text stringlengths 4 6.14k |
|---|
/*
* portable IEEE float/double read/write functions
*
* Copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file intfloat_readwrite.c
* Portable IEEE float/double read/write functions.
*/
#include "common.h"
#include "intfloat_readwrite.h"
double av_int2dbl(int64_t v){
if(v+v > 0xFFEULL<<52)
return NAN;
return ldexp(((v&((1LL<<52)-1)) + (1LL<<52)) * (v>>63|1), (v>>52&0x7FF)-1075);
}
float av_int2flt(int32_t v){
if(v+v > 0xFF000000U)
return NAN;
return ldexp(((v&0x7FFFFF) + (1<<23)) * (v>>31|1), (v>>23&0xFF)-150);
}
double av_ext2dbl(const AVExtFloat ext){
uint64_t m = 0;
int e, i;
for (i = 0; i < 8; i++)
m = (m<<8) + ext.mantissa[i];
e = (((int)ext.exponent[0]&0x7f)<<8) | ext.exponent[1];
if (e == 0x7fff && m)
return NAN;
e -= 16383 + 63; /* In IEEE 80 bits, the whole (i.e. 1.xxxx)
* mantissa bit is written as opposed to the
* single and double precision formats */
if (ext.exponent[0]&0x80)
m= -m;
return ldexp(m, e);
}
int64_t av_dbl2int(double d){
int e;
if ( !d) return 0;
else if(d-d) return 0x7FF0000000000000LL + ((int64_t)(d<0)<<63) + (d!=d);
d= frexp(d, &e);
return (int64_t)(d<0)<<63 | (e+1022LL)<<52 | (int64_t)((fabs(d)-0.5)*(1LL<<53));
}
int32_t av_flt2int(float d){
int e;
if ( !d) return 0;
else if(d-d) return 0x7F800000 + ((d<0)<<31) + (d!=d);
d= frexp(d, &e);
return (d<0)<<31 | (e+126)<<23 | (int64_t)((fabs(d)-0.5)*(1<<24));
}
AVExtFloat av_dbl2ext(double d){
struct AVExtFloat ext= {{0}};
int e, i; double f; uint64_t m;
f = fabs(frexp(d, &e));
if (f >= 0.5 && f < 1) {
e += 16382;
ext.exponent[0] = e>>8;
ext.exponent[1] = e;
m = (uint64_t)ldexp(f, 64);
for (i=0; i < 8; i++)
ext.mantissa[i] = m>>(56-(i<<3));
} else if (f != 0.0) {
ext.exponent[0] = 0x7f; ext.exponent[1] = 0xff;
if (f != INFINITY)
ext.mantissa[0] = ~0;
}
if (d < 0)
ext.exponent[0] |= 0x80;
return ext;
}
|
// Declare.h : 放置各种全局变量和跨文件函数声明
#pragma once
extern ProcArgs_t Args;
extern PrintMessage_t PrintMessage;
extern void PrintHelp();
extern void ProcessArgs(int, wchar_t*[]);
extern void ProcConversion();
|
#include "tlist.h"
#include <stdlib.h>
#include <string.h>
tlist* tlist_new(int size){
tlist* t=malloc(sizeof(tlist));
memset(t,0,sizeof(tlist));
return t;
}
void tlist_append(tlist* t,void* data,int size){
tlist* next=tlist_new(0);
tlist* pos=t;
while (pos && pos->next) {
pos=pos->next;
}
pos->data=malloc(size);
memcpy(pos->data,data,size);
pos->next=next;
}
int tlist_size(tlist* t){
int ret=0;
tlist* pos=t;
while (pos && pos->next && pos->data) {
pos=pos->next ;
ret++;
};
return ret;
}
void* tlist_pop(tlist* t,int at){
int ret=0;
tlist* pos=t;
/*if (pos && !pos->next ){
return pos->data;
}*/
while (pos && pos->next) {
if (ret==at){
tlist* n=pos->next;
pos->data=n->data;
pos->next=n->next;
return pos->data;
}
pos=pos->next ;
ret++;
};
return NULL;
}
void tlist_fini(tlist* list){
tlist* head=list;
while (head){
if (head->data) free(head->data);
tlist *del=head;
head=head->next;
free(del);
}
}
|
public:
virtual void iconify();
void _iconify();
virtual void deiconify();
void _deiconify();
virtual void show(FXuint placement);
void _show(FXuint placement);
|
#pragma once
#include <czmq.h>
/** Load a Configuration from a ZPL File
*
* Loads a configuration from a ZPL file. Does not affect the
* configuration stack.
*
* filename: a path to a filename containing valid ZPL data
*
* Returns: zconfig_t * on success, NULL on failure
*/
zconfig_t *
blackstrap_conf_load(const char *filename);
/** Load a Configuration from a YAML File
*
* Loads a configuration from a YAML file. Does not affect the
* configuration stack.
*
* filename: a path to a filename containing valid YAML data
*
* Returns: zconfig_t * on success, NULL on failure
*/
zconfig_t *
blackstrap_conf_load_yaml(const char *file_name);
/** Resolve a Configuration Path to a long int
*
* dest: pointer to long integer
* conf: zconfig_t *
* path: zconfig path, such as "network/bind"
*
* Returns: 0 on success, -1 if no match, -ERANGE on conversion failure
*/
int
blackstrap_conf_resolve_long(long *dest, zconfig_t *conf, const char *path);
/** Resolve a Configuration Path to a long int, with Default Value Fallback
*
* dest, conf, path: (see above)
* default_value: no-match fallback default
*
* Returns: 0 on success, -ERANGE on conversion failure
*/
int
blackstrap_conf_resolve_long_default(long *dest, zconfig_t *conf,
const char *path, long default_value);
|
/*
raw os - Copyright (C) Lingjun Chen(jorya_txj).
This file is part of raw os.
raw os is free software; you can redistribute it 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.
raw os 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 Lesser General Public License
along with this program. if not, write email to jorya.txj@gmail.com
---
A special exception to the LGPL can be applied should you wish to distribute
a combined work that includes raw os, without being obliged to provide
the source code for any proprietary components. See the file exception.txt
for full details of how and when the exception can be applied.
*/
/* 2012-4 Created by jorya_txj
* xxxxxx please added here
*/
#ifndef RAW_TASK_H
#define RAW_TASK_H
typedef void (*RAW_TASK_ENTRY)(void *p_arg);
RAW_OS_ERROR raw_task_create(RAW_TASK_OBJ *task_obj, RAW_U8 *task_name, void *task_arg,
RAW_U8 task_prio, RAW_U32 time_slice, PORT_STACK *task_stack_base,
RAW_U32 stack_size, RAW_TASK_ENTRY task_entry, RAW_U8 auto_start);
RAW_OS_ERROR raw_disable_sche(void);
RAW_OS_ERROR raw_enable_sche(void);
RAW_OS_ERROR raw_sleep(RAW_TICK_TYPE dly);
RAW_OS_ERROR raw_time_sleep(RAW_U16 hours, RAW_U16 minutes, RAW_U16 seconds, RAW_U32 milli);
#if (CONFIG_RAW_TASK_SUSPEND > 0)
RAW_OS_ERROR raw_task_suspend(RAW_TASK_OBJ *task_ptr);
RAW_OS_ERROR raw_task_resume(RAW_TASK_OBJ *task_ptr);
RAW_OS_ERROR task_suspend(RAW_TASK_OBJ *task_ptr);
RAW_OS_ERROR task_resume(RAW_TASK_OBJ *task_ptr);
#endif
#if (CONFIG_RAW_TASK_PRIORITY_CHANGE > 0)
RAW_OS_ERROR raw_task_priority_change (RAW_TASK_OBJ *task_ptr, RAW_U8 new_priority, RAW_U8 *old_priority);
#endif
#if (CONFIG_RAW_TASK_DELETE > 0)
RAW_OS_ERROR raw_task_delete(RAW_TASK_OBJ *task_ptr);
#endif
#if (CONFIG_RAW_TASK_WAIT_ABORT > 0)
RAW_OS_ERROR raw_task_wait_abort(RAW_TASK_OBJ *task_ptr);
#endif
#if (CONFIG_SCHED_FIFO_RR > 0)
RAW_OS_ERROR raw_task_time_slice_change(RAW_TASK_OBJ *task_ptr, RAW_U32 new_time_slice);
RAW_OS_ERROR raw_set_sched_way(RAW_TASK_OBJ *task_ptr, RAW_U8 policy);
RAW_OS_ERROR raw_get_sched_way(RAW_TASK_OBJ *task_ptr, RAW_U8 *policy_ptr);
#endif
RAW_TASK_OBJ *raw_task_identify(void);
#if (CONFIG_RAW_TASK_STACK_CHECK > 0)
RAW_OS_ERROR raw_task_stack_check(RAW_TASK_OBJ *task_obj, RAW_U32 *free_stack);
#endif
#if (CONFIG_USER_DATA_POINTER > 0)
void raw_set_task_user_point(RAW_TASK_OBJ *task_ptr, void *user_point, RAW_U32 point_position);
void *raw_get_task_user_point(RAW_TASK_OBJ *task_ptr, RAW_U32 point_position);
#endif
#if (CONFIG_RAW_DEBUG > 0)
RAW_OS_ERROR raw_iter_block_task(LIST *object_head, void (*debug_function)(RAW_TASK_OBJ *arg), RAW_U8 opt);
RAW_U32 raw_get_system_global_space(void);
#endif
#define RAW_TASK_AUTO_START 1
#define RAW_TASK_DONT_START 0
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_UNTAGRESOURCEREQUEST_H
#define QTAWS_UNTAGRESOURCEREQUEST_H
#include "greengrassv2request.h"
namespace QtAws {
namespace GreengrassV2 {
class UntagResourceRequestPrivate;
class QTAWSGREENGRASSV2_EXPORT UntagResourceRequest : public GreengrassV2Request {
public:
UntagResourceRequest(const UntagResourceRequest &other);
UntagResourceRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(UntagResourceRequest)
};
} // namespace GreengrassV2
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_CREATEGRANTVERSIONRESPONSE_H
#define QTAWS_CREATEGRANTVERSIONRESPONSE_H
#include "licensemanagerresponse.h"
#include "creategrantversionrequest.h"
namespace QtAws {
namespace LicenseManager {
class CreateGrantVersionResponsePrivate;
class QTAWSLICENSEMANAGER_EXPORT CreateGrantVersionResponse : public LicenseManagerResponse {
Q_OBJECT
public:
CreateGrantVersionResponse(const CreateGrantVersionRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const CreateGrantVersionRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(CreateGrantVersionResponse)
Q_DISABLE_COPY(CreateGrantVersionResponse)
};
} // namespace LicenseManager
} // namespace QtAws
#endif
|
/*
* @BEGIN LICENSE
*
* Psi4: an open-source quantum chemistry software package
*
* Copyright (c) 2007-2017 The Psi4 Developers.
*
* The copyrights for code used from other parties are included in
* the corresponding files.
*
* This file is part of Psi4.
*
* Psi4 is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3.
*
* Psi4 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with Psi4; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* @END LICENSE
*/
#ifndef _psi_src_bin_occ_dpd_h_
#define _psi_src_bin_occ_dpd_h_
using namespace psi;
namespace psi{ namespace occwave{
class SymBlockVector;
class SymBlockMatrix
{
private:
double ***matrix_; // Object
int *rowspi_; // Rows per irrep
int *colspi_; // Columns per irrep
std::string name_; // Name of the matrix
int nirreps_; // Number of irreps
public:
SymBlockMatrix(); //default constructer
SymBlockMatrix(std::string name);
SymBlockMatrix(int nirreps, int *ins_rowspi, int *ins_colspi);
SymBlockMatrix(std::string name, int nirreps, int *ins_rowspi, int *ins_colspi);
~SymBlockMatrix(); //destructer
SymBlockMatrix* generate(int nirreps, int *ins_rowspi, int *ins_colspi);
SymBlockMatrix* generate(std::string name, int nirreps, int *ins_rowspi, int *ins_colspi);
SymBlockMatrix* transpose();
void init(std::string name, int nirreps, int *ins_rowspi, int *ins_colspi);
void memalloc();
void release();
void zero();
void zero_diagonal();
double trace();
SymBlockMatrix* transpose(int *ins_rowspi, int *ins_colspi);
void copy(const SymBlockMatrix* Adum);
void add(const SymBlockMatrix* Adum);
void add(int h, int i, int j, double value);
void subtract(const SymBlockMatrix* Adum);
void subtract(int h, int i, int j, double value);
void scale(double a);
void scale_row(int h, int m, double a);
void scale_column(int h, int n, double a);
double sum_of_squares();
double rms();
double rms(SymBlockMatrix* Atemp);
void set(double value);
void set(int h, int i, int j, double value);
void set(double **Asq);
void set(dpdbuf4 G);
double get(int h, int m, int n);
double *to_lower_triangle();
double **to_block_matrix();
void print(std::string out_fname);
void print();
void set_to_identity();
void gemm(bool transa, bool transb, double alpha, const SymBlockMatrix* a, const SymBlockMatrix* b, double beta);
int *rowspi();
int *colspi();
bool load(PSIO* psio, int itap, const char *label, int dim);
bool load(std::shared_ptr<psi::PSIO> psio, int itap, const char *label, int dim);
void write(PSIO* psio, int itap, bool saveSubBlocks);
void write(std::shared_ptr<psi::PSIO> psio, int itap, bool saveSubBlocks);
void read(std::shared_ptr<psi::PSIO> psio, int itap, bool readSubBlocks);
void read(std::shared_ptr<psi::PSIO> psio, int itap, const char *label, bool readSubBlocks);
void mgs();// Modified Gram-Schmidt
void gs();// Gram-Schmidt
void diagonalize(SymBlockMatrix* eigvectors, SymBlockVector* eigvalues);
void cdsyev(char jobz, char uplo, SymBlockMatrix* eigvectors, SymBlockVector* eigvalues); // diagonalize via acml
void davidson(int n_eigval, SymBlockMatrix* eigvectors, SymBlockVector* eigvalues, double cutoff, int print); // diagonalize via davidson alg.
void cdgesv(SymBlockVector* Xvec); // solve lineq via acml
void lineq_flin(SymBlockVector* Xvec, double *det); // solve lineq via flin
void lineq_pople(SymBlockVector* Xvec, int num_vecs, double cutoff); // solve lineq via pople
void read_oooo(std::shared_ptr<psi::PSIO> psio, int itap, int *mosym, int *qt2pitzer, int *occ_off, int *occpi, Array3i *oo_pairidx);
void read_oovv(std::shared_ptr<psi::PSIO> psio, int itap, int nocc, int *mosym, int *qt2pitzer, int *occ_off, int *vir_off, int *occpi,
int *virpi, Array3i *oo_pairidx, Array3i *vv_pairidx);
friend class SymBlockVector;
};
class SymBlockVector
{
private:
double **vector_; // Object
int *dimvec_; // dimensions per irrep
std::string name_; // Name of the vector
int nirreps_; // Number of irreps
public:
SymBlockVector(); //default constructer
SymBlockVector(std::string name);
SymBlockVector(int nirreps, int *ins_dimvec);
SymBlockVector(std::string name, int nirreps, int *ins_dimvec);
~SymBlockVector(); //destructer
int *dimvec();
void memalloc();
void release();
void zero();
double trace();
void copy(const SymBlockVector* Adum);
void add(const SymBlockVector* Adum);
void add(int h, int i, double value);
void subtract(const SymBlockVector* Adum);
void subtract(int h, int i, double value);
void scale(double a);
double sum_of_squares();
double rms();
double rms(SymBlockVector* Atemp);
double norm();
void set(double value);
void set(int h, int i, double value);
void set(double *Avec);
double get(int h, int m);
double *to_vector();
void print(std::string out_fname);
void print();
void set_to_unit();
void gemv(bool transa, double alpha, SymBlockMatrix* A, SymBlockVector* X, double beta);
double dot(SymBlockVector* X);
friend class SymBlockMatrix;
};
}} // End Namespaces
#endif // _psi_src_bin_occ_dpd_h_
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GLACIERCLIENT_P_H
#define QTAWS_GLACIERCLIENT_P_H
#include "core/awsabstractclient_p.h"
class QNetworkAccessManager;
namespace QtAws {
namespace Glacier {
class GlacierClient;
class GlacierClientPrivate : public QtAws::Core::AwsAbstractClientPrivate {
public:
explicit GlacierClientPrivate(GlacierClient * const q);
private:
Q_DECLARE_PUBLIC(GlacierClient)
Q_DISABLE_COPY(GlacierClientPrivate)
};
} // namespace Glacier
} // namespace QtAws
#endif
|
// Created file "Lib\src\Uuid\X64\oledbdat"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(DBOBJECT_TRANSLATION, 0xc8b522ee, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
|
#ifndef _READ_H5ATTRS_H_
#define _READ_H5ATTRS_H_
#include <hdf5.h>
int read_h5attrs(hid_t, char*, char*, ...);
#endif /* _READ_H5ATTRS_H_ */
|
// Created file "Lib\src\dxguid\X64\d3d10guid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_BATTERY_DISCHARGE_FLAGS_1, 0xbcded951, 0x187b, 0x4d05, 0xbc, 0xcc, 0xf7, 0xe5, 0x19, 0x60, 0xc2, 0x58);
|
#ifndef OUTPUTPOINTS_H
#define OUTPUTPOINTS_H
#ifndef GIS_H
#include "gis.h"
#endif
#include <QString>
class Crit3DOutputPoint : public gis::Crit3DPoint
{
public:
Crit3DOutputPoint();
std::string id;
double latitude;
double longitude;
bool active;
bool selected;
float currentValue;
void initialize(const std::string& _id, bool isActive, double _latitude, double _longitude,
double _z, int zoneNumber);
};
bool importOutputPointsCsv(QString csvFileName, QList<QList<QString>> &data, QString &errorString);
bool loadOutputPointListCsv(QString csvFileName, std::vector<Crit3DOutputPoint> &outputPointList,
int utmZone, QString &errorString);
bool writeOutputPointListCsv(QString csvFileName, std::vector<Crit3DOutputPoint> &outputPointList, QString &errorString);
#endif // OUTPUTPOINTS_H
|
// Created file "Lib\src\Uuid\X64\d2d1iid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_ID2D1PathGeometry, 0x2cd906a5, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9);
|
/*
* This file is part of matrix-glib-sdk
*
* matrix-glib-sdk is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* matrix-glib-sdk is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with matrix-glib-sdk. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef __MATRIX_GLIB_SDK_UTILS_H__
# define __MATRIX_GLIB_SDK_UTILS_H__
# include <glib-object.h>
# include <json-glib/json-glib.h>
G_BEGIN_DECLS
gchar *_matrix_g_enum_to_string(GType enum_type, gint value, gchar convert_dashes);
gint _matrix_g_enum_nick_to_value(GType enum_type, const gchar *nick, GError **error);
JsonNode *_matrix_json_node_deep_copy(JsonNode *node);
G_END_DECLS
#endif /* __MATRIX_GLIB_SDK_UTILS_H__ */
|
/*
* Copyright (c) 2011, The Iconfactory. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of The Iconfactory nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE ICONFACTORY BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <UIKit/UIView.h>
#import <UIKit/UIInterface.h>
@interface UIToolbar : UIView {
@private
UIBarStyle _barStyle;
UIColor *_tintColor;
NSMutableArray *_toolbarItems;
BOOL _translucent;
}
- (void)setItems:(NSArray *)items animated:(BOOL)animated;
@property (nonatomic) UIBarStyle barStyle;
@property (nonatomic, retain) UIColor *tintColor;
@property (nonatomic, copy) NSArray *items;
@property (nonatomic,assign,getter=isTranslucent) BOOL translucent;
@end
|
/*
* This file is part of the TREZOR project.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __STELLAR_H__
#define __STELLAR_H__
#include <stdbool.h>
#include "bip32.h"
#include "crypto.h"
#include "messages.pb.h"
#include "fsm.h"
typedef struct {
// BIP32 path to the address being used for signing
uint32_t address_n[10];
size_t address_n_count;
uint8_t signing_pubkey[32];
// 1 - public network, 2 - official testnet, 3 - other private network
uint8_t network_type;
// Total number of operations expected
uint8_t num_operations;
// Number that have been confirmed by the user
uint8_t confirmed_operations;
// sha256 context that will eventually be signed
SHA256_CTX sha256_ctx;
} StellarTransaction;
// Signing process
void stellar_signingInit(StellarSignTx *tx);
void stellar_signingAbort(void);
void stellar_confirmCreateAccountOp(StellarCreateAccountOp *msg);
void stellar_confirmPaymentOp(StellarPaymentOp *msg);
void stellar_confirmPathPaymentOp(StellarPathPaymentOp *msg);
void stellar_confirmManageOfferOp(StellarManageOfferOp *msg);
void stellar_confirmCreatePassiveOfferOp(StellarCreatePassiveOfferOp *msg);
void stellar_confirmSetOptionsOp(StellarSetOptionsOp *msg);
void stellar_confirmChangeTrustOp(StellarChangeTrustOp *msg);
void stellar_confirmAllowTrustOp(StellarAllowTrustOp *msg);
void stellar_confirmAccountMergeOp(StellarAccountMergeOp *msg);
void stellar_confirmManageDataOp(StellarManageDataOp *msg);
void stellar_confirmBumpSequenceOp(StellarBumpSequenceOp *msg);
void stellar_confirmSignString(StellarSignMessage *msg, StellarMessageSignature *resp);
void stellar_signString(const uint8_t *str_to_sign, uint32_t *address_n, size_t address_n_count, uint8_t *out_signature);
bool stellar_verifySignature(StellarVerifyMessage *msg);
// Layout
void stellar_layoutGetPublicKey(uint32_t *address_n, size_t address_n_count);
void stellar_layoutTransactionDialog(const char *line1, const char *line2, const char *line3, const char *line4, const char *line5);
void stellar_layoutTransactionSummary(StellarSignTx *msg);
void stellar_layoutSigningDialog(const char *line1, const char *line2, const char *line3, const char *line4, const char *line5, uint32_t *address_n, size_t address_n_count, const char *warning, bool is_final_step);
// Helpers
HDNode *stellar_deriveNode(uint32_t *address_n, size_t address_n_count);
size_t stellar_publicAddressAsStr(uint8_t *bytes, char *out, size_t outlen);
const char **stellar_lineBreakAddress(uint8_t *addrbytes);
void stellar_getPubkeyAtAddress(uint32_t *address_n, size_t address_n_count, uint8_t *out, size_t outlen);
void stellar_hashupdate_uint32(uint32_t value);
void stellar_hashupdate_uint64(uint64_t value);
void stellar_hashupdate_bool(bool value);
void stellar_hashupdate_string(uint8_t *data, size_t len);
void stellar_hashupdate_address(uint8_t *address_bytes);
void stellar_hashupdate_asset(StellarAssetType *asset);
void stellar_hashupdate_bytes(uint8_t *data, size_t len);
StellarTransaction *stellar_getActiveTx(void);
void stellar_fillSignedTx(StellarSignedTx *resp);
uint8_t stellar_allOperationsConfirmed(void);
void stellar_getSignatureForActiveTx(uint8_t *out_signature);
void stellar_format_uint32(uint32_t number, char *out, size_t outlen);
void stellar_format_uint64(uint64_t number, char *out, size_t outlen);
void stellar_format_stroops(uint64_t number, char *out, size_t outlen);
void stellar_format_asset(StellarAssetType *asset, char *str_formatted, size_t len);
void stellar_format_price(uint32_t numerator, uint32_t denominator, char *out, size_t outlen);
uint16_t stellar_crc16(uint8_t *bytes, uint32_t length);
#endif |
/*
VS1053.h -- Library for vs1053 sound chip
Copyright (c) 2015-2016 ARESPNO.
*/
#ifndef _VS1053_H
#define _VS1053_H
#include "Arduino.h"
#define VS_WRITE_COMMAND 0x02
#define VS_READ_COMMAND 0x03
//VS1053 register
#define SCI_MODE 0x00
#define SCI_STATUS 0x01
#define SCI_BASS 0x02
#define SCI_CLOCKF 0x03
#define SCI_DECODE_TIME 0x04
#define SCI_AUDATA 0x05
#define SCI_WRAM 0x06
#define SCI_WRAMADDR 0x07
#define SCI_HDAT0 0x08
#define SCI_HDAT1 0x09
#define SCI_AIADDR 0x0A
#define SCI_VOL 0x0B
#define SCI_AICTRL0 0x0C
#define SCI_AICTRL1 0x0D
#define SCI_AICTRL2 0x0E
#define SCI_AICTRL3 0x0F
#define SM_DIFF 0x01
#define SM_LAYER12 0x02
#define SM_RESET 0x04
#define SM_CANCEL 0x08
#define SM_EARSPEAKER_LO 0x10
#define SM_TESTS 0x20
#define SM_STREAM 0x40
#define SM_EARSPEAKER_HI 0x80
#define SM_DACT 0x100
#define SM_SDIORD 0x200
#define SM_SDISHARE 0x400
#define SM_SDINEW 0x800
#define SM_ADPCM 0x1000
#define SM_NONE 0x2000
#define SM_LINE1 0x4000
#define SM_CLK_RANGE 0x8000
class VS1053 {
public:
VS1053();
void begin(int xcs, int xdcs, int xreset, int dreq);
// Set vs1053 xcs, xdcs, xreset, dreq pin.
uint16_t sciRead(uint8_t reg); // read from register
void sciWrite(uint8_t reg, uint16_t val); // write to register
uint16_t sdiWrite(uint8_t *buf, uint16_t len);
// write data
void setVolume(uint16_t vol) { _vol = vol; sciWrite(SCI_VOL, _vol); }
void loadPatch(const uint16_t *buf, uint16_t len);
void softReset();
void initRecord(uint16_t samplerate = 8000); // Initialize register for recording.
void finishRecord(); // Restore register when finished recording.
private:
uint8_t _waitDreq(); // wait for dreq raised
int _xcs; // xcs pin
int _xdcs; // xcs pin
int _xreset; // xcs pin
int _dreq; // dreq pin
uint16_t _vol; // volume, maximum is 0, minimum is 0xfefe
};
extern VS1053 VSSound;
#endif // _VS1053_H
|
// Created file "Lib\src\Uuid\functiondiscovery"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(PKEY_Device_SafeRemovalRequired, 0xafd97640, 0x86a3, 0x4210, 0xb6, 0x7c, 0x28, 0x9c, 0x41, 0xaa, 0xbe, 0x55);
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_UPDATESOURCELOCATIONREQUEST_H
#define QTAWS_UPDATESOURCELOCATIONREQUEST_H
#include "mediatailorrequest.h"
namespace QtAws {
namespace MediaTailor {
class UpdateSourceLocationRequestPrivate;
class QTAWSMEDIATAILOR_EXPORT UpdateSourceLocationRequest : public MediaTailorRequest {
public:
UpdateSourceLocationRequest(const UpdateSourceLocationRequest &other);
UpdateSourceLocationRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(UpdateSourceLocationRequest)
};
} // namespace MediaTailor
} // namespace QtAws
#endif
|
/*
* Definitions to silence compiler warnings about unused function attributes/parameters.
*
* Copyright (C) 2008-2022, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined( _LIBOLECF_UNUSED_H )
#define _LIBOLECF_UNUSED_H
#include <common.h>
#if !defined( LIBOLECF_ATTRIBUTE_UNUSED )
#if defined( __GNUC__ ) && __GNUC__ >= 3
#define LIBOLECF_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#else
#define LIBOLECF_ATTRIBUTE_UNUSED
#endif
#endif
#if defined( _MSC_VER )
#define LIBOLECF_UNREFERENCED_PARAMETER( parameter ) \
UNREFERENCED_PARAMETER( parameter );
#else
#define LIBOLECF_UNREFERENCED_PARAMETER( parameter ) \
/* parameter */
#endif
#endif /* !defined( _LIBOLECF_UNUSED_H ) */
|
// Created file "Lib\src\sensorsapi\X64\sensorsapi"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_PROCESSOR_PERF_BOOST_POLICY, 0x45bcc044, 0xd885, 0x43e2, 0x86, 0x05, 0xee, 0x0e, 0xc6, 0xe9, 0x6b, 0x59);
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GETTAGSRESPONSE_P_H
#define QTAWS_GETTAGSRESPONSE_P_H
#include "costexplorerresponse_p.h"
namespace QtAws {
namespace CostExplorer {
class GetTagsResponse;
class GetTagsResponsePrivate : public CostExplorerResponsePrivate {
public:
explicit GetTagsResponsePrivate(GetTagsResponse * const q);
void parseGetTagsResponse(QXmlStreamReader &xml);
private:
Q_DECLARE_PUBLIC(GetTagsResponse)
Q_DISABLE_COPY(GetTagsResponsePrivate)
};
} // namespace CostExplorer
} // namespace QtAws
#endif
|
/* radare - LGPL - 2015-2018 - a0rtega */
#include <r_types.h>
#include <r_util.h>
#include <r_lib.h>
#include <r_bin.h>
#include <string.h>
#include "../format/nin/nds.h"
static struct nds_hdr loaded_header;
static bool check_bytes(const ut8 *buf, ut64 length) {
ut8 ninlogohead[6];
if (!buf || length < sizeof(struct nds_hdr)) { /* header size */
return false;
}
memcpy (ninlogohead, buf + 0xc0, 6);
/* begin of nintendo logo = \x24\xff\xae\x51\x69\x9a */
return (!memcmp (ninlogohead, "\x24\xff\xae\x51\x69\x9a", 6))? true: false;
}
static void *load_bytes(RBinFile *bf, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb) {
return memcpy (&loaded_header, buf, sizeof(struct nds_hdr));
}
static bool load(RBinFile *bf) {
const ut8 *bytes = bf? r_buf_buffer (bf->buf): NULL;
ut64 sz = bf? r_buf_size (bf->buf): 0;
if (!bf || !bf->o) {
return false;
}
bf->o->bin_obj = load_bytes (bf, bytes, sz, bf->o->loadaddr, bf->sdb);
return check_bytes (bytes, sz);
}
static int destroy(RBinFile *bf) {
r_buf_free (bf->buf);
bf->buf = NULL;
return true;
}
static ut64 baddr(RBinFile *bf) {
return (ut64) loaded_header.arm9_ram_address;
}
static ut64 boffset(RBinFile *bf) {
return 0LL;
}
static RList *sections(RBinFile *bf) {
RList *ret = NULL;
RBinSection *ptr9 = NULL, *ptr7 = NULL;
if (!(ret = r_list_new ())) {
return NULL;
}
if (!(ptr9 = R_NEW0 (RBinSection))) {
r_list_free (ret);
return NULL;
}
if (!(ptr7 = R_NEW0 (RBinSection))) {
r_list_free (ret);
free (ptr9);
return NULL;
}
strcpy (ptr9->name, "arm9");
ptr9->size = loaded_header.arm9_size;
ptr9->vsize = loaded_header.arm9_size;
ptr9->paddr = loaded_header.arm9_rom_offset;
ptr9->vaddr = loaded_header.arm9_ram_address;
ptr9->srwx = r_str_rwx ("rwx");
ptr9->add = true;
r_list_append (ret, ptr9);
strcpy (ptr7->name, "arm7");
ptr7->size = loaded_header.arm7_size;
ptr7->vsize = loaded_header.arm7_size;
ptr7->paddr = loaded_header.arm7_rom_offset;
ptr7->vaddr = loaded_header.arm7_ram_address;
ptr7->srwx = r_str_rwx ("rwx");
ptr7->add = true;
r_list_append (ret, ptr7);
return ret;
}
static RList *entries(RBinFile *bf) {
RList *ret = r_list_new ();
RBinAddr *ptr9 = NULL, *ptr7 = NULL;
if (bf && bf->buf) {
if (!ret) {
return NULL;
}
ret->free = free;
if (!(ptr9 = R_NEW0 (RBinAddr))) {
r_list_free (ret);
return NULL;
}
if (!(ptr7 = R_NEW0 (RBinAddr))) {
r_list_free (ret);
free (ptr9);
return NULL;
}
/* ARM9 entry point */
ptr9->vaddr = loaded_header.arm9_entry_address;
// ptr9->paddr = loaded_header.arm9_entry_address;
r_list_append (ret, ptr9);
/* ARM7 entry point */
ptr7->vaddr = loaded_header.arm7_entry_address;
// ptr7->paddr = loaded_header.arm7_entry_address;
r_list_append (ret, ptr7);
}
return ret;
}
static RBinInfo *info(RBinFile *bf) {
RBinInfo *ret = R_NEW0 (RBinInfo);
if (!ret) {
return NULL;
}
if (!bf || !bf->buf) {
free (ret);
return NULL;
}
char *filepath = r_str_newf ("%.12s - %.4s",
loaded_header.title, loaded_header.gamecode);
ret->file = filepath;
ret->type = strdup ("ROM");
ret->machine = strdup ("Nintendo DS");
ret->os = strdup ("nds");
ret->arch = strdup ("arm");
ret->has_va = true;
ret->bits = 32;
return ret;
}
RBinPlugin r_bin_plugin_ninds = {
.name = "ninds",
.desc = "Nintendo DS format r_bin plugin",
.license = "LGPL3",
.load = &load,
.load_bytes = &load_bytes,
.destroy = &destroy,
.check_bytes = &check_bytes,
.baddr = &baddr,
.boffset = &boffset,
.entries = &entries,
.sections = §ions,
.info = &info,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_BIN,
.data = &r_bin_plugin_ninds,
.version = R2_VERSION
};
#endif
|
// Created file "Lib\src\dxguid\X64\dxguid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
/** @defgroup ntp Network Time Protocol client
* @brief Provides NTP client
* @ingroup datetime
* @ingroup udp
* @{
*/
#ifndef APP_NTPCLIENT_H_
#define APP_NTPCLIENT_H_
#include "UdpConnection.h"
#include "../Platform/System.h"
#include "../Timer.h"
#include "../SystemClock.h"
#include "../Platform/Station.h"
#include "../Delegate.h"
#define NTP_PORT 123
#define NTP_PACKET_SIZE 48
#define NTP_VERSION 4
#define NTP_MODE_CLIENT 3
#define NTP_MODE_SERVER 4
#define NTP_DEFAULT_SERVER "pool.ntp.org"
#define NTP_DEFAULT_QUERY_INTERVAL_SECONDS 600 // 10 minutes
#define NTP_RESPONSE_TIMEOUT_MS 20000 // 20 seconds
class NtpClient;
// Delegate constructor usage: (&YourClass::method, this)
typedef Delegate<void(NtpClient& client, time_t ntpTime)> NtpTimeResultDelegate;
/** @brief NTP client class */
class NtpClient : protected UdpConnection
{
public:
/** @brief Instantiates NTP client object
*/
NtpClient();
/** @brief Instantiates NTP client object
* @param onTimeReceivedCb Callback delegate to be called when NTP time result is received
*/
NtpClient(NtpTimeResultDelegate onTimeReceivedCb);
/** @brief Instantiates NTP client object
* @param reqServer IP address or hostname of NTP server
* @param reqIntervalSeconds Quantity of seconds between NTP requests
* @param onTimeReceivedCb Callback delegate to be called when NTP time result is received (Default: None)
*/
NtpClient(String reqServer, int reqIntervalSeconds, NtpTimeResultDelegate onTimeReceivedCb = nullptr);
virtual ~NtpClient();
/** @brief Request time from NTP server
* @note Instigates request. Result is handled by NTP result handler function if defined
*/
void requestTime();
/** @brief Set the NTP server
* @param server IP address or hostname of NTP server
*/
void setNtpServer(String server);
/** @brief Enable / disable periodic query
* @param autoQuery True to enable periodic query of NTP server
*/
void setAutoQuery(bool autoQuery);
/** @brief Set query period
* @param seconds Period in seconds between periodic queries
*/
void setAutoQueryInterval(int seconds);
/** @brief Enable / disable update of system clock
* @param autoUpdateClock True to update system clock with NTP result.
*/
void setAutoUpdateSystemClock(bool autoUpdateClock);
protected:
/** @brief Handle UDP message reception
* @param buf Pointer to data buffer containing UDP payload
* @param remoteIP IP address of remote host
* @param remotePort Port number of remote host
*/
void onReceive(pbuf* buf, IPAddress remoteIP, uint16_t remotePort);
/** @brief Send time request to NTP server
* @param serverIp IP address of NTP server
*/
void internalRequestTime(IPAddress serverIp);
protected:
String server = NTP_DEFAULT_SERVER; ///< IP address or Hostname of NTP server
NtpTimeResultDelegate delegateCompleted = nullptr; ///< NTP result handler delegate
bool autoUpdateSystemClock = false; ///< True to update system clock with NTP time
Timer autoUpdateTimer; ///< Periodic query timer
Timer timeoutTimer; ///< NTP message timeout timer
Timer connectionTimer; ///< Wait for WiFi connection timer
/** @brief Handle DNS response
* @param name Pointer to c-string containing hostname
* @param ip Ponter to IP address
* @param arg Pointer to the NTP client object that made the DNS request
* @note This function is called when a DNS query is serviced
*/
static void staticDnsResponse(const char* name, LWIP_IP_ADDR_T* ip, void* arg);
};
/** @} */
#endif /* APP_NTPCLIENT_H_ */
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTINDEXRESPONSE_P_H
#define QTAWS_LISTINDEXRESPONSE_P_H
#include "clouddirectoryresponse_p.h"
namespace QtAws {
namespace CloudDirectory {
class ListIndexResponse;
class ListIndexResponsePrivate : public CloudDirectoryResponsePrivate {
public:
explicit ListIndexResponsePrivate(ListIndexResponse * const q);
void parseListIndexResponse(QXmlStreamReader &xml);
private:
Q_DECLARE_PUBLIC(ListIndexResponse)
Q_DISABLE_COPY(ListIndexResponsePrivate)
};
} // namespace CloudDirectory
} // namespace QtAws
#endif
|
/*
spindle_control.c - spindle control methods
Part of Grbl
Copyright (c) 2009-2011 Simen Svale Skogsrud
Grbl 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.
Grbl 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 Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#include "spindle_control.h"
#include "settings.h"
#include "config.h"
#include "stepper.h"
#include <avr/io.h>
static int current_direction;
void spindle_init()
{
spindle_run(0, 0);
}
void spindle_run(int direction, uint32_t rpm)
{
if (direction != current_direction) {
st_synchronize();
if(direction) {
if(direction > 0) {
SPINDLE_DIRECTION_PORT &= ~(1<<SPINDLE_DIRECTION_BIT);
} else {
SPINDLE_DIRECTION_PORT |= 1<<SPINDLE_DIRECTION_BIT;
}
SPINDLE_ENABLE_PORT |= 1<<SPINDLE_ENABLE_BIT;
} else {
SPINDLE_ENABLE_PORT &= ~(1<<SPINDLE_ENABLE_BIT);
}
current_direction = direction;
}
}
void spindle_stop()
{
spindle_run(0, 0);
}
|
//dcblock.c:
/*
* Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2010
*
* This file is part of libroardsp a part of RoarAudio,
* a cross-platform sound system for both, home and professional use.
* See README for details.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3
* as published by the Free Software Foundation.
*
* libroardsp 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "libroardsp.h"
int roardsp_dcblock_init (struct roardsp_filter * filter, struct roar_stream * stream, int id) {
struct roardsp_dcblock * inst = roar_mm_malloc(sizeof(struct roardsp_dcblock));
// roardsp_downmix_ctl(filter, ROARDSP_FCTL_MODE, &mode);
if ( inst == NULL ) {
ROAR_ERR("roardsp_dcblock_init(*): Can not alloc memory for filter dcblock: %s", strerror(errno));
filter->inst = NULL;
return -1;
}
memset(inst, 0, sizeof(struct roardsp_dcblock));
filter->inst = inst;
return 0;
}
int roardsp_dcblock_uninit (struct roardsp_filter * filter) {
if ( filter == NULL )
return -1;
if ( filter->inst == NULL )
return -1;
roar_mm_free(filter->inst);
return 0;
}
int roardsp_dcblock_reset (struct roardsp_filter * filter, int what) {
if ( filter == NULL )
return -1;
if ( filter->inst == NULL )
return -1;
ROAR_DBG("roardsp_dcblock_reset(filter=%p, what=%i) = ?", filter, what);
switch (what) {
case ROARDSP_RESET_NONE:
return 0;
break;
case ROARDSP_RESET_FULL:
memset(filter->inst, 0, sizeof(struct roardsp_dcblock));
return 0;
break;
case ROARDSP_RESET_STATE:
memset(((struct roardsp_dcblock*)filter->inst)->dc, 0, sizeof(int32_t)*ROARDSP_DCBLOCK_NUMBLOCKS);
((struct roardsp_dcblock*)filter->inst)->cur = 0;
return 0;
break;
default:
return -1;
}
return -1;
}
int roardsp_dcblock_calc16 (struct roardsp_filter * filter, void * data, size_t samples) {
struct roardsp_dcblock * inst = filter->inst;
int16_t * samp = (int16_t *) data;
register int64_t s = 0;
size_t i;
for (i = 0; i < samples; i++) {
// ROAR_WARN("roardsp_dcblock_calc16(*): s=%i, samp[i=%i]=%i", s, i, samp[i]);
s += samp[i];
}
ROAR_DBG("roardsp_dcblock_calc16(*): s=%i (current block of %i samples)", s, samples);
s = (float)(s / samples);
ROAR_DBG("roardsp_dcblock_calc16(*): inst=%p, inst->cur=%i", inst, inst->cur);
inst->dc[(inst->cur)++] = s;
if ( inst->cur == ROARDSP_DCBLOCK_NUMBLOCKS )
inst->cur = 0;
s = 0;
for (i = 0; i < ROARDSP_DCBLOCK_NUMBLOCKS; i++)
s += inst->dc[i];
s /= ROARDSP_DCBLOCK_NUMBLOCKS;
// s += (ROAR_INSTINT)filter->inst;
ROAR_DBG("roardsp_dcblock_calc16(*): new DC value: %i", s);
for (i = 0; i < samples; i++)
samp[i] -= s;
ROAR_DBG("roardsp_downmix_calc16(*) = 0");
return 0;
}
//ll
|
/**
* @file httpresponse.h
* @brief Class to handle a response to an HTTP request
*
* @author Saint-Genest Gwenael <gwen@cowlab.fr>
* @copyright Cowlab (c) 2017
*
* @par Warning
* CF71 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* version 3 as published by the Free Software Foundation. You
* should have received a copy of the GNU Lesser General Public
* License along with this program, see LICENSE file for more details.
* This program is distributed WITHOUT ANY WARRANTY see README file.
*/
#ifndef HTTPRESPONSE_H
#define HTTPRESPONSE_H
#include <QMap>
#include <QString>
class QTcpSocket;
class httpContent;
/**
* @class httpResponse
* @brief This class is used to handle a response to an HTTP request
*
*/
class httpResponse
{
public:
httpResponse();
~httpResponse();
httpContent *getContent(void);
void insertHeader(const QString &name, const QString &value);
void send(QTcpSocket *sock);
void setContent(httpContent *content);
void setContentType(const QString &type);
void setStatusCode(int code);
private:
int mRetCode;
QString mContentType;
httpContent *mContent;
QMap<QString,QString> mHeaders;
};
#endif // HTTPRESPONSE_H
|
/*+@@file@@----------------------------------------------------------------*//*!
\file GdiPlusTypes.h
\par Description
Extension and update of headers for PellesC compiler suite.
\par Project:
PellesC Headers extension
\date Created on Sun Jul 17 15:37:01 2016
\date Modified on Sun Jul 17 15:37:01 2016
\author frankie
\*//*-@@file@@----------------------------------------------------------------*/
#ifndef _GDIPLUS_H
#define _GDIPLUS_H
#if __POCC__ >= 500
#pragma once
#endif
#include <fGdiPlusFlat.h>
#endif
|
// Created file "Lib\src\Svcguid\X64\iid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(CLSID_CEventClass, 0xcdbec9c0, 0x7a68, 0x11d1, 0x88, 0xf9, 0x00, 0x80, 0xc7, 0xd7, 0x71, 0xbf);
|
#ifndef INCLUDE_OPTIONS_PARSER_H_
#define INCLUDE_OPTIONS_PARSER_H_
#include <boost/program_options.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
#include <fstream>
#include <iostream>
#include "../include/asltgv2recon4d.h"
#include "../include/ictgv2.h"
#include "../include/ictv.h"
#include "../include/tgv2.h"
#include "../include/tgv2_3d.h"
#include "../include/h1_recon.h"
#include "../include/tv.h"
#include "../include/tv_temp.h"
#include "../include/coil_construction.h"
#include "agile/agile.hpp"
#include "agile/io/file.hpp"
namespace po = boost::program_options;
/**
* \brief Reconstruction method option enum
*
*/
typedef enum Method
{
TV,
TVtemp,
TGV2,
TGV2_3D,
ICTV,
ICTGV2,
BS_RECON,
ASLTGV2RECON4D
} Method;
/**
* \brief GpuNUFFT parameter collection
*/
typedef struct GpuNUFFTParams
{
GpuNUFFTParams()
{
}
GpuNUFFTParams(DType kernelWidth, DType sectorWidth, DType osf)
: kernelWidth(kernelWidth), sectorWidth(sectorWidth), osf(osf)
{
}
DType kernelWidth;
DType sectorWidth;
DType osf;
} GpuNUFFTParams;
/**
* \brief Options parser for command line input arguments
*
* Extracts reconstruction method, problem dimensions, etc.
*/
class OptionsParser
{
public:
OptionsParser();
virtual ~OptionsParser();
void Usage();
bool ParseOptions(int argc, char *argv[]);
TVParams tvParams;
TVtempParams tvtempParams;
TGV2Params tgv2Params;
ICTVParams ictvParams;
ICTGV2Params ictgv2Params;
TGV2_3DParams tgv2_3DParams;
ASLTGV2RECON4DParams asltgv2recon4DParams;
CoilConstructionParams coilParams;
H1Params h1Params;
std::string kdataFilename;
std::string maskFilename;
std::string kdataFilenameH1;
std::string kdataLFilename;
std::string maskFilenameH1;
std::string outputFilename;
std::string outputFilenameFinal;
Method method;
Dimension dims;
bool verbose;
int debugstep;
unsigned int slice;
int tpat;
int gpu_device_nr;
std::string sensitivitiesFilename;
std::string u0Filename;
std::string densityFilename;
bool nonuniform;
bool normalize;
bool extradata;
GpuNUFFTParams gpuNUFFTParams;
AdaptLambdaParams adaptLambdaParams;
bool rawdata;
bool forceOSRemoval;
private:
po::options_description desc;
po::options_description conf;
po::options_description hidden;
std::string parameterFile;
po::options_description cmdline_options;
po::options_description config_options;
po::options_description visible;
po::positional_options_description p;
void AddCoilConstrConfigurationParameters();
void AddTVConfigurationParameters();
void AddTVtempConfigurationParameters();
void AddTGV2ConfigurationParameters();
void AddTGV2_3DConfigurationParameters();
void AddICTVConfigurationParameters();
void AddICTGV2ConfigurationParameters();
void AddASLTGV2RECON4DConfigurationParameters();
void AddGPUNUFFTConfigurationParameters();
void AddH1ConfigurationParameters();
void AddAdaptLambdaConfigurationParameters();
void SetMaxIt(int maxIt);
void SetStopPDGap(float stopPDGap);
void SetAdaptLambdaParams();
};
std::istream &operator>>(std::istream &in, Method &method);
void validate(boost::any &v, const std::vector<std::string> &values,
Dimension *target, int c);
void validate3D(boost::any &v, const std::vector<std::string> &values,
Dimension *target, int c);
#endif // INCLUDE_OPTIONS_PARSER_H_
|
/* Copyright (c) 2015, Zombie Rendering
* ahmetbilgili@gmail.com
*
* This file is part of Livre <https://github.com/BlueBrain/Livre>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3.0 as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _cachable_h_
#define _cachable_h_
#include <zrenderer/common/types.h>
namespace zrenderer
{
/**
* Base object for cachable objects.
*/
template< typename Key >
class Cachable
{
public:
Cachable( const Key& key )
: _key( key )
, _refCount( 0 )
{}
virtual ~Cachable() {}
typedef Key key_type;
/**
* @return the size of allocation
*/
virtual size_t getSize() const = 0;
/**
* @return the key of the cachable object
*/
const Key& getKey() const { return _key; }
/**
* Increases the ref count
*/
void increaseRef() { ++_refCount; }
/**
* Decreases the ref count
*/
void decreaseRef() { --_refCount; }
/**
* @return the ref count
*/
uint64_t getRefCount() const { return _refCount; }
private:
Key _key;
uint64_t _refCount;
};
}
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_MARKETPLACECATALOGREQUEST_P_H
#define QTAWS_MARKETPLACECATALOGREQUEST_P_H
#include "core/awsabstractrequest_p.h"
#include "marketplacecatalogrequest.h"
namespace QtAws {
namespace MarketplaceCatalog {
class MarketplaceCatalogRequest;
class MarketplaceCatalogRequestPrivate : public QtAws::Core::AwsAbstractRequestPrivate {
public:
MarketplaceCatalogRequest::Action action; ///< MarketplaceCatalog action to be performed.
QString apiVersion; ///< MarketplaceCatalog API version string. @todo Should this be in the abstract base class?
QVariantMap parameters; ///< MarketplaceCatalog request (query string) parameters. @todo?
MarketplaceCatalogRequestPrivate(const MarketplaceCatalogRequest::Action action, MarketplaceCatalogRequest * const q);
MarketplaceCatalogRequestPrivate(const MarketplaceCatalogRequestPrivate &other, MarketplaceCatalogRequest * const q);
static QString toString(const MarketplaceCatalogRequest::Action &action);
private:
Q_DECLARE_PUBLIC(MarketplaceCatalogRequest)
};
} // namespace MarketplaceCatalog
} // namespace QtAws
#endif
|
// Created file "Lib\src\ehstorguids\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(WPD_PROPERTY_CAPABILITIES_EVENT, 0x0cabec78, 0x6b74, 0x41c6, 0x92, 0x16, 0x26, 0x39, 0xd1, 0xfc, 0xe3, 0x56);
|
// Created file "Lib\src\Uuid\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(WPD_COMMAND_OBJECT_ENUMERATION_FIND_NEXT, 0xb7474e91, 0xe7f8, 0x4ad9, 0xb4, 0x00, 0xad, 0x1a, 0x4b, 0x58, 0xee, 0xec);
|
/*
Part of: Useless Containers Library
Contents: unbalanced binary search tree
Date: Mon Dec 6, 2010
Abstract
Copyright (c) 2010, 2019 Marco Maggi <marco.maggi-ipsu@poste.it>
This program is free software: you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** --------------------------------------------------------------------
** Headers.
** -----------------------------------------------------------------*/
#ifndef DEBUGGING
# define DEBUGGING 0
#endif
#include "ucl-internals.h"
static __inline__ __attribute__((__always_inline__,__nonnull__))
ucl_value_t
node_key (ucl_node_getkey_t getkey, void * N)
{
return getkey.func(getkey.data, N);
}
static __inline__ __attribute__((__always_inline__,__nonnull__))
int
comparison_key_key (ucl_comparison_t keycmp, ucl_value_t K1, ucl_value_t K2)
{
return keycmp.func(keycmp.data, K1, K2);
}
static __inline__ __attribute__((__always_inline__,__nonnull__))
int
comparison_key_node (ucl_comparison_t keycmp, ucl_node_getkey_t getkey, ucl_value_t K, ucl_node_t N)
{
return keycmp.func(keycmp.data, K, node_key(getkey, N));
}
static __inline__ __attribute__((__always_inline__,__nonnull__))
int
comparison_node_node (ucl_comparison_t keycmp, ucl_node_getkey_t getkey, ucl_node_t N1, ucl_node_t N2)
{
return keycmp.func(keycmp.data, node_key(getkey, N1), node_key(getkey, N2));
}
void
ucl_bst_insert (void * top_, void * new_, ucl_comparison_t keycmp, ucl_node_getkey_t getkey)
{
ucl_node_t cur = top_, new = new_;
for (;;) {
if (0 <= comparison_node_node(keycmp, getkey, new, cur)) {
if (cur->bro)
cur = cur->bro;
else {
cur->bro = new;
new->dad = cur;
return;
}
} else {
if (cur->son) {
cur = cur->son;
} else {
cur->son = new;
new->dad = cur;
return;
}
}
}
}
void *
ucl_bst_find (void * top_, ucl_value_t K, ucl_comparison_t keycmp, ucl_node_getkey_t getkey)
{
for (ucl_node_t cur = top_;;) {
int comparison_result = comparison_key_node(keycmp, getkey, K, cur);
if (0 < comparison_result) {
if (cur->bro)
cur = cur->bro;
else
return NULL;
} else if (0 > comparison_result) {
if (cur->son)
cur = cur->son;
else
return NULL;
} else {
assert(0 == comparison_result);
return cur;
}
}
}
void *
ucl_bst_delete (void * root_, void * cur_)
{
ucl_node_t root = root_, cur = cur_, dad, son, bro, new_root = NULL;
if (!cur->son && !cur->bro) {
debug("deleting node with no son and no bro");
/* Example:
*
* root root
* | =>
* cur
*/
dad = cur->dad;
if (dad) {
if (cur == dad->son)
dad->son = NULL;
else
dad->bro = NULL;
}
new_root = (cur == root)? NULL : root;
} else if (cur->son && cur->bro) {
debug("deleting node with both son and bro");
/* Example:
*
* root root
* | |
* cur--bro => son--bro
* |
* son
*/
dad = cur->dad;
son = cur->son;
if (dad) {
if (cur == dad->son)
dad->son = son;
else
dad->bro = son;
}
son->dad = dad;
while (son->bro)
son = son->bro;
son->bro = cur->bro;
new_root = (cur == root)? cur->son : root;
} else if (cur->son) {
assert(NULL == cur->bro);
debug("deleting node with son only");
/* Example:
*
* root root
* | |
* cur => son
* |
* son
*/
dad = cur->dad;
son = cur->son;
if (dad) {
if (cur == dad->son)
dad->son = son;
else
dad->bro = son;
}
son->dad = dad;
new_root = (cur == root)? son : root;
} else {
debug("deleting node with bro only");
assert(cur->bro);
assert(NULL == cur->son);
/* Example:
*
* root--cur--bro => root--bro
*
*/
dad = cur->dad;
bro = cur->bro;
if (dad) {
debug("cur is dad's son %d", cur == dad->son);
if (cur == dad->son)
dad->son = bro;
else
dad->bro = bro;
}
bro->dad = dad;
new_root = (cur == root)? bro : root;
}
cur->dad = cur->son = cur->bro = NULL;
return new_root;
}
/* end of file */
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTMEETINGSREQUEST_P_H
#define QTAWS_LISTMEETINGSREQUEST_P_H
#include "chimerequest_p.h"
#include "listmeetingsrequest.h"
namespace QtAws {
namespace Chime {
class ListMeetingsRequest;
class ListMeetingsRequestPrivate : public ChimeRequestPrivate {
public:
ListMeetingsRequestPrivate(const ChimeRequest::Action action,
ListMeetingsRequest * const q);
ListMeetingsRequestPrivate(const ListMeetingsRequestPrivate &other,
ListMeetingsRequest * const q);
private:
Q_DECLARE_PUBLIC(ListMeetingsRequest)
};
} // namespace Chime
} // namespace QtAws
#endif
|
// CMainFrame.h : interface of the CMainFrame class
//
#pragma once
class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Overrides
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CToolBar m_wndTBApp;
CReBar m_wndReBar;
CDialogBar m_wndDlgBar;
// Generated message map functions
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
DECLARE_MESSAGE_MAP()
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnClose();
};
|
/* moore_statemachine.h
* this file is part of DTL
*
* Copyright (C) <2017> <Dominik Baack>
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the LGPL license. See the LICENSE file for details.
*/
#pragma once
#include <tuple>
#include <utility>
#include "meta/index_sequence.h"
#include "algorithm/state_machine/moore_state.h"
namespace algorithm
{
namespace state_machine
{
template <class TIn, class ... TArgs>
class MooreStateMachine
{
static_assert(sizeof...(TArgs) > 0, "Number of States must be at least 1!");
private:
std::tuple<TArgs...> m_states;
MooreState<TIn>* m_current;
template<std::size_t... I>
std::tuple<TArgs* ...> _getStates( meta::integer_sequence<I...> )
{
return std::make_tuple( &std::get<I>(m_states)... );
}
public:
/** Constructor takes one to N different States and stores them in this class
* You should not access the States after they were transfered into this class
* use getStates() to access and mofify each state
*/
constexpr MooreStateMachine(TArgs&&... states)
: m_states{ states... }, m_current( &std::get<0>(m_states) )
{
//static_assert(std::is_convertible<, "Must inherit from class MooreState");
}
/** Recieve pointers to access and modifie stored States
* User std::tie( pointers ) to access the states
*/
std::tuple<TArgs* ...> getStates()
{
return _getStates(meta::index_sequence_from< sizeof...(TArgs) >() );
}
/** Transfer State into the next
* Inputs data into the StateMachine and transfers to the next state
*/
void call(TIn in)
{
m_current = m_current->transfer(in);
m_current->operator()();
}
inline long size() const
{
return sizeof...(TArgs);
}
};
}
}
|
/*
* Insertion sort
* --------------
* (using integer data type)
*/
#include <stdio.h>
#include <stdlib.h>
void printArray(const int* array, const size_t size);
void isort(int* array, const size_t size);
int main(int argc, char* argv[])
{
if (argc < 2)
{
printf("isort : Usage is 'isort [array]'\n");
return 1;
}
size_t size = argc - 1;
// allocate memory dynamically for the array
int* array = (int* )calloc(size, sizeof(int));
for (size_t i = 0; i < size; i++)
array[i] = atoi(argv[i+1]);
printf("Array before sorting :-\n");
printArray(array, size);
// sort using insertion sort
isort(array, size);
printf("\nArray after sorting :-\n");
printArray(array, size);
// release memory
free(array);
return 0;
}
void printArray(const int* array, const size_t size)
{
for (size_t i = 0; i < size; i++)
printf("%d ", array[i]);
printf("\n");
}
void isort(int* array, const size_t size)
{
for (size_t j = 1; j < size; j++)
{
int key = array[j], i = j - 1;
while (i >= 0 && array[i] > key)
{
array[i + 1] = array[i];
i--;
}
array[i + 1] = key;
}
}
|
/******************************************************************************
* PV` FileName: user_main.c
*******************************************************************************/
#include "user_config.h"
#include "bios.h"
#include "sdk/add_func.h"
#include "hw/esp8266.h"
#include "user_interface.h"
#include "tcp_srv_conn.h"
#include "flash_eep.h"
#include "wifi.h"
#include "hw/spi_register.h"
#include "hw/pin_mux_register.h"
#include "sdk/rom2ram.h"
#include "web_iohw.h"
#include "tcp2uart.h"
#include "webfs.h"
#include "sdk/libmain.h"
#ifdef USE_WEB
#include "web_srv.h"
#endif
#ifdef USE_NETBIOS
#include "netbios.h"
#endif
#ifdef USE_SNTP
#include "sntp.h"
#endif
//#ifdef USE_MODBUS
//#include "modbustcp.h"
#ifdef USE_RS485DRV
#include "driver/rs485drv.h"
#include "mdbtab.h"
#endif
//#endif
#include "power_meter.h"
#ifdef USE_WEB
extern uint8 web_fini(const uint8 * fname);
static const uint8 sysinifname[] ICACHE_RODATA_ATTR = "protect/init.ini";
#endif
void ICACHE_FLASH_ATTR init_done_cb(void)
{
#if DEBUGSOO > 0
os_printf("\nSDK Init - Ok\nHeap size: %d bytes\n", system_get_free_heap_size());
os_printf("Flash ID: %08x, size: %u\n", spi_flash_get_id(), spi_flash_real_size());
os_printf("PERIPHS_IO_MUX = %X\n\n", READ_PERI_REG(PERIPHS_IO_MUX));
os_printf("Curr cfg size: %d b\n", current_cfg_length());
struct ets_store_wifi_hdr whd;
spi_flash_read(((flashchip->chip_size/flashchip->sector_size)-1)*flashchip->sector_size, &whd, sizeof(whd));
os_printf("Last sec rw count: %u\n\n", whd.wr_cnt);
#endif
//
user_initialize(2); // init FRAM, timer/tasks
ets_set_idle_cb(user_idle, NULL); // do not use sleep mode!
//
#ifdef USE_WEB
web_fini(sysinifname);
#endif
switch(system_get_rst_info()->reason) {
case REASON_SOFT_RESTART:
case REASON_DEEP_SLEEP_AWAKE:
break;
default:
New_WiFi_config(WIFI_MASK_ALL);
break;
}
#ifdef USE_RS485DRV
rs485_drv_start();
init_mdbtab();
#endif
}
extern uint32 _lit4_start[]; // addr start BSS in IRAM
extern uint32 _lit4_end[]; // addr end BSS in IRAM
/******************************************************************************
* FunctionName : user_init
* Description : entry of user application, init user function here
* Parameters : none
* Returns : none
*******************************************************************************/
void ICACHE_FLASH_ATTR user_init(void) {
sys_read_cfg();
if(!syscfg.cfg.b.debug_print_enable) system_set_os_print(0);
//GPIO0_MUX = VAL_MUX_GPIO0_SDK_DEF;
GPIO4_MUX = VAL_MUX_GPIO4_SDK_DEF;
GPIO5_MUX = VAL_MUX_GPIO5_SDK_DEF;
GPIO12_MUX = VAL_MUX_GPIO12_SDK_DEF;
GPIO13_MUX = VAL_MUX_GPIO13_SDK_DEF;
GPIO14_MUX = VAL_MUX_GPIO14_SDK_DEF;
GPIO15_MUX = VAL_MUX_GPIO15_SDK_DEF;
// vad7
//power_meter_init();
//
//uart_init(); // in tcp2uart.h
system_timer_reinit();
#if (DEBUGSOO > 0 && defined(USE_WEB))
os_printf("\nSimple WEB version: " WEB_SVERSION "\n");
#endif
//if(syscfg.cfg.b.pin_clear_cfg_enable) test_pin_clr_wifi_config(); // сброс настроек, если замкнут пин RX
set_cpu_clk(); // select cpu frequency 80 or 160 MHz
#ifdef USE_GDBSTUB
extern void gdbstub_init(void);
gdbstub_init();
#endif
#if DEBUGSOO > 0
if(eraminfo.size > 0) os_printf("Found free IRAM: base: %p, size: %d bytes\n", eraminfo.base, eraminfo.size);
os_printf("System memory:\n");
system_print_meminfo();
os_printf("bssi : 0x%x ~ 0x%x, len: %d\n", &_lit4_start, &_lit4_end, (uint32)(&_lit4_end) - (uint32)(&_lit4_start));
os_printf("free : 0x%x ~ 0x%x, len: %d\n", (uint32)(&_lit4_end), (uint32)(eraminfo.base) + eraminfo.size, (uint32)(eraminfo.base) + eraminfo.size - (uint32)(&_lit4_end));
os_printf("Start 'heap' size: %d bytes\n", system_get_free_heap_size());
#endif
#if DEBUGSOO > 0
os_printf("Set CPU CLK: %u MHz\n", ets_get_cpu_frequency());
#endif
Setup_WiFi();
WEBFSInit(); // файловая система
system_deep_sleep_set_option(0);
system_init_done_cb(init_done_cb);
}
|
#ifndef MODELDEMOWIDGET_H
#define MODELDEMOWIDGET_H
#include <QWidget>
namespace Ui {
class ModelDemoWidget;
}
class MSqlQueryModel;
class ModelDemoWidget : public QWidget
{
Q_OBJECT
public:
explicit ModelDemoWidget(QWidget *parent = 0);
~ModelDemoWidget();
private:
//connected to GUI buttons
Q_SLOT void on_pbSetQueryAsync_clicked();
Q_SLOT void on_pbSetQuery_clicked();
Ui::ModelDemoWidget *ui;
MSqlQueryModel* m_model;
};
#endif // MODELDEMOWIDGET_H
|
#pragma once
#include "displayimagetextmenu.h"
#define GAMEMODECOUNT 6
class ChooseGameModeMenu :
public DisplayImageTextMenu
{
protected:
virtual void throwAction();
private:
long lastRun;
bool* traNext;
bool* traPrev;
int currmode;
AbstractConsole* console;
double transistion;
int transistionDirection;
std::string gamemode;
void update();
public:
ChooseGameModeMenu(int pid, AbstractConsole* console, ActionListener * quitListener);
virtual void run(AbstractConsole* pConsole);
virtual void render(AbstractConsole* pConsole);
virtual void onKeyDown(int keycode);
};
|
#include "RR.h"
runStats * RRscheduler(Process ** queue, int length){
//sort the processes into the order they should be processed in
int i, s = 1;
Process * t;
while (s) {
s = 0;
for (i = 1; i < length; i++) {
if (queue[i]->arrivalTime < queue[i - 1]->arrivalTime) {
t = queue[i];
queue[i] = queue[i - 1];
queue[i - 1] = t;
s = 1;
}
}
}
float averageWait = 0;
float averageTurn = 0;
int toki = 0; //time
int finished = 0;
//run the processes
while(finished < length){
for(int i = 0; i < length; i++){
if(queue[i]->done != 't'){
//add to wait time calculation
averageWait += toki - queue[i]->stopTime;
//If this is the first time running the process make the current time the start time
if(queue[i]->burstTime == queue[i]->remainingTime)
queue[i]->startTime = toki;
//If the process will not finish within the allocated time quantum
if(queue[i]->remainingTime > QUANTUM){
queue[i]->remainingTime = queue[i]->remainingTime - QUANTUM;
toki += QUANTUM;
queue[i]->stopTime = toki;
}
//The process will exactly finish within the allocated time quantum
else if(queue[i]->remainingTime == QUANTUM){
queue[i]->done = 't';
finished++;
toki += QUANTUM;
queue[i]->endTime = toki;
averageTurn += toki;
}
//the process will finish before the time quantum ends
else{
queue[i]->done = 't';
finished++;
toki += queue[i]->remainingTime;
queue[i]->endTime = toki;
averageTurn += toki;
}
}
}
}
//setup to return run stats
runStats * myStats = (runStats*)malloc(sizeof(runStats));
myStats->averageWaittime = averageWait/(float)length;
myStats->averageTurnaroundtime = averageTurn/(float)length;
return myStats;
}
runStats * RRPscheduler(Process ** queue, int length){
//Sort processes by priority
int i, s = 1;
Process * t;
while (s) {
s = 0;
for (i = 1; i < length; i++) {
if (queue[i]->priority < queue[i - 1]->priority) {
t = queue[i];
queue[i] = queue[i - 1];
queue[i - 1] = t;
s = 1;
}
}
}
float averageWait = 0;
float averageTurn = 0;
int toki = 0; //time
int finished = 0;
//run the processes
while(finished < length){
for(int i = 0; i < length; i++){
if(queue[i]->done != 't'){
//add to wait time calculation
averageWait += toki - queue[i]->stopTime;
//If this is the first time running the process make the current time the start time
if(queue[i]->burstTime == queue[i]->remainingTime)
queue[i]->startTime = toki;
//If the process will not finish within the allocated time quantum
if(queue[i]->remainingTime > QUANTUM){
queue[i]->remainingTime = queue[i]->remainingTime - QUANTUM;
toki += QUANTUM;
queue[i]->stopTime = toki;
}
//The process will exactly finish within the allocated time quantum
else if(queue[i]->remainingTime == QUANTUM){
queue[i]->done = 't';
finished++;
toki += QUANTUM;
queue[i]->endTime = toki;
averageTurn += toki;
}
//the process will finish before the time quantum ends
else{
queue[i]->done = 't';
finished++;
toki += queue[i]->remainingTime;
queue[i]->endTime = toki;
averageTurn += toki;
}
}
}
}
//setup to return run stats
runStats * myStats = (runStats*)malloc(sizeof(runStats));
myStats->averageWaittime = averageWait/(float)length;
myStats->averageTurnaroundtime = averageTurn/(float)length;
return myStats;
}
|
/*
xxHash - Extremely Fast Hash algorithm
Header File
Copyright (C) 2012-2016, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You can contact the author at :
- xxHash source repository : https://github.com/Cyan4973/xxHash
*/
#ifndef INC_LUTIL_XXHASH_H__
#define INC_LUTIL_XXHASH_H__
/**
@file xxHash.h
@author t-sakai
@date 2016/02/28 create
*/
#if defined(_MSC_VER)
typedef char Char;
typedef __int8 s8;
typedef __int16 s16;
typedef __int32 s32;
typedef __int64 s64;
typedef unsigned __int8 u8;
typedef unsigned __int16 u16;
typedef unsigned __int32 u32;
typedef unsigned __int64 u64;
typedef float f32;
typedef double f64;
#define EXPORT_API __declspec(dllexport)
#define LUTIL_INLINE __inline
#elif defined(ANDROID) || defined(__GNUC__)
#include <stdint.h>
typedef char Char;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef float f32;
typedef double f64;
#define EXPORT_API
#define LUTIL_INLINE inline
#else
typedef char Char;
typedef char s8;
typedef short s16;
typedef long s32;
typedef long long s64;
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
typedef unsigned long long u64;
typedef float f32;
typedef double f64;
#define EXPORT_API
#define LUTIL_INLINE inline
#endif
//----------------------------------------------------
//---
//--- xxHash
//---
//----------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
EXPORT_API struct Context32_t
{
u64 totalLength_;
u32 seed_;
u32 v1_;
u32 v2_;
u32 v3_;
u32 v4_;
u32 mem_[4];
u32 memSize_;
};
EXPORT_API struct Context64_t
{
u64 totalLength_;
u64 seed_;
u64 v1_;
u64 v2_;
u64 v3_;
u64 v4_;
u64 mem_[4];
u64 memSize_;
};
typedef struct Context32_t Context32;
typedef struct Context64_t Context64;
/**
The xxHash algorithm
https://github.com/Cyan4973/xxHash
*/
EXPORT_API void xxHash32Init(struct Context32_t* context, u32 seed);
EXPORT_API void xxHash32Update(struct Context32_t* context, const u8* input, u32 length);
EXPORT_API u32 xxHash32Finalize(struct Context32_t* context);
EXPORT_API void xxHash64Init(struct Context64_t* context, u64 seed);
EXPORT_API void xxHash64Update(struct Context64_t* context, const u8* input, u32 length);
EXPORT_API u64 xxHash64Finalize(struct Context64_t* context);
#ifdef __cplusplus
}
#endif
#endif //INC_LUTIL_XXHASH_H__
|
#ifndef CALCNUM_DETERMINANTE_H
#define CALCNUM_DETERMINANTE_H
#include "matriz.h"
#include "vetor.h"
#include "pivot.h"
// Algoritmo DETERMINANTE
template<typename T>
T MatrizT<T>::Determinante() {
const int n(m_);
T temp, det = 1;
for (int i = 1; i <= n && det != (T)0; ++i) {
if (Pivot(i)) det *= -1;
temp = a(i, i);
det *= temp;
if (temp != (T)0) {
for (int j = i; j <= n; ++j)
a(i, j) /= temp;
for (int k = i + 1; k <= n; ++k) {
temp = a(k, i);
for (int j = i + 1; j <= n; ++j)
a(k, j) -= temp * a(i, j);
}
}
}
return det;
}
#endif
|
// Copyright 2022 The Google Research Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SCANN_BASE_INTERNAL_SINGLE_MACHINE_FACTORY_IMPL_H_
#define SCANN_BASE_INTERNAL_SINGLE_MACHINE_FACTORY_IMPL_H_
#include <memory>
#include "scann/base/reordering_helper_factory.h"
#include "scann/base/single_machine_base.h"
#include "scann/base/single_machine_factory_options.h"
#include "scann/data_format/dataset.h"
#include "scann/proto/crowding.pb.h"
#include "scann/proto/scann.pb.h"
#include "scann/utils/factory_helpers.h"
#include "scann/utils/scann_config_utils.h"
#include "tensorflow/core/lib/core/errors.h"
namespace research_scann {
template <typename T>
class DenseDataset;
template <typename T>
class TypedDataset;
class ScannConfig;
class ScannInputData;
using StatusOrSearcherUntyped =
StatusOr<unique_ptr<UntypedSingleMachineSearcherBase>>;
namespace internal {
inline int NumQueryDatabaseSearchTypesConfigured(const ScannConfig& config) {
return config.has_brute_force() + config.has_hash();
}
template <typename LeafSearcherT>
class SingleMachineFactoryImplClass {
public:
template <typename T>
static StatusOrSearcherUntyped SingleMachineFactoryImpl(
ScannConfig config, const shared_ptr<Dataset>& dataset,
const GenericSearchParameters& params,
SingleMachineFactoryOptions* opts) {
config.mutable_input_output()->set_in_memory_data_type(TagForType<T>());
SCANN_RETURN_IF_ERROR(CanonicalizeScannConfigForRetrieval(&config));
auto typed_dataset = std::dynamic_pointer_cast<TypedDataset<T>>(dataset);
if (dataset && !typed_dataset) {
return InvalidArgumentError("Dataset is the wrong type");
}
TF_ASSIGN_OR_RETURN(auto searcher,
LeafSearcherT::SingleMachineFactoryLeafSearcher(
config, typed_dataset, params, opts));
auto* typed_searcher =
down_cast<SingleMachineSearcherBase<T>*>(searcher.get());
TF_ASSIGN_OR_RETURN(
auto reordering_helper,
ReorderingHelperFactory<T>::Build(config, params.reordering_dist,
typed_dataset, opts));
typed_searcher->EnableReordering(std::move(reordering_helper),
params.post_reordering_num_neighbors,
params.post_reordering_epsilon);
return {std::move(searcher)};
}
};
template <typename LeafSearcherT>
StatusOrSearcherUntyped SingleMachineFactoryUntypedImpl(
const ScannConfig& config, shared_ptr<Dataset> dataset,
SingleMachineFactoryOptions opts) {
GenericSearchParameters params;
SCANN_RETURN_IF_ERROR(params.PopulateValuesFromScannConfig(config));
if (params.reordering_dist->NormalizationRequired() != NONE && dataset &&
dataset->normalization() !=
params.reordering_dist->NormalizationRequired()) {
return InvalidArgumentError(
"Dataset not correctly normalized for the exact distance measure.");
}
if (params.pre_reordering_dist->NormalizationRequired() != NONE && dataset &&
dataset->normalization() !=
params.pre_reordering_dist->NormalizationRequired()) {
return InvalidArgumentError(
"Dataset not correctly normalized for the pre-reordering distance "
"measure.");
}
if (opts.type_tag == kInvalidTypeTag) {
CHECK(dataset) << "Code fails to wire-through the type tag";
opts.type_tag = dataset->TypeTag();
}
TF_ASSIGN_OR_RETURN(auto searcher,
SCANN_CALL_FUNCTION_BY_TAG(
opts.type_tag,
SingleMachineFactoryImplClass<
LeafSearcherT>::template SingleMachineFactoryImpl,
config, dataset, params, &opts));
CHECK(searcher) << "Returning nullptr instead of Status is a bug";
if (config.crowding().enabled() && opts.crowding_attributes) {
SCANN_RETURN_IF_ERROR(
searcher->EnableCrowding(std::move(opts.crowding_attributes)));
}
return {std::move(searcher)};
}
} // namespace internal
} // namespace research_scann
#endif
|
#pragma once
#include "CoreMinimal.h"
#include "CoreShell.h"
|
#pragma once
#include <atomic>
template <typename Derived>
class RefCnt
{
public:
RefCnt() : m_counter(1) {;}
Derived* ref()
{
++m_counter;
return static_cast<Derived*>(this);
}
void unref()
{
if (m_counter-- == 1)
{
delete static_cast<Derived*>(this);
}
}
private:
RefCnt(const RefCnt &); // = delete;
RefCnt& operator=(const RefCnt &); // = delete
std::atomic_int_fast32_t m_counter;
};
struct RefCntDeleter
{
template <typename T>
void operator()(T* obj)
{
obj->unref();
}
};
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/waf/WAF_EXPORTS.h>
#include <aws/waf/WAFRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace WAF
{
namespace Model
{
/**
* <p>A request to create an <a>XssMatchSet</a>.</p>
*/
class AWS_WAF_API CreateXssMatchSetRequest : public WAFRequest
{
public:
CreateXssMatchSetRequest();
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>A friendly name or description for the <a>XssMatchSet</a> that you're
* creating. You can't change <code>Name</code> after you create the
* <code>XssMatchSet</code>.</p>
*/
inline const Aws::String& GetName() const{ return m_name; }
/**
* <p>A friendly name or description for the <a>XssMatchSet</a> that you're
* creating. You can't change <code>Name</code> after you create the
* <code>XssMatchSet</code>.</p>
*/
inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
/**
* <p>A friendly name or description for the <a>XssMatchSet</a> that you're
* creating. You can't change <code>Name</code> after you create the
* <code>XssMatchSet</code>.</p>
*/
inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = value; }
/**
* <p>A friendly name or description for the <a>XssMatchSet</a> that you're
* creating. You can't change <code>Name</code> after you create the
* <code>XssMatchSet</code>.</p>
*/
inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
/**
* <p>A friendly name or description for the <a>XssMatchSet</a> that you're
* creating. You can't change <code>Name</code> after you create the
* <code>XssMatchSet</code>.</p>
*/
inline CreateXssMatchSetRequest& WithName(const Aws::String& value) { SetName(value); return *this;}
/**
* <p>A friendly name or description for the <a>XssMatchSet</a> that you're
* creating. You can't change <code>Name</code> after you create the
* <code>XssMatchSet</code>.</p>
*/
inline CreateXssMatchSetRequest& WithName(Aws::String&& value) { SetName(value); return *this;}
/**
* <p>A friendly name or description for the <a>XssMatchSet</a> that you're
* creating. You can't change <code>Name</code> after you create the
* <code>XssMatchSet</code>.</p>
*/
inline CreateXssMatchSetRequest& WithName(const char* value) { SetName(value); return *this;}
/**
* <p>The value returned by the most recent call to <a>GetChangeToken</a>.</p>
*/
inline const Aws::String& GetChangeToken() const{ return m_changeToken; }
/**
* <p>The value returned by the most recent call to <a>GetChangeToken</a>.</p>
*/
inline void SetChangeToken(const Aws::String& value) { m_changeTokenHasBeenSet = true; m_changeToken = value; }
/**
* <p>The value returned by the most recent call to <a>GetChangeToken</a>.</p>
*/
inline void SetChangeToken(Aws::String&& value) { m_changeTokenHasBeenSet = true; m_changeToken = value; }
/**
* <p>The value returned by the most recent call to <a>GetChangeToken</a>.</p>
*/
inline void SetChangeToken(const char* value) { m_changeTokenHasBeenSet = true; m_changeToken.assign(value); }
/**
* <p>The value returned by the most recent call to <a>GetChangeToken</a>.</p>
*/
inline CreateXssMatchSetRequest& WithChangeToken(const Aws::String& value) { SetChangeToken(value); return *this;}
/**
* <p>The value returned by the most recent call to <a>GetChangeToken</a>.</p>
*/
inline CreateXssMatchSetRequest& WithChangeToken(Aws::String&& value) { SetChangeToken(value); return *this;}
/**
* <p>The value returned by the most recent call to <a>GetChangeToken</a>.</p>
*/
inline CreateXssMatchSetRequest& WithChangeToken(const char* value) { SetChangeToken(value); return *this;}
private:
Aws::String m_name;
bool m_nameHasBeenSet;
Aws::String m_changeToken;
bool m_changeTokenHasBeenSet;
};
} // namespace Model
} // namespace WAF
} // namespace Aws
|
/*
* Copyright 2019-2022 Diligent Graphics LLC
* Copyright 2015-2019 Egor Yusov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* In no event and under no legal theory, whether in tort (including negligence),
* contract, or otherwise, unless required by applicable law (such as deliberate
* and grossly negligent acts) or agreed to in writing, shall any Contributor be
* liable for any damages, including any direct, indirect, special, incidental,
* or consequential damages of any character arising as a result of this License or
* out of the use or inability to use the software (including but not limited to damages
* for loss of goodwill, work stoppage, computer failure or malfunction, or any and
* all other commercial damages or losses), even if such Contributor has been advised
* of the possibility of such damages.
*/
#pragma once
#include "../../../Primitives/interface/CommonDefinitions.h"
#include "../../../Primitives/interface/BasicTypes.h"
DILIGENT_BEGIN_NAMESPACE(Diligent)
struct LinuxNativeWindow
{
Uint32 WindowId DEFAULT_INITIALIZER(0);
void* pDisplay DEFAULT_INITIALIZER(nullptr);
void* pXCBConnection DEFAULT_INITIALIZER(nullptr);
};
DILIGENT_END_NAMESPACE // namespace Diligent
|
#ifndef CAR_H
#define CAR_H
//#include <arch/arch.h>
#include "/usr/include/arch/arch.h"
class Car {
private:
Object c;
bool in;
float rotate;
float scale;
float stutter;
float vel;
vector<Object> burn;
int id;
bool l,r,u,d;
int wbounds, hbounds;
public:
Car();
void drive();
void getIn();
void getOut();
void genBurn();
vector<Object> getBurns() const {return burn;}
void move(bool l, bool r, bool u, bool d);
void update();
Object setCar(string img, int fx, int fy, int fw, int fh, SDL_Renderer* ren, float sp, float sc);
void setCar(Object obj) {c=obj;}
Object getCar() const {return c;}
void setIn(bool i) {in=i;}
bool isIn() const {return in;}
void setSpeed(float s) {c.setSpeed(s);}
float getSpeed() {return c.getSpeed();}
void setRotate(float rot) {rotate=rot;}
float getRotate() const {return rotate;}
void setScale(float s) {scale=s;}
float getScale() const {return scale;}
void setStutter(float s) {stutter=s;}
float getStutter() const {return stutter;}
void setVel(float v) {vel=v;}
float getVel() const {return vel;}
double get_degrees(double input);
void setBounds(int w, int h) {wbounds=w; hbounds=h;}
};
#endif //CAR_H
|
/*!
@header EaseMob.h
@abstract 客户端基本类
@author EaseMob Inc.
@version 1.00 2014/01/01 Creation (1.00)
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIApplication.h>
#import "EaseMobHeaders.h"
/*!
@class
@brief 该类声明了EMChatManager和EMDeviceManager
@discussion SDK集成进工程后, 最先使用的类, 所有的类对象, 均是通过这个单实例来获取, 示例代码如下:
[EaseMob sharedInstance]
*/
@interface EaseMob : NSObject<UIApplicationDelegate>
/*!
@property
@brief 聊天管理器, 获取该对象后, 可以做登录、聊天、加好友等操作
*/
@property (nonatomic, readonly, strong) id<IChatManager> chatManager;
/*!
@property
@brief 设备管理器, 获取该对象后, 可以操作硬件相关的接口(照片、音频、地理位置信息等)
*/
@property (nonatomic, readonly, strong) id<IDeviceManager> deviceManager;
/*!
@property
@brief EaseMob SDK版本号
*/
@property (nonatomic, readonly, strong) NSString *sdkVersion;
/*!
@method
@brief 获取单实例
@discussion
@result EaseMob实例对象
*/
+ (EaseMob *)sharedInstance;
/*!
@method
@brief 初始化SDK
@discussion 失败返回EMError,成功返回nil
@result 初始化是否成功
*/
- (EMError *)registerSDKWithAppKey:(NSString *)anAppKey EM_DEPRECATED_IOS(2_0_0, 2_0_2, "Use -registerSDKWithAppKey:apnsCertName:"); // Deprecated;
/*!
@method
@brief 初始化SDK
@discussion 失败返回EMError,成功返回nil
@param anAppKey 申请应用时的appkey
@param anAPNSCertName 需要使用的APNS证书名字(需要与后台上传时的APNS证书名字相同, 客户端打包时的证书, 需要与服务器后台的证书一一对应)
@result 初始化是否成功
*/
- (EMError *)registerSDKWithAppKey:(NSString *)anAppKey
apnsCertName:(NSString *)anAPNSCertName;
/*!
@method
@brief 初始化SDK
@discussion 失败返回EMError,成功返回nil
@param anAppKey 申请应用时的appkey
@param anAPNSCertName 需要使用的APNS证书名字(需要与后台上传时的APNS证书名字相同, 客户端打包时的证书, 需要与服务器后台的证书一一对应)
@param anOtherConfig 其他初始化配置。目前支持自定义 1、是否打印Console Log(对应key为kSDKConfigEnableConsoleLogger)
@result 初始化是否成功
*/
- (EMError *)registerSDKWithAppKey:(NSString *)anAppKey
apnsCertName:(NSString *)anAPNSCertName
otherConfig:(NSDictionary *)anOtherConfig;
/*!
@method
@brief App切换到后台时, 开启后台运行模式, 在后台时, 仍可接收消息
@discussion 要使SDK在后台仍然能正常运行, 有两种方式可以实现:
1. 在工程的Capabilities中, 设置Background Modes, 勾选 Voice Over IP, 无需调用此方法, 也可保持App在后台运行(但开启此项时, 如果应用未使用到VOIP, 上传到App Store会有被拒绝的风险)
2. 在工程的Capabilities中, 设置Background Modes, 勾选 Audio And Airplay, 然后调用此方法, 即可保持App在后台一直运行.
*/
- (void)enableBackgroundReceiveMessage EM_DEPRECATED_IOS(2_0_0, 2_0_7, "目前已不使用该方法, 请在 applicationDidEnterBackground 和 applicationWillEnterForeground 方法中通知添加 SDK 的回调即可");
//开启 exception监听,并将exception写入到日志
//(跟友盟有冲突,如果使用了友盟,调用了该方法,有可能会导致 umeng的 crashReport不能正常工作)
//建议只在 Debug 状态时,打开该开关
- (void)enableUncaughtExceptionHandler;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/quicksight/QuickSight_EXPORTS.h>
#include <aws/quicksight/model/TemplateAlias.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace QuickSight
{
namespace Model
{
class AWS_QUICKSIGHT_API UpdateTemplateAliasResult
{
public:
UpdateTemplateAliasResult();
UpdateTemplateAliasResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
UpdateTemplateAliasResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The template alias.</p>
*/
inline const TemplateAlias& GetTemplateAlias() const{ return m_templateAlias; }
/**
* <p>The template alias.</p>
*/
inline void SetTemplateAlias(const TemplateAlias& value) { m_templateAlias = value; }
/**
* <p>The template alias.</p>
*/
inline void SetTemplateAlias(TemplateAlias&& value) { m_templateAlias = std::move(value); }
/**
* <p>The template alias.</p>
*/
inline UpdateTemplateAliasResult& WithTemplateAlias(const TemplateAlias& value) { SetTemplateAlias(value); return *this;}
/**
* <p>The template alias.</p>
*/
inline UpdateTemplateAliasResult& WithTemplateAlias(TemplateAlias&& value) { SetTemplateAlias(std::move(value)); return *this;}
/**
* <p>The HTTP status of the request.</p>
*/
inline int GetStatus() const{ return m_status; }
/**
* <p>The HTTP status of the request.</p>
*/
inline void SetStatus(int value) { m_status = value; }
/**
* <p>The HTTP status of the request.</p>
*/
inline UpdateTemplateAliasResult& WithStatus(int value) { SetStatus(value); return *this;}
/**
* <p>The AWS request ID for this operation.</p>
*/
inline const Aws::String& GetRequestId() const{ return m_requestId; }
/**
* <p>The AWS request ID for this operation.</p>
*/
inline void SetRequestId(const Aws::String& value) { m_requestId = value; }
/**
* <p>The AWS request ID for this operation.</p>
*/
inline void SetRequestId(Aws::String&& value) { m_requestId = std::move(value); }
/**
* <p>The AWS request ID for this operation.</p>
*/
inline void SetRequestId(const char* value) { m_requestId.assign(value); }
/**
* <p>The AWS request ID for this operation.</p>
*/
inline UpdateTemplateAliasResult& WithRequestId(const Aws::String& value) { SetRequestId(value); return *this;}
/**
* <p>The AWS request ID for this operation.</p>
*/
inline UpdateTemplateAliasResult& WithRequestId(Aws::String&& value) { SetRequestId(std::move(value)); return *this;}
/**
* <p>The AWS request ID for this operation.</p>
*/
inline UpdateTemplateAliasResult& WithRequestId(const char* value) { SetRequestId(value); return *this;}
private:
TemplateAlias m_templateAlias;
int m_status;
Aws::String m_requestId;
};
} // namespace Model
} // namespace QuickSight
} // namespace Aws
|
/* $NetBSD: vsscanf.c,v 1.13 2003/08/07 16:43:35 agc Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Donn Seeley at UUNET Technologies, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)vsscanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: vsscanf.c,v 1.13 2003/08/07 16:43:35 agc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include "reentrant.h"
#include "local.h"
static int eofread(void *, char *, int);
/* ARGSUSED */
static int
eofread(cookie, buf, len)
void *cookie;
char *buf;
int len;
{
return (0);
}
int
vsscanf(str, fmt, ap)
const char *str;
const char *fmt;
va_list ap;
{
FILE f;
struct __sfileext fext;
assert(str != NULL);
assert(fmt != NULL);
_FILEEXT_SETUP(&f, &fext);
f._flags = __SRD;
f._bf._base = f._p = __UNCONST(str);
f._bf._size = f._r = strlen(str);
f._read = eofread;
_UB(&f)._base = NULL;
f._lb._base = NULL;
return (__svfscanf_unlocked(&f, fmt, ap));
}
|
/*
===========================================================================
File: TYPEDEF.H v.2.3 - 30.Nov.2009
===========================================================================
ITU-T STL BASIC OPERATORS
TYPE DEFINITION PROTOTYPES
History:
26.Jan.00 v1.0 Incorporated to the STL from updated G.723.1/G.729
basic operator library (based on basic_op.h)
03 Nov 04 v2.0 Incorporation of new 32-bit / 40-bit / control
operators for the ITU-T Standard Tool Library as
described in Geneva, 20-30 January 2004 WP 3/16 Q10/16
TD 11 document and subsequent discussions on the
wp3audio@yahoogroups.com email reflector.
March 06 v2.1 Changed to improve portability.
============================================================================
*/
/*_____________________
| |
| Basic types. |
|_____________________|
*/
#ifndef _TYPEDEF_H
#define _TYPEDEF_H "$Id $"
#define ORIGINAL_TYPEDEF_H /* Define to get "original" version *
* of typedef.h (this file). */
#undef ORIGINAL_TYPEDEF_H /* Undefine to get the "new" version *
* of typedef.h (see typedefs.h). */
#ifdef ORIGINAL_TYPEDEF_H
/*
* This is the original code from the file typedef.h
*/
#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(_MSC_VER) || defined(__ZTC__)
typedef signed char Word8;
typedef short Word16;
typedef long Word32;
typedef __int64 Word40;
typedef unsigned short UWord16;
typedef unsigned long UWord32;
typedef int Flag;
#elif defined(__CYGWIN__)
typedef signed char Word8;
typedef short Word16;
typedef long Word32;
typedef long long Word40;
typedef unsigned short UWord16;
typedef unsigned long UWord32;
typedef int Flag;
#elif defined(__sun)
typedef signed char Word8;
typedef short Word16;
typedef long Word32;
/*#error "The 40-bit operations have not been tested on __sun : need to define Word40"*/
typedef long long Word40;
typedef unsigned short UWord16;
typedef unsigned long UWord32;
typedef int Flag;
#elif defined(__unix__) || defined(__unix)
typedef signed char Word8;
typedef short Word16;
typedef int Word32;
/*#error "The 40-bit operations have not been tested on unix : need to define Word40"*/
typedef long long Word40;
typedef unsigned short UWord16;
typedef unsigned int UWord32;
typedef int Flag;
#endif
#else /* ifdef ORIGINAL_TYPEDEF_H */ /* not original typedef.h */
/*
* Use (improved) type definition file typdefs.h and add a "Flag" type.
*/
#include "typedefs.h"
typedef int Flag;
#endif /* ifdef ORIGINAL_TYPEDEF_H */
#endif /* ifndef _TYPEDEF_H */
/* end of file */
|
///> [Serializable]
#ifndef COMPOSITEEXPRESSION_H
#define COMPOSITEEXPRESSION_H
#include "Expression.h"
#ifndef SVECTOR_H
#include "SVector.h"
#endif
using namespace Serialization;
///> class=CompositeExpression
///> parent=Expression
class CompositeExpression : public Expression
{
protected:
///> type=vector(Expression*)
SVector<Expression*> _expressions;
///> type=bool
bool _shortCircuit;
Expression* GetTermAux(int p_currentIndex, int p_targetIndex);
public:
CompositeExpression() {}
CompositeExpression(const vector<Expression*>& p_expressions) : Expression(EXPRESSION_Composite), _expressions(p_expressions), _shortCircuit(true) {}
CompositeExpression(Expression* p_expression) : Expression(EXPRESSION_Composite), _shortCircuit(true) { _expressions.push_back(p_expression); }
bool AddExpression(Expression* p_expression);
bool RemoveExpression(Expression* p_expression);
bool Equals(const Expression* p_rhs) const;
bool PartiallyEqualsAux(const Expression* p_rhs, MatchSide p_anchor, vector<pair<Expression*,Expression*>>& p_matchedLeafs) const;
bool ShortCircuit() const { return _shortCircuit; }
void ShortCircuit(bool val) { _shortCircuit = val; }
const vector<Expression*>& Expressions() const { return _expressions; }
void Clear();
Expression* operator[](int p_index);
Expression* At(int p_index);
void Copy(IClonable* p_dest);
//----------------------------------------------------------------------------------------------
// Serialization
protected:
void InitializeAddressesAux();
//----------------------------------------------------------------------------------------------------------------------------------------------------
};
#endif // _H |
#ifndef __H_EW_EWC_BASE_PLUGIN_PLUGIN_WORKSPACE__
#define __H_EW_EWC_BASE_PLUGIN_PLUGIN_WORKSPACE__
#include "ewc_base/plugin/plugin_common.h"
EW_ENTER
class DLLIMPEXP_EWC_BASE PluginWorkspace : public PluginCommon2
{
public:
typedef PluginCommon2 basetype;
PluginWorkspace(WndManager& w);
virtual bool OnAttach();
bool OnCmdEvent(ICmdParam& cmd,int phase);
};
EW_LEAVE
#endif
|
#include <stdio.h>
void p (unsigned char a, unsigned char b, unsigned char v)
{
if (v)
printf ("\t%d / %d = %d\r\n", a, b, v);
}
void main ()
{
unsigned char a;
for (a=1; a; ++a) {
p (a, 1, a / 1);
p (a, 2, a / 2);
p (a, 3, a / 3);
p (a, 4, a / 4);
p (a, 5, a / 5);
p (a, 6, a / 6);
p (a, 7, a / 7);
p (a, 8, a / 8);
p (a, 9, a / 9);
p (a, 10, a / 10);
p (a, 11, a / 11);
p (a, 12, a / 12);
p (a, 13, a / 13);
p (a, 14, a / 14);
p (a, 15, a / 15);
p (a, 16, a / 16);
p (a, 17, a / 17);
p (a, 18, a / 18);
p (a, 19, a / 19);
p (a, 20, a / 20);
p (a, 21, a / 21);
p (a, 22, a / 22);
p (a, 23, a / 23);
p (a, 24, a / 24);
p (a, 25, a / 25);
p (a, 26, a / 26);
p (a, 27, a / 27);
p (a, 28, a / 28);
p (a, 29, a / 29);
p (a, 30, a / 30);
p (a, 31, a / 31);
p (a, 32, a / 32);
p (a, 33, a / 33);
p (a, 34, a / 34);
p (a, 35, a / 35);
p (a, 36, a / 36);
p (a, 37, a / 37);
p (a, 38, a / 38);
p (a, 39, a / 39);
p (a, 40, a / 40);
p (a, 41, a / 41);
p (a, 42, a / 42);
p (a, 43, a / 43);
p (a, 44, a / 44);
p (a, 45, a / 45);
p (a, 46, a / 46);
p (a, 47, a / 47);
p (a, 48, a / 48);
p (a, 49, a / 49);
p (a, 50, a / 50);
p (a, 51, a / 51);
p (a, 52, a / 52);
p (a, 53, a / 53);
p (a, 54, a / 54);
p (a, 55, a / 55);
p (a, 56, a / 56);
p (a, 57, a / 57);
p (a, 58, a / 58);
p (a, 59, a / 59);
p (a, 60, a / 60);
p (a, 61, a / 61);
p (a, 62, a / 62);
p (a, 63, a / 63);
p (a, 64, a / 64);
p (a, 65, a / 65);
p (a, 66, a / 66);
p (a, 67, a / 67);
p (a, 68, a / 68);
p (a, 69, a / 69);
p (a, 70, a / 70);
p (a, 71, a / 71);
p (a, 72, a / 72);
p (a, 73, a / 73);
p (a, 74, a / 74);
p (a, 75, a / 75);
p (a, 76, a / 76);
p (a, 77, a / 77);
p (a, 78, a / 78);
p (a, 79, a / 79);
p (a, 80, a / 80);
p (a, 81, a / 81);
p (a, 82, a / 82);
p (a, 83, a / 83);
p (a, 84, a / 84);
p (a, 85, a / 85);
p (a, 86, a / 86);
p (a, 87, a / 87);
p (a, 88, a / 88);
p (a, 89, a / 89);
p (a, 90, a / 90);
p (a, 91, a / 91);
p (a, 92, a / 92);
p (a, 93, a / 93);
p (a, 94, a / 94);
p (a, 95, a / 95);
p (a, 96, a / 96);
p (a, 97, a / 97);
p (a, 98, a / 98);
p (a, 99, a / 99);
p (a, 100, a / 100);
p (a, 101, a / 101);
p (a, 102, a / 102);
p (a, 103, a / 103);
p (a, 104, a / 104);
p (a, 105, a / 105);
p (a, 106, a / 106);
p (a, 107, a / 107);
p (a, 108, a / 108);
p (a, 109, a / 109);
p (a, 110, a / 110);
p (a, 111, a / 111);
p (a, 112, a / 112);
p (a, 113, a / 113);
p (a, 114, a / 114);
p (a, 115, a / 115);
p (a, 116, a / 116);
p (a, 117, a / 117);
p (a, 118, a / 118);
p (a, 119, a / 119);
p (a, 120, a / 120);
p (a, 121, a / 121);
p (a, 122, a / 122);
p (a, 123, a / 123);
p (a, 124, a / 124);
p (a, 125, a / 125);
p (a, 126, a / 126);
p (a, 127, a / 127);
p (a, 128, a / 128);
p (a, 129, a / 129);
p (a, 130, a / 130);
p (a, 131, a / 131);
p (a, 132, a / 132);
p (a, 133, a / 133);
p (a, 134, a / 134);
p (a, 135, a / 135);
p (a, 136, a / 136);
p (a, 137, a / 137);
p (a, 138, a / 138);
p (a, 139, a / 139);
p (a, 140, a / 140);
p (a, 141, a / 141);
p (a, 142, a / 142);
p (a, 143, a / 143);
p (a, 144, a / 144);
p (a, 145, a / 145);
p (a, 146, a / 146);
p (a, 147, a / 147);
p (a, 148, a / 148);
p (a, 149, a / 149);
p (a, 150, a / 150);
p (a, 151, a / 151);
p (a, 152, a / 152);
p (a, 153, a / 153);
p (a, 154, a / 154);
p (a, 155, a / 155);
p (a, 156, a / 156);
p (a, 157, a / 157);
p (a, 158, a / 158);
p (a, 159, a / 159);
p (a, 160, a / 160);
p (a, 161, a / 161);
p (a, 162, a / 162);
p (a, 163, a / 163);
p (a, 164, a / 164);
p (a, 165, a / 165);
p (a, 166, a / 166);
p (a, 167, a / 167);
p (a, 168, a / 168);
p (a, 169, a / 169);
p (a, 170, a / 170);
p (a, 171, a / 171);
p (a, 172, a / 172);
p (a, 173, a / 173);
p (a, 174, a / 174);
p (a, 175, a / 175);
p (a, 176, a / 176);
p (a, 177, a / 177);
p (a, 178, a / 178);
p (a, 179, a / 179);
p (a, 180, a / 180);
p (a, 181, a / 181);
p (a, 182, a / 182);
p (a, 183, a / 183);
p (a, 184, a / 184);
p (a, 185, a / 185);
p (a, 186, a / 186);
p (a, 187, a / 187);
p (a, 188, a / 188);
p (a, 189, a / 189);
p (a, 190, a / 190);
p (a, 191, a / 191);
p (a, 192, a / 192);
p (a, 193, a / 193);
p (a, 194, a / 194);
p (a, 195, a / 195);
p (a, 196, a / 196);
p (a, 197, a / 197);
p (a, 198, a / 198);
p (a, 199, a / 199);
p (a, 200, a / 200);
p (a, 201, a / 201);
p (a, 202, a / 202);
p (a, 203, a / 203);
p (a, 204, a / 204);
p (a, 205, a / 205);
p (a, 206, a / 206);
p (a, 207, a / 207);
p (a, 208, a / 208);
p (a, 209, a / 209);
p (a, 210, a / 210);
p (a, 211, a / 211);
p (a, 212, a / 212);
p (a, 213, a / 213);
p (a, 214, a / 214);
p (a, 215, a / 215);
p (a, 216, a / 216);
p (a, 217, a / 217);
p (a, 218, a / 218);
p (a, 219, a / 219);
p (a, 220, a / 220);
p (a, 221, a / 221);
p (a, 222, a / 222);
p (a, 223, a / 223);
p (a, 224, a / 224);
p (a, 225, a / 225);
p (a, 226, a / 226);
p (a, 227, a / 227);
p (a, 228, a / 228);
p (a, 229, a / 229);
p (a, 230, a / 230);
p (a, 231, a / 231);
p (a, 232, a / 232);
p (a, 233, a / 233);
p (a, 234, a / 234);
p (a, 235, a / 235);
p (a, 236, a / 236);
p (a, 237, a / 237);
p (a, 238, a / 238);
p (a, 239, a / 239);
p (a, 240, a / 240);
p (a, 241, a / 241);
p (a, 242, a / 242);
p (a, 243, a / 243);
p (a, 244, a / 244);
p (a, 245, a / 245);
p (a, 246, a / 246);
p (a, 247, a / 247);
p (a, 248, a / 248);
p (a, 249, a / 249);
p (a, 250, a / 250);
p (a, 251, a / 251);
p (a, 252, a / 252);
p (a, 253, a / 253);
p (a, 254, a / 254);
p (a, 255, a / 255);
}
}
|
#pragma once
#include <string>
enum RecommendationType {
BUY,
SELL,
HOLD,
NO_RECOMMENDATION
};
class Recommendation {
public:
Recommendation();
Recommendation(const std::string &ticker, RecommendationType rec, double target);
~Recommendation();
Recommendation(const Recommendation &r);
Recommendation &operator =(const Recommendation &r);
double getTarget() const;
RecommendationType getRecommendation() const;
std::string getTicker() const;
private:
std::string m_ticker;
RecommendationType m_recType;
double m_target;
}; |
// Copyright 2019 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
#pragma once
#include <cstddef>
#include <string_view>
#include "pw_preprocessor/compiler.h"
#include "pw_unit_test/event_handler.h"
namespace pw::unit_test {
// An event handler implementation which produces human-readable test output.
//
// Example output:
//
// >>> Running MyTestSuite.TestCase1
// [SUCCESS] 128 <= 129
// [FAILURE] 'a' == 'b'
// at ../path/to/my/file_test.cc:4831
// <<< Test MyTestSuite.TestCase1 failed
//
class SimplePrintingEventHandler : public EventHandler {
public:
// Function for writing output as a string.
using WriteFunction = void (*)(const std::string_view& string,
bool append_newline);
// Instantiates an event handler with a function to which to output results.
// If verbose is set, information for successful tests is written as well as
// failures.
SimplePrintingEventHandler(WriteFunction write_function, bool verbose = false)
: write_(write_function), verbose_(verbose) {}
void RunAllTestsStart() override;
void RunAllTestsEnd(const RunTestsSummary& run_tests_summary) override;
void TestCaseStart(const TestCase& test_case) override;
void TestCaseEnd(const TestCase& test_case, TestResult result) override;
void TestCaseExpect(const TestCase& test_case,
const TestExpectation& expectation) override;
void TestCaseDisabled(const TestCase& test_case) override;
private:
void WriteLine(const char* format, ...) PW_PRINTF_FORMAT(2, 3);
WriteFunction write_;
bool verbose_;
char buffer_[512];
};
} // namespace pw::unit_test
|
/**************************************************************************
* *
* Algorithmic C (tm) Math Library *
* *
* Software Version: 3.4 *
* *
* Release Date : Mon Jan 31 11:05:01 PST 2022 *
* Release Type : Production Release *
* Release Build : 3.4.2 *
* *
* Copyright 2018 Siemens *
* *
**************************************************************************
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or *
* implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
**************************************************************************
* *
* The most recent version of this package is available at github. *
* *
*************************************************************************/
// Revision History:
// 3.1.0 - Added ac_tanh_pwl.h
// 2.0.10 - Removed including of ac_random.h from ac_math.h header file.
// Completed list of header file inclusions in ac_math.h
#ifndef _INCLUDED_AC_MATH_H_
#define _INCLUDED_AC_MATH_H_
#include <ac_math/ac_abs.h>
// ac_abs()
#include <ac_math/ac_arccos_cordic.h>
// ac_arccos_cordic()
#include <ac_math/ac_arcsin_cordic.h>
// ac_arcsin_cordic()
#include <ac_math/ac_atan_pwl.h>
// ac_atan_pwl()
#include <ac_math/ac_atan_pwl_ha.h>
// ac_atan_pwl_ha()
#include <ac_math/ac_atan2_cordic.h>
// ac_atan2_cordic()
#include <ac_math/ac_barrel_shift.h>
//ac_barrel_shift()
#include <ac_math/ac_div.h>
// ac_div()
#include <ac_math/ac_hcordic.h>
// ac_log_cordic()
// ac_log2_cordic()
// ac_exp_cordic()
// ac_exp2_cordic()
// ac_pow_cordic()
#include <ac_math/ac_inverse_sqrt_pwl.h>
// ac_inverse_sqrt_pwl()
#include <ac_math/ac_log_pwl.h>
// ac_log_pwl()
// ac_log2_pwl()
#include <ac_math/ac_normalize.h>
// ac_normalize()
#include <ac_math/ac_pow_pwl.h>
// ac_pow2_pwl()
// ac_exp_pwl()
#include <ac_math/ac_reciprocal_pwl.h>
// ac_reciprocal_pwl()
#include <ac_math/ac_reciprocal_pwl_ha.h>
// ac_reciprocal_pwl_ha()
#include <ac_math/ac_shift.h>
// ac_shift_left()
// ac_shift_right()
#include <ac_math/ac_sigmoid_pwl.h>
// ac_sigmoid_pwl()
#include <ac_math/ac_sincos_cordic.h>
// ac_sincos_cordic()
#include <ac_math/ac_sincos_lut.h>
// ac_sincos_lut()
#include <ac_math/ac_sqrt.h>
// ac_sqrt()
#include <ac_math/ac_sqrt_pwl.h>
// ac_sqrt_pwl()
#include <ac_math/ac_tan_pwl.h>
// ac_tan_pwl()
#include <ac_math/ac_tanh_pwl.h>
// ac_tanh_pwl()
#include <ac_math/ac_softmax_pwl.h>
// ac_softmax_pwl()
#endif
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import "TiProxy.h"
#import "TiUtils.h"
#import "TiEvaluator.h"
@class TiHost;
/**
The base class for all FindATDN2 modules
*/
@interface TiModule : TiProxy
{
@protected
TiHost *host;
@private
CFMutableDictionaryRef classNameLookup;
NSString *moduleName;
id moduleAssets;
}
// internal
-(void)_setName:(NSString*)name;
-(void)setPageContext:(id<TiEvaluator>)evaluator;
-(void)setHost:(TiHost*)host;
-(id)createProxy:(NSArray*)args forName:(NSString*)name context:(id<TiEvaluator>)evaluator;
// module related utilities
-(NSString*)moduleId;
-(BOOL)isJSModule;
-(NSData*)moduleJS;
-(NSData*)loadModuleAsset:(NSString*)fromPath;
/*
Converts a resource name in to a URL.
@param name The name of the resource.
@return The URL of the resource
*/
-(NSURL*)moduleResourceURL:(NSString*)name;
-(id)bindCommonJSModule:(NSString*)code;
-(id)bindCommonJSModuleForPath:(NSURL*)path;
// lifecycle
/**
FindATDN2 Platform calls this method on startup.
*/
-(void)startup;
/**
FindATDN2 Platform calls this method on shutdown.
@param sender The sender of the event.
*/
-(void)shutdown:(id)sender;
/**
FindATDN2 Platform calls this method on suspend.
@param sender The sender of the event.
*/
-(void)suspend:(id)sender;
/**
FindATDN2 Platform calls this method on entering background.
@param sender The sender of the event.
*/
-(void)paused:(id)sender;
/**
FindATDN2 Platform calls this method on resume.
@param sender The sender of the event.
*/
-(void)resume:(id)sender;
/**
Tells the module that it was resumed.
@param sender The sender of the event.
*/
-(void)resumed:(id)sender;
@end
|
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the author nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BADVPN_SOCKS_UDP_CLIENT_SOCKSUDPCLIENT_H
#define BADVPN_SOCKS_UDP_CLIENT_SOCKSUDPCLIENT_H
#include <stdint.h>
#include <base/BPending.h>
#include <base/DebugObject.h>
#include <flow/BufferWriter.h>
#include <flow/PacketBuffer.h>
#include <flow/SinglePacketBuffer.h>
#include <flowextra/PacketPassInactivityMonitor.h>
#include <misc/debug.h>
#include <misc/socks_proto.h>
#include <socksclient/BSocksClient.h>
#include <structure/BAVL.h>
#include <system/BAddr.h>
#include <system/BDatagram.h>
#include <system/BReactor.h>
#include <system/BTime.h>
// This sets the number of packets to accept while waiting for SOCKS server to authenticate and
// connect. A slow or far-away SOCKS server could require 300 ms to connect, and a chatty
// client (e.g. STUN) could send a packet every 20 ms, so a limit of 16 seems reasonable.
#define SOCKS_UDP_SEND_BUFFER_PACKETS 16
typedef void (*SocksUdpClient_handler_received) (void *user, BAddr local_addr, BAddr remote_addr, const uint8_t *data, int data_len);
typedef struct {
BAddr server_addr;
const struct BSocksClient_auth_info *auth_info;
size_t num_auth_info;
int num_connections;
int max_connections;
int udp_mtu;
btime_t keepalive_time;
BReactor *reactor;
void *user;
SocksUdpClient_handler_received handler_received;
BAVL connections_tree; // By local_addr
DebugObject d_obj;
} SocksUdpClient;
struct SocksUdpClient_connection {
SocksUdpClient *client;
BAddr local_addr;
BSocksClient socks;
BufferWriter send_writer;
PacketBuffer send_buffer;
PacketPassInactivityMonitor send_monitor;
PacketPassInterface send_if;
BDatagram socket;
PacketPassInterface recv_if;
SinglePacketBuffer recv_buffer;
// The first_* members represent the initial packet, which has to be stored so it can wait for
// send_writer to become ready.
uint8_t *first_data;
int first_data_len;
BAddr first_remote_addr;
// If all packets sent so far have been sent to the same IP, port 53, with the
// same DNS ID, then this is that ID. Otherwise, it is -1. This is used to
// close ephemeral DNS query connections once a response is received.
int dns_id;
BPending first_job;
BAVLNode connections_tree_node;
};
/**
* Initializes the SOCKS5-UDP client object.
* This function does not perform network access, so it will always succeed if the arguments
* are valid.
*
* Currently, this function only supports connection to a SOCKS5 server that is routable from
* localhost (i.e. running on the local machine). It may be possible to add support for remote
* servers, but SOCKS5 does not support UDP if there is a NAT or firewall between the client
* and the proxy.
*
* @param o the object
* @param udp_mtu the maximum size of packets that will be sent through the tunnel
* @param max_connections how many local ports to track before dropping packets
* @param keepalive_time how long to track an idle local port before forgetting it
* @param server_addr SOCKS5 server address. MUST BE ON LOCALHOST.
* @param reactor reactor we live in
* @param user value passed to handler
* @param handler_received handler for incoming UDP packets
*/
void SocksUdpClient_Init (SocksUdpClient *o, int udp_mtu, int max_connections, btime_t keepalive_time,
BAddr server_addr, const struct BSocksClient_auth_info *auth_info, size_t num_auth_info,
BReactor *reactor, void *user, SocksUdpClient_handler_received handler_received);
void SocksUdpClient_Free (SocksUdpClient *o);
/**
* Submit a packet to be sent through the proxy.
*
* This will reuse an existing connection for packets from local_addr, or create one if
* there is none. If the number of live connections exceeds max_connections, or if the number of
* buffered packets from this port exceeds a limit, packets will be dropped silently.
*
* As a resource optimization, if a connection has only been used to send one DNS query, then
* the connection will be closed and freed once the reply is received.
*
* @param o the object
* @param local_addr the UDP packet's source address, and the expected destination for replies
* @param remote_addr the destination of the packet after it exits the proxy
* @param data the packet contents. Caller retains ownership.
*/
void SocksUdpClient_SubmitPacket (SocksUdpClient *o, BAddr local_addr, BAddr remote_addr, const uint8_t *data, int data_len);
#endif
|
//
// NSDictionary+nl_Kit.h
// jobsradar
//
// Created by nathan@hoomic.com on 15/5/11.
// Copyright (c) 2015年 Hoomic. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "NSDictionary+nl_Short.h"
#import "NSMutableDictionary+nl_Short.h"
@interface NSDictionary (nl_Kit)
- (BOOL)nl_hasKey:(NSString *)key;
/**
* @brief Returns a Boolean value that indicates whether a given object is present in the dictionary as a value.
* This method determines whether anObject is present in the values array by sending an isEqual: message to each
* of the array’s objects (and passing anObject as the parameter to each isEqual: message).
*
* @param value An object
*
* @return YES if anObject is present in the dictionary as a value, otherwise NO.
*/
- (BOOL)nl_containsValue:(NSString *)value;
/**
* @brief Returns the size of all instances of the dictionary keys.
*
* @return The size in bytes of all instances of the dictionary keys.
*/
- (NSUInteger)nl_sizeAllKeys;
/**
* @brief Returns the size of all instances of the dictionary values.
*
* @return The size in bytes of all instances of the dictionary values.
*/
- (NSUInteger)nl_sizeAllValues;
/**
* @brief Returns the size of all instances of the dictionary keys and values.
* eq: [self nl_sizeAllKeys] + [self nl_sizeAllValues]
*
* @return The size in bytes of all instances of the dictionary keys and values.
*/
- (NSUInteger)nl_sizeAllObjects;
/**
* @brief Convert the dictionary to json data.
*
* @return Json Data.
*/
- (NSData *)nl_toJsonData;
/**
* @brief Convert the dictionary to json string.
*
* @return Json string.
*/
- (NSString *)nl_toJsonString;
@end
@interface NSMutableDictionary (nl_SafeAccessory)
- (BOOL)nl_setObject:(id)object forKey:(id)key;
@end |
/** @file
* Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
#ifndef __MPAM_ACS_GIC_H__
#define __MPAM_ACS_GIC_H__
uint32_t g001_entry(uint32_t num_pe);
#endif
|
//
// Copyright (C) 2006 Andras Babos and Andras Varga
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//
#ifndef __INET_OSPFINTERFACESTATEWAITING_H
#define __INET_OSPFINTERFACESTATEWAITING_H
#include "inet/routing/ospfv2/interface/OSPFInterfaceState.h"
namespace inet {
namespace ospf {
class InterfaceStateWaiting : public InterfaceState
{
public:
virtual void processEvent(Interface *intf, Interface::InterfaceEventType event);
virtual Interface::InterfaceStateType getState() const { return Interface::WAITING_STATE; }
};
} // namespace ospf
} // namespace inet
#endif // ifndef __INET_OSPFINTERFACESTATEWAITING_H
|
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef HTMLObjectElement_h
#define HTMLObjectElement_h
#include "core/html/FormAssociatedElement.h"
#include "core/html/HTMLPlugInImageElement.h"
namespace WebCore {
class HTMLFormElement;
class HTMLObjectElement FINAL : public HTMLPlugInImageElement, public FormAssociatedElement {
public:
static PassRefPtr<HTMLObjectElement> create(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
virtual ~HTMLObjectElement();
bool isDocNamedItem() const { return m_docNamedItem; }
const String& classId() const { return m_classId; }
bool containsJavaApplet() const;
virtual bool useFallbackContent() const { return m_useFallbackContent; }
void renderFallbackContent();
// Implementations of FormAssociatedElement
HTMLFormElement* form() const { return FormAssociatedElement::form(); }
virtual bool isFormControlElement() const { return false; }
virtual bool isEnumeratable() const { return true; }
virtual bool appendFormData(FormDataList&, bool);
// Implementations of constraint validation API.
// Note that the object elements are always barred from constraint validation.
virtual String validationMessage() const OVERRIDE { return String(); }
bool checkValidity() { return true; }
virtual void setCustomValidity(const String&) OVERRIDE { }
using Node::ref;
using Node::deref;
virtual bool canContainRangeEndPoint() const { return useFallbackContent(); }
private:
HTMLObjectElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&);
virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE;
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual const AtomicString& imageSourceURL() const OVERRIDE;
virtual RenderWidget* renderWidgetForJSBindings() const;
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
virtual void updateWidget(PluginCreationOption);
void updateDocNamedItem();
void reattachFallbackContent();
bool hasFallbackContent() const;
// FIXME: This function should not deal with url or serviceType
// so that we can better share code between <object> and <embed>.
void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType);
bool shouldAllowQuickTimeClassIdQuirk();
bool hasValidClassId();
virtual void refFormAssociatedElement() { ref(); }
virtual void derefFormAssociatedElement() { deref(); }
virtual HTMLFormElement* virtualForm() const;
virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return isDocNamedItem(); }
virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return isDocNamedItem(); }
String m_classId;
bool m_docNamedItem : 1;
bool m_useFallbackContent : 1;
};
}
#endif
|
/*
* Copyright 2013 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _SDF_VISIBLE_HH_
#define _SDF_VISIBLE_HH_
/** \def SDFORMAT_VISIBLE
* Use to represent "symbol visible" if supported
*/
/** \def SDFORMAT_HIDDEN
* Use to represent "symbol hidden" if supported
*/
#if defined _WIN32 || defined __CYGWIN__
#ifdef BUILDING_DLL
#ifdef __GNUC__
#define SDFORMAT_VISIBLE __attribute__ ((dllexport))
#else
#define SDFORMAT_VISIBLE __declspec(dllexport)
#endif
#else
#ifdef __GNUC__
#define SDFORMAT_VISIBLE __attribute__ ((dllimport))
#else
#define SDFORMAT_VISIBLE __declspec(dllimport)
#endif
#endif
#define SDFORMAT_HIDDEN
#else
#if __GNUC__ >= 4
#define SDFORMAT_VISIBLE __attribute__ ((visibility ("default")))
#define SDFORMAT_HIDDEN __attribute__ ((visibility ("hidden")))
#else
#define SDFORMAT_VISIBLE
#define SDFORMAT_HIDDEN
#endif
#endif
#endif /* SDFORMAT_VISIBLE_HH */
|
/*
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id$
*/
#include <stdlib.h>
#include "apt_task_msg.h"
/** Abstract pool of task messages to allocate task messages from */
struct apt_task_msg_pool_t {
void (*destroy)(apt_task_msg_pool_t *pool);
apt_task_msg_t* (*acquire_msg)(apt_task_msg_pool_t *pool);
void (*release_msg)(apt_task_msg_t *task_msg);
void *obj;
apr_pool_t *pool;
};
/** Dynamic allocation of messages (no actual pool exist)*/
typedef struct apt_msg_pool_dynamic_t apt_msg_pool_dynamic_t;
struct apt_msg_pool_dynamic_t {
apr_size_t size;
};
static apt_task_msg_t* dynamic_pool_acquire_msg(apt_task_msg_pool_t *task_msg_pool)
{
apt_msg_pool_dynamic_t *dynamic_pool = task_msg_pool->obj;
apt_task_msg_t *task_msg = malloc(dynamic_pool->size);
task_msg->msg_pool = task_msg_pool;
task_msg->type = TASK_MSG_USER;
task_msg->sub_type = 0;
return task_msg;
}
static void dynamic_pool_release_msg(apt_task_msg_t *task_msg)
{
if(task_msg) {
free(task_msg);
}
}
static void dynamic_pool_destroy(apt_task_msg_pool_t *task_msg_pool)
{
/* nothing to do */
}
APT_DECLARE(apt_task_msg_pool_t*) apt_task_msg_pool_create_dynamic(apr_size_t msg_size, apr_pool_t *pool)
{
apt_task_msg_pool_t *task_msg_pool = apr_palloc(pool,sizeof(apt_task_msg_pool_t));
apt_msg_pool_dynamic_t *dynamic_pool = apr_palloc(pool,sizeof(apt_msg_pool_dynamic_t));
dynamic_pool->size = msg_size + sizeof(apt_task_msg_t) - 1;
task_msg_pool->pool = pool;
task_msg_pool->obj = dynamic_pool;
task_msg_pool->acquire_msg = dynamic_pool_acquire_msg;
task_msg_pool->release_msg = dynamic_pool_release_msg;
task_msg_pool->destroy = dynamic_pool_destroy;
return task_msg_pool;
}
/** Static allocation of messages from message pool (not implemented yet) */
APT_DECLARE(apt_task_msg_pool_t*) apt_task_msg_pool_create_static(apr_size_t msg_size, apr_size_t pool_size, apr_pool_t *pool)
{
return NULL;
}
APT_DECLARE(void) apt_task_msg_pool_destroy(apt_task_msg_pool_t *msg_pool)
{
if(msg_pool->destroy) {
msg_pool->destroy(msg_pool);
}
}
APT_DECLARE(apt_task_msg_t*) apt_task_msg_acquire(apt_task_msg_pool_t *task_msg_pool)
{
if(!task_msg_pool->acquire_msg)
return NULL;
return task_msg_pool->acquire_msg(task_msg_pool);
}
APT_DECLARE(void) apt_task_msg_release(apt_task_msg_t *task_msg)
{
apt_task_msg_pool_t *task_msg_pool = task_msg->msg_pool;
if(task_msg_pool->release_msg)
task_msg_pool->release_msg(task_msg);
}
|
/***************************************************************************
* Copyright (C) 2005 by Francisco J. Ros *
* fjrm@dif.um.es *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef __DEFS_H__
#define __DEFS_H__
#ifdef OMNETPP
#include "inet/routing/extras/base/compatibility.h"
#endif
#ifndef NS_NO_GLOBALS
#ifndef NS_PORT
#include <net/if.h>
#include <netinet/in.h>
#define NS_CLASS
#define NS_STATIC static
#define NS_INLINE inline
#else
#define NS_CLASS DYMOUM::
#define NS_STATIC
#define NS_INLINE inline
#ifndef OMNETPP
#define NS_DEV_NR 0
#define NS_IFINDEX 0
#endif
#endif /* NS_PORT */
/* Version information */
#define DYMO_UM_VERSION "0.3"
#define DYMO_DRAFT_VERSION "Draft-05"
/* Misc defines */
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif /* MAX */
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
#ifndef NULL
#define NULL ((void *) 0)
#endif /* NULL */
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#endif /* IFNAMSIZ */
/* Maximum number of interfaces per node */
#define DYMO_MAX_NR_INTERFACES 10
#ifndef OMNETPP
/* Returns a dev_info struct given its corresponding iface index */
#define DEV_IFINDEX(ifindex) (this_host.devs[ifindex2devindex(ifindex)])
/* Returns a dev_info struct given its corresponding device number */
#define DEV_NR(n) (this_host.devs[n])
#else
#define DEV_IFINDEX(n) (this_host.devs[n])
#define DEV_NR(n) (this_host.devs[n])
#endif
namespace inet {
namespace inetmanet {
/* Data for a network device */
struct dev_info
{
int enabled; /* 1 if struct is used, else 0 */
int sock; /* DYMO socket associated with this device */
int icmp_sock; /* Raw socket used to send/receive ICMP messages */
u_int32_t ifindex; /* Index for this interface */
char ifname[IFNAMSIZ];/* Interface name */
struct in_addr ipaddr; /* The local IP address */
struct in_addr bcast; /* Broadcast address */
};
/* Data for a host */
struct host_info
{
u_int32_t seqnum; /* Sequence number */
u_int8_t prefix : 7; /* Prefix */
u_int8_t is_gw : 1; /* Is this host a gateway? */
int nif; /* Number of interfaces to broadcast on */
struct dev_info devs[DYMO_MAX_NR_INTERFACES];
};
} // namespace inetmanet
} // namespace inet
#endif /* NS_NO_GLOBALS */
#ifndef NS_NO_DECLARATIONS
/* Information about this host */
#ifndef OMNETPP
/* in omnet++ version this variables are defined private in the file dymo_um_omnet.h inside the definition of the class DYMOUM */
struct host_info this_host;
/* Array of interface indices */
u_int32_t dev_indices[DYMO_MAX_NR_INTERFACES];
/* Given a network interface index, returns the index into the
devs array */
NS_STATIC NS_INLINE int ifindex2devindex(u_int32_t ifindex)
{
int i;
for (i = 0; i < this_host.nif; i++)
if (dev_indices[i] == ifindex)
return i;
return -1;
}
#endif
#endif /* NS_NO_DECLARATIONS */
#ifndef NS_PORT
/* Callback functions */
typedef void (*callback_func_t) (int);
int attach_callback_func(int fd, callback_func_t func);
/* Given a socket descriptor, returns the corresponding dev_info
struct */
static inline struct dev_info *devfromsock(int sock)
{
int i;
for (i = 0; i < this_host.nif; i++)
if (this_host.devs[i].sock == sock)
return &this_host.devs[i];
return NULL;
}
/* Given an ICMP socket descriptor, returns the corresponding dev_info
struct */
static inline struct dev_info *devfromicmpsock(int icmp_sock)
{
int i;
for (i = 0; i < this_host.nif; i++)
if (this_host.devs[i].icmp_sock == icmp_sock)
return &this_host.devs[i];
return NULL;
}
#endif /* NS_PORT */
#endif /* __DEFS_H__ */
|
//
// SettingsViewController.h
// example
//
// Created by Jake Farrell on 1/23/12.
// Copyright (c) 2012 ONESite. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DDSSocialAccounts.h"
#import "Facebook.h"
#import "TwitterSessionDelegate.h"
@interface SettingsViewController : UITableViewController<UIActionSheetDelegate, FBSessionDelegate, FBRequestDelegate, TwitterSessionDelegate>
{
DDSSocialAccounts *_accounts;
UIActionSheet *loginPopupQuery;
}
@property (nonatomic, retain) DDSSocialAccounts *accounts;
- (void)backAction;
- (void)logoutAction;
- (void)showAccountError:(NSString*)provider;
- (void)showConnectError:(NSString*)provider;
- (void)unlinkAccount:(NSString*)provider;
// Facebook
- (void)displayFacebookLogin;
// Twitter
- (void)displayTwitterLogin;
@end
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkAddImageAdaptor_h
#define __itkAddImageAdaptor_h
#include "itkImageAdaptor.h"
#include "itkAddPixelAccessor.h"
namespace itk
{
/** \class AddImageAdaptor
* \brief Presents an image as being the addition of a constant value to all pixels
*
* Additional casting is performed according to the input and output image
* types following C++ default casting rules.
*
* \ingroup ImageAdaptors
* \ingroup ITKImageAdaptors
*/
template< typename TImage >
class AddImageAdaptor:public
ImageAdaptor< TImage,
Accessor::AddPixelAccessor< typename TImage::PixelType > >
{
public:
/** Standard class typedefs. */
typedef AddImageAdaptor Self;
typedef ImageAdaptor< TImage,
Accessor::AddPixelAccessor<
typename TImage::PixelType > > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
typedef typename TImage::PixelType PixelType;
/** Run-time type information (and related methods). */
itkTypeMacro(AddImageAdaptor, ImageAdaptor);
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Set the value to be added to image pixels */
void SetValue(const PixelType newvalue)
{ this->GetPixelAccessor().SetValue(newvalue); }
/** Get the value to be added to image pixels */
PixelType GetValue() const
{ return this->GetPixelAccessor().GetValue(); }
protected:
AddImageAdaptor() {}
virtual ~AddImageAdaptor() {}
private:
AddImageAdaptor(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
};
} // end namespace itk
#endif
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/editor/idl/nsIURIRefObject.idl
*/
#ifndef __gen_nsIURIRefObject_h__
#define __gen_nsIURIRefObject_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
#ifndef __gen_domstubs_h__
#include "domstubs.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIDOMNode; /* forward declaration */
/* starting interface: nsIURIRefObject */
#define NS_IURIREFOBJECT_IID_STR "2226927e-1dd2-11b2-b57f-faab47288563"
#define NS_IURIREFOBJECT_IID \
{0x2226927e, 0x1dd2, 0x11b2, \
{ 0xb5, 0x7f, 0xfa, 0xab, 0x47, 0x28, 0x85, 0x63 }}
/** A class which can represent any node which points to an
* external URI, e.g. <a>, <img>, <script> etc,
* and has the capability to rewrite URLs to be
* relative or absolute.
* Used by the editor but not dependant on it.
*/
class NS_NO_VTABLE NS_SCRIPTABLE nsIURIRefObject : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IURIREFOBJECT_IID)
/* attribute nsIDOMNode node; */
NS_SCRIPTABLE NS_IMETHOD GetNode(nsIDOMNode **aNode) = 0;
NS_SCRIPTABLE NS_IMETHOD SetNode(nsIDOMNode *aNode) = 0;
/**
* Go back to the beginning of the attribute list.
*/
/* void Reset (); */
NS_SCRIPTABLE NS_IMETHOD Reset(void) = 0;
/**
* Return the next rewritable URI.
*/
/* DOMString GetNextURI (); */
NS_SCRIPTABLE NS_IMETHOD GetNextURI(nsAString & _retval NS_OUTPARAM) = 0;
/**
* Go back to the beginning of the attribute list
*
* @param aOldPat Old pattern to be replaced, e.g. file:///a/b/
* @param aNewPat New pattern to be replaced, e.g. http://mypage.aol.com/
* @param aMakeRel Rewrite links as relative vs. absolute
*/
/* void RewriteAllURIs (in DOMString aOldPat, in DOMString aNewPat, in boolean aMakeRel); */
NS_SCRIPTABLE NS_IMETHOD RewriteAllURIs(const nsAString & aOldPat, const nsAString & aNewPat, PRBool aMakeRel) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIURIRefObject, NS_IURIREFOBJECT_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIURIREFOBJECT \
NS_SCRIPTABLE NS_IMETHOD GetNode(nsIDOMNode **aNode); \
NS_SCRIPTABLE NS_IMETHOD SetNode(nsIDOMNode *aNode); \
NS_SCRIPTABLE NS_IMETHOD Reset(void); \
NS_SCRIPTABLE NS_IMETHOD GetNextURI(nsAString & _retval NS_OUTPARAM); \
NS_SCRIPTABLE NS_IMETHOD RewriteAllURIs(const nsAString & aOldPat, const nsAString & aNewPat, PRBool aMakeRel);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIURIREFOBJECT(_to) \
NS_SCRIPTABLE NS_IMETHOD GetNode(nsIDOMNode **aNode) { return _to GetNode(aNode); } \
NS_SCRIPTABLE NS_IMETHOD SetNode(nsIDOMNode *aNode) { return _to SetNode(aNode); } \
NS_SCRIPTABLE NS_IMETHOD Reset(void) { return _to Reset(); } \
NS_SCRIPTABLE NS_IMETHOD GetNextURI(nsAString & _retval NS_OUTPARAM) { return _to GetNextURI(_retval); } \
NS_SCRIPTABLE NS_IMETHOD RewriteAllURIs(const nsAString & aOldPat, const nsAString & aNewPat, PRBool aMakeRel) { return _to RewriteAllURIs(aOldPat, aNewPat, aMakeRel); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIURIREFOBJECT(_to) \
NS_SCRIPTABLE NS_IMETHOD GetNode(nsIDOMNode **aNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNode(aNode); } \
NS_SCRIPTABLE NS_IMETHOD SetNode(nsIDOMNode *aNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetNode(aNode); } \
NS_SCRIPTABLE NS_IMETHOD Reset(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Reset(); } \
NS_SCRIPTABLE NS_IMETHOD GetNextURI(nsAString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNextURI(_retval); } \
NS_SCRIPTABLE NS_IMETHOD RewriteAllURIs(const nsAString & aOldPat, const nsAString & aNewPat, PRBool aMakeRel) { return !_to ? NS_ERROR_NULL_POINTER : _to->RewriteAllURIs(aOldPat, aNewPat, aMakeRel); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsURIRefObject : public nsIURIRefObject
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIURIREFOBJECT
nsURIRefObject();
private:
~nsURIRefObject();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsURIRefObject, nsIURIRefObject)
nsURIRefObject::nsURIRefObject()
{
/* member initializers and constructor code */
}
nsURIRefObject::~nsURIRefObject()
{
/* destructor code */
}
/* attribute nsIDOMNode node; */
NS_IMETHODIMP nsURIRefObject::GetNode(nsIDOMNode **aNode)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsURIRefObject::SetNode(nsIDOMNode *aNode)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void Reset (); */
NS_IMETHODIMP nsURIRefObject::Reset()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* DOMString GetNextURI (); */
NS_IMETHODIMP nsURIRefObject::GetNextURI(nsAString & _retval NS_OUTPARAM)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void RewriteAllURIs (in DOMString aOldPat, in DOMString aNewPat, in boolean aMakeRel); */
NS_IMETHODIMP nsURIRefObject::RewriteAllURIs(const nsAString & aOldPat, const nsAString & aNewPat, PRBool aMakeRel)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIURIRefObject_h__ */
|
//
// MeetingDetailViewController.h
// Meep
//
// Created by Alex Jarvis on 03/03/2011.
// Copyright 2011 Alex Jarvis. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Three20/Three20.h>
#import "MeetingDetailCell.h"
#import "AcceptMeetingRequestManager.h"
#import "DeclineMeetingRequestManager.h"
#import "DeleteMeetingRequestManager.h"
#import "UpdateMinutesBeforeRequestManager.h"
#import "MeetingDTO.h"
#import "MeetingDetailCell.h"
#import "MBProgressHUD.h"
#define DESC_CELL_FONT_SIZE 13.0f
#define DESC_CELL_WIDTH 300.0f
#define DESC_CELL_MARGIN 10.0f
@interface MeetingDetailViewController : UITableViewController <MeetingDetailCellDelegate,
AcceptMeetingRequestManagerDelegate,
DeclineMeetingRequestManagerDelegate,
DeleteMeetingRequestManagerDelegate,
UpdateMinutesBeforeRequestManagerDelegate,
UIAlertViewDelegate> {
NSUInteger awaitingReply;
NSUInteger attending;
NSUInteger notAttending;
MeetingDTO *previousMeeting;
MeetingDTO *thisMeeting;
AcceptMeetingRequestManager *acceptMeetingRequestManager;
DeclineMeetingRequestManager *declineMeetingRequestManager;
DeleteMeetingRequestManager *deleteMeetingRequestManager;
UpdateMinutesBeforeRequestManager *updateMinutesBeforeRequestManager;
MeetingDetailCell *meetingDetailCell;
BOOL listenToSegmentChanges;
BOOL showAlertMeSlider;
NSInteger oldSegmentValue;
IBOutlet UIButton *deleteMeetingButton;
UIAlertView *deleteMeetingAlertView;
NSNumber *minutesBefore;
MBProgressHUD *hud;
}
@property (nonatomic, retain) MeetingDTO *previousMeeting;
@property (nonatomic, retain) MeetingDTO *thisMeeting;
@property (nonatomic, retain) AcceptMeetingRequestManager *acceptMeetingRequestManager;
@property (nonatomic, retain) DeclineMeetingRequestManager *declineMeetingRequestManager;
@property (nonatomic, retain) DeleteMeetingRequestManager *deleteMeetingRequestManager;
@property (nonatomic, retain) UpdateMinutesBeforeRequestManager *updateMinutesBeforeRequestManager;
@property (nonatomic, retain) MeetingDetailCell *meetingDetailCell;
@property (nonatomic, retain) UIButton *deleteMeetingButton;
@end
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.Array
struct Il2CppArray;
#include "mscorlib_System_ValueType4014882752.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Array/InternalEnumerator`1<Mono.Math.BigInteger>
struct InternalEnumerator_1_t1601579431
{
public:
// System.Array System.Array/InternalEnumerator`1::array
Il2CppArray * ___array_0;
// System.Int32 System.Array/InternalEnumerator`1::idx
int32_t ___idx_1;
public:
inline static int32_t get_offset_of_array_0() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t1601579431, ___array_0)); }
inline Il2CppArray * get_array_0() const { return ___array_0; }
inline Il2CppArray ** get_address_of_array_0() { return &___array_0; }
inline void set_array_0(Il2CppArray * value)
{
___array_0 = value;
Il2CppCodeGenWriteBarrier(&___array_0, value);
}
inline static int32_t get_offset_of_idx_1() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t1601579431, ___idx_1)); }
inline int32_t get_idx_1() const { return ___idx_1; }
inline int32_t* get_address_of_idx_1() { return &___idx_1; }
inline void set_idx_1(int32_t value)
{
___idx_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
#include <stdio.h>
#include <string.h>
#define maxx 2000010
char str1[maxx],str2[maxx];
int main()
{
int len1,len2,i,j,l,k;
while(scanf("%s %s",str1,str2)==2)
{
len1 = strlen(str1);
len2 = strlen(str2);
l = 0,k=0;
for(i=0; i<len1; i++)
{
for(j=l; j<len2; j++)
{
if(str2[j]==str1[i])
{
l = j + 1;
k++;
break;
}
}
}
str1[len1] = '\0';
str2[len2] = '\0';
if(len1==k)
printf("Yes\n");
else
printf("No\n");
memset(str1,'\0',sizeof(str1));
memset(str2,'\0',sizeof(str2));
}
return 0;
}
|
//
// Copyright 2009-2011 Facebook
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface UIViewController (TTCategory)
/**
* Determines whether a controller is primarily a container of other controllers.
*
* @default NO
*/
@property (nonatomic, readonly) BOOL canContainControllers;
/**
* Whether or not this controller should ever be counted as the "top" view controller. This is
* used for the purposes of determining which controllers should have modal controllers presented
* within them.
*
* @default YES; subclasses may override to NO if they so desire.
*/
@property (nonatomic, readonly) BOOL canBeTopViewController;
/**
* The view controller that contains this view controller.
*
* This is just like parentViewController, except that it is not readonly. This property offers
* custom UIViewController subclasses the chance to tell TTNavigator how to follow the hierarchy
* of view controllers.
*/
@property (nonatomic, strong) UIViewController* superController;
/**
* The child of this view controller which is most visible.
*
* This would be the selected view controller of a tab bar controller, or the top
* view controller of a navigation controller. This property offers custom UIViewController
* subclasses the chance to tell TTNavigator how to follow the hierarchy of view controllers.
*/
- (UIViewController*)topSubcontroller;
/**
* The view controller that comes before this one in a navigation controller's history.
*
* This is an App Store-compatible version of previousViewController.
*/
- (UIViewController*)ttPreviousViewController;
/**
* The view controller that comes after this one in a navigation controller's history.
*/
- (UIViewController*)nextViewController;
/**
* A popup view controller that is presented on top of this view controller.
*/
@property (nonatomic, strong) UIViewController* popupViewController;
/**
* Displays a controller inside this controller.
*
* TTURLMap uses this to display newly created controllers. The default does nothing --
* UIViewController categories and subclasses should implement to display the controller
* in a manner specific to them.
*/
- (void)addSubcontroller:(UIViewController*)controller animated:(BOOL)animated
transition:(UIViewAnimationTransition)transition;
/**
* Dismisses a view controller using the opposite transition it was presented with.
*/
- (void)removeFromSupercontroller;
- (void)removeFromSupercontrollerAnimated:(BOOL)animated;
/**
* Brings a controller that is a child of this controller to the front.
*
* TTURLMap uses this to display controllers that exist already, but may not be visible.
* The default does nothing -- UIViewController categories and subclasses should implement
* to display the controller in a manner specific to them.
*/
- (void)bringControllerToFront:(UIViewController*)controller animated:(BOOL)animated;
/**
* Gets a key that can be used to identify a subcontroller in subcontrollerForKey.
*/
- (NSString*)keyForSubcontroller:(UIViewController*)controller;
/**
* Gets a subcontroller with the key that was returned from keyForSubcontroller.
*/
- (UIViewController*)subcontrollerForKey:(NSString*)key;
/**
* Persists aspects of the view state to a dictionary that can later be used to restore it.
*
* This will be called when TTNavigator is persisting the navigation history so that it
* can later be restored. This usually happens when the app quits, or when there is a low
* memory warning.
*
* Return NO to avoid adding this controller to the navigation history.
*
* Default return value: YES
*/
- (BOOL)persistView:(NSMutableDictionary*)state;
/**
* Restores aspects of the view state from a dictionary populated by persistView.
*
* This will be called when TTNavigator is restoring the navigation history. This may
* happen after launch, or when the controller appears again after a low memory warning.
*/
- (void)restoreView:(NSDictionary*)state;
/**
* XXXjoe Not documenting this in the hopes that I can eliminate it ;)
*/
- (void)persistNavigationPath:(NSMutableArray*)path;
/**
* Finishes initializing the controller after a TTNavigator-coordinated delay.
*
* If the controller was created in between calls to TTNavigator beginDelay and endDelay, then
* this will be called after endDelay.
*/
- (void)delayDidEnd;
/**
* Shows or hides the navigation and status bars.
*/
- (void)showBars:(BOOL)show animated:(BOOL)animated;
/**
* Shortcut for its animated-optional cousin.
*/
- (void)dismissModalViewController;
/**
* Forcefully initiates garbage collection. You may call this in your didReceiveMemoryWarning
* message if you are worried about garbage collection memory consumption.
*
* See Articles/UI/GarbageCollection.mdown for a more detailed discussion.
*/
+ (void)doCommonGarbageCollection;
@end
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/searchlib/fef/blueprint.h>
#include <vespa/searchlib/fef/table.h>
#include "termdistancecalculator.h"
namespace search::features {
/**
* This struct contains parameters used by the executor.
**/
struct TermDistanceParams {
uint32_t fieldId;
uint32_t termX;
uint32_t termY;
TermDistanceParams() : fieldId(0), termX(0), termY(0) {}
};
/**
* Implements the executor for calculating min term distance (forward and reverse).
**/
class TermDistanceExecutor : public fef::FeatureExecutor
{
private:
QueryTerm _termA;
QueryTerm _termB;
const fef::MatchData *_md;
virtual void handle_bind_match_data(const fef::MatchData &md) override;
public:
TermDistanceExecutor(const fef::IQueryEnvironment & env,
const TermDistanceParams & params);
void execute(uint32_t docId) override;
bool valid() const;
};
/**
* Implements the blueprint for the term distance executor.
**/
class TermDistanceBlueprint : public fef::Blueprint {
private:
TermDistanceParams _params;
public:
TermDistanceBlueprint();
void visitDumpFeatures(const fef::IIndexEnvironment & env, fef::IDumpFeatureVisitor & visitor) const override;
fef::Blueprint::UP createInstance() const override;
fef::ParameterDescriptions getDescriptions() const override {
return fef::ParameterDescriptions().desc().indexField(fef::ParameterCollection::ANY).number().number();
}
bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override;
fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override;
};
}
|
#pragma once
class ZN_API CRendererWoW
: public RendererBase
{
public:
CRendererWoW(IBaseManager& BaseManager, IScene& Scene);
virtual ~CRendererWoW();
void InitializeForward(std::shared_ptr<IRenderTarget> OutputRenderTarget);
void InitializeDeffered(std::shared_ptr<IRenderTarget> OutputRenderTarget);
public:
std::shared_ptr<IBlendState> GetEGxBlend(uint32 Index) const;
private:
std::shared_ptr<IRenderTarget> CreateGBuffer(std::shared_ptr<IRenderTarget> RenderTarget);
private: // Blend mode
void InitEGxBlend(IRenderDevice& RenderDevice);
IBlendState::BlendMode GetEGxBlendMode(uint32 Index);
private:
std::shared_ptr<IRenderPassCreateTypelessList> m_SceneListTypelessPass;
std::shared_ptr<CPassDeffered_ShadowMaps> m_ShadowMapsPass;
std::shared_ptr<CPassDeffered_RenderUIQuad> m_Deffered_UIQuadPass;
std::map<uint32, std::shared_ptr<IBlendState>> m_EGxBlendStates;
}; |
// Weibo
//
// Created by Fay on 15/10/3.
// Copyright (c) 2015年 Fay. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface NSString (Extension)
- (CGSize)SizeWithFont:(UIFont *)font maxW:(CGFloat)maxW;
- (CGSize)SizeWithFont:(UIFont *)font;
@end
// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com |
//
// NSString+JWStringDeleteToURL.h
// 吃货美食
//
// Created by scjy on 16/5/11.
// Copyright © 2016年 赵天. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (JWStringDeleteToURL)
/**
* string删除
*
* @param string 原本的string
* @param deleteString 要删的string
*
* @return 删除完的string
*/
- (NSString *)string:(NSString *)string withDeleteString:(NSString *)deleteString;
/**
* string删除“\”
*
* @param string 原本的string
*
* @return 删除完的string
*/
- (NSString *)stringDeleteToURL:(NSString *)string;
@end
|
/*
* test.h
*
* Header file for the test suite.
*
* Created on: Jan 16, 2017
* Author: pyk
*/
#include <stdint.h>
#ifndef TEST_H_
#define TEST_H_
void test();
#endif /* TEST_H_ */
|
#ifndef POLARBEAR_H
#define POLARBEAR_H
#include "hibike_device.h" //to get the hibike framework
#define NUM_PARAMS 15
typedef enum {
MANUALDRIVE = 0,
PID_VEL = 1,
PID_POS = 2
} DriveModes;
typedef enum {
DUTY_CYCLE = 0,
PID_POS_SETPOINT = 1,
PID_POS_KP = 2,
PID_POS_KI = 3,
PID_POS_KD = 4,
PID_VEL_SETPOINT = 5,
PID_VEL_KP = 6,
PID_VEL_KI = 7,
PID_VEL_KD = 8,
CURRENT_THRESH = 9,
ENC_POS = 10,
ENC_VEL = 11,
MOTOR_CURRENT = 12,
DEADBAND = 13
} param;
// function prototypes
void setup();
void loop();
float readPWMInput();
void resetPWMInput();
void resetDriveMode();
uint8_t readDriveMode();
#endif /* POLARBEAR_H */
|
//
// YBHomePictuerDismissAnimatedTransitioning.h
// weiBoOC
//
// Created by MAC on 15/12/5.
// Copyright © 2015年 MAC. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface YBHomePictuerDismissAnimatedTransitioning : NSObject <UIViewControllerAnimatedTransitioning>
@end
|
#ifndef FRUSTUM_H
#define FRUSTUM_H
#define deg2rad2(d) (M_PI*(d)/180)
///////////////////////////////////////////////////////////////////////////////
// draw frustum
///////////////////////////////////////////////////////////////////////////////
void drawFrustum(float fovY, float aspectRatio, float nearPlane, Vector4f colorLineV, Vector4f colorPlaneV)//, float farPlane)
{
float tangent = tanf(deg2rad2(fovY/2));
float nearHeight = nearPlane * tangent;
float nearWidth = nearHeight * aspectRatio;
// float farHeight = farPlane * tangent;
// float farWidth = farHeight * aspectRatio;
// compute 8 vertices of the frustum
float vertices[4][3];
// near top right
vertices[0][0] = nearWidth; vertices[0][1] = nearHeight; vertices[0][2] = -nearPlane;
// near top left
vertices[1][0] = -nearWidth; vertices[1][1] = nearHeight; vertices[1][2] = -nearPlane;
// near bottom left
vertices[2][0] = -nearWidth; vertices[2][1] = -nearHeight; vertices[2][2] = -nearPlane;
// near bottom right
vertices[3][0] = nearWidth; vertices[3][1] = -nearHeight; vertices[3][2] = -nearPlane;
// // far top right
// vertices[4][0] = farWidth; vertices[4][1] = farHeight; vertices[4][2] = -farPlane;
// // far top left
// vertices[5][0] = -farWidth; vertices[5][1] = farHeight; vertices[5][2] = -farPlane;
// // far bottom left
// vertices[6][0] = -farWidth; vertices[6][1] = -farHeight; vertices[6][2] = -farPlane;
// // far bottom right
// vertices[7][0] = farWidth; vertices[7][1] = -farHeight; vertices[7][2] = -farPlane;
//float colorLine1[4] = { 0.7f, 0.7f, 0.7f, 0.7f };
//float colorLine2[4] = { 0.2f, 0.2f, 0.2f, 0.7f };
//float colorPlane[4] = { 0.5f, 0.5f, 0.5f, 0.5f };
//glDisable(GL_LIGHTING);
//glDisable(GL_CULL_FACE);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// draw the edges around frustum
glLineWidth(1);
//glColor3f(1,1,1);
glBegin(GL_LINES);
glColor4fv(colorLineV.data());
glVertex3f(0, 0, 0);
//glColor4fv(colorLine1);
glVertex3fv(vertices[0]);
//glColor4fv(colorLine2);
glVertex3f(0, 0, 0);
//glColor4fv(colorLine1);
glVertex3fv(vertices[1]);
//glColor4fv(colorLine2);
glVertex3f(0, 0, 0);
//glColor4fv(colorLine1);
glVertex3fv(vertices[2]);
//glColor4fv(colorLine2);
glVertex3f(0, 0, 0);
//glColor4fv(colorLine1);
glVertex3fv(vertices[3]);
glEnd();
//glColor4fv(colorLine1);
// glBegin(GL_LINE_LOOP);
// glVertex3fv(vertices[4]);
// glVertex3fv(vertices[5]);
// glVertex3fv(vertices[6]);
// glVertex3fv(vertices[7]);
// glEnd();
//glColor4fv(colorLine1);
glBegin(GL_LINE_LOOP);
glVertex3fv(vertices[0]);
glVertex3fv(vertices[1]);
glVertex3fv(vertices[2]);
glVertex3fv(vertices[3]);
glEnd();
// draw near and far plane
glColor4fv(colorPlaneV.data());
//glColor3f(0,0,0);
glBegin(GL_QUADS);
glVertex3fv(vertices[0]);
glVertex3fv(vertices[1]);
glVertex3fv(vertices[2]);
glVertex3fv(vertices[3]);
// glVertex3fv(vertices[4]);
// glVertex3fv(vertices[5]);
// glVertex3fv(vertices[6]);
// glVertex3fv(vertices[7]);
glEnd();
//glEnable(GL_CULL_FACE);
//glEnable(GL_LIGHTING);
}
#endif // FRUSTUM_H
|
/******************************************************************************
** File Name: JpegDec_init.h *
** Author: Xiaowei Luo *
** DATE: 12/14/2006 *
** Copyright: 2006 Spreatrum, Incoporated. All Rights Reserved. *
** Description: This file defines the operation interfaces of macroblock *
** operation of mp4 deccoder. *
*****************************************************************************/
/******************************************************************************
** Edit History *
**---------------------------------------------------------------------------*
** DATE NAME DESCRIPTION *
** 12/14/2006 Xiaowei Luo Create. *
*****************************************************************************/
#ifndef _JPEGDEC_INIT_H_
#define _JPEGDEC_INIT_H_
/*----------------------------------------------------------------------------*
** Dependencies *
**---------------------------------------------------------------------------*/
#include "jpegcodec_def.h"
/**---------------------------------------------------------------------------*
** Compiler Flag *
**---------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
{
#endif
PUBLIC JPEG_RET_E JPEG_FWInitDecInput(JPEG_DEC_INPUT_PARA_T *jpeg_dec_input);
PUBLIC void JpegDec_HwTopRegCfg(void);
PUBLIC void JpegDec_HwSubModuleCfg(uint32 header_length);
PUBLIC void JPEGFW_AllocMCUBuf(void);
PUBLIC void JpegDec_HwTopUpdateYUVAddr(uint32 y_phy_addr,uint32_t u_phy_addr,uint32_t v_phy_addr);
/**---------------------------------------------------------------------------*
** Compiler Flag *
**---------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
/**---------------------------------------------------------------------------*/
// End
#endif //_JPEGDEC_INIT_H_
|
//
// RenrenPackage.h
// MobiSageSDK
//
// Created by Ryou Zhang on 11/9/11.
// Copyright (c) 2011 mobiSage. All rights reserved.
//
#import "MobiSageSNSPackage.h"
@interface MSRenrenPackage : MobiSageSNSPackage
{
@protected
NSString* m_ClientID;
NSString* m_SecretKey;
NSString* m_AccessToken;
NSString* m_UrlPath;
NSString* m_HttpMethod;
BOOL m_IsSignature;
NSMutableDictionary* m_ParamDic;
}
-(id)initWithClientID:(NSString*)clientID;
-(id)initWithAccessToken:(NSString*)accessToken SecretKey:(NSString*)secretKey clientID:(NSString*)clientID;
-(void)addParameter:(NSString*)name Value:(NSString*)value;
-(void)generateHTTPBody:(NSMutableURLRequest*)request;
@end
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/elasticbeanstalk/ElasticBeanstalk_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace ElasticBeanstalk
{
namespace Model
{
/**
* <p>A link to another environment, defined in the environment's manifest. Links
* provide connection information in system properties that can be used to connect
* to another environment in the same group. See <a
* href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html">Environment
* Manifest (env.yaml)</a> for details.</p>
*/
class AWS_ELASTICBEANSTALK_API EnvironmentLink
{
public:
EnvironmentLink();
EnvironmentLink(const Aws::Utils::Xml::XmlNode& xmlNode);
EnvironmentLink& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
void OutputToStream(Aws::OStream& oStream, const char* location) const;
/**
* <p>The name of the link.</p>
*/
inline const Aws::String& GetLinkName() const{ return m_linkName; }
/**
* <p>The name of the link.</p>
*/
inline void SetLinkName(const Aws::String& value) { m_linkNameHasBeenSet = true; m_linkName = value; }
/**
* <p>The name of the link.</p>
*/
inline void SetLinkName(Aws::String&& value) { m_linkNameHasBeenSet = true; m_linkName = value; }
/**
* <p>The name of the link.</p>
*/
inline void SetLinkName(const char* value) { m_linkNameHasBeenSet = true; m_linkName.assign(value); }
/**
* <p>The name of the link.</p>
*/
inline EnvironmentLink& WithLinkName(const Aws::String& value) { SetLinkName(value); return *this;}
/**
* <p>The name of the link.</p>
*/
inline EnvironmentLink& WithLinkName(Aws::String&& value) { SetLinkName(value); return *this;}
/**
* <p>The name of the link.</p>
*/
inline EnvironmentLink& WithLinkName(const char* value) { SetLinkName(value); return *this;}
/**
* <p>The name of the linked environment (the dependency).</p>
*/
inline const Aws::String& GetEnvironmentName() const{ return m_environmentName; }
/**
* <p>The name of the linked environment (the dependency).</p>
*/
inline void SetEnvironmentName(const Aws::String& value) { m_environmentNameHasBeenSet = true; m_environmentName = value; }
/**
* <p>The name of the linked environment (the dependency).</p>
*/
inline void SetEnvironmentName(Aws::String&& value) { m_environmentNameHasBeenSet = true; m_environmentName = value; }
/**
* <p>The name of the linked environment (the dependency).</p>
*/
inline void SetEnvironmentName(const char* value) { m_environmentNameHasBeenSet = true; m_environmentName.assign(value); }
/**
* <p>The name of the linked environment (the dependency).</p>
*/
inline EnvironmentLink& WithEnvironmentName(const Aws::String& value) { SetEnvironmentName(value); return *this;}
/**
* <p>The name of the linked environment (the dependency).</p>
*/
inline EnvironmentLink& WithEnvironmentName(Aws::String&& value) { SetEnvironmentName(value); return *this;}
/**
* <p>The name of the linked environment (the dependency).</p>
*/
inline EnvironmentLink& WithEnvironmentName(const char* value) { SetEnvironmentName(value); return *this;}
private:
Aws::String m_linkName;
bool m_linkNameHasBeenSet;
Aws::String m_environmentName;
bool m_environmentNameHasBeenSet;
};
} // namespace Model
} // namespace ElasticBeanstalk
} // namespace Aws
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "singlestringattribute.h"
#include "postinglistattribute.h"
namespace search {
/**
* Implementation of single value string attribute that in addition to enum store
* uses an underlying posting list to provide faster search.
*
* B: EnumAttribute<StringAttribute>
*/
template <typename B>
class SingleValueStringPostingAttributeT
: public SingleValueStringAttributeT<B>,
protected PostingListAttributeSubBase<AttributePosting,
typename B::LoadedVector,
typename B::LoadedValueType,
typename B::EnumStore>
{
public:
using EnumStore = typename SingleValueStringAttributeT<B>::EnumStore;
using EnumStoreBatchUpdater = typename EnumStore::BatchUpdater;
private:
using LoadedVector = typename B::LoadedVector;
using PostingParent = PostingListAttributeSubBase<AttributePosting,
LoadedVector,
typename B::LoadedValueType,
typename B::EnumStore>;
using Change = StringAttribute::Change;
using ChangeVector = StringAttribute::ChangeVector;
using ComparatorType = typename EnumStore::ComparatorType;
using DocId = typename SingleValueStringAttributeT<B>::DocId;
using EnumIndex = typename SingleValueStringAttributeT<B>::EnumIndex;
using PostingMap = typename PostingParent::PostingMap;
using QueryTermSimpleUP = AttributeVector::QueryTermSimpleUP;
using SelfType = SingleValueStringPostingAttributeT<B>;
using StringSingleImplSearchContext = typename SingleValueStringAttributeT<B>::StringSingleImplSearchContext;
using StringSinglePostingSearchContext = attribute::StringPostingSearchContext<StringSingleImplSearchContext,
SelfType,
vespalib::btree::BTreeNoLeafData>;
using ValueModifier = typename SingleValueStringAttributeT<B>::ValueModifier;
using generation_t = typename SingleValueStringAttributeT<B>::generation_t;
using PostingParent::_postingList;
using PostingParent::clearAllPostings;
using PostingParent::handle_load_posting_lists;
using PostingParent::handle_load_posting_lists_and_update_enum_store;
using PostingParent::forwardedOnAddDoc;
public:
using PostingList = typename PostingParent::PostingList;
using Dictionary = EnumPostingTree;
using PostingParent::getPostingList;
private:
void freezeEnumDictionary() override;
void mergeMemoryStats(vespalib::MemoryUsage & total) override;
void applyUpdateValueChange(const Change & c,
EnumStore & enumStore,
std::map<DocId, EnumIndex> &currEnumIndices);
void makePostingChange(const vespalib::datastore::EntryComparator &cmp,
IEnumStoreDictionary& dictionary,
const std::map<DocId, EnumIndex> &currEnumIndices,
PostingMap &changePost);
void applyValueChanges(EnumStoreBatchUpdater& updater) override;
public:
SingleValueStringPostingAttributeT(const vespalib::string & name, const AttributeVector::Config & c =
AttributeVector::Config(AttributeVector::BasicType::STRING));
~SingleValueStringPostingAttributeT();
void removeOldGenerations(generation_t firstUsed) override;
void onGenerationChange(generation_t generation) override;
AttributeVector::SearchContext::UP
getSearch(QueryTermSimpleUP term, const attribute::SearchContextParams & params) const override;
bool onAddDoc(DocId doc) override {
return forwardedOnAddDoc(doc, this->_enumIndices.size(), this->_enumIndices.capacity());
}
void onAddDocs(DocId lidLimit) override {
forwardedOnAddDoc(lidLimit, this->_enumIndices.size(), this->_enumIndices.capacity());
}
void load_posting_lists(LoadedVector& loaded) override {
handle_load_posting_lists(loaded);
}
attribute::IPostingListAttributeBase * getIPostingListAttributeBase() override {
return this;
}
const attribute::IPostingListAttributeBase * getIPostingListAttributeBase() const override {
return this;
}
void load_posting_lists_and_update_enum_store(enumstore::EnumeratedPostingsLoader& loader) override {
handle_load_posting_lists_and_update_enum_store(loader);
}
};
using SingleValueStringPostingAttribute = SingleValueStringPostingAttributeT<EnumAttribute<StringAttribute> >;
} // namespace search
|
/**
* \file seg_err.c
*
* Error information segment (ERR) accessors for the HL7 parser.
*
* \internal
* Copyright (c) 2011 Juan Jose Comellas <juanjo@comellas.org>
*
* \warning DO NOT MODIFY THIS FILE.
*
* Autogenerated by the ./hl7segdef.py script on Mon Jun 6 12:54:47 2011
*/
/* ------------------------------------------------------------------------
Headers
------------------------------------------------------------------------ */
#include <hl7parser/config.h>
#include <hl7parser/element.h>
#include <hl7parser/export.h>
#include <hl7parser/segment.h>
#include <hl7parser/seg_err.h>
BEGIN_C_DECL()
/* ------------------------------------------------------------------------ */
HL7_EXPORT HL7_Element *hl7_err_segment_id( HL7_Segment *segment )
{
return hl7_segment_component( segment, 0, 0 );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_segment_id( HL7_Segment *segment, HL7_Element *element )
{
return hl7_segment_set_component( segment, 0, 0, element );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_segment_id_str( HL7_Segment *segment, const char *value )
{
int rc;
HL7_Element element;
rc = hl7_element_copy_str( &element, value, segment->allocator );
return ( rc == 0 ? hl7_segment_set_component( segment, 0, 0, &element ) : rc );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_sequence( HL7_Segment *segment )
{
return hl7_element_int( hl7_segment_component( segment, 0, 1 ) );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_sequence( HL7_Segment *segment, HL7_Element *element )
{
return hl7_segment_set_component( segment, 0, 1, element );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_sequence_int( HL7_Segment *segment, const int value )
{
int rc;
HL7_Element element;
rc = hl7_element_set_int( &element, value, segment->allocator );
return ( rc == 0 ? hl7_segment_set_component( segment, 0, 1, &element ) : rc );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_field_pos( HL7_Segment *segment )
{
return hl7_element_int( hl7_segment_component( segment, 0, 2 ) );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_field_pos( HL7_Segment *segment, HL7_Element *element )
{
return hl7_segment_set_component( segment, 0, 2, element );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_field_pos_int( HL7_Segment *segment, const int value )
{
int rc;
HL7_Element element;
rc = hl7_element_set_int( &element, value, segment->allocator );
return ( rc == 0 ? hl7_segment_set_component( segment, 0, 2, &element ) : rc );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT HL7_Element *hl7_err_error_code( HL7_Segment *segment )
{
return hl7_segment_subcomponent( segment, 0, 3, 0 );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_error_code( HL7_Segment *segment, HL7_Element *element )
{
return hl7_segment_set_subcomponent( segment, 0, 3, 0, element );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_error_code_str( HL7_Segment *segment, const char *value )
{
int rc;
HL7_Element element;
rc = hl7_element_copy_str( &element, value, segment->allocator );
return ( rc == 0 ? hl7_segment_set_subcomponent( segment, 0, 3, 0, &element ) : rc );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT HL7_Element *hl7_err_error_text( HL7_Segment *segment )
{
return hl7_segment_subcomponent( segment, 0, 3, 1 );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_error_text( HL7_Segment *segment, HL7_Element *element )
{
return hl7_segment_set_subcomponent( segment, 0, 3, 1, element );
}
/* ------------------------------------------------------------------------ */
HL7_EXPORT int hl7_err_set_error_text_str( HL7_Segment *segment, const char *value )
{
int rc;
HL7_Element element;
rc = hl7_element_copy_str( &element, value, segment->allocator );
return ( rc == 0 ? hl7_segment_set_subcomponent( segment, 0, 3, 1, &element ) : rc );
}
END_C_DECL()
|
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
// Copyright Dirk Lemstra 2014
//
// Blob reference class
//
// This is an internal implementation class that should not be
// accessed by users.
//
#if !defined(Magick_Blob_header)
#define Magick_Blob_header
#include "Magick++/Include.h"
#include "Magick++/Thread.h"
#include "Magick++/Blob.h"
namespace Magick
{
class BlobRef
{
public:
// Construct with data, making private copy of data
BlobRef(const void* data_,size_t length_);
// Destructor (actually destroys data)
~BlobRef(void);
// Decreases reference count and return the new count
size_t decrease();
// Increases reference count
void increase();
Blob::Allocator allocator; // Memory allocation system in use
size_t length; // Blob length
void* data; // Blob data
private:
// Copy constructor and assignment are not supported
BlobRef(const BlobRef&);
BlobRef& operator=(const BlobRef&);
MutexLock _mutexLock; // Mutex lock
size_t _refCount; // Reference count
};
} // namespace Magick
#endif // Magick_Blob_header
|
/**
* Copyright 2007-2015, Kaazing Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "KGWebSocketHandlerAdapter.h"
/*
* WebSocket Native KGHandler Chain
* NativeHandler - AuthenticationHandler - HandshakeHandler - {BalancingHandler} - Codec - BridgeHandler
* Responsibilities:
* a) handle balancer messages
* balancer message is the first message after connection is established
* if message is "\uf0ff" + 'N' - fire connectionOpen event
* if message is "\uf0ff" + 'R' + redirectURl - start reConnect process
*
* b) server will remove balancer message. instead, server will sent a 'HTTP 301' to redirect client
* client needs to change accordingly
*/
@interface KGWebSocketNativeBalancingHandler : KGWebSocketHandlerAdapter
- (void) reconnect:(KGWebSocketChannel *) channel uri:(KGWSURI *) uri protocol:(NSString*) protocol;
- (void) handleBinaryMessageReceived:(KGWebSocketChannel *) channel message:(KGByteBuffer *) message;
- (void) handleTextMessageReceived:(KGWebSocketChannel *) channel message:(NSString*) message;
@end
|
#include "str_cpy.h"
#include <stdio.h>
char* _strcpy(char* dest , const char *src)
{
char* temp = dest;
while((*dest++ = *src++) != '\0');
return temp;
}
|
//
// SignupViewController.h
// StudentCompanion
//
// Created by Pragya Pherwani on 7/18/14.
// Copyright (c) 2014 Yahoo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SignupViewController : UIViewController <UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning>
@property (weak, nonatomic) IBOutlet UITextField *userEmailaddress;
@property (weak, nonatomic) IBOutlet UITextField *userPassword;
@property (weak, nonatomic) IBOutlet UIButton *signUpButton;
- (IBAction)onSignupButton:(id)sender;
- (IBAction)backToLogin:(id)sender;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/dynamodb/DynamoDB_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace DynamoDB
{
namespace Model
{
enum class TableStatus
{
NOT_SET,
CREATING,
UPDATING,
DELETING,
ACTIVE,
INACCESSIBLE_ENCRYPTION_CREDENTIALS,
ARCHIVING,
ARCHIVED
};
namespace TableStatusMapper
{
AWS_DYNAMODB_API TableStatus GetTableStatusForName(const Aws::String& name);
AWS_DYNAMODB_API Aws::String GetNameForTableStatus(TableStatus value);
} // namespace TableStatusMapper
} // namespace Model
} // namespace DynamoDB
} // namespace Aws
|
#import <Cocoa/Cocoa.h>
// Thanks to Dan Messing (Stunt Software) for this implementation
@interface NSBezierPath (PNRoundedRectangle)
+ (NSBezierPath*)bezierPathWithRoundRectInRect:(NSRect)aRect radius:(float)radius;
@end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.