text stringlengths 4 6.14k |
|---|
/*
* This file Copyright (C) Mnemosyne LLC
*
* This file is licensed by the GPL version 2. Works owned by the
* Transmission project are granted a special exemption to clause 2 (b)
* so that the bulk of its code can remain under the MIT license.
* This exemption does not extend to derived works not owned by
* the Transmission project.
*
* $Id$
*/
#ifndef __TRANSMISSION__
#error only libtransmission should #include this header.
#endif
#ifndef TR_PLATFORM_H
#define TR_PLATFORM_H
#define TR_PATH_DELIMITER '/'
#define TR_PATH_DELIMITER_STR "/"
/**
* @addtogroup tr_session Session
* @{
*/
/**
* @brief invoked by tr_sessionInit () to set up the locations of the resume, torrent, and clutch directories.
* @see tr_getResumeDir ()
* @see tr_getTorrentDir ()
* @see tr_getWebClientDir ()
*/
void tr_setConfigDir (tr_session * session, const char * configDir);
/** @brief return the directory where .resume files are stored */
const char * tr_getResumeDir (const tr_session *);
/** @brief return the directory where .torrent files are stored */
const char * tr_getTorrentDir (const tr_session *);
/** @brief return the directory where the Web Client's web ui files are kept */
const char * tr_getWebClientDir (const tr_session *);
/** @brief return the number of bytes available for use in the specified path, or -1 on error */
int64_t tr_getFreeSpace (const char * path);
/** @} */
/**
* @addtogroup utils Utilities
* @{
*/
typedef struct tr_thread tr_thread;
/** @brief Instantiate a new process thread */
tr_thread* tr_threadNew (void (*func)(void *), void * arg);
/** @brief Return nonzero if this function is being called from `thread'
@param thread the thread being tested */
bool tr_amInThread (const tr_thread *);
/***
****
***/
typedef struct tr_lock tr_lock;
/** @brief Create a new thread mutex object */
tr_lock * tr_lockNew (void);
/** @brief Destroy a thread mutex object */
void tr_lockFree (tr_lock *);
/** @brief Attempt to lock a thread mutex object */
void tr_lockLock (tr_lock *);
/** @brief Unlock a thread mutex object */
void tr_lockUnlock (tr_lock *);
/** @brief return nonzero if the specified lock is locked */
int tr_lockHave (const tr_lock *);
#ifdef WIN32
void * mmap (void *ptr, long size, long prot, long type, long handle, long arg);
long munmap (void *ptr, long size);
#endif
/* @} */
#endif
|
#ifndef INVERSE_H
#define INVERSE_H
// GLOBAL VARIABLES
extern void (*computeS0andJ0_ptr)(const Vector &, int, double, Vector &, double &);
extern void (*computeSandJ_ptr)(const Vector &, int, double, double, double, Vector &, double &);
extern void (*regularizeS_ptr)(const Vector &, double &, Vector &, Vector &, const Vector &, double, double);
extern void (*regularizeS_gradOnly_ptr)(const Vector &, double &, Vector &, const Vector &, double, double);
// Partition function
double getZ(int, const Vector &, std::vector<int> &, std::vector<int> &, Vector &, Vector &, int, double);
double getZ_gradOnly(int, const Vector &, std::vector<int> &, std::vector<int> &, Vector &, int, double);
void optimizeS(const Vector &, const Vector &, double &, Vector &, Vector &, const Vector &);
void optimizeS_gradOnly(const Vector &, const Vector &, double &, Vector &, const Vector &);
// Auxiliary functions
void computeS0andJ0_Empty(const Vector &, int, double, Vector &, double &);
void initialize(const Vector &, int, Vector &, Vector &, int &);
bool useDescent(const Vector &);
void computeDescentStep(const Vector &, int, Vector &);
void computeNewtonStep(const Vector &, Vector &, std::vector<double> &, int, int, Vector &);
//double lineSearch_simple(const Vector &, const Vector &, Vector &, double, const Vector &, Vector &, Vector &, Vector &, double);
double lineSearch_simple(const Vector &, const Vector &, Vector &, double, double, const Vector &, Vector &, Vector &, Vector &, double, bool, double);
double lineSearch_interp(const Vector &, const Vector &, Vector &, double, double, const Vector &, Vector &, Vector &, Vector &, double);
void makeStep(Vector &, const Vector &, const Vector &, double, double, double, Vector &, Vector &, double &);
// Main functions
void computeS0andJ0_L2(const Vector &, int, double, Vector &, double &);
void computeS0andJ0_L2_binary(const Vector &, int, double, Vector &, double &);
void computeSandJ_L2(const Vector &, int, double, double, double, Vector &, double &);
void regularizeS_L2(const Vector &, double &, Vector &, Vector &, const Vector &, double, double);
void regularizeS_L2_gradOnly(const Vector &, double &, Vector &, const Vector &, double, double);
void regularizeS_L2_GI(const Vector &, double &, Vector &, Vector &, const Vector &, double, double);
void regularizeS_L2_gradOnly_GI(const Vector &, double &, Vector &, const Vector &, double, double);
#endif
|
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <H5Cpp.h>
#include <cxxtest/TestSuite.h>
#include "../src/misc.h"
#include "../src/Prediction.h"
#include "../src/Performance.h"
#include "../src/PerformanceMeasure.h"
#define DELTA 0.00000000001
namespace PerfM = PerformanceMeasure;
using namespace H5;
class MeasureTest : public CxxTest::TestSuite
{
public:
void testAUC(void)
{
/*
library(ROCR)
data(ROCR.xval)
write.table(cbind(ROCR.xval$predictions[[1]], ROCR.xval$labels[[1]]), "rocr.xval.1cv.tsv", row.names=F, col.names=F, quote=F,sep="\t")
p <- prediction(ROCR.xval$predictions[[1]], ROCR.xval$labels[[1]])
perf <- performance(p, "auc")
perf@y.values
*/
ifstream in("data/rocr.xval.1cv.tsv");
TS_ASSERT(in && !in.bad());
vector<double> p;
vector<int> l;
for (string line; getline(in, line, '\n');) {
/* skip empty lines */
if(line.length() == 0)
continue;
vector<string> row = splitLine(line);
p.push_back(convertToDouble(row[0]));
l.push_back(convertToInt(row[1]));
}
Prediction pred(p, l);
pred.compute();
Performance<PerfM::None, PerfM::AUCROC> perf(pred);
perf.compute();
TS_ASSERT_DELTA(perf.y_values.front(), 0.95347010896, DELTA);
}
void testTPRFPR(void)
{
/*
library(ROCR)
data(ROCR.xval)
write.table(cbind(ROCR.xval$predictions[[1]], ROCR.xval$labels[[1]]), "rocr.xval.1cv.tsv", row.names=F, col.names=F, quote=F,sep="\t")
p <- prediction(ROCR.xval$predictions[[1]], ROCR.xval$labels[[1]])
perf <- performance(p, "tpr", "fpr")
write.table(cbind(perf@x.values[[1]], perf@y.values[[1]], perf@alpha.values[[1]]), "rocr.xval.1cv.ref.tsv", row.names=F, col.names=F, quote=F,sep="\t")
perf@y.values
*/
ifstream in("data/rocr.xval.1cv.tsv");
TS_ASSERT(in && !in.bad());
vector<double> p;
vector<int> l;
for (string line; getline(in, line, '\n');) {
/* skip empty lines */
if(line.length() == 0)
continue;
vector<string> row = splitLine(line);
p.push_back(convertToDouble(row[0]));
l.push_back(convertToInt(row[1]));
}
Prediction pred(p, l);
pred.compute();
Performance<PerfM::TPR, PerfM::FPR> perf(pred);
perf.compute();
ifstream in_ref("data/rocr.xval.1cv.ref.tsv");
TS_ASSERT(in_ref && !in_ref.bad());
vector<double> x_values;
vector<double> y_values;
vector<double> alpha_values;
for (string line; getline(in_ref, line, '\n');) {
/* skip empty lines */
if(line.length() == 0)
continue;
vector<string> row = splitLine(line);
x_values.push_back(convertToDouble(row[0]));
y_values.push_back(convertToDouble(row[1]));
alpha_values.push_back(convertToDouble(row[2]));
}
TS_ASSERT(x_values.size() == perf.x_values.size());
TS_ASSERT(y_values.size() == perf.y_values.size());
TS_ASSERT(alpha_values.size() == perf.alpha_values.size());
for(int i = 0; i< x_values.size(); i++) {
// ROCR has swapped axes
TS_ASSERT_DELTA(perf.y_values[i],x_values[i], DELTA);
TS_ASSERT_DELTA(perf.x_values[i],y_values[i], DELTA);
TS_ASSERT_DELTA(perf.alpha_values[i],alpha_values[i], DELTA);
}
}
void testH5(void)
{
/*
library(ROCR)
data(ROCR.xval)
write.table(cbind(ROCR.xval$predictions[[1]], ROCR.xval$labels[[1]]), "rocr.xval.1cv.tsv", row.names=F, col.names=F, quote=F,sep="\t")
p <- prediction(ROCR.xval$predictions[[1]], ROCR.xval$labels[[1]])
perf <- performance(p, "auc")
perf@y.values
*/
ifstream in("data/rocr.xval.1cv.tsv");
TS_ASSERT(in && !in.bad());
vector<double> p;
vector<int> l;
for (string line; getline(in, line, '\n');) {
/* skip empty lines */
if(line.length() == 0)
continue;
vector<string> row = splitLine(line);
p.push_back(convertToDouble(row[0]));
l.push_back(convertToInt(row[1]));
}
Prediction pred(p, l);
pred.compute();
Performance<PerfM::None, PerfM::AUCROC> perf(pred);
perf.compute();
H5File file( "/tmp/test.h5", H5F_ACC_TRUNC );
perf.H5Add(&file, "test");
}
};
|
#ifndef OBJECTS_POS_H_
#define OBJECTS_POS_H_
#include <string>
// TODO(simsa-st): Do a class from this, that is itterable
// (for (auto dir : dirs)) and provides functions such as OppositeDir(),
// Letter() ('U'), Word() ('UP'), sf::Keyboard::Up, etc.
namespace direction {
extern int shift[4][2];
extern char letter[4];
}
class Pos {
public:
Pos() : Pos(0, 0) {}
Pos(int x, int y) : x_(x), y_(y) {}
Pos move(int dir) {
return Pos(x_ + direction::shift[dir][0], y_ + direction::shift[dir][1]);
}
int x() const { return x_; }
int y() const { return y_; }
std::string Print() const;
bool operator==(const Pos& other) const {
return x_ == other.x_ && y_ == other.y_;
}
bool operator!=(const Pos& other) const { return !(*this == other); }
protected:
int x_;
int y_;
};
#endif // OBJECTS_POS_H_
|
#ifndef GUIUTIL_H
#define GUIUTIL_H
#include <QString>
#include <QObject>
#include <QMessageBox>
QT_BEGIN_NAMESPACE
class QFont;
class QLineEdit;
class QWidget;
class QDateTime;
class QUrl;
class QAbstractItemView;
QT_END_NAMESPACE
class SendCoinsRecipient;
/** Utility functions used by the CannaCoin-qt UI.
*/
namespace GUIUtil
{
// Create human-readable string from date
QString dateTimeStr(const QDateTime &datetime);
QString dateTimeStr(qint64 nTime);
// Render addresses in monospace font
QFont bitcoinAddressFont();
// Set up widgets for address and amounts
void setupAddressWidget(QLineEdit *widget, QWidget *parent);
void setupAmountWidget(QLineEdit *widget, QWidget *parent);
// Parse "CannaCoin:" URI into recipient object, return true on succesful parsing
// See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);
// HTML escaping for rich text controls
QString HtmlEscape(const QString& str, bool fMultiLine=false);
QString HtmlEscape(const std::string& str, bool fMultiLine=false);
/** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing
is selected.
@param[in] column Data column to extract from the model
@param[in] role Data role to extract from the model
@see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress
*/
void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole);
/** Get save file name, mimics QFileDialog::getSaveFileName, except that it appends a default suffix
when no suffix is provided by the user.
@param[in] parent Parent window (or 0)
@param[in] caption Window caption (or empty, for default)
@param[in] dir Starting directory (or empty, to default to documents directory)
@param[in] filter Filter specification such as "Comma Separated Files (*.csv)"
@param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0).
Can be useful when choosing the save file format based on suffix.
*/
QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(),
const QString &dir=QString(), const QString &filter=QString(),
QString *selectedSuffixOut=0);
/** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking.
@returns If called from the GUI thread, return a Qt::DirectConnection.
If called from another thread, return a Qt::BlockingQueuedConnection.
*/
Qt::ConnectionType blockingGUIThreadConnection();
// Determine whether a widget is hidden behind other windows
bool isObscured(QWidget *w);
// Open debug.log
void openDebugLogfile();
/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
representation if needed. This assures that Qt can word-wrap long tooltip messages.
Tooltips longer than the provided size threshold (in characters) are wrapped.
*/
class ToolTipToRichTextFilter : public QObject
{
Q_OBJECT
public:
explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0);
protected:
bool eventFilter(QObject *obj, QEvent *evt);
private:
int size_threshold;
};
bool GetStartOnSystemStartup();
bool SetStartOnSystemStartup(bool fAutoStart);
/** Help message, shown with --help. */
class HelpMessageBox : public QMessageBox
{
Q_OBJECT
public:
HelpMessageBox(QWidget *parent = 0);
/** Show message box or print help message to standard output, based on operating system. */
void showOrPrint();
/** Print help message to console */
void printToConsole();
private:
QString header;
QString coreOptions;
QString uiOptions;
};
} // namespace GUIUtil
#endif // GUIUTIL_H
|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_ECABVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_ECABVersionString[];
|
//
// BugshotConsoleLogger.h
// BugshotLumberjack
//
// Created by LiuYang on 16/9/30.
// Copyright © 2016年 same. All rights reserved.
//
#import <CocoaLumberjack/CocoaLumberjack.h>
@interface BugshotConsoleLogger : DDAbstractLogger
/// Set the maximum number of messages to be displayed on the Dashboard. Default `1000`.
@property (nonatomic) NSUInteger maxMessages;
/// An optional formatter to be used for shortened log messages.
@property (atomic, strong) id<DDLogFormatter> shortLogFormatter;
- (NSArray *)currentLogMessages;
- (void)clearConsole;
- (void)addMarker;
- (NSString *)textWithLogMessage:(DDLogMessage *)logMessage;
@end
|
//
// UIView+YCYBlockGesture.h
//
// Created by ycy on 14/12/30.
// Copyright (c) 2014年 NULLS. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^YCYGestureActionBlock)(UIGestureRecognizer *gestureRecoginzer);
@interface UIView (YCYBlockGesture)
/**
* @brief 添加tap手势
*
* @param block 代码块
*/
- (void)ycy_addTapActionWithBlock:(YCYGestureActionBlock)block;
/**
* @brief 添加长按手势
*
* @param block 代码块
*/
- (void)ycy_addLongPressActionWithBlock:(YCYGestureActionBlock)block;
@end
|
#define LUA_LIB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <lua.h>
#include <lauxlib.h>
static unsigned int num_escape_sql_str(unsigned char *dst, unsigned char *src, size_t size)
{
unsigned int n =0;
while (size) {
/* the highest bit of all the UTF-8 chars
* is always 1 */
if ((*src & 0x80) == 0) {
switch (*src) {
case '\0':
case '\b':
case '\n':
case '\r':
case '\t':
case 26: /* \Z */
case '\\':
case '\'':
case '"':
n++;
break;
default:
break;
}
}
src++;
size--;
}
return n;
}
static unsigned char*
escape_sql_str(unsigned char *dst, unsigned char *src, size_t size)
{
while (size) {
if ((*src & 0x80) == 0) {
switch (*src) {
case '\0':
*dst++ = '\\';
*dst++ = '0';
break;
case '\b':
*dst++ = '\\';
*dst++ = 'b';
break;
case '\n':
*dst++ = '\\';
*dst++ = 'n';
break;
case '\r':
*dst++ = '\\';
*dst++ = 'r';
break;
case '\t':
*dst++ = '\\';
*dst++ = 't';
break;
case 26:
*dst++ = '\\';
*dst++ = 'Z';
break;
case '\\':
*dst++ = '\\';
*dst++ = '\\';
break;
case '\'':
*dst++ = '\\';
*dst++ = '\'';
break;
case '"':
*dst++ = '\\';
*dst++ = '"';
break;
default:
*dst++ = *src;
break;
}
} else {
*dst++ = *src;
}
src++;
size--;
} /* while (size) */
return dst;
}
static int
quote_sql_str(lua_State *L)
{
size_t len, dlen, escape;
unsigned char *p;
unsigned char *src, *dst;
if (lua_gettop(L) != 1) {
return luaL_error(L, "expecting one argument");
}
src = (unsigned char *) luaL_checklstring(L, 1, &len);
if (len == 0) {
dst = (unsigned char *) "''";
dlen = sizeof("''") - 1;
lua_pushlstring(L, (char *) dst, dlen);
return 1;
}
escape = num_escape_sql_str(NULL, src, len);
dlen = sizeof("''") - 1 + len + escape;
p = lua_newuserdata(L, dlen);
dst = p;
*p++ = '\'';
if (escape == 0) {
memcpy(p, src, len);
p+=len;
} else {
p = (unsigned char *) escape_sql_str(p, src, len);
}
*p++ = '\'';
if (p != dst + dlen) {
return luaL_error(L, "quote sql string error");
}
lua_pushlstring(L, (char *) dst, p - dst);
return 1;
}
static struct luaL_Reg mysqlauxlib[] = {
{"quote_sql_str",quote_sql_str},
{NULL, NULL}
};
LUAMOD_API int luaopen_mysqlaux_c_ (lua_State *L) {
lua_newtable(L);
luaL_setfuncs(L, mysqlauxlib, 0);
return 1;
}
LUAMOD_API int luaopen_mysqlaux_c(lua_State *L) {
luaL_requiref(L, "mysqlaux.c", luaopen_mysqlaux_c_, 1);
lua_pop(L, 1); /* remove lib */
return 1;
}
|
#ifndef PLAYER_H
#define PLAYER_H
#include "coord.h"
#include "gameboard.h"
class Player
{
protected:
GameBoard *gb;
int colour;
public:
bool wouldPutInCheck(Coord, Coord, bool a = false, bool isKing = true);
Player(GameBoard*, int);
bool isMyPiece(Pieces*);
virtual void makeMove()=0;
};
#endif //PLAYER_H
|
#pragma once
#include <luxa/platform.h>
#include <luxa/memory/allocator.h>
#include <luxa/collections/array.h>
#include <vulkan/vulkan.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct lx_gpu {
lx_allocator_t *allocator;
VkPhysicalDevice handle;
VkPhysicalDeviceProperties properties;
VkPhysicalDeviceFeatures features;
VkPhysicalDeviceMemoryProperties memory_properties;
uint32_t compute_queue_family_index;
uint32_t graphics_queue_family_index;
uint32_t presentation_queue_family_index;
lx_array_t *queue_family_properties; // VkQueueFamilyProperties
} lx_gpu_t;
typedef struct lx_shader {
VkShaderModule handle;
uint32_t id;
VkShaderStageFlags stage;
} lx_shader_t;
typedef struct lx_gpu_device {
lx_gpu_t *gpu;
lx_array_t *shaders;
VkDevice handle;
VkQueue graphics_queue;
VkQueue compute_queue;
VkQueue presentation_queue;
} lx_gpu_device_t;
typedef struct lx_gpu_buffer {
VkBuffer handle;
VkDeviceMemory memory;
VkDeviceSize size;
VkDeviceSize offset;
void *data;
} lx_gpu_buffer_t;
typedef struct lx_gpu_image {
VkImage handle;
VkDeviceMemory memory;
VkDeviceSize offset;
VkFormat format;
} lx_gpu_image_t;
lx_result_t lx_gpu_all_available(lx_allocator_t *allocator, VkInstance instance, VkSurfaceKHR presentation_surface, lx_array_t **gpus);
lx_result_t lx_gpu_create_device(lx_gpu_t *gpu, const char *extensions[], size_t num_extensions, const char *validation_layers[], size_t num_validation_layers, lx_gpu_device_t **device);
void lx_gpu_destroy_device(lx_gpu_device_t *device);
void lx_gpu_destroy(lx_gpu_t *gpu);
lx_result_t lx_gpu_create_semaphore(lx_gpu_device_t *device, VkSemaphore *semaphore);
void lx_gpu_destroy_semaphore(lx_gpu_device_t *device, VkSemaphore semaphore);
lx_gpu_buffer_t *lx_gpu_create_buffer(lx_gpu_device_t *device, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags memory_properties);
void lx_gpu_destroy_buffer(lx_gpu_device_t *device, lx_gpu_buffer_t *buffer);
bool lx_gpu_map_memory(lx_gpu_device_t *device, lx_gpu_buffer_t *buffer);
void lx_gpu_unmap_memory(lx_gpu_device_t *device, lx_gpu_buffer_t *buffer);
void lx_gpu_buffer_copy_data(lx_gpu_device_t *device, lx_gpu_buffer_t *buffer, const void *data);
lx_result_t lx_gpu_copy_buffer(lx_gpu_device_t *device, lx_gpu_buffer_t *dst, lx_gpu_buffer_t *src, VkCommandPool command_pool);
lx_result_t lx_gpu_create_shader(lx_gpu_device_t *device, const char *code, size_t code_size, uint32_t id, VkShaderStageFlags stage);
lx_result_t lx_gpu_destroy_shader(lx_gpu_device_t *device, uint32_t id);
lx_shader_t *lx_gpu_shader(lx_gpu_device_t *device, uint32_t id);
lx_gpu_image_t *lx_gpu_create_image(lx_gpu_device_t *device, VkExtent2D size, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties);
void lx_gpu_destroy_image(lx_gpu_device_t *device, lx_gpu_image_t *image);
#ifdef __cplusplus
}
#endif
|
//
// MainSplitView.h
// AutoLayoutTest
//
// Created by Bill So on 11/4/14.
// Copyright (c) 2014 Bill So. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface MainSplitView : NSSplitView
@end
|
//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2015-2017 Francois Beaune, The appleseedhq Organization
//
// 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 APPLESEED_RENDERER_MODELING_BSSRDF_GAUSSIANBSSRDF_H
#define APPLESEED_RENDERER_MODELING_BSSRDF_GAUSSIANBSSRDF_H
// appleseed.renderer headers.
#include "renderer/global/globaltypes.h"
#include "renderer/modeling/bssrdf/bssrdf.h"
#include "renderer/modeling/bssrdf/ibssrdffactory.h"
#include "renderer/modeling/bssrdf/separablebssrdf.h"
#include "renderer/modeling/input/inputarray.h"
// appleseed.foundation headers.
#include "foundation/platform/compiler.h"
// appleseed.main headers.
#include "main/dllsymbol.h"
// Forward declarations.
namespace foundation { class Dictionary; }
namespace foundation { class DictionaryArray; }
namespace renderer { class ParamArray; }
namespace renderer
{
//
// Gaussian BSSRDF input values.
//
APPLESEED_DECLARE_INPUT_VALUES(GaussianBSSRDFInputValues)
{
float m_weight;
Spectrum m_reflectance;
float m_reflectance_multiplier;
Spectrum m_mfp;
float m_mfp_multiplier;
float m_ior;
float m_fresnel_weight;
struct Precomputed
{
Spectrum m_k;
Spectrum m_channel_pdf;
};
Precomputed m_precomputed;
SeparableBSSRDF::InputValues m_base_values;
};
//
// Gaussian BSSRDF factory.
//
class APPLESEED_DLLSYMBOL GaussianBSSRDFFactory
: public IBSSRDFFactory
{
public:
// Return a string identifying this BSSRDF model.
virtual const char* get_model() const override;
// Return metadata for this BSSRDF model.
virtual foundation::Dictionary get_model_metadata() const override;
// Return metadata for the inputs of this BSSRDF model.
virtual foundation::DictionaryArray get_input_metadata() const override;
// Create a new BSSRDF instance.
virtual foundation::auto_release_ptr<BSSRDF> create(
const char* name,
const ParamArray& params) const override;
// Static variant of the create() method above.
static foundation::auto_release_ptr<BSSRDF> static_create(
const char* name,
const ParamArray& params);
};
} // namespace renderer
#endif // !APPLESEED_RENDERER_MODELING_BSSRDF_GAUSSIANBSSRDF_H
|
//
// BEMLine.h
// SimpleLineGraph
//
// Created by Bobo on 12/27/13. Updated by Sam Spencer on 1/11/14.
// Copyright (c) 2013 Boris Emorine. All rights reserved.
// Copyright (c) 2014 Sam Spencer.
//
#if __has_feature(objc_modules)
// We recommend enabling Objective-C Modules in your project Build Settings for numerous benefits over regular #imports
@import Foundation;
@import UIKit;
@import CoreGraphics;
#else
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
#endif
/// The type of animation used to display the graph
typedef NS_ENUM(NSInteger, BEMLineAnimation) {
/// The draw animation draws the lines from left to right and bottom to top.
BEMLineAnimationDraw,
/// The fade animation fades in the lines from 0% opaque to 100% opaque (based on the \p lineAlpha property).
BEMLineAnimationFade,
/// No animation is used to display the graph
BEMLineAnimationNone
};
/// Class to draw the line of the graph
@interface BEMLine : UIView
//----- POINTS -----//
/// The previous point. Necessary for Bezier curve
@property (assign, nonatomic) CGPoint P0;
/// The starting point of the line
@property (assign, nonatomic) CGPoint P1;
/// The ending point of the line
@property (assign, nonatomic) CGPoint P2;
/// The next point. Necessary for Bezier curve
@property (assign, nonatomic) CGPoint P3;
/// All of the Y-axis values for the points
@property (nonatomic) NSArray *arrayOfPoints;
/// All of the X-Axis coordinates used to draw vertical lines through
@property (nonatomic) NSArray *arrayOfVerticalRefrenceLinePoints;
/// All of the Y-Axis coordinates used to draw horizontal lines through
@property (nonatomic) NSArray *arrayOfHorizontalRefrenceLinePoints;
/// All of the point values
@property (nonatomic) NSArray *arrayOfValues;
/** Draw thin, translucent, reference lines using the provided X-Axis and Y-Axis coordinates.
@see Use \p arrayOfVerticalRefrenceLinePoints to specify vertical reference lines' positions. Use \p arrayOfHorizontalRefrenceLinePoints to specify horizontal reference lines' positions. */
@property (nonatomic) BOOL enableRefrenceLines;
/** Draw a thin, translucent, frame on the edge of the graph to separate it from the labels on the X-Axis and the Y-Axis. */
@property (nonatomic) BOOL enableRefrenceFrame;
//----- COLORS -----//
/// The line color. A single, solid color which is applied to the entire line. If the \p gradient property is non-nil this property will be ignored.
@property (strong, nonatomic) UIColor *color;
/// The color of the area above the line, inside of its superview
@property (strong, nonatomic) UIColor *topColor;
/// A color gradient applied to the area above the line, inside of its superview. If set, it will be drawn on top of the fill from the \p topColor property.
@property (assign, nonatomic) CGGradientRef topGradient;
/// The color of the area below the line, inside of its superview
@property (strong, nonatomic) UIColor *bottomColor;
/// A color gradient applied to the area below the line, inside of its superview. If set, it will be drawn on top of the fill from the \p bottomColor property.
@property (assign, nonatomic) CGGradientRef bottomGradient;
@property (strong, nonatomic) UIColor *xAxisBackgroundColor;
@property (nonatomic) CGFloat xAxisBackgroundAlpha;
/** A color gradient to be applied to the line. If this property is set, it will mask (override) the \p color property.
@todo This property is non-functional at this point in time. It only serves as a marker for further implementation. */
@property (assign, nonatomic) CGGradientRef lineGradient;
/// The reference line color. Defaults to `color`.
@property (strong, nonatomic) UIColor *refrenceLineColor;
//----- ALPHA -----//
/// The line alpha
@property (nonatomic) float lineAlpha;
/// The alpha value of the area above the line, inside of its superview
@property (nonatomic) float topAlpha;
/// The alpha value of the area below the line, inside of its superview
@property (nonatomic) float bottomAlpha;
//----- SIZE -----//
/// The width of the line
@property (nonatomic) float lineWidth;
//----- BEZIER CURVE -----//
/// The line is drawn with smooth curves rather than straight lines when set to YES.
@property (nonatomic) BOOL bezierCurveIsEnabled;
//----- ANIMATION -----//
/// The entrance animation period in seconds.
@property (nonatomic) CGFloat animationTime;
/// The type of entrance animation.
@property (nonatomic) BEMLineAnimation animationType;
//----- FRAME -----//
/// The offset dependant on the size of the labels to create the frame
@property (nonatomic) CGFloat frameOffset;
@end
|
#ifndef BITCOINUNITS_H
#define BITCOINUNITS_H
#include <QString>
#include <QAbstractListModel>
/** Bitcoin unit definitions. Encapsulates parsing and formatting
and serves as list model for drop-down selection boxes.
*/
class BitcoinUnits: public QAbstractListModel
{
Q_OBJECT
public:
explicit BitcoinUnits(QObject *parent);
/** Bitcoin units.
@note Source: https://en.bitcoin.it/wiki/Units . Please add only sensible ones
*/
enum Unit
{
WIKI,
cWIKI,
mWIKI
};
//! @name Static API
//! Unit conversion and formatting
///@{
//! Get list of units, for drop-down box
static QList<Unit> availableUnits();
//! Is unit ID valid?
static bool valid(int unit);
//! Short name
static QString name(int unit);
//! Longer description
static QString description(int unit);
//! Number of Satoshis (1e-8) per unit
static qint64 factor(int unit);
//! Number of amount digits (to represent max number of coins)
static int amountDigits(int unit);
//! Number of decimals left
static int decimals(int unit);
//! Format as string
static QString format(int unit, qint64 amount, bool plussign=false);
//! Format as string (with unit)
static QString formatWithUnit(int unit, qint64 amount, bool plussign=false);
//! Parse string to coin amount
static bool parse(int unit, const QString &value, qint64 *val_out);
///@}
//! @name AbstractListModel implementation
//! List model for unit drop-down selection box.
///@{
enum RoleIndex {
/** Unit identifier */
UnitRole = Qt::UserRole
};
int rowCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
///@}
private:
QList<BitcoinUnits::Unit> unitlist;
};
typedef BitcoinUnits::Unit BitcoinUnit;
#endif // BITCOINUNITS_H
|
//
// Model.h
// UIView
//
// Created by bmob-LT on 16/6/16.
// Copyright © 2016年 bmob-LT. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Model : NSObject
@property (copy,nonatomic) NSString *icon;
@property (copy,nonatomic) NSString *name;
@end
|
//
// TestTableController2.h
// iBXTest
//
// Created by Balalaev Sergey on 11/6/13.
// Copyright (c) 2013 ByteriX. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TestTableController2 : UITableViewController
@end
|
#pragma once
#include <reflectionzeug/NumberProperty.h>
#include <reflectionzeug/SignedIntegralPropertyInterface.h>
namespace reflectionzeug
{
/**
* \brief Provides the property implementation for signed integral types.
*
* Extends the NumberProperty by implementing necessary methods for uniform access
* of all signed integral types.
*
* \ingroup property_hierarchy
*/
template <typename Type>
class SignedIntegralProperty : public NumberProperty<Type, SignedIntegralPropertyInterface>
{
public:
virtual ~SignedIntegralProperty() = 0;
virtual void accept(AbstractPropertyVisitor * visitor);
virtual long long toLongLong() const;
virtual bool fromLongLong(long long integral);
protected:
virtual std::string matchRegex() const;
};
} // namespace reflectionzeug
#include <reflectionzeug/SignedIntegralProperty.hpp>
|
//
// YYMeFooter.h
// 01-百思不得姐
//
// Created by Apple on 15/10/11.
// Copyright © 2015年 xiaomage. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface YYMeFooter : UIView
@end
|
// Copyright (c) 2011-2016 The Flericoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <chrono>
#include <vector>
#include <System/ContextGroup.h>
#include <System/Dispatcher.h>
#include <System/Event.h>
#include <System/TcpConnection.h>
#include <System/Timer.h>
#include "CryptoNoteConfig.h"
#include "LevinProtocol.h"
#include "P2pInterfaces.h"
#include "P2pProtocolDefinitions.h"
#include "P2pProtocolTypes.h"
namespace CryptoNote {
class P2pContext {
public:
using Clock = std::chrono::steady_clock;
using TimePoint = Clock::time_point;
struct Message : P2pMessage {
enum Type {
NOTIFY,
REQUEST,
REPLY
};
Type messageType;
uint32_t returnCode;
Message(P2pMessage&& msg, Type messageType, uint32_t returnCode = 0);
size_t size() const;
};
P2pContext(System::Dispatcher& dispatcher, System::TcpConnection&& conn,
bool isIncoming, const NetworkAddress& remoteAddress, std::chrono::nanoseconds timedSyncInterval, const CORE_SYNC_DATA& timedSyncData);
~P2pContext();
PeerIdType getPeerId() const;
uint16_t getPeerPort() const;
const NetworkAddress& getRemoteAddress() const;
bool isIncoming() const;
void setPeerInfo(uint8_t protocolVersion, PeerIdType id, uint16_t port);
bool readCommand(LevinProtocol::Command& cmd);
void writeMessage(const Message& msg);
void start();
void stop();
private:
uint8_t version = 0;
const bool incoming;
const NetworkAddress remoteAddress;
PeerIdType peerId = 0;
uint16_t peerPort = 0;
System::Dispatcher& dispatcher;
System::ContextGroup contextGroup;
const TimePoint timeStarted;
bool stopped = false;
TimePoint lastReadTime;
// timed sync info
const std::chrono::nanoseconds timedSyncInterval;
const CORE_SYNC_DATA& timedSyncData;
System::Timer timedSyncTimer;
System::Event timedSyncFinished;
System::TcpConnection connection;
System::Event writeEvent;
System::Event readEvent;
void timedSyncLoop();
};
P2pContext::Message makeReply(uint32_t command, const BinaryArray& data, uint32_t returnCode);
P2pContext::Message makeRequest(uint32_t command, const BinaryArray& data);
std::ostream& operator <<(std::ostream& s, const P2pContext& conn);
}
|
/*! @file rdf_statement.c
*
* Implements the RDF 'statement' interfaces declared in `rdf.h`.
*
* @author Tomas Michalek <tomas.michalek.st@vsb.cz>
* @date 2016
*/
#include <ardp/rdf.h>
/* rdf_statement_create() {{{ */
struct rdf_statement* rdf_statement_create(void)
{
struct rdf_statement* statement = calloc (1, sizeof(*statement) );
return (statement) ? statement : NULL; //pretty shure that now its pointless constuct, but it will not hurt.
} /* }}} */
/* rdf_statement_from_nodes(s,p,o,g) {{{ */
struct rdf_statement* rdf_statement_from_nodes( struct rdf_term* subject,
struct rdf_term* predicate,
struct rdf_term* object,
struct rdf_term* graph )
{
struct rdf_statement* statement = rdf_statement_create();
if ( statement == NULL ) {
//rdf_term_free does NULL check
rdf_term_free(subject);
rdf_term_free(predicate);
rdf_term_free(object);
rdf_term_free(graph);
return NULL;
}
statement->subject = subject;
statement->predicate = predicate;
statement->object = object;
statement->graph = graph;
return statement;
} /*}}}*/
/* rdf_statement_copy(statement) {{{ */
struct rdf_statement* rdf_statement_copy(struct rdf_statement* s)
{
if(!s) // Preflight sanity check
return NULL;
struct rdf_statement* s2 = rdf_statement_create();
if(!s2)
return NULL;
// (void)0 should work as ASM NO-OP ... let's test it.
(!s->subject) ? (void)0 : rdf_term_copy(s->subject);
(!s->predicate) ? (void)0 : rdf_term_copy(s->predicate);
(!s->object) ? (void)0 : rdf_term_copy(s->object);
(!s->graph) ? (void)0 : rdf_term_copy(s->graph);
return s2;
} /*}}}*/
/* rdf_statement_zero(statement) {{{ */
void rdf_statement_zero(struct rdf_statement* s)
{
assert(s); // sanity check if we even have something.
memset(s, 0, sizeof(*s));
} /* }}} */
/* rdf_statement_clear(statement) {{{ */
void rdf_statement_clear(struct rdf_statement* s)
{
if (!s)
return;
// rdf_term_free does NULL check
rdf_term_free(s->subject); s->subject = NULL;
rdf_term_free(s->predicate); s->predicate = NULL;
rdf_term_free(s->object); s->object = NULL;
rdf_term_free(s->graph); s->graph = NULL;
} /*}}}*/
/* rdf_statement_free(statement) {{{ */
void rdf_statement_free(struct rdf_statement* s)
{
if(!s)
return;
rdf_statement_clear(s);
free(s);
} /*}}}*/
/* rdf_statement_compare(a,b) {{{ */
int rdf_statement_compare(struct rdf_statement* a, struct rdf_statement* b)
{
int ret = 0;
if ( !a || !b ) {
ptrdiff_t pd = (b - a); // if either are NULL, return dff order.
return (pd > 0) - (pd < 0); // return 'sign'
}
ret = rdf_term_compare(a->subject,b->subject);
if(ret)
goto exit;
ret = rdf_term_compare(a->predicate,b->predicate);
if (ret)
goto exit;
ret = rdf_term_compare(a->object, b->object);
if (ret)
goto exit;
ret = rdf_term_compare(a->graph, b->graph);
exit:
return ret;
} /*}}}*/
/* rdf_statement_equals(a,b) {{{ */
int rdf_statement_equals(struct rdf_statement* a, struct rdf_statement* b)
{
if ( !a || !b )
return 0;
if(!rdf_term_equals(a->subject, b->subject))
return 0;
if (!rdf_term_equals(a->predicate, b->predicate))
return 0;
if (!rdf_term_equals(a->object, b->object))
return 0;
if (!rdf_term_equals(a->graph, b->graph))
return 0;
return 1;
} /*}}}*/
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "_TNDRMomentLike.h"
@interface TNDRMomentLike : _TNDRMomentLike
{
}
@end
|
//
// GSWBaseViewController.h
// GuShiWen
//
// Created by byn on 16/4/11.
// Copyright © 2016年 byn. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GSWBaseViewController : UIViewController
@end
|
#pragma once
#include <HAL/MotorCtrl/Interfaces/IMotorCtrlVisitors.h>
namespace Motor {
struct RunVelocity : MotorCtrlVisitorBase<RunVelocity,void> {
const double velocity;
RunVelocity(double velocity) : velocity(velocity) {}
};
}
template <> struct
visit<CanOpenDS402MotorCtrl,Motor::RunVelocity> {
static int call(CanOpenDS402MotorCtrl& mctrl, Motor::RunVelocity& visitor) {
std::cout << "CanOpenDS402MotorCtrl: RunVelocity("<<visitor.velocity<<")"<<std::endl;
mctrl.writeDict(0x6041,0);
return 0;
}
};
template <> struct
visit<ElmoWhistleMotorCtrl,Motor::RunVelocity> {
static int call(ElmoWhistleMotorCtrl& mctrl, Motor::RunVelocity& visitor) {
std::cout << "ElmoWhistleMotorCtrl: RunVelocity("<<visitor.velocity<<")"<<std::endl;
return 0;
}
};
|
/**
* Quick Sort
*
* * Pick an element of the array (eg a[0]). Called pivot element
* * Partition the array as <x | x | >=x
* * Recursively sort partition
*
* Time Complexity:
* * Depth: O(log n)
* * Width: O(n)
* * Total: O(n*log(n))
*
* Worst case: x is the largest element every time (sorted in reverse) | O(n^2)
*
* For better performance:
* * Preferably pick a random value as pivot (median of a sample) and swap it to position 0
*/
#include <stdlib.h>
/*
2, -10, 14, 42, 11, -7, 0, 38 | pivot 2 before loop
2, -10, 14, 42, 11, -7, 0, 38 | m 1 temp -10
*/
/**
* Quick Sort
*
* i sweeps through
* m is the pivot element
* pivot We take pivot as a[0]
*
* @param a Array to be sorted
* @param n Size
*/
void sort(int a[], int n) {
if (n <= 1 || a == (int *)0)
return;
int i, m = 0, temp;
int pivot = 0;
for (i = 1; i < n; i++) {
if (a[i] < a[pivot]) { // Swap with next element
m++;
temp = a[m];
a[m] = a[i];
a[i] = temp;
}
}
temp = a[m];
a[m] = a[pivot];
a[pivot] = temp;
sort(a, m);
sort(a + (m+1), n - (m+1));
}
|
//
// 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 IBBinaryArchiver, NSString;
@protocol IBBinaryArchivableColor <NSObject>
+ (id <IBBinaryArchivableColor>)blackColor;
+ (id <IBBinaryArchivableColor>)ibColorWithRed:(double)arg1 green:(double)arg2 blue:(double)arg3 alpha:(double)arg4;
+ (id <IBBinaryArchivableColor>)ibColorWithWhite:(double)arg1 alpha:(double)arg2;
- (NSString *)ibArchivedSystemKeyPathForBinaryArchiver:(IBBinaryArchiver *)arg1;
- (BOOL)ibGetRed:(double *)arg1 green:(double *)arg2 blue:(double *)arg3 alpha:(double *)arg4;
- (BOOL)ibGetWhite:(double *)arg1 alpha:(double *)arg2;
@end
|
// This libcanard config header is included from canard.c via CANARD_CONFIG_HEADER
// Expose the internal definitions for testing.
#define CANARD_PRIVATE
|
#define MICROPY_HW_BOARD_NAME "STBee F4mini"
#define MICROPY_HW_MCU_NAME "STM32F405RG"
#define MICROPY_HW_HAS_SWITCH (1)
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_HAS_SDCARD (0)
#define MICROPY_HW_HAS_MMA7660 (0)
#define MICROPY_HW_HAS_LCD (0)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_TIMER (1)
#define MICROPY_HW_ENABLE_SERVO (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_USB (1)
// HSE is 12MHz
#define MICROPY_HW_CLK_PLLM (12)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
#define MICROPY_HW_CLK_LAST_FREQ (1)
// The pyboard has a 32kHz crystal for the RTC
#define MICROPY_HW_RTC_USE_LSE (1)
#define MICROPY_HW_RTC_USE_US (0)
#define MICROPY_HW_RTC_USE_CALOUT (1)
// UART config
#define MICROPY_HW_UART1_TX (pin_B6)
#define MICROPY_HW_UART1_RX (pin_B7)
#define MICROPY_HW_UART2_TX (pin_A2)
#define MICROPY_HW_UART2_RX (pin_A3)
#define MICROPY_HW_UART2_RTS (pin_A1)
// USRSW is connected pin_A0. if you push USRSW, UART2_CTS dosen't work
#define MICROPY_HW_UART2_CTS (pin_A0)
#define MICROPY_HW_UART3_TX (pin_B10)
#define MICROPY_HW_UART3_RX (pin_B11)
#define MICROPY_HW_UART3_RTS (pin_B14)
#define MICROPY_HW_UART3_CTS (pin_B13)
// USRSW is connected pin_A0. if you push USRSW, UART4_TX dosen't work
#define MICROPY_HW_UART4_TX (pin_A0)
#define MICROPY_HW_UART4_RX (pin_A1)
#define MICROPY_HW_UART6_TX (pin_C6)
#define MICROPY_HW_UART6_RX (pin_C7)
// I2C busses
#define MICROPY_HW_I2C1_SCL (pin_B6)
#define MICROPY_HW_I2C1_SDA (pin_B7)
#define MICROPY_HW_I2C2_SCL (pin_B10)
#define MICROPY_HW_I2C2_SDA (pin_B11)
// SPI busses
#define MICROPY_HW_SPI1_NSS (pin_A4)
#define MICROPY_HW_SPI1_SCK (pin_A5)
#define MICROPY_HW_SPI1_MISO (pin_A6)
#define MICROPY_HW_SPI1_MOSI (pin_A7)
#define MICROPY_HW_SPI2_NSS (pin_B12)
#define MICROPY_HW_SPI2_SCK (pin_B13)
#define MICROPY_HW_SPI2_MISO (pin_B14)
#define MICROPY_HW_SPI2_MOSI (pin_B15)
// CAN busses
#define MICROPY_HW_CAN1_TX (pin_B9)
#define MICROPY_HW_CAN1_RX (pin_B8)
#define MICROPY_HW_CAN2_TX (pin_B13)
#define MICROPY_HW_CAN2_RX (pin_B12)
// USRSW is pulled low. Pressing the button makes the input go high.
#define MICROPY_HW_USRSW_PIN (pin_A0)
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
#define MICROPY_HW_USRSW_PRESSED (1)
// The STBee F4mini has 1 LEDs
#define MICROPY_HW_LED1 (pin_D2) // red
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config
#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
|
/////////////////////////////////////////////////////////////////////////////
// Name: hid.h
// Purpose: DARWIN HID layer for WX
// Author: Ryan Norton
// Modified by:
// Created: 11/11/2003
// RCS-ID: $Id: hid.h,v 1.4.2.1 2005/12/19 10:55:47 JS Exp $
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ===========================================================================
// declarations
// ===========================================================================
// ---------------------------------------------------------------------------
// headers
// ---------------------------------------------------------------------------
#ifndef _WX_MACCARBONHID_H_
#define _WX_MACCARBONHID_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "hid.h"
#endif
#include "wx/defs.h"
#include "wx/string.h"
// ---------------------------------------------------------------------------
// definitions
// ---------------------------------------------------------------------------
//Mac OSX only
#ifdef __DARWIN__
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/hid/IOHIDLib.h>
#include <IOKit/hid/IOHIDKeys.h>
#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
//Darn apple - doesn't properly wrap their headers in extern "C"!
//http://www.macosx.com/forums/archive/index.php/t-68069.html
//Needed for codewarrior link error with mach_port_deallocate()
extern "C" {
#include <mach/mach_port.h>
}
#include <mach/mach.h> //this actually includes mach_port.h (see above)
//Utility wrapper around CFArray
class wxCFArray
{
public:
wxCFArray(CFTypeRef pData) : pArray((CFArrayRef) pData) {}
CFTypeRef operator [] (const int& nIndex) {return CFArrayGetValueAtIndex(pArray, nIndex); }
int Count() {return CFArrayGetCount(pArray);}
private:
CFArrayRef pArray;
};
//
// A wrapper around OS X HID Manager procedures.
// The tutorial "Working With HID Class Device Interfaces" Is
// Quite good, as is the sample program associated with it
// (Depite the author's protests!).
class wxHIDDevice
{
public:
wxHIDDevice() : m_ppDevice(NULL), m_ppQueue(NULL), m_pCookies(NULL) {}
//kHIDPage_GenericDesktop
//kHIDUsage_GD_Joystick,kHIDUsage_GD_Mouse,kHIDUsage_GD_Keyboard
bool Create (int nClass = -1, int nType = -1, int nDev = 1);
static int GetCount(int nClass = -1, int nType = -1);
void AddCookie(CFTypeRef Data, int i);
void AddCookieInQueue(CFTypeRef Data, int i);
void InitCookies(size_t dwSize, bool bQueue = false);
//Must be implemented by derived classes
//builds the cookie array -
//first call InitCookies to initialize the cookie
//array, then AddCookie to add a cookie at a certain point in an array
virtual void BuildCookies(wxCFArray& Array) = 0;
//checks to see whether the cookie at nIndex is active (element value != 0)
bool IsActive(int nIndex);
//checks to see whether the cookie at nIndex exists
bool HasElement(int nIndex);
//closes the device and cleans the queue and cookies
virtual ~wxHIDDevice();
protected:
IOHIDDeviceInterface** m_ppDevice; //this, essentially
IOHIDQueueInterface** m_ppQueue; //queue (if we want one)
IOHIDElementCookie* m_pCookies; //cookies
wxString m_szProductName; //product name
int m_nProductId; //product id
int m_nManufacturerId; //manufacturer id
mach_port_t m_pPort;
};
class wxHIDKeyboard : public wxHIDDevice
{
public:
bool Create();
virtual void BuildCookies(wxCFArray& Array);
};
#endif //__DARWIN__
#endif
//WX_MACCARBONHID_H |
//
// MenuController.h
// Pixr - 500px for Apple Watch
//
// Created by Umar Farooque on 20/08/15.
// Copyright © 2015 Umar Farooque. All rights reserved.
//
#import <WatchKit/WatchKit.h>
#import <Foundation/Foundation.h>
@interface MenuController : WKInterfaceController
@end
|
//
// JJChooseFriendsController.h
// Footprints
//
// Created by Jinjin on 14/12/1.
// Copyright (c) 2014年 JiaJun. All rights reserved.
//
#import "BaseViewController.h"
typedef void(^DidChooseMember)(ContactMemberModel *model,BOOL isChoose);
typedef void(^DidChooseComplete)(NSArray *members);
@interface JJChooseFriendsController : BaseViewController
@property (nonatomic,assign) BOOL isRecommend;
@property (nonatomic,assign) BOOL isAllFriends;
@property (nonatomic,strong) NSString *recommendMemberId;
@property (nonatomic,strong) DidChooseMember didChooseMember;
@property (nonatomic,strong) DidChooseComplete chooseComplete;
- (void)addDeletedUser:(id)user;
@end
|
//
// BNRColorViewController.h
// Colorboard
//
// Created by user on 15/8/2.
// Copyright (c) 2015年 Potter. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BNRColorDescription.h"
@interface BNRColorViewController : UIViewController
@property (nonatomic) BOOL existingColor;
@property (nonatomic) BNRColorDescription *colorDescription;
@end
|
#include "gb.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
static size_t map_find_symbol_index(GB_symbol_map_t *map, uint16_t addr)
{
if (!map->symbols) {
return 0;
}
ssize_t min = 0;
ssize_t max = map->n_symbols;
while (min < max) {
size_t pivot = (min + max) / 2;
if (map->symbols[pivot].addr == addr) return pivot;
if (map->symbols[pivot].addr > addr) {
max = pivot;
}
else {
min = pivot + 1;
}
}
return (size_t) min;
}
GB_bank_symbol_t *GB_map_add_symbol(GB_symbol_map_t *map, uint16_t addr, const char *name)
{
size_t index = map_find_symbol_index(map, addr);
map->symbols = realloc(map->symbols, (map->n_symbols + 1) * sizeof(map->symbols[0]));
memmove(&map->symbols[index + 1], &map->symbols[index], (map->n_symbols - index) * sizeof(map->symbols[0]));
map->symbols[index].addr = addr;
map->symbols[index].name = strdup(name);
map->n_symbols++;
return &map->symbols[index];
}
const GB_bank_symbol_t *GB_map_find_symbol(GB_symbol_map_t *map, uint16_t addr)
{
if (!map) return NULL;
size_t index = map_find_symbol_index(map, addr);
if (index >= map->n_symbols || map->symbols[index].addr != addr) {
index--;
}
if (index < map->n_symbols) {
return &map->symbols[index];
}
return NULL;
}
GB_symbol_map_t *GB_map_alloc(void)
{
GB_symbol_map_t *map = malloc(sizeof(*map));
memset(map, 0, sizeof(*map));
return map;
}
void GB_map_free(GB_symbol_map_t *map)
{
for (unsigned i = 0; i < map->n_symbols; i++) {
free(map->symbols[i].name);
}
if (map->symbols) {
free(map->symbols);
}
free(map);
}
static unsigned hash_name(const char *name)
{
unsigned r = 0;
while (*name) {
r <<= 1;
if (r & 0x400) {
r ^= 0x401;
}
r += (unsigned char)*(name++);
}
return r & 0x3FF;
}
void GB_reversed_map_add_symbol(GB_reversed_symbol_map_t *map, uint16_t bank, GB_bank_symbol_t *bank_symbol)
{
unsigned hash = hash_name(bank_symbol->name);
GB_symbol_t *symbol = malloc(sizeof(*symbol));
symbol->name = bank_symbol->name;
symbol->addr = bank_symbol->addr;
symbol->bank = bank;
symbol->next = map->buckets[hash];
map->buckets[hash] = symbol;
}
const GB_symbol_t *GB_reversed_map_find_symbol(GB_reversed_symbol_map_t *map, const char *name)
{
unsigned hash = hash_name(name);
GB_symbol_t *symbol = map->buckets[hash];
while (symbol) {
if (strcmp(symbol->name, name) == 0) return symbol;
symbol = symbol->next;
}
return NULL;
}
|
/**
* The MIT License (MIT)
*
* Copyright (c) 2015-2016 Andre Netzeband
*
* 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 IGUITexture.h
* @author Andre Netzeband
* @brief Contains an interface to a GUITexture object.
* @addtogroup IrrIMGUI
*/
#ifndef IRRIMGUI_INCLUDE_IRRIMGUI_IGUITEXTURE_H_
#define IRRIMGUI_INCLUDE_IRRIMGUI_IGUITEXTURE_H_
// library includes
#include "IncludeIMGUI.h"
/**
* @addtogroup IrrIMGUI
* @{
*/
namespace IrrIMGUI
{
class IGUITexture
{
public:
/// @brief Destructor.
virtual ~IGUITexture(void) {}
/// @brief Implicit cast operator to ImTextureID.
operator ImTextureID(void) { return getTextureID(); }
/// @return Returns the Texture ID.
virtual ImTextureID getTextureID(void) { return this; }
protected:
IGUITexture(void) {};
};
}
/**
* @}
*/
#endif // IRRIMGUI_INCLUDE_IRRIMGUI_IGUITEXTURE_H_
|
#ifndef FEEDER_MDSGPU
#define FEEDER_MDSGPU 0
#include "texture.h"
#include "data.h"
/*
Data Structures
*/
typedef struct feeder_t {
int *P; // permutation
int N4; // ceil( tier->n_points / 4 )
float *D; // n^2/2 lower triangle of symmetric distance matrix
int type; // 0 = raw file, 1 = graph file
float *page; // data buffer to store pages on the cpu
float norm_dist; // constant to normalize the distance with
} Feeder;
/*
Function Prototypes
*/
float *setup_feeder( Tier *tier, const char *filename, int type );
void feeder_get_page( Tier *tier, int base_iteration, bool b_fix );
#endif |
/**
@file bitsize_of.h
@brief retrieves the width in bits from type.
@author HRYKY
@version $Id: bitsize_of.h 324 2014-02-09 04:38:38Z hryky.private@gmail.com $
*/
#ifndef BITSIZE_OF_H_20130525210011541
#define BITSIZE_OF_H_20130525210011541
//------------------------------------------------------------------------------
// defines macros
//------------------------------------------------------------------------------
#define hryky_template_param \
typename ValueT, typename ResultT
#define hryky_template_arg \
ValueT, ResultT
//------------------------------------------------------------------------------
// declares types
//------------------------------------------------------------------------------
namespace hryky
{
/// retrieves the width in bits from type.
template <hryky_template_param>
class BitsizeOf;
} // namespace hryky
//------------------------------------------------------------------------------
// declares classes
//------------------------------------------------------------------------------
/**
@brief retrieves the width in bits from type.
*/
template <typename ValueT, typename ResultT = size_t>
class hryky::BitsizeOf
{
public :
static ResultT const value = sizeof(ValueT) << 3;
};
//------------------------------------------------------------------------------
// specializes classes
//------------------------------------------------------------------------------
namespace hryky
{
} // namespace hryky
//------------------------------------------------------------------------------
// defines public member functions
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// defines protected member functions
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// defines private member functions
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// declares global functions
//------------------------------------------------------------------------------
namespace hryky
{
} // namespace hryky
//------------------------------------------------------------------------------
// defines global functions
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// revokes the temporary macros
//------------------------------------------------------------------------------
#undef hryky_template_param
#undef hryky_template_arg
#endif // BITSIZE_OF_H_20130525210011541
// end of file
|
/*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2020 Scientific Computing and Imaging Institute,
University of Utah.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef INTERFACE_MODULES_CALCULATE_DISTANCE_TO_FIELD_BOUNDARY_H
#define INTERFACE_MODULES_CALCULATE_DISTANCE_TO_FIELD_BOUNDARY_H
#include "Interface/Modules/Fields/ui_calculatedistancetofieldboundary.h"
#include <Interface/Modules/Base/ModuleDialogGeneric.h>
#include <Interface/Modules/Fields/share.h>
namespace SCIRun {
namespace Gui {
class SCISHARE CalculateDistanceToFieldBoundaryDialog : public ModuleDialogGeneric,
public Ui::CalculateDistanceToFieldBoundary
{
Q_OBJECT
public:
CalculateDistanceToFieldBoundaryDialog(const std::string& name,
SCIRun::Dataflow::Networks::ModuleStateHandle state,
QWidget* parent = 0);
};
}
}
#endif
|
#if !defined(AFX_CXRUNCTRL_H__A707CD4A_2DED_4CEB_8EFC_6A4A3C38228D__INCLUDED_)
#define AFX_CXRUNCTRL_H__A707CD4A_2DED_4CEB_8EFC_6A4A3C38228D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CxRunCtrl.h : main header file for CXRUNCTRL.DLL
#if !defined( __AFXCTL_H__ )
#error include 'afxctl.h' before including this file
#endif
#include "resource.h" // main symbols
#include "CacheFileManager.h"
/////////////////////////////////////////////////////////////////////////////
// CCxRunCtrlApp : See CxRunCtrl.cpp for implementation.
#define WM_REPLACE_PICTURE WM_USER + 1
class CCxRunCtrlApp : public COleControlModule
{
public:
CCxRunCtrlApp();
BOOL InitInstance();
int ExitInstance();
public:
BOOL VerifySecurityArea(LPCTSTR lpszArea);
VARIANT GetApplication(LPCTSTR pszItem);
void SetApplication(LPCTSTR pszItem, const VARIANT FAR& newValue);
void ClearApplicationVariables();
BOOL m_bHighlightMouseObject;
CString m_strLastPicturePath;
CCacheFileManager* m_pCacheFileManager;
CString m_strUserName;
CString m_strUserSecurityAreas;
DWORD m_dwUserPrivilege;
DWORD m_bAdministrator;
// Ó¦ÓóÌÐò¶ÔÏ󣬿ÉÒÔÓÃÀ´±£´æÈ«¾Ö±äÁ¿
CTypedPtrMap<CMapStringToPtr, CString, VARIANT*> m_mapApplicationItems;
};
#define APPTIMELIMIT 1000 * 60 * 120
extern CCxRunCtrlApp theApp;
extern DWORD theAppKey;
extern DWORD theAppStartTime;
extern const GUID CDECL _tlid;
extern const WORD _wVerMajor;
extern const WORD _wVerMinor;
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CXRUNCTRL_H__A707CD4A_2DED_4CEB_8EFC_6A4A3C38228D__INCLUDED)
|
#include "os_type.h"
#include "osapi.h"
#include "espconn.h"
#include "user_interface.h"
//char* g_product_key_buf = "8e5be54e561811fa9b403b5387add08ba184855227df729b0998d6898de57a9b";
//#define SERVER_ADDRESS "https://api.pandocloud.com"
/******************************************************************************
* FunctionName : wifi_connect_check
* Description : check the wifi connect status. if device has connected the wifi,
* start the gateway flow.
* Parameters : none
* Returns : none
*******************************************************************************/
bool ICACHE_FLASH_ATTR
net_connect_check(void)
{
struct ip_info device_ip;
uint8 connect_status = 0;
wifi_get_ip_info(STATION_IF, &device_ip);
connect_status = wifi_station_get_connect_status();
if (connect_status == STATION_GOT_IP && device_ip.ip.addr != 0)
{
// device has connected the wifi.
// the device is in wifi config mode, waiting for wifi config mode over.
if(get_wifi_config_state() == 1)
{
return 0;
}
return 1;
}
else
{
PRINTF("WIFI status: not connected\n");
return 0;
}
}
void ICACHE_FLASH_ATTR
get_device_serial(char* serial_buf)
{
char device_sta_mac[6];
wifi_get_macaddr(STATION_IF,device_sta_mac);
os_sprintf(serial_buf, "%02x%02x%02x%02x%02x%02x", device_sta_mac[0], device_sta_mac[1], device_sta_mac[2], device_sta_mac[3] \
, device_sta_mac[4], device_sta_mac[5]);
PRINTF("device_serial:%s\n", serial_buf);
}
|
#ifndef GAME_H
#define GAME_H
#include <vector>
#include <string>
#include <ncurses.h>
#include "registering_enum.h"
#include "menu.h"
#include "player.h"
using namespace std;
class Game
{
public:
Game(pair<int, int>);
~Game();
void loop(void);
private:
/* Functions */
void draw();
unsigned short int choose_pawn(unsigned short int);
unsigned short int choose_disc(unsigned short int);
void init_players_disc(void);
void init_board(void);
void init_players(void);
void init_stair(void);
void print_color_stair();
void print_color_pawn();
void print_color_board();
void print_color_players();
void print_menu();
void select_option();
int move_pawn(Color);
void pick_right();
void pick_left();
void player(const char*);
/* Getters and Setters */
void number_players(unsigned short int);
unsigned short int number_players(void);
void number_pawns(unsigned short int);
unsigned short int number_pawns(void);
void number_discs(unsigned short int);
unsigned short int number_discs(void);
void number_special_discs(unsigned short int);
unsigned short int number_special_discs(void);
vector<string> players_disc(void);
string board(void);
Menu* discwin(void);
Menu* pawnwin(void);
void climb_stair(Color);
void pawn_stair(int);
int calculate_score(int);
/* Variables */
bool _picked;
int _pawn_pos;
int _pawn_turn;
int _reachable;
unsigned short int _num_players;
unsigned short int _num_pawns;
unsigned short int _num_discs;
unsigned short int _num_special_discs;
vector<string> _players_disc;
string _board;
Menu* _pawnmenu;
Menu* _discmenu;
Menu* _blackmenu;
pair<int, int> _screen_size;
Player** _players;
int _player_turn;
char* _stair;
int _stair_pos;
int _skip_pick_disc;
};
#endif
|
#ifndef WEATHERDAILYMODEL_H
#define WEATHERDAILYMODEL_H
#include <QObject>
#include <QColor>
#include <QTimer>
#include <QAbstractItemModel>
#include <QSortFilterProxyModel>
#include <QNetworkAccessManager>
#include <QGeoCoordinate>
#include "weatherdata.h"
#include "weathercommon.h"
class WeatherDailyModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(QString cityName READ cityName WRITE setCityName NOTIFY cityNameChanged)
Q_PROPERTY(QString countryID READ countryID WRITE setCountryID NOTIFY countryIDChanged)
Q_PROPERTY(int daysNumber READ daysNumber NOTIFY daysNumberChanged)
public:
enum WeatherRoles {
TimestampRole = Qt::UserRole + 1,
TemperatureDayRole,
TemperatureMinRole,
TemperatureMaxRole,
TemperatureNightRole,
TemperatureEveRole,
TemperatureMornRole,
PressureRole,
HumidityRole,
WeatherConditionIdRole,
WeatherConditionNameRole,
WeatherConditionDescriptionRole,
WeatherConditionIconIdRole,
CloudsCoverageRole,
WindSpeedRole,
WindDegreesRole,
WindGustRole,
RainRole,
SnowRole,
SunriseRole,
SunsetRole
};
explicit WeatherDailyModel(WeatherCommon *wcommon, QAbstractListModel *parent = nullptr);
virtual ~WeatherDailyModel() {}
QString cityName() const;
QString countryID() const;
QHash<int, QByteArray> roleNames() const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
Q_INVOKABLE void setUpdateInterval(int updateInterval);
int daysNumber() const;
void setSearchCriteria(const WeatherCommon::SearchCriteria &searchCriteria);
signals:
void cityNameChanged(QString cityName);
void countryIDChanged(QString countryID);
void daysNumberChanged(int daysNumber);
private slots:
void onWeatherDailyRequestFinished();
void setDaysNumber(int daysNumber);
public slots:
void requestWeatherUpdate();
void setCityName(QString cityName);
void setCountryID(QString countryID);
private:
QNetworkAccessManager _nam;
qint64 _lastTs;
QString m_cityName;
QString m_countryID;
QVector<WeatherData *> m_dailyList;
QTimer _updateTimer;
int _updateInterval;
int m_daysNumber;
WeatherCommon *m_wcommon;
QNetworkReply *replyDaily;
};
#endif // WEATHERDAILYMODEL_H
|
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <SDWebImage/UIImageView+WebCache.h>
#import "UIScrollView+EmptyDataSet.h"
#import "MBProgressHUD.h"
#import "UIScrollView+SVInfiniteScrolling.h"
#import "ArticleTableViewCell.h" |
//
// color.h
//
#ifndef rv_color_h
#define rv_color_h
#define _COLOR_BEGIN "\x1B["
#define _COLOR_SEP ";"
#define _COLOR_END "m"
#define _COLOR_RESET "\x1B[m"
#define _COLOR_NORMAL "0"
#define _COLOR_BOLD "1"
#define _COLOR_UNDERSCORE "4"
#define _COLOR_REVERSE "7"
#define _COLOR_FG_BLACK "30"
#define _COLOR_FG_RED "31"
#define _COLOR_FG_GREEN "32"
#define _COLOR_FG_YELLOW "33"
#define _COLOR_FG_BLUE "34"
#define _COLOR_FG_MAGENTA "35"
#define _COLOR_FG_CYAN "36"
#define _COLOR_FG_WHITE "37"
#define _COLOR_BG_BLACK "40"
#define _COLOR_BG_RED "41"
#define _COLOR_BG_GREEN "42"
#define _COLOR_BG_YELLOW "43"
#define _COLOR_BG_BLUE "44"
#define _COLOR_BG_MAGENTA "45"
#define _COLOR_BG_CYAN "46"
#define _COLOR_BG_WHITE "47"
extern const char* ansi_color_names[];
enum ansi_color_spec {
ansi_color_keep,
ansi_color_normal,
ansi_color_reverse
};
extern ssize_t rv_color_to_ansi_index(std::string color);
extern std::string rv_colors_to_ansi_escape_sequence(std::string fg_color, std::string bg_color,
ansi_color_spec spec = ansi_color_keep);
#endif
|
// Copyright (C) 2002-2011 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_IMAGE_H_INCLUDED__
#define __I_GUI_IMAGE_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace video
{
class ITexture;
}
namespace gui
{
//! GUI element displaying an image.
class IGUIImage : public IGUIElement
{
public:
//! constructor
IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_IMAGE, environment, parent, id, rectangle) {}
//! Sets an image texture
virtual void setImage(video::ITexture* image) = 0;
//! Gets the image texture
virtual video::ITexture* getImage() const = 0;
//! Sets the color of the image
virtual void setColor(video::SColor color) = 0;
//! Sets if the image should scale to fit the element
virtual void setScaleImage(bool scale) = 0;
//! Sets if the image should use its alpha channel to draw itself
virtual void setUseAlphaChannel(bool use) = 0;
//! Gets the color of the image
virtual video::SColor getColor() const = 0;
//! Returns true if the image is scaled to fit, false if not
virtual bool isImageScaled() const = 0;
//! Returns true if the image is using the alpha channel, false if not
virtual bool isAlphaChannelUsed() const = 0;
};
} // end namespace gui
} // end namespace irr
#endif
|
/**
* @file src/psascan_src/inmem_psascan_src/sparse_isa.h
* @author Dominik Kempa <dominik.kempa (at) gmail.com>
*
* @section DESCRIPTION
*
* Sparse ISA encoding based on the ISAs algorithm computing
* Lempel-Ziv (LZ77) factorization described in
*
* Dominik Kempa, Simon J. Puglisi:
* Lempel-Ziv factorization: Simple, fast, practical.
* In Proc. ALENEX 2013, p. 103-112.
*
* @section LICENCE
*
* This file is part of pSAscan v0.1.0
* See: http://www.cs.helsinki.fi/group/pads/
*
* Copyright (C) 2014-2015
* Juha Karkkainen <juha.karkkainen (at) cs.helsinki.fi>
* Dominik Kempa <dominik.kempa (at) gmail.com>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
**/
#ifndef __PSASCAN_SRC_INMEM_PSASCAN_SRC_SPARSE_ISA_H_INCLUDED
#define __PSASCAN_SRC_INMEM_PSASCAN_SRC_SPARSE_ISA_H_INCLUDED
#include <algorithm>
#include <thread>
namespace psascan_private {
namespace inmem_psascan_private {
template<typename pagearray_type, typename rank_type, unsigned isa_sampling_rate_log>
struct sparse_isa {
static const unsigned isa_sampling_rate = (1U << isa_sampling_rate_log);
static const unsigned isa_sampling_rate_mask = isa_sampling_rate - 1;
static const long k_sigma = 256;
static void compute_sparse_isa_aux(const pagearray_type &bwtsa, long block_beg,
long block_end, long psa_size, long *sparse_isa, long &last) {
for (long j = block_beg; j < block_end; ++j) {
long sa_j = bwtsa[j].sa;
if (!(sa_j & isa_sampling_rate_mask))
sparse_isa[sa_j >> isa_sampling_rate_log] = j;
if (sa_j == psa_size - 1) last = j;
}
}
sparse_isa(const pagearray_type *bwtsa, const unsigned char *text,
const rank_type *rank, long length, long i0, long max_threads) {
m_bwtsa = bwtsa;
m_length = length;
m_rank = rank;
m_text = text;
m_i0 = i0;
long elems = (m_length + isa_sampling_rate - 1) / isa_sampling_rate + 1;
m_sparse_isa = (long *)malloc(elems * sizeof(long));
long max_block_size = (m_length + max_threads - 1) / max_threads;
long n_blocks = (m_length + max_block_size - 1) / max_block_size;
std::thread **threads = new std::thread*[n_blocks];
for (long t = 0; t < n_blocks; ++t) {
long block_beg = t * max_block_size;
long block_end = std::min(block_beg + max_block_size, m_length);
threads[t] = new std::thread(compute_sparse_isa_aux, std::ref(*m_bwtsa),
block_beg, block_end, m_length, m_sparse_isa, std::ref(m_last_isa));
}
for (long t = 0; t < n_blocks; ++t) threads[t]->join();
for (long t = 0; t < n_blocks; ++t) delete threads[t];
delete[] threads;
m_count = (long *)malloc(k_sigma * sizeof(long));
std::copy(rank->m_count, rank->m_count + k_sigma, m_count);
++m_count[text[length - 1]];
--m_count[0];
for (long i = 0, s = 0; i < k_sigma; ++i) {
long t = m_count[i];
m_count[i] = s;
s += t;
}
}
inline long query(long j) const {
long isa_i;
long i = ((j + isa_sampling_rate - 1) >> isa_sampling_rate_log);
if ((i << isa_sampling_rate_log) < m_length) {
isa_i = m_sparse_isa[i];
i <<= isa_sampling_rate_log;
} else {
isa_i = m_last_isa;
i = m_length - 1;
}
while (i != j) {
// Compute ISA[i - 1] from ISA[i].
// Invariant:
// isa_i = ISA[i]
// j <= i
unsigned char c = m_text[i - 1];
int delta = (isa_i > m_i0 && c == 0);
isa_i = m_count[c] + m_rank->rank(isa_i, c) - delta;
if (isa_i < 0 || ((long)((*m_bwtsa)[isa_i].sa)) != i - 1)
++isa_i;
--i;
}
return isa_i;
}
~sparse_isa() {
free(m_sparse_isa);
free(m_count);
}
private:
long m_length;
long m_last_isa;
long m_i0;
long *m_count;
long *m_sparse_isa;
const unsigned char *m_text;
const pagearray_type *m_bwtsa;
const rank_type *m_rank;
};
} // namespace inmem_psascan_private
} // namespace psascan_private
#endif // __PSASCAN_SRC_INMEM_PSASCAN_SRC_SPARSE_ISA_H_INCLUDED
|
//
// RBUserStep.h
// iReBeacon
//
// Created by Giuseppe Macrì on 10/31/13.
// Copyright (c) 2013 giuseppem. All rights reserved.
//
#import <Parse/Parse.h>
@interface RBUserStep : PFObject<PFSubclassing>
@property (strong, nonatomic) PFUser *user;
@property (strong, nonatomic) NSString *step;
+ (NSString *)parseClassName;
- (id)initWithUser:(PFUser *)user withStep:(NSString *)beaconsJSON;
@end
|
//
// CWSParametrizedInstruction.h
// yafacwesConsole
//
// Created by Matthias Lamoureux on 02/08/2015.
// Copyright (c) 2015 pinguzaph. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CWSInstructionCodes.h"
@interface CWSParametrizedInstruction : NSObject
@property (nonatomic, assign) CWSInstructionCode code;
@property (nonatomic, strong) id parameter;
+ (instancetype) parametrizedInstructionWithCode:(CWSInstructionCode) aCode andParameter:(id) aParameter;
@end
|
#include <p18cxxx.h>
#include "xlcd.h"
/********************************************************************
* Function Name: SetCGRamAddr *
* Return Value: void *
* Parameters: CGaddr: character generator ram address *
* Description: This routine sets the character generator *
* address of the Hitachi HD44780 LCD *
* controller. The user must check to see if *
* the LCD controller is busy before calling *
* this routine. *
********************************************************************/
void SetCGRamAddr(unsigned char CGaddr)
{
#ifdef BIT8 // 8-bit interface
TRIS_DATA_PORT = 0; // Make data port ouput
DATA_PORT = CGaddr | 0b01000000; // Write cmd and address to port
RW_PIN = 0; // Set control signals
RS_PIN = 0;
DelayFor18TCY();
E_PIN = 1; // Clock cmd and address in
DelayFor18TCY();
E_PIN = 0;
DelayFor18TCY();
TRIS_DATA_PORT = 0xff; // Make data port inputs
#else // 4-bit interface
#ifdef UPPER // Upper nibble interface
TRIS_DATA_PORT &= 0x0f; // Make nibble input
DATA_PORT &= 0x0f; // and write upper nibble
DATA_PORT |= ((CGaddr | 0b01000000) & 0xf0);
#else // Lower nibble interface
TRIS_DATA_PORT &= 0xf0; // Make nibble input
DATA_PORT &= 0xf0; // and write upper nibble
DATA_PORT |= (((CGaddr |0b01000000)>>4) & 0x0f);
#endif
RW_PIN = 0; // Set control signals
RS_PIN = 0;
DelayFor18TCY();
E_PIN = 1; // Clock cmd and address in
DelayFor18TCY();
E_PIN = 0;
#ifdef UPPER // Upper nibble interface
DATA_PORT &= 0x0f; // Write lower nibble
DATA_PORT |= ((CGaddr<<4)&0xf0);
#else // Lower nibble interface
DATA_PORT &= 0xf0; // Write lower nibble
DATA_PORT |= (CGaddr&0x0f);
#endif
DelayFor18TCY();
E_PIN = 1; // Clock cmd and address in
DelayFor18TCY();
E_PIN = 0;
#ifdef UPPER // Upper nibble interface
TRIS_DATA_PORT |= 0xf0; // Make inputs
#else // Lower nibble interface
TRIS_DATA_PORT |= 0x0f; // Make inputs
#endif
#endif
return;
}
|
#ifndef CONNECTION_H
#define CONNECTION_H
#include "net.h"
struct connection;
enum connection_behavior {
CONNECTION_BEHAVIOR_DESTROY = 0,
CONNECTION_BEHAVIOR_ALLOW
};
enum connection_disconnect_reason {
/* not disconnected yet */
CONNECTION_DISCONNECT_NOT = 0,
/* normal requested disconnection */
CONNECTION_DISCONNECT_DEINIT,
/* input buffer full */
CONNECTION_DISCONNECT_BUFFER_FULL,
/* connection got disconnected */
CONNECTION_DISCONNECT_CONN_CLOSED,
/* connect() timed out */
CONNECTION_DISCONNECT_CONNECT_TIMEOUT,
/* remote didn't send input */
CONNECTION_DISCONNECT_IDLE_TIMEOUT
};
struct connection_vfuncs {
void (*destroy)(struct connection *conn);
/* For UNIX socket clients this gets called immediately with
success=TRUE, for IP connections it gets called later:
If connect() fails, sets success=FALSE and errno. Streams aren't
initialized in that situation either. destroy() is called after
the callback. */
void (*client_connected)(struct connection *conn, bool success);
/* implement one of the input*() methods.
They return 1 = ok, continue. 0 = ok, but stop processing more
lines, -1 = error, disconnect the client. */
void (*input)(struct connection *conn);
int (*input_line)(struct connection *conn, const char *line);
int (*input_args)(struct connection *conn, const char *const *args);
};
struct connection_settings {
const char *service_name_in;
const char *service_name_out;
unsigned int major_version, minor_version;
unsigned int client_connect_timeout_msecs;
unsigned int input_idle_timeout_secs;
size_t input_max_size;
size_t output_max_size;
enum connection_behavior input_full_behavior;
bool client;
bool dont_send_version;
};
struct connection {
struct connection *prev, *next;
struct connection_list *list;
char *name;
int fd_in, fd_out;
struct io *io;
struct istream *input;
struct ostream *output;
struct timeout *to;
time_t last_input;
/* for IP client: */
struct ip_addr ip;
unsigned int port;
/* received minor version */
unsigned int minor_version;
enum connection_disconnect_reason disconnect_reason;
unsigned int version_received:1;
};
struct connection_list {
struct connection *connections;
unsigned int connections_count;
struct connection_settings set;
struct connection_vfuncs v;
};
void connection_init_server(struct connection_list *list,
struct connection *conn, const char *name,
int fd_in, int fd_out);
void connection_init_client_ip(struct connection_list *list,
struct connection *conn,
const struct ip_addr *ip, unsigned int port);
void connection_init_client_unix(struct connection_list *list,
struct connection *conn, const char *path);
void connection_init_from_streams(struct connection_list *list,
struct connection *conn, const char *name,
struct istream *input, struct ostream *output);
int connection_client_connect(struct connection *conn);
void connection_disconnect(struct connection *conn);
void connection_deinit(struct connection *conn);
/* Returns -1 = disconnected, 0 = nothing new, 1 = something new.
If input_full_behavior is ALLOW, may return also -2 = buffer full. */
int connection_input_read(struct connection *conn);
/* Verify that VERSION input matches what we expect. */
int connection_verify_version(struct connection *conn, const char *const *args);
/* Returns human-readable reason for why connection was disconnected. */
const char *connection_disconnect_reason(struct connection *conn);
void connection_switch_ioloop(struct connection *conn);
struct connection_list *
connection_list_init(const struct connection_settings *set,
const struct connection_vfuncs *vfuncs);
void connection_list_deinit(struct connection_list **list);
void connection_input_default(struct connection *conn);
int connection_input_line_default(struct connection *conn, const char *line);
#endif
|
#ifndef _FUNC_TUPLE_
#define _FUNC_TUPLE_
namespace wheels
{
template<typename F, typename P = void*>
struct func_tuple_t
{
func_tuple_t()
{
}
func_tuple_t(const F& f, const P& p):
func_(f), param_(p)
{
}
func_tuple_t(const func_tuple_t& c):
func_(c.func_), param_(c.param_)
{
}
F func_;
P param_;
};
}
#endif
|
#pragma once
#ifndef MacroFloat_$C7AB4645_73F4_462F_9392_0FE5AB76DC56
#define MacroFloat_$C7AB4645_73F4_462F_9392_0FE5AB76DC56 1
#define KTL$Constants$DoubleDecimalDigits$Macro 17 // # of decimal digits of rounding precision
#define KTL$Constants$DoubleDigits$Macro 15 // # of decimal digits of precision
#define KTL$Constants$DoubleEpsilon$Macro 2.2204460492503131e-016 // smallest such that 1.0+DBL_EPSILON != 1.0
#define KTL$Constants$DoubleHasSubnormal$Macro 1 // type does support subnormal numbers
#define KTL$Constants$DoubleMantissaDigits 53 // # of bits in mantissa
#define KTL$Constants$DoubleMaxDecimalExponent$Macro 308 // max decimal exponent
#define KTL$Constants$DoubleMaxBinaryExponent$Macro 1024 // max binary exponent
#define KTL$Constants$DoubleMinDecimalExponent$Macro (-307) // min decimal exponent
#define KTL$Constants$DoubleMinBinaryExponent$Macro (-1021) // min binary exponent
#define KTL$Constants$DoubleExponentRadix$Macro 2 // exponent radix
#define KTL$Constants$FloatDecimalDigits$Macro 9 // # of decimal digits of rounding precision
#define KTL$Constants$FloatDigits$Macro 6 // # of decimal digits of precision
#define KTL$Constants$FloatEpsilon$Macro 1.192092896e-07F // smallest such that 1.0+DBL_EPSILON != 1.0
#define KTL$Constants$FloatHasSubnormal$Macro 1 // type does support subnormal numbers
#define KTL$Constants$FloatGuard$Macro 0
#define KTL$Constants$FloatMantissaDigits 24 // # of bits in mantissa
#define KTL$Constants$FloatMaxDecimalExponent$Macro 38 // max decimal exponent
#define KTL$Constants$FloatMaxBinaryExponent$Macro 128 // max binary exponent
#define KTL$Constants$FloatMinDecimalExponent$Macro (-37) // min decimal exponent
#define KTL$Constants$FloatMinBinaryExponent$Macro (-125) // min binary exponent
#define KTL$Constants$FloatNormalize$Macro 0
#define KTL$Constants$FloatExponentRadix$Macro 2 // exponent radix
#endif
|
//
// FontDownloader.h
// FontDownloader
//
// Created by Takeru Chuganji on 9/26/15.
// Copyright © 2015 Takeru Chuganji. All rights reserved.
//
@import Foundation;
//! Project version number for FontDownloader.
FOUNDATION_EXPORT const double FontDownloaderVersionNumber;
//! Project version string for FontDownloader.
FOUNDATION_EXPORT const unsigned char FontDownloaderVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <FontDownloader/PublicHeader.h>
|
#ifndef __TOOLS_H__
#define __TOOLS_H__
#define DEBUG 0
/**
* Prints the string provided if debug mode enabled.
* @param fmt The string which must be printed.
* @return None.
*/
#define finger_debug(fmt) \
do { \
if (DEBUG) { \
fprintf(stderr, fmt); \
} \
} while (0)
/**
* Prints the string provided if debug mode enabled. Handle multiple args.
* @param fmt The string which must be printed.
* @param VARARGS The other arguments.
* @return None.
*/
#define finger_args(fmt, ...) \
do { \
if (DEBUG) { \
fprintf(stderr, fmt, __VA_ARGS__); \
} \
} while (0)
typedef int finger_data_t;
typedef enum {TREE_NODE, DATA_NODE} node_type_t;
typedef enum {EMPTY_NODE, SINGLE_NODE, DEEP_NODE} deep_type_t;
typedef enum {FINGER_LEFT, FINGER_RIGHT} side_t;
typedef struct fingernode_t_def{
int ref_counter;
int tag;
int arity;
int lookup_idx;
node_type_t node_type;
union {
struct fingernode_t_def** children;
finger_data_t** data;
} content;
} fingernode_t;
typedef struct deep_t_def {
deep_type_t deep_type;
int ref_counter;
int tag;
fingernode_t* left;
fingernode_t* right;
union {
fingernode_t* single;
struct deep_t_def* deeper;
} content;
} deep_t;
/**
** deep_t* simple linked list
**/
typedef struct deep_list_t_def {
deep_t* content;
struct deep_list_t_def* next;
} deep_list_t;
deep_list_t* list_make();
int list_is_empty(deep_list_t* list);
void list_push(deep_t* deep, deep_list_t** list);
deep_t* list_pop(deep_list_t** list);
int list_size(deep_list_t* list);
void list_destroy(deep_list_t* list);
/**
** fingernode_t* double linked list
**/
typedef struct finger_list_t_def {
fingernode_t* content;
struct finger_list_t_def* next;
struct finger_list_t_def* prev;
} finger_list_t;
typedef struct finger_deque_t_def {
int size;
finger_list_t* first;
finger_list_t* last;
} finger_deque_t;
finger_deque_t* deque_make();
int deque_is_empty(finger_deque_t* deque);
void deque_push_front(fingernode_t* val, finger_deque_t* deque);
void deque_push_back(fingernode_t* val, finger_deque_t* deque);
fingernode_t* deque_pop_first(finger_deque_t* deque);
fingernode_t* deque_pop_last(finger_deque_t* deque);
int deque_size(finger_deque_t* deque);
void deque_destroy(finger_deque_t* deque);
/**
** Miscellaneous
**/
int finger_depth(fingernode_t* finger);
void dump_deep_debug(deep_t* deep, int span, void (*display)(finger_data_t**, int));
void dump_finger_debug(fingernode_t* node, int span, void (*display)(finger_data_t**, int));
#endif
|
#pragma once
#include <winvfs/winvfs_common.h>
typedef enum WIN_VFS_COMPARISON_RESULT
{
IsEqual
,IsGreaterThan
,IsLessThan
} WinVfsComparisonResult;
//It's a base struact for all entries which will be stored in the cache
typedef struct WIN_VFS_CACHE_ENTRY
{
//Entry type
ULONG entryType;
//Functicon to compaer two entries.
BOOLEAN isEntryInCache;
//All entries are binded.
RTL_SPLAY_LINKS links;
} WinVfsCacheEntry, *PWinVfsCacheEntry;
/*Functicon to compare two entries. It returnes three possible resulsts
* pE1 and pE2 are equal
* pE1 is greater than pE2
* pE2 is less than pE2
* @param pE1 first entry
* @param pE2 second entry
* @result compare result
*/
typedef WinVfsComparisonResult ( *WinVfsCahceCompare )( PWinVfsCacheEntry pE1, PWinVfsCacheEntry pE2 );
/**
* Add a new entry in a cache If it is not yet. If cache is empty ppRoot will be initialized.
* @param pRootEntry root node of a cache
* @param pNewEntry entry to insert
* @param compare function to comapre two entries
*/
void winvfs_cache_insert_entry( _Inout_ PRTL_SPLAY_LINKS *ppRoot, _In_ PWinVfsCacheEntry pNewEntry, _In_ WinVfsCahceCompare compare );
/**
* Remove entry from a cache. Root link is updated after remove cache entry( Need to mark cache empty )
* @param pEntry entry to remove
* @return removed entry. If entry is not in a cache NULL is returned.
*/
void winvfs_cache_remove_entry( _Inout_ PRTL_SPLAY_LINKS *ppRoot, _In_ PWinVfsCacheEntry pEntry );
/**
* Find an entry. EntryType and and entry context must be initialized in the pEntryToFind. All other field must be zero.
* @param pRootEntry root node of a cache
* @param pEntryToFind entry to find
* @param compare function to comapre two entries
* @return found cache entry. If entry is not in the cache NULL is returned.
*/
PWinVfsCacheEntry winvfs_cache_find_entry( _In_ PRTL_SPLAY_LINKS *ppRoot, _In_ PWinVfsCacheEntry pEntryToFind, _In_ WinVfsCahceCompare compare ); |
/*
* Copyright (c) 2018 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 CALL_PACKET_RECEIVER_H_
#define CALL_PACKET_RECEIVER_H_
#include <algorithm>
#include <memory>
#include <string>
#include <vector>
#include BOSS_WEBRTC_U_api__mediatypes_h //original-code:"api/mediatypes.h"
#include BOSS_WEBRTC_U_common_types_h //original-code:"common_types.h" // NOLINT(build/include)
#include BOSS_WEBRTC_U_rtc_base__copyonwritebuffer_h //original-code:"rtc_base/copyonwritebuffer.h"
namespace webrtc {
class PacketReceiver {
public:
enum DeliveryStatus {
DELIVERY_OK,
DELIVERY_UNKNOWN_SSRC,
DELIVERY_PACKET_ERROR,
};
virtual DeliveryStatus DeliverPacket(MediaType media_type,
rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us);
// TODO(bugs.webrtc.org/9584): Deprecated. Over the transition, default
// implementations are used, and subclasses must override one or the other.
virtual DeliveryStatus DeliverPacket(MediaType media_type,
rtc::CopyOnWriteBuffer packet,
const PacketTime& packet_time);
protected:
virtual ~PacketReceiver() {}
};
} // namespace webrtc
#endif // CALL_PACKET_RECEIVER_H_
|
#ifndef __COMMON_DEFINITIONS_H__
#define __COMMON_DEFINITIONS_H__
#include <stddef.h>
#define BITU(x) (1u << (x))
#define BITUL(x) (1ul << (x))
#define BITULL(x) (1ull << (x))
#define container_of(ptr, type, member) \
(type *)((char *)(ptr) - offsetof(type, member))
#endif /*__COMMON_DEFINTIONS_H__*/
|
// 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.
// MaterialDesignCocoa
#define COCOAPODS_POD_AVAILABLE_MaterialDesignCocoa
#define COCOAPODS_VERSION_MAJOR_MaterialDesignCocoa 0
#define COCOAPODS_VERSION_MINOR_MaterialDesignCocoa 0
#define COCOAPODS_VERSION_PATCH_MaterialDesignCocoa 1
|
// ImaginationServer.World.Packets.h
#pragma once
#include "Stdafx.h"
#include <BitStream.h>
#include <MessageIdentifiers.h>
using namespace RakNet;
using namespace System;
using namespace System::Collections::Generic;
using namespace cli;
using namespace ImaginationServer::Common;
using namespace ImaginationServer::Common::Data;
namespace ImaginationServerWorldPackets {
// From LUNI, mostly
public enum class CharCreatePantsColor : unsigned long {
PANTS_BRIGHT_RED = 2508,
PANTS_BRIGHT_ORANGE = 2509,
PANTS_BRICK_YELLOW = 2511,
PANTS_MEDIUM_BLUE = 2513,
PANTS_SAND_GREEN = 2514,
PANTS_DARK_GREEN = 2515,
PANTS_EARTH_GREEN = 2516,
PANTS_EARTH_BLUE = 2517,
PANTS_BRIGHT_BLUE = 2519,
PANTS_SAND_BLUE = 2520,
PANTS_DARK_STONE_GRAY = 2521,
PANTS_MEDIUM_STONE_GRAY = 2522,
PANTS_WHITE = 2523,
PANTS_BLACK = 2524,
PANTS_REDDISH_BROWN = 2526,
PANTS_DARK_RED = 2527
};
// Struct that puts names to each base shirt ID (for easy use)
public enum class CharCreateShirtColor : unsigned long {
SHIRT_BRIGHT_RED = 4049,
SHIRT_BRIGHT_BLUE = 4083,
SHIRT_BRIGHT_YELLOW = 4117,
SHIRT_DARK_GREEN = 4151,
SHIRT_BRIGHT_ORANGE = 4185,
SHIRT_BLACK = 4219,
SHIRT_DARK_STONE_GRAY = 4253,
SHIRT_MEDIUM_STONE_GRAY = 4287,
SHIRT_REDDISH_BROWN = 4321,
SHIRT_WHITE = 4355,
SHIRT_MEDIUM_BLUE = 4389,
SHIRT_DARK_RED = 4423,
SHIRT_EARTH_BLUE = 4457,
SHIRT_EARTH_GREEN = 4491,
SHIRT_BRICK_YELLOW = 4525,
SHIRT_SAND_BLUE = 4559,
SHIRT_SAND_GREEN = 4593
};
public ref class WorldPackets
{
public:
static void SendCharacterListResponse(String^ address, Account^ account, LuServer^ peer);
static unsigned long FindCharShirtID(unsigned long shirtColor, unsigned long shirtStyle) {
unsigned long shirtID = 0;
// This is a switch case to determine the base shirt color (IDs from CDClient.xml)
switch (shirtColor) {
case 0:
{
shirtID = shirtStyle >= 35 ? 5730 : (unsigned long)CharCreateShirtColor::SHIRT_BRIGHT_RED;
break;
}
case 1:
{
shirtID = shirtStyle >= 35 ? 5736 : (unsigned long)CharCreateShirtColor::SHIRT_BRIGHT_BLUE;
break;
}
case 3:
{
shirtID = shirtStyle >= 35 ? 5808 : (unsigned long)CharCreateShirtColor::SHIRT_DARK_GREEN;
break;
}
case 5:
{
shirtID = shirtStyle >= 35 ? 5754 : (unsigned long)CharCreateShirtColor::SHIRT_BRIGHT_ORANGE;
break;
}
case 6:
{
shirtID = shirtStyle >= 35 ? 5760 : (unsigned long)CharCreateShirtColor::SHIRT_BLACK;
break;
}
case 7:
{
shirtID = shirtStyle >= 35 ? 5766 : (unsigned long)CharCreateShirtColor::SHIRT_DARK_STONE_GRAY;
break;
}
case 8:
{
shirtID = shirtStyle >= 35 ? 5772 : (unsigned long)CharCreateShirtColor::SHIRT_MEDIUM_STONE_GRAY;
break;
}
case 9:
{
shirtID = shirtStyle >= 35 ? 5778 : (unsigned long)CharCreateShirtColor::SHIRT_REDDISH_BROWN;
break;
}
case 10:
{
shirtID = shirtStyle >= 35 ? 5784 : (unsigned long)CharCreateShirtColor::SHIRT_WHITE;
break;
}
case 11:
{
shirtID = shirtStyle >= 35 ? 5802 : (unsigned long)CharCreateShirtColor::SHIRT_MEDIUM_BLUE;
break;
}
case 13:
{
shirtID = shirtStyle >= 35 ? 5796 : (unsigned long)CharCreateShirtColor::SHIRT_DARK_RED;
break;
}
case 14:
{
shirtID = shirtStyle >= 35 ? 5802 : (unsigned long)CharCreateShirtColor::SHIRT_EARTH_BLUE;
break;
}
case 15:
{
shirtID = shirtStyle >= 35 ? 5808 : (unsigned long)CharCreateShirtColor::SHIRT_EARTH_GREEN;
break;
}
case 16:
{
shirtID = shirtStyle >= 35 ? 5814 : (unsigned long)CharCreateShirtColor::SHIRT_BRICK_YELLOW;
break;
}
case 84:
{
shirtID = shirtStyle >= 35 ? 5820 : (unsigned long)CharCreateShirtColor::SHIRT_SAND_BLUE;
break;
}
case 96:
{
shirtID = shirtStyle >= 35 ? 5826 : (unsigned long)CharCreateShirtColor::SHIRT_SAND_GREEN;
shirtColor = 16;
break;
}
}
// Initialize another variable for the shirt color
unsigned long editedShirtColor = shirtID;
// This will be the final shirt ID
unsigned long shirtIDFinal;
// For some reason, if the shirt color is 35 - 40,
// The ID is different than the original... Was this because
// these shirts were added later?
if (shirtStyle >= 35) {
shirtIDFinal = editedShirtColor += (shirtStyle - 35);
}
else {
// Get the final ID of the shirt by adding the shirt
// style to the editedShirtColor
shirtIDFinal = editedShirtColor += (shirtStyle - 1);
}
//cout << "Shirt ID is: " << shirtIDFinal << endl;
return shirtIDFinal;
}
static void WriteStringToBitStream(const char* myString, int stringSize, int maxChars, RakNet::BitStream* output)
{
// Write the string to provided BitStream along with the size
output->Write(myString, stringSize);
// Check to see if there are any bytes remaining according to user
// specification
auto remaining = maxChars - stringSize;
// If so, fill with 0x00
for (auto i = 0; i < remaining; i++)
{
unsigned char zero = 0;
output->Write(zero);
}
}
static void CreatePacketHeader(MessageID messageId, unsigned short connectionType, unsigned long internalPacketId, BitStream* output)
{
unsigned char unknown1 = 0; // This is an unknown uchar
// Write data to provided BitStream
output->Write(messageId);
output->Write(connectionType);
output->Write(internalPacketId);
output->Write(unknown1);
}
};
}
|
//
// BoxView.h
// Backgammon
//
// Created by Vladimir Nabokov on 5/27/14.
// Copyright (c) 2014 Evren Kanalici. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "UserSlot.h"
@interface BoxSlotView : UserSlot
@end
|
//
// CLAvAudioPlayerUtils.h
// avFoundation_audio
//
// Created by tidemedia on 2017/8/15.
// Copyright © 2017年 charly. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CLAvAudioPlayerUtils : NSObject
@property (assign, getter=isPlaying, nonatomic) BOOL playing;
+ (instancetype)avAudioPlayerShareInstance;
- (BOOL)addPlayerWithPathName:(NSString *)name;
- (void)paly;
- (void)stop;
- (void)pause;
- (void)adjustRate:(float)rate;
- (void)adjustPan:(float)pan index:(NSUInteger)idx;
- (void)adjustVolume:(float)volume index:(NSUInteger)idx;
@end
|
#pragma once
#include <string>
#include <vector>
#include <algorithm>
namespace rstr {
std::vector<std::string> split(std::string const & str, std::string const & pattern);
std::string strip(std::string const & str);
std::string lstrip(std::string const & str);
std::string rstrip(std::string const & str);
bool end_with(std::string const & str, std::string const & pattern);
bool include(std::string const & str, std::string const & pattern);
std::string reverse(std::string const & str);
bool start_with(std::string const & str, std::string const & pattern);
}
|
//
// setCardDeck.h
// Matchismo
//
// Created by AravinthChandran on 19/12/13.
// Copyright (c) 2013 AravinthChandran. All rights reserved.
//
#import "Deck.h"
#import "setCard.h"
@interface setCardDeck : Deck
-(instancetype)initWithColor:(NSArray *)colors andShapes:(NSArray *)shapes;
-(instancetype)initWithDefaults;
@end
|
#pragma once
struct uchar4;
struct int2;
struct int3;
struct float4;
void kernelLauncher(uchar4 * d_out, float *d_vol, int w, int h, int3 volSize,
int method, int zs, float theta, float threshold,float dist);
void InitResources(float *d_vol,int3 volSize,int id,float4 params);
|
//
// UIView+Animation.h
// StringDemo
//
// Created by 何 振东 on 12-10-11.
// Copyright (c) 2012年 wsk. All rights reserved.
//
/**
* direction取值:kCATransitionFromTop kCATransitionFromBottom
* kCATransitionFromLeft kCATransitionFromRight
*/
#define kCameraEffectOpen @"cameraIrisHollowOpen"
#define kCameraEffectClose @"cameraIrisHollowClose"
#import <UIKit/UIKit.h>
#import "QuartzCore/QuartzCore.h"
@interface UIView (Animation)
//揭开
+ (void)animationReveal:(UIView *)view direction:(NSString *)direction;
//渐隐渐消
+ (void)animationFade:(UIView *)view;
//翻转
+ (void)animationFlip:(UIView *)view direction:(NSString *)direction;
//旋转缩放
+ (void)animationRotateAndScaleEffects:(UIView *)view;//各种旋转缩放效果。
+ (void)animationRotateAndScaleDownUp:(UIView *)view;//旋转同时缩小放大效果
//push
+ (void)animationPush:(UIView *)view direction:(NSString *)direction;
//Curl UnCurl
+ (void)animationCurl:(UIView *)view direction:(NSString *)direction;
+ (void)animationUnCurl:(UIView *)view direction:(NSString *)direction;
//Move
+ (void)animationMove:(UIView *)view direction:(NSString *)direction;
//立方体
+ (void)animationCube:(UIView *)view direction:(NSString *)direction;
//水波纹
+ (void)animationRippleEffect:(UIView *)view;
//相机开合
+ (void)animationCameraEffect:(UIView *)view type:(NSString *)type;
//吸收
+ (void)animationSuckEffect:(UIView *)view;
+ (void)animationBounceOut:(UIView *)view;
+ (void)animationBounceIn:(UIView *)view;
+ (void)animationBounce:(UIView *)view;
@end
|
//
// DIFollowingViewController.h
// DemoInstagram
//
// Created by Anatoliy Afanasev on 12/20/15.
// Copyright © 2015 Anatoliy Afanasev. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DIFollowingViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITableView *table;
@end
|
#import <Cordova/CDVPlugin.h>
@import Photos;
@interface LocalAssets : CDVPlugin
- (void)getAllPhotos:(CDVInvokedUrlCommand*)command;
- (void)getPhotoMetadata:(CDVInvokedUrlCommand*)command;
- (void)getThumbnails:(CDVInvokedUrlCommand*)command;
- (void)getPhoto:(CDVInvokedUrlCommand*)command;
@end
|
// warnings that are disabled for the Visual Studio builds
#pragma warning(disable:4290) // C++ Exception Specification ignored
#pragma warning(disable:4100) // Unreferenced formal parameter
#pragma warning(disable:4702) // unreachable code
#pragma warning(disable:4800) // forcing value to bool 'true' or 'false' (performance warning)
#pragma warning(disable:4141) // novtable more than once--broken in 8603 compiler
#pragma warning(disable:4296) // bool expression is always true
#pragma warning(disable:4242) // possible loss of data on conversion
#pragma warning(disable:4703) // Local pointer potentially used used w/o being initialized
// warnings disabled temporarily until fixed in VS sources (1/20/00 KarlSi)
#pragma warning(disable:4584) // bass-class 'x' is already a base-class of 'y'
#pragma warning(disable:4995) // using deprecated functionality (eg. iostream)
// warnings disabled temporarily until fixed in VS sources (2004/07/20 DJCarter)
#pragma warning(disable:4334) // '<<' : result of 32-bit shift implicitly converted to 64 bits
#pragma warning(disable:4293) // '<<' : shift count negative or too big, undefined behavior
#pragma warning(disable:4430) // missing type specifier - int assumed. Note: C++ does not support default-int
// warnings disabled temporarily until fixed in VS sources (2012/11/05 MarkLe)
// In the 17.1 compiler, C4312 is now enabled by default and VS sources are not clean
#pragma warning(disable:4312) // 'type cast' : conversion from 'int' to 'void *' of greater size
// warning disabled for IJW
#pragma warning(disable:4793) // 'vararg' : causes native code generation
// warnings disabled temporarily until fixed in VS sources (2014/01/06 JoEmmett)
#pragma warning(disable:4838) // narrowing conversion in initialization
// warnings disabled temporarily until fixed in VS sources (2014/04/07 XiangFan)
#pragma warning(disable:4456) // variable shadowing
#pragma warning(disable:4457) // variable shadowing
#pragma warning(disable:4458) // variable shadowing
#pragma warning(disable:4459) // variable shadowing
|
/**************************************
WWW.NAMINIC.COM
/**************************************/
#include <board.h>
#include <pio/pio.h>
#include <pmc/pmc.h>
#include <ssc/ssc.h>
#include <utility/lcd4bit.h>
void main()
{
unsigned int x=10;
lcd_init();
lcd_clear();
lcd_gotoxy(1,1);
lcd_putsf("WWW.NAMINIC.COM");
lcd_gotoxy(2,1);
lcd_puts(x);
while(1){
}
}
|
//
// UITableViewCell+PBIndexing.h
// Pbind <https://github.com/wequick/Pbind>
//
// Created by galen on 17/7/27.
// Copyright (c) 2015-present, Wequick.net. All rights reserved.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import <UIKit/UIKit.h>
@interface UITableViewCell (PBIndexing)
@property (nonatomic, strong) NSIndexPath *indexPath;
@end
|
// RUN: %check --only -e %s
typedef int wchar_t;
wchar_t *pw = "hello"; // CHECK: /warning: mismatching types/
char *pc = L"hello"; // CHECK: /warning: mismatching types/
wchar_t aw[] = "hello"; // CHECK: /error: incorrect string literal/
char ac[] = L"hello"; // CHECK: /error: incorrect string literal/
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "CDStructures.h"
@interface NSArray (IDELocalizationStreamArrayUtilities)
- (id)IDELocalizationStream_collect;
- (id)IDELocalizationStream_join;
- (id)IDELocalizationStream_asyncMap:(dispatch_block_t)arg1;
- (id)IDELocalizationStream_map:(dispatch_block_t)arg1;
- (id)IDELocalizationStream;
@end
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
#import "NSCoding.h"
@class NSString;
@interface POIInfo : NSObject <NSCoding>
{
struct CLLocationCoordinate2D _coordinate;
double _scale;
NSString *_bid;
NSString *_address;
NSString *_poiName;
NSString *_infoUrl;
}
@property(retain, nonatomic) NSString *infoUrl; // @synthesize infoUrl=_infoUrl;
@property(retain, nonatomic) NSString *poiName; // @synthesize poiName=_poiName;
@property(retain, nonatomic) NSString *address; // @synthesize address=_address;
@property(retain, nonatomic) NSString *bid; // @synthesize bid=_bid;
@property(nonatomic) double scale; // @synthesize scale=_scale;
@property(nonatomic) struct CLLocationCoordinate2D coordinate; // @synthesize coordinate=_coordinate;
- (void).cxx_destruct;
- (id)description;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (void)dealloc;
@end
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: android/libcore/luni/src/main/java/java/io/FileReader.java
//
#include "../../J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_JavaIoFileReader")
#ifdef RESTRICT_JavaIoFileReader
#define INCLUDE_ALL_JavaIoFileReader 0
#else
#define INCLUDE_ALL_JavaIoFileReader 1
#endif
#undef RESTRICT_JavaIoFileReader
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if !defined (JavaIoFileReader_) && (INCLUDE_ALL_JavaIoFileReader || defined(INCLUDE_JavaIoFileReader))
#define JavaIoFileReader_
#define RESTRICT_JavaIoInputStreamReader 1
#define INCLUDE_JavaIoInputStreamReader 1
#include "../../java/io/InputStreamReader.h"
@class JavaIoFile;
@class JavaIoFileDescriptor;
/*!
@brief A specialized <code>Reader</code> that reads from a file in the file system.
All read requests made by calling methods in this class are directly
forwarded to the equivalent function of the underlying operating system.
Since this may induce some performance penalty, in particular if many small
read requests are made, a FileReader is often wrapped by a
BufferedReader.
- seealso: BufferedReader
- seealso: FileWriter
*/
@interface JavaIoFileReader : JavaIoInputStreamReader
#pragma mark Public
/*!
@brief Constructs a new FileReader on the given <code>file</code>.
@param file
a File to be opened for reading characters from.
@throws FileNotFoundException
if <code>file</code> does not exist.
*/
- (instancetype)initWithJavaIoFile:(JavaIoFile *)file;
/*!
@brief Construct a new FileReader on the given FileDescriptor <code>fd</code>.
Since
a previously opened FileDescriptor is passed as an argument, no
FileNotFoundException can be thrown.
@param fd
the previously opened file descriptor.
*/
- (instancetype)initWithJavaIoFileDescriptor:(JavaIoFileDescriptor *)fd;
/*!
@brief Construct a new FileReader on the given file named <code>filename</code>.
@param filename
an absolute or relative path specifying the file to open.
@throws FileNotFoundException
if there is no file named <code>filename</code>.
*/
- (instancetype)initWithNSString:(NSString *)filename;
@end
J2OBJC_EMPTY_STATIC_INIT(JavaIoFileReader)
FOUNDATION_EXPORT void JavaIoFileReader_initWithJavaIoFile_(JavaIoFileReader *self, JavaIoFile *file);
FOUNDATION_EXPORT JavaIoFileReader *new_JavaIoFileReader_initWithJavaIoFile_(JavaIoFile *file) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT JavaIoFileReader *create_JavaIoFileReader_initWithJavaIoFile_(JavaIoFile *file);
FOUNDATION_EXPORT void JavaIoFileReader_initWithJavaIoFileDescriptor_(JavaIoFileReader *self, JavaIoFileDescriptor *fd);
FOUNDATION_EXPORT JavaIoFileReader *new_JavaIoFileReader_initWithJavaIoFileDescriptor_(JavaIoFileDescriptor *fd) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT JavaIoFileReader *create_JavaIoFileReader_initWithJavaIoFileDescriptor_(JavaIoFileDescriptor *fd);
FOUNDATION_EXPORT void JavaIoFileReader_initWithNSString_(JavaIoFileReader *self, NSString *filename);
FOUNDATION_EXPORT JavaIoFileReader *new_JavaIoFileReader_initWithNSString_(NSString *filename) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT JavaIoFileReader *create_JavaIoFileReader_initWithNSString_(NSString *filename);
J2OBJC_TYPE_LITERAL_HEADER(JavaIoFileReader)
#endif
#pragma clang diagnostic pop
#pragma pop_macro("INCLUDE_ALL_JavaIoFileReader")
|
//
// OCAppDelegate.h
// OnCourse
//
// Created by East Agile on 11/29/12.
// Copyright (c) 2012 phatle. All rights reserved.
//
#import <UIKit/UIKit.h>
@class OCCourseraCrawler;
@interface OCAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UINavigationController *navigationController;
@property (strong, nonatomic) OCCourseraCrawler *courseCrawler;
@property (nonatomic, strong) NSManagedObjectModel *managedObjectModel;
@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator;
- (NSString *)applicationDocumentsDirectory;
- (void)saveContext;
@end
|
//
// ToDoItem.h
// AppleToDoList
//
// Created by James Scott on 10/27/14.
// Copyright (c) 2014 James Scott. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ToDoItem : NSObject
@property NSString *itemName;
@property BOOL completed;
@property (readonly) NSDate *creationDate;
@end
|
//
// NDDESEC.H
// Copyright (c) 1994-1999, Microsoft Corp. All rights reserved.
//
#ifndef _INC_NDDESEC
#define _INC_NDDESEC
#if _MSC_VER > 1000
#pragma once
#endif
#define NDDE_SHAREDB_ADD (0x00000001)
#define NDDE_SHAREDB_DELETE (0x00000002)
#define NDDE_SHAREDB_LIST (0x00000004)
#define NDDE_SHAREDB_ADMIN (NDDE_SHAREDB_ADD | \
NDDE_SHAREDB_DELETE | \
NDDE_SHAREDB_LIST | \
READ_CONTROL | \
WRITE_DAC | \
WRITE_OWNER)
#define NDDE_SHAREDB_OPER (NDDE_SHAREDB_ADD | \
NDDE_SHAREDB_DELETE | \
NDDE_SHAREDB_LIST)
#define NDDE_SHAREDB_POWER (NDDE_SHAREDB_ADD | \
NDDE_SHAREDB_DELETE | \
NDDE_SHAREDB_LIST)
#define NDDE_SHAREDB_USER (NDDE_SHAREDB_ADD | \
NDDE_SHAREDB_DELETE | \
NDDE_SHAREDB_LIST)
#define NDDE_SHAREDB_EVERYONE (NDDE_SHAREDB_LIST)
#define NDDE_SHARE_READ (0x00000001)
#define NDDE_SHARE_WRITE (0x00000002)
#define NDDE_SHARE_INITIATE_STATIC (0x00000004)
#define NDDE_SHARE_INITIATE_LINK (0x00000008)
#define NDDE_SHARE_REQUEST (0x00000010)
#define NDDE_SHARE_ADVISE (0x00000020)
#define NDDE_SHARE_POKE (0x00000040)
#define NDDE_SHARE_EXECUTE (0x00000080)
#define NDDE_SHARE_ADD_ITEMS (0x00000100)
#define NDDE_SHARE_LIST_ITEMS (0x00000200)
#define NDDE_SHARE_GENERIC_READ (NDDE_SHARE_READ | \
NDDE_SHARE_INITIATE_STATIC | \
NDDE_SHARE_REQUEST | \
NDDE_SHARE_ADVISE | \
NDDE_SHARE_LIST_ITEMS)
#define NDDE_SHARE_GENERIC_WRITE (NDDE_SHARE_INITIATE_STATIC | \
NDDE_SHARE_INITIATE_LINK | \
NDDE_SHARE_POKE | \
DELETE)
#define NDDE_SHARE_GENERIC_EXECUTE (NDDE_SHARE_INITIATE_STATIC | \
NDDE_SHARE_INITIATE_LINK | \
NDDE_SHARE_EXECUTE)
#define NDDE_SHARE_GENERIC_ALL (NDDE_SHARE_READ | \
NDDE_SHARE_WRITE | \
NDDE_SHARE_INITIATE_STATIC | \
NDDE_SHARE_INITIATE_LINK | \
NDDE_SHARE_REQUEST | \
NDDE_SHARE_ADVISE | \
NDDE_SHARE_POKE | \
NDDE_SHARE_EXECUTE | \
NDDE_SHARE_ADD_ITEMS | \
NDDE_SHARE_LIST_ITEMS | \
DELETE | \
READ_CONTROL | \
WRITE_DAC | \
WRITE_OWNER)
#define NDDE_ITEM_REQUEST (0x00000001)
#define NDDE_ITEM_ADVISE (0x00000002)
#define NDDE_ITEM_POKE (0x00000004)
#define NDDE_ITEM_GENERIC_READ (NDDE_ITEM_REQUEST | NDDE_ITEM_ADVISE)
#define NDDE_ITEM_GENERIC_WRITE (NDDE_ITEM_POKE)
#define NDDE_ITEM_GENERIC_EXECUTE (0)
#define NDDE_ITEM_GENERIC_ALL (NDDE_ITEM_REQUEST | \
NDDE_ITEM_ADVISE | \
NDDE_ITEM_POKE | \
DELETE | \
READ_CONTROL | \
WRITE_DAC | \
WRITE_OWNER)
#define NDDE_GUI_NONE (0)
#define NDDE_GUI_READ (NDDE_SHARE_GENERIC_READ)
#define NDDE_GUI_READ_LINK (NDDE_SHARE_GENERIC_READ | \
NDDE_SHARE_INITIATE_LINK)
#define NDDE_GUI_CHANGE (NDDE_SHARE_GENERIC_READ | \
NDDE_SHARE_GENERIC_WRITE | \
NDDE_SHARE_GENERIC_EXECUTE)
#define NDDE_GUI_FULL_CONTROL (NDDE_SHARE_GENERIC_ALL)
#endif
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "FBSDKBasicUtility.h"
#import "FBSDKAccessToken.h"
#import "FBSDKApplicationDelegate.h"
#import "FBSDKButton.h"
#import "FBSDKConstants.h"
#import "FBSDKCopying.h"
#import "FBSDKCoreKit.h"
#import "FBSDKGraphErrorRecoveryProcessor.h"
#import "FBSDKGraphRequest.h"
#import "FBSDKGraphRequestConnection.h"
#import "FBSDKGraphRequestDataAttachment.h"
#import "FBSDKMeasurementEvent.h"
#import "FBSDKMutableCopying.h"
#import "FBSDKProfile.h"
#import "FBSDKProfilePictureView.h"
#import "FBSDKSettings.h"
#import "FBSDKTestUsersManager.h"
#import "FBSDKURL.h"
#import "FBSDKUtility.h"
#import "FBSDKAppEvents.h"
#import "FBSDKAppLink.h"
#import "FBSDKAppLinkNavigation.h"
#import "FBSDKAppLinkResolver.h"
#import "FBSDKAppLinkResolving.h"
#import "FBSDKAppLinkReturnToRefererController.h"
#import "FBSDKAppLinkReturnToRefererView.h"
#import "FBSDKAppLinkTarget.h"
#import "FBSDKAppLinkUtility.h"
#import "FBSDKWebViewAppLinkResolver.h"
FOUNDATION_EXPORT double FBSDKCoreKitVersionNumber;
FOUNDATION_EXPORT const unsigned char FBSDKCoreKitVersionString[];
|
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "SNDownloadQueue.h"
@interface P2PResultTwitterView : UIView <SNDownloadQueueDelegate> {
IBOutlet UILabel *name;
IBOutlet UIImageView *portraitImage;
IBOutlet UIButton *saveButton;
IBOutlet UIButton *discardButton;
IBOutlet UIActivityIndicatorView *activity;
NSData *imageBinary;
}
@property (nonatomic, retain) NSData *imageBinary;
@property (nonatomic, readonly) UILabel *name;
- (void)update;
- (void)updatePortraitImageView;
@end
|
// The MIT License (MIT)
// Copyright (c) 2013 lailongwei<lailongwei@126.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __LLBC_COM_OS_HEADER_H__
#define __LLBC_COM_OS_HEADER_H__
#include "llbc/common/PFConfig.h"
// OS header files.
#if LLBC_TARGET_PLATFORM_WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef WINVER
#define WINVER 0x600
#endif
#include <Windows.h>
#include <Winsock2.h>
#include <Mswsock.h>
#include <Ws2tcpip.h>
#include <process.h>
#include <ObjBase.h>
#include <ShlObj.h>
#pragma warning(disable:4091)
#include <DbgHelp.h>
#pragma warning(default:4091)
#endif // LLBC_TARGET_PLATFORM_WIN32
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/timeb.h>
#if LLBC_TARGET_PLATFORM_NON_WIN32
#include <fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <pthread.h>
#include <libgen.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/syscall.h>
#include <netdb.h>
#include <dirent.h>
#include <semaphore.h>
#include <arpa/inet.h>
#include <dlfcn.h>
#include <execinfo.h>
#if LLBC_TARGET_PLATFORM_LINUX
#include <sys/epoll.h>
#endif
#if LLBC_TARGET_PLATFORM_MAC || LLBC_TARGET_PLATFORM_IPHONE
#include <sys/param.h>
#endif
#if LLBC_TARGET_PLATFORM_MAC
#include <mach/mach.h>
#include <mach/mach_time.h>
#endif
#endif // LLBC_TARGET_PLATFORM_NON_WIN32
#if LLBC_TARGET_PLATFORM_WIN32
#include <io.h>
#include <intrin.h>
#endif // LLBC_TARGET_PLATFORM_WIN32
// C standard heder files.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include <errno.h>
#include <signal.h>
#include <time.h>
#if LLBC_TARGET_PLATFORM_NON_WIN32
#include <unistd.h>
#endif
// C++ standard header files.
#include <cstddef>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <memory>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <array>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <limits.h>
#include <functional>
// RTTI support header files.
#include <typeinfo>
#if LLBC_TARGET_PLATFORM_NON_WIN32
#include <cxxabi.h>
#endif
// UUID lib header file.
#if LLBC_TARGET_PLATFORM_NON_WIN32
#include <uuid/uuid.h>
#endif
// iconv lib header file.
#if LLBC_TARGET_PLATFORM_NON_WIN32
#include <iconv.h>
#endif
// Enable posix support, if in WIN32 platform.
#if LLBC_TARGET_PLATFORM_WIN32
#ifndef _POSIX_
#define _POSIX_
#endif // !_POSIX_
#endif // LLBC_TARGET_PLATFORM_WIN32
#endif // !__LLBC_COM_OS_HEADER_H__
|
//
// YPPhotoGroupController.h
// YPPhotoDemo
//
// Created by YueWen on 16/7/13.
// Copyright © 2017年 YueWen. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RITLPhotoTableViewModel.h"
#import "RITLPhotoViewController.h"
NS_ASSUME_NONNULL_BEGIN
@class RITLPhotoGroupViewModel;
/// 显示组的控制器
NS_AVAILABLE_IOS(8_0) @interface RITLPhotoGroupViewController : UITableViewController <RITLPhotoViewController>
/// viewModel
@property (nonatomic, strong) id <RITLPhotoTableViewModel> viewModel;
@end
NS_ASSUME_NONNULL_END
|
// CFW1Factory.h
#ifndef IncludeGuard__FW1_CFW1Factory
#define IncludeGuard__FW1_CFW1Factory
namespace FW1FontWrapper {
// Factory that creates FW1 objects
class CFW1Factory : public IFW1Factory {
public:
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
virtual ULONG STDMETHODCALLTYPE AddRef();
virtual ULONG STDMETHODCALLTYPE Release();
// IFW1Factory
virtual HRESULT STDMETHODCALLTYPE CreateFontWrapper(
ID3D11Device *pDevice,
LPCWSTR pszFontFamily,
IFW1FontWrapper **ppFontWrapper
);
virtual HRESULT STDMETHODCALLTYPE CreateFontWrapper(
ID3D11Device *pDevice,
IDWriteFactory *pDWriteFactory,
const FW1_FONTWRAPPERCREATEPARAMS *pCreateParams,
IFW1FontWrapper **ppFontWrapper
);
virtual HRESULT STDMETHODCALLTYPE CreateFontWrapper(
ID3D11Device *pDevice,
IFW1GlyphAtlas *pGlyphAtlas,
IFW1GlyphProvider *pGlyphProvider,
IFW1GlyphVertexDrawer *pGlyphVertexDrawer,
IFW1GlyphRenderStates *pGlyphRenderStates,
IDWriteFactory *pDWriteFactory,
const FW1_DWRITEFONTPARAMS *pDefaultFontParams,
IFW1FontWrapper **ppFontWrapper
);
virtual HRESULT STDMETHODCALLTYPE CreateGlyphVertexDrawer(
ID3D11Device *pDevice,
UINT VertexBufferSize,
IFW1GlyphVertexDrawer **ppGlyphVertexDrawer
);
virtual HRESULT STDMETHODCALLTYPE CreateGlyphRenderStates(
ID3D11Device *pDevice,
BOOL DisableGeometryShader,
BOOL AnisotropicFiltering,
IFW1GlyphRenderStates **ppGlyphRenderStates
);
virtual HRESULT STDMETHODCALLTYPE CreateTextRenderer(
IFW1GlyphProvider *pGlyphProvider,
IFW1TextRenderer **ppTextRenderer
);
virtual HRESULT STDMETHODCALLTYPE CreateTextGeometry(
IFW1TextGeometry **ppTextGeometry
);
virtual HRESULT STDMETHODCALLTYPE CreateGlyphProvider(
IFW1GlyphAtlas *pGlyphAtlas,
IDWriteFactory *pDWriteFactory,
IDWriteFontCollection *pFontCollection,
UINT MaxGlyphWidth,
UINT MaxGlyphHeight,
IFW1GlyphProvider **ppGlyphProvider
);
virtual HRESULT STDMETHODCALLTYPE CreateDWriteRenderTarget(
IDWriteFactory *pDWriteFactory,
UINT RenderTargetWidth,
UINT RenderTargetHeight,
IFW1DWriteRenderTarget **ppRenderTarget
);
virtual HRESULT STDMETHODCALLTYPE CreateGlyphAtlas(
ID3D11Device *pDevice,
UINT GlyphSheetWidth,
UINT GlyphSheetHeight,
BOOL HardwareCoordBuffer,
BOOL AllowOversizedGlyph,
UINT MaxGlyphCountPerSheet,
UINT MipLevels,
UINT MaxGlyphSheetCount,
IFW1GlyphAtlas **ppGlyphAtlas
);
virtual HRESULT STDMETHODCALLTYPE CreateGlyphSheet(
ID3D11Device *pDevice,
UINT GlyphSheetWidth,
UINT GlyphSheetHeight,
BOOL HardwareCoordBuffer,
BOOL AllowOversizedGlyph,
UINT MaxGlyphCount,
UINT MipLevels,
IFW1GlyphSheet **ppGlyphSheet
);
virtual HRESULT STDMETHODCALLTYPE CreateColor(
UINT32 Color,
IFW1ColorRGBA **ppColor
);
// Public functions
public:
CFW1Factory();
HRESULT initFactory();
// Internal functions
private:
virtual ~CFW1Factory();
HRESULT createDWriteFactory(IDWriteFactory **ppDWriteFactory);
void setErrorString(const wchar_t *str);
// Internal data
private:
ULONG m_cRefCount;
std::wstring m_lastError;
CRITICAL_SECTION m_errorStringCriticalSection;
private:
CFW1Factory(const CFW1Factory&);
CFW1Factory& operator=(const CFW1Factory&);
};
}// namespace FW1FontWrapper
#endif// IncludeGuard__FW1_CFW1Factory
|
#include "test"
#include "test.abc"
#include "test.H"
#include "test'.h"
|
//
// SecondViewController.h
// DFSidebarMenu
//
// Created by Kiss Tamás on 09/03/14.
// Copyright (c) 2014 defko@me.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SecondViewController : UIViewController
@end
|
//
// SWBufferedPipe.h
// This file is part of the "SWApplicationSupport" project, and is distributed under the MIT License.
//
// Created by Samuel Williams on 29/03/08.
// Copyright 2008 Samuel Williams. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface SWBufferedPipe : NSObject {
NSPipe * pipe;
NSMutableData * data;
NSFileHandle * handle;
id delegate;
}
- initWithPipe: (NSPipe *) pipe;
- init;
@property(readonly,retain) NSPipe * pipe;
@property(readonly,retain) NSMutableData * data;
@property(assign) id delegate;
- (void) readInBackgroundAndNotify;
- (void) readToEndOfFileInBackgroundAndNotify;
@end
@interface NSObject (SWBufferedPipeDelegate)
- (void) bufferedPipe: (SWBufferedPipe*)buffer dataAvailable: (NSData*)data;
- (void) bufferedPipe: (SWBufferedPipe*)buffer dataFinished: (NSData*)data;
@end
|
//
// AppDelegate.h
// HeadLineNews
//
// Created by 李明禄 on 15/11/16.
// Copyright © 2015年 SocererGroup. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
@end
|
//
// ViewController.h
// AutoLayout
//
// Created by Ravi Prakash on 04/08/15.
// Copyright (c) 2015 Ravi Prakash. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
@property (strong, nonatomic) UIButton *button1;
@property (strong, nonatomic) UIButton *button2;
@property (strong, nonatomic) UITableView *tableView;
@end
|
/*
SeeedTouchScreen.h - Library for 4-line resistance touch screen.
Modified by loovee Aug 12, 2012.
(c) ladyada / adafruit
Code under MIT License.
*/
#define __PRESSURE 10
#define __PRESURE __PRESSURE // Previous misspelled macro left for backwards compatibility
class Point {
public:
int x, y, z;
public:
Point(void);
Point(int x, int y, int z);
bool operator==(Point);
bool operator!=(Point);
};
class TouchScreen {
private:
unsigned char _yp, _ym, _xm, _xp;
public:
TouchScreen(unsigned char xp, unsigned char yp, unsigned char xm, unsigned char ym);
bool isTouching(void);
Point getPoint();
};
|
#include <stdio.h>
#include <unistd.h>
#include <time.h>
int main(void)
{
int fd;
int ret;
printf("Starting syscall tests\n");
printf("Testing privilege operation return code: ");
fd = open("/dev/dummy", O_RDWR);
if (fd < 0)
printf("SUCCESS (%d)\n", fd);
else
printf("FAIL\n");
printf("Testing privilege elevation return code: ");
ret = write(fd, NULL, 0);
if (ret < 0)
printf("SUCCESS (%d)\n", ret);
else
printf("FAIL\n");
}
|
#pragma once
#include "GameObject.h"
class Gun;
class PickUp : public GameObject
{
protected:
bool m_FlagForReset;
public:
PickUp() {}
PickUp(unsigned int renderOrder, Scene* aScene, std::string aName, std::string aTag, Vector3 aPosition, Vector3 aRotation, Vector3 aScale, Mesh* aMesh, ShaderProgram* aShader, Material* aTexture);
~PickUp();
void OnBeginContact(b2Contact* contact);
void Update(double TimePassed);
void ReturnPickUp();
};
|
#ifndef _CURL_UTILS_CLASS_H_
#define _CURL_UTILS_CLASS_H_
#include <curl/curl.h>
class CurlUtils
{
public:
static int GetInterruptCodeForCurlCallback(CURLoption callback_option);
static CURLoption GetDataOptionForCallbackOption(CURLoption callback_option);
static bool IsDataOption(CURLoption option) noexcept;
static bool IsCallbackOption(CURLoption option) noexcept;
};
#endif // _CURL_UTILS_CLASS_H_
|
#ifndef __WINZIP_JPEG_LZMA_H__
#define __WINZIP_JPEG_LZMA_H__
#if !__LP64__
#define _LZMA_UINT32_IS_ULONG
#endif
#define Byte LzmaByte
#include "../../Other/lzma/LzmaDec.h"
#undef Byte
#endif
|
/*
* Phaser Message protocol
*
*
*/
#ifndef _phaser_msg_h_
#define _phaser_msg_h_
#include "stdint.h"
#include "msg_framework.h"
#include "stream_stat.h"
//===========================================
// Phaser message types
//===========================================
enum {
PH_MSG_Phase = 'P',
PH_MSG_Angle = 'A',
PH_MSG_Control = 'C',
PH_MSG_Config = 'G',
PH_MSG_Test = 'T', // Test message, like ping, but with configuration
PH_MSG_Text = 'X',
};
//===========================================
// Phaser platform types
//===========================================
typedef enum {
PH_TELOSB,
PH_PHASER,
PH_PHASERTX,
PH_SANTA,
} platform_id_t;
// Platform name from ID
#define PH_PLATFORM_NAME( platform_id ) ( \
(platform_id)==PH_TELOSB ? "TelosB" : \
(platform_id)==PH_PHASER ? "Phaser" : \
(platform_id)==PH_PHASERTX ? "PhaserTX" : \
(platform_id)==PH_SANTA ? "Santa" : \
"?")
//===========================================
// Configuration parameters
//===========================================
// RSSI and TX power types
typedef int8_t rssi_t;
typedef int8_t lqi_t;
typedef uint8_t tx_power_t;
// structure for the iterator
typedef struct
{
int idx;
int limit;
} loop_int_t;
// Default value (0). Use to init variables of this type.
#define LOOP_INT_0 { 0,0 }
// Phase test setup
typedef struct
{
uint8_t start;
uint8_t step;
uint16_t count;
} iter8_config_t;
// Angle configuration type
typedef uint16_t angle_t;
enum { ANGLE_NOT_SET_VALUE= 0xffff };
// Phase configuration type
typedef uint8_t phase_t;
enum { phase_max_c = 0xff };
// Test iterators
typedef struct
{
loop_int_t power;
loop_int_t phaseA;
loop_int_t phaseB;
loop_int_t angle;
} test_loop_t;
// Default value (0). Use to init variables of this type.
#define TEST_LOOP_INIT_VAL { LOOP_INT_0,LOOP_INT_0,LOOP_INT_0,LOOP_INT_0 }
#define TEST_CONFIG_POWER_LIST_SIZE 8
//--------------------------------------------
// Antenna state variables, union by platform
// This defines the state and is updated during the each test run
typedef union
{
struct {
uint16_t i16;
};
struct { // Phaser
uint8_t phaseA;
uint8_t phaseB;
};
struct { // PhaserTX
uint8_t phase;
uint8_t attenuation;
};
struct { // Santa
uint8_t santa_pins;
uint8_t santa_extra;
};
} ant_state_t;
// Antena configuration parameters, union by platform
// These define the test parameters, limits, iteration count, etc.
typedef union
{
struct { // Phaser
iter8_config_t phaseA;
iter8_config_t phaseB;
};
struct { // PhaserTX
iter8_config_t phase;
iter8_config_t attenuation;
};
struct { // Santa
iter8_config_t santa_pins;
uint32_t santa_extra;
};
} ant_test_config_t;
// Test run setup
typedef struct
{
uint8_t platform_id;
uint16_t start_delay; // delay before the test starts in ms
uint16_t send_count; // Number of experiments per each configuration
uint16_t send_delay; // delay between test message sends in ms
uint16_t angle_step;
uint16_t angle_count;
tx_power_t power[TEST_CONFIG_POWER_LIST_SIZE];
ant_test_config_t ant;
} test_config_t;
//===========================================
// Messages
//===========================================
typedef struct
{
msg_timestamp_t timestamp;
uint16_t msgCounter;
uint16_t expIdx; // Experiment index/counter
angle_t angle;
ant_state_t ant;
// phase_t phaseA;
// phase_t phaseB;
uint8_t power; // cc2420: 0(min) - 31(max)
} __attribute__((packed))
phaser_ping_t;
// phaser_config_t;
typedef struct
{
angle_t angle;
msg_action_t action;
} __attribute__((packed))
phaser_angle_t;
typedef struct
{
msg_action_t action;
} __attribute__((packed))
phaser_control_t;
//===========================================
// Experimental data
//===========================================
STREAM_STAT_DECLARE(rssi_data_t, int32_t);
STREAM_STAT_DECLARE(lqi_data_t, int32_t);
typedef struct
{
// int expIdx;
tx_power_t power;
angle_t angle;
phase_t phase;
rssi_data_t rssi_data;
lqi_data_t lqi_data;
} experiment_t;
#endif // _phaser_msg_h_
|
#pragma once
#include <tuple>
#include <type_traits>
#include "utils.h"
namespace twistoy {
namespace detail {
template<typename T, typename U>
typename std::enable_if<std::is_convertible<T, U>::value || std::is_convertible<U, T>::value, bool>::type compare(T t, U u) {
return t == u;
}
bool compare(...) {
return false;
}
template<int I, typename T, typename... Args>
struct find_index {
static int call(const std::tuple<Args...> &t, T&& val) {
return (compare(std::get<I>(t), val) ? I : find_index<I - 1, T, Args...>::call(t, std::forward<T>(val)));
}
};
template<typename T, typename... Args>
struct find_index<0, T, Args...> {
static int call(const std::tuple<Args...> &t, T&& val) {
return (compare(std::get<0>(t), val) ? 0 : -1);
}
};
template<int I, typename T, typename First, typename... Rest>
struct find_type_impl :
std::conditional<std::is_same<T, First>::value, std::integral_constant<int, I>, find_type_impl<I + 1, T, Rest...>>::type {};
template<int I, typename T, typename First>
struct find_type_impl<I, T, First> :
std::conditional<std::is_same<T, First>::value, std::integral_constant<int, I>, std::integral_constant<int, -1>>::type {};
template<int... I, typename Tuple>
auto _reverse_impl(const Tuple& t, seq<I...>) {
return std::make_tuple(std::get<I>(t)...);
}
template<int I1, int... I2, typename Tuple>
void _traverse_tuple_impl(const Tuple& t, seq<I1, I2...>) {
cout << std::get<I1>(t) << endl;
_traverse_tuple_impl(t, seq<I2...>());
}
template<typename Tuple>
void _traverse_tuple_impl(const Tuple& t, seq<>) {}
}
// find if val in the tuple
// if exists, return the index of val; else return -1
template<typename T, typename... Args>
int find_index(const std::tuple<Args...>& t, T&& val) {
return detail::find_index<sizeof...(Args)-1, T, Args...>::call(t, std::forward<T>(val));
}
// find if type T in the tuple
// if exists, value will be the index; else value will be -1
template<typename T, typename... Args>
struct find_type : detail::find_type_impl<0, T, Args...> {};
// find out and return the value of type T in the tuple
template<typename T, typename... Args>
T find_type_value(const std::tuple<Args...>& t) {
if (find_type<T, Args...>::value != -1) {
return std::get<find_type<T, Args...>::value>(t);
}
else {
throw invalid_argument("there's no type t in the tuple");
}
}
// return a tuple which is reverse from input
template<typename... Args>
auto get_reverse_tuple(const std::tuple<Args...>& t) {
return detail::_reverse_impl(t, static_range<sizeof...(Args), -1>::type());
}
// traverse a tuple, and output each element
template<typename... Args>
void traverse_tuple(const std::tuple<Args...>& t) {
detail::_traverse_tuple_impl(t, static_range<sizeof...(Args)>::type());
}
} |
//
// MQBridgeWrapper.h
// MQExtensionKit
//
// Created by Elwinfrederick on 14/09/2017.
// Copyright © 2017 冯明庆. All rights reserved.
//
#import "MQRouterDefine.h"
#if __has_include(<MGJRouter/MGJRouter.h>)
#ifndef MQ_ROUTER_W
#define MQ_ROUTER_W MQBridgeWrapper.mq_shared
#endif
@import MGJRouter;
@interface MQBridgeWrapper : NSObject
/// note : what ever you use the 'alloc init' or some intial method , // 所有的 alloc init 或 任何初始化操作
/// note : this Wrapper returns the same object , // 包裹者 返回同一个对象
/// note : absolute singleton // 绝对单例
+ (instancetype) new NS_UNAVAILABLE;
+ (instancetype) mq_shared ;
// begin with scheme , like "scheme://do sth" // 用一个 scheme 来初始化 , 比如 "scheme://do sth"
// note : only the first time have its effect (scheme can't be re-configured again) . // 只第一次使用有效 , scheme 不能被重新设置
+ (instancetype) mq_shared_with_scheme : (MQRouterRegistKey) s_scheme ;
// regist // 注册
//- (instancetype) mq_regist_fallback : (void (^)(MQRouterPatternInfo dInfos)) fallback ;
- (instancetype) mq_regist_operation : (MQRouterRegistKey) s_url
action : (void(^)(MQRouterPatternInfo dInfos)) action ;
- (instancetype) mq_regist_object : (MQRouterRegistKey) s_url
value : (id(^)(MQRouterPatternInfo d_infos)) value ;
// deregist // 取消注册
- (instancetype) mq_deregist : (MQRouterRegistKey) s_url ;
// open // 打开
- (BOOL) mq_is_can_open : (MQRouterRegistKey) s_url ;
- (instancetype) mq_call : (MQRouterPatternInfo) d_pattern
fallback : (void(^)(MQRouterPatternInfo d_infos)) fallback ;
- (id) mq_get : (MQRouterPatternInfo) d_pattern
fallback : (void(^)(MQRouterPatternInfo)) fallback ;
FOUNDATION_EXPORT MQRouterOperateKey mq_router_fallback_url ; // can be customed by user with 'mq_sharedWithScheme:' methods // 可以被开发者使用 'mq_sharedWithScheme:' 来设置
MQRouterPatternInfo mq_router_url_make(MQRouterRegistKey s_url) ;
MQRouterPatternInfo mq_router_url_pattern_make(MQRouterRegistKey s_url ,
NSDictionary *d_user_info) ;
/// note : completion block only works with regist methods // 完成 block 只在 注册过的方法中有效
/// note : if uses in call method , completion will have no values . // 如果在回调中使用 , block 没有值 .
MQRouterPatternInfo mq_router_url_pattern_completion_make(MQRouterRegistKey s_url ,
NSDictionary *d_user_info ,
MQRouterCompletionBlock) ;
@end
#endif
|
/**
* Contains useful functions that can be used in any module.
*/
/**
* @file utils.h
* @author Jeremy Attali, Johan Attali
* @date July 23, 2013
*/
#pragma once
/**
* Get the path of a given filepath.
*/
void get_file_path(char* filepath, char* path);
/**
* Get the file name of a given filepath.
*/
void get_file_name(char* filepath, char* filename);
/**
* Get the extension of a given filepath.
*/
void get_file_extension(const char* filepath, char* ext);
|
#include "lab5.h"
#include "lab5t1.h"
#include "lab5t2.h"
#include "lab5t3.h"
int main (void)
{
int option = 0, lab_task = 0;
while (lab_task >= 0)
{
while (lab_task == 0)
{
option = display_menu ("Lab 5 Main Menu", "1. Task 1 - Prime Numbers\n2. Task 2 - Employee Pay\n3. Task 3 - Number Guess Ultra\n4. Quit", 4, 1);
if (option == 1)
{
lab_task = 1;
}
else if (option == 2)
{
lab_task = 2;
}
else if (option == 3)
{
lab_task = 3;
}
else
{
lab_task = -1;
}
}
while (lab_task == 1)
{
task1_main ();
system ("pause");
system ("cls");
lab_task = 0;
}
while (lab_task == 2)
{
task2_main ();
system ("pause");
system ("cls");
lab_task = 0;
}
while (lab_task == 3)
{
task3_main ();
system ("pause");
system ("cls");
lab_task = 0;
}
}
} |
//
// AppDelegate.h
// PhotoPicker
//
// Created by S on 15/11/16.
// Copyright © 2015年 S. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// ASITestCase.h
// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
//
// Created by Ben Copsey on 26/07/2009.
// Copyright 2009 All-Seeing Interactive. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <GHUnit/GHUnit.h>
#else
#import <GHUnit/GHUnit.h>
#endif
@interface ASITestCase : GHTestCase {
}
- (NSString *)filePathForTemporaryTestFiles;
@end
|
/*
* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef CHAIN_PROBLEM_H
#define CHAIN_PROBLEM_H
class chainProblem : public Test
{
public:
chainProblem()
{
//dump
{
b2Vec2 g(0.000000000000000e+00f, -1.000000000000000e+01f);
m_world->SetGravity(g);
b2Body** bodies = (b2Body**)b2Alloc(2 * sizeof(b2Body*));
b2Joint** joints = (b2Joint**)b2Alloc(0 * sizeof(b2Joint*));
{
b2BodyDef bd;
bd.type = b2BodyType(0);
bd.position.Set(0.000000000000000e+00f, 0.000000000000000e+00f);
bd.angle = 0.000000000000000e+00f;
bd.linearVelocity.Set(0.000000000000000e+00f, 0.000000000000000e+00f);
bd.angularVelocity = 0.000000000000000e+00f;
bd.linearDamping = 0.000000000000000e+00f;
bd.angularDamping = 0.000000000000000e+00f;
bd.allowSleep = bool(4);
bd.awake = bool(2);
bd.fixedRotation = bool(0);
bd.bullet = bool(0);
bd.active = bool(32);
bd.gravityScale = 1.000000000000000e+00f;
bodies[0] = m_world->CreateBody(&bd);
{
b2FixtureDef fd;
fd.friction = 2.000000029802322e-01f;
fd.restitution = 0.000000000000000e+00f;
fd.density = 0.000000000000000e+00f;
fd.isSensor = bool(0);
fd.filter.categoryBits = uint16(1);
fd.filter.maskBits = uint16(65535);
fd.filter.groupIndex = int16(0);
b2ChainShape shape;
b2Vec2 vs[3];
vs[0].Set(0.000000000000000e+00f, 1.000000000000000e+00f);
vs[1].Set(0.000000000000000e+00f, 0.000000000000000e+00f);
vs[2].Set(4.000000000000000e+00f, 0.000000000000000e+00f);
shape.CreateChain(vs, 3);
shape.m_prevVertex.Set(4.719737010713663e-34f, 8.266340761211261e-34f);
shape.m_nextVertex.Set(1.401298464324817e-45f, 8.266340761211261e-34f);
shape.m_hasPrevVertex = bool(0);
shape.m_hasNextVertex = bool(0);
fd.shape = &shape;
bodies[0]->CreateFixture(&fd);
}
}
{
b2BodyDef bd;
bd.type = b2BodyType(2);
bd.position.Set(6.033980250358582e-01f, 3.028350114822388e+00f);
bd.angle = 0.000000000000000e+00f;
bd.linearVelocity.Set(0.000000000000000e+00f, 0.000000000000000e+00f);
bd.angularVelocity = 0.000000000000000e+00f;
bd.linearDamping = 0.000000000000000e+00f;
bd.angularDamping = 0.000000000000000e+00f;
bd.allowSleep = bool(4);
bd.awake = bool(2);
bd.fixedRotation = bool(0);
bd.bullet = bool(1);
bd.active = bool(32);
bd.gravityScale = 1.000000000000000e+00f;
bodies[1] = m_world->CreateBody(&bd);
{
b2FixtureDef fd;
fd.friction = 2.000000029802322e-01f;
fd.restitution = 0.000000000000000e+00f;
fd.density = 1.000000000000000e+01f;
fd.isSensor = bool(0);
fd.filter.categoryBits = uint16(1);
fd.filter.maskBits = uint16(65535);
fd.filter.groupIndex = int16(0);
b2PolygonShape shape;
b2Vec2 vs[8];
vs[0].Set(5.000000000000000e-01f, -3.000000000000000e+00f);
vs[1].Set(5.000000000000000e-01f, 3.000000000000000e+00f);
vs[2].Set(-5.000000000000000e-01f, 3.000000000000000e+00f);
vs[3].Set(-5.000000000000000e-01f, -3.000000000000000e+00f);
shape.Set(vs, 4);
fd.shape = &shape;
bodies[1]->CreateFixture(&fd);
}
}
b2Free(joints);
b2Free(bodies);
joints = NULL;
bodies = NULL;
}
}
static Test* Create()
{
return new chainProblem;
}
};
#endif
|
#include <cs50.h>
#include <stdio.h>
int main(int argc, string argv[])
{
if (argc != 2)
{
printf("missing command-line argument\n");
return 1;
}
printf("hello, %s\n", argv[1]);
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.