text stringlengths 4 6.14k |
|---|
/* Copyright 2011 ENSEIRB, INRIA & CNRS
**
** This file is part of the Scotch software package for static mapping,
** graph partitioning and sparse matrix ordering.
**
** This software is governed by the CeCILL-C license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-C license and that you accept its terms.
*/
/************************************************************/
/** **/
/** NAME : library_graph_coarsen.c **/
/** **/
/** AUTHOR : Francois PELLEGRINI **/
/** **/
/** FUNCTION : This module is the API for the graph **/
/** coarsening routine of the libSCOTCH **/
/** library. **/
/** **/
/** DATES : # Version 5.1 : from : 07 aug 2011 **/
/** to 07 aug 2011 **/
/** **/
/************************************************************/
/*
** The defines and includes.
*/
#define LIBRARY
#include "module.h"
#include "common.h"
#include "graph.h"
#include "graph_coarsen.h"
#include "scotch.h"
/*********************************/
/* */
/* This routine is the C API for */
/* the graph coarsening routine. */
/* */
/*********************************/
/*+ This routine creates a coarse graph from the
*** given fine graph, unless the coarse graph is
*** smaller than some threshold size or the
*** coarsening ratio is above some other threshold.
*** If the coarse graph is created, a coarse-to-fine
*** vertex array is created, that contains a pair of
*** fine indices for each coarse index. The contents
*** of the Scotch internal array are copied to the
*** array provided by the user.
*** It returns:
*** - 0 : if the graph has been coarsened.
*** - 1 : if the graph could not be coarsened.
*** - 2 : on error.
+*/
int
SCOTCH_graphCoarsen (
const SCOTCH_Graph * restrict const finegrafptr, /* Fine graph structure to fill */
SCOTCH_Graph * restrict const coargrafptr, /* Coarse graph */
SCOTCH_Num * restrict const coarmulttab, /* Pointer to multinode array */
const SCOTCH_Num coarnbr, /* Minimum number of coarse vertices */
const double coarrat) /* Maximum contraction ratio */
{
GraphCoarsenMulti * restrict coarmultptr;
int o;
o = graphCoarsen ((const Graph * restrict const) finegrafptr, (Graph * restrict const) coargrafptr,
&coarmultptr, coarnbr, coarrat, GRAPHCOARHEM);
if (o == 0) { /* If coarsening succeeded */
SCOTCH_Num coarvertnbr;
SCOTCH_graphSize (coargrafptr, &coarvertnbr, NULL); /* Get number of coarse vertices */
memCpy (coarmulttab, coarmultptr, coarvertnbr * 2 * sizeof (Gnum));
}
return (o);
}
|
/**************************************************
* $Id: bof.h,v 1.5 2006/10/31 07:28:57 skhay Exp $
* File : bof.h
* Author: Hayden So
* Date : 01/11/2006
* Description:
* header file for the BOF file format
**************************************************/
#ifndef _BOF_H_
#define _BOF_H_
// #include <linux/borph.h>
/******************** Main BOF header ******************
* It MUST be at most 52 bytes long. i.e. it MUST be the exact
* same size as a elf header Elf32_EHdr
*******************************************************/
struct bofhdr {
unsigned char ident[16];
uint32_t b_version;
uint16_t b_machine;
uint16_t b_elfmachine;
uint32_t b_numchip;
uint32_t b_elfoff; // offset of elf header from beginning of file
uint32_t b_hwoff; // offset of the 1st hwregion from beginning of file
int32_t load_err;
uint32_t b_ekver; // embedded kernel version
uint32_t pad[2];
};
/* position of various misc identifying info within ident */
#define BI_ENDIAN 5
#define BOFDATA2LSB 1
#define BOFDATA2MSB 2
/* legal values for b_machine */
#define BM_BEE2 2
#define BM_ROACH 3
/***********************
* header per hw region
***********************/
struct hwr_addr {
uint16_t class;
uint16_t addr;
};
#define HAC_BEE2FPGA 0x1
#define HAC_PRMOD 0x2
#define HAC_ROACH 0x3
/* hwrhdr flags */
#define HFG_PLACED 0x1
#define HFG_NOCONFIG 0x2
struct hwrhdr {
uint32_t flag;
struct hwr_addr addr; /* address of placed */
uint32_t pl_off; /* payload offset */
uint32_t pl_len; /* payload len */
uint32_t nr_symbol;
uint32_t strtab_off; /* string table offset */
uint32_t next_hwr; /* next hw_region on file */
// HHH and more info about register mapping, etc
};
#define IORM_READ 1
#define IORM_WRITE 2
#define IORM_READWRITE 3
#define IORM_PIPE 4
struct bofioreg {
uint16_t name; //offset into strtab where this name can be found
uint16_t mode;
uint32_t loc;
uint32_t len;
};
#endif /* _BOF_H_ */
|
// -*- C++ -*-
//
// SimpleKTCut.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef THEPEG_SimpleKTCut_H
#define THEPEG_SimpleKTCut_H
//
// This is the declaration of the SimpleKTCut class.
//
#include "ThePEG/Cuts/OneCutBase.h"
namespace ThePEG {
/**
* This is a very simple concrete sub-class of OneCutbase simply
* requiring a minimum transverse momentum of any outgoing
* particle. It is also possible to require a minimum and maximum
* pseudorapidity. Optionally the restrictions only apply to particles
* matching a specific matcher object.
*
* @see \ref SimpleKTCutInterfaces "The interfaces"
* defined for SimpleKTCut.
*/
class SimpleKTCut: public OneCutBase {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
SimpleKTCut(Energy minKT=10*GeV)
: theMinKT(minKT), theMaxKT(Constants::MaxEnergy),
theMinEta(-Constants::MaxRapidity),
theMaxEta(Constants::MaxRapidity) {}
/**
* The destructor.
*/
virtual ~SimpleKTCut();
//@}
public:
/** @name Overwritten virtual functions defined in the base class. */
//@{
/**
* Return the minimum allowed value of the transverse momentum of an
* outgoing parton.
*/
virtual Energy minKT(tcPDPtr p) const;
/**
* Return the minimum allowed pseudo-rapidity of an outgoing parton
* of the given type. The pseudo-rapidity is measured in the lab
* system.
*/
virtual double minEta(tcPDPtr p) const;
/**
* Return the maximum allowed pseudo-rapidity of an outgoing parton
* of the given type. The pseudo-rapidity is measured in the lab
* system.
*/
virtual double maxEta(tcPDPtr p) const;
/**
* Return true if a particle with type \a ptype and momentum \a p
* passes the cuts. The \a parent contains information about the
* kinematics of the hard sub-process.
*/
virtual bool passCuts(tcCutsPtr parent,
tcPDPtr ptype, LorentzMomentum p) const;
//@}
/**
* Describe the currently active cuts in the log file.
*/
virtual void describe() const;
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* The standard Init function used to initialize the interfaces.
* Called exactly once for each class by the class description system
* before the main function starts or
* when this class is dynamically loaded.
*/
static void Init();
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
virtual IBPtr clone() const;
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
virtual IBPtr fullclone() const;
//@}
private:
/**
* Helper function used by the interface.
*/
Energy maxKTMin() const;
/**
* Helper function used by the interface.
*/
Energy minKTMax() const;
/**
* Helper function used by the interface.
*/
double maxEtaMin() const;
/**
* Helper function used by the interface.
*/
double minEtaMax() const;
private:
/**
* The minimum allowed value of the transverse momentum of an
* outgoing parton.
*/
Energy theMinKT;
/**
* The maximum allowed value of the transverse momentum of an
* outgoing parton.
*/
Energy theMaxKT;
/**
* The minimum allowed pseudo-rapidity of an outgoing parton. The
* pseudo-rapidity is measured in the lab system.
*/
double theMinEta;
/**
* The maximum allowed pseudo-rapidity of an outgoing parton. The
* pseudo-rapidity is measured in the lab system.
*/
double theMaxEta;
/**
* If non-null only particles matching this object will be affected
* by this cut.
*/
PMPtr theMatcher;
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static ClassDescription<SimpleKTCut> initSimpleKTCut;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
SimpleKTCut & operator=(const SimpleKTCut &);
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of SimpleKTCut. */
template <>
struct BaseClassTrait<SimpleKTCut,1> {
/** Typedef of the first base class of SimpleKTCut. */
typedef OneCutBase NthBase;
};
/** This template specialization informs ThePEG about the name of
* the SimpleKTCut class and the shared object where it is defined. */
template <>
struct ClassTraits<SimpleKTCut>
: public ClassTraitsBase<SimpleKTCut> {
/** Return a platform-independent class name */
static string className() { return "ThePEG::SimpleKTCut"; }
/** Return the name of the shared library be loaded to get
* access to the SimpleKTCut class and every other class it uses
* (except the base class). */
static string library() { return "SimpleKTCut.so"; }
};
/** @endcond */
}
#endif /* THEPEG_SimpleKTCut_H */
|
#import "UdpPacket.h"
@interface MissionPacket : UdpPacket
- (instancetype) initWithUnits:( NSMutableArray *)units;
@end
|
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
// include, we are testing static methods
#include "tp_timer.c"
static struct timeval tv_exp1;
void callback1(time_evt_t *te, void *ptr)
{
assert_int_equal(ptr, 1000);
assert_int_equal(te->tv.tv_sec, tv_exp1.tv_sec);
assert_int_equal(te->tv.tv_usec, tv_exp1.tv_usec);
}
static int ptr_exp2;
static struct timeval tv_exp2;
void callback2(time_evt_t *te, void *ptr)
{
int r = ptr - NULL;
assert_true(r == 0x100 || r == 0x200);
ptr_exp2 |= r;
assert_int_equal(te->tv.tv_sec, tv_exp2.tv_sec);
assert_int_equal(te->tv.tv_usec, tv_exp2.tv_usec);
}
/// test few results known as good
static void test_t1(void **state)
{
(void) state; // unused
ptr_exp2 = 0;
tv_exp1.tv_sec = 0;
tv_exp1.tv_usec = 0;
tv_exp2.tv_sec = 0;
tv_exp2.tv_usec = 0;
tp_timer_t *timer = tp_timer_create();
assert_non_null(timer);
assert_true(tp_timer_register(timer, callback1, (void *)1000));
tv_exp1.tv_usec = 1;
tp_timer_tick(timer, false, 1);
tp_timer_cancel(timer, callback1, (void *)1000);
assert_true(tp_timer_register(timer, callback1, (void *)1000));
assert_false(tp_timer_register(timer, callback1, (void *)1000));
assert_true(tp_timer_register(timer, callback2, (void *)0x100));
assert_true(tp_timer_register(timer, callback2, (void *)0x200));
tp_timer_cancel(timer, callback1, (void *)1000);
tp_timer_cancel(timer, callback1, (void *)1000);
tv_exp1.tv_usec = -1;
tv_exp2.tv_usec = 3;
tp_timer_tick(timer, false, 2);
assert_int_equal(ptr_exp2, 0x300);
tp_timer_destroy(timer);
}
int main(void)
{
const UnitTest tests[] = {
unit_test(test_t1),
};
return run_tests(tests);
}
|
/**
* @file OptionType.h
* @author Thomas Saquet, Florent Poinsaut
* @date
* @brief File containing example of doxygen usage for quick reference.
*
* Alert - Dbo is the database objects library, part of the Alert software
* Copyright (C) 2013-2017
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef OPTIONTYPE_H
#define OPTIONTYPE_H
#include "tools/MainIncludeFile.h"
namespace Echoes
{
namespace Dbo
{
class OptionType : public Table
{
public:
OptionType();
virtual ~OptionType();
static std::string TRIGRAM;
Wt::Dbo::collection<Wt::Dbo::ptr<PackOption> > packOptions;
Wt::Dbo::collection<Wt::Dbo::ptr<Option> > options;
template<class Action>
void persist(Action& a)
{
mapClassAttributesStrings["NAME"] = &this->name;
Table::fieldFiller(a, *this);
Wt::Dbo::hasMany(a, packOptions, Wt::Dbo::ManyToOne, TRIGRAM_PACK_OPTION SEP TRIGRAM_OPTION_TYPE);
Wt::Dbo::hasMany(a, options, Wt::Dbo::ManyToOne, TRIGRAM_OPTION SEP TRIGRAM_OPTION_TYPE);
}
protected:
private:
};
}
}
#endif // OPTIONTYPE_H
|
#ifndef NESJOYADAPTER_h
#define NESJOYADAPTER_h
#include <Joystick.h>
class NESAdapter {
private:
Joystick_ joy;
bool changed;
int x, y;
bool a, b, start, select, l, r;
public:
NESAdapter(int joyId);
void begin();
void reset();
void setA(bool pushed);
void setB(bool pushed);
void setStart(bool pushed);
void setSelect(bool pushed);
void setY(int y);
void setX(int x);
void setL(bool pushed);
void setR(bool pushed);
void sendState();
};
#endif
|
// Scene.h
#ifndef __Scene_h
#define __Scene_h
#include "AbstractScene.h"
#include "Quaternion.h"
class Scene : public AbstractScene
{
public:
Scene();
virtual ~Scene();
// set fovy angle
void SetFovy(float fovy);
// set params for roate amd zoom (debugging for rendering)
void SetRotateRadPerPixel(float radPerPixel) { m_RadPerPixel=radPerPixel;}
float GetRotateRadPerPixel() { return m_RadPerPixel; }
void SetScaleRatePerPixel(float scaleRatePerPixel) { m_ScaleRatePerPixel=scaleRatePerPixel;}
float GetScaleRatePerPixel() { return m_ScaleRatePerPixel; }
// current parames and statues
void GetTranslate(float translate[3]);//maybe useful!
float GetScale() { return m_Scale;}
const Quaternion& GetRotation() { return m_Rotation; }
void SetTranslate(const float translate[3]);
void SetScale(float scale);
void SetRotation(const Quaternion& rotation);
// current matrix
const Matrix4x4& GetViewMatrix();
const Matrix4x4& GetProjectionMatrix();
// z distance, the x-ray source to isocenter of volume
float GetZTranslateBase() { return m_ZTranslateBase;}
// size of view port
void GetViewPort(int* viewport) { viewport[0]=m_ViewPort[0]; viewport[1]=m_ViewPort[1]; }
virtual void Resize(int width, int height);
protected:
// render context
virtual void RenderContent();
// box (ROI) for object
virtual void GetSize3D(float size3D[3]);
void SetSize3DModified();
int m_OldMouseX,m_OldMouseY;
public:
// initialization
void _calculateCamera();
// update the matrix
void _calculateMatrix();
// reference point
void _makeReference();
public:
// size of view port
int m_ViewPort[2];
//float m_Fovy;
// nearest plane and farest plane
float m_Near, m_Far;
// z offset
float m_ZTranslateBase;
// translate, scale, and rotation
float m_Translate[3];
float m_Scale;
Quaternion m_Rotation;
// tag for whether update is needed?
bool m_NeedCalculateCamera; // initialization again
bool m_NeedCalculateMatrix; // recomputing matrix
// matrix
Matrix4x4 m_ViewMatrix;
Matrix4x4 m_ProjectionMatrix;
////// params for interaction (in rendering)
float m_RadPerPixel;
float m_ScaleRatePerPixel;
float m_OldTranslate[3];
float m_OldScale;
Quaternion m_OldRotation;
bool m_Rotating;
bool m_Scaling;
bool m_Moving;
// distance
float m_sid;
float m_sdd;
double m_halfFrustumHeight;
double m_halfFrustumWidth;
double m_ds;
};
#endif |
//
// StreamView.h
// Moonlight
//
// Created by Cameron Gutman on 10/19/14.
// Copyright (c) 2014 Moonlight Stream. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ControllerSupport.h"
@protocol EdgeDetectionDelegate <NSObject>
- (void) edgeSwiped;
@end
@interface StreamView : UIView
- (void) setupOnScreenControls:(ControllerSupport*)controllerSupport swipeDelegate:(id<EdgeDetectionDelegate>)swipeDelegate;
- (void) setMouseDeltaFactors:(float)x y:(float)y;
@end
|
#pragma once
#include <fstream>
#include <string>
#include <sstream>
#include <map>
#include <vector>
using namespace std;
class CCallsignLookup
{
private:
std::map<string, string> callsigns;
public:
CCallsignLookup(string fileName);
string getCallsign(string airlineCode);
static bool Available;
static CCallsignLookup* Lookup;
~CCallsignLookup();
}; |
/**
* @file kpanic.h
*
* @author TacOS developers
*
* @section LICENSE
*
* Copyright (C) 2010-2015 TacOS developers.
*
* 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 at
* http://www.gnu.org/copyleft/gpl.html
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses>.
*
* @section DESCRIPTION
*
* @brief Handlers des exceptions.
*/
#ifndef _K_PANIC_H
#define _K_PANIC_H
#include <types.h>
/**
* Mise en place des handlers d'exceptions.
*/
void kpanic_init();
#endif
|
/***************************************************************************
* Copyright (C) 2012 by Leo Hoo *
* lion@9465.net *
* *
***************************************************************************/
#ifndef _Regex_base_H_
#define _Regex_base_H_
/**
@author Leo Hoo <lion@9465.net>
*/
#include "../object.h"
namespace fibjs
{
class Regex_base : public object_base
{
public:
// Regex_base
virtual result_t exec(const char* str, v8::Local<v8::Array>& retVal) = 0;
virtual result_t test(const char* str, bool& retVal) = 0;
virtual result_t get_lastIndex(int32_t& retVal) = 0;
virtual result_t set_lastIndex(int32_t newVal) = 0;
virtual result_t get_global(bool& retVal) = 0;
virtual result_t get_ignoreCase(bool& retVal) = 0;
virtual result_t get_multiline(bool& retVal) = 0;
DECLARE_CLASSINFO(Regex_base);
public:
static void s_exec(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_test(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_get_lastIndex(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args);
static void s_set_lastIndex(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void> &args);
static void s_get_global(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args);
static void s_get_ignoreCase(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args);
static void s_get_multiline(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args);
};
}
namespace fibjs
{
inline ClassInfo& Regex_base::class_info()
{
static ClassData::ClassMethod s_method[] =
{
{"exec", s_exec},
{"test", s_test}
};
static ClassData::ClassProperty s_property[] =
{
{"lastIndex", s_get_lastIndex, s_set_lastIndex},
{"global", s_get_global, block_set},
{"ignoreCase", s_get_ignoreCase, block_set},
{"multiline", s_get_multiline, block_set}
};
static ClassData s_cd =
{
"Regex", NULL,
2, s_method, 0, NULL, 4, s_property, NULL, NULL,
&object_base::class_info()
};
static ClassInfo s_ci(s_cd);
return s_ci;
}
inline void Regex_base::s_get_lastIndex(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args)
{
int32_t vr;
PROPERTY_ENTER();
PROPERTY_INSTANCE(Regex_base);
hr = pInst->get_lastIndex(vr);
METHOD_RETURN();
}
inline void Regex_base::s_set_lastIndex(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void> &args)
{
PROPERTY_ENTER();
PROPERTY_INSTANCE(Regex_base);
PROPERTY_VAL(int32_t);
hr = pInst->set_lastIndex(v0);
PROPERTY_SET_LEAVE();
}
inline void Regex_base::s_get_global(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args)
{
bool vr;
PROPERTY_ENTER();
PROPERTY_INSTANCE(Regex_base);
hr = pInst->get_global(vr);
METHOD_RETURN();
}
inline void Regex_base::s_get_ignoreCase(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args)
{
bool vr;
PROPERTY_ENTER();
PROPERTY_INSTANCE(Regex_base);
hr = pInst->get_ignoreCase(vr);
METHOD_RETURN();
}
inline void Regex_base::s_get_multiline(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args)
{
bool vr;
PROPERTY_ENTER();
PROPERTY_INSTANCE(Regex_base);
hr = pInst->get_multiline(vr);
METHOD_RETURN();
}
inline void Regex_base::s_exec(const v8::FunctionCallbackInfo<v8::Value>& args)
{
v8::Local<v8::Array> vr;
METHOD_INSTANCE(Regex_base);
METHOD_ENTER(1, 1);
ARG(arg_string, 0);
hr = pInst->exec(v0, vr);
METHOD_RETURN();
}
inline void Regex_base::s_test(const v8::FunctionCallbackInfo<v8::Value>& args)
{
bool vr;
METHOD_INSTANCE(Regex_base);
METHOD_ENTER(1, 1);
ARG(arg_string, 0);
hr = pInst->test(v0, vr);
METHOD_RETURN();
}
}
#endif
|
/******************************************************************************
* Spine Runtimes Software License
* Version 2.3
*
* Copyright (c) 2013-2015, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable and
* non-transferable license to use, install, execute and perform the Spine
* Runtimes Software (the "Software") and derivative works solely for personal
* or internal use. Without the written permission of Esoteric Software (see
* Section 2 of the Spine Software License Agreement), you may not (a) modify,
* translate, adapt or otherwise create derivative works, improvements of the
* Software or develop new applications using the Software or (b) remove,
* delete, alter or obscure any trademarks or any copyright, trademark, patent
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "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 ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef SPINE_EVENTDATA_H_
#define SPINE_EVENTDATA_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct spEventData {
const char* const name;
int intValue;
float floatValue;
const char* stringValue;
#ifdef __cplusplus
spEventData() :
name(0),
intValue(0),
floatValue(0),
stringValue(0) {
}
#endif
} spEventData;
spEventData* spEventData_create (const char* name);
void spEventData_dispose (spEventData* self);
#ifdef SPINE_SHORT_NAMES
typedef spEventData EventData;
#define EventData_create(...) spEventData_create(__VA_ARGS__)
#define EventData_dispose(...) spEventData_dispose(__VA_ARGS__)
#endif
#ifdef __cplusplus
}
#endif
#endif /* SPINE_EVENTDATA_H_ */
|
//讲分钟转换为小时+分钟
# include <stdio.h>
# define T 60
int main(void)
{
int m, h;
printf("分钟TO小时分钟\n请输入分钟数:\n");
while (scanf("%d", &m),m > 0){
printf("%dh%dmin\n", m/T, m%T);
printf("输入大于0的值以继续:\n");
}
return 0;
}
|
/*============================================================================*/
/** @file timeout.h
* @ingroup drivers
* @brief time elapsed routines.
*
* Creation Date: Sat - 1 january 2011
*
* @author Bart Houkes
*/
/*------------------------------------------------------------------------------
** Copyright (C) 2011, 2014, 2015
** Houkes Horeca Applications
**
** This file is part of the SDL2UI Library. This library 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, or (at your option)
** any later version.
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
** Under Section 7 of GPL version 3, you are granted additional
** permissions described in the GCC Runtime Library Exception, version
** 3.1, as published by the Free Software Foundation.
** You should have received a copy of the GNU General Public License and
** a copy of the GCC Runtime Library Exception along with this program;
** see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
** <http://www.gnu.org/licenses/>
**===========================================================================*/
#pragma once
/*------------- Standard includes --------------------------------------------*/
#include "my_thread.h"
/*------------- Necessary include files -------------------------------------*/
/*------------- External symbolic constants ---------------------------------*/
/*------------- External macros ---------------------------------------------*/
/*------------- Enum definitions --------------------------------------------*/
/*------------- Structure definitions ---------------------------------------*/
/*------------- External class declarations ---------------------------------*/
/*=============================================================================
* Ctimeout
*==========================================================================*/
/** Ctimeout
* Easy way to detect a timeout.
*/
/*===========================================================================*/
class Ctimeout : public CmyLock
{
public :
Ctimeout(void);
~Ctimeout(void);
public:
void setTime( int timeout, int margin, int minTries);
int running(void);
bool expired(void);
void setExpired(void);
static unsigned long GetTickCount();
void stop();
int elapsed(void);
private:
int m_startTime; ///< Start time value.
int m_timeout; ///< Time value.
bool m_detected; ///< Timeout detected.
int m_margin; ///< Margin.
int m_tries; ///< Number of checks.
int m_minRetries; ///< Minimum tries before timeout.
int m_lastElapsed; ///< For debugging only.
};
extern void delay( double milisec);
/*=============================================================================
** end of file
**===========================================================================*/
|
#include "reader_book_chunks.h"
int reader_books_db_init(APP* app)
{
g_return_val_if_fail(app != NULL, EXIT_FAILURE);
const char* conf_dir = g_get_user_config_dir();
char* db_path = g_strdup_printf("%s/simple-fb2-reader/books.sqlite3", conf_dir);
sqlite3** db = &(app->book_db);
if(sqlite3_open(db_path, db) == SQLITE_OK)
{
if(sqlite3_exec(*db, "CREATE TABLE IF NOT EXISTS books(hash TEXT, line INT, line_offset INT);", NULL, NULL, NULL) != SQLITE_OK)
{
g_log(NULL, G_LOG_LEVEL_WARNING, "SQLITE ERROR: %s", sqlite3_errmsg(*db));
return EXIT_FAILURE;
}
if(sqlite3_exec(*db, "CREATE TABLE IF NOT EXISTS recent_books_ring(name TEXT, hash TEXT, path TEXT, time INT);", NULL, NULL, NULL) != SQLITE_OK)
{
g_log(NULL, G_LOG_LEVEL_WARNING, "SQLITE ERROR: %s", sqlite3_errmsg(*db));
return EXIT_FAILURE;
}
}
else
{
g_log(NULL, G_LOG_LEVEL_WARNING, "SQLITE ERROR: %s", sqlite3_errmsg(*db));
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
//##################################################################################################
int reader_books_table_add_new(APP* app, const char* hash, int64_t* index)
{
g_return_val_if_fail(app != NULL, EXIT_FAILURE);
g_return_val_if_fail(hash != NULL, EXIT_FAILURE);
sqlite3* db = app->book_db;
sqlite3_stmt* query = NULL;
sqlite3_prepare(db, "INSERT INTO books VALUES(?, 0, 0);", -1, &query, NULL);
sqlite3_bind_text(query, 1, hash, -1, NULL);
sqlite3_step(query);
*index = sqlite3_last_insert_rowid(db);
sqlite3_finalize(query);
return EXIT_SUCCESS;
}
int reader_books_table_get_index_by_hash(APP* app, const char* hash, int64_t* index)
{
g_return_val_if_fail(app != NULL, EXIT_FAILURE);
g_return_val_if_fail(hash != NULL, EXIT_FAILURE);
sqlite3* db = app->book_db;
sqlite3_stmt* query = NULL;
*index = -1;
sqlite3_prepare(db, "SELECT rowid FROM books WHERE hash IS ?;", -1, &query, NULL);
sqlite3_bind_text(query, 1, hash, -1, NULL);
if(sqlite3_step(query) == SQLITE_ROW)
*index = sqlite3_column_int64(query, 0);
sqlite3_finalize(query);
return EXIT_SUCCESS;
}
//##################################################################################################
int reader_books_table_get_int_by_index(APP* app, int64_t index, const char* param, int* value)
{
g_return_val_if_fail(app != NULL, EXIT_FAILURE);
g_return_val_if_fail(param != NULL, EXIT_FAILURE);
g_return_val_if_fail(index != -1, EXIT_FAILURE);
sqlite3* books_db = app->book_db;
sqlite3_stmt* query = NULL;
*value = 0;
char buff[512];
snprintf(buff, sizeof(buff), "SELECT %s FROM books WHERE rowid IS ?;", param);
if(sqlite3_prepare(books_db, buff, -1, &query, NULL) != SQLITE_OK)
{
g_log(NULL, G_LOG_LEVEL_WARNING, "Failed to get row from books table. %s", sqlite3_errmsg(books_db));
return EXIT_FAILURE;
}
sqlite3_bind_int64(query, 1, index);
if(sqlite3_step(query) == SQLITE_ROW)
*value = sqlite3_column_int(query, 0);
sqlite3_finalize(query);
return EXIT_SUCCESS;
}
int reader_books_table_set_int_by_index(APP* app, int64_t index, const char* param, int value)
{
g_return_val_if_fail(app != NULL, EXIT_FAILURE);
g_return_val_if_fail(param != NULL, EXIT_FAILURE);
sqlite3* books_db = app->book_db;
sqlite3_stmt* query = NULL;
char buff[512];
snprintf(buff, sizeof(buff), "UPDATE books SET %s=? WHERE rowid IS ?;", param);
if(sqlite3_prepare(books_db, buff, -1, &query, NULL) != SQLITE_OK)
{
g_log(NULL, G_LOG_LEVEL_WARNING, "Failed to update row from books table. %s", sqlite3_errmsg(books_db));
return EXIT_FAILURE;
}
sqlite3_bind_int(query, 1, value);
sqlite3_bind_int64(query, 2, index);
sqlite3_step(query);
sqlite3_finalize(query);
return EXIT_SUCCESS;
}
|
/*
* Generated by class-dump 3.1.2.
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard.
*/
#import "NBPhoneMetaData.h"
@interface NBPhoneMetadataCD : NBPhoneMetaData
{
}
- (id)init;
@end
|
// ADOBE SYSTEMS INCORPORATED
// Copyright 1993 - 2002 Adobe Systems Incorporated
// All Rights Reserved
//
// NOTICE: Adobe permits you to use, modify, and distribute this
// file in accordance with the terms of the Adobe license agreement
// accompanying it. If you have received this file from a source
// other than Adobe, then your use, modification, or distribution
// of it requires the prior written permission of Adobe.
//-------------------------------------------------------------------
//-------------------------------------------------------------------------------
//
// File:
// PIMachODebug.h
//
// Description:
// This file contains the prototypes and utilities
// for MachO plug-in debugging.
//
// Use:
// This particular file will define the debug flags to
// build a Carbon debug version of the plug-in.
//
//-------------------------------------------------------------------------------
#ifndef __PIMachODebug_H__ // Has this not been defined yet?
#define __PIMachODebug_H__ // Only include this once by predefining it
#ifndef _DEBUG
#define _DEBUG 1
#endif
#endif // __PIMachODebug_H__
// end PIMachODebug.h
|
#ifndef _COMMAND_H_
#define _COMMAND_H_
#define MAX_CMD_LEN 64
void cmd_proc (char *cmd);
int cmd_isautorun(void);
void cmd_autorun(int ar);
uint8_t GetFtestState(void);
#endif
|
#ifndef SRC_LEVELS_PARSERETHERNETSNAP_H_
#define SRC_LEVELS_PARSERETHERNETSNAP_H_
#include "ChunkEtherNetSNAP.h"
#include "ChunkEtherNet.h"
#include "../types/Processor.h"
/**
* Parser of SNAP EtherNet frame
*/
//lint -sem(ParserEtherNetSNAP::Process, 1p)
//lint -sem(ParserEtherNetSNAP::Process, 2p)
class ParserEtherNetSNAP: public Processor<ChunkEtherNet, ChunkEtherNetSNAP> {
public:
/**
* Try to get EtherNet SNAP frame from data.
* @param parent Optional reference to parent Chunk
* @return NULL or parsed chunk
*/
std::shared_ptr<ChunkEtherNetSNAP> Process(const std::shared_ptr<ChunkEtherNet> &parent);
/**
* Returns unique ID for this Parser
* @return ID
*/
std::string ID();
/**
* Returns description for this Parser
* @return Description
*/
std::string Description();
};
#endif /* SRC_LEVELS_PARSERETHERNETSNAP_H_ */
|
// Copyright 2012 Joan Puigcerver <joapuipe@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 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 DATASET_H_
#define DATASET_H_
#include <protos/ratings.pb.h>
#include <math.h>
#include <stdint.h>
#include <string>
#include <vector>
class Dataset {
public:
struct Rating {
uint32_t user;
uint32_t item;
std::vector<float> scores;
};
Dataset();
Dataset& operator = (const Dataset& other);
void clear();
void copy(Dataset* other, size_t i, size_t n) const;
void erase_scores();
void get_scores_from_common_ratings_by_users(
uint32_t user1, uint32_t user2,
std::vector<float> * ratings_u1,
std::vector<float> * ratings_u2) const;
std::string info(uint32_t npr = 0) const;
bool load(const mcfs::protos::Ratings& ratings);
bool load(const std::string& filename);
const std::vector<Rating*>& ratings_by_item(uint32_t item) const;
const std::vector<Rating*>& ratings_by_user(uint32_t user) const;
void save(mcfs::protos::Ratings * ratings) const;
bool save(const std::string&, bool ascii = false) const;
void shuffle(bool prepare = true);
void to_normal_scale();
void to_original_scale();
inline std::vector<Rating>& mutable_ratings() { return ratings_; }
inline const std::vector<Rating>& ratings() const { return ratings_; }
inline float minv(uint32_t c) const { return minv_[c]; }
inline float maxv(uint32_t c) const { return maxv_[c]; }
inline float precision(uint32_t c) const { return precision_[c]; }
inline uint32_t users() const { return N_; }
inline uint32_t items() const { return M_; }
inline size_t criteria_size() const { return criteria_size_; }
inline size_t ratings_size() const { return ratings_.size(); }
static void partition(Dataset * original, Dataset * partition, float f);
static float rmse(const Dataset& a, const Dataset& b);
private:
struct SortPRatingsByItem {
bool operator() (const Rating* a, const Rating* b) const;
};
struct SortPRatingsByUser {
bool operator() (const Rating* a, const Rating* b) const;
};
std::vector<Rating> ratings_;
std::vector<float> minv_;
std::vector<float> maxv_;
std::vector<int> precision_;
uint32_t criteria_size_;
uint32_t N_, M_;
std::vector<std::vector<Rating*> > ratings_by_user_;
std::vector<std::vector<Rating*> > ratings_by_item_;
void count_items();
void count_users();
void init_maxv();
void init_minv();
void prepare_aux();
};
#endif // DATASET_H_
|
//--------- CODE CONFIGURATION OPTIONS -----------
#ifndef codeoptions_h
#define codeoptions_h
#define FS 44117
// print waveform on serial output for plotting
//#define PLOTOUT
// print level & cpus/mem stats
#define PRINTSTAT
// print waveshaping function
//#define PRINTWAVE
// run test sequence
//#define RUNTESTS
// test tone
//#define TEST_TONE
// enable usb audio input output (input is mixed with line in into effect processor).
//#define USBAUDIO
// choose only one of the following interfaces
//#define TEENSYADDA
//#define SGTL5000
#define WM8731
// stereo or mono output
#define STEREO
#endif
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Code/Dev/appNativa/source/rareobjc/../rare/core/com/appnativa/rare/scripting/DynamicBindings.java
//
// Created by decoteaud on 3/11/16.
//
#ifndef _RAREDynamicBindings_H_
#define _RAREDynamicBindings_H_
@class JavaUtilHashMap;
@class RAREaScriptManager;
@protocol JavaUtilCollection;
@protocol JavaUtilMap;
@protocol JavaUtilSet;
#import "JreEmulation.h"
#include "javax/script/Bindings.h"
@interface RAREDynamicBindings : NSObject < JavaxScriptBindings > {
@public
id<JavaxScriptBindings> bindings_;
__weak RAREaScriptManager *scriptNamager_;
}
+ (NSString *)FORM;
+ (NSString *)TOP;
+ (NSString *)WIDGET;
+ (NSString *)WINDOW;
+ (JavaUtilHashMap *)generatedValues;
- (id)initWithJavaxScriptBindings:(id<JavaxScriptBindings>)bindings
withRAREaScriptManager:(RAREaScriptManager *)sm;
- (void)clear;
- (BOOL)containsKeyWithId:(id)key;
- (BOOL)containsValueWithId:(id)value;
- (id<JavaUtilSet>)entrySet;
- (id<JavaUtilSet>)keySet;
- (id)putWithId:(NSString *)name
withId:(id)value;
- (void)putAllWithJavaUtilMap:(id<JavaUtilMap>)toMerge;
- (id)removeWithId:(id)key;
- (int)size;
- (id<JavaUtilCollection>)values;
- (id)getWithId:(id)key;
- (BOOL)isEmpty;
- (id)getOtherWithId:(id)key;
- (void)copyAllFieldsTo:(RAREDynamicBindings *)other;
@end
J2OBJC_FIELD_SETTER(RAREDynamicBindings, bindings_, id<JavaxScriptBindings>)
typedef RAREDynamicBindings ComAppnativaRareScriptingDynamicBindings;
#endif // _RAREDynamicBindings_H_
|
/*****************************************************************
File : YD-Module\BMP180\bmp180.c
Fuction : BMP180 chip with Digital pressure sensor
Author : @hiyangdong
Version : V1.0
Time : 12 Nov. 2015
Thanks : https://github.com/LonelyWolf/stm32/tree/master/bmp180
*****************************************************************/
#include "bmp180.h"
#include "i2c.h"
#include <math.h>
BMP180_Calibration_TypeDef bmpCal;
//uint8_t BMP_value[10];
void BMP180_Init(void)
{
MX_I2C1_Init();
}
void BMP180_Reset(void)
{
BMP180_WriteReg(BMP180_SOFT_RESET_REG,0xb6); // Do software reset
}
HAL_StatusTypeDef BMP180_WriteReg(uint8_t reg, uint8_t value)
{
uint8_t rxData[2] = {reg,value};
HAL_StatusTypeDef status;
status = HAL_I2C_Master_Transmit(&BMPi2c,BMP180_ADDR,rxData,2,2);
while(status != HAL_OK)
{
if(HAL_I2C_GetError(&BMPi2c) != HAL_I2C_ERROR_AF)
{}
}
return status;
}
uint8_t BMP180_ReadReg(uint8_t reg)
{
uint8_t value;
while(HAL_I2C_Master_Transmit(&BMPi2c,BMP180_ADDR,®,1,100) != HAL_OK)
{
if(HAL_I2C_GetError(&BMPi2c) != HAL_I2C_ERROR_AF)
{}
}
if(HAL_I2C_Master_Receive(&BMPi2c,BMP180_ADDR+1,&value,1,100) != HAL_OK)
{
if(HAL_I2C_GetError(&BMPi2c) != HAL_I2C_ERROR_AF)
{}
}
return value;
}
uint16_t BMP180_ReadTwoByte(uint8_t reg)
{
uint8_t value[2];
int16_t regData = 0;
while(HAL_I2C_Master_Transmit(&BMPi2c,BMP180_ADDR,®,1,2) != HAL_OK)
{
if(HAL_I2C_GetError(&BMPi2c) != HAL_I2C_ERROR_AF)
{}
}
if(HAL_I2C_Master_Receive(&BMPi2c,BMP180_ADDR+1,value,2,2) != HAL_OK)
{
if(HAL_I2C_GetError(&BMPi2c) != HAL_I2C_ERROR_AF)
{}
}
regData = (value[0]<<8)+value[1];
return regData;
}
/*¶ÁÈ¡BMP180µÄУ׼ϵÊý*/
void BMP180_ReadCalibration(void)
{
bmpCal.AC1 = BMP180_ReadTwoByte(0xaa);
bmpCal.AC2 = BMP180_ReadTwoByte(0xac);
bmpCal.AC3 = BMP180_ReadTwoByte(0xae);
bmpCal.AC4 = BMP180_ReadTwoByte(0xb0);
bmpCal.AC5 = BMP180_ReadTwoByte(0xb2);
bmpCal.AC6 = BMP180_ReadTwoByte(0xb4);
bmpCal.B1 = BMP180_ReadTwoByte(0xb6);
bmpCal.B2 = BMP180_ReadTwoByte(0xb8);
bmpCal.MB = BMP180_ReadTwoByte(0xba);
bmpCal.MC = BMP180_ReadTwoByte(0xbc);
bmpCal.MD = BMP180_ReadTwoByte(0xbe);
}
/*¶ÁBMP180ûÓо¹ý²¹³¥µÄζÈÖµ*/
uint16_t BMP180_Read_UT(void)
{
uint16_t UT;
BMP180_WriteReg(BMP180_CTRL_MEAS_REG,BMP180_T_MEASURE);
HAL_Delay(5); // Wait for 4.5ms by datasheet
UT = BMP180_ReadTwoByte(0xf6);
return UT;
}
/*¶ÁBMP180ûÓо¹ý²¹³¥µÄѹÁ¦Öµ*/
uint32_t BMP180_Read_UP(uint8_t oss)
{
uint32_t UP;
uint8_t cmd,delay;
switch(oss) {
case 0:
cmd = BMP180_P0_MEASURE;
delay = 6;
break;
case 1:
cmd = BMP180_P1_MEASURE;
delay = 9;
break;
case 2:
cmd = BMP180_P2_MEASURE;
delay = 15;
break;
case 3:
cmd = BMP180_P3_MEASURE;
delay = 27;
break;
}
BMP180_WriteReg(BMP180_CTRL_MEAS_REG,cmd);
HAL_Delay(delay); //wait some time
UP = BMP180_ReadTwoByte(0xf6);
UP &= 0x0000FFFF;
return UP;
}
/*°Ñδ¾¹ý²¹³¥µÄζȺÍѹÁ¦Öµ×ª»»ÎªÊµ¼ÊµÄζȺÍѹÁ¦Öµ
*True_Temp:ʵ¼ÊζÈÖµ,µ¥Î»:¡æ
*True_Press:ʱ¼äѹÁ¦Öµ,µ¥Î»:Pa
*True_Altitude:ʵ¼Êº£°Î¸ß¶È,µ¥Î»:m
*/
float BMP180_Calc_RT(uint16_t UT)
{
float Temp = 0;
float True_Temp = 0;
bmpCal.B5 = (((int32_t)UT - (int32_t)bmpCal.AC6) * (int32_t)bmpCal.AC5) >> 15;
bmpCal.B5 += ((int32_t)bmpCal.MC << 11) / (bmpCal.B5 + bmpCal.MD);
Temp = (bmpCal.B5 + 8) >> 4;
True_Temp = Temp/10.0;
printf("Temperature:%.1f \r\n",True_Temp);
return True_Temp;
}
float BMP180_Calc_RP(uint32_t UP, uint8_t oss)
{
int32_t B3,B6,X3,p;
uint32_t B4,B7;
float True_Press = 0;
B6 = bmpCal.B5 - 4000;
X3 = ((bmpCal.B2 * ((B6 * B6) >> 12)) >> 11) + ((bmpCal.AC2 * B6) >> 11);
B3 = (((((int32_t)bmpCal.AC1) * 4 + X3) << oss) + 2) >> 2;
X3 = (((bmpCal.AC3 * B6) >> 13) + ((bmpCal.B1 * ((B6 * B6) >> 12)) >> 16) + 2) >> 2;
B4 = (bmpCal.AC4 * (uint32_t)(X3 + 32768)) >> 15;
B7 = ((uint32_t)UP - B3) * (50000 >> oss);
if (B7 < 0x80000000)
p = (B7 << 1) / B4;
else
p = (B7 / B4) << 1;
True_Press = p + (((((p >> 8) * (p >> 8) * BMP180_PARAM_MG) >> 16) + ((BMP180_PARAM_MH * p) >> 16) + BMP180_PARAM_MI) >> 4);
printf("Press:%.1fPa \r\n",True_Press);
return True_Press;
}
float BMP180_kpa_to_altitude(float Pa)
{
float True_Altitude = 0;
True_Altitude = 44330*(1-pow((Pa/101325.0),(1.0/5.255)))/1000;
printf("Altitude:%.3fm \r\n",True_Altitude);
return True_Altitude;
}
// Fast integer Pa -> mmHg conversion (Pascals to millimeters of mercury)
float BMP180_kpa_to_mmhg(int32_t Pa)
{
float mmHg = 0;
mmHg = (float)Pa * 76.0 / 10130.0;
printf("mmHg:%.3fm \t",mmHg);
return mmHg;
}
|
/*
* Goodvibes Radio Player
*
* Copyright (C) 2015-2018 Arnaud Rebillout
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* 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 __GOODVIBES_UI_GV_ABOUT_DIALOG_H__
#define __GOODVIBES_UI_GV_ABOUT_DIALOG_H__
#include <gtk/gtk.h>
void gv_show_about_dialog(GtkWindow *parent, const gchar *audio_backend_string,
const gchar *ui_toolkit_string);
#endif /* __GOODVIBES_UI_GV_ABOUT_DIALOG_H__ */
|
#pragma once
#include "../../ILogger.h"
#include "../../VM/OpcodeHandler.h"
namespace Falltergeist
{
namespace VM
{
namespace Handler
{
class Opcode811E : public OpcodeHandler
{
public:
Opcode811E(VM::Script *script, std::shared_ptr<ILogger> logger);
private:
std::shared_ptr<ILogger> logger;
void _run() override;
};
}
}
} |
/*
Copyright 2014 Sky Leonard
This file is part of libfluff.
libfluff 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.
libfluff 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 libfluff. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FLUFF_CONFIG_TYPES_H_
#define FLUFF_CONFIG_TYPES_H_
#include <stddef.h>
#include <stdint.h>
#include <stdarg.h>
#include <wchar.h>
#endif /* FLUFF_CONFIG_TYPES_H_ */
|
//
// Copyright 2010, Darren Lafreniere
// <http://www.lafarren.com/image-completer/>
//
// This file is part of lafarren.com's Image Completer.
//
// Image Completer 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.
//
// Image Completer 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 Image Completer, named License.txt. If not, see
// <http://www.gnu.org/licenses/>.
//
#ifndef TECH_PROFILE_H
#define TECH_PROFILE_H
#if TECH_PROFILE
namespace LfnTech
{
///
/// Base class for time or memory profiling.
///
class BaseProfiler
{
public:
BaseProfiler(const char* name);
virtual ~BaseProfiler();
inline const std::string& GetName() const { return m_name; }
void Start();
void Stop();
protected:
virtual void OnStart() = 0;
virtual void OnStop() = 0;
private:
//
// Data
//
std::string m_name;
long volatile m_startCount;
};
///
/// Profiles execution time.
///
class TimeProfiler : public BaseProfiler
{
public:
enum ReportMode
{
// Report every sample
ReportEverySample,
// Report after every Nth sample
ReportEveryNthSample,
// Report when this profiler is destroyed
ReportFinal,
};
TimeProfiler(const char* name, ReportMode reportMode = ReportFinal, int nthBlock = 0);
virtual ~TimeProfiler();
private:
virtual void OnStart();
virtual void OnStop();
// Can be used internally by subclasses to differentiate runtime
// reports from final reports.
enum ReportContext
{
ReportContextRuntime,
ReportContextFinal,
};
void Report(ReportContext, int numBlocks, double time);
//
// Data
//
int m_reportAfterNumSamples;
int m_numSamples;
double m_startTime;
double m_timeSinceLastReport;
double m_totalTime;
};
//
// Profiles memory usage.
//
class MemProfiler : public BaseProfiler
{
public:
MemProfiler(const char* name);
virtual ~MemProfiler();
private:
virtual void OnStart();
virtual void OnStop();
//
// Data
//
// Platform-specific data allocated in Profile.cpp
class MemProfilerData;
MemProfilerData* m_data;
};
//
// Starts the profiler upon construction, and stops it upon destruction.
//
class ScopedProfiler
{
public:
inline ScopedProfiler(BaseProfiler& profiler) :
m_profiler(profiler)
{
m_profiler.Start();
}
inline ~ScopedProfiler()
{
m_profiler.Stop();
}
private:
BaseProfiler& m_profiler;
};
}
//
// Macros for scoped time profiling. Use as such:
//
// void MyClass::MyMethod()
// {
// TECH_TIME_PROFILE("MyClass::MyMethod");
// ...
//
// The time profiler macros create static TimeProfiler objects. Therefore,
// the name passed into time profiler macros cannot change; the first name
// is used throughout execution.
//
// The TECH_PROFILE preprocessor flag must be set to 1
#if TECH_PROFILE_MACROS && defined(_MSC_VER)
// Reports the final profile:
#define TECH_TIME_PROFILE(__name__) \
TECH_TIME_PROFILE_INDIRECT1(__LINE__, __name__, LfnTech::TimeProfiler::ReportFinal, 0)
// Reports every sample:
#define TECH_TIME_PROFILE_EVERY_SAMPLE(__name__) \
TECH_TIME_PROFILE_INDIRECT1(__LINE__, __name__, LfnTech::TimeProfiler::ReportEverySample, 1)
// Reports every Nth sample:
#define TECH_TIME_PROFILE_EVERY_NTH_SAMPLE(__name__, __nthBlock__) \
TECH_TIME_PROFILE_INDIRECT1(__LINE__, __name__, LfnTech::TimeProfiler::ReportEveryNthSample, __nthBlock__)
// Helper macros to successfully expand __LINE__
#define TECH_TIME_PROFILE_INDIRECT1(__line__, __name__, __reportMode__, __nthBlock__) \
TECH_TIME_PROFILE_INDIRECT2(__line__, __name__, __reportMode__, __nthBlock__)
#define TECH_TIME_PROFILE_INDIRECT2(__line__, __name__, __reportMode__, __nthBlock__) \
static LfnTech::TimeProfiler techTimeProfiler##__line__(__name__, __reportMode__, __nthBlock__); \
LfnTech::ScopedProfiler techScopedProfiler##__line__(techTimeProfiler##__line__)
#else
#define TECH_TIME_PROFILE(__name__)
#define TECH_TIME_PROFILE_EVERY_SAMPLE(__name__)
#define TECH_TIME_PROFILE_EVERY_NTH_SAMPLE(__name__, __nthBlock__)
#endif // #if TECH_PROFILE_MACROS
//
// Macros for scoped memory profiling. Use as such:
//
// void MyClass::MyMethod()
// {
// TECH_MEM_PROFILE("MyClass::MyMethod");
// ...
//
// The time profiler macros create non-static MemProfiler objects. Therefore,
// the name passed into time profiler macros can change on any given execution.
//
// The TECH_PROFILE preprocessor flag must be set to 1
#if TECH_PROFILE_MACROS && defined(_MSC_VER)
#define TECH_MEM_PROFILE(__name__) \
TECH_MEM_PROFILE_INDIRECT1(__LINE__, __name__)
// Helper macros to successfully expand __LINE__
#define TECH_MEM_PROFILE_INDIRECT1(__line__, __name__) \
TECH_MEM_PROFILE_INDIRECT2(__line__, __name__)
#define TECH_MEM_PROFILE_INDIRECT2(__line__, __name__) \
LfnTech::MemProfiler techMemProfiler##__line__(__name__); \
LfnTech::ScopedProfiler techScopedProfiler##__line__(techMemProfiler##__line__)
#else
#define TECH_MEM_PROFILE(__name__)
#endif // #if TECH_PROFILE_MACROS
#endif // #if TECH_PROFILE
#endif // #ifndef TECH_PROFILE_H
|
#pragma once
#include "interpreter.h"
void init_table();
int try_call(program_state *state, char *name); |
#ifndef __ASM_SPINLOCK_TYPES_H
#define __ASM_SPINLOCK_TYPES_H
#ifndef __LINUX_SPINLOCK_TYPES_H
# error "please don't include this file directly"
#endif
#define TICKET_SHIFT 16
typedef struct
{
union
{
u32 slock;
struct __raw_tickets
{
#ifdef __ARMEB__
u16 next;
u16 owner;
#else
u16 owner;
u16 next;
#endif
} tickets;
};
} arch_spinlock_t;
#define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
typedef struct
{
u32 lock;
} arch_rwlock_t;
#define __ARCH_RW_LOCK_UNLOCKED { 0 }
#endif
|
/******************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* This file is part of Real VMX.
* Copyright (C) 2015 Surplus Users Ham Society
*
* Real VMX 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.
*
* Real VMX 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 Real VMX. If not, see <http://www.gnu.org/licenses/>.
*/
/* wwmColor.c - Window manager colormap */
#include "ugl.h"
const UGL_RGB wwmRGBColorTable[16] = {
/* BLACK */ UGL_MAKE_ARGB(255, 0, 0, 0),
/* BLUE */ UGL_MAKE_ARGB(255, 0, 0, 168),
/* GREEN */ UGL_MAKE_ARGB(255, 0, 168, 0),
/* CYAN */ UGL_MAKE_ARGB(255, 0, 168, 168),
/* RED */ UGL_MAKE_ARGB(255, 168, 0, 0),
/* MAGENTA */ UGL_MAKE_ARGB(255, 168, 0, 168),
/* BROWN */ UGL_MAKE_ARGB(255, 168, 84, 0),
/* LIGHTGRAY */ UGL_MAKE_ARGB(255, 168, 168, 168),
/* DARKGRAY */ UGL_MAKE_ARGB(255, 84, 84, 84),
/* LIGHTBLUE */ UGL_MAKE_ARGB(255, 84, 84, 255),
/* LIGHTGREEN */ UGL_MAKE_ARGB(255, 84, 255, 84),
/* LIGHTCYAN */ UGL_MAKE_ARGB(255, 84, 255, 255),
/* LIGHTRED */ UGL_MAKE_ARGB(255, 255, 84, 84),
/* LIGHTMAGENTA */ UGL_MAKE_ARGB(255, 255, 84, 255),
/* YELLOW */ UGL_MAKE_ARGB(255, 255, 255, 84),
/* WHITE */ UGL_MAKE_ARGB(255, 255, 255, 255)
};
|
#pragma once
#include "logger.h"
class amxNatives
{
public:
static const AMX_NATIVE_INFO loggerNatives[];
static cell AMX_NATIVE_CALL Log(AMX *amx, cell *params);
}; |
/*
Copyright 2009 Andreas Biegert
This file is part of the CS-BLAST package.
The CS-BLAST package 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.
The CS-BLAST package 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 "globals.h"
#include <stdint.h>
#ifndef CS_AA_H_
#define CS_AA_H_
namespace cs {
class AA {
public:
// Size of alphabet excluding wildcard character ANY
static const size_t kSize;
// Size of alphabet includding wildcard character ANY
static const size_t kSizeAny;
// Integer code of ANY character
static const uint8_t kAny;
// Integer code of GAP
static const uint8_t kGap;
// Integer code of ENDGAP
static const uint8_t kEndGap;
// For converting from ASCII to the amino acid code
static const uint8_t kCharToInt[];
// For converting from integer code back to ASCII character
static const char kIntToChar[];
// For testing if ASCII character is from amino acid code
static const bool kValidChar[];
// Functional groups of amino acid alphabet needed for coloring of profile logos
static const int kFuncGroup[];
// Name of this alphabet
static const char kName[];
private:
DISALLOW_COPY_AND_ASSIGN(AA);
};
} // namespace cs
#endif // CS_AA_H_
|
#ifndef NATIVE_IMAGE_H
#define NATIVE_IMAGE_H
typedef struct native_image NATIVE_IMAGE;
typedef uint8_t *UTOX_IMAGE;
enum {
FILTER_NEAREST, // ugly and quick filtering
FILTER_BILINEAR // prettier and a bit slower filtering
};
/* set filtering method used when resizing given image to one of above enum */
void image_set_filter(NATIVE_IMAGE *image, uint8_t filter);
/* set scale of image so that when it's drawn it will be `scale' times as large(2.0 for double size, 0.5 for half, etc.)
* notes: theoretically lowest possible scale is (1.0/65536.0), highest is 65536.0, values outside of this range will
* create weird issues
* scaling will be rounded to pixels, so it might not be exact
*/
void image_set_scale(NATIVE_IMAGE *image, double scale);
/* draws an utox image with or without alpha channel into the rect of (x,y,width,height) on the screen,
* starting at position (imgx,imgy) of the image
* WARNING: Windows can fail to show the image at all if the rect (imgx,imgy,width,height) contains even 1 pixel outside
* of
* the image's size AFTER SCALING, so be careful.
* TODO: improve this so this function is safer to use
*/
void draw_image(const NATIVE_IMAGE *image, int x, int y, uint32_t width, uint32_t height, uint32_t imgx, uint32_t imgy);
/* Native wrapper to ready and call draw_image */
void draw_inline_image(uint8_t *img_data, size_t size, uint16_t w, uint16_t h, int x, int y);
/* converts a png to a NATIVE_IMAGE, returns a pointer to it, keeping alpha channel only if keep_alpha is 1 */
NATIVE_IMAGE *utox_image_to_native(const UTOX_IMAGE, size_t size, uint16_t *w, uint16_t *h, bool keep_alpha);
/* free an image created by utox_image_to_native */
void image_free(NATIVE_IMAGE *image);
// OS-dependent macros
#if defined __WIN32__ || defined _WIN32 || defined __CYGWIN__
#include "win/image.h"
#else
#include "xlib/image.h"
#endif
#endif
|
#include<stdio.h>
#include<dos.h>
double operation(double a1,double a2,int b)
{
switch(b)
{
case 0:
return(a1+a2);
case 1:
return(a1-a2);
case 2:
return(a1*a2);
case 3:
return(a1/a2);
}
}
main()
{
int i,j,k,l,n,m,r,data[4],a[4]=
{
0
};
double num[4]=
{
0
}
,res1,res2,res3;
char sign[5]="+-*/",ch;
printf("input 4 numbers:");
for(i=0;i<4;i++)
{
scanf("%lf",num+i);
data[i]=num[i];
}
printf("Reflections on 10 seconds,input your answer:\n");
sleep(10);
printf("please input your result:\n");
for(i=1;i<=3;i++)
{
scanf("%d",&a[2]);
scanf("%c",&ch);
scanf("%d",&a[3]);
switch(ch)
{
case '+':
a[1]=a[2]+a[3];
break;
case '-':
a[1]=a[2]-a[3];
break;
case'*':
a[1]=a[2]*a[3];
break;
case'/':
a[1]=a[2]/a[3];
break;
}
printf("%d%c%d=%d\n",a[2],ch,a[3],a[1]);
}
if(a[1]==24)
printf("you are right!\n");
else
printf("sorry,you are worry!\n");
printf("press any key to see all the answers:\n");
getch();
printf("the result is:\n");
for(i=0;i<4;i++)
for(j=0;j<4;j++)
if(j!=i)
{
for(k=0;k<4;k++)
if(k!=i&&k!=j)
{
for(l=0;l<4;l++)
if(l!=i&&l!=j&&l!=k)
{
for(n=0;n<4;n++)
for(m=0;m<4;m++)
for(r=0;r<4;r++)
{
res1=operation(num[i],num[j],n);
res2=operation(res1,num[k],m);
res3=operation(res2,num[l],r);
if(res3==24.0)
printf("{(%d%c%d)%c%d}%c%d=24\n",data[i],sign[n],data[j],
sign[m],data[k],sign[r],data[l]);
else if(res3=-24.0)
printf("{(%d%c%d)%c%d}%c%d=24\n",data[k],sign[m],data[i],
sign[n],data[j],sign[r],data[l]);
else if(res3=1.0/24.0)
printf("{(%d%c%d)%c%d}%c%d=24\n",data[l],sign[r],data[i],
sign[n],data[j],sign[m],data[k]);
else if(res3=-1.0/24.0)
printf("{(%d%c%d)%c%d}%c%d=24\n",data[l],sign[r],data[k],
sign[n],data[i],sign[m],data[j]);
else
{
res1=operation(data[i],data[j],n);
res2=operation(data[k],data[l],r);
res3=operation(res1,res2,m);
if(res3==24.0)
printf("{(%d%c%d)%c%d}%c%d=24\n",data[i],sign[n],data[j],
sign[m],data[k],sign[r],data[l]);
}
}
}
}
}
getch();
}
|
/**
* Copyright (c) 2006-2013 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H
#define LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H
// LOVE
#include "common/runtime.h"
#include "wrap_Joint.h"
#include "WheelJoint.h"
namespace love
{
namespace physics
{
namespace box2d
{
WheelJoint *luax_checkwheeljoint(lua_State *L, int idx);
int w_WheelJoint_getJointTranslation(lua_State *L);
int w_WheelJoint_getJointSpeed(lua_State *L);
int w_WheelJoint_enableMotor(lua_State *L);
int w_WheelJoint_isMotorEnabled(lua_State *L);
int w_WheelJoint_setMotorSpeed(lua_State *L);
int w_WheelJoint_getMotorSpeed(lua_State *L);
int w_WheelJoint_setMaxMotorTorque(lua_State *L);
int w_WheelJoint_getMaxMotorTorque(lua_State *L);
int w_WheelJoint_getMotorTorque(lua_State *L);
int w_WheelJoint_setSpringFrequency(lua_State *L);
int w_WheelJoint_getSpringFrequency(lua_State *L);
int w_WheelJoint_setSpringDampingRatio(lua_State *L);
int w_WheelJoint_getSpringDampingRatio(lua_State *L);
extern "C" int luaopen_wheeljoint(lua_State *L);
} // box2d
} // physics
} // love
#endif // LOVE_PHYSICS_BOX2D_WRAP_WHEEL_JOINT_H
|
/**
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
* Copyright (C) 2012-2018 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules 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 COMMON_UTILS_H
#define COMMON_UTILS_H
#include "common/hercules.h"
#include <stdio.h> // FILE*
#ifndef WIN32
# include <unistd.h> // sleep()
#endif
/* [HCache] 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */
#define HCACHE_KEY 'k'
//Caps values to min/max
#define cap_value(a, min, max) (((a) >= (max)) ? (max) : ((a) <= (min)) ? (min) : (a))
#ifdef HERCULES_CORE
// generate a hex dump of the first 'length' bytes of 'buffer'
void WriteDump(FILE* fp, const void* buffer, size_t length);
void ShowDump(const void* buffer, size_t length);
void findfile(const char *p, const char *pat, void (func)(const char *, void *), void *context);
bool exists(const char* filename);
/// calculates the value of A / B, in percent (rounded down)
unsigned int get_percentage(const unsigned int A, const unsigned int B);
uint64 get_percentage64(const uint64 A, const uint64 B);
int64 apply_percentrate64(int64 value, int rate, int maxrate);
int apply_percentrate(int value, int rate, int maxrate);
const char* timestamp2string(char* str, size_t size, time_t timestamp, const char* format);
//////////////////////////////////////////////////////////////////////////
// byte word dword access [Shinomori]
//////////////////////////////////////////////////////////////////////////
extern uint8 GetByte(uint32 val, int idx);
extern uint16 GetWord(uint32 val, int idx);
extern uint16 MakeWord(uint8 byte0, uint8 byte1);
extern uint32 MakeDWord(uint16 word0, uint16 word1);
//////////////////////////////////////////////////////////////////////////
// Big-endian compatibility functions
//////////////////////////////////////////////////////////////////////////
extern int16 MakeShortLE(int16 val);
extern int32 MakeLongLE(int32 val);
extern uint16 GetUShort(const unsigned char* buf);
extern uint32 GetULong(const unsigned char* buf);
extern int32 GetLong(const unsigned char* buf);
extern float GetFloat(const unsigned char* buf);
size_t hread(void * ptr, size_t size, size_t count, FILE * stream);
size_t hwrite(const void * ptr, size_t size, size_t count, FILE * stream);
#endif // HERCULES_CORE
#ifdef WIN32
#define HSleep(x) Sleep(1000 * (x))
#else // ! WIN32
#define HSleep(x) sleep(x)
#endif
/* [Ind/Hercules] Caching */
struct HCache_interface {
void (*init) (void);
/* */
bool (*check) (const char *file);
FILE *(*open) (const char *file, const char *opt);
/* */
time_t recompile_time;
bool enabled;
};
#ifdef HERCULES_CORE
void HCache_defaults(void);
#endif // HERCULES_CORE
HPShared struct HCache_interface *HCache;
#endif /* COMMON_UTILS_H */
|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int
main(void)
{
time_t t;
struct tm *tmp;
char buf1[16];
char buf2[64];
time(&t);
tmp = localtime(&t);
if (strftime(buf1, 16, "time and date: %r, %a %b %d, %Y", tmp) == 0)
printf("buffer length 16 is too small\n");
else
printf("%s\n", buf1);
if (strftime(buf2, 64, "time and date: %r, %a %b %d, %Y", tmp) == 0)
printf("buffer length 64 is too small\n");
else
printf("%s\n", buf2);
exit(0);
} |
/*
*
* (C) 2013-22 - ntop.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 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.
*
*/
#ifndef _DOMAIN_NAMES_CONTACTS_H_
#define _DOMAIN_NAMES_CONTACTS_H_
#include "ntop_includes.h"
class DomainNamesContacts : public ServerContacts {
private:
u_int16_t domain_names_threshold;
HostAlertType getAlertType() const { return DomainNamesContactsAlert::getClassType(); };
u_int32_t getContactedServers(Host *h) const { return h->getDomainNamesCardinality(); }
DomainNamesContactsAlert *allocAlert(HostCheck *c, Host *h, risk_percentage cli_pctg, u_int64_t _num_domain_names, u_int64_t _domain_names_threshold) {
return new DomainNamesContactsAlert(c, h, cli_pctg, _num_domain_names,_domain_names_threshold);
};
public:
DomainNamesContacts();
~DomainNamesContacts() {};
void periodicUpdate(Host *h, HostAlert *engaged_alert);
bool loadConfiguration(json_object *config);
HostCheckID getID() const { return host_check_domain_names_contacts; }
std::string getName() const { return(std::string("domain_names_contacts")); }
};
#endif /* _DOMAIN_NAMES_CONTACTS_H_ */
|
// kernel/intr/stub.h
#ifndef _KERNEL_INTR_STUB_H_
#define _KERNEL_INTR_STUB_H_
#include <asm/types.h>
typedef
struct intr_regs_t {
_u32_t ds;
_u32_t edi;
_u32_t esi;
_u32_t ebp;
_u32_t esp;
_u32_t ebx;
_u32_t edx;
_u32_t ecx;
_u32_t eax;
_u32_t int_code;
_u32_t err_code;
_u32_t eip;
_u32_t cs;
_u32_t eflags;
_u32_t useresp;
_u32_t ss;
} __attribute__((packed)) _intr_regs_t;
typedef void (*_intr_handler_t)(_intr_regs_t *);
void reg_intr_handler(_u8_t n, _intr_handler_t handler);
void stub_init(void);
#endif |
#ifndef QMLCAMERASOURCE_H
#define QMLCAMERASOURCE_H
#include "ColorSource.h"
#include <QObject>
#include <QImage>
#include <QCamera>
#include <QVideoProbe>
#include <QQuickView>
class QmlCameraSource : public ImageSource
{
Q_OBJECT
public:
explicit QmlCameraSource(QQuickView* view, QObject* parent = nullptr);
public slots:
void start();
void stop();
protected slots:
void onFrame(const QVideoFrame& frame);
private:
QCamera* camera;
QQuickView* view;
QVideoProbe probe;
int frameNum;
};
#endif // QMLCAMERASOURCE_H
|
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
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 the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author 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.
*/
#include "Serial.h"
void Serial_TxString_P(const char* FlashStringPtr)
{
uint8_t CurrByte;
while ((CurrByte = pgm_read_byte(FlashStringPtr)) != 0x00)
{
Serial_TxByte(CurrByte);
FlashStringPtr++;
}
}
void Serial_TxString(const char* StringPtr)
{
uint8_t CurrByte;
while ((CurrByte = *StringPtr) != 0x00)
{
Serial_TxByte(CurrByte);
StringPtr++;
}
}
|
/*
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/>.
*/
/*
suppport for serial connected AHRS systems
*/
#pragma once
#include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h>
#include <AP_Common/Location.h>
#include <AP_NavEKF/AP_Nav_Common.h>
#ifndef HAL_EXTERNAL_AHRS_ENABLED
#define HAL_EXTERNAL_AHRS_ENABLED !HAL_MINIMIZE_FEATURES && !defined(HAL_BUILD_AP_PERIPH) && BOARD_FLASH_SIZE > 1024
#endif
#if HAL_EXTERNAL_AHRS_ENABLED
#include <GCS_MAVLink/GCS_MAVLink.h>
class AP_ExternalAHRS {
public:
AP_ExternalAHRS();
void init(void);
static const struct AP_Param::GroupInfo var_info[];
enum class DevType : uint8_t {
None = 0,
VecNav = 1,
};
static AP_ExternalAHRS *get_singleton(void) {
return _singleton;
}
// fixed IMU rate for now
float get_IMU_rate(void) const {
return 50;
}
// get serial port number, -1 for not enabled
int8_t get_port(void) const;
typedef struct {
uint8_t instance;
float pressure_pa;
float temperature;
} baro_data_message_t;
typedef struct {
Vector3f field;
} mag_data_message_t;
typedef struct {
uint16_t gps_week; // GPS week, 0xFFFF if not available
uint32_t ms_tow;
uint8_t fix_type;
uint8_t satellites_in_view;
float horizontal_pos_accuracy;
float vertical_pos_accuracy;
float horizontal_vel_accuracy;
float hdop;
float vdop;
int32_t longitude;
int32_t latitude;
int32_t msl_altitude; // cm
float ned_vel_north;
float ned_vel_east;
float ned_vel_down;
} gps_data_message_t;
typedef struct {
Vector3f accel;
Vector3f gyro;
float temperature;
} ins_data_message_t;
// accessors for AP_AHRS
bool healthy(void) const;
bool initialised(void);
bool get_quaternion(Quaternion &quat);
bool get_origin(Location &loc);
bool get_location(Location &loc);
Vector2f get_groundspeed_vector();
bool get_velocity_NED(Vector3f &vel);
bool get_speed_down(float &speedD);
bool pre_arm_check(char *failure_msg, uint8_t failure_msg_len) const;
void get_filter_status(nav_filter_status &status) const;
Vector3f get_gyro(void);
Vector3f get_accel(void);
void send_status_report(mavlink_channel_t chan) const;
// check for new data
void update() {
check_uart();
}
private:
AP_HAL::UARTDriver *uart;
int8_t port_num;
bool port_opened;
uint32_t baudrate;
void update_thread();
bool check_uart();
void process_packet1(const uint8_t *b);
void process_packet2(const uint8_t *b);
AP_Enum<DevType> devtype;
static AP_ExternalAHRS *_singleton;
uint8_t *pktbuf;
uint16_t pktoffset;
uint16_t bufsize;
struct VN_packet1 *last_pkt1;
struct VN_packet2 *last_pkt2;
uint32_t last_pkt1_ms;
uint32_t last_pkt2_ms;
bool origin_set;
Location origin;
static HAL_Semaphore sem;
};
namespace AP {
AP_ExternalAHRS &externalAHRS();
};
#endif // HAL_EXTERNAL_AHRS_ENABLED
|
/******************************************************************************
Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
These sources were developed at the Freie Universitaet Berlin, Computer Systems
and Telematics group (http://cst.mi.fu-berlin.de).
-------------------------------------------------------------------------------
This file is part of FeuerWare.
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.
FeuerWare 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/ .
--------------------------------------------------------------------------------
For further information and questions please use the web site
http://scatterweb.mi.fu-berlin.de
and the mailinglist (subscription via web site)
scatterweb@lists.spline.inf.fu-berlin.de
*******************************************************************************/
#ifndef __SHELL_H
#define __SHELL_H
/**
* @defgroup shell Simple Shell Interpreter
* @ingroup feuerware
*/
//#include "hashtable.h"
typedef struct shell_command_t {
char* name;
char* desc;
void (*handler)(char*);
} shell_command_t;
typedef struct shell_t {
const shell_command_t *command_list;
int (*readchar)(void);
void (*put_char)(int);
} shell_t;
/**
* @brief Initialize a shell object
* @param shell Pointer to preallocated shell object
* @param shell_commands Pointer to shell command structure. See test_shell project for example.
* @param read_char Pointer to input device read function. Should return exactly one byte or block.
* @param put_char Pointer to output funtion. currently unused, shell code will use printf.
*/
void shell_init(shell_t *shell, /*@null@*/ const shell_command_t *shell_commands, int(*read_char)(void), void (*put_char)(int));
/**
* @brief Endless loop that waits for command and executes handler.
*/
void shell_run(shell_t *shell);
void shell_auto_init(shell_t *shell);
#endif /* __SHELL_H */
|
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
/*
*/
#include "ngspice.h"
#include "inddefs.h"
#include "sperror.h"
#include "suffix.h"
int
INDmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
{
INDmodel **model = (INDmodel**)inModel;
INDmodel *modfast = (INDmodel*)kill;
INDinstance *here;
INDinstance *prev = NULL;
INDmodel **oldmod;
oldmod = model;
for( ; *model ; model = &((*model)->INDnextModel)) {
if( (*model)->INDmodName == modname ||
(modfast && *model == modfast) ) goto delgot;
oldmod = model;
}
return(E_NOMOD);
delgot:
*oldmod = (*model)->INDnextModel; /* cut deleted device out of list */
for(here = (*model)->INDinstances ; here ; here = here->INDnextInstance) {
if(prev) FREE(prev);
prev = here;
}
if(prev) FREE(prev);
FREE(*model);
return(OK);
}
|
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef BINDIALOG_H_
#define BINDIALOG_H_
#include <QCheckBox>
#include <QDialog>
// Qt forward declarations
class QLineEdit;
class QRadioButton;
namespace MantidQt {
namespace MantidWidgets {
/**
\class BinDialog
\brief class to display Bin selection dialog
\author Srikanth Nagella
\date November 2008
\version 1.0
BinDialog class handles the Input Dialog for bin selection:
e.g. enter bin range from X1 to X2.
*/
class BinDialog : public QDialog {
Q_OBJECT
public:
explicit BinDialog(QWidget *parent = nullptr);
~BinDialog() override;
void setIntegralMinMax(double, double, bool);
signals:
/// This signal is sent when changing the bin range selected.
/// Parameters are: min, max, and a bool set to true to mean "everything"
void IntegralMinMax(double, double, bool);
public slots:
void btnOKClicked();
void mEntireRange_toggled(bool on);
private:
QLineEdit *mIntegralMinValue;
QLineEdit *mIntegralMaxValue;
QCheckBox *mEntireRange;
};
} // namespace MantidWidgets
} // namespace MantidQt
#endif /*BINDIALOG_H_*/
|
#ifndef NTLMAUTHPLUGIN_H
#define NTLMAUTHPLUGIN_H
#include <interfaces/ipluginmanager.h>
#include <interfaces/ixmppstreammanager.h>
#include <interfaces/ioptionsmanager.h>
#include <interfaces/iaccountmanager.h>
#include <utils/xmpperror.h>
#include <utils/options.h>
#define NTLMAUTH_UUID "{AF2565C7-B689-4776-A40A-187C969CDED3}"
class NtlmAuthFeatureFactory :
public QObject,
public IPlugin,
public IOptionsDialogHolder,
public IXmppFeatureFactory
{
Q_OBJECT;
Q_INTERFACES(IPlugin IOptionsDialogHolder IXmppFeatureFactory);
Q_PLUGIN_METADATA(IID "org.vacuum-im.plugins.NtlmAuth");
public:
NtlmAuthFeatureFactory();
~NtlmAuthFeatureFactory();
//IPlugin
virtual QObject *instance() { return this; }
virtual QUuid pluginUuid() const { return NTLMAUTH_UUID; }
virtual void pluginInfo(IPluginInfo *APluginInfo);
virtual bool initConnections(IPluginManager *APluginManager, int &AInitOrder);
virtual bool initObjects();
virtual bool initSettings();
virtual bool startPlugin() { return true; }
//IOptionsHolder
virtual QMultiMap<int, IOptionsDialogWidget *> optionsDialogWidgets(const QString &ANodeId, QWidget *AParent);
//IXmppFeaturesPlugin
virtual QList<QString> xmppFeatures() const;
virtual IXmppFeature *newXmppFeature(const QString &AFeatureNS, IXmppStream *AXmppStream);
signals:
void featureCreated(IXmppFeature *AFeature);
void featureDestroyed(IXmppFeature *AFeature);
protected slots:
void onFeatureDestroyed();
private:
IOptionsManager *FOptionsManager;
IAccountManager *FAccountManager;
IXmppStreamManager *FXmppStreammanager;
};
#endif // NTLMAUTHPLUGIN_H
|
/******************************************************************
iLBC Speech Coder ANSI-C Source Code
enhancer.h
Copyright (C) The Internet Society (2004).
All Rights Reserved.
******************************************************************/
#ifndef __ENHANCER_H
#define __ENHANCER_H
#include "iLBC_define.h"
float xCorrCoef(
float *target, /* (i) first array */
float *regressor, /* (i) second array */
int subl /* (i) dimension arrays */
);
int enhancerInterface(
float *out, /* (o) the enhanced recidual signal */
float *in, /* (i) the recidual signal to enhance */
iLBC_Dec_Inst_t *iLBCdec_inst
/* (i/o) the decoder state structure */
);
#endif
|
/*
* This file is part of the Yices SMT Solver.
* Copyright (C) 2017 SRI International.
*
* Yices 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.
*
* Yices 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 Yices. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This is placeholder to replace mcsat/solver.c when
* Yices is compiled witout mcsat support.
*
* This files provides all the functions listed in
* mcsat/solver.h. They do nothing and should never be called.
* We provide this so that the compilation works.
*/
#include "mcsat/solver.h"
mcsat_solver_t *mcsat_new(context_t *ctx) {
return NULL;
}
void mcsat_destruct(mcsat_solver_t *mcsat) {
}
smt_status_t mcsat_status(const mcsat_solver_t *mcsat) {
return STATUS_IDLE;
}
void mcsat_reset(mcsat_solver_t *mcsat) {
}
void mcsat_push(mcsat_solver_t *mcsat) {
}
void mcsat_pop(mcsat_solver_t *mcsat) {
}
int32_t mcsat_assert_formulas(mcsat_solver_t *mcsat, uint32_t n, const term_t *f) {
return 0;
}
void mcsat_solve(mcsat_solver_t *mcsat, const param_t *params) {
}
void mcsat_set_tracer(mcsat_solver_t *mcsat, tracer_t *tracer) {
}
void mcsat_show_stats(mcsat_solver_t *mcsat, FILE *out) {
}
void mcsat_build_model(mcsat_solver_t* mcsat, model_t* model) {
}
|
//--------------------------------------------------------------
// File : usb_conf.h
//--------------------------------------------------------------
#ifndef __USB_CONF__H__
#define __USB_CONF__H__
//--------------------------------------------------------------
// Includes
//--------------------------------------------------------------
#include "stm32f4xx.h"
/****************** USB OTG FS CONFIGURATION **********************************/
#define RX_FIFO_FS_SIZE 128
#define TX0_FIFO_FS_SIZE 32
#define TX1_FIFO_FS_SIZE 128
#define TX2_FIFO_FS_SIZE 32
#define TX3_FIFO_FS_SIZE 0
/****************** USB OTG MODE CONFIGURATION ********************************/
#define __ALIGN_BEGIN
#define __ALIGN_END
#ifndef __packed
#define __packed __attribute__ ((__packed__))
#endif
#endif
|
#pragma once
#include <array>
#include <functional>
#include <string>
#include <vector>
#include "../engine/inputobserverinterface.h"
#include "../farender/spritecache.h"
#include "textcolor.h"
#include <boost/optional.hpp>
namespace FAWorld
{
class World;
class Actor;
class Item;
}
namespace FAGui
{
class GuiManager;
class DialogLineData
{
public:
DialogLineData(std::string text, TextColor color, bool alignCenter);
DialogLineData();
DialogLineData& setAction(std::function<void()> actionArg);
DialogLineData& setNumber(int32_t number);
DialogLineData& setYOffset(int32_t offset);
DialogLineData& setXOffset(int32_t offset);
DialogLineData& setForceSelected(bool value = true)
{
forceSelected = value;
return *this;
}
static DialogLineData separator()
{
DialogLineData data;
data.isSeparator = true;
return data;
}
public:
std::function<void()> action;
std::string text;
bool alignCenter = false;
bool isSeparator = false;
bool forceSelected = false; /// display selection forcefully on this line (Used for back button in some cases)
TextColor color = TextColor::white;
int32_t mXOffset = 0;
int32_t mYOffset = 0;
boost::optional<int32_t> mNumber;
};
class DialogData
{
static constexpr int32_t linesVisible = 24;
public:
static DialogLineData toLineData(const std::string& text, TextColor color, bool alignCenter);
DialogLineData&
textLines(const std::vector<std::string>& texts, TextColor color = TextColor::white, bool alignCenter = true, std::vector<int32_t> offsets = {});
void skip_line(int32_t cnt = 1);
void separator();
DialogLineData& footer(const std::string& text);
void header(const std::vector<std::string>& text);
void header(std::vector<DialogLineData> data) { mHeader = std::move(data); }
int32_t selectedLine();
void notify(Engine::KeyboardInputAction action, GuiManager& manager);
void widen() { mIsWide = true; }
void showScrollBar(bool show = true) { mScrollBarShown = show; }
bool isScrollbarShown() const { return mScrollBarShown; }
int32_t visibleBodyLineCount() const { return linesVisible - mHeader.size() - mFooter.size(); }
bool isVisible(int32_t line) const { return line >= mFirstVisible && line < mFirstVisible + visibleBodyLineCount(); }
double selectedLinePercent();
void clearLines();
std::vector<DialogLineData> getHeader() const { return mHeader; }
private:
std::vector<DialogLineData> mHeader;
std::vector<DialogLineData> mLines;
std::vector<DialogLineData> mFooter;
int mSelectedLine = -1; // -1 means the first selectable
int mFirstVisible = 0; // used in case if not all fit to the window
bool mIsWide = false;
friend class FAGui::GuiManager;
bool mScrollBarShown = false;
};
class DialogManager
{
public:
explicit DialogManager(GuiManager& gui_manager, FAWorld::World& world);
void talk(const FAWorld::Actor* npc);
void fillMessageDialog(std::vector<DialogLineData> header, const char* text);
private:
template <typename FilterType> void sellDialog(FilterType filter);
void buyDialog(std::vector<FAWorld::Item>& items);
void talkOgden(const FAWorld::Actor* npc);
void talkFarnham(const FAWorld::Actor* npc);
void talkAdria(const FAWorld::Actor* npc);
void talkWirt(const FAWorld::Actor* npc);
void talkPepin(const FAWorld::Actor* npc);
void talkCain(const FAWorld::Actor* npc);
void talkGillian(const FAWorld::Actor* npc);
void talkGriswold(const FAWorld::Actor* npc);
void quitDialog() const;
void confirmDialog(std::vector<DialogLineData> header, const FAWorld::Item& item, int price, const char* question, std::function<void()> successAction);
private:
GuiManager& mGuiManager;
FAWorld::World& mWorld;
};
}
|
#ifndef _CONFIG_
#define _CONFIG_
#include <unistd.h>
#include <libpiface-1.0/pfio.h>
#include <termios.h>
#include <signal.h>
#include <math.h>
#include <wiringPi.h>
#include <wand/MagickWand.h>
#define SIM 0 // 0 Move Plotter, 1 only simulate
#define PI 3.14159265
#define OK 0
#define ENDPOS 1
#define TRUE 0
#define FALSE 1
#define JUMP -1
#define FAST 0
#define MEDIUM 1
#define SLOW 2
#define XSLOW 3
#define SNAIL 4
#define POW_OFF 0
#define POW_LOW 355
#define POW_MED 511
#define POW_HI 767
#define POW_MAX 1023
// These are the steps the plotter can go in each direction
#define MAX_WIDTH 4484 // X
#define MAX_HEIGHT 7468 // Y
#define STEPS_PER_MM 23.622 // Valid in fullstep mode, double for half-step mode
// Image output
// image size X=4484 x Y=7468 = 33.486.512 pixel
//#define PIXEL 33486512
//#define IMAGESIZE 100459590 // 54 + 3 * PIXEL
//char bitmap[IMAGESIZE];
char image_in[MAX_WIDTH][MAX_HEIGHT];
char image_out[MAX_WIDTH][MAX_HEIGHT];
// left/right is x-axis, down is 0, up is 7460
char patternsX[] = {0x5, 0x9, 0xa, 0x6}; // fullstep mode
int stepX = 0;
int posX = 0;
// up/down is y-axis, left is 0, right is 4506
char patternsY[] = {0x60, 0xa0, 0x90, 0x50}; // fullstep mode
int stepY = 0;
int posY = 0;
int laserPower = 0; // Power of Laser
int autoSpeed = TRUE; // If set to true, gcode-file sets speed
int manSpeed = FAST;
int cancel = 0;
int laserOn = FALSE;
// stop sensors:
#define UP 2
#define DOWN 1
#define LEFT 8
#define RIGHT 4
#endif //_CONFIG_ |
#include "my.h"
/*
my_alpha.c
pre: Nothing
post: print out [a-z]
*/
void my_alpha(){
char c;
for(c = 'a'; c < 'z'; ++c)
my_char(c);
}
|
#pragma once
/* Copyright © 2011-2019 Lukas Martini
*
* This file is part of Xelix.
*
* Xelix 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.
*
* Xelix 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 Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <tasks/task.h>
#include <int/int.h>
enum scheduler_state {
SCHEDULER_OFF,
SCHEDULER_INITIALIZING,
SCHEDULER_INITIALIZED
};
extern enum scheduler_state scheduler_state;
void scheduler_add(task_t *task);
task_t* scheduler_find(uint32_t pid);
task_t* scheduler_get_current();
task_t* scheduler_select(isf_t* lastRegs);
void scheduler_init();
|
/*
HTOKENS.H
contains token definitions
for the Hugo Compiler and Engine
Copyright (c) 1995-2006 by Kent Tessman
The enum constants of type TOKEN_T reflect the token names
given in the token array. Token names followed by a # are
for system use.
*/
#define TOKENS 0x7B /* i.e., highest numbered token */
#define HASH_KEY 1023 /* arbitrary */
#if !defined (TOKEN_SET_DEFINED)
#define TOKEN_SET_DEFINED
enum TOKEN_T
{
/* 0x00 - 0x0f */
NULL_T, OPEN_BRACKET_T, CLOSE_BRACKET_T, DECIMAL_T,
COLON_T, EQUALS_T, MINUS_T, PLUS_T,
ASTERISK_T, FORWARD_SLASH_T, PIPE_T, SEMICOLON_T,
OPEN_BRACE_T, CLOSE_BRACE_T, OPEN_SQUARE_T, CLOSE_SQUARE_T,
/* 0x10 - 0x1f */
POUND_T, TILDE_T, GREATER_EQUAL_T, LESS_EQUAL_T,
NOT_EQUAL_T, AMPERSAND_T, GREATER_T, LESS_T,
IF_T, COMMA_T, ELSE_T, ELSEIF_T,
WHILE_T, DO_T, SELECT_T, CASE_T,
/* 0x20 - 0x2f */
FOR_T, RETURN_T, BREAK_T, AND_T,
OR_T, JUMP_T, RUN_T, IS_T,
NOT_T, TRUE_T, FALSE_T, LOCAL_T,
VERB_T, XVERB_T, HELD_T, MULTI_T,
/* 0x30 - 0x3f */
MULTIHELD_T, NEWLINE_T, ANYTHING_T, PRINT_T,
NUMBER_T, CAPITAL_T, TEXT_T, GRAPHICS_T,
COLOR_T, REMOVE_T, MOVE_T, TO_T,
PARENT_T, SIBLING_T, CHILD_T, YOUNGEST_T,
/* 0x40 - 0x4f */
ELDEST_T, YOUNGER_T, ELDER_T, PROP_T,
ATTR_T, VAR_T, DICTENTRY_T, TEXTDATA_T,
ROUTINE_T, DEBUGDATA_T, OBJECTNUM_T, VALUE_T,
EOL_T, SYSTEM_T, NOTHELD_T, MULTINOTHELD_T,
/* 0x50 - 0x5f */
WINDOW_T, RANDOM_T, WORD_T, LOCATE_T,
PARSE_T, CHILDREN_T, IN_T, PAUSE_T,
RUNEVENTS_T, ARRAYDATA_T, CALL_T, STRINGDATA_T,
SAVE_T, RESTORE_T, QUIT_T, INPUT_T,
/* 0x60 - 0x6f */
SERIAL_T, CLS_T, SCRIPTON_T, SCRIPTOFF_T,
RESTART_T, HEX_T, OBJECT_T, XOBJECT_T,
STRING_T, ARRAY_T, PRINTCHAR_T, UNDO_T,
DICT_T, RECORDON_T, RECORDOFF_T, WRITEFILE_T,
/* 0x70 - */
READFILE_T, WRITEVAL_T, READVAL_T, PLAYBACK_T,
COLOUR_T, PICTURE_T, LABEL_T, SOUND_T,
MUSIC_T, REPEAT_T, ADDCONTEXT_T, VIDEO_T
};
#endif /* if !defined (TOKEN_SET_DEFINED) */
#if defined (INIT_PASS)
char *token[] =
{
/* 0x00 - 0x0f */
"", "(", ")", ".", ":", "=", "-", "+",
"*", "/", "|", ";", "{", "}", "[", "]",
/* 0x10 - 0x1f */
"#", "~", ">=", "<=", "~=", "&", ">", "<",
"if", ",", "else", "elseif", "while", "do", "select", "case",
/* 0x20 - 0x2f */
"for", "return", "break", "and", "or", "jump", "run", "is",
"not", "true", "false", "local", "verb", "xverb", "held", "multi",
/* 0x30 - 0x3f */
"multiheld", "newline", "anything", "print",
"number", "capital", "text", "graphics",
"color", "remove", "move", "to",
"parent", "sibling", "child", "youngest",
/* 0x40 - 0x4f */
"eldest", "younger", "elder", "prop#",
"attr#", "var#", "dictentry#", "textdata#",
"routine#","debugdata#","objectnum#", "value#",
"eol#", "system", "notheld", "multinotheld",
/* 0x50 - 0x5f */
"window", "random", "word", "locate",
"parse$", "children", "in", "pause",
"runevents", "arraydata#", "call", "stringdata#",
"save", "restore", "quit", "input",
/* 0x60 - 0x6f */
"serial$", "cls", "scripton", "scriptoff",
"restart", "hex", "object", "xobject",
"string", "array", "printchar", "undo",
"dict", "recordon", "recordoff", "writefile",
/* 0x70 - */
"readfile", "writeval", "readval", "playback",
"colour", "picture", "label#", "sound",
"music", "repeat", "addcontext", "video"
};
int token_hash[TOKENS+1];
#else
extern char *token[];
extern int token_hash[];
#endif /* defined (INIT_PASS) */
|
// Copyright 2014, Georg Sauthoff <mail@georg.so>
/* {{{ GPLv3
This file is part of imapdl.
imapdl 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.
imapdl 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 imapdl. If not, see <http://www.gnu.org/licenses/>.
}}} */
#ifndef CSTRING_H
#define CSTRING_H
#include <functional>
#include <cstring>
namespace std
{
template<> struct hash<const char*>
{
using argument_type = const char*;
using result_type = size_t;
size_t operator()(argument_type s) const
{
size_t r = std::hash<std::string>()(string(s));
return r;
}
};
template<> struct equal_to<const char*>
{
using first_argument_type = const char*;
using second_argument_type = const char*;
using result_type = bool;
bool operator()(first_argument_type lhs, second_argument_type rhs) const
{
return !std::strcmp(lhs, rhs);
}
};
}
#endif
|
/*
* CliPicture.h
*
* Created on: Sep 13, 2013
* Author: reinhard
*/
#ifndef CLIPICTURE_H_
#define CLIPICTURE_H_
#include <menu.h>
#include <cstdlib>
class CliPicture {
public:
CliPicture(const char* name);
virtual ~CliPicture();
void addItem(const char* text);
void assignDisplay(WINDOW* win);
void postPicture(WINDOW* win);
void unpostPicture(WINDOW* win);
void sendKey(int key);
int getActMenuItem() { return item_index(current_item(m_me)) + 1; }
int count;
private:
const char* m_name;
MENU *m_me;
ITEM **m_it;
};
#endif /* CLIPICTURE_H_ */
|
#ifndef JOBSYSTEM_H
#define JOBSYSTEM_H
#include <stddef.h>
typedef void (*JobFunc)(size_t index, size_t workerIndex, void *userdata);
void initJobSystem(size_t numWorkers);
void deinitJobSystem();
void runJobsSync(JobFunc func, size_t count, void *userdata, size_t dataSize);
size_t getNumWorkers();
#endif // JOBSYSTEM_H
|
/***************************************************************************
Copyright (C) 2008 by the Tonatiuh Software Development Team.
This file is part of Tonatiuh.
Tonatiuh 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/>.
Acknowledgments:
The development of Tonatiuh was started on 2004 by Dr. Manuel J. Blanco,
then Chair of the Department of Engineering of the University of Texas at
Brownsville. From May 2004 to July 2008, it was supported by the Department
of Energy (DOE) and the National Renewable Energy Laboratory (NREL) under
the Minority Research Associate (MURA) Program Subcontract ACQ-4-33623-06.
During 2007, NREL also contributed to the validation of Tonatiuh under the
framework of the Memorandum of Understanding signed with the Spanish
National Renewable Energy Centre (CENER) on February, 20, 2007 (MOU#NREL-07-117).
Since June 2006, the development of Tonatiuh is being led by the CENER, under the
direction of Dr. Blanco, now Director of CENER Solar Thermal Energy Department.
Developers: Manuel J. Blanco (mblanco@cener.com), Amaia Mutuberria, Victor Martin.
Contributors: Javier Garcia-Barberena, Inaki Perez, Inigo Pagola, Gilda Jimenez,
Juana Amieva, Azael Mancillas, Cesar Cantu.
***************************************************************************/
#ifndef TONATIUH_SCRIPT_H_
#define TONATIUH_SCRIPT_H_
class QScriptContext;
class QScriptEngine;
namespace tonatiuh_script
{
int init( QScriptEngine* engine );
QScriptValue tonatiuh_filename(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_irradiance(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_numrays(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_numdivisions(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_photon_map_export_mode(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_random_generator(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_sunposition(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_calculatesun(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_setsunpositiontoscene(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_setdisconnectalltrackers(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_saveas(QScriptContext* context, QScriptEngine* engine );
QScriptValue tonatiuh_trace(QScriptContext* context, QScriptEngine* engine );
};
#endif /* TONATIUH_SCRIPT_H_ */
|
/*
* Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd.
*
* Authors:
* Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SKINCENTER_H
#define SKINCENTER_H
#include <QDialog>
//#include <QTimer>
#include "../component/kylinlistwidget.h"
#include "../component/kylintitlebar.h"
#include "../component/kylinlistwidgetitem.h"
class MainWindow;
class SkinCenter :public QDialog
{
Q_OBJECT
public:
SkinCenter(QWidget *parent = 0/*, Qt::WindowFlags f = 0*/);
~SkinCenter();
void setParentWindow(MainWindow *From) { mainwindow = From;}
void initBackgroundList();
void setLanguage();
void initConnect();
void initTitleBar(const QString &path);
void initUsingLogo(QListWidgetItem *init_item);
void setLogo();
public slots:
void onCloseButtonClicked();
void changeSkinCenterBackground(QString pciture);
protected:
// virtual void enterEvent (QEvent *);
// virtual void leaveEvent (QEvent *);
void closeEvent(QCloseEvent *event);
private:
MainWindow *mainwindow;
KylinTitleBar *title_bar;
KylinListWidget *list_widget;
QString last_skin_path;
QLabel *using_label;
// QTimer *delayTimer;
// QString titlebar_pic;
};
#endif // SKINCENTER_H
|
#include "hsv_to_rgb.h"
#include "stdio.h"
void print(uint8_t hsv[3], uint8_t rgb[3]) {
printf("hsv : %x, %x, %x, rgb: %x %x %x\n", hsv[0], hsv[1], hsv[2], rgb[0], rgb[1], rgb[2]);
}
int main() {
uint8_t hsv[3];
uint8_t rgb[3];
hsv[0] = 0;
hsv[1] = 0;
hsv[2] = 0;
hsv_to_rgb(rgb, hsv);
print(hsv, rgb);
for (uint8_t i = 0; i < 255; i++) {
hsv[0] = i;
for (uint8_t j = 0; j < 255; j++) {
hsv[1] = j;
hsv_to_rgb(rgb, hsv);
if (rgb[0] != 0 ||
rgb[1] != 0 ||
rgb[2] != 0) {
printf(" crap %d %d\n", i, j);
print(hsv, rgb);
}
}
}
printf("passed v being zero\n");
//red
printf("red\n");
hsv[0] = 0;
hsv[1] = 255;
hsv[2] = 255;
hsv_to_rgb(rgb, hsv);
print(hsv, rgb);
//cyan
printf("cyan\n");
hsv[0] = 127;
hsv[1] = 127;
hsv[2] = 255;
hsv_to_rgb(rgb, hsv);
print(hsv, rgb);
//white
printf("white\n");
hsv[0] = 127;
hsv[1] = 0;
hsv[2] = 255;
hsv_to_rgb(rgb, hsv);
print(hsv, rgb);
printf("round the world\n");
hsv[1] = 255;
hsv[2] = 255;
#if 0
for(uint8_t i = 0; i < 255; i++) {
hsv[0] = i;
hsv_to_rgb(rgb, hsv);
print(hsv, rgb);
}
#endif
return 0;
}
|
/*
* 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 MULTIPLY_CONST_CC_IMPL_H
#define MULTIPLY_CONST_CC_IMPL_H
#include "multiply_const_cc_base.h"
class multiply_const_cc_i : public multiply_const_cc_base
{
public:
multiply_const_cc_i(const char *uuid, const char *label);
~multiply_const_cc_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();
//
// createOutputSRI
//
// Called by setupIOMappings when an output mapping is defined. For each output mapping
// defined, a call to createOutputSRI will be issued with the associated output index.
// This default SRI and StreamID will be saved to the mapping and pushed down stream via pushSRI.
// The subclass is responsible for overriding behavior of this method. The index provide matches
// the stream index number that will be use by the GR Block object
//
// @param idx : output stream index number to associate the returned SRI object with
// @return sri : default SRI object passed down stream over a RedHawk port
//
BULKIO::StreamSRI createOutputSRI( int32_t idx );
};
#endif
|
//===- Diagnostic.h -------------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_LD_DIAGNOSTIC_H
#define MCLD_LD_DIAGNOSTIC_H
#include <string>
#include <cassert>
#include <mcld/LD/DiagnosticEngine.h>
namespace mcld {
/** \class Diagnostic
* \brief Diagnostic provides current status to DiagnosticPrinters.
*/
class Diagnostic
{
public:
Diagnostic(DiagnosticEngine& pEngine);
~Diagnostic();
unsigned int getID() const
{ return m_Engine.state().ID; }
unsigned int getNumArgs() const
{ return m_Engine.state().numArgs; }
DiagnosticEngine::ArgumentKind getArgKind(unsigned int pIdx) const {
assert(pIdx < getNumArgs() && "Argument index is out of range!");
return (DiagnosticEngine::ArgumentKind)m_Engine.state().ArgumentKinds[pIdx];
}
const std::string &getArgStdStr(unsigned int pIdx) const {
assert(getArgKind(pIdx) == DiagnosticEngine::ak_std_string &&
"Invalid argument accessor!");
return m_Engine.state().ArgumentStrs[pIdx];
}
const char* getArgCStr(unsigned int pIdx) const {
assert(getArgKind(pIdx) == DiagnosticEngine::ak_c_string &&
"Invalid argument accessor!");
return reinterpret_cast<const char*>(m_Engine.state().ArgumentVals[pIdx]);
}
int getArgSInt(unsigned int pIdx) const {
assert(getArgKind(pIdx) == DiagnosticEngine::ak_sint &&
"Invalid argument accessor!");
return (int)m_Engine.state().ArgumentVals[pIdx];
}
unsigned int getArgUInt(unsigned int pIdx) const {
assert(getArgKind(pIdx) == DiagnosticEngine::ak_uint &&
"Invalid argument accessor!");
return (unsigned int)m_Engine.state().ArgumentVals[pIdx];
}
unsigned long long getArgULongLong(unsigned pIdx) const {
assert(getArgKind(pIdx) == DiagnosticEngine::ak_ulonglong &&
"Invalid argument accessor!");
return (unsigned long long)m_Engine.state().ArgumentVals[pIdx];
}
bool getArgBool(unsigned int pIdx) const {
assert(getArgKind(pIdx) == DiagnosticEngine::ak_bool &&
"Invalid argument accessor!");
return (bool)m_Engine.state().ArgumentVals[pIdx];
}
intptr_t getRawVals(unsigned int pIdx) const {
assert(getArgKind(pIdx) != DiagnosticEngine::ak_std_string &&
"Invalid argument accessor!");
return m_Engine.state().ArgumentVals[pIdx];
}
// format - format this diagnostic into string, subsituting the formal
// arguments. The result is appended at on the pOutStr.
void format(std::string& pOutStr) const;
// format - format the given formal string, subsituting the formal
// arguments. The result is appended at on the pOutStr.
void format(const char* pBegin, const char* pEnd, std::string& pOutStr) const;
private:
const char* findMatch(char pVal, const char* pBegin, const char* pEnd ) const;
private:
DiagnosticEngine& m_Engine;
};
} // namespace of mcld
#endif
|
#include<stdio.h>
#include<math.h>
#include"nc.h"
int fISizeC[3][4]={
{ 0 , 0 , 0 , 0 },
{ HISTORY_BITS,INT_BITS,HISTORY_BITS,INT_BITS } ,
{HISTORY_BITS,HISTORY_BITS,DECIMAL_BITS,DECIMAL_BITS }
};
//#include"common.h"
//extern int fISizeC[3][4];
unsigned int getFlag(int h1,int h2)
{
if(h1!=-1 && h2!=-1)return 0;
if(h1==-1 && h2!=-1)return 1;
if(h1!=-1 && h2==-1)return 2;
if(h1==-1 && h2==-1)return 3;
return 0;
}
void getParts(float val,unsigned int *intPart,unsigned int *decPart)
{
*intPart = (unsigned int)val;
*decPart = (unsigned int)((val - (int)val) * pow(10,DECIMAL_DIGITS));
}
void getArgsInArray(int h1,int h2,unsigned int flag,unsigned int intPart,unsigned int decPart,unsigned int *Arr)
{
Arr[0]=flag;
switch(flag)
{
case 0:
Arr[1]=(unsigned int)h1;
Arr[2]=(unsigned int)h2;
break;
case 1:
Arr[1]=intPart;
Arr[2]=h2;
break;
case 2:
Arr[1]=h1;
Arr[2]=decPart;
break;
case 3:
Arr[1]=intPart;
Arr[2]=decPart;
break;
default:
printf("%s","Error flag not within range");
return ;
}
}
unsigned int getCompressedValue(unsigned int flag,unsigned int f1,unsigned int f2)
{
unsigned int part0,part1,part2;
int f1sz = fISizeC[1][flag];
int f2sz = fISizeC[2][flag];
part0 = flag;
part1 = (part0<<f1sz)|f1;
part2 = (part1<<f2sz)|f2;
return part2;
}
unsigned int
getNextCompressedWord (int f1,int f2,int flag,unsigned int *word,int wrapUp)
{
static unsigned int savedData = 0;
static int byteNum = 0;
static int hasSavedData = 0;
unsigned int compressedValue = 0;
unsigned int size;
if(!wrapUp)
{
if(hasSavedData)
{
*word=0;
*word = savedData;
savedData = 0;
hasSavedData = 0;
}
compressedValue = getCompressedValue(flag,f1,f2);
size=fISizeC[1][flag]+fISizeC[2][flag]+CONTROL_BITS;
if(byteNum+size<=SIZE_OF_WORD)
{
*word = (*word << (size)) | compressedValue;
byteNum += size;
if(byteNum==SIZE_OF_WORD)
{
byteNum=0;
return WORD_COMPLETE;
}
else
return WORD_INCOMPLETE;
}
else
{
*word =
(*word << (SIZE_OF_WORD - byteNum)) | (compressedValue >>
(size - (SIZE_OF_WORD - byteNum)));
byteNum = byteNum + size - SIZE_OF_WORD;
savedData = ((~(~0 << byteNum)) & compressedValue);
hasSavedData = 1;
return WORD_IN_TEMP;
}
}
else
{
if (hasSavedData)
*word = savedData << (SIZE_OF_WORD - byteNum);
else
*word = *word << (SIZE_OF_WORD - byteNum);
savedData = 0;
byteNum = 0;
hasSavedData = 0;
return WORD_COMPLETE;
}
}
|
/* Copyright (c) 2012-2015 Todd Freed <todd.freed@gmail.com>
This file is part of fab.
fab 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.
fab 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 fab. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _VALYRIA_DICTIONARY_INTERNAL_H
#define _VALYRIA_DICTIONARY_INTERNAL_H
#include "dictionary.h"
#include "hashtable.internal.h"
#include "macros.h"
typedef struct entry {
bool val; // has-a-value
void * k; // key
struct {
uint16_t ka; // key allocated size
uint16_t kl; // key length
} __attribute__((aligned(8)));
char v[]; // the value
} entry;
typedef struct dictionary_t {
union {
hashtable_t ht;
hashtable htx;
dictionary dx;
struct {
size_t size;
size_t table_size;
};
};
size_t vsz; // value size
size_t vssz; // value storage size
// user callbacks
void (*destroy_fn)(void * entry);
xapi (*xdestroy_fn)(void * entry);
} dictionary_t;
STATIC_ASSERT(offsetof(dictionary, size) == offsetof(dictionary_t, size));
STATIC_ASSERT(offsetof(dictionary_t, size) == offsetof(hashtable_t, size));
STATIC_ASSERT(offsetof(dictionary, table_size) == offsetof(hashtable_t, table_size));
STATIC_ASSERT(offsetof(dictionary_t, table_size) == offsetof(hashtable_t, table_size));
#endif
|
#ifndef kbdisplay_h
#define kbdisplay_h
#include <QtGui>
#include "ui_kbddisplay.h"
#include "keyitemmodel.h"
#include "qgraphicskeyitem.h"
#include "keyboardview.h"
#include "global.h"
/*!
* @brief Applications main window.
*/
class KbdDisplay : public QMainWindow
{
Q_OBJECT
public:
KbdDisplay();
virtual ~KbdDisplay();
void printItemTree(QGraphicsItem * root = nullptr, int level = 0);
public slots:
void keyChanged(KeyItem* item);
void open();
void save();
void saveAs();
void exportSVG();
void print();
void loadKbd(QString filename);
protected:
virtual void resizeEvent(QResizeEvent * event);
QTableView *table;
KeyboardView *view;
QGraphicsScene *scene;
KeyItemModel *model;
QComboBox *keyboardsComboBox;
QMultiMap<QString,QGraphicsItem*> keys;
QMap<QString,QGraphicsItemGroup*> groups;
QGraphicsItem * drawGroup(QXmlStreamReader &reader, QGraphicsItemGroup * parent,
double keywidth, double keyheight, double margin);
QGraphicsItem* getItem(QString value);
void setUpToolbar();
QString filename;
private:
Ui_KbdDisplay * ui;
};
#endif // kbdisplay_h
|
/* location-manual.c -- Manual location provider source
This file is part of Redshift.
Redshift 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.
Redshift 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 Redshift. If not, see <http://www.gnu.org/licenses/>.
Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com>
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <errno.h>
#include "location-manual.h"
#ifdef ENABLE_NLS
# include <libintl.h>
# define _(s) gettext(s)
#else
# define _(s) s
#endif
typedef struct {
location_t loc;
} location_manual_state_t;
static int
location_manual_init(location_manual_state_t **state)
{
*state = malloc(sizeof(location_manual_state_t));
if (*state == NULL) return -1;
location_manual_state_t *s = *state;
s->loc.lat = NAN;
s->loc.lon = NAN;
return 0;
}
static int
location_manual_start(location_manual_state_t *state)
{
/* Latitude and longitude must be set */
if (isnan(state->loc.lat) || isnan(state->loc.lon)) {
fputs(_("Latitude and longitude must be set.\n"), stderr);
exit(EXIT_FAILURE);
}
return 0;
}
static void
location_manual_free(location_manual_state_t *state)
{
free(state);
}
static void
location_manual_print_help(FILE *f)
{
fputs(_("Specify location manually.\n"), f);
fputs("\n", f);
/* TRANSLATORS: Manual location help output
left column must not be translated */
fputs(_(" lat=N\t\tLatitude\n"
" lon=N\t\tLongitude\n"), f);
fputs("\n", f);
fputs(_("Both values are expected to be floating point numbers,\n"
"negative values representing west / south, respectively.\n"), f);
fputs("\n", f);
}
static int
location_manual_set_option(location_manual_state_t *state, const char *key,
const char *value)
{
/* Parse float value */
char *end;
errno = 0;
float v = strtof(value, &end);
if (errno != 0 || *end != '\0') {
fputs(_("Malformed argument.\n"), stderr);
return -1;
}
if (strcasecmp(key, "lat") == 0) {
state->loc.lat = v;
} else if (strcasecmp(key, "lon") == 0) {
state->loc.lon = v;
} else {
fprintf(stderr, _("Unknown method parameter: `%s'.\n"), key);
return -1;
}
return 0;
}
static int
location_manual_get_fd(location_manual_state_t *state)
{
return -1;
}
static int
location_manual_handle(
location_manual_state_t *state, location_t *location, int *available)
{
*location = state->loc;
*available = 1;
return 0;
}
const location_provider_t manual_location_provider = {
"manual",
(location_provider_init_func *)location_manual_init,
(location_provider_start_func *)location_manual_start,
(location_provider_free_func *)location_manual_free,
(location_provider_print_help_func *)location_manual_print_help,
(location_provider_set_option_func *)location_manual_set_option,
(location_provider_get_fd_func *)location_manual_get_fd,
(location_provider_handle_func *)location_manual_handle
};
|
/*==============================================
#
# Author: Sun Qinxuan
#
# Email: sunqinxuan@outlook.com
#
# Last modified: 2017-04-01 21:18
#
# Filename: DataReading.h
#
# Description:
#
===============================================*/
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <pcl-1.8/pcl/io/io.h>
#include <pcl-1.8/pcl/io/file_io.h>
#include <pcl-1.8/pcl/point_types.h>
#include <pcl-1.8/pcl/point_cloud.h>
#include <eigen3/Eigen/src/Core/DenseBase.h>
#include <pcl-1.8/pcl/features/integral_image_normal.h>
#include <pcl-1.8/pcl/features/normal_3d.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <pcl-1.8/pcl/visualization/cloud_viewer.h>
#include "Basics.h"
// + foldername
// + rgb
// + depth
// - rgb.txt
// - depth.txt
//
namespace sun
{
class DataReading
{
public:
// DataReading.
// + input
// - path_name: path of the folder locating the rgb.txt, depth.txt, rgb folder and depth folder, etc.
// + function
// - assignment of camera intrinsic parameters;
// - allocate the point_cloud;
// - set default StorageType as Time_Name;
// - set default debug as false;
DataReading(const std::string f);
~DataReading() {}
void setDebug(bool d) {debug=d;}
// setSampleInterval.
// + input
// - delta_t: read the image sequence every delta_t time.
void setSampleInterval(double delta_t) {sample_interval=delta_t;}
// setNormalEstimation
// - set the integral image normal estimation method;
// - and some necessary parameters;
void setNormalEstimation(pcl::IntegralImageNormalEstimation<pcl::PointXYZRGBA,
pcl::Normal>::NormalEstimationMethod method,
float MaxDepthChangeFactor, float NormalSmoothingSize);
// getScan.
// - return the pointer to the scan loaded from depth and rgb image;
// - load
// - img_rgb,img_depth;
// - point_cloud, normal_cloud, pixel_cloud;
Scan* getScan() {return scan;}
// loadScan
// - load the rgb and depth images to point_cloud, normal_cloud and pixel_cloud;
void loadScan();
// Initialize
// + input
// - time_start: read the image sequence from time_start.
// + function
// - open rgb.txt and depth.txt;
// - set timestamp to the start time;
void Initialize(double time_start = 0);
private:
// SampleDataset
// - sample the image sequence at next time step.
void SampleDataset();
// scan
// - img_rgb,img_depth;
// - point_cloud, normal_cloud, pixel_cloud;
Scan *scan;
// integral image normal estimation method;
pcl::IntegralImageNormalEstimation<pcl::PointXYZRGBA, pcl::Normal> normal_estimate_integral;
// camera intrinsic parameters;
double fx,fy,cx,cy,factor,dx,dy;
// width and height of the image;
int Width,Height;
// the time interval that sample the sequence;
double sample_interval;
// path of the root folder that locate the image sequence;
const std::string freiburg;
// file stream of rgb.txt and depth.txt;
std::ifstream fp_rgb,fp_depth;
// timestamp controlling the sample of the sequence;
double timestamp_rgb, timestamp_depth, timestamp;
// filename_rgb - rgb/*.png
// filename_depth - depth/*.png
std::string filename_rgb, filename_depth;
bool debug;
};
}
|
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/sem.h>
void main()
{
int sd_product;
key_t key_product;
struct sembuf sembuf_product;
key_product = ftok("/arm",1);
sd_product = semget(key_product, 1, IPC_CREAT);
sembuf_product.sem_num = 0;
sembuf_product.sem_op = -1;
sembuf_product.sem_flg = SEM_UNDO;
semop(sd_product, &sembuf_product, 1);
system("cp ./product.txt ./ship/product.txt");
sembuf_product.sem_num = 0;
sembuf_product.sem_op = 1;
sembuf_product.sem_flg = SEM_UNDO;
semop(sd_product, &sembuf_product, 1);
} |
/*************************************************************************/
/* Copyright (C) 2007-2009 sujith <m.sujith@gmail.com> */
/* Copyright (C) 2009-2011 matias <mati86dl@gmail.com> */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/*************************************************************************/
#include "pragha-debug.h"
#include <stdio.h>
/* Function to save debug on file. */
gint debug_level;
void
pragha_log_to_file (const gchar* log_domain,
GLogLevelFlags log_level,
const gchar* message,
gpointer user_data)
{
FILE* logfile = fopen ((const char*)user_data, "a");
gchar* level_name = "";
switch (log_level)
{
/* skip irrelevant flags */
case G_LOG_LEVEL_MASK:
case G_LOG_FLAG_FATAL:
case G_LOG_FLAG_RECURSION:
case G_LOG_LEVEL_ERROR:
level_name = "ERROR";
break;
case G_LOG_LEVEL_CRITICAL:
level_name = "CRITICAL";
break;
case G_LOG_LEVEL_WARNING:
level_name = "WARNING";
break;
case G_LOG_LEVEL_MESSAGE:
level_name = "MESSAGE";
break;
case G_LOG_LEVEL_INFO:
level_name = "INFO";
break;
case G_LOG_LEVEL_DEBUG:
level_name = "DEBUG";
break;
}
fprintf (logfile, "%s %s: %s\n",
log_domain ? log_domain : "Pragha", level_name, message);
fclose (logfile);
}
|
#ifndef LIST_CREATOR_H
#define LIST_CREATOR_H
using namespace std;
bool create_list(vector<int> &elements,
int quantity_of_elements, int seed);
void get_list_from_user(vector<int> &elements,
int quantity_of_elements);
void create_unsorted_list(vector<int> &elements,
int quantity_of_elements, int seed);
#endif // LIST_CREATOR_H
|
#ifndef __war3source_inavmeshladderconnection_h__
#define __war3source_inavmeshladderconnection_h__
#include "../NavDirType.h"
class INavMeshLadderConnection
{
public:
virtual void Destroy() = 0;
virtual unsigned int GetConnectingLadderID() = 0;
virtual eNavLadderDir GetDirection() = 0;
};
#endif |
/* include/linux/aio_abi.h
*
* Copyright 2000,2001,2002 Red Hat.
*
* Written by Benjamin LaHaise <bcrl@kvack.org>
*
* Distribute under the terms of the GPLv2 (see ../../COPYING) or under
* the following terms.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation is hereby granted, provided that the above copyright
* notice appears in all copies. This software is provided without any
* warranty, express or implied. Red Hat makes no representations about
* the suitability of this software for any purpose.
*
* IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
* SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
* THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
* RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
* ENHANCEMENTS, OR MODIFICATIONS.
*/
#ifndef __LINUX__AIO_ABI_H
#define __LINUX__AIO_ABI_H
#include <linux/types.h>
#include <asm/byteorder.h>
typedef __kernel_ulong_t aio_context_t;
enum
{
IOCB_CMD_PREAD = 0,
IOCB_CMD_PWRITE = 1,
IOCB_CMD_FSYNC = 2,
IOCB_CMD_FDSYNC = 3,
/* These two are experimental.
* IOCB_CMD_PREADX = 4,
* IOCB_CMD_POLL = 5,
*/
IOCB_CMD_NOOP = 6,
IOCB_CMD_PREADV = 7,
IOCB_CMD_PWRITEV = 8,
};
/*
* Valid flags for the "aio_flags" member of the "struct iocb".
*
* IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb"
* is valid.
*/
#define IOCB_FLAG_RESFD (1 << 0)
/* read() from /dev/aio returns these structures. */
struct io_event
{
__u64 data; /* the data field from the iocb */
__u64 obj; /* what iocb this event came from */
__s64 res; /* result code for this event */
__s64 res2; /* secondary result */
};
#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)
#define PADDED(x,y) x, y
#elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)
#define PADDED(x,y) y, x
#else
#error edit for your odd byteorder.
#endif
/*
* we always use a 64bit off_t when communicating
* with userland. its up to libraries to do the
* proper padding and aio_error abstraction
*/
struct iocb
{
/* these are internal to the kernel/libc. */
__u64 aio_data; /* data to be returned in event's data */
__u32 PADDED(aio_key, aio_reserved1);
/* the kernel sets aio_key to the req # */
/* common fields */
__u16 aio_lio_opcode; /* see IOCB_CMD_ above */
__s16 aio_reqprio;
__u32 aio_fildes;
__u64 aio_buf;
__u64 aio_nbytes;
__s64 aio_offset;
/* extra parameters */
__u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */
/* flags for the "struct iocb" */
__u32 aio_flags;
/*
* if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an
* eventfd to signal AIO readiness to
*/
__u32 aio_resfd;
}; /* 64 bytes */
#undef IFBIG
#undef IFLITTLE
#endif /* __LINUX__AIO_ABI_H */
|
#include <stdio.h>
#include <stdlib.h>
#define NTHRDS 4
#include <omp.h>
static long num_p = 100000; // Numero total de segmentos
double paso; // Delta x
int main(void){
int i;
double x, pi, suma = 0.0;
paso = 1.0 / (double)num_p;
// Se calcula la suma
omp_set_num_threads(NTHRDS);
#pragma omp parallel for private(x) reduction(+:suma)
for(i = 0; i < num_p; i++){
x = (i + 0.5) * paso;
suma = suma + 4.0 / (1.0 + x * x);
}
// Se estima pi
pi = paso * suma;
printf("El valor aproximado de pi es: %3.10lf \n", pi);
return EXIT_SUCCESS;
}
|
/*************************************************************
This file is part of messaging-cells.
messaging-cells is free software: you can redistribute it and/or modify
it under the terms of the version 3 of the GNU General Public
License as published by the Free Software Foundation.
messaging-cells 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 messaging-cells. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------
Copyright (C) 2017-2018. QUIROGA BELTRAN, Jose Luis.
Id (cedula): 79523732 de Bogota - Colombia.
See https://messaging-cells.github.io/
messaging-cells is free software thanks to The Glory of Our Lord
Yashua Melej Hamashiaj.
Our Resurrected and Living, both in Body and Spirit,
Prince of Peace.
------------------------------------------------------------*/
#include "global.h"
int main() {
mc_workerus_main();
return 0;
}
|
#ifndef HomeEasyTransmitter_h
#define HomeEasyTransmitter_h
#ifndef ARDUINO
typedef unsigned char byte;
#endif
class HomeEasyTransmitter
{
public:
//Constructor.
//arg1 = pin to connected to 434Mhz transmitter
HomeEasyTransmitter(short dataPin, short pclkPin , byte pLed );
HomeEasyTransmitter(short dataPin, byte pLed );
//arg1 = true to turn switch on, false for off
//arg2 = the 26 bit long transmitter ID as found by the Pete and Banarby's recevier code
//arg3 = the 4 bit recipient code, seems to be on a dial for mains switches, 1010 (6 in decimal) for my light fittings
void setSwitch(bool,unsigned long, short);
//init pin in output
void initPin();
// private:
short txPin; // 433mhz transmitter on pin2
short clkPin; // 433mhz transmitter on pin2
byte ledPin;
void transmit(bool, unsigned long, short);
void transmit(bool blnOn,unsigned long transmitterId, short recipient, byte level );
void sendBit(bool);
void sendPair(bool);
void rfm69_set_data(byte state);
void rfm69_set_data_without_clk(byte state);
void rfm69_set_data_with_clk(byte state);
void deactivatePin();
};
#endif
|
/**
******************************************************************************
* @file DMA2D/DMA2D_MemToMemWithBlending/Inc/stm32f4xx_it.h
* @author MCD Application Team
* @version V1.4.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 "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 DMA2D_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
#ifndef DCREDENCIAL_H
#define DCREDENCIAL_H
#include "ui_DCredencial.h"
class EReporte;
class MCredenciales;
class DCredencial : public QDialog, private Ui::DCredencialBase
{
Q_OBJECT
public:
explicit DCredencial(QWidget *parent = 0);
void setearEquipo(const int id_equipo, const QString equipo );
signals:
void agregarVentana( QWidget * );
public slots:
void accept();
private:
void limpiarDatos();
QString equipo;
int id_equipo;
EReporte *reporte;
MCredenciales *modelo;
};
#endif // DCREDENCIAL_H
|
/***************************************************************************
* Copyright (C) 2007 by Esteban Zeller *
* juiraze@yahoo.com.ar *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef GARANTIASPLUGIN_H
#define GARANTIASPLUGIN_H
class QString;
class QStackedWidget;
class QMenuBar;
#include <QObject>
#include <QtPlugin>
#include <QList>
#include <QAction>
#include "../../src/eplugin.h"
class GarantiasPlugin: public QObject, EPlugin
{
Q_OBJECT
Q_INTERFACES(EPlugin)
public:
QList<QActionGroup *> accionesBarra();
bool inicializar();
QWidgetList formsPreferencias();
QString nombre() const;
int tipo() const;
void crearMenu( QMenuBar *m );
bool verificarTablas( QStringList tablas );
double version() const;
void crearToolBar( QToolBar *t );
QAction *botonPantallaInicial();
void crearAccionesGlobales(QMainWindow *){}
private:
QAction *ActGarantias;
QAction *ActAgregarGarantia;
QAction *ActVerVencimientos;
public slots:
void seCierraGestotux();
void verGarantias();
void agregarGarantiaProducto( int id_comprobante, int id_producto, QString nombre_producto, int id_cliente );
void agregarGarantiaEquipamiento( int id_comprobante, int id_equipamiento, QString nombre_producto, int id_cliente );
void agregarGarantia();
void verVencimientos();
signals:
void agregarVentana( QWidget *v );
void agregarDockWidget( Qt::DockWidgetArea area, QDockWidget *ventana );
};
#endif // GARANTIASPLUGIN_H
|
#ifndef CUSTOMMDIAREA_H
#define CUSTOMMDIAREA_H
#include <QWidget>
#include <QMdiArea>
#include <QMdiSubWindow>
namespace Ui {
class CustomMdiArea;
}
/**
* @brief CustomMdiArea class - redefines addSubWindow to add proper options for each
* subwindow in order to avoid flickering problems.
*/
class CustomMdiArea : public QMdiArea
{
public:
/**
* @brief CustomMdiArea
*/
CustomMdiArea(QWidget *parent);
~CustomMdiArea();
/**
* @brief addSubWindow - redefines QMdiArea addSubWindow by adding the RubberBandResize
* and RubberBandMove options to the subwindow in order to avoid flickering problems.
* @param widget
* @param flags
*/
QMdiSubWindow *addSubWindow(QWidget *widget, Qt::WindowFlags flags = 0);
private:
Ui::CustomMdiArea *ui;
};
#endif // CUSTOMMDIAREA_H
|
// Copyright 2016 Mischa Schirmer
//
// This file is part of NEBULAR.
//
// NEBULAR 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.
//
// NEBULAR 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 NEBULAR. If not, see <http://www.gnu.org/licenses/>.
#ifndef __FREEFREE_H
#define __FREEFREE_H
#include "functions.h"
using namespace std;
//************************************************************************
// Freefree class to deal with Bremsstrahlung;
// Gaunt factors are taken from van Hoof+ (2014)
//************************************************************************
class freefree {
private:
vector<double> grid_log_u;
vector<double> grid_log_g2;
vector<double> grid_geff;
void read_freefree(const string);
public:
double min_log_u;
double max_log_u;
double min_log_g2;
double max_log_g2;
string datapath;
// constructor
freefree ()
: min_log_u(0.)
, max_log_u(0.)
, min_log_g2(0.)
, max_log_g2(0.)
{
char *dpath = getenv("NEBULARDIR");
datapath = string(dpath);
// Read the van Hoof+ (2014) table
read_freefree(datapath+"/gauntff_reformat.dat");
}
// destructor; doesn't do anything at the moment
~freefree() {}
// Calculate the free-free emission and propagate
// the result into the output spectrum
void calculate_freefree(spectrum&, const double, const string);
};
#endif
|
#ifndef _ABSTRACT_H
#define _ABSTRACT_H
#include <ptlib.h>
#include <ptlib/pluginmgr.h>
class MyAbstractClass
{
public:
virtual PString Function() = 0;
};
#endif
|
// HOG-Man - Hierarchical Optimization for Pose Graphs on Manifolds
// Copyright (C) 2010 G. Grisetti, R. Kümmerle, C. Stachniss
//
// This file is part of HOG-Man.
//
// HOG-Man 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.
//
// HOG-Man 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 HOG-Man. If not, see <http://www.gnu.org/licenses/>.
#ifndef STANDARD_CAMERA_H
#define STANDARD_CAMERA_H
namespace AISNavigation {
class StandardCamera : public qglviewer::Camera
{
public:
StandardCamera() : _standard(true) {};
float zNear() const {
if (_standard)
return 0.001;
else
return Camera::zNear();
}
float zFar() const
{
if (_standard)
return 1000.0;
else
return Camera::zFar();
}
void toggleMode() {_standard = !_standard;}
bool isStandard() const {return _standard;}
private:
bool _standard;
};
} // end namespace
#endif
|
/*
Copyright © 2012 Clint Bellanger
Copyright © 2012 davidriod
Copyright © 2013 Kurt Rinnert
Copyright © 2014 Henrik Andersson
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 WidgetCheckBox
*/
#ifndef WIDGET_CHECKBOX_H
#define WIDGET_CHECKBOX_H
class Widget;
class WidgetCheckBox : public Widget {
public:
WidgetCheckBox (const std::string &fname = "images/menus/buttons/checkbox_default.png");
~WidgetCheckBox ();
void activate();
void Check ();
void unCheck ();
void toggleCheck ();
bool checkClick ();
bool checkClick (int x, int y);
bool isChecked () const;
void render ();
bool enabled;
private:
Sprite *cb;
bool checked;
bool pressed;
};
#endif
|
/*
* Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* 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.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef MLX5_CMD_H
#define MLX5_CMD_H
#include <linux/types.h>
struct manage_pages_layout
{
u64 ptr;
u32 reserved;
u16 num_entries;
u16 func_id;
};
struct mlx5_cmd_alloc_uar_imm_out
{
u32 rsvd[3];
u32 uarn;
};
#endif /* MLX5_CMD_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/>.
*/
/*
* That file declares functions that are used by automatic API wrapper generators. These
* should not be used by C API users.
*/
#ifndef _WRAPPER_UTILS_H
#define _WRAPPER_UTILS_H
#include <bctoolbox/list.h>
#include "linphone/defs.h"
#include "linphone/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup wrapper
* @{
*/
/**
* @brief Gets the list of listener in the account.
* @param account #LinphoneAccount object. @notnil
* @return The list of #LinphoneAccountCbs. @maybenil
* @donotwrap
*/
LINPHONE_PUBLIC const bctbx_list_t *linphone_account_get_callbacks_list(const LinphoneAccount *account);
/**
* Sets the current LinphoneAccountCbs.
* @param account #LinphoneAccount object. @notnil
* @param cbs The #LinphoneAccountCbs object. @maybenil
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_account_set_current_callbacks(LinphoneAccount *account, LinphoneAccountCbs *cbs);
/**
* @brief Gets the list of listener in the core.
* @param core The #LinphoneCore. @notnil
* @return The list of #LinphoneCoreCbs. @maybenil
* @donotwrap
*/
LINPHONE_PUBLIC bctbx_list_t *linphone_core_get_callbacks_list(const LinphoneCore *core);
/**
* @brief Gets the list of listener in the call.
* @param call #LinphoneCall object. @notnil
* @return The list of #LinphoneCallCbs. @maybenil
* @donotwrap
*/
LINPHONE_PUBLIC const bctbx_list_t *linphone_call_get_callbacks_list(const LinphoneCall *call);
/**
* @brief Gets the list of listener in the chat room.
* @param chat_room #LinphoneChatRoom object. @notnil
* @return The list of #LinphoneChatRoomCbs. @maybenil
* @donotwrap
*/
LINPHONE_PUBLIC const bctbx_list_t *linphone_chat_room_get_callbacks_list(const LinphoneChatRoom *chat_room);
/**
* Gets the list of listener in the conference.
* @param[in] conference LinphoneConference object
* @return The attached listeners. \bctbx_list{LinphoneConferenceCbs}
* @donotwrap
*/
LINPHONE_PUBLIC const bctbx_list_t *linphone_conference_get_callbacks_list(const LinphoneConference *conference);
/**
* Sets the current LinphoneChatRoomCbs.
* @param chat_room LinphoneChatRoom object
* @param cbs LinphoneChatRoomCbs object
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_chat_room_set_current_callbacks(LinphoneChatRoom *chat_room, LinphoneChatRoomCbs *cbs);
/**
* @brief Gets the list of listener in the chat mesasge.
* @param message #LinphoneChatMessage object.
* @return The list of #LinphoneChatMessageCbs.
* @donotwrap
*/
LINPHONE_PUBLIC const bctbx_list_t *linphone_chat_message_get_callbacks_list(const LinphoneChatMessage *message);
/**
* Sets the current LinphoneChatMessageCbs.
* @param message LinphoneChatMessage object
* @param cbs LinphoneChatMessageCbs object
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_chat_message_set_current_callbacks(LinphoneChatMessage *message, LinphoneChatMessageCbs *cbs);
/**
* Accessor for the shared_ptr<BelCard> stored by a #LinphoneVcard
* @param vcard a #LinphoneVcard
* @return a shared_ptr<BelCard>
* @donotwrap
*/
LINPHONE_PUBLIC void *linphone_vcard_get_belcard(LinphoneVcard *vcard);
/**
* Allow multipart on a basic chat room
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_chat_room_allow_multipart(LinphoneChatRoom *room);
/**
* Allow cpim on a basic chat room
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_chat_room_allow_cpim(LinphoneChatRoom *room);
/**
* Gets the list of listeners from a #LinphoneMagicSearch.
* @param magic_search #LinphoneMagicSearch object. @notnil
* @return The list of listeners that have been added. \bctbx_list{LinphoneMagicSearchCbs} @maybenil
* @donotwrap
*/
LINPHONE_PUBLIC const bctbx_list_t *linphone_magic_search_get_callbacks_list(const LinphoneMagicSearch *magic_search);
/************ */
/* DEPRECATED */
/* ********** */
/**
* Send a message to peer member of this chat room.
*
* The state of the sending message will be notified via the callbacks defined in the #LinphoneChatMessageCbs object that can be obtained
* by calling linphone_chat_message_get_callbacks().
* @note Unlike linphone_chat_room_send_chat_message(), that function only takes a reference on the #LinphoneChatMessage
* instead of totaly takes ownership on it. Thus, the #LinphoneChatMessage object must be released by the API user after calling
* that function.
*
* @param chat_room A chat room. @notnil
* @param message The message to send. @notnil
* @deprecated 08/07/2020 Use linphone_chat_message_send() instead.
* @donotwrap It doesn't says what the doc says it does
*/
LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_chat_room_send_chat_message_2(LinphoneChatRoom *chat_room, LinphoneChatMessage *message);
/**
* Resend a chat message if it is in the 'not delivered' state for whatever reason.
* @note Unlike linphone_chat_message_resend(), that function only takes a reference on the #LinphoneChatMessage
* instead of totaly takes ownership on it. Thus, the #LinphoneChatMessage object must be released by the API user after calling
* that function.
*
* @param message #LinphoneChatMessage object @notnil
* @deprecated 08/07/2020 Use linphone_chat_message_send instead.
* @donotwrap It doesn't says what the doc says it does
*/
LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_chat_message_resend_2(LinphoneChatMessage *message);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif // _WRAPPER_UTILS_H
|
#ifndef RH4N_VARIABLE_MAN_1DSTRING
#define RH4N_VARIABLE_MAN_1DSTRING
#define OFFSET_1DString(length, x) (((length+1)*sizeof(wchar_t))*x)
int new1DString(VariableObject *anker, char *group, char *name, int length, int x_length);
int set1DStringX(VariableObject *anker, char *group, char *name, int x, wchar_t *val);
wchar_t *get1DStringX(VariableObject *anker, char *group, char *name, int x);
int newStringfrom1DString(VariableObject *anker, char *group, char *name, int x,
char *new_group, char *new_name);
int print1DString(VariableObject *target, FILE *output, int mode);
int print1DStringX(VariableObject *target, int x, FILE *output);
#endif
|
/*
* This file is part of GReminder.
*
* Copyright 2014 Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
*
* GReminder 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.
*
* GReminder 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 GReminder. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __G_REMINDER_KEYWORDS_WIDGET_PRIVATE_H__
#define __G_REMINDER_KEYWORDS_WIDGET_PRIVATE_H__
#include "greminder-keywords-widget.h"
G_BEGIN_DECLS
typedef struct _GReminderKeywordsWidgetPrivate GReminderKeywordsWidgetPrivate;
struct _GReminderKeywordsWidget
{
GtkBox parent_instance;
};
struct _GReminderKeywordsWidgetClass
{
GtkBoxClass parent_class;
};
G_END_DECLS
#endif /*__G_REMINDER_KEYWORDS_WIDGET_PRIVATE_H__*/
|
#ifndef __Command__
#define __Command__
#include <string>
#include "player.h"
#include "globals.h"
using namespace std;
class Command
{
public:
Command(const list<string> names, const Action action, const int numberOfArguments);
virtual ~Command();
int CountWords(const string & input);
bool IsCommand(const string & input);
string GetArguments(const string & input);
list<string> names;
Action action;
int numberOfArguments;
};
#endif |
#ifndef TREE_H
#define TREE_H
struct tree {
struct tree *parent;
struct tree *left;
struct tree *right;
void *data;
};
struct tree * tree_create();
int tree_isempty(struct tree *tr);
int tree_destroy(struct tree *tr);
int tree_fulldestroy(struct tree *tr);
int tree_has(const struct tree *tr, const void *data, int (compare)(const void *data1, const void *data2));
int tree_add(struct tree *tr, const void *data, int (compare)(const void *lh, const void *rh));
int tree_size(const struct tree *tr);
int tree_map(struct tree *tr, int (action)(void const *data));
int tree_map_over_node(struct tree *tr, int (action)(struct tree const *node));
#endif |
#pragma once
#include "renderer/d3d12_includes.h"
#include "util/vector.h"
#define BLOWBOX_USE_32BIT_INDICES
namespace blowbox
{
/**
* This data type is typedef-ed because it allows the entire
* application to easily switch from 16 bit indices to 32 bit
* indices, if desired.
*
* @typedef blowbox::Index
* @brief Descibes an index.
*/
#ifdef BLOWBOX_USE_32BIT_INDICES
typedef uint32_t Index;
#else
typedef uint16_t Index;
#endif
/**
* Meshes consist of vertices. Every vertex has a bunch of information
* attached to it. This class stores the data for every vertex.
*
* @brief Describes a Vertex.
* @remarks Notably, bitangent is missing from the vertex layout. You
* are supposed to generate the bitangent yourself in the vertex
* shader that you have bound to the pipeline.
*/
class Vertex
{
public:
Vertex() :
position(0.0f, 0.0f, 0.0f),
normal(0.0f, 1.0f, 0.0f),
tangent(1.0f, 0.0f, 0.0f),
uv(0.0f, 0.0f),
color(1.0f, 0.0f, 1.0f, 0.0f)
{
}
DirectX::XMFLOAT3 position; //!< The position of the vertex.
DirectX::XMFLOAT3 normal; //!< The normal of the vertex.
DirectX::XMFLOAT3 tangent; //!< The tangent of the vertex.
DirectX::XMFLOAT2 uv; //!< The UV coordinates of the vertex.
DirectX::XMFLOAT4 color; //!< The color of the vertex.
/** @returns A list of D3D12_INPUT_ELEMENT_DESCs that explain the entire data layout of a vertex. */
static Vector<D3D12_INPUT_ELEMENT_DESC> GetInputElements()
{
Vector<D3D12_INPUT_ELEMENT_DESC> input_elements(5);
input_elements[0] = { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 };
input_elements[1] = { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 };
input_elements[2] = { "TANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 24, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 };
input_elements[3] = { "UV", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 36, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 };
input_elements[4] = { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 44, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 };
return input_elements;
}
};
} |
#ifndef CONTROL_H
#define CONTROL_H
#include <string>
#include <vector>
using namespace std;
struct playerNode{
int health;
string name;
int points;
int weapon;
};
struct TreeNode{
TreeNode *left;
TreeNode *right;
TreeNode *root;
int key;
};
class control
{
public:
control();
virtual ~control();
void buildTreeEasy();
void buildTreeMedium();
void buildTreeHard();
void createPlayer();
void printPlayerPath();
void printBestPath();
void traverseTree(int command);
void checkStats();
void changeWeapon(int weaponKey);
void recoverHealth();
void restart();
protected:
private:
void modifyStats();
bool beatDragon();
};
#endif // CONTROL_H
|
/* This file is part of PlasmaShop.
*
* PlasmaShop 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.
*
* PlasmaShop 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 PlasmaShop. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _QLINKLABEL_H
#define _QLINKLABEL_H
#include <QLabel>
#include <QMouseEvent>
class QLinkLabel : public QLabel
{
protected:
Q_OBJECT
bool fInClick;
public:
QLinkLabel(QWidget* parent = 0)
: QLabel(parent), fInClick(false) { init(); }
QLinkLabel(const QString& text, QWidget* parent = Q_NULLPTR)
: QLabel(text, parent), fInClick(false) { init(); }
protected:
void init();
void mousePressEvent(QMouseEvent* evt) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent* evt) Q_DECL_OVERRIDE;
signals:
void activated();
};
#endif
|
//----------------------------------------------------------------------------
// 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/>.
//----------------------------------------------------------------------------
//DqGroundMotions.h
#ifndef DqGroundMotions_h
#define DqGroundMotions_h
#include "xc_utils/src/kernel/CommandEntity.h"
#include <deque>
#include "utility/actor/actor/MovableObject.h"
namespace XC {
class GroundMotion;
//! @ingroup GMotion
//
//! @brief Seismic definitions container.
class DqGroundMotions : public CommandEntity, public MovableObject
{
protected:
typedef std::deque<GroundMotion *> dq_ptr_GroundMotions;
typedef dq_ptr_GroundMotions::const_reference const_reference;
typedef dq_ptr_GroundMotions::reference reference;
typedef dq_ptr_GroundMotions::iterator iterator;
typedef dq_ptr_GroundMotions::const_iterator const_iterator;
dq_ptr_GroundMotions gMotions; //!< Pointers to GroundMotion container.
int sendData(CommParameters &);
int recvData(const CommParameters &);
public:
DqGroundMotions(const size_t &num= 0);
DqGroundMotions(const DqGroundMotions &);
DqGroundMotions &operator=(const DqGroundMotions &);
~DqGroundMotions(void);
inline bool empty(void) const
{ return gMotions.empty(); }
inline size_t getNumGroundMotions(void) const
{ return gMotions.size(); }
inline iterator begin(void)
{ return gMotions.begin(); }
inline const_iterator begin(void) const
{ return gMotions.begin(); }
inline iterator end(void)
{ return gMotions.end(); }
inline const_iterator end(void) const
{ return gMotions.end(); }
inline reference operator[](const size_t &n)
{ return gMotions[n]; }
inline const_reference operator[](const size_t &n) const
{ return gMotions[n]; }
void addMotion(GroundMotion &f);
void clear(void);
int sendSelf(CommParameters &);
int recvSelf(const CommParameters &);
void Print(std::ostream &s,const int &flag);
};
} // end of XC namespace
#endif
|
//
// pwmoutput.h
//
// Circle - A C++ bare metal environment for Raspberry Pi
// Copyright (C) 2014-2015 R. Stange <rsta2@o2online.de>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 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 _circle_pwmoutput_h
#define _circle_pwmoutput_h
#include "../../../pi-OS/include/circle/gpioclock.h"
#include "../../../pi-OS/include/circle/spinlock.h"
#include "../../../Pi-OS/include/circle/types.h"
class CPWMOutput
{
public:
CPWMOutput (TGPIOClockSource Source, // see gpioclock.h
unsigned nDivider, // 1..4095
unsigned nRange, // Range (see "BCM2835 ARM Peripherals")
boolean bMSMode); // M/S mode (see "BCM2835 ARM Peripherals")
~CPWMOutput (void);
void Start (void);
void Stop (void);
#define PWM_CHANNEL1 1
#define PWM_CHANNEL2 2
void Write (unsigned nChannel, unsigned nValue); // nValue: 0..Range
private:
CGPIOClock m_Clock;
unsigned m_nDivider;
unsigned m_nRange;
boolean m_bMSMode;
boolean m_bActive;
CSpinLock m_SpinLock;
};
#endif
|
/*
Free Download Manager Copyright (c) 2003-2016 FreeDownloadManager.ORG
*/
#if !defined(AFX_VMSINTERNETSESSION_H__D02A0038_60AB_46ED_8961_C277CA35463C__INCLUDED_)
#define AFX_VMSINTERNETSESSION_H__D02A0038_60AB_46ED_8961_C277CA35463C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif
#include "downloadproperties.h"
class vmsInternetSession : public fsInternetSession
{
public:
fsInternetResult Create (LPCTSTR pszAgent, fsInternetAccessTypeEx enAT, LPCTSTR pszProxyName, fsNetworkProtocol enProtocol);
vmsInternetSession();
virtual ~vmsInternetSession();
};
#endif
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* This file is part of the libcdr project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __CMXPARSER_H__
#define __CMXPARSER_H__
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include <librevenge-stream/librevenge-stream.h>
#include "CDRTypes.h"
#include "CommonParser.h"
namespace libcdr
{
class CDRCollector;
class CMXParser : protected CommonParser
{
public:
explicit CMXParser(CDRCollector *collector);
virtual ~CMXParser();
bool parseRecords(librevenge::RVNGInputStream *input, long size = -1, unsigned level = 0);
private:
CMXParser();
CMXParser(const CMXParser &);
CMXParser &operator=(const CMXParser &);
bool parseRecord(librevenge::RVNGInputStream *input, unsigned level = 0);
void readRecord(unsigned fourCC, unsigned &length, librevenge::RVNGInputStream *input);
void readCMXHeader(librevenge::RVNGInputStream *input);
void readDisp(librevenge::RVNGInputStream *input, unsigned length);
void readCcmm(librevenge::RVNGInputStream *input, long &recordEnd);
void readPage(librevenge::RVNGInputStream *input, unsigned length);
// Command readers
void readBeginPage(librevenge::RVNGInputStream *input);
void readBeginLayer(librevenge::RVNGInputStream *input);
void readBeginGroup(librevenge::RVNGInputStream *input);
void readPolyCurve(librevenge::RVNGInputStream *input);
void readEllipse(librevenge::RVNGInputStream *input);
void readRectangle(librevenge::RVNGInputStream *input);
void readJumpAbsolute(librevenge::RVNGInputStream *input);
// Types readers
CDRTransform readMatrix(librevenge::RVNGInputStream *input);
CDRBox readBBox(librevenge::RVNGInputStream *input);
void readFill(librevenge::RVNGInputStream *input);
// Complex types readers
void readRenderingAttributes(librevenge::RVNGInputStream *input);
bool m_bigEndian;
unsigned short m_unit;
double m_scale;
double m_xmin, m_xmax, m_ymin, m_ymax;
unsigned m_indexSectionOffset;
unsigned m_infoSectionOffset;
unsigned m_thumbnailOffset;
unsigned m_fillIndex;
unsigned m_nextInstructionOffset;
};
} // namespace libcdr
#endif // __CMXPARSER_H__
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
|
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
******************************************************************************/
#ifndef __RTL8188E_CMD_H__
#define __RTL8188E_CMD_H__
enum RTL8188E_H2C_CMD_ID
{
/* Class Common */
H2C_COM_RSVD_PAGE = 0x00,
H2C_COM_MEDIA_STATUS_RPT = 0x01,
H2C_COM_SCAN = 0x02,
H2C_COM_KEEP_ALIVE = 0x03,
H2C_COM_DISCNT_DECISION = 0x04,
H2C_COM_INIT_OFFLOAD = 0x06,
H2C_COM_REMOTE_WAKE_CTL = 0x07,
H2C_COM_AP_OFFLOAD = 0x08,
H2C_COM_BCN_RSVD_PAGE = 0x09,
H2C_COM_PROB_RSP_RSVD_PAGE = 0x0A,
/* Class PS */
H2C_PS_PWR_MODE = 0x20,
H2C_PS_TUNE_PARA = 0x21,
H2C_PS_TUNE_PARA_2 = 0x22,
H2C_PS_LPS_PARA = 0x23,
H2C_PS_P2P_OFFLOAD = 0x24,
/* Class DM */
H2C_DM_MACID_CFG = 0x40,
H2C_DM_TXBF = 0x41,
/* Class BT */
H2C_BT_COEX_MASK = 0x60,
H2C_BT_COEX_GPIO_MODE = 0x61,
H2C_BT_DAC_SWING_VAL = 0x62,
H2C_BT_PSD_RST = 0x63,
/* Class */
H2C_RESET_TSF = 0xc0,
};
enum
{
PWRS
};
struct setpwrmode_parm
{
u8 Mode;/* 0:Active,1:LPS,2:WMMPS */
u8 SmartPS_RLBM;/* LPS= 0:PS_Poll,1:PS_Poll,2:NullData,WMM= 0:PS_Poll,1:NullData */
u8 AwakeInterval; /* unit: beacon interval */
u8 bAllQueueUAPSD;
u8 PwrState;/* AllON(0x0c),RFON(0x04),RFOFF(0x00) */
};
struct rsvdpage_loc
{
u8 LocProbeRsp;
u8 LocPsPoll;
u8 LocNullData;
u8 LocQosNull;
u8 LocBTQosNull;
};
/* host message to firmware cmd */
void rtl8188e_set_FwPwrMode_cmd(struct adapter *padapter, u8 Mode);
void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus);
void rtl8188e_set_FwMediaStatus_cmd(struct adapter *adapt, __le16 mstatus_rpt);
#endif/* __RTL8188E_CMD_H__ */
|
/* terminfo.c: Interface from Emacs to terminfo.
Copyright (C) 1985-1986, 2001-2014 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs 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.
GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include "tparam.h"
#include "lisp.h"
/* Define these variables that serve as global parameters to termcap,
* so that we do not need to conditionalize the places in Emacs
* that set them: */
extern char *UP, *BC, PC;
/* Interface to curses/terminfo library.
* Turns out that all of the terminfo-level routines look
* like their termcap counterparts except for tparm, which replaces
* tgoto. Not only is the calling sequence different, but the string
* format is different too: */
extern char *tparm (const char *str, ...);
char *
tparam (const char *string, char *outstring, int len,
int arg1, int arg2, int arg3, int arg4)
{
char *temp;
/* Emacs always should pass a null OUTSTRING and zero LEN. */
if (outstring || len)
emacs_abort ();
temp = tparm (string, arg1, arg2, arg3, arg4);
return xstrdup (temp);
}
/* EOF */
|
#ifndef PANEL_H
#define PANEL_H
namespace Panel {
bool kPreviewMoreTypes = true;
}
#endif // PANEL_H
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.