text
stringlengths 4
6.14k
|
|---|
#ifndef _VERSION_H_
#define _VERSION_H_
#define TREE_VERSION "1.0"
#define TREE_COPYRIGHT "(C) 2011-2015, Peter Behroozi"
#endif /* _VERSION_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[4];
atomic_int atom_1_r1_1;
void *t0(void *arg){
label_1:;
atomic_store_explicit(&vars[0], 2, 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 v3_r3 = v2_r1 ^ v2_r1;
int v4_r3 = v3_r3 + 1;
atomic_store_explicit(&vars[2], v4_r3, memory_order_seq_cst);
int v6_r5 = atomic_load_explicit(&vars[2], memory_order_seq_cst);
int v7_r6 = v6_r5 ^ v6_r5;
atomic_store_explicit(&vars[3+v7_r6], 1, memory_order_seq_cst);
int v9_r9 = atomic_load_explicit(&vars[3], memory_order_seq_cst);
int v10_cmpeq = (v9_r9 == v9_r9);
if (v10_cmpeq) goto lbl_LC00; else goto lbl_LC00;
lbl_LC00:;
atomic_store_explicit(&vars[0], 1, memory_order_seq_cst);
int v15 = (v2_r1 == 1);
atomic_store_explicit(&atom_1_r1_1, v15, memory_order_seq_cst);
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
atomic_init(&vars[1], 0);
atomic_init(&vars[3], 0);
atomic_init(&vars[2], 0);
atomic_init(&vars[0], 0);
atomic_init(&atom_1_r1_1, 0);
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
int v11 = atomic_load_explicit(&vars[0], memory_order_seq_cst);
int v12 = (v11 == 2);
int v13 = atomic_load_explicit(&atom_1_r1_1, memory_order_seq_cst);
int v14_conj = v12 & v13;
if (v14_conj == 1) assert(0);
return 0;
}
|
/**
* \file region.c
* \author Christian Eder ( ederc@mathematik.uni-kl.de )
* \date August 2012
* \brief General source file for non-inline region handling functions.
* This file is part of XMALLOC, licensed under the GNU General
* Public License version 3. See COPYING for more information.
*/
#include <region.h>
#include <system.h>
/************************************************
* REGION ALLOCATION
***********************************************/
xRegion xAllocNewRegion(int minNumberPages) {
xRegion region = xAllocFromSystem(sizeof(xRegionType));
void *addr;
int numberPages = __XMALLOC_MAX(minNumberPages,
__XMALLOC_MIN_NUMBER_PAGES_PER_REGION);
addr = xVallocFromSystem(numberPages * __XMALLOC_SIZEOF_SYSTEM_PAGE);
if (NULL == addr) {
numberPages = minNumberPages;
addr = xVallocFromSystem(numberPages * __XMALLOC_SIZEOF_SYSTEM_PAGE);
}
// register and initialize the region
xRegisterPagesInRegion(addr, numberPages);
region->current = NULL;
region->prev = NULL;
region->next = NULL;
region->initAddr = addr;
region->addr = addr;
region->numberInitPages = numberPages;
region->numberUsedPages = 0;
region->totalNumberPages = numberPages;
#ifdef __XMALLOC_DEBUG
info.availablePages += numberPages;
info.currentRegionsAlloc++;
if (info.currentRegionsAlloc > info.maxRegionsAlloc)
info.maxRegionsAlloc = info.currentRegionsAlloc;
#endif
return region;
}
/************************************************
* PAGE HANDLING IN REGIONS
***********************************************/
xPage xGetConsecutivePagesFromRegion(xRegion region, int numberNeeded) {
void *current, *page, *prev = NULL;
char *iter;
int found;
current = region->current;
while (NULL != current) {
found = 1;
iter = current;
while (__XMALLOC_NEXT(iter) == (iter + __XMALLOC_SIZEOF_SYSTEM_PAGE)) {
iter = __XMALLOC_NEXT(iter);
// it is possible that (iter + __XMALLOC_SIZEOF_SYSTEM_PAGE == 0
if (NULL == iter)
return NULL;
found++;
if (found == numberNeeded) {
page = current;
if (region->current == current) {
region->current = __XMALLOC_NEXT(iter);
} else {
__XMALLOC_ASSERT(NULL != prev);
__XMALLOC_NEXT(prev) = __XMALLOC_NEXT(iter);
}
return page;
}
}
prev = iter;
current = __XMALLOC_NEXT(iter);
}
return NULL;
}
/**********************************************
* FREEING OPERATIONS CONCERNING PAGES
*********************************************/
void xFreePagesFromRegion(xPage page, int quantity) {
xRegion region = page->region;
region->numberUsedPages -= quantity;
if (0 == region->numberUsedPages) {
if (xBaseRegion == region) {
if (NULL != region->next) {
xBaseRegion = region->next;
} else {
xBaseRegion = region->prev;
}
}
xTakeOutRegion(region);
xFreeRegion(region);
} else {
if ((xBaseRegion != region) && xIsRegionEmpty(region)) {
xTakeOutRegion(region);
xInsertRegionAfter(region, xBaseRegion);
}
if (quantity > 1) {
int i = quantity;
char *iterPage = (char *)page;
while (i > 1) {
__XMALLOC_NEXT(iterPage) = iterPage + __XMALLOC_SIZEOF_SYSTEM_PAGE;
iterPage = __XMALLOC_NEXT(iterPage);
i--;
}
__XMALLOC_NEXT(iterPage) = region->current;
} else {
__XMALLOC_NEXT(page) = region->current;
}
region->current = (void *)page;
}
#ifndef __XMALLOC_NDEBUG
info.availablePages += quantity;
info.usedPages -= quantity;
#endif
}
|
/*
* A flexible rogue-like engine with easy-to-use mouse interface, editor,
* solo, hotseat, network multiplayer and E-Mail game functionality in mind.
* Copyright (C) 2013 Ryoga Unryu
*
* 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 SHOW_DESCRIPTION_H
#define SHOW_DESCRIPTION_H
#include "Command/Backend/Object/ObjectCommand.h"
/** \addtogroup Commands
* \{
* \class ShowDescription
*
* \brief Shows the description of a given object.
*
* \author RyogaU
*
* \version 0.5
*
* Contact: RyogaU@googlemail.com
* \}
*/
class ShowDescription : public ObjectCommand
{
public:
ShowDescription(const ObjectBase *object, QObject *parent = 0);
virtual bool execute();
};
#endif // SHOW_DESCRIPTION_H
|
/*
* Copyright (c) 2010-2019 Belledonne Communications SARL.
*
* This file is part of Liblinphone.
*
* 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 _L_CPIM_GENERIC_HEADER_H_
#define _L_CPIM_GENERIC_HEADER_H_
#include <list>
#include "cpim-header.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
namespace Cpim {
class GenericHeaderPrivate;
class HeaderNode;
class LINPHONE_PUBLIC GenericHeader : public Header {
friend class HeaderNode;
public:
GenericHeader ();
GenericHeader (std::string name, std::string value, std::string parameters = "");
std::string getName () const override;
void setName (const std::string &name);
std::string getValue () const override;
void setValue (const std::string &value);
typedef std::shared_ptr<const std::list<std::pair<std::string, std::string>>> ParameterList;
ParameterList getParameters () const;
void addParameter (const std::string &key, const std::string &value);
void removeParameter (const std::string &key, const std::string &value);
std::string asString () const override;
private:
L_DECLARE_PRIVATE(GenericHeader);
L_DISABLE_COPY(GenericHeader);
};
}
LINPHONE_END_NAMESPACE
#endif // ifndef _L_CPIM_GENERIC_HEADER_H_
|
/*
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "xfixesint.h"
int
ProcXFixesChangeSaveSet(ClientPtr client)
{
Bool toRoot, remap;
int result;
WindowPtr pWin;
REQUEST(xXFixesChangeSaveSetReq);
REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq);
pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client,
SecurityReadAccess);
if (!pWin)
return (BadWindow);
if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
return BadMatch;
if ((stuff->mode != SetModeInsert) && (stuff->mode != SetModeDelete)) {
client->errorValue = stuff->mode;
return (BadValue);
}
if ((stuff->target != SaveSetNearest) && (stuff->target != SaveSetRoot)) {
client->errorValue = stuff->target;
return (BadValue);
}
if ((stuff->map != SaveSetMap) && (stuff->map != SaveSetUnmap)) {
client->errorValue = stuff->map;
return (BadValue);
}
toRoot = (stuff->target == SaveSetRoot);
remap = (stuff->map == SaveSetMap);
result = AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, remap);
if (client->noClientException != Success)
return (client->noClientException);
else
return (result);
}
int
SProcXFixesChangeSaveSet(ClientPtr client)
{
REQUEST(xXFixesChangeSaveSetReq);
swaps(&stuff->length);
swapl(&stuff->window);
return ProcXFixesChangeSaveSet(client);
}
|
#ifndef C_JSON_WRITE_IMPL_INCLUDED
#define C_JSON_WRITE_IMPL_INCLUDED
#include "c_json_write.h"
#ifdef __cplusplus
extern "C" {
#endif
struct c_json_write_options_t
{
/* Print each item on a new line. */
c_bool_t array_multiline;
/* Vertically align array square brackets on own line. */
c_uint8_t bracket_align;
/* Number of spaces after each colon delimiter. */
c_uint8_t colon_indent;
/* Number of spaces after each comma delimiter. */
c_uint8_t comma_indent;
/* Vertically align object curly braces on own line.*/
c_bool_t curly_align;
/* Number of spaces per left-margin indentation. */
c_uint8_t indent;
/* Sort object keys. */
c_bool_t sort_keys;
};
c_str_t c_json_writes(c_json_t json, c_json_write_options_t options)
{
c_str_t result;
return result;
}
#ifdef __cplusplus
}
#endif
#endif
/*
LICENSE BEGIN
c_ - A C library of types, data structures, algorithms and utilities.
Copyright (C) 2016 Remik Ziemlinski
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/>.
LICENSE END
*/
|
// Copyright 2009 Devrin Talen
// This file is part of ADBUSB.
//
// ADBUSB 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.
//
// ADBUSB 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 ADBUSB. If not, see <http://www.gnu.org/licenses/>.
/** \file usb.c
\brief USB high-level driver.
*/
#include "usb.h"
#include <stdint.h>
#include <avr/io.h>
#include <avr/interrupt.h> /* for sei() */
#include <util/delay.h> /* for _delay_ms() */
#include <avr/pgmspace.h>
#include "usbdrv.h"
#include "oddebug.h"
/// Keyboard HID Report Descriptor
/**
This is copied shamelessly from the spritesmodes code.
*/
extern const char usbHidReportDescriptor[] PROGMEM = {
/* partial keyboard */
0x05, 0x01, /* Usage Page (Generic Desktop), */
0x09, 0x06, /* Usage (Keyboard), */
0xA1, 0x01, /* Collection (Application), */
0x85, 0x01, /* Report Id (1) */
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x08, // REPORT_COUNT (8)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x07, /* Usage Page (Key Codes), */
0x95, 0x04, /* Report Count (4), */
0x75, 0x08, /* Report Size (8), */
0x15, 0x00, /* Logical Minimum (0), */
0x25, 0x75, /* Logical Maximum(117), */
0x19, 0x00, /* Usage Minimum (0), */
0x29, 0x75, /* Usage Maximum (117), */
0x81, 0x00, /* Input (Data, Array), ;Key arrays (4 bytes) */
0xC0, /* End Collection */
/* mouse */
0x05, 0x01, /* Usage Page (Generic Desktop), */
0x09, 0x02, /* Usage (Mouse), */
0xA1, 0x01, /* Collection (Application), */
0x09, 0x01, /* Usage (Pointer), */
0xA1, 0x00, /* Collection (Physical), */
0x05, 0x09, /* Usage Page (Buttons), */
0x19, 0x01, /* Usage Minimum (01), */
0x29, 0x03, /* Usage Maximun (03), */
0x15, 0x00, /* Logical Minimum (0), */
0x25, 0x01, /* Logical Maximum (1), */
0x85, 0x02, /* Report Id (2) */
0x95, 0x03, /* Report Count (3), */
0x75, 0x01, /* Report Size (1), */
0x81, 0x02, /* Input (Data, Variable, Absolute), ;3 button bits */
0x95, 0x01, /* Report Count (1), */
0x75, 0x05, /* Report Size (5), */
0x81, 0x01, /* Input (Constant), ;5 bit padding */
0x05, 0x01, /* Usage Page (Generic Desktop), */
0x09, 0x30, /* Usage (X), */
0x09, 0x31, /* Usage (Y), */
0x15, 0x81, /* Logical Minimum (-127), */
0x25, 0x7F, /* Logical Maximum (127), */
0x75, 0x08, /* Report Size (8), */
0x95, 0x02, /* Report Count (2), */
0x81, 0x06, /* Input (Data, Variable, Relative), ;2 position bytes (X & Y) */
0xC0, /* End Collection, */
0xC0, /* End Collection */
};
/// Keyboard idle rate
/**
For some reason the HID spec wants us to track this.
*/
static uint8_t idle_rate;
/// Initialize USB hardware
/**
Initialize any resources needed by the USB code and hardware.
*/
void usb_init()
{
uint8_t i;
//odDebugInit();
usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */
i = 0;
while(--i){ /* fake USB disconnect for > 250 ms */
_delay_ms(1.0);
}
usbDeviceConnect();
usbInit();
sei();
return;
}
/// Handle SETUP transactions.
/**
Received a SETUP transaction from the USB host. This could be the start of
a CONTROL transfer, in which case we better be ready to give the host the
latest data from the keyboard.
@param[in] data SETUP transaction data.
@return Length of data, or 0 if not handled.
*/
usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t *rq = (void *)data;
// Handle class request type
if ((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS) {
// wValue: ReportType (highbyte), ReportID (lowbyte)
if (rq->bRequest == USBRQ_HID_GET_REPORT) {
// we only have one report type, so don't look at wValue
usbMsgPtr = (void *)&mouseReportBuffer;
return sizeof(mouseReportBuffer);
} else if (rq->bRequest == USBRQ_HID_GET_IDLE) {
usbMsgPtr = &idle_rate;
return sizeof(idle_rate);
} else if (rq->bRequest == USBRQ_HID_SET_IDLE) {
idle_rate = rq->wValue.bytes[1];
}
}
return 0;
}
|
/* graph.h */
/*
This software library implements the maxflow algorithm
described in
An Experimental Comparison of Min-Cut/Max-Flow Algorithms
for Energy Minimization in Vision.
Yuri Boykov and Vladimir Kolmogorov.
In IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI),
September 2004
This algorithm was developed by Yuri Boykov and Vladimir Kolmogorov
at Siemens Corporate Research. To make it available for public use,
it was later reimplemented by Vladimir Kolmogorov based on open publications.
If you use this software for research purposes, you should cite
the aforementioned paper in any resulting publication.
*/
/*
Copyright 2001 Vladimir Kolmogorov (vnk@cs.cornell.edu), Yuri Boykov (yuri@csd.uwo.ca).
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
*/
/*
For description, example usage, discussion of graph representation
and memory usage see README.TXT.
*/
#ifndef __GRAPH_H__
#define __GRAPH_H__
#include "block.h"
/*
Nodes, arcs and pointers to nodes are
added in blocks for memory and time efficiency.
Below are numbers of items in blocks
*/
#define NODE_BLOCK_SIZE 512
#define ARC_BLOCK_SIZE 1024
#define NODEPTR_BLOCK_SIZE 128
class Graph
{
public:
typedef enum
{
SOURCE = 0,
SINK = 1
} termtype; /* terminals */
/* Type of edge weights.
Can be changed to char, int, float, double, ... */
//Nagoya start
// typedef short captype;
typedef double captype;
//Nagoya end
/* Type of total flow */
//Nagoya start
// typedef int flowtype;
typedef double flowtype;
//Nagoya end
typedef void * node_id;
/* interface functions */
/* Constructor. Optional argument is the pointer to the
function which will be called if an error occurs;
an error message is passed to this function. If this
argument is omitted, exit(1) will be called. */
Graph(void (*err_function)(char *) = NULL);
/* Destructor */
~Graph();
/* Adds a node to the graph */
node_id add_node();
/* Adds a bidirectional edge between 'from' and 'to'
with the weights 'cap' and 'rev_cap' */
void add_edge(node_id from, node_id to, captype cap, captype rev_cap);
/* Sets the weights of the edges 'SOURCE->i' and 'i->SINK'
Can be called at most once for each node before any call to 'add_tweights'.
Weights can be negative */
void set_tweights(node_id i, captype cap_source, captype cap_sink);
/* Adds new edges 'SOURCE->i' and 'i->SINK' with corresponding weights
Can be called multiple times for each node.
Weights can be negative */
void add_tweights(node_id i, captype cap_source, captype cap_sink);
/* After the maxflow is computed, this function returns to which
segment the node 'i' belongs (Graph::SOURCE or Graph::SINK) */
termtype what_segment(node_id i);
/* Computes the maxflow. Can be called only once. */
flowtype maxflow();
//Owieczka
void add_term3(node_id x, node_id y, node_id z, captype E000, captype E001, captype E010, captype E011, captype E100, captype E101, captype E110, captype E111);
void add_term2(node_id x, node_id y, captype E00, captype E01, captype E10, captype E11);
void add_term1(node_id x, captype E0, captype E1);
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
private:
/* internal variables and functions */
struct arc_st;
/* node structure */
typedef struct node_st
{
arc_st *first; /* first outcoming arc */
arc_st *parent; /* node's parent */
node_st *next; /* pointer to the next active node
(or to itself if it is the last node in the list) */
int TS; /* timestamp showing when DIST was computed */
int DIST; /* distance to the terminal */
short is_sink; /* flag showing whether the node is in the source or in the sink tree */
captype tr_cap; /* if tr_cap > 0 then tr_cap is residual capacity of the arc SOURCE->node
otherwise -tr_cap is residual capacity of the arc node->SINK */
} node;
/* arc structure */
typedef struct arc_st
{
node_st *head; /* node the arc points to */
arc_st *next; /* next arc with the same originating node */
arc_st *sister; /* reverse arc */
captype r_cap; /* residual capacity */
} arc;
/* 'pointer to node' structure */
typedef struct nodeptr_st
{
node_st *ptr;
nodeptr_st *next;
} nodeptr;
Block<node> *node_block;
Block<arc> *arc_block;
DBlock<nodeptr> *nodeptr_block;
void (*error_function)(char *); /* this function is called if a error occurs,
with a corresponding error message
(or exit(1) is called if it's NULL) */
flowtype flow; /* total flow */
/***********************************************************************/
node *queue_first[2], *queue_last[2]; /* list of active nodes */
nodeptr *orphan_first, *orphan_last; /* list of pointers to orphans */
int TIME; /* monotonically increasing global counter */
/***********************************************************************/
/* functions for processing active list */
void set_active(node *i);
node *next_active();
void maxflow_init();
void augment(arc *middle_arc);
void process_source_orphan(node *i);
void process_sink_orphan(node *i);
};
#endif
|
#define getTreeNodeElem( node, type ) (*((type *)(node->elem)))
typedeft struct {
void *elem;
int key;
TreeNode *left;
TreeNode *right;
TreeNode *prev;
} TreeNode;
bool hasLeft(TreeNode *node) {
if(node->left != NULL)
return true;
else
return false;
}
bool hasRight(TreeNode *node) {
if(node->right != NULL)
return true;
else
return false;
}
TreeNode* insertTree(TreeNode *node, TreeNode *tree) {
TreeNode * ptr;
if(tree == NULL)
tree = node;
else {
ptr = tree;
while(true) {
if(node->key > ptr) {
if(ptr->right == NULL) {
ptr->right = NULL;
break;
}
else
ptr = ptr->right;
}
else if(node->key >= ptr) {
if(ptr->left == NULL) {
ptr->left = NULL;
break;
}
else
ptr = ptr->left;
}
}
}
return node;
}
TreeNode* removeTree(TreeNode *node, TreeNode *tree) {
if(node->left == NULL && node->right == NULL)
node->right = NULL;
else if(node->left == NULL && node->right != NULL)
node->right = node->right;
else if(node->left != NULL && node->right == NULL)
node->right = node->left;
else if(node->left != NULL && node->right != NULL) {
TreeNode *predecessor = node->left;
if(predecessor->right == NULL) {
predecessor->right = node->right;
node->prev->right = predecessor;
}
else {
while(predecessor->right != NULL) {
if(predecessor->right->right == NULL) {
predecessor->right->right = node->right;
predecessor->right->left = node->left;
node->prev->right = predecessor->right;
predecessor->right = NULL;
break;
}
predecessor = predecessor->right;
}
}
}
return node;
}
|
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* always defined to indicate that i18n is enabled */
#define ENABLE_NLS 1
/* GETTEXT package name */
#define GETTEXT_PACKAGE "dynmotd_cpp"
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
/* Define to 1 if you have the `dcgettext' function. */
#define HAVE_DCGETTEXT 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define if the GNU gettext() function is already present or preinstalled. */
#define HAVE_GETTEXT 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define if your <locale.h> file defines LC_MESSAGES. */
#define HAVE_LC_MESSAGES 1
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "dynmotd_cpp"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME "dynmotd_cpp"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "dynmotd_cpp 0.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "dynmotd_cpp"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.1"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "0.1"
|
/**
*
* CTCForce.h
*
* Defines methods for Carrier to carrier interaction
* force estimation.
*
* Written by Taylor Shin
* Sep. 2nd, 2016
*
**/
#ifndef __CTCForce_h__
#define __CTCForce_h__
#define _USE_MATH_DEFINES
#include "fputils.h"
#include "physical_constants.h"
#include "typedefs.h"
#include "materials.h"
#include "sim_space.h"
namespace Physics {
class CTCForce : \
public virtual sim_space
{
public:
// Returns effective mass of electron/holes of silicon.
// fp_t eff_mass_si(spCarrier carrier);
// Returns thermal velocity with effective mass
Vel thermal_vel(const spCarrier& carrier);
// Calculate Debye length for a carrier
fp_t DebyeLength(const spCarrier& carrier);
// Diffuse a Carrier by given tau
void Diffusion(const spCarrier& carrier);
void Diffusion(const spCarrier& carrier, const fp_t& tau);
// Calculate Brownian scattering for a carrier
void MFPAdj(spCarrier& carrier);
void MFPAdj(spCarrier& carrier, const fp_t& tau);
// Drift force (Electric field from external bias)
Force DriftForce(const spCarrier& carrier);
// Carrier to Carrier interaction.
Force CoulombForce(spCarrier& carrier, spCarrier& other);
// Constructors and Destructors
CTCForce() {;}
virtual ~CTCForce() {;}
}; /* class CTCForce */
}; /* namespace Physics */
#endif /* Include guard */
|
/*
* skyplot.h - skyplot header
*
* Copyright (C) 2012 Michael Rieder <mr@student.ethz.ch>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <pthread.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "gnuplot_i.h"
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* GLOBAL CONSTANTS
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// Program-specific
#define PROJECTNAME "skyplot"
// Calculation constants
#define MOLLWEIDE_ERROR 0.0000001
// Mathematical Constants
#define RAD M_PI/180.0
#define DEG 180.0/M_PI
// Data input
#define NVSS_LINE_LEN 145
// Cosmological parameters
#define OMEGA_M 0.272
#define OMEGA_L 0.734
#define HUBBLE_0 71.0
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* STRUCTURES, ENUMS
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
typedef enum cattype_s {
CT_SDSS,
CT_NVSS
} cattype_t;
typedef struct catdata_s {
double ra;
double dec;
double z;
double abs_petro_r_mag;
double u_b_color;
double stellar_mass;
// Galactic coordinates for NVSS
double longitude;
double latitude;
// Rotation Measure
double rot_measure;
double rot_measure_mean; // mean RM in neighbourhood
double rot_measure_delta; // delta of RM to mean RM
int sourcesNum; // number of sources inside annulus
double rot_measure_mean_nn; // mean for Nearest neighbor
double rot_measure_delta_nn; // delta for NN
double rot_measure_sd_nn; // standard deviation with NN
double rot_measure_median;
double rot_measure_median_delta;
double comovD; // in GPc
double angDiamD;
double mollw_angle;
double mollw_angle_gal;
double cosdec; // cos(dec)
} catdata_t;
typedef struct catalog_s {
cattype_t type;
int number;
double threshold; // for selected NVSS
catdata_t *data; // pointer size may vary (32/64 bits)
} catalog_t;
typedef struct cullthread_s {
catalog_t *from;
catalog_t *toA;
catalog_t *toB;
int start;
int end;
double threshold;
time_t tic;
} threadData_t;
typedef struct sortNN_s {
double dist;
double rot_measure;
} sortNN_t;
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* EXTERNAL VARIABLES
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
extern int scripted;
// full catalogs
extern catalog_t nvss_full;
extern catalog_t sdss_full;
// pointers to the active buffers
extern catalog_t *sdss_culled;
extern catalog_t *nvss_culled;
extern catalog_t sdss_A;
extern catalog_t sdss_B;
extern catalog_t nvss_A;
extern catalog_t nvss_B;
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* FUNCTION DECLARATIONS
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// skyplot.c
int main( int argc, char **argv );
void SKY_ScriptLoop( const char *fileName );
void SKY_CmdLoop( void );
// compute.c
int COM_ImpLThreshold( catdata_t *cdn, catdata_t *cds,
double threshold );
void COM_MeanRM( const char *cmdLine );
void COM_MeanRM_NN( const char *cmdLine );
// culling.c
int CUL_CullCancel( const char *cmdLine );
// fileio.c
int FIO_OpenDataFile( FILE **fp, const char *fs, catalog_t *cat );
int FIO_ReadCatFile( FILE *fp, catalog_t *cat );
void FIO_CloseFile( FILE *fp );
void FIO_ReadDistFile( FILE *fp, catalog_t *cat );
int FIO_FileToMemory( const char *name, catalog_t *cat );
void FIO_MemoryToFile( const char *name, catalog_t *cat );
void FIO_DataToFile( const char *name, double *data, int number );
int FIO_OpenScriptFile( const char *name );
int FIO_ReadScript( char *cmdLine, int length );
void FIO_CloseScriptFile( void );
// math.c
double MAT_GreatCircD(double dra, double ddec,
double cosdec1, double cosdec2);
double MAT_AngDiamD( double z, double comovD );
void MAT_Mollweide( double dec, double *result );
// memory.c
void MEM_AppendCat( catalog_t *old, catalog_t *new, int offs );
void MEM_SwitchSDSSBuffer( void );
void MEM_SwitchNVSSBuffer( void );
void MEM_LoadCulled( void );
void MEM_SaveCulled( void );
void MEM_ResetCulled( void );
void MEM_Init( void );
void MEM_FreeAllBuffers( void );
// statistics.c
int STAT_DivideCancel( const char *cmdLine );
void STAT_WriteToDisk( const char *cmdLine );
// visual.c
void VIS_DrawPlot( const char *buf );
|
/**
* \file command.h
* \author Johan Boris Iantila
* \version 0.1
* \date 21/01/2016
*
*
*/
#ifndef COMMAND_H
#define COMMAND_H
#define BUFFER_SIZE 2048
#include <sys/time.h>
#include "enum.h"
typedef struct smscommand t_smscommand;
typedef struct ussdcommand t_ussdcommand;
typedef struct device t_device;
typedef struct devicestate t_devicestate;
struct smscommand{
char *pduBuffer;
char *messages;
char *phoneNumber;
char *error_message;
};
struct ussdcommand{
char *command;
char *error_message;
};
struct devicestate{
char *error;
int state;
};
struct device{
char *devicename;
t_device *next;
};
typedef struct at_smscommand{
at_cmd_t cmd; /*!< command code */
at_res_t res; /*!< expected responce code, can be RES_OK, RES_CMGR, RES_SMS_PROMPT */
unsigned flags; /*!< flags */
#define ATQ_CMD_FLAG_DEFAULT 0x00 /*!< empty flags */
#define ATQ_CMD_FLAG_STATIC 0x01 /*!< data is static no try deallocate */
#define ATQ_CMD_FLAG_IGNORE 0x02 /*!< ignore response non match condition */
struct timeval timeout; /*!< timeout value, started at time when command actually written on device */
#define ATQ_CMD_TIMEOUT_1S 1 /*!< timeout value 1 sec */
#define ATQ_CMD_TIMEOUT_2S 2 /*!< timeout value 2 sec */
#define ATQ_CMD_TIMEOUT_5S 5 /*!< timeout value 5 sec */
#define ATQ_CMD_TIMEOUT_10S 10 /*!< timeout value 10 sec */
#define ATQ_CMD_TIMEOUT_15S 15 /*!< timeout value 15 ses */
#define ATQ_CMD_TIMEOUT_40S 40 /*!< timeout value 40 ses */
char* data; /*!< command and data to send in device */
unsigned length; /*!< data length */
} at_queue_cmd_t;
#define ATQ_CMD_DECLARE_DYNFT(cmd,res,flags,s,u) { (cmd), (res), flags & ~ATQ_CMD_FLAG_STATIC, {(s), (u)}, 0, 0 }
#define ATQ_CMD_DECLARE_DYNF(cmd,res,flags) ATQ_CMD_DECLARE_DYNFT(cmd,res,flags,ATQ_CMD_TIMEOUT_2S,0)
//#define ATQ_CMD_DECLARE_DYNF(cmd,res,flags) { (cmd), (res), flags & ~ATQ_CMD_FLAG_STATIC, {ATQ_CMD_TIMEOUT_2S, 0}, 0, 0 }
#define ATQ_CMD_DECLARE_DYN(cmd) ATQ_CMD_DECLARE_DYNF(cmd, RES_OK, ATQ_CMD_FLAG_DEFAULT)
t_smscommand *createSmsCommand(const char* phoneNumber, const char* message);
t_ussdcommand *createUssdCommand(const char* command);
void sendcommand(int fd, const char *str);
t_devicestate* openttyUSB (const char* dev);
#endif
|
/**********************************************************************/
/* */
/* File name: int.c */
/* */
/* Since: 2004-Sept-20 */
/* */
/* Version: PICos18 v2.10 */
/* Copyright (C) 2003, 2004, 2005 Pragmatec. */
/* */
/* Author: Designed by Pragmatec S.A.R.L. www.pragmatec.net */
/* MONTAGNE Xavier [XM] xavier.montagne@pragmatec.net */
/* */
/* Purpose: Interrupt vector location. */
/* */
/* Distribution: This file is part of PICos18. */
/* PICos18 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, or (at your option) */
/* any later version. */
/* */
/* PICos18 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 gpsim; see the file */
/* COPYING.txt. If not, write to the Free Software */
/* Foundation, 59 Temple Place - Suite 330, */
/* Boston, MA 02111-1307, USA. */
/* */
/* > A special exception to the GPL can be applied should */
/* you wish to distribute a combined work that includes */
/* PICos18, without being obliged to provide the source */
/* code for any proprietary components. */
/* */
/* History: */
/* 2004/12/01 [XM] Create this file. */
/* 2005/10/29 [XM] Removed the "save" statement for InterruptL. */
/* Added "nosave" statement for InterruptH. */
/* */
/**********************************************************************/
#include "define.h"
/**********************************************************************
* Function you want to call when an IT occurs.
**********************************************************************/
extern void AddOneTick(void);
/*extern void MyOwnISR(void); */
void InterruptVectorL(void);
void InterruptVectorH(void);
extern unsigned char tmrcnt0, tmrcnt1;
/**********************************************************************
* General interrupt vector. Do not modify.
**********************************************************************/
#pragma code IT_vector_low=0x18
void Interrupt_low_vec(void)
{
_asm goto InterruptVectorL _endasm
}
#pragma code
#pragma code IT_vector_high=0x08
void Interrupt_high_vec(void)
{
_asm goto InterruptVectorH _endasm
}
#pragma code
/**********************************************************************
* General ISR router. Complete the function core with the if or switch
* case you need to jump to the function dedicated to the occuring IT.
* .tmpdata and MATH_DATA are saved automaticaly with C18 v3.
**********************************************************************/
#pragma code _INTERRUPT_VECTORL = 0x003000
#pragma interruptlow InterruptVectorL
void InterruptVectorL(void)
{
EnterISR();
if (INTCONbits.TMR0IF == 1)
{
AddOneTick();
/*tmrcnt0++;
if(tmrcnt0==50)
{
tmrcnt0=0;
tmrcnt1++;
if(tmrcnt1==200)
{
tmrcnt1=0;
}
}*/
}
/* Here are the other interrupts you would desire to manage */
if ((PIR1bits.RCIF)&(PIE1bits.RCIE))
RS_RX_INT();
if ((PIR1bits.TXIF)&(PIE1bits.TXIE))
RS_TX_INT();
LeaveISR();
}
#pragma code
/* BE CARREFULL : ONLY BSR, WREG AND STATUS REGISTERS ARE SAVED */
/* DO NOT CALL ANY FUNCTION AND USE PLEASE VERY SIMPLE CODE LIKE */
/* VARIABLE OR FLAG SETTINGS. CHECK THE ASM CODE PRODUCED BY C18 */
/* IN THE LST FILE. */
#pragma code _INTERRUPT_VECTORH = 0x003300
#pragma interrupt InterruptVectorH nosave=FSR0, TBLPTRL, TBLPTRH, TBLPTRU, TABLAT, PCLATH, PCLATU, PROD, section(".tmpdata"), section("MATH_DATA")
void InterruptVectorH(void)
{
if (INTCONbits.INT0IF == 1)
INTCONbits.INT0IF = 0;
}
#pragma code
extern void _startup (void);
#pragma code _RESET_INTERRUPT_VECTOR = 0x003400
void _reset (void)
{
_asm goto _startup _endasm
}
#pragma code
/* End of file : int.c */
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* main.c
* Copyright (C) Thura Hlaing 2010 <trhura@gmail.com>
*
* rookie 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.
*
* rookie 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 <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <config.h>
#include <gtk/gtk.h>
#include "rookie-i18n.h"
#include "rookie-app.h"
#include "rookie-debug.h"
int
main (int argc, char *argv[])
{
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#endif
rookie_debug_init ();
RookieApp *application = rookie_app_new ();
if (rookie_app_run (application, argc, argv))
return 1;
g_object_unref (application);
return 0;
}
|
/*
* Copyright 2011 Mect s.r.l
*
* This file is part of FarosPLC.
*
* FarosPLC 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.
*
* FarosPLC 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
* FarosPLC. If not, see http://www.gnu.org/licenses/.
*/
/*
* Filename: fbUtil.h
*/
#if defined(RTS_CFG_UTILITY_LIB)
NULL, /*20*/
NULL, /*21*/
NULL, /*22*/
NULL, /*23*/
NULL, /*24*/
#else /* RTS_CFG_UTILITY_LIB */
NULL, /*20*/
NULL, /*21*/
NULL, /*22*/
NULL, /*23*/
NULL, /*24*/
#endif /* RTS_CFG_UTILITY_LIB */
/* ---------------------------------------------------------------------------- */
|
#ifndef _TirDebouchechiote_
#define _TirDebouchechiote_
//-----------------------------------------------------------------------------
// Headers
//-----------------------------------------------------------------------------
#include "tir.h"
//-----------------------------------------------------------------------------
// Définition de la classe TirDecoucheChiote
//-----------------------------------------------------------------------------
#define DEBOUCHE_CHIOTE_SPEED 10
class TirDebouchechiote : public Tir
{
public:
int dx;
TirDebouchechiote(int n_pbk_ennemis, int vx, int vy);
virtual int degats() const
{
return 1;
};
virtual int enflame() const
{
return 0;
};
virtual void setDir(int d)
{
dir = d;
};
virtual void update();
};
#endif
|
/*
Copyright © 2012 Clint Bellanger
Copyright © 2012 Stefan Beller
Copyright © 2013 Ryan Dansie
Copyright © 2012-2021 Justin Jacobs
This file is part of FLARE.
FLARE 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.
FLARE 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
FLARE. If not, see http://www.gnu.org/licenses/
*/
/**
* class EntityBehavior
*
* Interface for entity behaviors.
* The behavior object is a component of Entity.
* Make AI decisions (movement, actions) for entities.
*/
#ifndef ENTITY_BEHAVIOR_H
#define ENTITY_BEHAVIOR_H
class Entity;
class EntityBehavior {
private:
static const float ALLY_FLEE_DISTANCE;
static const float ALLY_FOLLOW_DISTANCE_WALK;
static const float ALLY_FOLLOW_DISTANCE_STOP;
static const float ALLY_TELEPORT_DISTANCE;
// logic steps
void doUpkeep();
void findTarget();
void checkPower();
void checkMove();
void checkMoveStateStance();
void checkMoveStateMove();
void updateState();
FPoint getWanderPoint();
protected:
Entity *e;
static const int PATH_FOUND_FAIL_THRESHOLD = 1;
static const int PATH_FOUND_FAIL_WAIT_SECONDS = 2;
//variables for patfinding
std::vector<FPoint> path;
FPoint prev_target;
bool collided;
bool path_found;
int chance_calc_path;
int path_found_fails;
Timer path_found_fail_timer;
float target_dist;
float hero_dist;
FPoint pursue_pos;
// targeting vars
bool los;
//when fleeing, the entity moves away from the pursue_pos
bool fleeing;
bool move_to_safe_dist;
Timer turn_timer;
bool instant_power;
public:
explicit EntityBehavior(Entity *_e);
~EntityBehavior();
void logic();
};
#endif
|
// -----------------------------------------------
// This file is script-generated...
// -----------------------------------------------
#ifndef DAMAGE_EXTENT_H
#define DAMAGE_EXTENT_H
namespace vdis
{
typedef enum
{
DAMAGE_EXTENT_NONE = 0,
DAMAGE_EXTENT_MOBILITY_KILL = 1,
DAMAGE_EXTENT_FIREPOWER_KILL = 2,
DAMAGE_EXTENT_MOBILITY_AND_FIRE_POWER_KILL = 3,
DAMAGE_EXTENT_CATASTROPHIC_KILL = 4,
DAMAGE_EXTENT_OTHER = 5,
DAMAGE_EXTENT_END
} damage_extent_e;
}
#endif
|
//Colour_Maps.h.
#pragma once
#include <optional>
#include <string>
struct ClampedColourRGB {
double R; // within [0,1].
double G; // within [0,1].
double B; // within [0,1].
};
//These functions take a clamped input in [0,1] and map it to a colour specified in terms of R,G,B all within [0,1].
ClampedColourRGB ColourMap_Linear(double y);
ClampedColourRGB ColourMap_Viridis(double y);
ClampedColourRGB ColourMap_Magma(double y);
ClampedColourRGB ColourMap_Inferno(double y);
ClampedColourRGB ColourMap_Plasma(double y);
ClampedColourRGB ColourMap_Jet(double y);
ClampedColourRGB ColourMap_MorelandBlueRed(double y);
ClampedColourRGB ColourMap_MorelandBlackBody(double y);
ClampedColourRGB ColourMap_MorelandExtendedBlackBody(double y);
ClampedColourRGB ColourMap_KRC(double y);
ClampedColourRGB ColourMap_ExtendedKRC(double y);
ClampedColourRGB ColourMap_Kovesi_LinKRYW_5_100_c64(double y);
ClampedColourRGB ColourMap_Kovesi_LinKRYW_0_100_c71(double y);
ClampedColourRGB ColourMap_Kovesi_Cyclic_mygbm_30_95_c78(double y);
ClampedColourRGB ColourMap_LANL_OliveGreen_to_Blue(double y);
ClampedColourRGB ColourMap_YgorIncandescent(double y);
ClampedColourRGB ColourMap_Composite_50_90_107_110(double y);
ClampedColourRGB ColourMap_Composite_50_90_100_107_110(double y);
//This function takes a named colour and map it to a colour specified in terms of R,G,B all within [0,1].
std::optional<ClampedColourRGB> Colour_from_name(const std::string& n);
|
//+------------------------------------------------------------------+
//| Método de Mínimos Quadrados |
//| Copyright © 2014, Cleiton Gomes; Vanessa Barbosa |
//| http://www.softwarecsg.com.br |
//+------------------------------------------------------------------+
#include <stdio.h>
#include <stdlib.h>
double calculoCoeficienteLinear();
double calculoCoeficienteAngular();
double calculoCoeficienteLinear(int quantidadeVelas){
FILE *arquivo;
double x[quantidadeVelas], y[quantidadeVelas];
double soma_x = 0, soma_y = 0;
double numerador, denominador;
double variacaoLinear;
int i;
arquivo = fopen("dadosMinimosQuadrados.txt","rt");
for(i = 1; i < quantidadeVelas; i++){
fscanf(arquivo, "%lf",&x[i]);
fscanf(arquivo, "%lf",&y[i]);
soma_x = soma_x + x[i];
soma_y = soma_y + y[i];
}
for(i = 1; i < quantidadeVelas; i++){
numerador = x[i]*(y[i] - soma_x/quantidadeVelas);
denominador = y[i]*(x[i] - soma_y/quantidadeVelas);
}
variacaoLinear = numerador/denominador;
fclose(arquivo);
return variacaoLinear;
}
double calculoCoeficienteAngular(int quantidadeVelas){
FILE *arquivo;
double x[quantidadeVelas], y[quantidadeVelas];
double soma_x = 0, soma_y = 0;
double variacaoAngular;
int i;
arquivo = fopen("dadosMinimosQuadrados.txt","rt");
for(i = 1; i < quantidadeVelas; i++){
fscanf(arquivo, "%lf",&x[i]);
fscanf(arquivo, "%lf",&y[i]);
soma_x = soma_x + x[i];
soma_y = soma_y + y[i];
}
variacaoAngular = soma_y/quantidadeVelas - (calculoCoeficienteLinear(quantidadeVelas)*soma_x/quantidadeVelas);
fclose(arquivo);
return variacaoAngular;
}
|
/**
****************************************************************************************
*
* @file otpc.c
*
* @brief eeprom driver over i2c interface header file.
*
* Copyright (C) 2012. Dialog Semiconductor Ltd, unpublished work. This computer
* program includes Confidential, Proprietary Information and is a Trade Secret of
* Dialog Semiconductor Ltd. All use, disclosure, and/or reproduction is prohibited
* unless authorized in writing. All Rights Reserved.
*
* <bluetooth.support@diasemi.com> and contributors.
*
****************************************************************************************
*/
#include "global_io.h"
#include "otpc.h"
/**
****************************************************************************************
* @brief Enable OTP clock
****************************************************************************************
*/
void otpc_clock_enable(void)
{
SetBits16(CLK_AMBA_REG, OTP_ENABLE, 1); // set divider to 1
while ((GetWord16(ANA_STATUS_REG) & LDO_OTP_OK) != LDO_OTP_OK)
/* Just wait */;
}
/**
****************************************************************************************
* @brief Disable OTP clock
****************************************************************************************
*/
void otpc_clock_disable(void)
{
SetBits16(CLK_AMBA_REG, OTP_ENABLE, 0); // set divider to 1
}
/**
****************************************************************************************
* @brief Write OTP data
****************************************************************************************
*/
int otpc_write_fifo(unsigned int mem_addr, unsigned int cel_addr, unsigned int num_of_words)
{
int i;
int tmp;
int res;
SetWord32 (OTPC_MODE_REG, OTPC_MODE_STBY);
SetWord32 (OTPC_CELADR_REG,(cel_addr>>2)&0x1FFF);
SetWord32 (OTPC_NWORDS_REG, num_of_words - 1);
SetWord32 (OTPC_MODE_REG, OTPC_MODE_APROG);
res = 0;
for (i=0;i < num_of_words; i++) {
while (((tmp = GetWord32(OTPC_STAT_REG)) & OTPC_STAT_FWORDS) == 0x800);
if ((tmp & OTPC_STAT_ARDY) == OTPC_STAT_ARDY) {
res += -10;
break;
}
SetWord32 (OTPC_FFPRT_REG, GetWord32(mem_addr + 4*i)); // Write FIFO data
}
// wait end of programming
while ((GetWord32(OTPC_STAT_REG) & OTPC_STAT_ARDY) != OTPC_STAT_ARDY);
if ((GetWord32(OTPC_STAT_REG) & OTPC_STAT_PERROR) == OTPC_STAT_PERROR) {
if ((GetWord32(OTPC_STAT_REG) & OTPC_STAT_PERR_L) == OTPC_STAT_PERR_L)
res += -1;
if ((GetWord32(OTPC_STAT_REG) & OTPC_STAT_PERR_U) == OTPC_STAT_PERR_U)
res += -2;
}
return res;
}
|
#ifndef INCLUDED_volk_16i_branch_4_state_8_a16_H
#define INCLUDED_volk_16i_branch_4_state_8_a16_H
#include<inttypes.h>
#include<stdio.h>
#ifdef LV_HAVE_SSSE3
#include<xmmintrin.h>
#include<emmintrin.h>
#include<tmmintrin.h>
static inline void volk_16i_branch_4_state_8_a16_ssse3(short* target, short* src0, char** permuters, short* cntl2, short* cntl3, short* scalars) {
__m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11;
__m128i *p_target, *p_src0, *p_cntl2, *p_cntl3, *p_scalars;
p_target = (__m128i*)target;
p_src0 = (__m128i*)src0;
p_cntl2 = (__m128i*)cntl2;
p_cntl3 = (__m128i*)cntl3;
p_scalars = (__m128i*)scalars;
int i = 0;
int bound = 1;
xmm0 = _mm_load_si128(p_scalars);
xmm1 = _mm_shufflelo_epi16(xmm0, 0);
xmm2 = _mm_shufflelo_epi16(xmm0, 0x55);
xmm3 = _mm_shufflelo_epi16(xmm0, 0xaa);
xmm4 = _mm_shufflelo_epi16(xmm0, 0xff);
xmm1 = _mm_shuffle_epi32(xmm1, 0x00);
xmm2 = _mm_shuffle_epi32(xmm2, 0x00);
xmm3 = _mm_shuffle_epi32(xmm3, 0x00);
xmm4 = _mm_shuffle_epi32(xmm4, 0x00);
xmm0 = _mm_load_si128((__m128i*)permuters[0]);
xmm6 = _mm_load_si128((__m128i*)permuters[1]);
xmm8 = _mm_load_si128((__m128i*)permuters[2]);
xmm10 = _mm_load_si128((__m128i*)permuters[3]);
for(; i < bound; ++i) {
xmm5 = _mm_load_si128(p_src0);
xmm0 = _mm_shuffle_epi8(xmm5, xmm0);
xmm6 = _mm_shuffle_epi8(xmm5, xmm6);
xmm8 = _mm_shuffle_epi8(xmm5, xmm8);
xmm10 = _mm_shuffle_epi8(xmm5, xmm10);
p_src0 += 4;
xmm5 = _mm_add_epi16(xmm1, xmm2);
xmm6 = _mm_add_epi16(xmm2, xmm6);
xmm8 = _mm_add_epi16(xmm1, xmm8);
xmm7 = _mm_load_si128(p_cntl2);
xmm9 = _mm_load_si128(p_cntl3);
xmm0 = _mm_add_epi16(xmm5, xmm0);
xmm7 = _mm_and_si128(xmm7, xmm3);
xmm9 = _mm_and_si128(xmm9, xmm4);
xmm5 = _mm_load_si128(&p_cntl2[1]);
xmm11 = _mm_load_si128(&p_cntl3[1]);
xmm7 = _mm_add_epi16(xmm7, xmm9);
xmm5 = _mm_and_si128(xmm5, xmm3);
xmm11 = _mm_and_si128(xmm11, xmm4);
xmm0 = _mm_add_epi16(xmm0, xmm7);
xmm7 = _mm_load_si128(&p_cntl2[2]);
xmm9 = _mm_load_si128(&p_cntl3[2]);
xmm5 = _mm_add_epi16(xmm5, xmm11);
xmm7 = _mm_and_si128(xmm7, xmm3);
xmm9 = _mm_and_si128(xmm9, xmm4);
xmm6 = _mm_add_epi16(xmm6, xmm5);
xmm5 = _mm_load_si128(&p_cntl2[3]);
xmm11 = _mm_load_si128(&p_cntl3[3]);
xmm7 = _mm_add_epi16(xmm7, xmm9);
xmm5 = _mm_and_si128(xmm5, xmm3);
xmm11 = _mm_and_si128(xmm11, xmm4);
xmm8 = _mm_add_epi16(xmm8, xmm7);
xmm5 = _mm_add_epi16(xmm5, xmm11);
_mm_store_si128(p_target, xmm0);
_mm_store_si128(&p_target[1], xmm6);
xmm10 = _mm_add_epi16(xmm5, xmm10);
_mm_store_si128(&p_target[2], xmm8);
_mm_store_si128(&p_target[3], xmm10);
p_target += 3;
}
}
#endif /*LV_HAVE_SSEs*/
#ifdef LV_HAVE_GENERIC
static inline void volk_16i_branch_4_state_8_a16_generic(short* target, short* src0, char** permuters, short* cntl2, short* cntl3, short* scalars) {
int i = 0;
int bound = 4;
for(; i < bound; ++i) {
target[i* 8] = src0[((char)permuters[i][0])/2]
+ ((i + 1)%2 * scalars[0])
+ (((i >> 1)^1) * scalars[1])
+ (cntl2[i * 8] & scalars[2])
+ (cntl3[i * 8] & scalars[3]);
target[i* 8 + 1] = src0[((char)permuters[i][1 * 2])/2]
+ ((i + 1)%2 * scalars[0])
+ (((i >> 1)^1) * scalars[1])
+ (cntl2[i * 8 + 1] & scalars[2])
+ (cntl3[i * 8 + 1] & scalars[3]);
target[i* 8 + 2] = src0[((char)permuters[i][2 * 2])/2]
+ ((i + 1)%2 * scalars[0])
+ (((i >> 1)^1) * scalars[1])
+ (cntl2[i * 8 + 2] & scalars[2])
+ (cntl3[i * 8 + 2] & scalars[3]);
target[i* 8 + 3] = src0[((char)permuters[i][3 * 2])/2]
+ ((i + 1)%2 * scalars[0])
+ (((i >> 1)^1) * scalars[1])
+ (cntl2[i * 8 + 3] & scalars[2])
+ (cntl3[i * 8 + 3] & scalars[3]);
target[i* 8 + 4] = src0[((char)permuters[i][4 * 2])/2]
+ ((i + 1)%2 * scalars[0])
+ (((i >> 1)^1) * scalars[1])
+ (cntl2[i * 8 + 4] & scalars[2])
+ (cntl3[i * 8 + 4] & scalars[3]);
target[i* 8 + 5] = src0[((char)permuters[i][5 * 2])/2]
+ ((i + 1)%2 * scalars[0])
+ (((i >> 1)^1) * scalars[1])
+ (cntl2[i * 8 + 5] & scalars[2])
+ (cntl3[i * 8 + 5] & scalars[3]);
target[i* 8 + 6] = src0[((char)permuters[i][6 * 2])/2]
+ ((i + 1)%2 * scalars[0])
+ (((i >> 1)^1) * scalars[1])
+ (cntl2[i * 8 + 6] & scalars[2])
+ (cntl3[i * 8 + 6] & scalars[3]);
target[i* 8 + 7] = src0[((char)permuters[i][7 * 2])/2]
+ ((i + 1)%2 * scalars[0])
+ (((i >> 1)^1) * scalars[1])
+ (cntl2[i * 8 + 7] & scalars[2])
+ (cntl3[i * 8 + 7] & scalars[3]);
}
}
#endif /*LV_HAVE_GENERIC*/
#endif /*INCLUDED_volk_16i_branch_4_state_8_a16_H*/
|
#ifndef PROFESSOR_H
#define PROFESSOR_H
// include(s) oder
#include "beschaeftigter.h"
#include "beschreibbar.h"
// weitere Angaben
using namespace std;
class Professor : public Beschaeftigter
{
private:
// Attribute
/** Der Fachbereich des Professors. */
string fachbereich;
/** Studiengan des Professors.*/
string studiengang;
/** Sprechstunde des Professors.*/
string sprechstunde;
public:
// Konstruktoren
Professor();
Professor(Beschaeftigter die_person, const string der_fachbereich, const string der_studiengang);
virtual ~Professor();
Professor(const Professor& original);
Professor & operator=(const Professor& ein_professor);
// Methoden
virtual void schreibe_informationen() const;
};
// eventuell Deklaration
// weiterer Funktionen
#endif /* PROFESSOR_H */
|
#import "CCUIControlCenterButton.h"
|
#ifndef ALIS_H
#define ALIS_H
#include <string>
using namespace std;
class Alis
{
protected:
int urunKodu;
int alisTarihi;
float alisFiyati;
int alisAdeti;
int alisKodu;
public:
Alis();
int getUrunKodu();
void setUrunKodu(int value);
int getAlisTarihi();
void setAlisTarihi(int value);
float getAlisFiyati();
void setAlisFiyati(float value);
int getAlisAdeti();
void setAlisAdeti(int value);
int getAlisKodu();
void setAlisKodu(int value);
};
#endif // ALIS_H
|
#ifndef _PDF_COMPILERCOMPAT_H
#define _PDF_COMPILERCOMPAT_H
//
// *** THIS HEADER IS INCLUDED BY PdfDefines.h ***
// *** DO NOT INCLUDE DIRECTLY ***
#ifndef _PDF_DEFINES_H_
#error Please include PdfDefines.h instead
#endif
#include "podofo_config.h"
// Silence some annoying warnings from Visual Studio
#ifdef _MSC_VER
#if _MSC_VER <= 1200 // Visual Studio 6
#pragma warning(disable: 4786)
#pragma warning(disable: 4251)
#elif _MSC_VER <= 1400 // Visual Studio 2005
#pragma warning(disable: 4251)
#pragma warning(disable: 4275)
#endif // _MSC_VER
#endif // _MSC_VER
// Make sure that DEBUG is defined
// for debug builds on Windows
// as Visual Studio defines only _DEBUG
#ifdef _DEBUG
#ifndef DEBUG
#define DEBUG 1
#endif // DEBUG
#endif // _DEBUG
#if defined(__BORLANDC__) || defined( __TURBOC__)
# include <stddef.h>
#else
# include <cstddef>
#endif
#if defined(TEST_BIG)
# define PODOFO_IS_BIG_ENDIAN
#else
# define PODOFO_IS_LITTLE_ENDIAN
#endif
#if PODOFO_HAVE_STDINT_H
#include <stdint.h>
#endif
#if PODOFO_HAVE_BASETSD_H
#include <BaseTsd.h>
#endif
#if PODOFO_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if PODOFO_HAVE_MEM_H
#include <mem.h>
#endif
#if PODOFO_HAVE_CTYPE_H
#include <ctype.h>
#endif
#if PODOFO_HAVE_STRINGS_H
#include <strings.h>
#endif
// alloca() is defined only in <cstdlib> on Mac OS X,
// only in <malloc.h> on win32, and in both on Linux.
#if defined(_WIN32)
#include <malloc.h>
#endif
// Disable usage of min() and max() macros
#if defined(_WIN32) && !defined(__MINGW32__)
#define NOMINMAX
#endif
// Integer types - fixed size types guaranteed to work anywhere
// because we detect the right underlying type name to use with
// CMake. Use typedefs rather than macros for saner error messages
// etc.
namespace PoDoFo {
typedef PDF_INT8_TYPENAME pdf_int8;
typedef PDF_INT16_TYPENAME pdf_int16;
typedef PDF_INT32_TYPENAME pdf_int32;
typedef PDF_INT64_TYPENAME pdf_int64;
typedef PDF_UINT8_TYPENAME pdf_uint8;
typedef PDF_UINT16_TYPENAME pdf_uint16;
typedef PDF_UINT32_TYPENAME pdf_uint32;
typedef PDF_UINT64_TYPENAME pdf_uint64;
};
#undef PDF_INT8_TYPENAME
#undef PDF_INT16_TYPENAME
#undef PDF_INT32_TYPENAME
#undef PDF_INT64_TYPENAME
#undef PDF_UINT8_TYPENAME
#undef PDF_UINT16_TYPENAME
#undef PDF_UINT32_TYPENAME
#undef PDF_UINT64_TYPENAME
/*
* Some elderly compilers, notably VC6, don't support LL literals.
* In those cases we can use the oversized literal without any suffix.
*/
#if defined(PODOFO_COMPILER_LACKS_LL_LITERALS)
# define PODOFO_LL_LITERAL(x) x
# define PODOFO_ULL_LITERAL(x) x
#else
# define PODOFO_LL_LITERAL(x) x##LL
# define PODOFO_ULL_LITERAL(x) x##ULL
#endif
// pdf_long is defined as ptrdiff_t . It's a pointer-sized signed quantity
// used throughout the code for a variety of purposes.
//
// pdf_long is DEPRECATED. Please use one of the explicitly sized types
// instead, or define a typedef that meaningfully describes what it's for.
// Good choices in many cases include size_t (string and buffer sizes) and
// ptrdiff_t (offsets and pointer arithmetic).
//
// pdf_long should not be used in new code.
//
namespace PoDoFo {
typedef ptrdiff_t pdf_long;
};
// Different compilers use different format specifiers for 64-bit integers
// (yay!). Use these macros with C's automatic string concatenation to handle
// that ghastly quirk.
//
// for example: printf("Value of signed 64-bit integer: %"PDF_FORMAT_INT64" (more blah)", 128LL)
//
#if defined(_MSC_VER)
# define PDF_FORMAT_INT64 "I64d"
# define PDF_FORMAT_UINT64 "I64u"
#else
# define PDF_FORMAT_INT64 "lld"
# define PDF_FORMAT_UINT64 "llu"
#endif
// Different compilers express __FUNC__ in different ways and with different
// capabilities. Try to find the best option.
//
// Note that __LINE__ and __FILE__ are *NOT* included.
// Further note that you can't use compile-time string concatenation on __FUNC__ and friends
// on many compilers as they're defined to behave as if they were a:
// static const char* __func__ = 'nameoffunction';
// just after the opening brace of each function.
//
#if (defined(_MSC_VER) && _MSC_VER <= 1200)
# define PODOFO__FUNCTION__ __FUNCTION__
#elif defined(__BORLANDC__) || defined(__TURBOC__)
# define PODOFO__FUNCTION__ __FUNC__
#elif defined(__GNUC__)
# define PODOFO__FUNCTION__ __PRETTY_FUNCTION__
#else
# define PODOFO__FUNCTION__ __FUNCTION__
#endif
/**
* \mainpage
*
* <b>PdfCompilerCompat.h</b> gathers up nastyness required for various
* compiler compatibility into a central place. All compiler-specific defines,
* wrappers, and the like should be included here and (if necessary) in
* PdfCompilerCompat.cpp if they must be visible to public users of the library.
*
* If the nasty platform and compiler specific hacks can be kept to PoDoFo's
* build and need not be visible to users of the library, put them in
* PdfCompilerCompatPrivate.{cpp,h} instead.
*
* Please NEVER use symbols from this header or the PoDoFo::compat namespace in
* a "using" directive. Always explicitly reference names so it's clear that
* you're pulling them from the compat cruft.
*/
#endif
|
/*
This source file is part of Rigs of Rods
Copyright 2005-2012 Pierre-Michel Ricordel
Copyright 2007-2012 Thomas Fischer
Copyright 2013-2017 Petr Ohlidal & contributors
For more information, see http://www.rigsofrods.org/
Rigs of Rods 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.
Rigs of Rods 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 Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "RoRPrerequisites.h"
#include "Terrn2Fileformat.h"
#include <OgreVector3.h>
#include <string>
class TerrainManager : public ZeroedMemoryAllocator
{
public:
TerrainManager();
~TerrainManager();
void setGravity(float value);
std::vector<authorinfo_t>& GetAuthors();
TerrainGeometryManager* getGeometryManager() { return m_geometry_manager; };
TerrainObjectManager* getObjectManager() { return m_object_manager; };
float getGravity() const { return m_cur_gravity; };
std::string getTerrainName() const { return m_def.name; };
std::string getGUID() const { return m_def.guid; };
int getCategoryID() const { return m_def.category_id; };
int getVersion() const { return m_def.version; };
int getFarClip() const { return m_sight_range; }
float getPagedDetailFactor() const { return m_paged_detail_factor; };
Ogre::Vector3 getMaxTerrainSize();
Collisions* getCollisions() { return m_collisions; };
IWater* getWater() { return m_water.get(); };
Ogre::Light* getMainLight() { return m_main_light; };
Ogre::Vector3 getSpawnPos() { return m_def.start_position; };
RoR::Terrn2Def& GetDef() { return m_def; }
HydraxWater* getHydraxManager() { return m_hydrax_water; }
SkyManager* getSkyManager();
SkyXManager* getSkyXManager() { return SkyX_manager; };
ShadowManager* getShadowManager() { return m_shadow_manager; };
void LoadTelepoints();
void LoadPredefinedActors();
bool HasPredefinedActors();
bool LoadAndPrepareTerrain(std::string terrn2_filename);
void HandleException(const char* summary);
float GetHeightAt(float x, float z);
Ogre::Vector3 GetNormalAt(float x, float y, float z);
static const int UNLIMITED_SIGHTRANGE = 4999;
private:
SkyXManager *SkyX_manager;
// internal methods
void initCamera();
void initTerrainCollisions();
void initDashboards();
void initFog();
void initLight();
void initMotionBlur();
void initObjects();
void initScripting();
void initShadows();
void initSkySubSystem();
void initSunburn();
void initVegetation();
void initWater();
void fixCompositorClearColor();
void loadTerrainObjects();
TerrainObjectManager* m_object_manager;
TerrainGeometryManager* m_geometry_manager;
std::unique_ptr<IWater> m_water;
Collisions* m_collisions;
Dashboard* m_dashboard;
HDRListener* m_hdr_listener;
ShadowManager* m_shadow_manager;
SkyManager* m_sky_manager;
HydraxWater* m_hydrax_water;
Ogre::Light* m_main_light;
RoR::Terrn2Def m_def;
float m_cur_gravity;
float m_paged_detail_factor;
int m_sight_range;
};
|
/* This file is part of Lyos.
Lyos 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.
Lyos 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 Lyos. If not, see <http://www.gnu.org/licenses/>. */
#include "type.h"
#include "stdio.h"
#include "unistd.h"
#include "const.h"
#include "protect.h"
#include "string.h"
#include "fs.h"
#include "proc.h"
#include "tty.h"
#include "console.h"
#include "global.h"
#include "proto.h"
/*****************************************************************************
* uname
*****************************************************************************/
/**
*
*
*
*****************************************************************************/
PUBLIC int uname(struct utsname * name)
{
MESSAGE msg;
struct utsname * buf;
msg.type = UNAME;
msg.BUF = buf;
send_recv(BOTH, TASK_SYS, &msg);
assert(msg.type == SYSCALL_RET);
name = msg.BUF;
return msg.RETVAL;
}
|
/*
Glaurung, a chess program for the Apple iPhone.
Copyright (C) 2004-2010 Tord Romstad, Marco Costalba, Joona Kiiski.
Glaurung 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.
Glaurung 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/>.
*/
#import <UIKit/UIKit.h>
@interface AboutController : UIViewController {
}
@end
|
#pragma once
#include "FileScanner.h"
class CRecycleBinFScanner : public CCleanScanner
{
protected:
static const scanner_id m_nScannerId = RECYCLEBIN_SCANNER_ID;
virtual void algorithm( void );
void ( CRecycleBinFScanner::*m_pfnAlgoSelector )( void );
// algorithm implementation in essence
void algoStep1( void );
protected:
virtual void ReinitAlgorithm( void );
public:
explicit CRecycleBinFScanner( CCleanEngine * pEngine, INotifier * pNotifier = NULL, IScanProfiler * pProfiler = NULL );
virtual ~CRecycleBinFScanner( void );
virtual scanner_id ScannerId( void ) const { return m_nScannerId; }
virtual void CleanupObject( countable< IReportItem > item );
};
|
#ifndef GAMEMENU_H
#define GAMEMENU_H
#include <OGRE/OgreSingleton.h>
#include "OGRE/OgreStringVector.h"
using namespace Ogre;
namespace Ogre {
class OverlayManager;
class Overlay;
class OverlyContainer;
class OverlayElement;
class TextAreaOverlayElement;
}
class GameMenu : public Ogre::Singleton<GameMenu>
{
public:
GameMenu();
~GameMenu();
enum MenuMode{Gameplay,Opening,Main,Load,Save,Settings};
Ogre::OverlayManager* overlayMgr;
Ogre::Overlay* menuOverlay;
Ogre::Overlay* backgroundOverlay;
Ogre::Overlay* mouseOverlay;
Ogre::Overlay* blackoutOverlay;
Ogre::OverlayContainer* blackout;
Ogre::OverlayContainer* mouseContainer;
Ogre::OverlayElement* mousePanel;
static GameMenu& getSingleton(void);
static GameMenu* getSingletonPtr(void);
void mouseMoved(float x, float y);
void mousePressed();
int getMenuState();
void openMainMenu();
void openSettingsMenu();
void startNewGame();
void continueGameM();
private:
void loadGame();
void saveGame();
void quitGame();
void changeFullScreen();
void changeFSAA();
void changeResolution();
void applySettings();
bool fullscreen;
int fsaa;
int resolution;
StringVector foundRenderDevices;
StringVector foundResolutions;
float mouseX, mouseY;
void getCurrentSettings();
int idCounter;
OverlayElement* getElement(std::string elementName);
OverlayContainer* getContainer(std::string containerName);
void hilightElement(std::string elementName);
void unhilightElement(std::string elementName);
bool insideElement(std::string elementName);
void addButton(std::string buttonName,std::string parentName,int order,std::string caption);
void addTextElement(std::string elementName,std::string parentName,int order,std::string caption);
void addGUIElement(std::string elementName,std::string parentName,int order);
void addMenu(std::string menuName);
MenuMode mode;
void setupMouse();
void setupOpeningMenu();
void setupMainMenu();
void setupLoadMenu();
void setupSaveMenu();
void setupSettingsMenu();
};
#endif // GAMEMENU_H
|
/* Constants and
Copyright (C) 1997-2015 Marco Pedicini
This file is part of PELCR.
PELCR 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.
PELCR 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 PELCR. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/times.h>
#include <time.h>
#include <pthread.h>
#include <mpi.h>
#include "mydefs.h"
#include "symbolic.h"
#include "graph.h"
#include "combustion.h"
//#include "y.tab.h"
#include "io.h"
#include "dvm.h"
#include "distribution.h"
#include "lambdastar.h"
#include "buildgraph.h"
/* HashTable*BookTable[MAXNPROCESS]; */
#ifndef var_h
#define var_h
/* ANTO */
/* pointer to xfunction from dynamically loaded library */
void *handle;
/* path of dynamically loaded library */
char Path[MAXNAMELEN];
const char *error;
/* ANTO */
long maxloop,maxfires,maxbips;
long timestamp,outtimestamp;
long aggregation_cumulate, num_receives;
long global_physical_msgs;
int lightprocess ;
int schedule ;
int pflag ;
int traceflag, inflag, outflag,verflag;
long maxloo,maxfir,bip,bip2,bip3,bip4,fam_counter;
int locf_counter;
long fires,loops,prnsteps,ones;
int unaddtest,uneottest;
int laddtest,leottest;
long idle,lidle,lbip2;
int temp,nhot,ncold,scount;
long francesco,lastloop;
int npozzi=0 ;
int fra_hot;
struct tms smtime;
FILE*readfile,*writefile,*firfile,*tempfile,*coldfile,*anamfile;
FILE*mawfile[MAXNPROCESS],*maxwinfile[MAXNPROCESS];
FILE*trivfile,*hotfile,*nofile,*logfile;
char infile[MAXNAMELEN],outfile[MAXNAMELEN],directoryname[MAXNAMELEN];
char rline[MAXLENWEIGHT];
node*environment;
int comm,rank,size,ierr;
int TempProcess[MAXNPROCESS],TableProcess[MAXNPROCESS],number_of_processes;
int OutCounter[MAXNPROCESS],InCounter[MAXNPROCESS];
int combusted;
int ending,end_computation,check_passed;
MPI_Status status;
MPI_Request data_request,add_request,create_request,eot_request,die_request,request;
MPI_Request send_add_request,send_eot_request[MAXNPROCESS],send_die_request;
int dataflag,saddflag,addflag,createflag,eotflag,dieflag,flag,h;
int sebuf[MAXLENWEIGHT];
int sbuf[MAXLENWEIGHT];
long sbuflong[10];
//int reotbuf[10],raddbuf[MAXLENWEIGHT+7*sizeof(long)],rcreatebuf[10],rdiebuf[10];
int reotbuf[10],raddbuf[MAXLENWEIGHT],rcreatebuf[10],rdiebuf[10];
/*struct mbuffer incoming;*/
struct mbuffer incoming[MINPRIORITY]; /* array of buffers of incoming messages */
int maxubound;
int local_pending;
int edges_counter;
/*outgoing,*outbuffer= &outgoing;*/
int newval;
/********** Carlo *******************************************/
char buf[MAXNPROCESS][sizeof(long) + (1+MAXAWIN)*sizeof(struct messaggio)];
char rbuf[sizeof(int) + (1+MAXAWIN)*sizeof(struct messaggio)];
char sendbuffer[150*(sizeof(int) + (1+MAXAWIN)*sizeof(struct messaggio))];
/************************************************************/
int OutTerminationStatus[MAXNPROCESS][MAXNPROCESS];
int InTerminationStatus[MAXNPROCESS][MAXNPROCESS];
int outcontrol[MAXNPROCESS];
int tickcontrol[MAXNPROCESS];
struct messaggio msg;
float last_rate[MAXNPROCESS];
float current_rate;
graph G;
/******************* Carlo ***********************************/
int nrFisicMsg[MAXNPROCESS];
int nrApplMsg[MAXNPROCESS];
float aggregationRatio[MAXNPROCESS];
int aggregationWindow[MAXNPROCESS];
int maxTick[MAXNPROCESS];
time_t oss1, oss2;/* ,t;*/
long nTickSend; /* Quante volte spedisco allo scadere del tick */
long nFullSend; /* Quante volte spedisco perche il messaggio fisico e' pieno */
time_t inittime,finaltime,tim;
/****************************************************/
/* per i thread */
pthread_mutex_t mutex;
/****************************************************/
/********************************* Marco 06032001 ***********************/
/**** integro l'ampiezza della finestra di timeout **********************/
long cumulate_timeout[MAXNPROCESS];
long physical_msgs[MAXNPROCESS];
long applicative_msgs[MAXNPROCESS];
/***********************************************************************/
/* per lo scheduler */
int contatore_combustioni_f;
HashTable*BookTable[MAXNPROCESS];
struct messaggio pozzi[MAXCUTNODES]; /*maximal number of cut-nodes in the parsed input*/
int lift;
int varname;
symTbl *symbolTable;
int kindex;
int findex;
int fcounter;
node*principal ;
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "var_management.h"
int new3DBoolean(VariableObject *anker, char *group, char *name, int x_length, int y_length, int z_length)
{
VariableObject *target = NULL;
if((target = addNewVariable(anker, group, name, THREEDBOOL)) == NULL)
return(-1);
target->size = ((sizeof(bool)*x_length)*y_length)*z_length;
target->array_length[0] = x_length;
target->array_length[1] = y_length;
target->array_length[2] = z_length;
if((target->data = malloc(target->size)) == NULL)
{
rh4n_errno = MEMORY_ERROR;
return(-1);
}
memset(target->data, 0x00, target->size);
return(0);
}
int set3DBooleanXYZ(VariableObject *anker, char *group, char *name, int x, int y, int z, bool val)
{
VariableObject *target = NULL;
if((target = getVariable(anker, group, name)) == NULL)
return(-1);
if(target->type != THREEDBOOL)
{
rh4n_errno = WRONG_VAR_TYPE;
return(-1);
}
*((bool*)(target->data+OFFSET_3DBoolean(target->array_length[0],
target->array_length[1], target->array_length[2], x, y, z))) = val;
return(0);
}
bool get3DBooleanXYZ(VariableObject *anker, char *group, char *name, int x, int y, int z)
{
VariableObject *target = NULL;
if((target = getVariable(anker, group, name)) == NULL)
return(0);
return(*((bool*)(target->data+OFFSET_3DBoolean(target->array_length[0],
target->array_length[1], target->array_length[2], x, y, z))));
}
int print3DBoolean(VariableObject *target, FILE *output, int mode)
{
int offset = 0, i = 0, x = 0, z = 0;
if(mode == PRINT_MODE_FORMAT)
fprintf(output, "[%s] = ", target->name);
else if(mode == PRINT_MODE_JSON)
fprintf(output, "\"%s\": ", target->name);
fprintf(output, "[");
for(; i < target->array_length[0]; i++)
{
fprintf(output, "[");
for(x=0; x < target->array_length[1]; x++)
{
fprintf(output, "[");
for(z=0; z < target->array_length[2]; z++)
{
offset = OFFSET_3DBoolean(target->array_length[0],
target->array_length[1], target->array_length[2], i, x, z);
fprintf(output, "%s",
(*((bool*)(target->data+offset)) == true) ? "true" : "false" );
if(z+1 < target->array_length[2])
fprintf(output, ", ");
}
fprintf(output, "]");
if(x+1 < target->array_length[1])
fprintf(output, ", ");
}
fprintf(output, "]");
if(i+1 < target->array_length[0])
fprintf(output, ", ");
}
fprintf(output, "]");
return(0);
}
|
#include <CoOS.h> /*!< CoOS header file */
#include <stdio.h>
#include "stm32f4xx_conf.h"
#include "LCD.h"
#include "LedTask.h"
#include "BSP.h"
#include "LCD/LCDUtils.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[3];
atomic_int atom_0_r1_1;
atomic_int atom_1_r1_1;
void *t0(void *arg){
label_1:;
int v2_r1 = atomic_load_explicit(&vars[0], memory_order_seq_cst);
int v3_r3 = v2_r1 ^ v2_r1;
int v4_r3 = v3_r3 + 1;
atomic_store_explicit(&vars[1], v4_r3, memory_order_seq_cst);
int v21 = (v2_r1 == 1);
atomic_store_explicit(&atom_0_r1_1, v21, memory_order_seq_cst);
return NULL;
}
void *t1(void *arg){
label_2:;
int v6_r1 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v8_r3 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
atomic_store_explicit(&vars[1], 2, memory_order_seq_cst);
int v10_r5 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v12_r6 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v13_r7 = v12_r6 ^ v12_r6;
int v14_r7 = v13_r7 + 1;
atomic_store_explicit(&vars[2], v14_r7, memory_order_seq_cst);
atomic_store_explicit(&vars[0], 1, memory_order_seq_cst);
int v22 = (v6_r1 == 1);
atomic_store_explicit(&atom_1_r1_1, v22, memory_order_seq_cst);
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
atomic_init(&vars[0], 0);
atomic_init(&vars[1], 0);
atomic_init(&vars[2], 0);
atomic_init(&atom_0_r1_1, 0);
atomic_init(&atom_1_r1_1, 0);
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
int v15 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v16 = (v15 == 2);
int v17 = atomic_load_explicit(&atom_0_r1_1, memory_order_seq_cst);
int v18 = atomic_load_explicit(&atom_1_r1_1, memory_order_seq_cst);
int v19_conj = v17 & v18;
int v20_conj = v16 & v19_conj;
if (v20_conj == 1) assert(0);
return 0;
}
|
/**
* @file traduir.c
* @brief Prova que realitza la tradució de bloc lógic a bloc físic mitjançant inodes
* @date 09/11/2010
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "../include/bloques.h"
#include "../include/definicions.h"
#include "../include/ficheros.h"
int main(int argc, char *argv[])
{
uint bfisic = 0;
if (argc != 3) {
printf("[traduir.c] ERROR: Arguments incorrectes. Ex: ./traduir disco.imagen <num_bloc>\n");
exit(-1);
}
// montam es FS
if (bmount(argv[1]) == -1) {
return -1;
}
// proves
int r;
r = reservarInode(2, 7); // reservam de tipus 'dir' i amb permis d'escriptura
if (r == -1) {
printf("[traduir.c] ERROR: falla reservarInode()\n");
bumount();
return -1;
}
printf("[traduir.c] INFO: Inode reservat: %d\n", r);
if (traduirBlocInode(r, atoi(argv[2]), &bfisic, 1) == -1) {
printf("[traduir.c] ERROR: falla traduir_bloc_inode\n");
bumount();
return -1;
}
printf("[traduir.c] INFO: bloc fisic = %d\n", bfisic);
if (alliberarInode(r) == -1) {
printf("[traduir.c] ERROR: falla alliberarInode()\n");
bumount();
return -1;
}
// desmontam es FS
if (bumount() == -1) {
return -1;
}
return 0;
}
|
/*
* cnot.h
*/
#ifndef __QUANTUM_CNOT
#define __QUANTUM_CNOT
#include "matrix.h"
namespace Quantum {
class CNot : public Matrix {
public:
CNot();
};
}
#endif
|
/* -*- C -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008 Voltaire. All rights reserved
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef ORTE_MCA_RANK_FILE_RANKFILE_LEX_H_
#define ORTE_MCA_RANK_FILE_RANKFILE_LEX_H_
#include "orte_config.h"
#ifdef malloc
#undef malloc
#endif
#ifdef realloc
#undef realloc
#endif
#ifdef free
#undef free
#endif
#include <stdio.h>
BEGIN_C_DECLS
typedef union {
int ival;
char* sval;
} orte_rmaps_rank_file_value_t;
extern int orte_rmaps_rank_file_lex(void);
extern FILE *orte_rmaps_rank_file_in;
extern int orte_rmaps_rank_file_line;
extern bool orte_rmaps_rank_file_done;
extern orte_rmaps_rank_file_value_t orte_rmaps_rank_file_value;
int orte_rmaps_rank_file_wrap(void);
/*
* Make lex-generated files not issue compiler warnings
*/
#define YY_STACK_USED 0
#define YY_ALWAYS_INTERACTIVE 0
#define YY_NEVER_INTERACTIVE 0
#define YY_MAIN 0
#define YY_NO_UNPUT 1
#define YY_SKIP_YYWRAP 1
#define ORTE_RANKFILE_DONE 0
#define ORTE_RANKFILE_ERROR 1
#define ORTE_RANKFILE_QUOTED_STRING 2
#define ORTE_RANKFILE_EQUAL 3
#define ORTE_RANKFILE_INT 4
#define ORTE_RANKFILE_STRING 5
#define ORTE_RANKFILE_RANK 6
#define ORTE_RANKFILE_USERNAME 10
#define ORTE_RANKFILE_IPV4 11
#define ORTE_RANKFILE_HOSTNAME 12
#define ORTE_RANKFILE_NEWLINE 13
#define ORTE_RANKFILE_IPV6 14
#define ORTE_RANKFILE_SLOT 15
#define ORTE_RANKFILE_RELATIVE 16
END_C_DECLS
#endif
|
//
// Wire
// Copyright (C) 2016 Wire Swiss GmbH
//
// 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/.
//
#import "MessagingTest.h"
extern NSString * const EventConversationAdd;
extern NSString * const EventConversationAddClientMessage;
extern NSString * const EventConversationAddOTRMessage;
extern NSString * const EventConversationAddAsset;
extern NSString * const EventConversationAddOTRAsset;
extern NSString * const EventConversationKnock;
extern NSString * const EventConversationHotKnock;
extern NSString * const IsExpiredKey;
extern NSString * const EventConversationTyping;
extern NSString * const EventConversationMemberJoin;
extern NSString * const EventConversationMemberLeave;
extern NSString * const EventConversationRename;
extern NSString * const EventConversationCreate;
extern NSString * const EventConversationDelete;
extern NSString * const EventUserConnection;
extern NSString * const EventConversationConnectionRequest;
extern NSString * const EventNewConnection;
@interface MessagingTest (EventFactory)
- (ZMUpdateEvent *)eventWithPayload:(NSDictionary *)data inConversation:(ZMConversation *)conversation type:(NSString *)type;
- (NSMutableDictionary *)payloadForMessageInConversation:(ZMConversation *)conversation
sender:(ZMUser *)sender
type:(NSString *)type
data:(NSDictionary *)data;
- (NSMutableDictionary *)payloadForMessageInConversation:(ZMConversation *)conversation type:(NSString *)type data:(id)data;
- (NSMutableDictionary *)payloadForMessageInConversation:(ZMConversation *)conversation type:(NSString *)type data:(id)data time:(NSDate *)date;
- (NSMutableDictionary *)payloadForMessageInConversation:(ZMConversation *)conversation type:(NSString *)type data:(id)data time:(NSDate *)date fromUser:(ZMUser *)fromUser;
@end
|
/*
* This file is part of MultiROM.
*
* MultiROM 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.
*
* MultiROM 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 MultiROM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VERSION_H
#define VERSION_H
#define VERSION_MULTIROM 33
#define VERSION_TRAMPOLINE 27
#define VERSION_APKL 3
// For device-specific fixes. Use letters, the version will then be like "12a"
#define VERSION_DEV_FIX ""
#endif
|
/*
# PostgreSQL Database Modeler (pgModeler)
#
# Copyright 2006-2021 - Raphael Araújo e Silva <raphael@pgmodeler.io>
#
# 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 version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# The complete text of GPLv3 is at LICENSE file on source code root directory.
# Also, you can get the complete GNU General Public License at <http://www.gnu.org/licenses/>
*/
/**
\ingroup libgui
\class GenericSQLWidget
\brief Implements the operations to create/edit generic sql objects via form.
*/
#ifndef GENERIC_SQL_WIDGET_H
#define GENERIC_SQL_WIDGET_H
#include "ui_genericsqlwidget.h"
#include "baseobjectwidget.h"
#include "codecompletionwidget.h"
#include "widgets/objectstablewidget.h"
#include "widgets/objectselectorwidget.h"
class GenericSQLWidget: public BaseObjectWidget, public Ui::GenericSQLWidget {
private:
Q_OBJECT
NumberedTextEditor *definition_txt, *preview_txt;
SyntaxHighlighter *definition_hl, *preview_hl;
CodeCompletionWidget *definition_cp;
ObjectsTableWidget *objects_refs_tab;
ObjectSelectorWidget *object_sel;
/*! \brief This dummy object is used to generated the code preview while the user changes the fields
* in form. Once the dummy is configure it is copied to the real object being handled by the form (this->object) */
GenericSQL dummy_gsql;
//! \brief A regular expression used to remove attribute/reference delimiters {} from the names of configured references
static const QRegExp AttrDelimRegexp;
void showObjectReferenceData(int row, BaseObject *object, const QString &ref_name, bool use_signature, bool format_name);
public:
GenericSQLWidget(QWidget * parent = nullptr);
void setAttributes(DatabaseModel *model, OperationList *op_list, GenericSQL *genericsql=nullptr);
public slots:
void applyConfiguration();
private slots:
void updateCodePreview();
void addObjectReference(int row);
void editObjectReference(int row);
void updateObjectReference(int row);
void clearObjectReferenceForm();
};
#endif
|
#ifndef EarlyBurstRatesFunction_H
#define EarlyBurstRatesFunction_H
#include "RbVector.h"
#include "TypedFunction.h"
namespace RevBayesCore {
class DagNode;
class Tree;
template <class valueType> class TypedDagNode;
class EarlyBurstRatesFunction : public TypedFunction< RbVector<double> > {
public:
EarlyBurstRatesFunction(const TypedDagNode<Tree> *t, const TypedDagNode<double> *s, const TypedDagNode<double> *l);
virtual ~EarlyBurstRatesFunction(void); //!< Virtual destructor
// public member functions
EarlyBurstRatesFunction* clone(void) const; //!< Create an independent clone
void update(void);
protected:
void swapParameterInternal(const DagNode *oldP, const DagNode *newP); //!< Implementation of swaping parameters
private:
// members
const TypedDagNode<Tree>* tau;
const TypedDagNode<double>* sigma;
const TypedDagNode<double>* lambda;
};
}
#endif
|
#pragma once
template <typename T>
T Plus(const T& a, const T& b)
{
return (T)(a + b);
}
|
//
// Created by Nathan Bollom on 14/06/2017.
//
#ifndef STARTRADER_WORLD_H
#define STARTRADER_WORLD_H
#include <vector>
#include "sector.h"
class World {
private:
std::vector<Sector*> _sectors;
};
#endif //STARTRADER_WORLD_H
|
/*
Copyright (C) 2016 Krowten11
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 IP_RANGE_H
#define IP_RANGE_H
#include <string>
#include <utility>
#include <vector>
#include <sstream>
#include <boost/lexical_cast.hpp>
class IpRange {
public:
IpRange();
IpRange(std::string ip){setIpRange(ip);};
void setIpRange(std::string ip);
std::string getCurrentIp();
void update() {updateFirst();}
bool maxReached() const {return max_reached;}
private:
struct Range {
unsigned int min = 0;
unsigned int max = 255;
unsigned int current = min;
bool isNotRange = false;
};
bool max_reached = false;
std::vector<Range> ranges;
void updateFirst();
void updateSecond();
void updateThird();
void updateFourth();
};
#endif
|
#ifndef STORM_LOGIC_LONGRUNAVERAGEOPERATORFORMULA_H_
#define STORM_LOGIC_LONGRUNAVERAGEOPERATORFORMULA_H_
#include "storm/logic/OperatorFormula.h"
namespace storm {
namespace logic {
class LongRunAverageOperatorFormula : public OperatorFormula {
public:
LongRunAverageOperatorFormula(std::shared_ptr<Formula const> const& subformula, OperatorInformation const& operatorInformation = OperatorInformation());
virtual ~LongRunAverageOperatorFormula() {
// Intentionally left empty.
}
virtual bool isLongRunAverageOperatorFormula() const override;
virtual boost::any accept(FormulaVisitor const& visitor, boost::any const& data) const override;
virtual std::ostream& writeToStream(std::ostream& out) const override;
};
}
}
#endif /* STORM_LOGIC_LONGRUNAVERAGEOPERATORFORMULA_H_ */
|
/* This library for Digital Light sensor BH1750FVI
use I2C Communication protocal , SDA,SCL Are required
to interface with this sensor
pin configuration :
VCC >>> 3.3V
SDA >>> A4
SCL >>> A5
ADDR >> A3 "Optional"
GND >>> gnd
written By : Mohannad Rawashdeh
www.genotronex.com
*/
#ifndef BH1750FVI_h
#define BH1750FVI_h
#include "Arduino.h"
#include "Wire.h"
#define Device_Address_L 0x23 // Device address when address pin LOW
#define Device_Address_H 0x5C // Device address when address pin LOW
//all command here taken from Data sheet OPECODE Table page 5
#define Power_Down 0x00
#define Power_On 0x01
#define RESET 0x07
#define Continuous_H_resolution_Mode 0x10
#define Continuous_H_resolution_Mode2 0x11
#define Continuous_L_resolution_Mode 0x13
#define OneTime_H_resolution_Mode 0x20
#define OneTime_H_resolution_Mode2 0x21
#define OneTime_L_resolution_Mode 0x23//As well as address value
#define AddrPin 17 // Address pin enable
class BH1750FVI {
public:
BH1750FVI();
void begin(void);
void Sleep(void);
void SetMode(uint8_t MODE);
void Reset(void);
void SetAddress(uint8_t add);
uint16_t GetLightIntensity(void);
private:
void I2CWriteTo(uint8_t DataToSend);
byte address_value;
boolean state;
};
#endif
|
/*
* This file is part of Manjaro Settings Manager.
*
* Ramon Buldó <ramon@manjaro.org>
*
* Manjaro Settings Manager 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.
*
* Manjaro Settings Manager 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 Manjaro Settings Manager. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOCALECOMMON_H
#define LOCALECOMMON_H
#include <QtCore/QString>
#include <QtCore/QObject>
class LocaleCommon : public QObject
{
Q_OBJECT
public:
static QString getDescription();
static QString getName();
static QString getTitle();
};
#endif // LOCALECOMMON_H
|
/*-----------------------------------------------------------------------*\
| ___ ____ __ __ ___ _ _______ |
| / _ \ _ __ ___ _ __ / ___|| \/ |/ _ \| |/ / ____| _ _ |
| | | | | '_ \ / _ \ '_ \\___ \| |\/| | | | | ' /| _| _| |_ _| |_ |
| | |_| | |_) | __/ | | |___) | | | | |_| | . \| |__|_ _|_ _| |
| \___/| .__/ \___|_| |_|____/|_| |_|\___/|_|\_\_____||_| |_| |
| |_| |
| |
| Author: Alberto Cuoci <alberto.cuoci@polimi.it> |
| CRECK Modeling Group <http://creckmodeling.chem.polimi.it> |
| Department of Chemistry, Materials and Chemical Engineering |
| Politecnico di Milano |
| P.zza Leonardo da Vinci 32, 20133 Milano |
| |
|-------------------------------------------------------------------------|
| |
| This file is part of OpenSMOKE++ Suite. |
| |
| Copyright(C) 2015, 2014, 2013 Alberto Cuoci |
| Source-code or binary products cannot be resold or distributed |
| Non-commercial use only |
| Cannot modify source-code for any purpose (cannot create |
| derivative works) |
| |
\*-----------------------------------------------------------------------*/
#ifndef OpenSMOKE_Solve_Sparse_OpenSMOKEppNls_H
#define OpenSMOKE_Solve_Sparse_OpenSMOKEppNls_H
#include "math/native-nls-solvers/NonLinearSystemSolver"
namespace NlsSMOKE
{
template<typename Object, typename System>
int Solve_Sparse_OpenSMOKEppNls(Object* object, const NlsSMOKE::NonLinearSolver_Parameters& parameters)
{
std::cout << "Sparse NLS solution (OpenSMOKE++)..." << std::endl;
const unsigned int neq = object->NumberOfEquations();
// Initial conditions
Eigen::VectorXd yInitial(neq);
object->UnknownsVector(yInitial.data());
// Recognize the sparsity pattern
std::vector<unsigned int> rows;
std::vector<unsigned int> cols;
object->SparsityPattern(rows, cols);
// Define the solver
typedef NlsSMOKE::KernelSparse<System> kernel;
NlsSMOKE::NonLinearSolver<kernel> nls_solver;
// Set initial conditions
nls_solver.assign(object);
nls_solver.SetSparsityPattern(rows, cols, false);
nls_solver.SetLinearAlgebraSolver(parameters.jacobian_solver());
nls_solver.SetPreconditioner(parameters.preconditioner());
nls_solver.SetFirstGuessSolution(yInitial);
// Minimum Constraints
if (parameters.minimum_constraints() == true)
{
Eigen::VectorXd xMin(neq);
object->MinimumUnknownsVector(xMin.data());
nls_solver.SetMinimumValues(xMin);
}
// Maximum constraints
if (parameters.maximum_constraints() == true)
{
Eigen::VectorXd xMax(neq);
object->MaximumUnknownsVector(xMax.data());
nls_solver.SetMaximumValues(xMax);
}
// Maximum number of iterations
if (parameters.maximum_number_iterations() > 0.)
nls_solver.SetMaximumNumberOfIterations(parameters.maximum_number_iterations());
// Relative tolerance
if (parameters.tolerance_relative() > 0.)
nls_solver.SetRelativeTolerances(parameters.tolerance_relative());
// Absolute tolerance
if (parameters.tolerance_absolute() > 0.)
nls_solver.SetAbsoluteTolerances(parameters.tolerance_absolute());
// Verbose
if (parameters.verbosity_level() > 0)
nls_solver.SetPrint(true);
else
nls_solver.SetPrint(false);
// Scaling factors (ONE means no scaling)
if (parameters.scaling_policy() != 0)
{
Eigen::VectorXd w(neq);
for (unsigned int i = 0; i < neq; i++)
w(i) = 1. / std::max(1.e-2, yInitial(i));
nls_solver.SetWeights(w);
}
// Solve the non linear system
double timeStart = OpenSMOKE::OpenSMOKEGetCpuTime();
const int status = nls_solver();
double timeEnd = OpenSMOKE::OpenSMOKEGetCpuTime();
// Analyze the solution
if (status >= 0)
{
std::string message("Nls System successfully solved: ");
if (status == 0) message += "Start conditions";
else if (status == 1) message += "The maximum number of functions calls has been performed";
else if (status == 2) message += "The Newton correction has reached the required precision";
else if (status == 3) message += "The Quasi Newton correction has reached the required precision";
else if (status == 4) message += "The Gradient has reached the required precision";
else if (status == 5) message += "The Objective function phiNew has reached the required precision";
else if (status == 6) message += "The Objective function phiW has reached the required precision";
else if (status == 7) message += "The Objective function phiNew has reached the required precision but solution is dubious";
else if (status == 8) message += "Reached the assigned max value for Newton calls";
std::cout << message << std::endl;
Eigen::VectorXd y(neq), f(neq);
nls_solver.Solution(y, f);
//if (parameters.verbosity_level() > 0)
nls_solver.NlsSummary(std::cout);
object->CorrectedUnknownsVector(y.data());
}
else
{
std::string message("Nls Solver Error: ");
if (status == -1) message += "It has been impossible to reach the solution";
else if (status == -2) message += "The search has been stopped";
else if (status == -3) message += "The object is not initialized";
else if (status == -4) message += "It has been impossible to reach the solution in Restart";
std::cout << message << std::endl;
object->CorrectedUnknownsVector(yInitial.data());
}
return status;
}
}
#endif // OpenSMOKE_Solve_Sparse_OpenSMOKEppNls_H
|
/*
FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS 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. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 48000000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 20480 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 0
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */
|
/*
* sfall
* Copyright (C) 2008-2021 The sfall team
*
*/
#pragma once
namespace HRP
{
class CreditsScreen {
public:
static void init();
};
}
|
#pragma once
#define sTypeDomoticzSecurity 0x83
#define sTypeRAINWU 0x70 //Weather Underground (Total rain reported, no counter)
#define sTypeTHBFloat 0x10 //Weather Station
#define sTypeWINDNoTemp 0x30 //Weather Station
#define wsbaroforcast_heavy_snow 0x01
#define wsbaroforcast_snow 0x01
#define wsbaroforcast_heavy_rain 0x02
#define wsbaroforcast_rain 0x03
#define wsbaroforcast_cloudy 0x04
#define wsbaroforcast_some_clouds 0x05
#define wsbaroforcast_sunny 0x06
#define pTypeLimitlessLights 0xF1
#define sTypeLimitlessRGBW 0x01
#define sTypeLimitlessRGB 0x02
#define sTypeLimitlessWhite 0x03
#define pTypeThermostat 0xF2
#define sTypeThermSetpoint 0x01
#define sTypeThermTemperature 0x02
#define pTypeGeneral 0xF3
#define sTypeVisibility 0x01
#define sTypeSolarRadiation 0x02
#define sTypeSoilMoisture 0x03
#define sTypeLeafWetness 0x04
#define sTypeSystemTemp 0x05
#define sTypePercentage 0x06
#define sTypeSystemFan 0x07
#define sTypeVoltage 0x08
#define pTypeLux 0xF6
#define sTypeLux 0x01
#define pTypeTEMP_BARO 0xF7
#define sTypeBMP085 0x01
#define pTypeUsage 0xF8
#define sTypeElectric 0x01
#define pTypeAirQuality 0xF9
#define sTypeVoltcraft 0x01
#define pTypeP1Power 0xFA
#define sTypeP1Power 0x01
#define mModeP1Norm 0x00
#define mModeP1Double 0x01
#define pTypeP1Gas 0xFB
#define sTypeP1Gas 0x02
#define pTypeYouLess 0xFC
#define sTypeYouLess 0x01
#define pTypeRego6XXTemp 0xFD
#define sTypeRego6XXTemp 0x01
#define pTypeRego6XXValue 0xFE
#define sTypeRego6XXStatus 0x02
#define sTypeRego6XXCounter 0x03
//Z-Wave
//#define pTypeENERGY 0x5A
#define sTypeZWaveUsage 0xA0
typedef struct _tThermostat {
unsigned char len;
unsigned char type;
unsigned char subtype;
BYTE id1;
BYTE id2;
BYTE id3;
BYTE id4;
unsigned char dunit;
unsigned char battery_level;
float temp;
float temp1;
float temp2;
float temp3;
unsigned char utemp1;
unsigned char utemp2;
unsigned char utemp3;
_tThermostat()
{
len=sizeof(_tThermostat)-1;
type=pTypeThermostat;
subtype=sTypeThermTemperature;
battery_level=255;
id1=1;
id2=0;
id3=0;
id4=0;
}
} tThermostat;
typedef struct _tTempBaro {
unsigned char len;
unsigned char type;
unsigned char subtype;
BYTE id1;
float temp;
float baro;
float altitude;
unsigned char forecast;
_tTempBaro()
{
len=sizeof(_tTempBaro)-1;
type=pTypeTEMP_BARO;
subtype=sTypeBMP085;
id1=1;
}
} _tTempBaro;
typedef struct _tAirQualityMeter {
unsigned char len;
unsigned char type;
unsigned char subtype;
BYTE id1;
int airquality;
_tAirQualityMeter()
{
len=sizeof(_tAirQualityMeter)-1;
type=pTypeAirQuality;
subtype=sTypeVoltcraft;
id1=0;
}
} AirQualityMeter;
typedef struct _tUsageMeter {
unsigned char len;
unsigned char type;
unsigned char subtype;
BYTE id1;
BYTE id2;
BYTE id3;
BYTE id4;
unsigned char dunit;
float fusage;
_tUsageMeter()
{
len=sizeof(_tUsageMeter)-1;
type=pTypeUsage;
subtype=sTypeElectric;
id1=0;
id2=0;
id3=0;
id4=0;
}
} UsageMeter;
typedef struct _tLightMeter {
unsigned char len;
unsigned char type;
unsigned char subtype;
BYTE id1;
BYTE id2;
BYTE id3;
BYTE id4;
unsigned char dunit;
unsigned char battery_level;
float fLux;
_tLightMeter()
{
len=sizeof(_tLightMeter)-1;
type=pTypeLux;
subtype=sTypeLux;
id1=0;
id2=0;
id3=0;
id4=0;
battery_level=255;
}
} LightMeter;
typedef struct _tGeneralDevice {
unsigned char len;
unsigned char type;
unsigned char subtype;
unsigned char id;
float floatval1;
float floatval2;
int intval1;
int intval2;
_tGeneralDevice()
{
len=sizeof(_tGeneralDevice)-1;
type=pTypeGeneral;
subtype=sTypeVisibility;
id=0;
}
} GeneralDevice;
typedef struct _tLimitlessLights {
unsigned char len;
unsigned char type;
unsigned char subtype;
unsigned char dunit; //0=All, 1=Group1,2=Group2,3=Group3,4=Group4
unsigned char command;
unsigned char value;
_tLimitlessLights()
{
len=sizeof(_tLimitlessLights)-1;
type=pTypeLimitlessLights;
subtype=sTypeLimitlessRGBW;
}
} _tLimitlessLights;
#define Limitless_LedOff 0
#define Limitless_LedOn 1
#define Limitless_LedNight 2
#define Limitless_LedFull 3
#define Limitless_BrightnessUp 4
#define Limitless_BrightnessDown 5
#define Limitless_ColorTempUp 6
#define Limitless_ColorTempDown 7
#define Limitless_RGBDiscoNext 8
#define Limitless_RGBDiscoLast 9
#define Limitless_SetRGBColour 10
#define Limitless_DiscoSpeedSlower 11
#define Limitless_DiscoSpeedFaster 12
#define Limitless_DiscoMode 13
#define Limitless_SetColorToWhite 14
#define Limitless_SetBrightnessLevel 15
|
/*
* memory.h:
* This is the header file for memory operations.
*
* Authors:
* Renzhi Chen <rxc332@cs.bham.ac.uk>
* Ke Li <k.li@exeter.ac.uk>
*
* Institution:
* Computational Optimization and Data Analytics (CODA) Group @ University of Exeter
*
* Copyright (c) 2017 Renzhi Chen, Ke Li
*
* 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/>.
*/
# ifndef Samritan_MEMORY_H
# define Samritan_MEMORY_H
# include "../header/global.h"
void allocate_memory_ind (individual_real *ind);
void allocate_memory_pop (population_real *pop, int size);
void deallocate_memory_ind (individual_real *ind);
void deallocate_memory_pop (population_real *pop, int size);
# endif // Samritan_MEMORY_H
|
/*
Copyright (C) 2017-2021 Peter S. Zhigalov <peter.zhigalov@gmail.com>
This file is part of the `ImageViewer' program.
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/>.
*/
#if !defined(IMAGEVIEWERWIDGET_H_INCLUDED)
#define IMAGEVIEWERWIDGET_H_INCLUDED
#include <QGraphicsView>
#include <QImage>
#include "Utils/Global.h"
#include "Utils/ScopedPointer.h"
class QGraphicsItem;
class ImageViewerWidget : public QGraphicsView
{
Q_OBJECT
Q_DISABLE_COPY(ImageViewerWidget)
Q_PROPERTY(QImage backgroundTexture READ backgroundTexture WRITE setBackgroundTexture)
public:
enum ZoomMode
{
ZOOM_IDENTITY = 1,
ZOOM_FIT_TO_WINDOW = 2,
ZOOM_CUSTOM = 3
};
enum WheelMode
{
WHEEL_SCROLL = 1,
WHEEL_ZOOM = 2
};
Q_SIGNALS:
void zoomLevelChanged(qreal zoomLevel);
public:
explicit ImageViewerWidget(QWidget *parent = Q_NULLPTR);
~ImageViewerWidget();
ZoomMode zoomMode() const;
qreal zoomLevel() const;
WheelMode wheelMode() const;
QSize imageSize() const;
QImage grabImage() const;
public Q_SLOTS:
QGraphicsItem *graphicsItem() const;
void setGraphicsItem(QGraphicsItem *graphicsItem);
void clear();
void setZoomMode(ImageViewerWidget::ZoomMode mode);
void setZoomLevel(qreal zoomLevel);
void setWheelMode(ImageViewerWidget::WheelMode mode);
void rotateClockwise();
void rotateCounterclockwise();
void flipHorizontal();
void flipVertical();
void zoomIn();
void zoomOut();
void resetZoom();
void scrollLeft();
void scrollRight();
void scrollUp();
void scrollDown();
void setBackgroundColor(const QColor &color);
QImage backgroundTexture() const;
void setBackgroundTexture(const QImage &image);
void setSmoothTransformation(bool enabled);
protected:
void drawBackground(QPainter *painter, const QRectF &rect) Q_DECL_OVERRIDE;
bool event(QEvent* event) Q_DECL_OVERRIDE;
void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
private:
struct Impl;
QScopedPointer<Impl> m_impl;
};
#endif // IMAGEVIEWERWIDGET_H_INCLUDED
|
// button.h
// Copyright 2015 Karl Zeilhofer
// www.zeilhofer.co.at
// This file is part of WolkenThermometer-firmware.
// WolkenThermometer-firmware 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.
// WolkenThermometer-firmware 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 WolkenThermometer-firmware. If not, see <http://www.gnu.org/licenses/>.
#ifndef __BUTTON_H
#define __BUTTON_H
extern volatile uint8_t Button_PressedDuration;
bool Button_isPressed();
#endif
|
/*
Copyright 2011 rhn <gihu.rhn@porcupinefactory.org>
This file is part of Jazda.
Jazda 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.
Jazda 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 Jazda. If not, see <http://www.gnu.org/licenses/>.
*/
/* Builtin calculating and displaying current speed.
Speed is calculated between first and last pulse in queue on redraw. A timer
event is set some time after the predicted next pulse. If the pulse comes, timer
is set again. If the pulse doesn't come, the timeout is considered the next
valid pulse (thus lowering the speed).
*/
/* ---------- PREFERENCES --------------- */
#define SPEED_SIGNIFICANT_DIGITS 2 // 99km/h is good enough
#define SPEED_FRACTION_DIGITS 1 // better than my sigma
#define SPEED_DIGITS (number_display_t){.integer=SPEED_SIGNIFICANT_DIGITS, .fractional=SPEED_FRACTION_DIGITS}
void speed_on_wheel_stop(void);
void speed_on_wheel_pulse(const uint16_t now);
void speed_redraw(void);
#ifdef LONG_CALCULATIONS
uint16_t get_average_speed_long(uint32_t time_amount, const uint16_t pulse_count);
#endif
uint16_t get_average_speed(const uint16_t time_amount, const uint8_t pulse_count);
#ifndef CONSTANT_PULSE_DISTANCE
void speed_update_factor(void);
#endif
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__
#define __C_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__
#include "ISceneNode.h"
namespace irr
{
namespace scene
{
class CSceneNodeAnimatorRotation : public ISceneNodeAnimator
{
public:
//! constructor
CSceneNodeAnimatorRotation(u32 time, const core::vector3df& rotation);
//! animates a scene node
virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_;
//! Writes attributes of the scene node animator.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_;
//! Reads attributes of the scene node animator.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_;
//! Returns type of the scene node animator
virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ { return ESNAT_ROTATION; }
//! Creates a clone of this animator.
/** Please note that you will have to drop
(IReferenceCounted::drop()) the returned pointer after calling this. */
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_;
private:
core::vector3df Rotation;
};
} // end namespace scene
} // end namespace irr
#endif
|
/******************************************************************************
* Copyright (c) 2018, NVIDIA CORPORATION. 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 the NVIDIA CORPORATION 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 NVIDIA CORPORATION 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.
*
******************************************************************************/
#pragma once
#include <hydra/detail/external/hydra_thrust/detail/config.h>
#include <hydra/detail/external/hydra_thrust/detail/cpp11_required.h>
#if HYDRA_THRUST_CPP_DIALECT >= 2011
#if HYDRA_THRUST_DEVICE_COMPILER == HYDRA_THRUST_DEVICE_COMPILER_NVCC
#include <hydra/detail/external/hydra_thrust/system/cuda/config.h>
#include <hydra/detail/external/hydra_thrust/system/cuda/detail/util.h>
#include <hydra/detail/external/hydra_thrust/system/cuda/detail/execution_policy.h>
#include <hydra/detail/external/hydra_thrust/system/cuda/detail/util.h>
#include <mutex>
#include <unordered_map>
HYDRA_THRUST_BEGIN_NS
namespace cuda_cub
{
template<typename MR, typename DerivedPolicy>
__host__
MR * get_per_device_resource(execution_policy<DerivedPolicy>&)
{
static std::mutex map_lock;
static std::unordered_map<int, MR> device_id_to_resource;
int device_id;
hydra_thrust::cuda_cub::throw_on_error(cudaGetDevice(&device_id));
std::lock_guard<std::mutex> lock{map_lock};
return &device_id_to_resource[device_id];
}
}
HYDRA_THRUST_END_NS
#endif
#endif
|
/*
* Copyright 2014, 2015, Jacques Deschênes
* This file is part of CHIPcon v2.
*
* CHIPcon 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.
*
* CHIPcon 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 CHIPcon v2. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CAR_
#define CAR_
#include <avr/pgmspace.h>
#include <stdint.h>
#define CAR_SIZE (428)
extern const uint8_t car[CAR_SIZE];
extern const uint8_t car_info[];
#endif
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qbs.
**
** $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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QBS_MODULEPROPERTIES_H
#define QBS_MODULEPROPERTIES_H
#include <buildgraph/forward_decls.h>
#include <language/forward_decls.h>
#include <QScriptContext>
#include <QScriptValue>
namespace qbs {
namespace Internal {
class ModuleProperties
{
public:
static void init(QScriptValue productObject, const ResolvedProductConstPtr &product);
static void init(QScriptValue artifactObject, const Artifact *artifact);
private:
static void init(QScriptValue objectWithProperties, const void *ptr, const QString &type);
static QScriptValue js_moduleProperties(QScriptContext *context, QScriptEngine *engine);
static QScriptValue js_moduleProperty(QScriptContext *context, QScriptEngine *engine);
static QScriptValue moduleProperties(QScriptContext *context, QScriptEngine *engine);
};
} // namespace Internal
} // namespace qbs
#endif // QBS_MODULEPROPERTIES_H
|
/*
* Copyright (C) 2015 Niek Linnenbank
*
* 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 __LIBARCH_INTCONTROLLER_H
#define __LIBARCH_INTCONTROLLER_H
#include <Types.h>
#include <Macros.h>
/**
* @addtogroup lib
* @{
*
* @addtogroup libarch
* @{
*/
/**
* Interrupt controller interface.
*/
class IntController
{
public:
/**
* Result codes.
*/
enum Result
{
Success,
InvalidIRQ,
InvalidFrequency,
IOError,
NotFound
};
/**
* Constructor.
*/
IntController();
/**
* Get interrupt number base offset.
*
* Some interrupt controllers remap the interrupt numbers
* to a certain base offset.
*
* @return Interrupt number base offset.
*/
uint getBase() const;
/**
* Enable hardware interrupt (IRQ).
*
* @param irq Interrupt Request number.
*
* @return Result code.
*/
virtual Result enable(uint irq) = 0;
/**
* Disable hardware interrupt (IRQ).
*
* @param irq Interrupt Request number.
*
* @return Result code.
*/
virtual Result disable(uint irq) = 0;
/**
* Clear hardware interrupt (IRQ).
*
* Clearing marks the end of an interrupt service routine
* and causes the controller to trigger the interrupt again
* on the next trigger moment.
*
* @param irq Interrupt Request number to clear.
*
* @return Result code.
*/
virtual Result clear(uint irq) = 0;
/**
* Retrieve the next pending interrupt (IRQ).
*
* @param irq Outputs the next pending interrupt on Success
*
* @return Result code.
*/
virtual Result nextPending(uint & irq);
/**
* Check if an IRQ vector is set.
*
* @param irq Interrupt number
*
* @return True if triggered. False otherwise
*/
virtual bool isTriggered(uint irq);
protected:
/** Interrupt number base offset */
uint m_base;
};
/**
* @}
* @}
*/
#endif /* __LIBARCH_INTCONTROLLER_H */
|
/* automatically created by mc from /home/gaius/GM2/graft-5.2.0/gcc-5.2.0/gcc/gm2/gm2-libs-iso/RealStr.def. */
#if !defined (_RealStr_H)
# define _RealStr_H
# ifdef __cplusplus
extern "C" {
# endif
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
typedef struct { PROC_t proc; } PROC;
# endif
# include "GConvTypes.h"
# if defined (_RealStr_C)
# define EXTERN
# else
# define EXTERN extern
# endif
typedef ConvTypes_ConvResults RealStr_ConvResults;
EXTERN void RealStr_StrToReal (char *str_, unsigned int _str_high, double *real, RealStr_ConvResults *res);
EXTERN void RealStr_RealToFloat (double real, unsigned int sigFigs, char *str, unsigned int _str_high);
EXTERN void RealStr_RealToEng (double real, unsigned int sigFigs, char *str, unsigned int _str_high);
EXTERN void RealStr_RealToFixed (double real, int place, char *str, unsigned int _str_high);
EXTERN void RealStr_RealToStr (double real, char *str, unsigned int _str_high);
# ifdef __cplusplus
}
# endif
# undef EXTERN
#endif
|
/*
*
* Libreria para listas de proposito general
* Haga lo que quiera con ella, pero no hay garantias
* Silvio Quadri (c) 2009
*
* */
#ifndef LIST_INCLUDED
#define LIST_INCLUDED
typedef void(*_list_freefunc)(void*);
#ifndef NULL
#define NULL (void*)0
#endif
typedef struct _str_list{
void** data;
unsigned int entradas;
unsigned int tamanio;
unsigned int actual;
_list_freefunc free_func;
} _list;
_list* list_nueva( _list_freefunc free_func );
int list_agrega( _list* lista, void* data );
void list_quita( _list* lista, int entrada );
void* list_pop( _list* lista );
void list_free( _list* );
static inline void list_inicio( _list* lista ) { lista->actual = 0; }
static inline void list_final( _list* lista ) { lista->actual = lista->entradas - 1; }
static inline void* list_siguiente( _list* lista ) {
if( lista->actual >= lista->entradas ){ return NULL; }
return( lista->data[ lista->actual++ ] );
}
static inline void* list_anterior( _list* lista ){
if( lista->actual == 0 ) return NULL;
return lista->data[ lista->actual-- ];
}
static inline void* list_top( _list* lista ){
if( !lista->entradas ) return NULL;
return lista->data[lista->entradas-1];
}
#define list_push list_agrega
#endif
|
/*
* gnome-keyring
*
* Copyright (C) 2011 Collabora Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: Stef Walter <stefw@collabora.co.uk>
*/
#include "config.h"
#include "pkcs11/pkcs11.h"
#include "pkcs11/pkcs11i.h"
#include "gkm-attributes.h"
#include "gkm-generic-key.h"
#include "gkm-session.h"
#include "gkm-transaction.h"
#include "gkm-util.h"
#include "egg/egg-secure-memory.h"
struct _GkmGenericKey {
GkmSecretKey parent;
gpointer value;
gsize n_value;
};
G_DEFINE_TYPE (GkmGenericKey, gkm_generic_key, GKM_TYPE_SECRET_KEY);
static const CK_MECHANISM_TYPE GKM_GENERIC_MECHANISMS[] = {
CKM_G_HKDF_SHA256_DERIVE
};
/* -----------------------------------------------------------------------------
* INTERNAL
*/
static CK_RV
attribute_set_check_value (GkmGenericKey *self, CK_ATTRIBUTE *attr)
{
guchar buffer[20];
g_assert (GKM_IS_GENERIC_KEY (self));
g_assert (attr);
/* Just asking for the length */
if (!attr->pValue) {
attr->ulValueLen = 3;
return CKR_OK;
}
/* Just the a sha1 of the value */
gcry_md_hash_buffer (GCRY_MD_SHA1, buffer, self->value, self->n_value);
/* Use the first three bytes */
return gkm_attribute_set_data (attr, buffer, 3);
}
static GkmObject*
factory_create_generic_key (GkmSession *session, GkmTransaction *transaction,
CK_ATTRIBUTE_PTR attrs, CK_ULONG n_attrs)
{
GkmGenericKey *key;
GkmManager *manager;
CK_ATTRIBUTE_PTR value;
value = gkm_attributes_find (attrs, n_attrs, CKA_VALUE);
if (value == NULL) {
gkm_transaction_fail (transaction, CKR_TEMPLATE_INCOMPLETE);
return NULL;
}
if (gkm_attributes_find (attrs, n_attrs, CKA_VALUE_LEN)) {
gkm_transaction_fail (transaction, CKR_TEMPLATE_INCONSISTENT);
return NULL;
}
manager = gkm_manager_for_template (attrs, n_attrs, session);
key = g_object_new (GKM_TYPE_GENERIC_KEY,
"module", gkm_session_get_module (session),
"manager", manager,
NULL);
key->value = egg_secure_alloc (value->ulValueLen);
key->n_value = value->ulValueLen;
memcpy (key->value, value->pValue, key->n_value);
gkm_attribute_consume (value);
gkm_session_complete_object_creation (session, transaction, GKM_OBJECT (key),
TRUE, attrs, n_attrs);
return GKM_OBJECT (key);
}
/* -----------------------------------------------------------------------------
* OBJECT
*/
static CK_RV
gkm_generic_key_get_attribute (GkmObject *base, GkmSession *session, CK_ATTRIBUTE *attr)
{
GkmGenericKey *self = GKM_GENERIC_KEY (base);
switch (attr->type)
{
case CKA_KEY_TYPE:
return gkm_attribute_set_ulong (attr, CKK_GENERIC_SECRET);
case CKA_DERIVE:
return gkm_attribute_set_bool (attr, CK_TRUE);
case CKA_UNWRAP:
case CKA_WRAP:
return gkm_attribute_set_bool (attr, CK_FALSE);
case CKA_VALUE:
return gkm_attribute_set_data (attr, self->value, self->n_value);
case CKA_VALUE_LEN:
return gkm_attribute_set_ulong (attr, self->n_value);
case CKA_CHECK_VALUE:
return attribute_set_check_value (self, attr);
case CKA_ALLOWED_MECHANISMS:
return gkm_attribute_set_data (attr, (CK_VOID_PTR)GKM_GENERIC_MECHANISMS,
sizeof (GKM_GENERIC_MECHANISMS));
};
return GKM_OBJECT_CLASS (gkm_generic_key_parent_class)->get_attribute (base, session, attr);
}
static gconstpointer
gkm_generic_key_get_key_value (GkmSecretKey *key, gsize *n_value)
{
GkmGenericKey *self = GKM_GENERIC_KEY (key);
*n_value = self->n_value;
return self->value;
}
static void
gkm_generic_key_init (GkmGenericKey *self)
{
}
static void
gkm_generic_key_finalize (GObject *obj)
{
GkmGenericKey *self = GKM_GENERIC_KEY (obj);
if (self->value) {
egg_secure_clear (self->value, self->n_value);
egg_secure_free (self->value);
self->value = NULL;
self->n_value = 0;
}
G_OBJECT_CLASS (gkm_generic_key_parent_class)->finalize (obj);
}
static void
gkm_generic_key_class_init (GkmGenericKeyClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GkmObjectClass *gkm_class = GKM_OBJECT_CLASS (klass);
GkmSecretKeyClass *key_class = GKM_SECRET_KEY_CLASS (klass);
gkm_generic_key_parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = gkm_generic_key_finalize;
gkm_class->get_attribute = gkm_generic_key_get_attribute;
key_class->get_key_value = gkm_generic_key_get_key_value;
}
/* -----------------------------------------------------------------------------
* PUBLIC
*/
GkmFactory*
gkm_generic_key_get_factory (void)
{
static CK_OBJECT_CLASS klass = CKO_SECRET_KEY;
static CK_KEY_TYPE type = CKK_GENERIC_SECRET;
static CK_ATTRIBUTE attributes[] = {
{ CKA_CLASS, &klass, sizeof (klass) },
{ CKA_KEY_TYPE, &type, sizeof (type) }
};
static GkmFactory factory = {
attributes,
G_N_ELEMENTS (attributes),
factory_create_generic_key
};
return &factory;
}
|
#include <canopus/types.h>
#include <canopus/drivers/channel.h>
void *gyroscope_0;
void *magnetometer_1;
//adc_get_25vref_stats() {};
|
#include <stdio.h>
/*
Pattern
isDsPresent, TempL, TempH, Config, CRC
*/
#define PRESENCE_FLAG 0
#define MATCH_DSID_FLAG 1
#define MATCH_CRC_FLAG 2
#define PRESENT_FAN_FLAG 3
#define FAN_ON 4
#define ALARM_ON 5
#define STX 0x02
#define ETX 0x03
#define SIZEBUF 8
typedef enum _bool {false=0, true=1} bool;
typedef struct _measure {
float temp;
float pwm;
bool state[8];
/* bool isDsPresent; //PRESENCE_FLAG
bool isIdMatch; //MATCH_DSID_FLAG
bool isCrcMatch; //MATCH_CRC_FLAG
bool isFanPresent; //PRESENT_FAN_FLAG
bool fanState; //FAN_ON
bool alarmState; //ALARM_ON */
} record_t;
const char* fields[8] = {"PRESENCE_FLAG", "MATCH_DSID_FLAG", "MATCH_CRC_FLAG",
"PRESENT_FAN_FLAG", "FAN_ON", "ALARM_ON", "RESERVED1", "RESERVED2"};
int main () {
record_t dataBuf;
int i, f;
char c = 0;
char strBuf[SIZEBUF];
char bufPtr;
char pivot;
unsigned char state;
while (1) {
f = 1;
scanf ("%c", &strBuf[0]);
while(strBuf[0] != STX)
scanf ("%c", &strBuf[0]);
for(i=1; i<SIZEBUF-1; i++)
scanf ("%c", strBuf+i);
while(strBuf[SIZEBUF-1] != ETX) {
f = 0;
scanf ("%c", &strBuf[SIZEBUF-1]);
}
if (f == 1) {
//memset (dataBuf, 0, sizeof(dataBuf));
/*
dataBuf.temp = ((unsigned char)strBuf[0])/2.0f;
dataBuf.pwm = 100*(unsigned char)*(strBuf+1)/255;
state = (unsigned char)*(strBuf+2);
for (i=0; i<8; i++) {
if ((state & (1<<i)) != 0)
dataBuf.state[i] = true;
else
dataBuf.state[i] = false;
}
printf ("\rT=%0.1f'C pwm=%6.2f%% state=[", dataBuf.temp, dataBuf.pwm);
for (i=0; i<7; i++) {
if (dataBuf.state[i] == true)
printf ("\033[32;1m%s=%d\033[0m,", fields[i], dataBuf.state[i]);
else
printf ("%s=%d,", fields[i], dataBuf.state[i]);
}
printf ("%s=%d] %02X %02X", fields[i], dataBuf.state[i], (unsigned char)*(strBuf+3),
(unsigned char)*(strBuf+4));
*/
//printf ("\r");
// for(i=0; i < 5; i++) {
// printf ("%u(%c) ", (unsigned char)*(strBuf+i), strBuf[i]);
// printf ("%u ", (unsigned char)*(strBuf+i));
//if((unsigned char)*(strBuf) > 0)
//printf ("%u [rpm]", (15000000) / (128*(unsigned int)*(strBuf)) );
//printf ("device_id=%u ", (unsigned char)*(strBuf+0));
//printf ("TLSB=%u ", (unsigned char)*(strBuf+1));
//printf ("TMSB=%u ", (unsigned char)*(strBuf+2));
unsigned char tl, th, tc;
const char* names[] = {"STX", "N", "N", "tmpcnt", "temp", "N", "state_reg", "ETX"};
tl = (unsigned char)*(strBuf+0);
th = (unsigned char)*(strBuf+1);
tc = (unsigned char)*(strBuf+2);
unsigned char fsreg = (unsigned char)*(strBuf+3);
unsigned char state_reg = (unsigned char)*(strBuf+6);
//printf ("tm=%u tl=%u temp=%0.2f°C tc=%u ", th, tl, (th << 5 | tl >> 3) / 2.0, tc);
//printf ("%u ", (unsigned char)*(strBuf+4));
//printf ("fsreg=%u ", fsreg);
//printf ("%u ", fsreg);
//if(fsreg > 0)
//printf ("v_rot=%0.2f[rpm] ", (15.0 * fsreg) / 0.390264 );
//printf ("fspeed=%u ", (unsigned char)*(strBuf+4));
for (i=1; i<SIZEBUF-1; i++) {
printf ("[%u]%s=0x%02x %03u ", i, names[i], (unsigned char)*(strBuf+i), (unsigned char)*(strBuf+i));
}
printf ("[6]%s=%d 0x%02X [", names[6], state_reg, state_reg);
unsigned char tmp = state_reg, cnt = 8, al = 0;
while(cnt) {
printf ("%u", (tmp >> (cnt-1)) & 1);
//tmp = tmp >> 1;
cnt--;
}
printf ("]");
if (state_reg & (1 << 5)) printf (" AL ");
printf(" %2.1f℃", ((unsigned char)*(strBuf+2) << 5 | (unsigned char)*(strBuf+1) >> 3) / 2.0);
//}
printf ("\n");
fflush(stdout);
}
}
return 0;
}
|
#ifndef WIDE_SYSTEM_H
#define WIDE_SYSTEM_H
#include <stdio.h>
int
wide_system_system (const char *command);
FILE *
wide_system_fopen (const char *filename, const char *mode);
FILE *
wide_system_freopen (const char *filename, const char *mode, FILE *stream);
#endif // WIDE_SYSTEM_H
|
#ifndef Points3D_h
#define Points3D_h
//my includes
#include "mytypes.h"
class Points3D
{
public:
Points3D() : m_changesNotSaved(false) {}
//virtual z_int32_t getZ(const x_int32_t x, const y_int32_t y) = 0;
bool m_changesNotSaved;
private:
};
#endif
|
//===========================================================================
//
// w_cosh.c
//
// Part of the standard mathematical function library
//
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos 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 or (at your option) any later version.
//
// eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): jlarmour
// Contributors: jlarmour
// Date: 1998-02-13
// Purpose:
// Description:
// Usage:
//
//####DESCRIPTIONEND####
//
//===========================================================================
// CONFIGURATION
#include <pkgconf/libm.h> // Configuration header
// Include the Math library?
#ifdef CYGPKG_LIBM
// Derived from code with the following copyright
/* @(#)w_cosh.c 1.3 95/01/18 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/*
* wrapper cosh(x)
*/
#include "mathincl/fdlibm.h"
double cosh(double x) /* wrapper cosh */
{
#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
return __ieee754_cosh(x);
#else
double z;
z = __ieee754_cosh(x);
if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x)) return z;
if(fabs(x)>7.10475860073943863426e+02) {
return __kernel_standard(x,x,5); /* cosh overflow */
} else
return z;
#endif
}
#endif // ifdef CYGPKG_LIBM
// EOF w_cosh.c
|
#include "delineate.h"
/*
* Document-module: Delineate
*
* This module represents tha application namespace
*
*/
VALUE rb_module;
VALUE rb_module_delineate() {
return rb_module;
}
void define_ruby_module() {
if (rb_module)
return;
rb_module = rb_define_module("Delineate");
}
void Init_delineate() {
define_ruby_module();
define_ruby_point_class();
define_ruby_line_class();
extend_ruby_delineate_module();
}
|
//
// Validator.h
// OMDb-iOS
//
// Created by Jhonathan Wyterlin on 11/07/16.
// Copyright © 2016 Jhonathan Wyterlin. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Validator : NSObject
+(BOOL)validateObject:(id)object;
+(BOOL)isEmptyString:(NSString *)string;
@end
|
#ifndef USER_DATA_OBJECT_H
#define USER_DATA_OBJECT_H
#include <memory>
using namespace std;
struct other_user_data_object_t
{
int id;
int gpc_seq[8];//杠碰吃 顺序
int gpc_seq_count;
int paiCount;//手上的牌
int paiRecCount;//已经出了的牌
int _g;
int _ag;
int _p;
int _c;
char paiRecList[32];//已经出了的牌
char chi[16];
char peng[8];
char gang[8];
char NewCard;
};
struct user_data_object_t
{
user_data_object_t();
uint64_t user_id;
uint64_t desk_id;
int self_id;//1-4 玩家座位号(方位)
int gpc_seq[8];//杠碰吃 顺序
int gpc_seq_count;
int paiCount;
int paiRecCount;
int _g;
int _ag;
int _p;
int _c;
int cHuCount;
int cPengCount;
int cGangCount;
int cChiCount;
char paiRecList[36];
char paiList[16];
char chi[16];
char gang[8];
char peng[8];
char cHuList[16];
char cChiList[16];
char cGangList[8];
char cPengList[8];
char NewCard;
char wang;
};
using user_data_object = shared_ptr<user_data_object_t>;
user_data_object user_data_object_new();
std::string user_data_to_hex(user_data_object &obj);
std::string other_user_data_to_hex(user_data_object &obj);
#endif // USER_DATA_OBJECT_H
|
/*
* Window management definitions from <X/Xlib.h>
* Copyright (c) 1985 Massachusetts Institute of Technology
*/
#ifndef Xwindow_h
#define Xwindow_h
#include <InterViews/X10/Xdefs.h>
/*
* Data returned by XQueryWindow.
*/
typedef struct _WindowInfo {
short width, height; /* Width and height. */
short x, y; /* X and y coordinates. */
short bdrwidth; /* Border width. */
short mapped; /* IsUnmapped, IsMapped or IsInvisible.*/
short type; /* IsTransparent, IsOpaque or IsIcon. */
XWindow assoc_wind; /* Associated icon or opaque Window. */
} XWindowInfo;
/*
* Data structures used by XCreateWindows XCreateTransparencies and
* XCreateWindowBatch.
*/
typedef struct _OpaqueFrame {
XWindow self; /* window id of the window, filled in later */
short x, y; /* where to create the window */
short width, height; /* width and height */
short bdrwidth; /* border width */
XPixmap border; /* border pixmap */
XPixmap background; /* background */
} XOpaqueFrame;
typedef struct _TransparentFrame {
XWindow self; /* window id of the window, filled in later */
short x, y; /* where to create the window */
short width, height; /* width and height */
} XTransparentFrame;
typedef struct _BatchFrame {
short type; /* One of (IsOpaque, IsTransparent). */
XWindow parent; /* Window if of the window's parent. */
XWindow self; /* Window id of the window, filled in later. */
short x, y; /* Where to create the window. */
short width, height; /* Window width and height. */
short bdrwidth; /* Window border width. */
XPixmap border; /* Window border pixmap */
XPixmap background; /* Window background pixmap. */
} XBatchFrame;
XWindow XCreateWindow(
XWindow, int x, int y, int width, int height, int borderwidth,
XPixmap border, XPixmap bg
);
XWindow XCreateTransparency(XWindow, int x, int y, int width, int height);
void XDestroyWindow(XWindow);
void XDestroySubwindows(XWindow);
int XCreateWindows(XWindow, XOpaqueFrame defs[], int);
int XCreateTransparencies(XWindow, XTransparentFrame defs[], int);
int XCreateWindowBatch(XWindow, XBatchFrame defs, int);
XWindow XCreate(
const char* prompt, const char* program, const char* geometry,
const char* deflt, XOpaqueFrame* frame, int minwidth, int minheight
);
XWindow XCreateTerm(
const char* prompt, const char* program, const char* geometry,
const char* deflt, XOpaqueFrame* frame, int minwidth, int minheight,
int xadder, int yadder, int* cwidth, int* cheight, struct _FontInfo* f,
int fwidth, int fheight
);
void XMapWindow(XWindow);
void XMapSubwindows(XWindow);
void XUnmapWindow(XWindow);
void XUnmapTransparent(XWindow);
void XUnmapSubwindows(XWindow);
void XMoveWindow(XWindow, int x, int y);
void XChangeWindow(XWindow, int width, int height);
void XConfigureWindow(XWindow, int x, int y, int width, int height);
void XRaiseWindow(XWindow);
void XLowerWindow(XWindow);
void XCircWindowUp(XWindow);
void XCircWindowDown(XWindow);
XStatus XQueryWindow(XWindow, XWindowInfo*);
XStatus XQueryTree(XWindow, XWindow*, int*, XWindow**);
void XChangeBackground(XWindow, XPixmap);
void XChangeBorder(XWindow, XPixmap);
void XTileAbsolute(XWindow);
void XTileRelative(XWindow);
void XClipDrawThrough(XWindow);
void XClipClipped(XWindow);
void XStoreName(XWindow, const char*);
XStatus XFetchName(XWindow, const char**);
void XSetResizeHint(XWindow, int w0, int h0, int winc, int hinc);
void XGetResizeHint(XWindow, int* w0, int* h0, int* winc, int* hinc);
void XSetIconWindow(XWindow, XWindow);
void XClearIconWindow(XWindow);
#endif
|
/*******************************************************************************
Copyright (C) 2014-2017 Wright State University - All Rights Reserved
Daniel P. Foose - Maintainer/Lead Developer
This file is part of Vespucci.
Vespucci 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.
Vespucci 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 Vespucci. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
#ifndef PLOTWIDGET_H
#define PLOTWIDGET_H
#include <QWidget>
#include <qcustomplot.h>
#include <QVector>
#include <mlpack/core.hpp>
#include <Global/vespucciworkspace.h>
class VespucciWorkspace;
namespace Ui {
class PlotWidget;
}
using namespace std;
using namespace arma;
typedef vector<double> stdvec;
class PlotWidget : public QWidget
{
Q_OBJECT
public:
explicit PlotWidget(QWidget *parent, QSharedPointer<VespucciWorkspace> ws);
~PlotWidget();
void AddPlot(const mat & paired_data);
void AddPlot(const vec &abscissa, const vec &data);
void AddTransientPlot(const vec &abscissa, const vec &data);
void AddTransientPlot(const mat & paired_data);
void AddScatterPlot(const mat & paired_data);
void AddScatterPlot(const vec &abscissa, const vec &data);
void AddMappedScatterPlot(const mat & paired_data, const vec &categorical);
void AddMappedScatterPlot(const vec & abscissa, const vec &data, const vec &categorical);
void RemoveTransientPlot();
bool TransientOnly() const;
void SavePlot(QString filename);
private:
Ui::PlotWidget *ui;
QList<QColor> colors_;
QColor GetNextColor();
QSharedPointer<VespucciWorkspace> workspace_;
QCPGraph *transient_graph_;
};
#endif // PLOTWIDGET_H
|
/**
* output.c
* Author: Jan Viktorin <xvikto03 (at) stud.fit.vutbr.cz>
*
* 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 "pico.h"
#include "output.h"
#include "assembler.h"
#include "stab.h"
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
struct output {
FILE *file;
code_t code[PROGRAM_LEN];
};
bool output_init(struct pico *p, char *filename)
{
FILE *out = stdout;
if(filename != NULL) {
out = fopen(filename, "w");
if(out == NULL)
return error(NULL, "Can not open the output file");
}
struct output *ins = (struct output *) calloc(1, sizeof(struct output));
if(ins == NULL) {
fclose(out);
return error(NULL, "Memory allocation error");
}
ins->file = out;
p->output = ins;
return true;
}
void output_destroy(struct pico *p)
{
if(p->output == NULL)
return;
if(p->output->file != NULL)
fclose(p->output->file);
free(p->output);
p->output = NULL;
}
bool output_code(struct pico *p, progaddr_t address, code_t ins)
{
debug_here();
if(address >= PROGRAM_LEN)
return error(p, "Unexpected program address, max 1023");
p->output->code[address] = ins;
return true;
}
void output_flush(struct pico *p)
{
debug_here();
for(int i = 0; i < PROGRAM_LEN; i++) {
fprintf(p->output->file, "%.5X\n", p->output->code[i]);
}
}
|
// ThresClassEventSender.h
// author: Ionut Damianr <damian@hcm-lab.de>
// created: 2013/08/21
// Copyright (C) 2007-13 University of Augsburg, Lab for Human Centered Multimedia
//
// *************************************************************************************************
//
// This file is part of Social Signal Interpretation (SSI) developed at the
// Lab for Human Centered Multimedia of the University of Augsburg
//
// This library is free software; you can redistribute itand/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 any laterversion.
//
// 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 FORA PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along withthis library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
//*************************************************************************************************
#ifndef SSI_EVENT_THRESCLASSEVENTSENDER_H
#define SSI_EVENT_THRESCLASSEVENTSENDER_H
#include "base/IConsumer.h"
#include "ioput/option/OptionList.h"
#include "event/EventAddress.h"
namespace ssi {
class ThresClassEventSender : public IConsumer {
public:
class Options : public OptionList {
public:
Options ()
: minDiff (0.1f), mean(false) {
setSender ("tcsender");
setEvent ("class");
setClasses ("low, medium, high");
setThresholds ("0.1, 0.3, 0.8");
addOption ("sname", sname, SSI_MAX_CHAR, SSI_CHAR, "name of sender (if sent to event board)");
addOption ("ename", ename, SSI_MAX_CHAR, SSI_CHAR, "name of event (if sent to event board)");
addOption ("classes", classes, SSI_MAX_CHAR, SSI_CHAR, "names of the classes event (e.g. low,medium,high)");
addOption ("thres", &thres, SSI_MAX_CHAR, SSI_CHAR, "thresholds (e.g. 0.1,0.3,0.8)");
addOption ("minDiff", &minDiff, 1, SSI_FLOAT, "minimum difference to previous value");
addOption ("mean", &mean, 1, SSI_BOOL, "classify based on mean value of entire frame");
};
void setSender (const ssi_char_t *sname) {
if (sname) {
ssi_strcpy (this->sname, sname);
}
}
void setEvent (const ssi_char_t *ename) {
if (ename) {
ssi_strcpy (this->ename, ename);
}
}
void setClasses (const ssi_char_t *classes) {
if (classes) {
ssi_strcpy (this->classes, classes);
}
}
void setThresholds (const ssi_char_t *thres) {
if (thres) {
ssi_strcpy (this->thres, thres);
}
}
void setThresholds (ssi_size_t n_thres, ssi_real_t *thres) {
thres[0] = '\0';
if (n_thres > 0) {
ssi_char_t c[SSI_MAX_CHAR];
ssi_sprint (c, "%f", thres[0]);
strcat (classes, c);
for (ssi_size_t i = 1; i < n_thres; i++) {
ssi_sprint (c, ",%f", thres[i]);
strcat (classes, c);
}
}
}
bool mean;
ssi_real_t minDiff;
ssi_char_t sname[SSI_MAX_CHAR];
ssi_char_t ename[SSI_MAX_CHAR];
ssi_char_t classes[SSI_MAX_CHAR];
ssi_char_t thres[SSI_MAX_CHAR];
};
public:
static const ssi_char_t *GetCreateName () { return "ssi_consumer_ThresClassEventSender"; };
static IObject *Create (const ssi_char_t *file) { return new ThresClassEventSender (file); };
~ThresClassEventSender ();
static ssi_char_t *ssi_log_name;
int ssi_log_level;
Options *getOptions () { return &_options; };
const ssi_char_t *getName () { return GetCreateName (); };
const ssi_char_t *getInfo () { return "Classifies stream using thresholds."; };
void consume_enter (ssi_size_t stream_in_num,
ssi_stream_t stream_in[]);
void consume (IConsumer::info consume_info,
ssi_size_t stream_in_num,
ssi_stream_t stream_in[]);
void consume_flush (ssi_size_t stream_in_num,
ssi_stream_t stream_in[]);
bool setEventListener (IEventListener *listener);
const ssi_char_t *getEventAddress () {
return _event_address.getAddress ();
}
protected:
ThresClassEventSender (const ssi_char_t *file = 0);
int classify(ssi_real_t value, ssi_real_t* thresholds, ssi_size_t n_thresholds);
bool handleEvent(IEventListener *listener, ssi_event_t* ev, const ssi_char_t* class_name, ssi_time_t time);
ThresClassEventSender::Options _options;
ssi_char_t *_file;
IEventListener *_elistener;
EventAddress _event_address;
ssi_event_t _event;
ssi_real_t *_thres;
ssi_size_t _num_classes;
const ssi_char_t **_classes;
int _lastClass;
ssi_real_t _lastValue;
ssi_real_t *parseFloats (const ssi_char_t *str, ssi_size_t &n_indices, bool sort = false, const ssi_char_t *delims = " ,");
const ssi_char_t **parseStrings (const ssi_char_t *str, ssi_size_t &n_indices, const ssi_char_t *delims = " ,");
};
}
#endif
|
// Copyright (c) 2005 - 2017 Settlers Freaks (sf-team at siedler25.org)
//
// This file is part of Return To The Roots.
//
// Return To The Roots 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.
//
// Return To The Roots 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 Return To The Roots. If not, see <http://www.gnu.org/licenses/>.
#pragma once
enum MsgboxButton
{
MSB_OK,
MSB_OKCANCEL,
MSB_YESNO,
MSB_YESNOCANCEL
};
enum MsgboxIcon
{
MSB_QUESTIONGREEN = 72,
MSB_EXCLAMATIONGREEN,
MSB_QUESTIONRED,
MSB_EXCLAMATIONRED
};
enum MsgboxResult
{
MSR_OK = 0,
MSR_CANCEL,
MSR_YES,
MSR_NO,
MSR_NOTHING
};
|
//
// UIImage+Functions.h
// Liber
//
// Copyright © 2017 Christian-Schneider. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (Functions)
+ (UIImage*) imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize;
@end
|
/*-
* Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.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 __MARLIN_THUMBNAILER_H__
#define __MARLIN_THUMBNAILER_H__
#include "gof-file.h"
G_BEGIN_DECLS
typedef struct _MarlinThumbnailerClass MarlinThumbnailerClass;
typedef struct _MarlinThumbnailer MarlinThumbnailer;
#define MARLIN_TYPE_THUMBNAILER (marlin_thumbnailer_get_type ())
#define MARLIN_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MARLIN_TYPE_THUMBNAILER, MarlinThumbnailer))
#define MARLIN_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MARLIN_TYPE_THUMBNAILER, MarlinThumbnailerClass))
#define MARLIN_IS_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MARLIN_TYPE_THUMBNAILER))
#define MARLIN_IS_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MARLIN_TYPE_THUMBNAILER))
#define MARLIN_THUMBNAILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MARLIN_TYPE_THUMBNAILER, MarlinThumbnailerClass))
GType marlin_thumbnailer_get_type (void) G_GNUC_CONST;
MarlinThumbnailer *marlin_thumbnailer_new (void) G_GNUC_MALLOC;
MarlinThumbnailer *marlin_thumbnailer_get (void) G_GNUC_MALLOC;
gboolean marlin_thumbnailer_queue_file (MarlinThumbnailer *thumbnailer,
GOFFile *file,
guint *request,
gboolean large);
gboolean marlin_thumbnailer_queue_files (MarlinThumbnailer *thumbnailer,
GList *files,
guint *request,
gboolean large);
void marlin_thumbnailer_dequeue (MarlinThumbnailer *thumbnailer,
guint request);
G_END_DECLS
#endif /* !__MARLIN_THUMBNAILER_H__ */
|
//
// _ _ ______ _ _ _ _ _ _ _
// | \ | | | ____| | (_) | (_) | | | |
// | \| | ___ | |__ __| |_| |_ _ _ __ __ _| | | |
// | . ` |/ _ \ | __| / _` | | __| | '_ \ / _` | | | |
// | |\ | (_) | | |___| (_| | | |_| | | | | (_| |_|_|_|
// |_| \_|\___/ |______\__,_|_|\__|_|_| |_|\__, (_|_|_)
// __/ |
// |___/
//
// This file is auto-generated. Do not edit manually
//
// Copyright 2013 Automatak LLC
//
// Automatak LLC (www.automatak.com) licenses this file
// to you under the the Apache License Version 2.0 (the "License"):
//
// http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef OPENDNP3_STATICSECURITYSTATVARIATION_H
#define OPENDNP3_STATICSECURITYSTATVARIATION_H
#include <cstdint>
namespace opendnp3 {
enum class StaticSecurityStatVariation : uint8_t
{
Group121Var1 = 0
};
}
#endif
|
/**
******************************************************************************
* File Name : USB_OTG.c
* Description : This file provides code for the configuration
* of the USB_OTG instances.
******************************************************************************
*
* Copyright (c) 2018 STMicroelectronics International N.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
* 1. Redistribution 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 other
* contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
* 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
* 5. Redistribution and use of this software other than as permitted under
* this license is void and will automatically terminate your rights under
* this license.
*
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS 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 "usb_otg.h"
#include "gpio.h"
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
PCD_HandleTypeDef hpcd_USB_OTG_FS;
/* USB_OTG_FS init function */
void MX_USB_OTG_FS_PCD_Init(void)
{
hpcd_USB_OTG_FS.Instance = USB_OTG_FS;
hpcd_USB_OTG_FS.Init.dev_endpoints = 4;
hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_OTG_FS.Init.dma_enable = DISABLE;
hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_64;
hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE;
hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_FS.Init.vbus_sensing_enable = ENABLE;
hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE;
if (HAL_PCD_Init(&hpcd_USB_OTG_FS) != HAL_OK)
{
Error_Handler();
}
}
void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
{
GPIO_InitTypeDef GPIO_InitStruct;
if(pcdHandle->Instance==USB_OTG_FS)
{
/* USER CODE BEGIN USB_OTG_FS_MspInit 0 */
/* USER CODE END USB_OTG_FS_MspInit 0 */
/**USB_OTG_FS GPIO Configuration
PA11 ------> USB_OTG_FS_DM
PA12 ------> USB_OTG_FS_DP
*/
GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* Peripheral clock enable */
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
/* USER CODE BEGIN USB_OTG_FS_MspInit 1 */
/* USER CODE END USB_OTG_FS_MspInit 1 */
}
}
void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle)
{
if(pcdHandle->Instance==USB_OTG_FS)
{
/* USER CODE BEGIN USB_OTG_FS_MspDeInit 0 */
/* USER CODE END USB_OTG_FS_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_USB_OTG_FS_CLK_DISABLE();
/**USB_OTG_FS GPIO Configuration
PA11 ------> USB_OTG_FS_DM
PA12 ------> USB_OTG_FS_DP
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12);
}
/* USER CODE BEGIN USB_OTG_FS_MspDeInit 1 */
/* USER CODE END USB_OTG_FS_MspDeInit 1 */
}
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/**
******************************************************************************
* @file TIM/TIM_DMABurst/Inc/stm32f4xx_it.h
* @author MCD Application Team
* @version V1.3.0
* @date 17-February-2017
* @brief This file contains the headers of the interrupt handlers.
******************************************************************************
* @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.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_IT_H
#define __STM32F4xx_IT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
#include "main.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void NMI_Handler(void);
void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void TIMx_DMA_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
This file is part of Desperion.
Copyright 2010, 2011 LittleScaraby, Nekkro
Desperion 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.
Desperion 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 Desperion. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GAME_ROLE_PLAY_DELAYED_ACTION_MESSAGE__
#define __GAME_ROLE_PLAY_DELAYED_ACTION_MESSAGE__
class GameRolePlayDelayedActionMessage : public DofusMessage
{
public:
int delayedCharacterId;
int8 delayTypeId;
int delayDuration;
uint16 GetOpcode() const
{ return SMSG_GAME_ROLE_PLAY_DELAYED_ACTION; }
GameRolePlayDelayedActionMessage()
{
}
GameRolePlayDelayedActionMessage(int delayedCharacterId, int8 delayTypeId, int delayDuration) : delayedCharacterId(delayedCharacterId), delayTypeId(delayTypeId), delayDuration(delayDuration)
{
}
void Serialize(ByteBuffer& data) const
{
data<<delayedCharacterId<<delayTypeId<<delayDuration;
}
void Deserialize(ByteBuffer& data)
{
data>>delayedCharacterId>>delayTypeId>>delayDuration;
}
};
#endif
|
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef _MACH_MACHINE_TYPES_H
#define _MACH_MACHINE_TYPES_H
#if defined (__i386__) || defined (__x86_64__)
#include "libsa/i386/types.h"
#elif defined (__arm__)|| defined (__arm64__)
#include "libsa/arm/types.h"
#else
#error architecture not supported
#endif
#endif /* _MACH_MACHINE_TYPES_H */
|
/*
* Copyright 2011 Fabio Baltieri (fabio.baltieri@gmail.com)
*
* Based on the original ben-wpan code written by
* Werner Almesberger, Copyright 2008-2011
*
* 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.
*
*/
#ifndef USB_H
#define USB_H
#include <stdint.h>
/*
* Descriptor types
*
* Reuse libusb naming scheme (/usr/include/usb.h)
*/
#define USB_DT_DEVICE 1
#define USB_DT_CONFIG 2
#define USB_DT_STRING 3
#define USB_DT_INTERFACE 4
#define USB_DT_ENDPOINT 5
/*
* Device classes
*
* Reuse libusb naming scheme (/usr/include/usb.h)
*/
#define USB_CLASS_PER_INTERFACE 0xfe
#define USB_CLASS_VENDOR_SPEC 0xff
/*
* Configuration attributes
*/
#define USB_ATTR_BUS_POWERED 0x80
#define USB_ATTR_SELF_POWERED 0x40
#define USB_ATTR_REMOTE_WAKEUP 0x20
/*
* Setup request types
*/
#define TO_DEVICE(req) (0x00 | (req) << 8)
#define FROM_DEVICE(req) (0x80 | (req) << 8)
#define TO_INTERFACE(req) (0x01 | (req) << 8)
#define FROM_INTERFACE(req) (0x81 | (req) << 8)
#define TO_ENDPOINT(req) (0x02 | (req) << 8)
#define FROM_ENDPOINT(req) (0x82 | (req) << 8)
/*
* Setup requests
*/
#define GET_STATUS 0x00
#define CLEAR_FEATURE 0x01
#define SET_FEATURE 0x03
#define SET_ADDRESS 0x05
#define GET_DESCRIPTOR 0x06
#define SET_DESCRIPTOR 0x07
#define GET_CONFIGURATION 0x08
#define SET_CONFIGURATION 0x09
#define GET_INTERFACE 0x0a
#define SET_INTERFACE 0x0b
#define SYNCH_FRAME 0x0c
/*
* USB Language ID codes
*
* http://www.usb.org/developers/docs/USB_LANGIDs.pdf
*/
#define USB_LANGID_ENGLISH_US 0x409
/*
* Odd. sdcc seems to think "x" assumes the size of the destination, i.e.,
* uint8_t. Hence the cast.
*/
#define LE(x) ((uint16_t) (x) & 0xff), ((uint16_t) (x) >> 8)
#define LO(x) (((uint8_t *) &(x))[0])
#define HI(x) (((uint8_t *) &(x))[1])
#ifdef LOW_SPEED
#define EP0_SIZE 8
#else
#define EP0_SIZE 64
#endif
#define EP1_SIZE 64 /* simplify */
enum ep_state {
EP_IDLE,
EP_RX,
EP_TX,
EP_STALL,
};
struct ep_descr {
enum ep_state state;
uint8_t *buf;
uint8_t *end;
uint8_t size;
void (*callback)(void *user);
void *user;
};
struct setup_request {
uint8_t bmRequestType;
uint8_t bRequest;
uint16_t wValue;
uint16_t wIndex;
uint16_t wLength;
};
extern const uint8_t device_descriptor[];
extern const uint8_t config_descriptor[];
extern struct ep_descr eps[];
extern int (*user_setup)(const struct setup_request *setup);
extern void (*user_set_interface)(int nth);
extern int (*user_get_descriptor)(uint8_t type, uint8_t index,
const uint8_t **reply, uint8_t *size);
extern void (*user_reset)(void);
#define usb_left(ep) ((ep)->end-(ep)->buf)
#define usb_send(ep, buf, size, callback, user) \
usb_io(ep, EP_TX, (void *) buf, size, callback, user)
#define usb_recv(ep, buf, size, callback, user) \
usb_io(ep, EP_RX, buf, size, callback, user)
void usb_io(struct ep_descr *ep, enum ep_state state, uint8_t *buf,
uint8_t size, void (*callback)(void *user), void *user);
int handle_setup(const struct setup_request *setup);
int set_addr(uint8_t addr);
void usb_ep_change(struct ep_descr *ep);
void usb_reset(void);
void usb_init(void);
#endif /* !USB_H */
|
//----------------------------------------------------------------------------
// XC program; finite element analysis code
// for structural analysis and design.
//
// Copyright (C) Luis Claudio Pérez Tato
//
// This program derives from OpenSees <http://opensees.berkeley.edu>
// developed by the «Pacific earthquake engineering research center».
//
// Except for the restrictions that may arise from the copyright
// of the original program (see copyright_opensees.txt)
// XC 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 software 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/>.
//----------------------------------------------------------------------------
/* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** **
** (C) Copyright 1999, The Regents of the University of California **
** All Rights Reserved. **
** **
** Commercial use of this program without express permission of the **
** University of California, Berkeley, is strictly prohibited. See **
** file 'COPYRIGHT' in main directory for information on usage and **
** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
** **
** Developed by: **
** Frank McKenna (fmckenna@ce.berkeley.edu) **
** Gregory L. Fenves (fenves@ce.berkeley.edu) **
** Filip C. Filippou (filippou@ce.berkeley.edu) **
** **
** ****************************************************************** */
// $Revision: 1.1.1.1 $
// $Date: 2000/09/15 08:23:30 $
// $Source: /usr/local/cvs/OpenSees/SRC/utility/tagged/storage/TaggedObjectIter.h,v $
// File: ~/utility/tagged/storage/TaggedObjectIter.h
//
// Written: fmk
// Created: Fri Sep 20 15:27:47: 1996
// Revision: A
//
// Description: This file contains the class definition for TaggedObjectIter.
// TaggedObjectIter is an abstract base class.
#ifndef TaggedObjectIter_h
#define TaggedObjectIter_h
namespace XC {
class TaggedObject;
//! @ingroup Tagged
//
//! @brief An TaggedObjectIter is an iter for returning the Components
//! of an object of class TaggedObjectStorage.
//! It must be written for each subclass of TaggedObjectStorage (this is done
//! for efficiency reasons), hence the abstract base class.
class TaggedObjectIter
{
public:
TaggedObjectIter() {};
virtual ~TaggedObjectIter() {};
virtual void reset(void) =0;
virtual TaggedObject *operator()(void) =0;
};
} // end of XC namespace
#endif
|
/*
* This file is protected by Copyright. Please refer to the COPYRIGHT file
* distributed with this source distribution.
*
* This file is part of GNUHAWK.
*
* GNUHAWK is free software: you can redistribute it and/or modify is 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.
*
* GNUHAWK 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 VECTOR_SINK_C_IMPL_H
#define VECTOR_SINK_C_IMPL_H
#include "vector_sink_c_base.h"
class vector_sink_c_i : public vector_sink_c_base
{
public:
vector_sink_c_i(const char *uuid, const char *label);
~vector_sink_c_i();
//
// createBlock
//
// Create the actual GNU Radio Block to that will perform the work method. The resulting
// block object is assigned to gr_stpr
//
// Add property change callbacks for getter/setter methods
//
//
void createBlock();
void on_reset(const std::string &id);
};
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include "recpt1core.h"
#include "version.h"
#include <sys/poll.h>
#include <linux/dvb/dmx.h>
#include <linux/dvb/frontend.h>
#define ISDB_T_NODE_LIMIT 24 // 32:ARIB limit 24:program maximum
#define ISDB_T_SLOT_LIMIT 8
/* globals */
boolean f_exit = FALSE;
char bs_channel_buf[8];
static int fefd = 0;
static int dmxfd = 0;
int
close_tuner(thread_data *tdata)
{
int rv = 0;
if(fefd > 0){
close(fefd);
fefd = 0;
}
if(dmxfd > 0){
close(dmxfd);
dmxfd = 0;
}
if(tdata->tfd == -1)
return rv;
close(tdata->tfd);
tdata->tfd = -1;
return rv;
}
void
calc_cn(void)
{
int strength=0;
ioctl(fefd, FE_READ_SNR, &strength);
fprintf(stderr,"SNR: %d\n",strength);
}
int
parse_time(char *rectimestr, int *recsec)
{
/* indefinite */
if(!strcmp("-", rectimestr)) {
*recsec = -1;
return 0;
}
/* colon */
else if(strchr(rectimestr, ':')) {
int n1, n2, n3;
if(sscanf(rectimestr, "%d:%d:%d", &n1, &n2, &n3) == 3)
*recsec = n1 * 3600 + n2 * 60 + n3;
else if(sscanf(rectimestr, "%d:%d", &n1, &n2) == 2)
*recsec = n1 * 3600 + n2 * 60;
else
return 1; /* unsuccessful */
return 0;
}
/* HMS */
else {
char *tmpstr;
char *p1, *p2;
int flag;
if( *rectimestr == '-' ){
rectimestr++;
flag = 1;
}else
flag = 0;
tmpstr = strdup(rectimestr);
p1 = tmpstr;
while(*p1 && !isdigit(*p1))
p1++;
/* hour */
if((p2 = strchr(p1, 'H')) || (p2 = strchr(p1, 'h'))) {
*p2 = '\0';
*recsec += atoi(p1) * 3600;
p1 = p2 + 1;
while(*p1 && !isdigit(*p1))
p1++;
}
/* minute */
if((p2 = strchr(p1, 'M')) || (p2 = strchr(p1, 'm'))) {
*p2 = '\0';
*recsec += atoi(p1) * 60;
p1 = p2 + 1;
while(*p1 && !isdigit(*p1))
p1++;
}
/* second */
*recsec += atoi(p1);
if( flag )
*recsec *= -1;
free(tmpstr);
return 0;
} /* else */
return 1; /* unsuccessful */
}
void
do_bell(int bell)
{
int i;
for(i=0; i < bell; i++) {
fprintf(stderr, "\a");
usleep(400000);
}
}
/* from checksignal.c */
int
tune(char *channel, thread_data *tdata, int dev_num)
{
struct dtv_property prop[3];
struct dtv_properties props;
struct dvb_frontend_info fe_info;
int fe_freq;
int rc, i;
struct dmx_pes_filter_params filter;
struct dvb_frontend_event event;
struct pollfd pfd[1];
char device[32];
/* open tuner */
if(fefd == 0){
sprintf(device, "/dev/dvb/adapter%d/frontend0", dev_num);
fefd = open(device, O_RDWR);
if(fefd < 0) {
fprintf(stderr, "cannot open frontend device\n");
fefd = 0;
return 1;
}
fprintf(stderr, "device = %s\n", device);
}
if ( (ioctl(fefd,FE_GET_INFO, &fe_info) < 0)){
fprintf(stderr, "FE_GET_INFO failed\n");
return 1;
}
if(fe_info.type != FE_OFDM){
fprintf(stderr, "type is not FE_OFDM\n");
return 1;
}
fprintf(stderr,"Using DVB card \"%s\"\n",fe_info.name);
if( (fe_freq = atoi(channel)) == 0){
fprintf(stderr, "fe_freq is not number\n");
return 1;
}
prop[0].cmd = DTV_FREQUENCY;
prop[0].u.data = (fe_freq * 6000 + 395143) * 1000;
#ifdef DTV_STREAM_ID
prop[1].cmd = DTV_STREAM_ID;
#else
prop[1].cmd = DTV_ISDBS_TS_ID;
#endif
prop[1].u.data = 0;
prop[2].cmd = DTV_TUNE;
fprintf(stderr,"tuning to %d kHz\n",prop[0].u.data / 1000);
props.props = prop;
props.num = 3;
if (ioctl(fefd, FE_SET_PROPERTY, &props) == -1) {
perror("ioctl FE_SET_PROPERTY\n");
return 1;
}
pfd[0].fd = fefd;
pfd[0].events = POLLIN;
event.status=0;
fprintf(stderr,"polling");
for (i = 0; (i < 5) && ((event.status & FE_TIMEDOUT)==0) && ((event.status & FE_HAS_LOCK)==0); i++) {
fprintf(stderr,".");
if (poll(pfd,1,5000)){
if (pfd[0].revents & POLLIN){
if ((rc = ioctl(fefd, FE_GET_EVENT, &event)) < 0){
if (errno != EOVERFLOW) {
perror("ioctl FE_GET_EVENT");
fprintf(stderr,"status = %d\n", rc);
fprintf(stderr,"errno = %d\n", errno);
return -1;
}
else fprintf(stderr,"\nOverflow error, trying again (status = %d, errno = %d)", rc, errno);
}
}
}
}
if ((event.status & FE_HAS_LOCK)==0) {
fprintf(stderr, "\nCannot lock to the signal on the given channel\n");
return 1;
} else fprintf(stderr, "ok\n");
if(dmxfd == 0){
sprintf(device, "/dev/dvb/adapter%d/demux0", dev_num);
if((dmxfd = open(device,O_RDWR)) < 0){
dmxfd = 0;
fprintf(stderr, "cannot open demux device\n");
return 1;
}
}
filter.pid = 0x2000;
filter.input = DMX_IN_FRONTEND;
filter.output = DMX_OUT_TS_TAP;
// filter.pes_type = DMX_PES_OTHER;
filter.pes_type = DMX_PES_VIDEO;
filter.flags = DMX_IMMEDIATE_START;
if (ioctl(dmxfd, DMX_SET_PES_FILTER, &filter) == -1) {
fprintf(stderr,"FILTER %i: ", filter.pid);
perror("ioctl DMX_SET_PES_FILTER");
close(dmxfd);
dmxfd = 0;
return 1;
}
if(tdata->tfd < 0){
sprintf(device, "/dev/dvb/adapter%d/dvr0", dev_num);
if((tdata->tfd = open(device,O_RDONLY)) < 0){
// if((tdata->tfd = open(device,O_RDONLY|O_NONBLOCK)) < 0){
fprintf(stderr, "cannot open dvr device\n");
close(dmxfd);
dmxfd = 0;
return 1;
}
}
if(!tdata->tune_persistent) {
/* show signal strength */
calc_cn();
}
return 0; /* success */
}
|
/**
* Copyright (C) 2012 by INdT
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
* @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
*/
#ifndef _SPRITESHEET_H_
#define _SPRITESHEET_H_
#include "quasipainteditem.h"
#include <QtCore/QtGlobal>
class QPixmap;
class SpriteSheet : public QuasiPaintedItem
{
Q_OBJECT
Q_PROPERTY(int frame READ frame WRITE setFrame NOTIFY frameChanged)
public:
SpriteSheet(QuasiDeclarativeItem *parent = 0);
QString source() const;
void setSource(const QString &source);
int frames() const;
void setFrames(const int &frames);
int frame() const;
void setFrame(const int &frame);
int initialFrame() const;
void setInitialFrame(const int &initialFrame);
bool verticalMirror() const;
void setVerticalMirror(const bool &verticalMirror);
bool horizontalMirror() const;
void setHorizontalMirror(const bool &horizontalMirror);
void paint(QPainter *painter);
signals:
void sourceChanged();
void framesChanged();
void frameChanged();
void initialFrameChanged();
private:
void updateSizeInfo();
private:
QPixmap *m_pixMap;
QString m_source;
int m_frames;
int m_frame;
int m_initialFrame;
int m_frameWidth;
int m_vertical;
int m_horizontal;
bool m_mirror;
};
#endif /* _SPRITESHEET_H_ */
|
#include "readv.h"
#include "../base.h"
#include "../errno.h"
#include <linux-syscalls/linux.h>
long sys_readv(int fd, struct iovec* iovp, unsigned int len)
{
return sys_readv_nocancel(fd, iovp, len);
}
long sys_readv_nocancel(int fd, struct iovec* iovp, unsigned int len)
{
int ret;
ret = LINUX_SYSCALL3(__NR_readv, fd, iovp, len);
if (ret < 0)
return errno_linux_to_bsd(ret);
return ret;
}
|
/*
This source file is part of Rigs of Rods
Copyright 2005-2012 Pierre-Michel Ricordel
Copyright 2007-2012 Thomas Fischer
For more information, see http://www.rigsofrods.com/
Rigs of Rods 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.
Rigs of Rods 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 Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __AEROENGINE_H_
#define __AEROENGINE_H_
#include "RoRPrerequisites.h"
class AeroEngine
{
friend class RigInspector;
public:
enum {AEROENGINE_TYPE_TURBOPROP, AEROENGINE_TYPE_TURBOJET};
virtual ~AeroEngine() {};
virtual void updateVisuals()=0;
virtual void updateForces(float dt, int doUpdate)=0;
virtual void setThrottle(float val)=0;
virtual float getThrottle()=0;
virtual void reset()=0;
virtual void toggleReverse()=0;
virtual void flipStart()=0;
virtual float getRPMpc()=0;
virtual float getRPM()=0;
virtual void setRPM(float _rpm)=0;
virtual float getpropwash()=0;
virtual Ogre::Vector3 getAxis()=0;
virtual bool isFailed()=0;
virtual int getType()=0;
virtual bool getIgnition()=0;
virtual int getNoderef()=0;
virtual bool getWarmup()=0;
virtual float getRadius()=0;
};
#endif // __AEROENGINE_H_
|
/*
* This file is part of AQUAgpusph, a free CFD program based on SPH.
* Copyright (C) 2012 Jose Luis Cercos Pita <jl.cercos@upm.es>
*
* AQUAgpusph 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.
*
* AQUAgpusph 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 AQUAgpusph. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
* @brief Set all the components of an array with the desired value.
* (See Aqua::CalcServer::Set for details)
* @note Hardcoded versions of the files CalcServer/Set.cl.in and
* CalcServer/Set.hcl.in are internally included as a text array.
*/
#ifndef SET_H_INCLUDED
#define SET_H_INCLUDED
#include <CalcServer.h>
#include <CalcServer/Tool.h>
namespace Aqua{ namespace CalcServer{
/** @class Set Set.h CalcServer/Set.h
* @brief Set all the components of an array with the desired value.
*/
class Set : public Aqua::CalcServer::Tool
{
public:
/** Constructor.
* @param name Tool name.
* @param var_name Variable to set.
* @param value Value to set.
* @note Some helpers are available for value:
* - VEC_ZERO: Zeroes vector.
* - VEC_ONE: Ones vector, in 3D cases the last component will be zero.
* - VEC_ALL_ONE: Equal to VEC_ONE, but in 3D cases the last component will be one as well.
* - VEC_INFINITY: INFINITY components vector, in 3D cases the last component will be zero.
* - VEC_ALL_INFINITY: Equal to VEC_INFINITY, but in 3D cases the last component will be INFINITY as well.
* - VEC_NEG_INFINITY: -VEC_INFINITY
* - VEC_ALL_NEG_INFINITY: -VEC_ALL_INFINITY.
*/
Set(const char *name, const char *var_name, const char *value);
/** Destructor.
*/
~Set();
/** Initialize the tool.
* @return false if all gone right, true otherwise.
*/
bool setup();
protected:
/** Compute the reduction.
* @return false if all gone right, true otherwise.
*/
bool _execute();
private:
/** Get the input variable
* @return false if all gone right, true otherwise
*/
bool variable();
/** Setup the OpenCL stuff
* @return false if all gone right, true otherwise.
*/
bool setupOpenCL();
/** Compile the source code and generate the corresponding kernel
* @param source Source code to be compiled.
* @return Kernel instance, NULL if error happened.
*/
cl_kernel compile(const char* source);
/** Update the input looking for changed value.
* @return false if all gone right, true otherwise.
*/
bool setVariables();
/// Input variable name
char* _var_name;
/// Value to set
char* _value;
/// Input variable
InputOutput::ArrayVariable *_var;
/// Memory object sent
cl_mem _input;
/// OpenCL kernel
cl_kernel _kernel;
/// Global work sizes in each step
size_t _global_work_size;
/// Local work sizes in each step
size_t _local_work_size;
/// Number of elements
unsigned int _n;
};
}} // namespace
#endif // SET_H_INCLUDED
|
// AIServerTestDemoDlg.h : Í·Îļþ
//
#pragma once
#include "HttpAPIServer.h"
#include "afxwin.h"
#include "Resource.h"
class CHttpAPIServer;
// CAIServerTestDemoDlg ¶Ô»°¿ò
class CAIServerTestDemoDlg : public CDialogEx
{
// ¹¹Ôì
public:
CAIServerTestDemoDlg(CWnd* pParent = NULL); // ±ê×¼¹¹Ô캯Êý
// ¶Ô»°¿òÊý¾Ý
enum { IDD = IDD_AISERVERTESTDEMO_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Ö§³Ö
public:
void ShowAPIBCKMessage(const char* strBCKMsg);
void SendCallBackMessage(const char* host, const char* message);
// ʵÏÖ
protected:
HICON m_hIcon;
// Éú³ÉµÄÏûÏ¢Ó³É亯Êý
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
private:
CHttpAPIServer* m_pAPIServer;
public:
afx_msg void OnClose();
afx_msg void OnDestroy();
afx_msg void OnBnClickedButton1();
CEdit m_pFileEdit;
CStatic m_pShowMsg;
afx_msg void OnBnClickedButton2();
afx_msg void OnBnClickedButton3();
CEdit m_pCollectUsr;
CEdit m_pVerNum;
CEdit m_pVerthresold;
CEdit m_pEditServerAPIPath;
CEdit m_pEditVerPicPath;
afx_msg void OnBnClickedButton4();
CEdit m_p264verNum;
CEdit m_p264verthrold;
CEdit m_p264verAuidoID;
CEdit m_p264verVideoID;
CEdit m_p264verNodeID;
CEdit m_p264verMcuIp;
CEdit m_p264verMcuPort;
CEdit m_p264verMcuID;
CEdit m_p264verLocalport;
CEdit m_p264verLocalIp;
CEdit m_p264verNatport;
CEdit m_p264verNatIp;
afx_msg void OnBnClickedButton5();
CEdit m_pEditLocalHttpIP;
CEdit m_pEditStartVerHttpAPI;
CEdit m_pEditStopVerHttpAPI;
afx_msg void OnBnClickedButton7();
afx_msg void OnBnClickedButton6();
};
|
// Copyright (c) 2010 Google Inc.
// 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 Google Inc. 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
// 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.
//
// source_line_resolver_base.h: SourceLineResolverBase, an (incomplete)
// implementation of SourceLineResolverInterface. It serves as a common base
// class for concrete implementations: FastSourceLineResolver and
// BasicSourceLineResolver. It is designed for refactoring that removes
// code redundancy in the two concrete source line resolver classes.
//
// See "google_breakpad/processor/source_line_resolver_interface.h" for more
// documentation.
// Author: Siyang Xie (lambxsy@google.com)
#ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__
#define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__
#include <map>
#include <set>
#include <string>
#include "google_breakpad/processor/source_line_resolver_interface.h"
namespace google_breakpad {
using std::map;
using std::set;
// Forward declaration.
// ModuleFactory is a simple factory interface for creating a Module instance
// at run-time.
class ModuleFactory;
class SourceLineResolverBase : public SourceLineResolverInterface {
public:
// Read the symbol_data from a file with given file_name.
// The part of code was originally in BasicSourceLineResolver::Module's
// LoadMap() method.
// Place dynamically allocated heap buffer in symbol_data. Caller has the
// ownership of the buffer, and should call delete [] to free the buffer.
static bool ReadSymbolFile(const string& file_name,
char** symbol_data,
size_t* symbol_data_size);
protected:
// Users are not allowed create SourceLineResolverBase instance directly.
SourceLineResolverBase(ModuleFactory* module_factory);
virtual ~SourceLineResolverBase();
// Virtual methods inherited from SourceLineResolverInterface.
virtual bool LoadModule(const CodeModule* module, const string& map_file);
virtual bool LoadModuleUsingMapBuffer(const CodeModule* module,
const string& map_buffer);
virtual bool LoadModuleUsingMemoryBuffer(const CodeModule* module,
char* memory_buffer,
size_t memory_buffer_size);
virtual bool ShouldDeleteMemoryBufferAfterLoadModule();
virtual void UnloadModule(const CodeModule* module);
virtual bool HasModule(const CodeModule* module);
virtual bool IsModuleCorrupt(const CodeModule* module);
virtual void FillSourceLineInfo(StackFrame* frame);
virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame);
virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame);
// Nested structs and classes.
struct Line;
struct Function;
struct PublicSymbol;
struct CompareString {
bool operator()(const string& s1, const string& s2) const;
};
// Module is an interface for an in-memory symbol file.
class Module;
class AutoFileCloser;
// All of the modules that are loaded.
typedef map<string, Module*, CompareString> ModuleMap;
ModuleMap* modules_;
// The loaded modules that were detecting to be corrupt during load.
typedef set<string, CompareString> ModuleSet;
ModuleSet* corrupt_modules_;
// All of heap-allocated buffers that are owned locally by resolver.
typedef std::map<string, char*, CompareString> MemoryMap;
MemoryMap* memory_buffers_;
// Creates a concrete module at run-time.
ModuleFactory* module_factory_;
private:
// ModuleFactory needs to have access to protected type Module.
friend class ModuleFactory;
// Disallow unwanted copy ctor and assignment operator
SourceLineResolverBase(const SourceLineResolverBase&);
void operator=(const SourceLineResolverBase&);
};
} // namespace google_breakpad
#endif // GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__
|
//
// NSObject+KCObjectInfo.h
// kerkee
//
// Created by zihong on 15/8/25.
// Copyright (c) 2015年 zihong. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CGGeometry.h>
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
#define KC_VALUE(struct) ({ __typeof__(struct) __struct = struct; [NSValue valueWithBytes:&__struct objCType:@encode(__typeof__(__struct))]; })
#define KC_MAKELIVE(_CLASSNAME_) Class _CLASSNAME_ = NSClassFromString((NSString *)CFSTR(#_CLASSNAME_));
#define KC_VERIFIED_CLASS(_CLASSNAME_) ((_CLASSNAME_ *) NSClassFromString(@"" # _CLASSNAME_))
typedef IMP *IMPPointer;
BOOL class_swizzleMethodAndStore(Class aClass, SEL aOriginal, IMP aReplacement, IMPPointer aStore);
@interface NSObject (KCObjectInfo)
// A work in progress
+ (NSString *) kc_typeForString: (const char *) aTypeName;
// Return all superclasses of class or object
+ (NSArray *) kc_superclasses;
- (NSArray *) kc_superclasses;
// Examine
+ (NSString *) kc_dump;
- (NSString *) kc_dump;
// Access to object essentials for run-time checks. Stored by class in dictionary.
// Return an array of all an object's selectors
+ (NSArray *) kc_getMetaSelectorListForClass;
+ (NSArray *) kc_getSelectorListForClass;
+ (NSArray *) kc_getPropertyListForClass;
+ (NSArray *) kc_getIvarListForClass;
+ (NSArray *) kc_getProtocolListForClass;
// Return a dictionary with class/selectors entries, all the way up to NSObject
@property (readonly) NSDictionary *kc_selectors;
@property (readonly) NSDictionary *kc_properties; //you can see KCProperty class
@property (readonly) NSDictionary *kc_ivars;
@property (readonly) NSDictionary *kc_protocols;
// Check for properties, ivar. Use respondsToSelector: and conformsToProtocol: as well
- (BOOL) kc_hasProperty: (NSString *) aPropertyName;
- (BOOL) kc_hasIvar: (NSString *) aIvarName;
+ (BOOL) kc_classExists: (NSString *) aClassName;
+ (id) kc_instanceOfClassNamed: (NSString *) aClassName;
+ (void)kc_swizzleMethod:(SEL)aOrigSel withMethod:(SEL)aAltSel;
+ (BOOL)kc_swizzle:(SEL)aOriginal with:(IMP)aReplacement store:(IMPPointer)aStore;
+ (void)kc_exchangeMethond:(SEL)aSel1 :(SEL)aSel2;
+(IMP)kc_replaceMethod :(SEL)aOldMethond :(IMP)aNewIMP;
@end
// Method swizzling
void KCSwapClassMethods(Class cls, SEL original, SEL replacement);
void KCSwapInstanceMethods(Class cls, SEL original, SEL replacement);
// Module subclass support
BOOL KCClassOverridesClassMethod(Class cls, SEL selector);
BOOL KCClassOverridesInstanceMethod(Class cls, SEL selector);
|
/* ------------------------------------------------------------------
* GEM - Graphics Environment for Multimedia
*
* Copyright (c) 2002-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at
* zmoelnig@iem.kug.ac.at
* For information on usage and redistribution, and for a DISCLAIMER
* OF ALL WARRANTIES, see the file, "GEM.LICENSE.TERMS"
*
* this file has been generated...
* ------------------------------------------------------------------
*/
#ifndef _INCLUDE__GEM_OPENGL_GEMGLCLEARSTENCIL_H_
#define _INCLUDE__GEM_OPENGL_GEMGLCLEARSTENCIL_H_
#include "Base/GemGLBase.h"
/*
CLASS
GEMglClearStencil
KEYWORDS
openGL 0
DESCRIPTION
wrapper for the openGL-function
"glClearStencil( GLint s)"
*/
class GEM_EXTERN GEMglClearStencil : public GemGLBase
{
CPPEXTERN_HEADER(GEMglClearStencil, GemGLBase);
public:
// Constructor
GEMglClearStencil (t_float); // CON
protected:
// Destructor
virtual ~GEMglClearStencil ();
// Do the rendering
virtual void render (GemState *state);
// variables
GLint s; // VAR
virtual void sMess(t_float); // FUN
private:
// we need some inlets
t_inlet *m_inlet[1];
// static member functions
static void sMessCallback (void*, t_floatarg);
};
#endif // for header file
|
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef DETXMLFILE_H
#define DETXMLFILE_H
#include <QList>
#include <QString>
#include <vector>
namespace MantidQt {
namespace MantidWidgets {
/**
A class for creating grouping xml files
*/
class DetXMLFile {
public:
enum Option { List, Sum };
/// Create a grouping file to extract all detectors in detector_list excluding
/// those in exclude
DetXMLFile(const std::vector<int> &detector_list, const QList<int> &exclude,
const QString &fname);
/// Create a grouping file to extract detectors in dets. Option List - one
/// group - one detector,
/// Option Sum - one group which is a sum of the detectors
/// If fname is empty create a temporary file
DetXMLFile(const QList<int> &dets, Option opt = List,
const QString &fname = "");
/// Destructor
~DetXMLFile();
/// Make grouping file where each detector is put into its own group
void makeListFile(const QList<int> &dets);
/// Make grouping file for putting the detectors into one group (summing the
/// detectors)
void makeSumFile(const QList<int> &dets);
/// Return the name of the created grouping file
const std::string operator()() const { return m_fileName.toStdString(); }
private:
QString m_fileName; ///< holds the grouping file name
bool m_delete; ///< if true delete the file on destruction
};
} // namespace MantidWidgets
} // namespace MantidQt
#endif // DETXMLFILE_H
|
/* ----------------------------------------------------------------------
* I-SIMPA (http://i-simpa.ifsttar.fr). This file is part of I-SIMPA.
*
* I-SIMPA is a GUI for 3D numerical sound propagation modelling dedicated
* to scientific acoustic simulations.
* Copyright (C) 2007-2014 - IFSTTAR - Judicael Picaut, Nicolas Fortin
*
* I-SIMPA 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.
*
* I-SIMPA 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
* see <http://ww.gnu.org/licenses/>
*
* For more information, please consult: <http://i-simpa.ifsttar.fr> or
* send an email to i-simpa@ifsttar.fr
*
* To contact Ifsttar, write to Ifsttar, 14-20 Boulevard Newton
* Cite Descartes, Champs sur Marne F-77447 Marne la Vallee Cedex 2 FRANCE
* or write to scientific.computing@ifsttar.fr
* ----------------------------------------------------------------------*/
#include "first_header_include.hpp"
#include "data_manager/element.h"
#ifndef __ELEMENT_PROPERTY_MATERIAL_ADVANCED__
#define __ELEMENT_PROPERTY_MATERIAL_ADVANCED__
/** \file e_scene_volumes.h
\brief Dans ce dossier se trouve tout les volumes détéctés par l'interface.
*/
/**
\brief Dans ce dossier se trouve tout les volumes détéctés par l'interface.
*/
class E_Scene_Bdd_Materiaux_PropertyMaterial_Adv: public Element
{
public:
E_Scene_Bdd_Materiaux_PropertyMaterial_Adv( wxXmlNode* noeudCourant , Element* parent);
E_Scene_Bdd_Materiaux_PropertyMaterial_Adv( Element* parent);
// Sauvegarde des informations à destination des moteurs de calculs
virtual Element* AppendFilsByType(ELEMENT_TYPE etypefils,const wxString& libelle="");
wxXmlNode* SaveXMLCoreDoc(wxXmlNode* NoeudParent);
//wxXmlNode* SaveXMLCoreDoc(wxXmlNode* NoeudParent);
wxXmlNode* SaveXMLDoc(wxXmlNode* NoeudParent);
void OnRightClic(wxMenu* leMenu);
void AddCustomBRDF();
void AddCustomBRDFSamplingMehtods();
void AddCustomBRDFExpnentFactor();
};
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.