text stringlengths 4 6.14k |
|---|
#pragma once
/*
The MIT License (MIT)
Copyright (c) 2015 Dennis Wandschura
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.
*/
namespace Graphics
{
class CommandQueue;
}
struct FrameData;
#include "CommandList.h"
#include "CommandAllocator.h"
#include "Heap.h"
#include "Resource.h"
#include <vector>
#include <vxEngineLib/Event.h>
#include <memory>
class DownloadManager
{
struct DownloadEntry;
struct CopyEntry;
d3d::GraphicsCommandList* m_currentCommandList;
std::unique_ptr<d3d::GraphicsCommandList[]> m_commandLists;
u32 m_buildCommandList;
d3d::Resource m_bufferDownload;
std::vector<CopyEntry> m_copyEntries;
std::vector<DownloadEntry> m_entries;
u32 m_capacity;
u32 m_size;
d3d::Heap m_heapDownload;
bool queueCopyBuffer(d3d::Resource* cpySrc, u32 cpyOffset, u32 size, u8* cpuDst, const Event &evt);
public:
DownloadManager();
~DownloadManager();
bool initialize(ID3D12Device* device, FrameData* frameData, u32 frameCount);
void shutdown();
void pushDownloadBuffer(u8* dst, u32 size, d3d::Resource* cpySrc, u32 cpyOffset, const Event &evt);
void buildCommandList(FrameData* currentFrameData, u32 frameIndex);
void submitCommandList(Graphics::CommandQueue* queue);
void downloadToCpu();
}; |
/*
* Copyright (c) 2011 Pedro Borges and contributors
*/
#include "fail.h"
#include <zmq.h>
#include <caml/callback.h>
#include <caml/alloc.h>
#include <caml/fail.h>
#include <caml/memory.h>
/* This table must be synchronized with the variant definition. */
static int const caml_zmq_error_table[] = {
EINVAL,
EFAULT,
EMTHREAD,
ETERM,
ENODEV,
EADDRNOTAVAIL,
EADDRINUSE,
ENOCOMPATPROTO,
EPROTONOSUPPORT,
EAGAIN,
ENOTSUP,
EFSM,
ENOMEM,
EINTR
};
/* This must be the last value of the variant. */
static int const caml_zmq_EUNKNOWN =
(sizeof caml_zmq_error_table) / (sizeof caml_zmq_error_table[0]);
void caml_zmq_raise_if(int condition) {
CAMLparam0 ();
CAMLlocalN(error_parameters, 2);
if(condition) {
int error_to_raise = caml_zmq_EUNKNOWN;
int current_errno = zmq_errno();
int i;
for (i = 0; i < caml_zmq_EUNKNOWN; i++) {
if (current_errno == caml_zmq_error_table[i]) {
error_to_raise = i;
break;
}
}
error_parameters[0] = Val_int(error_to_raise);
error_parameters[1] = caml_copy_string(zmq_strerror(current_errno));
caml_raise_with_args(
*caml_named_value("zmq exception"),
2,
error_parameters);
}
CAMLreturn0;
}
|
#pragma once
#include <iomanip>
#include "Util.h"
namespace plog
{
class TxtFormatter
{
public:
static util::nstring header()
{
return util::nstring();
}
static util::nstring format(const Record& record)
{
tm t;
util::localtime_s(&t, &record.getTime().time);
util::nstringstream ss;
ss << t.tm_year + 1900 << "-" << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mon + 1 << "-" << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mday << " ";
ss << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_hour << ":" << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_min << ":" << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_sec << "." << std::setfill(PLOG_NSTR('0')) << std::setw(3) << record.getTime().millitm << " ";
ss << std::setfill(PLOG_NSTR(' ')) << std::setw(5) << std::left << severityToString(record.getSeverity()) << " ";
ss << "[" << record.getTid() << "] ";
ss << "[" << record.getFunc() << "@" << record.getLine() << "] ";
ss << record.getMessage() << "\n";
return ss.str();
}
};
}
|
//
// OAuthJsonResponse.h
// Instasite
//
// Created by mike davis on 10/24/15.
// Copyright © 2015 Instasite. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface OAuthJsonResponse : NSObject
@property (strong, nonatomic) NSString *accessToken;
@property (strong, nonatomic) NSString *scope;
- (instancetype)initFromJson:(NSDictionary *)json;
@end
|
/* Scale in the key of 1/10000 */
/*
These are periods -- if you delay this long,
then toggle the speaker pin, you'll get approximate
pitches.
This is the 16-bit version. The pitches get less accurate
as they get higher, but not as bad as the 8-bit one.
"x" denotes sharp.
Can be generated by Python:
import math
scale = ['C', 'Cx', 'D', 'Dx', 'E', 'F', 'Fx', 'G', 'Gx', 'A', 'Ax', 'B']
def octave(baseLength):
periods = [baseLength / math.exp(x*math.log(2)/12) for x in range(0, 12)]
periods = [int(round(x)) for x in periods]
return( zip(scale, periods) )
for i in range(0,4):
for note, period in octave(10000 / 2**i):
if period < 65500:
noteString = note + str(i)
print "#define {:<5}{:>6}".format(noteString, period)
*/
#define C0 10000
#define Cx0 9439
#define D0 8909
#define Dx0 8409
#define E0 7937
#define F0 7492
#define Fx0 7071
#define G0 6674
#define Gx0 6300
#define A0 5946
#define Ax0 5612
#define B0 5297
#define C1 5000
#define Cx1 4719
#define D1 4454
#define Dx1 4204
#define E1 3969
#define F1 3746
#define Fx1 3536
#define G1 3337
#define Gx1 3150
#define A1 2973
#define Ax1 2806
#define B1 2649
#define C2 2500
#define Cx2 2360
#define D2 2227
#define Dx2 2102
#define E2 1984
#define F2 1873
#define Fx2 1768
#define G2 1669
#define Gx2 1575
#define A2 1487
#define Ax2 1403
#define B2 1324
#define C3 1250
#define Cx3 1180
#define D3 1114
#define Dx3 1051
#define E3 992
#define F3 936
#define Fx3 884
#define G3 834
#define Gx3 787
#define A3 743
#define Ax3 702
#define B3 662
|
/*
* This file is part of the gk project (https://github.com/recp/gk)
* Copyright (c) Recep Aslantas.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "../../common.h"
#include "../../../include/gk/gk.h"
#include "rn_light.h"
#include "rn_pass.h"
#include "rn_transp.h"
bool
gkPrimIsTransparent(GkScene * __restrict scene,
GkGeometryInst * __restrict modelInst,
GkPrimInst * __restrict primInst) {
return gkIsTransparent(scene, primInst->activeMaterial);
}
bool
gkIsTransparent(GkScene * __restrict scene,
GkMaterial * __restrict mat) {
GkColor *color;
GkTechnique *tech;
float opacity;
if (!(scene->flags & GK_SCENEF_TRANSP)
|| !(tech = mat->technique)
|| !tech->transparent)
return false;
color = NULL;
if (tech->transparent->color
&& tech->transparent->color->method == GK_COLOR_COLOR)
color = tech->transparent->color->val;
switch (tech->transparent->opaque) {
case GK_OPAQUE_A_ONE: {
opacity = tech->transparent->amount;
if (color)
return (color->rgba.A * opacity) < 1.0f;
return opacity < 1.0f;
}
case GK_OPAQUE_A_ZERO: {
opacity = 1.0f - tech->transparent->amount;
if (color)
return (color->rgba.A * opacity) > 0.0f;
return opacity < 1.0f;
}
case GK_OPAQUE_RGB_ONE: {
opacity = tech->transparent->amount;
if (color)
return (glm_luminance(color->vec) * opacity) < 1.0f;
return opacity < 1.0f;
}
case GK_OPAQUE_RGB_ZERO: {
opacity = 1.0f - tech->transparent->amount;
if (color)
return (glm_luminance(color->vec) * opacity) > 0.0f;
return opacity < 1.0f;
}
case GK_OPAQUE_MASK: {
return false;
}
default: return true;
}
}
|
//
// AppDelegate.h
// Wisp
//
// Created by Daniel Larsson on 9/14/14.
// Copyright (c) 2014 Daniel Larsson. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
@property (strong, nonatomic) UIWindow *window;
@end
|
#pragma once
#include <core/core.h>
#include <core/reflection/type/Argument.h>
#include <memory>
// template implementation
#include <core/reflection/type/TypeInfo.h>
#include <utility>
NS_BEGIN(CORE_NAMESPACE)
template<typename T> const T& Argument::ref()const{return *cast<T>();}
template<typename T> T& Argument::ref(){return *cast<T>();}
template<typename T> T Argument::rvalue()const{
T v = ref<T>();
return v;
//return std::move<T>(v);
}
/* template<typename T>
auto
Argument::convert ()const -> decltype(choose_reference<T>::template choose<const Argument>(Argument())){
return choose_reference<T>::template choose<const Argument>(*this);
}*/
/*
template<typename T>
Argument::operator T && ()const{
T result = *cast<T>();
//return std::move<T>(result);
return result;
}*/
template<typename T>
Argument::Argument(const T & data):
data(std::static_pointer_cast<void>(std::shared_ptr<T>(new T(data)))),
type(type_of<T>()){
}
template<typename T>
Argument::Argument(std::shared_ptr<T> data):
data(std::static_pointer_cast<void>(data)),
type(type_of<T>()){
}
template<typename T>
Argument::operator const T & ()const{
if(!(bool)data){
throw std::exception();//("dereferencing null pointer in Argument");
}
return *cast<T>();
}
template<typename T>
Argument::operator T & (){
if(!(bool)data){
throw std::exception();//("dereferencing null pointer in Argument");
}
return *cast<T>();
}
template<typename T>
Argument::operator std::shared_ptr<const T>()const{
return cast<const T>();
}
template<typename T>
Argument::operator std::shared_ptr<T>(){
return cast<T>();
}
template<typename T>
std::shared_ptr<T> Argument::cast(){
return std::static_pointer_cast<T>(data);
}
template<typename T>
std::shared_ptr< const T> Argument::cast()const{
return std::static_pointer_cast<T>(data);
}
template<typename T> const T* Argument::c_ptr()const{
return std::static_pointer_cast<T>(data).get();
}
template<typename T> T* Argument::c_ptr(){
return std::static_pointer_cast<T>(data).get();
}
template<typename T> const std::shared_ptr<T> Argument::ptr()const{
return std::static_pointer_cast<T>(data);
}
template<typename T> std::shared_ptr<T> Argument::ptr(){
return std::static_pointer_cast<T>(data);
}
template<typename T> const std::weak_ptr<T> Argument::w_ptr()const{
return std::weak_ptr<T>(ptr<T>());
}
template<typename T> std::weak_ptr<T> Argument::w_ptr(){
return std::weak_ptr<T>(ptr<T>());
}
NS_END(CORE_NAMESPACE)
|
//
// IMArtistListDisplayArtist.h
// iTunesMusic
//
// Created by Toni on 13/01/16.
// Copyright © 2016 Toni. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface IMArtistListDisplayArtist : NSObject
@property (nonatomic, assign) NSInteger artistId;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *artworkURL;
+ (instancetype)displayArtistWithId:(NSInteger)artistId name:(NSString *)name artworkURL:(NSString *)artworkURL;
@end
|
//
// Arrow.h
// AJPickerButton
//
// Created by 钟宝健 on 15/10/11.
// Copyright © 2015年 钟宝健. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface Arrow : UIView
- (instancetype)initWithFrame:(CGRect)frame withArrowColor:(UIColor *)arrowColor;
@end
|
#ifndef AUDIOLISTENERBPM_H
#define AUDIOLISTENERBPM_H
#include <MiniBpm/MiniBpm.h>
#include <QTimer>
#include "audiolistener.h"
#define BPM_INTERVAL 1000
class AudioListenerBPM : public AudioListener
{
// BPM is actually computed periodically - every 1 second
// Save CPU to save kittens
Q_OBJECT
Q_PROPERTY(double bpm READ bpm NOTIFY bpmChanged)
double m_bpm;
breakfastquay::MiniBPM m_miniBPM;
QTimer *m_timer;
private slots:
void processSampleData();
void updateBPM();
public:
explicit AudioListenerBPM(QObject *parent = 0);
double bpm() const;
signals:
void bpmChanged();
public slots:
};
#endif // AUDIOLISTENERBPM_H
|
// stdafx.h : ±ê׼ϵͳ°üº¬ÎļþµÄ°üº¬Îļþ£¬
// »òÊǾ³£Ê¹Óõ«²»³£¸ü¸ÄµÄ
// ÌØ¶¨ÓÚÏîÄ¿µÄ°üº¬Îļþ
#pragma once
#include "../../agorasdk/include/AgoraBase.h"
#include "../../agorasdk/include/IAgoraLog.h"
#include "../../agorasdk/include/IAgoraMediaEngine.h"
#include "../../agorasdk/include/IAgoraRtcEngine.h"
#include "../../agorasdk/include/IAgoraService.h"
#include "../../agorasdk/include/IAgoraRtcChannel.h"
#include "../include/common.h"
#if defined _M_IX86
#pragma comment(lib, "../../agorasdk/x86/agora_rtc_sdk.lib")
#elif defined _M_X64
#pragma comment(lib, "../../agorasdk/x86_64/agora_rtc_sdk.lib")
#endif
//#pragma comment(lib, "../../agorasdk/lib/libagora_segmentation_extension.lib")
|
/*!
@class YMACardModel
@version 4.1
@author Dmitry Shakolo
@creation_date 18.09.15
@copyright Copyright (c) 2020 NBCO YooMoney LLC. All rights reserved.
@discussion Card model.
*/
#import "YMAMoneySourceModel.h"
typedef NS_ENUM(NSUInteger, YMACardState) {
YMACardStateUnknown,
YMACardStateActive,
YMACardStateActiveNoPin,
YMACardStateAwaitActivation,
YMACardStateBlocked,
YMACardStateExpired
};
typedef NS_ENUM(NSUInteger, YMACardKind) {
YMACardKindPlastic,
YMACardKindVirtual
};
typedef NS_ENUM(NSUInteger, YMACardEmission) {
YMACardEmissionUnknown,
YMACardEmissionYoocard
};
NS_ASSUME_NONNULL_BEGIN
extern NSString *const YMACardIdKey;
extern NSString *const YMACardTypeKey;
extern NSString *const YMACardPanFragmentKey;
extern NSString *const YMACardStateKey;
extern NSString *const YMACardKindKey;
extern NSString *const YMACardEmissionKey;
@interface YMACardModel : YMAMoneySourceModel
@property (nonatomic, copy, readonly) NSString *cardId;
@property (nonatomic, assign, readonly) YMACardState state;
@property (nonatomic, assign, readonly) YMACardKind kind;
@property (nonatomic, assign, readonly) YMACardEmission emission;
+ (instancetype)cardWithId:(NSString *)cardId
type:(YMAPaymentCardType)cardType
panFragment:(NSString *)panFragment
state:(YMACardState)state
kind:(YMACardKind)kind
emission:(YMACardEmission)emission;
+ (instancetype)cardByDictionary:(NSDictionary *)dictionary;
+ (instancetype)cardByDictionary:(NSDictionary *)dictionary
kind:(YMACardKind)kind
emission:(YMACardEmission)emission;
+ (YMACardState)cardStateByString:(NSString *)stateString;
NS_ASSUME_NONNULL_END
@end
|
// Flib
// $Id$
#ifndef __MEMORY_H
#define __MEMORY_H
#include <new>
#include "core/Types.h"
namespace Flib
{
#define LENGTH(x) (sizeof(x)/sizeof(x[0]))
template<typename T> T* ConstructInPlace(T* p)
{
return new (p) T;
}
template<typename T> void DestructInPlace(T* p)
{
p->~T();
}
/**
* Swap two values.
* It is recommended that you specialize (or overload) this function for classes
* that allocate memory on assignment so they can be swapped more efficiently.
* @param a First value
* @param b Second value
* @see String and Vector swap for examples
*/
template<typename T> void swap(T& a, T& b)
{
T tmp(a);
a = b;
b = tmp;
}
}; // namespace Flib
#endif // __MEMORY_H
|
#pragma once
#include <atomic>
namespace xi {
inline namespace ext {
using ::std::atomic;
using ::std::memory_order_acquire;
using ::std::memory_order_release;
using ::std::memory_order_relaxed;
using ::std::memory_order_acq_rel;
using ::std::memory_order_seq_cst;
using ::std::atomic_signal_fence;
} // inline namespace ext
} // namespace xi
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <mpi.h>
#include "GoL.h"
#include "communicate.h"
#include "io.h"
void io_MPI(short ** matrix, int proc_rank, int printing_proc, int size_x, int size_y, int num_guard_cells, int proc_size_x, int proc_size_y,
struct topology my_topology, int timestep)
{
// to do:
// adapt io routine so that the [0,0] processor doesn't need to hold all of the data from all the processors at the same time
int ierr;
short sub_matrix[ size_x-2*num_guard_cells ][(size_y-2*num_guard_cells)*proc_size_y];
int i,j;
// Gather across rows
for (i=num_guard_cells; i<size_x-num_guard_cells; ++i)
{
if(my_topology.coords[1] == 0)
{
ierr = MPI_Gather( &(matrix[i][num_guard_cells]),size_y-2*num_guard_cells, MPI_SHORT,
&(sub_matrix[i-num_guard_cells]), size_y-2*num_guard_cells, MPI_SHORT, 0, my_topology.row);
}
else
{
void * blank_ptr;
ierr = MPI_Gather(&(matrix[i][num_guard_cells]), size_y-2*num_guard_cells, MPI_SHORT,
blank_ptr, size_y-2*num_guard_cells, MPI_SHORT, 0, my_topology.row);
}
}
// Gather across columns
if( (my_topology.coords[0]==0) && (my_topology.coords[1]==0) )
{
char filename[256];
if (timestep != -1)
{
sprintf(filename,"data/step_%04d.dat",timestep);
}
else
{
strcpy(filename, "data/final.dat");
}
FILE *file_pointer = fopen(filename, "w");
for (j=0; j<(size_x-2*num_guard_cells); ++j)
{
int k;
for( k=0; k<(size_y-2*num_guard_cells)*proc_size_y; ++k)
{
fprintf(file_pointer, "%d ", sub_matrix[j][k]);
}
fprintf(file_pointer, "\n");
}
for(i=1; i<proc_size_x; ++i)
{
MPI_Status recv_status;
int count = proc_size_y*(size_y-2*num_guard_cells)*(size_x-2*num_guard_cells);
int source = i;
int tag = i;
ierr = MPI_Recv(sub_matrix, count, MPI_SHORT, source, tag, my_topology.column, &recv_status );
for (j=0; j<(size_x-2*num_guard_cells); ++j)
{
int k;
for( k=0; k<(size_y-2*num_guard_cells)*proc_size_y; ++k)
{
fprintf(file_pointer, "%d ", sub_matrix[j][k]);
}
fprintf(file_pointer, "\n");
}
}
fclose(file_pointer);
}
else if( (my_topology.coords[0]!=0) && (my_topology.coords[1]==0) )
{
int count = proc_size_y*(size_y-2*num_guard_cells)*(size_x-2*num_guard_cells);
int dest = 0;
int tag = my_topology.coords[0];
ierr = MPI_Send(sub_matrix, count, MPI_SHORT, dest, tag, my_topology.column);
}
return;
}
void add_benchmark_result(int proc_size, double delta_time, int real_cells, int num_timesteps)
{
// // Ultimately we'll want something like 'tau' for our performance model:
// double tau = delta_time / (real_cells * num_timesteps);
char filename[] = "data/benchmark_results.dat";
FILE *file_pointer = fopen(filename, "a");
fprintf(file_pointer, "%d %e %d %d \n", proc_size, delta_time, real_cells, num_timesteps);
fclose(file_pointer);
return;
}
|
#ifndef MYTYPE_H
#define MYTYPE_H
#include <QObject>
class MyType : public QObject
{
Q_OBJECT
Q_PROPERTY( QString helloWorld READ helloWorld WRITE setHelloWorld NOTIFY helloWorldChanged )
public:
explicit MyType(QObject *parent = 0);
~MyType();
Q_SIGNALS:
void helloWorldChanged();
protected:
QString helloWorld() { return m_message; }
void setHelloWorld(QString msg);
//{ m_message = msg; Q_EMIT helloWorldChanged(); }
QString m_message;
};
#endif // MYTYPE_H
|
//
// ViewController.h
// MGWatchdog
//
// Created by Max Gordeev on 30/05/15.
//
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#ifndef ABOUTDIALOG_H
#define ABOUTDIALOG_H
#include <QDialog>
namespace Ui {
class AboutDialog;
}
class AboutDialog : public QDialog
{
Q_OBJECT
public:
explicit AboutDialog(QWidget *parent = 0);
~AboutDialog();
private slots:
void on_okButton_clicked();
private:
Ui::AboutDialog *ui;
};
#endif // ABOUTDIALOG_H
|
//
// ManualSessionWithUserScenario.h
// iOSTestApp
//
// Created by Delisa on 7/13/18.
// Copyright © 2018 Bugsnag. All rights reserved.
//
#import "Scenario.h"
@interface ManualSessionWithUserScenario : Scenario
@end
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSCharacterSet.h"
@interface NSCharacterSet (IBCharacterSetAdditions)
+ (id)ib_cExtendedIdentifierInitialCharacterSet;
+ (id)ib_cExtendedIdentifierCharacterSet;
@end
|
#pragma once
#include <overworld/schema/Dungeon.h>
#include <functional>
#include <overworld/expressions/Block_Expression.h>
namespace overworld {
namespace exploring {
using Profession_Delegate = std::function<void(const Profession &)>;
class Profession_Explorer {
const Profession_Delegate action;
void explore_expression(const Expression &expression);
// void explore_profession(const Profession &profession);
// void explore_function(const Function &function);
// void explore_block(const Block &block);
// void explore_scope(const Scope &scope);
public:
Profession_Explorer(const Profession_Delegate &action) : action(action) {}
void explore_block(const Block &block);
};
}
} |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "WXPBGeneratedMessage.h"
@class NSString;
@interface CardListItem : WXPBGeneratedMessage
{
}
+ (void)initialize;
// Remaining properties
@property(retain, nonatomic) NSString *cardExt; // @dynamic cardExt;
@property(retain, nonatomic) NSString *cardTpId; // @dynamic cardTpId;
@property(nonatomic) int isSucc; // @dynamic isSucc;
@end
|
//
// KZ.h
// KZ
//
// Created by Kesi Maduka on 1/25/16.
// Copyright © 2016 Storm Edge Apps LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for KZ.
FOUNDATION_EXPORT double KZVersionNumber;
//! Project version string for KZ.
FOUNDATION_EXPORT const unsigned char KZVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <KZ/PublicHeader.h>
|
//
// AppDelegate.h
// SCProgressHUD
//
// Created by 孙程 on 16/7/14.
// Copyright © 2016年 Suncheng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
// Add ugfx user font library headers here, e.g.
// #include <ugfx-arduino-font-SourceSansPro-Regular14.h>
|
/*
File: GenerateConstraints.h
Authors:
Indranil Saha (isaha@cse.iitk.ac.in)
Ankush Desai(ankush@eecs.berkeley.edu)
This file is used for generating Z3 constraints.
*/
void GenerateVariableDeclarations(ofstream &ofp, int number_of_points);
void GenerateInitialLocationConstraints(ofstream &ofp, RobotPosition pos_start);
void GenerateFinalDestinationConstraints(ofstream &ofp, RobotPosition pos_end, int number_of_points);
void GenerateObstacleConstraints(ofstream &ofp, int length_x, int length_y, RobotPosition_Vector obstacles);
void GenerateTransitionConstraints(ofstream &ofp, MotionPrimitive_Vector primitives, int length_x, int length_y, RobotPosition_Vector obstacles, int number_of_points);
void GenerateCostConstraint(ofstream &ofp, int number_of_points, float total_cost);
void GenerateOutputConstraints(ofstream &ofp, int number_of_points);
string FloatToReal(float flf);
template <typename T> string ToSTR(const T& t);
#define MAX_SIZE_OF_WORKSPACE 100
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject-Protocol.h"
@protocol MKLocationProviderDelegate <NSObject>
- (void)locationProvider:(id)arg1 didReceiveError:(id)arg2 monitoringRegion:(id)arg3;
- (void)locationProvider:(id)arg1 didExitRegion:(id)arg2;
- (void)locationProvider:(id)arg1 didEnterRegion:(id)arg2;
- (void)locationProviderDidResumeLocationUpdates:(id)arg1;
- (void)locationProviderDidPauseLocationUpdates:(id)arg1;
- (_Bool)locationProviderShouldPauseLocationUpdates:(id)arg1;
- (void)locationProviderDidChangeAuthorizationStatus:(id)arg1;
- (void)locationProvider:(id)arg1 didReceiveError:(id)arg2;
- (void)locationProvider:(id)arg1 didUpdateHeading:(id)arg2;
- (void)locationProvider:(id)arg1 didUpdateLocation:(id)arg2 lastKnownNavCourse:(double)arg3;
- (void)locationProvider:(id)arg1 didUpdateLocation:(id)arg2;
@end
|
/**
* || ____ _ __
* +------+ / __ )(_) /_______________ _____ ___
* | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
* +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
* || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
*
* Crazyflie control firmware
*
* Copyright (C) 2011-2012 Bitcraze AB
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, in version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* configblock.c - Simple static implementation of the config block
*/
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include "configblock.h"
#include "config.h"
/* Internal format of the config block */
#define MAGIC 0x43427830
#define VERSION 0
struct configblock_s {
/* header */
uint32_t magic;
uint8_t version;
/* Content */
uint8_t radioChannel;
uint8_t radioSpeed;
float calibPitch;
float calibRoll;
/* Simple modulo 256 checksum */
uint8_t cksum;
} __attribute__((__packed__));
static struct configblock_s *configblock;
static bool cb_ok=false;
static uint8_t calculate_cksum(void* data, size_t len)
{
unsigned char* c = data;
int i;
unsigned char cksum=0;
for (i=0; i<len; i++)
cksum += *(c++);
return cksum;
}
int configblockInit(void)
{
configblock = (void*)CONFIG_BLOCK_ADDRESS;
//Verify the config block
if (configblock->magic!=MAGIC || configblock->version!= VERSION ||
calculate_cksum(configblock, sizeof(*configblock)) )
return -1;
cb_ok = true;
return 0;
}
int configblockTest(void)
{
return true;
}
/* Static accessors */
int configblockGetRadioChannel(void)
{
if (cb_ok)
return configblock->radioChannel;
else
return RADIO_CHANEL;
}
int configblockGetRadioSpeed(void)
{
if (cb_ok)
return configblock->radioSpeed;
else
return RADIO_DATARATE;
}
float configblockGetCalibPitch(void)
{
if (cb_ok)
return configblock->calibPitch;
else
return 0;
}
float configblockGetCalibRoll(void)
{
if (cb_ok)
return configblock->calibRoll;
else
return 0;
}
|
/*++
Copyright (c) 2012 Microsoft Corporation
Module Name:
subpaving_tactic.h
Abstract:
"Fake" tactic used to test subpaving module.
Author:
Leonardo de Moura (leonardo) 2012-08-07.
Revision History:
--*/
#ifndef __SUBPAVING_TACTIC_H_
#define __SUBPAVING_TACTIC_H_
#include"params.h"
class ast_manager;
class tactic;
tactic * mk_subpaving_tactic(ast_manager & m, params_ref const & p = params_ref());
#endif
|
#pragma once
#include "AzHeartbeat.h"
extern "C" __declspec(dllexport) CAzHeartbeat* WINAPI CreateAzHeartbeatObject();
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ls.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gmange <gmange@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2013/12/09 15:28:28 by gmange #+# #+# */
/* Updated: 2014/04/16 19:46:08 by gmange ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_ls.h"
/*
** ft_initlst
** initialise begin of list : ls->lst
*/
/*
** should desactivate options not managed / tested.
** only work now -a. Should test / fine tune -lrtR
*/
/*
** ft_parser
** registering options of user
*/
/*
** if there were files (not folders) in arguments, print asap sorted
** then remove those arguments from argv - list the in an array
*/
/*
** non-fonctionnel:
** * ls /dev
** * ls /dev/fd
*/
static int ft_initlst(t_ls *ls)
{
const char options[] = "-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1";
ft_bzero(ls, sizeof(*ls));
if (!(LGL_OPT = ft_strdup(options)))
ft_error_exit("malloc error", ls);
if (!(OPT = ft_strnew(ft_strlen(options))))
ft_error_exit("malloc error", ls);
return (0);
}
static int parser(int argc, char **argv, t_ls *ls)
{
int i;
int j;
i = 0;
while ((++i < argc && argv[i][0] == '-'))
{
j = 0;
while (argv[i][++j])
{
if (!ft_strchr(LGL_OPT, argv[i][j]))
ft_error_illegal_option(ls, argv[i][j]);
OPT[ft_strichr(LGL_OPT, argv[i][j])]++;
}
}
OPT[E_LO_R] = OPT[E_LO_R] ? -1 : 1;
if (OPT[E_LO_L])
{
if (!(NOW = (time_t*)ft_memalloc(MAX_LEN_NBR)))
ft_error_exit("malloc error", ls);
}
OPT[E_UP_R] = 0; /* désactivaiton de -R */
return (i);
}
static int argv_to_lst(char *argv, t_file **lst, t_ls *ls)
{
t_file *cur;
if (!(cur = ft_tlsnew(NULL, ls)))
ft_error_exit("malloc error - ls: ", ls);
if (!(PTH = ft_strdup(argv)))
ft_error_exit("malloc error - ls: ", ls);
if (*lst)
(*lst)->nxt = cur;
else
*lst = cur;
return (0);
}
int main(int argc, char **argv)
{
t_ls ls;
int i;
t_file *lst;
ft_initlst(&ls);
lst = NULL;
i = parser(argc, argv, &ls);
if (i == argc)
{
if (argv_to_lst(".", &lst, &ls) == 1)
return (1);
}
while (i < argc)
{
if (argv_to_lst(argv[i++], &lst, &ls) == 1)
return (1);
}
read_argv(&lst, &ls);
tls_del(&ls);
return (0);
}
|
#ifndef __c_learning__stack__
#define __c_learning__stack__
typedef struct MC_Stack MC_Stack;
extern MC_Stack * MC_StackNew ( void );
extern int MC_StackIsEmpty( MC_Stack *stack );
extern void MC_StackPush ( MC_Stack *stack, void *value );
extern void * MC_StackPop ( MC_Stack *stack );
extern void MC_StackFree ( MC_Stack **stack );
#ifdef DEBUG
extern void MC_StackSuite();
#endif
#endif /* defined(__c_learning__stack__) */
|
#ifndef PLAYER_H
#define PLAYER_H
#include <QMutex>
#include <QThread>
#include <QImage>
#include <QWaitCondition>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "opencv2/video/video.hpp"
#include <opencv2/objdetect/objdetect.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <QFile>
#include <QCoreApplication>
#include <QTextStream>
#include <QStringList>
#include <stdio.h>
using namespace std;
using namespace cv;
class Player : public QThread
{ Q_OBJECT
private:
bool stop;
QMutex mutex;
QWaitCondition condition;
Mat frame;
int frameRate;
VideoCapture *capture;
Mat RGBframe;
QImage img;
signals:
//Signal to output frame to be displayed
void processedImage(const QImage &image,int index);
void processImageMat(const Mat &frame,int index);
void testData(const int, const int);
protected:
void run();
void msleep(int ms);
public:
int type = 0;
int currentImageIndex = 0;
/*
bool recording = false;
int recording_index = 0;
//char recording_folder[30] = {'t','e','s','t'};
char *recording_folder = "test";
bool Recording(string filename);
*/
//Constructor
Player(QObject *parent = 0);
//Destructor
~Player();
//Load a video from memory
bool loadVideo(string filename);
bool loadImages(string filename);
//Play the video
void Play();
//Stop the video
void Stop();
//check if the player has been stopped
bool isStopped() const;
//set video properties
void setCurrentFrame( int frameNumber);
//Get video properties
double getFrameRate();
double getCurrentFrame();
double getNumberOfFrames();
};
#endif // PLAYER_H
|
//
// AppDelegate.h
// PrettyTunnel
//
// Created by zhang fan on 14/11/5.
//
//
#import <UIKit/UIKit.h>
@class SOCKSProxy;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
+ (AppDelegate*)sharedInstance;
- (SOCKSProxy*)socksProxy;
@end
|
#import "MOBProjection.h"
@interface MOBProjectionEPSG32125 : MOBProjection
@end
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class IBLiveViewsBundle, NSError, NSObject<IBLiveViewsBundleObserverEnvironment>;
@protocol IBLiveViewsBundleObserver <NSObject>
- (NSObject<IBLiveViewsBundleObserverEnvironment> *)environmentForObservingLiveViewsBundle:(IBLiveViewsBundle *)arg1;
- (void)liveViewsBundleWillInvalidate:(IBLiveViewsBundle *)arg1;
- (void)liveViewsBundleDidFinishBuilding:(IBLiveViewsBundle *)arg1 error:(NSError *)arg2;
- (void)liveViewsBundleNeedsToBeRebuilt:(IBLiveViewsBundle *)arg1;
@end
|
#pragma once
namespace lif
{
enum EItemType : unsigned __int16
{
eItemType_Unknown,
eItemType_BasicMesh // SBasicMesh
};
}
|
//
// MyView.h
// FirstTestFrameworks
//
// Created by huangshupeng on 2016/12/20.
// Copyright © 2016年 huangshupeng. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MyModel.h"
@interface MyView : UIView
@end
|
//
// DataController.h
// Finesse
//
// Created by Leonardo Lee on 2/7/15.
// Copyright (c) 2015 Code Fellows Malibu Awesome. All rights reserved.
//
#import <Foundation/Foundation.h>
@class UserProfile;
@interface DataController : NSObject
@property (nonatomic, strong) UserProfile *userProfile;
+(DataController *)sharedInstance;
@end
|
/*///////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
Plik: 3dMath.h
Autor: Real_Noname (real_noname@wp.pl)
(C): CODE RULERS (Real_Noname)
WWW: www.coderulers.prv.pl
Opis: Zawiera definicje klas i funkcji u³atwiaj¹ce
prowadzenia ró¿norakich obliczeñ matematycznych.
/////////////////////////////////////////////////////////
///////////////////////////////////////////////////////*/
#pragma once
#include <glm/vec3.hpp>
#include <CBCore/StringConvert.h>
#include <math.h>
#include "StrEx.h"
constexpr float PIOVER180 = 0.0174532925199432957692369076848861f;
constexpr float POW(float P) { return P * P; }
/* KLASA P£ASZCZYZN
P³aszczyzna, to niczym nie ograniczona
powieszchnia, która posiada tylko kierunek
przedni oraz przesuniêcie. Jest BARDZO
przydatna je¿eli chodzi o grafike 3D.
*/
class Planef
{
public:
glm::vec3 Normal;
float D = 0.0f;
public:
Planef();
Planef(const glm::vec3& normal, const float distance);
Planef(const glm::vec3& normal, const glm::vec3& point);
Planef(const glm::vec3& v1, const glm::vec3& v2, const glm::vec3& v3);
void Set(const glm::vec3& v1, const glm::vec3& v2, const glm::vec3& v3);
void Set(const glm::vec3& normal, const glm::vec3& pos);
const float Distance( const glm::vec3& pos ) const;
const bool Intersects( const glm::vec3& origin, const glm::vec3& dest, glm::vec3& outIntersect ) const;
};
/// <summary>
/// Klasa obiektów
/// Fizyczny obiekt opsiadaj¹cy pozycjê
/// oraz promieñ objêtoci.
/// </summary>
class CObject
{
protected:
float Angle = 0.0f;
public:
glm::vec3 Pos;
float Radius = 0.0f;
public:
CObject() = default;
CObject(const float radius) : Radius(radius){}
virtual ~CObject() = default;
virtual void SetAngle(const float angle){ Angle = angle; }
virtual const float GetAngle() const { return Angle; }
virtual const bool IsCollidable() const { return true; }
};
/// <summary>
/// Klasa jednostek
/// Jest to rodzaj obiektów posiadaj¹cych dynamikê.
/// Objawia siê ona zwrotem/kierunkiem w który mog¹
/// byæ zwrócone oraz pozycj¹ w której chc¹ siê znaleæ.
/// </summary>
class CDynamic :
public CObject
{
public:
glm::vec3 NextPos;
glm::vec3 Vector;
public:
CDynamic() : CObject(3.0f){};
CDynamic(const float radius) : CObject(radius){}
virtual ~CDynamic(){}
const glm::vec3 GetMoveVector() const { return NextPos - Pos; }
glm::vec3 GetBlockPos();
virtual const bool OnCollision( CObject* pObject ){ return false; };
virtual const bool OnCollision( const glm::vec3& point, const Planef& plane ){ return false; }
};
glm::vec3 MakeNormal( const glm::vec3& v1, const glm::vec3& v2, const glm::vec3& v3 );
glm::vec3 MakeVectorXZ( const float degAngle );
float Distance( const glm::vec3& V1, const glm::vec3& V2 );
float pythagoreanTheorem( const float A, const float B);
glm::vec3 ClosestPoint( const glm::vec3& V1, const glm::vec3 &V2, const glm::vec3 &Point );
float GetAngle( const glm::vec3& V1, const glm::vec3 &V2 );
float SwapAngle( float degAngle );
namespace core {
template<class _Type>
bool beetween(_Type value, _Type minValue, _Type maxValue) {
return minValue < value&& value < maxValue;
}
} |
/* algo3-11.c ÀûÓ÷ÇÑ»·Ë³Ðò¶ÓÁвÉÓùã¶ÈËÑË÷·¨Çó½âÃÔ¹¬ÎÊÌâ(Ò»Ìõ·¾¶) */
#include"c1.h"
#define M 5 /* ÃÔ¹¬ÐÐÊý(°üÀ¨Íâǽ) */
#define N 5 /* ÃÔ¹¬ÁÐÊý(°üÀ¨Íâǽ) */
#define D 8 /* ÒÆ¶¯·½ÏòÊý,Ö»ÄÜÈ¡4ºÍ8¡£(8¸ö,¿ÉбÐÐ;4¸ö,Ö»¿ÉÖ±×ß) */
typedef struct /* ¶¨Òå¶ÓÁÐÔªËØºÍÕ»ÔªËØÎªÍ¬ÀàÐ͵ĽṹÌå */
{
int x,y; /* µ±Ç°µãµÄÐÐÖµ£¬ÁÐÖµ */
int pre; /* ǰһµãÔÚ¶ÓÁÐÖеÄÐòºÅ */
}QElemType,SElemType; /* ¶¨ÒåÕ»ÔªËØºÍ¶ÓÁÐÔªËØ */
#include"c3-1.h" /* Õ»µÄ´æ´¢½á¹¹ */
#include"bo3-1.c" /* Õ»µÄ»ù±¾²Ù×÷ */
#include"c3-3.h" /* ¶ÓÁеĴ洢½á¹¹ */
#include"bo3-4.c" /* ¶ÓÁеĻù±¾²Ù×÷ */
struct /* ÒÆ¶¯Êý×é,ÒÆ¶¯·½ÏòÓÉÕý¶«Æð˳ʱÕëת */
{
int x,y;
#if D==8
}move[D]={{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1},{-1,0},{-1,1}};
#endif
#if D==4
}move[D]={{0,1},{1,0},{0,-1},{-1,0}};
#endif
Status Path(int maze[M][N]) /* ¹ã¶ÈËÑË÷·¨ÇóÒ»ÌõÃÔ¹¬Â·¾¶ */
{
SqQueue q; /* ²ÉÓ÷ÇÑ»·Ë³Ðò¶ÓÁÐ */
QElemType qf,qt; /* µ±Ç°µãºÍÏÂÒ»µã */
SqStack s; /* ²ÉÓÃ˳ÐòÕ» */
int i,j,flag=1; /* µ±ÕÒµ½³ö¿Ú,flag=0 */
int x1,y1; /* ÖÕµãµÄ×ø±ê */
printf("ÇëÊäÈëÈë¿ÚµÄÐÐ,ÁÐ(×óÉϽÇΪ1,1)\n");
scanf("%d,%d",&qf.x,&qf.y);
printf("ÇëÊäÈë³ö¿ÚµÄÐÐ,ÁÐ(ÓÒϽÇΪ%d,%d)\n",M-2,N-2);
scanf("%d,%d",&x1,&y1);
qf.pre=-1; /* ÉèÈë¿Ú(µÚÒ»µã)µÄÉÏÒ»µãµÄÐòºÅ=-1 */
maze[qf.x][qf.y]=-1; /* ³õʼµãÉèΪ-1(ÒÑ·ÃÎʹý) */
InitQueue(&q);
EnQueue(&q,qf); /* ÆðµãÈë¶Ó */
while(!QueueEmpty(q)&&flag)
{ /* ¶ÓÁÐÖл¹ÓÐû±»¹ã¶ÈËÑË÷¹ýµÄµãÇÒ»¹Ã»ÕÒµ½³ö¿Ú */
DeQueue(&q,&qf); /* ³ö¶ÓqfΪµ±Ç°µã */
for(i=0;i<D;i++) /* Ïò¸÷¸ö·½Ïò³¢ÊÔ */
{
qt.x=qf.x+move[i].x; /* ÏÂÒ»µãµÄ×ø±ê */
qt.y=qf.y+move[i].y;
if(maze[qt.x][qt.y]==1)
{ /* ´ËµãÊÇͨµÀÇÒ²»Ôø±»·ÃÎʹý */
maze[qt.x][qt.y]=-1; /* ÒÑ·ÃÎʹý */
qt.pre=q.front-1; /* ÉÏÒ»µã´¦ÓÚ¶ÓÁÐÖÐÏÖ¶ÓÍ·¼õÒ»µÄλÖÃ(ûɾ³ý) */
EnQueue(&q,qt); /* Èë¶Ó */
if(qt.x==x1&&qt.y==y1) /* µ½´ïÖÕµã */
{
flag=0;
break;
}
}
}
}
if(flag) /* ËÑË÷ÍêÕû¸ö¶ÓÁл¹Ã»µ½´ïÖÕµã */
{
printf("ûÓз¾¶¿Éµ½´ïÖյ㣡\n");
return ERROR;
}
else
{
InitStack(&s); /* ³õʼ»¯sÕ» */
i=q.rear-1; /* iΪ´ýÈëÕ»ÔªËØÔÚ¶ÓÁÐÖеÄλÖà */
while(i>=0) /* ûµ½Èë¿Ú */
{
Push(&s,*(q.base+i));
i=(*(q.base+i)).pre; /* iÎªÇ°Ò»ÔªËØÔÚ¶ÓÁÐÖеÄλÖà */
}
i=0; /* iΪ×ß³öÃÔ¹¬µÄ²½Öè */
while(!StackEmpty(s))
{
Pop(&s,&qf);
i++;
maze[qf.x][qf.y]=i;
}
printf("×ß³öÃÔ¹¬µÄÒ»¸ö·½°¸£º\n");
for(i=1;i<M-1;i++) /* Êä³ömaze[][],ÆäÖµÊÇ×ß³öÃÔ¹¬µÄ²½Öè */
{
for(j=1;j<N-1;j++)
printf("%3d",maze[i][j]);
printf("\n");
}
return OK;
}
}
void main()
{
int i,j;
int maze[M][N]; /* ÃÔ¹¬Êý×é */
printf("%dÐÐ%dÁÐÃÔ¹¬(²»°üÀ¨Íâǽ)\n",M-2,N-2);
for(i=0;i<N;i++)
{ /* 0Ϊǽ,1ΪͨµÀ */
maze[0][i]=0; /* ±±Ç½ */
maze[M-1][i]=0; /* ÄÏǽ */
}
for(i=1;i<M-1;i++)
{
maze[i][0]=0; /* Î÷ǽ */
maze[i][N-1]=0; /* ¶«Ç½ */
}
printf("Çë°´ÐÐÊäÈëÃÔ¹¬½á¹¹(²»°üÀ¨Öܱß,0Ϊǽ,1ΪͨµÀ),Èç1 0 0 1\n");
for(i=1;i<M-1;i++)
for(j=1;j<N-1;j++)
scanf("%d",&maze[i][j]);
printf("ÃÔ¹¬½á¹¹(°üÀ¨Íâǽ):\n");
for(i=0;i<M;i++)
{
for(j=0;j<N;j++)
printf("%3d",maze[i][j]);
printf("\n");
}
Path(maze);
}
|
/*-----------------------------------------------------------
Name: fisp
Author: fisper@163.com
Date: 2016.12
Copyright (c). All rights reserved.
------------------------------------------------------------*/
#pragma once
#include "base.h"
namespace fisp
{
namespace utility
{
/*-----------------------------------------------------------
class IDBPath
------------------------------------------------------------*/
class IDBPath : public IRoot
{
public:
virtual void setFileAndData(const String& file, const String& data) = 0;
virtual void getFileAndData(String& file, String& data) const = 0;
// only change data name. Default data name is "data".
virtual void dataName(const String& strDataName) = 0;
virtual void dataField(const String& strData) = 0;
virtual const String& dataField() const = 0;
virtual void fileField(const String& file) = 0;
virtual const String& fileField() const = 0;
virtual void appField(const String& strApp) = 0;
virtual const String& appField() const = 0;
virtual void sourceField(const String& path) = 0;
virtual String source(bool absolute = true) const = 0;
virtual void configField(const String& path) = 0;
virtual String config(bool absolute = true) const = 0;
virtual void storeField(const String& path) = 0;
virtual String store(bool absolute = true) const = 0;
virtual void usersField(const String& path) = 0;
virtual String users(bool absolute = true) const = 0;
virtual void shaderField(const String& path) = 0;
virtual String shader(bool absolute = true) const = 0;
virtual void webField(const String& path) = 0;
virtual String web(bool absolute = true) const = 0;
virtual const String& exePath() const = 0;
virtual void exePath(const String& path) = 0;
virtual const String& dataPath() const = 0;
virtual void dataPath(int uPreDirectory) = 0;
};
/*-----------------------------------------------------------
class DBPath
------------------------------------------------------------*/
class DBPath : public IDBPath
{
public:
void setFileAndData(const String& file, const String& data) override;
void getFileAndData(String& file, String& data) const override;
// only change path name. Default path name is "data".
void dataName(const String& strDataName) override;
void dataField(const String& strData) override;
const String& dataField() const override;
void fileField(const String& file) override;
const String& fileField() const override;
void appField(const String& strApp) override;
const String& appField() const override;
void sourceField(const String& path) override;
String source(bool absolute = true) const override;
void configField(const String& path) override;
String config(bool absolute = true) const override;
void storeField(const String& path) override;
String store(bool absolute = true) const override;
void usersField(const String& path) override;
String users(bool absolute = true) const override;
void shaderField(const String& path) override;
String shader(bool absolute = true) const override;
void webField(const String& path) override;
String web(bool absolute = true) const override;
const String& exePath() const override;
void exePath(const String& path) override;
virtual const String& dataPath() const override;
virtual void dataPath(int uPreDirectory) override;
public:
DBPath();
DBPath(const DBPath& other);
void fromPath(const String& strPath, int uPreDirectory);
static String extractPath(const String& strPath, int uPreDirectory);
protected:
String mstrData; // Only data path, not include file name.
String mstrFile; // Only file name , not include path.
String mstrApp; // app imp name used to specify sub path.
String mstrSource; // relative path , not absolute path.
String mstrConfig; // relative path , not absolute path.
String mstrStore; // relative path , not absolute path.
String mstrUsers; // relative path , not absolute path.
String mstrShader; // relative path , not absolute path.
String mstrWeb; // relative path , not absolute path.
String mstrExePath; // absolute exe path.
String mstrDataPath; // absolute data path.
};
}
}
|
//
// EDTabBarButtonCell.h
// Editor
//
// Created by Todd Ditchendorf on 8/6/13.
// Copyright (c) 2013 Todd Ditchendorf. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface EDTabBarButtonCell : NSButtonCell
+ (CGGradientRef)iconGradientForMain:(BOOL)isMain highlighted:(BOOL)isHi;
+ (NSColor *)iconStrokeColorForMain:(BOOL)isMain highlighted:(BOOL)isHi;
+ (NSShadow *)iconShadowForMain:(BOOL)isMain highlighted:(BOOL)isHi;
@end
|
// ======================================================================
/*!
* \brief Utilities for handling TimeSeries values
*/
// ======================================================================
#pragma once
#include <timeseries/TimeSeriesInclude.h>
namespace SmartMet
{
namespace Plugin
{
namespace Dali
{
double get_double(const TS::Value& value);
double get_double(const TS::TimedValue& timedvalue);
int get_fmisid(const TS::Value& value);
int get_fmisid(const TS::TimedValue& value);
} // namespace Dali
} // namespace Plugin
} // namespace SmartMet
|
#pragma once
#include <windows.h>
void Var_DisplayMainWindow();
void Var_SetVariableType(int);
void Var_RefreshVariables();
|
//
// MainNavController.h
// LittleBee
//
// Created by maoge on 16/12/19.
// Copyright © 2016年 maoge. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MainNavController : UINavigationController
@end
|
/** @file glass_defs.h
* @brief Definitions, types, etc for use inside glass.
*/
/* Copyright (C) 2010,2014,2015,2017 Olly Betts
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef XAPIAN_INCLUDED_GLASS_DEFS_H
#define XAPIAN_INCLUDED_GLASS_DEFS_H
#include "xapian/common/internaltypes.h"
/// Glass table extension.
#define GLASS_TABLE_EXTENSION "glass"
/// Default B-tree block size.
#define GLASS_DEFAULT_BLOCKSIZE 8192
/// Minimum B-tree block size.
#define GLASS_MIN_BLOCKSIZE 2048
/// Maximum B-tree block size.
#define GLASS_MAX_BLOCKSIZE 65536
/** The largest docid value supported by glass.
*
* The disk format supports 64-bit docids, but if Xapian::docid is narrower
* then it's the largest value supported by the type that matters here.
*/
#define GLASS_MAX_DOCID Xapian::docid(0xffffffffffffffff)
namespace Glass {
enum table_type {
POSTLIST,
DOCDATA,
TERMLIST,
POSITION,
SPELLING,
SYNONYM,
MAX_
};
}
/// A block number in a glass Btree file.
typedef uint4 glass_block_t;
/// The revision number of a glass database.
typedef uint4 glass_revision_number_t;
/// How many entries there are in a table.
typedef unsigned long long glass_tablesize_t;
#endif // XAPIAN_INCLUDED_GLASS_DEFS_H
|
/**
* test.c 2014-05-08
* anonymouse(anonymouse@email)
*
* Copyright (C) 2000-2014 All Right Reserved
*
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
* PARTICULAR PURPOSE.
*
* Auto generate for Design Patterns in C
*/
#include <stdio.h>
#include <stdlib.h>
#include <mycommon.h>
#include <myobj.h>
#include <mytrace.h>
#include <test_suite.h>
#include "wrapper.h"
#include "core.h"
static int test_main_entry(char *output, size_t sz)
{
TODO(Please add our **test** code here ...)
return 0;
}
void main_entry_test(void);
void main_entry_test(void)
{
my_test_suite_add(test_main_entry, "Test decorator encode");
}
|
#include <stdlib.h>
#include <sys/times.h>
#include "mylib.h"
void delete_tms(struct tms *ptms) {
free(ptms);
}
clock_t get_tms_cstime(struct tms *ptms) {
return ptms->tms_cstime;
}
clock_t get_tms_cutime(struct tms *ptms) {
return ptms->tms_cutime;
}
clock_t get_tms_stime(struct tms *ptms) {
return ptms->tms_stime;
}
clock_t get_tms_utime(struct tms *ptms) {
return ptms->tms_utime;
}
struct tms * new_tms() {
return malloc(sizeof(struct tms));
}
|
/*
Copyright (C) 2011 by Ivan Safrin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#pragma once
#include "polycode/core/PolyString.h"
#include "polycode/core/PolyGlobals.h"
#include "polycode/core/PolyEventHandler.h"
#include <vector>
namespace Polycode {
class Event;
typedef struct {
EventHandler *handler;
int eventCode;
} EventEntry;
/**
* Can dispatch events. The event dispatcher is base class which allows its subclass to dispatch custom events which EventHandler subclasses can then listen to. EventDispatcher and EventHandler are the two main classes in the Polycode event system. If you are familiar with ActionScript3's event system, you will find this to be very similar, except that it uses integers for event codes for speed, rather than strings.
*/
class _PolyExport EventDispatcher : public EventHandler {
public:
/**
* Default constructor
*/
EventDispatcher();
virtual ~EventDispatcher();
/**
* Removes all current event handlers from this dispatcher.
*/
void removeAllHandlers();
/**
* Removes all current event handlers from this dispatcher for a specific event listener.
* @param Event listener to remove handlers for.
*/
void removeAllHandlersForListener(EventHandler *handler);
/**
* Adds an event listener for a specific event code. Once a listener is registered for a specific event code, that listener will start getting event callbacks into the handleEvent() method.
* @param handler The event handler to add as a listener
* @param eventCode The requested event code to listen to.
* @see EventHandler
*/
void addEventListener(EventHandler *handler, int eventCode);
/**
* Adds an event listener for specified event code if it hasn't already been added, otherwise does nothing.
* @param handler The event handler to add as a listener
* @param eventCode The requested event code to listen to.
*/
void addEventListenerUnique(EventHandler *handler, int eventCode);
/**
* Returns true if this event dispatcher is registered with the specified EventHandler with the specified event code.
* @param handler EventHandler to check.
* @param eventCode The event code to check.
*/
bool hasEventListener(EventHandler *handler, int eventCode);
/**
* Removes a listener for a specific handler and event code.
* @param handler The event handler to remove as a listener
* @param eventCode The requested event code to remove listener for.
* @see EventHandler
*/
void removeEventListener(EventHandler *handler, int eventCode);
void __dispatchEvent(Event *event, int eventCode);
/**
* Dispatches an event to all handlers listening for the event code specified.
* @param event Event class to dispatch to listeners. You can subclass the Event class to send data in your events.
* @param eventCode The event code to dispatch the event for.
* @see Event
* @see EventHandler
*/
virtual void dispatchEvent(Event *event, int eventCode);
virtual void dispatchEventNoDelete(Event *event, int eventCode);
protected:
std::vector<EventEntry> handlerEntries;
};
}
|
#import "MOBProjection.h"
@interface MOBProjectionEPSG31976 : MOBProjection
@end
|
/*
* imwhgr.h
* Apple Imagewriter bitmap output helper
* (c) 2013 Daniele Cattaneo
*/
#include "citohapi.h"
#ifndef IMAGEWRITERLIBRARY_IMWHGR_H
#define IMAGEWRITERLIBRARY_IMWHGR_H
int hgrPrintBitmapStripeH8Wk8(printerRef prn, const uint8_t bitmap[], int chrWidth);
int hgrPrintBitmapStripeHiresH16Wk8(printerRef prn, const uint8_t bitmap[], int chrWidth);
#endif
|
#pragma once
#include "types.h"
#include "memory_types.h"
#include <new>
namespace foundation
{
/// Base class for memory allocators.
///
/// Note: Regardless of which allocator is used, prefer to allocate memory in larger chunks
/// instead of in many small allocations. This helps with data locality, fragmentation,
/// memory usage tracking, etc.
class Allocator
{
public:
/// Default alignment for memory allocations.
static const uint32_t DEFAULT_ALIGN = 4;
Allocator() {}
virtual ~Allocator() {}
/// Allocates the specified amount of memory aligned to the specified alignment.
virtual void *allocate(uint32_t size, uint32_t align = DEFAULT_ALIGN) = 0;
/// Frees an allocation previously made with allocate().
virtual void deallocate(void *p) = 0;
static const uint32_t SIZE_NOT_TRACKED = 0xffffffffu;
/// Returns the amount of usable memory allocated at p. p must be a pointer
/// returned by allocate() that has not yet been deallocated. The value returned
/// will be at least the size specified to allocate(), but it can be bigger.
/// (The allocator may round up the allocation to fit into a set of predefined
/// slot sizes.)
///
/// Not all allocators support tracking the size of individual allocations.
/// An allocator that doesn't suppor it will return SIZE_NOT_TRACKED.
virtual uint32_t allocated_size(void *p) = 0;
/// Returns the total amount of memory allocated by this allocator. Note that the
/// size returned can be bigger than the size of all individual allocations made,
/// because the allocator may keep additional structures.
///
/// If the allocator doesn't track memory, this function returns SIZE_NOT_TRACKED.
virtual uint32_t total_allocated() = 0;
private:
/// Allocators cannot be copied.
Allocator(const Allocator& other);
Allocator& operator=(const Allocator& other);
};
/// Creates a new object of type T using the allocator a to allocate the memory.
#define MAKE_NEW(a, T, ...) (new ((a).allocate(sizeof(T), alignof(T))) T(__VA_ARGS__))
#define MAKE_NEW_ARR( a, T, c ) (new ((a).allocate(sizeof(T) * c, alignof(T))) T() )
/// Frees an object allocated with MAKE_NEW.
#define MAKE_DELETE(a, T, p) do {if (p) {(p)->~T(); a.deallocate(p);}} while (0)
#define MAKE_DELETE_ARR(a, T, p) do {if (p) {a.deallocate(p);}} while (0)
/// Functions for accessing global memory data.
namespace memory_globals
{
/// Initializes the global memory allocators. scratch_buffer_size is the size of the
/// memory buffer used by the scratch allocators.
void init(uint32_t scratch_buffer_size = 4*1024*1024);
/// Returns a default memory allocator that can be used for most allocations.
///
/// You need to call init() for this allocator to be available.
Allocator& default_allocator();
/// Returns a default memory allocator that can be used for most allocations.
///
/// You need to call init() for this allocator to be available.
Allocator& default_renderthread_allocator();
/// Returns a "scratch" allocator that can be used for temporary short-lived memory
/// allocations. The scratch allocator uses a ring buffer of size scratch_buffer_size
/// to service the allocations.
///
/// If there is not enough memory in the buffer to match requests for scratch
/// memory, memory from the default_allocator will be returned instaed.
Allocator& default_scratch_allocator();
/// Shuts down the global memory allocators created by init().
void shutdown();
}
namespace memory {
inline void *align_forward(void *p, uint32_t align);
inline void *pointer_add(void *p, uint32_t bytes);
inline const void *pointer_add(const void *p, uint32_t bytes);
inline void *pointer_sub(void *p, uint32_t bytes);
inline const void *pointer_sub(const void *p, uint32_t bytes);
inline void mem_zero( void* P, u32 Size );
}
// ---------------------------------------------------------------
// Inline function implementations
// ---------------------------------------------------------------
// Aligns p to the specified alignment by moving it forward if necessary
// and returns the result.
inline void *memory::align_forward(void *p, uint32_t align) {
uintptr_t pi = uintptr_t(p);
const uint32_t mod = pi % align;
if (mod)
pi += (align - mod);
return (void *)pi;
}
/// Returns the result of advancing p by the specified number of bytes
inline void *memory::pointer_add(void *p, uint32_t bytes) {
return (void*)((char *)p + bytes);
}
inline const void *memory::pointer_add(const void *p, uint32_t bytes) {
return (const void*)((const char *)p + bytes);
}
/// Returns the result of moving p back by the specified number of bytes
inline void *memory::pointer_sub(void *p, uint32_t bytes) {
return (void*)((char *)p - bytes);
}
inline const void *memory::pointer_sub(const void *p, uint32_t bytes) {
return (const void*)((const char *)p - bytes);
}
inline void memory::mem_zero( void* P, u32 Size )
{
memset( P, 0, Size );
}
}
|
#include <limits.h>
#include "heap.h"
int left(int i);
int right(int i);
int parent(int i);
void exchange(heap *h, int x, int y);
void max_heapify(heap *h, int i);
void build_max_heap(heap *h);
void heap_sort(heap *h);
void min_heapify(heap *h, int i);
void build_min_heap(heap * h);
|
//
// RadiozAppDelegate.h
// radioz
//
// Created by Giacomo Tufano on 12/03/12.
// ©2014 Giacomo Tufano.
// Licensed under MIT license. See LICENSE file or http://www.opensource.org/licenses/mit-license.php
//
#import <UIKit/UIKit.h>
#import "PiwikTracker.h"
@class CoreDataController;
@interface RadiozAppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, strong, readonly) CoreDataController *coreDataController;
@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, strong) PiwikTracker *tracker;
@end
|
#ifndef VENUS_H
#define VENUS_H
#include <avr/pgmspace.h>
extern const unsigned char venus_planet[];
#endif |
//
// DetailViewController.h
// Kelley Calling
//
// Created by Grant Isom on 7/26/14.
// Copyright (c) 2014 Grant Isom. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
#import "Directory.h"
@interface DetailViewController : UITableViewController <MFMailComposeViewControllerDelegate, MFMessageComposeViewControllerDelegate>
@property (weak, nonatomic) Directory *directory;
@property (weak, nonatomic) IBOutlet UILabel *firstName;
@property (weak, nonatomic) IBOutlet UILabel *parentsName;
@property (weak, nonatomic) IBOutlet UILabel *lastName;
@property (weak, nonatomic) IBOutlet UINavigationItem *navBar;
@property (weak, nonatomic) IBOutlet UILabel *birthday;
@property (weak, nonatomic) IBOutlet UILabel *gradeLevel;
@property (weak, nonatomic) IBOutlet UIButton *phoneButton;
@property (weak, nonatomic) IBOutlet UIButton *emailAddress;
@property (weak, nonatomic) IBOutlet UIButton *homePhone;
@property (weak, nonatomic) IBOutlet UIButton *AddressLine1;
@property (weak, nonatomic) IBOutlet UIButton *AddressLine2;
@end
|
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
***/
#pragma once
#include "ui_gizmo_glue.inl"
namespace ui
{
class PreviewRenderingPanel;
namespace gizmo
{
struct ReferenceSpace;
///---
/// gizmo render mode, usually there are multiple gizmos in the viewport and this flag tells us if we are the active one or not
enum class GizmoRenderMode : Uint8
{
// no gizmos are active or selected,
Idle,
// user hovers the mouse over this gizmo but does not select it yet
Hover,
// this gizmo has been activated by the user
Active,
// other gizmo is active
OtherActive,
};
///---
/// gizmo space
enum class GizmoSpace : Uint8
{
// use transformations in world space
World,
// use transformations in local space
Local,
// use transformations in parent space
Parent,
// use transformations in view space
View,
};
///---
/// gizmo TRS mode
enum class GizmoMode : Uint8
{
// translation gizmo
Translation,
// rotation gizmo
Rotation,
// scaling gizmo
Scale,
};
//---
/// what to transform
enum class GizmoTarget : Uint8
{
// translate all nodes in the hierarchy (auto extends to children of parents)
WholeHierarchy,
// translate ONLY selected nodes (can move parent without children)
SelectionOnly,
};
//---
/// grid settings
struct UI_GIZMO_API GridSettings
{
RTTI_DECLARE_NONVIRTUAL_CLASS(GridSettings);
public:
Bool m_positionGridEnabled;
Bool m_rotationGridEnabled;
Float m_positionGridSize;
Float m_rotationGridSize;
Bool m_featureSnappingEnabled;
Bool m_rotationSnappingEnabled;
Float m_snappingDistance;
GridSettings();
};
//---
/// gizmo settings
struct UI_GIZMO_API GizmoSettings
{
RTTI_DECLARE_NONVIRTUAL_CLASS(GizmoSettings);
public:
GizmoMode m_mode;
GizmoSpace m_space;
GizmoTarget m_target;
Bool m_enableX;
Bool m_enableY;
Bool m_enableZ;
GizmoSettings();
};
///---
class IGizmo;
typedef base::SharedPtr<IGizmo> GizmoPtr;
class GizmoManager;
class IGizmoInputAction;
typedef base::SharedPtr<IGizmoInputAction> GizmoInputActionPtr;
typedef base::WeakPtr<IGizmoInputAction> GizmoInputActionWeakPtr;
class IGizmoTransformTransaction;
typedef base::SharedPtr<IGizmoTransformTransaction> GizmoTransformTransactionPtr;
class IGizmoTransformContext;
///---
} // gizmo
} // ui
|
#ifndef _EASYTEXPACKER_RECT_H_
#define _EASYTEXPACKER_RECT_H_
namespace etexpacker
{
struct RectSize
{
int width;
int height;
RectSize()
: width(-1), height(-1) {}
RectSize(int w, int h)
: width(w), height(h) {}
};
struct Rect
{
int x;
int y;
int width;
int height;
int tex_id;
Rect()
: tex_id(0) {}
};
}
#endif // _EASYTEXPACKER_RECT_H_ |
/*
* TMC2130.h
*
* Created on: 03 nov 2019
* Author: Tim Evers
*/
#ifndef TMC2130_H_
#define TMC2130_H_
#include <SPI.h>
#include "pins.h"
#include "Board.h"
#if defined(FARMDUINO_EXP_V20) || defined(FARMDUINO_EXP_V22) || defined(FARMDUINO_V30) || defined(FARMDUINO_V32)
#include "TMC2130_Basics.h"
static TMC2130_Basics TMC2130X(X_CHIP_SELECT, 1);
static TMC2130_Basics TMC2130Y(Y_CHIP_SELECT, 2);
static TMC2130_Basics TMC2130Z(Z_CHIP_SELECT, 3);
static TMC2130_Basics TMC2130E(E_CHIP_SELECT, 4);
void loadTMC2130ParametersMotor(TMC2130_Basics *tb, int microsteps, int current, int sensitivity, bool stealth);
#endif
#endif /* TMC2130_H_ */
|
#ifndef __COMMON_APP__
#define __COMMON_APP__
#include "DXUT.h"
#include <string>
#include <vector>
#include <list>
#include <map>
#endif |
#ifndef RTS_OBJECT
#define RTS_OBJECT
#include <d3dx9.h>
#include <vector>
#include "debug.h"
#include "mesh.h"
#include "camera.h"
HRESULT LoadObjectResources(IDirect3DDevice9* Device);
void UnloadObjectResources();
class OBJECT{
public:
OBJECT();
OBJECT(int t, D3DXVECTOR3 pos, D3DXVECTOR3 rot, float off);
void Render();
void Update(float deltaTime);
void UpdateCameras();
MESHINSTANCE m_meshInstance;
int m_type;
//Animation variables
int m_activeWP, m_nextWP;
float m_prc, m_speed, m_offset;
//Camera variables
std::vector<CAMERA> m_cameras;
int m_activeCam;
D3DXVECTOR3 m_direction;
};
#endif |
//
// RMSEstimator.c
// FxDSP
//
// Created by Hamilton Kibbe on 11/24/13.
// Copyright (c) 2013 Hamilton Kibbe. All rights reserved.
//
#include "RMSEstimator.h"
#include "Utilities.h"
#include <math.h>
#include <stdlib.h>
/*******************************************************************************
RMSEstimator */
struct RMSEstimator
{
float avgTime;
float sampleRate;
float avgCoeff;
float RMS;
};
struct RMSEstimatorD
{
double avgTime;
double sampleRate;
double avgCoeff;
double RMS;
};
/*******************************************************************************
RMSEstimatorInit */
RMSEstimator*
RMSEstimatorInit(float avgTime, float sampleRate)
{
RMSEstimator* rms = (RMSEstimator*) malloc(sizeof(RMSEstimator));
rms->avgTime = avgTime;
rms->sampleRate = sampleRate;
rms->RMS = 1;
rms->avgCoeff = 0.5 * (1.0 - expf( -1.0 / (rms->sampleRate * rms->avgTime)));
return rms;
}
RMSEstimatorD*
RMSEstimatorInitD(double avgTime, double sampleRate)
{
RMSEstimatorD* rms = (RMSEstimatorD*) malloc(sizeof(RMSEstimatorD));
rms->avgTime = avgTime;
rms->sampleRate = sampleRate;
rms->RMS = 1;
rms->avgCoeff = 0.5 * (1.0 - expf( -1.0 / (rms->sampleRate * rms->avgTime)));
return rms;
}
/*******************************************************************************
RMSEstimatorFree */
Error_t
RMSEstimatorFree(RMSEstimator* rms)
{
if (rms)
{
free(rms);
rms = NULL;
}
return NOERR;
}
Error_t
RMSEstimatorFreeD(RMSEstimatorD* rms)
{
if (rms)
{
free(rms);
rms = NULL;
}
return NOERR;
}
/*******************************************************************************
RMSEstimatorFlush */
Error_t
RMSEstimatorFlush(RMSEstimator* rms)
{
if (rms)
{
rms->RMS = 1.0;
return NOERR;
}
return NULL_PTR_ERROR;
}
Error_t
RMSEstimatorFlushD(RMSEstimatorD* rms)
{
if (rms)
{
rms->RMS = 1.0;
return NOERR;
}
return NULL_PTR_ERROR;
}
/*******************************************************************************
RMSEstimatorSetAvgTime */
Error_t
RMSEstimatorSetAvgTime(RMSEstimator* rms, float avgTime)
{
rms->avgTime = avgTime;
rms->avgCoeff = 0.5 * (1.0 - expf( -1.0 / (rms->sampleRate * rms->avgTime)));
return NOERR;
}
Error_t
RMSEstimatorSetAvgTimeD(RMSEstimatorD* rms, double avgTime)
{
rms->avgTime = avgTime;
rms->avgCoeff = 0.5 * (1.0 - expf( -1.0 / (rms->sampleRate * rms->avgTime)));
return NOERR;
}
/*******************************************************************************
RMSEstimatorProcess */
Error_t
RMSEstimatorProcess(RMSEstimator* rms,
float* outBuffer,
const float* inBuffer,
unsigned n_samples)
{
for (unsigned i = 0; i < n_samples; ++i)
{
rms->RMS += rms->avgCoeff * ((f_abs(inBuffer[i])/rms->RMS) - rms->RMS);
outBuffer[i] = rms->RMS;
}
return NOERR;
}
Error_t
RMSEstimatorProcessD(RMSEstimatorD* rms,
double* outBuffer,
const double* inBuffer,
unsigned n_samples)
{
for (unsigned i = 0; i < n_samples; ++i)
{
rms->RMS += rms->avgCoeff * ((f_abs(inBuffer[i])/rms->RMS) - rms->RMS);
outBuffer[i] = rms->RMS;
}
return NOERR;
}
/*******************************************************************************
RMSEstimatorTick */
float
RMSEstimatorTick(RMSEstimator* rms,
float inSample)
{
rms->RMS += rms->avgCoeff * ((f_abs(inSample/rms->RMS)) - rms->RMS);
return rms->RMS;
}
double
RMSEstimatorTickD(RMSEstimatorD* rms, double inSample)
{
rms->RMS += rms->avgCoeff * ((f_abs(inSample/rms->RMS)) - rms->RMS);
return rms->RMS;
}
|
//
// UnrestrictedData.h
// MasterpassQRCoreSDKV2
//
// Created by MasterCard on 21/9/17.
// Copyright © 2017 MasterCard. All rights reserved.
//
#import "TemplateData.h"
/**
This class is to store Unreserved Template Data of Push Payment Data tags 80-99 and to store Unreserved Template Data of Additional Data tags 50-99.
@note To assign Application Identifier (tag 00), use AID property from TemplateData class.
*/
@interface UnrestrictedData : TemplateData
// MARK: - Convenient Accessor
/**
Get Context Specific Data value for tag string. The tags are from 1 to 99.
@param tag NSString* tag for which to get value.
@return Value if found else `nil`
*/
- (NSString* _Nullable) getContextSpecificDataForTag:(NSString* _Nonnull) tag error:(NSError*_Nullable*_Nullable) error;
/**
Set Context Specific Data value for tag string. The tags are from 1 to 99.
@param value NSString* to set
@param tag NSString* tag to set the value of
*/
- (BOOL) setContextSpecificData:(NSString* _Nonnull) value forTag:(NSString* _Nonnull) tag error:(NSError*_Nullable*_Nullable) error;
/**
Set Context Specific Data value for tag string. This method is similar to (setContextSpecificData:error:). In this method user do not specify the tag, the function will determine the tag. The tags are from 1 to 99.
@param value NSString* to be inserted
*/
- (BOOL) setDynamicContextSpecificData:(NSString* _Nonnull) value error:(NSError* _Nullable *_Nullable) error;
/**
Get Context Specific Data all available tag. The return value can then be use to get the value by calling method (getTagInfoValueForTagString:error:). The tags are from 1 to 99.
@return NSArray of available tag in string
*/
- (NSArray<NSString*>* _Nullable) getAllDynamicContextSpecificDataTags;
@end
|
/*
* linux/fs/file_table.c
*
* (C) 1991 Linus Torvalds
*/
#include <linux/fs.h>
struct file file_table[NR_FILE];//lux 文件表
|
#pragma once
#include <math.h>
#include "SceneObject.h"
class Humanoid : public SceneObject
{
public:
Humanoid();
private:
float theta, val;
void draw();
};
|
#pragma once
#include <unordered_map>
#include "solar/json/json_object.h"
#include "builder.h"
#include "builder_type.h"
namespace solar {
class file_system;
class exe_runner;
class builder_factory {
private:
std::unordered_map<builder_type, std::unique_ptr<builder>> _builder_templates;
public:
builder_factory(file_system& file_system, exe_runner& exe_runner);
std::unique_ptr<builder> create_builder(json_object& object) const;
};
} |
//
// 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) 2010-2013 Francois Beaune, Jupiter Jazz Limited
// Copyright (c) 2014-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_KERNEL_RENDERING_FINAL_UNIFORMPIXELRENDERER_H
#define APPLESEED_RENDERER_KERNEL_RENDERING_FINAL_UNIFORMPIXELRENDERER_H
// appleseed.renderer headers.
#include "renderer/kernel/rendering/pixelrendererbase.h"
#include "renderer/utility/paramarray.h"
// appleseed.foundation headers.
#include "foundation/platform/compiler.h"
// Standard headers.
#include <cstddef>
// Forward declarations.
namespace foundation { class Dictionary; }
namespace renderer { class Frame; }
namespace renderer { class ISampleRendererFactory; }
namespace renderer
{
//
// Uniform pixel renderer.
//
class UniformPixelRendererFactory
: public PixelRendererBaseFactory
{
public:
// Constructor.
UniformPixelRendererFactory(
const Frame& frame,
ISampleRendererFactory* factory,
const ParamArray& params);
// Delete this instance.
void release() override;
// Return a new uniform pixel renderer instance.
IPixelRenderer* create(
const size_t thread_index) override;
// Return the metadata of the uniform pixel renderer parameters.
static foundation::Dictionary get_params_metadata();
private:
const Frame& m_frame;
ISampleRendererFactory* m_factory;
ParamArray m_params;
};
} // namespace renderer
#endif // !APPLESEED_RENDERER_KERNEL_RENDERING_FINAL_UNIFORMPIXELRENDERER_H
|
/*****************************************************************************
* Copyright (c) 2019 FrontISTR Commons
* This software is released under the MIT License, see LICENSE.txt
*****************************************************************************/
/*
CNFDB_408 Ver. 3.6
*/
#ifndef CNFDB_408H
#define CNFDB_408H
#include <vector>
#include "CNFDataBlock.h"
// 408 Group
class CNFDB_408 : public CNFDataBlock {
public:
CNFDB_408();
virtual ~CNFDB_408() {}
virtual void Read(class CNFData* nfd);
virtual void WriteData(class CNFData* nfd, FILE* fp);
public:
class cplclip_rec {
public:
// ##1
nf_int plclip_on;
nf_int plclip_neg;
// ##2
nf_float plclip_base[3];
// ##3
nf_float plclip_norm[3];
cplclip_rec() {}
cplclip_rec(const cplclip_rec& c)
: plclip_on(c.plclip_on), plclip_neg(c.plclip_neg) {
plclip_base[0] = c.plclip_base[0];
plclip_base[1] = c.plclip_base[1];
plclip_base[2] = c.plclip_base[2];
plclip_norm[0] = c.plclip_norm[0];
plclip_norm[1] = c.plclip_norm[1];
plclip_norm[2] = c.plclip_norm[2];
}
cplclip_rec& operator=(const cplclip_rec& c) {
plclip_on = c.plclip_on;
plclip_neg = c.plclip_neg;
plclip_base[0] = c.plclip_base[0];
plclip_base[1] = c.plclip_base[1];
plclip_base[2] = c.plclip_base[2];
plclip_norm[0] = c.plclip_norm[0];
plclip_norm[1] = c.plclip_norm[1];
plclip_norm[2] = c.plclip_norm[2];
return *this;
}
};
class crule_rec {
public:
// ##1
nf_int rule_type;
class centry_rec {
public:
nf_int startID;
nf_int stopID;
nf_int incID;
nf_int include;
};
std::vector<centry_rec> entry_set;
crule_rec& operator=(const crule_rec& rec) {
rule_type = rec.rule_type;
entry_set = rec.entry_set;
return *this;
}
};
class clist_rec {
public:
nf_int list_type;
std::vector<nf_int> entityID;
};
// #1
nf_int ID;
nf_int need_eval;
nf_bool prev_enum;
// #2
nf_char title[26];
// #3
nf_int layer[2];
nf_int layer_method;
// #4
nf_int coclip_on;
nf_int coclip_dof;
nf_int coclip_meth;
nf_int coclip_csys;
nf_float coclip_min;
nf_float coclip_max;
// #5
nf_int plclip_meth;
nf_int plclip_in;
// #--------------------------------
cplclip_rec plclip_set[6];
// #--------------------------------
nf_int max_rules;
// #--------------------------------
std::vector<crule_rec> rule_set;
// #--------------------------------
nf_int max_lists;
// #--------------------------------
std::vector<clist_rec> list_set;
protected:
void read_rule(class CNFData* nfd, std::vector<crule_rec>& list);
void read_list(class CNFData* nfd, std::vector<clist_rec>& list);
void write_rule(class CNFData* nfd, FILE* fp, std::vector<crule_rec>& list);
void write_list(class CNFData* nfd, FILE* fp, std::vector<clist_rec>& list);
};
#endif
|
//
// AppDelegate.h
// YXHttpEncapsulationDemo
//
// Created by R_zhou on 2017/3/6.
// Copyright © 2017年 R_zhou. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#pragma once
enum // constants
{
ID_HELP = 0xE146, // first attempt for F1
AFX_IDW_PANE_FIRST = 0xE900, // first pane (256 max)
AFX_IDW_PANE_LAST = 0xE9ff,
AFX_IDW_REBAR = 0xE804, // rebar
AFX_IDW_STATUS_BAR = 0xE801, // status bar
AFX_IDW_TOOLBAR = 0xE800 // main toolbar
};
enum // extra messages
{
WM_KICKIDLE= 0x036A, // (params unused) causes idles to kick in
WM_IDLEUPDATECMDUI= 0x0363 // wParam == disable if no handler
};
|
#ifndef RPCCONSOLE_H
#define RPCCONSOLE_H
#include <QDialog>
namespace Ui {
class RPCConsole;
}
class ClientModel;
/** Local Calcoin RPC console. */
class RPCConsole: public QDialog
{
Q_OBJECT
public:
explicit RPCConsole(QWidget *parent = 0);
~RPCConsole();
void setClientModel(ClientModel *model);
enum MessageClass {
MC_ERROR,
MC_DEBUG,
CMD_REQUEST,
CMD_REPLY,
CMD_ERROR
};
protected:
virtual bool eventFilter(QObject* obj, QEvent *event);
private slots:
void on_lineEdit_returnPressed();
void on_tabWidget_currentChanged(int index);
/** open the debug.log from the current datadir */
void on_openDebugLogfileButton_clicked();
/** display messagebox with program parameters (same as calcoin-qt --help) */
void on_showCLOptionsButton_clicked();
public slots:
void clear();
void message(int category, const QString &message, bool html = false);
/** Set number of connections shown in the UI */
void setNumConnections(int count);
/** Set number of blocks shown in the UI */
void setNumBlocks(int count, int countOfPeers);
/** Go forward or back in history */
void browseHistory(int offset);
/** Scroll console view to end */
void scrollToEnd();
signals:
// For RPC command executor
void stopExecutor();
void cmdRequest(const QString &command);
private:
Ui::RPCConsole *ui;
ClientModel *clientModel;
QStringList history;
int historyPtr;
void startExecutor();
};
#endif // RPCCONSOLE_H
|
//
// SectionListModel.h
// 07_UITableViewDemo
//
// Created by lzn on 15/8/11.
// Copyright (c) 2015年 NowFuture. All rights reserved.
//
#import <Foundation/Foundation.h>
/*
1.1个分组代表一个 model
2.几个分组就有几个 model
3.这些 model 可以组装成一个数组
*/
typedef NS_ENUM(NSInteger, SectionListType) {
SectionListTypeListen,
SectionListTypeSpeak,
SectionListTypeRead
};
@interface SectionListModel : NSObject
//对应分组 title
@property(nonatomic,strong,readonly) NSString *sectionTitle;
//对应分组 cell 的高度
@property(nonatomic,assign,readonly) float cellHeight;
//对应分组 cell 的数量,便捷访问
@property(nonatomic,assign) int cellCount;
//对应分组的数据源
@property(nonatomic,strong) NSArray *dataArray;
//只读的分组的类型
@property(nonatomic,assign,readonly) SectionListType type;
+ (instancetype)createWithType:(SectionListType)type;
@end
|
#ifndef _WEOBJ_
#define _WEOBJ_
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "we_opengl_hd.h"
#include "weobject.h"
#define OBJ_BUFFER_LENGHT 256
/*
typedef struct tagWEShaderVars{
GLint vertex_attrib;
GLint color_attrib;
GLint normal_attrib;
GLint texture_attrib;
GLint sampler;
GLint modelview;
GLint program_id;
}WEShaderVars;
*/
typedef struct tagWEObjMat{
}WEObjMat;
typedef struct tagWEObjModel{
float nFaces;
WEFace *faces;
float *vertex;
float *normal;
}WEObjModel;
int weObjLoad(FILE *outmsg,char *filename,WEObjModel *model);
int weObjDelete(WEObjModel *model);
int weObjDraw(WEObjModel *model, WEShaderVars *shader_vars, float *mv);
#endif
|
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2018, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/** @file color4.h
* @brief RGBA color structure, including operators when compiling in C++
*/
#pragma once
#ifndef AI_COLOR4D_H_INC
#define AI_COLOR4D_H_INC
#include "defs.h"
#ifdef __cplusplus
// ----------------------------------------------------------------------------------
/** Represents a color in Red-Green-Blue space including an
* alpha component. Color values range from 0 to 1. */
// ----------------------------------------------------------------------------------
template <typename TReal>
class aiColor4t
{
public:
aiColor4t() AI_NO_EXCEPT : r(), g(), b(), a() {}
aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a)
: r(_r), g(_g), b(_b), a(_a) {}
explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {}
aiColor4t (const aiColor4t& o)
: r(o.r), g(o.g), b(o.b), a(o.a) {}
public:
// combined operators
const aiColor4t& operator += (const aiColor4t& o);
const aiColor4t& operator -= (const aiColor4t& o);
const aiColor4t& operator *= (TReal f);
const aiColor4t& operator /= (TReal f);
public:
// comparison
bool operator == (const aiColor4t& other) const;
bool operator != (const aiColor4t& other) const;
bool operator < (const aiColor4t& other) const;
// color tuple access, rgba order
inline TReal operator[](unsigned int i) const;
inline TReal& operator[](unsigned int i);
/** check whether a color is (close to) black */
inline bool IsBlack() const;
public:
// Red, green, blue and alpha color values
TReal r, g, b, a;
}; // !struct aiColor4D
typedef aiColor4t<ai_real> aiColor4D;
#else
struct aiColor4D {
ai_real r, g, b, a;
};
#endif // __cplusplus
#endif // AI_COLOR4D_H_INC
|
C $Header$
C $Name$
#ifndef THSICE_OPTIONS_H
#define THSICE_OPTIONS_H
#include "PACKAGES_CONFIG.h"
#ifdef ALLOW_THSICE
#include "CPP_OPTIONS.h"
C- use continuous power-law function for partition of energy between lateral
C melting/freezing and thinning/thickening ; otherwise, use step function.
#undef THSICE_FRACEN_POWERLAW
C- allow single grid-point debugging write to standard-output
#define ALLOW_DBUG_THSICE
C- only to check conservation
C (change content of ICE_qleft,fresh,salFx-T files)
#undef CHECK_ENERGY_CONSERV
C CPP Macros go here
#endif /* ALLOW_THSICE */
#endif /* THSICE_OPTIONS_H */
CEH3 ;;; Local Variables: ***
CEH3 ;;; mode:fortran ***
CEH3 ;;; End: ***
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <Message/MFOfflineCacheOperation.h>
#import "MFDAOfflineCacheOperation-Protocol.h"
@class NSArray, NSString;
@interface MFDADeferredMessageMoveOperation : MFOfflineCacheOperation <MFDAOfflineCacheOperation>
{
NSArray *_sourceRemoteIDs;
NSArray *_originalFlags;
NSArray *_temporaryRemoteIDs;
NSString *_sourceMailboxID;
NSString *_destinationMailboxID;
}
- (id)description;
- (_Bool)performWithAccount:(id)arg1 offlineCache:(id)arg2;
- (void)dealloc;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (id)initWithMessages:(id)arg1 temporaryIDs:(id)arg2 sourceMailbox:(id)arg3 destinationMailbox:(id)arg4;
@end
|
/**
* Copyright (C) 2013 Jorge Jimenez (jorge@iryoku.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* 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. As clarification, there
* is no requirement that the copyright notice and permission be included in
* binary distributions 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 COPY_H
#define COPY_H
#include "RenderTarget.h"
class Copy {
public:
static void init(ID3D10Device *device);
static void release();
static void go(ID3D10ShaderResourceView *srcSRV, ID3D10RenderTargetView *dstRTV, D3D10_VIEWPORT *viewport=nullptr);
private:
static ID3D10Device *device;
static ID3D10Effect *effect;
static Quad *quad;
};
#endif
|
#ifndef COMMON_H
#define COMMON_H
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include "immintrin.h"
#include <include/perf.h>
typedef uint8_t u_int8_t;
typedef uint32_t u_int32_t;
#ifdef COUNT_FLOPS
struct global_op_count{
size_t int_mults;
size_t int_adds;
size_t fp_mults;
size_t fp_adds;
};
extern struct global_op_count __GLOBAL_OP_COUNT;
#define INCREMENT_FLOP_COUNT(_int_mul, _int_add, _fp_mul, _fp_add) __GLOBAL_OP_COUNT.int_mults+=(_int_mul);\
__GLOBAL_OP_COUNT.int_adds+=(_int_add);\
__GLOBAL_OP_COUNT.fp_adds+=(_fp_add);\
__GLOBAL_OP_COUNT.fp_mults+=(_fp_mul);\
#else
#define INCREMENT_FLOP_COUNT(_int_mul, _int_add, fp_mul, fp_add)
#endif
#ifdef COUNT_DETAIL_CYCLES
struct global_function_cycle_count{
size_t get_average_pixel_cycles;
size_t get_error_cycles;
size_t get_scale_factor_cycles;
size_t down_sample_cycles;
size_t ifs_transformation_execute_cycles;
};
extern struct global_function_cycle_count __COUNT_DETAIL_CYCLES;
#define INCREMENT_CYCLE_COUNT(_get_average_pixel_cycles, _get_error_cycles, _get_scale_factor_cycles, _down_sample_cycles, _ifs_transformation_execute_cycles) __COUNT_DETAIL_CYCLES.get_average_pixel_cycles+=(_get_average_pixel_cycles);\
__COUNT_DETAIL_CYCLES.get_error_cycles+=(_get_error_cycles);\
__COUNT_DETAIL_CYCLES.get_scale_factor_cycles+=(_get_scale_factor_cycles);\
__COUNT_DETAIL_CYCLES.down_sample_cycles+=(_down_sample_cycles);\
__COUNT_DETAIL_CYCLES.ifs_transformation_execute_cycles+=(_ifs_transformation_execute_cycles);\
#else
#define INCREMENT_CYCLE_COUNT(_get_average_pixel_cycles, _get_error_cycles, _get_scale_factor_cycles, _down_sample_cycles, _ifs_transformation_execute_cycles)
#endif
#include "frac_errors.h"
#define LOGT(...) printf("T [" MODULE_NAME"]: " __VA_ARGS__)
#define LOGD(...) printf("D [" MODULE_NAME"]: " __VA_ARGS__)
#define LOGW(...) fprintf(stderr, "W [" MODULE_NAME"]: " __VA_ARGS__)
#define LOGE(...) fprintf(stderr, "E [" MODULE_NAME"]: " __VA_ARGS__)
#endif // COMMON_H
|
#ifndef SENDCOINSENTRY_H
#define SENDCOINSENTRY_H
#include <QFrame>
namespace Ui {
class SendCoinsEntry;
}
class WalletModel;
class SendCoinsRecipient;
/** A single entry in the dialog for sending namocoins. */
class SendCoinsEntry : public QFrame
{
Q_OBJECT
public:
explicit SendCoinsEntry(QWidget *parent = 0);
~SendCoinsEntry();
void setModel(WalletModel *model);
bool validate();
SendCoinsRecipient getValue();
/** Return whether the entry is still empty and unedited */
bool isClear();
void setValue(const SendCoinsRecipient &value);
/** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
*/
QWidget *setupTabChain(QWidget *prev);
void setFocus();
public slots:
void setRemoveEnabled(bool enabled);
void clear();
signals:
void removeEntry(SendCoinsEntry *entry);
void payAmountChanged();
private slots:
void on_deleteButton_clicked();
void on_payTo_textChanged(const QString &address);
void on_addressBookButton_clicked();
void on_pasteButton_clicked();
void updateDisplayUnit();
private:
Ui::SendCoinsEntry *ui;
WalletModel *model;
};
#endif // SENDCOINSENTRY_H
|
/*=============================================================================
Copyright (c) 2012, Ludo Sapiens Inc. and contributors.
See accompanying file LICENSE.txt for details.
=============================================================================*/
#ifndef PLASMA_PARAMETRICPATCH_H
#define PLASMA_PARAMETRICPATCH_H
#include <Plasma/StdDefs.h>
#include <Plasma/Geometry/MetaSurface.h>
NAMESPACE_BEGIN
/*==============================================================================
CLASS ParametricPatch
==============================================================================*/
class ParametricPatch
{
public:
/*----- methods -----*/
// Creation.
void init( MetaSurface::Patch& p );
// Evaluation.
void parameters( const Vec2f& uv, Vec3f& pos, Vec3f& normal ) const;
const Vec3f& position( uint i ) const;
int flatness( const Vec2f& uv0, const Vec2f& uv1, int edge, float error );
void print() const;
private:
/*----- members -----*/
void evalCubic( const Vec2f& uv, Vec3f& pos, Vec3f& normal ) const;
void evalTriangle( uint p, const Vec3f& uvw, Vec3f& pos, Vec3f& normal ) const;
/*----- data members -----*/
bool _regular;
Vec3f _b[25];
};
NAMESPACE_END
#endif
|
/**
Copyright (C) 2013 Eric Wasylishen
Date: December 2013
License: MIT (see COPYING)
*/
#import <Foundation/Foundation.h>
#if (TARGET_OS_IPHONE)
# import <CoreObject/COCocoaTouchCompatibility.h>
#else
# import <AppKit/AppKit.h>
#endif
#import <EtoileFoundation/EtoileFoundation.h>
@interface COColorToHTMLString : NSValueTransformer
@end
|
#pragma once
#include <fstream>
#include <vector>
#include <iostream>
#include <iomanip>
using namespace System;
using namespace System::Collections::Generic;
using namespace std;
using namespace cv;
namespace ImageQuality {
public ref class BrisqueFeatureExtractor
{
public:
IList<double>^ BrisqueFeatures(cli::array<byte>^ buffer);
private:
vector<double> brisquefeatures(Mat image);
void brisque_feature(Mat imdist, vector<double> &feat);
void estimateggdparam(Mat vec, double &gamparam, double &sigma);
void estimateaggdparam(Mat vec, double &alpha, double &leftstd, double &rightstd);
void brisque_process(Mat imdist, vector<double> &feat);
Mat circshift(Mat structdis, int a, int b);
double Gamma(double x);
};
} |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "WXPBGeneratedMessage.h"
@class BaseResponse, NSMutableArray;
@interface LbsResponse : WXPBGeneratedMessage
{
}
+ (void)initialize;
// Remaining properties
@property(retain, nonatomic) BaseResponse *baseResponse; // @dynamic baseResponse;
@property(nonatomic) unsigned int contactCount; // @dynamic contactCount;
@property(retain, nonatomic) NSMutableArray *contactList; // @dynamic contactList;
@property(nonatomic) unsigned int flushTime; // @dynamic flushTime;
@property(nonatomic) unsigned int isShowRoom; // @dynamic isShowRoom;
@property(nonatomic) unsigned int roomMemberCount; // @dynamic roomMemberCount;
@property(nonatomic) unsigned int state; // @dynamic state;
@end
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class NSArray, NSMutableArray, NSMutableData, NSMutableDictionary, RTFTextTable;
// Not exported
@interface RTFReaderState : NSObject
{
id _delegate;
unsigned int _defaultToUniCharEncoding;
NSMutableDictionary *_documentInfoDictionary;
struct CGSize _paperSize;
double _lMargin;
double _rMargin;
double _bMargin;
double _tMargin;
struct CGSize _viewSize;
int _viewScale;
int _viewKind;
NSMutableArray *_attributesStack;
NSMutableDictionary *_curAttributes;
unsigned int _level;
struct _NSAttributeInfo _attributeInfo;
NSMutableData *_attributeInfoStack;
long long _tableNestingLevel;
_Bool _isRTLDocument;
NSArray *_textBlocks;
NSMutableArray *_nestedTables;
RTFTextTable *_currentTable;
RTFTextTable *_previousTable;
NSMutableArray *_currentRowArray;
NSMutableArray *_previousRowArray;
int _currentRow;
int _currentColumn;
int _currentDefinitionColumn;
_Bool _currentRowIsLast;
_Bool _setTableCells;
unsigned long long _currentBorderEdge;
_Bool _currentBorderIsTable;
NSMutableDictionary *_listDefinitions;
int _currentListNumber;
int _currentListLevel;
}
- (void)_notifyEndTableCellWithCell:(id)arg1;
- (void)_notifyStartTableCell;
- (void)_notifyEndTableRow;
- (void)_notifyStartTableRow;
- (void)_notifyEndTable;
- (void)_notifyStartTable;
- (void)_notifyEndParagraph;
- (void)_notifyStartParagraph;
- (void)_notifyProcessString:(id)arg1;
- (void)addOverride:(long long)arg1 forKey:(long long)arg2;
- (void)addListDefinition:(id)arg1 forKey:(long long)arg2;
- (id)listDefinitions;
- (void)setCurrentListLevel:(long long)arg1;
- (long long)currentListLevel;
- (void)setCurrentListNumber:(long long)arg1;
- (long long)currentListNumber;
- (void)setCurrentBorderEdge:(unsigned long long)arg1 isTable:(_Bool)arg2;
- (void)mergeTableCellsVertically;
- (void)mergeTableCellsHorizontally;
- (void)endTableRow;
- (_Bool)isLastTableRow;
- (void)lastTableRow;
- (void)endTableCell;
- (void)_paragraphInTable;
- (void)endTableCellDefinition;
- (void)startTableRowDefinition;
- (void)setTableNestingLevel:(long long)arg1;
- (void)_clearTableCells;
- (void)_setTableCells;
- (void)_popTableState;
- (void)_pushTableState;
- (void)_setCurrentBorderEdge:(unsigned long long)arg1 isTable:(_Bool)arg2;
- (_Bool)_currentTableCellIsPlaceholder;
- (_Bool)currentBorderIsTable;
- (unsigned long long)currentBorderEdge;
- (id)currentTableCell;
- (id)currentTable;
- (void)_beginTableRow;
- (void)_ensureTableCells;
- (_Bool)currentTableCellIsPlaceholder;
- (void)setTableFlags:(unsigned long long)arg1;
- (void)paragraphInTable;
- (void)_updateAttributes;
- (void)processString:(id)arg1;
- (void)endParagraph;
- (void)startParagraph;
- (id)currentParagraphStyle;
- (id)mutableParagraphStyle;
- (id)defaultParagraphStyle;
- (void)removeAttributeForKey:(id)arg1;
- (void)setAttribute:(id)arg1 forKey:(id)arg2;
- (id)attributeForKey:(id)arg1;
- (void)setTextAlignment:(int)arg1;
- (long long)baseWritingDirection;
- (void)setBaseWritingDirection:(long long)arg1;
- (_Bool)hasWritingDirectionAttribute;
- (void)setHasWritingDirectionAttribute:(_Bool)arg1;
- (double)fontSize;
- (void)setFontSize:(double)arg1;
- (id)font;
- (void)setFont:(id)arg1;
- (_Bool)italic;
- (void)setItalic:(_Bool)arg1;
- (_Bool)bold;
- (void)setBold:(_Bool)arg1;
- (void)setFontIsValid:(_Bool)arg1;
- (unsigned int)unicodeAlternativeLength;
- (void)setUnicodeAlternativeLength:(unsigned int)arg1;
- (_Bool)multiByteEncoding;
- (void)setMultiByteEncoding:(_Bool)arg1;
- (unsigned int)codePageEncoding;
- (void)setCodePageEncoding:(unsigned int)arg1;
- (unsigned int)toUniCharEncoding;
- (void)setToUniCharEncoding:(unsigned int)arg1;
- (unsigned int)defaultToUniCharEncoding;
- (void)setDefaultToUniCharEncoding:(unsigned int)arg1;
- (unsigned int)level;
- (id)currentAttributes;
- (id)mutableAttributes;
- (void)setViewScale:(long long)arg1;
- (void)setViewKind:(long long)arg1;
- (struct CGSize)viewSize;
- (void)setViewSize:(struct CGSize)arg1;
- (double)bottomMargin;
- (void)setBottomMargin:(double)arg1;
- (double)topMargin;
- (void)setTopMargin:(double)arg1;
- (double)rightMargin;
- (void)setRightMargin:(double)arg1;
- (double)leftMargin;
- (void)setLeftMargin:(double)arg1;
- (struct CGSize)paperSize;
- (void)setPaperSize:(struct CGSize)arg1;
- (id)documentInfoDictionary;
- (void)popState;
- (void)pushState;
- (void)dealloc;
- (id)initWithDelegate:(id)arg1;
@end
|
//
// UIColor+LHXColors.h
//
//
#import <UIKit/UIKit.h>
/**
* The UIColor+LHXColors category extends UIColor to allow colors to be specified by SVG color name, hex strings,
* and hex values. Additionally, HSL color space conversions have been added
*/
@interface UIColor (LHXColors)
/**
* Return a UIColor from an SVG color name
*
* @param name The color name
*/
+ (UIColor *)lhx_colorFromName:(NSString *)name;
/**
* Return a UIColor using the HSL color space
*
* @param hue The color's hue
* @param saturation The color's saturation
* @param lightness The color's lightness
*/
+ (UIColor *)lhx_colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation lightness:(CGFloat)lightness;
/**
* Return a UIColor using the HSL color space and an alpha value
*
* @param hue The color's hue
* @param saturation The color's saturation
* @param lightness The color's lightness
* @param alpha The color's alpha value
*/
+ (UIColor *)lhx_colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation lightness:(CGFloat)lightness alpha:(CGFloat)alpha;
/**
* Return a UIColor from a 3- or 6-digit hex string
*
* @param hexString The hex color string value
*/
+ (UIColor *)lhx_colorWithHexString:(NSString *)hexString;
/**
* Return a UIColor from a 3- or 6-digit hex string and an alpha value
*
* @param hexString The hex color string value
* @param alpha The color's alpha value
*/
+ (UIColor *)lhx_colorWithHexString:(NSString *)hexString withAlpha:(CGFloat)alpha;
/**
* Return a UIColor from a RGBA int
*
* @param value The int value
*/
+ (UIColor *)lhx_colorWithRGBAValue:(uint)value;
/**
* Return a UIColor from a ARGB int
*
* @param value The int value
*/
+ (UIColor *)lhx_colorWithARGBValue:(uint)value;
/**
* Return a UIColor from a RGB int
*
* @param value The int value
*/
+ (UIColor *)lhx_colorWithRGBValue:(uint)value;
/**
* Convert this color to HSLA
*
* @param hue A float pointer that will be set by this conversion
* @param saturation A float pointer that will be set by this conversion
* @param lightness A float pointer that will be set by this conversion
* @param alpha A float pointer that will be set by this conversion
*/
- (BOOL)lhx_getHue:(CGFloat *)hue saturation:(CGFloat *)saturation lightness:(CGFloat *)lightness alpha:(CGFloat *)alpha;
/**
* Determine if this color is opaque. Essentially, this returns true if the alpha channel is 1.0
*/
- (BOOL)lhx_isOpaque;
/**
* Adds percent to the lightness channel of this color
*/
- (UIColor *)lhx_darkenByPercent:(CGFloat)percent;
/**
* Subtracts percent from the lightness channel of this color
*/
- (UIColor *)lhx_lightenByPercent:(CGFloat)percent;
@end
|
//
// KSAppDelegate.h
// HelperApp
//
// Created by Keith Smiley on 6/12/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface KSAppDelegate : NSObject <NSApplicationDelegate>
@end |
#pragma once
#include "scene/asset.h"
#include "util/color.h"
#include "util/fastmap.h"
#include "view/view.h"
#include <atomic>
#include <list>
#include <memory>
#include <string>
#include <vector>
#include <tuple>
#include <unordered_map>
#include "glm/vec2.hpp"
#include "yaml-cpp/yaml.h"
#include "util/yamlHelper.h"
#include "map.h" // SceneError
namespace Tangram {
class DataLayer;
class FeatureSelection;
class FontContext;
class Light;
class MapProjection;
class Platform;
class SceneLayer;
class SpriteAtlas;
class Style;
class Texture;
class TileSource;
struct Stops;
class Url;
// Delimiter used in sceneloader for style params and layer-sublayer naming
const std::string DELIMITER = ":";
/* Singleton container of <Style> information
*
* Scene is a singleton containing the styles, lighting, and interactions defining a map scene
*/
class Scene {
public:
struct Camera {
CameraType type = CameraType::perspective;
float maxTilt = 90.f;
std::shared_ptr<Stops> maxTiltStops;
// perspective
glm::vec2 vanishingPoint = {0, 0};
float fieldOfView = 0.25 * PI;
std::shared_ptr<Stops> fovStops;
// isometric
glm::vec2 obliqueAxis = {0, 1};
};
Camera m_camera;
enum animate {
yes, no, none
};
Scene();
Scene(std::shared_ptr<const Platform> _platform, const std::string& _path = "");
Scene(std::shared_ptr<const Platform> _platform, const std::string& _yaml, const std::string& _resourceRoot);
Scene(const Scene& _other) = delete;
~Scene();
void copyConfig(const Scene& _other);
auto& camera() { return m_camera; }
auto& resourceRoot() { return m_resourceRoot; }
auto& config() { return m_config; }
auto& tileSources() { return m_tileSources; };
auto& layers() { return m_layers; };
auto& styles() { return m_styles; };
auto& lights() { return m_lights; };
auto& lightBlocks() { return m_lightShaderBlocks; };
auto& textures() { return m_textures; };
auto& functions() { return m_jsFunctions; };
auto& assets() { return m_assets; };
auto& spriteAtlases() { return m_spriteAtlases; };
auto& stops() { return m_stops; }
auto& background() { return m_background; }
auto& fontContext() { return m_fontContext; }
auto& globalRefs() { return m_globalRefs; }
auto& featureSelection() { return m_featureSelection; }
Style* findStyle(const std::string& _name);
const auto& path() const { return m_path; }
const auto& yaml() { return m_yaml; }
const auto& resourceRoot() const { return m_resourceRoot; }
const auto& config() const { return m_config; }
const auto& tileSources() const { return m_tileSources; };
const auto& layers() const { return m_layers; };
const auto& styles() const { return m_styles; };
const auto& lights() const { return m_lights; };
const auto& lightBlocks() const { return m_lightShaderBlocks; };
const auto& functions() const { return m_jsFunctions; };
const auto& mapProjection() const { return m_mapProjection; };
const auto& fontContext() const { return m_fontContext; }
const auto& globalRefs() const { return m_globalRefs; }
const auto& featureSelection() const { return m_featureSelection; }
const auto& assets() const { return m_assets; };
void createSceneAsset(const std::shared_ptr<Platform>& platform, const Url& resolvedUrl, const Url& relativeUrl,
const Url& base);
const Style* findStyle(const std::string& _name) const;
const Light* findLight(const std::string& _name) const;
void updateTime(float _dt) { m_time += _dt; }
float time() const { return m_time; }
int addIdForName(const std::string& _name);
int getIdForName(const std::string& _name) const;
int addJsFunction(const std::string& _function);
const int32_t id;
bool useScenePosition = true;
glm::dvec2 startPosition = { 0, 0 };
float startZoom = 0;
void animated(bool animated) { m_animated = animated ? yes : no; }
animate animated() const { return m_animated; }
std::shared_ptr<TileSource> getTileSource(int32_t id);
std::shared_ptr<TileSource> getTileSource(const std::string& name);
std::shared_ptr<Texture> getTexture(const std::string& name) const;
float pixelScale() { return m_pixelScale; }
void setPixelScale(float _scale);
std::atomic_ushort pendingTextures{0};
std::atomic_ushort pendingFonts{0};
std::vector<SceneError> errors;
private:
// The file path from which this scene was loaded
std::string m_path;
std::string m_yaml;
std::string m_resourceRoot;
// The root node of the YAML scene configuration
YAML::Node m_config;
std::unique_ptr<MapProjection> m_mapProjection;
std::vector<DataLayer> m_layers;
std::vector<std::shared_ptr<TileSource>> m_tileSources;
std::vector<std::unique_ptr<Style>> m_styles;
std::vector<std::unique_ptr<Light>> m_lights;
std::map<std::string, std::string> m_lightShaderBlocks;
std::unordered_map<std::string, std::shared_ptr<Texture>> m_textures;
std::unordered_map<std::string, std::shared_ptr<SpriteAtlas>> m_spriteAtlases;
// path as key
fastmap<std::string, std::shared_ptr<Asset>> m_assets;
// Records the YAML Nodes for which global values have been swapped; keys are
// nodes that referenced globals, values are nodes of globals themselves.
std::vector<std::pair<YamlPath, YamlPath>> m_globalRefs;
// Container of all strings used in styling rules; these need to be
// copied and compared frequently when applying styling, so rules use
// integer indices into this container to represent strings
std::vector<std::string> m_names;
std::vector<std::string> m_jsFunctions;
std::list<Stops> m_stops;
Color m_background;
std::shared_ptr<FontContext> m_fontContext;
std::unique_ptr<FeatureSelection> m_featureSelection;
animate m_animated = none;
float m_pixelScale = 1.0f;
float m_time = 0.0;
};
}
|
# ifndef _UTIL_H
# define _UTIL_H
# endif
# if !defined(DEBUG) && !defined(MINI) && !defined(SMALL) && !defined(MEDIUM) && !defined(BIG) && !defined(LARGE) && !defined(GIANT) && !defined(HUGE) && !defined(WTF) && !defined(NI)
# define DEBUG
# endif
# ifndef SIZE
# ifdef STANDARD_DATASET
# define SIZE 1024
# endif
# ifdef MINI
# define SIZE 512
# endif
# ifdef SMALL
# define SIZE 1024
# endif
# ifdef MEDIUM
# define SIZE 2048
# endif
# ifdef BIG
# define SIZE 4096
# endif
# ifdef LARGE
# define SIZE 8192
# endif
# ifdef GIANT
# define SIZE 16384
# endif
# ifdef HUGE
# define SIZE 32768
# endif
# ifdef WTF
# define SIZE 65536
# endif
# endif
/* PAPI */
#ifdef PAPI
#include <papi.h>
#define PAPI_SIZE 6
#endif
#ifdef INT
#define TYPEDEF int
#else
#define TYPEDEF double
#endif
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <omp.h>
#include <math.h>
#include <time.h>
#include <semaphore.h>
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
/* Start pthread */
void start_pthread(pthread_t *thread, int threads, void *(*parallel_pthread)(void*));
/* Divide problem functions */
int get_stripe(int tnum);
int get_init(int id, int stripe);
int get_end(int init, int stripe);
/* Debug purposes only */
void print(TYPEDEF **matrix);
/* Reset everything matrix */
void reset(TYPEDEF **A);
/* Malloc Matrix */
int mrand(void);
void msrand(unsigned seed);
void init(TYPEDEF ***A, int fact);
void minit(TYPEDEF ***A, int fact);
void zinit(TYPEDEF ***A);
/* Be clean */
void freetrix(TYPEDEF **A);
/* Line */
typedef struct structure {
TYPEDEF data;
struct structure *next;
} node;
typedef struct {
node *beggin, *end;
} line; |
//
// Created by CocoaPods on TODAYS_DATE.
// Copyright (c) 2014 PROJECT_OWNER. All rights reserved.
//
#import <Foundation/Foundation.h>
extern const struct LCSymbol {
__unsafe_unretained NSString *const Banknote;
__unsafe_unretained NSString *const Bubble;
__unsafe_unretained NSString *const Bulb;
__unsafe_unretained NSString *const Calendar;
__unsafe_unretained NSString *const Camera;
__unsafe_unretained NSString *const Clip;
__unsafe_unretained NSString *const Clock;
__unsafe_unretained NSString *const Cloud;
__unsafe_unretained NSString *const Cup;
__unsafe_unretained NSString *const Data;
__unsafe_unretained NSString *const Diamond;
__unsafe_unretained NSString *const Display;
__unsafe_unretained NSString *const Eye;
__unsafe_unretained NSString *const Fire;
__unsafe_unretained NSString *const Food;
__unsafe_unretained NSString *const Heart;
__unsafe_unretained NSString *const Key;
__unsafe_unretained NSString *const Lab;
__unsafe_unretained NSString *const Like;
__unsafe_unretained NSString *const Location;
__unsafe_unretained NSString *const Lock;
__unsafe_unretained NSString *const Mail;
__unsafe_unretained NSString *const Megaphone;
__unsafe_unretained NSString *const Music;
__unsafe_unretained NSString *const News;
__unsafe_unretained NSString *const Note;
__unsafe_unretained NSString *const Paperplane;
__unsafe_unretained NSString *const Params;
__unsafe_unretained NSString *const Pen;
__unsafe_unretained NSString *const Phone;
__unsafe_unretained NSString *const Photo;
__unsafe_unretained NSString *const Search;
__unsafe_unretained NSString *const Settings;
__unsafe_unretained NSString *const Shop;
__unsafe_unretained NSString *const Sound;
__unsafe_unretained NSString *const Stack;
__unsafe_unretained NSString *const Star;
__unsafe_unretained NSString *const Study;
__unsafe_unretained NSString *const TShirt;
__unsafe_unretained NSString *const Tag;
__unsafe_unretained NSString *const Television;
__unsafe_unretained NSString *const Trash;
__unsafe_unretained NSString *const Truck;
__unsafe_unretained NSString *const User;
__unsafe_unretained NSString *const Vallet;
__unsafe_unretained NSString *const Video;
__unsafe_unretained NSString *const Vynil;
__unsafe_unretained NSString *const World;
} LCSymbol;
|
//
// YYAudioTool.h
// sound-xyc
//
// Created by geek on 14/12/20.
// Copyright (c) 2014年 geek. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
@interface YYAudioTool : NSObject
/**
*播放音乐文件
*/
+(BOOL)playMusic:(NSString *)filename ofName:(NSString *)name;
/**
*播放音乐文件---给微拍单独使用
*/
+(BOOL)playSound:(NSString *)filename ofName:(NSString *)name;
/**
*暂停播放
*/
+(void)pauseMusic:(NSString *)filename ofName:(NSString *)name;
/**
*暂停播放---给微拍单独使用
*/
+(void)pauseSound:(NSString *)filename ofName:(NSString *)name;
/**
*停止播放音乐文件
*/
+(void)stopMusic:(NSString *)filename ofName:(NSString *)name;
/**
*播放音效文件
*/
+(void)playSound:(NSString *)filename;
/**
*销毁音效
*/
+(void)disposeSound:(NSString *)filename;
@end
|
#include "common.h"
#include "endian.h"
#include "tx.h"
#include "hash.h"
#include "ec.h"
int tx_sign() {
uint8_t priv[32];
EC_KEY *key;
uint8_t *msg;
size_t msg_len;
uint8_t digest[32];
uint8_t *sig;
unsigned int sig_len;
/* */
/* keypair */
bbp_parse_hex(priv, "16260783e40b16731673622ac8a5b045fc3ea4af70f727f3f9e92bdd3a1ddc42");
key = bbp_ec_new_keypair(priv);
/* message */
msg = bbp_alloc_hex("0100000001f3a27f485f9833c8318c490403307fef1397121b5dd8fe70777236e7371c4ef3000000001976a9146bf19e55f94d986b4640c154d86469934191951188acffffffff02e0fe7e01000000001976a91418ba14b3682295cb05230e31fecb00089240660888ace084b003000000001976a9146bf19e55f94d986b4640c154d86469934191951188ac0000000001000000", &msg_len);
/* signature */
bbp_hash256(digest, msg, msg_len);
sig_len = ECDSA_size(key);
sig = malloc(sig_len);
ECDSA_sign(0, digest, sizeof(digest), sig, &sig_len, key);
/* */
printf("\n====== Sign Transaction =====\n");
bbp_print_hex("digest", digest, sizeof(digest));
bbp_print_hex("signature", sig, sig_len);
free(sig);
free(msg);
EC_KEY_free(key);
return 0;
} |
//
// ViewController.h
// KWListViewDemo
//
// Created by 凯文马 on 15/9/29.
// Copyright © 2015年 凯文马. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HomeViewController : UIViewController
@end
|
/* See LICENSE file for copyright and license details. */
#include <stdint.h>
#include <string.h>
#include "bswap.h"
#include "minunit.h"
static const uint8_t test_data[] = {
0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07
};
static int
bitswap_test(void)
{
const uint8_t expected[] = {
0x00, 0x80, 0x40
};
uint8_t buf[3];
memcpy(buf, test_data, 3);
mu_assert(!bswap(buf, 3, BSWAP_BITSWAP));
mu_assert(!memcmp(expected, buf, 3));
return 0;
}
static int
byteswap_test(void)
{
const uint8_t expected[] = {
0x01, 0x00, 0x03, 0x02, 0x05, 0x04
};
uint8_t buf[6];
memcpy(buf, test_data, 6);
mu_assert(!bswap(buf, 6, BSWAP_BYTESWAP));
mu_assert(!memcmp(expected, buf, 6));
mu_assert(bswap(buf, 5, BSWAP_BYTESWAP));
return 0;
}
static int
wordswap_test(void)
{
const uint8_t expected[] = {
0x03, 0x02, 0x01, 0x00
};
uint8_t buf[4];
memcpy(buf, test_data, 4);
mu_assert(!bswap(buf, 4, BSWAP_WORDSWAP));
mu_assert(!memcmp(expected, buf, 4));
mu_assert(bswap(buf, 3, BSWAP_WORDSWAP));
return 0;
}
static int
wordbyteswap_test(void)
{
const uint8_t expected[] = {
0x02, 0x03, 0x00, 0x01,
0x06, 0x07, 0x04, 0x05
};
uint8_t buf[8];
memcpy(buf, test_data, 8);
mu_assert(!bswap(buf, 8, BSWAP_WORDBYTESWAP));
mu_assert(!memcmp(expected, buf, 8));
mu_assert(bswap(buf, 7, BSWAP_WORDBYTESWAP));
return 0;
}
int
run_tests(void)
{
mu_run_test(bitswap_test);
mu_run_test(byteswap_test);
mu_run_test(wordswap_test);
mu_run_test(wordbyteswap_test);
return 0;
}
|
#include <chip.h>
#include <board_init.h>
#include <print.h>
const uint8_t hextable[] = "0123456789ABCDEF";
void print_digit(uint8_t data)
{
PRINT(&hextable[data & 0x0F], 1);
}
void print_hex_u8(uint8_t data)
{
print_digit(data>>4);
print_digit(data);
}
void print_hex_u16(uint16_t data)
{
print_digit(data>>12);
print_digit(data>>8);
print_digit(data>>4);
print_digit(data);
}
void print_hex_u32(uint32_t data)
{
print_digit(data>>28);
print_digit(data>>24);
print_digit(data>>20);
print_digit(data>>16);
print_digit(data>>12);
print_digit(data>>8);
print_digit(data>>4);
print_digit(data);
}
void print_dec_u16(uint16_t data)
{
uint16_t num = 10000;
uint8_t idx;
while(num > 0)
{
idx = data / num;
print_digit(idx);
data -= idx * num;
num = num / 10;
}
}
void print_dec_u32(uint32_t data)
{
uint32_t num = 1000000000;
uint8_t idx;
while(num > 0)
{
idx = data / num;
print_digit(idx);
data -= idx * num;
num = num / 10;
}
}
void print_bin_u32(uint32_t data)
{
uint32_t mask = 0x80000000;
while(mask != 0)
{
if(mask & data)
print_digit(1);
else
print_digit(0);
mask = mask >> 1;
}
}
void printuart_char(uint8_t c)
{
PRINT(&c, 1);
}
|
/*
* math.h
* Facade header for LXT math module
*
* Created by Justin on 24/10/08.
* Copyright 2008 Monkey Style Games. All rights reserved.
*
*/
#ifndef __LXT_MATH_MATH_H__
#define __LXT_MATH_MATH_H__
// Everyone needs their own version of pi.
#define LXT_PI 3.141596f
#include "mat4.h"
#include "util.h"
#include "vec3.h"
#include "vec3.h"
#include "vec4.h"
#include "quat.h"
#include "rect.h"
#endif // __LXT_MATH_MATH_H__
|
#include <stdlib.h>
#include "draw2d.h"
#include "graphics.h"
#include "maths.h"
#include "texture.h"
static void swap_integers(int *a, int *b) {
int t = *a;
*a = *b;
*b = t;
}
static int lerp_integers(int a, int b, float t) {
return (int)(a + (b - a) * t);
}
static void convert_color(vec4_t input, unsigned char output[4]) {
output[0] = float_to_uchar(input.x);
output[1] = float_to_uchar(input.y);
output[2] = float_to_uchar(input.z);
output[3] = float_to_uchar(input.w);
}
static void convert_point(framebuffer_t *framebuffer, vec2_t input,
int *row, int *col) {
*row = (int)((framebuffer->height - 1) * float_saturate(input.y) + 0.5f);
*col = (int)((framebuffer->width - 1) * float_saturate(input.x) + 0.5f);
}
static void draw_point(framebuffer_t *framebuffer, unsigned char color[4],
int row, int col) {
int index = (row * framebuffer->width + col) * 4;
int i;
for (i = 0; i < 4; i++) {
framebuffer->color_buffer[index + i] = color[i];
}
}
/*
* for Bresenham's line algorithm, see
* https://github.com/ssloy/tinyrenderer/wiki/Lesson-1:-Bresenham%E2%80%99s-Line-Drawing-Algorithm
*/
static void draw_line(framebuffer_t *framebuffer, unsigned char color[4],
int row0, int col0, int row1, int col1) {
int row_distance = abs(row0 - row1);
int col_distance = abs(col0 - col1);
if (row_distance == 0 && col_distance == 0) {
draw_point(framebuffer, color, row0, col0);
} else if (row_distance > col_distance) {
int row;
if (row0 > row1) {
swap_integers(&row0, &row1);
swap_integers(&col0, &col1);
}
for (row = row0; row <= row1; row++) {
float t = (float)(row - row0) / (float)row_distance;
int col = lerp_integers(col0, col1, t);
draw_point(framebuffer, color, row, col);
}
} else {
int col;
if (col0 > col1) {
swap_integers(&col0, &col1);
swap_integers(&row0, &row1);
}
for (col = col0; col <= col1; col++) {
float t = (float)(col - col0) / (float)col_distance;
int row = lerp_integers(row0, row1, t);
draw_point(framebuffer, color, row, col);
}
}
}
static void draw_texture(framebuffer_t *framebuffer, texture_t *texture,
int row, int col, int width, int height) {
int src_r, src_c;
for (src_r = 0; src_r < height; src_r++) {
for (src_c = 0; src_c < width; src_c++) {
int dst_r = row + src_r;
int dst_c = col + src_c;
int src_index = src_r * texture->width + src_c;
int dst_index = (dst_r * framebuffer->width + dst_c) * 4;
vec4_t *src_pixel = &texture->buffer[src_index];
unsigned char *dst_pixel = &framebuffer->color_buffer[dst_index];
dst_pixel[0] += float_to_uchar(src_pixel->x);
dst_pixel[1] += float_to_uchar(src_pixel->y);
dst_pixel[2] += float_to_uchar(src_pixel->z);
}
}
}
void draw2d_draw_point(framebuffer_t *framebuffer, vec4_t color_,
vec2_t point) {
unsigned char color[4];
int row, col;
convert_color(color_, color);
convert_point(framebuffer, point, &row, &col);
draw_point(framebuffer, color, row, col);
}
void draw2d_draw_line(framebuffer_t *framebuffer, vec4_t color_,
vec2_t point0, vec2_t point1) {
unsigned char color[4];
int row0, col0, row1, col1;
convert_color(color_, color);
convert_point(framebuffer, point0, &row0, &col0);
convert_point(framebuffer, point1, &row1, &col1);
draw_line(framebuffer, color, row0, col0, row1, col1);
}
void draw2d_draw_triangle(framebuffer_t *framebuffer, vec4_t color_,
vec2_t point0, vec2_t point1, vec2_t point2) {
unsigned char color[4];
int row0, col0, row1, col1, row2, col2;
convert_color(color_, color);
convert_point(framebuffer, point0, &row0, &col0);
convert_point(framebuffer, point1, &row1, &col1);
convert_point(framebuffer, point2, &row2, &col2);
draw_line(framebuffer, color, row0, col0, row1, col1);
draw_line(framebuffer, color, row1, col1, row2, col2);
draw_line(framebuffer, color, row2, col2, row0, col0);
}
void draw2d_draw_texture(framebuffer_t *framebuffer, texture_t *texture,
vec2_t origin) {
int row, col, width, height;
convert_point(framebuffer, origin, &row, &col);
width = framebuffer->width - col;
height = framebuffer->height - row;
width = width < texture->width ? width : texture->width;
height = height < texture->height ? height : texture->height;
draw_texture(framebuffer, texture, row, col, width, height);
}
|
/* Topology Builder Bruce D. Ray
IUPUI Physics Dept. NMR Center
402 N. Blackford St.
Indianapolis, IN 46202
USA
angle and torsion tables set up header param_tables.h
*/
extern void find_angles(int just_count, int max_ang, int num_atoms,
int num_bonds, int *num_angs);
extern void find_torsions(int just_count, int max_tors, int num_atoms,
int num_bonds, int *num_tors);
extern void measure_angles(int num_angs);
extern double angle_comp(int i, int j, int k);
extern void measure_torsions(int num_tors);
extern void measure_bondlen(int num_bonds);
extern void measure_improp(int num_improp);
extern void fix_tor(int count, int num_impr);
extern void correct_dihed_types(int num_tors);
extern double dihed(int i, int j, int k, int l);
extern void set_wanted_tors(int tors_max, int purge_level);
extern void count_torsions(int num_tors);
extern int single_flat_ring(int i);
extern int cross_flat_ring(int i);
extern void amber_flat_rings(int num_tors);
extern void planar_angles(int num_angles);
|
/* ヘッダファイルのインクルード */
#include <stdio.h> /* 標準入出力 */
/* main関数の定義 */
int main(void){
/* 配列の初期化 */
char text[256] = {'\0'}; /* textを'\0'で埋める. */
/* 文字列の取得 */
gets(text); /* 入力文字列をgetsでtextに格納. */
/* 文字列の出力 */
printf("text = %s\n", text); /* textの内容をprintfで出力. */
/* プログラムの終了 */
return 0; /* 0を返して正常終了. */
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.