text stringlengths 4 6.14k |
|---|
#pragma once
#include "C3TypePtr.h"
#include <vector>
#include <string>
class C3FunctionSignature {
public:
C3FunctionSignature();
C3FunctionSignature(C3TypePtr return_type, const std::vector<C3TypePtr>&& arg_types);
C3TypePtr return_type() const;
const std::vector<C3TypePtr>& arg_types() const;
const std::string& string() const;
bool operator==(C3FunctionSignature other) const;
bool operator!=(C3FunctionSignature other) const;
private:
C3TypePtr _return_type;
std::vector<C3TypePtr> _arg_types;
std::string _string;
};
|
#ifndef XSCONNECTIVITYSTATE_H
#define XSCONNECTIVITYSTATE_H
#include "xdaconfig.h"
/*! \addtogroup enums Global enumerations
@{
*/
/*! \brief XsDevice connectivity state identifiers */
enum XsConnectivityState {
XCS_Disconnected, /*!< Device has disconnected, only limited informational functionality is available. */
XCS_Rejected, /*!< Device has been rejected and is disconnected, only limited informational functionality is available. */
XCS_PluggedIn, /*!< Device is connected through a cable. */
XCS_Wireless, /*!< Device is connected wirelessly. */
XCS_File, /*!< Device is reading from a file. */
XCS_Unknown, /*!< Device is in an unknown state. */
};
/*! @} */
typedef enum XsConnectivityState XsConnectivityState;
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief Convert the device state to a human readable string */
XDA_DLL_API const char *XsConnectivityState_toString(XsConnectivityState s);
#ifdef __cplusplus
} // extern "C"
/*! \brief \copybrief XsConnectivityState_toString \sa XsConnectivityState_toString */
inline const char *toString(XsConnectivityState s)
{
return XsConnectivityState_toString(s);
}
#endif
#endif // file guard
|
/*
* 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"
#import "MKLocationManagerObserver-Protocol.h"
#import "MKLocationManagerOperation-Protocol.h"
// Not exported
@interface MKLocationManagerSingleUpdater : NSObject <MKLocationManagerObserver, MKLocationManagerOperation>
{
id _handler;
_Bool _active;
}
@property(copy, nonatomic) id handler; // @synthesize handler=_handler;
- (void)locationManagerDidResumeLocationUpdates:(id)arg1;
- (void)locationManagerDidPauseLocationUpdates:(id)arg1;
- (_Bool)locationManagerShouldPauseLocationUpdates:(id)arg1;
- (void)locationManagerDidReset:(id)arg1;
- (void)locationManagerFailedToUpdateLocation:(id)arg1 withError:(id)arg2;
- (void)locationManagerUpdatedLocation:(id)arg1;
- (void)cancel;
- (void)start;
- (void)dealloc;
- (id)initWithHandler:(id)arg1;
@end
|
#pragma once
#include "alpr.h"
#include BLIK_OPENALPR_U_prewarp_h //original-code:"prewarp.h"
#include <stdlib.h>
#include <string.h>
#include BLIK_FAKEWIN_V_windows_h //original-code:<windows.h>
#include BLIK_OPENCV_U_opencv2__highgui__highgui_hpp //original-code:"opencv2/highgui/highgui.hpp"
#include BLIK_OPENCV_U_opencv2__imgproc__imgproc_hpp //original-code:"opencv2/imgproc/imgproc.hpp"
#using <mscorlib.dll>
#include <msclr\marshal_cppstd.h>
#include "helper-net.h"
#include "bitmapmat-net.h"
#include "motiondetector-net.h"
#include "config-net.h"
namespace openalprnet {
}
|
#ifndef __IM_TOOL_BAR_H__
#define __IM_TOOL_BAR_H__
#include "ImwConfig.h"
namespace ImWindow
{
//SFF_BEGIN
class IMGUI_API ImwToolBar
{
public:
ImwToolBar(int iHorizontalPriority = 0, bool bAutoDeleted = true);
ImwToolBar(const ImwToolBar& oToolBar);
virtual ~ImwToolBar();
void Destroy();
virtual void OnToolBar() = 0;
int GetHorizontalPriority() const;
bool IsAutoDeleted();
private:
int m_iHorizontalPriority;
bool m_bAutoDeleted;
};
typedef ImVector<ImwToolBar*> ImwToolBarVector;
//SFF_END
}
#endif // __IM_TOOL_BAR_H__ |
/*
* getint: parse stream of chars as integers.
*/
#include <ctype.h>
int getch(void);
void ungetch(int);
/* getint: get next integer from input to *pn */
int getint(int *pn)
{
int c, sign;
while (isspace(c = getch())) // skip whitespace
;
if (!isdigit(c) && c != EOF && c != '+' && c != '-') {
ungetch(c);
return 0;
}
sign = (c == '-') ? -1 : 1;
if (c == '+' || c == '-')
c = getch();
for (*pn = 0; isdigit(c); c = getch())
*pn = 10 * *pn + (c - '0');
*pn *= sign;
if (c != EOF)
ungetch(c);
return c;
}
|
//
// UIView+iZJU.h
// iZJU
//
// Created by ricky on 13-6-7.
// Copyright (c) 2013年 iZJU Studio. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (iZJU)
@property (nonatomic, assign) CGFloat top, bottom, left, right;
@property (nonatomic, assign) CGFloat x, y, width, height;
- (void)moveEaseOutBounceTo:(CGPoint)point;
- (void)moveEaseOutBounceTo:(CGPoint)point duration:(NSTimeInterval)duration;
@end
|
/*
* File: jsLexer.h
* Author: ghernan
*
* Javascript lexical analysis code
*
*/
#pragma once
#include "ScriptPosition.h"
enum LEX_TYPES
{
LEX_EOF = 0,
LEX_INITIAL,
LEX_COMMENT,
LEX_ID = 256,
LEX_INT,
LEX_FLOAT,
LEX_STR,
LEX_EQUAL,
LEX_TYPEEQUAL,
LEX_NEQUAL,
LEX_NTYPEEQUAL,
LEX_LEQUAL,
LEX_LSHIFT,
LEX_GEQUAL,
LEX_RSHIFT,
LEX_RSHIFTUNSIGNED,
LEX_PLUSPLUS,
LEX_MINUSMINUS,
LEX_ANDAND,
LEX_OROR,
LEX_POWER,
LEX_CONNECT,
LEX_SEND,
LEX_ASSIGN_BASE = 512,
// LEX_PLUSEQUAL = LEX_ASSIGN_BASE + '+',
// LEX_MINUSEQUAL = LEX_ASSIGN_BASE + '-',
// LEX_ANDEQUAL = LEX_ASSIGN_BASE + '&',
// LEX_OREQUAL = LEX_ASSIGN_BASE + '|',
// LEX_XOREQUAL = LEX_ASSIGN_BASE + '^',
// LEX_LSHIFTEQUAL,
// LEX_RSHIFTEQUAL,
LEX_ASSIGN_MAX = 1023,
// reserved words
LEX_R_WORDS_BASE = 1024,
LEX_R_IF,
LEX_R_ELSE,
LEX_R_DO,
LEX_R_WHILE,
LEX_R_FOR,
LEX_R_BREAK,
LEX_R_CONTINUE,
LEX_R_FUNCTION,
LEX_R_RETURN,
LEX_R_VAR,
LEX_R_CONST,
LEX_R_TRUE,
LEX_R_FALSE,
LEX_R_NULL,
LEX_R_NEW,
//Actor system keywords
LEX_R_ACTOR,
LEX_R_INPUT,
LEX_R_OUTPUT,
LEX_R_PROTOCOL,
LEX_R_SOCKET,
//Classes and objects keywords.
LEX_R_CLASS,
//Modules keywords
LEX_R_EXPORT,
LEX_R_IMPORT,
LEX_R_LIST_END /* always the last entry */
};
/// To get the string representation of a token type
std::string getTokenStr(int token);
/**
* Javascript token. Tokens are the fragments in which input source is divided
* and classified before being parsed.
*
* The lexical analysis process is implemented taking a functional approach. There
* is no 'lexer' object. There are functions which return the current state of the
* lex process as immutable 'CScriptToken' objects.
* These objects are not strictly 'immutable', as they have assignment operator. But none
* of their public methods modify its internal state.
*/
class CScriptToken
{
public:
/**
* The constructor doesn't make a copy of the input string, so it is important
* not to delete input string while there are still live 'CSriptTokens' using it.
*
* The token created with the constructor is not parsed from input string. It is
* just the 'initial' token. To parse the first real token, call 'next'.
*/
CScriptToken(const char* code);
CScriptToken(LEX_TYPES lexType, const char* code, const ScriptPosition& position, int length);
/// Reads next token from input, and returns it.
CScriptToken next(bool skipComments = true)const;
/// Checks that the current token matches the expected, and returns next
CScriptToken match(int expected_tk)const;
///Return a string representing the position in lines and columns of the token
const ScriptPosition& getPosition()const
{
return m_position;
}
LEX_TYPES type()const
{
return m_type;
}
bool eof()const
{
return m_type == LEX_EOF;
}
std::string text()const;
const char* code()const
{
return m_code;
}
std::string strValue()const;
private:
const char* m_code;
LEX_TYPES m_type; ///<Token type.
ScriptPosition m_position;
int m_length;
CScriptToken nextDispatch()const;
CScriptToken buildNextToken(LEX_TYPES lexType, const char* code, int length)const;
CScriptToken parseComment(const char * code)const;
CScriptToken parseId(const char * code)const;
CScriptToken parseNumber(const char * code)const;
CScriptToken parseString(const char * code)const;
CScriptToken parseOperator(const char * code)const;
ScriptPosition calcPosition(const char* code)const;
CScriptToken errorAt(const char* charPos, const char* msgFormat, ...)const;
}; |
#pragma once
#include "ml_model.h"
#include "ml_model_decorator.h"
namespace lib_models {
class MlModelImpl : public MlModel,
public std::enable_shared_from_this<MlModel> {
public:
MlModelImpl() = default;
MlModelImpl(sp<MlModelDecorator> decorator);
private:
void AddData(const int id, const sutil::any_type data) override;
sutil::any_type& GetData(const int id) override;
void Aggregate(col_array<sp<lib_models::MlModel>> models) override;
col_array<sp<lib_models::MlModel>> Split(const int parts) override;
void SaModel(string save_path) override;
void LdModel(string model_path) override;
col_array<sutil::any_type> data_;
sp<MlModelDecorator> decorator_;
};
} |
//
// TestEntity.h
// Persistence
//
// Created by Jozef Bozek on 4.3.2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class Child;
@interface TestEntity : NSManagedObject
@property (nonatomic, strong) NSString * name;
@property (nonatomic, strong) NSNumber * intProperty;
@property (nonatomic, strong) NSSet *childs;
@end
@interface TestEntity (CoreDataGeneratedAccessors)
- (void)addChildsObject:(Child *)value;
- (void)removeChildsObject:(Child *)value;
- (void)addChilds:(NSSet *)values;
- (void)removeChilds:(NSSet *)values;
@end
|
/* ヘッダファイルのインクルード */
#include <stdio.h> /* 標準入出力 */
#include <ctype.h> /* 文字操作 */
/* main関数の定義 */
int main(void){
/* 変数の初期化 */
char c = NULL; /* char型変数cをNULLで初期化. */
/* 文字の取得 */
c = (char)getchar(); /* getcharで文字を取得して, cに格納.(charにキャスト.) */
/* 表示文字かどうか判定. */
if (isgraph(c)){ /* isgraphでcが表示文字なら. */
printf("%02x is Graphic Character!\n", c); /* 表示文字であることを出力. */
}
/* プログラムの終了 */
return 0; /* 0を返して正常終了. */
}
|
/**
*
* Modified by Thayne Walker 2017.
*
* This file is part of HOG2.
*
* HOG2 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.
*
* HOG2 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 HOG2; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef VECTOR2D_H
#define VECTOR2D_H
#include <math.h>
#include "FPUtil.h"
#include <ostream>
#include <vector>
//#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
//typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
//typedef K::Point_2 Point_2;
//typedef K::Point_3 Point_3;
struct xyLoc;
class Vector2D {
public:
Vector2D(Vector2D const& v):Vector2D(v.x,v.y){}
Vector2D(xyLoc const& v);
//Vector2D(Point_2 const& p):Vector2D(p[0],p[1]){};
Vector2D(double _x,double _y):x(_x),y(_y) {/*Normalize();*/}
Vector2D():x(0),y(0) {}
void Set(double _x, double _y) { x=_x; y=_y; /*Normalize();*/}
void SetUpdateTime(double t) {}
double GetUpdateTime() {return 0.0;}
void SetAccessTime(double t) {}
double GetAccessTime() {return 0.0;}
//operator Point_2()const{return Point_2(x,y);}
bool operator==(const Vector2D &rhs)const{return (fequal(x,rhs.x)&&fequal(y,rhs.y));}
bool operator<(const Vector2D &rhs)const{return fequal(x,rhs.x)?fless(y,rhs.y):fless(x,rhs.x);}
// Dot product
inline double operator *(Vector2D const& other)const{return x * other.x + y * other.y;}
inline Vector2D operator -(Vector2D const& other)const{return Vector2D(x-other.x,y-other.y);}
inline Vector2D operator +(double s)const{return Vector2D(x+s,y+s);}
inline void operator -=(Vector2D const& other){x-=other.x;y-=other.y;}
// Negation
inline Vector2D operator -()const{return Vector2D(-x,-y);}
// Slope angle of this vector
inline double atan()const{ return atan2(y,x); }
// Square
inline double sq()const{ return (*this) * (*this); }
inline double len()const{ return sqrt(sq()); }
inline double cross(Vector2D const& b)const{return x*b.y-y*b.x;}
// Vector that is perpendicular to this vector
inline Vector2D perp()const{return Vector2D(y,-x);}
inline double min()const{return x<y?x:y;}
inline double max()const{return x>y?x:y;}
// Project an (unclosed) polygon onto this line (a normalized axis)
inline Vector2D projectPolyOntoSelf(std::vector<Vector2D> const& poly)const{
double min(poly[0]*(*this));
double max=min;
for(unsigned i(1); i<poly.size(); ++i){
double proj(poly[i]*(*this));
if(fless(proj,min)) min = proj;
if(fgreater(proj,max)) max = proj;
}
return Vector2D(min,max);
}
friend Vector2D operator /(const Vector2D& vec, const double num)
{
return Vector2D(vec.x / num, vec.y / num);
}
friend Vector2D operator *(const Vector2D& vec, const double num)
{
return Vector2D(vec.x * num, vec.y * num);
}
friend Vector2D operator *(const double num, const Vector2D& vec)
{
return Vector2D(vec.x * num, vec.y * num);
}
friend Vector2D operator +(const Vector2D& v1, const Vector2D& v2)
{
return Vector2D(v1.x + v2.x, v1.y + v2.y);
}
inline void operator +=(double s) { x +=s; y +=s; }
inline void operator +=(const Vector2D& v2) { x +=v2.x; y +=v2.y; }
inline void operator *=(double s) { x*=s; y*=s; }
inline void operator *=(Vector2D const& s) { x*=s.x; y*=s.y; }
inline void operator /=(double s) { x/=s; y/=s; }
// //private:
double x, y;
//double updateTime, accessTime;
void Normalize()
{
if ((x==0)&&(y==0))
return;
double magnitude(len());
x /= magnitude;
y /= magnitude;
}
};
struct TemporalVector : Vector2D {
TemporalVector(Vector2D const& loc, double time):Vector2D(loc), t(time){}
TemporalVector(double _x, double _y, float time):Vector2D(_x,_y), t(time){}
TemporalVector():Vector2D(),t(0){}
inline bool operator==(TemporalVector const& other)const{return Vector2D::operator==(other)&&fequal(t,other.t);}
double t;
};
// Calculate determinant of vector
inline double det(Vector2D const& v1, Vector2D const& v2){
return v1.x*v2.y - v1.y*v2.x;
}
// Compute normal to line segment with specified endpoints
inline Vector2D normal(Vector2D const& v1, Vector2D const& v2){
Vector2D tmp(v2.y-v1.y,v1.x-v2.x);
tmp.Normalize();
return tmp;
}
std::ostream& operator <<(std::ostream & out, Vector2D const& v);
#endif
|
#ifndef SIGNATURE_H
#define SIGNATURE_H
#include <ostream>
#include <array>
#include <stdexcept>
#include <limits>
#include "style.h"
#include "Polynomial.h"
/* lead monomials of elements of R^l, i.e. x^{...}*e_i */
template<class P = Polynomial<Term<int, Monomial<char> > > >
class Signature {
public:
typedef typename P::TermType::MonomialType MonomialType;
typedef typename P::TermType::CoefficientType CoefficientType;
typedef typename P::TermType TermType;
typedef Signature<P> This;
Signature() : m(), index(std::numeric_limits<uint>::max()) {}
Signature(const MonomialType& monomial, uint i) : m(monomial), index(i) {}
static This e(int i) {
This result;
result.index = i;
return result;
}
bool operator==(const This& other) const {
return index == other.index && m == other.m;
}
bool operator<(const This& other) const {
uint i = index;
uint j = other.index;
if (i > j) return true;
if (i == j && m < other.m) return true;
return false;
}
bool operator>(const This& other) const { return other < *this; }
bool divides(const This& other) const {
if (index != other.index) return false;
return m.divides(other.m);
}
MonomialType operator/(const This& other) const {
if (!other.divides(*this)) throw std::domain_error("does not divide");
return m / other.m;
}
This& operator*=(const TermType& b) { m *= b.m(); return *this; }
This operator*(const TermType& b) const { This r(*this); r *= b; return r; }
This& operator*=(const MonomialType& b) { m *= b; return *this; }
This operator*(const MonomialType& b) const { This r(*this); r *= b; return r; }
template<class P1>
friend std::ostream& operator<<(std::ostream&, const Signature<P1>&);
MonomialType m;
uint index;
};
template<class P>
Signature<P> operator*(const typename P::MonomialType& a, const Signature<P>& b) {
return b * a;
}
template<class P>
Signature<P> operator*(const typename P::TermType& a, const Signature<P>& b) {
return b * a;
}
template<class P>
std::ostream& operator<<(std::ostream& out, const Signature<P>& u) {
if (!u.m.isConstant()) out << u.m << "*";
return out << "e_" << u.index;
}
#endif // SIGNATURE_H
// vim:ruler:cindent:shiftwidth=2:expandtab:
|
// ÏÂÁÐ ifdef ¿éÊÇ´´½¨Ê¹´Ó DLL µ¼³ö¸ü¼òµ¥µÄ
// ºêµÄ±ê×¼·½·¨¡£´Ë DLL ÖеÄËùÓÐÎļþ¶¼ÊÇÓÃÃüÁîÐÐÉ϶¨ÒåµÄ MDAPI_EXPORTS
// ·ûºÅ±àÒëµÄ¡£ÔÚʹÓÃ´Ë DLL µÄ
// ÈÎºÎÆäËûÏîÄ¿Éϲ»Ó¦¶¨Òå´Ë·ûºÅ¡£ÕâÑù£¬Ô´ÎļþÖаüº¬´ËÎļþµÄÈÎºÎÆäËûÏîÄ¿¶¼»á½«
// MDAPI_API º¯ÊýÊÓΪÊÇ´Ó DLL µ¼ÈëµÄ£¬¶ø´Ë DLL Ôò½«Óô˺궨ÒåµÄ
// ·ûºÅÊÓΪÊDZ»µ¼³öµÄ¡£
//#ifdef MDAPI_EXPORTS
//#define MDAPI_API __declspec(dllexport)
//#else
//#define MDAPI_API __declspec(dllimport)
//#endif
//#include ".\api\ThostFtdcMdApi.h"
#pragma once
#define MDAPI_API __declspec(dllexport)
#define WINAPI __stdcall
#define WIN32_LEAN_AND_MEAN // ´Ó Windows Í·ÎļþÖÐÅųý¼«ÉÙʹÓõÄÐÅÏ¢
#include "stdafx.h"
#include ".\api\ThostFtdcMdApi.h"
#include ".\api\ThostFtdcUserApiDataType.h"
#include ".\api\ThostFtdcUserApiStruct.h"
// USER_API²ÎÊý
CThostFtdcMdApi* pUserApi;
//»Øµ÷º¯Êý
void* _OnFrontConnected;
void* _OnFrontDisconnected;
void* _OnHeartBeatWarning;
void* _OnRspUserLogin;
void* _OnRspUserLogout;
void* _OnRspSubMarketData;
void* _OnRspUnSubMarketData;
void* _OnRtnDepthMarketData;
void* _OnRspSubForQuoteRsp;
void* _OnRspUnSubForQuoteRsp;
void* _OnRtnForQuoteRsp;
void* _OnRspError;
///Á¬½Ó
typedef int (WINAPI *DefOnFrontConnected)(void);
///µ±¿Í»§¶ËÓë½»Ò׺ǫ́ͨÐÅÁ¬½Ó¶Ï¿ªÊ±£¬¸Ã·½·¨±»µ÷Óᣵ±·¢ÉúÕâ¸öÇé¿öºó£¬API»á×Ô¶¯ÖØÐÂÁ¬½Ó£¬¿Í»§¶Ë¿É²»×ö´¦Àí¡£
///@param nReason ´íÎóÔÒò
/// 0x1001 ÍøÂç¶Áʧ°Ü
/// 0x1002 ÍøÂçдʧ°Ü
/// 0x2001 ½ÓÊÕÐÄÌø³¬Ê±
/// 0x2002 ·¢ËÍÐÄÌøÊ§°Ü
/// 0x2003 ÊÕµ½´íÎó±¨ÎÄ
typedef int (WINAPI *DefOnFrontDisconnected)(int nReason);
///ÐÄÌø³¬Ê±¾¯¸æ¡£µ±³¤Ê±¼äδÊÕµ½±¨ÎÄʱ£¬¸Ã·½·¨±»µ÷Óá£
///@param nTimeLapse ¾àÀëÉϴνÓÊÕ±¨ÎĵÄʱ¼ä
typedef int (WINAPI *DefOnHeartBeatWarning)(int nTimeLapse);
///µÇ¼ÇëÇóÏìÓ¦
typedef int (WINAPI *DefOnRspUserLogin)(CThostFtdcRspUserLoginField *pRspUserLogin,CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
//µÇ³öÇëÇóÏìÓ¦
typedef int (WINAPI *DefOnRspUserLogout)(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///´íÎóÓ¦´ð
typedef int (WINAPI *DefOnRspError)(CThostFtdcRspInfoField *pRspInfo,int nRequestID, bool bIsLast);
//¶©ÔÄÐÐÇéÓ¦´ð
typedef int (WINAPI *DefOnRspSubMarketData)(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
//È¡ÏûÐÐÇéÓ¦´ð
typedef int (WINAPI *DefOnRspUnSubMarketData)(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
//Éî¶ÈÐÐÇé֪ͨ
typedef int (WINAPI *DefOnRtnDepthMarketData)(CThostFtdcDepthMarketDataField *pDepthMarketData);
///¶©ÔÄѯ¼ÛÓ¦´ð
typedef int (WINAPI *DefOnRspSubForQuoteRsp)(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///È¡Ïû¶©ÔÄѯ¼ÛÓ¦´ð
typedef int (WINAPI *DefOnRspUnSubForQuoteRsp)(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///ѯ¼Û֪ͨ
typedef int (WINAPI *DefOnRtnForQuoteRsp)(CThostFtdcForQuoteRspField *pForQuoteRsp);
// ´ËÀàÊÇ´Ó MdApi.dll µ¼³öµÄ
class CMdSpi : public CThostFtdcMdSpi
{
public:
///µ±¿Í»§¶ËÓë½»Ò׺ǫ́½¨Á¢ÆðͨÐÅÁ¬½Óʱ£¨»¹Î´µÇ¼ǰ£©£¬¸Ã·½·¨±»µ÷Óá£
virtual void OnFrontConnected();
///µ±¿Í»§¶ËÓë½»Ò׺ǫ́ͨÐÅÁ¬½Ó¶Ï¿ªÊ±£¬¸Ã·½·¨±»µ÷Óᣵ±·¢ÉúÕâ¸öÇé¿öºó£¬API»á×Ô¶¯ÖØÐÂÁ¬½Ó£¬¿Í»§¶Ë¿É²»×ö´¦Àí¡£
///@param nReason ´íÎóÔÒò
/// 0x1001 ÍøÂç¶Áʧ°Ü
/// 0x1002 ÍøÂçдʧ°Ü
/// 0x2001 ½ÓÊÕÐÄÌø³¬Ê±
/// 0x2002 ·¢ËÍÐÄÌøÊ§°Ü
/// 0x2003 ÊÕµ½´íÎó±¨ÎÄ
virtual void OnFrontDisconnected(int nReason);
///ÐÄÌø³¬Ê±¾¯¸æ¡£µ±³¤Ê±¼äδÊÕµ½±¨ÎÄʱ£¬¸Ã·½·¨±»µ÷Óá£
///@param nTimeLapse ¾àÀëÉϴνÓÊÕ±¨ÎĵÄʱ¼ä
virtual void OnHeartBeatWarning(int nTimeLapse);
///µÇ¼ÇëÇóÏìÓ¦
virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///µÇ³öÇëÇóÏìÓ¦
virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///´íÎóÓ¦´ð
virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo,int nRequestID, bool bIsLast);
///¶©ÔÄÐÐÇéÓ¦´ð
virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///È¡Ïû¶©ÔÄÐÐÇéÓ¦´ð
virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///Éî¶ÈÐÐÇé֪ͨ
virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData);
///¶©ÔÄѯ¼ÛÓ¦´ð
virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///È¡Ïû¶©ÔÄѯ¼ÛÓ¦´ð
virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///ѯ¼Û֪ͨ
virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp);
}; |
/**
* This header is generated by class-dump-z 0.2a.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: (null)
*/
#import "AWSModel.h"
@class NSNumber;
@interface AWSAutoScalingInstanceMonitoring : AWSModel {
NSNumber* _enabled;
}
@property(retain, nonatomic) NSNumber* enabled;
+ (id)JSONKeyPathsByPropertyKey;
- (void).cxx_destruct;
@end
|
//
// QSCompany2+CoreDataClass.h
// SyncKit
//
// Created by Manuel Entrena on 30/12/2016.
// Copyright © 2016 Manuel. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import <SyncKit/QSPrimaryKey.h>
@class QSEmployee2;
NS_ASSUME_NONNULL_BEGIN
@interface QSCompany2 : NSManagedObject <QSPrimaryKey>
@end
NS_ASSUME_NONNULL_END
#import "QSCompany2+CoreDataProperties.h"
|
#ifndef FIX50_MESSAGES_H
#define FIX50_MESSAGES_H
#include "../Message.h"
#include "../Group.h"
namespace FIX50
{
class Header : public FIX::Header
{
public:
};
class Trailer : public FIX::Trailer
{
public:
};
class Message : public FIX::Message
{
public:
Message( const FIX::MsgType& msgtype )
: FIX::Message(
FIX::BeginString("FIXT.1.1"), msgtype )
{ getHeader().setField( FIX::ApplVerID("7") ); }
Message(const FIX::Message& m) : FIX::Message(m) {}
Message(const Message& m) : FIX::Message(m) {}
Header& getHeader() { return (Header&)m_header; }
const Header& getHeader() const { return (Header&)m_header; }
Trailer& getTrailer() { return (Trailer&)m_trailer; }
const Trailer& getTrailer() const { return (Trailer&)m_trailer; }
};
}
#endif
|
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "utils/checksum.h"
#include "utils/addresses.h"
#include "socket/tcp_ipv4_socket.h"
#include "tcp/tcp_flags.h"
#include "tcp/tcp_messaging.h"
#include "tcp/tcp_commands.h"
int main(int argc, const char* argv[]) {
srand(time(NULL));
struct tcp_ip_socket* s;
struct tcp_ip_datagram* response;
int source_port;
char *dest_ip;
char dest_host[] = "pop.i.ua";
char msg[120] = {0};
if (argc < 2) {
printf("Parameters: username [port]\n");
exit (EXIT_FAILURE);
}
if (argc < 3) {
source_port = 47180;
}
else {
source_port = atoi(argv[2]);
}
char* password = getpass("Enter password: ");
dest_ip = get_ip_address(dest_host);
s = generate_tcp_ipv4_socket("192.168.1.2", dest_ip,
source_port, 110);
free(dest_ip);
// HANDSHAKE
if (tcp_handshake(s) < 0) {
close(s->socket);
free(s);
exit(EXIT_FAILURE);
}
// ACK message
if (tcp_confirm(s) < 0) {
close(s->socket);
free(s);
exit(EXIT_FAILURE);
}
tcp_push_message(s, "USER krygin2\r\n");
strcpy(msg, "USER");
strcat(msg, argv[1]);
strcat(msg, "\r\n");
/*
response = receive_datagram(s);
set_tcp_confirm(s->datagram, response);
*/
// ACK message
if (tcp_confirm(s) < 0) {
close(s->socket);
free(s);
exit(EXIT_FAILURE);
}
memset(msg, 0, 120);
strcpy(msg, "PASS ");
strcat(msg, password);
strcat(msg, "\r\n");
free(password);
tcp_push_message(s, msg);
response = receive_datagram(s);
printf("%s", response->message);
set_tcp_confirm(s->datagram, response);
tcp_push_message(s, "LIST\r\n");
response = receive_datagram(s);
printf("LIST: %s", response->message);
set_tcp_confirm(s->datagram, response);
tcp_push_message(s, "TOP 1 0\r\n");
response = receive_datagram(s);
printf("TOP: %s", response->message);
set_tcp_confirm(s->datagram, response);
tcp_push_message(s, "TOP 2 0\r\n");
response = receive_datagram(s);
printf("TOP: %s", response->message);
set_tcp_confirm(s->datagram, response);
tcp_push_message(s, "TOP 3 0\r\n");
response = receive_datagram(s);
printf("TOP: %s", response->message);
set_tcp_confirm(s->datagram, response);
tcp_push_message(s, "TOP 3 0\r\n");
response = receive_datagram(s);
printf("TOP: %s", response->message);
set_tcp_confirm(s->datagram, response);
tcp_push_message(s, "QUIT\r\n");
// ACK message
memset(s->datagram->message, 0, MESSAGE_SIZE);
if (tcp_confirm(s) < 0) {
close(s->socket);
free(s);
exit(EXIT_FAILURE);
}
// CLOSE
if (tcp_close(s) < 0) {
printf("Unable to close connection\n");
close(s->socket);
free(s);
exit(EXIT_FAILURE);
}
close(s->socket);
free(s);
exit(EXIT_SUCCESS);
}
|
/*
* ProjectEuler/src/c/Problem392.c
*
* Enmeshed unit circle
* ====================
* Published on Saturday, 1st September 2012, 02:00 pm
*
* A rectilinear grid is an orthogonal grid where the spacing between the
* gridlines does not have to be equidistant. An example of such grid is
* logarithmic graph paper. Consider rectilinear grids in the Cartesian
* coordinate system with the following properties:The gridlines are parallel to
* the axes of the Cartesian coordinate system.There are N+2 vertical and N+2
* horizontal gridlines. Hence there are (N+1) x (N+1) rectangular cells.The
* equations of the two outer vertical gridlines are x = -1 and x = 1.The
* equations of the two outer horizontal gridlines are y = -1 and y = 1.The grid
* cells are colored red if they overlap with the unit circle, black
* otherwise.For this problem we would like you to find the postions of the
* remaining N inner horizontal and N inner vertical gridlines so that the area
* occupied by the red cells is minimized. E.g. here is a picture of the
* solution for N = 10: The area occupied by the red cells for N = 10
* rounded to 10 digits behind the decimal point is 3.3469640797.
*/
#include <stdio.h>
#include "ProjectEuler/ProjectEuler.h"
#include "ProjectEuler/Problem392.h"
int main(int argc, char** argv) {
return 0;
} |
#pragma once
class CLocalServerHandlerProxy
{
public:
CLocalServerHandlerProxy(void* handle);
~CLocalServerHandlerProxy();
private:
CLocalServerHandlerProxy(const CLocalServerHandlerProxy&);
CLocalServerHandlerProxy& operator = (const CLocalServerHandlerProxy&);
public:
void BeginNewConnectionRequest(const uint64 id, const string& address, const int port);
void BeginLogonRequest(const uint64 id, const string& address, const int port, const string& username, const string& password, const string& deviceid, const string& appsessionid);
void BeginTwoFactorAuthResponse(const uint64 id, const FxTwoFactorReason reason, const std::string& otp);
void BeginShutdownConnectionNotification(const uint64 id);
void BeginCurrenciesInformationRequest(const uint64 id, const string& requestId);
void BeginSymbolsInformationRequest(const uint64 id, const string& requestId);
void BeginSessionInformationRequest(const uint64 id, const string& requestId);
void BeginSubscribeToQuotesRequest(const uint64 id, const string& requestId, const vector<string>& symbols, int32 marketDepth);
void BeginUnsubscribeQuotesRequest(const uint64 id, const string& requestId, const vector<string>& symbols);
void BeginComponentsInformationRequest(const uint64 id, const string& requestId, const int clientVersion);
void BeginDataHistoryRequest(const uint64 id, const string& requestId, const CFxDataHistoryRequest& request);
void BeginFileChunkRequest(const uint64 id, const string& requestId, const string& fileId, const uint32 chunkId);
void BeginBarsHistoryMetaInformationFileRequest(const uint64 id, const string& requestId, const string& symbol, int32 priceType, const string& period);
void BeginQuotesHistoryMetaInformationFileRequest(const uint64 id, const string& requestId, const string& symbol, bool includeLevel2);
private:
void* m_handle;
CLrpLocalClient m_client;
}; |
//
// 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 DSANode, DSATextSearchResult, DSMQuery, NSArray, NSString, NSURL;
@interface IDEDocSearchResult : NSObject
{
DSANode *_searchResultNode;
DSATextSearchResult *_textResult;
DSMQuery *_searchQuery;
NSURL *_overrideURL;
}
+ (id)searchResultForTextResult:(id)arg1 overrideURL:(id)arg2 fromQuery:(id)arg3;
+ (id)searchResultForTextResult:(id)arg1 fromQuery:(id)arg2;
+ (id)searchResultForNode:(id)arg1 fromQuery:(id)arg2;
@property(copy) NSURL *overrideURL; // @synthesize overrideURL=_overrideURL;
@property(retain) DSMQuery *searchQuery; // @synthesize searchQuery=_searchQuery;
@property(retain) DSATextSearchResult *textResult; // @synthesize textResult=_textResult;
@property(retain) DSANode *searchResultNode; // @synthesize searchResultNode=_searchResultNode;
- (void).cxx_destruct;
- (id)childItems;
- (id)description;
@property(readonly, copy) NSURL *URL;
@property(readonly, copy) NSString *displayName;
@property(readonly, copy) NSArray *children;
@end
|
/*
** C data arithmetic.
** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h
*/
#ifndef _LJ_CARITH_H
#define _LJ_CARITH_H
#include "lj_obj.h"
#if LJ_HASFFI
LJ_FUNC int lj_carith_op(lua_State *L, MMS mm);
#if LJ_32 && LJ_HASJIT
LJ_FUNC int64_t lj_carith_mul64(int64_t x, int64_t k);
#endif
LJ_FUNC uint64_t lj_carith_divu64(uint64_t a, uint64_t b);
LJ_FUNC int64_t lj_carith_divi64(int64_t a, int64_t b);
LJ_FUNC uint64_t lj_carith_modu64(uint64_t a, uint64_t b);
LJ_FUNC int64_t lj_carith_modi64(int64_t a, int64_t b);
LJ_FUNC uint64_t lj_carith_powu64(uint64_t x, uint64_t k);
LJ_FUNC int64_t lj_carith_powi64(int64_t x, int64_t k);
#endif
#endif
|
#include "MatrixN.h"
#include "Earlab.h"
#include "Logger.h"
#include "XmlMetadata.h"
#include "EarlabDataStream.h"
#include "EarlabModule.h"
class IHC
{
public:
IHC(double SampleRate_Hz, double Gain);
float Step(float Displacement_nM);
private:
double mSampleRate_Hz, mGain;
double ga0;
double mGA, mOldGA[4];
double mIHCFilter[4], mOldIHCFilter[4];
double ihca,ihcb;
double x0,x1;
double sx0,sx1;
double state_0;
double tau;
};
class CarneyInnerHaircell : public EarlabModule
{
public:
CarneyInnerHaircell();
~CarneyInnerHaircell();
int ReadParameters(const char *ParameterFileName);
int ReadParameters(const char *ParameterFileName, const char *SectionName);
int Start(int NumInputs, EarlabDataStreamType InputTypes[EarlabMaxIOStreamCount], int InputSize[EarlabMaxIOStreamCount][EarlabMaxIOStreamDimensions],
int NumOutputs, EarlabDataStreamType OutputTypes[EarlabMaxIOStreamCount], int OutputSize[EarlabMaxIOStreamCount][EarlabMaxIOStreamDimensions],
unsigned int OutputElementCounts[EarlabMaxIOStreamCount]);
int Advance(EarlabDataStream *InputStream[EarlabMaxIOStreamCount], EarlabDataStream *OutputStream[EarlabMaxIOStreamCount]);
int Stop(void);
int Unload(void);
private:
double mSampleRate_Hz;
int mNumChannels, mFrameSize_Samples, mSampleCount;
double mGain;
XmlMetadataFile *mMetadataFile;
IHC **IHCs;
char mCFFileName[256];
};
|
//================================================================
// Copyright (c) 2015 Leif Erkenbrach
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//================================================================
#pragma once
#ifndef NOVUS_KEYBOARD_STATE_H
#define NOVUS_KEYBOARD_STATE_H
#include <vector>
namespace novus
{
namespace KeyboardKey
{
enum Type
{
KEY_BACKSPACE = 8,
KEY_TAB,
KEY_RETURN = 13,
KEY_SHIFT = 16,
KEY_CONTROL,
KEY_ALT,
KEY_ESC = 27,
KEY_SPACE = 32,
KEY_LEFT = 37,
KEY_UP,
KEY_RIGHT,
KEY_DOWN,
KEY_0 = 48,
KEY_1,
KEY_2,
KEY_3,
KEY_4,
KEY_5,
KEY_6,
KEY_7,
KEY_8,
KEY_9,
KEY_A = 65,
KEY_B,
KEY_C,
KEY_D,
KEY_E,
KEY_F,
KEY_G,
KEY_H,
KEY_I,
KEY_J,
KEY_K,
KEY_L,
KEY_M,
KEY_N,
KEY_O,
KEY_P,
KEY_Q,
KEY_R,
KEY_S,
KEY_T,
KEY_U,
KEY_V,
KEY_W,
KEY_X,
KEY_Y,
KEY_Z,
KEY_NUMPAD0 = 96,
KEY_NUMPAD1,
KEY_NUMPAD2,
KEY_NUMPAD3,
KEY_NUMPAD4,
KEY_NUMPAD5,
KEY_NUMPAD6,
KEY_NUMPAD7,
KEY_NUMPAD8,
KEY_NUMPAD9,
KEY_MULTIPLY,
KEY_ADD,
KEY_SEPARATOR,
KEY_SUBTRACT,
KEY_DECIMAL,
KEY_DIVIDE,
KEY_F1,
KEY_F2,
KEY_F3,
KEY_F4,
KEY_F5,
KEY_F6,
KEY_F7,
KEY_F8,
KEY_F9,
KEY_F10,
KEY_F11,
KEY_F12,
KEY_LSHIFT = 160,
KEY_RSHIFT,
KEY_LCONTROL,
KEY_RCONTROL,
KEY_TILDE = 192,
KEY_COUNT,
};
}
class KeyboardState
{
friend class InputSystem;
public:
bool IsKeyPressed(KeyboardKey::Type key) const;
private:
KeyboardState();
~KeyboardState();
void PressKey(KeyboardKey::Type key);
void ReleaseKey(KeyboardKey::Type key);
private:
//char mKeys[21]; //Bitmap of keys
std::vector<bool> mKeys; //Looks like vector handles bools in the same way internally
};
}
#endif |
/*
(C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use.
*/
#ifndef MY_STUFF
#define MY_STUFF
# define CHARLS_STATIC
#endif
|
void print_matrix(double[64]);
void print_vector(double[8]);
|
//
// BCAppDelegate.h
// BCFirstLaunchTutorial
//
// Created by Bertrand Caron on 04/11/2013.
// Copyright (c) 2013 Bertrand Caron. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "BCFirstLaunchTutorial.h"
#import "BCGuidedTourWindowController.h"
@interface BCAppDelegate : NSObject <NSApplicationDelegate>
@property IBOutlet NSWindow *window;
@property IBOutlet NSTableView* tableView;
@property IBOutlet NSSearchField* searchField;
@property IBOutlet NSTextField* textField;
@property IBOutlet NSButton* button;
@property (strong) BCFirstLaunchTutorial* popoverController;
@property BCGuidedTourWindowController* guidedTourWindowController;
@end
|
#import <UIKit/UIKit.h>
@interface SBAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// Created by Aleksandrs Proskurins
//
// License
// Copyright © 2016 Aleksandrs Proskurins
// Released under an MIT license: http://opensource.org/licenses/MIT
//
#import <UIKit/UIKit.h>
//! Project version number for APCoreDataKit.
FOUNDATION_EXPORT double APCoreDataKitVersionNumber;
//! Project version string for APCoreDataKit.
FOUNDATION_EXPORT const unsigned char APCoreDataKitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <APCoreDataKit/PublicHeader.h>
|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_RSPrescreener_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_RSPrescreener_TestsVersionString[];
|
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2013-2016 Damien P. George
* Copyright (c) 2016 Paul Sokolovsky
*
* 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.
*/
#include "py/mpconfig.h"
#if MICROPY_PY_UTIME_MP_HAL
#include <string.h>
#include "py/obj.h"
#include "py/mphal.h"
#include "py/smallint.h"
#include "extmod/utime_mphal.h"
STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
#if MICROPY_PY_BUILTINS_FLOAT
mp_hal_delay_ms(1000 * mp_obj_get_float(seconds_o));
#else
mp_hal_delay_ms(1000 * mp_obj_get_int(seconds_o));
#endif
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(mp_utime_sleep_obj, time_sleep);
STATIC mp_obj_t time_sleep_ms(mp_obj_t arg) {
mp_int_t ms = mp_obj_get_int(arg);
if (ms > 0) {
mp_hal_delay_ms(ms);
}
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(mp_utime_sleep_ms_obj, time_sleep_ms);
STATIC mp_obj_t time_sleep_us(mp_obj_t arg) {
mp_int_t us = mp_obj_get_int(arg);
if (us > 0) {
mp_hal_delay_us(us);
}
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(mp_utime_sleep_us_obj, time_sleep_us);
STATIC mp_obj_t time_ticks_ms(void) {
return MP_OBJ_NEW_SMALL_INT(mp_hal_ticks_ms() & MP_SMALL_INT_POSITIVE_MASK);
}
MP_DEFINE_CONST_FUN_OBJ_0(mp_utime_ticks_ms_obj, time_ticks_ms);
STATIC mp_obj_t time_ticks_us(void) {
return MP_OBJ_NEW_SMALL_INT(mp_hal_ticks_us() & MP_SMALL_INT_POSITIVE_MASK);
}
MP_DEFINE_CONST_FUN_OBJ_0(mp_utime_ticks_us_obj, time_ticks_us);
STATIC mp_obj_t time_ticks_cpu(void) {
return MP_OBJ_NEW_SMALL_INT(mp_hal_ticks_cpu() & MP_SMALL_INT_POSITIVE_MASK);
}
MP_DEFINE_CONST_FUN_OBJ_0(mp_utime_ticks_cpu_obj, time_ticks_cpu);
STATIC mp_obj_t time_ticks_diff(mp_obj_t start_in, mp_obj_t end_in) {
// we assume that the arguments come from ticks_xx so are small ints
uint32_t start = MP_OBJ_SMALL_INT_VALUE(start_in);
uint32_t end = MP_OBJ_SMALL_INT_VALUE(end_in);
return MP_OBJ_NEW_SMALL_INT((end - start) & MP_SMALL_INT_POSITIVE_MASK);
}
MP_DEFINE_CONST_FUN_OBJ_2(mp_utime_ticks_diff_obj, time_ticks_diff);
#endif // MICROPY_PY_UTIME_MP_HAL
|
/*
* com.h
*
*/
#ifndef COM_H_
#define COM_H_
#include <stddef.h>
/* Data register. Reading this registers read from the Receive buffer.
* Writing to this register writes to the Transmit buffer. */
#define COM_REG_DATA (0)
/* Interrupt Enable Register. */
#define COM_REG_IER (1)
/* With DLAB set to 1, this is the least significant byte of the divisor value
* for setting the baud rate. */
#define COM_REG_BAUDL (0)
/* With DLAB set to 1, this is the most significant byte of the divisor
* value. */
#define COM_REG_BAUDH (1)
/* Interrupt Identification and FIFO control registers. */
#define COM_REG_IIR (2)
/* Line Control Register. The most significant bit of this register is the
* DLAB. */
#define COM_REG_LCR (3)
/* Modem Control Register. */
#define COM_REG_MCR (4)
/* Line Status Register. */
#define COM_REG_LSR (5)
/* Modem Status Register. */
#define COM_REG_MSR (6)
/* Scratch Register. */
#define COM_REG_SR (7)
#define COM_LCR_STOP_BIT 2
#define COM_LCR_PAR1_BIT 3
#define COM_LCR_PAR2_BIT 4
#define COM_LCR_PAR3_BIT 5
/* When this bit is set, offsets 0 and 1 are mapped to the low and high bytes
* of the Divisor register for setting the baud rate of the port. When this
* bit is clear, offsets 0 and 1 are mapped to their normal registers. */
#define COM_LCR_DLAB_BIT 7
/* receive buffer full (data available) */
#define COM_LSR_RBF_BIT 0
/* transmitter empty (new transmission can be started) */
#define COM_LSR_TEMT_BIT 6
/* This defines, how many bits of data will be sent in one character. Set this
* value by writing to the two least significant bits of the LCR */
#define COM_DATA_LEN_5 (0b00)
#define COM_DATA_LEN_6 (0b01)
#define COM_DATA_LEN_7 (0b10)
#define COM_DATA_LEN_8 (0b11)
/* This defines how many bits will be used as an end to the character.
* bit 2 of LCR.
*/
#define COM_STOP_ONE (0b00)
#define COM_STOP_MORE (0b01) /* 1.5 for DATA_LEN == 5, 2 otherwise */
/* Parity bits. */
#define COM_PARITY_NONE (0b000) /* no parity bit */
#define COM_PARITY_ODD (0b001) /* makes character sum odd */
#define COM_PARITY_EVEN (0b011) /* makes character sum even */
#define COM_PARITY_MARK (0b101) /* always 1 */
#define COM_PARITY_SPACE (0b111) /* always 0 */
void com_get_ports(u16* out, size_t* len);
int com_init_port(u16 port, u32 baud, u8 data_len, u8 stop_bit, u8 parity);
inline int com_data_available(u16 port);
inline int com_transmitter_empty(u16 port);
inline u8 com_data_read(u16 port);
inline void com_data_write(u16 port, u8 data);
#endif /* COM_H_ */
|
/* note: this file is only a backward compatible wrapper
for the old-style "platform.exports" definitions.
If your platform has migrated to the new exports
style you may as well insert the exports right here */
#include "sqVirtualMachine.h"
#include "sqMemoryAccess.h"
/* Configuration options */
#include "sqConfig.h"
/* Platform specific definitions */
#include "sqPlatformSpecific.h"
#include <stdio.h>
#include "sqMacUIEvents.h"
#if !NewspeakVM
# include "SerialPlugin.h"
#endif
/* duh ... this is ugly */
#define XFN(export) {"", #export, (void*)export},
#define XFNDF(export,depth,flags) {"", #export "\000" depth flags, (void*)export},
WindowPtr getSTWindow(void);
void setMessageHook(eventMessageHook theHook);
void setPostMessageHook(eventMessageHook theHook);
char * GetAttributeString(sqInt id);
#if !NewspeakVM
int serialPortSetControl(int portNum,int control, char *data);
int serialPortIsOpen(int portNum);
int serialPortNames(int portNum, char *portName, char *inName, char *outName);
#endif
Boolean IsKeyDown(void);
sqInt primitivePluginBrowserReady(void);
#ifdef ENABLE_URL_FETCH
sqInt primitivePluginDestroyRequest(void);
sqInt primitivePluginRequestFileHandle(void);
sqInt primitivePluginRequestState(void);
sqInt primitivePluginRequestURL(void);
sqInt primitivePluginRequestURLStream(void);
sqInt primitivePluginPostURL(void);
#endif
void *os_exports[][3] = {
XFN(getSTWindow)
XFN(setMessageHook)
XFN(setPostMessageHook)
XFN(GetAttributeString)
XFN(recordDragDropEvent)
#if !NewspeakVM
XFN(serialPortSetControl)
XFN(serialPortIsOpen)
XFN(serialPortClose)
XFN(serialPortCount)
XFN(serialPortNames)
XFN(serialPortOpen)
XFN(serialPortReadInto)
XFN(serialPortWriteFrom)
#endif
XFN(IsKeyDown)
XFN(getUIToLock)
/* Plugin support primitives
We should make these primitives a proper plugin
but right now we just need the exports. */
XFNDF(primitivePluginBrowserReady,"\377","\000")
#ifdef ENABLE_URL_FETCH
XFNDF(primitivePluginRequestURLStream,"\001","\000")
XFNDF(primitivePluginRequestURL,"\001","\000")
XFNDF(primitivePluginPostURL,"\001","\000")
XFNDF(primitivePluginRequestFileHandle,"\000","\000")
XFNDF(primitivePluginDestroyRequest,"\000","\000")
XFNDF(primitivePluginRequestState,"\000","\000")
#endif
{NULL, NULL, NULL}
};
|
//
// GPKGFeatureCacheTables.h
// geopackage-ios
//
// Created by Brian Osborn on 1/25/19.
// Copyright © 2019 NGA. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GPKGFeatureCache.h"
/**
* Feature Row Cache for multiple feature tables in a single GeoPackage
*/
@interface GPKGFeatureCacheTables : NSObject
/**
* Max Cache size
*/
@property (nonatomic) int maxCacheSize;
/**
* Initialize, created with cache size of GPKGFeatureCache DEFAULT_FEATURE_CACHE_MAX_SIZE
*
* @return new feature cache tables
*/
-(instancetype) init;
/**
* Initialize
*
* @param maxCacheSize max feature rows to retain in each feature table cache
*
* @return new feature cache tables
*/
-(instancetype) initWithMaxCacheSize: (int) maxCacheSize;
/**
* Get the feature table names with a feature row cache
*
* @return feature table names
*/
-(NSArray<NSString *> *) tables;
/**
* Get or create a feature row cache for the table name
*
* @param tableName feature table name
* @return feature row cache
*/
-(GPKGFeatureCache *) cacheForTable: (NSString *) tableName;
/**
* Get or create a feature row cache for the feature row
*
* @param featureRow feature row
* @return feature row cache
*/
-(GPKGFeatureCache *) cacheForRow: (GPKGFeatureRow *) featureRow;
/**
* Get the cache max size for the table name
*
* @param tableName feature table name
* @return max size
*/
-(int) maxSizeForTable: (NSString *) tableName;
/**
* Get the cached feature row by table name and feature id
*
* @param tableName feature table name
* @param featureId feature row id
* @return feature row or null
*/
-(GPKGFeatureRow *) rowByTable: (NSString *) tableName andId: (int) featureId;
/**
* Cache the feature row
*
* @param featureRow feature row
* @return previous cached feature row or null
*/
-(GPKGFeatureRow *) putRow: (GPKGFeatureRow *) featureRow;
/**
* Remove the cached feature row
*
* @param featureRow feature row
* @return removed feature row or null
*/
-(GPKGFeatureRow *) removeRow: (GPKGFeatureRow *) featureRow;
/**
* Remove the cached feature row by id
*
* @param tableName feature table name
* @param featureId feature row id
* @return removed feature row or null
*/
-(GPKGFeatureRow *) removeRowByTable: (NSString *) tableName andId: (int) featureId;
/**
* Clear the feature table cache
*
* @param tableName feature table name
*/
-(void) clearForTable: (NSString *) tableName;
/**
* Clear all caches
*/
-(void) clear;
/**
* Resize the feature table cache
*
* @param tableName feature table name
* @param maxCacheSize max cache size
*/
-(void) resizeForTable: (NSString *) tableName withMaxCacheSize: (int) maxCacheSize;
/**
* Resize all caches and update the max cache size
*
* @param maxCacheSize max cache size
*/
-(void) resizeWithMaxCacheSize: (int) maxCacheSize;
/**
* Clear and resize the feature table cache
*
* @param tableName feature table name
* @param maxCacheSize max cache size
*/
-(void) clearAndResizeForTable: (NSString *) tableName withMaxCacheSize: (int) maxCacheSize;
/**
* Clear and resize all caches and update the max cache size
*
* @param maxCacheSize max cache size
*/
-(void) clearAndResizeWithMaxCacheSize: (int) maxCacheSize;
@end
|
//
// DelightfulTabBar.h
// Delightful
//
// Created by Nico Prananta on 11/23/13.
// Copyright (c) 2013 Touches. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DelightfulTabBar : UITabBar
@end
|
#pragma once
#include <cstdint>
#include <ctime>
#include <sys/time.h>
#include <ostream>
static inline int64_t getTimeMs(struct timeval val) {
return val.tv_sec * ((int64_t) 1000) + val.tv_usec / 1000;
}
static inline int64_t getTimeUs(void) {
struct timeval val;
gettimeofday(&val, nullptr);
return val.tv_sec * ((int64_t) 1000000) + val.tv_usec;
}
static inline int64_t getTimeMs(void) {
struct timeval val;
gettimeofday(&val, nullptr);
return getTimeMs(val);
}
static inline int64_t getClockUs(void) {
struct timespec val;
#ifdef CYGWIN
clock_gettime(CLOCK_REALTIME, &val);
#else
clock_gettime(CLOCK_MONOTONIC, &val);
#endif
return val.tv_sec * ((int64_t) 1000000) + val.tv_nsec / 1000;
}
static inline int64_t getClockMs(void) {
struct timespec val;
#ifdef CYGWIN
clock_gettime(CLOCK_REALTIME, &val);
#else
clock_gettime(CLOCK_MONOTONIC, &val);
#endif
return val.tv_sec * ((int64_t) 1000) + val.tv_nsec / 1000000;
}
const char *get_time_str(time_t t, bool include_date);
//Copy of ODBC TIMESTAMP_STRUCT
typedef struct {
int16_t year;
uint16_t month;
uint16_t day;
uint16_t hour;
uint16_t minute;
uint16_t second;
uint32_t fraction; // nanoseconds s/1000 000 000
} timestamp_t;
time_t ts2time(const timestamp_t &ts);
static inline int64_t ts2us(const timestamp_t &ts) {
return ts2time(ts) * 1000000 + ts.fraction / 1000;
}
void time2ts(time_t t, timestamp_t &ts);
void us2ts(int64_t us, timestamp_t &ts);
void DumpTs(std::ostream& os, const timestamp_t &ts);
|
// OpenCallback.h
#ifndef __OPENCALLBACK_H
#define __OPENCALLBACK_H
#include "Common/MyCom.h"
#include "Common/MyString.h"
#include "Windows/FileFind.h"
#include "../../IPassword.h"
#include "../../Archive/IArchive.h"
#ifdef _SFX
#include "ProgressDialog.h"
#else
#include "ProgressDialog2.h"
#endif
class COpenArchiveCallback:
public IArchiveOpenCallback,
public IArchiveOpenVolumeCallback,
public IArchiveOpenSetSubArchiveName,
public IProgress,
public ICryptoGetTextPassword,
public CMyUnknownImp
{
UString _folderPrefix;
NWindows::NFile::NFind::CFileInfoW _fileInfo;
NWindows::NSynchronization::CCriticalSection _criticalSection;
bool _subArchiveMode;
UString _subArchiveName;
public:
bool PasswordIsDefined;
bool PasswordWasAsked;
UString Password;
HWND ParentWindow;
CProgressDialog ProgressDialog;
MY_UNKNOWN_IMP5(
IArchiveOpenCallback,
IArchiveOpenVolumeCallback,
IArchiveOpenSetSubArchiveName,
IProgress,
ICryptoGetTextPassword)
INTERFACE_IProgress(;)
INTERFACE_IArchiveOpenCallback(;)
INTERFACE_IArchiveOpenVolumeCallback(;)
// ICryptoGetTextPassword
STDMETHOD(CryptoGetTextPassword)(BSTR *password);
STDMETHOD(SetSubArchiveName(const wchar_t *name))
{
_subArchiveMode = true;
_subArchiveName = name;
return S_OK;
}
COpenArchiveCallback():
ParentWindow(0)
{
_subArchiveMode = false;
PasswordIsDefined = false;
PasswordWasAsked = false;
}
/*
void Init()
{
PasswordIsDefined = false;
_subArchiveMode = false;
}
*/
void LoadFileInfo(const UString &folderPrefix, const UString &fileName)
{
_folderPrefix = folderPrefix;
if (!_fileInfo.Find(_folderPrefix + fileName))
throw 1;
}
void ShowMessage(const UInt64 *completed);
INT_PTR StartProgressDialog(const UString &title, NWindows::CThread &thread)
{
return ProgressDialog.Create(title, thread, ParentWindow);
}
};
#endif
|
/*
* TBVCF
*
* This code has been extracted from the Csound opcode "tbvcf".
* It has been modified to work as a Soundpipe module.
*
* Original Author(s): Hans Mikelson
* Year: 2000
* Location: Opcodes/biquad.c
*
*/
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#define ROOT2 (1.4142135623730950488)
#ifndef M_PI
#define M_PI 3.14159265358979323846 /* pi */
#endif
#include "soundpipe.h"
int sp_tbvcf_create(sp_tbvcf **p)
{
*p = malloc(sizeof(sp_tbvcf));
return SP_OK;
}
int sp_tbvcf_destroy(sp_tbvcf **p)
{
free(*p);
return SP_OK;
}
int sp_tbvcf_init(sp_data *sp, sp_tbvcf *p)
{
p->fco = 500.0;
p->res = 0.8;
p->dist = 2.0;
p->asym = 0.5;
p->sr = sp->sr;
p->onedsr = 1.0 / p->sr;
p->iskip = 0.0;
if(p->iskip == 0.0){
p->y = p->y1 = p->y2 = 0.0;
}
p->fcocod = p->fco;
p->rezcod = p->res;
return SP_OK;
}
/* TODO: clean up code here. */
int sp_tbvcf_compute(sp_data *sp, sp_tbvcf *p, SPFLOAT *in, SPFLOAT *out)
{
SPFLOAT x;
SPFLOAT fco, res, dist, asym;
SPFLOAT y = p->y, y1 = p->y1, y2 = p->y2;
/* The initialisations are fake to fool compiler warnings */
SPFLOAT ih, fdbk, d, ad;
SPFLOAT fc=0.0, fco1=0.0, q=0.0, q1=0.0;
ih = 0.001; /* ih is the incremental factor */
/* Set up the pointers
fcoptr = p->fco;
resptr = p->res;
distptr = p->dist;
asymptr = p->asym; */
/* Get the values for the k-rate variables
fco = (SPFLOAT)*fcoptr;
res = (SPFLOAT)*resptr;
dist = (SPFLOAT)*distptr;
asym = (SPFLOAT)*asymptr; */
/* This should work in sp world */
fco = p->fco;
res = p->res;
dist = p->dist;
asym = p->asym;
/* Try to decouple the variables */
if ((p->rezcod==0) && (p->fcocod==0)) { /* Calc once only */
q1 = res/(1.0 + sqrt(dist));
fco1 = pow(fco*260.0/(1.0+q1*0.5),0.58);
q = q1*fco1*fco1*0.0005;
fc = fco1*p->onedsr*(p->sr/8.0);
}
if ((p->rezcod!=0) || (p->fcocod!=0)) {
q1 = res/(1.0 + sqrt(dist));
fco1 = pow(fco*260.0/(1.0+q1*0.5),0.58);
q = q1*fco1*fco1*0.0005;
fc = fco1*p->onedsr*(p->sr/8.0);
}
x = *in;
fdbk = q*y/(1.0 + exp(-3.0*y)*asym);
y1 = y1 + ih*((x - y1)*fc - fdbk);
d = -0.1*y*20.0;
ad = (d*d*d + y2)*100.0*dist;
y2 = y2 + ih*((y1 - y2)*fc + ad);
y = y + ih*((y2 - y)*fc);
*out = (y*fc/1000.0*(1.0 + q1)*3.2);
p->y = y; p->y1 = y1; p->y2 = y2;
return SP_OK;
}
|
#include <stdio.h>
#include <math.h>
long long unsigned int fatorial(unsigned int valor);
double rad_to_deg(double angulo);
int main(){
int fat=fatorial(3);
double ang=rad_to_deg(2*M_PI);
printf("%d %lf\n",fat,ang);
return 0;
}
long long unsigned int fatorial(unsigned int valor){
long long unsigned int i,fatorial=1;
for(i=1;i<=valor;i++){
fatorial*=i;
}
return fatorial;
}
double rad_to_deg(double angulo){
return 360*angulo/(2*M_PI);
}
|
#ifndef _INITBAAL_H_
#define _INITBAAL_H_
#include "interface/IPlugin.h"
namespace Plugins
{
namespace Init
{
DECLARE_TCP_PLUGIN(InitBaal, 0x65)
}
}
#endif // _INITBAAL_H_
|
/* Copyright (c) 2009-2013 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "str.h"
#include "env-util.h"
#include "hostpid.h"
#include "var-expand.h"
struct var_expand_test {
const char *in;
const char *out;
};
struct var_get_key_range_test {
const char *in;
unsigned int idx, size;
};
static void test_var_expand_builtin(void)
{
static struct var_expand_test tests[] = {
{ "%{hostname}", NULL },
{ "%{pid}", NULL },
{ "a%{env:FOO}b", "abaRb" }
};
static struct var_expand_table table[] = {
{ '\0', NULL, NULL }
};
string_t *str = t_str_new(128);
unsigned int i;
tests[0].out = my_hostname;
tests[1].out = my_pid;
env_put("FOO=baR");
test_begin("var_expand");
for (i = 0; i < N_ELEMENTS(tests); i++) {
str_truncate(str, 0);
var_expand(str, tests[i].in, table);
test_assert(strcmp(tests[i].out, str_c(str)) == 0);
}
test_end();
}
static void test_var_get_key_range(void)
{
static struct var_get_key_range_test tests[] = {
{ "", 0, 0 },
{ "{", 1, 0 },
{ "k", 0, 1 },
{ "{key}", 1, 3 },
{ "5.5Rk", 4, 1 },
{ "5.5R{key}", 5, 3 },
{ "{key", 1, 3 }
};
unsigned int i, idx, size;
test_begin("var_get_key_range");
for (i = 0; i < N_ELEMENTS(tests); i++) {
var_get_key_range(tests[i].in, &idx, &size);
test_assert(tests[i].idx == idx);
test_assert(tests[i].size == size);
if (tests[i].size == 1)
test_assert(tests[i].in[idx] == var_get_key(tests[i].in));
}
test_end();
}
void test_var_expand(void)
{
test_var_expand_builtin();
test_var_get_key_range();
}
|
#pragma once
#include "menuscreen.h"
namespace Engine
{
class MainMenuScreen :
public MenuScreen
{
#pragma region Initialization
public:
MainMenuScreen(void);
~MainMenuScreen(void);
#pragma endregion
#pragma region Handle Input
void PlayGameMenuEntrySelected(void* sender,int playerIndex);
void OptionsMenuSelected(void* sender,int playerIndex);
void OnCancel(void* sender,int playerIndex);
void ConfirmExitMessageBoxAccepted(void* sender,int playerIndex);
#pragma endregion
};
} |
/*
The MIT License
Copyright (c) 2014 Nick Farina
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.
*/
/*
SMXMLDocumentResponseSerializer
--------------------------------
Created by Nick Farina (nfarina@gmail.com)
*/
// SMXMLDocumentResponseSerializer allows you to parse a response from an AFNetworking HTTP request into an SMXMLDocument easily.
#import "AFURLResponseSerialization.h"
#import "SMXMLDocument.h"
@interface SMXMLDocumentResponseSerializer : AFHTTPResponseSerializer
@end
|
//
// ZiXun.h
// lol盒子
//
// Created by 贺聪 on 15/11/21.
// Copyright © 2015年 lanou3g. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ZiXun : NSObject
@property(nonatomic,retain)NSString * title;
@property(nonatomic,retain)NSString * content;
@property(nonatomic,retain)NSString * weight;
@property(nonatomic,retain)NSString * time;
@property(nonatomic,retain)NSString * readCount;
@property(nonatomic,retain)NSString * comment_id;
@property(nonatomic,retain)NSString * photo;
@property(nonatomic,retain)NSString * artld;
@property(nonatomic,retain)NSString * commentSum;
@property(nonatomic,retain)NSString * commentUrl;
@property(nonatomic,retain)NSString * type;
@property(nonatomic,retain)NSString * destUrl;
@property(nonatomic,assign)NSInteger hasVideo;
@end
|
/* Copyright (c) 2016 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#ifndef DISKIO_SDCARD_H_
#define DISKIO_SDCARD_H_
#include "diskio.h"
#include "nrf_block_dev.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@file
*
* @defgroup diskio_blockdev FatFS disk I/O interface based on block device.
* @{
*
* @brief This module implements the FatFs disk API. Internals of this module are based on block device.
*
*/
/**
* @brief FatFs disk I/O block device configuration structure.
* */
typedef struct
{
const nrf_block_dev_t * p_block_device; ///< Block device associated with a FatFs drive.
/**
* @brief FatFs disk interface synchronous wait function.
*
* The function to be called repeatedly until the disk I/O operation is completed.
*/
void (*wait_func)(void);
} diskio_blkdev_config_t;
/**
* @brief Disk I/O block device.
* */
typedef struct
{
diskio_blkdev_config_t config; ///< Disk I/O configuration.
nrf_block_dev_result_t last_result; ///< Result of the last I/O operation.
volatile DSTATUS state; ///< Current disk state.
volatile bool busy; ///< Disk busy flag.
} diskio_blkdev_t;
/**
* @brief Initializer of @ref diskio_blkdev_t.
*
* @param blk_device Block device handle.
* @param wait_funcion User wait function (NULL is allowed).
* */
#define DISKIO_BLOCKDEV_CONFIG(blk_device, wait_funcion) { \
.config = { \
.p_block_device = (blk_device), \
.wait_func = (wait_funcion), \
}, \
.last_result = NRF_BLOCK_DEV_RESULT_SUCCESS, \
.state = STA_NOINIT, \
.busy = false \
}
/**
* @brief FatFs disk initialization.
*
* Initializes a block device assigned to a drive number.
*
* @param[in] drv Drive number.
*
* @return Disk status code.
* */
DSTATUS disk_initialize(BYTE drv);
/**
* @brief FatFs disk uninitialization.
*
* Uninitializes a block device assigned to a drive number.
*
* @param[in] drv Drive index.
*
* @return Disk status code.
* */
DSTATUS disk_uninitialize(BYTE drv);
/**
* @brief FatFs disk status get.
*
* @param[in] drv Drive index.
*
* @return Disk status code.
* */
DSTATUS disk_status(BYTE drv);
/**
* @brief FatFs disk sector read.
*
* @param[in] drv Drive number.
* @param[out] buff Output buffer.
* @param[in] sector Sector start number.
* @param[in] count Sector count.
*
* @return FatFs standard error code.
* */
DRESULT disk_read(BYTE drv, BYTE* buff, DWORD sector, UINT count);
/**
* @brief FatFs disk sector write.
*
* @param[in] drv Drive number.
* @param[in] buff Input buffer.
* @param[in] sector Sector start number.
* @param[in] count Sector count.
*
* @return FatFs standard error code.
* */
DRESULT disk_write(BYTE drv, const BYTE* buff, DWORD sector, UINT count);
/**
* @brief FatFs disk I/O control operation.
*
* @param[in] drv Drive number.
* @param[in] cmd I/O control command.
* @param buff I/O control parameter (optional).
*
* @return FatFs standard error code.
* */
DRESULT disk_ioctl(BYTE drv, BYTE cmd, void* buff);
/**
* @brief Registers a block device array.
*
* @warning This function must be called before any other function from this header.
*
* @param[in] diskio_blkdevs Disk I/O block device array.
* @param[in] count Number of elements in a block device array.
* */
void diskio_blockdev_register(diskio_blkdev_t * diskio_blkdevs, size_t count);
/** @} */
#ifdef __cplusplus
}
#endif
#endif /*DISKIO_SDCARD_H_*/
|
/**
@file common.h
@brief common definition.
@author HRYKY
@version $Id: common.h 359 2014-07-01 11:21:44Z hryky.private@gmail.com $
*/
#ifndef COMMON_H_20111021154357322
#define COMMON_H_20111021154357322
#include "hryky/nullptr.h"
#include "hryky/is_null.h"
//------------------------------------------------------------------------------
// defines macros
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// declares types
//------------------------------------------------------------------------------
namespace hryky
{
}
//------------------------------------------------------------------------------
// declares classes
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// function declaration
//------------------------------------------------------------------------------
namespace hryky
{
/**
@brief release the instance that has release() method.
@param ptr is the instance
*/
template < typename T >
void release(T * & ptr);
} // namespace hryky
//------------------------------------------------------------------------------
// function definitions
//------------------------------------------------------------------------------
//--------------------------------
// address management
//--------------------------------
/**
@brief release the instance that has release() method.
@param ptr is the instance
- If ptr is null-pointer, this function does nothing.
*/
template < typename T >
void hryky::release(T * & ptr)
{
if (hryky_is_null(ptr)) {
return;
}
ptr->release();
ptr = hryky_nullptr;
}
#endif // COMMON_H_20111021154357322
// end of file
|
//
// UIScreen+BSCategory.h
// Objective-C_Categories
//
// Created by 张亚东 on 16/7/28.
// Copyright © 2016年 张亚东. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIScreen (BSCategory)
- (CGSize)bs_size;
- (CGFloat)bs_width;
- (CGFloat)bs_height;
@end
|
/*
Programa que le duas sequencias de numeros inteiros, e soma os valores
um a um, apresentrando como saida o resultado da soma das posicoes pares
AUTOR: Gabriel Henroique Campos Scalici
NUMERO: 9292970
DATA: 04-06-2015
*/
#include<stdio.h>
int main(void){
//variaveis
int n, i, j;
int aux;
//variavel n que o usuario digita
scanf("%d",&n);
//declaracao do vetor
int vetor[n], vetor2[n];
//estrutura para colocar os valores no primeiro vetor
for (i=0; i<n; i++){
scanf("%d", vetor+i);
}
//estrutura para colocar os valores no segundo vetor
for (i=0; i<n; i++){
scanf("%d", vetor2+i);
}
//logica para somar as posicoes pares dos vetores (incluindo a posicao 0)
//aux++ para percorrer todas as posicoes
for(aux=0; aux<n; aux++){
int total= *(vetor+aux) + *(vetor2+aux);
printf("%d ", total);
//aux++ novamente para pular um numero e ir somente nos pares
aux++;
}
printf("\n");
return 0;
}
|
//
// UIView+OAAdditions.h
// ObjCAdditions
//
// Copyright (c) 2014 Aleksejs Mjaliks
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <UIKit/UIKit.h>
@interface UIView (OAAdditions)
+ (instancetype)viewWithBackgroundColor:(UIColor *)color;
- (void)alignVerticallyView:(UIView *)view left:(CGFloat)left;
- (void)alignVerticallyView:(UIView *)view right:(CGFloat)right;
- (UIView *)findFirstResponder;
@end
|
#include "vector.h"
#include "utils.h"
vector_t *vector_new(size_t initial_size)
{
vector_t *v = (vector_t *)lothar_malloc(sizeof(vector_t));
v->size = initial_size;
v->capacity = initial_size > 1 ? initial_size : 1;
v->data = (void **)lothar_malloc(v->capacity * sizeof(void *));
return v;
}
void vector_free(vector_t **vec, int free_data)
{
if(free_data)
{
size_t i;
for(i = 0; i < (*vec)->size; ++i)
free((*vec)->data[i]);
}
free((*vec)->data);
free(*vec);
*vec = NULL;
}
void vector_resize(vector_t *vec, size_t newsize)
{
if(newsize > vec->capacity)
{
while(newsize > vec->capacity)
vec->capacity <<= 1;
vec->data = (void **)lothar_realloc(vec->data, vec->capacity * sizeof(void *));
vec->size = newsize;
}
else
{
vec->size = newsize;
if(vec->capacity > 4 && vec->size < vec->capacity >> 1)
{
while(vec->capacity > 4 && vec->size < vec->capacity >> 1)
vec->capacity >>= 1;
vec->data = (void **)lothar_realloc(vec->data, vec->capacity * sizeof(void *));
}
}
}
void vector_insert(vector_t *vec, size_t i, void *item)
{
size_t _i;
vector_resize(vec, vec->size + 1);
for(_i = vec->size; _i > i; --_i)
vec->data[_i] = vec->data[_i - 1];
vec->data[i] = item;
}
void *vector_remove(vector_t *vec, size_t i)
{
void *ret = vec->data[i];
for(; i < vec->size; ++i)
vec->data[i] = vec->data[i + 1];
vector_resize(vec, vec->size - 1);
return ret;
}
void vector_swap(vector_t *vec, size_t a, size_t b)
{
if(a != b)
{
void *tmp = vector_get(vec, a);
vector_set(vec, a, vector_get(vec, b));
vector_set(vec, b, tmp);
}
}
|
#ifndef STATEMACHINEH
#define STATEMACHINEH
// TODO: Eventually remove this limitation
#define MAX_QUOROM_SIZE 16
#include <sys/time.h>
enum role_t {
PROPOSER,
ACCEPTOR,
LEARNER,
CLIENT,
};
enum state_t {
S_AVAILABLE,
S_PREPARE,
S_SEND_PROPOSAL_TO_ACCEPTOR,
S_COLLECT_ACCEPTOR_PROPOSAL_RESPONSE,
S_ACCEPT_PROPOSAL,
S_ACCEPTED_PROPOSAL,
S_ACCEPTED_WAIT,
S_SET,
S_GET,
S_CLIENT_RESPOND,
S_DONE,
};
typedef struct {
unsigned short state;
short type;
unsigned short nodes_quorom[MAX_QUOROM_SIZE]; // replace with list
unsigned short num_quorom;
unsigned short max_fails;
unsigned short fails;
short nodes_left;
unsigned short flags;
long ticket;
int slot;
long value;
unsigned short client;
unsigned long deadline;
} state;
typedef state (*sm_role_fn)(state);
extern unsigned long deadline;
state init_state(enum role_t role, state *prev_state);
void init_sm();
void destroy_sm();
void next_states();
#endif
|
// To check if a library is compiled with CocoaPods you
// can use the `COCOAPODS` macro definition which is
// defined in the xcconfigs so it is available in
// headers also when they are imported in the client
// project.
// AFJSONRPCClient
#define COCOAPODS_POD_AVAILABLE_AFJSONRPCClient
#define COCOAPODS_VERSION_MAJOR_AFJSONRPCClient 0
#define COCOAPODS_VERSION_MINOR_AFJSONRPCClient 4
#define COCOAPODS_VERSION_PATCH_AFJSONRPCClient 0
// AFNetworking
#define COCOAPODS_POD_AVAILABLE_AFNetworking
#define COCOAPODS_VERSION_MAJOR_AFNetworking 1
#define COCOAPODS_VERSION_MINOR_AFNetworking 3
#define COCOAPODS_VERSION_PATCH_AFNetworking 1
// ECSlidingViewController
#define COCOAPODS_POD_AVAILABLE_ECSlidingViewController
#define COCOAPODS_VERSION_MAJOR_ECSlidingViewController 0
#define COCOAPODS_VERSION_MINOR_ECSlidingViewController 10
#define COCOAPODS_VERSION_PATCH_ECSlidingViewController 0
|
#ifndef UMESHU_IO_OBJ_H
#define UMESHU_IO_OBJ_H
#include "../Point2.h"
#include <boost/utility/enable_if.hpp>
#include <fstream>
#include <string>
namespace umeshu {
namespace io {
// enabled only for triangulations with ids
template< typename Tria >
void write_obj( std::string const& filename, Tria& tria,
typename boost::enable_if< typename Tria::Items::Supports_id >::type* dummy = 0 )
{
namespace bg = boost::geometry;
std::ofstream out( filename.c_str() );
if ( out.fail() )
{
return;
}
Point2 p1, p2, p3;
out << "# " << filename << std::endl;
tria.generate_item_ids();
for ( typename Tria::Node_const_iterator iter = tria.nodes_begin(); iter != tria.nodes_end(); ++iter )
{
out << "v " << bg::get<0>( iter->position() ) << " " << bg::get<1>( iter->position() ) << " 0\n";
}
for ( typename Tria::Face_const_iterator iter = tria.faces_begin(); iter != tria.faces_end(); ++iter )
{
typename Tria::Node_handle n1, n2, n3;
iter->nodes( n1, n2, n3 );
out << "f " << n1->id() + 1 << " " << n2->id() + 1 << " " << n3->id() + 1 << std::endl;
}
}
} // io
} // umeshu
#endif // UMESHU_IO_OBJ_H
|
#pragma once
#include <d3d9.h>
#include <d3dx9.h>
#include "ViewPort.h"
class Camera
{
private:
ViewPort *VPort;
D3DXMATRIX mt;
protected:
D3DXVECTOR3 PosOut;
public:
void SetViewPort(int vpx, int vpy, int vpHeight, int vpWidth);
void SetViewPort(ViewPort *viewPort);
D3DXVECTOR3 GetPosition();
D3DXVECTOR3 WorldTransform(RECT Rect, D3DXVECTOR3 PosIn);
//void Scale();
Camera();
~Camera();
};
|
//
// AppDelegate.h
// STNetListenDemo
//
// Created by zhenlintie on 15/6/10.
// Copyright (c) 2015年 sTeven. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#define BUILDING_LIBRARY
#include <exodus/exodus.h>
// a library section is a just a class stored in an so/dll shared library that can be
// called like a function or subroutine from another executable.
// library could have MULTIPLE libraryinit/exit sections and all are publically available
// by including the libraryfilename.h file name in other programs and libraries.
// the libraryinit() libraryexit() macros would have to modified to create function names
// eg libraryinit(funcx) libraryexit(funcx)
// a library can also have classes. classes are identical to library sections but they are
// private to the library since they are not published in the libraryfilename.h file.
// exodus subroutines and functions in libraries are just local subroutines and functions
// and are redefined without DLLEXPORT here
#undef subroutine
#undef function
#define subroutine \
public: \
void
#define function \
public: \
var
// a library section is just a class plus a global exported function that allows the class
// to be instantiated and its main(...) called from another program via so/dll delay loading
// AND share the mv environment variables of the calling program!
#define libraryinit(CLASSNAME) classinit(CLASSNAME)
// to undo an ms optimisation that prevents casting between member function pointers
// http://social.msdn.microsoft.com/Forums/en/vclanguage/thread/a9cfa5c4-d90b-4c33-89b1-9366e5fbae74
//"VS compiler violates the standard in the name of optimization. It makes pointers-to-members
// have different size depending on the complexity of the class hierarchy.
// Print out sizeof(BaseMemPtr) and sizeof(&Derived::h) to see this.
// http://msdn.microsoft.com/en-us/library/yad46a6z.aspx
// http://msdn.microsoft.com/en-us/library/83cch5a6.aspx
// http://msdn.microsoft.com/en-us/library/ck561bfk.aspx"
//
// the above requirement could be removed if libraryexit() generated the exactly
// correct pointer to member WITH THE RIGHT ARGUMENTS
// this could be done by generating special code in funcx.h and requiring
//#include "funcx.h" in the bottom of every "funcx.cpp"
/*
without the above pragma, in msvc 2005+ you get an error when compiling libraries
(exodus external subroutines) in the libraryexit() line containing "&ExodusProgram::main;" as
follows:
f1.cpp(12) : error C2440: 'type cast' : cannot convert from 'exodus::var (__this
call ExodusProgram::* )(exodus::in)' to 'exodus::pExodusProgramBaseMemberFunction';
Pointers to members have different representations; cannot cast between them
*/
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#define libraryexit(CLASSNAME) \
classexit(CLASSNAME) extern "C" PUBLIC void exodusprogrambasecreatedelete_##CLASSNAME( \
pExodusProgramBase& pexodusprogrambase, MvEnvironment& mv, \
pExodusProgramBaseMemberFunction& pmemberfunction) { \
if (pexodusprogrambase) { \
delete pexodusprogrambase; \
pexodusprogrambase = nullptr; \
pmemberfunction = nullptr; \
} else { \
pexodusprogrambase = new CLASSNAME##ExodusProgram(mv); \
_Pragma("GCC diagnostic push") \
pmemberfunction = \
(pExodusProgramBaseMemberFunction)&CLASSNAME##ExodusProgram::main; \
_Pragma("GCC diagnostic pop") \
} \
return; \
}
// purpose of the above is to either return a new exodusprogram object
// and a pointer to its main function - or to delete an exodusprogram object
|
#pragma once
class Debugger
{
private:
std::unordered_set<u16> break_points;
std::unordered_set<u16> memory_watches;
function<u8(u16, u32)> read_byte_callback;
function<void(u16, u8, u32)> write_byte_callback;
function<void(std::array<u16, 5>&, bool&)> cpu_state_callback;
function<void(std::array<u8, 12>&, std::array<u8, 8>&)> gpu_state_callback;
u16* pc;
u32 vblanks_left = 0;
u16 step_over_adress = 0;
u16 change_adress = 0;
u16 current_pc = 0;
u8 new_val = 0;
bool next_instruction = false;
bool memory_changed = false;
bool step_over = false;
bool is_breakpoint();
void enter_trap();
void enter_memory_trap();
const char* dispatch_opcode(u8 opcode, u8 byte_1);
u8 get_opcode_bytes(u8 opcode);
void insert_breakpoint(u16 adress);
void remove_breakpoint(u16 adress);
void insert_watchpoint(u16 adress);
void remove_watchpoint(u16 adress);
void dump_registers();
void dump_memory_region(u16 start, u16 end);
void dump_gpu_regs();
void wait_for_user();
public:
void attach_mmu(function<u8(u16, u32)> read_byte, function<void(u16, u8, u32)> write_byte);
//void attach_mbc(u32* bank_num);
std::tuple<u16**, function<void(std::array<u16, 5>&, bool&)>*> get_cpu()
{
return std::make_tuple(&pc, &cpu_state_callback);
}
void attach_gpu(function<void(std::array<u8, 12>&, std::array<u8, 8>&)> dbg_func) { gpu_state_callback = dbg_func; }
void check_memory_access(u16 adress, u8 value);
void step();
void check_mmu();
void after_vblank();
void setup_entry_point();
void reset();
};
|
//
// AMPActivityIndicator.h
// AMPActivityIndicator Example
//
// Created by Alejandro Martinez on 11/08/13.
// Copyright (c) 2013 Alejandro Martinez. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AMPActivityIndicator : UIView
@property (nonatomic) UIColor *barColor;
@property (nonatomic) CGFloat barWidth;
@property (nonatomic) CGFloat barHeight;
@property (nonatomic) CGFloat aperture;
- (void)startAnimating;
- (void)stopAnimating;
- (BOOL)isAnimating;
- (void)setProgress:(CGFloat)progress;
@end
|
#include <kmip.h>
int kmip_db_init(kmip_t *kmip)
{
kmip->db = (mongo_connection *)malloc(sizeof(mongo_connection));
if (kmip->db == NULL)
return -1;
if (mongo_connect( kmip->db , kmip->db_name, kmip->db_port )) {
fprintf(stderr, "failed to connect\n");
return -1;
}
/*
bson b;
mongo_md5_state_t st;
mongo_md5_byte_t digest[16];
bson_init( &b , json_to_bson( js ) , 1 );
*/
return 0;
}
/*
void kmip_nvp_to_bson_append_element( bson_buffer * bb , kmip_name_value_pair_t *nvp ){
if ( ! nvp ){
bson_append_null( bb , nvp->name );
return;
}
switch ( nvp->type ){
case KMIP_ITEM_TYPE_INTEGER:
case KMIP_ITEM_TYPE_ENUMERATION:
bson_append_int( bb , nvp->name , (int)*((int*)(nvp->value)) );
break;
case KMIP_ITEM_TYPE_TEXT_STRING:
bson_append_string_n( bb , nvp->name, ((char *)(nvp->value)), (int)nvp->len );
break;
case KMIP_ITEM_TYPE_BYTE_STRING:
bson_append_binary( bb , nvp->name, KMIP_ITEM_TYPE_BYTE_STRING, ((const char *)(nvp->value)), (int)nvp->len );
break;
default:
fprintf( stderr , "can't handle type for : %s\n" , nvp->name );
}
}
bson *kmip_hashmap_to_bson(kmip_name_value_pair_t *nvps)
{
bson *b;
bson_buffer *bb;
kmip_name_value_pair_t *tmp_nvp, *nvp = NULL;
b = ( bson * )malloc( sizeof( bson ) );
bb = ( bson_buffer * )malloc( sizeof( bson_buffer ) );
bson_buffer_init( bb );
HASH_ITER(hh, nvps, nvp, tmp_nvp) {
kmip_nvp_to_bson_append_element( bb , nvp );
}
bson_buffer_finish( bb );
bson_from_buffer( b, bb );
free(bb);
return b;
}
*/
int kmip_save(kmip_t *kmip, char *collection_name, bson *b)
{
mongo_insert( kmip->db, collection_name, b );
return 0;
}
|
// Copyright (c) 2011-2015 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <cstdint>
#include <memory>
namespace CryptoNote {
class IInputStream {
public:
virtual size_t read(char* data, size_t size) = 0;
};
class IOutputStream {
public:
virtual void write(const char* data, size_t size) = 0;
};
}
|
//
// DYLJSContextHandler.h
// DYLWebView
//
// Created by mannyi on 2017/7/20.
// Copyright © 2017年 mannyi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <JavaScriptCore/JavaScriptCore.h>
@protocol DYLJSContextHandlerDelegate <JSExport>
- (void)show;
- (void)open;
@end
@interface DYLJSContextHandler : NSObject <DYLJSContextHandlerDelegate>
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)initWithWeakTarget:(id)weakTarget;
@end
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\Collections\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#ifndef __APP_UNO_COLLECTIONS_DICTIONARY2_VALUE_COLLECTION__UNO_U_X_FILE_SOURCE__7649F81_H__
#define __APP_UNO_COLLECTIONS_DICTIONARY2_VALUE_COLLECTION__UNO_U_X_FILE_SOURCE__7649F81_H__
#include <app/Uno.Object.h>
#include <Uno.h>
namespace app { namespace Uno { namespace Collections { struct Dictionary__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_; } } }
namespace app { namespace Uno { namespace Collections { struct Dictionary2_ValueCollection_Enumerator__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_; } } }
namespace app { namespace Uno { struct WeakReference__Fuse_Resources_FileImageSourceImpl; } }
namespace app {
namespace Uno {
namespace Collections {
struct Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_;
struct Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___uType : ::uClassType
{
};
Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___uType* Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___typeof();
void Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl____ObjInit(Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* __this, ::app::Uno::Collections::Dictionary__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* source);
int Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___get_Count(Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* __this);
::app::Uno::Collections::Dictionary2_ValueCollection_Enumerator__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_ Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___GetEnumerator(Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* __this);
Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___New_1(::uStatic* __this, ::app::Uno::Collections::Dictionary__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* source);
void Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___Uno_Collections_ICollection_Add(Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* __this, ::app::Uno::WeakReference__Fuse_Resources_FileImageSourceImpl* item);
void Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___Uno_Collections_ICollection_Clear(Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* __this);
bool Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___Uno_Collections_ICollection_Contains(Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* __this, ::app::Uno::WeakReference__Fuse_Resources_FileImageSourceImpl* item);
bool Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___Uno_Collections_ICollection_Remove(Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* __this, ::app::Uno::WeakReference__Fuse_Resources_FileImageSourceImpl* item);
struct Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_ : ::uObject
{
::uStrong< ::app::Uno::Collections::Dictionary__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_*> _source;
void _ObjInit(::app::Uno::Collections::Dictionary__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_* source) { Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl____ObjInit(this, source); }
int Count() { return Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___get_Count(this); }
::app::Uno::Collections::Dictionary2_ValueCollection_Enumerator__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_ GetEnumerator();
};
}}}
#include <app/Uno.Collections.Dictionary2_ValueCollection_Enumerator__Uno_UX_-3c31f8e2.h>
namespace app {
namespace Uno {
namespace Collections {
inline ::app::Uno::Collections::Dictionary2_ValueCollection_Enumerator__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_ Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl_::GetEnumerator() { return Dictionary2_ValueCollection__Uno_UX_FileSource__Uno_WeakReference_Fuse_Resources_FileImageSourceImpl___GetEnumerator(this); }
}}}
#endif
|
//
// UADDBError.h
// AWS iOS SDK
//
// Created by Rob Amos on 4/02/2014.
//
//
#import "UAMantle.h"
#import "UAAWSError.h"
@interface UADDBError : UAMTLModel <UAMTLJSONSerializing, UAAWSError>
@property (nonatomic) NSUInteger HTTPStatusCode;
@property (nonatomic, copy) NSString *code;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, copy) NSString *requestID;
@end
|
//
// PTBorderButton.h
// JibberJabber
//
// Created by Paolo Tagliani on 27/10/15.
// Copyright © 2015 Paolo Tagliani. All rights reserved.
//
#import <UIKit/UIKit.h>
IB_DESIGNABLE
/**
* Default button with borded that use the Lato Regular font
*/
@interface PTBorderButton : UIButton
/**
* The color of the border of the button
*/
@property(nonatomic, strong, readwrite) IBInspectable UIColor *borderColor;
/**
* This will override the layer background color. The button will not preseve selected/highlighted color
*/
@property(nonatomic, copy, readwrite) IBInspectable UIColor *backgroundColor;
/**
* The color of the background layer when selected the button
*/
@property(nonatomic, strong, readwrite) IBInspectable UIColor *selectedBackgroundColor;
/**
* Corner radius applied to the button
*/
@property(nonatomic, assign, readwrite) IBInspectable CGFloat cornerRadius;
/**
* A boolean that indicate if the border has to be shown when selected
*/
@property(nonatomic, assign, readwrite) IBInspectable BOOL showBorderWhenSelected;
/**
* Size of the border
*/
@property(nonatomic, assign, readwrite) IBInspectable CGFloat borderWidth;
/**
* Text Color when selected
*/
@property(nonatomic, strong, readwrite) IBInspectable UIColor *selectedTextColor;
@end
|
/*
* entity_graphic.c
*
* Created on: 26 Oct 2009
* Author: David
*/
#include "dt_logger.h"
#include <stdbool.h>
#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
#include <SDL/SDL_image.h>
#include "entity_graphic.h"
#include "rendering/texture_loader.h"
/*
* load_sprite_from_file
*
* Loads the image located at the filename and makes it an opengl texture
* returning the result in the texture parameter.
*
* Parameters: texture - This will be the loaded texture if succesful.
* filename - The filename to be loaded.
* isSpriteTiled - Set to true if the sprite will tile and false
* if the sprite will stretch.
* width - Will be returned as the width of the texture.
* height - Will be returned as the height of the texture.
*
* Return: One of LOAD_SPRITE_RET_CODES.
*/
int load_sprite_from_file(GLuint *texture,
char *filename,
bool isSpriteTiled,
int *width,
int *height)
{
/*
* Local Variables.
*/
int ret_code = LOAD_SPRITE_OK;
int rc;
SDL_Surface *loaded_surface;
/*
* Attempt to load the sprite from the filename given.
*/
loaded_surface = (SDL_Surface *) IMG_Load(filename);
if (NULL == loaded_surface)
{
ret_code = LOAD_SPRITE_LOAD_FAIL;
goto EXIT_LABEL;
}
/*
* Retrieve the width and the height from the loaded surface.
*/
(*width) = loaded_surface->w;
(*height) = loaded_surface->h;
/*
* Convert the sdl surface to an opengl texture.
*/
rc = SDL_GL_LoadTexture(loaded_surface, texture, isSpriteTiled);
if (LOAD_TEXTURE_OK != rc)
{
DT_DEBUG_LOG("Failed to convert sprite: %s\n", filename);
ret_code = LOAD_SPRITE_CONVERT_FAIL;
goto EXIT_LABEL;
}
EXIT_LABEL:
/*
* Free the sdl surface now that the object is as an opengl texture.
*/
if (NULL != loaded_surface)
{
SDL_FreeSurface(loaded_surface);
}
return(ret_code);
}
/*
* create_entity_graphic
*
* Sets up an entity graphic object that can be used by multiple different
* entities.
*
* Parameters: filename - The filename with the graphic in it.
* entity_graphic - This will contain the returned object.
* isSpriteTiled - Set to true if the sprite will tile and false
* if the sprite will stretch.
*
* Return: One of LOAD_SPRITE_RET_CODES.
*/
int create_entity_graphic(char *filename,
ENTITY_GRAPHIC **entity_graphic,
bool isSpriteTiled)
{
/*
* Local Variables.
*/
int ret_code;
/*
* Allocate the memory for the graphic object.
*/
(*entity_graphic) = (ENTITY_GRAPHIC *) DT_MALLOC(sizeof(ENTITY_GRAPHIC));
/*
* Load the sprite pointed to by the filename into the entity graphic
* object.
*/
ret_code = load_sprite_from_file(&((*entity_graphic)->sprite),
filename,
isSpriteTiled,
&((*entity_graphic)->width),
&((*entity_graphic)->height));
/*
* Set the reference count to 0 as no entities yet reference this graphic.
*/
(*entity_graphic)->ref_count = 0;
return(ret_code);
}
/*
* destroy_entity_graphic
*
* Destroy the entity graphic object and free the memory associated with it.
*
* Parameters: entity_graphic - The graphic to destroy.
*/
void destroy_entity_graphic(ENTITY_GRAPHIC *entity_graphic)
{
/*
* If a bitmap was loaded for this sprite then free the surface.
*/
if (GL_TRUE == glIsTexture(entity_graphic->sprite))
{
glDeleteTextures(1, &(entity_graphic->sprite));
}
/*
* Free the object itself.
*/
DT_FREE(entity_graphic);
}
/*
* add_reference_to_graphic
*
* Increases the reference count on the entity graphic object.
*
* Parameters: graphic - The graphic which is going to have its reference count
* increased.
*
* Returns: Nothing.
*/
void add_reference_to_graphic(ENTITY_GRAPHIC *graphic)
{
graphic->ref_count++;
}
/*
* remove_reference_to_graphic
*
* Reduces the reference count of an entity graphic object and checks whether
* this was the last object that referred to it. If so then it also frees the
* memory allocated to the graphic object.
*
* Parameters: graphic - The entity graphic.
*
* Returns: True if the object was destroyed and false otherwise.
*/
bool remove_reference_to_graphic(ENTITY_GRAPHIC *graphic)
{
/*
* Local Variables.
*/
bool destroyed = false;
/*
* Reduce the reference count of the graphic object.
*/
graphic->ref_count--;
/*
* If nothing uses this entity graphic then destroy it and free the memory.
*/
if (graphic->ref_count == 0)
{
destroy_entity_graphic(graphic);
destroyed = true;
}
return(destroyed);
}
|
/*
** String handling.
** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h
*/
#ifndef _LJ_STR_H
#define _LJ_STR_H
#include <stdarg.h>
#include "lj_obj.h"
/* String helpers. */
LJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b);
LJ_FUNC const char *lj_str_find(const char *s, const char *f,
MSize slen, MSize flen);
LJ_FUNC int lj_str_haspattern(GCstr *s);
/* String interning. */
LJ_FUNC void lj_str_resize(lua_State *L, MSize newmask);
LJ_FUNCA GCstr *lj_str_new(lua_State *L, const char *str, size_t len);
LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s);
#define lj_str_newz(L, s) (lj_str_new(L, s, strlen(s)))
#define lj_str_newlit(L, s) (lj_str_new(L, "" s, sizeof(s)-1))
#endif
|
//
// AKnightsQuest.h
// ObjCMonads
//
// Created by Tamas Lustyik on 2014.04.08..
// Copyright (c) 2014 LKXF. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifdef __cplusplus
extern "C" {
#endif
void Knight();
#ifdef __cplusplus
}
#endif
|
#ifndef _ROS_SERVICE_ListPublishedServices_h
#define _ROS_SERVICE_ListPublishedServices_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
#include "zeroconf_msgs/PublishedService.h"
namespace zeroconf_msgs
{
static const char LISTPUBLISHEDSERVICES[] = "zeroconf_msgs/ListPublishedServices";
class ListPublishedServicesRequest : public ros::Msg
{
public:
typedef const char* _service_type_type;
_service_type_type service_type;
ListPublishedServicesRequest():
service_type("")
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
uint32_t length_service_type = strlen(this->service_type);
varToArr(outbuffer + offset, length_service_type);
offset += 4;
memcpy(outbuffer + offset, this->service_type, length_service_type);
offset += length_service_type;
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
uint32_t length_service_type;
arrToVar(length_service_type, (inbuffer + offset));
offset += 4;
for(unsigned int k= offset; k< offset+length_service_type; ++k){
inbuffer[k-1]=inbuffer[k];
}
inbuffer[offset+length_service_type-1]=0;
this->service_type = (char *)(inbuffer + offset-1);
offset += length_service_type;
return offset;
}
const char * getType(){ return LISTPUBLISHEDSERVICES; };
const char * getMD5(){ return "e1bf1fd6519c823d87c16f342a193a85"; };
};
class ListPublishedServicesResponse : public ros::Msg
{
public:
uint32_t services_length;
typedef zeroconf_msgs::PublishedService _services_type;
_services_type st_services;
_services_type * services;
ListPublishedServicesResponse():
services_length(0), services(NULL)
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
*(outbuffer + offset + 0) = (this->services_length >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (this->services_length >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (this->services_length >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (this->services_length >> (8 * 3)) & 0xFF;
offset += sizeof(this->services_length);
for( uint32_t i = 0; i < services_length; i++){
offset += this->services[i].serialize(outbuffer + offset);
}
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
uint32_t services_lengthT = ((uint32_t) (*(inbuffer + offset)));
services_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
services_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
services_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
offset += sizeof(this->services_length);
if(services_lengthT > services_length)
this->services = (zeroconf_msgs::PublishedService*)realloc(this->services, services_lengthT * sizeof(zeroconf_msgs::PublishedService));
services_length = services_lengthT;
for( uint32_t i = 0; i < services_length; i++){
offset += this->st_services.deserialize(inbuffer + offset);
memcpy( &(this->services[i]), &(this->st_services), sizeof(zeroconf_msgs::PublishedService));
}
return offset;
}
const char * getType(){ return LISTPUBLISHEDSERVICES; };
const char * getMD5(){ return "12aaabf9e3957c5a3d8c742745b6d97d"; };
};
class ListPublishedServices {
public:
typedef ListPublishedServicesRequest Request;
typedef ListPublishedServicesResponse Response;
};
}
#endif
|
//
// DZXHttpRequest.h
// DZXZhihuDaily
//
// Created by 邓梓暄 on 16/1/2.
// Copyright © 2016年 Zahi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DZXHttpRequest : NSObject
+ (void)getDataWithURL:(NSString *)url
parameter:(NSDictionary *)parameter
success:(void (^)(id responseDict))success
fail:(void (^)(NSError *error))fail;
@end
|
#pragma once
#ifndef __DEM_L1_EVENT_DISPATCHER_H__
#define __DEM_L1_EVENT_DISPATCHER_H__
#include <util/HashTable.h>
#include "Subscription.h"
#include "Event.h"
#include "EventNative.h"
// Event dispatcher receives fired events and dispatches them to subordinate dispatchers and subscribers.
namespace Data
{
typedef Ptr<class CParams> PParams;
}
namespace Events
{
using namespace Data;
class CEventDispatcher: public Core::CRefCounted
{
protected:
struct CEventNode
{
float FireTime; //???store int or packed to int for CPU fast
Ptr<CEventBase> Event;
CEventNode* Next;
CEventNode(): Next(NULL) {}
};
CEventNode* PendingEventsHead;
CEventNode* PendingEventsTail; // to preserve events' fire order, insert to the end of the list
CEventNode* EventsToAdd;
// can use sorted array instead of nList & implement subscription priority
HashTable<CEventID, PEventHandler> Subscriptions;
DWORD ScheduleEvent(CEventBase* Event, float RelTime);
DWORD DispatchEvent(const CEventBase& Event);
// Event handler (to subscribe to other dispatcher and receive its events)
bool OnEvent(const CEventBase& Event) { return !!DispatchEvent(Event); }
public:
CEventDispatcher();
CEventDispatcher(int HashTableCapacity);
virtual ~CEventDispatcher();
PSub AddHandler(CEventID ID, PEventHandler Handler);
// Returns handled counter (how much handlers handled this event)
DWORD FireEvent(CStrID ID, PParams Params = NULL, char Flags = 0, float RelTime = 0.f); /// non-native
DWORD FireEvent(CEventNative& Event, char Flags = -1, float RelTime = 0.f); /// native
void ProcessPendingEvents();
// Return value is subscription handle used to unsubscribe
//???leave 2 instead of 4 with CEventID first param?
PSub Subscribe(CStrID ID, bool (*Callback)(const CEventBase&), ushort Priority = Priority_Default);
template<class T> PSub Subscribe(CStrID ID, T* Object, bool (T::*Callback)(const CEventBase&), ushort Priority = Priority_Default);
PSub Subscribe(const CRTTI* RTTI, bool (*Callback)(const CEventBase&), ushort Priority = Priority_Default);
template<class T> PSub Subscribe(const CRTTI* RTTI, T* Object, bool (T::*Callback)(const CEventBase&), ushort Priority = Priority_Default);
PSub Subscribe(CEventDispatcher& Listener, ushort Priority = Priority_Default);
void Unsubscribe(PSub Sub);
void Unsubscribe(CEventID ID, CEventHandler* Handler);
//void UnsubscribeEvent(CStrID ID);
//void UnsubscribeEvent(const CRTTI* RTTI);
//void UnsubscribeCallback(bool (*Callback)(const CEventBase&));
//template<class T> void UnsubscribeObject(T* Object);
//template<class T> void Unsubscribe(CStrID ID, T* Object, bool FirstOnly = true);
void UnsubscribeAll() { Subscriptions.Clear(); }
};
//---------------------------------------------------------------------
inline CEventDispatcher::CEventDispatcher():
PendingEventsHead(NULL),
PendingEventsTail(NULL),
EventsToAdd(NULL)
{
}
//---------------------------------------------------------------------
inline CEventDispatcher::CEventDispatcher(int HashTableCapacity):
Subscriptions(HashTableCapacity),
PendingEventsHead(NULL),
PendingEventsTail(NULL),
EventsToAdd(NULL)
{
}
//---------------------------------------------------------------------
inline DWORD CEventDispatcher::FireEvent(CStrID ID, PParams Params, char Flags, float RelTime)
{
//!!!event pools!
Ptr<CEvent> Event = n_new(CEvent)(ID, Flags, Params); //EventMgr->ParamEvents.Allocate();
return ScheduleEvent(Event, RelTime);
}
//---------------------------------------------------------------------
inline DWORD CEventDispatcher::FireEvent(CEventNative& Event, char Flags, float RelTime)
{
if (Flags != -1) Event.Flags = Flags;
return ScheduleEvent(&Event, RelTime);
}
//---------------------------------------------------------------------
inline PSub CEventDispatcher::Subscribe(CStrID ID, CEventCallback Callback, ushort Priority)
{
return AddHandler(ID, n_new(CEventHandlerCallback)(Callback, Priority));
}
//---------------------------------------------------------------------
template<class T>
inline PSub CEventDispatcher::Subscribe(CStrID ID, T* Object, bool (T::*Callback)(const CEventBase&), ushort Priority)
{
return AddHandler(ID, n_new(CEventHandlerMember<T>)(Object, Callback, Priority));
}
//---------------------------------------------------------------------
inline PSub CEventDispatcher::Subscribe(const CRTTI* RTTI, CEventCallback Callback, ushort Priority)
{
return AddHandler(RTTI, n_new(CEventHandlerCallback)(Callback, Priority));
}
//---------------------------------------------------------------------
template<class T>
inline PSub CEventDispatcher::Subscribe(const CRTTI* RTTI, T* Object, bool (T::*Callback)(const CEventBase&), ushort Priority)
{
return AddHandler(RTTI, n_new(CEventHandlerMember<T>)(Object, Callback, Priority));
}
//---------------------------------------------------------------------
inline PSub CEventDispatcher::Subscribe(CEventDispatcher& Listener, ushort Priority)
{
return AddHandler(NULL, n_new(CEventHandlerMember<CEventDispatcher>)(&Listener, &CEventDispatcher::OnEvent, Priority));
}
//---------------------------------------------------------------------
inline void CEventDispatcher::Unsubscribe(PSub Sub)
{
n_assert(Sub->Dispatcher == this);
Unsubscribe(Sub->Event, Sub->Handler);
}
//---------------------------------------------------------------------
}
#endif |
#include "stdio.h"
#include "stdbool.h"
#include "yuv4.h"
int yuv42cmm(unsigned char* input, unsigned char *output, int height, int width)
{
int i;
int j;
unsigned char value;
unsigned short *output_short = (unsigned short*)output;
//y
for(i = 0;i < height;i++) {
for(j = 0;j < width;j++) {
yuv4GetYPixel(input, ((i * width) + j), &value, width, height);
unsigned short y_short = (unsigned short)(((unsigned short)value) << 8);
*(output_short + ((i * width) + j)) = y_short;
}
}
//cb
char cb_value;
unsigned short cb_short;
for(i = 0;i < height/2;i++) {
for(j = 0;j < width/2;j++) {
yuv4GetCbPixel(input, ((i * (width/2)) + j), &cb_value, width/2, height/2);
cb_short = (unsigned short)(cb_value + 128);
cb_short <<= 8;
*(output_short + (height * width) + ((i * (width/2)) + j)) = cb_short;
}
}
//cr
char cr_value;
unsigned short cr_short;
for(i = 0;i < height/2;i++) {
for(j = 0;j < width/2;j++) {
yuv4GetCrPixel(input, ((i * (width/2)) + j), &cr_value, width/2, height/2);
cr_short = (unsigned short)(cr_value + 128);
cr_short <<= 8;
*(output_short + (height * width) + ((height/2) * (width/2)) + ((i * (width/2)) + j)) = cr_short;
}
}
return 0;
}
|
//
// HPDebugCrawlerViewController.h
// HiPDA
//
// Created by Jichao Wu on 15/10/29.
// Copyright © 2015年 wujichao. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HPDebugCrawlerViewController : UIViewController
@property (nonatomic, strong) HPCrawlerErrorContext *context;
@end
|
#ifndef IANTBASECONTROLLER_H
#define IANTBASECONTROLLER_H
#include <argos3/core/utility/logging/argos_log.h>
#include <argos3/core/control_interface/ci_controller.h>
#include <argos3/plugins/robots/generic/control_interface/ci_positioning_sensor.h>
#include <argos3/plugins/robots/generic/control_interface/ci_differential_steering_actuator.h>
#include <argos3/plugins/robots/foot-bot/control_interface/ci_footbot_proximity_sensor.h>
#include <argos3/core/simulator/loop_functions.h>
#include <cmath>
#include <stack>
/**
* iAntBaseController
* @author Antonio Griego
*/
class iAntBaseController : public argos::CCI_Controller {
public:
iAntBaseController();
/* iAnt navigation functions */
argos::CRadians GetHeading();
argos::CVector2 GetPosition();
argos::CVector2 GetTarget();
void SetTarget(argos::CVector2 t);
void SetStartPosition(argos::CVector3 sp);
argos::CVector3 GetStartPosition();
size_t GetMovementState();
void Stop();
void Move();
bool Wait();
void Wait(size_t wait_time_in_seconds);
/* iAnt time calculation functions */
size_t SimulationTick();
size_t SimulationTicksPerSecond();
argos::Real SimulationSecondsPerTick();
argos::Real SimulationTimeInSeconds();
bool IsAtTarget();
protected:
size_t WaitTime;
argos::Real TargetDistanceTolerance;
argos::Real SearchStepSize;
argos::CRange<argos::Real> ForageRangeX;
argos::CRange<argos::Real> ForageRangeY;
argos::CRange<argos::Real> GoStraightAngleRangeInDegrees;
// iAnt base controller movement parameters
argos::Real RobotForwardSpeed;
argos::Real RobotRotationSpeed;
argos::Real TicksToWaitWhileMoving;
// foot-bot components: sensors and actuators
argos::CCI_PositioningSensor* compassSensor;
argos::CCI_DifferentialSteeringActuator* wheelActuator;
argos::CCI_FootBotProximitySensor* proximitySensor;
// controller state variables
enum MovementState {
STOP = 0,
LEFT = 1,
RIGHT = 2,
FORWARD = 3,
BACK = 4
} CurrentMovementState;
private:
argos::CLoopFunctions& LF;
argos::CVector3 StartPosition;
argos::CVector2 TargetPosition;
/* movement definition variables */
struct Movement {
size_t type;
argos::Real magnitude;
};
//MovementState CurrentMovementState;
std::stack<Movement> MovementStack;
/* private navigation helper functions */
void SetNextMovement();
void SetTargetAngleDistance(argos::Real newAngleToTurnInDegrees);
void SetTargetTravelDistance(argos::Real newTargetDistance);
void SetLeftTurn(argos::Real newTargetAngle);
void SetRightTurn(argos::Real newTargetAngle);
void SetMoveForward(argos::Real newTargetDistance);
void SetMoveBack(argos::Real newTargetDistance);
void PushMovement(size_t moveType, argos::Real moveSize);
void PopMovement();
/* collision detection functions */
bool CollisionDetection();
argos::CVector2 GetCollisionVector();
};
#endif /* IANTBASECONTROLLER_H */ |
typedef int ElementType;
/* START: fig3_6.txt */
#ifndef _List_H
#define _List_H
struct Node;
typedef struct Node *PtrToNode;
typedef PtrToNode List;
typedef PtrToNode Position;
List MakeEmpty( List L );
int IsEmpty( List L );
int IsLast( Position P, List L );
Position Find( ElementType X, List L );
void Delete( ElementType X, List L );
Position FindPrevious( ElementType X, List L );
void Insert( ElementType X, List L, Position P );
void DeleteList( List L );
Position Header( List L );
Position First( List L );
Position Advance( Position P );
ElementType Retrieve( Position P );
#endif /* _List_H */
/* END */
|
// Author: Emmanuel Odeke <odeke@ualberta.ca>
#ifndef _HLRU_H
#define _HLRU_H
#include "hashList.h"
#define HCache HLRU
typedef HashList HLRU;
#endif
|
//
// NSString+Array.h
// OnsiteTexts
//
// Created by David Hodge on 9/1/15.
// Copyright (c) 2015 Genesis Apps, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Array)
/**
* Takes an array of strings and formats them into a single string with commas.
*
* @param array The string components to combine
*/
+ (NSString *)stringFromComponents:(NSMutableArray *)array;
@end
|
typedef struct _gtkQueryCssProvider{
void (*addStyle) ();
}gtkQueryCssProvider;
gtkQueryCssProvider cssStyle (char*);
void addStyle (); |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <AppKit/NSTableCellView.h>
@class NSImageView, NSTextField;
@interface DVTFileLiteralInfoCellView : NSTableCellView
{
NSTextField *_subtitle;
NSImageView *_checkmark;
}
- (void).cxx_destruct;
@property(retain, nonatomic) NSImageView *checkmark; // @synthesize checkmark=_checkmark;
@property(retain, nonatomic) NSTextField *subtitle; // @synthesize subtitle=_subtitle;
@end
|
#include "SDL.h"
#include "SDL_gpu.h"
#include <math.h>
#include "compat.h"
#include "common.h"
#include <stdlib.h>
#define PI 3.14159265359
void getScreenToWorld(float screenX, float screenY, float* worldX, float* worldY)
{
GPU_Target* screen = GPU_GetContextTarget();
GPU_Camera camera = GPU_GetCamera(screen);
if(screen == NULL)
return;
if(worldX)
{
//if(camera.angle == 0.0f)
*worldX = (screenX - screen->w/2) / camera.zoom_x + camera.x + screen->w/2;
//else
//*worldX = (screenX - screen->w/2) / camera.zoom_x * cos(-camera.angle*PI/180) - (screenY - screen->h/2) / camera.zoom * sin(-camera.angle*PI/180) + camera.x + screen->w/2;
}
if(worldY)
{
//if(camera.angle == 0.0f)
*worldY = (screenY - screen->h/2) / camera.zoom_y + camera.y + screen->h/2;
//else
//*worldY = (screenX - screen->w/2) / camera.zoom_y * sin(-camera.angle*PI/180) + (screenY - screen->h/2) / camera.zoom * cos(-camera.angle*PI/180) + camera.y + screen->h/2;
}
}
void getWorldToScreen(float worldX, float worldY, float* screenX, float* screenY)
{
GPU_Target* screen = GPU_GetContextTarget();
GPU_Camera camera = GPU_GetCamera(screen);
if(screen == NULL)
return;
if(screenX)
{
//if(camera.angle == 0.0f)
*screenX = (worldX - camera.x - screen->w/2)*camera.zoom_x + screen->w/2;
//else
//*screenX = (worldX - camera.x - screen->w/2)*camera.zoom_x * cos(-camera.angle*PI/180) + screen->w/2;
}
if(screenY)
{
//if(camera.angle == 0.0f)
*screenY = (worldY - camera.y - screen->h/2)*camera.zoom_y + screen->h/2;
//else
//*screenY = (worldY - camera.y - screen->h/2)*camera.zoom_y * sin(-camera.angle*PI/180) + screen->h/2;
}
}
void printScreenToWorld(float screenX, float screenY)
{
float worldX, worldY;
getScreenToWorld(screenX, screenY, &worldX, &worldY);
printf("ScreenToWorld: (%.1f, %.1f) -> (%.1f, %.1f)\n", screenX, screenY, worldX, worldY);
}
void printWorldToScreen(float worldX, float worldY)
{
float screenX, screenY;
getWorldToScreen(worldX, worldY, &screenX, &screenY);
printf("WorldToScreen: (%.1f, %.1f) -> (%.1f, %.1f)\n", worldX, worldY, screenX, screenY);
}
int main(int argc, char* argv[])
{
GPU_Target* screen;
printRenderers();
screen = GPU_Init(800, 600, GPU_DEFAULT_INIT_FLAGS);
if(screen == NULL)
return -1;
printCurrentRenderer();
{
int numImages;
GPU_Image** images;
int i;
const Uint8* keystates;
GPU_Camera camera;
float dt;
Uint8 done;
SDL_Event event;
float x, y;
images = (GPU_Image**)malloc(sizeof(GPU_Image*)*(argc - 1));
numImages = 0;
for (i = 1; i < argc; i++)
{
images[numImages] = GPU_LoadImage(argv[i]);
if (images[numImages] != NULL)
numImages++;
}
keystates = SDL_GetKeyState(NULL);
camera = GPU_GetDefaultCamera();
dt = 0.010f;
done = 0;
while (!done)
{
while (SDL_PollEvent(&event))
{
if (event.type == SDL_QUIT)
done = 1;
else if (event.type == SDL_KEYDOWN)
{
if (event.key.keysym.sym == SDLK_ESCAPE)
done = 1;
else if (event.key.keysym.sym == SDLK_r)
{
camera = GPU_GetDefaultCamera();
}
}
else if (event.type == SDL_MOUSEBUTTONDOWN)
{
float x, y;
GPU_GetVirtualCoords(screen, &x, &y, event.button.x, event.button.y);
printScreenToWorld(x, y);
}
}
if (keystates[KEY_UP])
{
camera.y -= 200 * dt;
}
else if (keystates[KEY_DOWN])
{
camera.y += 200 * dt;
}
if (keystates[KEY_LEFT])
{
camera.x -= 200 * dt;
}
else if (keystates[KEY_RIGHT])
{
camera.x += 200 * dt;
}
if(keystates[KEY_MINUS])
{
camera.zoom_x -= 1.0f*dt;
camera.zoom_y -= 1.0f*dt;
}
else if(keystates[KEY_EQUALS])
{
camera.zoom_x += 1.0f*dt;
camera.zoom_y += 1.0f*dt;
}
GPU_ClearRGBA(screen, 255, 255, 255, 255);
GPU_SetCamera(screen, &camera);
x = 0;
y = 0;
for (i = 0; i < numImages; i++)
{
x += images[i]->w / 2.0f;
y += images[i]->h / 2.0f;
GPU_Blit(images[i], NULL, screen, x, y);
x += images[i]->w / 2.0f;
y += images[i]->h / 2.0f;
}
GPU_Flip(screen);
SDL_Delay(10);
}
for (i = 0; i < numImages; i++)
{
GPU_FreeImage(images[i]);
}
free(images);
}
GPU_Quit();
return 0;
}
|
#include "string.h"
#ifdef __DEBUG_USE_STDIO_STRING_H__
#include <stdio.h>
#define debugf(args...) printf(args)
#else // __DEBUG_USE_STDIO_STRING_H__
#define debugf(args...)
#endif // __DEBUG_USE_STDIO_STRING_H__
/**
* @fn 10 進数値を文字列へ変換する
* @param (l) 変換対象数値
* @param (str) 変換後の文字列を格納するバッファへのポインタ
* @param (max_length) 変換後の文字列を格納するバッファの長さ
* @return エラーコード
* 0 : 正常終了
* 1 : 変換後文字列を格納するバッファの長さが足りなかった
* @deprecated 互換性のために残してあります。ltoa() 関数を使用してください。
* @see ltoa()
*/
unsigned char ltoa_10(const uint64 l, char* str, const int max_length) {
debugf("start ltoa_10.\n");
return ltoa(l, str, max_length, 10l);
}
/**
* @fn 数値を、指定された基数の文字列へ変換する
* @param (l) 変換対象数値
* @param (str) 変換後の文字列を格納するバッファへのポインタ
* @param (max_length) 変換後の文字列を格納するバッファの長さ
* @param (radix) 基数(サポート範囲: 1 <= radix <= 16)
* @return エラーコード
* 0 : 正常終了
* 1 : 変換後文字列を格納するバッファの長さが足りなかった
* 2 : サポートしていない基数が指定された
*/
unsigned char ltoa(const uint64 l, char* str, const int max_length, const uint64 radix) {
uint64 i;
uint64 tmp_long_value = l < 0 ? -l : l;
uint8 tmp_digit_value;
uint64 length = 0;
debugf("start ltoa.\n");
debugf("l : %d\n", l);
debugf("str : %p\n", str);
debugf("max_length : %d\n", max_length);
debugf("radix : %d\n", radix);
debugf("tmp_long_value: %d\n", tmp_long_value);
// 桁の数値と文字を対応付けする配列
const char cmap[]
= { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
// 基数判定
if (!(radix >= 1 && radix <= 16)) {
debugf("invalid radix.\n");
return 3;
}
// ゼロ判定, ゼロならさっさと返却する
if (l == 0) {
if (max_length < 2) {
return 1;
}
str[0] = '0';
str[1] = '\0';
return 0;
}
// 桁数判定
while (tmp_long_value != 0) {
tmp_long_value = tmp_long_value / radix;
length++;
}
if (l < 0) {
length++;
}
debugf("length: %d\n", length);
// バッファ長上限判定(NULL 文字を含めるので +1 する)
// 上限を超えていたら 1 を返却
if (length + 1 > max_length) {
debugf("length + 1 > max_length.\n");
return 1;
}
// 文字列変換
// 文字列変換開始インデックス
i = length - 1;
// NULL 文字追加
str[length] = '\0';
// 各桁の変換
tmp_long_value = l < 0 ? -l : l;
while (tmp_long_value != 0) {
tmp_digit_value = tmp_long_value % radix;
debugf("digit: %c\n", cmap[tmp_digit_value]);
str[i] = cmap[tmp_digit_value];
i--;
tmp_long_value = tmp_long_value / radix;
}
// 負数処理
if (l < 0) {
str[0] = '-';
}
return 0;
}
|
//
// AppDelegate.h
// SQPerformance
//
// Created by 朱双泉 on 2018/7/5.
// Copyright © 2018 Castie!. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* dump2tar - tool to dump files and command output into a tar archive
*
* Reference counting for directory handles
*
* Copyright IBM Corp. 2016, 2017
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
#ifndef DREF_H
#define DREF_H
#include <dirent.h>
#include <stdbool.h>
/* Multiple jobs may refer to an open DIR * - need reference counting */
struct dref {
DIR *dd;
int dirfd;
unsigned int count;
};
struct dref *dref_create(const char *dirname);
struct dref *dref_get(struct dref *dref);
void dref_put(struct dref *dref);
#endif /* DREF_H */
|
//
// AnimatedLoadingBar.h
// Smokescreen
//
// Created by Huebner, Rob on 9/23/14.
// Copyright (c) 2014-2015 Vimeo (https://vimeo.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <UIKit/UIKit.h>
@interface AnimatedLoadingBar : UIView
@property (nonatomic, assign) BOOL hidesWhenStopped;
- (void)startAnimating;
- (void)stopAnimating;
@end
|
#ifndef _ATTACK_BASE_H
#define _ATTACK_BASE_H
/**
Klasa koja kontrolise te rakete koje napadaju,
tu se radi logika oko zadavanja putanja interpolacije i tih gluposti
*/
class AttackBase
{
};
#endif |
#ifndef GAME_H
#define GAME_H 1
#include "board.h"
#include "bitboard.h"
#include "time.h"
#include "const.h"
#include "xboardplayer.h"
#include <string.h>
#include <stdlib.h>
class Board;
class XBoardPlayer;
typedef XBoardPlayer Player;
//Play one game of chess..
class Game {
public:
Board *board;
pthread_mutex_t boardLock; //Lock for changing the board/reading off engine structures
Board *boardCopy; //Make a copy and use this one to check move legality etc..
pthread_mutex_t copyLock;
int colour;
int mode;
int running;
int opponentMoved; //We're in ponder mode - has our opponent moved?
//In milli-seconds
int ourTime, opponentsTime;
int baseTime, increment, movesPerControl;
unsigned long long int lastUpdateOurTime; //From gettimeofday
unsigned long long int lastUpdateOpponentsTime; //From gettimeofday
pthread_mutex_t modeLock; //lLock for changing game states updating time etc..
unsigned long long int startMoveTime;
int timeAllocated;
int lastNps;
Player *player;
void findMove();
void ponder();
//Called by the search regularly to update time etc.. to check if a new move has come in
int interfaceUpdate();
static void runGame(Game *instance);
void run();
void stop();
void reset();
int isRunning();
Game(Player *player);
~Game();
void setBoard(char *fen);
void setColour(int colour);
void setMode(int mode);
void setTimeControls(int movesPerControl, int baseTime, int increment);
void setTime(int ourTime);
void setOpponentsTime(int opponentsTime);
unsigned long long getTime();
unsigned long long getTimeTaken();
void externalMove(char *move);
void Game::undo();
void listMoves();
void printBoard();
void readPgn(char *filename);
void benchMark(char *filename);
void benchTreeSize(char *filename);
void benchGenerate(char *filename);
void benchMove(char *filename);
void printEval();
};
#endif
|
////////////////////////////////////////
// //
// LibManage //
// Library Management Sytem //
// //
// Copyright (c) 2007 Kartik Singhal. //
// kartiksinghal@gmail.com //
// All rights reserved. //
// //
////////////////////////////////////////
#define _CRT_SECURE_NO_WARNINGS //to eliminate deprecation warnings
// Included header files
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
#include <cctype>
#include <iomanip>
#include "conio2.h"
#include "date.h"
using namespace std;
// To exit the program incase memory error occurs
void exitLM(void)
{
clrscr();
gotoxy(28,13);
cerr<<"Memory error! Exiting...";
_getch();
exit(0);
} //End exitLM()
//////////////////////////////////////
// The Book Class //
//////////////////////////////////////
class Book //76 bytes
{
public:
void displayList(void);
char* booknameOf(int);
protected:
void addNewBook(int, char[], char[], float, int, int);
void updateCopies(int, int, int);
void modify(int, char[], char[], float);
int bookFound(int);
int booknameFound(char[]);
int recordnoOf(int);
int available(int);
char* authornameOf(int);
float bookpriceOf(int);
int noOfCopiesOf(int);
int bookcodeOf(char[]);
void display(int);
int recCount(void);
void deleteRec(int);
private:
int bookcode, copies;
char name[33], author[26];
float price;
int avail;
}; //Book class ends
////////////////////////////////////////
// The Member Class //
////////////////////////////////////////
class Member //108 bytes
{
public:
void displayList(void);
protected:
void addMem(int, int, char[], char[], char[], Date);
void modify(int, char[], char[], char[]);
int memberFound(int);
void updateBook(int, int, Date);
char* membername(int);
char* memberphone(int);
char* memberaddress(int);
int recordnoOf(int);
int lastcode(void);
int issuedFor(int);
int fineFor(int);
void display(int);
void deleteRec(int);
private:
int memcode, bookcode;
char name[26], phone[10], address[33];
Date returnDate;
}; //Member class ends
//////////////////////////////////////
// The Menu Class //
//////////////////////////////////////
class Menu
{
public:
void displayMainMenu(void);
void displayIntroduction(void);
private:
void displayEditMenu(void);
void displayEditBookMenu(void);
void displayEditMemberMenu(void);
}; //Menu class ends
//////////////////////////////////////////
// The Working Class //
//////////////////////////////////////////
class Working : public Book, public Member
{
public:
void issueBook(void);
void returnBook(void);
void addBook(void);
void addMember(void);
void modifyBook(void);
void modifyMember(void);
void deleteBook(void);
void deleteMember(void);
}; //Working class ends
//////////////////////////////////////////
// //
// THE END //
// //
//////////////////////////////////////////
|
#pragma once
#include "Sarene/Renderer/Buffer.h"
namespace Sarene
{
class OpenGLVertexBuffer : public VertexBuffer
{
public:
OpenGLVertexBuffer(float* vertices, uint32_t size);
virtual ~OpenGLVertexBuffer();
virtual void Bind() const override;
virtual void Unbind() const override;
virtual const BufferLayout& GetLayout() const override { return m_Layout; };
virtual void SetLayout(const BufferLayout& layout) override { m_Layout = layout; };
private:
uint32_t m_RendererID;
BufferLayout m_Layout;
};
class OpenGLIndexBuffer : public IndexBuffer
{
public:
OpenGLIndexBuffer(uint32_t* indices, uint32_t count);
virtual ~OpenGLIndexBuffer();
virtual void Bind() const override;
virtual void Unbind() const override;
virtual uint32_t GetCount() const { return m_Count; }
private:
uint32_t m_RendererID;
uint32_t m_Count;
};
}
|
//
// ViewController.h
// XenditExampleObjC
//
// Created by Maxim Bolotov on 3/31/17.
// Copyright © 2017 Xendit. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ObjCViewController : UIViewController
@end
|
//
// AppDelegate.h
// JJ_Class_05_多线程_NSRecursiveLock
//
// Created by Jay on 16/8/31.
// Copyright © 2016年 JJ. All rights reserved.
//
/**
* NSRecursiveLock递归锁的使用
http://www.cocoachina.com/ios/20150513/11808.html
*/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// FirstViewController.h
// YouXin
//
// Created by qingyun on 15/12/9.
// Copyright © 2015年 qingyun. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController
@end
|
//================ Copyright (c) 2017, PG, All rights reserved. =================//
//
// Purpose: macOS
//
// $NoKeywords: $macenv
//===============================================================================//
#ifdef __APPLE__
#ifndef MACOSENVIRONMENT_H
#define MACOSENVIRONMENT_H
#include "Environment.h"
class MacOSWrapper;
class MacOSEnvironment : public Environment
{
public:
MacOSEnvironment(MacOSWrapper *wrapper);
virtual ~MacOSEnvironment();
void update();
// engine/factory
Graphics *createRenderer();
ContextMenu *createContextMenu();
// system
OS getOS();
void shutdown();
void restart();
void sleep(unsigned int us);
UString getExecutablePath();
void openURLInDefaultBrowser(UString url);
// user
UString getUsername();
UString getUserDataPath();
// file IO
bool fileExists(UString filename);
bool directoryExists(UString directoryName);
bool createDirectory(UString directoryName);
bool renameFile(UString oldFileName, UString newFileName);
bool deleteFile(UString filePath);
std::vector<UString> getFilesInFolder(UString folder);
std::vector<UString> getFoldersInFolder(UString folder);
std::vector<UString> getLogicalDrives();
UString getFolderFromFilePath(UString filepath);
UString getFileExtensionFromFilePath(UString filepath, bool includeDot = false);
// clipboard
UString getClipBoardText();
void setClipBoardText(UString text);
// dialogs & message boxes
void showMessageInfo(UString title, UString message);
void showMessageWarning(UString title, UString message);
void showMessageError(UString title, UString message);
void showMessageErrorFatal(UString title, UString message);
UString openFileWindow(const char *filetypefilters, UString title, UString initialpath);
UString openFolderWindow(UString title, UString initialpath);
// window
void focus();
void center();
void minimize();
void maximize();
void enableFullscreen();
void disableFullscreen();
void setWindowTitle(UString title);
void setWindowPos(int x, int y);
void setWindowSize(int width, int height);
void setWindowResizable(bool resizable);
void setWindowGhostCorporeal(bool corporeal);
void setMonitor(int monitor);
Vector2 getWindowPos();
Vector2 getWindowSize();
int getMonitor();
std::vector<McRect> getMonitors();
Vector2 getNativeScreenSize();
McRect getVirtualScreenRect();
McRect getDesktopRect();
int getDPI();
bool isFullscreen() {return m_bFullScreen;}
bool isWindowResizable() {return m_bResizable;}
// mouse
bool isCursorInWindow();
bool isCursorVisible();
bool isCursorClipped() {return false;}
Vector2 getMousePos();
McRect getCursorClip();
CURSORTYPE getCursor();
void setCursor(CURSORTYPE cur);
void setCursorVisible(bool visible);
void setMousePos(int x, int y);
void setCursorClip(bool clip, McRect rect);
// keyboard
UString keyCodeToString(KEYCODE keyCode);
// ILLEGAL:
inline MacOSWrapper *getWrapper() {return m_wrapper;}
private:
static int getFilesInFolderFilter(const struct dirent *entry);
static int getFoldersInFolderFilter(const struct dirent *entry);
void setCursorVisible(bool visible, bool internalOverride);
MacOSWrapper *m_wrapper;
// monitors
static std::vector<McRect> m_vMonitors;
// window
bool m_bFullScreen;
bool m_bResizable;
// mouse
bool m_bCursorClipped;
McRect m_cursorClip;
bool m_bCursorRequest;
bool m_bCursorReset;
int m_iCursorInvisibleCounter;
int m_iCursorVisibleCounter;
bool m_bCursorVisible;
bool m_bCursorVisibleInternalOverride;
bool m_bIsCursorInsideWindow;
CURSORTYPE m_cursorType;
};
#endif
#endif
|
/*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2020 Scientific Computing and Imaging Institute,
University of Utah.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef ALGORITHMS_MATH_ElectrodeCoilSetupAlgorithm_H
#define ALGORITHMS_MATH_ElectrodeCoilSetupAlgorithm_H
#include <Core/Algorithms/Base/AlgorithmBase.h>
#include <Core/Algorithms/BrainStimulator/share.h>
///@file ElectrodeCoilSetupAlgorithm
///@brief The algorithm of this module deals with the complex interaction of input data and GUI functionality.
///
///
///@author
/// Moritz Dannhauer
///
///@details
/// In the first execution all relevant input data are send to and represented by the GUI. After further GUI user input
/// the validity is evaluated with respect of the data provided at the input ports. Validity remarks are provided
/// in the info box depicted in blue color whereas data expectation violations halt the module and throw a red error box.
/// For a single valid table row, the module generates a tDCS electrode or TMS coil using specific functions.
/// If a valid tDCS table row is present, two field outputs (second and third output) are created.The second ouput
/// creates a the field containing the moved tDCS electrodes whereas the third outputs the electrodes adjusted to the scalp surface.
/// In the case that the tDCS electrode does not encapsulates a part of the scalp, no electrode can be actually created and the third
/// output will not contain a valid electrode.
/// If only TMS coils are specified the first output of the module can be expected to contain no data.
namespace SCIRun {
namespace Core {
namespace Algorithms {
namespace BrainStimulator {
ALGORITHM_PARAMETER_DECL(TableValues);
ALGORITHM_PARAMETER_DECL(ProtoTypeInputCheckbox);
ALGORITHM_PARAMETER_DECL(AllInputsTDCS);
ALGORITHM_PARAMETER_DECL(ProtoTypeInputComboBox);
ALGORITHM_PARAMETER_DECL(NumberOfPrototypes);
ALGORITHM_PARAMETER_DECL(ElectrodethicknessCheckBox);
ALGORITHM_PARAMETER_DECL(ElectrodethicknessSpinBox);
ALGORITHM_PARAMETER_DECL(InvertNormalsCheckBox);
ALGORITHM_PARAMETER_DECL(OrientTMSCoilRadialToScalpCheckBox);
ALGORITHM_PARAMETER_DECL(PutElectrodesOnScalpCheckBox);
ALGORITHM_PARAMETER_DECL(InterpolateElectrodeShapeCheckbox);
class SCISHARE ElectrodeCoilSetupAlgorithm : public AlgorithmBase
{
public:
ElectrodeCoilSetupAlgorithm();
AlgorithmOutput run(const AlgorithmInput& input) const override;
static const AlgorithmOutputName FINAL_ELECTRODES_FIELD;
static const AlgorithmOutputName MOVED_ELECTRODES_FIELD;
static const AlgorithmInputName SCALP_SURF;
static const AlgorithmInputName LOCATIONS;
static const AlgorithmInputName ELECTRODECOILPROTOTYPES;
static const AlgorithmOutputName ELECTRODE_SPONGE_LOCATION_AVR;
static const AlgorithmOutputName COILS_FIELD;
boost::tuple<VariableHandle, Datatypes::DenseMatrixHandle, FieldHandle, FieldHandle, FieldHandle> run(const FieldHandle scalp, const Datatypes::DenseMatrixHandle locations, const std::vector<FieldHandle>& elc_coil_proto) const;
static const int number_of_columns = 10; /// number of GUI columns
static const double direction_bound;
static const AlgorithmParameterName columnNames[number_of_columns];
private:
static const int unknown_stim_type; /// first Stimulation type
static const int tDCS_stim_type; /// second ...
static const int TMS_stim_type; /// third ...
Datatypes::DenseMatrixHandle make_rotation_matrix_around_axis(double angle, std::vector<double>& axis_vector) const;
Datatypes::DenseMatrixHandle make_rotation_matrix(const double angle, const std::vector<double>& normal) const;
boost::tuple<Datatypes::DenseMatrixHandle, FieldHandle, FieldHandle, VariableHandle> make_tdcs_electrodes(FieldHandle scalp, const std::vector<FieldHandle>& elc_coil_proto,
const std::vector<double>& elc_prototyp_map, const std::vector<double>& elc_x, const std::vector<double>& elc_y, const std::vector<double>& elc_z, const std::vector<double>& elc_angle_rotation, const std::vector<double>& elc_thickness, VariableHandle table) const;
FieldHandle make_tms(FieldHandle scalp, const std::vector<FieldHandle>& elc_coil_proto, const std::vector<double>& coil_prototyp_map, const std::vector<double>& coil_x, const std::vector<double>& coil_y, const std::vector<double>& coil_z, const std::vector<double>& coil_angle_rotation, std::vector<double>& coil_nx, std::vector<double>& coil_ny, std::vector<double>& coil_nz) const;
VariableHandle fill_table(FieldHandle scalp, Datatypes::DenseMatrixHandle locations, const std::vector<FieldHandle>& input) const;
boost::tuple<Variable::List, double, double, double> make_table_row(int i,double x, double y, double z, double nx, double ny, double nz) const;
};
}}}}
#endif
|
#include <stdio.h>
#include "includes.h"
#include <string.h>
#define DEBUG 1
//semaphores for handshaking
OS_EVENT *aSemaphore;
OS_EVENT *bSemaphore;
/* Definition of Task Stacks */
/* Stack grows from HIGH to LOW memory */
#define TASK_STACKSIZE 2048
OS_STK task1_stk[TASK_STACKSIZE];
OS_STK task2_stk[TASK_STACKSIZE];
OS_STK stat_stk[TASK_STACKSIZE];
/* Definition of Task Priorities */
#define TASK1_PRIORITY 6 // highest priority
#define TASK2_PRIORITY 7
#define TASK_STAT_PRIORITY 12 // lowest priority
void printStackSize(INT8U prio)
{
INT8U err; //error flag for statistics task
OS_STK_DATA stk_data;
err=OSTaskStkChk(prio, &stk_data);
if(err==OS_NO_ERR)
{
if(DEBUG==1)
{
printf("Task Priority %d - Used: %d; Free: %d\n", prio, stk_data.OSFree, stk_data.OSUsed);
}
}
else
{
if (DEBUG==1)
{
printf("Stack Check Error!\n");
}
}
}
/* Prints a message and sleeps for given time interval */
void task1(void* pdata)
{
INT8U err_task1; //error flag for task 1
while (1)
{
OSSemSet(bSemaphore, 0, &err_task1); //set key to 0
OSSemPend(aSemaphore, 0, &err_task1); // Trying to access the key
if(err_task1==OS_ERR_NONE)
{
printf("T0-S0\n");
OSSemPost(aSemaphore); // Releasing the key
OSSemPend(bSemaphore, 0, &err_task1); // Trying to access the key
if (err_task1==OS_ERR_NONE)
{
printf("T0-S1\n");
printf("\n");
}
}
OSSemPost(bSemaphore); // Releasing the key
}
}
/* Prints a message and sleeps for given time interval */
void task2(void* pdata)
{
INT8U err_task2; //error flag for task 2
while (1)
{
OSSemPend(aSemaphore, 0, &err_task2); // Trying to access the key
if(err_task2==OS_ERR_NONE)
{
printf("T1-S0\n");
printf("T1-S1\n");
}
OSSemPost(aSemaphore); // Releasing the key
OSSemPost(bSemaphore); // Releasing the key
}
}
/* Printing Statistics */
void statisticTask(void* pdata)
{
INT8U err_task3;
//**********************Critical section*******************
while(1)
{
OSSemPend(aSemaphore, 0, &err_task3); // Trying to access the key
if(err_task3==OS_ERR_NONE)
{
//print stack data for all 3 tasks
printStackSize(TASK1_PRIORITY);
printStackSize(TASK2_PRIORITY);
printStackSize(TASK_STAT_PRIORITY);
}
OSSemPost(aSemaphore); // Releasing the key
}
//**********************Non-critical section*******************
}
/* The main function creates two task and starts multi-tasking */
int main(void)
{
INT8U err;
aSemaphore=OSSemCreate(1); // binary semaphore (1 key)
bSemaphore=OSSemCreate(1); // binary semaphore (1 key)
//creates task 1
OSTaskCreateExt
(task1, // Pointer to task code
NULL, // Pointer to argument that is
// passed to task
&task1_stk[TASK_STACKSIZE-1], // Pointer to top of task stack
TASK1_PRIORITY, // Desired Task priority
TASK1_PRIORITY, // Task ID
&task1_stk[0], // Pointer to bottom of task stack
TASK_STACKSIZE, // Stacksize
NULL, // Pointer to user supplied memory
// (not needed here)
OS_TASK_OPT_STK_CHK | // Stack Checking enabled
OS_TASK_OPT_STK_CLR // Stack Cleared
);
//creates task 2
OSTaskCreateExt
(task2, // Pointer to task code
NULL, // Pointer to argument that is
// passed to task
&task2_stk[TASK_STACKSIZE-1], // Pointer to top of task stack
TASK2_PRIORITY, // Desired Task priority
TASK2_PRIORITY, // Task ID
&task2_stk[0], // Pointer to bottom of task stack
TASK_STACKSIZE, // Stacksize
NULL, // Pointer to user supplied memory
// (not needed here)
OS_TASK_OPT_STK_CHK | // Stack Checking enabled
OS_TASK_OPT_STK_CLR // Stack Cleared
);
//create statistics task
if (DEBUG == 1)
{
OSTaskCreateExt
(statisticTask, // Pointer to task code
NULL, // Pointer to argument that is
// passed to task
&stat_stk[TASK_STACKSIZE-1], // Pointer to top of task stack
TASK_STAT_PRIORITY, // Desired Task priority
TASK_STAT_PRIORITY, // Task ID
&stat_stk[0], // Pointer to bottom of task stack
TASK_STACKSIZE, // Stacksize
NULL, // Pointer to user supplied memory
// (not needed here)
OS_TASK_OPT_STK_CHK | // Stack Checking enabled
OS_TASK_OPT_STK_CLR // Stack Cleared
);
}
OSStart(); //start OS
return 0;
} |
// Copyright (c) 2016-2017 The c0ban developers
#ifndef BITCOIN_CHAINPARAMSSEEDS_H
#define BITCOIN_CHAINPARAMSSEEDS_H
/**
* List of fixed seed nodes for the bitcoin network
* AUTOGENERATED by contrib/seeds/generate-seeds.py
*
* Each line contains a 16-byte IPv6 address and a port.
* IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.
*/
static SeedSpec6 pnSeed6_main[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0xc7,0xbf,0xd9}, 3881}, // Tokyo
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0x4e,0x97,0x8a}, 3881} // Seoul
};
static SeedSpec6 pnSeed6_test[] = {
{{0xfe,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0xbf,0x79,0x0d,0x36,0xc0,0xf3,0x6d}, 13881},
{{0xfe,0x80,0x0,0x00,0x00,0x00,0x00,0x00,0xb0,0xf1,0xe5,0xa3,0x72,0xf1,0x72,0xf9}, 13881}
};
#endif // BITCOIN_CHAINPARAMSSEEDS_H
|
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2016_16_1_0_AI_h__
#define __nFRC_2016_16_1_0_AI_h__
#include "FRC_FPGA_ChipObject/tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2016_16_1_0
{
class tAI
{
public:
tAI(){}
virtual ~tAI(){}
virtual tSystemInterface* getSystemInterface() = 0;
static tAI* create(tRioStatusCode *status);
typedef enum
{
kNumSystems = 1,
} tIfaceConstants;
typedef
union{
struct{
#ifdef __vxworks
unsigned ScanSize : 3;
unsigned ConvertRate : 26;
#else
unsigned ConvertRate : 26;
unsigned ScanSize : 3;
#endif
};
struct{
unsigned value : 29;
};
} tConfig;
typedef
union{
struct{
#ifdef __vxworks
unsigned Channel : 3;
unsigned Averaged : 1;
#else
unsigned Averaged : 1;
unsigned Channel : 3;
#endif
};
struct{
unsigned value : 4;
};
} tReadSelect;
typedef enum
{
} tOutput_IfaceConstants;
virtual signed int readOutput(tRioStatusCode *status) = 0;
typedef enum
{
} tConfig_IfaceConstants;
virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
virtual void writeConfig_ScanSize(unsigned char value, tRioStatusCode *status) = 0;
virtual void writeConfig_ConvertRate(unsigned int value, tRioStatusCode *status) = 0;
virtual tConfig readConfig(tRioStatusCode *status) = 0;
virtual unsigned char readConfig_ScanSize(tRioStatusCode *status) = 0;
virtual unsigned int readConfig_ConvertRate(tRioStatusCode *status) = 0;
typedef enum
{
} tLoopTiming_IfaceConstants;
virtual unsigned int readLoopTiming(tRioStatusCode *status) = 0;
typedef enum
{
kNumOversampleBitsElements = 8,
} tOversampleBits_IfaceConstants;
virtual void writeOversampleBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
virtual unsigned char readOversampleBits(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
{
kNumAverageBitsElements = 8,
} tAverageBits_IfaceConstants;
virtual void writeAverageBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
virtual unsigned char readAverageBits(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
{
kNumScanListElements = 8,
} tScanList_IfaceConstants;
virtual void writeScanList(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
virtual unsigned char readScanList(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
{
} tLatchOutput_IfaceConstants;
virtual void strobeLatchOutput(tRioStatusCode *status) = 0;
typedef enum
{
} tReadSelect_IfaceConstants;
virtual void writeReadSelect(tReadSelect value, tRioStatusCode *status) = 0;
virtual void writeReadSelect_Channel(unsigned char value, tRioStatusCode *status) = 0;
virtual void writeReadSelect_Averaged(bool value, tRioStatusCode *status) = 0;
virtual tReadSelect readReadSelect(tRioStatusCode *status) = 0;
virtual unsigned char readReadSelect_Channel(tRioStatusCode *status) = 0;
virtual bool readReadSelect_Averaged(tRioStatusCode *status) = 0;
private:
tAI(const tAI&);
void operator=(const tAI&);
};
}
}
#endif // __nFRC_2016_16_1_0_AI_h__
|
//
// PFUpdateViewController.h
// RatreeSamosorn
//
// Created by Pariwat on 7/30/14.
// Copyright (c) 2014 platwofusion. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DLImageLoader.h"
#import "CRGradientNavigationBar.h"
#import "PFRatreeSamosornApi.h"
#import "PFUpdateCell.h"
#import "PFDetailViewController.h"
#import "PFActivityDetailViewController.h"
#import "PFLoginViewController.h"
#import "PFAccountViewController.h"
#import "PFNotificationViewController.h"
@protocol PFUpdateViewControllerDelegate <NSObject>
- (void)resetApp;
- (void)PFGalleryViewController:(id)sender sum:(NSMutableArray *)sum current:(NSString *)current;
- (void)PFImageViewController:(id)sender viewPicture:(NSString *)link;
- (void)HideTabbar;
- (void)ShowTabbar;
@end
@interface PFUpdateViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
@property (assign, nonatomic) id delegate;
@property (strong, nonatomic) PFRatreeSamosornApi *RatreeSamosornApi;
@property NSUserDefaults *feedOffline;
@property (strong, nonatomic) PFLoginViewController *loginView;
@property (strong, nonatomic) IBOutlet UIView *waitView;
@property (strong, nonatomic) IBOutlet UIView *popupwaitView;
@property (strong, nonatomic) IBOutlet UIView *NoInternetView;
@property (strong, nonatomic) NSString *checkinternet;
@property (strong, nonatomic) IBOutlet UIActivityIndicatorView *act;
@property (strong, nonatomic) IBOutlet UILabel *loadLabel;
@property (strong, nonatomic) IBOutlet UINavigationController *navController;
@property (strong, nonatomic) IBOutlet CRGradientNavigationBar *navBar;
@property (strong, nonatomic) IBOutlet UINavigationItem *navItem;
@property (strong, nonatomic) IBOutlet UITableView *tableView;
@property (strong, nonatomic) NSMutableArray *arrObj;
@property (strong, nonatomic) NSDictionary *obj;
@property (retain, nonatomic) NSString *paging;
@end
|
/*
* =====================================================================================
*
* Filename: contagem.c
*
* Description:
*
* Version: 1.0
* Created: 12-09-2015 06:26:19
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Organization:
*
* =====================================================================================
*/
#include <stdio.h>
int eh_permut(int num1,int num2)
{
while (num1 != 0 )
{
switch (conta_digitos(num2,num1 % 10))
{
case 1:
num1 = num1 / 10;
break;
default:
return 0;
}
}
return 1;
}
|
//
// AppDelegate.h
// resident
//
// Created by Xin Qin on 2/6/15.
// Copyright (c) 2015 Xin Qin. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
@end
@class TableViewCell;
@protocol TabelViewCellTouchUpInsideProtocol <NSObject>
@required
- (void)tabelViewCellTouchUpInside:(TableViewCell *)cell;
@end
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-CHROMIUM file.
#ifndef ELECTRON_SHELL_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
#define ELECTRON_SHELL_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
#include <string>
#include "base/memory/singleton.h"
#include "content/public/browser/media_observer.h"
#include "content/public/browser/media_stream_request.h"
#include "third_party/blink/public/common/mediastream/media_stream_request.h"
namespace electron {
// This singleton is used to receive updates about media events from the content
// layer.
class MediaCaptureDevicesDispatcher : public content::MediaObserver {
public:
static MediaCaptureDevicesDispatcher* GetInstance();
// Methods for observers. Called on UI thread.
const blink::MediaStreamDevices& GetAudioCaptureDevices();
const blink::MediaStreamDevices& GetVideoCaptureDevices();
// Helper to get the default devices which can be used by the media request.
// Uses the first available devices if the default devices are not available.
// If the return list is empty, it means there is no available device on the
// OS.
// Called on the UI thread.
void GetDefaultDevices(bool audio,
bool video,
blink::MediaStreamDevices* devices);
// Helpers for picking particular requested devices, identified by raw id.
// If the device requested is not available it will return NULL.
const blink::MediaStreamDevice* GetRequestedAudioDevice(
const std::string& requested_audio_device_id);
const blink::MediaStreamDevice* GetRequestedVideoDevice(
const std::string& requested_video_device_id);
// Returns the first available audio or video device, or NULL if no devices
// are available.
const blink::MediaStreamDevice* GetFirstAvailableAudioDevice();
const blink::MediaStreamDevice* GetFirstAvailableVideoDevice();
// Unittests that do not require actual device enumeration should call this
// API on the singleton. It is safe to call this multiple times on the
// singleton.
void DisableDeviceEnumerationForTesting();
// Overridden from content::MediaObserver:
void OnAudioCaptureDevicesChanged() override;
void OnVideoCaptureDevicesChanged() override;
void OnMediaRequestStateChanged(int render_process_id,
int render_view_id,
int page_request_id,
const GURL& security_origin,
blink::mojom::MediaStreamType stream_type,
content::MediaRequestState state) override;
void OnCreatingAudioStream(int render_process_id,
int render_view_id) override;
void OnSetCapturingLinkSecured(int render_process_id,
int render_frame_id,
int page_request_id,
blink::mojom::MediaStreamType stream_type,
bool is_secure) override;
// disable copy
MediaCaptureDevicesDispatcher(const MediaCaptureDevicesDispatcher&) = delete;
MediaCaptureDevicesDispatcher& operator=(
const MediaCaptureDevicesDispatcher&) = delete;
private:
friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;
MediaCaptureDevicesDispatcher();
~MediaCaptureDevicesDispatcher() override;
// Only for testing, a list of cached audio capture devices.
blink::MediaStreamDevices test_audio_devices_;
// Only for testing, a list of cached video capture devices.
blink::MediaStreamDevices test_video_devices_;
// Flag used by unittests to disable device enumeration.
bool is_device_enumeration_disabled_ = false;
};
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
|
/* block/gsl_block_float.h
*
* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough
*
* 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 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __GSL_BLOCK_FLOAT_H__
#define __GSL_BLOCK_FLOAT_H__
#if !defined( GSL_FUN )
# if !defined( GSL_DLL )
# define GSL_FUN extern
# elif defined( BUILD_GSL_DLL )
# define GSL_FUN extern __declspec(dllexport)
# else
# define GSL_FUN extern __declspec(dllimport)
# endif
#endif
#include <stdlib.h>
#include <gsl/gsl_errno.h>
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif
__BEGIN_DECLS
struct gsl_block_float_struct
{
size_t size;
float *data;
};
typedef struct gsl_block_float_struct gsl_block_float;
GSL_FUN gsl_block_float *gsl_block_float_alloc (const size_t n);
GSL_FUN gsl_block_float *gsl_block_float_calloc (const size_t n);
GSL_FUN void gsl_block_float_free (gsl_block_float * b);
GSL_FUN int gsl_block_float_fread (FILE * stream, gsl_block_float * b);
GSL_FUN int gsl_block_float_fwrite (FILE * stream, const gsl_block_float * b);
GSL_FUN int gsl_block_float_fscanf (FILE * stream, gsl_block_float * b);
GSL_FUN int gsl_block_float_fprintf (FILE * stream, const gsl_block_float * b, const char *format);
GSL_FUN int gsl_block_float_raw_fread (FILE * stream, float * b, const size_t n, const size_t stride);
GSL_FUN int gsl_block_float_raw_fwrite (FILE * stream, const float * b, const size_t n, const size_t stride);
GSL_FUN int gsl_block_float_raw_fscanf (FILE * stream, float * b, const size_t n, const size_t stride);
GSL_FUN int gsl_block_float_raw_fprintf (FILE * stream, const float * b, const size_t n, const size_t stride, const char *format);
GSL_FUN size_t gsl_block_float_size (const gsl_block_float * b);
GSL_FUN float * gsl_block_float_data (const gsl_block_float * b);
__END_DECLS
#endif /* __GSL_BLOCK_FLOAT_H__ */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.