text stringlengths 4 6.14k |
|---|
#ifndef SIMBAADGROUPSITEMEXISTREQUEST_H
#define SIMBAADGROUPSITEMEXISTREQUEST_H
#include <TaoApiCpp/TaoRequest.h>
#include <TaoApiCpp/TaoParser.h>
#include <TaoApiCpp/response/SimbaAdgroupsItemExistResponse.h>
/**
* TOP API: 判断在一个推广计划中是否已经推广了一个商品
*
* @author sd44 <sd44sdd44@yeah.net>
*/
class SimbaAdgroupsItemExistRequest : public TaoRequest
{
public:
virtual QString getApiMethodName() const;
qlonglong getCampaignId() const
; void setCampaignId (qlonglong campaignId);
qlonglong getItemId() const
; void setItemId (qlonglong itemId);
QString getNick() const
; void setNick (QString nick);
virtual SimbaAdgroupsItemExistResponse *getResponseClass(const QString &session = "",
const QString &accessToken = "");
private:
/**
* @brief 推广计划Id
**/
qlonglong campaignId;
/**
* @brief 商品Id
**/
qlonglong itemId;
/**
* @brief 主人昵称
**/
QString nick;
};
#endif /* SIMBAADGROUPSITEMEXISTREQUEST_H */
|
/*
* Copyright (c) 2010, NanChang BangTeng Inc
*
* kangle web server http://www.kanglesoft.com/
* ---------------------------------------------------------------------
*
* 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, USA.
* See COPYING file for detail.
*
* Author: KangHongjiu <keengo99@gmail.com>
*/
#ifndef KTABLE_H_
#define KTABLE_H_
#include "KSocket.h"
#include "KJump.h"
#include <list>
#include "KReg.h"
#include "KAccess.h"
////////////////////////////////////////////////
class KChain;
#define TABLE_CONTEXT "table"
class KTable : public KJump {
public:
~KTable();
KTable();
bool match(KHttpRequest *rq, KHttpObject *obj, int &jumpType,
KJump **jumpTable, unsigned &checked_table,
const char **hitTable, int *hitChain);
std::string addChain();
std::string addChainForm(KChain *chain,u_short accessType);
void htmlTable(std::stringstream &s,const char *vh,u_short accessType);
int insertChain(int index, KChain *newChain);
bool delChain(std::string name);
bool editChain(std::string name,KUrlValue *urlValue,KAccess *kaccess);
bool delChain(int index);
bool editChain(int index, KUrlValue *urlValue,KAccess *kaccess);
bool addAcl(int index, std::string acl, bool mark,KAccess *kaccess);
bool delAcl(int index, std::string acl, bool mark);
void empty();
friend class KAccess;
public:
bool startElement(KXmlContext *context,
std::map<std::string, std::string> &attribute,KAccess *kaccess);
bool startCharacter(KXmlContext *context, char *character, int len);
bool endElement(KXmlContext *context);
/*
*/
void buildXML(std::stringstream &s,int flag);
bool buildXML(const char *chain_name,std::stringstream &s,int flag);
private:
KChain *findChain(const char *name);
KChain *findChain(int index);
void removeChain(KChain *chain);
void pushChain(KChain *chain);
void chainChangeName(std::string oname,KChain *chain);
//еÄÁ´
//std::vector<KChain *> chain;
KChain *head;
KChain *end;
std::map<std::string,KChain *> chain_map;
KChain *curChain;
bool ext;
};
#endif /*KTABLE_H_*/
|
# include <stdio.h>
# include <stdlib.h>
# include "thread.h"
# include "atomic.h"
# include "../stackallocator.h"
# include "satestcomm.h"
StackAllocator sa;
volatile int b1=0, b2=0;
void *worker(void *arg)
{
int i, j;
void *items[CONCURRENT];
for (i=0; i<CONCURRENT; i++)
items[i]=NULL;
inc(&b1);
while (b1!=(NWORKER));
inc(&b2);
while (b2!=(NWORKER));
for (j=0; j<NITER; j++) {
/* get i from 0 to CONCURRENT -1 */
i=rand()%CONCURRENT;
if (items[i]) {
sa_free(&sa, items[i]);
items[i]=NULL;
}
else
items[i]=sa_alloc(&sa);
}
dec(&b1);
while (b1!=0);
dec(&b2);
while (b2!=0);
for (i=0; i<CONCURRENT; i++)
if (items[i]) {
sa_free(&sa, items[i]);
items[i]=NULL;
}
return NULL;
}
int main(int argc, char *argv[])
{
pthread_t thrs[NWORKER];
# if (CHECK)
char *ret;
# endif
int i;
sa_init(&sa, 37, NWORKER*CONCURRENT);
for (i=0; i<NWORKER; i++)
pthread_create(thrs+i, NULL, worker, NULL);
for (i=0; i<NWORKER; i++)
pthread_join(thrs[i], NULL);
# if (CHECK)
if ((ret=(char *)sa_check(&sa))) {
fprintf(stderr, "StackAllocator check failed!\n");
switch ((int)ret) {
case 1 :
fprintf(stderr, "Count doesn't match.\n");
break;
default :
fprintf(stderr, "Invalid block %p\n", ret);
}
sa_dump(&sa, stderr);
}
else {
fprintf(stderr, "StackAllocator check passed!\n");
}
# endif
return 0;
}
|
// Wsl_F
#include <iostream>
using namespace std;
template <typename T>
class LinkedStack
{
private:
class Node
{
public:
T value;
Node* prev;
public:
Node()
{
value = T();
prev = NULL;
}
Node(T value, Node* prev)
{
this->value = value;
this->prev = prev;
}
~Node()
{
value = T();
prev = NULL;
}
};
private:
Node *last;
int size_ = 0;
public:
LinkedStack()
{
last = NULL;
size_ = 0;
}
void push(T value)
{
if (size_ == 0)
{
Node* newNode = new Node(value, NULL);
last = newNode;
}
else
{
Node* newNode = new Node(value, last);
last = newNode;
}
size_++;
}
T back()
{
// if (size_ == 0)
// throw out_of_range("Stack is empty");
return last->value;
}
void pop()
{
//if (size_ == 0)
//throw out_of_range("Stack is empty");
if (size_ == 1)
{
delete last;
size_ = 0;
return;
}
Node* node = last;
last = last->prev;
delete node;
size_--;
}
int size()
{
return this->size_;
}
private:
void print(ostream& out)
{
out << "size: " << size_ << endl;
for (Node* cur = last; cur; cur = cur->prev)
out << cur->value << " ";
out << endl;
}
};
|
/*
* Support for LG2160 - ATSC/MH
*
* Copyright (C) 2010 Michael Krufky <mkrufky@linuxtv.org>
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _LG2160_H_
#define _LG2160_H_
#include <linux/i2c.h>
#include "dvb_frontend.h"
enum lg_chip_type {
LG2160 = 0,
LG2161 = 1,
};
#define LG2161_1019 LG2161
#define LG2161_1040 LG2161
enum lg2160_spi_clock {
LG2160_SPI_3_125_MHZ = 0,
LG2160_SPI_6_25_MHZ = 1,
LG2160_SPI_12_5_MHZ = 2,
};
#if 0
enum lg2161_oif {
LG2161_OIF_EBI2_SLA = 1,
LG2161_OIF_SDIO_SLA = 2,
LG2161_OIF_SPI_SLA = 3,
LG2161_OIF_SPI_MAS = 4,
LG2161_OIF_SERIAL_TS = 7,
};
#endif
struct lg2160_config {
u8 i2c_addr;
u16 if_khz;
int deny_i2c_rptr:1;
int spectral_inversion:1;
unsigned int output_if;
enum lg2160_spi_clock spi_clock;
enum lg_chip_type lg_chip;
};
#if defined(CONFIG_DVB_LG2160) || (defined(CONFIG_DVB_LG2160_MODULE) && \
defined(MODULE))
extern
struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
struct i2c_adapter *i2c_adap);
#else
static inline
struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
struct i2c_adapter *i2c_adap)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif
#endif
|
#include "../inc.h"
#include <math.h>
#include <initializer_list>
#include <array>
#ifndef ZGL_MATRIX
#define ZGL_MATRIX
_ZGL_BEGIN
/// Matrix
/// ¾ØÕó
///
/// rows: Number of matrix rows
/// ¾ØÕóÐÐÊý
/// cols: Number of matrix columns
/// ¾ØÕóÁÐÊý
/// Titem: Type of item within matrix
/// ¾ØÕóÏîÀàÐÍ
template < z_size_t rows, z_size_t cols, typename Titem, typename = void >
class matrix {
typedef Titem _Titem;
typedef matrix< rows, cols, Titem > _Tself;
protected :
#ifdef ZGL_DISABLE_RVALUE
_Titem v[rows][cols] = { };
#endif
#ifdef ZGL_ENABLE_RVALUE
_Titem **v;
#endif
public :
~matrix() {
#ifdef ZGL_ENABLE_RVALUE
if (v) {
delete[] v[0];
delete[] v;
}
#endif
}
// default constructor as initializer as zero matrix
// ĬÈϹ¹Ôì³õʼ»¯Áã¾ØÕó
matrix() {
#ifdef ZGL_ENABLE_RVALUE
v = new _Titem*[rows];
v[0] = new _Titem[rows * cols];
for (z_size_t i = 1; i < rows; i++)
v[i] = v[i - 1] + cols;
z_size_t i = rows * cols;
while (i--)
v[0][i] = _Titem(0);
#endif
}
#ifdef ZGL_ENABLE_RVALUE
// constructor that using Rvalue params
// ʹÓÃÓÒÖµ¹¹Ôì
matrix(matrix&& src) {
v = src.v;
src.v = nullptr;
}
#endif
// constructor that using item array
// ʹÓÃÊý×éµÄ¹¹Ô캯Êý
template < typename = std::enable_if_t < (rows != 0) && (cols != 0) > >
matrix(const _Titem src[rows][cols])
: matrix() {
for (z_size_t i = 0; i < rows; i++)
for (z_size_t j = 0; j < cols; j++)
v[i][j] = src[i][j];
}
// constructor that using type of itself
// copy constructor
// ¿½±´¹¹Ô캯Êý
matrix(const _Tself& src)
: matrix() {
for (z_size_t i = 0; i < rows; i++)
for (z_size_t j = 0; j < cols; j++)
v[i][j] = src[i][j];
}
// constructor that using initializer_list in cpp-11
// ʹÓÃC++11µÄ³õʼ»¯Áбí
matrix(const std::initializer_list< std::initializer_list< _Titem > >& src)
: matrix() {
z_size_t i = 0;
for (const std::initializer_list< _Titem >& _s : src) {
z_size_t j = 0;
for (const _Titem& _t : _s) {
v[i][j] = _t;
j++;
}
i++;
}
}
// constructor that using 4 submatrix to initialize
// ʹÓÃËĸö×Ó¾ØÕó¹¹Ôì¾ØÕó
template < z_size_t rows_s, z_size_t rows_t, z_size_t cols_u, z_size_t cols_v, typename = std::enable_if_t < (rows_s + rows_t) == rows && (cols_u + cols_v) == cols > >
matrix(const matrix < rows_s, cols_u, _Titem > & m11,
const matrix < rows_s, cols_v, _Titem > & m12,
const matrix < rows_t, cols_u, _Titem > & m21,
const matrix < rows_t, cols_v, _Titem > & m22)
: matrix() {
for (z_size_t i = 0; i < rows_s + rows_t; i++)
for (z_size_t j = 0; j < cols_u + cols_v; j++)
if (i < rows_s)
if (j < cols_u)
v[i][j] = m11[i][j];
else
v[i][j] = m12[i][j - cols_u];
else if (j < cols_u)
v[i][j] = m21[i - rows_s][j];
else
v[i][j] = m22[i - rows_s][j - cols_u];
}
_Titem* operator [] (z_size_t opt) const {
return (_Titem*)(v[opt]);
}
virtual const _Tself& operator = (const _Tself& src) {
for (z_size_t i = 0; i < rows; i++)
for (z_size_t j = 0; j < cols; j++)
v[i][j] = src[i][j];
return *this;
}
#ifdef ZGL_ENABLE_RVALUE
virtual const _Tself& operator = (_Tself&& src) {
if (v) {
delete[] v[0];
delete[] v;
}
v = src.v;
src.v = nullptr;
return *this;
}
#endif
template < typename _Titem >
bool operator == (const matrix < rows, cols, _Titem >& opt) const {
for (z_size_t i = 0; i < rows; i++)
for (z_size_t j = 0; j < cols; j++)
if (std::is_floating_point< _Titem >::value ? (!floating_eq< _Titem >(v[i][j], opt[i][j])) : (v[i][j] != opt[i][j]))
return false;
return true;
}
bool operator != (const _Tself& opt) const {
return !(*this == opt);
}
_Tself operator + (const _Tself& opt) const {
_Tself _t;
for (z_size_t i = 0; i < rows; i++)
for (z_size_t j = 0; j < cols; j++)
_t[i][j] = v[i][j] + opt[i][j];
return STD_MOVE(_t);
}
_Tself operator - (const _Tself& opt) const {
_Tself _t = *this + opt * -1;
return STD_MOVE(_t);
}
_Tself operator * (const _Titem& opt) const {
_Tself _t;
for (z_size_t i = 0; i < rows; i++)
for (z_size_t j = 0; j < cols; j++)
_t[i][j] = v[i][j] * opt;
return STD_MOVE(_t);
}
template < z_size_t n_cols >
matrix < rows, n_cols, _Titem > operator * (const matrix < cols, n_cols, _Titem >& opt) const {
matrix < rows, n_cols, _Titem > _t;
for (z_size_t i = 0; i < rows; i++)
for (z_size_t j = 0; j < n_cols; j++)
for (z_size_t k = 0; k < cols; k++)
_t[i][j] = _t[i][j] + v[i][k] * opt[k][j];
return STD_MOVE(_t);
}
_Tself operator / (const _Titem& opt) const {
return STD_MOVE((_Tself&)(*this * (_Titem(1) / opt)));
}
_Tself operator / (const _Tself& opt) const {
throw "";
}
// matrix transpose
// ¾ØÕóתÖÃ
template < z_size_t rows, z_size_t cols >
static matrix < cols, rows, _Titem > transpose (const matrix < rows, cols, _Titem >& opt) {
matrix < cols, rows, _Titem > _t;
for (z_size_t i = 0; i < rows; i++)
for (z_size_t j = 0; j < cols; j++)
_t[j][i] = opt[i][j];
return STD_MOVE(_t);
}
// Cofactor
// Óà×Óʽ
// rows_ct, cols_ct : base in 1
template < z_size_t rows_ct = 0, z_size_t cols_ct = 0 >
static matrix < rows - (rows_ct == 0 ? 0 : 1), cols - (cols_ct == 0 ? 0 : 1), _Titem > cofactor(const matrix < rows, cols, _Titem > & opt) {
matrix < rows - (rows_ct == 0 ? 0 : 1), cols - (cols_ct == 0 ? 0 : 1), _Titem > _t;
for (z_size_t i = 0, _mr = 0; i < rows; i++)
if (i != (rows_ct - 1))
for (z_size_t j = 0, _mc = 0; j < cols; j++)
if (j != (cols_ct - 1))
_t[i - _mr][j - _mc] = opt[i][j];
else
_mc = 1;
else
_mr = 1;
return STD_MOVE(_t);
}
};
template < z_size_t rows, z_size_t cols, typename Titem >
class matrix < rows, cols, Titem, typename std::enable_if_t < (rows < 0) || (cols < 0) > > { };
_ZGL_END
#endif // !ZGL_MATRIX
|
/*
* Copyright 2021 KylinSoft Co., Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef HOVERBTN_H
#define HOVERBTN_H
#include <QWidget>
#include <QEvent>
#include <QString>
#include <QFrame>
#include <QTimer>
#include <QLabel>
#include <QPushButton>
#include <QHBoxLayout>
#include <QResizeEvent>
#include <QPropertyAnimation>
class HoverBtn : public QWidget
{
Q_OBJECT
public:
HoverBtn(QString mname, bool isHide, QWidget *parent = nullptr);
HoverBtn(QString mname, QString detailName, QWidget *parent = nullptr);
~HoverBtn();
public:
QString mName;
QString mDetailName;
QPushButton *mAbtBtn;
QFrame *mInfoItem;
QLabel *mPitIcon;
QLabel *mPitLabel;
QLabel *mDetailLabel;
QHBoxLayout *mHLayout;
QTimer *mMouseTimer;
bool mAnimationFlag = false;
bool mIsHide;
int mHideWidth;
QPropertyAnimation *mEnterAction = nullptr;
QPropertyAnimation *mLeaveAction = nullptr;
private:
void initUI();
void initAnimation();
protected:
virtual void resizeEvent(QResizeEvent *event);
virtual void enterEvent(QEvent * event);
virtual void leaveEvent(QEvent * event);
virtual void mousePressEvent(QMouseEvent * event);
Q_SIGNALS:
void widgetClicked(QString name);
void enterWidget(QString name);
void leaveWidget(QString name);
void resize();
};
#endif // HOVERBTN_H
|
/*****************************************************************************
* Copyright 2006 - 2008 Broadcom Corporation. All rights reserved.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2, available at
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a
* license other than the GPL, without Broadcom's express prior written
* consent.
*****************************************************************************/
/*=============================================================================
Project : VMCS
Module : Gencmd Service
Id : $Id: //software/vc3/DEV/applications/vmcs/vchi/gencmd_common.h#2 $
FILE DESCRIPTION
Gencmd Service common header
=============================================================================*/
#ifndef GENCMD_COMMON_H
#define GENCMD_COMMON_H
#include "vchi/message.h"
#define GENCMD_4CC MAKE_FOURCC("GCMD")
#define GENCMDSERVICE_MSGFIFO_SIZE 1024
//Format of reply message is error code followed by a string
#endif
|
/***************************************************************************
* filespace.c -- a simple mechanism for storing dynamic amounts of data *
* in a simple to use, and quick to append-to structure. *
* *
***********************IMPORTANT NSOCK LICENSE TERMS***********************
* *
* The nsock parallel socket event library is (C) 1999-2013 Insecure.Com *
* LLC This library is free software; you may redistribute and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; Version 2. This guarantees *
* your right to use, modify, and redistribute this software under certain *
* conditions. If this license is unacceptable to you, Insecure.Com LLC *
* may be willing to sell alternative licenses (contact *
* sales@insecure.com ). *
* *
* As a special exception to the GPL terms, Insecure.Com LLC grants *
* permission to link the code of this program with any version of the *
* OpenSSL library which is distributed under a license identical to that *
* listed in the included docs/licenses/OpenSSL.txt file, and distribute *
* linked combinations including the two. You must obey the GNU GPL in all *
* respects for all of the code used other than OpenSSL. If you modify *
* this file, you may extend this exception to your version of the file, *
* but you are not obligated to do so. *
* *
* If you received these files with a written license agreement stating *
* terms other than the (GPL) terms above, then that alternative license *
* agreement takes precedence over this comment. *
* *
* Source is provided to this software because we believe users have a *
* right to know exactly what a program is going to do before they run it. *
* This also allows you to audit the software for security holes (none *
* have been found so far). *
* *
* Source code also allows you to port Nmap to new platforms, fix bugs, *
* and add new features. You are highly encouraged to send your changes *
* to the dev@nmap.org mailing list for possible incorporation into the *
* main distribution. By sending these changes to Fyodor or one of the *
* Insecure.Org development mailing lists, or checking them into the Nmap *
* source code repository, it is understood (unless you specify otherwise) *
* that you are offering the Nmap Project (Insecure.Com LLC) the *
* unlimited, non-exclusive right to reuse, modify, and relicense the *
* code. Nmap will always be available Open Source, but this is important *
* because the inability to relicense code has caused devastating problems *
* for other Free Software projects (such as KDE and NASM). We also *
* occasionally relicense the code to third parties as discussed above. *
* If you wish to specify special license conditions of your *
* contributions, just say so when you send them. *
* *
* 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 v2.0 for more details *
* (http://www.gnu.org/licenses/gpl-2.0.html). *
* *
***************************************************************************/
/* $Id: filespace.c 31563 2013-07-28 22:08:48Z fyodor $ */
#include "nsock_internal.h"
#include "filespace.h"
#include <string.h>
#define FS_INITSIZE_DEFAULT 1024
/* Assumes space for fs has already been allocated */
int filespace_init(struct filespace *fs, int initial_size) {
memset(fs, 0, sizeof(struct filespace));
if (initial_size == 0)
initial_size = FS_INITSIZE_DEFAULT;
fs->current_alloc = initial_size;
fs->str = (char *)safe_malloc(fs->current_alloc);
fs->str[0] = '\0';
fs->pos = fs->str;
return 0;
}
int fs_free(struct filespace *fs) {
if (fs->str)
free(fs->str);
fs->current_alloc = fs->current_size = 0;
fs->pos = fs->str = NULL;
return 0;
}
/* Concatenate a string to the end of a filespace */
int fs_cat(struct filespace *fs, const char *str, int len) {
if (len < 0)
return -1;
if (len == 0)
return 0;
/*
printf("fscat: current_alloc=%d; current_size=%d; len=%d\n",
fs->current_alloc, fs->current_size, len);
*/
if (fs->current_alloc - fs->current_size < len + 2) {
char *tmpstr;
fs->current_alloc = (int)(fs->current_alloc * 1.4 + 1);
fs->current_alloc += 100 + len;
tmpstr = (char *)safe_malloc(fs->current_alloc);
memcpy(tmpstr, fs->str, fs->current_size);
fs->pos = (fs->pos - fs->str) + tmpstr;
if (fs->str)
free(fs->str);
fs->str = tmpstr;
}
memcpy(fs->str + fs->current_size, str, len);
fs->current_size += len;
fs->str[fs->current_size] = '\0';
return 0;
}
|
#include <stdlib.h>
#include <stdio.h>
unsigned long long fact(unsigned long long n)
{
if (n < 0) {
return 0;
} else if (n == 0) {
return 1;
} else if (n == 1) {
return 1;
} else {
return n * fact(n-1);
}
}
/* int facttail(int n, int a) */
/* { */
/* if (n < 0) { */
/* return 0; */
/* } else if (n == 0) { */
/* return 1; */
/* } else if (n == 1) { */
/* return a; */
/* } else { */
/* return n * facttail(n-1, n*a); */
/* } */
/* } */
int main(int argc, char** argv)
{
// facttail(1000000000, 1);
if (argc < 2)
return -1;
printf("Res: %llu\n", fact(atoi(argv[1])));
return 0;
}
|
/*
* This file is part of ePipe
* Copyright (C) 2020, Logical Clocks AB. All rights reserved
*
* 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 EPIPE_PARTCOLSTATSTABLE_H
#define EPIPE_PARTCOLSTATSTABLE_H
#include "tables/DBTable.h"
struct PARTCOLSTATSRow {
Int64 mPARTID;
};
class PARTCOLSTATSTable : public DBTable<PARTCOLSTATSRow> {
public:
PARTCOLSTATSTable() : DBTable("PART_COL_STATS") {
addColumn("PART_ID");
}
PARTCOLSTATSRow getRow(NdbRecAttr *value[]) {
PARTCOLSTATSRow row;
row.mPARTID = value[0]->int64_value();
return row;
}
void remove(Ndb *conn, Int64 PARTID)
{
AnyMap key;
key[0] = PARTID;
int count = deleteByIndex(conn, "PartIndex", key);
LOG_INFO("Removed " << count << " entries of PART_COL_STATS for PART_ID: " << PARTID);
}
};
#endif //EPIPE_PARTCOLSTATSTABLE_H
|
/*
* (C) Copyright 2013
* Stefano Babic, DENX Software Engineering, sbabic@denx.de.
*
* 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
*/
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <mtd/mtd-user.h>
#include "swupdate.h"
#include "handler.h"
#include "fw_env.h"
#include "util.h"
static void uboot_handler(void);
static int install_uboot_environment(struct img_type *img,
void __attribute__ ((__unused__)) *data)
{
int ret;
int fdout;
uint32_t checksum = 0;
unsigned long dummy;
char buf[64];
char filename[64];
struct stat statbuf;
snprintf(filename, sizeof(filename), "%s%s", TMPDIR, img->fname);
ret = stat(filename, &statbuf);
if (ret) {
fdout = openfileoutput(filename);
ret = copyfile(img->fdin, fdout, img->size, &dummy, 0, 0, &checksum);
close(fdout);
}
ret = fw_parse_script(filename);
if (ret < 0)
snprintf(buf, sizeof(buf), "Error setting U-Boot environment");
else
snprintf(buf, sizeof(buf), "U-Boot environment updated");
notify(RUN, RECOVERY_NO_ERROR, buf);
return ret;
}
__attribute__((constructor))
static void uboot_handler(void)
{
register_handler("uboot", install_uboot_environment, NULL);
}
|
#include "nvitem_common.h"
#ifndef _NVITEM_PACKET_H_
#define _NVITEM_PACKET_H_
void _initPacket(void);
#define _PACKET_START 0 // new packet group
#define _PACKET_CONTINUE 1 // next packet in current group
#define _PACKET_SKIP 2 // non control packet
#define _PACKET_FAIL 3 // channel fail
uint32 _getPacket(uint8** buf, uint32* size);
void _sendPacktRsp(uint8 rsp);
#endif
|
/*
* UnrealIRCd, src/modules/cap_invitenotify.c
* Copyright (c) 2013 William Pitcock <nenolod@dereferenced.org>
*
* 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "proto.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef _WIN32
#include "version.h"
#endif
#include "m_cap.h"
ModuleHeader MOD_HEADER(cap_invitenotify)
= {
"cap_invitenotify",
"$Id$",
"invite-notify client capability",
"3.2-b8-1",
NULL
};
static void cap_invitenotify_caplist(struct list_head *head)
{
ClientCapability *cap;
cap = MyMallocEx(sizeof(ClientCapability));
cap->name = strdup("invite-notify");
cap->cap = PROTO_INVITENOTIFY;
clicap_append(head, cap);
}
static void cap_invitenotify_invite(aClient *from, aClient *to, aChannel *chptr)
{
sendto_channel_butone_with_capability(from, PROTO_INVITENOTIFY,
from, chptr, "INVITE %s :%s", to->name, chptr->chname);
}
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(cap_invitenotify)(ModuleInfo *modinfo)
{
MARK_AS_OFFICIAL_MODULE(modinfo);
HookAddVoidEx(modinfo->handle, HOOKTYPE_INVITE, cap_invitenotify_invite);
HookAddVoidEx(modinfo->handle, HOOKTYPE_CAPLIST, cap_invitenotify_caplist);
return MOD_SUCCESS;
}
/* Is first run when server is 100% ready */
DLLFUNC int MOD_LOAD(cap_invitenotify)(int module_load)
{
return MOD_SUCCESS;
}
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(cap_invitenotify)(int module_unload)
{
return MOD_SUCCESS;
}
|
/*
Tencent is pleased to support the open source community by making PhxSQL available.
Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the GNU General Public 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://opensource.org/licenses/GPL-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 <string>
#include <stdint.h>
#include <vector>
#include <memory>
namespace phxbinlogsvr {
class PhxBinlogStubInterface;
class PhxBinlogClient {
public:
PhxBinlogClient(PhxBinlogStubInterface * stub_interface);
virtual ~PhxBinlogClient();
int GetMaster(std::string *ip, uint32_t *expire_time);
int GetMaster(std::string *ip, uint32_t *expire_time, uint32_t *version);
int GetGlobalMaster(const std::vector<std::string> &iplist, std::string *ip, uint32_t *expire_time,
uint32_t *version, bool require_majority = true);
int SetExportIP(const std::string &ip, const uint32_t &port);
int SendBinLog(const std::string &old_gtid, const std::string &new_gtid, const std::string &event_buffer);
int SendBinLog(const std::string &old_gtid, const std::string &event_buffer, std::string *max_gtid);
int SendBinLog(const std::string &old_gtid, const std::string &event_buffer);
int GetLastSendGtid(const std::string &uuid, std::string * last_send_gtid);
int AddMember(const std::string &ip);
int RemoveMember(const std::string &ip);
int HeartBeat(const uint32_t &flag = 1);
int SetMySqlAdminInfo(const std::string &now_admin_username, const std::string &now_admin_pwd,
const std::string &new_admin_username, const std::string &new_admin_pwd);
int SetMySqlReplicaInfo(const std::string &now_admin_username, const std::string &now_admin_pwd,
const std::string &new_replica_username, const std::string &new_replica_pwd);
int GetMemberList(std::vector<std::string> *ip_list, uint32_t *port);
int InitBinlogSvrMaster();
protected:
int GetGlobalMaster(const std::vector<std::string> &iplist, const uint32_t &port, std::string *ip,
uint32_t *expire_time, uint32_t *version, bool require_majority = true);
int GetGlobalLastSendGtid(const std::vector<std::string> &iplist, const uint32_t &port, const std::string &uuid,
std::string * last_send_gtid);
int GetLocalMaster(std::string *ip, uint32_t * expire_time, uint32_t *version);
int GetLocalLastSendGtid(const std::string &uuid, std::string * last_send_gtid);
friend class PhxBinlogSvrLogic;
private:
//coding interface
bool EncodeBinLogBuffer(const std::string &old_gtid, const std::string &new_gtid, const std::string &event_buffer,
std::string *encode_buffer);
bool EncodeExportIPInfo(const std::string &ip, const uint32_t &port, std::string *encode_buffer);
bool EncodeHeartBeatInfo(const uint32_t &flag, std::string * encode_buffer);
bool EncodeMemberList(const std::string &from_ip, const std::string &to_ip, std::string * buffer);
bool DecodeMasterInfo(const std::string &decode_buffer, std::string *ip, uint32_t *expire_time, uint32_t *version);
PhxBinlogStubInterface* stub_interface_;
};
}
|
//////////////////////////////////////////////////////////////////////////////
// Copyright 2004-2014, SenseGraphics AB
//
// This file is part of H3D API.
//
// H3D API 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.
//
// H3D API 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 H3D API; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// A commercial license is also available. Please contact us at
// www.sensegraphics.com for more information.
//
//
/// \file WorldInfo.h
/// \brief Header file for WorldInfo, X3D scene-graph node
///
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __WORLDINFO_H__
#define __WORLDINFO_H__
#include <H3D/X3DInfoNode.h>
#include <H3D/MFString.h>
#include <H3D/SFString.h>
namespace H3D {
/// \class WorldInfo
/// \brief The WorldInfo node contains information about the world.
/// This node is strictly for documentation purposes and has no effect on
/// the visual appearance or behaviour of the world. The title field is
/// intended to store the name or title of the world so that browsers can
/// present this to the user (perhaps in the window border). Any other
/// information about the world can be stored in the info field, such
/// as author information, copyright, and usage instructions. This is
/// the base node type for all nodes that contain only
/// information without visual semantics.
///
/// <b>Examples:</b>
/// - <a href="../../../H3DAPI/examples/All/WorldInfo.x3d">WorldInfo.x3d</a>
/// ( <a href="examples/WorldInfo.x3d.html">Source</a> )
class H3DAPI_API WorldInfo : public X3DInfoNode {
public:
/// Constructor.
WorldInfo( Inst< SFNode > _metadata = 0,
Inst< MFString > _info = 0,
Inst< SFString > _title = 0 );
/// Extra information about the world, e.g. author information,
/// copyright, and usage instructions.
///
/// <b>Access type:</b> initializeOnly \n
/// <b>Default value:</b> [] \n
auto_ptr< MFString > info;
/// The title of the world.
///
/// <b>Access type:</b> initializeOnly \n
/// <b>Default value:</b> "" \n
auto_ptr< SFString > title;
/// The H3DNodeDatabase for this node.
static H3DNodeDatabase database;
};
}
#endif
|
sound_type snd_make_exp(sound_type in);
sound_type snd_exp(sound_type in);
/* LISP: (snd-exp SOUND) */
|
// $Id: RichLinkDef.h,v 1.16 2006/09/13 14:56:13 hoehne Exp $
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class CbmRich+;
#pragma link C++ class CbmRichHitProducer+;
#pragma link C++ class CbmGeoRich+;
#pragma link C++ class CbmRichMatchRings+;
#pragma link C++ class CbmRichContFact;
#pragma link C++ class CbmGeoRichPar;
#pragma link C++ class CbmRichTrainAnnSelect;
#pragma link C++ class CbmRichTrainAnnElectrons;
#pragma link C++ class CbmRichEventDisplay+;
//reconstruction
#pragma link C++ class CbmRichReconstruction+;
//qa
#pragma link C++ class CbmRichTestSim+;
#pragma link C++ class CbmRichTestHits+;
#pragma link C++ class CbmRichGeoTest+;
#pragma link C++ class CbmRichUrqmdTest+;
#pragma link C++ class CbmRichGeoOpt+;
#pragma link C++ class CbmRichRingFitterQa+;
#pragma link C++ class CbmRichProt+;
#pragma link C++ class CbmRichProtHitProducer+;
#pragma link C++ class CbmRichProtPrepareExtrapolation+;
#pragma link C++ class CbmRichProtProjectionProducer+;
#pragma link C++ class CbmRichPrototypeQa+;
#pragma link C++ class CbmRichTrbUnpack+;
#pragma link C++ class CbmRichTrbUnpack2+;
#pragma link C++ class CbmTrbEdgeMatcher+;
#pragma link C++ class CbmTrbCalibrator+;
#pragma link C++ class CbmRichTrbRecoQa+;
#pragma link C++ class CbmRichTrbPulserQa+;
#pragma link C++ class CbmRichHitInfo+;
#pragma link C++ class CbmRichTrbRecoQaStudyReport+;
#endif
|
/* -*- c++ -*-
Copyright (C) 2004-2012 Christian Wieninger
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
The author can be reached at cwieninger@gmx.de
The project's page is at http://winni.vdr-developer.org/epgsearch
*/
#include <string>
#include <list>
#include <vdr/plugin.h>
#include "services.h"
#include "mainmenushortcut.h"
static const char *VERSION = "0.0.1";
static const char *DESCRIPTION = trNOOP("Direct access to epgsearch's search menu");
static const char *MAINMENUENTRY = trNOOP("Search");
static const char *SETUPTEXT = trNOOP("EpgSearch-Search in main menu");
class cPluginEpgsearchonly:public cMainMenuShortcut {
public:
virtual const char *Version() {
return VERSION;
}
virtual const char *Description() {
return I18nTranslate(DESCRIPTION, I18nEpgsearch);
}
virtual bool Initialize();
virtual cOsdObject *MainMenuAction() {
return GetEpgSearchMenu("Epgsearch-searchmenu-v1.0");
};
protected:
virtual const char *SetupText() {
return I18nTranslate(SETUPTEXT, I18nEpgsearch);
}
virtual const char *MainMenuText() {
return I18nTranslate(MAINMENUENTRY, I18nEpgsearch);
}
};
bool cPluginEpgsearchonly::Initialize()
{
return cMainMenuShortcut::Initialize();
}
VDRPLUGINCREATOR(cPluginEpgsearchonly); // Don't touch this!
|
/****************************************************************************
* WiiTweet
*
* Pedro Aguiar
*
* wt_profile.cpp
*
* Saving/Loading user data support class.
***************************************************************************/
#ifndef WT_PROFILE_H
#define WT_PROFILE_H
#include <gccore.h>
#include <stdio.h>
#include <stdlib.h>
#include <ogcsys.h>
#include <unistd.h>
#include <malloc.h>
#include <string.h>
#include <string>
#include <fat.h>
#include "twitcurl/twitcurl.h"
#define DONT_SAVE 0
#define SAVE 1
#define TOKENMAXLEN 63
class wt_profile{
public:
char tokenKeyLen;
char tokenKey[TOKENMAXLEN];
char tokenSecretLen;
char tokenSecret[TOKENMAXLEN];
char screenName[TOKENMAXLEN];
char userName[TOKENMAXLEN+1]; //Local username used to identify the profile, it is also the filename
char version; //Profile version, in case something changes and I need to be aware of which info do I have
char oauth; //Authorization step
char NIP; //True (non-zero) if the user has a NIP
char save;
char img;
class twitCurl * twitterObj;
wt_profile(const char * name); //First-time constructor
wt_profile(char * filename, int savechanges); //Load-from-file constructor
~wt_profile();
void getTokenKey(std::string& buf, const char * typedNIP);
void setTokenKey(std::string& buf, const char * typedNIP);
void getTokenSecret(std::string& buf, const char * typedNIP);
void setTokenSecret(std::string& buf, const char * typedNIP);
void getScreenName(std::string& buf);
void setScreenName(std::string& buf);
};
#endif
|
/*
* The table of implimented splitting functions
*
* init_split - Will be called before a tree is started. May do very
* little, but empirical Bayes like methods will need to set
* some global variables.
* choose_split - function to find the best split
* eval - function to calculate the response estimate and risk
* error - Function that returns the prediction error.
* num_y - Number of columns needed to represent y (usually 1)
*/
extern int anovainit(int n, double *y[], int maxcat, char **error,
double *parm, int *size, int who, double *wt);
extern int poissoninit(int n, double *y[], int maxcat, char **error,
double *parm, int *size, int who, double *wt);
extern int giniinit(int n, double *y[], int maxcat, char **error,
double *parm, int *size, int who, double *wt);
extern int usersplit_init(int n, double *y[], int maxcat, char **error,
double *parm, int *size, int who, double *wt);
extern void anovass(int n, double *y[], double *value, double *risk,
double *wt);
extern void poissondev(int n, double *y[], double *value, double *risk,
double *wt);
extern void ginidev(int n, double *y[], double *value, double *risk,
double *wt);
extern void usersplit_eval(int n, double *y[], double *value, double *risk,
double *wt);
extern void anova(int n, double *y[], double *x, int nclass,
int edge, double *improve, double *split, int *csplit,
double myrisk, double *wt);
extern void poisson(int n, double *y[], double *x, int nclass,
int edge, double *improve, double *split, int *csplit,
double myrisk, double *wt);
extern void gini(int n, double *y[], double *x, int nclass,
int edge, double *improve, double *split, int *csplit,
double myrisk, double *wt);
extern void usersplit(int n, double *y[], double *x, int nclass,
int edge, double *improve, double *split, int *csplit,
double myrisk, double *wt);
extern double anovapred(double *y, double *yhat);
extern double ginipred(double *y, double *yhat);
extern double poissonpred(double *y, double *yhat);
extern double usersplit_pred(double *y, double *yhat);
static struct {
int (*init_split) ();
void (*choose_split) ();
void (*eval) ();
double (*error) ();
} func_table[] = {
{anovainit, anova, anovass, anovapred},
{poissoninit, poisson, poissondev, poissonpred},
{giniinit, gini, ginidev, ginipred},
{usersplit_init, usersplit, usersplit_eval, usersplit_pred}
};
#define NUM_METHODS 4 /* size of the above structure */
|
/******************************************************************
iLBC Speech Coder ANSI-C Source Code
StateConstructW.c
Copyright (c) 2001,
Global IP Sound AB.
All rights reserved.
******************************************************************/
#include <math.h>
#include <string.h>
#include "iLBC_define.h"
#include "constants.h"
#include "filter.h"
#include "StateConstructW.h"
/*----------------------------------------------------------------*
* decoding of the start state
*---------------------------------------------------------------*/
void StateConstructW(
int idxForMax, /* (i) 6-bit index for the quantization of
max amplitude */
int *idxVec, /* (i) vector of quantization indexes */
float *syntDenum, /* (i) synthesis filter denumerator */
float *out, /* (o) the decoded state vector */
int len /* (i) length of a state vector */
){
float maxVal, tmpbuf[LPC_FILTERORDER+2*STATE_LEN], *tmp,
numerator[LPC_FILTERORDER+1];
float foutbuf[LPC_FILTERORDER+2*STATE_LEN], *fout;
int k,tmpi;
/* decoding of the maximum value */
maxVal = state_frgqTbl[idxForMax];
maxVal = (float)pow(10,maxVal)/(float)4.5;
/* initialization of buffers and coefficients */
memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float));
memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float));
for(k=0; k<LPC_FILTERORDER; k++){
numerator[k]=syntDenum[LPC_FILTERORDER-k];
}
numerator[LPC_FILTERORDER]=syntDenum[0];
tmp = &tmpbuf[LPC_FILTERORDER];
fout = &foutbuf[LPC_FILTERORDER];
/* decoding of the sample values */
for(k=0; k<len; k++){
tmpi = len-1-k;
/* maxVal = 1/scal */
tmp[k] = maxVal*state_sq3Tbl[idxVec[tmpi]];
}
/* circular convolution with all-pass filter */
memset(tmp+len, 0, len*sizeof(float));
ZeroPoleFilter(tmp, numerator, syntDenum, 2*len,
LPC_FILTERORDER, fout);
for(k=0;k<len;k++){
out[k] = fout[len-1-k]+fout[2*len-1-k];
}
}
|
/*
* Copyright (c) Tony Bybell 2010
*
* 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.
*/
#ifndef WAVE_WAVEWINDOW_H
#define WAVE_WAVEWINDOW_H
void button_press_release_common(void);
void UpdateSigValue(Trptr t);
void MaxSignalLength(void);
void RenderSigs(int trtarget, int update_waves);
int RenderSig(Trptr t, int i, int dobackground);
void populateBuffer(Trptr t, char *altname, char* buf);
void calczoom(double z0);
void make_sigarea_gcs(GtkWidget *widget);
void force_screengrab_gcs(void);
void force_normal_gcs(void);
gint wavearea_configure_event(GtkWidget *widget, GdkEventConfigure *event);
#endif
|
/****************************************************************************
** $Id: qt/showimg.h 3.3.8 edited Jan 11 14:37 $
**
** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
**
** This file is part of an example program for Qt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
#ifndef SHOWIMG_H
#define SHOWIMG_H
#include <qwidget.h>
#include <qimage.h>
class QLabel;
class QMenuBar;
class QPopupMenu;
class ImageViewer : public QWidget
{
Q_OBJECT
public:
ImageViewer( QWidget *parent=0, const char *name=0, int wFlags=0 );
~ImageViewer();
bool loadImage( const QString& );
protected:
void paintEvent( QPaintEvent * );
void resizeEvent( QResizeEvent * );
void mousePressEvent( QMouseEvent * );
void mouseReleaseEvent( QMouseEvent * );
void mouseMoveEvent( QMouseEvent * );
private:
void scale();
int conversion_flags;
bool smooth() const;
bool useColorContext() const;
int alloc_context;
bool convertEvent( QMouseEvent* e, int& x, int& y );
QString filename;
QImage image; // the loaded image
QPixmap pm; // the converted pixmap
QPixmap pmScaled; // the scaled pixmap
QMenuBar *menubar;
QPopupMenu *file;
QPopupMenu *saveimage;
QPopupMenu *savepixmap;
QPopupMenu *edit;
QPopupMenu *options;
QWidget *helpmsg;
QLabel *status;
int si, sp, ac, co, mo, fd, bd, // Menu item ids
td, ta, ba, fa, au, ad, dd,
ss, cc, t1, t8, t32;
void updateStatus();
void setMenuItemFlags();
bool reconvertImage();
int pickx, picky;
int clickx, clicky;
bool may_be_other;
static ImageViewer* other;
void setImage(const QImage& newimage);
private slots:
void to1Bit();
void to8Bit();
void to32Bit();
void toBitDepth(int);
void copy();
void paste();
void hFlip();
void vFlip();
void rot180();
void editText();
void newWindow();
void openFile();
void saveImage(int);
void savePixmap(int);
void giveHelp();
void doOption(int);
void copyFrom(ImageViewer*);
};
#endif // SHOWIMG_H
|
/*
* thunix/fs/ialloc.c
*
* it contains the inode allocation and deallocation routines
*/
#include <thunix.h>
#include <fs_ext2.h>
/* get the group's inode bitmap of the given group num */
void * ext2_read_inode_bitmap(unsigned int block_group)
{
void *inode_bitmap;
inode_bitmap =(void *)( EXT2_BITMAP_BUFFER
+ ((block_group << 1) + 1) * EXT2_BLOCK_SIZE);
return inode_bitmap;
}
void ext2_free_inode(int inr)
{
unsigned int inode_group;
unsigned int bit;
struct ext2_group_desc * desc;
struct ext2_sb_info * sbi = EXT2_SBI();
void *bitmap;
inode_group = ext2_get_group_num (inr, INODE);
bit = ext2_get_group_offset (inr, INODE);
if ( !ext2_clear_bit(bitmap, bit) )
ext2_error ("bit %d is alread cleared",bit);
desc = ext2_get_group_desc (inode_group);
desc->bg_free_inodes_count ++;
sbi->s_free_inodes_count ++;
}
int ext2_grab_inode (char *bitmap, unsigned int goal)
{
if ( !ext2_test_bit(bitmap, goal) )
goto got_inode;
/* else looking forward */
goal = find_first_zero (bitmap, goal + 1, EXT2_INODES_PER_GROUP);
got_inode:
return goal;
}
/*
* find a free inode in the inode table
*/
int ext2_alloc_inode (unsigned int goal, int mode)
{
unsigned int inode;
unsigned int inode_group;
unsigned int bit;
struct ext2_group_desc *desc;
struct ext2_sb_info * sbi = EXT2_SBI();
void *bitmap;
EXT2_DEBUG(printk("\n"));
inode_group = ext2_get_group_num (goal, INODE);
bit = ext2_get_group_offset (goal, INODE);
bitmap = ext2_read_inode_bitmap (inode_group);
inode = ext2_grab_inode (bitmap, bit);
if ( !inode )
ext2_error ("no free inodes any more");
desc = ext2_get_group_desc (inode_group);
desc->bg_free_inodes_count --;
if (S_ISDIR(mode)) {
desc->bg_used_dirs_count ++;
sbi->s_dirs_count ++;
}
sbi->s_free_inodes_count --;
ext2_set_bit (bitmap, inode);
return inode;
}
/*
* make a new inode for mknod
*/
struct m_inode *ext2_new_inode(struct m_inode *dir, int mode)
{
struct m_inode *inode;
int inr;
/* find a near inode */
inr = ext2_alloc_inode (dir->i_num, mode);
EXT2_DEBUG(printk("the allocted inode inr : %d\n",inr));
inode = ext2_iget(inr);
inode->i_count = 1;
inode->i_nlinks = 1;
inode->i_atime = CURRENT_TIME;
inode->i_ctime = CURRENT_TIME;
inode->i_mode = mode;
return inode;
}
|
/*
* This file is part of the syndication library
*
* Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org>
*
* 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 SYNDICATION_MAPPER_MAPPERATOMIMPL_H
#define SYNDICATION_MAPPER_MAPPERATOMIMPL_H
#include "feedatomimpl.h"
#include <atom/document.h>
#include <specificdocument.h>
#include <feed.h>
#include <mapper.h>
namespace Syndication {
/** @internal */
class AtomMapper : public Mapper<Feed>
{
boost::shared_ptr<Feed> map(SpecificDocumentPtr doc) const
{
return boost::shared_ptr<Feed>(new FeedAtomImpl(boost::static_pointer_cast<Atom::FeedDocument>(doc)));
}
};
} // namespace Syndication
#endif // SYNDICATION_MAPPER_MAPPERATOMIMPL_H
|
/* miniSynth - A Simple Software Synthesizer
Copyright (C) 2015 Ville Räisänen <vsr at vsr.name>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TIMBREWIDGET_H
#define TIMBREWIDGET_H
#include <QDialog>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QVector>
#include <QSlider>
#include <QDial>
#include <QLabel>
#include <QSignalMapper>
class TimbreWidget : public QWidget {
Q_OBJECT
public:
TimbreWidget(int _numHarmonics, QWidget *parent = 0);
~TimbreWidget();
void getValues(QVector<int> &litudesOut, QVector<int> &phasesOut);
void setValues(QVector<int> &litudesIn, QVector<int> &phasesIn);
public slots:
void reset();
void updateValues();
private slots:
void valueChanged(int tmp);
signals:
void settingsChanged(QVector<int> &litudes, QVector<int> &phases);
private:
int numHarmonics;
QHBoxLayout *hbox;
QVector<QSlider *> sliders;
QVector<QDial *> dials;
QVector<int> amplitudes;
QVector<int> phases;
QSignalMapper *signalMapper;
};
#endif // TIMBREWIDGET_H
|
/* opgave 2_3 print test variabelen */
#include <stdio.h>
int a, b, c, d;
int main(void)
{
a = b = c = d = 0;
printf ( "int a = 0: %d \n", a );
a = ++b + ++c;
printf ( "int a = ++b + ++c: %d \n", a );
a = b++ + c++;
printf ( "int a = b++ + c++: %d \n", a );
a = ++b + c++;
printf ( "int a = ++b + c++: %d \n", a );
a = b-- + --c;
printf ( "int a = b-- + --c: %d \n", a );
d = c;
a = ++c + d;
printf ( "int a = ++c + d: %d \n", a );
d = a++;
printf ( "int d = a++: %d \n", d );
}
|
/*
* Copyright (C) 2007 - 2020 Stephen F. Booth <me@sbooth.org>
*
* 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
*/
#import <Cocoa/Cocoa.h>
#import "DecoderMethods.h"
#include <AudioToolbox/AudioToolbox.h>
@class Decoder;
@interface RegionDecoder : NSObject <DecoderMethods>
{
Decoder *_decoder;
SInt64 _startingFrame;
UInt32 _frameCount;
NSUInteger _loopCount;
UInt32 _framesReadInCurrentLoop;
SInt64 _totalFramesRead;
NSUInteger _completedLoops;
}
// ========================================
// Creation
// ========================================
+ (instancetype) decoderWithFilename:(NSString *)filename startingFrame:(SInt64)startingFrame;
+ (instancetype) decoderWithFilename:(NSString *)filename startingFrame:(SInt64)startingFrame frameCount:(UInt32)frameCount;
+ (instancetype) decoderWithFilename:(NSString *)filename startingFrame:(SInt64)startingFrame frameCount:(UInt32)frameCount loopCount:(NSUInteger)loopCount;
- (instancetype) initWithFilename:(NSString *)filename startingFrame:(SInt64)startingFrame;
- (instancetype) initWithFilename:(NSString *)filename startingFrame:(SInt64)startingFrame frameCount:(UInt32)frameCount;
- (instancetype) initWithFilename:(NSString *)filename startingFrame:(SInt64)startingFrame frameCount:(UInt32)frameCount loopCount:(NSUInteger)loopCount;
// ========================================
// Properties
// ========================================
- (Decoder *) decoder;
- (SInt64) startingFrame;
- (void) setStartingFrame:(SInt64)startingFrame;
- (UInt32) frameCount;
- (void) setFrameCount:(UInt32)frameCount;
- (NSUInteger) loopCount;
- (void) setLoopCount:(NSUInteger)loopCount;
- (void) reset;
- (NSUInteger) completedLoops;
@end
|
/*
* Copyright (C) 2003 by Unai Garro <ugarro@users.sourceforge.net>
* Copyright (C) 2004 by Enrico Ros <rosenric@dei.unipd.it>
* Copyright (C) 2004 by Stephan Kulow <coolo@kde.org>
* Copyright (C) 2004 by Oswald Buddenhagen <ossi@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KDMTHEMER_H
#define KDMTHEMER_H
#include <QMap>
#include <QObject>
class KdmItem;
class QDomNode;
class QPaintDevice;
/**
* @author Unai Garro
*/
/*
* The themer widget. Whatever drawn here is just themed
* according to a XML file set by the user.
*/
class KdmThemer : public QObject {
Q_OBJECT
public:
/*
* Construct and destruct the interface
*/
KdmThemer( const QString &path, const QString &mode,
const QMap<QString, bool> &types, QWidget *w );
~KdmThemer();
bool isOK() { return rootItem != 0; }
const QString &baseDir() const { return basedir; }
KdmItem *findNode( const QString & ) const;
// must be called by parent widget
void widgetEvent( QEvent *e );
void setWidget( QWidget *w );
QWidget *widget() { return m_widget; }
void setTypeVisible( const QString &t, bool show );
bool typeVisible( const QString &t ) { return m_showTypes.value( t, false ); }
void paintBackground( QPaintDevice *dev );
Q_SIGNALS:
void activated( const QString &id );
private:
/*
* Our display mode (e.g. console, remote, ...)
*/
QString m_currentMode;
QMap<QString, bool> m_showTypes;
// defines the directory the theme is in
QString basedir;
/*
* Stores the root of the theme
*/
KdmItem *rootItem;
bool m_geometryOutdated;
bool m_geometryInvalid;
QWidget *m_widget;
// methods
/*
* Parses the XML file looking for the
* item list and adds those to the themer
*/
void generateItems( KdmItem *parent, const QDomNode &node );
void showStructure();
private Q_SLOTS:
void update( int x, int y, int w, int h );
void slotNeedPlacement();
void slotNeedPlugging();
};
#endif
|
#include <termios.h>
speed_t cfgetispeed(const struct termios *termios_p)
{
return termios_p->c_ispeed;
}
|
/* $Id: diva_didd.c,v 1.1.1.1 2007/10/15 18:22:43 ronald Exp $
*
* DIDD Interface module for Eicon active cards.
*
* Functions are in dadapter.c
*
* Copyright 2002-2003 by Armin Schindler (mac@melware.de)
* Copyright 2002-2003 Cytronics & Melware (info@melware.de)
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include "platform.h"
#include "di_defs.h"
#include "dadapter.h"
#include "divasync.h"
#include "did_vers.h"
static char *main_revision = "$Revision: 1.1.1.1 $";
static char *DRIVERNAME =
"Eicon DIVA - DIDD table (http://www.melware.net)";
static char *DRIVERLNAME = "divadidd";
char *DRIVERRELEASE_DIDD = "2.0";
MODULE_DESCRIPTION("DIDD table driver for diva drivers");
MODULE_AUTHOR("Cytronics & Melware, Eicon Networks");
MODULE_SUPPORTED_DEVICE("Eicon diva drivers");
MODULE_LICENSE("GPL");
#define DBG_MINIMUM (DL_LOG + DL_FTL + DL_ERR)
#define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG)
extern int diddfunc_init(void);
extern void diddfunc_finit(void);
extern void DIVA_DIDD_Read(void *, int);
static struct proc_dir_entry *proc_didd;
struct proc_dir_entry *proc_net_eicon = NULL;
EXPORT_SYMBOL(DIVA_DIDD_Read);
EXPORT_SYMBOL(proc_net_eicon);
static char *getrev(const char *revision)
{
char *rev;
char *p;
if ((p = strchr(revision, ':'))) {
rev = p + 2;
p = strchr(rev, '$');
*--p = 0;
} else
rev = "1.0";
return rev;
}
static int
proc_read(char *page, char **start, off_t off, int count, int *eof,
void *data)
{
int len = 0;
char tmprev[32];
strcpy(tmprev, main_revision);
len += sprintf(page + len, "%s\n", DRIVERNAME);
len += sprintf(page + len, "name : %s\n", DRIVERLNAME);
len += sprintf(page + len, "release : %s\n", DRIVERRELEASE_DIDD);
len += sprintf(page + len, "build : %s(%s)\n",
diva_didd_common_code_build, DIVA_BUILD);
len += sprintf(page + len, "revision : %s\n", getrev(tmprev));
if (off + count >= len)
*eof = 1;
if (len < off)
return 0;
*start = page + off;
return ((count < len - off) ? count : len - off);
}
static int DIVA_INIT_FUNCTION create_proc(void)
{
proc_net_eicon = proc_mkdir("net/eicon", NULL);
if (proc_net_eicon) {
if ((proc_didd =
create_proc_entry(DRIVERLNAME, S_IFREG | S_IRUGO,
proc_net_eicon))) {
proc_didd->read_proc = proc_read;
}
return (1);
}
return (0);
}
static void DIVA_EXIT_FUNCTION remove_proc(void)
{
remove_proc_entry(DRIVERLNAME, proc_net_eicon);
remove_proc_entry("net/eicon", NULL);
}
static int DIVA_INIT_FUNCTION divadidd_init(void)
{
char tmprev[32];
int ret = 0;
printk(KERN_INFO "%s\n", DRIVERNAME);
printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE_DIDD);
strcpy(tmprev, main_revision);
printk("%s Build:%s(%s)\n", getrev(tmprev),
diva_didd_common_code_build, DIVA_BUILD);
if (!create_proc()) {
printk(KERN_ERR "%s: could not create proc entry\n",
DRIVERLNAME);
ret = -EIO;
goto out;
}
if (!diddfunc_init()) {
printk(KERN_ERR "%s: failed to connect to DIDD.\n",
DRIVERLNAME);
#ifdef MODULE
remove_proc();
#endif
ret = -EIO;
goto out;
}
out:
return (ret);
}
static void DIVA_EXIT_FUNCTION divadidd_exit(void)
{
diddfunc_finit();
remove_proc();
printk(KERN_INFO "%s: module unloaded.\n", DRIVERLNAME);
}
module_init(divadidd_init);
module_exit(divadidd_exit);
|
/*
* (C) 2016 by Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
*
* 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.
*
* based on ulogd which was almost entirely written by Harald Welte,
* with contributions from fellow hackers such as Pablo Neira Ayuso,
* Eric Leblond and Pierre Chifflier.
*/
#ifndef _NURS_NFNL_COMMON_H
#define _NURS_NFNL_COMMON_H
#include <libmnl/libmnl.h>
int mnl_socket_set_reliable(struct mnl_socket *nl);
void frame_destructor(void *data);
struct mnl_socket *nurs_mnl_socket(const char *ns, int bus);
enum nurs_return_t nurs_ret_from_mnl(int cbret);
#endif
|
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:42 2014 */
/* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/usb/serial/ir.h */
|
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef MODEL_H
#define MODEL_H
#include <vector>
#include "Utils.h"
class Model
{
public:
Model(std::string path);
~Model();
void ReadVertices();
void ReadBoundingTriangles();
void ReadBoundingNormals();
ModelHeader Header;
std::vector<Vector3> Vertices;
std::vector<Vector3> Normals;
std::vector<Triangle<uint16> > Triangles;
bool IsCollidable;
FILE* Stream;
bool IsBad;
};
#endif |
/*
* Cirrus Logic AccuPak (CLJR) decoder
* Copyright (c) 2003 Alex Beregszaszi
*
* 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
* Cirrus Logic AccuPak decoder.
*/
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
static int decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
GetBitContext gb;
AVFrame * const p = data;
int x, y, ret;
if (avctx->height <= 0 || avctx->width <= 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid width or height\n");
return AVERROR_INVALIDDATA;
}
if (buf_size / avctx->height < avctx->width) {
av_log(avctx, AV_LOG_ERROR,
"Resolution larger than buffer size. Invalid header?\n");
return AVERROR_INVALIDDATA;
}
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
return ret;
p->pict_type = AV_PICTURE_TYPE_I;
p->key_frame = 1;
init_get_bits(&gb, buf, buf_size * 8);
for (y = 0; y < avctx->height; y++) {
uint8_t *luma = &p->data[0][y * p->linesize[0]];
uint8_t *cb = &p->data[1][y * p->linesize[1]];
uint8_t *cr = &p->data[2][y * p->linesize[2]];
for (x = 0; x < avctx->width; x += 4) {
luma[3] = (get_bits(&gb, 5)*33) >> 2;
luma[2] = (get_bits(&gb, 5)*33) >> 2;
luma[1] = (get_bits(&gb, 5)*33) >> 2;
luma[0] = (get_bits(&gb, 5)*33) >> 2;
luma += 4;
*(cb++) = get_bits(&gb, 6) << 2;
*(cr++) = get_bits(&gb, 6) << 2;
}
}
*got_frame = 1;
return buf_size;
}
static av_cold int decode_init(AVCodecContext *avctx)
{
avctx->pix_fmt = AV_PIX_FMT_YUV411P;
return 0;
}
AVCodec ff_cljr_decoder = {
.name = "cljr",
.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CLJR,
.init = decode_init,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
};
|
/*
Copyright (C) 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
Copyright (c) 2009 Leo Franchi <lfranchi@kde.org>
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 MESSAGECOMPOSER_ENCRYPTJOB_H
#define MESSAGECOMPOSER_ENCRYPTJOB_H
#include "abstractencryptjob.h"
#include "contentjobbase.h"
#include "infopart.h"
#include "messagecomposer_export.h"
#include "kleo/enum.h"
#include <gpgme++/key.h>
#include <vector>
namespace KMime {
class Content;
}
namespace GpgME {
class Error;
}
namespace Message {
class EncryptJobPrivate;
/**
Encrypt the contents of a message .
Used as a subjob of CryptoMessage
*/
class MESSAGECOMPOSER_EXPORT EncryptJob : public ContentJobBase, public AbstractEncryptJob
{
Q_OBJECT
public:
explicit EncryptJob( QObject *parent = 0 );
virtual ~EncryptJob();
void setContent( KMime::Content* content );
void setCryptoMessageFormat( Kleo::CryptoMessageFormat format);
void setEncryptionKeys( const std::vector<GpgME::Key>& keys );
void setRecipients( const QStringList& rec );
std::vector<GpgME::Key> encryptionKeys() const;
QStringList recipients() const;
protected Q_SLOTS:
//virtual void doStart();
virtual void process();
private:
Q_DECLARE_PRIVATE( EncryptJob )
};
}
#endif
|
#ifndef _IP6T_SRH_H
#define _IP6T_SRH_H
#include <linux/types.h>
#include <linux/netfilter.h>
/* Values for "mt_flags" field in struct ip6t_srh */
#define IP6T_SRH_NEXTHDR 0x0001
#define IP6T_SRH_LEN_EQ 0x0002
#define IP6T_SRH_LEN_GT 0x0004
#define IP6T_SRH_LEN_LT 0x0008
#define IP6T_SRH_SEGS_EQ 0x0010
#define IP6T_SRH_SEGS_GT 0x0020
#define IP6T_SRH_SEGS_LT 0x0040
#define IP6T_SRH_LAST_EQ 0x0080
#define IP6T_SRH_LAST_GT 0x0100
#define IP6T_SRH_LAST_LT 0x0200
#define IP6T_SRH_TAG 0x0400
#define IP6T_SRH_MASK 0x07FF
/* Values for "mt_invflags" field in struct ip6t_srh */
#define IP6T_SRH_INV_NEXTHDR 0x0001
#define IP6T_SRH_INV_LEN_EQ 0x0002
#define IP6T_SRH_INV_LEN_GT 0x0004
#define IP6T_SRH_INV_LEN_LT 0x0008
#define IP6T_SRH_INV_SEGS_EQ 0x0010
#define IP6T_SRH_INV_SEGS_GT 0x0020
#define IP6T_SRH_INV_SEGS_LT 0x0040
#define IP6T_SRH_INV_LAST_EQ 0x0080
#define IP6T_SRH_INV_LAST_GT 0x0100
#define IP6T_SRH_INV_LAST_LT 0x0200
#define IP6T_SRH_INV_TAG 0x0400
#define IP6T_SRH_INV_MASK 0x07FF
/**
* struct ip6t_srh - SRH match options
* @ next_hdr: Next header field of SRH
* @ hdr_len: Extension header length field of SRH
* @ segs_left: Segments left field of SRH
* @ last_entry: Last entry field of SRH
* @ tag: Tag field of SRH
* @ mt_flags: match options
* @ mt_invflags: Invert the sense of match options
*/
struct ip6t_srh {
__u8 next_hdr;
__u8 hdr_len;
__u8 segs_left;
__u8 last_entry;
__u16 tag;
__u16 mt_flags;
__u16 mt_invflags;
};
#endif /*_IP6T_SRH_H*/
|
#ifndef _ASM_HW_IRQ_H
#define _ASM_HW_IRQ_H
#include <xen/config.h>
#include <xen/device_tree.h>
#define NR_VECTORS 256 /* XXX */
typedef struct {
DECLARE_BITMAP(_bits,NR_VECTORS);
} vmask_t;
struct arch_pirq
{
};
struct arch_irq_desc {
unsigned int type;
};
#define NR_LOCAL_IRQS 32
#define NR_IRQS 1024
#define nr_irqs NR_IRQS
#define nr_static_irqs NR_IRQS
#define arch_hwdom_irqs(domid) NR_IRQS
struct irq_desc;
struct irqaction;
struct irq_desc *__irq_to_desc(int irq);
#define irq_to_desc(irq) __irq_to_desc(irq)
void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
#define domain_pirq_to_irq(d, pirq) (pirq)
bool_t is_assignable_irq(unsigned int irq);
void init_IRQ(void);
void init_secondary_IRQ(void);
int route_irq_to_guest(struct domain *d, unsigned int virq,
unsigned int irq, const char *devname);
int release_guest_irq(struct domain *d, unsigned int irq);
domid_t irq_get_domain_id(struct irq_desc *desc);
void arch_move_irqs(struct vcpu *v);
#define arch_evtchn_bind_pirq(d, pirq) ((void)((d) + (pirq)))
/* Set IRQ type for an SPI */
int irq_set_spi_type(unsigned int spi, unsigned int type);
int irq_set_type(unsigned int irq, unsigned int type);
int platform_get_irq(const struct dt_device_node *device, int index);
void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask);
/*
* Use this helper in places that need to know whether the IRQ type is
* set by the domain.
*/
bool_t irq_type_set_by_domain(const struct domain *d);
#endif /* _ASM_HW_IRQ_H */
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
|
#ifndef _MICROP_HTCKOVSKY_H
#define _MICROP_HTCKOVSKY_H
#define MICROP_OJ_POWER_KOVS 0x03
#define MICROP_VERSION_REG_KOVS 0x07
#define MICROP_PATTERN_COMMAND_KOVS 0x11
#define MICROP_LCD_BRIGHTNESS_KOVS 0x12
#define MICROP_LCD_BRIGHTNESS_KOVS_13 0x13
#define MICROP_KEYPAD_BRIGHTNESS_KOVS 0x14
#define MICROP_COLOR_LED_STATE_KOVS 0x20
#define MICROP_LSENSOR_KOVS 0x30
#define MICROP_PATTERN_BUFFER_KOVS 0x41
#define MICROP_HEADSET_AMP_KOVS 0x80
#define MICROP_OJ_OVERFLOW_KOVS 0x82
#define MICROP_OJ_RESET_KOVS 0xBA
#define MICROP_OJ_REQUEST_KOVS 0xF0
#define MICROP_OJ_ID_KOVS 0xF1
#define MICROP_OJ_DATA_KOVS 0xF5
#define MICROP_LSENSOR_ENA_KOVS 0xF7
#define MICROP_KPD_LED_ENABLE_KOVS 0x30
#define MICROP_KPD_LED_BRIGHTNESS_KOVS 0x32
#define MICROP_CMD_OJ_RESET_KOVS 0x5A
#define MICROP_CMD_OJ_PWR_ON 0
#define MICROP_CMD_OJ_PWR_OFF 1
#endif
|
/* -*- mode: c; tab-width: 4; indent-tabs-mode: n; c-basic-offset: 4 -*-
*
* $Id: nb_kernel333_x86_64_sse.h,v 1.1 2004/12/26 19:33:01 lindahl Exp $
*
* This file is part of Gromacs Copyright (c) 1991-2004
* David van der Spoel, Erik Lindahl, University of Groningen.
*
* 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.
*
* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org
*
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
#ifndef _NB_KERNEL333_X86_64_SSE_H_
#define _NB_KERNEL333_X86_64_SSE_H_
/*! \file nb_kernel333_x86_64_sse.h
* \brief x86_64 SSE-optimized versions of nonbonded kernel 333
*
* \internal
*/
/*! \brief Nonbonded kernel 333 with forces, optimized for x86_64 sse.
*
* \internal
*
* <b>Coulomb interaction:</b> Tabulated <br>
* <b>VdW interaction:</b> Tabulated <br>
* <b>Water optimization:</b> TIP4P interacting with non-water atoms <br>
* <b>Forces calculated:</b> Yes <br>
*
* \note All level1 and level2 nonbonded kernels use the same
* call sequence. Parameters are documented in nb_kernel.h
*/
void
nb_kernel333_x86_64_sse (int * nri, int iinr[], int jindex[],
int jjnr[], int shift[], float shiftvec[],
float fshift[], int gid[], float pos[],
float faction[], float charge[], float * facel,
float * krf, float * crf, float Vc[],
int type[], int * ntype, float vdwparam[],
float Vvdw[], float * tabscale, float VFtab[],
float invsqrta[], float dvda[], float * gbtabscale,
float GBtab[], int * nthreads, int * count,
void * mtx, int * outeriter,int * inneriter,
float * work);
/*! \brief Nonbonded kernel 333 without forces, optimized for x86_64 sse.
*
* \internal
*
* <b>Coulomb interaction:</b> Tabulated <br>
* <b>VdW interaction:</b> Tabulated <br>
* <b>Water optimization:</b> TIP4P interacting with non-water atoms <br>
* <b>Forces calculated:</b> No <br>
*
* \note All level1 and level2 nonbonded kernels use the same
* call sequence. Parameters are documented in nb_kernel.h
*/
void
nb_kernel333nf_x86_64_sse(int * nri, int iinr[], int jindex[],
int jjnr[], int shift[], float shiftvec[],
float fshift[], int gid[], float pos[],
float faction[], float charge[], float * facel,
float * krf, float * crf, float Vc[],
int type[], int * ntype, float vdwparam[],
float Vvdw[], float * tabscale, float VFtab[],
float invsqrta[], float dvda[], float * gbtabscale,
float GBtab[], int * nthreads, int * count,
void * mtx, int * outeriter,int * inneriter,
float * work);
#endif /* _NB_KERNEL333_X86_64_SSE_H_ */
|
/*
* Copyright 2017 Clément Vuchener
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef LIBHIDPP_HIDPP10_RAM_MAPPING_H
#define LIBHIDPP_HIDPP10_RAM_MAPPING_H
#include <hidpp/AbstractMemoryMapping.h>
#include <hidpp10/IMemory.h>
#include <hidpp10/IProfile.h>
namespace HIDPP10
{
class RAMMapping: public HIDPP::AbstractMemoryMapping
{
public:
RAMMapping (Device *dev);
virtual std::vector<uint8_t>::const_iterator getReadOnlyIterator (const HIDPP::Address &address);
virtual std::vector<uint8_t>::iterator getWritableIterator (const HIDPP::Address &address);
virtual bool computeOffset (std::vector<uint8_t>::const_iterator it, HIDPP::Address &address);
protected:
virtual void readPage (const HIDPP::Address &address, std::vector<uint8_t> &data);
virtual void writePage (const HIDPP::Address &address, const std::vector<uint8_t> &data);
private:
IMemory _imem;
};
}
#endif
|
#ifndef LOGINDIALOG_H
#define LOGINDIALOG_H
#include <QObject>
#include <QDialog>
#include <QLabel>
#include <QPushButton>
#include <QToolButton>
#include <QCommandLinkButton>
#include <QFile>
#include <QTextStream>
#include <QTextCodec>
#include <QVBoxLayout>
#include <QStackedLayout>
#include <QDebug>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkCookieJar>
#include <QNetworkCookie>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QDomDocument>
#include "common.h"
#include "closabledialog.h"
#include "maindialog.h"
class LoginDialog : public ClosableDialog
{
Q_OBJECT
public:
LoginDialog(QWidget *parent=0);
void initUI();
void getUUID();
void handleUUID();
void getQRCode();
void handleQRCode();
void waitForScan(int tip);
void handleScan();
void getCookie(QString url);
void handleCookie();
private:
QWidget *initPage1();
QWidget *initPage2();
QLabel *title;
QStackedLayout *stack;
//page1
QLabel *qrCode;
QLabel *notice;
//page2
QLabel *image;
QLabel *name;
QToolButton *btn_setting;
QPushButton *loginBtn;
QCommandLinkButton *switchBtn;
QNetworkAccessManager *manager;
QNetworkReply *reply;
};
#endif // LOGINDIALOG_H
|
//
// HSSprite.h
// SpriteAnimationFramework
//
// Created by Hans Sjunnesson (hans.sjunnesson@gmail.com) on 2009-03-30.
// Copyright 2009 Hans Sjunnesson. All rights reserved.
//
// 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/>.
#import <Foundation/Foundation.h>
#import "HSFrameAnimator.h"
@interface HSSprite : NSObject {
@private
CALayer *sprite_;
int frame_;
NSString *frameset_;
HSAnimationMode animationMode_;
}
@property (nonatomic, retain) CALayer *sprite;
@property (nonatomic, assign) int frame;
@property (nonatomic, assign) NSString *frameset;
@property (nonatomic, assign) HSAnimationMode animationMode;
@end
|
/*
* time_window.h
*
*
*/
#ifndef _OpenAPI_time_window_H_
#define _OpenAPI_time_window_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_time_window_s OpenAPI_time_window_t;
typedef struct OpenAPI_time_window_s {
char *start_time;
char *stop_time;
} OpenAPI_time_window_t;
OpenAPI_time_window_t *OpenAPI_time_window_create(
char *start_time,
char *stop_time
);
void OpenAPI_time_window_free(OpenAPI_time_window_t *time_window);
OpenAPI_time_window_t *OpenAPI_time_window_parseFromJSON(cJSON *time_windowJSON);
cJSON *OpenAPI_time_window_convertToJSON(OpenAPI_time_window_t *time_window);
OpenAPI_time_window_t *OpenAPI_time_window_copy(OpenAPI_time_window_t *dst, OpenAPI_time_window_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_time_window_H_ */
|
#include "clFourier.h"
#include "clKernel.h"
#include "ROIPositions.h"
namespace PCFRegistration
{
struct PCFOptions
{
bool determinefocus;
bool pcfrecon;
bool rotscale;
bool MI;
float focalstep;
int steps;
int reference;
float pcpcfkmax;
float searchpercentage;
float magcal;
float rotcal;
float maxdrift;
float startdf;
float enddf;
float snr;
bool knownfocus;
std::vector<float> focuslist;
};
struct Abberrations2
{
float beta;
float delta;
float Cs;
float kmax;
float A1r;
float A1i;
};
};
class clRegistrationMemories
{
public:
// First Group
cl_mem clImage1;
cl_mem clImage2;
cl_mem clFFTImage1;
cl_mem clFFTImage2;
cl_mem clPCPCFResult;
cl_mem fullImage;
cl_mem rotScaleImage;
cl_mem clW;
cl_mem clWminus;
cl_mem clw;
cl_mem clwminus;
cl_mem clT;
cl_mem clU;
cl_mem clV;
cl_mem clRestored;
cl_mem clMTF;
cl_mem clNPS;
void SetupGroupOne(int width, int height, int fullwidth, int fullheight);
void SetupMTFNPS(int mtflength, int npslength);
// Second Group
cl_mem clRestoredMinus;
cl_mem clQ;
cl_mem clPCI;
cl_mem clPCIC;
cl_mem clPCIM;
cl_mem clPCIS;
cl_mem clSumOutput;
cl_mem clSumOutputFloat;
cl_mem clSumOutputUint;
void SetupGroupTwo(int width, int height, int nGroups);
void CleanUp(bool mtfnps);
};
#pragma once
class Registration
{
private:
int gonext;
int nextdir;
int padTop;
int padLeft;
int padRight;
int padBottom;
int currentimage;
bool gotMTF;
bool gotNPS;
int mtflength;
float scaleMTFx;
float scaleMTFy;
float voltage;
public:
Registration(void);
~Registration(void);
bool noalign;
// Vector to hold IDs of registered images as they are completed.
std::vector<int> ImageList;
// Open CL Memories
clRegistrationMemories clMem;
// Other options/settings
PCFRegistration::PCFOptions options;
PCFRegistration::Abberrations2 Aberrations;
// Open CL Kernels
clFourier* OpenCLFFT;
clKernel cl_k_PCPCF;
clKernel cl_k_PadCrop;
clKernel cl_k_WaveTransferFunction;
clKernel cl_k_WaveTransferFunctionMinus;
clKernel cl_k_WienerW;
clKernel cl_k_WienerWMinus;
clKernel cl_k_WienerT;
clKernel cl_k_WienerU;
clKernel cl_k_WienerV;
clKernel cl_k_MakeRestored;
clKernel cl_k_RotScale;
clKernel cl_k_Q;
clKernel cl_k_SumReduction;
clKernel cl_k_SumReductionFloat;
clKernel cl_k_SumReductionUint;
clKernel cl_k_MinusWavefunction;
clKernel cl_k_CalculatePCI;
clKernel cl_k_Abs;
clKernel cl_k_WaveTransferFunctionMTF;
clKernel cl_k_WaveTransferFunctionMinusMTF;
clKernel cl_k_MakeRestoredMTFNPS;
clKernel cl_k_HanningWindow;
clKernel cl_k_Predicted;
void KernelCleanUp();
// Things to set before using class
void Setup(clFourier* FFT,int ref, int num, int wid, int hei, int fullwid, int fullhei, int* xs, int* ys, float* sxs, float* sys, float* dfs, float wavel, float pixelscale, float volts, float min, float max);
int referenceimage;
int NumberOfImages;
int width;
int height;
int fullwidth;
int fullheight;
int* xShiftVals;
int* yShiftVals;
float* subXShifts;
float* subYShifts;
float* defocusshifts;
float wavelength;
float pixelscale;
float min;
float max;
void IterateImageNumber();
void BuildKernels();
void LoadMTFNPS(DigitalMicrograph::Image &MTFImage, DigitalMicrograph::Image &NPSImage);
void SetFixedArgs(ROIPositions ROIpos, cl_mem &clxFrequencies, cl_mem &clyFrequencies, float wavelength);
void RotationScale(float* seriesdata,size_t* fullWorkSize,std::vector<float> &rotscaledseries);
void RegisterSeries(float* seriesdata, ROIPositions ROIpos, cl_mem &clxFrequencies, cl_mem &clyFrequencies);
void MIRegisterSeries(float* seriesdata, ROIPositions ROIpos, cl_mem &clxFrequencies, cl_mem &clyFrequencies);
void MagnificationPCF(int numberoftrials, float expectedDF, std::vector<std::complex<float>> &dataOne, int preshiftx, int preshifty, size_t* globalWorkSize, std::vector<float> &seriesdata, int iLeft, int iTop, int im );
void PhaseCompensatedPCF(int numberoftrials, float expectedDF, std::vector<std::complex<float>> &dataOne, int preshiftx, int preshifty, size_t* globalWorkSize);
void MutualInformation(int numberoftrials, float expectedDF, std::vector<std::complex<float>> &dataOne, std::vector<std::complex<float>> &dataTwo, int preshiftx, int preshifty, size_t* globalWorkSize, int miSize, DigitalMicrograph::Image &MIMap, int imagenumber);
void MutualInformationFast(int numberoftrials, float expectedDF, std::vector<std::complex<float>> &dataOne, std::vector<std::complex<float>> &dataTwo, int preshiftx, int preshifty, size_t* globalWorkSize, int miSize, DigitalMicrograph::Image &MIMap, int imagenumber);
void AddToReconstruction(std::vector<float> &rotscaledseries, size_t* globalWorkSize, float DfGuess, float A1rGuess, float A1iGuess);
void MakeDriftCorrectedSeries(std::vector<float> &rotscaledseries, size_t* globalWorkSize);
void SetupPCI(size_t* globalWorkSize);
void Window(cl_mem &Image, int width, int height);
void PCITrials(float sumQ, float startdf, float stepdf,float A1r, float A1i, cl_mem &clxFrequencies, cl_mem &clyFrequencies, size_t* globalWorkSize, size_t* globalSizeSum,
size_t* localSizeSum, int nGroups, int totalSize, float &DfGuess, float &A1rGuess, float &A1iGuess,bool first);
// Little utility functions or wrappers
float CalculateExpectedDF(int imageone, int imagetwo);
float CalculateTrialDF(int trialnumber, int numberoftrials, float expectedDF);
void CopyImageData(int imagenumber, int iLeft, int iTop,std::vector<std::complex<float>> &data, std::vector<float> &seriesdata, int preshiftx, int preshifty);
void DeterminePadding(ROIPositions ROIpos);
float SumReduction(cl_mem &Array, size_t* globalSizeSum, size_t* localSizeSum, int nGroups, int totalSize);
float SumReductionFloat(cl_mem &Array, size_t* globalSizeSum, size_t* localSizeSum, int nGroups, int totalSize, int offset);
float SumReductionUint(cl_mem &Array, size_t* globalSizeSum, size_t* localSizeSum, int nGroups, int totalSize, int offset);
};
|
/***********************************************************************
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
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.
- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific 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 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.
***********************************************************************/
//#ifdef HAVE_CONFIG_H
#include "opus__config.h"
//#endif
#include "main_FLP.h"
#include "tuning_parameters.h"
/* Processing of gains */
void silk_process_gains_FLP(
silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
opus_int condCoding /* I The type of conditional coding to use */
)
{
silk_shape_state_FLP *psShapeSt = &psEnc->sShape;
opus_int k;
opus_int32 pGains_Q16[ MAX_NB_SUBFR ];
silk_float s, InvMaxSqrVal, gain, quant_offset;
/* Gain reduction when LTP coding gain is high */
if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) {
s = 1.0f - 0.5f * silk_sigmoid( 0.25f * ( psEncCtrl->LTPredCodGain - 12.0f ) );
for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {
psEncCtrl->Gains[ k ] *= s;
}
}
/* Limit the quantized signal */
InvMaxSqrVal = ( silk_float )( pow( 2.0f, 0.33f * ( 21.0f - psEnc->sCmn.SNR_dB_Q7 * ( 1 / 128.0f ) ) ) / psEnc->sCmn.subfr_length );
for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {
/* Soft limit on ratio residual energy and squared gains */
gain = psEncCtrl->Gains[ k ];
gain = ( silk_float )sqrt( gain * gain + psEncCtrl->ResNrg[ k ] * InvMaxSqrVal );
psEncCtrl->Gains[ k ] = silk_min_float( gain, 32767.0f );
}
/* Prepare gains for noise shaping quantization */
for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {
pGains_Q16[ k ] = (opus_int32)( psEncCtrl->Gains[ k ] * 65536.0f );
}
/* Save unquantized gains and gain Index */
silk_memcpy( psEncCtrl->GainsUnq_Q16, pGains_Q16, psEnc->sCmn.nb_subfr * sizeof( opus_int32 ) );
psEncCtrl->lastGainIndexPrev = psShapeSt->LastGainIndex;
/* Quantize gains */
silk_gains_quant( psEnc->sCmn.indices.GainsIndices, pGains_Q16,
&psShapeSt->LastGainIndex, condCoding == CODE_CONDITIONALLY, psEnc->sCmn.nb_subfr );
/* Overwrite unquantized gains with quantized gains and convert back to Q0 from Q16 */
for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) {
psEncCtrl->Gains[ k ] = pGains_Q16[ k ] / 65536.0f;
}
/* Set quantizer offset for voiced signals. Larger offset when LTP coding gain is low or tilt is high (ie low-pass) */
if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) {
if( psEncCtrl->LTPredCodGain + psEnc->sCmn.input_tilt_Q15 * ( 1.0f / 32768.0f ) > 1.0f ) {
psEnc->sCmn.indices.quantOffsetType = 0;
} else {
psEnc->sCmn.indices.quantOffsetType = 1;
}
}
/* Quantizer boundary adjustment */
quant_offset = silk_Quantization_Offsets_Q10[ psEnc->sCmn.indices.signalType >> 1 ][ psEnc->sCmn.indices.quantOffsetType ] / 1024.0f;
psEncCtrl->Lambda = LAMBDA_OFFSET
+ LAMBDA_DELAYED_DECISIONS * psEnc->sCmn.nStatesDelayedDecision
+ LAMBDA_SPEECH_ACT * psEnc->sCmn.speech_activity_Q8 * ( 1.0f / 256.0f )
+ LAMBDA_INPUT_QUALITY * psEncCtrl->input_quality
+ LAMBDA_CODING_QUALITY * psEncCtrl->coding_quality
+ LAMBDA_QUANT_OFFSET * quant_offset;
silk_assert( psEncCtrl->Lambda > 0.0f );
silk_assert( psEncCtrl->Lambda < 2.0f );
}
|
#ifndef HANDEYETRANSFORMATION_H_
#define HANDEYETRANSFORMATION_H_
#include <theia/theia.h>
#include "type.h"
class HandEyeTransformation
{
public:
const double* HandEyeParameter() const;
double* Mutable_HandEyeParameter();
void SetHandEyeTranslatation(const Eigen::Vector3d& translation);
Eigen::Vector3d GetHandEyeTranslation() const;
void SetHandEyeRotationFromRotationMatrix(const Eigen::Matrix3d& rotation);
void SetHandEyeRotationFromAngleAxis(const Eigen::Vector3d& angle_axis);
Eigen::Matrix3d GetHandEyeRotationAsRotationMatrix() const;
Eigen::Vector3d GetHandEyeRotationAsAngleAxis() const;
enum ParametersIndex
{
ROTATION = 0,
TRANSLATION = 3
};
private:
double hand_eye_parameter_[6];
};
#endif //HANDEYETRANSFORMATION_H_
|
/* Copyright (C) 2018 Magnus Lång and Tuan Phong Ngo
* This benchmark is part of SWSC */
#include <assert.h>
#include <stdint.h>
#include <stdatomic.h>
#include <pthread.h>
atomic_int vars[2];
atomic_int atom_1_r1_1;
atomic_int atom_1_r3_2;
atomic_int atom_1_r6_0;
void *t0(void *arg){
label_1:;
atomic_store_explicit(&vars[0], 1, memory_order_seq_cst);
atomic_store_explicit(&vars[1], 1, memory_order_seq_cst);
return NULL;
}
void *t1(void *arg){
label_2:;
int v2_r1 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v4_r3 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v6_r4 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v7_r5 = v6_r4 ^ v6_r4;
int v10_r6 = atomic_load_explicit(&vars[0+v7_r5], memory_order_seq_cst);
int v16 = (v2_r1 == 1);
atomic_store_explicit(&atom_1_r1_1, v16, memory_order_seq_cst);
int v17 = (v4_r3 == 2);
atomic_store_explicit(&atom_1_r3_2, v17, memory_order_seq_cst);
int v18 = (v10_r6 == 0);
atomic_store_explicit(&atom_1_r6_0, v18, memory_order_seq_cst);
return NULL;
}
void *t2(void *arg){
label_3:;
atomic_store_explicit(&vars[1], 2, memory_order_seq_cst);
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
pthread_t thr2;
atomic_init(&vars[1], 0);
atomic_init(&vars[0], 0);
atomic_init(&atom_1_r1_1, 0);
atomic_init(&atom_1_r3_2, 0);
atomic_init(&atom_1_r6_0, 0);
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_create(&thr2, NULL, t2, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
pthread_join(thr2, NULL);
int v11 = atomic_load_explicit(&atom_1_r1_1, memory_order_seq_cst);
int v12 = atomic_load_explicit(&atom_1_r3_2, memory_order_seq_cst);
int v13 = atomic_load_explicit(&atom_1_r6_0, memory_order_seq_cst);
int v14_conj = v12 & v13;
int v15_conj = v11 & v14_conj;
if (v15_conj == 1) assert(0);
return 0;
}
|
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
//
//////////////////////////////////////////////////////////////////////
#ifndef _AK_WWISE_UNDO_H
#define _AK_WWISE_UNDO_H
#include <AK/Wwise/Utilities.h>
#ifdef _DEBUG
#define UNDO_EVENT_DEBUG_INFO
#endif // UNIT_TEST
namespace AK
{
namespace Wwise
{
class IUndoEvent
: public IPluginBase
{
public:
// Un-execute the action
virtual bool Undo() = 0;
// Re-execute the action
virtual bool Redo() = 0;
// Get the name of the action
virtual bool GetName( CString& out_csName ) = 0;
// Check if this undo event is relevant all by itself. For example,
// a selection change is not necessary, but is nice to have around when
// surrounded by other events in a complex undo.
virtual bool IsNecessary() = 0;
// Return the associated object GUID this undo is modifying
virtual GUID GetObjectID() const = 0;
#ifdef UNDO_EVENT_DEBUG_INFO
// Get a string representing data for this
// undo event. It will be used to display info in the
// debug window. The object should prepend in_szPrefix
// to the string (for formatting complex undo info)
virtual bool GetDebugString( LPCTSTR in_szPrefix, CString& out_csString ) = 0;
#endif // UNDO_EVENT_DEBUG_INFO
};
class IComplexUndo
: public IUndoEvent
{
public:
// Add an event to this complex undo event
virtual bool AddEvent( IUndoEvent* in_pEvent ) = 0;
// Check if this complex undo is empty ( i.e. contains no sub events ).
virtual bool IsEmpty() = 0;
// If this complex undo contains only one sub event, remove it and return it
virtual IUndoEvent* ExtractSingleSubEvent() = 0;
};
class IUndoManager
{
public:
// Add an undo event
virtual bool AddEvent( IUndoEvent* in_pEvent ) = 0;
// Open a complex undo event that will contain all subsequent undo events
virtual bool OpenComplex( IComplexUndo * in_pComplex = NULL ) = 0;
// Close the current complex undo
virtual bool CloseComplex( LPCTSTR in_szName, bool in_bKeepEvenIfContainsSingleEvent = false ) = 0;
// Cancel the current complex undo
virtual bool CancelComplex() = 0;
// Check if we are currently in a state where we can add undo events.
virtual bool CanAddEvent() = 0;
// Check if we are busy (undoing or redoing).
virtual bool IsBusy() = 0;
};
}
}
#endif // _AK_WWISE_UNDO_H
|
int lengthOfLongestSubstring(char* s) {
int alphabet[128], i, maxLength;
char *p, *q;
maxLength = 0;
for(p = s; *p != '\0';p++){
for(i = 0; i < 128; ++i)
alphabet[i] = 0;
for(q = p, i = 0; *q != '\0'; q++){
if(!alphabet[*q]){
++alphabet[*q];
++i;
if(i > maxLength)
maxLength = i;
}else{
break;
}
}
}
return maxLength;
}
|
#pragma once
/*
* Copyright (C) 2014-2015 Team KODI
* http://kodi.tv
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
#include "RoomCorrection/typedefs.h"
class ICaptureSource
{
public:
virtual bool Create(uint SampleFrequency, uint FrameSize=0, uint MaxCaptureChannels=1, std::string DeviceName="") = 0;
virtual void Destroy() = 0;
virtual bool StartCapturing() = 0;
virtual bool StopCapturing() = 0;
virtual bool PauseCapturing() = 0;
virtual bool IsCapturing() = 0;
virtual int Get_Devices(CCaptureDeviceList_t &DeviceList) = 0;
virtual ulong GetStoredSamples() = 0;
virtual ulong GetSamples(float *Samples, ulong MaxSamples, ulong Offset = 0) = 0;
}; |
/*********************************************************************
Comb-Layer : MCNP(X) Input builder
* File: physicsInc/ZoneUnit.h
*
* Copyright (c) 2004-2021 by Stuart Ansell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
****************************************************************************/
#ifndef physicsSystem_ZoneUnit_h
#define physicsSystem_ZoneUnit_h
namespace attachSystem
{
class FixedComp;
}
class objectGroups;
class Simulation;
namespace physicsSystem
{
/*!
\class ZoneUnit
\version 1.0
\author S. Ansell
\date February 2016
\brief Adds zone (ranged) support
\tparam T :: Data type
Provides a range of intergers groups an associated data with
that range.
E.g. 11-13 : 4.5, 14-18:7.5 ...
*/
template<typename T>
class ZoneUnit
{
public:
/// Ranges to build
std::vector<MapSupport::Range<int>> Zones;
/// Data associated with the zone
std::vector<T> ZoneData;
static MapSupport::Range<int>
createMapRange(std::vector<int>&);
static MapSupport::Range<int>
createMapRange(std::set<int>&);
void sortZone();
bool procZone(const objectGroups&,std::vector<std::string>&);
void addData(const T&);
ZoneUnit();
ZoneUnit(const ZoneUnit&);
ZoneUnit& operator=(const ZoneUnit&);
~ZoneUnit() {} ///< Destructor
size_t findItem(const int) const;
bool inRange(const int,T&) const;
};
}
#endif
|
#pragma once
#include <ip/UdpSocket.h>
#include <osc/OscPacketListener.h>
#include <memory>
#include <thread>
#include <functional>
#include <map>
#include <iostream>
class OscReceiver
{
public:
using message_handler = std::function<void(osc::ReceivedMessageArgumentStream)>;
using connection_handler = std::function<void(osc::ReceivedMessageArgumentStream, std::string)>;
OscReceiver(unsigned int port)
{
setPort(port);
}
~OscReceiver()
{
_runThread.detach();
socket.reset();
}
void run()
{
_runThread = std::thread(&UdpListeningReceiveSocket::Run, socket.get());
}
template<typename... K>
void setConnectionHandler(K&&... args)
{
_impl.setConnectionHandler(std::forward<K>(args)...);
}
template<typename T, class C>
void addHandler(const std::string &s, T&& theMember, C&& theClass)
{
_impl.addHandler(s, std::bind(theMember, theClass, std::placeholders::_1));
}
void addHandler(const std::string &s, const message_handler h)
{
_impl.addHandler(s, h);
}
unsigned int port() const
{
return _port;
}
unsigned int setPort(unsigned int port)
{
_port = port;
bool ok = false;
while(!ok)
{
try
{
socket = std::make_shared<UdpListeningReceiveSocket>
(IpEndpointName(IpEndpointName::ANY_ADDRESS, _port),
&_impl);
ok = true;
}
catch(std::runtime_error& e)
{
_port++;
}
}
std::cerr << "Receiver port set : " << _port << std::endl;
return _port;
}
private:
unsigned int _port = 0;
std::shared_ptr<UdpListeningReceiveSocket> socket;
class : public osc::OscPacketListener
{
public:
void setConnectionHandler(const std::string& s, const connection_handler& h)
{
_connectionAdress = s;
_connectionHandler = h;
}
void addHandler(const std::string& s, const message_handler& h)
{
_map[s] = h;
}
protected:
virtual void ProcessMessage(const osc::ReceivedMessage& m,
const IpEndpointName& ip) override
{
try
{
auto addr = std::string(m.AddressPattern());
std::cerr << "Message received on " << addr << std::endl;
if(addr == _connectionAdress)
{
char s[16];
ip.AddressAsString(s);
_connectionHandler(m.ArgumentStream(), std::string(s));
}
else if(_map.find(addr) != _map.end())
{
_map[addr](m.ArgumentStream());
}
}
catch( osc::Exception& e )
{
std::cerr << "error while parsing message: "
<< m.AddressPattern() << ": " << e.what() << std::endl;
}
}
private:
std::map<std::string, message_handler> _map;
std::string _connectionAdress{};
connection_handler _connectionHandler{};
} _impl{};
std::thread _runThread;
};
|
#pragma once
#define THINKPAD_AVAILABLE
#include "shared.h"
#define THINKPAD_ACPI_DEVICE "/proc/acpi/ibm/led"
typedef struct {
char *led;
int device;
} ThinkpadConfig;
void thinkpad_init(Indicator *indicator, char *led);
void thinkpad_quit(Indicator *indicator);
void thinkpad_turn_on(Indicator *indicator);
void thinkpad_turn_off(Indicator *indicator);
|
/* Quickscope - a software oscilloscope
* Copyright (C) 2012-2014 Lance Arsenault
* GNU General Public License version 3
*/
#include "quickscope.h"
static bool
SpewSource(struct QsSource *s, struct QsIterator2 *it)
{
float x, y;
long double t;
while(qsIterator2_get(it, &x, &y, &t))
printf("%Lg %g %g\n", t, x, y);
return true;
}
int main(int argc, char **argv)
{
if(!argv[1])
{
fprintf(stderr, "Usage: %s SND_FILE\n", argv[0]);
return 1;
}
struct QsSource *snd;
snd = qsSoundFile_create(argv[1],
10000/*scope frames per scope source read call*/,
0, /* play back rate, 0 for same as file play rate*/
NULL/*source group*/);
qsSource_addChangeCallback(snd,
(bool (*)(struct QsSource *, void *)) SpewSource,
qsIterator2_create(snd, snd, 0/*channel0*/,
(qsSource_numChannels(snd) < 2) ? 0: 1/*channel1*/));
qsApp_main();
qsApp_destroy();
return 0;
}
|
/*
* life : a Game of Life implementation
* Copyright (C) 2015 Thomas Baumela
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/***********************************************************
* world.h : *
* Créations, chargement et sauvegardes des mondes *
***********************************************************/
#ifndef WORLD_H
#define WORLD_H
/* Small World */
#define DEFAULT_WIDTH_WORLD 90
#define DEFAULT_HEIGHT_WORLD 25
/* Voisines */
#define Left_Top [x-1][y-1]
#define Top [x ][y-1]
#define Right_Top [x+1][y-1]
#define Right [x+1][y ]
#define Right_Bot [x+1][y+1]
#define Bot [x ][y+1]
#define Left_Bot [x-1][y+1]
#define Left [x-1][y ]
#include <stdio.h>
void scan_line(FILE* file, int nbLine); // Ignore un certain nombre de ligne (nbLine) d'un fichier
/* Fonctions de chargement et de sauvegarde des mondes */
int save_world(Cell** world, int width, int height);
void get_dimensions(FILE* file, int* worldSize, int* width, int* height); // Récupert les dimensions du monde pour l'allocation dynamique
int load_world(FILE* file, Cell** world, int width, int height);
void init_world (Cell** world, int width, int height); // Initialise un monde vide
void random_world (Cell** world, int width, int height, int xMargin, int yMargin, int pcChanceOfLife); // Initialise un monde aléatoire
void copy_world (Cell** source, Cell** destination, int width, int height); // Copie le monde source dans le monde de destination
int population (Cell** world, int width, int height); // Calcul le nombre de cellules vivantes dans le monde
#endif // WORLD_H
|
/*
** ClanLib SDK
** Copyright (c) 1997-2005 The ClanLib Team
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any damages
** arising from the use of this software.
**
** Permission is granted to anyone to use this software for any purpose,
** including commercial applications, and to alter it and redistribute it
** freely, subject to the following restrictions:
**
** 1. The origin of this software must not be misrepresented; you must not
** claim that you wrote the original software. If you use this software
** in a product, an acknowledgment in the product documentation would be
** appreciated but is not required.
** 2. Altered source versions must be plainly marked as such, and must not be
** misrepresented as being the original software.
** 3. This notice may not be removed or altered from any source distribution.
**
** Note: Some of the libraries ClanLib may link to may have additional
** requirements or restrictions.
**
** File Author(s):
**
** Magnus Norddahl
** (if your name is missing here, please add it)
*/
//! clanCore="Math"
//! header=core.h
#ifndef header_matrix4x4
#define header_matrix4x4
#ifdef CL_API_DLL
#ifdef CL_CORE_EXPORT
#define CL_API_CORE __declspec(dllexport)
#else
#define CL_API_CORE __declspec(dllimport)
#endif
#else
#define CL_API_CORE
#endif
#if _MSC_VER > 1000
#pragma once
#endif
//: 4x4 Matrix.
class CL_API_CORE CL_Matrix4x4
{
//! Construction:
public:
//: Constructs a 4x4 matrix.
//param identity: When true, initial matrix will be the identity matrix. If false, initial will be null matrix.
//param matrix[16]: Initial matrix.
CL_Matrix4x4(bool identity = false);
CL_Matrix4x4(const CL_Matrix4x4 ©);
CL_Matrix4x4(double *matrix);
CL_Matrix4x4(float *matrix);
//! Attributes:
public:
double matrix[16];
//: Operator that returns the matrix as a double[16] array.
operator double const*() const { return matrix; }
//: Operator that returns the matrix as a double[16] array.
operator double *() { return matrix; }
//: Operator that returns the matrix cell at the given index.
double &operator[](int i) { return matrix[i]; }
//: Operator that returns the matrix cell at the given index.
const double &operator[](int i) const { return matrix[i]; }
//: Operator that returns the matrix cell at the given index.
double &operator[](unsigned int i) { return matrix[i]; }
//: Operator that returns the matrix cell at the given index.
const double &operator[](unsigned int i) const { return matrix[i]; }
//: Returns the x coordinate for the point (0,0,0) multiplied with this matrix.
double get_origin_x() const;
//: Returns the y coordinate for the point (0,0,0) multiplied with this matrix.
double get_origin_y() const;
//: Returns the z coordinate for the point (0,0,0) multiplied with this matrix.
double get_origin_z() const;
//! Operations:
public:
//: Copy assignment operator.
CL_Matrix4x4 &operator =(const CL_Matrix4x4 ©);
//: Equality operator.
bool operator==(const CL_Matrix4x4 &other) const;
//: Not-equal operator.
bool operator!=(const CL_Matrix4x4 &other) const;
//: Multiply two matrices.
CL_Matrix4x4 multiply(const CL_Matrix4x4 &matrix) const;
//! Implementation:
private:
};
#endif
|
/***
* * WHAT
* * Implementation of mod_mod.vdm
* * FILE
* * $Source: /home/vdmtools/cvsroot/toolbox/code/cg/mod_mod.h,v $
* * VERSION
* * $Revision: 1.6 $
* * DATE
* * $Date: 2006/03/17 08:29:12 $
* * STATUS
* * Under development
* * REFERENCES
* *
* * PROJECT
* * IDERS
* * AUTHOR
* * Henrik Voss + $Author: vdmtools $
* *
* * COPYRIGHT
* * (C) Kyushu University
***/
#ifndef __mod_mod_h__
#define __mod_mod_h__
private:
SEQ<TYPE_CPP_Stmt> vi_l; // seq of CPP`Stmt
SEQ<TYPE_CPP_IdentDeclaration> idecl_l; // seq of CPP`IdentDeclaration
private:
SET<TYPE_CPP_File> GenModule(const TYPE_AS_Module &);
TYPE_CPP_File GenHFile(const TYPE_AS_Module &);
SET<TYPE_AS_Name> RemPrePost(const Map &);
TYPE_CPP_File GenCCFile(const TYPE_AS_Module &);
SEQ<TYPE_CPP_Preprocessor> GenImports(const SET<TYPE_AS_Name> &);
SEQ<TYPE_CPP_Preprocessor> GenRename(const TYPE_AS_Name &, const Map &);
SEQ<TYPE_CPP_Preprocessor> GenRenameRecord(const TYPE_AS_Name &, const TYPE_AS_Name &, const TYPE_AS_CompositeType &);
SEQ<TYPE_CPP_Preprocessor> GenRenameInv(const TYPE_AS_Name &, const TYPE_AS_Name &, const TYPE_AS_TypeDef &);
TYPE_CPP_CPPAS GenTypes(const TYPE_AS_Name & nm, const MAP<TYPE_AS_Name, TYPE_AS_TypeDef> & type_m,
const Generic & sd);
TYPE_CPP_CPPAS GenTypeInvFcts(const MAP<TYPE_AS_Name, TYPE_AS_TypeDef> &, const Generic &);
SEQ<TYPE_CPP_IdentDeclaration> GenExportedValues(const Generic &, const SEQ<TYPE_AS_ValueDef> &);
TYPE_CPP_FunctionDefinition GenInitFct(const TYPE_AS_Name &, bool);
TYPE_CPP_IdentDeclaration GenInitDecl(const TYPE_AS_Name &);
SEQ<TYPE_CPP_IdentDeclaration> GenStaticVars(const Generic &);
TYPE_CPP_CPPAS GenExpSigs(const Map &, const Generic &, const TYPE_AS_Module &);
TYPE_CPP_CPPAS GenLocalSigs(const Map &, const Generic &);
TYPE_CPP_CPPAS GenFctDef_MOD(const MAP<TYPE_AS_Name, TYPE_AS_FnDef> &, const Generic &);
TYPE_CPP_CPPAS GenOpDef_MOD(const MAP<TYPE_AS_Name, TYPE_AS_OpDef> &, const Generic &);
SEQ<TYPE_AS_TypeDef> TypeMapToSeq(const MAP<TYPE_AS_Name, TYPE_AS_TypeDef> &, const Generic &) const;
Generic GenInitStateFnDef(const TYPE_AS_StateDef & sd);
#endif // __mod_mod_h__
|
/**
******************************************************************************
* @file Examples_LL/IWDG/IWDG_RefreshUntilUserEvent/Src/stm32f4xx_it.c
* @author MCD Application Team
* @version V1.0.0
* @date 17-February-2017
* @brief Main Interrupt Service Routines.
* This file provides template for all exceptions handler and
* peripherals interrupt service routine.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* 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 STMicroelectronics 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 COPYRIGHT HOLDER 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.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_it.h"
/** @addtogroup STM32F4xx_LL_Examples
* @{
*/
/** @addtogroup IWDG_RefreshUntilUserEvent
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/******************************************************************************/
/* Cortex-M4 Processor Exceptions Handlers */
/******************************************************************************/
/**
* @brief This function handles NMI exception.
* @param None
* @retval None
*/
void NMI_Handler(void)
{
}
/**
* @brief This function handles Hard Fault exception.
* @param None
* @retval None
*/
void HardFault_Handler(void)
{
/* Go to infinite loop when Hard Fault exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Memory Manage exception.
* @param None
* @retval None
*/
void MemManage_Handler(void)
{
/* Go to infinite loop when Memory Manage exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Bus Fault exception.
* @param None
* @retval None
*/
void BusFault_Handler(void)
{
/* Go to infinite loop when Bus Fault exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Usage Fault exception.
* @param None
* @retval None
*/
void UsageFault_Handler(void)
{
/* Go to infinite loop when Usage Fault exception occurs */
while (1)
{
}
}
/**
* @brief This function handles SVCall exception.
* @param None
* @retval None
*/
void SVC_Handler(void)
{
}
/**
* @brief This function handles Debug Monitor exception.
* @param None
* @retval None
*/
void DebugMon_Handler(void)
{
}
/**
* @brief This function handles PendSVC exception.
* @param None
* @retval None
*/
void PendSV_Handler(void)
{
}
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler(void)
{
}
/******************************************************************************/
/* STM32F4xx Peripherals Interrupt Handlers */
/* Add here the Interrupt Handler for the used peripheral(s) (IWDG), for the */
/* available peripheral interrupt handler's name please refer to the startup */
/* file (startup_stm32f4xx.s). */
/******************************************************************************/
/**
* @brief This function handles external line 13 interrupt request.
* @param None
* @retval None
*/
void USER_BUTTON_IRQHANDLER(void)
{
/* Manage Flags */
if(LL_EXTI_IsActiveFlag_0_31(USER_BUTTON_EXTI_LINE) != RESET)
{
/* Clear EXTI flag */
LL_EXTI_ClearFlag_0_31(USER_BUTTON_EXTI_LINE);
/* Handle user button press in dedicated function */
UserButton_Callback();
}
}
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
** my_put_nbrbase.c for my_put_nbrbase in /home/blonde_f/rendu/PSU_2013_my_printf
**
** Made by Guillaume Blondeau
** Login <blonde_f@epitech.net>
**
** Started on Fri Nov 15 13:03:12 2013 Guillaume Blondeau
** Last update Sun Jan 5 10:50:15 2014 Guillaume Blondeau
*/
#include <stdlib.h>
#include "my.h"
void my_putbase(char *res, char *base)
{
int i;
int j;
i = my_strlen(res) - 1;
while (i >= 0)
{
j = 0;
while (res[i] != j)
j++;
my_putchar(base[j]);
i--;
}
}
int my_put_nbrbase(int nb, char *base)
{
int tall;
int i;
char *res;
res = malloc(30 * sizeof(char));
if (res == NULL)
{
my_putstr("Malloc Error");
return (-1);
}
tall = my_strlen(base);
i = 0;
while (nb > tall)
{
res[i++] = nb % tall;
nb = nb / tall;
}
res[i++] = nb;
res[i] = '\0';
my_putbase(res, base);
free(res);
return (0);
}
|
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "n1_n2_message_transfer_rsp_data.h"
OpenAPI_n1_n2_message_transfer_rsp_data_t *OpenAPI_n1_n2_message_transfer_rsp_data_create(
OpenAPI_n1_n2_message_transfer_cause_e cause,
char *supported_features
)
{
OpenAPI_n1_n2_message_transfer_rsp_data_t *n1_n2_message_transfer_rsp_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_n1_n2_message_transfer_rsp_data_t));
if (!n1_n2_message_transfer_rsp_data_local_var) {
return NULL;
}
n1_n2_message_transfer_rsp_data_local_var->cause = cause;
n1_n2_message_transfer_rsp_data_local_var->supported_features = supported_features;
return n1_n2_message_transfer_rsp_data_local_var;
}
void OpenAPI_n1_n2_message_transfer_rsp_data_free(OpenAPI_n1_n2_message_transfer_rsp_data_t *n1_n2_message_transfer_rsp_data)
{
if (NULL == n1_n2_message_transfer_rsp_data) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(n1_n2_message_transfer_rsp_data->supported_features);
ogs_free(n1_n2_message_transfer_rsp_data);
}
cJSON *OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON(OpenAPI_n1_n2_message_transfer_rsp_data_t *n1_n2_message_transfer_rsp_data)
{
cJSON *item = NULL;
if (n1_n2_message_transfer_rsp_data == NULL) {
ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON() failed [N1N2MessageTransferRspData]");
return NULL;
}
item = cJSON_CreateObject();
if (!n1_n2_message_transfer_rsp_data->cause) {
ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON() failed [cause]");
goto end;
}
if (cJSON_AddStringToObject(item, "cause", OpenAPI_n1_n2_message_transfer_cause_ToString(n1_n2_message_transfer_rsp_data->cause)) == NULL) {
ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON() failed [cause]");
goto end;
}
if (n1_n2_message_transfer_rsp_data->supported_features) {
if (cJSON_AddStringToObject(item, "supportedFeatures", n1_n2_message_transfer_rsp_data->supported_features) == NULL) {
ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON() failed [supported_features]");
goto end;
}
}
end:
return item;
}
OpenAPI_n1_n2_message_transfer_rsp_data_t *OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON(cJSON *n1_n2_message_transfer_rsp_dataJSON)
{
OpenAPI_n1_n2_message_transfer_rsp_data_t *n1_n2_message_transfer_rsp_data_local_var = NULL;
cJSON *cause = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_rsp_dataJSON, "cause");
if (!cause) {
ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON() failed [cause]");
goto end;
}
OpenAPI_n1_n2_message_transfer_cause_e causeVariable;
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_n1_n2_message_transfer_cause_FromString(cause->valuestring);
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_rsp_dataJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON() failed [supported_features]");
goto end;
}
}
n1_n2_message_transfer_rsp_data_local_var = OpenAPI_n1_n2_message_transfer_rsp_data_create (
causeVariable,
supported_features ? ogs_strdup(supported_features->valuestring) : NULL
);
return n1_n2_message_transfer_rsp_data_local_var;
end:
return NULL;
}
OpenAPI_n1_n2_message_transfer_rsp_data_t *OpenAPI_n1_n2_message_transfer_rsp_data_copy(OpenAPI_n1_n2_message_transfer_rsp_data_t *dst, OpenAPI_n1_n2_message_transfer_rsp_data_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_n1_n2_message_transfer_rsp_data_free(dst);
dst = OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}
|
//
// DeviceMotion.h
// P5P
//
// Created by CNPP on 3.2.2011.
// Copyright Beat Raess 2011. All rights reserved.
//
// This file is part of P5P.
//
// P5P 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.
//
// P5P 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 P5P. If not, see www.gnu.org/licenses/.
#import <UIKit/UIKit.h>
#import <CoreMotion/CoreMotion.h>
#import "AccelerometerFilter.h"
/**
* DeviceAcceleration data.
*/
@interface DeviceAcceleration : NSObject {
// fields
double x;
double y;
double z;
}
// Properties
@property double x;
@property double y;
@property double z;
@end
/**
* Device Motion.
*/
@interface DeviceMotion : NSObject {
// manager
CMMotionManager *motionManager;
// filters
LowpassFilter *gravityLpf;
HighpassFilter *userAccelerationHpf;
LowpassFilter *userAccelerationHpfLpf;
// processed data
BOOL gravity;
CMAcceleration userAcceleration;
}
// Properties
@property BOOL gravity;
// Business Methods
- (DeviceAcceleration*)currentAccelerometerData;
@end
|
#ifndef TRANSFORM_H
#define TRANSFORM_H
#include <iostream>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/transform.hpp>
using namespace glm;
namespace ubi
{
class Transform
{
public:
Transform ();
Transform (const vec3& position, const quat& rotation, const vec3& scale);
virtual ~Transform ();
Transform (const Transform& other);
Transform operator= (const Transform& other);
mat4 GetModel () const;
void Set (const vec3& position, const quat& rotation, const vec3& scale);
vec3 position;
quat rotation;
vec3 scale;
};
}
#endif // TRANSFORM_H
|
/**
* This file is part of ORB-SLAM.
*
* Copyright (C) 2014 Raúl Mur-Artal <raulmur at unizar dot es> (University of Zaragoza)
* For more information see <http://webdiis.unizar.es/~raulmur/orbslam/>
*
* ORB-SLAM 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.
*
* ORB-SLAM 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 ORB-SLAM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOOPCLOSING_H
#define LOOPCLOSING_H
#include "KeyFrame.h"
#include "LocalMapping.h"
#include "Map.h"
#include "ORBVocabulary.h"
#include "Tracking.h"
#include <boost/thread.hpp>
#include "KeyFrameDatabase.h"
#include "g2o/types/types_seven_dof_expmap.h"
namespace ORB_SLAM
{
class Tracking;
class LocalMapping;
class KeyFrameDatabase;
class LoopClosing
{
public:
typedef pair<set<KeyFrame*>,int> ConsistentGroup;
typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;
public:
LoopClosing(Map* pMap, KeyFrameDatabase* pDB, ORBVocabulary* pVoc);
void SetTracker(Tracking* pTracker);
void SetLocalMapper(LocalMapping* pLocalMapper);
void Run();
void InsertKeyFrame(KeyFrame *pKF);
void RequestReset();
protected:
bool CheckNewKeyFrames();
bool DetectLoop();
bool ComputeSim3();
void SearchAndFuse(KeyFrameAndPose &CorrectedPosesMap);
void CorrectLoop();
void ResetIfRequested();
bool mbResetRequested;
boost::mutex mMutexReset;
Map* mpMap;
Tracking* mpTracker;
KeyFrameDatabase* mpKeyFrameDB;
ORBVocabulary* mpORBVocabulary;
LocalMapping *mpLocalMapper;
std::list<KeyFrame*> mlpLoopKeyFrameQueue;
boost::mutex mMutexLoopQueue;
std::vector<float> mvfLevelSigmaSquare;
// Loop detector parameters
float mnCovisibilityConsistencyTh;
// Loop detector variables
KeyFrame* mpCurrentKF;
KeyFrame* mpMatchedKF;
std::vector<ConsistentGroup> mvConsistentGroups;
std::vector<KeyFrame*> mvpEnoughConsistentCandidates;
std::vector<KeyFrame*> mvpCurrentConnectedKFs;
std::vector<MapPoint*> mvpCurrentMatchedPoints;
std::vector<MapPoint*> mvpLoopMapPoints;
cv::Mat mScw;
g2o::Sim3 mg2oScw;
double mScale_cw;
long unsigned int mLastLoopKFid;
};
} //namespace ORB_SLAM
#endif // LOOPCLOSING_H
|
#pragma once
#include <stdint.h>
/*! HC-SR04 Ultrasonic ranger device
*
* SonicRanger provides a simple wrapper around the calculation
* necessary to determine the range of an object using a HC-SR04
* ultrasonic range finder.
*
*/
#ifdef ARDUINO_AVR_DIGISPARK
uint32_t pulseInLong(uint8_t pin, uint8_t state, uint32_t timeout);
#endif // ARDUINO_AVR_DIGISPARK
class SonicRanger {
public:
static const uint16_t DefaultMaxRangeCm = 200;
static const uint8_t DefaultTimeoutMs = 15;
public:
/*! Constructor.
*
* \param trigPin the arduino pin conneced to the TRIG pin of the HC-SR04 device.
* \param echoPin the arduino pin conneced to the ECHO pin of the HC-SR04 device.
*/
SonicRanger(const uint8_t trigPin, const uint8_t echoPin);
/*! Initialization.
*
* Typically called from setup().
*/
void begin();
/*! Get range in cm.
*
* \return the range of the nearest object to the HC-SR04
* device in cm (approximate). If no object is in range,
* some the maximum range (200 cm) will be returned.
*
* NOTE: execution time depends on the range to an object.
* Of no object is in range, the ranging will time out after
* 15ms. The maximum range and timeout values can be set
* using setMaxRange() and setTimeoutMs().
*
* Range=10cm, execution time ~1 ms
* Range=50cm, execution time ~4 ms
* Range=100cm, execution time ~7 ms
* Range=150cm, execution time ~10 ms
* Range=>200cm, execution time ~15 ms
*/
uint16_t getRange();
/*! Set maximum range
*
* \param cm the new maximum range in cm.
*/
void setMaxRange(uint16_t cm) { _maxCm = cm; }
/*! Set timeout in ms.
*
* \param ms the new timeout in milliseconds.
*
* Note that you need to allow about 7 ms for every 100
* cm of range you wish to be able to measure. Typically
* HC-SR04 units can only reliably measure ranges of up
* a couple of meters.
*/
void setTimeoutMs(uint16_t ms) { _timeoutMs = ms; }
private:
const uint8_t _trigPin;
const uint8_t _echoPin;
uint16_t _maxCm;
uint16_t _timeoutMs;
};
|
#ifndef ICEMDIAREA_H
#define ICEMDIAREA_H
#include <QMdiArea>
#include <QPaintEvent>
#include "headers/backgrounddrawstyleflags.h"
class IceMdiArea : public QMdiArea
{
Q_OBJECT
Q_ENUM(BackgroundDrawStyleFlags)
public:
explicit IceMdiArea(QWidget *parent = 0);
void setBackgroundImage(QString path);
protected:
void paintEvent(QPaintEvent *event);
private:
void DrawWindowBackgroundStretched(bool withAspectRatio = false);
// Store the logo image.
QPixmap m_pixmapOriginal;
QPixmap m_pixmapCurrent;
BackgroundDrawStyleFlags::BackgroundDrawStyles m_backgroundDrawStyle;
};
#endif // ICEMDIAREA_H
|
/* Solucao para o problema "Caçadores de Mito" da OBI 2009
por: Igor Ribeiro de Assis */
#include <stdio.h>
#include <string.h> /* memset() */
#define MAXX 510
#define MAXY 510
/* para marcar onde cairam os raios */
int mapa[MAXX][MAXY];
int main() {
int N, x, y, i;
int caiu = 0;
scanf("%d", &N);
memset(mapa, 0, sizeof(mapa));
for (i = 0; i < N; i++) {
scanf("%d%d", &x, &y);
/* se mapa[x][y] >= 1, entao já caiu um raio nesse quadrante */
if (mapa[x][y]++)
caiu = 1;
}
printf("%d\n", caiu);
return 0;
}
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the class library */
/* SoPlex --- the Sequential object-oriented simPlex. */
/* */
/* Copyright (C) 1996-2018 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SoPlex is distributed under the terms of the ZIB Academic Licence. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file wallclocktimer.h
* @brief WallclockTimer class.
*/
#ifndef _WALLCLOCK_TIMER_H_
#define _WALLCLOCK_TIMER_H_
#include "spxdefines.h"
#include "timer.h"
namespace soplex
{
class WallclockTimer : public Timer
{
private:
//------------------------------------
/**@name Data */
//@{
mutable long sec; ///< seconds
mutable long usec; ///< microseconds
mutable Real lasttime;
//@}
//------------------------------------
/**@name Internal helpers */
//@{
/// convert wallclock time to secounds.
Real wall2sec(long s, long us) const
{
return (Real)s+ 0.000001 * (Real)us;
}
//@}
public:
//------------------------------------
/**@name Construction / destruction */
//@{
/// default constructor
WallclockTimer()
: Timer(), sec(0), usec(0), lasttime(0.0)
{}
/// copy constructor
WallclockTimer(const WallclockTimer& old)
: Timer(), sec(old.sec), usec(old.usec), lasttime(old.lasttime)
{}
/// assignment operator
WallclockTimer& operator=(const WallclockTimer& old)
{
sec = old.sec;
usec = old.usec;
lasttime = old.lasttime;
return *this;
}
virtual ~WallclockTimer()
{}
//@}
//------------------------------------
/**@name Control */
//@{
/// initialize timer, set timing accounts to zero.
virtual void reset()
{
status = RESET;
sec = usec = 0;
lasttime = 0.0;
}
/// start timer, resume accounting user, system and real time.
virtual void start();
/// stop timer, return accounted user time.
virtual Real stop();
/// return type of timer
virtual TYPE type()
{
return WALLCLOCK_TIME;
}
//@}
//------------------------------------
/**@name Access */
//@{
virtual Real time() const;
virtual Real lastTime() const;
//@}
};
} // namespace soplex
#endif // _WALLCLOCK_TIMER_H_
|
#ifndef XMLDBAWRITER_H
#define XMLDBAWRITER_H
#include "globalenum.h"
#include <QIODevice>
#include <QXmlStreamWriter>
#include <QMap>
class XmlDbaWriter
{
QXmlStreamWriter _streamWriter;
sections::section _currentSection;
static QString getSectionName(sections::section section);
public:
XmlDbaWriter(QIODevice* stream);
bool writeNext(QMap<QString, QString> data);
bool hasError()const;
sections::section getCurrentSection()const;
void setSection(sections::section section);
void startSection(sections::section section);
void startSection();
void endSection();
void startElement(QString name);
void endElement();
void startDocument();
void endDocument();
void writeAttribute(const QString & qualifiedName, const QString & value);
void writeDTD();
};
#endif // XMLDBAWRITER_H
|
/******************************************************************************
** Copyright (c) 2006-2018, Calaos. All Rights Reserved.
**
** This file is part of Calaos.
**
** Calaos 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.
**
** Calaos 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 Foobar; if not, write to the Free Software
** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
**
******************************************************************************/
#ifndef WEBINPUTSTRING_H
#define WEBINPUTSTRING_H
#include "Calaos.h"
#include "InputString.h"
#include "WebDocBase.h"
namespace Calaos
{
class WebInputString : public InputString
{
protected:
virtual void readValue();
WebDocBase docBase;
public:
WebInputString(Params &p);
~WebInputString();
};
}
#endif // WEBINPUTSTRING_H
|
/*-
* Copyright (C) 2008-2009 by Maxim Ignatenko
* gelraen.ua@gmail.com
*
* All rights reserved. *
* *
* 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. *
*
* $Id: ircconnection.h 27 2009-05-14 11:17:28Z imax $
*/
#ifndef IRCCONNECTION_H
#define IRCCONNECTION_H
#include "connection.h"
/**
@author gelraen <gelraen.ua@gmail.com>
*/
class IRCConnection : public Connection
{
public:
IRCConnection();
~IRCConnection();
virtual bool WriteCmdAsync(const string& str);
virtual bool ReadCmdAsync(string& str);
};
#endif
|
// This file is part of Fleeting Password Manager (Fleetingpm).
// Copyright (C) 2011 Jussi Lind <jussi.lind@iki.fi>
//
// Fleetingpm 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.
// Fleetingpm 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 Fleetingpm. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef LOGINDATA_H
#define LOGINDATA_H
#include <QString>
//! Login data that includes url, username, and password length.
//! Only this data can be saved.
class LoginData
{
public:
//! Default constructor.
LoginData();
//! Constructor.
LoginData(QString url, QString userName, int passwordLength);
//! Set URL/ID.
void setUrl(QString url);
//! Get URL/ID.
QString url() const;
//! Set user name.
void setUserName(QString userName);
//! Get user name.
QString userName() const;
//! Set password length.
void setPasswordLength(int passwordLength);
//! Get password length.
int passwordLength() const;
private:
//! URL/ID
QString m_url;
//! User name
QString m_userName;
//! Password length
int m_passwordLength;
};
#endif // LOGINDATA_H
|
#ifndef _SMETER_H_
#define _SMETER_H_
#include "types.h"
#include "ProcessBlock.h"
class SMeter: public ProcessBlock
{
public:
SMeter(std::string name);
~SMeter();
int receive(std::shared_ptr<ProcessBuffer> buf, uint32_t input, int recursion);
private:
int process(cfloat_t* in, int cnt, float* out);
float val;
};
#endif
|
#ifndef EVALUATION_H
#define EVALUATION_H
enum class EvaluationMode
{
Paused,
Automatic,
Steady,
};
enum class EvaluationType
{
Steady,
Automatic,
Manual,
Reset,
};
#endif // EVALUATION_H
|
#include "SDL.h"
#pragma once
class Game
{
public:
Game();
~Game();
bool init(const char* title, int xpos, int ypos, int width, int
height, bool fullscreen);
void render();
void update();
void handleEvents();
void clean();
bool running() { return m_bRunning; }
private:
SDL_Window* m_pWindow;
SDL_Renderer* m_pRenderer;
SDL_Texture* m_pTexture; // the new SDL_Texture variable
SDL_Rect m_sourceRectangle; // the first rectangle
SDL_Rect m_destinationRectangle; // another rectangle
int currentFrame;
bool m_bRunning;
};
|
/*
(c) 2016,2017 Grain
This file is part of ICSEdit.
ICSEdit 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.
ICSEdit 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 ICSEdit. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/**
* @brief VOgz_[
*/
namespace ICSE {
template <class _Ty, class... _Args>
class Singleton
{
public:
typedef _Ty InstanceType;
public:
/// ¶¬
static void create(_Args... args)
{
if (_instance == NULL) {
_instance = new InstanceType(args...);
}
}
/// jü
static void destroy()
{
if (_instance != NULL) {
delete _instance;
_instance = NULL;
}
}
#if 1
/// CX^XQbg
static InstanceType& getInstance()
{
return *_instance;
}
#else
/// CX^XQbg
static InstanceType* getInstance()
{
return _instance;
}
#endif
/// CX^XQÆQbg
static InstanceType& getInstanceRef()
{
return *_instance;
}
/// CX^X|C^Qbg
static InstanceType* getInstancePtr()
{
return _instance;
}
/// ¶¬ÏÝ??
static bool isCreate() { return _instance != NULL; };
/// jüÏÝ??
static bool isDestroy() { return _instance == NULL; };
private:
static InstanceType* _instance; //!< CX^X
private:
// Ö~
Singleton() = delete;
virtual ~Singleton() = delete;
Singleton(const Singleton&) = delete;
Singleton& operator=(const Singleton&) = delete;
Singleton(const Singleton&&) = delete;
Singleton& operator=(const Singleton&&) = delete;
};
template <class _Ty, class... _Args>
typename Singleton<_Ty, _Args...>::InstanceType* Singleton<_Ty, _Args...>::_instance = NULL;
} |
/*
* Copyright (C) 2020 Marco Bortolin
*
* This file is part of IBMulator.
*
* IBMulator 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.
*
* IBMulator 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 IBMulator. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IBMULATOR_RIFF_H
#define IBMULATOR_RIFF_H
#include <vector>
#include <stack>
#include <cstdio>
typedef const char fourcc_str_t[5];
constexpr uint32_t FOURCC(fourcc_str_t _code)
{
return
(uint32_t(_code[3]) << 24) |
(uint32_t(_code[2]) << 16) |
(uint32_t(_code[1]) << 8) |
uint32_t(_code[0]);
}
#define FOURCC_RIFF FOURCC("RIFF")
#define FOURCC_LIST FOURCC("LIST")
struct RIFFHeader {
uint32_t RIFF; // 0/4 FOURCC code "RIFF"
uint32_t fileSize; // 4/4 This is the size of the entire file in bytes
// minus 8 bytes for the two fields not included in
// this count: RIFF and fileSize.
uint32_t fileType; // 8/4 FOURCC code
} GCC_ATTRIBUTE(packed);
#define RIFF_HEADER_FILESIZE_POS 4
#define RIFF_MAX_FILESIZE UINT32_MAX
struct RIFFChunkHeader {
uint32_t chunkID; // FOURCC that identifies the data contained in the chunk
uint32_t chunkSize; // the size of the data in chunkData
// chunkData follows, always padded to nearest WORD boundary.
// chunkSize gives the size of the valid data in the chunk; it does not
// include the padding, the size of chunkID, or the size of chunkSize.
} GCC_ATTRIBUTE(packed);
struct RIFFListHeader {
uint32_t LIST; // FOURCC code "LIST"
uint32_t listSize; // the size of the list
uint32_t listType; // FOURCC code
// data follows, consisting of chunks or lists, in any order.
// The value of listSize includes the size of listType plus the size of data;
// it does not include the 'LIST' FOURCC or the size of listSize.
} GCC_ATTRIBUTE(packed);
class RIFFFile
{
protected:
RIFFHeader m_header;
FILE *m_file;
bool m_write_mode;
uint64_t m_write_size;
long int m_chunk_rpos;
RIFFChunkHeader m_chunk_rhead;
std::stack<long int> m_lists_w; // starting offsets of list headers
bool m_chunk_wstart;
long int m_chunk_wpos;
RIFFChunkHeader m_chunk_whead;
public:
RIFFFile();
virtual ~RIFFFile();
virtual RIFFHeader open_read(const char *_filepath);
virtual void open_write(const char *_filepath, uint32_t _file_type);
inline bool is_open() const { return m_file != nullptr; }
inline bool is_open_read() const { return is_open() && !m_write_mode; }
inline bool is_open_write() const { return is_open() && m_write_mode; }
uint32_t file_size() const ;
void close();
void close_file() noexcept;
protected:
enum class ChunkPosition {
HEADER,
DATA
};
void reset();
void read(void *_buffer, uint32_t _size);
void write(const void *_data, uint32_t _len);
RIFFChunkHeader read_chunk_header();
std::vector<uint8_t> read_chunk_data() const;
void read_rewind_chunk(ChunkPosition) const;
void read_skip_chunk() const;
RIFFChunkHeader read_find_chunk(uint32_t _code);
long int write_list_start(uint32_t _code);
void write_list_end();
long int write_chunk(uint32_t _code, const void *_data, uint32_t _len);
long int write_chunk_start(uint32_t _code);
void write_chunk_data(const void *_data, uint32_t _len);
uint32_t write_chunk_end();
void write_update(long int _pos, const void *_data, uint32_t _len);
virtual void write_end();
long int get_cur_pos() const;
long int get_cur_size() const;
void set_cur_pos(long int _pos);
private:
long int get_ckdata_size(const RIFFChunkHeader&, long int _pos = -1) const;
bool is_offset_overflow(long int _pos, uint64_t _size) const;
};
#endif |
/*
Copyright (C) 2010,2012 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
This file is part of ESPResSo.
ESPResSo 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.
ESPResSo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NSQUARE_H
#define NSQUARE_H
/** \file nsquare.h
This file contains the code for a simple n^2 particle loop.
The nsquare cell system performs a full n^2 particle interaction
calculation over the simulation box. Therefore every node just
has a single cell containing all local particles plus one ghost
cell per other node. The communication is done via broadcasts
(exchange_ghosts and update_ghosts) and reduce operations
(collect_ghost_force).
The algorithm used for interaction calculation is parallelized,
but a full communication is needed every time step. Let us assume
that the number of nodes P is odd. Then a node p will do the
interaction calculation with another node q iff \f$(q-p)\,mod\,P\f$ is even.
Of course then every node has to do the same amount of work
(provided the particles are distributed equally), and each
interaction pair is done exactly once, since for odd P \f$r\,mod\,P\f$
odd iff \f$-r\,mod\,P\f$ is even. For an even number of nodes,
a virtual additional processor is assumed, with which no interactions occur.
This means, that each communication cycle, 1 processor is idle, which is
pretty ineffective.
The second main part of this cell system is a load balancer which
at the beginning of the integration is called and balances the
numbers of particles between the nodes. This means that the number
of particles per node should be around \f$N/P\f$, so the goal is to
let every processor have a number of particles which is one of the
two integers closest to \f$N/P\f$. The algorithm is greedy, i. e. it
searches for the node with most and least particles and transfers
as much as possible particles between them so that at least one of
them satisfies the constraints. Of course the algorithm terminates
if both satisfy the condition without transfer.
The calculations themselves are just simple loops over all
appropriate particle pairs.
*/
#include "cells.h"
/** always returns the one local cell */
Cell *nsq_position_to_cell(double pos[3]);
/** always returns the one local cell */
void nsq_topology_release();
/** setup the nsquare topology */
void nsq_topology_init(CellPList *local);
/** implements the load balancing as described above. */
void nsq_balance_particles(int global_flag);
/** n^2 force calculation */
void nsq_calculate_ia();
/** n^2 energy calculation */
void nsq_calculate_energies();
/** n^2 pressure calculation */
void nsq_calculate_virials(int v_comp);
#endif
|
#ifndef SPAUDIOENGINE_H
#define SPAUDIOENGINE_H
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
#include <string>
#include <vector>
#include "SPEngine/SPException.h"
class SPAudioEngine
{
public:
SPAudioEngine();
virtual ~SPAudioEngine();
// Création et destruction de la sortie sonore
void CreateAudioOutput(int p_SampleFreq, int p_SampleSize);
bool isAudioOutputOpen();
void DestroyAudioOutput();
// Lecture de sons
void PlaySample(Mix_Chunk* p_Sample, int p_iChannelNum = -1);
void StopAllSamples(); // Arrêter la lecture des samples pour pouvoir les décharger !
void SetMusic(Mix_Music* p_Music, bool p_bAlwaysLoop = true); // pour enlever le pointeur, passer NULL
void PlayCurrentMusic(); // Ne démarre la musique que si le pointeur n'est pas NULL
void PauseCurrentMusic(); // Idem
void ResumeCurrentMusic(); // Après un appel de PauseCurrentMusic
void StopCurrentMusic();
bool IsMusicPlaying();
protected:
private:
bool m_OutputIsOpened;
// Il faut retenir la musique qui est en train d'être jouée, pour pouvoir l'arrêter si on en joue une autre
Mix_Music* m_CurrentMusic;
bool m_bLoopSong;
};
#endif // SPAUDIOENGINE_H
|
/*
* network.h: Virtual Machine Placement Problem - Common Functions Header
* Date: 17-11-2014
* Author: Fabio Lopez Pires (flopezpires@gmail.com)
* Corresponding Conference Paper: A Many-Objective Optimization Framework for Virtualized Datacenters
*/
/* include libraries */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
/* definitions */
#define T_HEADER "NETWORK TRAFFIC"
#define L_HEADER "NETWORK TOPOLOGY"
#define C_HEADER "NETWORK LINK CAPACITY"
#define TAM_BUFFER BUFSIZ
/* get the number of network links */
int get_l_size(char path_to_file[]);
/* load datacenter network topology */
int** load_T(int v_size, char path_to_file[]);
int** load_G(int h_size, int l_size, char path_to_file[]);
int* load_K(int l_size, char path_to_file[]);
/* load utilization of network resources */
int** load_network_utilization(int **population, int **G, int **T, int number_of_individuals, int l_size, int v_size);
|
/*
* TCImage.h
*
* Copyright 2018 Avérous Julien-Pierre
*
* This file is part of TorChat.
*
* TorChat 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.
*
* TorChat 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 TorChat. If not, see <http://www.gnu.org/licenses/>.
*
*/
#import <Foundation/Foundation.h>
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
# import <UIKit/UIKit.h>
#else
# import <AppKit/AppKit.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/*
** TCImage
*/
#pragma mark - TCImage
@interface TCImage : NSObject <NSCopying>
// -- Instance --
- (instancetype)initWithWidth:(NSUInteger)width height:(NSUInteger)height NS_DESIGNATED_INITIALIZER;
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
- (nullable instancetype)initWithImage:(UIImage *)image NS_DESIGNATED_INITIALIZER;
#else
- (nullable instancetype)initWithImage:(NSImage *)image NS_DESIGNATED_INITIALIZER;
#endif
- (instancetype)init NS_UNAVAILABLE;
// -- Content --
- (BOOL)setBitmap:(NSData *)bitmap;
- (BOOL)setBitmapAlpha:(NSData *)bitmap;
- (NSData *)bitmap;
- (NSData *)bitmapAlpha;
@property (nullable, nonatomic, readonly, copy) NSData *bitmapMixed;
// -- Properties --
@property (nonatomic, readonly) NSUInteger width;
@property (nonatomic, readonly) NSUInteger height;
// -- Representation --
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
@property (nullable, nonatomic, readonly, copy) UIImage *imageRepresentation;
#else
@property (nullable, nonatomic, readonly, copy) NSImage *imageRepresentation;
#endif
@end
NS_ASSUME_NONNULL_END
|
int y;
int f(int b)
{
int y;
{ int x[10];
x[2+3-5]=b + f(5+x[2]*b);}
{ int x[10];
x[2+3-5]=b + f(5+x[2]*b);}
}
int z;
int main(int arg1, int arg2[])
{
write f(arg1 + arg2[3+5] -z + y);
write f(arg1 + arg2[3+5] -z + y);
}
|
/********************************************************************************
* *
* I F F I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2004,2020 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* 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 program. If not, see <http://www.gnu.org/licenses/> *
********************************************************************************/
#ifndef FXIFFICON_H
#define FXIFFICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/**
* The IFF Icon provides support for the EA/Amiga Image File Format.
*/
class FXAPI FXIFFIcon : public FXIcon {
FXDECLARE(FXIFFIcon)
protected:
FXIFFIcon(){}
private:
FXIFFIcon(const FXIFFIcon&);
FXIFFIcon &operator=(const FXIFFIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an icon from memory stream formatted as IFF format
FXIFFIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in IFF format
virtual FXbool savePixels(FXStream& store) const;
/// Load pixels from stream in IFF format
virtual FXbool loadPixels(FXStream& store);
/// Destroy
virtual ~FXIFFIcon();
};
#ifndef FXLOADIFF
#define FXLOADIFF
/**
* Check if stream contains a IFF, return true if so.
*/
extern FXAPI FXbool fxcheckIFF(FXStream& store);
/**
* Load an IFF (EA Image File Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI FXbool fxloadIFF(FXStream& store,FXColor*& data,FXint& width,FXint& height);
#endif
}
#endif
|
#include <stdio.h>
int main(int argc, char * argv)
{
return 0;
} |
/*
* Cantata
*
* Copyright (c) 2015 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* 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; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef MPD_LIBRARY_MODEL_H
#define MPD_LIBRARY_MODEL_H
#include "sqllibrarymodel.h"
class MpdLibraryModel : public SqlLibraryModel
{
Q_OBJECT
public:
static MpdLibraryModel * self();
MpdLibraryModel();
QVariant data(const QModelIndex &index, int role) const;
void readSettings();
private Q_SLOTS:
void cover(const Song &song, const QImage &img, const QString &file);
void coverUpdated(const Song &song, const QImage &img, const QString &file);
void artistImage(const Song &song, const QImage &img, const QString &file);
};
#endif
|
/*
* Copyright 2016 by SEAL-ORAM Project
*
* 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.
*/
//
// Created by Dong Xie on 7/6/2016.
// Mongo Server Connector
//
#ifndef SEAL_ORAM_MONGOCONNECTOR_H
#define SEAL_ORAM_MONGOCONNECTOR_H
#include <mongo/client/dbclient.h>
#include "ServerConnector.h"
#include <string>
using namespace mongo;
class MongoConnector: public ServerConnector {
public:
MongoConnector(const std::string& url, const std::string& collection_name, const bool flag = false);
MongoConnector(const std::string& url);
virtual ~MongoConnector();
struct iterator: public ServerConnector::iterator {
iterator(std::unique_ptr<DBClientCursor> c): cursor(std::move(c)) {}
virtual ~iterator() {}
virtual bool hasNext() {
return cursor->more();
}
virtual std::string next() {
BSONObj p = cursor->next();
int len;
const char* raw_data = p.getField("data").binData(len);
return std::string(raw_data, (size_t)len);
}
std::unique_ptr<DBClientCursor> cursor;
};
virtual void clear(const std::string& ns = "");
virtual void insert(const uint32_t& id, const std::string& encrypted_block, const std::string& ns = "");
virtual void insert(const uint32_t& id, std::string* encrypted_block,size_t block_len, const std::string& ns = "");
virtual void insert(const std::vector< std::pair<uint32_t, std::string> >& blocks, const std::string& ns = "");
virtual void insert(const std::string* sbuffer, const uint32_t& low, const size_t& len, const std::string& ns = "");
virtual void insert(const std::vector< std::pair<std::string, std::string> >& blocks, const std::string& ns = "");
virtual void insertWithTag(const std::vector< std::pair<std::string, std::string> >& blocks, const std::string& ns = "");
virtual iterator* scan();
virtual std::string find(const uint32_t& id, const std::string& ns = "");
virtual std::string* find(const uint32_t& id,size_t& len,const std::string& ns = "");
virtual void find(const std::vector<uint32_t>& ids, std::string* sbuffer, size_t& length, const std::string& ns = "");
virtual std::string fetch(const std::string& id, const std::string& ns = "");
virtual void find(const uint32_t& low, const uint32_t& high, std::vector<std::string>& blocks, const std::string& ns = "");
virtual void findByTag(const uint32_t& tag, std::string* sbuffer, size_t& length, const std::string& ns = "");
virtual void update(const uint32_t& id, const std::string& data, const std::string& ns = "");
virtual void update(const uint32_t& id, std::string* encrypted_block,size_t block_len, const std::string& ns = "");
virtual void update(const std::string* sbuffer, const uint32_t& low, const size_t& len, const std::string& ns = "");
virtual void update(const std::vector< std::pair<uint32_t, std::string> > blocks, const std::string& ns = "");
void initialize(const std::string& ns);
void finalize(const std::string& ns);
private:
DBClientConnection mongo;
std::string collection_name;
bool by_tag;
};
#endif //SEAL_ORAM_MONGOCONNECTOR_H
|
#include<stdio.h>
int main()
{
char * p;
int i = 0;
for(;i < 1024*1024; i++)
{
p = malloc( sizeof(char));
//free(p);
}
return 0;
}
|
/**
* Copyright (C) 2017 kkkeQAQ <kkke@nwsuaf.edu.cn>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef KAPPLICATION_H
#define KAPPLICATION_H
#include "KObject.h"
#include <vector>
#include "KEvent.h"
#include "KEventLoop.h"
class KApplication:public KObject{
private:
std::vector<char*>args;
static KApplication *self;
KEventLoop *eventLoop;
public:
static KApplication* instance();
static void postEvent(KObject *object,KEvent *event);
KApplication(int argc,char **argv);
~KApplication()override;
std::vector<char*>& arguments();
void quit();
void exit(int exitCode);
int exec();
};
#define kApp KApplication::instance()
#endif //KAPPLICATION_H
|
/*****************************************************************************
* Copyright (c) 2014-2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "../../../sprites.h"
#include "../../RideData.h"
#include "../../ShopItem.h"
#include "../../Track.h"
// clang-format off
constexpr const RideTypeDescriptor TwisterRollerCoasterRTD =
{
SET_FIELD(AlternateType, RIDE_TYPE_NULL),
SET_FIELD(Category, RIDE_CATEGORY_ROLLERCOASTER),
SET_FIELD(EnabledTrackPieces, (1ULL << TRACK_FLAT) | (1ULL << TRACK_STRAIGHT) | (1ULL << TRACK_STATION_END)
| (1ULL << TRACK_LIFT_HILL) | (1ULL << TRACK_FLAT_ROLL_BANKING) | (1ULL << TRACK_VERTICAL_LOOP) | (1ULL << TRACK_SLOPE)
| (1ULL << TRACK_SLOPE_STEEP) | (1ULL << TRACK_SLOPE_CURVE) | (1ULL << TRACK_SLOPE_CURVE_STEEP) | (1ULL << TRACK_S_BEND)
| (1ULL << TRACK_CURVE_SMALL) | (1ULL << TRACK_CURVE) | (1ULL << TRACK_HALF_LOOP) | (1ULL << TRACK_CORKSCREW)
| (1ULL << TRACK_HELIX_SMALL) | (1ULL << TRACK_BRAKES) | (1ULL << TRACK_ON_RIDE_PHOTO) | (1ULL << TRACK_SLOPE_VERTICAL)
| (1ULL << TRACK_BARREL_ROLL) | (1ULL << TRACK_POWERED_LIFT) | (1ULL << TRACK_HALF_LOOP_LARGE)
| (1ULL << TRACK_SLOPE_CURVE_BANKED) | (1ULL << TRACK_BLOCK_BRAKES) | (1ULL << TRACK_SLOPE_ROLL_BANKING)
| (1ULL << TRACK_SLOPE_STEEP_LONG) | (1ULL << TRACK_CURVE_VERTICAL) | (1ULL << TRACK_QUARTER_LOOP)
| (1ULL << TRACK_BOOSTER)),
SET_FIELD(ExtraTrackPieces, (1ULL << TRACK_LIFT_HILL_STEEP) | (1ULL << TRACK_BRAKE_FOR_DROP)),
SET_FIELD(CoveredTrackPieces, 0),
SET_FIELD(StartTrackPiece, TRACK_ELEM_END_STATION),
SET_FIELD(TrackPaintFunction, get_track_paint_function_twister_rc),
SET_FIELD(Flags, RIDE_TYPE_FLAGS_TRACK_HAS_3_COLOURS | RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION |
RIDE_TYPE_FLAGS_COMMON_COASTER | RIDE_TYPE_FLAGS_COMMON_COASTER_NON_ALT | RIDE_TYPE_FLAG_HAS_LARGE_CURVES |
RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES | RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS),
SET_FIELD(RideModes, (1ULL << RIDE_MODE_CONTINUOUS_CIRCUIT) | (1ULL << RIDE_MODE_CONTINUOUS_CIRCUIT_BLOCK_SECTIONED)),
SET_FIELD(DefaultMode, RIDE_MODE_CONTINUOUS_CIRCUIT),
SET_FIELD(OperatingSettings, { 10, 27, 30, 17, 68, 0 }),
SET_FIELD(Naming, { STR_RIDE_NAME_TWISTER_ROLLER_COASTER, STR_RIDE_DESCRIPTION_TWISTER_ROLLER_COASTER }),
SET_FIELD(NameConvention, { RIDE_COMPONENT_TYPE_TRAIN, RIDE_COMPONENT_TYPE_TRACK, RIDE_COMPONENT_TYPE_STATION }),
SET_FIELD(EnumName, nameof(RIDE_TYPE_TWISTER_ROLLER_COASTER)),
SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)),
SET_FIELD(Heights, { 40, 24, 8, 9, }),
SET_FIELD(MaxMass, 31),
SET_FIELD(LiftData, { SoundId::LiftBM, 5, 8 }),
SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_twister_roller_coaster),
SET_FIELD(RatingsMultipliers, { 52, 36, 10 }),
SET_FIELD(UpkeepCosts, { 43, 20, 80, 11, 3, 10 }),
SET_FIELD(BuildCosts, { 120, 5, 55, }),
SET_FIELD(DefaultPrices, { 20, 20 }),
SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK),
SET_FIELD(PhotoItem, SHOP_ITEM_PHOTO),
SET_FIELD(BonusValue, 120),
SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS(
{ COLOUR_YELLOW, COLOUR_YELLOW, COLOUR_BORDEAUX_RED },
{ COLOUR_AQUAMARINE, COLOUR_AQUAMARINE, COLOUR_DARK_PURPLE },
{ COLOUR_WHITE, COLOUR_WHITE, COLOUR_LIGHT_BLUE },
{ COLOUR_DARK_GREEN, COLOUR_MOSS_GREEN, COLOUR_DARK_BROWN },
{ COLOUR_BORDEAUX_RED, COLOUR_LIGHT_ORANGE, COLOUR_WHITE },
)),
SET_FIELD(ColourPreview, { SPR_RIDE_DESIGN_PREVIEW_TWISTER_ROLLER_COASTER_TRACK, SPR_RIDE_DESIGN_PREVIEW_TWISTER_ROLLER_COASTER_SUPPORTS }),
SET_FIELD(ColourKey, RideColourKey::Ride),
};
// clang-format on
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtEnginio module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QCLOUDSERVICES_QRESTCONNECTION_H
#define QCLOUDSERVICES_QRESTCONNECTION_H
#include <QObject>
#include <QtCloudServices/qrestoperation.h>
QT_BEGIN_NAMESPACE
class QRestRequest;
class QRestConnectionObject;
class QTCLOUDSERVICES_EXPORT QRestConnection {
friend class QRestEndpoint;
friend class QRestOperation;
protected:
QRestConnection(QRestConnectionObject *aObject);
public:
// Constructors
QRestConnection();
QRestConnection(const QRestConnection &aOther);
virtual ~QRestConnection();
// Assignment
QRestConnection& operator=(const QRestConnection &aOther);
// IsValid
bool operator!() const Q_REQUIRED_RESULT;
bool isValid() const Q_REQUIRED_RESULT;
QRestOperation restRequest(const QRestRequest &aRequest);
public:
// Get implementation object
const QRestConnectionObject* object() const;
QRestConnectionObject* object();
private:
QRestConnectionObject *iObject;
};
QT_END_NAMESPACE
#endif /* QCLOUDSERVICES_QRESTCONNECTION_H */
|
/*copyright 2010 Simon Graeser*/
/*
This file is part of Pina.
Pina 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.
Pina 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 Pina. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COLLADA_NEWPARAM_H
#define COLLADA_NEWPARAM_H
#include "../Element.h"
#include "../Templates/TypelistConstructor64to128.h"
#include "../Types/SimpleTypes.h"
#define THIS Newparam
namespace PINA_NAMESPACE{
class Annotate;
class Semantic;
class Modifier;
class SIDREF;
/**
@brief A new parameter object
*/
class THIS: public Element{
public:
THIS(XmlElement* h = 0);
std::string getName() const;
~THIS();
static const std::string Name;
void order();
STATIC_CHECKED_FUNCTIONS;
typedef TL::Append<
TL::Cons64to128<
Annotate, //FX
Semantic, //FX
Modifier, //FX
PINA_CG_PARAMETER_ELEMENTS, //FX
PINA_GLSL_PARAMETER_ELEMENTS //FX
>::List
,
TL::Cons64to128<
PINA_EFFECT_PARAMETER_ELEMENTS, //FX
PINA_GLES_PARAMETER_ELEMENTS, //FX
PINA_GLES2_PARAMETER_ELEMENTS, //FX
Float, //FX
Float2, //FX
Float3, //FX
Float4, //FX
Sampler2D, //FX
Float, //Kinematics
Int, //Kinematics
Bool, //Kinematics
SIDREF //Kinematics
>::List
>::Result Types;
/* attributes */
Attribute<std::string> attrib_sid;
private:
};
}/*PINA_NAMESPACE*/
#undef THIS
#endif
|
/**
exponential Model f = ( A * exp(-lambda * i) - y_i )
*/
#include "gens.h"
#include "fit_chooser.h"
#include "GLS.h"
#include "pade_laplace.h"
double
fexp( const struct x_desc X , const double *fparams , const size_t Npars )
{
size_t i ;
register double sum = 0.0 ;
for( i = 0 ; i < 2 * X.N ; i+=2 ) {
sum += fparams[i] * exp( -fparams[i+1] * X.X ) ;
}
return sum ;
}
void
exp_f( double *f , const void *data , const double *fparams )
{
const struct data *DATA = (const struct data*)data ;
size_t i , j ;
for( i = 0 ; i < DATA -> n ; i++ ) {
double p[ DATA -> N * 2 ] ;
for( j = 0 ; j < DATA -> N * 2 ; j++ ) {
p[ j ] = fparams[ DATA -> map[ i ].p[ j ] ] ;
}
struct x_desc X = { DATA -> x[i] , DATA -> LT[i] ,
DATA -> N , DATA -> M } ;
f[i] = fexp( X , p , DATA -> N * 2 ) - DATA -> y[i] ;
}
return ;
}
// derivatives
void
exp_df( double **df , const void *data , const double *fparams )
{
const struct data *DATA = (const struct data*)data ;
size_t i , j ;
for( i = 0 ; i < DATA -> n ; i++ ) {
for( j = 0 ; j < 2*DATA -> N ; j+=2 ) {
const double t = DATA -> x[i] ;
const double e = exp( -fparams[ DATA-> map[i].p[j+1] ] * t ) ;
df[ DATA-> map[i].p[j+0] ][i] = e ;
df[ DATA-> map[i].p[j+1] ][i] = -t * fparams[ DATA-> map[i].p[j] ] * e ;
}
}
return ;
}
// second derivatives? Will we ever use them - J?
void
exp_d2f( double **d2f , const void *data , const double *fparams )
{
return ;
}
// guesses using the data, we don't need to be too accurate
void
exp_guesses( double *fparams ,
const struct data_info Data ,
const struct fit_info Fit )
{
// usual counters, p0 and p1 count how many times the fit parameter
// is used which we average over
double f[ 2 * Fit.N ] ;
size_t i , j , shift = 0 , p[ 2*Fit.N ] ;
for( i = 0 ; i < Fit.Nlogic ; i++ ) {
fparams[i] = 0.0 ;
}
for( i = 0 ; i < 2*Fit.N ; i++ ) {
p[i] = 0 ; f[i] = 0.0 ;
}
// loop each individual data set and fit using least squares to
// log(y),x
for( i = 0 ; i < Data.Nsim ; i++ ) {
size_t N = 0 ;
for( j = shift ; j < shift + Data.Ndata[i] ; j++ ) {
if( Data.x[j].avg > Data.LT[j]/2 ) continue ;
N++ ;
}
// set the data
double x[ N ] , y[ N ] ;
N = 0 ;
for( j = shift ; j < shift + Data.Ndata[i] ; j++ ) {
//if( Data.x[j].avg > Data.LT[j]/2 ) continue ;
x[ N ] = Data.x[j].avg ;
y[ N ] = Data.y[j].avg ;
N++ ;
}
#ifdef VERBOSE
for( j = 0 ; j < N ; j++ ) {
printf( "%f %f \n" , x[j] , y[j] ) ;
}
#endif
// pade laplace is bad here because we are already in the plateau region!!!!
if( pade_laplace( f , x , y , N , Fit.N , 3 ) == FAILURE ) {
fprintf( stderr , "Jamie : do something about this!\n" ) ;
break ;
} else {
for( j = 0 ; j < 2*Fit.N ; j+=2 ) {
fparams[ Fit.map[shift].p[ j + 0 ] ] += f[ j + 0 ] ;
fparams[ Fit.map[shift].p[ j + 1 ] ] += -f[ j + 1 ] ;
if( Fit.map[shift].p[ j + 0 ] == j + 0 ) p[j + 0]++ ;
if( Fit.map[shift].p[ j + 1 ] == j + 1 ) p[j + 1]++ ;
}
}
shift += Data.Ndata[i] ;
}
// normalise the guesses if we have summed multiple ones
for( j = 0 ; j < 2*Fit.N ; j++ ) {
if( p[j] > 1 ) {
fparams[ j ] /= p[j] ;
}
}
// tell us about the guesses always use the prior as a guess
printf( "\n" ) ;
for( i = 0 ; i < Fit.Nlogic ; i++ ) {
if( Fit.Prior[i].Initialised == true ) {
fparams[i] = Fit.Prior[i].Val ;
}
printf( "[GUESS] Fit param guess %zu -> %f \n" , i , fparams[i] ) ;
}
printf( "\n" ) ;
return ;
}
|
#ifndef MULTIPLE_ELSE_IF_SAME_MEMORY_H
#define MULTIPLE_ELSE_IF_SAME_MEMORY_H
#include "ibp/foundation/boolean.h"
#include "ibp/foundation/integer.h"
ibp::Integer foo( ibp::Integer x,
ibp::Boolean* y,
ibp::Boolean* z );
#endif
|
/*
-----------------------------------------------------------------------------------------------
This source file is part of the Particle Universe product.
Copyright (c) 2010 Henry van Merode
Usage of this program is licensed under the terms of the Particle Universe Commercial License.
You can find a copy of the Commercial License in the Particle Universe package.
-----------------------------------------------------------------------------------------------
*/
#ifndef __PU_LINE_EMITTER_FACTORY_H__
#define __PU_LINE_EMITTER_FACTORY_H__
#include "ParticleUniversePrerequisites.h"
#include "ParticleUniverseEmitterFactory.h"
#include "ParticleUniverseLineEmitter.h"
#include "ParticleUniverseLineEmitterTokens.h"
namespace ParticleUniverse
{
/** This is the factory class that is responsible for creating a LineEmitter.
*/
class _ParticleUniverseExport LineEmitterFactory : public ParticleEmitterFactory
{
protected:
LineEmitterWriter mLineEmitterWriter;
LineEmitterTranslator mLineEmitterTranslator;
public:
LineEmitterFactory(void) {};
virtual ~LineEmitterFactory(void) {};
/** See ParticleEmitterFactory */
String getEmitterType(void) const
{
return "Line";
}
/** See ParticleEmitterFactory */
ParticleEmitter* createEmitter(void)
{
return _createEmitter<LineEmitter>();
}
/** See ScriptReader */
virtual bool translateChildProperty(ScriptCompiler* compiler, const AbstractNodePtr &node)
{
return mLineEmitterTranslator.translateChildProperty(compiler, node);
};
/** See ScriptReader */
virtual bool translateChildObject(ScriptCompiler* compiler, const AbstractNodePtr &node)
{
return mLineEmitterTranslator.translateChildObject(compiler, node);
};
/* */
virtual void write(ParticleScriptSerializer* serializer, const IElement* element)
{
// Delegate to mLineEmitterWriter
mLineEmitterWriter.write(serializer, element);
}
};
}
#endif
|
/* Copyright (C) 2018 Magnus Lång and Tuan Phong Ngo
* This benchmark is part of SWSC */
#include <assert.h>
#include <stdint.h>
#include <stdatomic.h>
#include <pthread.h>
atomic_int vars[2];
atomic_int atom_1_r1_1;
atomic_int atom_2_r3_2;
atomic_int atom_2_r5_0;
void *t0(void *arg){
label_1:;
atomic_store_explicit(&vars[0], 1, memory_order_seq_cst);
return NULL;
}
void *t1(void *arg){
label_2:;
int v2_r1 = atomic_load_explicit(&vars[0], memory_order_seq_cst);
int v3_r3 = v2_r1 ^ v2_r1;
atomic_store_explicit(&vars[1+v3_r3], 1, memory_order_seq_cst);
int v18 = (v2_r1 == 1);
atomic_store_explicit(&atom_1_r1_1, v18, memory_order_seq_cst);
return NULL;
}
void *t2(void *arg){
label_3:;
atomic_store_explicit(&vars[1], 2, memory_order_seq_cst);
int v5_r3 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v6_r4 = v5_r3 ^ v5_r3;
int v9_r5 = atomic_load_explicit(&vars[0+v6_r4], memory_order_seq_cst);
int v19 = (v5_r3 == 2);
atomic_store_explicit(&atom_2_r3_2, v19, memory_order_seq_cst);
int v20 = (v9_r5 == 0);
atomic_store_explicit(&atom_2_r5_0, v20, memory_order_seq_cst);
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
pthread_t thr2;
atomic_init(&vars[1], 0);
atomic_init(&vars[0], 0);
atomic_init(&atom_1_r1_1, 0);
atomic_init(&atom_2_r3_2, 0);
atomic_init(&atom_2_r5_0, 0);
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_create(&thr2, NULL, t2, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
pthread_join(thr2, NULL);
int v10 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v11 = (v10 == 2);
int v12 = atomic_load_explicit(&atom_1_r1_1, memory_order_seq_cst);
int v13 = atomic_load_explicit(&atom_2_r3_2, memory_order_seq_cst);
int v14 = atomic_load_explicit(&atom_2_r5_0, memory_order_seq_cst);
int v15_conj = v13 & v14;
int v16_conj = v12 & v15_conj;
int v17_conj = v11 & v16_conj;
if (v17_conj == 1) assert(0);
return 0;
}
|
//
// MDLibrary.h
// MDUtils
//
// Created by 没懂 on 17/3/20.
// Copyright © 2017年 com.infomacro. All rights reserved.
//
#ifndef MDLibrary_h
#define MDLibrary_h
#import "MDDefines.h"
#import "MDObject.h"
#import "NSObject+Property.h"
#import "MDConfig.h"
#import "UIView+Addition.h"
#endif /* MDLibrary_h */
|
/*
* A Command & Conquer: Renegade SSGM Plugin, containing all the single player mission scripts
* Copyright(C) 2017 Neijwiert
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <scripts.h>
/*
M03 -> 1147534 1147533 1147532 1147531 1147530 1147529 1147527 1146701 1146700 300009 300028 300032 1141162 1144451 1144448 1144731 1144732 300010
*/
class M03_Killed_Sound : public ScriptImpClass
{
private:
virtual void Killed(GameObject *obj, GameObject *killer);
}; |
#ifndef _RPCVIEW_QT_H_
#define _RPCVIEW_QT_H_
#define QT_BUILD_CONFIGURE
#define NOMINMAX
#include <QtCore/QSortFilterProxyModel>
#include <QtGui/QStandardItemModel>
#include <QtWidgets/QDockWidget>
#include <QtWidgets/QLabel>
#include <QtWidgets/QTreeView>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QDockWidget>
#include <QtWidgets/QTextEdit>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QApplication>
#include <QtWidgets/QFormLayout>
#include <QtWidgets/QAbstractItemView>
#include <QtCore/QTimer>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QAction>
#include <QtWidgets/QActionGroup>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtGui/QPixmap>
#include <QtWidgets/QTreeWidgetItem>
#include <QtWidgets/QTreeWidget>
#include <QtWidgets/QMessageBox>
#include <QtCore/QFile>
#include <QtCore/QProcess>
#include <QtWidgets/QSplashScreen>
#include <QtWidgets/QHeaderView>
#include <QtGui/QSyntaxHighlighter>
#include <QtCore/QSettings>
#include <QtCore/QThread>
#include <QtWidgets/QColorDialog>
#include <QtWidgets/QInputDialog>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QStackedWidget>
#include <QtGui/QKeyEvent>
#include <QtWidgets/QToolButton>
#include <QtWidgets/QDialogButtonBox>
#include <QtCore/QSignalMapper>
#include <QtWinExtras/qwinfunctions.h>
#endif |
/*
Copyright 2017 Alex Margarit <alex@alxm.org>
This file is part of Faur, a C video game framework.
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef F_INC_PLATFORM_GRAPHICS_SOFTWARE_DRAW_V_H
#define F_INC_PLATFORM_GRAPHICS_SOFTWARE_DRAW_V_H
#include "f_software_draw.p.h"
#endif // F_INC_PLATFORM_GRAPHICS_SOFTWARE_DRAW_V_H
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.