text
stringlengths
4
6.14k
/* Copyright (C) 2011 J. Coliz <maniacbug@ymail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. */ /* spaniakos <spaniakos@gmail.com> Added __ARDUINO_X86__ support */ #ifndef __RF24_CONFIG_H__ #define __RF24_CONFIG_H__ /*** USER DEFINES: ***/ //#define FAILURE_HANDLING //#define SERIAL_DEBUG //#define MINIMAL //#define SPI_UART // Requires library from https://github.com/TMRh20/Sketches/tree/master/SPI_UART //#define SOFTSPI // Requires library from https://github.com/greiman/DigitalIO /**********************/ #define rf24_max(a,b) (a>b?a:b) #define rf24_min(a,b) (a<b?a:b) #endif // __RF24_CONFIG_H__
#ifndef GLEngineCmds__hhhh #define GLEngineCmds__hhhh #include <windows.h> #include <cstdint> #include <GL/glew.h> #include "../BMPBox.h" #include "../FrameCapture.h" class GLEngine; /****************************************************/ /* Common argumets for bitmap rendering coordinates */ /****************************************************/ struct GLBitmapRenderCoords { int mXDest; int mYDest; int mWidthDest; int mHeightDest; int mXSrc; int mYSrc; int mWidthSrc; int mHeightSrc; }; /************************************/ /* Base class for GLEngine Commands */ /************************************/ class GLEngineCmd; class GLEngineCmd { public: GLEngineCmd() {} virtual ~GLEngineCmd() {} public: virtual void run(GLEngine& glEngine) const = 0; virtual bool shouldBeSynchronous(void) const { return false; } virtual bool isFrameEnd(void) const { return false; } virtual bool isSmbxClearCmd(void) const { return false; } virtual bool isExitCmd(void) const { return false; } }; /******************************/ /* Specific GLEngine Commands */ /******************************/ class GLEngineCmd_ClearSMBXSprites : public GLEngineCmd { public: virtual void run(GLEngine& glEngine) const; virtual bool shouldBeSynchronous(void) const { return true; } virtual bool isSmbxClearCmd(void) const { return true; } }; class GLEngineCmd_ClearLunaTexture : public GLEngineCmd { public: const BMPBox* mBmp; virtual void run(GLEngine& glEngine) const; virtual bool shouldBeSynchronous(void) const { return true; } }; class GLEngineCmd_EmulateBitBlt : public GLEngineCmd, public GLBitmapRenderCoords { public: HDC mHdcSrc; DWORD mRop; virtual void run(GLEngine& glEngine) const; }; class GLEngineCmd_RenderCameraToScreen : public GLEngineCmd, public GLBitmapRenderCoords { public: HDC mHdcDest; HDC mHdcSrc; DWORD mRop; virtual void run(GLEngine& glEngine) const; }; class GLEngineCmd_EndFrame : public GLEngineCmd { public: HDC mHdcDest; virtual void run(GLEngine& glEngine) const; virtual bool isFrameEnd(void) const { return true; } }; class GLEngineCmd_LunaDrawSprite : public GLEngineCmd, public GLBitmapRenderCoords { public: const BMPBox* mBmp; float mOpacity; virtual void run(GLEngine& glEngine) const; }; class GLEngineCmd_Exit : public GLEngineCmd { public: virtual void run(GLEngine& glEngine) const; virtual bool isExitCmd(void) const { return true; } }; class GLEngineCmd_SetTexture : public GLEngineCmd { public: const BMPBox* mBmp; uint32_t mColor; virtual void run(GLEngine& glEngine) const; }; class GLEngineCmd_Draw2DArray : public GLEngineCmd { public: GLuint mType; const float* mVert; const float* mTex; uint32_t mCount; virtual void run(GLEngine& glEngine) const; virtual ~GLEngineCmd_Draw2DArray() { if (mVert) { free((void*)mVert); mVert = NULL; } if (mTex) { free((void*)mTex); mTex = NULL; } } }; class GLEngineCmd_LuaDraw : public GLEngineCmd { public: const BMPBox* mBmp; std::shared_ptr<CaptureBuffer> mCapBuff; float mColor[4]; GLuint mType; const float* mVert; const float* mTex; const float* mVertColor; uint32_t mCount; bool mSceneCoords; virtual void run(GLEngine& glEngine) const; virtual ~GLEngineCmd_LuaDraw() { if (mVert) { free((void*)mVert); mVert = NULL; } if (mTex) { free((void*)mTex); mTex = NULL; } if (mVertColor) { free((void*)mVertColor); mVertColor = NULL; } } }; class GLEngineCmd_SetCamera : public GLEngineCmd { public: double mX, mY; virtual void run(GLEngine& glEngine) const; }; #endif
#include <stdint.h> #include <stdbool.h> #include "inc/hw_types.h" #include "inc/hw_gpio.h" #include "inc/hw_memmap.h" #include "inc/hw_sysctl.h" #include "driverlib/gpio.h" #include "driverlib/rom.h" #include "driverlib/sysctl.h" #include "driverlib/pin_map.h" #include "driverlib/timer.h" #define LED_RED GPIO_PIN_1 #define LED_BLUE GPIO_PIN_2 #define LED_GREEN GPIO_PIN_3 int main() { ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_GREEN); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); ROM_TimerDisable(TIMER0_BASE, TIMER_A); ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC); ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, ROM_SysCtlClockGet()); ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_GREEN, 0); ROM_TimerEnable(TIMER0_BASE, TIMER_A); while(1) { if(ROM_TimerValueGet(TIMER0_BASE, TIMER_A) >= (ROM_SysCtlClockGet()/2)) { ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_GREEN, LED_GREEN); } else { ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_GREEN, 0); } } }
/******************************************************************************* GridsFromTableAndGrid.cpp Copyright (C) Victor Olaya This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGridsFromTableAndGrid : public CSG_Module_Grid { public: CGridsFromTableAndGrid(void); virtual const SG_Char * Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //---------------------------------------------------------
#ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include <QDialog> #include "aggreg_operators/aggregoperators.h" namespace Ui { class AggregFilterSettingsDialog; } class AggregFilterSettingsDialog : public QDialog { Q_OBJECT // == METHODS == public: explicit AggregFilterSettingsDialog(QWidget* parent = 0); virtual ~AggregFilterSettingsDialog(); // Set active aggregation operator type void SetCurrAggrOpType(const AggregOperator::Type& t_type); // Get current aggregation operator type AggregOperator::Type GetAggrOpType() const; // Set aggregation operator power void SetCurrAggrOpPower(const double& t_power); // Get current aggregation operator power value double GetAggrOpPower() const; // Set active aggregation operator function type void SetCurrAggrOpFunc(const AggregOperator::Func& t_type); // Get current aggregation operator function type AggregOperator::Func GetAggrOpFunc() const; private: // Fill ComboBox with aggregation operators types void FillAggrOpCB(); // Fill ComboBox with function types of functional aggregation operator void FillAggrOpFuncsCB(); signals: void SignalAggrOpType(AggregOperator::Type t_type); void SignalAggrOpPower(double t_power); void SignalAggrOpFunc(AggregOperator::Func t_func); private slots: // Slot that will be called on change of aggregation operator type void on_aggrOpCB_currentIndexChanged(const QString& text); // Slot that will be called on change of power value void on_powerLE_editingFinished(); // Slot that will be called on change of functional aggregation operator // type void on_funcTypeCB_currentIndexChanged(const QString& text); // == DATA == private: Ui::AggregFilterSettingsDialog *ui; }; #endif // SETTINGSDIALOG_H
/* ---------------------------- rand_poisson ---------------------------------- */ /* */ /* rand_poisson generates a poisson distributed random variable. */ /* Written by Olaf Matthes (olaf.matthes@gmx.de) */ /* Based on code found in Dodge/Jerse "Computer Music" */ /* Get source at http://www.akustische-kunst.org/puredata/maxlib/ */ /* */ /* 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. */ /* */ /* Based on PureData by Miller Puckette and others. */ /* */ /* ---------------------------------------------------------------------------- */ #include "m_pd.h" #include <stdlib.h> #include <time.h> #include <math.h> #define fran() (t_float)rand()/(t_float)RAND_MAX #ifndef M_PI #define M_PI 3.1415927 #endif static char *version = "poisson v0.1, generates a poisson distributed random variable\n" " written by Olaf Matthes <olaf.matthes@gmx.de>"; /* -------------------------- rand_poisson ------------------------------ */ static t_class *rand_poisson_class; typedef struct _rand_poisson { t_object x_obj; t_float x_lambda; } t_rand_poisson; static void *rand_poisson_new(t_floatarg f) { t_rand_poisson *x = (t_rand_poisson *)pd_new(rand_poisson_class); srand( (unsigned)time( NULL ) ); floatinlet_new(&x->x_obj, &x->x_lambda); outlet_new(&x->x_obj, &s_float); x->x_lambda = f; return (x); } static void rand_poisson_bang(t_rand_poisson *x) { t_float u, v; t_int n = 0; v = exp(-x->x_lambda); u = fran(); while(u > v) { u *= fran(); n++; } outlet_float(x->x_obj.ob_outlet, n); } #ifndef MAXLIB void poisson_setup(void) { rand_poisson_class = class_new(gensym("poisson"), (t_newmethod)rand_poisson_new, 0, sizeof(t_rand_poisson), 0, A_DEFFLOAT, 0); class_addbang(rand_poisson_class, rand_poisson_bang); class_sethelpsymbol(rand_poisson_class, gensym("poisson-help.pd")); logpost(NULL, 4, version); } #else void maxlib_poisson_setup(void) { rand_poisson_class = class_new(gensym("maxlib_poisson"), (t_newmethod)rand_poisson_new, 0, sizeof(t_rand_poisson), 0, A_DEFFLOAT, 0); class_addcreator((t_newmethod)rand_poisson_new, gensym("poisson"), A_DEFFLOAT, 0); class_addbang(rand_poisson_class, rand_poisson_bang); class_sethelpsymbol(rand_poisson_class, gensym("maxlib/poisson-help.pd")); } #endif
/* * This file is part of NumptyPhysics <http://thp.io/2015/numptyphysics/> * Coyright (c) 2014 Thomas Perl <m@thp.io> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; 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. */ #ifndef NUMPTYPHYSICS_RENDERER_H #define NUMPTYPHYSICS_RENDERER_H #include <memory> #include "Common.h" #include "Path.h" namespace NP { class TextureData { public: TextureData(int w, int h) : w(w), h(h) {} virtual ~TextureData() {} int w; int h; }; typedef std::shared_ptr<TextureData> Texture; class FontData { public: FontData(int size) : size(size) {} virtual ~FontData() {} int size; }; typedef std::shared_ptr<FontData> Font; class FramebufferData { public: FramebufferData(int w, int h) : w(w), h(h) {} virtual ~FramebufferData() {} int w; int h; }; typedef std::shared_ptr<FramebufferData> Framebuffer; class Renderer { public: virtual ~Renderer() {} virtual Vec2 framebuffer_size() = 0; virtual Vec2 world_size() = 0; Rect framebuffer_rect() { return Rect(Vec2(0, 0), framebuffer_size()); } Rect world_rect() { return Rect(Vec2(0, 0), world_size()); } virtual Texture load(const char *filename, bool cache) = 0; virtual Framebuffer framebuffer(Vec2 size) = 0; virtual void begin(Framebuffer &rendertarget, Rect world_rect) = 0; virtual void end(Framebuffer &rendertarget) = 0; virtual Texture retrieve(Framebuffer &rendertarget) = 0; virtual Rect clip(Rect rect) = 0; virtual void image(const Texture &texture, int x, int y, int w, int h) = 0; virtual void subimage(const Texture &texture, const Rect &src, const Rect &dst) = 0; virtual void blur(const Texture &texture, const Rect &src, const Rect &dst, float rx, float ry) = 0; virtual void rewind(const Texture &texture, const Rect &src, const Rect &dst, float t, float a) = 0; virtual void saturation(const Texture &texture, const Rect &src, const Rect &dst, float a) = 0; virtual void rectangle(const Rect &rect, int rgba, bool fill) = 0; virtual void path(const Path &path, int rgba) = 0; virtual Font load(const char *filename, int size) = 0; virtual void metrics(const Font &font, const char *text, int *width, int *height) = 0; virtual Texture text(const Font &font, const char *text, int rgb) = 0; virtual void clear() = 0; virtual void flush() = 0; virtual void swap() = 0; }; }; #endif /* NUMPTYPHYSICS_RENDERER_H */
/* This file is part of Helio Workstation. Helio 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. Helio 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 Helio. If not, see <http://www.gnu.org/licenses/>. */ #pragma once class MidiTrackSource; #include "UndoAction.h" #include "Pattern.h" //===----------------------------------------------------------------------===// // Insert Clip //===----------------------------------------------------------------------===// class ClipInsertAction final : public UndoAction { public: explicit ClipInsertAction(MidiTrackSource &source) noexcept : UndoAction(source) {} ClipInsertAction(MidiTrackSource &source, const String &trackId, const Clip &target) noexcept; bool perform() override; bool undo() override; int getSizeInUnits() override; SerializedData serialize() const override; void deserialize(const SerializedData &data) override; void reset() override; private: String trackId; Clip clip; JUCE_DECLARE_NON_COPYABLE(ClipInsertAction) }; //===----------------------------------------------------------------------===// // Remove Instance //===----------------------------------------------------------------------===// class ClipRemoveAction final : public UndoAction { public: explicit ClipRemoveAction(MidiTrackSource &source) noexcept : UndoAction(source) {} ClipRemoveAction(MidiTrackSource &source, const String &trackId, const Clip &target) noexcept; bool perform() override; bool undo() override; int getSizeInUnits() override; SerializedData serialize() const override; void deserialize(const SerializedData &data) override; void reset() override; private: String trackId; Clip clip; JUCE_DECLARE_NON_COPYABLE(ClipRemoveAction) }; //===----------------------------------------------------------------------===// // Change Instance //===----------------------------------------------------------------------===// class ClipChangeAction final : public UndoAction { public: explicit ClipChangeAction(MidiTrackSource &source) noexcept : UndoAction(source) {} ClipChangeAction(MidiTrackSource &source, const String &trackId, const Clip &target, const Clip &newParameters) noexcept; bool perform() override; bool undo() override; int getSizeInUnits() override; UndoAction *createCoalescedAction(UndoAction *nextAction) override; SerializedData serialize() const override; void deserialize(const SerializedData &data) override; void reset() override; private: String trackId; Clip clipBefore; Clip clipAfter; JUCE_DECLARE_NON_COPYABLE(ClipChangeAction) }; //===----------------------------------------------------------------------===// // Insert Group //===----------------------------------------------------------------------===// class ClipsGroupInsertAction final : public UndoAction { public: explicit ClipsGroupInsertAction(MidiTrackSource &source) noexcept : UndoAction(source) {} ClipsGroupInsertAction(MidiTrackSource &source, const String &trackId, Array<Clip> &target) noexcept; bool perform() override; bool undo() override; int getSizeInUnits() override; SerializedData serialize() const override; void deserialize(const SerializedData &data) override; void reset() override; private: String trackId; Array<Clip> clips; JUCE_DECLARE_NON_COPYABLE(ClipsGroupInsertAction) }; //===----------------------------------------------------------------------===// // Remove Group //===----------------------------------------------------------------------===// class ClipsGroupRemoveAction final : public UndoAction { public: explicit ClipsGroupRemoveAction(MidiTrackSource &source) noexcept : UndoAction(source) {} ClipsGroupRemoveAction(MidiTrackSource &source, const String &trackId, Array<Clip> &target) noexcept; bool perform() override; bool undo() override; int getSizeInUnits() override; SerializedData serialize() const override; void deserialize(const SerializedData &data) override; void reset() override; private: String trackId; Array<Clip> clips; JUCE_DECLARE_NON_COPYABLE(ClipsGroupRemoveAction) }; //===----------------------------------------------------------------------===// // Change Group //===----------------------------------------------------------------------===// class ClipsGroupChangeAction final : public UndoAction { public: explicit ClipsGroupChangeAction(MidiTrackSource &source) noexcept : UndoAction(source) {} ClipsGroupChangeAction(MidiTrackSource &source, const String &trackId, Array<Clip> &state1, Array<Clip> &state2) noexcept; bool perform() override; bool undo() override; int getSizeInUnits() override; UndoAction *createCoalescedAction(UndoAction *nextAction) override; SerializedData serialize() const override; void deserialize(const SerializedData &data) override; void reset() override; private: String trackId; Array<Clip> clipsBefore; Array<Clip> clipsAfter; JUCE_DECLARE_NON_COPYABLE(ClipsGroupChangeAction) };
/* * Copyright (C) 2007-2009 Daniel Prevost <dprevost@photonsoftware.org> * * This file is part of Photon (photonsoftware.org). * * This file may be distributed and/or modified under the terms of the * GNU General Public License version 2 or version 3 as published by the * Free Software Foundation and appearing in the file COPYING.GPL2 and * COPYING.GPL3 included in the packaging of this software. * * Licensees holding a valid Photon Commercial license can use this file * in accordance with the terms of their license. * * 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. */ /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ #include "Nucleus/Hash.h" #include "Nucleus/Tests/HashTx/HashTest.h" const bool expectedToPass = true; /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ int main() { psonSessionContext context; psonHashTx * pHash; enum psoErrors errcode; pHash = initHashTest( expectedToPass, &context ); errcode = psonHashTxInit( pHash, g_memObjOffset, 100, &context ); if ( errcode != PSO_OK ) { ERROR_EXIT( expectedToPass, &context.errorHandler, ; ); } psonHashTxFini( pHash ); return 0; } /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
#ifndef __TR_BASE_H__ #define __TR_BASE_H__ #include "tr/commons.h" #include "tr/memory.h" #include "tr/class.h" #include "tr/logger.h" #include "tr/timer.h" #include "tr/print_trace.h" #include "tr/sized_data.h" #include "tr/math.h" #include "tr/interface.h" #include "tr/interface/class.h" #include "tr/interface/subject.h" #include "tr/interface/observer.h" #include "tr/interface/serializable.h" #include "tr/interface/indexable.h" #include "tr/interface/logger.h" const char * const TR_base_version(void); #endif // __TR_BASE_H__ // vim: set ts=4 sw=4:
/* Copyright (C) 2009-2016 Red Hat 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 _SSS_CRYPTO_H_ #define _SSS_CRYPTO_H_ #include <talloc.h> #include <stdint.h> /* Guaranteed either to fill given buffer with crypto strong random data * or to fail with error code (for example in the case of the lack of * proper entropy) * Suitable to be used in security relevant context. */ int sss_generate_csprng_buffer(uint8_t *buf, size_t size); int s3crypt_sha512(TALLOC_CTX *mmectx, const char *key, const char *salt, char **_hash); int s3crypt_gen_salt(TALLOC_CTX *memctx, char **_salt); /* Methods of obfuscation. */ enum obfmethod { AES_256, NUM_OBFMETHODS }; char *sss_base64_encode(TALLOC_CTX *mem_ctx, const unsigned char *in, size_t insize); unsigned char *sss_base64_decode(TALLOC_CTX *mem_ctx, const char *in, size_t *outsize); #define SSS_SHA1_LENGTH 20 int sss_hmac_sha1(const unsigned char *key, size_t key_len, const unsigned char *in, size_t in_len, unsigned char *out); int sss_password_encrypt(TALLOC_CTX *mem_ctx, const char *password, int plen, enum obfmethod meth, char **obfpwd); int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded, char **password); #endif /* _SSS_CRYPTO_H_ */
/* copyright(C) 2002 H.Kawai (under KL-01). */ /* #include <stddef.h> */ #if (!defined(STDDEF_H)) & 1 #define STDDEF_H 1 #if (defined(__cplusplus)) extern "C" { #endif #include "go_lib.h" /* size_t --> go_lib.h */ #if (defined(__cplusplus)) } #endif #endif
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QDBUSTRAYICON_H #define QDBUSTRAYICON_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <QtGui/private/qtguiglobal_p.h> QT_REQUIRE_CONFIG(systemtrayicon); #include <QIcon> #include <QTemporaryFile> #include <QTimer> #include "QtGui/qpa/qplatformsystemtrayicon.h" #include "private/qdbusmenuconnection_p.h" QT_BEGIN_NAMESPACE class QStatusNotifierItemAdaptor; class QDBusMenuAdaptor; class QDBusPlatformMenu; class QXdgNotificationInterface; class QDBusTrayIcon: public QPlatformSystemTrayIcon { Q_OBJECT Q_PROPERTY(QString category READ category NOTIFY categoryChanged) Q_PROPERTY(QString status READ status NOTIFY statusChanged) Q_PROPERTY(QString tooltip READ tooltip NOTIFY tooltipChanged) Q_PROPERTY(QString iconName READ iconName NOTIFY iconChanged) Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) Q_PROPERTY(bool isRequestingAttention READ isRequestingAttention NOTIFY attention) Q_PROPERTY(QString attentionTitle READ attentionTitle NOTIFY attention) Q_PROPERTY(QString attentionMessage READ attentionMessage NOTIFY attention) Q_PROPERTY(QString attentionIconName READ attentionIconName NOTIFY attention) Q_PROPERTY(QIcon attentionIcon READ attentionIcon NOTIFY attention) Q_PROPERTY(QDBusPlatformMenu *menu READ menu NOTIFY menuChanged) public: QDBusTrayIcon(); virtual ~QDBusTrayIcon(); QDBusMenuConnection * dBusConnection(); void init() Q_DECL_OVERRIDE; void cleanup() Q_DECL_OVERRIDE; void updateIcon(const QIcon &icon) Q_DECL_OVERRIDE; void updateToolTip(const QString &tooltip) Q_DECL_OVERRIDE; void updateMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; QPlatformMenu *createMenu() const Q_DECL_OVERRIDE; void showMessage(const QString &title, const QString &msg, const QIcon &icon, MessageIcon iconType, int msecs) Q_DECL_OVERRIDE; bool isSystemTrayAvailable() const Q_DECL_OVERRIDE; bool supportsMessages() const Q_DECL_OVERRIDE { return true; } QRect geometry() const Q_DECL_OVERRIDE { return QRect(); } QString category() const { return m_category; } QString status() const { return m_status; } QString tooltip() const { return m_tooltip; } QString iconName() const { return m_iconName; } const QIcon & icon() const { return m_icon; } bool isRequestingAttention() const { return m_attentionTimer.isActive(); } QString attentionTitle() const { return m_messageTitle; } QString attentionMessage() const { return m_message; } QString attentionIconName() const { return m_attentionIconName; } const QIcon & attentionIcon() const { return m_attentionIcon; } QString instanceId() const { return m_instanceId; } QDBusPlatformMenu *menu() { return m_menu; } signals: void categoryChanged(); void statusChanged(QString arg); void tooltipChanged(); void iconChanged(); void attention(); void menuChanged(); private Q_SLOTS: void attentionTimerExpired(); void actionInvoked(uint id, const QString &action); void notificationClosed(uint id, uint reason); void watcherServiceRegistered(const QString &serviceName); private: void setStatus(const QString &status); QTemporaryFile *tempIcon(const QIcon &icon); private: QDBusMenuConnection* m_dbusConnection; QStatusNotifierItemAdaptor *m_adaptor; QDBusMenuAdaptor *m_menuAdaptor; QDBusPlatformMenu *m_menu; QXdgNotificationInterface *m_notifier; QString m_instanceId; QString m_category; QString m_defaultStatus; QString m_status; QString m_tooltip; QString m_messageTitle; QString m_message; QIcon m_icon; QTemporaryFile *m_tempIcon; QString m_iconName; QIcon m_attentionIcon; QTemporaryFile *m_tempAttentionIcon; QString m_attentionIconName; QTimer m_attentionTimer; bool m_registered; }; QT_END_NAMESPACE #endif // QDBUSTRAYICON_H
/***************************************************************************** * * Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC * Produced at the Lawrence Livermore National Laboratory * LLNL-CODE-442911 * All rights reserved. * * This file is part of VisIt. For details, see https://visit.llnl.gov/. The * full copyright notice is contained in the file COPYRIGHT located at the root * of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html. * * 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 disclaimer below. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the disclaimer (as noted below) in the * documentation and/or other materials provided with the distribution. * - Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY, * LLC, THE U.S. DEPARTMENT OF ENERGY 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. * *****************************************************************************/ // ************************************************************************* // // avtDataRangeSelection.h // // ************************************************************************* // #ifndef AVT_DATA_RANGE_SELECTION_H #define AVT_DATA_RANGE_SELECTION_H #include <float.h> #include <string> #include <pipeline_exports.h> #include <ref_ptr.h> #include <avtDataSelection.h> // **************************************************************************** // Class: avtDataRangeSelection // // Purpose: Specify a data selection by a scalar range for a named variable. // // The default is a range from -FLT_MAX to +FLT_MAX for variable "default" // // Programmer: Markus Glatter // Creation: July 27, 2007 // // Modifications: // // Hank Childs, Tue Dec 18 10:04:43 PST 2007 // Define private copy constructor and assignment operator to prevent // accidental use of default, bitwise copy implementations. // // Hank Childs, Tue Dec 20 14:43:08 PST 2011 // Add method DescriptionString. // // **************************************************************************** class PIPELINE_API avtDataRangeSelection : public avtDataSelection { public: avtDataRangeSelection(); avtDataRangeSelection(const std::string _var, const double _min, const double _max); virtual ~avtDataRangeSelection(); virtual const char * GetType() const { return "Data Range Selection"; }; virtual std::string DescriptionString(void); void SetVariable(const std::string _var) { var = _var; }; void SetMin(const double _min) { min = _min; }; void SetMax(const double _max) { max = _max; }; std::string GetVariable() const { return var; }; double GetMin() const { return min; }; double GetMax() const { return max; }; bool operator==(const avtDataRangeSelection &s) const; private: std::string var; double min; double max; // These methods are defined to prevent accidental use of bitwise copy // implementations. If you want to re-define them to do something // meaningful, that's fine. avtDataRangeSelection(const avtDataRangeSelection&) {;}; avtDataRangeSelection &operator=(const avtDataRangeSelection &) { return *this; }; }; typedef ref_ptr<avtDataRangeSelection> avtDataRangeSelection_p; #endif
/* File: draeditor.h Project: dragonfly Author: Douwe Vos Date: Mar 22, 2015 e-mail: dmvos2000(at)yahoo.com Copyright (C) 2015 Douwe Vos. 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 DRAEDITOR_H_ #define DRAEDITOR_H_ #include "context/dracontexteditor.h" #include "document/draconnectormap.h" #include "document/draiconnectorrequestfactory.h" #include <chameleon.h> #include <caterpillar.h> #include <worm.h> G_BEGIN_DECLS #define DRA_TYPE_EDITOR (dra_editor_get_type()) #define DRA_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), dra_editor_get_type(), DraEditor)) #define DRA_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DRA_TYPE_EDITOR, DraEditorClass)) #define DRA_IS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DRA_TYPE_EDITOR)) #define DRA_IS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DRA_TYPE_EDITOR)) #define DRA_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DRA_TYPE_EDITOR, DraEditorClass)) typedef struct _DraEditor DraEditor; typedef struct _DraEditorPrivate DraEditorPrivate; typedef struct _DraEditorClass DraEditorClass; struct _DraEditor { ChaEditor parent; }; struct _DraEditorClass { ChaEditorClass parent_class; void (*showContextMenu)(DraEditor *editor, ChaCursorWo *cursor, GdkEvent *event); void (*toggleSpelling)(DraEditor *editor); }; struct _DraEditorPanel; GType dra_editor_get_type(); void dra_editor_construct(DraEditor *instance, ChaDocument *document, DraConnectorMap *connector_map, DraIConnectorRequestFactory *connector_factory, WorService *wor_service); DraEditor *dra_editor_new(ChaDocument *document, DraConnectorMap *connector_map, DraIConnectorRequestFactory *connector_factory, WorService *wor_service); struct _DraEditorPanel *dra_editor_get_panel(DraEditor *editor); void dra_editor_set_preferences(DraEditor *editor, DraPreferencesWo *a_prefs); void dra_editor_toggle_spelling(DraEditor *editor); void dra_editor_request_mark_occurrences(DraEditor *editor); void dra_editor_set_occurrence_text(DraEditor *editor, CatStringWo *text); void dra_editor_set_focus_active(DraEditor *editor, gboolean focus_active); void dra_editor_goto_line(DraEditor *editor); void dra_editor_set_context_editor(DraEditor *editor, DraContextEditor *context_editor); DraContextEditor *dra_editor_get_context_editor(DraEditor *editor); G_END_DECLS #endif /* DRAEDITOR_H_ */
/* * @file Tools/Enum.h * Defines a macro that declares an enum and provides * a function to access the names of its elements. * * @author Thomas Röfer */ #pragma once #include <string> #include <vector> /** * @class EnumName * The class converts a single comma-separated string of enum names * into single entries that can be accessed in constant time. * It is the worker class for the templated version below. */ class EnumName { private: std::vector<std::string> names; /**< The vector of enum names. */ /** * A method that trims a string, i.e. removes spaces from its * beginning and end. * @param s The string that is trimmed. * @return The string without spaces at the beginning and at its end. */ static std::string trim(const std::string& s); public: /** * Constructor. * @param enums A string that contains a comma-separated list of enum * elements. It is allowed that an element is initialized * with the value of its predecessor. Any other * initializations are forbidden. * "a, b, numOfLettersBeforeC, c = numOfLettersBeforeC, d" * would be a legal parameter. * @param numOfEnums The number of enums in the string. Reassignments do * not count, i.e. in the example above, this * parameter had to be 4. */ EnumName(const std::string& enums, size_t numOfEnums); /** * The method returns the name of an enum element. * @param index The index of the enum element. * @return Its name. */ const char* getName(size_t e) {return e >= names.size() ? 0 : names[e].c_str();} }; /** * Defining an enum and a function get<Enum>Name(<Enum>) that can return * the name of each enum element. The enum will automatically * contain an element numOf<Enum>s that reflects the number of * elements defined. */ #define ENUM(Enum, ...) \ enum Enum {__VA_ARGS__, numOf##Enum##s}; \ inline static const char* getName(Enum e) {static EnumName en(#__VA_ARGS__, (size_t) numOf##Enum##s); return en.getName((size_t) e);}
// // Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. // // 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 St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef GNASH_SOUND_H #define GNASH_SOUND_H #include "ref_counted.h" // Forward declarations namespace gnash { class movie_definition; class RunResources; } namespace gnash { /// An identifier for a sound sample managed by a sound_handler // /// Definition tags will maintain a mapping between SWF-defined id /// of the sound and these identifiers. // /// A sound_definition is used only by DefineSoundTags for embedded event /// sounds. These sounds can be started either through the AS sound class /// or using a StartSoundTag. // /// sound_definitions are not used for: /// - embedded streaming sounds /// - loaded event sounds. // /// Streaming event sounds (Sound class). /// /// Specifying an identifier for use by sound_handler would likely be /// claner, anyway this is what it is *currently*. /// /// NOTE that the destructor of this identifier (thus becoming a "smart" /// identifier) requests the currently registered sound_handler removal /// of the identified sound_sample. This *might* be the reason why /// it is a ref-counted thing (hard to belive...). /// /// @todo move definition to sound_handler.h and possibly nest /// inside sound_handler itself ? // /// This is ref_counted because it is an export. /// TODO: check whether it really needs to be ref counted. class sound_sample : public ref_counted { public: int m_sound_handler_id; sound_sample(int id, const RunResources& r) : m_sound_handler_id(id), _runResources(r) { } /// delete the actual sound sample from the currently registered /// sound handler. ~sound_sample(); /// This is necessary because at least some sound_samples are /// destroyed after the movie_root has been destroyed, so that /// access through the VM (which assumes movie_root exists) causes /// a segfault. const RunResources& _runResources; }; } // namespace gnash #endif // GNASH_SOUND_H
#ifndef FORT64_H #define FORT64_H #include <QObject> #include "Project/Files/ProjectFile.h" class Fort64 : public QObject { Q_OBJECT public: explicit Fort64(QObject *parent=0); Fort64(ProjectFile *projectFile, QObject *parent=0); Fort64(QString domainName, ProjectFile *projectFile, QObject *parent=0); private: QString domainName; ProjectFile* projectFile; }; #endif // FORT64_H
#ifndef __MXFSTREAM__H_ #define __MXFSTREAM__H_ class mfstream { public: FILE *fptr; mfstream() { fptr = 0; } void open(const char *buf, int flags) { fptr = fopen(buf, "r"); } int is_open() { return ( fptr == 0) ? 0 : 1; } int eof() { return feof(fptr); } void close() { if(fptr) fclose(fptr); } }; #endif
// // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // + + // + This file is part of enGrid. + // + + // + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid 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. + // + + // + enGrid 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 enGrid. If not, see <http://www.gnu.org/licenses/>. + // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // #ifndef BLENDERREADER_H #define BLENDERREADER_H #include "iooperation.h" class BlenderReader : public IOOperation { protected: // methods virtual void operate(); public: // methods BlenderReader(); }; #endif // BLENDERREADER_H
/******************************************************************************* AppIcon PURPOSE: Holds information on the desktop location of an app icon. This info is needed by the TouchDetector to determine if a touch event was on a particular desktop icon. AUTHOR: J.R. Weber <joe.weber77@gmail.com> *******************************************************************************/ /* PlaysurfaceLauncher - Provides a game console-like environment for launching TUIO-based multitouch apps. Copyright (c) 2014, 2015 J.R.Weber <joe.weber77@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, go to http://www.gnu.org/licenses/gpl-3.0.en.html or write to Free Software Foundation, Inc. 59 Temple Place, Suite 330 Boston, MA 02111-1307 USA */ #ifndef GUI_APPICON_H #define GUI_APPICON_H #include <QImage> namespace gui { class AppIcon { public: static const int DEFAULT_WIDTH, DEFAULT_HEIGHT; AppIcon( const QImage & iconImage ); virtual ~AppIcon(); void setImage( const QImage & image ); QImage iconImage(); void setRect( int x, int y, int width, int height ); QRect rect(); bool containsPoint( double x, double y ); private: QImage iconImage_; QRect rect_; int xMin_, xMax_, yMin_, yMax_; }; } #endif
/*++ Copyright (c) Microsoft Corporation. All rights reserved. Module Name: sens.h Abstract: This file is the master header file for Event System events published and subscribed by the System Event Notification service (SENS). Author: Gopal Parupudi <GopalP> [Notes:] optional-notes Revision History: GopalP 12/8/1997 Start. --*/ #ifndef __SENS_H__ #define __SENS_H__ #if _MSC_VER > 1000 #pragma once #endif // // Constants // #define CONNECTION_LAN 0x00000001 #define CONNECTION_WAN 0x00000002 #define CONNECTION_AOL 0x00000004 // // SENS Guids related to Event System // DEFINE_GUID( SENSGUID_PUBLISHER, /* 5fee1bd6-5b9b-11d1-8dd2-00aa004abd5e */ 0x5fee1bd6, 0x5b9b, 0x11d1, 0x8d, 0xd2, 0x00, 0xaa, 0x00, 0x4a, 0xbd, 0x5e ); DEFINE_GUID( SENSGUID_SUBSCRIBER_LCE, /* d3938ab0-5b9d-11d1-8dd2-00aa004abd5e */ 0xd3938ab0, 0x5b9d, 0x11d1, 0x8d, 0xd2, 0x00, 0xaa, 0x00, 0x4a, 0xbd, 0x5e ); DEFINE_GUID( SENSGUID_SUBSCRIBER_WININET, /* d3938ab5-5b9d-11d1-8dd2-00aa004abd5e */ 0xd3938ab5, 0x5b9d, 0x11d1, 0x8d, 0xd2, 0x00, 0xaa, 0x00, 0x4a, 0xbd, 0x5e ); // // Classes of Events published by SENS // DEFINE_GUID( SENSGUID_EVENTCLASS_NETWORK, /* d5978620-5b9f-11d1-8dd2-00aa004abd5e */ 0xd5978620, 0x5b9f, 0x11d1, 0x8d, 0xd2, 0x00, 0xaa, 0x00, 0x4a, 0xbd, 0x5e ); DEFINE_GUID( SENSGUID_EVENTCLASS_LOGON, /* d5978630-5b9f-11d1-8dd2-00aa004abd5e */ 0xd5978630, 0x5b9f, 0x11d1, 0x8d, 0xd2, 0x00, 0xaa, 0x00, 0x4a, 0xbd, 0x5e ); DEFINE_GUID( SENSGUID_EVENTCLASS_ONNOW, /* d5978640-5b9f-11d1-8dd2-00aa004abd5e */ 0xd5978640, 0x5b9f, 0x11d1, 0x8d, 0xd2, 0x00, 0xaa, 0x00, 0x4a, 0xbd, 0x5e ); DEFINE_GUID( SENSGUID_EVENTCLASS_LOGON2, /* d5978650-5b9f-11d1-8dd2-00aa004abd5e */ 0xd5978650, 0x5b9f, 0x11d1, 0x8d, 0xd2, 0x00, 0xaa, 0x00, 0x4a, 0xbd, 0x5e ); #endif // __SENS_H__
/* ============================================================ * Date : Sep 15, 2009 * Copyright 2009 Palm, Inc. All rights reserved. * ============================================================ */ #ifndef MOJLISTINTERNAL_H_ #define MOJLISTINTERNAL_H_ template <class T, MojListEntry T::* ENTRY> inline MojList<T, ENTRY>::ConstIterator::ConstIterator(const Iterator& iter) : m_pos(iter.m_pos) { } template <class T, MojListEntry T::* ENTRY> inline bool MojList<T, ENTRY>::ConstIterator::operator==(const Iterator& rhs) const { return m_pos == rhs.m_pos; } template <class T, MojListEntry T::* ENTRY> inline bool MojList<T, ENTRY>::ConstIterator::operator!=(const Iterator& rhs) const { return !operator==(rhs); } template <class T, MojListEntry T::* ENTRY> inline MojList<T, ENTRY>::~MojList() { clear(); #ifdef MOJ_DEBUG m_entry.reset(); #endif } template <class T, MojListEntry T::* ENTRY> bool MojList<T, ENTRY>::contains(const T* val) const { MojAssert(val); for (ConstIterator i = begin(); i != end(); ++i) { if (*i == val) return true; } return false; } template <class T, MojListEntry T::* ENTRY> void MojList<T, ENTRY>::swap(MojList& rhs) { MojList tmp = *this; *this = rhs; rhs = tmp; } template <class T, MojListEntry T::* ENTRY> void MojList<T, ENTRY>::clear() { Iterator i = begin(); while (i != end()) { (i++).pos()->reset(); } init(); } template <class T, MojListEntry T::* ENTRY> inline void MojList<T, ENTRY>::erase(T* val) { MojAssert(contains(val)); (val->*ENTRY).erase(); --m_size; } template <class T, MojListEntry T::* ENTRY> inline void MojList<T, ENTRY>::pushFront(T* val) { MojAssert(val); m_entry.m_next->insert(&(val->*ENTRY)); ++m_size; } template <class T, MojListEntry T::* ENTRY> inline void MojList<T, ENTRY>::pushBack(T* val) { MojAssert(val); m_entry.insert(&(val->*ENTRY)); ++m_size; } template <class T, MojListEntry T::* ENTRY> T* MojList<T, ENTRY>::popFront() { MojAssert(!empty()); T* val = entryToVal(m_entry.m_next); m_entry.m_next->erase(); --m_size; return val; } template <class T, MojListEntry T::* ENTRY> T* MojList<T, ENTRY>::popBack() { MojAssert(!empty()); T* val = entryToVal(m_entry.m_prev); m_entry.m_prev->erase(); --m_size; return val; } template <class T, MojListEntry T::* ENTRY> MojList<T, ENTRY>& MojList<T, ENTRY>::operator=(MojList& list) { if (&list != this) { clear(); init(list); } return *this; } template <class T, MojListEntry T::* ENTRY> void MojList<T, ENTRY>::init() { m_size = 0; m_entry.m_prev = &m_entry; m_entry.m_next = &m_entry; } template <class T, MojListEntry T::* ENTRY> void MojList<T, ENTRY>::init(MojList& list) { if (list.empty()) { init(); } else { m_size = list.m_size; m_entry.m_prev = list.m_entry.m_prev; m_entry.m_next = list.m_entry.m_next; m_entry.fixup(); list.init(); } } #endif /* MOJLISTINTERNAL_H_ */
/* freg, Free-Roaming Elementary Game with open and interactive world * Copyright (C) 2012-2015 Alexander 'mmaulwurff' Kromm * mmaulwurff@gmail.com * * This file is part of FREG. * * FREG 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. * * FREG 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 FREG. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ACTIVE_WATCHER_H #define ACTIVE_WATCHER_H #include "blocks/Active.h" #include "header.h" #include <QObject> class QString; class ActiveWatcher : public QObject { Q_OBJECT public: explicit ActiveWatcher(QObject* const _parent) : QObject(_parent) , watched(nullptr) {} ~ActiveWatcher() { if (watched) watched->SetWatcher(nullptr); } void SetWatched(Active* const a) { watched = a; } signals: void Moved(int direction) const; void ReceivedText(const QString& text) const; void Updated() const; void CauseTeleportation() const; void Destroyed() const; private: Q_DISABLE_COPY(ActiveWatcher) Active* watched; }; #endif // ACTIVE_WATCHER_H
/********** * Copyright 1990 Regents of the University of California. All rights reserved. * File: b3v1par.c * Author: 1995 Min-Chie Jeng and Mansun Chan. * Modified by Paolo Nenzi 2002 **********/ /* * Release Notes: * BSIM3v3.1, Released by yuhua 96/12/08 */ #include "ngspice.h" #include "ifsim.h" #include "bsim3v1def.h" #include "sperror.h" #include "suffix.h" int BSIM3v1param(int param, IFvalue *value, GENinstance *inst, IFvalue *select) { BSIM3v1instance *here = (BSIM3v1instance*)inst; switch(param) { case BSIM3v1_W: here->BSIM3v1w = value->rValue; here->BSIM3v1wGiven = TRUE; break; case BSIM3v1_L: here->BSIM3v1l = value->rValue; here->BSIM3v1lGiven = TRUE; break; case BSIM3v1_M: here->BSIM3v1m = value->rValue; here->BSIM3v1mGiven = TRUE; break; case BSIM3v1_AS: here->BSIM3v1sourceArea = value->rValue; here->BSIM3v1sourceAreaGiven = TRUE; break; case BSIM3v1_AD: here->BSIM3v1drainArea = value->rValue; here->BSIM3v1drainAreaGiven = TRUE; break; case BSIM3v1_PS: here->BSIM3v1sourcePerimeter = value->rValue; here->BSIM3v1sourcePerimeterGiven = TRUE; break; case BSIM3v1_PD: here->BSIM3v1drainPerimeter = value->rValue; here->BSIM3v1drainPerimeterGiven = TRUE; break; case BSIM3v1_NRS: here->BSIM3v1sourceSquares = value->rValue; here->BSIM3v1sourceSquaresGiven = TRUE; break; case BSIM3v1_NRD: here->BSIM3v1drainSquares = value->rValue; here->BSIM3v1drainSquaresGiven = TRUE; break; case BSIM3v1_OFF: here->BSIM3v1off = value->iValue; break; case BSIM3v1_IC_VBS: here->BSIM3v1icVBS = value->rValue; here->BSIM3v1icVBSGiven = TRUE; break; case BSIM3v1_IC_VDS: here->BSIM3v1icVDS = value->rValue; here->BSIM3v1icVDSGiven = TRUE; break; case BSIM3v1_IC_VGS: here->BSIM3v1icVGS = value->rValue; here->BSIM3v1icVGSGiven = TRUE; break; case BSIM3v1_NQSMOD: here->BSIM3v1nqsMod = value->iValue; here->BSIM3v1nqsModGiven = TRUE; break; case BSIM3v1_IC: switch(value->v.numValue){ case 3: here->BSIM3v1icVBS = *(value->v.vec.rVec+2); here->BSIM3v1icVBSGiven = TRUE; case 2: here->BSIM3v1icVGS = *(value->v.vec.rVec+1); here->BSIM3v1icVGSGiven = TRUE; case 1: here->BSIM3v1icVDS = *(value->v.vec.rVec); here->BSIM3v1icVDSGiven = TRUE; break; default: return(E_BADPARM); } break; default: return(E_BADPARM); } return(OK); }
//============== IV: Multiplayer - http://code.iv-multiplayer.com ============== // // File: PlayerNatives.h // Project: Server.Core // Author(s): jenksta // MaVe // License: See LICENSE in root directory // //============================================================================== #pragma once #include "../Natives.h" class CPlayerNatives { private: static SQInteger IsConnected(SQVM * pVM); static SQInteger GetName(SQVM * pVM); static SQInteger SetName(SQVM * pVM); static SQInteger SetHealth(SQVM * pVM); static SQInteger GetHealth(SQVM * pVM); static SQInteger SetArmour(SQVM * pVM); static SQInteger GetArmour(SQVM * pVM); static SQInteger SetCoordinates(SQVM * pVM); static SQInteger GetCoordinates(SQVM * pVM); static SQInteger SetTime(SQVM * pVM); static SQInteger SetWeather(SQVM * pVM); static SQInteger SetGravity(SQVM * pVM); static SQInteger SendMessage(SQVM * pVM); static SQInteger SendMessageToAll(SQVM * pVM); static SQInteger IsInAnyVehicle(SQVM * pVM); static SQInteger IsInVehicle(SQVM * pVM); static SQInteger GetVehicleId(SQVM * pVM); static SQInteger GetSeatId(SQVM * pVM); static SQInteger IsOnFoot(SQVM * pVM); static SQInteger TogglePayAndSpray(SQVM * pVM); static SQInteger ToggleAutoAim(SQVM * pVM); //static SQInteger SetPlayerDrunk(SQVM * pVM); static SQInteger GiveWeapon(SQVM * pVM); static SQInteger RemoveWeapons(SQVM * pVM); static SQInteger SetSpawnLocation(SQVM * pVM); static SQInteger SetModel(SQVM * pVM); static SQInteger GetModel(SQVM * pVM); static SQInteger ToggleControls(SQVM * pVM); static SQInteger IsSpawned(SQVM * pVM); static SQInteger SetHeading(SQVM * pVM); static SQInteger GetHeading(SQVM * pVM); static SQInteger TogglePhysics(SQVM * pVM); static SQInteger Kick(SQVM * pVM); static SQInteger Ban(SQVM * pVM); static SQInteger GetIp(SQVM * pVM); static SQInteger GiveMoney(SQVM * pVM); static SQInteger SetMoney(SQVM * pVM); static SQInteger ResetMoney(SQVM * pVM); static SQInteger GetMoney(SQVM * pVM); static SQInteger DisplayText(SQVM * pVM); static SQInteger DisplayTextForAll(SQVM * pVM); static SQInteger DisplayInfoText(SQVM * pVM); static SQInteger DisplayInfoTextForAll(SQVM * pVM); static SQInteger ToggleFrozen(SQVM * pVM); static SQInteger GetState(SQVM * pVM); static SQInteger SetVelocity(SQVM * pVM); static SQInteger GetVelocity(SQVM * pVM); static SQInteger GetWantedLevel(SQVM * pVM); static SQInteger SetWantedLevel(SQVM * pVM); static SQInteger WarpIntoVehicle(SQVM * pVM); static SQInteger RemoveFromVehicle(SQVM * pVM); static SQInteger GetWeapon(SQVM * pVM); static SQInteger GetAmmo(SQVM * pVM); static SQInteger GetSerial(SQVM * pVM); static SQInteger SetCameraBehind(SQVM * pVM); static SQInteger SetDucking(SQVM * pVM); static SQInteger IsDucking(SQVM * pVM); static SQInteger SetInvincible(SQVM * pVM); static SQInteger ToggleHUD(SQVM * pVM); static SQInteger ToggleRadar(SQVM * pVM); static SQInteger ToggleNames(SQVM * pVM); static SQInteger ToggleAreaNames(SQVM * pVM); static SQInteger GetEmptyControlState(SQVM * pVM); static SQInteger GetPreviousControlState(SQVM * pVM); static SQInteger GetControlState(SQVM * pVM); static SQInteger TriggerEvent(SQVM * pVM); static SQInteger ToggleNametagForPlayer(SQVM * pVM); static SQInteger GetColor(SQVM * pVM); static SQInteger SetColor(SQVM * pVM); static SQInteger GetPing(SQVM * pVM); static SQInteger SetClothes(SQVM * pVM); static SQInteger GetClothes(SQVM * pVM); static SQInteger ResetClothes(SQVM * pVM); static SQInteger Respawn(SQVM * pVM); static SQInteger GiveHelmet(SQVM * pVM); static SQInteger RemoveHelmet(SQVM * pVM); static SQInteger ToggleHelmet(SQVM * pVM); static SQInteger SetCameraPos(SQVM * pVM); static SQInteger SetCameraLookAt(SQVM * pVM); static SQInteger ResetCamera(SQVM * pVM); static SQInteger forceAnim(SQVM * pVM); static SQInteger requestAnim(SQVM * pVM); static SQInteger releaseAnim(SQVM * pVM); static SQInteger triggerAudioEvent(SQVM * pVM); static SQInteger triggerMissionCompleteAudio(SQVM * pVM); static SQInteger triggerPoliceReport(SQVM * pVM); static SQInteger fadeScreenIn(SQVM * pVM); static SQInteger fadeScreenOut(SQVM * pVM); static SQInteger blockWeaponChange(SQVM * pVM); static SQInteger blockWeaponDrop(SQVM * pVM); static SQInteger AttachCamToPlayer(SQVM * pVM); static SQInteger AttachCamToVehicle(SQVM * pVM); static SQInteger DisplayHudNotification(SQVM * pVM); static SQInteger FollowVehicleMode(SQVM * pVM); static SQInteger FollowVehicleOffset(SQVM * pVM); static SQInteger SetAmmoInClip(SQVM * pVM); static SQInteger SetAmmo(SQVM * pVM); static SQInteger SetMobilePhone(SQVM * pVM); static SQInteger SaySpeech(SQVM * pVM); static SQInteger DriveAutomatic(SQVM * pVM); static SQInteger GetFileChecksum(SQVM * pVM); static SQInteger SetDimension(SQVM * pVM); static SQInteger GetDimension(SQVM * pVM); public: static void Register(CScriptingManager * pScriptingManager); };
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ #include "ompi_config.h" #include "ompi/mpi/fortran/mpif-h/bindings.h" #include "ompi/mpi/fortran/base/constants.h" #if OMPI_BUILD_MPI_PROFILING #if OPAL_HAVE_WEAK_SYMBOLS #pragma weak PMPI_NEIGHBOR_ALLTOALL = ompi_neighbor_alltoall_f #pragma weak pmpi_neighbor_alltoall = ompi_neighbor_alltoall_f #pragma weak pmpi_neighbor_alltoall_ = ompi_neighbor_alltoall_f #pragma weak pmpi_neighbor_alltoall__ = ompi_neighbor_alltoall_f #pragma weak PMPI_Neighbor_alltoall_f = ompi_neighbor_alltoall_f #pragma weak PMPI_Neighbor_alltoall_f08 = ompi_neighbor_alltoall_f #else OMPI_GENERATE_F77_BINDINGS (PMPI_NEIGHBOR_ALLTOALL, pmpi_neighbor_alltoall, pmpi_neighbor_alltoall_, pmpi_neighbor_alltoall__, pompi_neighbor_alltoall_f, (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr), (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, ierr) ) #endif #endif #if OPAL_HAVE_WEAK_SYMBOLS #pragma weak MPI_NEIGHBOR_ALLTOALL = ompi_neighbor_alltoall_f #pragma weak mpi_neighbor_alltoall = ompi_neighbor_alltoall_f #pragma weak mpi_neighbor_alltoall_ = ompi_neighbor_alltoall_f #pragma weak mpi_neighbor_alltoall__ = ompi_neighbor_alltoall_f #pragma weak MPI_Neighbor_alltoall_f = ompi_neighbor_alltoall_f #pragma weak MPI_Neighbor_alltoall_f08 = ompi_neighbor_alltoall_f #else #if ! OMPI_BUILD_MPI_PROFILING OMPI_GENERATE_F77_BINDINGS (MPI_NEIGHBOR_ALLTOALL, mpi_neighbor_alltoall, mpi_neighbor_alltoall_, mpi_neighbor_alltoall__, ompi_neighbor_alltoall_f, (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr), (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, ierr) ) #else #define ompi_neighbor_alltoall_f pompi_neighbor_alltoall_f #endif #endif void ompi_neighbor_alltoall_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr) { int c_ierr; MPI_Comm c_comm; MPI_Datatype c_sendtype, c_recvtype; c_comm = PMPI_Comm_f2c(*comm); c_sendtype = PMPI_Type_f2c(*sendtype); c_recvtype = PMPI_Type_f2c(*recvtype); sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); c_ierr = PMPI_Neighbor_alltoall(sendbuf, OMPI_FINT_2_INT(*sendcount), c_sendtype, recvbuf, OMPI_FINT_2_INT(*recvcount), c_recvtype, c_comm); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); }
#ifndef PREDICTORS_H #define PREDICTORS_H #include <stdbool.h> /* Random prediction */ void random_predictor(); /* Predict always true (taken) or false */ void always_x(bool p); /* Implement assignment 1 here */ void assignment_1_simple(); /* Single Bit predictor */ void single_bit_predictor(); void two_bit_predictor(); void two_two_bit_predictor(); void custom_predictor(); /* Implement assignment 2 here */ void assignment_2_GAg(int history); /* Implement assignment 4 here */ void assignment_3_SAs(int history, int n_sets); /* Assignment 4: Change these parameters to your needs */ void assignment_4_your_own(int k, int n); /* Bonus: Change these parameters to your needs */ void bonus_1(); /* Bonus: Change these parameters to your needs */ void bonus_2(); #endif
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <semaphore.h> #include <sys/mman.h> #define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) struct shared { sem_t sem; int count; } shared; int main(int argc, char **argv) { int fd, i, nloop; struct shared *ptr; if (3 != argc) { printf("usage: %s <pathname> <#loops>\n", argv[0]); exit(EXIT_FAILURE); } nloop = atoi(argv[2]); // open file if ((fd = open(argv[1], O_RDWR | O_CREAT, FILE_MODE)) == -1) { printf("open error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } // initialize fd to 0 if (write(fd, &shared, sizeof(struct shared)) == -1) { printf("write error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } // map into memory if ((ptr = mmap(NULL, sizeof(struct shared), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) { printf("mmap error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } // close file if (close(fd) == -1) { printf("close error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } // initialize semaphore that is shared between processes if (sem_init(&ptr->sem, 1, 1) == -1) { printf("sem_init error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } // stdout is unbuffered setbuf(stdout, NULL); if (fork() == 0) { // child for (i = 0; i < nloop; ++i) { if (sem_wait(&ptr->sem) == -1) { printf("sem_wait child: error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } printf("child: %d\n", ptr->count++); if (sem_post(&ptr->sem) == -1) { printf("sem_post child error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } } exit(EXIT_SUCCESS); } for (i = 0; i < nloop; ++i) { // parent if (sem_wait(&ptr->sem) == -1) { printf("sem_wait parent error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } printf("parent: %d\n", ptr->count++); if (sem_post(&ptr->sem) == -1) { printf("sem_post parent error: %s\n", strerror(errno)); exit(EXIT_FAILURE); } } exit(EXIT_SUCCESS); }
#pragma once #include "stdafx.h" #include "firfilter.h" #include "forward.h" #include "abstractframedetector.h" #include "ringbuffer.h" class FrameDetector : public AbstractFrameDetector { Q_OBJECT public: FrameDetector(const QAudioFormat& format, QObject *parent = 0); public slots: void processAudio(const QByteArray& data); private: QAudioFormat format_; RingBuffer<double> audio_buffer_; RingBuffer<double> bufs1200_; RingBuffer<double> bufc1200_; RingBuffer<double> bufs2200_; RingBuffer<double> bufc2200_; RingBuffer<double> bufsignal_; RingBuffer<double> bufflag_; RingBuffer<double> bufthreshold_; FIRFilter lowpass_; FIRFilter bandpass_; FIRFilter bandstop_; uint64_t total_count_; uint32_t frame_sequence_; uint64_t prev_count_; double level_; double signal_level_; double input_level_; double threshold_; private: typedef RingBuffer<double>::const_iterator RingBufferIterator; void clipFrame(const RingBufferIterator& begin, const RingBufferIterator& end); };
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QFile> #include <QByteArray> #include <QtNetwork/QNetworkAccessManager> #include <QtNetwork/QNetworkRequest> #include <QtNetwork/QNetworkReply> #include <QProcess> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); void doDownload(); ~MainWindow(); private slots: void on_pushButton_clicked(); void updateDownloadProgress(qint64 bytesRead, qint64 bytesTotal); void replyDownloadFinished(QNetworkReply* pReply); void httpReadyRead(); private: Ui::MainWindow *ui; QNetworkAccessManager *m_manager; QFile *m_file; QNetworkReply *m_reply; }; #endif // MAINWINDOW_H
/** * \file IMP/VersionInfo.h \brief Version and authorship of IMP objects. * * Copyright 2007-2017 IMP Inventors. All rights reserved. * */ #ifndef IMPKERNEL_VERSION_INFO_H #define IMPKERNEL_VERSION_INFO_H #include <IMP/kernel_config.h> #include "exception.h" #include "comparison_macros.h" #include "check_macros.h" #include "showable_macros.h" #include "value_macros.h" #include "Value.h" #include <iostream> IMPKERNEL_BEGIN_NAMESPACE //! Version and module information for Objects /** All IMP::Object -derived objects have a method IMP::Object::get_version_info() returning such an object. The version info allows one to determine the module and version of all restraints used to help creating reproducible results. */ class IMPKERNELEXPORT VersionInfo : public Value { public: //! Create a VersionInfo object with the given module and version. VersionInfo(std::string module, std::string version); VersionInfo() {} std::string get_module() const { return module_; } std::string get_version() const { return version_; } IMP_SHOWABLE_INLINE(VersionInfo, { IMP_USAGE_CHECK(!module_.empty(), "Attempting to use uninitialized version info"); out << module_ << " " << version_; }); IMP_COMPARISONS_2(VersionInfo, module_, version_); private: std::string module_, version_; }; IMP_VALUES(VersionInfo, VersionInfos); IMPKERNEL_END_NAMESPACE #endif /* IMPKERNEL_VERSION_INFO_H */
#pragma once #ifdef SLIDERTEST #include "v2f.h" struct hit_object; void p_init(int& argc, char* argv[]); void p_show(hit_object& ho); #else #define p_init(argc, argv) #define p_show(ho) #endif
#include "sigmoid.h" double sigmoid_func (double x) { /* Sigmoid function: * * 1 * O = ____________ * ( 1 + e^-x ) * */ return ( (double) 1.0 / (1.0 + exp (-x) ) ); } double sigmoid_deriv_func (double y) { /* Afgeleide van de Sigmoid function: * * O' = y * (1 - y) * */ return (y * (1.0 - y) ); }
/* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once #include <boost/shared_ptr.hpp> #include <Swiften/Base/boost_bsignals.h> #include <boost/enable_shared_from_this.hpp> #include <vector> #include <Swiften/Session/Session.h> #include <Swiften/JID/JID.h> namespace Swift { class ConnectionFactory; class XMLParserFactory; class Element; class PayloadParserFactoryCollection; class PayloadSerializerCollection; class OutgoingLinkLocalSession : public Session { public: OutgoingLinkLocalSession( const JID& localJID, const JID& remoteJID, boost::shared_ptr<Connection> connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory); void queueElement(boost::shared_ptr<Element> element); private: void handleSessionStarted(); void handleElement(boost::shared_ptr<Element>); void handleStreamStart(const ProtocolHeader&); private: std::vector<boost::shared_ptr<Element> > queuedElements_; }; }
/* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * From ASN.1 module "S1AP-IEs" * found in "../support/s1ap-r16.1.0/36413-g10.asn" * `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps` */ #include "S1AP_WLANName.h" int S1AP_WLANName_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; if(!sptr) { ASN__CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1 && size <= 32)) { /* Constraint check succeeded */ return 0; } else { ASN__CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static asn_oer_constraints_t asn_OER_type_S1AP_WLANName_constr_1 CC_NOTUSED = { { 0, 0 }, -1 /* (SIZE(1..32)) */}; asn_per_constraints_t asn_PER_type_S1AP_WLANName_constr_1 CC_NOTUSED = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */, 0, 0 /* No PER value map */ }; static const ber_tlv_tag_t asn_DEF_S1AP_WLANName_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_S1AP_WLANName = { "WLANName", "WLANName", &asn_OP_OCTET_STRING, asn_DEF_S1AP_WLANName_tags_1, sizeof(asn_DEF_S1AP_WLANName_tags_1) /sizeof(asn_DEF_S1AP_WLANName_tags_1[0]), /* 1 */ asn_DEF_S1AP_WLANName_tags_1, /* Same as above */ sizeof(asn_DEF_S1AP_WLANName_tags_1) /sizeof(asn_DEF_S1AP_WLANName_tags_1[0]), /* 1 */ { &asn_OER_type_S1AP_WLANName_constr_1, &asn_PER_type_S1AP_WLANName_constr_1, S1AP_WLANName_constraint }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ };
/* * Copyright (C) 2014 HEPfit Collaboration * All rights reserved. * * For the licensing terms see doc/COPYING. */ #ifndef HIGGSKVGENKF_H #define HIGGSKVGENKF_H #include <NPbase.h> /** * @class HiggsKvgenKf * @ingroup HiggsExtensions * @brief A model class extending the %StandardModel Higgs sector with three couplings. * @author HEPfit Collaboration * @copyright GNU General Public License * @details This is a Model class containing parameters and functions associated * with an extension of the %StandardModel where Higgs couplings to the @f$Z@f$ boson * are rescaled by @f$K_Z@f$, Higgs couplings to the @f$W@f$ boson * are rescaled by @f$K_W@f$ and Higgs couplings to all fermions are rescaled by @f$K_f@f$. * This class inherits from the %HiggsExtensionModel class, which defines parameters related to generic * extensions of the %StandardModel Higgs sector. * * * @anchor HiggsKvgenKfInitialization * <h3>Initialization</h3> * * After creating an instance of the current class, * it is required to call the initialization method InitializeModel(), which * is needed by the base class. * * The initializations and updates of the model parameters are explained * below. * * * @anchor HiggsKvgenKfParameters * <h3>%Model parameters</h3> * * The model parameters of %HiggsKvgenKf (in addition to the %StandardModel ones) are summarized below: * <table class="model"> * <tr> * <th>Label</th> * <th>LaTeX symbol</th> * <th>Description</th> * </tr> * <tr> * <td class="mod_name">%KZ</td> * <td class="mod_symb">@f$\kappa_Z@f$</td> * <td class="mod_desc">The factor rescaling Higgs couplings to @f$Z@f$ bosons with respect to the SM.</td> * </tr> * <tr> * <td class="mod_name">%KW</td> * <td class="mod_symb">@f$\kappa_W@f$</td> * <td class="mod_desc">The factor rescaling Higgs couplings to @f$W@f$ bosons with respect to the SM.</td> * </tr> * <tr> * <td class="mod_name">%Kf</td> * <td class="mod_symb">@f$\kappa_f@f$</td> * <td class="mod_desc">The factor rescaling all Higgs couplings to fermions with respect to the SM.</td> * </tr> * <tr> * <td class="mod_name">%BrHinv</td> * <td class="mod_symb">Br@f$(H\to invisible)@f$</td> * <td class="mod_desc">The branching ratio of invisible Higgs decays.</td> * </tr> * </table> * * Please read information about parameter initialization and update in the documentation of the %StandardModel class. */ class HiggsKvgenKf : public NPbase { public: static const int NHKvgenKfvars = 4; ///< The number of the model parameters in %HiggsKvgenKf. /** * @brief A string array containing the labels of the model parameters in %HiggsKvgenKf. */ static const std::string HKvgenKfvars[NHKvgenKfvars]; HiggsKvgenKf(); virtual ~HiggsKvgenKf() { }; double getKf() const { return Kf; } void setKf(double Kf) { this->Kf = Kf; } double getKW() const { return KW; } void setKW(double KW) { this->KW = KW; } double getKZ() const { return KZ; } void setKZ(double KZ) { this->KZ = KZ; } /** * @brief A method to check if all the mandatory parameters for %HiggsKvgenKf * have been provided in model initialization. * @param[in] DPars a map of the parameters that are being updated in the Monte Carlo run * (including parameters that are varied and those that are held constant) * @return a boolean that is true if the execution is successful */ virtual bool CheckParameters(const std::map<std::string, double>& DPars); //////////////////////////////////////////////////////////////////////// virtual double muggH(const double sqrt_s) const; virtual double muVBF(const double sqrt_s) const; virtual double muWH(const double sqrt_s) const; virtual double muZH(const double sqrt_s) const; virtual double muVH(const double sqrt_s) const; virtual double muVBFpVH(const double sqrt_s) const; virtual double muttH(const double sqrt_s) const; virtual double muggHpttH(const double sqrt_s) const; virtual double BrHggRatio() const; virtual double BrHWWRatio() const; virtual double BrHZZRatio() const; virtual double BrHZgaRatio() const; virtual double BrHgagaRatio() const; virtual double BrHtautauRatio() const; virtual double BrHccRatio() const; virtual double BrHbbRatio() const; virtual double computeGammaTotalRatio() const; //////////////////////////////////////////////////////////////////////// protected: /** * @brief A method to set the value of a parameter of %HiggsKvKf. * @param[in] name name of a model parameter * @param[in] value the value to be assigned to the parameter specified by name */ virtual void setParameter(const std::string name, const double& value); virtual double computeKg() const; virtual double computeKW() const; virtual double computeKZ() const; /** * @brief A method to compute the ratio of the @f$HZ\gamma@f$ coupling in the current model and in the SM. * @return the ratio of the @f$HZ\gamma@f$ coupling in the current model and in the SM */ virtual double computeKZga() const; /** * @brief A method to compute the ratio of the @f$H\gamma\gamma@f$ coupling in the current model and in the SM. * @return the ratio of the @f$H\gamma\gamma@f$ coupling in the current model and in the SM */ virtual double computeKgaga() const; virtual double computeKtau() const; virtual double computeKc() const; virtual double computeKt() const; virtual double computeKb() const; //////////////////////////////////////////////////////////////////////// private: double KW, KZ, Kf, BrHinv; }; #endif /* HIGGSKVGENKF_H */
/* **************************************************************** * Rabit Multi-Threaded Management System * Athrs: Randal Direen PhD * Harry Direen PhD * www.direentech.com * Date: June 2016 * *******************************************************************/ #ifndef MANAGER_STATUS_MESSAGE #define MANAGER_STATUS_MESSAGE #include <string> #include <memory> #include <sstream> #include "RabitMessage.h" #include "ManagerStats.h" namespace Rabit { //The Message contains various information about a Managers //operation including a number of statistics on the operation //of the manager. class ManagerStatusMessage : public RabitMessage { public: //This is the Manager name for reference purposes. std::string ManagerName = "Unknown"; enum RunningState_e { MgrState_Startup, MgrState_Running, MgrState_Shutdown }; RunningState_e RunningState = MgrState_Startup; //This flag can be set to true if there is some error in the //manager, otherwize it will be false. bool ErrorCondition = false; //A user definded Code indicating the type of error occurring //in the manager. int ErrorCode = 0; ManagerStats_t ManagerStats; private: public: ManagerStatusMessage() : RabitMessage() { ManagerStats.Clear(); } virtual std::unique_ptr<RabitMessage> Clone() const final { auto clone = std::unique_ptr<ManagerStatusMessage>(new ManagerStatusMessage(*this)); return std::move(clone); } virtual bool CopyMessage(RabitMessage *msg) final { if (msg->GetTypeIndex() == std::type_index(typeid(ManagerStatusMessage))) { RabitMessage::CopyMessage(msg); ManagerStatusMessage* msMsg = static_cast<ManagerStatusMessage *>(msg); *this = *msMsg; this->ManagerName = msMsg->ManagerName; return true; } return false; } virtual void Clear() final { //Don't Clear the Manager Name or Running State. //this->RunningState = MgrState_Startup; this->ErrorCondition = false; this->ErrorCode = 0; ManagerStats.Clear(); } virtual std::string ToString() const final { std::ostringstream ss; ss << "ManagerName = " << ManagerName << " RunningState = " << RunningState << " ErrorCondition = " << ErrorCondition << " ErrorCode = " << ErrorCode << " ManagerStats = " << ManagerStats.ToString() << std::endl; return ss.str(); } }; } #endif //MANAGER_STATUS_MESSAGE
#pragma once #include <utility> #include <iostream> namespace pathfinding { typedef std::pair<int, int> location_t; #define ROAD_COEFFICIENT 0.2 class Node { public: enum NodeType { NORMAL, CITY, ROAD, WOOD, MOUNTAIN, WATER }; private: static int WOOD_LENGTH; static int WOOD_NODES; static int WATER_NODES; int length; location_t position; bool traversable = true; NodeType type = NodeType::NORMAL; public: Node(int, std::pair<int, int>, bool); int Length() const; std::pair<int, int> Position() const; bool Traversable() const; NodeType Type() const; double StraightDistance(Node* n); void makeRoad(); void makeWood(); void makeWater(); void makeCity(); static double WOOD_THRESHOLD; static double WATER_THRESHOLD; static int TOTAL_WATER_NODES(); static int TOTAL_WOOD_NODES(); friend std::ostream& operator<< (std::ostream&, const Node&); }; }
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* This file is part of the program and library */ /* SCIP --- Solving Constraint Integer Programs */ /* */ /* Copyright (C) 2002-2018 Konrad-Zuse-Zentrum */ /* fuer Informationstechnik Berlin */ /* */ /* SCIP is distributed under the terms of the ZIB Academic License. */ /* */ /* You should have received a copy of the ZIB Academic License */ /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /**@file type_compr.h * @ingroup TYPEDEFINITIONS * @brief type definitions for tree compression * @author Jakob Witzig * * This file defines the interface for tree compression implemented in C. * */ /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ #ifndef __SCIP_TYPE_COMPR_H__ #define __SCIP_TYPE_COMPR_H__ #include "scip/def.h" #include "scip/type_scip.h" #include "scip/type_result.h" #include "scip/type_timing.h" #ifdef __cplusplus extern "C" { #endif typedef struct SCIP_Compr SCIP_COMPR; /**< tree compression */ typedef struct SCIP_ComprData SCIP_COMPRDATA; /**< locally defined tree compression data */ /** copy method for compression plugins (called when SCIP copies plugins) * * input: * - scip : SCIP main data structure * - compr : the compression technique itself */ #define SCIP_DECL_COMPRCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_COMPR* compr) /** destructor of tree compression to free user data (called when SCIP is exiting) * * input: * - scip : SCIP main data structure * - compr : the compression technique itself */ #define SCIP_DECL_COMPRFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_COMPR* compr) /** initialization method of tree compression (called after problem was transformed) * * input: * - scip : SCIP main data structure * - compr : the compression technique itself */ #define SCIP_DECL_COMPRINIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_COMPR* compr) /** deinitialization method of tree compression (called before transformed problem is freed) * * input: * - scip : SCIP main data structure * - compr : the compression technique itself */ #define SCIP_DECL_COMPREXIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_COMPR* compr) /** solving process initialization method of tree compressionc (called when branch and bound process is about to begin) * * This method is called when the presolving was finished and the branch and bound process is about to begin. * The tree compression may use this call to initialize its branch and bound specific data. * * input: * - scip : SCIP main data structure * - compr : the compression technique itself */ #define SCIP_DECL_COMPRINITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_COMPR* compr) /** solving process deinitialization method of tree compression (called before branch and bound process data is freed) * * This method is called before the branch and bound process is freed. * The tree compression should use this call to clean up its branch and bound data. * * input: * - scip : SCIP main data structure * - compr : the compression technique itself */ #define SCIP_DECL_COMPREXITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_COMPR* compr) /** execution method of tree compression technique * * Try to compress the current search tree. The method is called in the node processing loop. * * input: * - scip : SCIP main data structure * - compr : the compression technique itself * - result : pointer to store the result of the heuristic call * * possible return values for *result: * - SCIP_SUCCESS : the tree could be compressed * - SCIP_DIDNITFIND : the method could not compress the tree * - SCIP_DIDNOTRUN : the compression was skipped */ #define SCIP_DECL_COMPREXEC(x) SCIP_RETCODE x (SCIP* scip, SCIP_COMPR* compr, SCIP_RESULT* result) #ifdef __cplusplus } #endif #endif
#ifndef H_S_MISSION #define H_S_MISSION #ifdef OLD_MISSIONS void prepare_for_mission(void); void mission_spawn_extra_p1_processes(void); void set_player_w_init_spawn_angle(int player_index, int nearby_data_well); //int use_mission_system_file(int mission); void save_mission_status_file(void); void load_mission_status_file(void); enum { MISSION_STATUS_UNFINISHED, MISSION_STATUS_FINISHED, //MISSION_STATUS_2STARS, //MISSION_STATUS_3STARS, MISSION_STATUSES // used for bounds-checking loaded values }; enum { MISSION_TUTORIAL1, MISSION_TUTORIAL2, MISSION_TUTORIAL3, MISSION_TUTORIAL4, MISSION_MISSION1, MISSION_MISSION2, MISSION_MISSION3, MISSION_MISSION4, MISSION_MISSION5, MISSION_MISSION6, MISSION_MISSION7, MISSION_MISSION8, MISSION_ADVANCED1, // currently it is assumed that all advanced missions, and nothing else, come after this one MISSION_ADVANCED2, MISSION_ADVANCED3, MISSION_ADVANCED4, MISSION_ADVANCED5, MISSION_ADVANCED6, MISSION_ADVANCED7, MISSION_ADVANCED8, MISSIONS }; struct missionsstruct { int status [MISSIONS]; // MISSION_STATUS_* enum int locked [MISSIONS]; // 0 or 1 }; struct missionsstruct missions; struct mission_state_struct { // extact meaning of all of these values depends on which mission is being played int phase; // currently used only for tutorials - keeps track of where the player is up to int reveal_player1; // shows player 1 on the map if p1 has no static processes left }; #endif #endif
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jouni Ahto <jouni.ahto@exdec.fi> | | Andrew Avdeev <andy@simgts.mv.ru> | | Ard Biesheuvel <a.k.biesheuvel@its.tudelft.nl> | +----------------------------------------------------------------------+ */ /* $Id: php_interbase.h,v 1.71.2.1.2.1 2007/01/01 09:36:02 sebastian Exp $ */ #ifndef PHP_INTERBASE_H #define PHP_INTERBASE_H extern zend_module_entry ibase_module_entry; #define phpext_interbase_ptr &ibase_module_entry PHP_MINIT_FUNCTION(ibase); PHP_RINIT_FUNCTION(ibase); PHP_MSHUTDOWN_FUNCTION(ibase); PHP_RSHUTDOWN_FUNCTION(ibase); PHP_MINFO_FUNCTION(ibase); PHP_FUNCTION(ibase_connect); PHP_FUNCTION(ibase_pconnect); PHP_FUNCTION(ibase_close); PHP_FUNCTION(ibase_drop_db); PHP_FUNCTION(ibase_query); PHP_FUNCTION(ibase_fetch_row); PHP_FUNCTION(ibase_fetch_assoc); PHP_FUNCTION(ibase_fetch_object); PHP_FUNCTION(ibase_free_result); PHP_FUNCTION(ibase_name_result); PHP_FUNCTION(ibase_prepare); PHP_FUNCTION(ibase_execute); PHP_FUNCTION(ibase_free_query); PHP_FUNCTION(ibase_timefmt); PHP_FUNCTION(ibase_gen_id); PHP_FUNCTION(ibase_num_fields); PHP_FUNCTION(ibase_num_params); #if abies_0 PHP_FUNCTION(ibase_num_rows); #endif PHP_FUNCTION(ibase_affected_rows); PHP_FUNCTION(ibase_field_info); PHP_FUNCTION(ibase_param_info); PHP_FUNCTION(ibase_trans); PHP_FUNCTION(ibase_commit); PHP_FUNCTION(ibase_rollback); PHP_FUNCTION(ibase_commit_ret); PHP_FUNCTION(ibase_rollback_ret); PHP_FUNCTION(ibase_blob_create); PHP_FUNCTION(ibase_blob_add); PHP_FUNCTION(ibase_blob_cancel); PHP_FUNCTION(ibase_blob_open); PHP_FUNCTION(ibase_blob_get); PHP_FUNCTION(ibase_blob_close); PHP_FUNCTION(ibase_blob_echo); PHP_FUNCTION(ibase_blob_info); PHP_FUNCTION(ibase_blob_import); PHP_FUNCTION(ibase_add_user); PHP_FUNCTION(ibase_modify_user); PHP_FUNCTION(ibase_delete_user); PHP_FUNCTION(ibase_service_attach); PHP_FUNCTION(ibase_service_detach); PHP_FUNCTION(ibase_backup); PHP_FUNCTION(ibase_restore); PHP_FUNCTION(ibase_maintain_db); PHP_FUNCTION(ibase_db_info); PHP_FUNCTION(ibase_server_info); PHP_FUNCTION(ibase_errmsg); PHP_FUNCTION(ibase_errcode); PHP_FUNCTION(ibase_wait_event); PHP_FUNCTION(ibase_set_event_handler); PHP_FUNCTION(ibase_free_event_handler); #else #define phpext_interbase_ptr NULL #endif /* PHP_INTERBASE_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */
/******************************************************************* * * ftxopenf.h * * internal TrueType Open functions * * Copyright 1996-1999 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used * modified and distributed under the terms of the FreeType project * license, LICENSE.TXT. By continuing to use, modify, or distribute * this file you indicate that you have read the license and * understand and accept it fully. * ******************************************************************/ #ifndef FTXOPENF_H #define FTXOPENF_H #include "ftxopen.h" #ifdef __cplusplus extern "C" { #endif /* functions from ftxopen.c */ TT_Error Load_ScriptList( TTO_ScriptList* sl, PFace input ); TT_Error Load_FeatureList( TTO_FeatureList* fl, PFace input ); TT_Error Load_LookupList( TTO_LookupList* ll, PFace input, TTO_Type type ); TT_Error Load_Coverage( TTO_Coverage* c, PFace input ); TT_Error Load_ClassDefinition( TTO_ClassDefinition* cd, UShort limit, PFace input ); TT_Error Load_Device( TTO_Device* d, PFace input ); void Free_ScriptList( TTO_ScriptList* sl ); void Free_FeatureList( TTO_FeatureList* fl ); void Free_LookupList( TTO_LookupList* ll, TTO_Type type ); void Free_Coverage( TTO_Coverage* c ); void Free_ClassDefinition( TTO_ClassDefinition* cd ); void Free_Device( TTO_Device* d ); /* functions from ftxgsub.c */ TT_Error Load_SingleSubst( TTO_SingleSubst* ss, PFace input ); TT_Error Load_MultipleSubst( TTO_MultipleSubst* ms, PFace input ); TT_Error Load_AlternateSubst( TTO_AlternateSubst* as, PFace input ); TT_Error Load_LigatureSubst( TTO_LigatureSubst* ls, PFace input ); TT_Error Load_ContextSubst( TTO_ContextSubst* cs, PFace input ); TT_Error Load_ChainContextSubst( TTO_ChainContextSubst* ccs, PFace input ); void Free_SingleSubst( TTO_SingleSubst* ss ); void Free_MultipleSubst( TTO_MultipleSubst* ms ); void Free_AlternateSubst( TTO_AlternateSubst* as ); void Free_LigatureSubst( TTO_LigatureSubst* ls ); void Free_ContextSubst( TTO_ContextSubst* cs ); void Free_ChainContextSubst( TTO_ChainContextSubst* ccs ); /* functions from ftxgpos.c */ TT_Error Load_SinglePos( TTO_SinglePos* sp, PFace input ); TT_Error Load_PairPos( TTO_PairPos* pp, PFace input ); TT_Error Load_CursivePos( TTO_CursivePos* cp, PFace input ); TT_Error Load_MarkBasePos( TTO_MarkBasePos* mbp, PFace input ); TT_Error Load_MarkLigPos( TTO_MarkLigPos* mlp, PFace input ); TT_Error Load_MarkMarkPos( TTO_MarkMarkPos* mmp, PFace input ); TT_Error Load_ContextPos( TTO_ContextPos* cp, PFace input ); TT_Error Load_ChainContextPos( TTO_ChainContextPos* ccp, PFace input ); void Free_SinglePos( TTO_SinglePos* sp ); void Free_PairPos( TTO_PairPos* pp ); void Free_CursivePos( TTO_CursivePos* cp ); void Free_MarkBasePos( TTO_MarkBasePos* mbp ); void Free_MarkLigPos( TTO_MarkLigPos* mlp ); void Free_MarkMarkPos( TTO_MarkMarkPos* mmp ); void Free_ContextPos( TTO_ContextPos* cp ); void Free_ChainContextPos( TTO_ChainContextPos* ccp ); /* query functions */ TT_Error Coverage_Index( TTO_Coverage* c, UShort glyphID, UShort* index ); TT_Error Get_Class( TTO_ClassDefinition* cd, UShort glyphID, UShort* class, UShort* index ); TT_Error Get_Device( TTO_Device* d, UShort size, Short* value ); /* functions from ftxgdef.c */ TT_Error Add_Glyph_Property( TTO_GDEFHeader* gdef, UShort glyphID, UShort property ); #ifdef __cplusplus } #endif #endif /* FTXOPENF_H */ /* END */
#include "defs.h" #include "fdefs.h" #include <stdlib.h> #include "xray.h" /* * Read in the spline coefficients for spline interpolating the X-ray * luminosity. * The format of the table is Comment line <redshift> <number of spline points> <min. temperature> <delta temperature> (the temperatures are log10(Kelvin).) <number of bands> <y spline coefficients for band 1> <y'' spline coefficients for band 1> <y spline coefficients for band 2> ... This version allows you to read the spline file from the command line with a call to: xrayload splinefile */ void xray_load_sub(job) char *job ; { int count ; int i,j ; FILE *fp; char command[MAXCOMM] ; if(sscanf(job,"%s %s",command, hardfile.name) != 2){ printf("<Useage, xrayload splinefile>\n") ; return ; } /* Free any previously allocated stuff */ if ( temp_spline!=NULL ) free(temp_spline) ; if ( xray_lums!=NULL ){ for(i = 0; i < number_bands; i++) { free( xray_lums[i].yspl ); free( xray_lums[i].y2spl ); } free(xray_lums) ; } hardfile.ptr = fopen(hardfile.name,"r") ; if(hardfile.ptr == NULL) { printf("<Sorry %s, file does not exist>\n",title); return; } /* * Toss first line */ fscanf(hardfile.ptr, "%*s"); count = fscanf(hardfile.ptr, "%lf", &redshift); if(count != 1) { printf("<Sorry %s, file format wrong>\n", title); return; } count = fscanf(hardfile.ptr, "%d %lf %lf", &xray_spline_n, &xray_min_temp, &deldtempi); if(count != 3) { printf("<Sorry %s, file format wrong>\n", title); return; } count=fscanf(hardfile.ptr, "%d",&number_bands) ; if(count != 1) { printf("<Sorry %s, file format wrong>\n", title); return; } temp_spline = (double *)malloc(xray_spline_n*sizeof(*temp_spline)); for(i = 0; i < xray_spline_n; i++) { temp_spline[i] = xray_min_temp + i*deldtempi; } xray_lums = malloc(number_bands*sizeof(*xray_lums)); if(xray_lums == NULL) { printf("<sorry, no memory for xray_lum, %s>\n",title) ; return; } for(i = 0; i < number_bands; i++) { xray_lums[i].yspl = malloc(xray_spline_n*sizeof(*(xray_lums->yspl))); xray_lums[i].y2spl = malloc(xray_spline_n*sizeof(*(xray_lums->y2spl))); } for(i = 0 ; i < number_bands; i++){ for(j = 0 ; j < xray_spline_n; j++){ count = fscanf(hardfile.ptr, "%lf",&xray_lums[i].yspl[j]) ; if(count != 1) { printf("<Sorry %s, file format wrong>\n", title); return; } } for(j = 0 ; j < xray_spline_n; j++){ count = fscanf(hardfile.ptr, "%lf",&xray_lums[i].y2spl[j]) ; if(count != 1) { printf("<Sorry %s, file format wrong>\n", title); return; } } } /* Close the file */ close( hardfile.ptr ) ; printf(" Spline file: %s loaded \n", hardfile.name ) ; xray_loaded = YES ; }
int socket(int domain, int type, int protocol) { #ifdef DEBUG printf("[vlany] socket() called\n"); #endif HOOK(old_socket, CSOCKET); if(domain == AF_NETLINK && protocol == NETLINK_INET_DIAG) if(!strcmp(procname_self(), "ss") || !strcmp(procname_self(), "/usr/sbin/ss") || !strcmp(procname_self(), "/bin/ss")) { errno = EIO; return -1; } return old_socket(domain,type,protocol); }
/* CXenon VM v0.0.5 */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <stdbool.h> #include "mpc/mpc.h" #include "parser/parser.h" #include "preprocessor/preprocessor.h" #include "repl/repl.h" int main(int argc, char **argv){ if (argc < 2){ repl(); } else { char *a = calloc(1, 1000*sizeof(char)); printf("%s\n", finput(a, argv[1], 1000*sizeof(char))); char *b = preprocessor(a); free(a); mpc_ast_t* ast = parse(argv[1], b); free(b); mpc_ast_print(ast); mpc_ast_delete(ast); return 0; } }
#ifndef AZAN_CALCLUATION_H #define AZAN_CALCLUATION_H /*Bismillahirahamannirahim...*/ /* INSPIRED BY https://ideone.com/ndCpBe */ #include <math.h> #include <ctime> #include "setting_azan/setting_kota.h" /* _NOTE_ : THIS FOR INDONESIA COUNTRY and arround it*/ #define FAJR_TWILIGHT_SEA 17.5 //Untuk daerah malaysia dan sekitarnya(Termasuk Indonesia) #define ISHA_TWILIGHT_SEA 18 //Untuk daerah malaysia dan sekitarnya(Termasuk Indonesia) int get_curr_year(); int get_curr_date(); int get_curr_month(); void convert_to_hour(double result,int &hours,int &minutes); //mengubah hasil kalkulasi ke jam int max_24(double value); class azan_calc { private: double latitude; // diambil menggunakan sqlite double longitude; //sama static double subuh; //masih dalam bentuk koma static double dzuhur; static double ashar; static double magrib; static double isya; static double sunRiseTime; public: azan_calc (double longitude_i,double latitude_i,int timezone); double moreLess360(double value); double radToDeg(double radian); double degToRad(double degree); double get_lat(); double get_long(); static double get_subuh(); static double get_dzuhur(); static double get_ashar(); static double get_magrib(); static double get_isya(); }; #endif
/** * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium * Copyright (C) 2017-2018 Osimis S.A., Belgium * * 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. * * In addition, as a special exception, the copyright holders of this * program give permission to link the code of its release with the * OpenSSL project's "OpenSSL" library (or with modified versions of it * that use the same license as the "OpenSSL" library), and distribute * the linked executables. You must obey the GNU General Public License * in all respects for all of the code used other than "OpenSSL". If you * modify file(s) with this exception, you may extend this exception to * your version of the file(s), but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source files * in the program, then also delete it here. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. **/ #pragma once #include "../Enumerations.h" #include "IHttpOutputStream.h" #include "IHttpStreamAnswer.h" #include <list> #include <string> #include <stdint.h> #include <map> namespace Orthanc { class HttpOutput : public boost::noncopyable { private: typedef std::list< std::pair<std::string, std::string> > Header; class StateMachine : public boost::noncopyable { public: enum State { State_WritingHeader, State_WritingBody, State_WritingMultipart, State_Done }; private: IHttpOutputStream& stream_; State state_; HttpStatus status_; bool hasContentLength_; uint64_t contentLength_; uint64_t contentPosition_; bool keepAlive_; std::list<std::string> headers_; std::string multipartBoundary_; std::string multipartContentType_; public: StateMachine(IHttpOutputStream& stream, bool isKeepAlive); ~StateMachine(); void SetHttpStatus(HttpStatus status); void SetContentLength(uint64_t length); void SetContentType(const char* contentType); void SetContentFilename(const char* filename); void SetCookie(const std::string& cookie, const std::string& value); void AddHeader(const std::string& header, const std::string& value); void ClearHeaders(); void SendBody(const void* buffer, size_t length); void StartMultipart(const std::string& subType, const std::string& contentType); void SendMultipartItem(const void* item, size_t length, const std::map<std::string, std::string>& headers); void CloseMultipart(); void CloseBody(); State GetState() const { return state_; } }; StateMachine stateMachine_; bool isDeflateAllowed_; bool isGzipAllowed_; HttpCompression GetPreferredCompression(size_t bodySize) const; public: HttpOutput(IHttpOutputStream& stream, bool isKeepAlive) : stateMachine_(stream, isKeepAlive), isDeflateAllowed_(false), isGzipAllowed_(false) { } void SetDeflateAllowed(bool allowed) { isDeflateAllowed_ = allowed; } bool IsDeflateAllowed() const { return isDeflateAllowed_; } void SetGzipAllowed(bool allowed) { isGzipAllowed_ = allowed; } bool IsGzipAllowed() const { return isGzipAllowed_; } void SendStatus(HttpStatus status, const char* message, size_t messageSize); void SendStatus(HttpStatus status) { SendStatus(status, NULL, 0); } void SendStatus(HttpStatus status, const std::string& message) { SendStatus(status, message.c_str(), message.size()); } void SetContentType(const char* contentType) { stateMachine_.SetContentType(contentType); } void SetContentFilename(const char* filename) { stateMachine_.SetContentFilename(filename); } void SetCookie(const std::string& cookie, const std::string& value) { stateMachine_.SetCookie(cookie, value); } void AddHeader(const std::string& key, const std::string& value) { stateMachine_.AddHeader(key, value); } void Answer(const void* buffer, size_t length); void Answer(const std::string& str); void AnswerEmpty(); void SendMethodNotAllowed(const std::string& allowed); void Redirect(const std::string& path); void SendUnauthorized(const std::string& realm); void StartMultipart(const std::string& subType, const std::string& contentType) { stateMachine_.StartMultipart(subType, contentType); } void SendMultipartItem(const void* item, size_t size, const std::map<std::string, std::string>& headers) { stateMachine_.SendMultipartItem(item, size, headers); } void CloseMultipart() { stateMachine_.CloseMultipart(); } bool IsWritingMultipart() const { return stateMachine_.GetState() == StateMachine::State_WritingMultipart; } void Answer(IHttpStreamAnswer& stream); }; }
// Converted using ConvPNG #include <stdint.h> #include "sprite_gfx.h" uint8_t sonic_run_1_compressed[231] = { 0x1B,0x24,0x1B,0x06,0x00,0x4C,0x07,0x00,0x06,0x84,0x52,0x00,0x03,0x1E,0x00,0x07,0x08,0x00,0x1D,0x03,0x84,0x85,0x1C,0x0D,0x0D,0x08,0xC7,0x00,0xD8,0x1A,0x53,0x09, 0x09,0x08,0x7C,0x0B,0x00,0x1B,0x21,0x18,0xFF,0x4E,0x4F,0x17,0x01,0xC7,0x00,0x5F,0x4C,0x1A,0x14,0x95,0x19,0x0E,0x0E,0x04,0x1D,0x69,0x76,0x35,0x1A,0x0C,0x17,0x00, 0x08,0x00,0x11,0x1F,0x39,0x0A,0xC9,0x1A,0x1B,0x86,0x84,0x1B,0x05,0x22,0x0C,0x0A,0x98,0x15,0x09,0xB6,0x75,0x4F,0x00,0x58,0x07,0x6B,0x0D,0x00,0x00,0x8B,0x19,0x79, 0x02,0x29,0x49,0x0C,0x04,0xD7,0x00,0x1C,0x0C,0x17,0x4B,0x87,0xD0,0x18,0x8B,0x2E,0x0E,0x02,0x02,0x1C,0x8B,0x19,0x69,0x07,0x01,0x01,0x1B,0x35,0x05,0x00,0x01,0x1E, 0x84,0x05,0xC0,0x0A,0xED,0x19,0x7D,0x0A,0x00,0x02,0x18,0x1B,0x01,0xAC,0x1C,0x85,0x1D,0x05,0x66,0xD4,0x0C,0x54,0x48,0x85,0x01,0x00,0x02,0x0D,0x0A,0x03,0x00,0x40, 0xD3,0x07,0x8F,0x1A,0x78,0x02,0x1A,0xAD,0x24,0x05,0x0E,0xB2,0x1B,0x0D,0x04,0x26,0x50,0xB0,0x5C,0xA0,0x9B,0x73,0xEF,0x0A,0xA2,0x04,0x01,0x52,0x4F,0x02,0x72,0x41, 0x0A,0x0D,0xD1,0x1A,0x06,0x93,0x1A,0xBC,0x28,0x09,0x18,0x8B,0x62,0xC2,0xA0,0xA6,0x52,0x1B,0x45,0x00,0xDF,0x4E,0x00,0x34,0xCD,0x1A,0x11,0x1C,0xF0,0x12,0x4C,0x39, 0x00,0x06,0x81,0xE2,0x00,0x00,0x01, };
#ifndef VRWINDOW_H_INCLUDED #define VRWINDOW_H_INCLUDED #include <OpenSG/OSGWindow.h> #include <OpenSG/OSGRenderAction.h> #include "core/setup/VRSetupFwd.h" #include "core/utils/VRDeviceFwd.h" #include "core/utils/VRName.h" #include "core/utils/VRChangeList.h" OSG_BEGIN_NAMESPACE; using namespace std; class VRWindow; class VRThread; typedef boost::function<void (VRWindowPtr, int, int, int, int, int)> VRWindowCallback; // params: device, button, state, mouse x, mouse y class VRWindow : public std::enable_shared_from_this<VRWindow>, public VRName { protected: bool active = false; bool content = false; bool waitingAtBarrier = false; bool stopping = false; string msaa = "x4"; int type = -1; WindowMTRecPtr _win; RenderActionRefPtr ract; vector<VRViewWeakPtr> views; VRChangeList changeListStats; VRMousePtr mouse = 0; VRMultiTouchPtr multitouch = 0; VRKeyboardPtr keyboard = 0; int width = 640; int height = 480; VRThreadCbPtr winThread; int thread_id = -1; void update( VRThreadWeakPtr t ); public: VRWindow(); virtual ~VRWindow(); static VRWindowPtr create(); VRWindowPtr ptr(); bool hasType(int i); void resize(int w, int h); Vec2i getSize(); void setAction(RenderActionRefPtr ract); static unsigned int active_window_count; bool isActive(); void setActive(bool b); bool hasContent(); void setContent(bool b); bool isWaiting(); void stop(); void setMouse(VRMousePtr m); void setMultitouch(VRMultiTouchPtr m); VRMousePtr getMouse(); VRMultiTouchPtr getMultitouch(); void setKeyboard(VRKeyboardPtr m); VRKeyboardPtr getKeyboard(); WindowMTRecPtr getOSGWindow(); void addView(VRViewPtr view); void remView(VRViewPtr view); vector<VRViewPtr> getViews(); void setMSAA(string s); string getMSAA(); virtual void sync(bool fromThread = false); virtual void render(bool fromThread = false); virtual void clear(Color3f c); virtual void save(XMLElementPtr node); virtual void load(XMLElementPtr node); }; OSG_END_NAMESPACE; #endif // VRWINDOW_H_INCLUDED
/* * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H #define AVCODEC_ALPHA_DSPUTIL_ALPHA_H #include <stdint.h> void ff_simple_idct_axp(int16_t *block); void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block); void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block); void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels, int line_size, int h); void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, int line_size); void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, int line_size); extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, int line_size); extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, int line_size); void get_pixels_mvi(int16_t *restrict block, const uint8_t *restrict pixels, int line_size); void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); #endif /* AVCODEC_ALPHA_DSPUTIL_ALPHA_H */
#include "addr_space.h" #include "phys_alloc.h" #include <oslib.h> #include <string.h> extern int _mapMem( void *phys, void *virt, int pages, int flags, struct AddrSpace *aSpace ); extern void print(const char *, ...); void dump_regs( struct Tcb *tcb ); int handle_exception( int args[5] ); void dump_regs( struct Tcb *tcb ) { print( " @ EIP: 0x" ); print(toHexString( tcb->state.eip )); print( "\nEAX: 0x" ); print(toHexString( tcb->state.eax )); print( " EBX: 0x" ); print(toHexString( tcb->state.ebx )); print( " ECX: 0x" ); print(toHexString( tcb->state.ecx )); print( " EDX: 0x" ); print(toHexString( tcb->state.edx )); print( "\nESI: 0x" ); print(toHexString( tcb->state.esi )); print( " EDI: 0x" ); print(toHexString( tcb->state.edi )); print( " ESP: 0x" ); print(toHexString( tcb->state.esp )); print( " EBP: 0x" ); print(toHexString( tcb->state.ebp )); print( " CR3: 0x" ); print(toHexString( (int)tcb->addrSpace ) ); print("\nEFLAGS: 0x"); print(toHexString( tcb->state.eflags )); } int handle_exception( int args[5] ) { struct ResourcePool *pool; struct Tcb tcb; void *addr; tid_t tid = args[1]; int intNum = args[2]; int errorCode = args[3]; dword cr2 = args[4]; pool = lookup_tid(tid); sys_read(RES_TCB, &tcb); if(intNum == 14) { /* Only accept if exception was caused by accessing a non-existant user page. Then check to make sure that the accessed page was allocated to the thread. */ if( pool && (errorCode & 0x5) == 0x4 && find_address(&pool->addrSpace, (void *)cr2)) { addr = alloc_phys_page(NORMAL, (void *)tcb.addrSpace); _mapMem( addr, (void *)(cr2 & ~0xFFF), 1, 0, &pool->addrSpace ); tcb.status = TCB_STATUS_READY; sys_update(RES_TCB, &tcb); return 0; } else if( pool && (errorCode & 0x05) && (cr2 & ~0x3FFFFF) == STACK_TABLE ) /* XXX: This can be done better. Will not work if there aren't any pages in the stack page! */ { addr = alloc_phys_page(NORMAL, (void *)tcb.addrSpace); _mapMem( addr, (void *)(cr2 & ~0xFFF), 1, 0, &pool->addrSpace ); tcb.status = TCB_STATUS_READY; sys_update(RES_TCB, &tcb); return 0; } else { if( !pool ) print("Invalid pool\n"); dump_regs( &tcb ); print("Can't find address: 0x"); print(toHexString(cr2)); print(" in addr space 0x"); print(toHexString(tcb.addrSpace)); return -1; } } else { // print("Exception!!!(Need to put the rest of data here)\n"); dump_regs( &tcb ); return -1; } }
#ifndef APPROX #define APPROX /* Structures */ struct options_s { unsigned int error_max; unsigned int cut_size; unsigned int noisy_vectors; unsigned int iterations; unsigned int remove_covered; unsigned int seed; unsigned int verbose; char *original_basis; double threshold; char majority; unsigned int bonus_covered; unsigned int penalty_overcovered; char *decomp_matrix; }; /* type definitions */ #ifndef DBP_TYPES /* to make sure that we include these just once*/ #define DBP_TYPES typedef char *vector; typedef char **matrix; typedef unsigned long int *ivector; /* to save integer vectors */ typedef unsigned long int **imatrix; /* " matrices */ #endif typedef struct options_s options; /* procedures */ int approximate(matrix Set, int size, int dim, matrix B, int k, matrix O, options *opti); void approx_help(); #endif
/* * Copyright (C) 2016-2017 Socionext Inc. * * SPDX-License-Identifier: GPL-2.0+ */ #include <linux/io.h> #include "../init.h" #include "../sc64-regs.h" void uniphier_ld11_early_clk_init(void) { u32 tmp; /* provide clocks */ tmp = readl(SC_CLKCTRL4); tmp |= SC_CLKCTRL4_PERI; writel(tmp, SC_CLKCTRL4); }
/* * Copyright 2011 Andrew Gottemoller. * * This software is a copyrighted work licensed under the terms of the * Trigger Script license. Please consult the file "TS_LICENSE" for * details. */ #ifndef _TSIDE_RUN_H_ #define _TSIDE_RUN_H_ #include <windows.h> extern int TSIDE_InitializeRun (void); extern void TSIDE_ShutdownRun (void); extern void TSIDE_SetRunData (WCHAR*, unsigned int); extern void TSIDE_SetRunControllerMode (unsigned int); extern void TSIDE_PrintVariables (void); extern void TSIDE_AbortRun (void); extern INT_PTR CALLBACK TSIDE_RunMessageProc (HWND, UINT, WPARAM, LPARAM); #endif
#ifndef EZCONTRAST_H #define EZCONTRAST_H #include "ezeffect.h" //---------------------------------------------------------------------------------------------------------------------- /// @file ezContrast.h /// @brief The class for generating the ezContrast effect /// @author Tom Hoxey /// @version 1.0 /// @date 20/3/17 Initial version //---------------------------------------------------------------------------------------------------------------------- class ezContrast : public ezEffect { public: //---------------------------------------------------------------------------------------------------------------------- /// @brief The ctor for the ezContrast class /// @param _up Whether the effect will increment or decrement, set true to increment /// @param _increment The amount to increment by //---------------------------------------------------------------------------------------------------------------------- ezContrast(int _increment); }; #endif // EZCONTRAST_H
/* LUFA Library Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2010 OBinou (obconseil [at] gmail [dot] com) 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. */ /** \file * * Header file for RelayBoard.c. */ #ifndef _RELAYBOARD_H_ #define _RELAYBOARD_H_ /* Includes: */ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> #include <avr/interrupt.h> #include "Descriptors.h" #include <LUFA/Version.h> #include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/USB/USB.h> /* Macros: */ #define RELAY1 (1 << 7) #define RELAY2 (1 << 6) #define RELAY3 (1 << 5) #define RELAY4 (1 << 4) #define ALL_RELAYS (RELAY1 | RELAY2 | RELAY3 | RELAY4) /* Function Prototypes: */ void SetupHardware(void); void EVENT_USB_Device_ControlRequest(void); #endif
/* * Copyright © 2015 Andrew Penkrat * * This file is part of Minotaur. * * Minotaur 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. * * Minotaur 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 Minotaur. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DIRECTIONENUM_H #define DIRECTIONENUM_H #include <QPoint> #include <QString> enum direction { Up, Down, Left, Right, Error }; direction getOppositeDirection(direction d); QPoint directionToPoint(direction dir); direction directionFromString(QString s); #endif // DIRECTIONENUM_H
//=========================================================================== // KERNEL TO EXTRAPOLATE SINGLE TIME STEP - CONSTANT DENSITY TIPO_EQUACAO = 0 //=========================================================================== void kernel_CPU_06_mod_3DRhoCte(float* gU0, float* gU1, float* gVorg, int nnoi, int nnoj, int k0, int k1, float FATMDFX, float FATMDFY, float FATMDFZ, float *W){ int index_X, index_Y; // X, Y grid position int stride = nnoi * nnoj; // stride to next Z int index, k; #pragma omp parallel for default(shared) private(index_X, index_Y, index, k) for(index_Y = 0; index_Y < nnoj; index_Y++) for(k = 0; k < k1 - k0; k++){ for(index_X = 0; index_X < nnoi; index_X++){ index = (index_Y * nnoi + index_X) + (k0 + k) * stride; //------------------------------------------------ // Wavefield Extrapolation Only on Interior Points //------------------------------------------------ if(gVorg[index] > 0.0f){ gU1[index] = 2.0f * gU0[index] - gU1[index] + FATMDFX * gVorg[index] * gVorg[index] * ( + W[6] * (gU0[index - 6] + gU0[index + 6]) + W[5] * (gU0[index - 5] + gU0[index + 5]) + W[4] * (gU0[index - 4] + gU0[index + 4]) + W[3] * (gU0[index - 3] + gU0[index + 3]) + W[2] * (gU0[index - 2] + gU0[index + 2]) + W[1] * (gU0[index - 1] + gU0[index + 1]) + W[0] * gU0[index] ) + FATMDFY * gVorg[index] * gVorg[index] * ( + W[6] * (gU0[index - 6 * nnoi] + gU0[index + 6 * nnoi]) + W[5] * (gU0[index - 5 * nnoi] + gU0[index + 5 * nnoi]) + W[4] * (gU0[index - 4 * nnoi] + gU0[index + 4 * nnoi]) + W[3] * (gU0[index - 3 * nnoi] + gU0[index + 3 * nnoi]) + W[2] * (gU0[index - 2 * nnoi] + gU0[index + 2 * nnoi]) + W[1] * (gU0[index - nnoi] + gU0[index + nnoi]) + W[0] * gU0[index] ) + FATMDFZ * gVorg[index] * gVorg[index] * ( + W[6] * (gU0[index + 6 * stride] + gU0[index - 6 * stride]) + W[5] * (gU0[index + 5 * stride] + gU0[index - 5 * stride]) + W[4] * (gU0[index + 4 * stride] + gU0[index - 4 * stride]) + W[3] * (gU0[index + 3 * stride] + gU0[index - 3 * stride]) + W[2] * (gU0[index + 2 * stride] + gU0[index - 2 * stride]) + W[1] * (gU0[index + stride] + gU0[index - stride]) + W[0] * gU0[index] ); } // end if } // end for index_X } } // end function
#ifndef _SCREENEFFECT_H #define _SCREENEFFECT_H #include "autogen/sprites.h" // screeneffects are a simple draw overlay used w/ things such as flashes and such. class ScreenEffect { public: ScreenEffect() { enabled = false; } virtual ~ScreenEffect() {} virtual void Draw() = 0; bool enabled; protected: int state; int timer; }; // FlashScreen simply flashes the screen white several times, // and is used in various places such as when Misery casts spells. struct SE_FlashScreen : public ScreenEffect { void Start(); void Draw(); int flashes_left; bool flashstate; }; // Starflash is a full-screen white explosion in the shape of a '+', // used when some bosses are defeated. struct SE_Starflash : public ScreenEffect { void Start(int x, int y); void Draw(); int centerx, centery; int size, speed; }; // Fade is the fade-in/out used on every stage transistion/TRA. struct SE_Fade : public ScreenEffect { SE_Fade(); void Start(int fadedir, int dir, int spr = SPR_FADE_DIAMOND); void Draw(void); void set_full(int dir); int getstate(void); struct { int fadedir; int sweepdir; int curframe; int sprite; } fade; }; #define FADE_IN 0 #define FADE_OUT 1 // these directions correspond to the FAI/FAO parameters. #define FADE_LEFT 0 #define FADE_UP 1 #define FADE_RIGHT 2 #define FADE_DOWN 3 #define FADE_CENTER 4 #define FS_NO_FADE 0 // no fade is active #define FS_FADING 1 // currently fading in or out #define FS_FADED_OUT 2 // completely faded out namespace ScreenEffects { void Draw(void); void Stop(); }; // namespace ScreenEffects extern SE_FlashScreen flashscreen; extern SE_Starflash starflash; extern SE_Fade fade; #endif
/// @author Alexander Rykovanov 2014 /// @email rykovanov.as@gmail.com /// @brief OPC UA Address space part. /// @license GNU GPL /// /// Distributed under the GNU GPL License /// (See accompanying file LICENSE or copy at /// http://www.gnu.org/licenses/gpl.html) /// #pragma once #include <boost/iterator/transform_iterator.hpp> #include <boost/archive/iterators/base64_from_binary.hpp> #include <boost/archive/iterators/transform_width.hpp> #include <boost/archive/iterators/dataflow_exception.hpp> #include <algorithm> std::string Base64Encode(const std::string& in);
/* ---------------------------------------------------------------------------- * ATMEL Microcontroller Software Support - ROUSSET - * ---------------------------------------------------------------------------- * Copyright (c) 2006, Atmel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the disclaiimer below. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the disclaimer below in the documentation and/or * other materials provided with the distribution. * * Atmel's name may not be used to endorse or promote products derived from * this software without specific prior written permission. * * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * ---------------------------------------------------------------------------- */ //------------------------------------------------------------------------------ // Headers //------------------------------------------------------------------------------ #include <config.h> #include <string.h> //------------------------------------------------------------------------------ // Exported functions //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ /// Copies data from a source buffer into a destination buffer. The two buffers /// must NOT overlap. Returns the destination buffer. /// \param pDestination Destination buffer. /// \param pSource Source buffer. /// \param num Number of bytes to copy. //------------------------------------------------------------------------------ FASTCODE void * memcpy(void *pDestination, const void *pSource, size_t num) { unsigned char *pByteDestination; unsigned char *pByteSource; unsigned int *pAlignedSource = (unsigned int *) pSource; unsigned int *pAlignedDestination = (unsigned int *) pDestination; // If num is more than 4 bytes, and both dest. and source are aligned, // then copy dwords if ((((unsigned int) pAlignedDestination & 0x3) == 0) && (((unsigned int) pAlignedSource & 0x3) == 0) && (num > 4)) { while (num > 4) { *pAlignedDestination++ = *pAlignedSource++; num -= 4; } } // Copy remaining bytes pByteDestination = (unsigned char *) pAlignedDestination; pByteSource = (unsigned char *) pAlignedSource; while (num--) { *pByteDestination++ = *pByteSource++; } return pDestination; } //------------------------------------------------------------------------------ /// Fills a memory region with the given value. Returns a pointer to the /// memory region. /// \param ptr Pointer to the start of the memory region to fill. /// \param value Value to fill the region with. /// \param num Size to fill in bytes. //------------------------------------------------------------------------------ FASTCODE void * memset(void *ptr, int value, size_t num) { unsigned char *pByteDestination; unsigned int *pAlignedDestination = (unsigned int *) ptr; unsigned int alignedValue = (value << 24) | (value << 16) | (value << 8) | value; // Set words if possible if ((((unsigned int) pAlignedDestination & 0x3) == 0) && (num > 4)) { while (num > 4) { *pAlignedDestination++ = alignedValue; num -= 4; } } // Set remaining bytes pByteDestination = (unsigned char *) pAlignedDestination; while (num--) { *pByteDestination++ = value; } return ptr; }
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QMAKEEVALUATOR_P_H #define QMAKEEVALUATOR_P_H #include "proitems.h" #include <qregexp.h> #define debugMsg if (!m_debugLevel) {} else debugMsgInternal #define traceMsg if (!m_debugLevel) {} else traceMsgInternal #ifdef PROEVALUATOR_DEBUG # define dbgBool(b) (b ? "true" : "false") # define dbgReturn(r) \ (r == ReturnError ? "error" : \ r == ReturnBreak ? "break" : \ r == ReturnNext ? "next" : \ r == ReturnReturn ? "return" : \ "<invalid>") # define dbgKey(s) qPrintable(s.toString().toQString()) # define dbgStr(s) qPrintable(formatValue(s, true)) # define dbgStrList(s) qPrintable(formatValueList(s)) # define dbgSepStrList(s) qPrintable(formatValueList(s, true)) # define dbgStrListList(s) qPrintable(formatValueListList(s)) # define dbgQStr(s) dbgStr(ProString(s)) #else # define dbgBool(b) 0 # define dbgReturn(r) 0 # define dbgKey(s) 0 # define dbgStr(s) 0 # define dbgStrList(s) 0 # define dbgSepStrList(s) 0 # define dbgStrListList(s) 0 # define dbgQStr(s) 0 #endif QT_BEGIN_NAMESPACE namespace QMakeInternal { struct QMakeStatics { QString field_sep; QString strtrue; QString strfalse; ProKey strCONFIG; ProKey strARGS; ProKey strARGC; QString strDot; QString strDotDot; QString strever; QString strforever; QString strhost_build; ProKey strTEMPLATE; ProKey strQMAKE_PLATFORM; ProKey strQMAKE_DIR_SEP; ProKey strQMAKESPEC; #ifdef PROEVALUATOR_FULL ProKey strREQUIRES; #endif QHash<ProKey, int> expands; QHash<ProKey, int> functions; QHash<ProKey, ProKey> varMap; ProStringList fakeValue; }; extern QMakeStatics statics; } QT_END_NAMESPACE #endif // QMAKEEVALUATOR_P_H
/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2017 Victor Perez * * 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/>. * */ /** * Fast I/O interfaces for STM32F4 * These use GPIO functions instead of Direct Port Manipulation, as on AVR. */ #ifndef _FASTIO_STM32F4_H #define _FASTIO_STM32F4_H #define _BV(b) (1 << (b)) #define READ(IO) digitalRead(IO) #define WRITE(IO, v) digitalWrite(IO,v) #define TOGGLE(IO) do{ _SET_OUTPUT(IO); digitalWrite(IO,!digitalRead(IO)); }while(0) #define WRITE_VAR(IO, v) digitalWrite(IO,v) #define _GET_MODE(IO) #define _SET_MODE(IO,M) pinMode(IO, M) #define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */ #define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */ #define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */ #define SET_INPUT_PULLDOW(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */ #define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); WRITE(IO, LOW); }while(0) #define GET_INPUT(IO) #define GET_OUTPUT(IO) #define GET_TIMER(IO) #define OUT_WRITE(IO, v) { _SET_OUTPUT(IO); WRITE(IO, v); } #endif // _FASTIO_STM32F4_H
/* CorePlayer.h * Copyright (C) 1998-2002 Andy Lo A Foe <andy@loafoe.com> * * This file is part of AlsaPlayer. * * AlsaPlayer 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. * * AlsaPlayer 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 __CorePlayer_h__ #define __CorePlayer_h__ #include <stdio.h> #include <pthread.h> #include <semaphore.h> #include <set> #include "SampleBuffer.h" #include "AlsaNode.h" #include "AlsaSubscriber.h" #include "input_plugin.h" #ifdef __linux__ #include <linux/limits.h> #endif // __linux__ // Tunable parameters #define BUF_SIZE (10240) // Size of a single ringbuffer partition #define NR_BUF 16 // Number of partitions in ringbuffer #define NR_CBUF 8 // Number of partitions to read ahead // (equals 2.6 seconds). NOTE: NR_CBUF // should NEVER exceed (NR_BUF/2), it doesn't // make sense otherwise #define MAX_INPUT_PLUGINS 16 typedef void(*volume_changed_type)(void *, float new_vol); typedef void(*speed_changed_type)(void *, float new_speed); typedef void(*pan_changed_type)(void *, float new_pan); typedef void(*position_notify_type)(void *, int pos); typedef void(*stop_notify_type)(void *); typedef void(*start_notify_type)(void *); typedef struct _coreplayer_notifier { void *data; volume_changed_type volume_changed; speed_changed_type speed_changed; pan_changed_type pan_changed; position_notify_type position_notify; start_notify_type start_notify; stop_notify_type stop_notify; } coreplayer_notifier; typedef struct _sample_buf { int start; _sample_buf *next, *prev; SampleBuffer *buf; } sample_buf; class CorePlayer // Much more abstraction to come, well maybe not { private: int total_blocks; int write_buf_changed; int read_direction; int blocks_in_buffer; int jump_point; int last_read; bool streaming; int repitched; int new_block_number; float pitch_point; float pitch; float pitch_multi; float real_pitch; bool jumped; bool producing; float volume; float pan; int output_rate; int input_rate; AlsaNode *node; AlsaSubscriber *sub; float save_speed; std::set<coreplayer_notifier *> notifiers; // INPUT plugin stuff input_object *the_object; input_plugin *plugin; // Pointer to the current plugin pthread_t producer_thread; pthread_mutex_t player_mutex; pthread_mutex_t counter_mutex; pthread_cond_t producer_ready; pthread_mutex_t thread_mutex; pthread_mutex_t notifier_mutex; #if !defined(EMBEDDED) // this buffer is used to apply volume/pan and mixing channels char *input_buffer; #endif sample_buf *buffer; sample_buf *read_buf, *write_buf, *new_write_buf; int BlockSeek(int); int FilledBuffers(); void ResetBuffer(); void SetSpeedMulti(float multi) { pitch_multi = multi; } void update_pitch(); void kill_producer(); static void producer_func(void *data); static bool streamer_func(void *, void *, int); int pcm_worker(sample_buf *dest, int start); int Read32(void *, int); int SetDirection(int dir); int GetDirection() { return read_direction; } void load_input_addons(); void unregister_plugins(); void UnregisterPlugins(); void Lock(); void Unlock(); void LockNotifiers(); void UnlockNotifiers(); int RegisterPlugin(input_plugin *the_plugin); public: // Static members static int plugins_loaded; static int plugin_count; static pthread_mutex_t plugins_mutex; static input_plugin plugins[MAX_INPUT_PLUGINS]; CorePlayer(AlsaNode *node=(AlsaNode *)NULL); ~CorePlayer(); void RegisterNotifier(coreplayer_notifier *, void *data); void UnRegisterNotifier(coreplayer_notifier *); AlsaNode *GetNode() { return node; } int GetPosition(); // Current position in blocks void PositionUpdate(); // Notify the interfaces about the position int SetSpeed(float val); // Set the playback speed: 1.0 = 100% float GetSpeed(); // Get speed float GetVolume() { return volume; } // Get Volume level void SetVolume(float vol); // Set volume level float GetPan() { return pan; } // Get Pan level void SetPan(float p); // Set Pan level: // 0.0 = center // -1.0 = right channel muted // 1.0 = left channel muted int GetCurrentTime(int block=-1); // Returns the time position of block in // hundreths of seconds int GetStreamInfo(stream_info *info); // Return stream info int GetBlocks(); // Total number of blocks int GetTracks(); // Total number of tracks int GetSampleRate(); // Samplerat of this player int GetChannels(); // Number of channels int GetBlockSize(); // Block size in bytes input_plugin * GetPlayer(const char *); // This one is temporary int GetLatency() { if (node) return node->GetLatency(); else return 0; } bool Open(const char *path = (const char *)NULL); void Close(); bool Start(); void Stop(); int Seek(int pos); bool CanSeek(); void Pause (); void UnPause (); bool IsPaused (); int IsActive() { return streaming; } int IsPlaying() { return producing; } }; #endif
//Centralized_Moments.h. #pragma once #include <list> #include <functional> #include <limits> #include <map> #include <cmath> #include <any> #include "YgorMisc.h" #include "YgorMath.h" #include "YgorImages.h" bool ComputeCentralizedMoments(planar_image_collection<float,double>::images_list_it_t first_img_it, std::list<planar_image_collection<float,double>::images_list_it_t> selected_img_its, std::list<std::reference_wrapper<planar_image_collection<float,double>>>, std::list<std::reference_wrapper<contour_collection<double>>> ccsl, std::any); void DumpCentralizedMoments(std::map<std::string,std::string> InvocationMetadata);
// // EMultiPeerPresenter.h // PIXY // // Created by gao feng on 16/4/26. // Copyright © 2016年 music4kid. All rights reserved. // #import "CDDContext.h" #import "IMultiPeerPresenter.h" #import "EPresenter.h" @interface EMultiPeerPresenter : EPresenter <IMultiPeerPresenter> @end
/* * Platformer Game Engine by Wohlstand, a free platform for game making * Copyright (c) 2014-2019 Vitaly Novichkov <admin@wohlnet.ru> * * 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 * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <QPixmap> #include <QPainter> #include <QImage> #ifndef GRAPHICS_FUNCS_H #define GRAPHICS_FUNCS_H struct FIBITMAP; class GraphicsHelps { public: static FIBITMAP *loadImage(QString file, bool convertTo32bit); static void mergeWithMask(FIBITMAP *image, QString pathToMask, QPixmap *maskFallback = nullptr); static QPixmap mergeToRGBA(QPixmap image, QImage mask); static void mergeToRGBA_BitWise(QImage &image, QImage mask); static void mergeToRGBA(QPixmap &img, QImage &mask, QString path, QString maskpath); static void getMaskFromRGBA(const QPixmap &srcimage, QImage &mask); static void getMaskFromRGBA(const QPixmap &srcimage, FIBITMAP *&mask); static void loadMaskedImage(QString rootDir, QString in_imgName, QString &out_maskName, QPixmap &out_Img, QImage &out_Mask, QString &out_errStr); static void loadMaskedImage(QString rootDir, QString in_imgName, QString &out_maskName, QPixmap &out_Img, QString &out_errStr); static QPixmap loadPixmap(QString file); static QImage loadQImage(QString file); static void loadQImage(QImage &target, QString file, QString maskPath = "", QPixmap *fallbackMask = nullptr); /*! * \brief Resizes image to requested size with keeping aspect ration, but with making convas of requested size as-is (empty space will be filled with transparency) * \param imageInOut Image to scale * \param targetSize Image size to process */ static void squareImageR(QPixmap &imageInOut, QSize targetSize); /*! * \brief Converts number into image where that number has been drawn * \param number Target number to draw * \return Image with drawn number value */ static QPixmap drawDegitFont(int number); }; #endif // GRAPHICS_FUNCS_H
#ifndef HIGHLIGHTER_H #define HIGHLIGHTER_H #include <QSyntaxHighlighter> #include <QHash> #include <QTextCharFormat> class QTextDocument; class Highlighter : public QSyntaxHighlighter { Q_OBJECT public: Highlighter(QTextDocument *parent = 0); protected: void highlightBlock(const QString &text); private: struct HighlightingRule { QRegExp pattern; QTextCharFormat format; }; QVector<HighlightingRule> highlightingRules; QRegExp commentStartExpression; QRegExp commentEndExpression; QTextCharFormat varTypes; QTextCharFormat modifier; QTextCharFormat precompiler; QTextCharFormat statement; QTextCharFormat anotherKeys; QTextCharFormat singleLineCommentFormat; QTextCharFormat multiLineCommentFormat; QTextCharFormat quotationFormat; QTextCharFormat globalConstant; QTextCharFormat globalVarFormat; QTextCharFormat globalFunctionFormat; }; #endif
#ifndef __MOKOSUITE_PIM_PIM_H #define __MOKOSUITE_PIM_PIM_H void mokosuite_pim_init(void); #endif /* __MOKOSUITE_PIM_PIM_H */
//Copyright 2013-2015 Ilija Tovilo // //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. #import <Cocoa/Cocoa.h> #import <QuartzCore/QuartzCore.h> // // !!!IMPORTANT!!! - Embedd ITProgressIndicator in a layer-backed view to avoid side-effects! // /** * @class ITProgressIndicator * * A replacement for `NSProgressIndicator`. * It's a highly customizable control, driven by Core Animation, which makes it much more performant. * * So basically, it's awesome. * */ @interface ITProgressIndicator : NSView #pragma mark - Methods /** * Override this method to achieve a custom animation * * @return CAKeyframeAnimation - animation which will be put on the progress indicator layer */ - (CAKeyframeAnimation *)keyFrameAnimationForCurrentPreferences; #pragma mark - Properties /// @property isIndeterminate - Indicates if the view will show the progress, or just spin @property (nonatomic, setter = setIndeterminate:) BOOL isIndeterminate; /// @property progress - The amount that should be shown when `isIndeterminate` is set to `YES` @property (nonatomic) CGFloat progress; /// @property animates - Indicates if the view is animating @property (nonatomic) BOOL animates; /// @property hideWhenStopped - Indicates if the view will be hidden if it's stopped @property (nonatomic) BOOL hideWhenStopped; /// @property lengthOfLine - The length of a single line @property (nonatomic) CGFloat lengthOfLine; /// @property widthOfLine - The width of a single line @property (nonatomic) CGFloat widthOfLine; /// @property numberOfLines - The number of lines of the indicator @property (nonatomic) NSUInteger numberOfLines; /// @property innerMargin - The distance of the lines from the middle @property (nonatomic) CGFloat innerMargin; /// @property animationDuration - Duration of a single rotation @property (nonatomic) CGFloat animationDuration; /// @property gradualAnimation - Defines if the animation is smooth or gradual @property (nonatomic) BOOL steppedAnimation; /// @property color - The color of the progress indicator @property (nonatomic, strong) NSColor *color; @end
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2011-2013 Sandia National Laboratories. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ #ifndef OSC_PORTALS4_REQUEST_H #define OSC_PORTALS4_REQUEST_H #include "ompi/request/request.h" struct ompi_osc_portals4_request_t { ompi_request_t super; int32_t ops_expected; volatile int32_t ops_committed; }; typedef struct ompi_osc_portals4_request_t ompi_osc_portals4_request_t; OBJ_CLASS_DECLARATION(ompi_osc_portals4_request_t); #define OMPI_OSC_PORTALS4_REQUEST_ALLOC(win, req) \ do { \ opal_free_list_item_t *item; \ item = opal_free_list_wait(&mca_osc_portals4_component.requests); \ req = (ompi_osc_portals4_request_t*) item; \ OMPI_REQUEST_INIT(&req->super, false); \ req->super.req_mpi_object.win = win; \ req->super.req_complete = false; \ req->super.req_state = OMPI_REQUEST_ACTIVE; \ req->super.req_status.MPI_ERROR = MPI_SUCCESS; \ req->ops_expected = 0; \ req->ops_committed = 0; \ } while (0) #define OMPI_OSC_PORTALS4_REQUEST_RETURN(req) \ do { \ OMPI_REQUEST_FINI(&request->super); \ opal_free_list_return (&mca_osc_portals4_component.requests, \ (opal_free_list_item_t*) req); \ } while (0) #endif
/* This file is part of Darling. Copyright (C) 2019 Lubos Dolezel Darling 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. Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface CKPrettyError : NSObject @end
/** ****************************************************************************** * @file i2c.h * @author YANDLD * @version V2.5 * @date 2014.3.26 * @brief www.beyondcore.net http://upcmcu.taobao.com * @note 此文件为芯片IIC模块的底层功能函数 ****************************************************************************** */ #ifndef __CH_LIB_I2C_H__ #define __CH_LIB_I2C_H__ #ifdef __cplusplus extern "C" { #endif #include <stdint.h> /** * \struct I2C_InitTypeDef * \brief I2C初始化结构 */ typedef struct { uint32_t instance; ///< I2C pin select uint32_t baudrate; ///< baudrate some common baudrate: 48000Hz 76000Hz 96000Hz 376000Hz }I2C_InitTypeDef; /** * \struct i2c_gpio * \brief i2c sda and scl */ typedef struct { uint32_t instace; ///< I2C 模块号 uint32_t sda_pin; ///< I2C 数据线 uint32_t scl_pin; ///< I2C 时钟线 }i2c_gpio; /* I2C模块号 */ #define HW_I2C0 (0x00U) /* I2C模块0,以下依次类推 */ #define HW_I2C1 (0x01U) #define HW_I2C2 (0x02U) /* I2C QuickInit macro */ #define I2C1_SCL_PE01_SDA_PE00 (0X000081A1U) #define I2C0_SCL_PE19_SDA_PE18 (0X0000A520U) #define I2C0_SCL_PF22_SDA_PF23 (0X0000ACA8U) #define I2C0_SCL_PB00_SDA_PB01 (0X00008088U) #define I2C0_SCL_PB02_SDA_PB03 (0X00008488U) #define I2C1_SCL_PC10_SDA_PC11 (0X00009491U) #define I2C0_SCL_PD08_SDA_PD09 (0X00009098U) #define I2C0_SCL_PE24_SDA_PE25 (0X0000B160U) #define I2C1_SCL_PC01_SDA_PC02 (0X00008291U) #define I2Cx_SCL_PC14_SDA_PC15 (0X00009C50U) /** * \enum I2C_Direction_Type * \brief I2C 读写设置 */ typedef enum { kI2C_Read, /**< I2C Master Read Data */ kI2C_Write, /**< I2C Master Write Data */ kI2C_DirectionNameCount, }I2C_Direction_Type; /** * \enum I2C_ITDMAConfig_Type * \brief I2C 中断DMA配置 */ typedef enum { kI2C_IT_Disable, /**< Disable Interrupt */ kI2C_DMA_Disable, /**< Disable DMA */ kI2C_IT_BTC, /**< Byte Transfer Complete Interrupt */ kI2C_DMA_BTC, /**< DMA Trigger On Byte Transfer Complete */ }I2C_ITDMAConfig_Type; /* I2C CallBack Type */ typedef void (*I2C_CallBackType)(void); uint8_t I2C_QuickInit(uint32_t MAP, uint32_t baudrate); int I2C_BurstWrite(uint32_t instance ,uint8_t chipAddr, uint32_t addr, uint32_t addrLen, uint8_t *buf, uint32_t len); int I2C_WriteSingleRegister(uint32_t instance, uint8_t chipAddr, uint8_t addr, uint8_t data); int I2C_BurstRead(uint32_t instance ,uint8_t chipAddr, uint32_t addr, uint32_t addrLen, uint8_t *buf, uint32_t len); int I2C_ReadSingleRegister(uint32_t instance, uint8_t chipAddr, uint8_t addr, uint8_t *data); int SCCB_ReadSingleRegister(uint32_t instance, uint8_t chipAddr, uint8_t addr, uint8_t* data); int SCCB_WriteSingleRegister(uint32_t instance, uint8_t chipAddr, uint8_t addr, uint8_t data); /* test function */ int I2C_Probe(uint32_t instance, uint8_t chipAddr); void I2C_Scan(uint32_t MAP); extern uint8_t I2C_WaitAck(void); extern void I2C_Stop(void); extern uint8_t I2C_Start(void); extern void I2C_SendByte(uint8_t data); #ifdef __cplusplus } #endif #endif
unsigned int fft_hard_float[] = { 0xa8000042, 0xa8000003, 0xa8000024, 0xa0000005, 0xa1000006, 0x100014c1, 0x31007c84, 0x11000405, 0x200010a5, 0x11fffca6, 0x30001826, 0x28001021, 0x510004a1, 0x21000421, 0x10001821, 0x10001425, 0x21000ca5, 0x21000c21, 0x10000467, 0x10001463, 0xa2000005, 0x280010a1, 0x51001821, 0x21000c21, 0x10000441, 0x11001062, 0x74000804, 0x110010e5, 0x74001406, 0x74000c08, 0x74000409, 0x11001021, 0x74000401, 0xc100050a, 0xc000194b, 0xc100248c, 0xc0002d8b, 0x74001c0d, 0x7c00140b, 0xc1000481, 0xc1002504, 0xc0003485, 0xc80004a5, 0x7c001c05, 0xc80028c5, 0xc80030a5, 0x7c000805, 0xc80011a2, 0xc0000821, 0x7c000c01, 0x92000000 }; unsigned *code_hard_float = fft_hard_float;
/* xoreos - A reimplementation of BioWare's Aurora engine * * xoreos is the legal property of its developers, whose names * can be found in the AUTHORS file distributed with this source * distribution. * * xoreos 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. * * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>. */ /** @file * A placeable object in a Sonic Chronicles: The Dark Brotherhood area. */ #ifndef ENGINES_SONIC_PLACEABLE_H #define ENGINES_SONIC_PLACEABLE_H #include "src/common/scopedptr.h" #include "src/common/changeid.h" #include "src/aurora/types.h" #include "src/graphics/aurora/types.h" #include "src/engines/sonic/object.h" namespace Engines { namespace Sonic { class Placeable : public Object { public: /** Load from a placeable instance. */ Placeable(const Aurora::GFF4Struct &placeable); ~Placeable(); // Basic visuals void show(); ///< Show the placeable's model. void hide(); ///< Hide the placeable's model. // Object/Cursor interactions void enter(); ///< The cursor entered the placeable. void leave(); ///< The cursor left the placeable. /** (Un)Highlight the placeable. */ void highlight(bool enabled); // Positioning /** Set the placeable's position within its area. */ virtual void setPosition(float x, float y, float z); /** Set the placeable's orientation. */ virtual void setOrientation(float x, float y, float z, float angle); protected: /** The resource change created by indexing the model's texture. */ Common::ChangeID _modelTexture; /** The placeable's model. */ Common::ScopedPtr<Graphics::Aurora::Model> _model; uint32 _placeableID; ///< The placeable's identifer from GFF. uint32 _typeID; ///< The placeable's type. uint32 _appearanceID; ///< The placeable's appearance. /** The name of the model representing this placeable. */ Common::UString _modelName; /** The scale modifying this placeable's model. */ float _scale; /** Load from a placeable instance. */ void load(const Aurora::GFF4Struct &placeable); }; } // End of namespace Sonic } // End of namespace Engines #endif // ENGINES_SONIC_PLACEABLE_H
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #include <stdbool.h> #include <stdint.h> #include <string.h> #include "platform.h" #include "drivers/accgyro/accgyro_mpu.h" #include "drivers/exti.h" #include "drivers/nvic.h" #include "drivers/system.h" #include "drivers/exti.h" #define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000) void SetSysClock(void); void systemReset(void) { if (mpuResetFn) { mpuResetFn(); } __disable_irq(); NVIC_SystemReset(); } void systemResetToBootloader(void) { if (mpuResetFn) { mpuResetFn(); } *((uint32_t *)0x2001FFFC) = 0xDEADBEEF; // 128KB SRAM STM32F4XX __disable_irq(); NVIC_SystemReset(); } void enableGPIOPowerUsageAndNoiseReductions(void) { RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE | #ifdef STM32F40_41xxx RCC_AHB1Periph_GPIOF | RCC_AHB1Periph_GPIOG | RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_GPIOI | #endif RCC_AHB1Periph_CRC | RCC_AHB1Periph_FLITF | RCC_AHB1Periph_SRAM1 | RCC_AHB1Periph_SRAM2 | RCC_AHB1Periph_BKPSRAM | RCC_AHB1Periph_DMA1 | RCC_AHB1Periph_DMA2 | 0, ENABLE ); RCC_AHB2PeriphClockCmd(0, ENABLE); #ifdef STM32F40_41xxx RCC_AHB3PeriphClockCmd(0, ENABLE); #endif RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM2 | RCC_APB1Periph_TIM3 | RCC_APB1Periph_TIM4 | RCC_APB1Periph_TIM5 | RCC_APB1Periph_TIM6 | RCC_APB1Periph_TIM7 | RCC_APB1Periph_TIM12 | RCC_APB1Periph_TIM13 | RCC_APB1Periph_TIM14 | RCC_APB1Periph_WWDG | RCC_APB1Periph_SPI2 | RCC_APB1Periph_SPI3 | RCC_APB1Periph_USART2 | RCC_APB1Periph_USART3 | RCC_APB1Periph_UART4 | RCC_APB1Periph_UART5 | RCC_APB1Periph_I2C1 | RCC_APB1Periph_I2C2 | RCC_APB1Periph_I2C3 | RCC_APB1Periph_CAN1 | RCC_APB1Periph_CAN2 | RCC_APB1Periph_PWR | RCC_APB1Periph_DAC | 0, ENABLE); RCC_APB2PeriphClockCmd( RCC_APB2Periph_TIM1 | RCC_APB2Periph_TIM8 | RCC_APB2Periph_USART1 | RCC_APB2Periph_USART6 | RCC_APB2Periph_ADC | RCC_APB2Periph_ADC1 | RCC_APB2Periph_ADC2 | RCC_APB2Periph_ADC3 | RCC_APB2Periph_SDIO | RCC_APB2Periph_SPI1 | RCC_APB2Periph_SYSCFG | RCC_APB2Periph_TIM9 | RCC_APB2Periph_TIM10 | RCC_APB2Periph_TIM11 | 0, ENABLE); GPIO_InitTypeDef GPIO_InitStructure; GPIO_StructInit(&GPIO_InitStructure); GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; // default is un-pulled input GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_InitStructure.GPIO_Pin &= ~(GPIO_Pin_11 | GPIO_Pin_12); // leave USB D+/D- alone GPIO_InitStructure.GPIO_Pin &= ~(GPIO_Pin_13 | GPIO_Pin_14); // leave JTAG pins alone GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_Init(GPIOD, &GPIO_InitStructure); GPIO_Init(GPIOE, &GPIO_InitStructure); #ifdef STM32F40_41xxx GPIO_Init(GPIOF, &GPIO_InitStructure); GPIO_Init(GPIOG, &GPIO_InitStructure); GPIO_Init(GPIOH, &GPIO_InitStructure); GPIO_Init(GPIOI, &GPIO_InitStructure); #endif } bool isMPUSoftReset(void) { if (RCC->CSR & RCC_CSR_SFTRSTF) return true; else return false; } void systemInit(void) { SetSysClock(); // Configure NVIC preempt/priority groups NVIC_PriorityGroupConfig(NVIC_PRIORITY_GROUPING); // cache RCC->CSR value to use it in isMPUSoftreset() and others cachedRccCsrValue = RCC->CSR; /* Accounts for OP Bootloader, set the Vector Table base address as specified in .ld file */ extern void *isr_vector_table_base; NVIC_SetVectorTable((uint32_t)&isr_vector_table_base, 0x0); RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_OTG_FS, DISABLE); RCC_ClearFlag(); enableGPIOPowerUsageAndNoiseReductions(); // Init cycle counter cycleCounterInit(); memset(extiHandlerConfigs, 0x00, sizeof(extiHandlerConfigs)); // SysTick SysTick_Config(SystemCoreClock / 1000); }
#define _GNU_SOURCE #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <error.h> #include<sys/types.h> #include<sys/syscall.h> #include <fcntl.h> void *thread_fun(void *arg) { pthread_attr_t attr; struct sched_param prio; int status; int policy; prio.sched_priority = 60; status = pthread_attr_init(&attr); if(status != 0) printf("pthread_attr_init() failed\n"); status = pthread_setschedparam(pthread_self(), SCHED_RR, &prio); if(status != 0) printf("pthread_setschedparam() failed\n"); status = pthread_getschedparam(pthread_self(), &policy, &prio); if(status != 0) printf("pthread_getschedparam() failed\n"); /* status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if(status != 0) printf("pthread_attr_setdetachstate() failed\n"); status = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); if(status != 0) printf("pthread_attr_setinheritsched() failed\n"); status = pthread_getattr_np(pthread_self(), &attr); if(status != 0) printf("pthread_getattr_np() failed\n"); */ printf ("Scheduling policy no. --> %d\n", policy); if(policy == SCHED_RR) printf ("Scheduling policy name --> %s\n", "SCHED_FIFO"); printf("priority %d\n",prio.sched_priority); ioctl((int *)arg, syscall(SYS_gettid), 0000); return NULL; } int main (void) { int fd; int pid; int status; pthread_t th_id; fd = open("/dev/myChar", O_RDWR); if (fd < 0) perror("Unable to open the Device"); else printf("File Opened Successfully %d\n", fd); /* status = pthread_attr_init(&attr); if(status != 0) printf("pthread_attr_init() failed\n"); status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if(status != 0) printf("pthread_attr_setdetachstate() failed\n"); status = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); if(status != 0) printf("pthread_attr_setinheritsched() failed\n"); status = pthread_setschedparam(pthread_self(), SCHED_RR, &prio); if(status != 0) printf("pthread_setschedparam() failed\n"); */ status = pthread_create(&th_id, NULL, thread_fun, fd); if(status != 0) printf("pthread_create() failed\n"); pthread_exit(NULL); return 0; }
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BASICWIDGETS_H #define BASICWIDGETS_H #include <qdeclarative.h> #include <QGraphicsScene> #include <QGraphicsView> #include <QLabel> #include <QPushButton> #include <QToolButton> #include <QCheckBox> #include <QRadioButton> #include <QLineEdit> #include <QTextEdit> #include <QPlainTextEdit> #include <QDoubleSpinBox> #include <QSlider> #include <QDateEdit> #include <QTimeEdit> #include <QProgressBar> #include <QGroupBox> #include <QDial> #include <QLCDNumber> #include <QFontComboBox> #include <QScrollBar> #include <QCalendarWidget> #include <QTabWidget> #include <QMenu> #include <QAction> #include "filewidget.h" #include "layoutwidget.h" QML_DECLARE_TYPE(QWidget) //display QML_DECLARE_TYPE(QLabel) QML_DECLARE_TYPE(QProgressBar) QML_DECLARE_TYPE(QLCDNumber) //input QML_DECLARE_TYPE(QLineEdit) QML_DECLARE_TYPE(QTextEdit) QML_DECLARE_TYPE(QPlainTextEdit) QML_DECLARE_TYPE(QSpinBox) QML_DECLARE_TYPE(QDoubleSpinBox) QML_DECLARE_TYPE(QSlider) QML_DECLARE_TYPE(QDateTimeEdit) QML_DECLARE_TYPE(QDateEdit) QML_DECLARE_TYPE(QTimeEdit) QML_DECLARE_TYPE(QFontComboBox) QML_DECLARE_TYPE(QDial) QML_DECLARE_TYPE(QScrollBar) QML_DECLARE_TYPE(QCalendarWidget) QML_DECLARE_TYPE(QComboBox) //buttons QML_DECLARE_TYPE(QPushButton) QML_DECLARE_TYPE(QToolButton) QML_DECLARE_TYPE(QCheckBox) QML_DECLARE_TYPE(QRadioButton) //containers QML_DECLARE_TYPE(QGroupBox) QML_DECLARE_TYPE(QFrame) QML_DECLARE_TYPE(QScrollArea) QML_DECLARE_TYPE(QTabWidget) QML_DECLARE_TYPE(FileWidget) QML_DECLARE_TYPE(LayoutWidget) class Action : public QAction { Q_OBJECT public: Action(QObject *parent = 0) : QAction(parent) {} }; QML_DECLARE_TYPE(QMenu) QML_DECLARE_TYPE(Action) //QML_DECLARE_TYPE(QToolBox) //itemviews //QML_DECLARE_TYPE(QListView) //QML_DECLARE_TYPE(QTreeView) //QML_DECLARE_TYPE(QTableView) //top-level windows? class BasicWidgets { public: static void registerDeclarativeTypes(); }; #endif // BASICWIDGETS_H
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1995, 1996, 1997, 2000, 2001, 05 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc. */ #include <linux/capability.h> #include <linux/errno.h> #include <linux/linkage.h> #include <linux/fs.h> #include <linux/smp.h> #include <linux/ptrace.h> #include <linux/string.h> #include <linux/syscalls.h> #include <linux/file.h> #include <linux/utsname.h> #include <linux/unistd.h> #include <linux/sem.h> #include <linux/msg.h> #include <linux/shm.h> #include <linux/compiler.h> #include <linux/ipc.h> #include <linux/uaccess.h> #include <linux/slab.h> #include <linux/elf.h> #include <asm/asm.h> #include <asm/branch.h> #include <asm/cachectl.h> #include <asm/cacheflush.h> #include <asm/asm-offsets.h> #include <asm/signal.h> #include <asm/sim.h> #include <asm/shmparam.h> #include <asm/sysmips.h> #include <asm/uaccess.h> #include <asm/switch_to.h> /* * For historic reasons the pipe(2) syscall on MIPS has an unusual calling * convention. It returns results in registers $v0 / $v1 which means there * is no need for it to do verify the validity of a userspace pointer * argument. Historically that used to be expensive in Linux. These days * the performance advantage is negligible. */ asmlinkage int sysm_pipe(void) { int fd[2]; int error = do_pipe_flags(fd, 0); if (error) { return error; } current_pt_regs()->regs[3] = fd[1]; return fd[0]; } SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, off_t, offset) { unsigned long result; result = -EINVAL; if (offset & ~PAGE_MASK) { goto out; } result = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); out: return result; } SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, unsigned long, pgoff) { if (pgoff & (~PAGE_MASK >> 12)) { return -EINVAL; } return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> (PAGE_SHIFT - 12)); } save_static_function(sys_fork); save_static_function(sys_clone); SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) { struct thread_info *ti = task_thread_info(current); ti->tp_value = addr; if (cpu_has_userlocal) { write_c0_userlocal(addr); } return 0; } static inline int mips_atomic_set(unsigned long addr, unsigned long new) { unsigned long old, tmp; struct pt_regs *regs; unsigned int err; if (unlikely(addr & 3)) { return -EINVAL; } if (unlikely(!access_ok(VERIFY_WRITE, addr, 4))) { return -EINVAL; } if (cpu_has_llsc && R10000_LLSC_WAR) { __asm__ __volatile__ ( " .set arch=r4000 \n" " li %[err], 0 \n" "1: ll %[old], (%[addr]) \n" " move %[tmp], %[new] \n" "2: sc %[tmp], (%[addr]) \n" " beqzl %[tmp], 1b \n" "3: \n" " .insn \n" " .section .fixup,\"ax\" \n" "4: li %[err], %[efault] \n" " j 3b \n" " .previous \n" " .section __ex_table,\"a\" \n" " "STR(PTR)" 1b, 4b \n" " "STR(PTR)" 2b, 4b \n" " .previous \n" " .set mips0 \n" : [old] "=&r" (old), [err] "=&r" (err), [tmp] "=&r" (tmp) : [addr] "r" (addr), [new] "r" (new), [efault] "i" (-EFAULT) : "memory"); } else if (cpu_has_llsc) { __asm__ __volatile__ ( " .set "MIPS_ISA_ARCH_LEVEL" \n" " li %[err], 0 \n" "1: ll %[old], (%[addr]) \n" " move %[tmp], %[new] \n" "2: sc %[tmp], (%[addr]) \n" " bnez %[tmp], 4f \n" "3: \n" " .insn \n" " .subsection 2 \n" "4: b 1b \n" " .previous \n" " \n" " .section .fixup,\"ax\" \n" "5: li %[err], %[efault] \n" " j 3b \n" " .previous \n" " .section __ex_table,\"a\" \n" " "STR(PTR)" 1b, 5b \n" " "STR(PTR)" 2b, 5b \n" " .previous \n" " .set mips0 \n" : [old] "=&r" (old), [err] "=&r" (err), [tmp] "=&r" (tmp) : [addr] "r" (addr), [new] "r" (new), [efault] "i" (-EFAULT) : "memory"); } else { do { preempt_disable(); ll_bit = 1; ll_task = current; preempt_enable(); err = __get_user(old, (unsigned int *) addr); err |= __put_user(new, (unsigned int *) addr); if (err) { break; } rmb(); } while (!ll_bit); } if (unlikely(err)) { return err; } regs = current_pt_regs(); regs->regs[2] = old; regs->regs[7] = 0; /* No error */ /* * Don't let your children do this ... */ __asm__ __volatile__( " move $29, %0 \n" " j syscall_exit \n" : /* no outputs */ : "r" (regs)); /* unreached. Honestly. */ unreachable(); } SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2) { switch (cmd) { case MIPS_ATOMIC_SET: return mips_atomic_set(arg1, arg2); case MIPS_FIXADE: if (arg1 & ~3) { return -EINVAL; } if (arg1 & 1) { set_thread_flag(TIF_FIXADE); } else { clear_thread_flag(TIF_FIXADE); } if (arg1 & 2) { set_thread_flag(TIF_LOGADE); } else { clear_thread_flag(TIF_LOGADE); } return 0; case FLUSH_CACHE: __flush_cache_all(); return 0; } return -EINVAL; } /* * No implemented yet ... */ SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op) { return -ENOSYS; } /* * If we ever come here the user sp is bad. Zap the process right away. * Due to the bad stack signaling wouldn't work. */ asmlinkage void bad_stack(void) { do_exit(SIGSEGV); }
// // Filehaven // Copyright (C) 2018 Paul Young (aka peymojo) // // 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 RenameItemInVaultOp_h #define RenameItemInVaultOp_h #include <string> #include "Filehaven/Vault/Vault.h" #include "SharedCancel.h" #include "VaultOp.h" // class RenameItemInVaultOp : public VaultOp { public: // RenameItemInVaultOp(const VaultPtr& vault, const ItemPathPtr& item, const std::string& newName); protected: // virtual OpResult Execute(const HermitPtr& h_, OpResultDictPtr& outResultDict) override; // virtual void Cancel() override; // virtual double GetProgress() override; private: // VaultPtr mVault; ItemPathPtr mItem; std::string mNewName; double mProgress; SharedCancelPtr mCancel; }; #endif /* RenameItemInVaultOp_h */
// // STVLCPlayer.h // SubTTS // // Created by peter ljunglöf on 2012-02-26. // Copyright (c) 2012 göteborgs universtiet. All rights reserved. // #import "STPlayer.h" @interface STVLCPlayer : STPlayer @end
/* File: jagjarnoderenderer.c Project: jaguar Author: Douwe Vos Date: Jun 6, 2013 e-mail: dmvos2000(at)yahoo.com Copyright (C) 2013 Douwe Vos. 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 "jagjarnoderenderer.h" #include <logging/catlogdefs.h> #define CAT_LOG_LEVEL CAT_LOG_WARN #define CAT_LOG_CLAZZ "JagJarNodeRenderer" #include <logging/catlog.h> static void l_renderer_iface_init(MooINodeRendererInterface *iface); G_DEFINE_TYPE_WITH_CODE(JagJarNodeRenderer, jag_jar_node_renderer, G_TYPE_OBJECT, { // @suppress("Unused static function") G_IMPLEMENT_INTERFACE(MOO_TYPE_INODE_RENDERER, l_renderer_iface_init); }); static void l_dispose(GObject *object); static void l_finalize(GObject *object); static void jag_jar_node_renderer_class_init(JagJarNodeRendererClass *clazz) { GObjectClass *object_class = G_OBJECT_CLASS(clazz); object_class->dispose = l_dispose; object_class->finalize = l_finalize; } static void jag_jar_node_renderer_init(JagJarNodeRenderer *instance) { } static void l_dispose(GObject *object) { cat_log_detail("dispose:%p", object); G_OBJECT_CLASS(jag_jar_node_renderer_parent_class)->dispose(object); cat_log_detail("disposed:%p", object); } static void l_finalize(GObject *object) { cat_log_detail("finalize:%p", object); cat_ref_denounce(object); G_OBJECT_CLASS(jag_jar_node_renderer_parent_class)->finalize(object); cat_log_detail("finalized:%p", object); } JagJarNodeRenderer *jag_jar_node_renderer_new() { JagJarNodeRenderer *result = g_object_new(JAG_TYPE_JAR_NODE_RENDERER, NULL); cat_ref_anounce(result); return result; } void jag_jar_renderer_draw_jar(cairo_t *cairo, double xoffset, int yoffset, double size, gboolean with_blue) { double nn = size*0.08; xoffset += nn; yoffset += nn; size = size-nn*2.0; // double x2 = 0.5+xoffset+(size*0.260); // double y2 = 0.5+yoffset+(size*0.165); // double xc = 0.5+xoffset+(size*0.5); // double yc = 0.5+yoffset+(size*0.5); double cap_diff = 0.08; double cap_top = 0.13; double cap_bottom = 0.30; double x10 = 0.5+xoffset+(size*0.05); double x1 = 0.5+xoffset+(size*0.10); double x11 = 0.5+xoffset+(size*0.15); double y1 = 0.5+yoffset+(size*(cap_top-cap_diff)); double y2 = 0.5+yoffset+(size*cap_top); double y3 = 0.5+yoffset+(size*(cap_top+cap_diff)); double y4 = 0.5+yoffset+(size*cap_bottom); double y5 = 0.5+yoffset+(size*(cap_bottom+cap_diff)); double y6 = 0.5+yoffset+(size*0.72); double y7 = 0.5+yoffset+(size*0.76); double y8 = 0.5+yoffset+(size*0.83); double y9 = 0.5+yoffset+(size*0.90); double x20 = 0.5+xoffset+(size*0.95); double x2 = 0.5+xoffset+(size*0.90); double x21 = 0.5+xoffset+(size*0.85); cairo_set_line_width(cairo, 0.75); /* glass */ cairo_move_to(cairo, x11, y4); cairo_line_to(cairo, x10, y5); cairo_line_to(cairo, x10, y6); cairo_curve_to(cairo, x10,y7, x10,y7, x11,y8); cairo_curve_to(cairo, x11,y9, x21,y9, x21,y8); // cairo_curve_to(cairo, x21,y7, x11,y7, x11,y8); // // cairo_move_to(cairo, x21, y8); cairo_curve_to(cairo, x20,y7, x20,y7, x20,y6); cairo_line_to(cairo, x20, y5); cairo_line_to(cairo, x21, y4); cairo_close_path(cairo); if (with_blue) { cairo_set_source_rgb(cairo, 0.7,0.7,1.0); } else { cairo_set_source_rgb(cairo, 0.85, 0.85, 1.0); } cairo_fill_preserve(cairo); // cairo_set_source_rgb(cairo, 0.3, 0.3, 0.7); cairo_set_source_rgb(cairo, 0.0, 0.0, 0.0); cairo_stroke(cairo); // // cairo_set_source_rgb(cairo, 0.5, 0.5, 1.0); // cairo_move_to(cairo, x11,y8); // cairo_curve_to(cairo, x11,y9, x21,y9, x21,y8); // cairo_curve_to(cairo, x21,y7, x11,y7, x11,y8); // cairo_stroke(cairo); /* cap */ cairo_set_line_width(cairo, 1.0); cairo_move_to(cairo, x1,y2); cairo_curve_to(cairo, x1,y1, x2,y1, x2,y2); cairo_line_to(cairo, x2, y4); cairo_curve_to(cairo, x2,y5, x1,y5, x1,y4); cairo_line_to(cairo, x1, y2); cairo_curve_to(cairo, x1,y3, x2,y3, x2,y2); cairo_set_source_rgb(cairo, 0.3, 0.8, 0.3); cairo_fill_preserve(cairo); cairo_set_source_rgb(cairo, 0.0, 0.3, 0.0); cairo_stroke(cairo); } /********************* begin MooINodeRendererFactory implementation *********************/ static void l_update_layout(MooINodeRenderer *self, struct _MooNodeLayout *node_layout) { } static void l_paint(MooINodeRenderer *self, cairo_t *cairo, struct _MooNodeLayout *node_layout) { int layout_x = moo_node_layout_get_x(node_layout); int layout_y = moo_node_layout_get_y(node_layout); int size = moo_node_layout_get_height(node_layout); layout_x += size; jag_jar_renderer_draw_jar(cairo, layout_x, layout_y, size, FALSE); } static void l_renderer_iface_init(MooINodeRendererInterface *iface) { iface->updateLayout = l_update_layout; iface->paint = l_paint; } /********************* end MooINodeRendererFactory implementation *********************/
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #define TARGET_BOARD_IDENTIFIER "BBV2" // BeeBrain V2. #define TARGET_CONFIG #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT #define BRUSHED_ESC_AUTODETECT #define LED0_PIN PB1 #define LED1_PIN PB2 #define USE_EXTI // #define DEBUG_MPU_DATA_READY_INTERRUPT #define MPU_INT_EXTI PB6 #define USE_MPU_DATA_READY_SIGNAL #define GYRO #define USE_GYRO_SPI_MPU6500 #define GYRO_MPU6500_ALIGN CW270_DEG #define ACC #define USE_ACC_SPI_MPU6500 #define ACC_MPU6500_ALIGN CW270_DEG #define SERIAL_PORT_COUNT 4 #define USE_VCP #define USE_UART1 #define USE_UART2 #define USE_UART3 #define USE_MSP_UART #define AVOID_UART2_FOR_PWM_PPM #define UART1_TX_PIN PA9 #define UART1_RX_PIN PA10 #define UART2_TX_PIN PA2 #define UART2_RX_PIN PA3 #define UART3_TX_PIN PB10 #define UART3_RX_PIN PB11 #define USE_SPI #define USE_SPI_DEVICE_1 #define USE_SPI_DEVICE_3 #define SPI1_NSS_PIN PA4 #define SPI1_SCK_PIN PA5 #define SPI1_MISO_PIN PA6 #define SPI1_MOSI_PIN PA7 #define SPI3_NSS_PIN PA15 #define SPI3_SCK_PIN PB3 #define SPI3_MISO_PIN PB4 #define SPI3_MOSI_PIN PB5 #define MPU6500_CS_PIN PA15 #define MPU6500_SPI_INSTANCE SPI3 #define OSD #define USE_MAX7456 #define MAX7456_SPI_INSTANCE SPI1 #define MAX7456_SPI_CS_PIN PA4 #define VTX_RTC6705 #define VTX_RTC6705SOFTSPI #define VTX_CONTROL #define RTC6705_SPIDATA_PIN PC15 #define RTC6705_SPILE_PIN PB12 #define RTC6705_SPICLK_PIN PC13 #define USE_ADC // #define BOARD_HAS_VOLTAGE_DIVIDER #define ADC_INSTANCE ADC3 #define VBAT_ADC_PIN PB13 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define SERIALRX_UART SERIAL_PORT_USART2 // #define BEEBRAIN_V2_DSM #ifdef BEEBRAIN_V2_DSM // Receiver - DSM #define DEFAULT_FEATURES (FEATURE_MOTOR_STOP | FEATURE_OSD) #define SERIALRX_PROVIDER SERIALRX_SPEKTRUM2048 #define RX_CHANNELS_TAER #else // Receiver - Frsky #define DEFAULT_FEATURES (FEATURE_MOTOR_STOP | FEATURE_OSD | FEATURE_TELEMETRY) #define SERIALRX_PROVIDER SERIALRX_SBUS #endif // IO - stm32f303cc in 48pin package #define TARGET_IO_PORTA 0xffff #define TARGET_IO_PORTB 0xffff #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15)) #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4)) #define USABLE_TIMER_CHANNEL_COUNT 4 #define USED_TIMERS ( TIM_N(1) | TIM_N(8) | TIM_N(15) )
#include <stdio.h> /* ENUNCIADO Leia um vetor de 8 posições e troque os 4 primeiros valores pelos 4 últimos e vice e versa. Escreva ao final o vetor obtido. */ int main(){ int vetor[8], i=0, numero, primeira_pt; scanf("%d", &numero); primeira_pt=numero%10000; numero /= 10000; for (i; i<4;i++){ vetor[i]=0; vetor[i]=primeira_pt; } for (i;i<8;i++){ vetor[i]=0; vetor[i]=numero; } for(i=0;i<8;i++){ printf("%d\n", vetor[i]); } }
#ifndef _ASM_X86_SECTIONS_H #define _ASM_X86_SECTIONS_H #include <asm-generic/sections.h> #include <asm/extable.h> extern char __brk_base[], __brk_limit[]; extern struct exception_table_entry __stop___ex_table[]; #if defined(CONFIG_X86_64) extern char __end_rodata_hpage_align[]; #endif #endif /* _ASM_X86_SECTIONS_H */
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <errno.h> #include <stdbool.h> #include <limits.h> #include "myhead.h" int main(void) { int minutes; static char input[SIZE]; while(1){ memset(input, 0, SIZE); /********************************** USHRT_MAX = 65,535 **********************************/ printf("minutes (0 ~ %hu): ", USHRT_MAX); if(!s_fgets(input, SIZE, stdin)) perror_exit("fgets failed"); /********** empty line ************/ if(input[0] == '\n') continue; /********** out of range **********/ if(more_then(input, 6)){ printf("invalid input!\n"); while(getchar() != '\n'); continue; } /********* NOT digits only *********/ if(!is_digit(input)){ printf("invalid input!\n"); continue; } minutes = atoi(input); /********** out of range **********/ if((minutes > USHRT_MAX) || (minutes < 0)){ printf("out of range!\n"); continue; } /*********************************** Congratulations! no logical flaw was found, now jump out of this loop and print the answer. ***********************************/ break; } printf("%d hours and %d minutes\n", (minutes/MIN_PER_HOUR), (minutes%MIN_PER_HOUR)); return 0; }
/** * This header is generated by class-dump-z 0.2-1. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: /System/Library/PrivateFrameworks/DataAccess.framework/DataAccess */ #import "CalNetworkChangeNotificationListener.h" #import <Foundation/NSObject.h> #import "DataAccess-Structs.h" @class CalDAVOperationQueue, MobileCalDAVAccount, DAVSession, NSError, CalDAVPrincipal, NSRecursiveLock, NSString, NSArray; @interface CalDAVAccount : NSObject <CalNetworkChangeNotificationListener> { CalDAVPrincipal* _principal; MobileCalDAVAccount* _mobileAccount; BOOL _isDelegate; BOOL _isWritable; NSString* _principalPath; NSString* _userDisplayName; NSString* _uid; DAVSession* _session; NSError* _lastOperationError; NSArray* _tempCalendarList; int _queryOfficeHoursRunning; NSRecursiveLock* _connectedStateLock; int _connectedState; BOOL _userPrefersOffline; NSError* _connectionError; CalDAVOperationQueue* _operationQueue; BOOL _checkingCredentials; } -(void)setPrincipal:(id)principal; -(id)principal; -(id)mobileAccount; -(void)setMobileAccount:(id)account; -(instancetype)initWithConfiguration:(id)configuration; // inherited: -(instancetype)init; -(id)configuration; -(void)setupSources; // in a protocol: -(void)systemNetworkDidChange; -(void)attemptAutomaticConnect; -(void)attemptAutomaticConnectOnBackgroundThread; -(void)automaticConnectDone:(id)done; // in a protocol: -(void)systemWillSleep; // in a protocol: -(void)systemDidWake; // inherited: -(void)dealloc; -(id)operationQueue; -(BOOL)isDelegate; -(void)setIsDelegate:(BOOL)delegate; -(BOOL)isWritable; -(void)setIsWritable:(BOOL)writable; -(id)principalPath; -(void)setPrincipalPath:(id)path; -(id)fullPrincipalAddress; -(void)setFullPrincipalAddress:(id)address; -(id)login; -(void)setLogin:(id)login; -(id)displayName; -(void)setDisplayName:(id)name; -(id)copyWithZone:(NSZone*)zone; -(void)setUid:(id)uid; -(id)uid; -(id)key; -(void)setLastOperationError:(id)error; -(id)lastOperationError; -(void)updateSessionTimeout:(id)timeout; -(id)_systemVersionString; -(id)_icalendarVersionString; -(id)_userAgentString; -(id)session; -(void)invalidateSession; -(id)getStringForState:(int)state; -(int)connectedState; -(void)setConnectedState:(int)state; -(int)statusForConnectedState; -(BOOL)isBusy; -(BOOL)userPrefersOffline; -(void)setUserPrefersOffline:(BOOL)offline; -(BOOL)isOffline; -(void)logError:(id)error; -(void)setSourceError:(id)error; -(void)doneCheckingCredentials:(BOOL)credentials; -(void)refreshAllSources; -(void)goOfflineAfterError:(BOOL)error; -(BOOL)isTransientError:(id)error; -(BOOL)isConnectionError:(id)error; -(BOOL)isConnectionErrorForDAVError:(id)daverror; -(BOOL)isConnectionErrorForAYError:(id)ayerror; -(BOOL)isConnectionErrorForOSStatusError:(id)osstatusError; -(BOOL)isConnectionErrorForNSPosixError:(id)nsposixError; -(BOOL)isConnectionErrorForAYNetDBError:(id)aynetDBError; -(BOOL)isConnectionErrorForStreamSocketSSLError:(id)streamSocketSSLError; -(BOOL)isConnectionErrorForCFNetworkHTTPError:(id)cfnetworkHTTPError; -(BOOL)isConnectionErrorForGenericError:(id)genericError; -(BOOL)isRefreshing; -(BOOL)isPendingRefresh; -(void)cancelRefresh; -(void)refreshWithContext:(id)context; @end
/* * (C) 2003-2006 Gabest * (C) 2006-2012 see Authors.txt * * This file is part of MPC-HC. * * MPC-HC 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. * * MPC-HC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #pragma once #include <atlbase.h> #include "../../../DSUtil/DSUtil.h" #define StreamDriveThruName L"MPC StreamDriveThru" class CStreamDriveThruInputPin : public CBasePin { CComQIPtr<IAsyncReader> m_pAsyncReader; public: CStreamDriveThruInputPin(TCHAR* pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); virtual ~CStreamDriveThruInputPin(); HRESULT GetAsyncReader(IAsyncReader** ppAsyncReader); DECLARE_IUNKNOWN; STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); HRESULT CheckMediaType(const CMediaType* pmt); HRESULT CheckConnect(IPin* pPin); HRESULT BreakConnect(); HRESULT CompleteConnect(IPin* pPin); STDMETHODIMP BeginFlush(); STDMETHODIMP EndFlush(); }; class CStreamDriveThruOutputPin : public CBaseOutputPin { CComQIPtr<IStream> m_pStream; public: CStreamDriveThruOutputPin(TCHAR* pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr); virtual ~CStreamDriveThruOutputPin(); HRESULT GetStream(IStream** ppStream); DECLARE_IUNKNOWN; STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); HRESULT DecideBufferSize(IMemAllocator* pAlloc, ALLOCATOR_PROPERTIES* pProperties); HRESULT CheckMediaType(const CMediaType* pmt); HRESULT GetMediaType(int iPosition, CMediaType* pmt); HRESULT CheckConnect(IPin* pPin); HRESULT BreakConnect(); HRESULT CompleteConnect(IPin* pPin); STDMETHODIMP BeginFlush(); STDMETHODIMP EndFlush(); STDMETHODIMP Notify(IBaseFilter* pSender, Quality q); }; class __declspec(uuid("534FE6FD-F1F0-4aec-9F45-FF397320CE33")) CStreamDriveThruFilter : public CBaseFilter, protected CAMThread, public IMediaSeeking { CCritSec m_csLock; CStreamDriveThruInputPin* m_pInput; CStreamDriveThruOutputPin* m_pOutput; protected: enum { CMD_EXIT, CMD_STOP, CMD_PAUSE, CMD_RUN }; DWORD ThreadProc(); LONGLONG m_position; public: CStreamDriveThruFilter(LPUNKNOWN pUnk, HRESULT* phr); virtual ~CStreamDriveThruFilter(); DECLARE_IUNKNOWN; STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); int GetPinCount(); CBasePin* GetPin(int n); STDMETHODIMP Stop(); STDMETHODIMP Pause(); STDMETHODIMP Run(REFERENCE_TIME tStart); // IMediaSeeking STDMETHODIMP GetCapabilities(DWORD* pCapabilities); STDMETHODIMP CheckCapabilities(DWORD* pCapabilities); STDMETHODIMP IsFormatSupported(const GUID* pFormat); STDMETHODIMP QueryPreferredFormat(GUID* pFormat); STDMETHODIMP GetTimeFormat(GUID* pFormat); STDMETHODIMP IsUsingTimeFormat(const GUID* pFormat); STDMETHODIMP SetTimeFormat(const GUID* pFormat); STDMETHODIMP GetDuration(LONGLONG* pDuration); STDMETHODIMP GetStopPosition(LONGLONG* pStop); STDMETHODIMP GetCurrentPosition(LONGLONG* pCurrent); STDMETHODIMP ConvertTimeFormat(LONGLONG* pTarget, const GUID* pTargetFormat, LONGLONG Source, const GUID* pSourceFormat); STDMETHODIMP SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags); STDMETHODIMP GetPositions(LONGLONG* pCurrent, LONGLONG* pStop); STDMETHODIMP GetAvailable(LONGLONG* pEarliest, LONGLONG* pLatest); STDMETHODIMP SetRate(double dRate); STDMETHODIMP GetRate(double* pdRate); STDMETHODIMP GetPreroll(LONGLONG* pllPreroll); };
/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, * 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 version 2 for more details (a copy is included * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see * http://www.gnu.org/licenses/gpl-2.0.html * * GPL HEADER END */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* * Copyright (c) 2011, 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * * lustre/lustre/include/lustre_idmap.h * * MDS data structures. * See also lustre_idl.h for wire formats of requests. */ #ifndef _LUSTRE_EACL_H #define _LUSTRE_EACL_H /** \defgroup eacl eacl * * @{ */ #ifdef CONFIG_FS_POSIX_ACL #include <linux/fs.h> #include <linux/posix_acl_xattr.h> typedef struct { __u16 e_tag; __u16 e_perm; __u32 e_id; __u32 e_stat; } ext_acl_xattr_entry; typedef struct { __u32 a_count; ext_acl_xattr_entry a_entries[0]; } ext_acl_xattr_header; #define CFS_ACL_XATTR_SIZE(count, prefix) \ (sizeof(prefix ## _header) + (count) * sizeof(prefix ## _entry)) #define CFS_ACL_XATTR_COUNT(size, prefix) \ (((size) - sizeof(prefix ## _header)) / sizeof(prefix ## _entry)) #endif /* CONFIG_FS_POSIX_ACL */ /** @} eacl */ #endif
#include "unpipc.h" int main(int argc, char **argv) { int semid, nsems, i; struct semid_ds seminfo; unsigned short *ptr; union semun arg; if (argc != 2) err_quit("usage: semgetvalues <pathname>"); /* 4first get the number of semaphores in the set */ semid = Semget(Ftok(argv[1], 0), 0, 0); arg.buf = &seminfo; Semctl(semid, 0, IPC_STAT, arg); nsems = arg.buf->sem_nsems; /* 4allocate memory to hold all the values in the set */ ptr = Calloc(nsems, sizeof(unsigned short)); arg.array = ptr; /* 4fetch the values and print */ Semctl(semid, 0, GETALL, arg); for (i = 0; i < nsems; i++) printf("semval[%d] = %d\n", i, ptr[i]); exit(0); }
/*------------------------------------------------------------------------- * * replorigindesc.c * rmgr descriptor routines for replication/logical/origin.c * * Portions Copyright (c) 2015-2017, PostgreSQL Global Development Group * * * IDENTIFICATION * src/backend/access/rmgrdesc/replorigindesc.c * *------------------------------------------------------------------------- */ #include "postgres.h" #include "replication/origin.h" void replorigin_desc(StringInfo buf, XLogReaderState *record) { char *rec = XLogRecGetData(record); uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK; switch (info) { case XLOG_REPLORIGIN_SET: { xl_replorigin_set *xlrec; xlrec = (xl_replorigin_set *) rec; appendStringInfo(buf, "set %u; lsn %X/%X; force: %d", xlrec->node_id, (uint32) (xlrec->remote_lsn >> 32), (uint32) xlrec->remote_lsn, xlrec->force); break; } case XLOG_REPLORIGIN_DROP: { xl_replorigin_drop *xlrec; xlrec = (xl_replorigin_drop *) rec; appendStringInfo(buf, "drop %u", xlrec->node_id); break; } } } const char * replorigin_identify(uint8 info) { switch (info) { case XLOG_REPLORIGIN_SET: return "SET"; case XLOG_REPLORIGIN_DROP: return "DROP"; default: return NULL; } }
#ifndef TINFORMER_H #define TINFORMER_H //#include <QObject> #include <QString> //#include <QMYSQLDriver> #include <QSqlDatabase> #include <QSqlQuery> #include <QStringList> #include <QVariant> #include "tovar.h" #include "sql_config.h" #include "dbf_config.h" #include "db_translator.h" #include "dbf_informer.h" class Tinformer { public: enum DataSource { MySQL, DBF }; enum SearchMethod { tbarcode, tnomer, tname }; //Tinformer (int mode); Tinformer (); ~Tinformer (); bool prepare(SqlConfig *sql); bool prepare(DbfConfig *dbf); bool set_fields(dbTranslator *rows); bool set_tb_name(QString tbName); int get_maximum(); QList<Tovar> info (QString text, QString method = "tbarcode", int startPos = 0, int endPos = -1, int limit = 0, bool FromStartToEnd = true, bool AllowFastSearch = true); QList<Tovar> check_line_prices (QList<Tovar> inputList); int last_found_record_number(); QStringList db_describe(); QStringList tb_describe(QString tbName); void set_limit_search(int number); private: QSqlDatabase db; DataSource datasource; bool db_is_ready; bool tb_is_ready; SqlConfig *sqlDB; DbfConfig *dbfDB; QString values_to_select; // список полей для селекта из mysql dbTranslator* fields; //для понимания полей SQLтаблицы dbf_informer* dbf_info; //класс для работы с DBF-файлами int limit_search; //ограничение поиска int last_record; //public slots: /* public slots: bool is_valid(); Tovar info(QString barcode, int method); */ }; #endif // TINFORMER_H
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Code/Dev/appNativa/source/rareobjc/../rare/core/com/appnativa/rare/scripting/iShellEngineProvider.java // // Created by decoteaud on 3/11/16. // #ifndef _RAREiShellEngineProvider_H_ #define _RAREiShellEngineProvider_H_ @protocol JavaUtilList; @protocol RAREiScriptingEngine; @protocol RAREiScriptingIO; #import "JreEmulation.h" @protocol RAREiShellEngineProvider < NSObject, JavaObject > - (id<RAREiScriptingEngine>)getDefaultEngineWithRAREiScriptingIO:(id<RAREiScriptingIO>)sio; - (id<RAREiScriptingEngine>)getEngineWithNSString:(NSString *)language withRAREiScriptingIO:(id<RAREiScriptingIO>)sio; - (id<JavaUtilList>)getLanguages; - (id<JavaUtilList>)getTargets; - (id<JavaUtilList>)getViewers; - (id<JavaUtilList>)getWidgetNamesWithNSString:(NSString *)viewer; @end #define ComAppnativaRareScriptingIShellEngineProvider RAREiShellEngineProvider #endif // _RAREiShellEngineProvider_H_
/////////////////////////////////////////////////////////////////////////////// // // SIMPLESTRING.H // // One of the design goals of CppUnitLite is to compilation with very old C++ // compilers. For that reason, I've added a simple string class that provides // only the operations needed in CppUnitLite. // /////////////////////////////////////////////////////////////////////////////// #ifndef SIMPLE_STRING #define SIMPLE_STRING #include <string> class SimpleString { friend bool operator== (const SimpleString& left, const SimpleString& right); public: SimpleString (); SimpleString (const char *value); SimpleString (const SimpleString& other); ~SimpleString (); SimpleString operator= (const SimpleString& other); char *asCharString () const; int size() const; private: char *buffer; }; SimpleString StringFrom (bool value); SimpleString StringFrom (const char *value); SimpleString StringFrom (int value); SimpleString StringFrom (unsigned value); #ifndef __MINGW32__ SimpleString StringFrom (std::size_t value); #endif SimpleString StringFrom (long value); SimpleString StringFrom (long long value); SimpleString StringFrom (double value); SimpleString StringFrom(const std::string& value); SimpleString StringFrom (const SimpleString& other); #endif
#include "global.h" #include "math.h" double normal_01_cdf ( double x ) //****************************************************************************** // // Purpose: // // NORMAL_01_CDF evaluates the Normal 01 CDF. // // Modified: // // 10 February 1999 // // Author: // // John Burkardt // // Reference: // // A G Adams, // Areas Under the Normal Curve, // Algorithm 39, // Computer j., // Volume 12, pages 197-198, 1969. // // Parameters: // // Input, double X, the argument of the CDF. // // Output, double CDF, the value of the CDF. // { double a1 = 0.398942280444E+00; double a2 = 0.399903438504E+00; double a3 = 5.75885480458E+00; double a4 = 29.8213557808E+00; double a5 = 2.62433121679E+00; double a6 = 48.6959930692E+00; double a7 = 5.92885724438E+00; double b0 = 0.398942280385E+00; double b1 = 3.8052E-08; double b2 = 1.00000615302E+00; double b3 = 3.98064794E-04; double b4 = 1.98615381364E+00; double b5 = 0.151679116635E+00; double b6 = 5.29330324926E+00; double b7 = 4.8385912808E+00; double b8 = 15.1508972451E+00; double b9 = 0.742380924027E+00; double b10 = 30.789933034E+00; double b11 = 3.99019417011E+00; double cdf; double q; double y; // // |X| <= 1.28. // if ( fabs ( x ) <= 1.28 ) { y = 0.5 * x * x; q = 0.5 - fabs ( x ) * ( a1 - a2 * y / ( y + a3 - a4 / ( y + a5 + a6 / ( y + a7 ) ) ) ); // // 1.28 < |X| <= 12.7 // } else if ( fabs ( x ) <= 12.7 ) { y = 0.5 * x * x; q = exp ( - y ) * b0 / ( fabs ( x ) - b1 + b2 / ( fabs ( x ) + b3 + b4 / ( fabs ( x ) - b5 + b6 / ( fabs ( x ) + b7 - b8 / ( fabs ( x ) + b9 + b10 / ( fabs ( x ) + b11 ) ) ) ) ) ); // // 12.7 < |X| // } else { q = 0.0; } // // Take account of negative X. // if ( x < 0.0 ) { cdf = q; } else { cdf = 1.0 - q; } return cdf; } //**********************************************************************
#define MESSAGE_BUFFER_SIZE (2 * 4096) class Creceived_message { public: Creceived_message(); ~Creceived_message(); void add_data(char *pbuffer, int size); bool available_message(); void get_message(char *pbuffer, int buffer_size, int *psize); private: void reset(); private: char *m_pmessage_buffer; int m_index; int m_message_size; bool m_bavailable; };
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> #include <platform.h> #include "drivers/io.h" #include "drivers/dma.h" #include "drivers/timer.h" #include "drivers/timer_def.h" const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM5, CH4, PA3, TIM_USE_PPM, TIMER_INPUT_ENABLED, 0), // PPM DMA1_ST1 DEF_TIM(TIM3, CH1, PC6, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED, 0), // S1 DMA1_ST4 DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED, 0), // S2 DMA2_ST3 DEF_TIM(TIM3, CH3, PC8, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED, 0), // S3 DMA1_ST7 DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED, 0), // S4 DMA2_ST7 DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED, 0), // S5 DMA1_ST2 DEF_TIM(TIM1, CH1, PA8, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED, 0), // S6 DMA2_ST6 DEF_TIM(TIM2, CH1, PA15, TIM_USE_LED, TIMER_OUTPUT_ENABLED, 0) // LED STRIP DMA1_ST5 };
/* * gen_testcases.h * * This file is a part of VirtEEPROM, emulation of EEPROM (Electrically * Erasable Programmable Read-only Memory). * * (C) 2015 Nina Evseenko <anvoebugz@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. * * 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 VEEPROM_GEN_TESTCASES #define VEEPROM_GEN_TESTCASES int gen_verify_2(const char*); int gen_verify_3(const char*); int gen_verify_4(const char*); int gen_verify_5(const char*); int gen_verify_6(const char*); int gen_verify_7(const char*); int gen_verify_8(const char*); int gen_verify_9(const char*); int gen_verify_10(const char*); int gen_verify_11(const char*); int gen_verify_12(const char*); int gen_verify_13(const char*); int gen_verify_14(const char*); int gen_verify_15(const char*); int gen_verify_16(const char*); int gen_verify_17(const char*); int gen_verify_18(const char*); int gen_verify_19(const char*); int gen_verify_20(const char*); int gen_verify_21(const char*); int gen_verify_22(const char*); int gen_verify_23(const char*); int gen_verify_24(const char*); int gen_verify_25(const char*); int gen_verify_26(const char*); int gen_verify_27(const char*); int gen_verify_28(const char*); int gen_verify_29(const char*); int gen_verify_30(const char*); int gen_verify_31(const char*); int gen_clear(const char*); #endif
/* * 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/>. */ /* * File: deamonizer.hpp * Author: Jörn Roddelkopf * Version: 1.1 01.09.2016 */ #ifndef DAEMONIZER_H #define DAEMONIZER_H #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <errno.h> #include <unistd.h> #include <string.h> #include <spawn.h> #include <sys/wait.h> #include <iostream> #include <vector> /** * This Class is used to daemonize this Application and to call external * Tools like FFmpeg. */ class Daemonizer { public: bool daemonize(void); // Daemonize this Application bool runExternal(std::string cmd, std::vector<std::string> argvs, bool wait); // Run an external Application }; #endif /* DEAMONIZER_H */