text
stringlengths
4
6.14k
/*! * \file test_logging.h * \brief Interface to unit test logging functionality. * \author Paul Griffiths * \copyright Copyright 2014 Paul Griffiths. Distributed under the terms * of the GNU General Public License. <http://www.gnu.org/licenses/> */ #ifndef PG_TEST_LOGGING_H #define PG_TEST_LOGGING_H #include <stdbool.h> /*! * \brief Logs the result of a unit test. * \param success `true` if the test succeeded, `false` otherwise. * \param fmt Format string for failure message. * \param ... Arguements to format string. */ void tests_log_test(const bool success, const char * fmt, ...); /*! * \brief Returns the total number of tests run. * \returns The total number of tests run. */ int tests_get_total_tests(void); /*! * \brief Returns the total number of successful tests. * \returns The total number of successful tests. */ int tests_get_successes(void); /*! * \brief Returns the total number of failed tests. * \returns The total number of failed tests. */ int tests_get_failures(void); #endif /* PG_TEST_LOGGING_H */
/**************************************************************************** * * Copyright (c) 2014 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name PX4 nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /** * @file drv_device.h * * Generic device / sensor interface. */ #ifndef _DRV_DEVICE_H #define _DRV_DEVICE_H #include <stdint.h> #include <sys/ioctl.h> #include "drv_sensor.h" #include "drv_orb_dev.h" /* * ioctl() definitions */ #define _DEVICEIOCBASE (0x100) #define _DEVICEIOC(_n) (_PX4_IOC(_DEVICEIOCBASE, _n)) /** ask device to stop publishing */ #define DEVIOCSPUBBLOCK _DEVICEIOC(0) /** check publication block status */ #define DEVIOCGPUBBLOCK _DEVICEIOC(1) /** * Return device ID, to enable matching of configuration parameters * (such as compass offsets) to specific sensors */ #define DEVIOCGDEVICEID _DEVICEIOC(2) #ifdef __PX4_POSIX #define DIOC_GETPRIV SIOCDEVPRIVATE #endif #endif /* _DRV_DEVICE_H */
#ifndef PARTICLE_FILTER_H #define PARTICLE_FILTER_H #include <cmath> #include <eigen3/Eigen/Dense> #include <random> #include <vector> #include "ros/console.h" #include "ros/ros.h" #include "tf/transform_datatypes.h" #include "geometry_msgs/Point32.h" #include "sensor_msgs/PointCloud.h" #include "sensor_msgs/ChannelFloat32.h" #include "localization/filter_utilities.h" using namespace Eigen; using namespace filter_utilities; class ParticleFilter { public: ParticleFilter(ros::NodeHandle &_nh); bool NewPosition(); tf::Vector3 GetPosition(); double GetPositionDT(); void InputDepth(const double depth); void InputHydrophones(const tf::Vector3 position, const double dt); void InputAbsLinVel(const tf::Vector3 lin_vel, const double dt); void InputOrientation(const tf::Quaternion orientation); void Reset(); private: void initialize(); void reload_params(); void publish_point_cloud(); Vector4d state_to_observation(Vector3d state); Vector4d add_observation_noise( Vector4d particle_obs); void update_particle_states(); void update_particle_weights(); void resample_particles(); void estimate_state(); void predict(); void update(); // Nodehandle received from localization_system ros::NodeHandle &nh; // Publisher for point cloud of particles. ros::Publisher particle_cloud_pub; // Set to true when estimate_state() called. bool new_position; // Number of particles. Comes from localization param. int num_particles; // Number of times update and predict steps have been run. int num_iterations; // Stores estimated position and metadata. tf::Vector3 estimated_position; ros::Time last_estimated_position_time; double estimated_position_dt; // Stores position of pinger in pool. Loaded from param. tf::Vector3 pinger_position; // Vectors of all particle states. // Each particle state is a column vector as follows: // | x_pos | // | y_pos | // | z_pos | std::vector<Vector3d> particle_states; std::vector<Vector3d> last_particle_states; // Vector of particle weights std::vector<double> particle_weights; // This stores the standard deviations of the observation inputs. Loaded // from params. Matrix<double, 4, 4> observation_stddev; // This stores the current hydrophone and depth observations as a column // vector as follows: // | i component of pinger bearing | // | j component of pinger bearing | // | k component of pinger bearing | // | depth | Vector4d observation; // Stores the initial state of the sub. Loaded from params. Vector3d initial_state; // This stores the standard deviations of the initial state in order to // generate the initial particles. Loaded from params. Vector3d initial_distribution; // This pushes the state forward based on the previous state. Since the // state for each particle is only the subs position this is simply an // identity matrix. Matrix<double, 3, 3> system_update_model; // This stores the standard deviations of the system update step. This adds // noise to the particles during the system update step. Matrix<double, 3, 3> system_update_stddev; // This relates the control input to the state. It is currently an // identity matrix * dt. Matrix<double, 3, 3> control_update_model; // This stores the inputted linear velocity. Vector3d control_input; // This stores our current orientation based on what the IMU says. Used for // transforming the pinger bearing from the global frame to the sub's // frame. tf::Quaternion current_orientation; }; #endif //PARTICLE_FILTER_H
// // gcroot.h - Template class that wraps GCHandle from mscorlib.dll. // Copyright (C) Microsoft Corporation // All rights reserved. // // This include file is provided for back-compatibilty. // Include <msclr\gcroot.h> and use ::msclr::gcroot instead of ::gcroot. // // Use this class to declare gc "pointers" that live in the C++ heap. // // Example: // struct StringList { // gcroot<String^> str; // StringList *next; // StringList(); // should have ctors and dtors // ~StringList(); // }; // // By convention, we maintain a 1-to-1 relationship between C++ objects // and the handle slots they "point" to. Thus, two distinct C++ objects // always refer to two distinct handles, even if they "point" to the same // object. Therefore, when the C++ object is destroyed, its handle can // be freed without error. // // Note that we cannot currently embed a GCHandle directly in an unmanaged C++ // class. We therefore store a void*, and use the conversion methods of // GCHandle to reconstitute a GCHandle from the void* on demand. // // See msclr\gcroot.h for implementations details. #if _MSC_VER > 1000 #pragma once #endif #if !defined(_INC_GCROOT) #define _INC_GCROOT #ifndef RC_INVOKED #include <stddef.h> #define __DEFINE_GCROOT_IN_GLOBAL_NAMESPACE #include <msclr\gcroot.h> #endif /* RC_INVOKED */ #endif // _INC_GCROOT
// vim: set noexpandtab: #ifndef ANIMATION_H #define ANIMATION_H #include <string> #include <cassert> #include <SDL.h> #include <boost/shared_ptr.hpp> #include "vector2d.h" #include "area.h" namespace grail { /** * Base class for all animations */ class Animation : public Area { public: typedef boost::shared_ptr<Animation> Ptr; Animation() { } virtual ~Animation() { } virtual void renderAt(SDL_Surface* target, uint32_t ticks, VirtualPosition p) const = 0; virtual VirtualSize getSize() const = 0; virtual bool hasPoint(VirtualPosition p) const { return (p.getX() >= 0) && (p.getX() < getSize().getX()) && (p.getY() >= 0) && (p.getY() < getSize().getY()); } virtual void eachFrame(uint32_t ticks) { } virtual uint16_t getDirection() const { return 0; } virtual void setDirection(uint16_t direction) { } virtual void setDirection(VirtualPosition p) { } virtual void makeContinuationOf(const Animation& other) { setDirection(other.getDirection()); } }; /** * Animations that have a direction. * E.g. a character walking left looks different than the same character * walking right. * * Essentially this grophs together a bunch of animations and associates each * with a direction. */ class DirectionAnimation : public Animation { uint16_t currentDirection; uint16_t directions; double offset; Animation::Ptr* animations; public: static const std::string className; DirectionAnimation(uint16_t directions, double offset=0); ~DirectionAnimation(); void renderAt(SDL_Surface*, uint32_t, VirtualPosition) const; VirtualSize getSize() const; bool hasPoint(VirtualPosition) const; void eachFrame(uint32_t); uint16_t getDirection() const { return currentDirection; } void setDirection(uint16_t direction) { assert(direction < directions); currentDirection = direction; } void setDirection(VirtualPosition p) { setDirection(p.nearestDirection(directions, offset)); } void setAnimation(uint16_t direction, Animation::Ptr animation); }; } // namespace grail #endif // ANIMATION_H
/* * This file is part of Windows-Uptime. * * Copyright (C) 2014-2015 R1tschY <r1tschy@yahoo.de> * * Windows-Uptime 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. * * TrafficIndicator 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 RENDERCONTEXT_H #define RENDERCONTEXT_H #include "eventhandle.h" #include "variant.h" #include "event.h" namespace WinUptime { class RenderContext { public: RenderContext() noexcept: handle_() { } RenderContext(const wchar_t* query) : handle_() { openForValues(&query, 1); } RenderContext(std::initializer_list<const wchar_t*> queries) : handle_() { openForValues(queries.begin(), queries.size()); } void openForValues(std::initializer_list<const wchar_t*> queries) { openForValues(queries.begin(), queries.size()); } template<std::size_t N> void openForValues(const wchar_t* (&values)[N]) { openForValues(values, N); } template<std::size_t N> void getValues(const Event& event, Variant (&values)[N]) { getValues(event, values, N); } Variant getValue(const Event& event) { Variant value; getValues(event, &value, 1); return value; } private: EventHandle handle_; void openForValues(const wchar_t* const* values, std::size_t n); void getValues(const Event& event, Variant* values, std::size_t n); }; } // namespace WinUptime #endif // RENDERCONTEXT_H
/*! @file * * @date 12.12.2014 * @author Azzurite * * @copyright GPL v3 * Copyright (C) 2014 Azzurite * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once namespace pong { namespace resources { class ResourceManager { public: /*! * @brief Default constructor. */ ResourceManager() noexcept; /*! * @brief Default copy constructor. */ ResourceManager(const ResourceManager&) noexcept; /*! * @brief Default move constructor. */ ResourceManager(ResourceManager&&) noexcept; /*! * @brief Default destructor. */ ~ResourceManager() noexcept; /*! * @brief Default copy assignment operator. */ ResourceManager& operator=(const ResourceManager&) noexcept; /*! * @brief Default move assignment operator. */ ResourceManager& operator=(ResourceManager&&) noexcept; protected: private: }; } // namespace resources } // namespace pong
/* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. * * This program is a 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 FSF - Free Software * Foundation */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <dirent.h> #include <time.h> #include <windows.h> #include "os_regex/os_regex.h" #include "headers/file_op.h" #define OSSECCONF "ossec.conf" #define OSSECDEF "default-ossec.conf" #define OSSECLAST "ossec.conf.bak" #define CLIENTKEYS "client.keys" #define OS_MAXSTR 1024 /* Check if a file exists */ int fileexist(char *file); /* Grep for a string in a file */ int dogrep(char *file, char *str); /* Check if dir exists */ int direxist(char *dir); /* Get Windows main directory */ void get_win_dir(char *file, int f_size);
// // AppDelegate.h // Texture-Base-OneStep // // Created by Windy on 2017/2/13. // Copyright © 2017年 Windy. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* * cepstrum_register.h * * Created on: Dec 31, 2016 * Author: detroit */ #ifndef CEPSTRUM_REGISTER_H_ #define CEPSTRUM_REGISTER_H_ #endif /* CEPSTRUM_REGISTER_H_ */
// // WKWebpagePlugin.h // WallpaperKit // // Created by Naville Zhang on 2017/1/9. // Copyright © 2017年 NavilleZhang. All rights reserved. // #import "WKDesktop.h" #import <WebKit/WebKit.h> @interface WKWebpagePlugin : WKWebView<WKRenderProtocal> /** Init Plugin @param window NSWindow to draw in.Caller will handle view adding @param args Arguments For Rendering Webpage can be specified by using either: @"Path" the NSURL of target webpage @"HTML" the raw HTML NSString* @"Javascript" is an optional NSString*,which will be evaluated after the page is loaded @"BaseURL" is an optional NSURL*,which will be used as BaseURL for the request @"Cookie" is an optional Cookie string @discussion MouseEvents are supported by explicited overwrite NSEvent Handlers and execute JS */ - (instancetype)initWithWindow:(WKDesktop*)window andArguments:(NSDictionary*)args; @property (nonatomic) BOOL requiresConsistentAccess; @property (nonatomic) BOOL requiresExclusiveBackground; @property (nonatomic,assign,readwrite) NSDictionary* arg; @end
#include <string.h> /* reverse: reverse string s in place */ int reverse(char *s) { if (!s) return 1; size_t i, j; for (i = 0, j = strlen(s)-1; i < j; i++, j--) { if (s[i] != s[j]) { s[i] ^= s[j]; s[j] ^= s[i]; s[i] ^= s[j]; } } return 0; }
#ifndef AST__VISITOR__STRINGIFYVISITOR_H_ #define AST__VISITOR__STRINGIFYVISITOR_H_ #include "Visitor.h" namespace AST { namespace Visitor { using AST::Expression::Expression; using AST::Expression::Number; using AST::Expression::Variable; using AST::Expression::Text; namespace Op = AST::Expression::Operation; namespace Fcn = AST::Expression::FunctionCall; class StringifyVisitor: public Visitor { Text * getFunctionTextExpression(Fcn::FunctionCall * fcnExpr, const char * fcnName); public: StringifyVisitor(); virtual ~StringifyVisitor(); virtual Expression * visit(Number * expression); virtual Expression * visit(Variable * expression); virtual Expression * visit(Text * expression); virtual Expression * visit(Op::Addition * expression); virtual Expression * visit(Op::Subtraction * expression); virtual Expression * visit(Op::Multiplication * expression); virtual Expression * visit(Op::Division * expression); virtual Expression * visit(Op::Negation * expression); virtual Expression * visit(Op::Power * expression); virtual Expression * visit(Fcn::Sqrt * expression); virtual Expression * visit(Fcn::Exp * expression); virtual Expression * visit(Fcn::Ln * expression); virtual Expression * visit(Fcn::Sin * expression); virtual Expression * visit(Fcn::Cos * expression); virtual Expression * visit(Fcn::Tan * expression); virtual Expression * visit(Fcn::Cot * expression); virtual Expression * visit(Fcn::Sinh * expression); virtual Expression * visit(Fcn::Cosh * expression); virtual Expression * visit(Fcn::Tanh * expression); virtual Expression * visit(Fcn::ArcSin * expression); virtual Expression * visit(Fcn::ArcCos * expression); virtual Expression * visit(Fcn::ArcTan * expression); virtual Expression * visit(Fcn::ArSinh * expression); virtual Expression * visit(Fcn::ArCosh * expression); virtual Expression * visit(Fcn::ArTanh * expression); virtual Expression * visit(Fcn::FunctionByIdentifier * expression); }; }} /* namespace AST::Visitor */ #endif /* AST__VISITOR__STRINGIFYVISITOR_H_ */
/* Penjin is Copyright (c)2005, 2006, 2007, 2008, 2009, 2010 Kevin Winfield-Pantoja This file is part of Penjin. Penjin is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Penjin 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 Penjin. If not, see <http://www.gnu.org/licenses/>. */ #ifndef VECTOR2DI_H #define VECTOR2DI_H #include "trenki/vector_math.h" // Vectors #include "PenjinFixedFunc.h" #include <limits> using namespace vmath; using namespace fixedpoint; #include "Vector2dx.h" #ifdef PENJIN_SDL struct SDL_Rect; #endif class Vector2di : public vec2<int> { public: /// Constructors and Deconstructor. Vector2di(){;} template <class T> Vector2di(const T& v){x = v.x;y = v.y;} Vector2di(const vec2<fixed_point<16> >& v) { this->x = fixedpoint::fix2int(v.x); this->y = fixedpoint::fix2int(v.y); } Vector2di(const Vector2dx& v) { vec2<fixed_point<16> > t = v; this->x = fixedpoint::fix2int(t.x); this->y = fixedpoint::fix2int(t.y); } Vector2di(const fixed_point<16>& x, const fixed_point<16>& y) { this->x = fixedpoint::fix2int(x); this->y = fixedpoint::fix2int(y); } template <class T> Vector2di(const T& x,const T& y) { this->x = x; this->y = y; } template <class T,class S> Vector2di(const T& x,const S& y) { this->x = x; this->y = y; } /// Standard operators Vector2di& operator=(const vec2<fixed_point<16> >& v){x = fix2int(v.x);y = fix2int(v.y);return *this;} template <class T> Vector2di& operator=(const T& v){x = v.x;y=v.y;return *this;} // TODO Add a level of approximation to equivalence operators. template <class T> bool operator==(const T& v)const{return (x==v.x && y==v.y);} bool operator==(const vec2<fixed_point<16> >& v)const{return(x == fix2int(v.x) && y == fix2int(v.y));} template <class T> Vector2di operator+(const T& v)const{return Vector2di(x + v.x, y + v.y);} template <class T> Vector2di operator-(const T& v)const{return Vector2di(x - v.x, y - v.y);} template <class T> Vector2di operator*(const T& v)const{return Vector2di(x * v.x, y * v.y);} Vector2di operator*(const float& f)const{return Vector2di(x*f,y*f);} template <class T> Vector2di operator/(const T& v)const{return Vector2di(x / v.x, y / v.y);} // TODO add rounding up Vector2di operator/(const float& f)const{return Vector2di(x/f,y/f);} // TODO use a Fixed intermediary to round to nearest whole number for result. Vector2di operator/(const int& i)const{return Vector2di(x/i,y/i);} template <class T> Vector2di& operator+=(const T& v) { x+=v.x; y+=v.y; return *this; } template <class T> Vector2di& operator-=(const T& v) { x-=v.x; y-=v.y; return *this; } Vector2di& operator-=(const vec2<fixed_point<16> >& v) { x-=fixedpoint::fix2int(v.x); y-=fixedpoint::fix2int(v.y); return *this; } Vector2di& operator-=(const Vector2dx& v) { x-=fixedpoint::fix2int(v.x); y-=fixedpoint::fix2int(v.y); return *this; } template <class T> Vector2di& operator*=(const T& v) { x*=v.x; y*=v.y; return *this; } template <class T> Vector2di& operator/=(const T& v) { x/=v.x; y/=v.y; return *this; } Vector2di& operator/=(const int& i) { // TODO added Fixed intermediary and round result to nearest whole number. x/=i; y/=i; return *this; } /// Scaling Vector2di& operator*=(const float& s); Vector2di& operator/=(const float& s); /// Negation Vector2di operator- (){return Vector2di(0-x,0-y);} /// Vector operations Vector2di unit()const{float temp = length();return Vector2di(x/temp,y/temp);} template <class T> float dot(const T& v)const{return (x*v.x+y*v.y);} float dot(const vec2<fixed_point<16> >& v)const{return(x * fix2float(v.x) + y * fix2float(v.y));} float length() const{return sqrt(lengthSquared());} float lengthSquared() const{return (x*x + y*y);} void normalise(); #ifdef PENJIN_SDL bool inRect(const SDL_Rect& rect) const; #endif bool inRect(const int x, const int y, const unsigned int w, const unsigned int h) const; }; #endif // VECTOR2DI_H
/* $Id: c018.c,v 1.2 2004/07/30 17:28:43 ConnerJ Exp $ */ /* Copyright (c)1999 Microchip Technology */ /* MPLAB-C18 startup code */ /* external reference to the user's main routine */ extern void main (void); /* prototype for the startup function */ void _entry (void); void _startup (void); extern near char FPFLAGS; #define RND 6 #pragma code _entry_scn=0x000000 void _entry (void) { _asm goto _startup _endasm } #pragma code _startup_scn void _startup (void) { _asm // Initialize the stack pointer lfsr 1, _stack lfsr 2, _stack clrf TBLPTRU, 0 // 1st silicon doesn't do this on POR bcf __FPFLAGS,RND,0 // Initalize rounding flag for floating point libs _endasm loop: // Call the user's main routine main (); goto loop; } /* end _startup() */
// // MJCandidatesPanel.h // MJ郑码 // // Created by MJsaka on 15/3/12. // Copyright (c) 2015年 MJsaka. All rights reserved. // #import <Cocoa/Cocoa.h> #import "MJInputController.h" @interface MJUIStyle : NSObject<NSCopying> { } @property (nonatomic, assign) BOOL horizontal; @property (nonatomic, assign) BOOL inlinePreedit; @property (nonatomic, copy) NSString* fontName; @property (nonatomic, assign) CGFloat fontSize; @property (nonatomic, assign) double alpha; @property (nonatomic, assign) double cornerRadius; @property (nonatomic, assign) double borderHeight; @property (nonatomic, assign) double borderWidth; @property (nonatomic, assign) double lineSpacing; @property (nonatomic, assign) double spacing; @property (nonatomic, copy) NSString *backgroundColor; @property (nonatomic, copy) NSString *highlightedBackgroundColor; @property (nonatomic, copy) NSString *textColor; @property (nonatomic, copy) NSString *candidateTextColor; @property (nonatomic, copy) NSString *highlightedTextColor; @property (nonatomic, copy) NSString *highlightedCandidateTextColor; @end @class MJCandidatesPanel; @interface MJCandidatesView : NSView { NSAttributedString* _content; } @property (nonatomic, retain) NSColor *backgroundColor; @property (nonatomic, assign) BOOL horizontal; @property (nonatomic, assign) double cornerRadius; @property (nonatomic, assign) double borderHeight; @property (nonatomic, assign) double borderWidth; -(NSSize)contentSize; -(void)setContent:(NSAttributedString*)content; @end @interface MJCandidatesPanel : NSObject { NSRect _positionRect; NSWindow *_window; MJCandidatesView *_view; NSMutableDictionary *_attrs; NSMutableDictionary *_highlightedAttrs; NSMutableDictionary *_labelAttrs; NSMutableDictionary *_labelHighlightedAttrs; NSMutableDictionary *_tipsAttrs; NSMutableDictionary *_tipsHighlightedAttrs; NSMutableDictionary *_preeditAttrs; NSMutableDictionary *_preeditHighlightedAttrs; NSParagraphStyle *_paragraphStyle; NSParagraphStyle *_preeditParagraphStyle; BOOL _horizontal; BOOL _inlinePreedit; } -(void)hide; -(void)updateCandidates:(NSArray*)candidates withTips:(NSArray*)tips withClasses:(NSArray*)classes atPosition:(NSRect)position selectIndex:(NSInteger)index; -(void)updateUIStyle:(MJUIStyle*)style; @end
//# GlobalProcessControl.h: Implementation of ACC/PLC ProcessControl class. //# //# Copyright (C) 2006 //# ASTRON (Netherlands Institute for Radio Astronomy) //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands //# //# This file is part of the LOFAR software suite. //# The LOFAR software suite is free software: you can redistribute it and/or //# modify it under the terms of the GNU General Public License as published //# by the Free Software Foundation, either version 3 of the License, or //# (at your option) any later version. //# //# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. //# //# $Id$ #ifndef LOFAR_BBSCONTROL_GLOBALPROCESSCONTROL_H #define LOFAR_BBSCONTROL_GLOBALPROCESSCONTROL_H // \file // Implementation of ACC/PLC ProcessControl class //# Includes #include <Common/lofar_smartptr.h> #include <PLC/ProcessControl.h> #include <ParmDB/Axis.h> #include <LMWCommon/VdsDesc.h> #include <BBSControl/Strategy.h> #include <BBSControl/CalSession.h> namespace LOFAR { namespace BBS { // \addtogroup BBSControl // @{ // Implementation of the ProcessControl interface for the global BBS // controller. class GlobalProcessControl : public ACC::PLC::ProcessControl { public: // Default constructor. GlobalProcessControl(); // Destructor. virtual ~GlobalProcessControl(); // @name Implementation of PLC interface. // @{ virtual tribool define(); virtual tribool init(); virtual tribool run(); virtual tribool release(); virtual tribool quit(); virtual tribool pause(const string& condition); virtual tribool snapshot(const string& destination); virtual tribool recover(const string& source); virtual tribool reinit(const string& configID); virtual string askInfo(const string& keylist); // @} private: enum State { UNDEFINED = -1, NEXT_CHUNK, NEXT_CHUNK_WAIT, RUN, FINALIZE, FINALIZE_WAIT, QUIT, //# Insert new types HERE !! N_State }; // Compare two axes for equality within a tolerance (using casa::near()). bool equal(const Axis::ShPtr &lhs, const Axis::ShPtr &rhs) const; // Get the global time axis and verify consistency across all parts. Axis::ShPtr getGlobalTimeAxis() const; // Assign an index to each kernel process starting from 0. The index is // sorted on start frequency. Also, each solver process is assigned an // index (starting from 0, sorted on worker id). void createWorkerIndex(); // Set run state to \a state void setState(State state); // Return the run state as a string. const string& showState() const; // State of the control process controller. State itsState; // The strategy that will be executed by this controller. Strategy itsStrategy; // Iterator used to iterate over the leaf-nodes (SingleSteps) of the // Strategy. StrategyIterator itsStrategyIterator; // Calibration session information. scoped_ptr<CalSession> itsCalSession; // Id of the command that the controller is waiting for. CommandId itsWaitId; CEP::VdsDesc itsVdsDesc; Axis::ShPtr itsGlobalTimeAxis; double itsFreqStart, itsFreqEnd; size_t itsTimeStart, itsTimeEnd; size_t itsChunkStart, itsChunkSize; }; // @} } // namespace BBS } // namespace LOFAR #endif
/* Copyright 2014 Ilya Zhuravlev This file is part of Acquisition. Acquisition 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. Acquisition 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 Acquisition. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <memory> #include <vector> #include <QSet> #include "item.h" #include "column.h" #include "bucket.h" class BuyoutManager; class Filter; class FilterData; class ItemsModel; class QTreeView; class QModelIndex; class Search { public: Search(BuyoutManager &bo, const std::string &caption, const std::vector<std::unique_ptr<Filter>> &filters, QTreeView *view); void FilterItems(const Items &items); void FromForm(); void ToForm(); void ResetForm(); const std::string &caption() const { return caption_; } const Items &items() const { return items_; } const std::vector<std::unique_ptr<Column>> &columns() const { return columns_; } const std::vector<std::unique_ptr<Bucket>> &buckets() const { return buckets_; } QString GetCaption(); int GetItemsCount(); bool IsAnyFilterActive() const; // Sets this search as current, will display items in passed QTreeView. void Activate(const Items &items); void RestoreViewProperties(); void SaveViewProperties(); ItemLocation GetTabLocation(const QModelIndex & index) const; private: void UpdateItemCounts(const Items &items); std::vector<std::unique_ptr<FilterData>> filters_; std::vector<std::unique_ptr<Column>> columns_; std::string caption_; Items items_; QTreeView *view_{nullptr}; BuyoutManager &bo_manager_; std::unique_ptr<ItemsModel> model_; std::vector<std::unique_ptr<Bucket>> buckets_; uint unfiltered_item_count_{0}; uint filtered_item_count_total_{0}; QSet<QString> expanded_property_; };
/* Copyright (C) 2014-2022 FastoGT. All right reserved. This file is part of FastoNoSQL. FastoNoSQL 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. FastoNoSQL 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 FastoNoSQL. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <vector> #include <QObject> #include <fastonosql/core/cluster/cluster_discovery_info.h> #include "proxy/connection_settings/iconnection_settings.h" namespace fastonosql { namespace gui { class DiscoveryConnection : public QObject { Q_OBJECT public: explicit DiscoveryConnection(proxy::IConnectionSettingsBaseSPtr conn, QObject* parent = Q_NULLPTR); Q_SIGNALS: void connectionResult(common::Error err, qint64 ms_time_execute, std::vector<core::ServerDiscoveryClusterInfoSPtr> infos); public Q_SLOTS: void routine(); private: common::time64_t elipsedTime() const; proxy::IConnectionSettingsBaseSPtr connection_; common::time64_t start_time_; }; } // namespace gui } // namespace fastonosql
#include <stdio.h> int main() { int num =0; while(num<=100) { printf("value of variable num is: %d\n", num); if (num==2) { break; } num++; } printf("Out of while-loop"); return 0; } /* value of variable num is: 0 value of variable num is: 1 value of variable num is: 2 Out of while-loop */
// ***************************************************************************** // glc_repmover.h Tao3D project // ***************************************************************************** // // File description: // // // // // // // // // ***************************************************************************** // This software is licensed under the GNU General Public License v3 // (C) 2011, Catherine Burvelle <catherine@taodyne.com> // (C) 2019, Christophe de Dinechin <christophe@dinechin.org> // (C) 2010-2011, Jérôme Forissier <jerome@taodyne.com> // (C) 2011, Soulisse Baptiste <soulisse@polytech.unice.fr> // ***************************************************************************** // This file is part of Tao3D // // Tao3D is free software: you can r 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. // // Tao3D 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 Tao3D, in a file named COPYING. // If not, see <https://www.gnu.org/licenses/>. // ***************************************************************************** //! \file glc_repmover.h Interface for the GLC_RepMover class. #ifndef GLC_REPMOVER_H_ #define GLC_REPMOVER_H_ #include <QColor> #include "../maths/glc_vector3d.h" #include "../maths/glc_matrix4x4.h" #include "../shading/glc_renderproperties.h" #include "../glc_config.h" class GLC_Viewport; ////////////////////////////////////////////////////////////////////// //! \class GLC_RepMover /*! \brief GLC_RepMover : Base class for all interactive manipulation representation*/ ////////////////////////////////////////////////////////////////////// class GLC_LIB_EXPORT GLC_RepMover { public: struct RepMoverInfo { QVector<GLC_Matrix4x4> m_MatrixInfo; QVector<GLC_Vector3d> m_VectorInfo; QVector<double> m_DoubleInfo; QVector<int> m_IntInfo; QVector<QString> m_StringInfo; }; public: //! Default constructor GLC_RepMover(GLC_Viewport*); //! Copy constructor GLC_RepMover(const GLC_RepMover&); //! Destructor virtual ~GLC_RepMover(); ////////////////////////////////////////////////////////////////////// /*! \name Get Functions*/ //@{ ////////////////////////////////////////////////////////////////////// public: //! Return the main Color inline QColor mainColor() {return m_MainColor;} //! Return a clone of the repmover virtual GLC_RepMover* clone() const= 0; //@} ////////////////////////////////////////////////////////////////////// /*! \name Set Functions*/ //@{ ////////////////////////////////////////////////////////////////////// //! Set representation main color virtual void setMainColor(const QColor& color); //! Set representation wire thickness virtual void setThickness(double thickness); //! Init the representation virtual void init(){} //! Update the representation virtual void update(){} //! Set the repMoverInfo of this rep void setRepMoverInfo(RepMoverInfo* pRepMoverInfo); //@} ////////////////////////////////////////////////////////////////////// /*! \name OpenGL Functions*/ //@{ ////////////////////////////////////////////////////////////////////// public: //! Representation OpenGL Execution void render(); protected: //! Virtual interface for OpenGL Geometry set up. virtual void glDraw()= 0; //@} ////////////////////////////////////////////////////////////////////// // Protected Members ////////////////////////////////////////////////////////////////////// protected: //! The viewport GLC_Viewport* m_pViewport; //! The rep main color QColor m_MainColor; //! The rep wire thickness double m_Thickness; //! The rep rendering properties GLC_RenderProperties m_RenderProperties; //! The repmover info of this rep RepMoverInfo* m_pRepMoverInfo; }; #endif /* GLC_REPMOVER_H_ */
#include <stdio.h> int main() { printf("Hello, World!"); return 0; }
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** 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 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. ** ****************************************************************************/ #pragma once #include <QWizardPage> namespace QmakeProjectManager { namespace Internal { namespace Ui { class TestWizardPage; } struct TestWizardParameters; /* TestWizardPage: Let's the user input test class name, slot * (for which a CLassNameValidatingLineEdit is abused) and file name. */ class TestWizardPage : public QWizardPage { Q_OBJECT public: explicit TestWizardPage(QWidget *parent = 0); ~TestWizardPage(); virtual bool isComplete() const; TestWizardParameters parameters() const; QString sourcefileName() const; public slots: void setProjectName(const QString &); private slots: void slotClassNameEdited(const QString&); void slotFileNameEdited(); void slotUpdateValid(); private: const QString m_sourceSuffix; const bool m_lowerCaseFileNames; Ui::TestWizardPage *ui; bool m_fileNameEdited; bool m_valid; }; } // namespace Internal } // namespace QmakeProjectManager
/* * Platformer Game Engine by Wohlstand, a free platform for game making * Copyright (c) 2014-2021 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 #ifndef TILESETITEMBUTTON_H #define TILESETITEMBUTTON_H #include <QFrame> #include <QGraphicsScene> #include <data_configs/data_configs.h> #include "../../defines.h" class TilesetItemButton : public QFrame { Q_OBJECT public: explicit TilesetItemButton(DataConfig* conf, QGraphicsScene *scene=0, QWidget *parent = 0); DataConfig *config() const; void setConfig(DataConfig *config); void applyItem(const int &type_i, const int &id, const int &width = -1, const int &height = -1); void applySize(const int &width, const int &height); ItemTypes::itemTypes itemType() const; unsigned int id() const; bool isItemSet(); signals: void clicked(int itemType, unsigned long id); public slots: protected: void paintEvent(QPaintEvent* ev); void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); private: DataConfig* m_config; ItemTypes::itemTypes m_itemType; unsigned int m_id; QPixmap m_drawItem; QGraphicsScene *scn; }; #endif // TILESETITEMBUTTON_H
#ifndef _HASHTABLE_H_ #define _HASHTABLE_H_ #include "typedefs.h" #include <stdlib.h> #include <string.h> typedef void (*DestroyFunction)(void* data); typedef uint32 (*HashFunction)(const char* key); // Hash Tables. typedef struct _TableEntry { char* key; void* val; } TableEntry; typedef struct _HashTable { int capacity; TableEntry* entries; HashFunction hashFunctor; DestroyFunction deFunctor; } HashTable; // Functions. void HashTableDestroy(HashTable* table); HashTable* HashTableCreate(uint32 size, HashFunction cFunctor=NULL, DestroyFunction dFunctor=NULL); int InsertEntry(HashTable* table, char* key, void* val); void* GetEntryFromHashTable(HashTable* table, char* key); #endif /* _HASHTABLE_H_ */
/* pop.h: Header file for the "pop.c" client POP3 protocol. Copyright (C) 1991, 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Jonathan Kamens, jik@security.ov.com. This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <stdio.h> #define GETLINE_MIN 1024 /* the getline buffer starts out this */ /* size */ #define GETLINE_INCR 1024 /* the getline buffer is grown by this */ /* size when it needs to grow */ extern char pop_error[]; extern int pop_debug; struct _popserver { int file, data; char *buffer; int buffer_size, buffer_index; int in_multi; int trash_started; }; typedef struct _popserver *popserver; /* * Valid flags for the pop_open function. */ #define POP_NO_KERBEROS (1<<0) #define POP_NO_HESIOD (1<<1) #define POP_NO_GETPASS (1<<2) #ifdef __STDC__ #define _ARGS(a) a #else #define _ARGS(a) () #endif extern popserver pop_open _ARGS((char *host, char *username, char *password, int flags)); extern int pop_stat _ARGS((popserver server, int *count, int *size)); extern int pop_list _ARGS((popserver server, int message, int **IDs, int **size)); extern int pop_retrieve _ARGS((popserver server, int message, int markfrom, char **)); extern int pop_retrieve_first _ARGS((popserver server, int message, char **response)); extern int pop_retrieve_next _ARGS((popserver server, char **line)); extern int pop_retrieve_flush _ARGS((popserver server)); extern int pop_top_first _ARGS((popserver server, int message, int lines, char **response)); extern int pop_top_next _ARGS((popserver server, char **line)); extern int pop_top_flush _ARGS((popserver server)); extern int pop_multi_first _ARGS((popserver server, char *command, char **response)); extern int pop_multi_next _ARGS((popserver server, char **line)); extern int pop_multi_flush _ARGS((popserver server)); extern int pop_delete _ARGS((popserver server, int message)); extern int pop_noop _ARGS((popserver server)); extern int pop_last _ARGS((popserver server)); extern int pop_reset _ARGS((popserver server)); extern int pop_quit _ARGS((popserver server)); extern void pop_close _ARGS((popserver)); #undef _ARGS /* arch-tag: 76cc5f58-8e86-48fa-bc72-a7c6cb1c4f1c (do not change this comment) */
/* * SyncDeviceService.h * * Contains definitions for the general sync properties and formats * * Copyright (c) Microsoft Corporation, All Rights Reserved. * */ #ifndef _SYNCDEVICESERVICE_H_ #define _SYNCDEVICESERVICE_H_ /*****************************************************************************/ /* Sync Service Properties */ /*****************************************************************************/ DEFINE_DEVSVCGUID(NAMESPACE_SyncSvc, 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16); /* PKEY_SyncSvc_SyncFormat * * Indicates the format GUID for the object format that is to be used in the * sync operation. * * Type: UInt128 * Form: None */ DEFINE_DEVSVCPROPKEY(PKEY_SyncSvc_SyncFormat, 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16, 2); #define NAME_SyncSvc_SyncFormat L"SyncFormat" /* PKEY_SyncSvc_LocalOnlyDelete * * Boolean flag indicating whether deletes of objects on the service host * should be treated as "local only" and not propogated to other sync * participants. The alternative is "true sync" in which deletes on the * service host are propogated to all other sync participants. * * Type: UInt8 * Form: None */ DEFINE_DEVSVCPROPKEY(PKEY_SyncSvc_LocalOnlyDelete, 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16, 3); #define NAME_SyncSvc_LocalOnlyDelete L"LocalOnlyDelete" /* PKEY_SyncSvc_FilterType * * Value describing type of the filter * * Type: UInt8 * Form: None */ DEFINE_DEVSVCPROPKEY(PKEY_SyncSvc_FilterType, 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16, 4); #define NAME_SyncSvc_FilterType L"FilterType" #define SYNCSVC_FILTER_NONE 0 #define SYNCSVC_FILTER_CONTACTS_WITH_PHONE 1 #define SYNCSVC_FILTER_TASK_ACTIVE 2 #define SYNCSVC_FILTER_CALENDAR_WINDOW_WITH_RECURRENCE 3 /* PKEY_SyncSvc_SyncObjectReferences * * Value describing whether object references should be included as part of * the sync process or not * * Type: UInt8 * Form: Enum */ DEFINE_DEVSVCPROPKEY(PKEY_SyncSvc_SyncObjectReferences, 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16, 5); #define NAME_SyncSvc_SyncObjectReferences L"SyncObjectReferences" #define ENUM_SyncSvc_SyncObjectReferencesDisabled 0x00 #define ENUM_SyncSvc_SyncObjectReferencesEnabled 0xff /*****************************************************************************/ /* Sync Service Object Properties */ /*****************************************************************************/ DEFINE_DEVSVCGUID(NAMESPACE_SyncObj, 0x37364f58, 0x2f74, 0x4981, 0x99, 0xa5, 0x7a, 0xe2, 0x8a, 0xee, 0xe3, 0x19); /* PKEY_SyncObj_LastAuthorProxyID * * Contains a GUID inidcating the proxy ID of the last proxy to author the * object * * Type: UInt128 * Form: None */ DEFINE_DEVSVCPROPKEY(PKEY_SyncObj_LastAuthorProxyID, 0x37364f58, 0x2f74, 0x4981, 0x99, 0xa5, 0x7a, 0xe2, 0x8a, 0xee, 0xe3, 0x19, 2); #define NAME_SyncObj_LastAuthorProxyID L"LastAuthorProxyID" /*****************************************************************************/ /* Sync Service Methods */ /*****************************************************************************/ /* METHOD_SyncSvc_BeginSync */ DEFINE_DEVSVCGUID(METHOD_SyncSvc_BeginSync, 0x63803e07, 0xc713, 0x45d3, 0x81, 0x19, 0x34, 0x79, 0xb3, 0x1d, 0x35, 0x92); #define NAME_SyncSvc_BeginSync L"BeginSync" /* METHOD_SyncSvc_EndSync */ DEFINE_DEVSVCGUID(METHOD_SyncSvc_EndSync, 0x40f3f0f7, 0xa539, 0x422e, 0x98, 0xdd, 0xfd, 0x8d, 0x38, 0x5c, 0x88, 0x49); #define NAME_SyncSvc_EndSync L"EndSync" #endif /* _SYNCDEVICESERVICE_H_ */
/* gus.mb, an open source flow solver. Copyright (C) 2016 Hiromasa Kato <hiromasa at gmail.com> This file is part of gus.mb. gus.mb 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. gus.mb 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/>. */ // $Id: BCFunctors.h 4 2010-03-06 14:10:00Z kato $ #ifndef INCLUDED_HIRO_BC_FUNCTORS_H__ #define INCLUDED_HIRO_BC_FUNCTORS_H__ #include "Block.h" #include "Structured.h" class BCFunctor { public: virtual ~BCFunctor() {} virtual void Apply( Structured<double> U, const Block& block ) = 0; protected: private: }; class BCInviscidWall : public BCFunctor { public: BCInviscidWall(const IndexRange& range, int direction); virtual ~BCInviscidWall(); virtual void Apply( Structured<double> U, const Block& block ); protected: private: IndexRange mRange; int mDirection; }; class BCExtrapolate : public BCFunctor { public: BCExtrapolate(int iin, int ighost); virtual ~BCExtrapolate(); virtual void Apply( Structured<double> U, const Block& block ); protected: private: int mIIn, mIGhost; }; #endif // INCLUDED_HIRO_BC_FUNCTORS_H__
/* * eltako_fud14.c * * Created on: Dec 24, 2016 * Author: jnevens */ #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <eu/log.h> #include <eu/variant_map.h> #include <libeltako/message.h> #include <libeltako/dimmer.h> #include "eltako.h" #include "action.h" #include "event.h" #include "device.h" #include "eltako_fud14.h" typedef struct { uint32_t address; uint8_t dim_value; uint8_t dim_direction; uint8_t dim_min_value; uint8_t dim_max_value; uint8_t dim_interval; } device_fud14_t; static bool fud14_device_parser(device_t *device, char *options[]) { if(options[1] != NULL) { device_fud14_t *fud14 = calloc(1, sizeof(device_fud14_t)); fud14->address = strtoll(options[1], NULL, 16); fud14->dim_value = 0; fud14->dim_direction = 1; fud14->dim_min_value = 0; fud14->dim_max_value = 100; fud14->dim_interval = 3; device_set_userdata(device, fud14); eu_log_debug("FUD14 device created (name: %s, address: 0x%x)", device_get_name(device), fud14->address); return true; } return false; } static bool fud14_device_exec(device_t *device, action_t *action, event_t *event) { device_fud14_t *fud14 = device_get_userdata(device); eltako_message_t *msg = NULL; eu_log_info("set fud14 device: %s, type: %s", device_get_name(device), action_type_to_char(action_get_type(action))); switch (action_get_type(action)) { case ACTION_SET: fud14->dim_value = (action_get_option(action, 1) != NULL) ? atoi(action_get_option(action, 1)) : 100; fud14->dim_direction = 0; msg = eltako_dimmer_create_message(fud14->address, DIMMER_EVENT_ON, fud14->dim_value, 1, false); break; case ACTION_UNSET: msg = eltako_dimmer_create_message(fud14->address, DIMMER_EVENT_OFF, 0, 1, false); fud14->dim_value = 0; fud14->dim_direction = 1; break; case ACTION_TOGGLE: { int max_dim_value = (action_get_option(action, 1) != NULL) ? atoi(action_get_option(action, 1)) : 100; fud14->dim_value = (fud14->dim_value > 0) ? 0 : max_dim_value; msg = eltako_dimmer_create_message(fud14->address, (fud14->dim_value > 0) ? DIMMER_EVENT_ON : DIMMER_EVENT_OFF, fud14->dim_value, 1, false); fud14->dim_direction = !!!fud14->dim_value; break; } case ACTION_DIM: if (fud14->dim_direction == 1) { fud14->dim_value += fud14->dim_interval; } else { fud14->dim_value -= fud14->dim_interval; } if (fud14->dim_value >= fud14->dim_max_value) { fud14->dim_value = fud14->dim_max_value; fud14->dim_direction = 0; } if (fud14->dim_value <= fud14->dim_min_value) { fud14->dim_value = fud14->dim_min_value; fud14->dim_direction = 1; } msg = eltako_dimmer_create_message(fud14->address, DIMMER_EVENT_ON, 100, 1, false); break; default: return false; } eu_log_info("set fud14 device: %s, type: %s, new value: %d", device_get_name(device), action_type_to_char(action_get_type(action)), fud14->dim_value); bool rv = eltako_send(msg); device_trigger_event(device, (fud14->dim_value > 0) ? EVENT_SET : EVENT_UNSET ); return rv; } static bool fud14_device_check(device_t *device, condition_t *condition) { device_fud14_t *fud14 = device_get_userdata(device); switch (condition_get_type(condition)) { eu_log_debug("condition: %s, current value: %d", condition_type_to_char(condition_get_type(condition)), fud14->dim_value); case CONDITION_SET: return (fud14->dim_value > 0) ? true : false; break; case CONDITION_UNSET: return (fud14->dim_value == 0) ? true : false; break; } return false; } static bool fud14_device_state(device_t *device, eu_variant_map_t *state) { device_fud14_t *fud14 = device_get_userdata(device); eu_variant_map_set_int32(state, "value", fud14->dim_value); return true; } static void fud14_device_cleanup(device_t *device) { device_fud14_t *fud14 = device_get_userdata(device); free(fud14); } static bool fud14_device_store(device_t *device, eu_variant_map_t *state) { device_fud14_t *fud14 = device_get_userdata(device); eu_variant_map_set_int32(state, "value", fud14->dim_value); return true; } static bool fud14_device_restore(device_t *device, eu_variant_map_t *state) { device_fud14_t *fud14 = device_get_userdata(device); fud14->dim_value = eu_variant_map_get_int32(state, "value"); return true; } static device_type_info_t fud14_info = { .name = "FUD14", .events = 0, .actions = ACTION_SET | ACTION_UNSET | ACTION_TOGGLE | ACTION_DIM, .conditions = CONDITION_SET | CONDITION_UNSET, .check_cb = fud14_device_check, .parse_cb = fud14_device_parser, .exec_cb = fud14_device_exec, .state_cb = fud14_device_state, .store_cb = fud14_device_store, .restore_cb = fud14_device_restore, .cleanup_cb = fud14_device_cleanup, }; bool eltako_fud14_init(void) { device_type_register(&fud14_info); return true; }
#ifndef CYGONCE_HAL_HAL_DIAG_H #define CYGONCE_HAL_HAL_DIAG_H /*============================================================================= // // hal_diag.h // // HAL Support for Kernel Diagnostic Routines // //============================================================================= //####ECOSGPLCOPYRIGHTBEGIN#### // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. // // eCos is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 or (at your option) any later version. // // eCos is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License // for more details. // // You should have received a copy of the GNU General Public License along // with eCos; if not, write to the Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. // // As a special exception, if other files instantiate templates or use macros // or inline functions from this file, or you compile this file and link it // with other works to produce a work based on this file, this file does not // by itself cause the resulting work to be covered by the GNU General Public // License. However the source code for this file must still be made available // in accordance with section (3) of the GNU General Public License. // // This exception does not invalidate any other reasons why a work based on // this file might be covered by the GNU General Public License. // // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. // at http://sources.redhat.com/ecos/ecos-license/ // ------------------------------------------- //####ECOSGPLCOPYRIGHTEND#### //============================================================================= //#####DESCRIPTIONBEGIN#### // // Author(s): hmt // Contributors: hmt // Date: 1999-01-11 // Purpose: HAL Support for Kernel Diagnostic Routines // Description: Diagnostic routines for use during kernel development. // Usage: #include <cyg/hal/hal_diag.h> // //####DESCRIPTIONEND#### // //===========================================================================*/ #include <pkgconf/hal.h> #include <cyg/infra/cyg_type.h> /*---------------------------------------------------------------------------*/ #define CYG_DIAG_USE_ERC32 /*---------------------------------------------------------------------------*/ #ifdef CYG_DIAG_USE_ERC32 /*---------------------------------------------------------------------------*/ /* Register addresses */ #define SPARC_MEC_UART (0x01f800e0) /* These must be accessed word-wide to work! */ #define SPARC_MEC_UART_IO( x ) ((cyg_uint32)(x)) #define SPARC_MEC_UART_A_RX ((volatile cyg_uint32 *)(SPARC_MEC_UART + 0)) #define SPARC_MEC_UART_A_TX ((volatile cyg_uint32 *)(SPARC_MEC_UART + 0)) #define SPARC_MEC_UART_B_RX ((volatile cyg_uint32 *)(SPARC_MEC_UART + 4)) #define SPARC_MEC_UART_B_TX ((volatile cyg_uint32 *)(SPARC_MEC_UART + 4)) #define SPARC_MEC_UART_STATUS ((volatile cyg_uint32 *)(SPARC_MEC_UART + 8)) #define SPARC_MEC_UART_RXAMASK (0x00006) #define SPARC_MEC_UART_RXBMASK (0x60000) #define SPARC_MEC_UART_TXAMASK (0x00001) #define SPARC_MEC_UART_TXBMASK (0x10000) /*---------------------------------------------------------------------------*/ #define HAL_DIAG_INIT() #define HAL_DIAG_WRITE_CHAR(_c_) \ { \ if( 1 || _c_ != '\r' ) \ { \ while( (SPARC_MEC_UART_RXAMASK & *SPARC_MEC_UART_STATUS) == 0 ) \ continue; \ *SPARC_MEC_UART_A_TX = SPARC_MEC_UART_IO(_c_); \ } \ } #define HAL_DIAG_READ_CHAR(_c_) \ { \ while( (SPARC_MEC_UART_TXAMASK & *SPARC_MEC_UART_STATUS) == 0 ) \ continue; \ _c_ = (char)*SPARC_MEC_UART_A_TX; \ } #define XHAL_DIAG_WRITE_CHAR(_c_) \ { \ if( _c_ != '\r' ) \ { \ *SPARC_MEC_UART_A_TX = SPARC_MEC_UART_IO(_c_); \ } \ } #define XHAL_DIAG_READ_CHAR(_c_) \ { \ _c_ = (char)*SPARC_MEC_UART_A_TX; \ } #else /*---------------------------------------------------------------------------*/ /* There is no diagnostic output on SPARCLITE simulator */ #define HAL_DIAG_INIT() #define HAL_DIAG_WRITE_CHAR(_c_) #define HAL_DIAG_READ_CHAR(_c_) (_c_) = 0 #endif /*---------------------------------------------------------------------------*/ /* end of hal_diag.h */ #endif /* CYGONCE_HAL_HAL_DIAG_H */
#pragma once #include "OutputManagerBase.h" #include "../mathutils/math_util.h" #include "gnuplot/gnuplot_i.h" template <typename data_type> /** * @brief The GnuplotOutput class * * Affichage de tableaux de samples avec gnuplot. * (les buffers sont passés en sortie) */ class GnuplotOutput:public OutputManagerBase<data_type> { using IOManagerBase<data_type>::v; using IOManagerBase<data_type>::channels; using IOManagerBase<data_type>::frames; private: gnuplot_ctrl *h = nullptr; Output_p outputImpl = nullptr; public: GnuplotOutput(OutputManagerBase<data_type>* output, Parameters<data_type>& cfg): OutputManagerBase<data_type>(nullptr, cfg), outputImpl(output) { h = gnuplot_init(); gnuplot_setstyle(h, "lines"); } virtual ~GnuplotOutput() { gnuplot_close(h); } GnuplotOutput(const GnuplotOutput&) = delete; GnuplotOutput& operator=(const GnuplotOutput&) = delete; virtual void writeNextBuffer(Audio_p& data) override { auto& buffer = getAudio<data_type>(data); for(auto& channel : buffer) { gnuplot_resetplot(h); gnuplot_plot_x(h, channel.data(), channel.size(), "Plot"); sleep(3); } outputImpl->writeNextBuffer(data); } };
#pragma once #include "Resource.h" // CDlgTranslateAll ¶Ô»°¿ò class VGDEP_EXPORT CDlgTranslateAll : public CDialog { DECLARE_DYNAMIC(CDlgTranslateAll) public: CDlgTranslateAll(CWnd* pParent = NULL); // ±ê×¼¹¹Ô캯Êý virtual ~CDlgTranslateAll(); // ¶Ô»°¿òÊý¾Ý enum { IDD = IDD_TRANSALL }; vgKernel::Vec3 getTranslateVec() { return vgKernel::Vec3( m_fltTransX , m_fltTransY , m_fltTransZ ); } protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Ö§³Ö DECLARE_MESSAGE_MAP() private: float m_fltTransX; float m_fltTransY; float m_fltTransZ; afx_msg void OnBnClickedOk(); public: float m_tranX; };
/* Noobish Noobsicle wrote this IPS patching code Adapted to C by RocketRobz */ #include <nds/ndstypes.h> #include <nds/memory.h> #include "nds_header.h" #include "locations.h" #include "tonccpy.h" extern u32 consoleModel; extern bool extendedMemoryConfirmed; void applyIpsPatch(const tNDSHeader* ndsHeader, u8* ipsbyte, bool arm9Only, bool higherMem, bool ROMinRAM) { const char* romTid = getRomTid(ndsHeader); bool doLow = (strncmp(romTid, "VKG", 3) == 0); int ipson = 5; int totalrepeats = 0; u32 offset = 0; void* rombyte = 0; while (1) { offset = ipsbyte[ipson] * 0x10000 + ipsbyte[ipson + 1] * 0x100 + ipsbyte[ipson + 2]; if (offset >= ndsHeader->arm9romOffset && ((offset < ndsHeader->arm9romOffset+ndsHeader->arm9binarySize) || arm9Only)) { // ARM9 binary rombyte = ndsHeader->arm9destination - ndsHeader->arm9romOffset; } else if (offset >= ndsHeader->arm7romOffset && offset < ndsHeader->arm7romOffset+ndsHeader->arm7binarySize) { // ARM7 binary rombyte = ndsHeader->arm7destination - ndsHeader->arm7romOffset; } else if (offset >= ndsHeader->arm9romOffset+ndsHeader->arm9binarySize && offset < ndsHeader->arm7romOffset) { // Overlays rombyte = (void*)(higherMem ? ROM_SDK5_LOCATION : ROM_LOCATION); if (extendedMemoryConfirmed) { rombyte = (void*)ROM_LOCATION_EXT; } else if (consoleModel == 0 && higherMem) { rombyte = (void*)retail_CACHE_ADRESS_START_SDK5; if (doLow) { rombyte = (void*)CACHE_ADRESS_START_low; } } rombyte -= ndsHeader->arm9romOffset+ndsHeader->arm9binarySize; } ipson += 3; if (ipsbyte[ipson] * 256 + ipsbyte[ipson + 1] == 0) { ipson += 2; totalrepeats = ipsbyte[ipson] * 256 + ipsbyte[ipson + 1]; ipson += 2; u8 repeatbyte[totalrepeats]; for (int ontime = 0; ontime < totalrepeats; ontime++) { repeatbyte[ontime] = ipsbyte[ipson]; } tonccpy(rombyte+offset, repeatbyte, totalrepeats); ipson++; } else { totalrepeats = ipsbyte[ipson] * 256 + ipsbyte[ipson + 1]; ipson += 2; tonccpy(rombyte+offset, ipsbyte+ipson, totalrepeats); ipson += totalrepeats; } if (ipsbyte[ipson] == 69 && ipsbyte[ipson + 1] == 79 && ipsbyte[ipson + 2] == 70) { break; } } }
/* * File: SorolletConstants.h * Author: sole * * Created on 27 February 2010, 00:18 */ #ifndef _SOROLLETCONSTANTS_H #define _SOROLLETCONSTANTS_H enum { NOTE_NULL = -1, NOTE_OFF = -2, INSTRUMENT_NULL = -1, VOLUME_NULL = -1, EFFECT_NULL = -1 }; #endif /* _SOROLLETCONSTANTS_H */
//TITLE: ENEMY_ATTRIBUTES_H //PROJECT: DON´T CRUSH MY CASTLE //AUTHOR: Andrés Ortiz //VERSION: 0.7.6 //DESCRIPTION: defines each kind of enemy #ifndef ENEMY_ATTRIBUTES #define ENEMY_ATTRIBUTES #include "al_anim.h" #include <map> const string enemy_xml_value="Enemy"; enum enemy_animation {idle_anim,up_anim,down_anim,left_anim,right_anim,dead_anim}; //defines each animation for an enemy //defines the basic characteristics of an enemy kind struct enemy_attributes { map<enemy_animation,al_anim> animation; //stores all animations of an enemy string name; //name of the enemy double speed; //basic speed (pixels per seconds) unsigned int max_life; //max (and initial) life of enemy unsigned int armor; //armor of the enemy unsigned int reward; //reward when killed //CONSTRUCTORS //default constructor enemy_attributes(); //constructor from xml element enemy_attributes(const XMLElement *enemy_root,const ALLEGRO_TIMER *timer); //full constructor without animations enemy_attributes(const string &name,unsigned int life,unsigned int armor,double enemy_speed,unsigned int reward=0); //full constructor with animations enemy_attributes(const string &name,unsigned int life,unsigned int armor,double enemy_speed,const map<enemy_animation,al_anim> &animation,unsigned int reward=0); //DESTRUCTOR ~enemy_attributes(); //METHODS //reads xml element bool read_xml(const XMLElement *enemy_root,const ALLEGRO_TIMER *timer); //reads from xml file (with enemy xml element as root) bool read_xml(const string &filename,const ALLEGRO_TIMER *timer); //insert animation (erasing previous animations and reseting all counters) void insert_animation(enemy_animation type,const al_anim &anim); //clear all attributes (dont destroy bitmaps) void clear(); //destroy all animations and clear data void destroy(); //returns true if the enemy has all the necessary info bool check() const; }; #endif
/* ---------------------------------------------------------------------- * Copyright (C) 2010-2013 ARM Limited. All rights reserved. * * $Date: 16. October 2013 * $Revision: V1.4.2 * * Project: CMSIS DSP Library * Title: arm_mat_add_q15.c * * Description: Q15 matrix addition * * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * - Neither the name of ARM LIMITED nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * -------------------------------------------------------------------- */ #include "arm_math.h" /** * @ingroup groupMatrix */ /** * @addtogroup MatrixAdd * @{ */ /** * @brief Q15 matrix addition. * @param[in] *pSrcA points to the first input matrix structure * @param[in] *pSrcB points to the second input matrix structure * @param[out] *pDst points to output matrix structure * @return The function returns either * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. * * <b>Scaling and Overflow Behavior:</b> * \par * The function uses saturating arithmetic. * Results outside of the allowable Q15 range [0x8000 0x7FFF] will be saturated. */ arm_status arm_mat_add_q15( const arm_matrix_instance_q15 * pSrcA, const arm_matrix_instance_q15 * pSrcB, arm_matrix_instance_q15 * pDst) { q15_t *pInA = pSrcA->pData; /* input data matrix pointer A */ q15_t *pInB = pSrcB->pData; /* input data matrix pointer B */ q15_t *pOut = pDst->pData; /* output data matrix pointer */ uint16_t numSamples; /* total number of elements in the matrix */ uint32_t blkCnt; /* loop counters */ arm_status status; /* status of matrix addition */ #ifdef ARM_MATH_MATRIX_CHECK /* Check for matrix mismatch condition */ if((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || (pSrcA->numCols != pDst->numCols)) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; } else #endif /* #ifdef ARM_MATH_MATRIX_CHECK */ { /* Total number of samples in the input matrix */ numSamples = (uint16_t) (pSrcA->numRows * pSrcA->numCols); #ifndef ARM_MATH_CM0_FAMILY /* Run the below code for Cortex-M4 and Cortex-M3 */ /* Loop unrolling */ blkCnt = (uint32_t) numSamples >> 2u; /* First part of the processing with loop unrolling. Compute 4 outputs at a time. ** a second loop below computes the remaining 1 to 3 samples. */ while(blkCnt > 0u) { /* C(m,n) = A(m,n) + B(m,n) */ /* Add, Saturate and then store the results in the destination buffer. */ *__SIMD32(pOut)++ = __QADD16(*__SIMD32(pInA)++, *__SIMD32(pInB)++); *__SIMD32(pOut)++ = __QADD16(*__SIMD32(pInA)++, *__SIMD32(pInB)++); /* Decrement the loop counter */ blkCnt--; } /* If the blockSize is not a multiple of 4, compute any remaining output samples here. ** No loop unrolling is used. */ blkCnt = (uint32_t) numSamples % 0x4u; /* q15 pointers of input and output are initialized */ while(blkCnt > 0u) { /* C(m,n) = A(m,n) + B(m,n) */ /* Add, Saturate and then store the results in the destination buffer. */ *pOut++ = (q15_t) __QADD16(*pInA++, *pInB++); /* Decrement the loop counter */ blkCnt--; } #else /* Run the below code for Cortex-M0 */ /* Initialize blkCnt with number of samples */ blkCnt = (uint32_t) numSamples; /* q15 pointers of input and output are initialized */ while(blkCnt > 0u) { /* C(m,n) = A(m,n) + B(m,n) */ /* Add, Saturate and then store the results in the destination buffer. */ *pOut++ = (q15_t) __SSAT(((q31_t) * pInA++ + *pInB++), 16); /* Decrement the loop counter */ blkCnt--; } #endif /* #ifndef ARM_MATH_CM0_FAMILY */ /* set status as ARM_MATH_SUCCESS */ status = ARM_MATH_SUCCESS; } /* Return to application */ return (status); } /** * @} end of MatrixAdd group */
/* gstyle-utils.h * * Copyright 2016 sebastien lafargue <slafargue@gnome.org> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * SPDX-License-Identifier: GPL-3.0-or-later */ #pragma once #include <glib.h> #include <cairo.h> #include <gtk/gtk.h> #include <gdk/gdk.h> #include "gstyle-color.h" G_BEGIN_DECLS gboolean gstyle_str_empty0 (const gchar *str); gboolean gstyle_utf8_is_spaces (const gchar *str); void draw_cairo_round_box (cairo_t *cr, GdkRectangle rect, gint tl_radius, gint tr_radius, gint bl_radius, gint br_radius); void gstyle_utils_get_rect_resized_box (GdkRectangle src_rect, GdkRectangle *dst_rect, GtkBorder *offset); cairo_pattern_t *gstyle_utils_get_checkered_pattern (void); void gstyle_utils_get_contrasted_rgba (GdkRGBA rgba, GdkRGBA *dst_rgba); gboolean gstyle_utils_is_array_contains_same_color (GPtrArray *ar, GstyleColor *color); static inline guint32 pack_rgba24 (GdkRGBA *rgba) { guint red, green, blue, alpha; guint32 result; alpha = CLAMP (rgba->alpha * 255, 0, 255); red = CLAMP (rgba->red * 255, 0, 255); green = CLAMP (rgba->green * 255, 0, 255); blue = CLAMP (rgba->blue * 255, 0, 255); result = (alpha << 24) | (red << 16) | (green << 8) | blue; return result; } static inline void unpack_rgba24 (guint32 val, GdkRGBA *rgba) { rgba->blue = (val & 0xFF) / 255.0; val >>= 8; rgba->green = (val & 0xFF) / 255.0; val >>= 8; rgba->red = (val & 0xFF) / 255.0; val >>= 8; rgba->alpha = (val & 0xFF) / 255.0; } static inline gboolean gstyle_utils_cmp_border (GtkBorder border1, GtkBorder border2) { if (border1.left != border2.left || border1.right != border2.right || border1.top != border2.top || border1.bottom != border2.bottom) return FALSE; else return TRUE; } #define gstyle_clear_weak_pointer(ptr) g_clear_weak_pointer(ptr) #define gstyle_set_weak_pointer(ptr,obj) g_set_weak_pointer(ptr,obj) /* A more type-correct form of gstyle_clear_pointer(), to help find bugs. */ #define gstyle_clear_pointer(pptr, free_func) \ G_STMT_START { \ G_STATIC_ASSERT (sizeof (*(pptr)) == sizeof (gpointer)); \ typeof(*(pptr)) _dzl_tmp_clear = *(pptr); \ *(pptr) = NULL; \ if (_dzl_tmp_clear) \ free_func (_dzl_tmp_clear); \ } G_STMT_END G_END_DECLS
// See also ColumnSelecctor script // After I posted the ColumnSelector script @71notout replied... // @Richardbishop Cool - now 2 add further complication, what if the 6 cols were in an attached data table? // this is the bit I'm struggling with. // @Richardbishop Data table created from spreadsheet pre test exec // Data flows chronologically hence need to use col 1, then 2, then 3, etc. // After these tweets, I updated the script so that it used an external CSV file for the data. [ExternalData.csv] // // The CSV file looked like this..... // Column_1,Column_2,Column_3,Column_4,Column_5,Column_6 // One,Two,Three,Four,Five,Six // Instead of strings called sColumn_1, sColumn_2 etc, I used parameters called pColumn_1, pColumn_2 etc. Action() { int iIteration; //iIteration used to hold the iteration number as an integer char cStringName[64]; //cStringName is a char value to hold the string name iIteration = atoi (lr_eval_string( "{pIteration}" )); // Convert the parameter pIteration into an integer iIteration sprintf(cStringName, "{pColumn_%d}", iIteration); // Create the string name based on a suffix with the iteration number as a prefix //Write out the iteration number and the name of the string for this iteration lr_output_message("Iteration is [%s], String used is %s", lr_eval_string( "{pIteration}" ),cStringName ); //Write out the contents of the string for this iteration lr_output_message("Value of %s is [%s]",cStringName, lr_eval_string(cStringName)); return 0; }
/* * Copyright 2013-2014 Giulio Camuffo <giuliocamuffo@gmail.com> * * This file is part of Orbital * * Orbital 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. * * Orbital 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 Orbital. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ORBITAL_INTERFACE_H #define ORBITAL_INTERFACE_H #include <type_traits> #include <QObject> struct wl_interface; struct wl_client; struct wl_global; namespace Orbital { class Interface; class Compositor; class Object : public QObject { Q_OBJECT public: explicit Object(QObject *p = nullptr); virtual ~Object(); void addInterface(Interface *iface); template <class T> T *findInterface() const; private: QList<Interface *> m_ifaces; }; class Interface : public QObject { Q_OBJECT public: explicit Interface(QObject *p = nullptr); virtual ~Interface() {} Object *object() const { return m_obj; } protected: virtual void added() {} private: Object *m_obj; friend class Object; }; class Global { public: Global(Compositor *c, const wl_interface *i, uint32_t version); virtual ~Global(); protected: virtual void bind(wl_client *client, uint32_t version, uint32_t id) = 0; private: wl_global *m_global; }; template <class T> T *Object::findInterface() const { static_assert(std::is_base_of<Interface, T>::value, "T is not derived from Interface."); for (Interface *iface: m_ifaces) { if (T *t = qobject_cast<T *>(iface)) { return t; } } return nullptr; } } #endif
/* * This file is part of eSolid. * * Copyright (C) 2010 - 2013 Nenad Radulovic * * eSolid is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * eSolid 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 eSolid. If not, see <http://www.gnu.org/licenses/>. * * web site: http://github.com/nradulovic * e-mail : nenad.b.radulovic@gmail.com *//***********************************************************************//** * @file * @author Nenad Radulovic * @brief Family profile for ST-Microelectronics STM32F10x * @addtogroup arm-none-eabi-gcc * @brief Family profile for ST-Microelectronics STM32F10x *********************************************************************//** @{ */ /**@defgroup arm-none-eabi-gcc-stm32f10x ST-Microelectronics STM32F10x * @brief ST-Microelectronics STM32F10x * @{ *//*--------------------------------------------------------------------*/ #ifndef ES_PROFILE_H_ #define ES_PROFILE_H_ /*========================================================= INCLUDE FILES ==*/ #include "arch/cortex_m3.h" /*=============================================================== MACRO's ==*/ /**@brief Specifies maximum CPU clock speed in Hz. */ #define ES_PROFILE_MAX_CPU_CLOCK 24000000ul /**@brief System timer maximum value * @details STM32F10x family has 24-bit wide system tick register */ #define ES_PROFILE_MAX_SYSTIMER_VAL 0xfffffful /**@brief Maximum RAM size for this family * @details This define is used to choose optimal algorithm for this family * of micro-controllers. */ #define ES_PROFILE_MAX_RAM_SIZE 8192u #if !defined(ES_OPTIMIZE_FOR_SPEED) #define ES_RAM_SIZE_MAX 65535 #define ES_RAM_SSIZE_MAX 32767 #define ES_RAM_SSIZE_MIN -32768 #else #define ES_RAM_SIZE_MAX 4294967295ul #define ES_RAM_SSIZE_MAX 2147483647l #define ES_RAM_SSIZE_MIN -2147483648l #endif /* !ES_OPTIMIZE_FOR_SPEED */ /**@brief Port constant: interrupt priority bits implemented in MCU * @note It is also recommended to ensure that all priority bits are * assigned as being preemption priority bits, and none as sub * priority bits */ #define PORT_ISR_PRIO_BITS 4u /*------------------------------------------------------- C++ extern base --*/ #ifdef __cplusplus extern "C" { #endif /*============================================================ DATA TYPES ==*/ typedef unsigned int esRamSize; typedef signed int esRamSSize; /*====================================================== GLOBAL VARIABLES ==*/ /*=================================================== FUNCTION PROTOTYPES ==*/ /*-------------------------------------------------------- C++ extern end --*/ #ifdef __cplusplus } #endif /*================================*//** @cond *//*== CONFIGURATION ERRORS ==*/ /** @endcond *//** @} *//** @} *//********************************************* * END of profile.h ******************************************************************************/ #endif /* ES_PROFILE_H_ */
/* This file is part of QDeviceMonitor. QDeviceMonitor 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. QDeviceMonitor 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 QDeviceMonitor. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DEVICEWIDGET_H #define DEVICEWIDGET_H #include "ui_DeviceWidget.h" #include "devices/DeviceFacade.h" #include "ui/colors/ColorTheme.h" #include <QPalette> #include <QPointer> #include <QSharedPointer> #include <QTextStream> #include <QWidget> namespace Ui { class DeviceWidget; } class DeviceWidget : public QWidget { Q_OBJECT QSharedPointer<Ui::DeviceWidget> m_ui; QPalette m_defaultTextEditPalette; QPalette m_redPalette; QPointer<DeviceFacade> m_deviceFacade; QString m_id; QTextStream m_textStream; QString m_stringStream; QString m_currentLogFileName; public: explicit DeviceWidget(QPointer<QWidget> parent, QPointer<DeviceFacade> deviceFacade, const QString& id); ~DeviceWidget() override; void hideVerbosity(); inline QLineEdit& getFilterLineEdit() const { return *(m_ui->filterLineEdit); } inline QTextEdit& getTextEdit() const { return *(m_ui->textEdit); } inline int getVerbosityLevel() const { return m_ui->verbositySlider->value(); } void highlightFilterLineEdit(bool red); void maybeScrollTextEditToEnd(); void addText(const ColorTheme::ColorType color, const QStringRef& text); void addText(const QColor& color, const QStringRef& text); void flushText(); void clearTextEdit(); void onLogFileNameChanged(const QString& logFileName); void focusFilterInput(); void markLog(); void clearLog(); void openLogFile(); signals: void verbosityLevelChanged(const int level); public slots: void on_verbositySlider_valueChanged(const int value); void on_wrapCheckBox_toggled(const bool checked); void on_scrollLockCheckBox_toggled(const bool checked); void on_openLogFileButton_clicked(); void on_markLogButton_clicked(); private: void updateTextEditPalette(); void scrollTextEditToEnd(); }; #endif // DEVICEWIDGET_H
#pragma once #include "../Observer/Subject.h" #include "../DataStruct/Primitives.h" #include "../DataStruct/IocpStruct.h" #include "../AsyNetRemoteClient/AsyNetRemoteClient.h" #include <mswsock.h> #include <winsock2.h> namespace nsIocpServerClientNet { class CAsyNetListener :public AsyOperateBase, /* ´ÓÍê³É¶Ë¿ÚÖÐÈ¡³öÊý¾Ý½øÐвÙ×÷ */ public CSubject, /*½«Á¬½ÓÓû§×÷Ϊ×Ô¼ºµÄ¹Û²ìÕß*/ public IObserver /*×÷ΪÁ¬½ÓÓû§µÄ¹Û²ìÕß*/ { private: CSmartSocketHandle m_listenerSocket; std::shared_ptr<IThreadPool> m_pThreadPool; CCriticalMutex m_criticalMutexLock; LPFN_ACCEPTEX m_lpfnAcceptEx;; LPFN_GETACCEPTEXSOCKADDRS m_lpfnGetAcceptExSockAddrs; LPFN_DISCONNECTEX m_lpfnDisconnectEx; std::list<std::unique_ptr<PER_IO_CONTEXT>> m_lstReuseAcceptCtx; std::list<std::unique_ptr<PER_IO_CONTEXT>> m_lstCurrentUseAcceptCtx; public: CAsyNetListener(std::shared_ptr<IThreadPool> pThreadPool); //Íⲿ´´½¨µÄÏß³Ì³Ø ÓÃÓÚÌí¼Ó Ì×½Ó×ÖÉ豸 ~CAsyNetListener(); public: bool Operate(bool bRet, DWORD dwBytesTransfered, void* pParam); void OpenSocket(const char* pStrIP, const UINT nPort, const bool bTcp = true); void CloseSocket(); void Listen(); //ÓÃÒì³£ ´úÌæ·µ»ØÖµ void ReturnAccpetCtx(LPPER_IO_CONTEXT &pIOCtx); void PostAcceptEx(LPPER_IO_CONTEXT &pIOCtx); void DoAcceptEx(LPPER_IO_CONTEXT &pIOCtx); void UpdateAcceptCtxList(CSmartSocketHandle* pRemoteSock); void Notify(const NOTISY_MSG_TYPE iMessage, void* pParam1, void* pParam2); void DoIOError(LPPER_IO_CONTEXT &pIOCtx); }; }
#ifndef _SLICE_H #define _SLICE_H #include <stdlib.h> #include <stdint.h> struct slice_s { void *x; uint32_t n; uint32_t max; uint32_t width; }; typedef struct slice_s *Slice; Slice slice_ctor(size_t width, size_t n, size_t max); void slice_dtor(Slice *s); void slice_copy(Slice dst, Slice src); Slice slice_append(Slice s, void *next, int m); Slice slice(Slice s, int st, int en); #endif
#ifndef GAMEMAP_H #define GAMEMAP_H #include<OgreSceneManager.h> #include<OgreEntity.h> #include<OgreManualObject.h> #include "maptile.h" #include "gamedefines.h" #include "tilesetmanager.h" struct MapInfo { int factor1, factor2, factor3, factor4, size, corrode, torchChance; }; class GameMap { public: GameMap(int, int, Biome, Ogre::SceneManager*, TileSetManager*); virtual ~GameMap(); bool checkCollision(int, int); protected: MapTile ***mMap; int mXSize, mYSize; Ogre::SceneManager *mMgr; Ogre::ManualObject *mMObject; TileSetManager *mTileSetMgr; boost::rand48 mRng; std::vector<Ogre::Light *> mLights; int getRelX(int x, TileSide side) { return x - (side == LEFT) + (side == RIGHT); } int getRelY(int y, TileSide side) { return y - (side == DOWN) + (side == UP); } void drawSurface(TileSide, int, int, bool, uint32_t *); int analyzeDestroyed(int x, int y, int r); void setAllStoredState(); void updateManualObject(void); void updateTorches(); bool getBoundedDestroyed(int x, int y, TileSide side = TOP, bool existsCheck = false); TileSide flipDirection(TileSide side); int getBoundedX(int v, int b) {return std::min(mXSize-b, std::max(b, v));}; int getBoundedY(int v, int b) {return std::min(mYSize-b, std::max(b, v));}; void generateMap(Biome, struct MapInfo); void generateTunnel(int xf, int yf, int xt, int yt, int maxJitter, int jitterChance); }; #endif // GAMEMAP_H
// // GBAppDelegate.h // GT-Buses // // Created by Alex Perez on 2/4/14. // Copyright (c) 2014 Alex Perez. All rights reserved. // @import UIKit; @class GBRootViewController; @interface GBAppDelegate : UIResponder <UIApplicationDelegate> @property (nonatomic, strong) GBRootViewController *viewController; @property (nonatomic, strong) UIWindow *window; @end
/* * This is bin2c program, which allows you to convert binary file to * C language array, for use as embedded resource, for instance you can * embed graphics or audio file directly into your program. * This is public domain software, use it on your own risk. * Contact Serge Fukanchik at fuxx@mail.ru if you have any questions. * * Some modifications were made by Gwilym Kuiper (kuiper.gwilym@gmail.com) * I have decided not to change the licence. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #ifdef USE_BZ2 #include <bzlib.h> #endif int main ( int argc, char* argv[] ) { char *buf; char* ident; unsigned int i, file_size, need_comma; FILE *f_input, *f_output; #ifdef USE_BZ2 char *bz2_buf; unsigned int uncompressed_size, bz2_size; #endif if (argc < 4) { fprintf(stderr, "Usage: %s binary_file output_file array_name\n", argv[0]); return -1; } f_input = fopen(argv[1], "rb"); if (f_input == NULL) { fprintf(stderr, "%s: can't open %s for reading\n", argv[0], argv[1]); return -1; } // Get the file length fseek(f_input, 0, SEEK_END); file_size = ftell(f_input); fseek(f_input, 0, SEEK_SET); file_size++; buf = (char *)malloc(file_size); assert(buf); fread(buf, file_size, 1, f_input); fclose(f_input); #ifdef USE_BZ2 // allocate for bz2. bz2_size = ((file_size) * 1.01) + 600; // as per the documentation bz2_buf = (char *)malloc(bz2_size); assert(bz2_buf); // compress the data int status = BZ2_bzBuffToBuffCompress(bz2_buf, &bz2_size, buf, file_size, 9, 1, 0); if(status != BZ_OK) { fprintf(stderr, "Failed to compress data: error %i\n", status); return -1; } // and be very lazy free(buf); uncompressed_size = file_size; file_size = bz2_size; buf = bz2_buf; #endif f_output = fopen(argv[2], "w"); if (f_output == NULL) { fprintf(stderr, "%s: can't open %s for writing\n", argv[0], argv[1]); return -1; } ident = argv[3]; need_comma = 0; fprintf (f_output, "const unsigned char %s[%i] = {", ident, file_size); for (i = 0; i < file_size; ++i) { if (need_comma) fprintf(f_output, ", "); else need_comma = 1; if (( i % 11 ) == 0) fprintf(f_output, "\n\t"); fprintf(f_output, "0x%.2x", buf[i] & 0xff); } fprintf(f_output, "\n};\n\n"); fprintf(f_output, "const int %s_length = %i;\n", ident, file_size); #ifdef USE_BZ2 fprintf(f_output, "const int %s_length_uncompressed = %i;\n", ident, uncompressed_size); #endif fclose(f_output); return 0; }
/* * block.h - definition of a block * Copyright (C) 2014 Vivien Didelot * * 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 _BLOCK_H #define _BLOCK_H #include <sys/types.h> #include "log.h" #include "map.h" #define INTERVAL_ONCE -1 #define INTERVAL_REPEAT -2 #define INTERVAL_PERSIST -3 #define FORMAT_RAW 0 #define FORMAT_JSON 1 /* Block command exit codes */ #define EXIT_URGENT '!' /* 33 */ #define EXIT_ERR_INTERNAL 66 struct block { const struct map *config; struct map *env; /* Shortcuts */ const char *command; int interval; unsigned signal; unsigned format; /* Runtime info */ unsigned long timestamp; int in[2]; int out[2]; int err[2]; int code; pid_t pid; }; const char *block_get(const struct block *block, const char *key); int block_set(struct block *block, const char *key, const char *value); static inline const char *block_name(const struct block *block) { return block_get(block, "name") ? : "<unknown>"; } int block_for_each(const struct block *block, int (*func)(const char *key, const char *value, void *data), void *data); #define block_debug(block, msg, ...) \ debug("[%s] " msg, block_name(block), ##__VA_ARGS__) #define block_error(block, msg, ...) \ error("[%s] " msg, block_name(block), ##__VA_ARGS__) int block_setup(struct block *block); int block_click(struct block *block); int block_spawn(struct block *block); void block_touch(struct block *block); int block_reap(struct block *block); int block_update(struct block *block); void block_close(struct block *block); #endif /* _BLOCK_H */
// ZenLib::CriticalSection - CriticalSection functions // Copyright (C) 2007-2012 MediaArea.net SARL, Info@MediaArea.net // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // CriticalSection functions // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- #ifndef ZenLib_CriticalSectionH #define ZenLib_CriticalSectionH //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #ifdef CS #undef CS //Solaris defines this somewhere #endif //--------------------------------------------------------------------------- namespace ZenLib { //*************************************************************************** /// @brief CriticalSection manipulation //*************************************************************************** class CriticalSection { public : //Constructor/Destructor CriticalSection (); ~CriticalSection (); //Enter/Leave void Enter(); void Leave(); private : void* CritSect; }; //*************************************************************************** /// @brief CriticalSectionLocker helper //*************************************************************************** class CriticalSectionLocker { public: CriticalSectionLocker (ZenLib::CriticalSection &CS) { CritSec=&CS; CritSec->Enter(); } ~CriticalSectionLocker () { CritSec->Leave(); } private: ZenLib::CriticalSection *CritSec; }; } //NameSpace #endif
#pragma once #include <vector> #include "ShaderConfig.h" #include "Window.h" #include "AudioProcess.h" class ShaderPrograms; class Renderer { friend class ShaderPrograms; // for uploading uniform values public: Renderer(const ShaderConfig& config, const Window& window); Renderer& operator=(Renderer&& o); ~Renderer(); void update(AudioData &data); void update(); void render(); void set_programs(const ShaderPrograms* shaders); private: Renderer(Renderer&) = delete; Renderer(Renderer&&) = delete; Renderer& operator=(Renderer& o) = delete; const ShaderConfig& config; const ShaderPrograms* shaders; const Window& window; void upload_uniforms(const Buffer& buff, const int buff_index) const; std::chrono::steady_clock::time_point start_time; float elapsed_time; int frame_counter; int num_user_buffers; std::vector<int> buffers_last_drawn; std::vector<GLuint> fbos; // n * num_user_buffs std::vector<GLuint> fbo_textures; // 2n * num_user_buffs std::vector<GLuint> audio_textures; // 2n * num_user_buffs }; #include "ShaderPrograms.h"
/** ****************************************************************************** * @file FLASH/FLASH_WriteProtection/Inc/main.h * @author MCD Application Team * @version V1.0.0 * @date 17-February-2017 * @brief Header for main.c module ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" #include "stm32F413H_discovery.h" #include "stm32F413H_discovery_lcd.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
//************************************************************************************************************ // Defenders of Mankind: A 3D space shoot'em up game. // Copyright (C) 2011 David Entrena, David Rodríguez, Gorka Suárez, Roberto Jiménez // // 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/>. //************************************************************************************************************ // Defenders of Mankind: Juego shoot'em up de naves en 3D. // Copyright (c) 2011 Grupo 03 // Grupo 03: David Entrena, David Rodríguez, Gorka Suárez, Roberto Jiménez //************************************************************************************************************ #ifndef __CORE_BLUEPRINTS_H__ #define __CORE_BLUEPRINTS_H__ //************************************************************************************************************ // Includes //************************************************************************************************************ #include "Core/Types/DataTypes.h" //************************************************************************************************************ // Core //************************************************************************************************************ namespace Core { class EntityInfoTable; /** * Esta clase representa una colección de descriptores de entidades. */ class Blueprints { public: //---------------------------------------------------------------------------------------------------- // Métodos //---------------------------------------------------------------------------------------------------- /** * Obtiene un tipo de entidad. * @param name El nombre del tipo de entidad. * @return El descriptor del tipo de entidad. */ EntityInfoTable * get(const std::string & name); /** * Añade un tipo de entidad. * @param name El nombre del tipo de entidad. * @return Si el tipo de entidad se ha registrado o no. */ bool add(const std::string & name); /** * Añade un tipo de entidad. * @param info La tabla descriptora del tipo de entidad. * @return Si el tipo de entidad se ha registrado o no. * @remark El puntero al descriptor no es guardado, porque se crea una copia. */ bool add(const EntityInfoTable * info); /** * Elimina tipo de entidad. * @param name El nombre del tipo de entidad. */ void remove(const std::string & name); /** * Elimina todos los tipos de entidad. */ void clear(); /** * Comprueba si está un tipo de entidad registrado. * @param name El nombre del tipo de entidad. * @return Si el tipo de entidad está registrado o no. */ bool contains(const std::string & name) const; //---------------------------------------------------------------------------------------------------- // Constructores y destructor //---------------------------------------------------------------------------------------------------- /** * Construye un nuevo objeto. */ Blueprints(); /** * Constructor copia del objeto. * @param obj El objeto a copiar. */ Blueprints(const Blueprints & obj); /** * Destructor del objeto. */ virtual ~Blueprints(); //---------------------------------------------------------------------------------------------------- // Operadores //---------------------------------------------------------------------------------------------------- EntityInfoTable * operator [](const std::string & name) { return get(name); } protected: //---------------------------------------------------------------------------------------------------- // Campos //---------------------------------------------------------------------------------------------------- /** * La tabla con los descriptores de entidades. */ EntityInfoTableTable _table; //---------------------------------------------------------------------------------------------------- // Métodos //---------------------------------------------------------------------------------------------------- /** * Añade un tipo de entidad. * @param name El nombre del tipo de entidad. * @param info La tabla descriptora del tipo de entidad. * @return Si el tipo de entidad se ha registrado o no. */ bool addEntityInfoTable(const std::string & name, EntityInfoTable * info); }; } #endif
#include<stdio.h> #define MAX_SIZE 10 // maximum size of lexeme // hence maximum size of identifier can // be of size MAX_SIZE FILE *fp; char ch; // a global character, also regarded as int id = IDHEAD; int checkDelimit (char ch) { // check if ch is within a-z or A-Z or 0-9 if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '_') return 0; // not delimiter else return 1; // is a delimiter } // lexer TOKEN lex () { int i = 0; // buffer size to store the lexemes of size MAX_SIZE char buffer[MAX_SIZE]; TOKEN token = getToken(); TOKEN retToken = NULL; do { ch = fgetc(fp); if (ch == feof(fp)) break; if (ch == ' ' || ch == '\t') continue; else if (ch == '\n') { line++; continue; } if(checkDelimit(ch)) { char lach = fgetc(fp); // lookahead character // retract back 1 pointer as per the automata if (ch == feof(fp)) break; if (ch == '/' && lach == '*') { ch = fgetc (fp); lach = fgetc (fp); while (ch != '*' && lach != '/') { ch = lach; lach = fgetc (fp); } continue; } if (ch == '=' && lach == '=') { token->value = EE; token->lexeme = (char *) malloc(sizeof(char) * 2); strcpy(token->lexeme, "=="); return token; } if (ch == '<') { if (lach == '=') { token->value = LE; token->lexeme = (char *) malloc(sizeof(char) * 2); strcpy(token->lexeme, "<="); return token; } else { token->value = LT; token->lexeme = (char *) malloc(sizeof(char) ); strcpy(token->lexeme, "<"); fseek(fp, -1, SEEK_CUR); return token; } } // endof '<' scan if (ch == '>') { if (lach == '=') { token->value = GE; token->lexeme = (char *) malloc(sizeof(char) * 2); strcpy(token->lexeme, ">="); return token; } else { token->value = GT; token->lexeme = (char *) malloc(sizeof(char) ); strcpy(token->lexeme, ">"); fseek(fp, -1, SEEK_CUR); return token; } } if (ch == '!' && lach == '=') { token->value = NE; token->lexeme = (char *) malloc(sizeof(char) * 2); strcpy(token->lexeme, "!="); return token; } // endof '>' scan // retract back one character from input stream if( ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '%' || ch == '^' || ch == '}' || ch == '{' || ch == '(' || ch == ')' || ch == ';' || ch == ',' || ch == '=' || ch == '\"') { token->value = ch; token->lexeme = (char *) malloc(sizeof(char) * 2); token->lexeme[0] = ch; token->lexeme[1] = '\0'; fseek(fp, -1, SEEK_CUR); return token; } // endof operators scan ungetc(1, fp); } // endof checkdelimiter // scanning for numericals if (ch >= '0' && ch <= '9') { // flag = 0 is int, 1 is float int intFloatFlag = 0; while ((ch >= '0' && ch <= '9')) { buffer[i++] = ch; ch = fgetc(fp); } // check for float value if (ch == '.') { // check that there is a digit after '.' ch = fgetc(fp); if (ch >= '0' && ch <= '9') { intFloatFlag = 1; while (ch >= '0' && ch <= '9') { buffer[i++] = ch; ch = fgetc(fp); if (ch == feof(fp)) break; } } // else it is an error else { printf("line %d: lex.c: Not a valid float number...\n", line); fseek(fp, -1, SEEK_CUR); // call error routine continue; } } // if ch is not a '.' and not a delimiter, then its an error if (ch != '.' && !checkDelimit(ch)) { printf("line %d: lex.c: Not a valid number...\n", line); fseek(fp, -1, SEEK_CUR); // call error routine continue; } // if there is a delimiter, it is an integer else if (checkDelimit(ch)) { buffer[i] = '\0'; if (intFloatFlag) // is a float token->value = NF; else token->value = NI; token->lexeme = (char *) malloc (sizeof(char) * i); strcpy (token->lexeme, buffer); i = 0; // reset i fseek(fp, -1, SEEK_CUR); // return the integer token return token; } } // end of numerical // scanning identifiers and keywords // first character need to be letter and not a digit if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { while (!checkDelimit(ch)) { buffer[i++] = ch; ch = fgetc(fp); } if (ch == '.') { printf ("line %d: lex.c: Not a valid identifier... ", line); printf ("Cannot use '.' with an identifier. "); printf("Only '_' permitted...\n"); continue; } buffer[i] = '\0'; i = 0; fseek(fp, -1, SEEK_CUR); // check if buffer is in symbol table // symbol table returns a token if it is present // else it returns NULL and hence need to add buffer to symbol table // by incrementing the id retToken = lookUpSymTab (buffer); // insert buffer to symbol table if retId is -1 if (retToken == NULL) // on inserting buffer to symbol table it returns an token return insertToSymTab (id++, buffer); else return retToken; } } // endof do-while loop while (ch != feof(fp)); return NULL; }
#ifndef COALESCENTTREEMODELHELPER_H #define COALESCENTTREEMODELHELPER_H #include "rate.h" #include <vector> namespace ribi { namespace ctm { struct Parameters; struct Helper { using Rate = ribi::units::Rate; enum class Part { phylogeny, branch_lengths }; Helper(); ///Calculate the likelihood of the candidate parameters in generating the dataset double CalcLogLikelihood( const std::string& newick, const Rate& birth_rate, const Rate& death_rate ) const; ///Uses DDD package double CalcLogLikelihoodDdd( const std::string& newick, const Rate& birth_rate, const Rate& death_rate, const Part part ) const; ///Uses laser package double CalcLogLikelihoodLaser( const std::string& newick, const Rate& birth_rate, const Rate& death_rate ) const; ///Uses DDD package void CalcMaxLikelihood( const std::string& newick, Rate& birth_rate, Rate& death_rate, const Part part = Part::phylogeny ) const; std::string CreateSimulatedPhylogeny( const Parameters& parameters ) const; }; } //~namespace ctm } //~namespace ribi #endif // COALESCENTTREEMODELHELPER_H
/* This file is part of Floppy Disk Ripper (FDR) program. Copyright (C) 2014, psb^hlw. FDR 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. FDR 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 <string.h> #include "main.h" #include "ui.h" #include "keyb.h" #include "fdd.h" #include "sdc.h" // struct FDR_INFO_t FDR_INFO; int main(void) { CPU14MHZ(); // Some default values here memcpy(FDR_INFO.dir_name, "IMAGES/DISK1", sizeof ("IMAGES/DISK1")); FDR_INFO.single_file = 1; FDR_INFO.overwrite = 0; FDR_INFO.from_trk = 0; FDR_INFO.to_trk = 79; FDR_INFO.drive = 0; FDR_INFO.smprate = 1; FDR_INFO.sides = 2; FDR_INFO.revs = 1; // UI init ui_init(); // Start UI while(1) ui_proc(); } // Make image routine, called from UI. uint8_t make_image(char **err_msg) { uint8_t trk, side, res, rc, s1,s2, sdcpp=0; int8_t sdir; static char * const fddi_msgs[] = {"No drive.", "No disk in drive."}; static char * const sdcp_msgs[] = {"FatFs: mkdir error.", "FatFs: chdir error.", "File already exists.", "FatFs: open error."}; static char * const sdcs_msgs[] = {"File already exists.", "FatFs: open error.", "FatFs: write error.", "Break pressed."}; res = MKI_ERROR; FDR_INFO.file_name[0] = 0; // for empty file name FDR_INFO.track = FDR_INFO.from_trk; // for empty progress bar FDR_INFO.side = FDR_INFO.sides & 1; // for empty progress bar ui_show_progress(PGS_INIT); // Init ZC if (sdc_init()==SDCI_MOUNT_ERR) { *err_msg="FatFs: mount error."; goto exit; } // Init FDC rc=fdd_init(); if (rc!=FDDI_OK) { *err_msg=fddi_msgs[rc-1]; goto exit; } // Check sd card rc=sdc_prepare(); if (rc!=SDCP_OK) { *err_msg=sdcp_msgs[rc-1]; goto exit; } sdcpp=1; // sd card prepared, finalize needed s1=FDR_INFO.sides & 1; // side from s2=1 + (!!FDR_INFO.sides); // side to sdir=(FDR_INFO.from_trk > FDR_INFO.to_trk) ? -1 : 1; // step dir // Capture loop for (trk=FDR_INFO.from_trk; trk!=(uint8_t)(FDR_INFO.to_trk+sdir); trk+=sdir) for (side=s1; side<s2; side++) { FDR_INFO.track = trk; FDR_INFO.side = side; ui_show_progress(PGS_READ); if (fdd_capture()!=FDDC_OK) { *err_msg="Floppy read timeout."; goto exit; } ui_show_progress(PGS_WRITE); rc=sdc_save_track(); if (rc!=SDCS_OK) { *err_msg=sdcs_msgs[rc-1]; goto exit; } if(is_break_pressed()) { *err_msg="Break pressed."; goto exit; } } res=MKI_OK; exit: if(sdcpp!=0 && sdc_finalize()!=SDCF_OK) { //*err_msg="SD Card (finalize) failed."; } return res; }
/* * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) * From ASN.1 module "ACSE1" * found in "../isoAcseLayer.asn" * `asn1c -fskeletons-copy` */ #ifndef _Authenticationvalue_H_ #define _Authenticationvalue_H_ #include <asn_application.h> /* Including external dependencies */ #include <GraphicString.h> #include <BIT_STRING.h> #include <constr_CHOICE.h> #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum Authenticationvalue_PR { Authenticationvalue_PR_NOTHING, /* No components present */ Authenticationvalue_PR_charstring, Authenticationvalue_PR_bitstring } Authenticationvalue_PR; /* Authenticationvalue */ typedef struct Authenticationvalue { Authenticationvalue_PR present; union Authenticationvalue_u { GraphicString_t charstring; BIT_STRING_t bitstring; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Authenticationvalue_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Authenticationvalue; #ifdef __cplusplus } #endif #endif /* _Authenticationvalue_H_ */
const char PAGE_microajax_js[] = R"=====( function microAjax(B,A){this.bindFunction=function(E,D){return function(){return E.apply(D,[D])}};this.stateChange=function(D){if(this.request.readyState==4){this.callbackFunction(this.request.responseText)}};this.getRequest=function(){if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}return false};this.postBody=(arguments[2]||"");this.callbackFunction=A;this.url=B;this.request=this.getRequest();if(this.request){var C=this.request;C.onreadystatechange=this.bindFunction(this.stateChange,this);if(this.postBody!==""){C.open("POST",B,true);C.setRequestHeader("X-Requested-With","XMLHttpRequest");C.setRequestHeader("Content-type","application/x-www-form-urlencoded");C.setRequestHeader("Connection","close")}else{C.open("GET",B,true)}C.send(this.postBody)}}; function setValues(url) { microAjax(url, function (res) { res.split(String.fromCharCode(10)).forEach(function(entry) { fields = entry.split("|"); if(fields[2] == "input") { document.getElementById(fields[0]).value = fields[1]; } else if(fields[2] == "div") { document.getElementById(fields[0]).innerHTML = fields[1]; } else if(fields[2] == "chk") { document.getElementById(fields[0]).checked = fields[1]; } }); }); } )=====";
/* Music.h Copyright (c) 2016 by Michael Zahniser Endless Sky 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. Endless Sky 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 MUSIC_H_ #define MUSIC_H_ #include <condition_variable> #include <cstdint> #include <cstdio> #include <mutex> #include <string> #include <thread> #include <vector> // The Music class streams mp3 audio from a file and delivers it to the program // on "block" at a time, so it never needs to hold the entire decoded file in // memory. Each block is 16-bit stereo, 44100 Hz. If no file is specified, or if // the decoding thread is not done yet, it returns silence rather than blocking, // so the game won't freeze if the music stops for some reason. class Music { public: Music(); ~Music(); void SetSource(const std::string &path = ""); const std::vector<int16_t> &NextChunk(); private: // This is the entry point for the decoding thread. void Decode(); private: // Buffers for storing the decoded audio sample. The "silence" buffer holds // a block of silence to be returned if nothing was read from the file. std::vector<int16_t> silence; std::vector<int16_t> next; std::vector<int16_t> current; std::string previousPath; FILE *nextFile = nullptr; bool done = false; std::thread thread; std::mutex decodeMutex; std::condition_variable condition; }; #endif
/* Copyright 2008 Brain Research Institute, Melbourne, Australia Written by Thomas G Close, Mar 20, 2011. This file is part of MRtrix. MRtrix 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. MRtrix 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 MRtrix. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __bts_math_blossom_edge_h__ #define __bts_math_blossom_edge_h__ namespace FTS { namespace Math { namespace Blossom { class Edge { public: Edge() { } Edge(size_t first, size_t second, double weight) : first(first), second(second), weight(weight) { } public: size_t first; size_t second; double weight; bool has_node(size_t index) const { return (first == index) || (second == index); } size_t& node(size_t index) { assert(index < 2); return !index ? first : second; } const size_t& node(size_t index) const { assert(index < 2); return !index ? first : second; } bool operator<(const Edge& e) const { return weight < e.weight; } }; inline std::ostream& operator<<(std::ostream& stream, const Edge& e) { stream << "{" << e.first << "," << e.second << "} = " << e.weight; return stream; } } } } #endif /* */
/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* GeoIP support is present */ /* #undef HAVE_GEOIP */ /* Define to 1 if you have the <GeoIP.h> header file. */ /* #undef HAVE_GEOIP_H */ /* GeoIP not supported: library too old, plase upgrade first */ /* #undef HAVE_GEOIP_IPv6 */ /* Local hiredis package present */ /* #undef HAVE_HIREDIS */ /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `GeoIP' library (-lGeoIP). */ /* #undef HAVE_LIBGEOIP */ /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Native PF_RING support */ /* #undef HAVE_PF_RING */ /* We have sqlite */ #define HAVE_SQLITE 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Last SVN change */ #define NTOPNG_SVN_DATE "Sat Oct 18 17:04:55 EDT 2014" /* SVN Release */ #define NTOPNG_SVN_RELEASE "r1.2.2" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Architecture of this host */ #define PACKAGE_MACHINE "x86_64" /* Define to the full name of this package. */ #define PACKAGE_NAME "Makefile.in" /* OS name */ #define PACKAGE_OSNAME "x86_64-apple-darwin12.3.0" /* SVN release of this package */ #define PACKAGE_RELEASE "r1.2.2" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "Makefile.in 1.2.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "makefile-in" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.2.2" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Disable warning on windows */ #define _CRT_SECURE_NO_WARNINGS 1
#ifndef BOOK_PICK_H #define BOOK_PICK_H // // Copyright (C) 2010 - Bernd H Stramm // // This program is distributed under the terms of // the GNU General Public License version 3 // // 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 <QDialog> #include "ui_bookdialog.h" #include <QTableWidgetItem> #include <QSqlDatabase> namespace nota { class BookPick : public QDialog, public Ui_BookDialog { Q_OBJECT public: BookPick (QWidget * parent); void SetDB (QSqlDatabase & db) { pDB = &db; } int Exec (); bool SelectedBook (); QString TitleSelected (); public slots: void PickedCell (int row, int col); private: void SetFlags (QTableWidgetItem *item); void ListBooks (); QSqlDatabase *pDB; bool selectedSomething; QString selectedTitle; }; } // namespace #endif
// x3c - C++ PluginFramework #ifndef _X3_CONFIGDB_SQLPARSER_H #define _X3_CONFIGDB_SQLPARSER_H #include "Ix_SQLParser.h" class SQLParser_Access : public Ix_SQLParser { public: SQLParser_Access() { } void InterfaceRelease() { delete this; } std::wstring GetFunc_CURDATE() { return L"Date()"; } std::wstring GetFunc_CURTIME() { return L"Time()"; } std::wstring GetFunc_NOW() { return L"Now()"; } }; class SQLParser_SQLServer : public Ix_SQLParser { public: SQLParser_SQLServer() { } void InterfaceRelease() { delete this; } std::wstring GetFunc_CURDATE() { return L"GetDate()"; } std::wstring GetFunc_CURTIME() { return L"GetTime()"; } std::wstring GetFunc_NOW() { return L"GetNow()"; } }; #endif // _X3_CONFIGDB_SQLPARSER_H
/* IRC-LEI Bot * Copyright (C) 2010 David Serrano * * 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 "globals.h" #include "string.h" char ns_pass[256]; char bot_channel[256]; char bot_nick[256]; char name_list[1000][256]; bool name_listing = false; unsigned int name_count; bool greeter_on = true; bool bot_exiting = false; bool bot_identified = false; bool is_op(const char* nick) { unsigned int i; for (i = 0; i < name_count; i++) { if (name_list[i][0] == '@' && strcmp(nick, &name_list[i][1]) == 0) { return true; } } return false; } bool is_voice(const char* nick) { unsigned int i; for (i = 0; i < name_count; i++) { if (name_list[i][0] == '+' && strcmp(nick, &name_list[i][1]) == 0) { return true; } } return false; }
/*************************************************************************** JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992 Copyright 1990 Regents of the University of California. All rights reserved. Authors: 1985 S. Hwang 1993 Stephen R. Whiteley ****************************************************************************/ #include "spice.h" #include <stdio.h> #include "mesdefs.h" #include "const.h" #include "sperror.h" #include "util.h" #include "cktext.h" int MESsetup(matrix,inModel,ckt,states) /* load the diode structure with those pointers needed later * for fast matrix loading */ SMPmatrix *matrix; GENmodel *inModel; CKTcircuit *ckt; int *states; { MESmodel *model = (MESmodel*)inModel; MESinstance *here; int error; CKTnode *tmp; /* loop through all the diode models */ for ( ; model != NULL; model = model->MESnextModel) { if ( (model->MEStype != NMF) && (model->MEStype != PMF) ) { model->MEStype = NMF; } if (!model->MESthresholdGiven) { model->MESthreshold = -2; } if (!model->MESbetaGiven) { model->MESbeta = 2.5e-3; } if (!model->MESbGiven) { model->MESb = 0.3; } if (!model->MESalphaGiven) { model->MESalpha = 2; } if (!model->MESlModulationGiven) { model->MESlModulation = 0; } if (!model->MESdrainResistGiven) { model->MESdrainResist = 0; } if (!model->MESsourceResistGiven) { model->MESsourceResist = 0; } if (!model->MEScapGSGiven) { model->MEScapGS = 0; } if (!model->MEScapGDGiven) { model->MEScapGD = 0; } if (!model->MESgatePotentialGiven) { model->MESgatePotential = 1; } if (!model->MESgateSatCurrentGiven) { model->MESgateSatCurrent = 1e-14; } if (!model->MESdepletionCapCoeffGiven) { model->MESdepletionCapCoeff = .5; } if (!model->MESfNcoefGiven) { model->MESfNcoef = 0; } if (!model->MESfNexpGiven) { model->MESfNexp = 1; } /* loop through all the instances of the model */ for (here = model->MESinstances; here != NULL; here = here->MESnextInstance) { if (!here->MESareaGiven) { here->MESarea = 1; } here->MESstate = *states; *states += MESnumStates; if (model->MESsourceResist != 0 && here->MESsourcePrimeNode == 0) { error = CKTmkVolt(ckt,&tmp,here->MESname,"source"); if (error) return (error); here->MESsourcePrimeNode = tmp->number; } else { here->MESsourcePrimeNode = here->MESsourceNode; } if (model->MESdrainResist != 0 && here->MESdrainPrimeNode == 0) { error = CKTmkVolt(ckt,&tmp,here->MESname,"drain"); if (error) return (error); here->MESdrainPrimeNode = tmp->number; } else { here->MESdrainPrimeNode = here->MESdrainNode; } TSTALLOC(MESdrainDrainPrimePtr,MESdrainNode,MESdrainPrimeNode) TSTALLOC(MESgateDrainPrimePtr,MESgateNode,MESdrainPrimeNode) TSTALLOC(MESgateSourcePrimePtr,MESgateNode,MESsourcePrimeNode) TSTALLOC(MESsourceSourcePrimePtr,MESsourceNode, MESsourcePrimeNode) TSTALLOC(MESdrainPrimeDrainPtr,MESdrainPrimeNode,MESdrainNode) TSTALLOC(MESdrainPrimeGatePtr,MESdrainPrimeNode,MESgateNode) TSTALLOC(MESdrainPrimeSourcePrimePtr,MESdrainPrimeNode, MESsourcePrimeNode) TSTALLOC(MESsourcePrimeGatePtr,MESsourcePrimeNode,MESgateNode) TSTALLOC(MESsourcePrimeSourcePtr,MESsourcePrimeNode, MESsourceNode) TSTALLOC(MESsourcePrimeDrainPrimePtr,MESsourcePrimeNode, MESdrainPrimeNode) TSTALLOC(MESdrainDrainPtr,MESdrainNode,MESdrainNode) TSTALLOC(MESgateGatePtr,MESgateNode,MESgateNode) TSTALLOC(MESsourceSourcePtr,MESsourceNode,MESsourceNode) TSTALLOC(MESdrainPrimeDrainPrimePtr,MESdrainPrimeNode, MESdrainPrimeNode) TSTALLOC(MESsourcePrimeSourcePrimePtr,MESsourcePrimeNode, MESsourcePrimeNode) } } return (OK); }
// // AddThemeViewController.h // LudoTech // // Created by Valentin Bercot on 18/03/2015. // Copyright (c) 2015 Valentin Bercot & Remy Tartiere. All rights reserved. // #import <UIKit/UIKit.h> // ===== DECLARATION ===== @interface AddThemeViewController : UIViewController // ===== PROPERTIES ===== @property (weak, nonatomic) IBOutlet UITextField *name; // ===== METHODS ===== - (IBAction)save:(id)sender; - (IBAction)cancel:(id)sender; @end
/* * jpegtcl.c -- * * Generic interface to XML parsers. * * Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net> * * Zveno Pty Ltd makes this software and associated documentation * available free of charge for any purpose. You may make copies * of the software but you must include all of this notice on any copy. * * Zveno Pty Ltd does not warrant that this software is error free * or fit for any purpose. Zveno Pty Ltd disclaims any liability for * all claims, expenses, losses, damages and costs any user may incur * as a result of using, copying or modifying the software. * */ #include "jpegtcl.h" /* *---------------------------------------------------------------------------- * * Jpegtcl_Init -- * * Initialisation routine for loadable module * * Results: * None. * * Side effects: * Creates commands in the interpreter, * loads xml package. * *---------------------------------------------------------------------------- */ int Jpegtcl_Init (interp) Tcl_Interp *interp; /* Interpreter to initialise. */ { extern const JpegtclStubs jpegtclStubs; if (Tcl_InitStubs(interp, "8.3", 0) == NULL) { return TCL_ERROR; } /* DO NOT USE PACKAGE_VERSION, USE INFO FROM jpegtcl.h INSTEAD */ if (Tcl_PkgProvideEx(interp, PACKAGE_NAME, JPEGTCL_VERSION, (ClientData) &jpegtclStubs) != TCL_OK) { return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * Jpegtcl_SafeInit -- * * Initialisation routine for loadable module in a safe interpreter. * * Results: * None. * * Side effects: * Creates commands in the interpreter, * loads xml package. * *---------------------------------------------------------------------------- */ int Jpegtcl_SafeInit (interp) Tcl_Interp *interp; /* Interpreter to initialise. */ { return Jpegtcl_Init(interp); }
/* ide-extension-set-adapter.h * * Copyright 2015-2019 Christian Hergert <christian@hergert.me> * * 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/>. * * SPDX-License-Identifier: GPL-3.0-or-later */ #pragma once #if !defined (IDE_PLUGINS_INSIDE) && !defined (IDE_PLUGINS_COMPILATION) # error "Only <libide-plugins.h> can be included directly." #endif #include <libpeas/peas.h> #include <libide-core.h> G_BEGIN_DECLS #define IDE_TYPE_EXTENSION_SET_ADAPTER (ide_extension_set_adapter_get_type()) IDE_AVAILABLE_IN_3_32 G_DECLARE_FINAL_TYPE (IdeExtensionSetAdapter, ide_extension_set_adapter, IDE, EXTENSION_SET_ADAPTER, IdeObject) typedef void (*IdeExtensionSetAdapterForeachFunc) (IdeExtensionSetAdapter *set, PeasPluginInfo *plugin_info, PeasExtension *extension, gpointer user_data); IDE_AVAILABLE_IN_3_32 IdeExtensionSetAdapter *ide_extension_set_adapter_new (IdeObject *parent, PeasEngine *engine, GType interface_type, const gchar *key, const gchar *value); IDE_AVAILABLE_IN_3_32 PeasEngine *ide_extension_set_adapter_get_engine (IdeExtensionSetAdapter *self); IDE_AVAILABLE_IN_3_32 GType ide_extension_set_adapter_get_interface_type (IdeExtensionSetAdapter *self); IDE_AVAILABLE_IN_3_32 const gchar *ide_extension_set_adapter_get_key (IdeExtensionSetAdapter *self); IDE_AVAILABLE_IN_3_32 void ide_extension_set_adapter_set_key (IdeExtensionSetAdapter *self, const gchar *key); IDE_AVAILABLE_IN_3_32 const gchar *ide_extension_set_adapter_get_value (IdeExtensionSetAdapter *self); IDE_AVAILABLE_IN_3_32 void ide_extension_set_adapter_set_value (IdeExtensionSetAdapter *self, const gchar *value); IDE_AVAILABLE_IN_3_32 guint ide_extension_set_adapter_get_n_extensions (IdeExtensionSetAdapter *self); IDE_AVAILABLE_IN_3_32 void ide_extension_set_adapter_foreach (IdeExtensionSetAdapter *self, IdeExtensionSetAdapterForeachFunc foreach_func, gpointer user_data); IDE_AVAILABLE_IN_3_32 void ide_extension_set_adapter_foreach_by_priority (IdeExtensionSetAdapter *self, IdeExtensionSetAdapterForeachFunc foreach_func, gpointer user_data); IDE_AVAILABLE_IN_3_32 PeasExtension *ide_extension_set_adapter_get_extension (IdeExtensionSetAdapter *self, PeasPluginInfo *plugin_info); G_END_DECLS
/* * rele, * * * Copyright (C) 2015 Davide Tateo & Matteo Pirotta * Versione 1.0 * * This file is part of rele. * * rele 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. * * rele 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 rele. If not, see <http://www.gnu.org/licenses/>. */ #ifndef INCLUDE_RELE_APPROXIMATORS_REGRESSORS_REGRESSIONTREE_H_ #define INCLUDE_RELE_APPROXIMATORS_REGRESSORS_REGRESSIONTREE_H_ #include "rele/approximators/regressors/trees/trees_bits/nodes/EmptyTreeNode.h" #include "rele/approximators/regressors/trees/trees_bits/nodes/InternalTreeNode.h" #include "rele/approximators/regressors/trees/trees_bits/nodes/LeafTreeNode.h" #include "rele/approximators/regressors/trees/trees_bits/nodes/TreeNode.h" #include "rele/approximators/Regressors.h" #include "rele/approximators/Features.h" namespace ReLe { template<class InputC, class OutputC, bool denseOutput> class RegressionTree: public BatchRegressor_<InputC, OutputC, denseOutput> { using BatchRegressor_<InputC, OutputC, denseOutput>::phi; public: RegressionTree(Features_<InputC, denseOutput>& phi, const EmptyTreeNode<OutputC>& emptyNode, unsigned int outputDimensions = 1, unsigned int nMin = 2) : BatchRegressor_<InputC, OutputC, denseOutput>(phi, outputDimensions), root(nullptr), emptyNode(emptyNode), nMin(nMin) { } virtual OutputC operator() (const InputC& input) override { if (!root) return emptyNode.getValue(phi(input)); return root->getValue(phi(input)); } virtual double computeJFeatures(const BatchData_<OutputC, denseOutput>& dataset) override { double J = 0; for(unsigned int i = 0; i < dataset.size(); i++) { OutputC yhat = root->getValue(dataset.getInput(i)); OutputC y = dataset.getOutput(i); J += output_traits<OutputC>::errorSquared(yhat, y); } return J / dataset.size(); } void setNMin(int nm) { nMin = nm; } int getNMin() { return nMin; } virtual void trainFeatures(const BatchData_<OutputC, denseOutput>& featureDataset) override = 0; TreeNode<OutputC>* getRoot() { return root; } virtual ~RegressionTree() { cleanTree(); } protected: void cleanTree() { if (root && !root->isEmpty()) delete root; } void splitDataset(const BatchData_<OutputC, denseOutput>& ds, int cutDir, double cutPoint, arma::uvec& indexesLow, arma::uvec& indexesHigh) { indexesLow.set_size(ds.size()); indexesHigh.set_size(ds.size()); unsigned int lowNumber = 0; unsigned int highNumber = 0; // split inputs in two subsets for (unsigned int i = 0; i < ds.size(); i++) { auto&& element = ds.getInput(i); double tmp = element[cutDir]; if (tmp < cutPoint) { indexesLow(lowNumber) = i; lowNumber++; } else { indexesHigh(highNumber) = i; highNumber++; } } indexesLow.resize(lowNumber); indexesHigh.resize(highNumber); } TreeNode<OutputC>* buildLeaf(const BatchData_<OutputC, denseOutput>& ds, LeafType type) { switch(type) { case LeafType::Constant: return new LeafTreeNode<OutputC, denseOutput>(ds); case LeafType::Linear: return nullptr; //TODO [MINOR] implement case LeafType::Samples: return new SampleLeafTreeNode<OutputC, denseOutput>(ds.clone()); default: return nullptr; } } protected: TreeNode<OutputC>* root; EmptyTreeNode<OutputC> emptyNode; unsigned int nMin; // minimum number of tuples for splitting }; #define USE_REGRESSION_TREE_MEMBERS \ typedef RegressionTree<InputC, OutputC, denseOutput> Base; \ using Base::root; \ using Base::emptyNode; \ using Base::nMin; } #endif /* INCLUDE_RELE_APPROXIMATORS_REGRESSORS_REGRESSIONTREE_H_ */
#include <Python.h> #include <numpy/arrayobject.h> #include <svdlib.h> #include <stdio.h> /* Mock Python object just to handle freeing the memory. From http://blog.enthought.com/?p=62 */ typedef struct { PyObject_HEAD void *memory; int multidim; /* flag to say we should free memory[0] first. */ } _MyDeallocObject; static void _mydealloc_dealloc(PyObject* _self) { _MyDeallocObject *self = (_MyDeallocObject*) _self; if (self->multidim) free(((double **)self->memory)[0]); free(self->memory); self->ob_type->tp_free((PyObject *)self); } static PyTypeObject _myDeallocType = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "mydeallocator", /*tp_name*/ sizeof(_MyDeallocObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ _mydealloc_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash */ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ "Internal deallocator object", /* tp_doc */ }; PyObject* make_deallocator_for(void* mem, int multidim) { static int dealloc_inited = 0; if (!dealloc_inited) { _myDeallocType.tp_new = PyType_GenericNew; PyType_Ready(&_myDeallocType); dealloc_inited = 1; } _MyDeallocObject* newobj = PyObject_New(_MyDeallocObject, &_myDeallocType); newobj->memory = mem; newobj->multidim = multidim; return (PyObject*)newobj; } static int _numpy_inited = 0; void init_numpy(void) { if (_numpy_inited) return; import_array(); _numpy_inited = 1; } PyObject * wrapDMat(DMat d) { init_numpy(); PyArray_Descr *type = PyArray_DescrFromType(NPY_DOUBLE); npy_intp dim[2] = {d->h.rows, d->h.cols}; npy_intp strides[2] = {d->h.cols*sizeof(double), sizeof(double)}; PyObject* arr = PyArray_NewFromDescr( &PyArray_Type, type, 2, dim, strides, d->value[0], NPY_CONTIGUOUS | NPY_WRITEABLE, NULL /*PyObject *obj*/ ); PyArray_BASE(arr) = make_deallocator_for(d->value, 1); return arr; } PyObject * wrap_double_array(double* d, int len) { init_numpy(); PyArray_Descr *type = PyArray_DescrFromType(NPY_DOUBLE); npy_intp dim[1] = {len}; npy_intp strides[1] = {sizeof(double)}; PyObject* arr = PyArray_NewFromDescr( &PyArray_Type, type, 1, dim, strides, d, NPY_CONTIGUOUS | NPY_WRITEABLE, NULL /*PyObject *obj*/ ); PyArray_BASE(arr) = make_deallocator_for(d, 0); return arr; } PyObject * wrapSVDrec(struct svdrec * rec, int transposed) { PyObject * ut = wrapDMat(rec->Ut); PyObject * s = wrap_double_array(rec->S, rec->d); PyObject * vt = wrapDMat(rec->Vt); PyObject * result = PyTuple_New(3); PyTuple_SetItem(result, 1, s); if (transposed) { PyTuple_SetItem(result, 0, vt); PyTuple_SetItem(result, 2, ut); } else { PyTuple_SetItem(result, 0, ut); PyTuple_SetItem(result, 2, vt); } return result; }
#ifndef COLOR_H #define COLOR_H #include <QVector> #include <QString> #include <QColor> class Color { public: enum ColorSpace { sRgb, monitorRgb, euroScaleCmyk, printerCmyk, sRgbHsv }; Color(); Color(ColorSpace colorSpace, const QVector<double> &components); void setComponents(const QVector<double> &components); QVector<double> components() const; void setComponentValue(int componentId, double value); double componentValue(int componentId) const; void setName(const QString &name); QString name() const; ColorSpace colorSpace() const; QString colorSpaceName() const; static QString colorSpaceName(ColorSpace colorSpace); QVector<double> pcsColor() const; Color convertToColorConversionSpace() const; Color convertToColorSpace(ColorSpace targetColorSpace) const; QString description() const; QColor displayColor(int displayId = 0) const; private: ColorSpace m_colorSpace; QVector<double> m_components; QString m_name; void setColorSpace(ColorSpace colorSpace); }; #endif
/* * limit_id_to_monitoring_key.h * * Contains the limit identifier and the corresponding monitoring key for a given S-NSSAI and DNN. */ #ifndef _OpenAPI_limit_id_to_monitoring_key_H_ #define _OpenAPI_limit_id_to_monitoring_key_H_ #include <string.h> #include "../external/cJSON.h" #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" #ifdef __cplusplus extern "C" { #endif typedef struct OpenAPI_limit_id_to_monitoring_key_s OpenAPI_limit_id_to_monitoring_key_t; typedef struct OpenAPI_limit_id_to_monitoring_key_s { char *limit_id; OpenAPI_list_t *monkey; } OpenAPI_limit_id_to_monitoring_key_t; OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_create( char *limit_id, OpenAPI_list_t *monkey ); void OpenAPI_limit_id_to_monitoring_key_free(OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key); OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_parseFromJSON(cJSON *limit_id_to_monitoring_keyJSON); cJSON *OpenAPI_limit_id_to_monitoring_key_convertToJSON(OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key); OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_copy(OpenAPI_limit_id_to_monitoring_key_t *dst, OpenAPI_limit_id_to_monitoring_key_t *src); #ifdef __cplusplus } #endif #endif /* _OpenAPI_limit_id_to_monitoring_key_H_ */
/* ============================================================ * * This file is a part of the rekonq project * * Copyright (C) 2008-2011 by Andrea Diamantini <adjam7 at gmail dot com> * Copyright (C) 2009 by Paweł Prażak <pawelprazak at gmail dot com> * Copyright (C) 2009-2011 by Lionel Chauvin <megabigbug@yahoo.fr> * Copyright (C) 2010 by Matthieu Gicquel <matgic78 at gmail dot com> * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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 MAINVIEW_H #define MAINVIEW_H // Rekonq Includes #include "rekonq_defines.h" // Local Includes #include "historymanager.h" // KDE Includes #include <KTabWidget> // Forward Declarations class HistoryItem; class MainWindow; class StackedUrlBar; class TabBar; class UrlBar; class WebTab; class QLabel; class QToolButton; class QUrl; class QWebFrame; /** * This class represent rekonq Main View. * It contains all WebViews and the url bar. * */ class REKONQ_TESTS_EXPORT MainView : public KTabWidget { Q_OBJECT public: MainView(MainWindow *parent); inline StackedUrlBar *widgetBar() const { return m_widgetBar; } TabBar *tabBar() const; WebTab *currentWebTab() const; UrlBar *currentUrlBar() const; WebTab *webTab(int index) const; /** * show and hide TabBar if user doesn't choose * "Always Show TabBar" option * */ void updateTabBar(); inline QToolButton *addTabButton() const { return m_addTabButton; } /** * This function creates a new empty tab * with a webview inside * @param focused decide if you wannna give focus * (or not) to this new tab (default true) * @return the webview embedded in the new tab */ WebTab *newWebTab(bool focused = true); inline QList<HistoryItem> recentlyClosedTabs() { return m_recentlyClosedTabs; } Q_SIGNALS: // tabs change when: // - current tab change // - one tab is closed // - one tab is added // - one tab is updated (eg: changes url) void tabsChanged(); // current tab signals void currentTitle(const QString &url); void showStatusBarMessage(const QString &message, Rekonq::Notify status = Rekonq::Info); void linkHovered(const QString &link); void browserTabLoading(bool); void openPreviousInHistory(); void openNextInHistory(); void printRequested(QWebFrame *frame); public Q_SLOTS: /** * Core browser slot. This create a new tab with a WebView inside * for browsing and follows rekonq settings about opening there a * home/blank/rekonq page * */ void newTab(); // Indexed slots void cloneTab(int index = -1); void closeTab(int index = -1, bool del = true); void closeOtherTabs(int index = -1); void reloadTab(int index = -1); /** * Detaches tab at @c index to a new window. * If @c toWindow is not null, the tab is instead * added to existing MainWindow @c toWindow. */ void detachTab(int index = -1, MainWindow *toWindow = NULL); void reloadAllTabs(); void nextTab(); void previousTab(); void openLastClosedTab(); void openClosedTab(); void switchToTab(const int index); void loadFavorite(const int index); // WEB slot actions void webReload(); void webStop(); private Q_SLOTS: void currentChanged(int index); void webViewLoadStarted(); void webViewLoadFinished(bool ok); void webViewIconChanged(); void webViewTitleChanged(const QString &title); void webViewUrlChanged(const QUrl &url); void windowCloseRequested(); void postLaunch(); protected: virtual void resizeEvent(QResizeEvent *event); private: /** * This function creates (if not exists) and returns a QLabel * with a loading QMovie. * Imported from Arora's code. * * @param index the tab index where inserting the animated label * @param addMovie creates or not a loading movie * * @return animated label's pointer */ QLabel *animatedLoading(int index, bool addMovie); // -------------------------------------------------------------------------- StackedUrlBar *m_widgetBar; QString m_loadingGitPath; // the new tab button QToolButton *m_addTabButton; int m_currentTabIndex; QList<HistoryItem> m_recentlyClosedTabs; MainWindow *m_parentWindow; }; #endif // MAINVIEW_H
#include "../../openexr-2.5.7/IlmBase/Imath/ImathRandom.h"
#ifndef PIPPIP_ENCLAVEREQUEST_H #define PIPPIP_ENCLAVEREQUEST_H #include "PostPacket.h" #include <QString> #include <map> class QJsonObject; namespace Pippip { struct SessionState; class EnclaveRequest : public PostPacket { public: EnclaveRequest(SessionState *state); ~EnclaveRequest(); public: QString getValue(const QString& name) const; void setRequestType(const QString& type); void setValue(const QString& name, const QString& value); public: QJsonObject *getJson() const; const QString& getUrl() const; protected: SessionState *state; QJsonObject *request; }; } // namespace Pippip #endif // PIPPIP_ENCLAVEREQUEST_H
#pragma once /* This file is part of Kraft der Mada. Copyright (c) 2010 Timm Eversmeyer Kraft der Mada 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. Kraft der Mada 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 Kraft der Mada. If not, see <http://www.gnu.org/licenses/>. */ #include "game/base/Component.h" namespace mada { class SoundEntity; class SoundComponent : public Component { __mada_declare_class(SoundComponent); public: SoundComponent(); ~SoundComponent(); void onActivate(); void onDeactivate(); private: Ptr<SoundEntity> m_entity; Vector3 getPosition() const; void setPosition(const Vector3& pos); }; __mada_register_type(SoundComponent); }
/* * Copyright (c) 2010-2019 Belledonne Communications SARL. * * This file is part of mediastreamer2. * * 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 <sys/types.h> #include <sys/sysctl.h> #import <Foundation/Foundation.h> #include "mediastreamer2/msvideo.h" @interface IOSHardware : NSObject + (NSString *) platform; + (BOOL) isHDVideoCapable; + (MSVideoSize) HDVideoSize:(const char *) deviceId; + (BOOL) isFrontCamera:(const char *) deviceId; + (BOOL) isBackCamera:(const char *) deviceId; @end
/* * ---------------------------------------------------------------------------- * Copyright (c) 2013-2021, xSky <guozhw at gmail dot com> * All rights reserved. * Distributed under GPL license. * ---------------------------------------------------------------------------- */ #ifndef _XREDIS_POOL_H_ #define _XREDIS_POOL_H_ #include "hiredis.h" #include "xLock.h" #include "xRedisClient.h" #include <list> #include <string.h> #include <string> namespace xrc { #define MAX_REDIS_CONN_POOLSIZE 128 // 每个DB最大连接数 #define MAX_REDIS_CACHE_TYPE 128 // 最大支持的CACHE种类数 #define MAX_REDIS_DB_HASHBASE 128 // 最大HASH分库基数 #define GET_CONNECT_ERROR "get connection error" #define CONNECT_CLOSED_ERROR "redis connection be closed" #ifdef WIN32 #define strcasecmp stricmp #define strncasecmp strnicmp #define usleep(us) Sleep((us)/1000) #define pthread_self() GetCurrentThreadId() #endif enum { REDISDB_UNCONN, REDISDB_WORKING, REDISDB_DEAD }; class RedisConnection { public: RedisConnection(); ~RedisConnection(); void Init(uint32_t cahcetype, uint32_t sliceindex, const std::string& host, uint32_t port, const std::string& pass, uint32_t poolsize, uint32_t timeout, uint32_t role, uint32_t slaveidx); bool RedisConnect(); bool RedisReConnect(); bool Ping(); redisContext* GetCtx() const { return mCtx; } uint32_t GetdbIndex() const { return mSliceIndex; } uint32_t GetType() const { return mType; } uint32_t GetRole() const { return mRole; } uint32_t GetSlaveIdx() const { return mSlaveIdx; } bool GetConnstatus() const { return mConnStatus; } private: bool Auth(); redisContext* ConnectWithTimeout(); private: // redis connector context redisContext* mCtx; std::string mHost; // redis host uint32_t mPort; // redis sever port std::string mPass; // redis server password uint32_t mTimeout; // connect timeout second uint32_t mPoolsize; // connect pool size for each redis DB uint32_t mType; // redis cache pool type uint32_t mSliceIndex; // redis DB index uint32_t mRole; // redis role uint32_t mSlaveIdx; // the index in the slave group bool mConnStatus; // redis connection status }; typedef std::list<RedisConnection*> RedisConnectionPool; typedef std::list<RedisConnection*>::iterator RedisConnectionIter; typedef std::vector<RedisConnectionPool*> RedisSlaveGroup; typedef std::vector<RedisConnectionPool*>::iterator RedisSlaveGroupIter; typedef struct _RedisSliceConn_ { RedisConnectionPool RedisMasterConnection; RedisSlaveGroup RedisSlaveConnection; xLock MasterLock; xLock SlaveLock; } RedisSliceConn; class RedisSlice { public: RedisSlice(); ~RedisSlice(); void Init(uint32_t cahcetype, uint32_t dbindex); // 连到到一个REDIS服务节点 bool ConnectRedisSlice(uint32_t cahcetype, uint32_t dbindex, const std::string& host, uint32_t port, const std::string& passwd, uint32_t poolsize, uint32_t timeout, int32_t role); RedisConnection* GetMasterConn(); RedisConnection* GetSlaveConn(); RedisConnection* GetConn(int32_t ioRole); void FreeConn(RedisConnection* redisconn); void CloseConnPool(); void ConnPoolPing(); uint32_t GetStatus() const; private: RedisSliceConn mSliceConn; bool mHaveSlave; uint32_t mType; // redis cache pool type uint32_t mSliceindex; // redis slice index uint32_t mStatus; // redis slice status }; class RedisGroup { public: RedisGroup(); virtual ~RedisGroup(); bool InitDB(uint32_t cachetype, uint32_t hashbase); bool ConnectRedisGroup(uint32_t cahcetype, uint32_t dbindex, const std::string& host, uint32_t port, const std::string& passwd, uint32_t poolsize, uint32_t timeout, uint32_t role); RedisConnection* GetConn(uint32_t dbindex, uint32_t ioRole); void FreeConn(RedisConnection* redisconn); void ClosePool(); void KeepAlive(); uint32_t GetDBStatus(uint32_t dbindex); uint32_t GetHashBase() const; private: RedisSlice* mSliceList; uint32_t mCachetype; uint32_t mHashbase; }; class RedisPool { public: RedisPool(); ~RedisPool(); bool Init(uint32_t typesize); bool SetHashBase(uint32_t cachetype, uint32_t hashbase); uint32_t GetHashBase(uint32_t cachetype); bool ConnectRedisGroup(uint32_t cachetype, uint32_t sliceindex, const std::string& host, uint32_t port, const std::string& passwd, uint32_t poolsize, uint32_t timeout, uint32_t role); static bool CheckReply(const redisReply* reply); static void FreeReply(const redisReply* reply); RedisConnection* GetConnection(uint32_t cachetype, uint32_t index, uint32_t ioType = MASTER); void FreeConnection(RedisConnection* redisconn); void Keepalive(); void Release(); private: RedisGroup* mRedisGroupList; uint32_t mTypeSize; }; } // namespace xrc #endif
/* * geniv: IV generation * * Copyright (c) 2015 Herbert Xu <herbert@gondor.apana.org.au> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * */ #ifndef _CRYPTO_INTERNAL_GENIV_H #define _CRYPTO_INTERNAL_GENIV_H #include <crypto/internal/aead.h> #include <linux/spinlock.h> #include <linux/types.h> struct aead_geniv_ctx { spinlock_t lock; struct crypto_aead *child; struct crypto_skcipher *sknull; u8 salt[] __attribute__ ((aligned(__alignof__(u32)))); }; struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl, struct rtattr **tb, u32 type, u32 mask); void aead_geniv_free(struct aead_instance *inst); int aead_init_geniv(struct crypto_aead *tfm); void aead_exit_geniv(struct crypto_aead *tfm); #endif /* _CRYPTO_INTERNAL_GENIV_H */
/* * Quantis USB commands * * Copyright (C) 2004-2012 ID Quantique SA, Carouge/Geneva, Switzerland * All rights reserved. * * ---------------------------------------------------------------------------- * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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. * * ---------------------------------------------------------------------------- * * Alternatively, this software may be distributed under the terms of the * GNU General Public License version 2 as published by the Free Software * Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * ---------------------------------------------------------------------------- * * For history of changes, see ChangeLog.txt */ #ifndef QUANTIS_USB_COMMANDS_H #define QUANTIS_USB_COMMANDS_H #ifndef DISABLE_QUANTIS_USB /** Vendor IDs */ # define VENDOR_ID_ELLISYS 0x0ABA /** Devices IDs */ # define DEVICE_ID_QUANTIS_USB 0x0102 /* Windows uses GUID to identify devices */ # ifdef _WIN32 # include <initguid.h> /* {6476DB04-8D6C-49f5-BCF3-E2C1FC313A18} */ DEFINE_GUID(GUID_DEVINTERFACE_QUANTIS_USB, 0x6476db04, 0x8d6c, 0x49f5, 0xbc, 0xf3, 0xe2, 0xc1, 0xfc, 0x31, 0x3a, 0x18); # endif /* _WIN32 */ /* Timeout for request (in milliseconds */ # define QUANTIS_USB_REQUEST_TIMEOUT 1000 /* Defines QuantisUSB-specific commands */ # define QUANTIS_USB_CMD_GET_BOARD_VERSION 0x10 # define QUANTIS_USB_CMD_MODULE_DISABLE 0x11 # define QUANTIS_USB_CMD_MODULE_ENABLE 0x12 # define QUANTIS_USB_CMD_GET_MODULES_STATUS 0x13 # define QUANTIS_USB_CMD_GET_MODULES_POWER 0x14 # define QUANTIS_USB_CMD_GET_MODULES_MASK 0x15 # define QUANTIS_USB_CMD_GET_MODULES_RATE 0x16 /** * Maximal size (in bytes) of an BULK packet. * * We have: * - 64 bytes for USB 1 * - 512 bytes for USB 2 */ # define USB_MAX_BULK_PACKET_SIZE 512 /** * Quantis USB Endpoint for bulk requests. * * This can be seen in the device's descriptor, but since it do not change * we can define it here for faster execution. */ # define QUANTIS_USB_ENDPOINT_BULK_IN 0x86 #endif /* DISABLE_QUANTIS_USB */ #endif /* QUANTIS_USB_COMMANDS_H */
/* * src/views/log.c * Log view. * * Copyright (c) 2011 Patrick "P. J." McDermott * * 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 <stdlib.h> #include <string.h> #include <stdarg.h> #include <curses.h> #include "../views.h" #include "../windows.h" struct view_log { struct view_type *vm_type; struct view *vm_down; struct tab *vm_tab; }; struct view_log_msg { enum view_log_type vlm_type; char *vlm_msg; struct view_log_msg *vlm_prev; }; static struct view_log *view_log_view; static struct view_log_msg *view_log_msg_tail; static struct view *view_log_init(); static void view_log_free(struct view *v); static void view_log_draw(struct view *v); void view_type_log_init() { struct controller *con; con = controller_init(); view_type_register("log", con, &view_log_init, &view_log_free, &view_log_draw); } static struct view * view_log_init() { struct view_log *v; v = malloc(sizeof(*v)); view_log_view = v; view_log_msg_tail = NULL; return (struct view *) v; } static void view_log_free(struct view *v) { free((struct view_log *) v); } static void view_log_draw(struct view *v) { int win_maxy, win_maxx, i; struct view_log_msg *msg; wclear(window_main); curs_set(0); getmaxyx(window_main, win_maxy, win_maxx); for (i = win_maxy - 1, msg = view_log_msg_tail; i >= 0 && msg != NULL; msg = msg->vlm_prev) { #ifndef DEBUG if (msg->vlm_type != VLT_DEBUG) { #endif wmove(window_main, i--, 0); switch (msg->vlm_type) { case VLT_DEBUG: wprintw(window_main, "DEBUG: %s", msg->vlm_msg); break; case VLT_INFO: wprintw(window_main, "%s", msg->vlm_msg); break; } #ifndef DEBUG } #endif } wrefresh(window_main); } void view_log_print(enum view_log_type type, char *fmt, ...) { va_list args; struct view_log_msg *vlm; vlm = malloc(sizeof(*vlm)); vlm->vlm_type = type; vlm->vlm_msg = malloc(256); va_start(args, fmt); vsprintf(vlm->vlm_msg, fmt, args); va_end(args); if (view_log_msg_tail != NULL) { vlm->vlm_prev = view_log_msg_tail; } else { vlm->vlm_prev = NULL; } view_log_msg_tail = vlm; if (view_is_current((struct view *) view_log_view)) { view_draw_current(); } } void view_debug_print(char *fmt, ...) { va_list args; struct view_log_msg *vlm; vlm = malloc(sizeof(*vlm)); vlm->vlm_type = VLT_DEBUG; vlm->vlm_msg = malloc(256); va_start(args, fmt); vsprintf(vlm->vlm_msg, fmt, args); va_end(args); if (view_log_msg_tail != NULL) { vlm->vlm_prev = view_log_msg_tail; } else { vlm->vlm_prev = NULL; } view_log_msg_tail = vlm; if (view_is_current((struct view *) view_log_view)) { view_draw_current(); } }
// Copyright (c) 2005 - 2017 Settlers Freaks (sf-team at siedler25.org) // // This file is part of Return To The Roots. // // Return To The Roots is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // Return To The Roots is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Return To The Roots. If not, see <http://www.gnu.org/licenses/>. #pragma once #include "figures/noFigure.h" class noFlag; class SerializedGameData; class noRoadNode; /// Basisklasse für Geologen und Späher, also die, die an eine Flagge gebunden sind zum Arbeiten class nofFlagWorker : public noFigure { protected: /// Flaggen-Ausgangspunkt noFlag* flag; enum State { STATE_FIGUREWORK, // Zur Flagge und zurückgehen, Rumirren usw STATE_GOTOFLAG, // geht zurück zur Flagge um anschließend nach Hause zu gehen STATE_GEOLOGIST_GOTONEXTNODE, // Zum nächsten Punkt gehen, um dort zu graben STATE_GEOLOGIST_DIG, // graben (mit Hammer auf Berg hauen) STATE_GEOLOGIST_CHEER, // Jubeln, dass man etwas gefunden hat STATE_SCOUT_SCOUTING // läuft umher und erkundet } state; /// Kündigt bei der Flagge void AbrogateWorkplace() override; /// Geht wieder zurück zur Flagge und dann nach Hause void GoToFlag(); public: nofFlagWorker(Job job, MapPoint pos, unsigned char player, noRoadNode* goal); nofFlagWorker(SerializedGameData& sgd, unsigned obj_id); /// Aufräummethoden protected: void Destroy_nofFlagWorker(); public: void Destroy() override { Destroy_nofFlagWorker(); } /// Serialisierungsfunktionen protected: void Serialize_nofFlagWorker(SerializedGameData& sgd) const; public: void Serialize(SerializedGameData& sgd) const override { Serialize_nofFlagWorker(sgd); } /// Wird aufgerufen, wenn die Flagge abgerissen wurde virtual void LostWork() = 0; /// Gibt Flagge zurück noFlag* GetFlag() const { return flag; } };
/***************************************************************************** * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: mods/deathmatch/logic/rpc/CWorldRPCs.h * PURPOSE: Header for world RPC calls * DEVELOPERS: Jax <> * Stanislav Bobrov <lil_toady@hotmail.com> * Alberto Alonso <rydencillo@gmail.com> * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ #ifndef __CWorldRPCs_H #define __CWorldRPCs_H #include "CRPCFunctions.h" class CWorldRPCs : public CRPCFunctions { public: static void LoadFunctions ( void ); DECLARE_RPC ( SetTime ); DECLARE_RPC ( SetWeather ); DECLARE_RPC ( SetWeatherBlended ); DECLARE_RPC ( SetMinuteDuration ); DECLARE_RPC ( SetGravity ); DECLARE_RPC ( SetGameSpeed ); DECLARE_RPC ( SetWaveHeight ); DECLARE_RPC ( SetSkyGradient ); DECLARE_RPC ( ResetSkyGradient ); DECLARE_RPC ( SetBlurLevel ); DECLARE_RPC ( SetWantedLevel ); DECLARE_RPC ( ResetMapInfo ); DECLARE_RPC ( SetFPSLimit ); DECLARE_RPC ( SetGarageOpen ); DECLARE_RPC ( SetGlitchEnabled ); DECLARE_RPC ( SetCloudsEnabled ); }; #endif
/** * mds — A micro-display server * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (maandree@kth.se) * * 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 "call-stack.h" #include <stdlib.h> /** * An entry in the call-stack */ typedef struct mds_kbdc_call { /** * The tree node where the call was made */ const mds_kbdc_tree_t *tree; /** * The position of the line of the tree node * where the call begins */ size_t start; /** * The position of the line of the tree node * where the call end */ size_t end; /** * A snapshot of the include-stack as it * looked when the call was being made */ mds_kbdc_include_stack_t *include_stack; } mds_kbdc_call_t; /** * Variable whether the latest created error is stored */ static mds_kbdc_parse_error_t *error; /** * The `result` parameter of root procedure that requires the include-stack */ static mds_kbdc_parsed_t *result; /** * The original value of `result->pathname` */ static char *original_pathname; /** * The original value of `result->source_code` */ static mds_kbdc_source_code_t *original_source_code; /** * Stack of visited function- and macro-calls */ static mds_kbdc_call_t *restrict calls = NULL; /** * The number elements allocated for `calls` */ static size_t calls_size = 0; /** * The number elements stored in `calls` */ static size_t calls_ptr = 0; /** * Add “called from here”-notes * * @return Zero on success, -1 on error */ int mds_kbdc_call_stack_dump(void) { char *old_pathname = result->pathname; mds_kbdc_source_code_t *old_source_code = result->source_code; size_t ptr = calls_ptr, iptr; mds_kbdc_call_t *restrict call; mds_kbdc_include_stack_t *restrict includes; while (ptr--) { call = calls + ptr; includes = call->include_stack; iptr = includes->ptr; result->pathname = iptr ? includes->stack[iptr - 1]->filename : original_pathname; result->source_code = iptr ? includes->stack[iptr - 1]->source_code : original_source_code; NEW_ERROR_(result, NOTE, 1, call->tree->loc_line, call->start, call->end, 1, "called from here"); DUMP_INCLUDE_STACK(iptr); } result->pathname = old_pathname; result->source_code = old_source_code; return 0; fail: result->pathname = old_pathname; result->source_code = old_source_code; return -1; } /** * Prepare for usage of call-stacks * * @param result_ The `result` parameter of root procedure that requires the call-stack */ void mds_kbdc_call_stack_begin(mds_kbdc_parsed_t *restrict result_) { result = result_; original_pathname = result_->pathname; original_source_code = result_->source_code; } /** * Cleanup after usage of call-stacks */ void mds_kbdc_call_stack_end(void) { result->pathname = original_pathname; result->source_code = original_source_code; free(calls), calls = NULL; calls_size = calls_ptr = 0; } /** * Mark an function- or macro-call * * @param tree The tree node where the call was made * @param start The position of the line of the tree node where the call begins * @param end The position of the line of the tree node where the call end * @return Zero on success, -1 on error */ int mds_kbdc_call_stack_push(const mds_kbdc_tree_t *restrict tree, size_t start, size_t end) { mds_kbdc_call_t *tmp; mds_kbdc_call_t *call; if (calls_ptr == calls_size) { fail_if (yrealloc(tmp, calls, calls_size + 4, mds_kbdc_call_t)); calls_size += 4; } call = calls + calls_ptr++; call->tree = tree; call->start = start; call->end = end; call->include_stack = mds_kbdc_include_stack_save(); fail_if (!call->include_stack); return 0; fail: return -1; } /** * Undo the lasted not-undone call to `mds_kbdc_call_stack_push` * * This function is guaranteed not to modify `errno` */ void mds_kbdc_call_stack_pop(void) { int saved_errno = errno; mds_kbdc_include_stack_free(calls[--calls_ptr].include_stack); errno = saved_errno; }
#ifndef TICTACTOEPLAYER_H #define TICTACTOEPLAYER_H namespace ribi { namespace tictactoe { enum class Player { player1, player2 }; int PlayerToState(const Player player) noexcept; Player StateToPlayer(const int state); } //~namespace tictactoe } //~namespace ribi #endif // TICTACTOEPLAYER_H
/* * * Copyright © 2000 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #define FUNC shadowUpdateRotate16 #define Data CARD16 #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "shrotpack.h"
/* * iore_test_types.c * * Author: Camilo <eduardo.camilo@posgrad.ufsc.br> */ #include <assert.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include "iore_test_types.h" /*** VARIABLES ***************************************************************/ const char *test_type_lbl[IORE_TEST_TYPE_LENGTH] = { "write", "read" }; const char *test_file_mode_lbl[IORE_TEST_FMODE_LENGTH] = { "Nx1", "NxN" }; /*** FUNCTIONS ***************************************************************/ char * test2str (const iore_test_t *test) { char *str = NULL; if (test) { char *wkld = wkld2str (&test->wkld); char *afio = afio2str (&test->afio); char *afsb = afsb2str (test->afsb); int len = snprintf(str, 0, TEST2STR_FORMAT, test, (test->type.write ? "true" : "false"), (test->type.read ? "true" : "false"), (test->write_flush ? "true" : "false"), (test->write_flush_per_req ? "true" : "false"), test->read_reorder_offset, (test->intra_test_barrier ? "true": "false"), test->inter_test_delay_secs, test_file_mode_lbl[test->file_mode], test->file_name, (test->file_name_append_sequence_num ? "true" : "false"), (test->file_name_append_task_id ? "true" : "false"), (test->file_dir_per_task ? "true" : "false"), (test->file_keep ? "true" : "false"), wkld, afio, afsb) + 1; if (len > 0) { str = malloc (len); assert(str); snprintf(str, len, TEST2STR_FORMAT, test, (test->type.write ? "true" : "false"), (test->type.read ? "true" : "false"), (test->write_flush ? "true" : "false"), (test->write_flush_per_req ? "true" : "false"), test->read_reorder_offset, (test->intra_test_barrier ? "true" : "false"), test->inter_test_delay_secs, test_file_mode_lbl[test->file_mode], test->file_name, (test->file_name_append_sequence_num ? "true" : "false"), (test->file_name_append_task_id ? "true" : "false"), (test->file_dir_per_task ? "true" : "false"), (test->file_keep ? "true" : "false"), wkld, afio, afsb); } } return str; } /* test2str () */
/* ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio 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. */ /** * @file RP/system_rp2040.h * @brief CMSIS system device file for the RP2040. * * @defgroup CMSIS_RP2040 RP2040 System Device File * @ingroup CMSIS_DEVICE * @{ */ #ifndef SYSTEM_RP2040_H #define SYSTEM_RP2040_H extern uint32_t SystemCoreClock; #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #endif /* SYSTEM_RP2040_H */
// // KFCalibrateViewController.h // kalman-ios // // Created by Gareth Cross on 12/26/2013. // Copyright (c) 2013 gareth. All rights reserved. // #import <UIKit/UIKit.h> @interface KFCalibrateViewController : UIViewController {} @property (nonatomic) IBOutlet UILabel * instructionLabel; @end
/* ** ClanLib SDK ** Copyright (c) 1997-2005 The ClanLib Team ** ** This software is provided 'as-is', without any express or implied ** warranty. In no event will the authors be held liable for any damages ** arising from the use of this software. ** ** Permission is granted to anyone to use this software for any purpose, ** including commercial applications, and to alter it and redistribute it ** freely, subject to the following restrictions: ** ** 1. The origin of this software must not be misrepresented; you must not ** claim that you wrote the original software. If you use this software ** in a product, an acknowledgment in the product documentation would be ** appreciated but is not required. ** 2. Altered source versions must be plainly marked as such, and must not be ** misrepresented as being the original software. ** 3. This notice may not be removed or altered from any source distribution. ** ** Note: Some of the libraries ClanLib may link to may have additional ** requirements or restrictions. ** ** File Author(s): ** ** Magnus Norddahl ** (if your name is missing here, please add it) */ #ifndef header_inputsource_memory_generic #define header_inputsource_memory_generic #if _MSC_VER > 1000 #pragma once #endif #include "API/Core/IOData/inputsource.h" #include "API/Core/IOData/inputsource_provider.h" class CL_OutputSource_MemoryGeneric; class CL_InputSource_MemoryGeneric : public CL_InputSource //: Interface to read data from a memory_generic source. //- <p>CL_InputSource_MemoryGeneric is used to read data from a memory_generic source.</p> //also: CL_InputSourceProvider - Interface to open input sources with. { public: CL_InputSource_MemoryGeneric(void *data, int size, bool delete_data = false); //: MemoryGeneric copy constructor. //- <p>Makes a seperate copy of the memory in MG.</p> //also: MemoryGeneric::clone. //param MG: Pointer to the MemoryGeneric object from which to copy. CL_InputSource_MemoryGeneric(const CL_InputSource_MemoryGeneric *MG); virtual ~CL_InputSource_MemoryGeneric(); //: Reads larger amounts of data (no endian and 64 bit conversion). //param data: Points to an array where the read data is stored. //param size: Number of bytes to read. //return: Num bytes actually read. virtual int read(void *data, int size); //: Opens the input source. By default, it is open. virtual void open(); //: Closes the input source. virtual void close(); //: Make a copy of the current InputSource, standing at the same position. //return: The clone of the input source. virtual CL_InputSource *clone() const; //: Returns current position in input source. //return: Current position in input source. virtual int tell() const; //: Seeks to the specified position in the input source. //param pos: Position relative to 'seek_type'. //param seek_type: Defines what the 'pos' is relative to. Can be either seek_set, seek_cur og seek_end. virtual void seek(int pos, SeekEnum seek_type); //: Returns the size of the input source //return: Size of the input source. virtual int size() const; //: Pushes the current input source position. The position can be restored again with pop_position. virtual void push_position(); //: Pops a previous pushed input source position (returns to the position). virtual void pop_position(); //: Purges the input buffer of data without deleting the buffer virtual void purge(); private: unsigned char *data; unsigned int pos, length; bool delete_data; }; class CL_InputSourceProvider_Memory : public CL_InputSourceProvider { public: CL_InputSourceProvider_Memory(unsigned char *data, unsigned int size, bool delete_data); CL_InputSourceProvider_Memory(CL_InputSource_MemoryGeneric *MG); CL_InputSourceProvider_Memory(CL_OutputSource_MemoryGeneric *MG); virtual CL_InputSource *open_source(const std::string &handle); virtual CL_InputSourceProvider *clone(); private: unsigned char *data; unsigned int size; bool delete_data; }; #endif
/* * 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 "sessionTest.h" const bool expectedToPass = false; /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ int main() { #if defined(USE_DBC) psonSession * pSession; psonSessionContext context; int errcode; void * pApiObject = (void *) &errcode; /* dummy pointer */ ptrdiff_t objOffset; psonObjectContext * pObject; bool ok; pSession = initSessionTest( expectedToPass, &context ); ok = psonSessionInit( pSession, pApiObject, &context ); if ( ! ok ) { ERROR_EXIT( expectedToPass, &context.errorHandler, ; ); } objOffset = SET_OFFSET( pSession ); /* Dummy offset */ ok = psonSessionAddObj( pSession, objOffset, PSO_FOLDER, pApiObject, &pObject, &context ); if ( ! ok ) { ERROR_EXIT( expectedToPass, &context.errorHandler, ; ); } psonSessionGetFirst( pSession, &pObject, NULL ); ERROR_EXIT( expectedToPass, &context.errorHandler, ; ); #else return 1; #endif } /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
/* * Copyright (C) 2006-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 "ListTestCommon.h" #include "Nucleus/Tests/EngineTestCommon.h" const bool expectedToPass = false; /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ int main() { #if defined(USE_DBC) psonLinkedList list; psonLinkNode node; psonSessionContext context; initTest( expectedToPass, &context ); InitMem(); psonLinkNodeInit( &node ); psonLinkedListInit( &list ); list.initialized = 0; psonLinkedListRemoveItem( &list, &node ); ERROR_EXIT( expectedToPass, NULL, ; ); #else return 1; #endif } /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
#ifndef DATE_H #define DATE_H struct _Date { long year; int day; int month; }; typedef struct _Date Date; #endif
/* * 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/Elements/StreamFeatures.h> #include <Swiften/Serializer/GenericElementSerializer.h> namespace Swift { class StreamFeaturesSerializer : public GenericElementSerializer<StreamFeatures> { public: StreamFeaturesSerializer(); virtual SafeByteArray serialize(boost::shared_ptr<Element> element) const; }; }
/*************************************************************************** * This file is part of the CuteReport project * * Copyright (C) 2012-2014 by Alexander Mikhalov * * alexander.mikhalov@gmail.com * * * ** GNU General Public License Usage ** * * * This library is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 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/>. * * * ** GNU Lesser General Public License ** * * * This library is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * You should have received a copy of the GNU Lesser General Public * * License along with this library. * * If not, see <http://www.gnu.org/licenses/>. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * ****************************************************************************/ #ifndef RENDERERINTERFACE_H #define RENDERERINTERFACE_H #include "reportplugininterface.h" #include <QObject> #include <QGraphicsItem> #include <QtScript> #include <QtCore> #include <qscriptengine.h> namespace CuteReport { class ReportInterface; class RenderedPageInterface; class RenderedReportInterface; class RenderedReportInterface; class CUTEREPORT_EXPORTS RendererInterface : public ReportPluginInterface { Q_OBJECT Q_PROPERTY(int _current_property READ _currentProperty WRITE _setCurrentProperty DESIGNABLE false) Q_PROPERTY(QString _current_property_description READ _current_property_description DESIGNABLE false) public: explicit RendererInterface(QObject *parent = 0); virtual ~RendererInterface(); virtual RendererInterface * createInstance(QObject * parent = 0) const = 0; virtual RendererInterface * clone() const = 0; virtual void run(ReportInterface* report) = 0; virtual void stop() = 0; virtual bool isRunning() = 0; virtual ReportInterface * report() = 0; virtual void setDpi(int dpi) = 0; virtual int dpi() const = 0; virtual CuteReport::RenderedReportInterface * takeRenderedReport() = 0; virtual void _setCurrentProperty(int num) { m_currentProperty = num; } virtual int _currentProperty() { return m_currentProperty; } virtual QString _current_property_description() const; signals: void changed(); void started(); void done(bool errorsFound); void cancelled(); void processingPage(int page, int total); protected: explicit RendererInterface(const RendererInterface &dd, QObject * parent); friend class RenderedReportInterface; int m_currentProperty; }; } Q_DECLARE_INTERFACE(CuteReport::RendererInterface, "CuteReport.RendererInterface/1.0") /// ------------------ template for additional metatypes template <typename Tp> QScriptValue qScriptValueFromQObject(QScriptEngine *engine, Tp const &qobject) { return engine->newQObject(qobject); } template <typename Tp> void qScriptValueToQObject(const QScriptValue &value, Tp &qobject) { qobject = qobject_cast<Tp>(value.toQObject()); } template <typename Tp> int qScriptRegisterQObjectMetaType( QScriptEngine *engine, const QScriptValue &prototype = QScriptValue() #ifndef qdoc , Tp * /* dummy */ = 0 #endif ) { return qScriptRegisterMetaType<Tp>(engine, qScriptValueFromQObject, qScriptValueToQObject, prototype); } /// -------------------------- #endif // RENDERERINTERFACE_H
/*----------------------------------- Name:shahansha salim Roll number:cs1803 Date:31-jly-2018 Program description: dynamic memory allocation+ file copy Acknowledgements: ------------------------------------*/ #include "cs1803-day4-prog6.h" int main(int argc,char *argv[]) { FILE *fp1=NULL,*fp2=NULL; char *arr1=NULL,*arr2=NULL; struct stat statbuf; size_t f1size=0,f2size=0; if(argc <2){ printf("\ninput files\n"); return -1; } fp1 = fopen(argv[1],"r"); fp2 = fopen(argv[2],"r"); if(NULL == fp1 || NULL == fp2) { printf("\nERROR : file open\n"); return -1; } fstat(fileno(fp1),&statbuf); f1size = (size_t)statbuf.st_size; printf("\nfile1 size : %lu\n",f1size); memoryAlloc(&arr1,f1size); fread(arr1,f1size,1,fp1); fstat(fileno(fp2),&statbuf); f2size = (size_t)statbuf.st_size; printf("\nfile2 size : %lu\n",f2size); memoryAlloc(&arr2,f2size); fread(arr2,f2size,1,fp2); printf("\nfile1::\n%s",arr1); printf("\nfile2::\n%s",arr2); fp1 = freopen(argv[1],"w",fp1); fp2 = freopen(argv[2],"w",fp2); fwrite(arr2,f2size,1,fp1); fwrite(arr1,f1size,1,fp2); return 0; }
/* dzl-graph-model.h * * Copyright (C) 2015 Christian Hergert <christian@hergert.me> * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or (at your option) any later version. * * This file 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 General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DZL_GRAPH_MODEL_H #define DZL_GRAPH_MODEL_H #include <glib-object.h> #include "dzl-version-macros.h" #include "dzl-graph-column.h" G_BEGIN_DECLS #define DZL_TYPE_GRAPH_MODEL (dzl_graph_view_model_get_type()) DZL_AVAILABLE_IN_ALL G_DECLARE_DERIVABLE_TYPE (DzlGraphModel, dzl_graph_view_model, DZL, GRAPH_MODEL, GObject) struct _DzlGraphModelClass { GObjectClass parent; }; typedef struct { gpointer data[8]; } DzlGraphModelIter; DZL_AVAILABLE_IN_ALL DzlGraphModel *dzl_graph_view_model_new (void); DZL_AVAILABLE_IN_ALL guint dzl_graph_view_model_add_column (DzlGraphModel *self, DzlGraphColumn *column); DZL_AVAILABLE_IN_ALL guint dzl_graph_view_model_get_n_columns (DzlGraphModel *self); DZL_AVAILABLE_IN_ALL GTimeSpan dzl_graph_view_model_get_timespan (DzlGraphModel *self); DZL_AVAILABLE_IN_ALL void dzl_graph_view_model_set_timespan (DzlGraphModel *self, GTimeSpan timespan); DZL_AVAILABLE_IN_ALL gint64 dzl_graph_view_model_get_end_time (DzlGraphModel *self); DZL_AVAILABLE_IN_ALL guint dzl_graph_view_model_get_max_samples (DzlGraphModel *self); DZL_AVAILABLE_IN_ALL void dzl_graph_view_model_set_max_samples (DzlGraphModel *self, guint n_rows); DZL_AVAILABLE_IN_ALL void dzl_graph_view_model_push (DzlGraphModel *self, DzlGraphModelIter *iter, gint64 timestamp); DZL_AVAILABLE_IN_ALL gboolean dzl_graph_view_model_get_iter_first (DzlGraphModel *self, DzlGraphModelIter *iter); DZL_AVAILABLE_IN_ALL gboolean dzl_graph_view_model_get_iter_last (DzlGraphModel *self, DzlGraphModelIter *iter); DZL_AVAILABLE_IN_ALL gboolean dzl_graph_view_model_iter_next (DzlGraphModelIter *iter); DZL_AVAILABLE_IN_ALL void dzl_graph_view_model_iter_get (DzlGraphModelIter *iter, gint first_column, ...); DZL_AVAILABLE_IN_ALL void dzl_graph_view_model_iter_get_value (DzlGraphModelIter *iter, guint column, GValue *value); DZL_AVAILABLE_IN_ALL gint64 dzl_graph_view_model_iter_get_timestamp (DzlGraphModelIter *iter); DZL_AVAILABLE_IN_ALL void dzl_graph_view_model_iter_set (DzlGraphModelIter *iter, gint first_column, ...); G_END_DECLS #endif /* DZL_GRAPH_MODEL_H */
/* * Copyright (C) 2004-2021 Savoir-faire Linux Inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> * Author: Olivier Gregoire <olivier.gregoire@savoirfairelinux.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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ #pragma once // Cppunit import #include <cppunit/extensions/HelperMacros.h> #include <cppunit/TestCaller.h> #include <cppunit/TestCase.h> #include <cppunit/TestSuite.h> // Application import #include "manager.h" #include "sip/sipvoiplink.h" #include "sip/sip_utils.h" #include <atomic> #include <thread> class RAIIThread { public: RAIIThread() = default; RAIIThread(std::thread&& t) : thread_ {std::move(t)} {}; ~RAIIThread() { join(); } void join() { if (thread_.joinable()) thread_.join(); } RAIIThread(RAIIThread&&) = default; RAIIThread& operator=(RAIIThread&&) = default; private: std::thread thread_; }; /* * @file Test-sip.h * @brief Regroups unitary tests related to the SIP module */ class test_SIP : public CppUnit::TestFixture { public: //test_SIP() : CppUnit::TestCase("SIP module Tests") {} /* * Code factoring - Common resources can be initialized here. * This method is called by unitcpp before each test */ void setUp(); /* * Code factoring - Common resources can be released here. * This method is called by unitcpp after each test */ void tearDown(); private: // Create a simple IP call and test his state void testSimpleOutgoingIpCall(void); // Receive a new incoming call and test his state void testSimpleIncomingIpCall(void); // Test with multiple outgoing calls void testMultipleOutgoingIpCall(void); // TODO this test bug, the new calls are sometimes // put in hold void testMultipleIncomingIpCall(void); // Test the hold state void testHoldIpCall(void); void testSIPURI(void); /** * Use cppunit library macros to add unit test to the factory */ CPPUNIT_TEST_SUITE(test_SIP); CPPUNIT_TEST ( testSIPURI ); /*CPPUNIT_TEST ( testHoldIpCall ); CPPUNIT_TEST ( testSimpleOutgoingIpCall ); CPPUNIT_TEST ( testMultipleOutgoingIpCall ); CPPUNIT_TEST ( testSimpleIncomingIpCall );*/ //CPPUNIT_TEST ( testMultipleIncomingIpCall ); CPPUNIT_TEST_SUITE_END(); RAIIThread eventLoop_; std::atomic_bool running_; };
/* This file is part of VecVis * * VecVis 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. * * VecVis 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: FlwReaders.h * * Author: David Warne (david.warne@qut.edu.au) * * Summary: Specification of Reader function for vector fields */ #ifndef READERS_H #define READERS_H #include<stdio.h> #include<stdlib.h> #include<string.h> /* Header info reader */ unsigned char V_ReadHeader(const char* filename, int* total_verts, int* total_elements, int* numBoundaries, int* tsteps, float* bounds, int* numScalars, fpos_t* vertpos, fpos_t* elementpos, fpos_t* fluxpos, fpos_t* scalarpos, fpos_t* boudarypos); /*Data Readers*/ unsigned char V_ReadData(const char* filename, int total_verts, int total_elements, int numBoundaries, int tsteps, int numScalars, float* X, float* Y, float** Vx, float** Vy, int** elements, int* numVerts, int* numVertsB, int** boundaries, float*** scalars, fpos_t* vertpos, fpos_t* elementpos, fpos_t* fluxpos, fpos_t* scalarpos, fpos_t* boudarypos); #endif
/* -*- C -*- */ /* Copyright (C) 2000-2014 Free Software Foundation, Inc. Written by Eli Zaretskii (eliz@is.elta.co.il) This file is part of groff. groff 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. groff 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/>. */ /* This header file compartmentalize all idiosyncrasies of non-Posix systems, such as MS-DOS, MS-Windows, etc. It should be loaded after the system headers like stdio.h to protect against warnings and error messages w.r.t. redefining macros. */ #if defined _MSC_VER # ifndef _WIN32 # define _WIN32 # endif #endif #if defined(__MSDOS__) || defined(__EMX__) \ || (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__)) /* Binary I/O nuisances. */ # include <fcntl.h> # include <io.h> # ifdef HAVE_UNISTD_H # include <unistd.h> # endif # ifndef STDIN_FILENO # define STDIN_FILENO 0 # define STDOUT_FILENO 1 # define STDERR_FILENO 2 # endif # ifdef HAVE_DIRECT_H # include <direct.h> # endif # ifdef HAVE_PROCESS_H # include <process.h> # endif # if defined(_MSC_VER) || defined(__MINGW32__) # define POPEN_RT "rt" # define POPEN_WT "wt" # define popen(c,m) _popen(c,m) # define pclose(p) _pclose(p) # define pipe(pfd) _pipe((pfd),0,_O_BINARY|_O_NOINHERIT) # define mkdir(p,m) _mkdir(p) # define setmode(f,m) _setmode(f,m) # define WAIT(s,p,m) _cwait(s,p,m) # define creat(p,m) _creat(p,m) # define read(f,b,s) _read(f,b,s) # define write(f,b,s) _write(f,b,s) # define dup(f) _dup(f) # define dup2(f1,f2) _dup2(f1,f2) # define close(f) _close(f) # define isatty(f) _isatty(f) # define access(p,m) _access(p,m) # endif # define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) # define FOPEN_RB "rb" # define FOPEN_WB "wb" # define FOPEN_RWB "wb+" # ifndef O_BINARY # ifdef _O_BINARY # define O_BINARY (_O_BINARY) # endif # endif /* The system shell. Groff assumes a Unixy shell, but non-Posix systems don't have standard places where it lives, and might not have it installed to begin with. We want to give them some leeway. */ # ifdef __EMX__ # define getcwd(b,s) _getcwd2(b,s) # else # define BSHELL (system_shell_name()) # define BSHELL_DASH_C (system_shell_dash_c()) # define IS_BSHELL(s) (is_system_shell(s)) # endif /* The separator for directories in PATH and other environment variables. */ # define PATH_SEP ";" # define PATH_SEP_CHAR ';' /* Characters that separate directories in a path name. */ # define DIR_SEPS "/\\:" /* How to tell if the argument is an absolute file name. */ # define IS_ABSOLUTE(f) \ ((f)[0] == '/' || (f)[0] == '\\' || (f)[0] && (f)[1] == ':') /* The executable extension. */ # define EXE_EXT ".exe" /* Possible executable extensions. */ # define PATH_EXT ".com;.exe;.bat;.cmd" /* The system null device. */ # define NULL_DEV "NUL" /* The default place to create temporary files. */ # ifndef P_tmpdir # ifdef _P_tmpdir # define P_tmpdir _P_tmpdir # else # define P_tmpdir "c:/temp" # endif # endif /* Prototypes. */ # ifdef __cplusplus extern "C" { # endif char * system_shell_name(void); const char * system_shell_dash_c(void); int is_system_shell(const char *); # ifdef __cplusplus } # endif #endif #if defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__) /* Win32 implementations which use the Microsoft runtime library * are prone to hanging when a pipe reader quits with unread data in the pipe. * `gtroff' avoids this, by invoking `FLUSH_INPUT_PIPE()', defined as ... */ # define FLUSH_INPUT_PIPE(fd) \ do if (!isatty(fd)) \ { \ char drain[BUFSIZ]; \ while (read(fd, drain, sizeof(drain)) > 0) \ ; \ } while (0) /* The Microsoft runtime library also has a broken argument passing mechanism, * which may result in improper grouping of arguments passed to a child process * by the `spawn()' family of functions. In `groff', only the `spawnvp()' * function is affected; we work around this defect, by substituting a * wrapper function in place of `spawnvp()' calls. */ # ifdef __cplusplus extern "C" { # endif int spawnvp_wrapper(int, char *, char **); # ifdef __cplusplus } # endif # ifndef SPAWN_FUNCTION_WRAPPERS # undef spawnvp # define spawnvp spawnvp_wrapper # undef _spawnvp # define _spawnvp spawnvp # endif /* SPAWN_FUNCTION_WRAPPERS */ #else /* Other implementations do not suffer from Microsoft runtime bugs, * but `gtroff' requires a dummy definition for FLUSH_INPUT_PIPE() */ # define FLUSH_INPUT_PIPE(fd) do {} while(0) #endif /* Defaults, for Posix systems. */ #ifndef SET_BINARY # define SET_BINARY(f) do {} while(0) #endif #ifndef FOPEN_RB # define FOPEN_RB "r" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef FOPEN_RWB # define FOPEN_RWB "w+" #endif #ifndef POPEN_RT # define POPEN_RT "r" #endif #ifndef POPEN_WT # define POPEN_WT "w" #endif #ifndef O_BINARY # define O_BINARY 0 #endif #ifndef BSHELL # define BSHELL "/bin/sh" #endif #ifndef BSHELL_DASH_C # define BSHELL_DASH_C "-c" #endif #ifndef IS_BSHELL # define IS_BSHELL(s) ((s) && strcmp(s,BSHELL) == 0) #endif #ifndef PATH_SEP # define PATH_SEP ":" # define PATH_SEP_CHAR ':' #endif #ifndef DIR_SEPS # define DIR_SEPS "/" #endif #ifndef IS_ABSOLUTE # define IS_ABSOLUTE(f) ((f)[0] == '/') #endif #ifndef EXE_EXT # define EXE_EXT "" #endif #ifndef PATH_EXT # define PATH_EXT "" #endif #ifndef NULL_DEV # define NULL_DEV "/dev/null" #endif #ifndef GS_NAME # define GS_NAME "gs" #endif #ifndef WAIT # define WAIT(s,p,m) wait(s) #endif #ifndef _WAIT_CHILD # define _WAIT_CHILD 0 #endif
/* casm - Simple, portable assembler Copyright (C) 2003-2015 Ian Cowburn (ianc@noddybox.co.uk) 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/>. ------------------------------------------------------------------------- Gameboy ROM output */ #ifndef CASM_NESOUT_H #define CASM_NESOUT_H #include "parse.h" #include "state.h" #include "cmd.h" /* ---------------------------------------- INTERFACES */ /* NES Output options */ const ValueTable *NESOutputOptions(void); CommandStatus NESOutputSetOption(int opt, int argc, char *argv[], int quoted[], char *error, size_t error_size); /* NES ROM output of assembly. Returns TRUE if OK, FALSE for failure. */ int NESOutput(const char *filename, const char *filename_bank, MemoryBank **bank, int count, char *error, size_t error_size); #endif /* vim: ai sw=4 ts=8 expandtab */
#ifndef GOOGLE_DRIVE_FIELDS_H #define GOOGLE_DRIVE_FIELDS_H namespace GoogleDrive { class Fields { public: enum Field { }; // Fields(); // static QString construct(); // void enableField(Field f, bool enable = true); }; } #endif