text
stringlengths
4
6.14k
#ifndef __DONGLE_HDMI_H__ #define __DONGLE_HDMI_H__ #include <linux/notifier.h> enum DONGLE_HDMI_STATUS { DONGLE_HDMI_POWER_ON = 1, DONGLE_HDMI_POWER_OFF, DONGLE_HDMI_MAx }; /*Register to slimport driver*/ int hdmi_driver_notifier_register(struct notifier_block *nb); int hdmi_driver_notifier_unregister(struct notifier_block *nb); #endif /*__DONGLE_HDMI_H__*/
/* *************************************************************************** * finder.h -- main code of LC-Finder, responsible for the initialization of * the LC-Finder and the scheduling of other functions. * * Copyright (C) 2016-2019 by Liu Chao <lc-soft@live.cn> * * This file is part of the LC-Finder project, and may only be used, modified, * and distributed under the terms of the GPLv2. * * By continuing to use, modify, or distribute this file you indicate that you * have read the license and understand and accept it fully. * * The LC-Finder project 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 GPL v2 for more details. * * You should have received a copy of the GPLv2 along with this file. It is * usually in the LICENSE.TXT file, If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************/ /* **************************************************************************** * finder.h -- LC-Finder 主程序代码,负责整个程序的初始化和其它功能的调度。 * * 版权所有 (C) 2016-2018 归属于 刘超 <lc-soft@live.cn> * * 这个文件是 LC-Finder 项目的一部分,并且只可以根据GPLv2许可协议来使用、更改和 * 发布。 * * 继续使用、修改或发布本文件,表明您已经阅读并完全理解和接受这个许可协议。 * * LC-Finder 项目是基于使用目的而加以散布的,但不负任何担保责任,甚至没有适销 * 性或特定用途的隐含担保,详情请参照GPLv2许可协议。 * * 您应已收到附随于本文件的GPLv2许可协议的副本,它通常在 LICENSE 文件中,如果 * 没有,请查看:<http://www.gnu.org/licenses/>. * ****************************************************************************/ #ifndef LCFINDER_H #define LCFINDER_H #include <LCUI_Build.h> #include <LCUI/LCUI.h> #include "build.h" #include "types.h" #include "bridge.h" #include "common.h" #include "file_cache.h" #include "file_search.h" #include "thumb_db.h" #include "thumb_cache.h" LCFINDER_BEGIN_HEADER /** 事件类型 */ enum LCFinderEventType { EVENT_DIR_ADD, EVENT_DIR_DEL, EVENT_SYNC, EVENT_SYNC_DONE, EVENT_TAG_ADD, EVENT_TAG_UPDATE, EVENT_DIRS_CHG, EVENT_FILE_DEL, EVENT_THUMBDB_DEL_DONE, EVENT_LANG_CHG, EVENT_PRIVATE_SPACE_CHG, EVENT_LICENSE_CHG }; /** 配置数据结构 */ typedef struct FinderConfigRec_ { char head[32]; /**< 头部标记 */ struct { int major; int minor; int revision; int type; } version; /**< 版本号 */ char language[32]; /**< 当前语言 */ int files_sort; /**< 文件的排序方式 */ char encrypted_password[48]; /**< 加密后的密码 */ int scaling; /**< 界面的缩放比例,100 ~ 200 */ wchar_t detector_model_name[64]; } FinderConfigRec, *FinderConfig; typedef struct FinderLicenseRec_ { LCUI_BOOL is_active; LCUI_BOOL is_trial; } FinderLicenseRec, *FinderLicense; enum FinderState { FINDER_STATE_NONE, FINDER_STATE_ACTIVATED, FINDER_STATE_BLOCKED }; /** LCFinder 的主要数据记录 */ typedef struct Finder_ { int state; /**< 当前状态 */ DB_Dir *dirs; /**< 源文件夹列表 */ DB_Tag *tags; /**< 标签列表 */ size_t n_dirs; /**< 多少个源文件夹 */ size_t n_tags; /**< 多少个标签 */ wchar_t *work_dir; /**< 工作目录 */ wchar_t *data_dir; /**< 数据文件夹 */ wchar_t *fileset_dir; /**< 文件列表缓存所在文件夹 */ wchar_t *thumbs_dir; /**< 缩略图数据库所在文件夹 */ wchar_t **thumb_paths; /**< 缩略图数据库路径列表 */ ThumbCache thumb_cache; /**< 缩略图数据缓存 */ Dict *thumb_dbs; /**< 缩略图数据库记录,以源文件夹路径作为索引 */ LCUI_EventTrigger trigger; /**< 事件触发器 */ FinderConfigRec config; /**< 当前配置 */ FinderLicenseRec license; /**< 当前许可证状态信息 */ int open_private_space; /**< 是否打开了私人空间 */ int storage; /**< 文件服务连接标识符,主要用于获取文件基本信息 */ int storage_for_image; /**< 文件服务连接标识符,主要用于读取图片内容 */ int storage_for_thumb; /**< 文件服务连接标识符,主要用于获取图片缩略图 */ int storage_for_scan; /**< 文件服务连接标识符,主要用于扫描文件列表 */ } Finder; typedef void(*LCFinder_EventHandler)(void*, void*); /** 文件同步状态记录 */ typedef struct FileSyncStatusRec_ { size_t task_i; int state; /**< 当前状态 */ size_t files; /**< 文件总数 */ size_t dirs; /**< 目录总数 */ size_t added_files; /**< 增加的文件数量 */ size_t changed_files; /**< 改变的文件数量 */ size_t deleted_files; /**< 删除的文件数量 */ size_t scaned_files; /**< 已扫描的文件数量 */ size_t synced_files; /**< 已同步的文件数量 */ size_t scaned_dirs; /**< 已扫描的目录数量 */ SyncTask task; /**< 当前正执行的任务 */ SyncTask *tasks; /**< 所有任务 */ void *data; void(*callback)(void*); } FileSyncStatusRec, *FileSyncStatus; extern Finder finder; /** 绑定事件 */ int LCFinder_BindEvent(int event_id, LCFinder_EventHandler handler, void *data); /** 触发事件 */ int LCFinder_TriggerEvent(int event_id, void *data); /** 获取指定文件路径所处的源文件夹 */ DB_Dir LCFinder_GetSourceDir(const char *filepath); size_t LCFinder_GetSourceDirList(DB_Dir **outdirs); /** 获取缩略图数据库总大小 */ int64_t LCFinder_GetThumbDBTotalSize(void); /** 清除缩略图数据库 */ void LCFinder_ClearThumbDB(void); void LCFinder_SyncFilesAsync(FileSyncStatus s); DB_Dir LCFinder_GetDir(const char *dirpath); DB_Dir LCFinder_AddDir(const char *dirpath, const char *token, int visible); DB_Tag LCFinder_GetTagById(int id); DB_Tag LCFinder_GetTag(const char *tagname); DB_Tag LCFinder_AddTag(const char *tagname); DB_Tag LCFinder_AddTagForFile(DB_File file, const char *tagname); /** 获取文件的标签列表 */ size_t LCFinder_GetFileTags(DB_File file, DB_Tag **outtags); /** 重新载入标签列表 */ void LCFinder_ReloadTags(void); void LCFinder_DeleteDir(DB_Dir dir); size_t LCFinder_DeleteFiles(char * const *files, size_t nfiles, int(*onstep)(void*, size_t, size_t), void *privdata); /** 保存配置 */ int LCFinder_SaveConfig(void); /** 载入配置 */ int LCFinder_LoadConfig(void); /** 验证密码 */ LCUI_BOOL LCFinder_AuthPassword(const char *password); /** 设置密码 */ void LCFinder_SetPassword(const char *password); /** 开启私人空间 */ void LCFinder_OpenPrivateSpace(void); /** 关闭私人空间 */ void LCFinder_ClosePrivateSpace(void); int LCFinder_Init(int argc, char **argv); int LCFinder_Run(void); void LCFinder_Exit(void); LCFINDER_END_HEADER #endif
/** * comediscope.h * (c) 2004-2012 Bernd Porr, no warranty, GNU-public license **/ class ComediScope; #ifndef COMEDISCOPE_H #define COMEDISCOPE_H #include <QWidget> #include <QPushButton> #include <QCheckBox> #include <QLayout> #include <QPaintEvent> #include <QTimerEvent> //#include <Iir.h> #include <comedilib.h> #include <fcntl.h> #include "ext_data_receive.h" #include "comedirecord.h" #include "Fir1fixed.h" #define MAX_DISP_X 4096 // max screen width #define IIRORDER 2 #define VOLT_FORMAT_STRING "%+.3f" class ComediScope : public QWidget { Q_OBJECT public: /** * Constructor: **/ ComediScope( ComediRecord* comediRecordTmp, int channels = 0, float notchF = 50, int port_for_ext_data = 0, int maxComediDevices = 1, int first_dev_no = 0, int req_sampling_rate = 1000, const char *defaultTextStringForMissingExtData = NULL, int fftdevnumber = -1, int fftchannel = -1, int fftmaxf = -1 ); /** * Destructor: close the file if necessary **/ ~ComediScope(); protected: /** * Overloads the empty paint-function: draws the functions and saves the data **/ void paintEvent( QPaintEvent * ); public: /** * Clears the screen **/ void clearScreen(); private: /** * Paints the data on the screen, is callsed by paintEvent **/ void paintData(float** buffer); /** * Is called by the timer of the window. This causes the drawing and saving * of all not yet displayed/saved data. **/ void timerEvent( QTimerEvent * ); private slots: /** * Updates the time-code and also the voltages of the channels **/ void updateTime(); private: /** * Saves data which has arrived from the AD-converter **/ void writeFile(); private: /** * file descriptor for /dev/comedi0 **/ comedi_t **dev; private: unsigned int** chanlist; private: int subdevice; private: comedi_cmd** cmd; /** * y-positions of the data **/ int ***ypos; /** * current x-pos **/ int xpos; /** * elapsed msec **/ long int nsamples; public: /** * sets the filename for the data-file **/ void setFilename(QString name,int csv); public: /** * sets the time between the samples **/ void setTB(int us); private: /** * pointer to the parent widget which contains all the controls **/ ComediRecord* comediRecord; private: /** * the filename of the data-file **/ QString* rec_filename; /** * the file descriptor to the data-file **/ FILE* rec_file; /** * number of channels switched on **/ int num_channels; private: /** * buffer which adds up the data for averaging **/ float** adAvgBuffer; private: /** * init value for the averaging counter **/ int tb_init; int eraseFlag; private: /** * counter for the tb. If zero the average is * taken from adAvgBuffer and saved into actualAD. **/ int tb_counter; public: /** * Starts recording **/ void startRec(); /** * Ends recording **/ void stopRec(); private: /** * the number of channels actually used per comedi device **/ int channels_in_use; public: int getNchannels() {return channels_in_use;}; private: /** * Frequency for the notch filter in Hz **/ float notchFrequency; public: /** * sets the notch frequency **/ void setNotchFrequency(float f); /** * gets the notch frequency **/ float getNotchFrequency() { return notchFrequency; } private: /** * flag if data has been recorded. Prevents overwrite. **/ int recorded; /** * the max value of the A/D converter **/ lsampl_t* maxdata; public: /** * physical range **/ comedi_range** crange; /** * notch filter **/ // Iir::Butterworth::BandStop<IIRORDER>*** iirnotch; /** * comma separated? **/ char separator; /** * Object for external data reception via a socket **/ Ext_data_receive* ext_data_receive; /** * Number of detected comedi devices **/ int nComediDevices; /** * Timer for printing the voltages in the textfields **/ QTimer* counter; /** * Raw daq data from the A/D converter which is saved to a file **/ lsampl_t** daqData; /** * The actual sampling rate **/ int sampling_rate; public: /** * Start the DAQ board(s) **/ void startDAQ(); public: /** * Gets the number of comedi devices actually used here **/ int getNcomediDevices() {return nComediDevices;}; public: /** * Gets the actual sampling rate the boards are running at. **/ int getActualSamplingRate() {return sampling_rate;}; // FFT int fftdevno; int fftch; int fftmaxfrequency; }; #endif
/* * gedit-view-centering.h * This file is part of gedit * * Copyright (C) 2014 - Sébastien Lafargue * Copyright (C) 2015 - Sébastien Wilmet * * Gedit is free software; you can redistribute this file and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * Gedit is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef GEDIT_VIEW_CENTERING_H #define GEDIT_VIEW_CENTERING_H #include <gtk/gtk.h> G_BEGIN_DECLS #define GEDIT_TYPE_VIEW_CENTERING (gedit_view_centering_get_type()) #define GEDIT_VIEW_CENTERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_VIEW_CENTERING, GeditViewCentering)) #define GEDIT_VIEW_CENTERING_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_VIEW_CENTERING, GeditViewCentering const)) #define GEDIT_VIEW_CENTERING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_VIEW_CENTERING, GeditViewCenteringClass)) #define GEDIT_IS_VIEW_CENTERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_VIEW_CENTERING)) #define GEDIT_IS_VIEW_CENTERING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_VIEW_CENTERING)) #define GEDIT_VIEW_CENTERING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_VIEW_CENTERING, GeditViewCenteringClass)) typedef struct _GeditViewCentering GeditViewCentering; typedef struct _GeditViewCenteringClass GeditViewCenteringClass; typedef struct _GeditViewCenteringPrivate GeditViewCenteringPrivate; struct _GeditViewCentering { GtkBin parent; GeditViewCenteringPrivate *priv; }; struct _GeditViewCenteringClass { GtkBinClass parent_class; }; GType gedit_view_centering_get_type (void) G_GNUC_CONST; GeditViewCentering * gedit_view_centering_new (void); void gedit_view_centering_set_centered (GeditViewCentering *container, gboolean centered); gboolean gedit_view_centering_get_centered (GeditViewCentering *container); G_END_DECLS #endif /* GEDIT_VIEW_CENTERING_H */ /* ex:set ts=8 noet: */
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008 The Regents of the University of California // // This file is part of Qbox // // Qbox is distributed 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. // See the file COPYING in the root directory of this distribution // or <http://www.gnu.org/licenses/>. // //////////////////////////////////////////////////////////////////////////////// // // ChargeMixCoeff.h // //////////////////////////////////////////////////////////////////////////////// // $Id: ChargeMixCoeff.h,v 1.6 2008-09-08 15:56:18 fgygi Exp $ #ifndef CHARGEMIXCOEFF_H #define CHARGEMIXCOEFF_H #include<iostream> #include<iomanip> #include<sstream> #include<stdlib.h> #include "Sample.h" class ChargeMixCoeff : public Var { Sample *s; public: const char *name ( void ) const { return "charge_mix_coeff"; }; int set ( int argc, char **argv ) { if ( argc != 2 ) { if ( ui->onpe0() ) cout << " charge_mix_coeff takes only one value" << endl; return 1; } double v = atof(argv[1]); if ( v < 0.0 ) { if ( ui->onpe0() ) cout << " charge_mix_coeff must be non-negative" << endl; return 1; } s->ctrl.charge_mix_coeff = v; return 0; } string print (void) const { ostringstream st; st.setf(ios::left,ios::adjustfield); st << setw(10) << name() << " = "; st.setf(ios::right,ios::adjustfield); st << setw(10) << s->ctrl.charge_mix_coeff; return st.str(); } ChargeMixCoeff(Sample *sample) : s(sample) { s->ctrl.charge_mix_coeff = 0.5; }; }; #endif
/**************************************************************** * * * Copyright 2001, 2002 Sanchez Computer Associates, Inc. * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ #include "mdef.h" #include "gtm_string.h" #include "rtnhdr.h" /* For urx.h */ #include "urx.h" void urx_putlab (char *lab, int lablen, urx_rtnref *rtn, char *addr) { urx_labref *lp0, *lp1, *tmplp; boolean_t found; int c; urx_addr *tmpap; found = FALSE; lp0 = (urx_labref *)rtn; lp1 = ((urx_rtnref *) lp0)->lab; /* Locate the given label on this routine's unresolved label chain. If not found, we will create a new element and insert it on the chain. When we have a label node, allocate and add an address reference for the supplied address. This address will receive the resolved value when the label becomes resolved. Note that labels are ordered on this chain alphabetically within label name size ... i.e. all sorted 1 character labels followed by all sorted 2 character labels, etc. Note also that the layouts of urx_rtnref and urx_labref are critical as the "next" field in labref is at the same offset as the "lab" anchor in the rtnref block allowing urx_rtnref to be cast and serve as an anchor for the labref chain. */ while (lp1 != 0) { c = lablen - lp1->len; if (!c) c = memcmp(lab, lp1->name.c, lablen); if (c > 0) { lp0 = lp1; lp1 = lp0->next; } else { if (c == 0) found = TRUE; break; } } if (lp0 == (urx_labref *)rtn) assert(((urx_rtnref *)lp0)->lab == lp1); else assert(lp0->next == lp1); if (!found) { /* Add new label name to list */ tmplp = (urx_labref *)malloc(sizeof(urx_labref)); tmplp->len = lablen; memcpy(tmplp->name.c, lab, lablen); tmplp->addr = 0; tmplp->next = lp1; if (lp0 == (urx_labref *)rtn) ((urx_rtnref *)lp0)->lab = tmplp; else lp0->next = tmplp; lp1 = tmplp; } assert(lp1 != 0); tmpap = (urx_addr *)malloc(sizeof(urx_addr)); tmpap->next = lp1->addr; tmpap->addr = (int4 *)addr; lp1->addr = tmpap; return; }
// // UIColor+Util.h // iosapp // // Created by chenhaoxiang on 14-10-18. // Copyright (c) 2014年 oschina. All rights reserved. // #import <UIKit/UIKit.h> @interface UIColor (Util) + (UIColor *)colorWithHex:(int)hexValue alpha:(CGFloat)alpha; + (UIColor *)colorWithHex:(int)hexValue; + (UIColor *)themeColor; + (UIColor *)nameColor; + (UIColor *)titleColor; + (UIColor *)separatorColor; + (UIColor *)cellsColor; + (UIColor *)titleBarColor; + (UIColor *)selectTitleBarColor; + (UIColor *)navigationbarColor; + (UIColor *)selectCellSColor; + (UIColor *)labelTextColor; + (UIColor *)teamButtonColor; + (UIColor *)infosBackViewColor; + (UIColor *)lineColor; + (UIColor *)contentTextColor; @end
/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <tap.h> int main() { plan(4); ok1(1); ok1(1); /* Tests in the todo region is expected to fail. If they don't, something is strange. */ todo_start("Need to fix these"); ok1(0); ok1(0); todo_end(); return exit_status(); }
/******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org> Copyright (C) 2008 Lucas Murray <lmurray@undefinedfire.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. *********************************************************************/ #ifndef KWIN_DESKTOPGRID_H #define KWIN_DESKTOPGRID_H #include <kwineffects.h> #include <kshortcut.h> #include <QObject> #include <QtCore/QTimeLine> #include <QtGui/QGraphicsView> namespace Plasma { class PushButton; class FrameSvg; } namespace KWin { class PresentWindowsEffectProxy; class DesktopButtonsView : public QGraphicsView { Q_OBJECT public: DesktopButtonsView(QWidget* parent = 0); void windowInputMouseEvent(QMouseEvent* e); void setAddDesktopEnabled(bool enable); void setRemoveDesktopEnabled(bool enable); virtual void drawBackground(QPainter* painter, const QRectF& rect); Q_SIGNALS: void addDesktop(); void removeDesktop(); private: Plasma::PushButton* m_addDesktopButton; Plasma::PushButton* m_removeDesktopButton; Plasma::FrameSvg* m_frame; }; class DesktopGridEffect : public Effect { Q_OBJECT public: DesktopGridEffect(); ~DesktopGridEffect(); virtual void reconfigure(ReconfigureFlags); virtual void prePaintScreen(ScreenPrePaintData& data, int time); virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data); virtual void postPaintScreen(); virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void windowInputMouseEvent(Window w, QEvent* e); virtual void grabbedKeyboardEvent(QKeyEvent* e); virtual bool borderActivated(ElectricBorder border); virtual bool isActive() const; enum { LayoutPager, LayoutAutomatic, LayoutCustom }; // Layout modes private slots: void toggle(); // slots for global shortcut changed // needed to toggle the effect void globalShortcutChanged(const QKeySequence& seq); void slotAddDesktop(); void slotRemoveDesktop(); void slotWindowAdded(KWin::EffectWindow* w); void slotWindowClosed(KWin::EffectWindow *w); void slotWindowDeleted(KWin::EffectWindow *w); void slotNumberDesktopsChanged(int old); void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old); private: QPointF scalePos(const QPoint& pos, int desktop, int screen = -1) const; QPoint unscalePos(const QPoint& pos, int* desktop = NULL) const; int posToDesktop(const QPoint& pos) const; EffectWindow* windowAt(QPoint pos) const; void setCurrentDesktop(int desktop); void setHighlightedDesktop(int desktop); int desktopToRight(int desktop, bool wrap = true) const; int desktopToLeft(int desktop, bool wrap = true) const; int desktopUp(int desktop, bool wrap = true) const; int desktopDown(int desktop, bool wrap = true) const; void setActive(bool active); void setup(); void setupGrid(); void finish(); bool isMotionManagerMovingWindows() const; bool isUsingPresentWindows() const; QRectF moveGeometryToDesktop(int desktop) const; void desktopsAdded(int old); void desktopsRemoved(int old); QList<ElectricBorder> borderActivate; int zoomDuration; int border; Qt::Alignment desktopNameAlignment; int layoutMode; int customLayoutRows; bool activated; QTimeLine timeline; int paintingDesktop; int highlightedDesktop; int m_originalMovingDesktop; Window input; bool keyboardGrab; bool wasWindowMove, wasDesktopMove, isValidMove; EffectWindow* windowMove; QPoint windowMoveDiff; QPoint dragStartPos; // Soft highlighting QList<QTimeLine*> hoverTimeline; QList< EffectFrame* > desktopNames; QSize gridSize; Qt::Orientation orientation; QPoint activeCell; // Per screen variables QList<double> scale; // Because the border isn't a ratio each screen is different QList<double> unscaledBorder; QList<QSizeF> scaledSize; QList<QPointF> scaledOffset; // Shortcut - needed to toggle the effect KShortcut shortcut; PresentWindowsEffectProxy* m_proxy; QList<WindowMotionManager> m_managers; bool m_usePresentWindows; QRect m_windowMoveGeometry; QPoint m_windowMoveStartPoint; QHash< DesktopButtonsView*, EffectWindow* > m_desktopButtonsViews; }; } // namespace #endif
//-------------------------------------------------------------------------- // Edges // Copyright (C) 1999-2000 Vincent C. H. Ma // http://edges.sourceforge.net // vchma@users.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: Mesh.h,v 1.7 2001/03/21 06:34:17 vchma Exp $ //-------------------------------------------------------------------------- #ifndef __MESH_H__ #define __MESH_H__ class Vertex; class HalfEdge; class DualEdge; class Face; class Vector2; class Op; #include "Common.h" #include "utility.hpp" #include "Array.h" // for the arrays in the Mesh #include "Vector.h" // for using ZeroVector #include "Point.h" class MeshDraw; class Mesh : public Common, boost::noncopyable { public: Mesh(); virtual ~Mesh(); friend class MeshDraw; // Add a new vertex/normal/UV, returns -1 if fail, otherwise returns index int addVertex( double x, double y, double z ); int addNormal( double x, double y, double z ); int addUV( double x, double y ); // Add a new face, given a list of vertex indices, plus // optional normal and UVs // the arrays must be of the same length, i.e. numVertices. // o/w, undefined behaviour results. // // returns 0 if fail, otherwise non-zero for success int addFace( int numVertices, const unsigned int *vertexIndices, const unsigned int *normalIndices = 0, const unsigned int *UVIndices = 0 ); // Return the number of registered Vertices, Faces and Edges int numPoints() const { return myPoints.size(); } int numNormals() const { return myNormals.size(); } int numUVs() const { return myUVs.size(); } int numVertices() const { return myVertices.size(); } int numFaces() const { return myFaces.size(); } int numEdges() const { return myEdges.size(); } int numDEdges() const { return myDEdges.size(); } const Face &getFace( int i ) const { return *(myFaces[i]); } const HalfEdge &getEdge( int i ) const { return *(myEdges[i]); } const Vertex &getVertex( int i ) const { return *(myVertices[i]); } const Point &getPoint( int i ) const { return *(myPoints[i]); } const Vector &getNormal( int i ) const { return *(myNormals[i]); } const Vector2 &getUV( int i ) const { return *(myUVs[i]); } Face &getFace( int i ) { return *(myFaces[i]); } HalfEdge &getEdge( int i ) { return *(myEdges[i]); } Vertex &getVertex( int i ) { return *(myVertices[i]); } Point &getPoint( int i ) { return *(myPoints[i]); } Vector &getNormal( int i ) { return *(myNormals[i]); } Vector2 &getUV( int i ) { return *(myUVs[i]); } // See if mesh is valid i.e. all edges are paired, etc bool isValid() const; // Read in a file bool readFile( char *filename ); // Debug output void debugOutput( std::ostream &os ); // Accept a visiting Op, ask it to operate on myself virtual bool acceptOp( Op &op ); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // ?! void getLookAt( double *lookAt, double &maxDim ); Point &getCentroid() { return myCenter; } Point &getDMin() { return myDMin; } Point &getDMax() { return myDMax; } double getMaxDimension() const; double getBoundingSphereRadius() const { return (myMax-myCenter).normalize(); } // TEMP DualEdge **getDualEdges() { return myDEdges.dupeGut(); } const Array<Face *> &getFaceArray() const { return myFaces; } void calcDualEdges(); private: // Release all resources that are taken up by vertices/edges/faces void cleanup(); // the EdgeEndPointLookUp is used to store the edges by their endpoint // indices. Then, as edges are added, one can look for it's sym by // querying with the endpoints. void attemptMatchEdge( HalfEdge *e, int origin, int dest ); Array<Point *> myPoints; Array<Vertex *> myVertices; Array<Face *> myFaces; Array<HalfEdge *> myEdges; Array<HalfEdge *> myOneOutOfTwo; Array<DualEdge *> myDEdges; Array<Vector *> myNormals; Array<Vector2 *> myUVs; Tcl_HashTable myEdgeEndPointLookUp; Point myMax; Point myMin; Point myCenter; Point myDMax; Point myDMin; Point myDCenter; }; #endif // __MESH_H__
#include <ngadmin.h> #include <nsdp/attr.h> #include <nsdp/protocol.h> #include "lib.h" #include "network.h" int ngadmin_getStormFilterState (struct ngadmin *nga, int *s) { List *attr; struct attr *at; int ret = ERR_OK; if (nga == NULL || s == NULL) return ERR_INVARG; else if (nga->current == NULL) return ERR_NOTLOG; attr = createEmptyList(); pushBackList(attr, newEmptyAttr(ATTR_STORM_ENABLE)); ret = readRequest(nga, attr); if (ret != ERR_OK) goto end; filterAttributes(attr, ATTR_STORM_ENABLE, ATTR_END); *s = 0; if (attr->first == NULL) { ret = ERR_BADREPLY; goto end; } at = attr->first->data; if (at->size != 1) { ret = ERR_BADREPLY; goto end; } *s = *(char*)at->data; end: destroyList(attr, (void(*)(void*))freeAttr); return ret; } int ngadmin_setStormFilterState (struct ngadmin *nga, int s) { List *attr; attr = createEmptyList(); pushBackList(attr, newByteAttr(ATTR_STORM_ENABLE, s != 0)); return writeRequest(nga, attr); } int ngadmin_getStormFilterValues (struct ngadmin *nga, int *ports) { List *attr; ListNode *ln; struct attr *at; int ret = ERR_OK, port; struct attr_bitrate *sb; struct swi_attr *sa; if (nga == NULL || ports == NULL) return ERR_INVARG; sa = nga->current; if (sa == NULL) return ERR_NOTLOG; attr = createEmptyList(); pushBackList(attr, newEmptyAttr(ATTR_STORM_BITRATE)); ret = readRequest(nga, attr); if (ret != ERR_OK) goto end; filterAttributes(attr, ATTR_STORM_BITRATE, ATTR_END); for (port = 0; port < sa->ports; port++) ports[port] = BITRATE_UNSPEC; for (ln = attr->first; ln != NULL; ln = ln->next) { at = ln->data; sb = at->data; if (at->size == 0) { ret = ERR_BADREPLY; goto end; } if (sb->port <= sa->ports) ports[sb->port - 1] = sb->bitrate; } end: destroyList(attr, (void(*)(void*))freeAttr); return ret; } int ngadmin_setStormFilterValues (struct ngadmin *nga, const int *ports) { List *attr; int port; struct attr_bitrate *sb; if (nga == NULL || ports == NULL) return ERR_INVARG; else if (nga->current == NULL) return ERR_NOTLOG; attr = createEmptyList(); for (port = 0; port < nga->current->ports; port++) { if (ports[port] != BITRATE_UNSPEC) { sb = malloc(sizeof(struct attr_bitrate)); if (sb == NULL) return ERR_MEM; sb->port = port + 1; sb->bitrate = ports[port]; pushBackList(attr, newAttr(ATTR_STORM_BITRATE, sizeof(struct attr_bitrate), sb)); } } return writeRequest(nga, attr); } int ngadmin_getBitrateLimits (struct ngadmin *nga, int *ports) { List *attr; ListNode *ln; struct attr *at; int ret = ERR_OK, port; struct attr_bitrate *pb; struct swi_attr *sa; if (nga == NULL || ports == NULL) return ERR_INVARG; sa = nga->current; if (sa == NULL) return ERR_NOTLOG; attr = createEmptyList(); pushBackList(attr, newEmptyAttr(ATTR_BITRATE_INPUT)); pushBackList(attr, newEmptyAttr(ATTR_BITRATE_OUTPUT)); ret = readRequest(nga, attr); if (ret != ERR_OK) goto end; filterAttributes(attr, ATTR_BITRATE_INPUT, ATTR_BITRATE_OUTPUT, ATTR_END); for (port = 0; port < sa->ports; port++) { ports[2 * port + 0] = BITRATE_UNSPEC; ports[2 * port + 1] = BITRATE_UNSPEC; } for (ln = attr->first; ln != NULL; ln = ln->next) { at = ln->data; pb = at->data; if (at->size == 0) { ret = ERR_BADREPLY; goto end; } if (pb->port > sa->ports) continue; else if (at->attr == ATTR_BITRATE_INPUT) ports[(pb->port - 1) * 2 + 0] = pb->bitrate; else ports[(pb->port - 1) * 2 + 1] = pb->bitrate; } end: destroyList(attr, (void(*)(void*))freeAttr); return ret; } int ngadmin_setBitrateLimits (struct ngadmin *nga, const int *ports) { List *attr; int port; struct attr_bitrate *pb; if (nga == NULL || ports == NULL) return ERR_INVARG; else if (nga->current == NULL) return ERR_NOTLOG; attr = createEmptyList(); for (port = 0; port < nga->current->ports; port++) { if (ports[2 * port + 0] >= BITRATE_NOLIMIT && ports[2 * port + 0] <= BITRATE_512M) { pb = malloc(sizeof(struct attr_bitrate)); if (pb == NULL) return ERR_MEM; pb->port = port + 1; pb->bitrate = ports[2 * port + 0]; pushBackList(attr, newAttr(ATTR_BITRATE_INPUT, sizeof(struct attr_bitrate), pb)); } if (ports[2 * port + 1] >= BITRATE_NOLIMIT && ports[2 * port + 1] <= BITRATE_512M) { pb = malloc(sizeof(struct attr_bitrate)); if (pb == NULL) return ERR_MEM; pb->port = port + 1; pb->bitrate = ports[2 * port + 1]; pushBackList(attr, newAttr(ATTR_BITRATE_OUTPUT, sizeof(struct attr_bitrate), pb)); } } return writeRequest(nga, attr); }
/*========================================================================= Program: Visualization Toolkit Module: $RCSfile: vtkXMLPUnstructuredGridReader.h,v $ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkXMLPUnstructuredGridReader - Read PVTK XML UnstructuredGrid files. // .SECTION Description // vtkXMLPUnstructuredGridReader reads the PVTK XML UnstructuredGrid // file format. This reads the parallel format's summary file and // then uses vtkXMLUnstructuredGridReader to read data from the // individual UnstructuredGrid piece files. Streaming is supported. // The standard extension for this reader's file format is "pvtu". // .SECTION See Also // vtkXMLUnstructuredGridReader #ifndef __vtkXMLPUnstructuredGridReader_h #define __vtkXMLPUnstructuredGridReader_h #include "vtkXMLPUnstructuredDataReader.h" class vtkUnstructuredGrid; class VTK_IO_EXPORT vtkXMLPUnstructuredGridReader : public vtkXMLPUnstructuredDataReader { public: vtkTypeRevisionMacro(vtkXMLPUnstructuredGridReader,vtkXMLPUnstructuredDataReader); void PrintSelf(ostream& os, vtkIndent indent); static vtkXMLPUnstructuredGridReader *New(); // Description: // Get/Set the reader's output. void SetOutput(vtkUnstructuredGrid *output); vtkUnstructuredGrid *GetOutput(); vtkUnstructuredGrid *GetOutput(int idx); protected: vtkXMLPUnstructuredGridReader(); ~vtkXMLPUnstructuredGridReader(); const char* GetDataSetName(); void GetOutputUpdateExtent(int& piece, int& numberOfPieces, int& ghostLevel); void SetupOutputTotals(); void SetupOutputData(); void SetupNextPiece(); int ReadPieceData(); void CopyArrayForCells(vtkDataArray* inArray, vtkDataArray* outArray); vtkXMLDataReader* CreatePieceReader(); virtual int FillOutputPortInformation(int, vtkInformation*); // The index of the cell in the output where the current piece // begins. vtkIdType StartCell; private: vtkXMLPUnstructuredGridReader(const vtkXMLPUnstructuredGridReader&); // Not implemented. void operator=(const vtkXMLPUnstructuredGridReader&); // Not implemented. }; #endif
#import "VictoryCondition.h" @interface CasualtiesCondition : VictoryCondition @property (nonatomic, assign) float percentage; - (instancetype) initWithPercentage:(int)percentage; @end
/***************************************************************** * $Id: db_actionsystempermission.h 2248 2015-06-21 09:13:00Z rutger $ * Created: Dec 2, 2013 10:14:42 PM - rutger * * Copyright (C) 2013 Red-Bag. All rights reserved. * This file is part of the Biluna DB project. * * See http://www.red-bag.com for further details. *****************************************************************/ #ifndef DB_ACTIONSYSTEMPERMISSION_H #define DB_ACTIONSYSTEMPERMISSION_H #include "rb_action.h" /** * Action for editing permission dialog */ class DB_EXPORT DB_ActionSystemPermission : public RB_Action { Q_OBJECT public: DB_ActionSystemPermission(); virtual ~DB_ActionSystemPermission() {} static RB_String getName() { return "User permissions"; } virtual RB_String name() { return DB_ActionSystemPermission::getName(); } static RB_GuiAction* createGuiAction(); static RB_Action* factory(); virtual void trigger(); }; #endif // DB_ACTIONSYSTEMPERMISSION_H
/* *_________________________________________________________________________* * POEMS: PARALLELIZABLE OPEN SOURCE EFFICIENT MULTIBODY SOFTWARE * * DESCRIPTION: SEE READ-ME * * FILE NAME: fixedpoint.h * * AUTHORS: See Author List * * GRANTS: See Grants List * * COPYRIGHT: (C) 2005 by Authors as listed in Author's List * * LICENSE: Please see License Agreement * * DOWNLOAD: Free at www.rpi.edu/~anderk5 * * ADMINISTRATOR: Prof. Kurt Anderson * * Computational Dynamics Lab * * Rensselaer Polytechnic Institute * * 110 8th St. Troy NY 12180 * * CONTACT: anderk5@rpi.edu * *_________________________________________________________________________*/ #ifndef FIXEDPOINT_H #define FIXEDPOINT_H #include "point.h" #include "vect3.h" class FixedPoint : public Point { public: FixedPoint(); ~FixedPoint(); FixedPoint(double x, double y, double z); FixedPoint(Vect3& v); PointType GetType(); Vect3 GetPoint(); bool ReadInPointData(std::istream& in); void WriteOutPointData(std::ostream& out); }; #endif
/** @file * NetLabel userspace/kernel interface API. * * The NetLabel system manages static and dynamic security label mappings for * network protocols such as CIPSO and RIPSO. * * Author: Paul Moore <paul@paul-moore.com> * */ /* * (c) Copyright Hewlett-Packard Development Company, L.P., 2006 * * This program is free software: you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * 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 _NETLABEL_H #define _NETLABEL_H /* NetLabel NETLINK protocol version * 1: initial version * 2: added static labels for unlabeled connections * 3: network selectors added to the NetLabel/LSM domain mapping */ #define NETLBL_PROTO_VERSION 3 /* NetLabel NETLINK types/families */ #define NETLBL_NLTYPE_NONE 0 #define NETLBL_NLTYPE_MGMT 1 #define NETLBL_NLTYPE_MGMT_NAME "NLBL_MGMT" #define NETLBL_NLTYPE_RIPSO 2 #define NETLBL_NLTYPE_RIPSO_NAME "NLBL_RIPSO" #define NETLBL_NLTYPE_CIPSOV4 3 #define NETLBL_NLTYPE_CIPSOV4_NAME "NLBL_CIPSOv4" #define NETLBL_NLTYPE_CIPSOV6 4 #define NETLBL_NLTYPE_CIPSOV6_NAME "NLBL_CIPSOv6" #define NETLBL_NLTYPE_UNLABELED 5 #define NETLBL_NLTYPE_UNLABELED_NAME "NLBL_UNLBL" #define NETLBL_NLTYPE_ADDRSELECT 6 #define NETLBL_NLTYPE_ADDRSELECT_NAME "NLBL_ADRSEL" #define NETLBL_NLTYPE_CALIPSO 7 #define NETLBL_NLTYPE_CALIPSO_NAME "NLBL_CALIPSO" /* * MGMT */ /** * NetLabel Management commands */ enum { NLBL_MGMT_C_UNSPEC, NLBL_MGMT_C_ADD, NLBL_MGMT_C_REMOVE, NLBL_MGMT_C_LISTALL, NLBL_MGMT_C_ADDDEF, NLBL_MGMT_C_REMOVEDEF, NLBL_MGMT_C_LISTDEF, NLBL_MGMT_C_PROTOCOLS, NLBL_MGMT_C_VERSION, __NLBL_MGMT_C_MAX, }; #define NLBL_MGMT_C_MAX (__NLBL_MGMT_C_MAX - 1) /** * NetLabel Management attributes */ enum { NLBL_MGMT_A_UNSPEC, NLBL_MGMT_A_DOMAIN, NLBL_MGMT_A_PROTOCOL, NLBL_MGMT_A_VERSION, NLBL_MGMT_A_CV4DOI, NLBL_MGMT_A_IPV6ADDR, NLBL_MGMT_A_IPV6MASK, NLBL_MGMT_A_IPV4ADDR, NLBL_MGMT_A_IPV4MASK, NLBL_MGMT_A_ADDRSELECTOR, NLBL_MGMT_A_SELECTORLIST, NLBL_MGMT_A_FAMILY, NLBL_MGMT_A_CLPDOI, __NLBL_MGMT_A_MAX, }; #define NLBL_MGMT_A_MAX (__NLBL_MGMT_A_MAX - 1) /* * CIPSO V4 */ /* CIPSOv4 DOI map types */ #define CIPSO_V4_MAP_UNKNOWN 0 #define CIPSO_V4_MAP_TRANS 1 #define CIPSO_V4_MAP_PASS 2 #define CIPSO_V4_MAP_LOCAL 3 /** * NetLabel CIPSOv4 commands */ enum { NLBL_CIPSOV4_C_UNSPEC, NLBL_CIPSOV4_C_ADD, NLBL_CIPSOV4_C_REMOVE, NLBL_CIPSOV4_C_LIST, NLBL_CIPSOV4_C_LISTALL, __NLBL_CIPSOV4_C_MAX, }; #define NLBL_CIPSOV4_C_MAX (__NLBL_CIPSOV4_C_MAX - 1) /** * NetLabel CIPSOv4 attributes */ enum { NLBL_CIPSOV4_A_UNSPEC, NLBL_CIPSOV4_A_DOI, NLBL_CIPSOV4_A_MTYPE, NLBL_CIPSOV4_A_TAG, NLBL_CIPSOV4_A_TAGLST, NLBL_CIPSOV4_A_MLSLVLLOC, NLBL_CIPSOV4_A_MLSLVLREM, NLBL_CIPSOV4_A_MLSLVL, NLBL_CIPSOV4_A_MLSLVLLST, NLBL_CIPSOV4_A_MLSCATLOC, NLBL_CIPSOV4_A_MLSCATREM, NLBL_CIPSOV4_A_MLSCAT, NLBL_CIPSOV4_A_MLSCATLST, __NLBL_CIPSOV4_A_MAX, }; #define NLBL_CIPSOV4_A_MAX (__NLBL_CIPSOV4_A_MAX - 1) /* * CALIPSO */ /* CALIPSO DOI map types */ #define CALIPSO_MAP_UNKNOWN 0 #define CALIPSO_MAP_PASS 2 /** * NetLabel CALIPSO commands */ enum { NLBL_CALIPSO_C_UNSPEC, NLBL_CALIPSO_C_ADD, NLBL_CALIPSO_C_REMOVE, NLBL_CALIPSO_C_LIST, NLBL_CALIPSO_C_LISTALL, __NLBL_CALIPSO_C_MAX, }; #define NLBL_CALIPSO_C_MAX (__NLBL_CALIPSO_C_MAX - 1) /** * NetLabel CALIPSO attributes */ enum { NLBL_CALIPSO_A_UNSPEC, NLBL_CALIPSO_A_DOI, NLBL_CALIPSO_A_MTYPE, __NLBL_CALIPSO_A_MAX, }; #define NLBL_CALIPSO_A_MAX (__NLBL_CALIPSO_A_MAX - 1) /* * UNLABELED */ /** * NetLabel Unlabeled commands */ enum { NLBL_UNLABEL_C_UNSPEC, NLBL_UNLABEL_C_ACCEPT, NLBL_UNLABEL_C_LIST, NLBL_UNLABEL_C_STATICADD, NLBL_UNLABEL_C_STATICREMOVE, NLBL_UNLABEL_C_STATICLIST, NLBL_UNLABEL_C_STATICADDDEF, NLBL_UNLABEL_C_STATICREMOVEDEF, NLBL_UNLABEL_C_STATICLISTDEF, __NLBL_UNLABEL_C_MAX, }; #define NLBL_UNLABEL_C_MAX (__NLBL_UNLABEL_C_MAX - 1) /** * NetLabel Unlabeled attributes */ enum { NLBL_UNLABEL_A_UNSPEC, NLBL_UNLABEL_A_ACPTFLG, NLBL_UNLABEL_A_IPV6ADDR, NLBL_UNLABEL_A_IPV6MASK, NLBL_UNLABEL_A_IPV4ADDR, NLBL_UNLABEL_A_IPV4MASK, NLBL_UNLABEL_A_IFACE, NLBL_UNLABEL_A_SECCTX, __NLBL_UNLABEL_A_MAX, }; #define NLBL_UNLABEL_A_MAX (__NLBL_UNLABEL_A_MAX - 1) #endif /* _NETLABEL_H */
// L3D realtime 3D library, explained in book "Linux 3D Graphics Programming" // Copyright (C) 2000 Norman Lin // Contact: nlin@linux3dgraphicsprogramming.org (alt. nlin@geocities.com) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "../lib/geom/object/object3d.h" #include "../lib/geom/polygon/p3_ltex.h" #include "../lib/geom/texture/texture.h" #include "../lib/geom/texture/texload.h" class pyramid:public l3d_object { public: pyramid(l3d_texture_loader *l, l3d_surface_cache *scache); virtual ~pyramid(void); };
/** * Copyright (c) 2012, WebItUp <contact@webitup.fr> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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. */ #ifndef COCOAINIT_H #define COCOAINIT_H class CocoaInitializer { public: CocoaInitializer(); ~CocoaInitializer(); private: class Private; Private* d; }; #endif // COCOAINIT_H
/* Space Whales Team: Packet Class for Weather Balloon Ground Station Last Updated March 11, 2013 Released under GNU GPL - version 2 or later By The Space Whales */ #ifndef __PACKET_H__ #define __PACKET_H__ #include <cstdlib> #include <iostream> #include <fstream> #include <string> #include "base.h" using namespace std; ////////////////////////////////////////////////////////////////////////////// /// Class Function Declarations ////////////////////////////////////////////////////////////////////////////// class Packet{ // OVERVIEW: Class that handles the data transmitted in the weather // balloon packet string echo; // balloon echo tm fltme; // flight time (as determined by balloon) double pres; // pressure double humd; // humidity double accel[3]; // acceleration data double temp[2]; // temperature data double lat; // latitude double lng; // longitude double alt; // altitude bool sens; // flag to indicate good sensor data bool gps; // flag to indicate good gps data double extractSens(string &raw); // MODIFIES: raw, cout // EFFECTS: Removes any data up to and including SENSDLIM from raw, // returns it as a double if possible, throws string // "Invalid" if not void parseSens(string &raw); // MODIFIES: this, raw, cout // EFFECTS: Extracts sensor data at the beginning of raw and places it // into this, prints success to the terminal and throws // an error string for failure void parseGPS(const string &raw); // MODIFIES: this, cout // EFFECTS: Parses NMEA strings in data and places them into this, // prints success to the terminal and throws an error // string for failure double convrtGPS(const string &raw); // REQUIRES: raw is valid NMEA GPGGA latitude or longitude string // EFFECTS: Returns the string converted to decimal degrees void writeHeader(ofstream &maphtml, const int mapdlay); // REQUIRES: maphtml points to an open ofstream // MODIFIES: maphtml // EFFECTS: Prints the HTML header to the file for GPS mapping with refresh // delay <mapdlay>, prints success to the terminal and throws // an error string for failure void writePts(ofstream &maphtml, const string &dfilenm); // REQUIRES: maphtml points to an open ofstream, dfilenm is the name of // valid datafile // MODIFIES: maphtml, cout // EFFECTS: Write the the lat and lon points in the file <dfilenm> to the // HTML of maphtml void writeEnd(ofstream &maphtml); // REQUIRES: maphtml points to an open ofstream // MODIFIES: maphtml // EFFECTS: Prints the HTML end to the file for the GPS mapping public: void parseData(const unsigned char *buff, const int buff_size); // REQUIRES: buff is NULL terminated // MODIFIES: this, cout // EFFECTS: Takes data and places it into this, prints progess and any // errors to cout void writeData(Param &inst); // MODIFIES: inst.datfile, cout, GPSmap.html // EFFECTS: Tries to write pket data to <inst.dfilenm> with a timestamp, // if successful writes the data in <dfilenm> to a map in // GPSmap.html with a delay of <mapdlay>, prints success to // the terminal and throws an error string for failure void writeHTML(const string &dfilenm, const int mapdlay); // MODIFIES: cout // EFFECTS: Writes the data in <dfilenm> to a map in GPSmap.html with a // delay of <mapdlay>, prints success to the terminal and // throws an error string for failure or no data }; #endif // __PACKET_H__
/* * Komposter * * Copyright (c) 2010 Noora Halme et al. (see AUTHORS) * * This code is licensed under the GNU General Public * License version 2. See LICENSE for full text. * * Handling the configuration file ~/.komposter * */ #ifndef __DOTFILE_H__ #define __DOTFILE_H__ int dotfile_load(); int dotfile_save(); char *dotfile_getvalue(char *key); int dotfile_setvalue(char *key, char *value); #endif
// // ViewController.h // 检测网络的连接状态 // // Created by GnuHua on 14-7-31. // Copyright (c) 2014年 jiaxh. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#ifndef __PLATEAU_H__ #define __PLATEAU_H__ #include "carte.h" #include "joueur.h" #include <cstdlib>//pour melangerJeu #include <time.h> #include <fstream>//pour enterScore et clog //#include <regex>pour la partie mise en commentaire de enterScore #define SHRT_MAX 32767 using namespace std; class Plateau{ private: Carte* jeu; Carte* plateau; int* mises; Carte defausse; public: size_t nbJoueurs; Joueur *tabJoueurs; Plateau(); ~Plateau(); void afficherPlateau() const; void afficherJeu() const; void melangerJeu(); void initJoueurs(); Joueur* enleverJoueur(string); void changerPlaceJoueurs(); void premDonneur(); void miseInit(); void distribuer(); size_t longMain(int) const; void viderMains(); void initDefausse(); void afficheDefausse() const; void setDefausse(Carte); int valDefausse() const; Carte getDefausse() const; void scoreGagnant(Joueur &j); void payerGagnant(Joueur &win); void retirerMise(int indJ); bool autorisationJouer(int nb) const; void enterScores(); }; void HELP(); #endif
/******************************************************************************* * * * WashingtonDC Dreamcast Emulator * Copyright (C) 2019 snickerbockers * * 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 SOUND_H_ #define SOUND_H_ #include "washdc/sound_intf.h" void dc_sound_init(struct washdc_sound_intf const *intf); void dc_sound_cleanup(void); void dc_submit_sound_samples(washdc_sample_type *samples, unsigned count); #endif
// // Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "DebugUIPage.h" #ifdef DEBUG NS_ASSUME_NONNULL_BEGIN @interface DebugUIMisc : DebugUIPage @end NS_ASSUME_NONNULL_END #endif
#ifndef _DBP_UTILS #define _DBP_UTILS #include <stdio.h> #ifndef DBP_TYPES /* to make sure that we typedef these just once */ #define DBP_TYPES typedef char *vector; typedef char **matrix; typedef unsigned long int *ivector; /* to save integer vectors */ typedef unsigned long int **imatrix; /* " matrices */ #endif #define MAX_LINELENGTH 4096 /* Longest line in sparse input matrix */ /* Some new types here... */ struct selestr { unsigned int c; struct selestr *n; }; typedef struct selestr selement; typedef selement **smatrix; matrix read_matrix(const char *file, int *s, int *d); matrix read_sparse_matrix(const char *file, int *s, int *d); int print_matrix(const char *file, matrix S, int s, int d); int print_sparse_matrix(const char *file, matrix S, int s, int d); void free_matrix(matrix M, int n); /* Initials a seed for random number generator and return NULL if 'seed' != 0. * Otherwise returns a pointer to random number character device to be used * with 'give_rand()'. */ FILE * init_seed(unsigned int seed); /* Returns a random number as an unsigned integer. If 'randdev' is is NULL, * uses standard library 'rand()', otherwise uses given character device. */ unsigned int give_rand(FILE *randdev); #endif
/** * gcode_begin.h * Source code file for G-Code generation, simulation, and visualization * library. * * Copyright (C) 2006 - 2010 by Justin Shumaker * Copyright (C) 2014 - 2020 by Asztalos Attila Oszkár * * 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 _GCODE_BEGIN_H #define _GCODE_BEGIN_H #include "gcode_util.h" #include "gcode_internal.h" #define GCODE_BIN_DATA_BEGIN_COORDINATE_SYSTEM 0x00 #define GCODE_BEGIN_COORDINATE_SYSTEM_NONE 0x0 #define GCODE_BEGIN_COORDINATE_SYSTEM_WORKSPACE1 0x1 #define GCODE_BEGIN_COORDINATE_SYSTEM_WORKSPACE2 0x2 #define GCODE_BEGIN_COORDINATE_SYSTEM_WORKSPACE3 0x3 #define GCODE_BEGIN_COORDINATE_SYSTEM_WORKSPACE4 0x4 #define GCODE_BEGIN_COORDINATE_SYSTEM_WORKSPACE5 0x5 #define GCODE_BEGIN_COORDINATE_SYSTEM_WORKSPACE6 0x6 static const char *GCODE_XML_ATTR_BEGIN_COORDINATE_SYSTEM = "coordinate-system"; typedef struct gcode_begin_s { uint8_t coordinate_system; } gcode_begin_t; void gcode_begin_init (gcode_block_t **block, gcode_t *gcode, gcode_block_t *parent); void gcode_begin_free (gcode_block_t **block); void gcode_begin_save (gcode_block_t *block, FILE *fh); void gcode_begin_load (gcode_block_t *block, FILE *fh); void gcode_begin_make (gcode_block_t *block); void gcode_begin_parse (gcode_block_t *block, const char **xmlattr); #endif
/* Copyright 2005-2009 Last.fm Ltd. - Primarily authored by Max Howell, Jono Cole and Doug Mansell This file is part of the Last.fm Desktop Application Suite. lastfm-desktop 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. lastfm-desktop 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 lastfm-desktop. If not, see <http://www.gnu.org/licenses/>. */ #ifndef FRIENDS_PICKER_H #define FRIENDS_PICKER_H #include <QDialog> #include <lastfm/User> #include "lib/DllExportMacro.h" class UNICORN_DLLEXPORT FriendsPicker : public QDialog { Q_OBJECT struct { class QDialogButtonBox* buttons; class QListWidget* list; } ui; public: FriendsPicker( const User& = AuthenticatedUser() ); QList<User> selection() const; private slots: void onGetFriendsReturn(); }; #endif
// ***************************************************************************************************************************************** // **** PLEASE NOTE: This is a READ-ONLY representation of the actual script. For editing please press the "Develop Script" button. **** // ***************************************************************************************************************************************** Action() { lr_start_transaction("0010_OpenHomePage"); truclient_step("1", "Navigate to 'http://maps.environment...ics&lang=_e'", "snapshot=Action_1.inf"); lr_end_transaction("0010_OpenHomePage",0); truclient_step("2", "Wait 3 seconds", "snapshot=Action_2.inf"); lr_start_transaction("0020_OpenFloodMapsPage"); truclient_step("3", "Click on Flood Map for Planning... link", "snapshot=Action_3.inf"); lr_end_transaction("0020_OpenFloodMapsPage",0); truclient_step("5", "Wait 3 seconds", "snapshot=Action_5.inf"); truclient_step("6", "Click on Enter a postcode or place... textbox", "snapshot=Action_6.inf"); truclient_step("7", "Type LR.getParam('pPostCode') in Enter a postcode or place... textbox", "snapshot=Action_7.inf"); lr_start_transaction("0030_OpenLocalFloodMap"); truclient_step("8", "Press Enter key on Enter a postcode or place... textbox", "snapshot=Action_8.inf"); lr_end_transaction("0030_OpenLocalFloodMap",0); truclient_step("9", "Wait 3 seconds", "snapshot=Action_9.inf"); return 0; }
/* * * Copyright 2014-2016 Ignacio San Roman Lana * * This file is part of OpenCV_ML_Tool * * OpenCV_ML_Tool 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. * * OpenCV_ML_Tool 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 OpenCV_ML_Tool. If not, see http://www.gnu.org/licenses/. * * For those usages not covered by this license please contact with * isanromanlana@gmail.com */ #ifndef CONF_KNN_H #define CONF_KNN_H #include <QMainWindow> #include <opencv2/opencv.hpp> #include "mainwindow.h" namespace Ui { class Conf_KNN; } class Conf_KNN : public QMainWindow { Q_OBJECT public: explicit Conf_KNN(void *puntero, QWidget *parent = 0); ~Conf_KNN(); private slots: void on_Aceptar_clicked(); private: Ui::Conf_KNN *ui; void *punt; }; #endif // CONF_KNN_H
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef TESTVIEW_H #define TESTVIEW_H #include <qmlmodelview.h> #include <QVariant> #include <QStringList> #include <model.h> class TestView : public QmlDesigner::QmlModelView { Q_OBJECT public: struct MethodCall { MethodCall(const QString &n, const QStringList &args) : name(n), arguments(args) { } QString name; QStringList arguments; }; TestView(QmlDesigner::Model *model); void modelAttached(QmlDesigner::Model *model); void modelAboutToBeDetached(QmlDesigner::Model *model); void nodeCreated(const QmlDesigner::ModelNode &createdNode); void nodeAboutToBeRemoved(const QmlDesigner::ModelNode &removedNode); void nodeRemoved(const QmlDesigner::ModelNode &removedNode, const QmlDesigner::NodeAbstractProperty &parentProperty, AbstractView::PropertyChangeFlags propertyChange); void nodeReparented(const QmlDesigner::ModelNode &node, const QmlDesigner::NodeAbstractProperty &newPropertyParent, const QmlDesigner::NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange); void nodeIdChanged(const QmlDesigner::ModelNode& node, const QString& newId, const QString& oldId); void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion); void bindingPropertiesChanged(const QList<QmlDesigner::BindingProperty>& propertyList, PropertyChangeFlags propertyChange); void variantPropertiesChanged(const QList<QmlDesigner::VariantProperty>& propertyList, PropertyChangeFlags propertyChange); void propertiesAboutToBeRemoved(const QList<QmlDesigner::AbstractProperty> &propertyList); void fileUrlChanged(const QUrl &oldBaseUrl, const QUrl &newBaseUrl); void selectedNodesChanged(const QList<QmlDesigner::ModelNode> &selectedNodeList, const QList<QmlDesigner::ModelNode> &lastSelectedNodeList); void nodeOrderChanged(const QmlDesigner::NodeListProperty &listProperty, const QmlDesigner::ModelNode &movedNode, int oldIndex); void actualStateChanged(const QmlDesigner::ModelNode &node); QList<MethodCall> &methodCalls(); QString lastFunction() const; QmlDesigner::NodeInstanceView *nodeInstanceView() const; QmlDesigner::NodeInstance instanceForModelNode(const QmlDesigner::ModelNode &modelNode); private: QList<MethodCall> m_methodCalls; static QString serialize(AbstractView::PropertyChangeFlags change); }; bool operator==(TestView::MethodCall call1, TestView::MethodCall call2); QDebug operator<<(QDebug debug, TestView::MethodCall call); #endif // TESTVIEW_H
//*************************************************************************** // // PQueue.h -- Prototype for priority queues // //---------------------------------------------------------------------------// // Copyright (C) Microsoft Corporation. All rights reserved. // //===========================================================================// #ifndef PQUEUE_H #define PQUEUE_H //*************************************************************************** //-------------- // Include Files //-------------------------------- // Structure and Class Definitions typedef struct _PQNode { int32_t key; // sort value uint32_t id; // hash value for this map position int32_t row; // HB-specific int32_t col; // HB-specific } PQNode; class PriorityQueue { protected: PQNode* pqList; int32_t maxItems; int32_t numItems; int32_t keyMin; void downHeap (int curIndex); void upHeap (int curIndex); public: void init (void) { pqList = NULL; numItems = 0; } PriorityQueue (void) { init(); } int init (int maxItems, int keyMinValue = -2000000); int insert (PQNode& item); void remove (PQNode& item); void change (int itemIndex, int newValue); int find (unsigned int id); int findByKey (int32_t key, uint32_t id, int startIndex = 1); void clear (void) { numItems = 0; } int getNumItems (void) { return(numItems); } bool isEmpty (void) { return(numItems == 0); } PQNode* getItem (int itemIndex) { return(&pqList[itemIndex]); } void destroy (void); ~PriorityQueue (void) { destroy(); } }; typedef PriorityQueue* PriorityQueuePtr; //*************************************************************************** #endif
// // vidBusinessCard.h // vidcon // // Created by Tyler Dodge on 6/13/12. // // #import <Foundation/Foundation.h> #import "vidSpeakerModel.h" #define TWITTER_KEY @"twitter" #define YOUTUBE_KEY @"youtube" #define FACEBOOK_KEY @"facebook" #define NAME_KEY @"name" #define TWITTER_ENABLED_KEY @"twitterEnabled" #define YOUTUBE_ENABLED_KEY @"youtubeEnabled" #define FACEBOOK_ENABLED_KEY @"facebookEnabled" @interface vidBusinessCard : NSObject @property (strong, nonatomic) NSString * twitter; @property (strong, nonatomic) NSString * youtube; @property (strong, nonatomic) NSString * facebook; @property (strong, nonatomic) NSString * name; @property (nonatomic) BOOL isTwitterEnabled; @property (nonatomic) BOOL isYoutubeEnabled; @property (nonatomic) BOOL isFacebookEnabled; -(NSDictionary *)toDictionary; -(vidSpeaker *)toVidSpeaker; -(NSDictionary *)toSendableDictionary; -(vidBusinessCard *)initWithJsonDictionary:(NSDictionary *)json; @end
//################################################################################################## // // Custom Visualization Core library // Copyright (C) Ceetron Solutions AS // // This library may be used under the terms of either the GNU General Public License or // the GNU Lesser General Public License as follows: // // 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. // // 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 at <<http://www.gnu.org/licenses/gpl.html>> // for more details. // // GNU Lesser General Public License Usage // 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 2.1 of the License, or // (at your option) any later version. // // This library is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU Lesser General Public License at <<http://www.gnu.org/licenses/lgpl-2.1.html>> // for more details. // //################################################################################################## #pragma once #include <vector> class QVariant; class QMenu; class QString; class QWidget; namespace caf { class PdmFieldHandle; class PdmUiFieldHandle; class PdmUiCommandSystemInterface; class PdmUiCommandSystemProxy { public: PdmUiCommandSystemProxy(); static PdmUiCommandSystemProxy* instance(); void setCommandInterface( PdmUiCommandSystemInterface* undoCommandInterface ); void setUiValueToField( PdmUiFieldHandle* uiFieldHandle, const QVariant& newUiValue ); void setCurrentContextMenuTargetWidget( QWidget* targetWidget ); void populateMenuWithDefaultCommands( const QString& uiConfigName, QMenu* menu ); private: static std::vector<PdmFieldHandle*> fieldsFromSelection( PdmFieldHandle* editorField ); private: PdmUiCommandSystemInterface* m_commandInterface; }; } // End of namespace caf
/* * Renamah * Copyright (C) 2009 Guillaume Denry <guillaume.denry@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * 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 SIMPLE_DIR_MODEL_H #define SIMPLE_DIR_MODEL_H #include <QDirModel> class SimpleDirModel : public QDirModel { Q_OBJECT public: int columnCount(const QModelIndex & parent = QModelIndex()) const; }; #endif
/* * ===================================================================================== * * Filename: translationCommandIterationUpdate.h * * Description: * * Version: 1.0 * Created: 26/11/14 16:01:12 * Revision: none * Compiler: gcc * * Author: Jerome Plumat (JP), j.plumat@auckland.ac.nz * Company: UoA, Auckand, NZ * * ===================================================================================== */ #ifndef __ITERATIONCOMMANDITERATIONUPDATE__ #define __ITERATIONCOMMANDITERATIONUPDATE__ #include "itkCommand.h" //#include "itkRegularStepGradientDescentOptimizer.h" #include "itkGradientDescentOptimizer.h" class CommandIterationUpdate : public itk::Command { public: typedef CommandIterationUpdate Self; typedef itk::Command Superclass; typedef itk::SmartPointer<Self> Pointer; itkNewMacro( Self ); protected: CommandIterationUpdate() {}; public: //typedef itk::RegularStepGradientDescentOptimizer OptimizerType; typedef itk::GradientDescentOptimizer OptimizerType; typedef const OptimizerType * OptimizerPointer; void Execute(itk::Object *caller, const itk::EventObject & event) { Execute( (const itk::Object *)caller, event); } void Execute(const itk::Object * object, const itk::EventObject & event) { OptimizerPointer optimizer = dynamic_cast< OptimizerPointer >( object ); if( ! itk::IterationEvent().CheckEvent( &event ) ) { return; } std::cout <<"("<< optimizer->GetCurrentIteration() << ")_["; std::cout << optimizer->GetValue() << "] "; std::cout<<" T:["<<optimizer->GetCurrentPosition()[0]<<","; std::cout<<optimizer->GetCurrentPosition()[1]<<","; std::cout<<optimizer->GetCurrentPosition()[2]<<"]"<<std::endl; } }; #endif
/*----------------------------------------------------------------------------*/ /* Copyright (C) 2015 Alexandre Campo */ /* */ /* This file is part of USE Tracker. */ /* */ /* USE Tracker 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. */ /* */ /* USE Tracker 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 USE Tracker. If not, see <http://www.gnu.org/licenses/>. */ /*----------------------------------------------------------------------------*/ #ifndef TRACKER_H #define TRACKER_H #include "PipelinePlugin.h" #include "Utils.h" #include <iostream> #include <fstream> #include <opencv2/imgproc/imgproc.hpp> // extern Parameters parameters; struct Tracker : public PipelinePlugin { // helper public classes struct Entity { int x, y; int size; std::vector<float> dx, dy; int diffIdx; bool assigned; bool toforget; int zone; int lastFrameDetected; int lastFrameNotDetected; int linkedEntity; // used in case this is a virtual entity Entity (int motionEstimatorLength = 0) { x = 0; y = 0; size = 0; assigned = false; zone = 1;//ZONE_VISIBLE; lastFrameDetected = -1000; lastFrameNotDetected = 0; linkedEntity = -1; toforget = false; diffIdx = 0; // ResizeHistory(motionEstimatorLength); dx.resize(motionEstimatorLength); dy.resize(motionEstimatorLength); } void ResizeHistory(int motionEstimatorLength) { dx.clear(); dy.clear(); for (int i = 0; i < motionEstimatorLength; i++) { dx.push_back(0); dy.push_back(0); } } }; class Interdistance { public: int blobIdx, entityIdx; int distsq; Interdistance (int b, int e, int d) { blobIdx = b; entityIdx = e; distsq = d; } bool operator<(const Interdistance &dp) const { return distsq < dp.distsq; } }; struct HistoryEntry { HistoryEntry(unsigned int f, unsigned int i) { frameNumber = f; entitiesIndex = i; } unsigned int frameNumber; unsigned int entitiesIndex; }; // class members unsigned int entitiesCount = 1; std::vector<Entity> entities; std::vector<Entity> previousEntities; std::fstream outputStream; std::string outputFilename; float minInterdistance = 5.0; float maxMotionPerSecond = 800; float extrapolationDecay = 0.8; unsigned int motionEstimatorLength = 10; float motionEstimatorTimeout = 1.0; bool useVirtualEntities = false; float virtualEntitiesLifetime = 1.0; float virtualEntitiesDelay = 0.3; bool virtualEntitiesZone = false; float virtualEntitiesDistsq = 0.0; // history & replay bool replay = false; std::vector<Entity> history; std::vector<HistoryEntry> historyEntries; unsigned int historyEntriesIndex = 0; unsigned int historyStartFrame = 0; unsigned int trailLength = 10; // methods ~Tracker(); void SetMaxEntities(unsigned int n); inline void UpdateMotionEstimator (Entity& entity, const Entity& previousEntity); void Reset(); void Apply(); void Track(); void Replay(); void SetReplay(bool enable); void LoadHistory(std::string file); void ClearHistory(); void OutputStep(); void OpenOutput(); void CloseOutput(); void OutputHud (cv::Mat& hud); void LoadXML (cv::FileNode& fn); void SaveXML (cv::FileStorage& fs); }; #endif
/* +---------------------------------------------------------------------------+ | The Mobile Robot Programming Toolkit (MRPT) C++ library | | | | http://www.mrpt.org/ | | | | Copyright (C) 2005-2011 University of Malaga | | | | This software was written by the Machine Perception and Intelligent | | Robotics Lab, University of Malaga (Spain). | | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | | | | This file is part of the MRPT project. | | | | MRPT 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. | | | | MRPT 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 MRPT. If not, see <http://www.gnu.org/licenses/>. | | | +---------------------------------------------------------------------------+ */ #ifndef CPOINT3D_H #define CPOINT3D_H #include <mrpt/poses/CPoint.h> #include <mrpt/poses/CPose3D.h> namespace mrpt { namespace poses { DEFINE_SERIALIZABLE_PRE( CPoint3D ) /** A class used to store a 3D point. * * For a complete description of Points/Poses, see mrpt::poses::CPoseOrPoint, or refer * to the <a href="http://www.mrpt.org/2D_3D_Geometry" >2D/3D Geometry tutorial</a> in the wiki. * * <div align=center> * <img src="CPoint3D.gif"> * </div> * * \ingroup poses_grp * \sa CPoseOrPoint,CPose, CPoint */ class BASE_IMPEXP CPoint3D : public CPoint<CPoint3D>, public mrpt::utils::CSerializable { // This must be added to any CSerializable derived class: DEFINE_SERIALIZABLE( CPoint3D ) public: mrpt::math::CArrayDouble<3> m_coords; //!< [x,y,z] public: /** Constructor for initializing point coordinates. */ inline CPoint3D(const double x=0,const double y=0,const double z=0) { m_coords[0]= x; m_coords[1]=y; m_coords[2]=z; } /** Constructor from a XYZ 3-vector */ explicit inline CPoint3D(const mrpt::math::CArrayDouble<3> &xyz) : m_coords(xyz) { } /** Constructor from an CPoint2D object. */ CPoint3D( const CPoint2D &p); /** Constructor from an CPose3D object. */ explicit inline CPoint3D( const CPose3D &p) { m_coords[0]=p.x(); m_coords[1]=p.y(); m_coords[2]=p.z(); } /** Constructor from an CPose2D object. */ explicit CPoint3D( const CPose2D &p); /** Constructor from lightweight object. */ inline CPoint3D(const mrpt::math::TPoint3D &p) { m_coords[0]=p.x; m_coords[1]=p.y; m_coords[2]=p.z; } /** Returns this point as seen from "b", i.e. result = this - b */ CPoint3D operator - (const CPose3D& b) const; /** Returns this point minus point "b", i.e. result = this - b */ CPoint3D operator - (const CPoint3D& b) const; /** Returns this point plus point "b", i.e. result = this + b */ CPoint3D operator + (const CPoint3D& b) const; /** Returns this point plus pose "b", i.e. result = this + b */ CPose3D operator + (const CPose3D& b) const; enum { is_3D_val = 1 }; static inline bool is_3D() { return is_3D_val!=0; } enum { is_PDF_val = 0 }; static inline bool is_PDF() { return is_PDF_val!=0; } /** @name STL-like methods and typedefs @{ */ typedef double value_type; //!< The type of the elements typedef double& reference; typedef const double& const_reference; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; // size is constant enum { static_size = 3 }; static inline size_type size() { return static_size; } static inline bool empty() { return false; } static inline size_type max_size() { return static_size; } static inline void resize(const size_t n) { if (n!=static_size) throw std::logic_error(format("Try to change the size of CPoint3D to %u.",static_cast<unsigned>(n))); } /** @} */ }; // End of class def. } // End of namespace } // End of namespace #endif
/* * LSST Data Management System * Copyright 2016 AURA/LSST. * * This product includes software developed by the * LSST Project (http://www.lsst.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 LSST License Statement and * the GNU General Public License along with this program. If not, * see <https://www.lsstcorp.org/LegalNotices/>. */ #ifndef LSST_SPHGEOM_CODEC_H_ #define LSST_SPHGEOM_CODEC_H_ // Optimized path requires little endian arch and support for unaligned loads. #if defined(__x86_64__) or (defined(__aarch64__) and defined(__LITTLE_ENDIAN__)) #define OPTIMIZED_LITTLE_ENDIAN #endif #ifdef NO_OPTIMIZED_PATHS #undef OPTIMIZED_LITTLE_ENDIAN #endif /// \file /// \brief This file contains simple helper functions for encoding and /// decoding primitive types to/from byte strings. #include <vector> namespace lsst { namespace sphgeom { /// `encode` appends an IEEE double in little-endian byte order /// to the end of buffer. inline void encodeDouble(double item, std::vector<uint8_t> & buffer) { #ifdef OPTIMIZED_LITTLE_ENDIAN auto ptr = reinterpret_cast<uint8_t const *>(&item); buffer.insert(buffer.end(), ptr, ptr + 8); #else union { uint64_t u; double d; }; d = item; buffer.push_back(static_cast<uint8_t>(u)); buffer.push_back(static_cast<uint8_t>(u >> 8)); buffer.push_back(static_cast<uint8_t>(u >> 16)); buffer.push_back(static_cast<uint8_t>(u >> 24)); buffer.push_back(static_cast<uint8_t>(u >> 32)); buffer.push_back(static_cast<uint8_t>(u >> 40)); buffer.push_back(static_cast<uint8_t>(u >> 48)); buffer.push_back(static_cast<uint8_t>(u >> 56)); #endif } /// `decode` extracts an IEEE double from the 8 byte little-endian byte /// sequence in buffer. inline double decodeDouble(uint8_t const * buffer) { #ifdef OPTIMIZED_LITTLE_ENDIAN return *reinterpret_cast<double const *>(buffer); #else union { uint64_t u; double d; }; u = static_cast<uint64_t>(buffer[0]) + (static_cast<uint64_t>(buffer[1]) << 8) + (static_cast<uint64_t>(buffer[2]) << 16) + (static_cast<uint64_t>(buffer[3]) << 24) + (static_cast<uint64_t>(buffer[4]) << 32) + (static_cast<uint64_t>(buffer[5]) << 40) + (static_cast<uint64_t>(buffer[6]) << 48) + (static_cast<uint64_t>(buffer[7]) << 56); return d; #endif } }} // namespace lsst::sphgeom #endif // LSST_SPHGEOM_CODEC_H_
#ifndef SPLINE_EDITOR_H #define SPLINE_EDITOR_H # include <QWidget> #include "splinetransferfunction.h" class SplineEditor : public QWidget { Q_OBJECT public : enum PointShape { CircleShape, RectangleShape }; enum LockType { LockToLeft = 0x01, LockToRight = 0x02, LockToTop = 0x04, LockToBottom = 0x08 }; enum SortType { NoSort, XSort, YSort }; enum ConnectionType { NoConnection, LineConnection, CurveConnection }; SplineEditor(QWidget*); QImage colorMapImage(); void paintEvent(QPaintEvent*); void resizeEvent(QResizeEvent*); void mouseMoveEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mousePressEvent(QMouseEvent*); void keyPressEvent(QKeyEvent*); void enterEvent(QEvent*); void leaveEvent(QEvent*); int border() const; void setBorder(const int); QSizeF pointSize() const; void setPointSize(const QSizeF&); QRectF boundingRect() const; ConnectionType connectionType(); void setConnectionType(ConnectionType); void setConnectionPen(const QPen&); void setShapePen(const QPen&); void setShapeBrush(const QBrush&); void setHistogramImage(QImage, QImage); void setTransferFunction(SplineTransferFunction*); void setMapping(QPolygonF); void setGradLimits(int, int); void setOpmod(float, float); void show2D(bool); bool set16BitPoint(float, float); public slots : void setGradientStops(QGradientStops); private slots : void saveTransferFunctionImage_cb(); signals : void refreshDisplay(); void splineChanged(); void selectEvent(QGradientStops); void deselectEvent(); void applyUndo(bool); private : QWidget *m_parent; SplineTransferFunction *m_splineTF; bool m_showGrid; bool m_showOverlay; bool m_show2D; QImage m_histogramImage1D; QImage m_histogramImage2D; QPolygonF m_mapping; QRectF m_bounds; PointShape m_pointShape; ConnectionType m_connectionType; int m_border; bool m_dragging; bool m_moveSpine; QSizeF m_pointSize; int m_currentIndex; int m_prevCurrentIndex; int m_normalIndex; int m_hoverIndex; QPen m_pointPen; QPen m_connectionPen; QBrush m_pointBrush; QRectF pointBoundingRect(QPointF, int); QPointF convertLocalToWidget(QPointF); QPointF convertWidgetToLocal(QPointF); int checkNormalPressEvent(QMouseEvent*); void getPainterPath(QPainterPath*, QPolygonF); void paintPatchLines(QPainter*); void paintPatchEndPoints(QPainter*); void paintUnderlay(QPainter*); void paintOverlay(QPainter*); QAction *save_transferfunction_image_action; void showHelp(); }; #endif
/************************************************************************** ** ** sngrep - SIP Messages flow viewer ** ** Copyright (C) 2013-2016 Ivan Alonso (Kaian) ** Copyright (C) 2013-2016 Irontec SL. All rights reserved. ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see <http://www.gnu.org/licenses/>. ** ****************************************************************************/ /** * @file option.h * @author Ivan Alonso [aka Kaian] <kaian@irontec.com> * * @brief Functions to manage application settings * * This file contains the functions to manage application settings and * optionuration resource files. Configuration will be parsed in this order, * from less to more priority, so the later will overwrite the previous. * * - Initialization * - \@sysdir\@/sngreprc * - $HOME/.sngreprc * - $SNGREPRC * * This is a basic approach to configuration, but at least a minimun is required * for those who can not see all the list columns or want to disable colours in * every sngrep execution. * */ #ifndef __SNGREP_CONFIG_H #define __SNGREP_CONFIG_H //! Shorter declarartion of config_option struct typedef struct config_option option_opt_t; //! Option types enum option_type { COLUMN = 0, ALIAS }; /** * @brief Configurable option structure * * sngrep is optionured by a group of attributes that can be * modified using resource files. */ struct config_option { //! Setting type enum option_type type; //! Name of attribute char *opt; //! Value of attribute char *value; }; /** * @brief Initialize all program options * * This function will give all available settings an initial value. * This values can be overriden using resources files, either from system dir * or user home dir. * * @param no_config Do not load config file if set to 1 * @return 0 in all cases */ int init_options(int no_config); /** * @brief Deallocate options memory * * Deallocate memory used for program configurations */ void deinit_options(); /** * @brief Read optionuration directives from file * * This funtion will parse passed filenames searching for configuration * directives of sngrep. See documentation for a list of available * directives and attributes * * @param fname Full path configuration file name * @return 0 in case of parse success, -1 otherwise */ int read_options(const char *fname); /** * @brief Get settings option value (string) * * Used in all the program to access the optionurable options of sngrep * Use this function instead of accessing optionuration array. * * @param opt Name of optionurable option * @return configuration option value or NULL if not found */ const char* get_option_value(const char *opt); /** * @brief Get settings option value (int) * * Basically the same as get_option_value converting the result to * integer. * Use this function instead of accessing configuration array. * * @todo -1 is an error! * * @param opt Name of optionurable option * @return option numeric value or -1 in case of error */ int get_option_int_value(const char *opt); /** * @brief Sets a settings option value * * Basic setter for 'set' directive attributes * * @param opt Name of configuration option * @param value Value of configuration option */ void set_option_value(const char *opt, const char *value); /** * @brief Sets an alias for a given address * * @param address IP Address * @param string representing the alias */ void set_alias_value(const char *address, const char *alias); /** * @brief Get alias for a given address (string) * * @param address IP Address * @return configured alias or address if not alias found */ const char * get_alias_value(const char *address); #endif
/* -*- c++ -*- */ /* * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio 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 Radio 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 Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ // @WARNING@ #ifndef INCLUDED_MULTIPLY_CONST_FF_H #define INCLUDED_MULTIPLY_CONST_FF_H #include <gnuradio/blocks/api.h> #include <gnuradio/sync_block.h> namespace gr { namespace blocks { /*! * \brief output = input * real constant * \ingroup math_operators_blk */ class BLOCKS_API multiply_const_ff : virtual public sync_block { public: // gr::gnuradio/blocks::multiply_const_ff::sptr typedef boost::shared_ptr<multiply_const_ff> sptr; /*! * \brief Create an instance of multiply_const_ff * \param k real multiplicative constant * \param vlen Vector length of incoming stream */ static sptr make(float k, size_t vlen=1); /*! * \brief Return real multiplicative constant */ virtual float k() const = 0; /*! * \brief Set real multiplicative constant */ virtual void set_k(float k) = 0; }; } /* namespace blocks */ } /* namespace gr */ #endif /* INCLUDED_MULTIPLY_CONST_FF_H */
#pragma once #include<WinSock2.h> #include<stdio.h> void err_display(const char *msg) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, WSAGetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL); printf("[%s] %s", msg, (LPCTSTR)lpMsgBuf); LocalFree(lpMsgBuf); } // ¼ÒÄÏ ÇÔ¼ö ¿À·ù Ãâ·Â ÈÄ Á¾·á void err_quit(const char *msg) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, WSAGetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL); MessageBox(NULL, (LPCTSTR)lpMsgBuf, msg, MB_ICONERROR); LocalFree(lpMsgBuf); exit(-1); } // »ç¿ëÀÚ Á¤ÀÇ µ¥ÀÌÅÍ ¼ö½Å ÇÔ¼ö int recvn(SOCKET s, char *buf, int len, int flags) { int received; char *ptr = buf; int left = len; while (left > 0) { received = recv(s, ptr, left, flags); if (received == SOCKET_ERROR) return SOCKET_ERROR; else if (received == 0) break; left -= received; ptr += received; } return (len - left); }
/* Copyright 2016,王思远 <darknightghost.cn@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "../../../../common/common.h" #include "../../../../sandnix/kernel/hal/io/io.h" #include "./kclock_defs.h" //Initialize clock void core_kclock_init(); //How many microseconds the system has be runing. u64 core_kclock_get_micro_sec(); //The interval of clock. void core_kclock_set_interval(u32 microseconds);
/* 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 <fastonosql/core/basic_types.h> namespace fastonosql { namespace gui { typedef core::readable_string_t convert_in_t; typedef core::readable_string_t convert_out_t; bool string_from_json(const convert_in_t& value, convert_out_t* out); bool string_to_json(const convert_in_t& data, convert_out_t* out); bool string_from_hex(const convert_in_t& value, convert_out_t* out); bool string_to_hex(const convert_in_t& data, convert_out_t* out); bool string_from_unicode(const convert_in_t& value, convert_out_t* out); bool string_to_unicode(const convert_in_t& data, convert_out_t* out); // snappy bool string_from_snappy(const convert_in_t& value, convert_out_t* out); bool string_to_snappy(const convert_in_t& data, convert_out_t* out); // zlib bool string_from_zlib(const convert_in_t& value, convert_out_t* out); bool string_to_zlib(const convert_in_t& data, convert_out_t* out); // gzip bool string_from_gzip(const convert_in_t& value, convert_out_t* out); bool string_to_gzip(const convert_in_t& data, convert_out_t* out); // lz4 bool string_from_lz4(const convert_in_t& value, convert_out_t* out); bool string_to_lz4(const convert_in_t& data, convert_out_t* out); // bzip2 bool string_from_bzip2(const convert_in_t& value, convert_out_t* out); bool string_to_bzip2(const convert_in_t& data, convert_out_t* out); // base64 bool string_from_base64(const convert_in_t& value, convert_out_t* out); bool string_to_base64(const convert_in_t& data, convert_out_t* out); } // namespace gui } // namespace fastonosql
#ifndef HEXAGON_H #define HEXAGON_H #include "graph/Lattice.h" #include <memory> #include <ngl/VertexArrayObject.h> namespace ppnp { //---------------------------------------------------------------------------------------------------------------------- /// @class Hexagon /// @brief Construct triangulated hexagon plane /// @author Erika Camilleri /// @version 1.0 /// @date 06/16/16 //---------------------------------------------------------------------------------------------------------------------- class Hexagon : public Lattice { public: //---------------------------------------------------------------------------------------------------------------------- /// @brief constructor to build *regular* hexagonal 2D lattice /// @param[in] _n centered hexagonal number /// @param[in] _distance distance between 2 points //---------------------------------------------------------------------------------------------------------------------- Hexagon(const int &_n, const ngl::Real &_distance); //---------------------------------------------------------------------------------------------------------------------- /// @brief constructor with inheritence to build *regular* hexagonal 2D lattice /// @param[in] _n centered hexagonal number /// @param[in] _distance distance between 2 points /// @param[in] _isWeighted whether or not the lattice edges have weights (inherited param) //---------------------------------------------------------------------------------------------------------------------- Hexagon(const int &_n, const ngl::Real &_distance, const ngl::Real &_isWeighted) : Lattice(_isWeighted) { m_n = _n; m_distance = _distance; m_height = ( (_n * 2 ) - 2) * _distance; m_width = ( (_n * 2 ) - 2) * _distance; } virtual void construct(); virtual void save(); virtual void load(); protected: private: int m_n; ngl::Real m_distance; }; } //end namespace ppnp #endif // end HEXAGON_H
/* * This file is part of Spacel game. * * Copyright 2016, Vincent Glize <vincent.glize@live.fr> * * Spacel 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. * * Spacel 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 Spacel. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "inventory.h" #include "unit.h" namespace spacel { namespace engine { enum PlayerRace { PLAYER_RACE_HUMAN, PLAYER_RACE_KILBOG, PLAYER_RACE_ARKYN, PLAYER_RACE_SPACEELF, PLAYER_RACE_MAX, }; /*static const char *player_race_names[PLAYER_RACE_MAX] = { "Human", "Kilbog", "Arkyn", "Space Elf" };*/ enum PlayerSex { PLAYER_SEX_MALE, PLAYER_SEX_FEMALE, PLAYER_SEX_MAX, }; /*static const char *player_sex_names[PLAYER_SEX_MAX] = { "Male", "Female" };*/ enum PlayerStat { PLAYER_STAT_STAMINA, PLAYER_STAT_MAX, }; class Player : public Unit { public: Player(const std::string &username); ~Player() {}; private: std::string m_username = ""; PlayerSex m_sex = PLAYER_SEX_MALE; PlayerRace m_race = PLAYER_RACE_HUMAN; uint32_t m_player_stats[PLAYER_STAT_MAX]; uint64_t m_xp = 0; uint16_t m_level = 1; std::unordered_map<uint32_t, InventoryPtr> m_inventories; }; } }
/* * * (C) 2013-21 - ntop.org * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #ifndef _SYSLOG_H_ #define _SYSLOG_H_ #include "ntop_includes.h" class SyslogDump : public DB { public: SyslogDump(NetworkInterface *_iface); virtual ~SyslogDump(); virtual bool dumpFlow(time_t when, Flow *f, char *json); virtual void startLoop() { ; } }; #endif /* _LOGSTASH_H_ */
/* * Song.h * * Created on: 22.03.2012 * Author: michi */ #ifndef SRC_DATA_SONG_H_ #define SRC_DATA_SONG_H_ #include "Data.h" #include "Rhythm/BarCollection.h" #include "../lib/base/base.h" #include "../lib/base/pointer.h" #include "../lib/any/any.h" #include <shared_mutex> class Data; class AudioEffect; class MidiEffect; class Track; class TrackLayer; class Sample; class Synthesizer; class SongSelection; class AudioBuffer; class BarPattern; class TrackMarker; class MidiNoteBuffer; enum class SampleFormat; enum class SignalType; class Tag { public: string key, value; bool operator==(const Tag &o) const; bool operator!=(const Tag &o) const; bool valid() const; }; class Song : public Data { public: Song(Session *session, int sample_rate); virtual ~Song(); void _cdecl __init__(Session *session, int sample_rate); void _cdecl __delete__() override; Range _cdecl range(); Range _cdecl range_with_time(); static const string MESSAGE_NEW; static const string MESSAGE_ADD_TRACK; static const string MESSAGE_DELETE_TRACK; static const string MESSAGE_ADD_EFFECT; static const string MESSAGE_DELETE_EFFECT; static const string MESSAGE_ADD_SAMPLE; static const string MESSAGE_DELETE_SAMPLE; static const string MESSAGE_ADD_LAYER; static const string MESSAGE_EDIT_LAYER; static const string MESSAGE_DELETE_LAYER; static const string MESSAGE_CHANGE_CHANNELS; static const string MESSAGE_EDIT_BARS; static const string MESSAGE_SCALE_BARS; static const string MESSAGE_ENABLE_FX; class Error : public Exception { public: explicit Error(const string &message); }; string _cdecl get_time_str(int t); string _cdecl get_time_str_fuzzy(int t, float dt); string _cdecl get_time_str_long(int t); void _cdecl reset() override; bool is_empty(); void _cdecl invalidate_all_peaks(); Track *_cdecl time_track(); int _cdecl bar_offset(int index); string _cdecl get_tag(const string &key); Array<TrackMarker*> get_parts(); // action void _cdecl add_tag(const string &key, const string &value); void _cdecl edit_tag(int index, const string &key, const string &value); void _cdecl delete_tag(int index); void _cdecl change_all_track_volumes(Track *t, float volume); void _cdecl set_sample_rate(int sample_rate); void _cdecl set_default_format(SampleFormat format); void _cdecl set_compression(int compression); Track *_cdecl add_track(SignalType type, int index = -1); Track *_cdecl add_track_after(SignalType type, Track *insert_after = nullptr); void _cdecl delete_track(Track *track); Sample *_cdecl create_sample_audio(const string &name, const AudioBuffer &buf); Sample *_cdecl create_sample_midi(const string &name, const MidiNoteBuffer &midi); void _cdecl add_sample(Sample *s); void _cdecl delete_sample(Sample *s); void _cdecl edit_sample_name(Sample *s, const string &name); void _cdecl sample_replace_buffer(Sample *s, AudioBuffer *buf); void _cdecl add_bar(int index, const BarPattern &bar, int mode); void _cdecl add_pause(int index, int length, int mode); void _cdecl edit_bar(int index, const BarPattern &bar, int mode); void _cdecl delete_bar(int index, bool affect_midi); void _cdecl delete_time_interval(int index, const Range &range); void _cdecl insert_selected_samples(const SongSelection &sel); void _cdecl delete_selected_samples(const SongSelection &sel); void _cdecl delete_selection(const SongSelection &sel); void _cdecl create_samples_from_selection(const SongSelection &sel, bool auto_delete); // helper Sample* _cdecl get_sample_by_uid(int uid); // data Array<Tag> tags; int sample_rate; SampleFormat default_format; int compression; shared_array<AudioEffect> __fx; shared_array<Track> tracks; shared_array<Sample> samples; BarCollection bars; Any secret_data; Array<TrackLayer*> layers() const; }; int get_track_index(Track *t); #endif /* SRC_DATA_SONG_H_ */
/* * language_def.h * Copyright (C) 2013 David Jolly * ---------------------- * * 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 LANGUAGE_DEF_H_ #define LANGUAGE_DEF_H_ #include <set> #include "type.h" namespace resource { enum { ATTRIBUTE_TYPE_FLOAT = 0, ATTRIBUTE_TYPE_IDENTIFIER, ATTRIBUTE_TYPE_INTEGER, ATTRIBUTE_TYPE_STRING_VAR, }; enum { DIRECTIVE_TYPE_CONFIG = 0, DIRECTIVE_TYPE_IMAGE, DIRECTIVE_TYPE_SOUND, DIRECTIVE_TYPE_SPRITE, DIRECTIVE_TYPE_ROOT, }; enum { SYMBOL_TYPE_BRACE_CLOSE = 0, SYMBOL_TYPE_BRACE_OPEN, SYMBOL_TYPE_IDENTIFIER_SEPERATOR, SYMBOL_TYPE_LIST_SEPERATOR, SYMBOL_TYPE_TERMINATOR, }; enum { TOKEN_TYPE_ATTRIBUTE = 0, TOKEN_TYPE_BEGIN, TOKEN_TYPE_DIRECTIVE, TOKEN_TYPE_END, TOKEN_TYPE_FLOAT, TOKEN_TYPE_IDENTIFIER, TOKEN_TYPE_INTEGER, TOKEN_TYPE_STATEMENT, TOKEN_TYPE_STRING_VAR, TOKEN_TYPE_SYMBOL, }; static const std::string ATTRIBUTE_TYPE_STR[] = { "FLOAT", "IDENTIFIER", "INTEGER", "STRING", }; static const std::string DIRECTIVE_TYPE_STR[] = { "config", "image", "sound", "sprite", }; static const char SYMBOL_TYPE_CH[] = { '}', '{', ':', ',', ';', }; static const std::string SYMBOL_TYPE_STR[] = { "}", "{", ":", ",", ";", }; static const std::string TOKEN_TYPE_STR[] = { "ATTRIBUTE", "BEGIN", "DIRECTIVE", "END", "FLOAT", "IDENTIFIER", "INTEGER", "STATEMENT", "STRING", "SYMBOL", }; #define CHAR_COMMENT '#' #define CHAR_DECIMAL '.' #define CHAR_DIRECTORY '\\' #define CHAR_END_OF_STREAM '\0' #define CHAR_NEGATE '-' #define CHAR_NEW_LINE '\n' #define CHAR_STRING_DELIM '\"' #define CHAR_TAB '\t' #define CHAR_UNDERSCORE '_' #define CONTROL "CONTROL" #define INVALID_TYPE ((size_t) INVALID) #define MAX_ATTRIBUTE_TYPE ATTRIBUTE_TYPE_STRING_VAR #define MAX_DIRECTIVE_TYPE DIRECTIVE_TYPE_ROOT #define MAX_SYMBOL_TYPE SYMBOL_TYPE_TERMINATOR #define MAX_TOKEN_TYPE TOKEN_TYPE_SYMBOL static const std::set<std::string> DIRECTIVE_TYPE_SET( DIRECTIVE_TYPE_STR, DIRECTIVE_TYPE_STR + MAX_DIRECTIVE_TYPE + 1 ); static const std::set<std::string> SYMBOL_TYPE_SET( SYMBOL_TYPE_STR, SYMBOL_TYPE_STR + MAX_SYMBOL_TYPE + 1 ); static const size_t TOKEN_SUBTYPE_LEN[] = { MAX_ATTRIBUTE_TYPE + 1, 0, MAX_DIRECTIVE_TYPE + 1, 0, 0, 0, 0, 0, 0, MAX_SYMBOL_TYPE + 1, 0, }; static const std::string *TOKEN_SUBTYPE_STR[] = { ATTRIBUTE_TYPE_STR, NULL, DIRECTIVE_TYPE_STR, NULL, NULL, NULL, NULL, NULL, NULL, SYMBOL_TYPE_STR, NULL, }; #define ATTRIBUTE_TYPE_STRING(_T_)\ (_T_ > MAX_ATTRIBUTE_TYPE ? UNKNOWN : ATTRIBUTE_TYPE_STR[_T_]) #define DIRECTIVE_TYPE_STRING(_T_)\ (_T_ > MAX_DIRECTIVE_TYPE ? UNKNOWN : (_T_ == MAX_DIRECTIVE_TYPE ? CONTROL\ : transform(DIRECTIVE_TYPE_STR[_T_], ::toupper))) #define IS_DIRECTIVE(_S_)\ (DIRECTIVE_TYPE_SET.find(_S_) != DIRECTIVE_TYPE_SET.end()) #define IS_SYMBOL(_S_)\ (SYMBOL_TYPE_SET.find(_S_) != SYMBOL_TYPE_SET.end()) #define SYMBOL_TYPE_CHAR(_T_)\ (_T_ > MAX_SYMBOL_TYPE ? CHAR_END_OF_STREAM : SYMBOL_TYPE_CH[_T_]) #define SYMBOL_TYPE_STRING(_T_)\ (_T_ > MAX_SYMBOL_TYPE ? UNKNOWN : SYMBOL_TYPE_STR[_T_]) #define TOKEN_SUBTYPE_LENGTH(_T_)\ (_T_ > MAX_TOKEN_TYPE ? 0 : TOKEN_SUBTYPE_LEN[_T_]) #define TOKEN_SUBTYPE_STRING(_T_)\ (_T_ > MAX_TOKEN_TYPE ? NULL : TOKEN_SUBTYPE_STR[_T_]) #define TOKEN_TYPE_STRING(_T_)\ (_T_ > MAX_TOKEN_TYPE ? UNKNOWN : TOKEN_TYPE_STR[_T_]) size_t __find_subtype( const std::string &text, size_t type ); std::string __subtype_as_string( size_t type, size_t subtype ); } #endif
//================================================================================================= // Copyright (c) 2015, Alexander Stumpf, TU Darmstadt // All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of the Simulation, Systems Optimization and Robotics // group, TU Darmstadt 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 BE LIABLE FOR ANY // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //================================================================================================= #ifndef VIGIR_FOOTSTEP_PLANNING_LIB_ROBOT_MODEL_PLUGIN_H__ #define VIGIR_FOOTSTEP_PLANNING_LIB_ROBOT_MODEL_PLUGIN_H__ #include <ros/ros.h> #include <vigir_footstep_planning_lib/helper.h> #include <vigir_footstep_planning_lib/plugins/plugin.h> namespace vigir_footstep_planning { class RobotModelPlugin : public Plugin { public: RobotModelPlugin(const ParameterSet& params, ros::NodeHandle &nh); RobotModelPlugin(ros::NodeHandle &nh); bool isUnique() const final; const geometry_msgs::Vector3& getFootSize() const; const geometry_msgs::Vector3& getUpperBodySize() const; const geometry_msgs::Vector3& getUpperBodyOriginShift() const; // typedefs typedef boost::shared_ptr<RobotModelPlugin> Ptr; typedef boost::shared_ptr<const RobotModelPlugin> ConstPtr; protected: // foot paramaters geometry_msgs::Vector3 foot_size; // upper body parameters geometry_msgs::Vector3 upper_body_size; geometry_msgs::Vector3 upper_body_origin_shift; }; } #endif
/* NOYAUTEST.C */ /*--------------------------------------------------------------------------* * Programme de tests * *--------------------------------------------------------------------------*/ #include "serialio.h" #include "noyau.h" #include "fifo.h" /* ** Test du noyau preemptif. Lier noyautes.c avec noyau.c et noyaufil.c */ /* Création de la file du producteur/consommateur */ FIFO fifo; /* Création des tâches */ TACHE launch(void); TACHE Producteur(void); TACHE Consommateur(void); uint16_t Prod; uint16_t Cons; TACHE launch(void) { puts("------> EXEC tache launch"); init_fifo(&fifo); Prod = cree(Producteur); Cons = cree(Consommateur); active(Prod); active(Cons); fin_tache(); } TACHE Producteur(void) { int i = 0; long j; puts("------> DEBUT tache Producteur"); while(1) { push_fifo(&fifo, 1); puts("-- Prod -- Production"); if (size_fifo(&fifo) == MAX_FIFO) { puts("-- Prod -- Sleep"); dort(); } if (size_fifo(&fifo) >= 1) { puts("-- Prod -- Reveille Cons"); reveille(Cons); } } fin_tache(); } TACHE Consommateur(void) { int i = 0; long j; puts("------> DEBUT tache Consommateur"); while(1) { pop_fifo(&fifo); puts("-- Cons -- Consommation"); if(size_fifo(&fifo) == 0) { puts("-- Cons -- Sleep"); dort(); } if(size_fifo(&fifo) <= MAX_FIFO - 1) { puts("-- Cons -- Reveille Prod"); reveille(Prod); } } fin_tache(); } int main() { serial_init(115200); puts("Test noyau"); puts("Noyau preemptif"); start(launch); getchar(); return (0); }
/* * This file is part of eVic SDK. * * eVic SDK 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. * * eVic SDK 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 eVic SDK. If not, see <http://www.gnu.org/licenses/>. * * Copyright (C) 2015-2016 ReservedField * Copyright (C) 2015-2016 Jussi Timperi */ /** * NOTE: this low-level interface is not guaranteed to be thread/ISR-safe. */ #ifndef EVICSDK_DISPLAY_SSD_H #define EVICSDK_DISPLAY_SSD_H #include <stdint.h> #include <stdbool.h> #include <M451Series.h> #ifdef __cplusplus extern "C" { #endif /** * Commands shared by the SSDxxxx display controllers. */ #define SSD_SET_CONTRAST_LEVEL 0x81 #define SSD_SET_MULTIPLEX_RATIO 0xA8 #define SSD_DISPLAY_OFF 0xAE #define SSD_DISPLAY_ON 0xAF /** * Reset is at PA.0. */ #define DISPLAY_SSD_RESET PA0 /** * Vdd/Vci (logic voltage) enable is at PA.1. */ #define DISPLAY_SSD_VDD PA1 /** * Vcc (matrix drive voltage) enable is at PC.4. * This is generated by a TPS61040 boost converter. */ #define DISPLAY_SSD_VCC PC4 /** * D/C# is at PE.10. */ #define DISPLAY_SSD_DC PE10 /** * Turns the display on or off. * This only acts on the pixels, the display will * still be powered. If you want to control the supply * rails, use Display_SSD_SetPowerOn(). * * @param isOn True to turn the display on, false to turn it off. */ void Display_SSD_SetOn(uint8_t isOn); /** * Powers the display on or off. * This turns the actual supply rails on/off, cutting * off all current draw from the display when off. It is * slower than Display_SSD_SetOn(). * * @param isPowerOn True to power on the display, false to power it off. */ void Display_SSD_SetPowerOn(uint8_t isPowerOn); /** * Flips the display according to the display orientation value in data flash. * An update must be issued afterwards. */ void Display_SSD_Flip(); /** * Sets whether the display colors are inverted. * * @param invert True for inverted display, false for normal display. */ void Display_SSD_SetInverted(bool invert); /** * Sends the framebuffer to the controller and updates the display. * * @param framebuf Framebuffer. */ void Display_SSD_Update(const uint8_t *framebuf); /** * Initializes the display controller. */ void Display_SSD_Init(); /** * Writes data to the display controller. * * @param isData True if writing GDDRAM data (D/C# high). * @param buf Data buffer. * @param len Size in bytes of the data buffer. */ void Display_SSD_Write(uint8_t isData, const uint8_t *buf, uint32_t len); /** * Sends a command to the display controller. * * @param cmd Command. */ void Display_SSD_SendCommand(uint8_t cmd); /** * Sets the display contrast (OLED current). * SSD1306: ~0.4uA/LSB * SSD1327: ~1.2uA/LSB * * @param contrast Contrast (0 - 255). */ void Display_SSD_SetContrast(uint8_t contrast); #ifdef __cplusplus } #endif #endif
/** ****************************************************************************** * @file LibJPEG/LibJPEG_Decoding/Inc/main.h * @author MCD Application Team * @version V1.1.0 * @date 17-February-2017 * @brief Header for main.c module ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics International N.V. * All rights reserved.</center></h2> * * Redistribution and use in source and binary forms, with or without * modification, are permitted, provided that the following conditions are met: * * 1. Redistribution of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of other * contributors to this software may be used to endorse or promote products * derived from this software without specific written permission. * 4. This software, including modifications and/or derivative works of this * software, must execute solely and exclusively on microcontroller or * microprocessor devices manufactured by or for STMicroelectronics. * 5. Redistribution and use of this software other than as permitted under * this license is void and will automatically terminate your rights under * this license. * * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" /* Jpeg includes component */ #include <stdint.h> #include <string.h> #include "jpeglib.h" /* EVAL includes component */ #include "stm32469i_eval.h" #include "stm32469i_eval_lcd.h" #include "stm32469i_eval_sdram.h" #include "stm32469i_eval_camera.h" /* FatFs includes component */ #include "ff_gen_drv.h" #include "sd_diskio.h" #include "decode.h" /* Exported types ------------------------------------------------------------*/ typedef struct RGB { uint8_t B; uint8_t G; uint8_t R; }RGB_typedef; /* Exported constants --------------------------------------------------------*/ #define IMAGE_HEIGHT 240 #define IMAGE_WIDTH 320 /* #define SWAP_RB */ #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * 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 "Nucleus/MemoryObject.h" #include "MemObjTest.h" const bool expectedToPass = false; /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ int main() { #if defined(USE_DBC) psonMemObject* pObj; psotObjDummy *pDummy; psonSessionContext context; pDummy = initMemObjTest( expectedToPass, &context ); pObj = &pDummy->memObject; psonMemObjectInit( pObj, PSON_IDENT_ALLOCATOR, NULL, 4 ); ERROR_EXIT( expectedToPass, NULL, ; ); #else return 1; #endif } /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2007 Erwin Coumans http://bulletphysics.com This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef SPU_SAMPLE_TASK_PROCESS_H #define SPU_SAMPLE_TASK_PROCESS_H #include <assert.h> #include "PlatformDefinitions.h" #include <stdlib.h> #include "LinearMath/btAlignedObjectArray.h" #include "SpuSampleTask/SpuSampleTask.h" //just add your commands here, try to keep them globally unique for debugging purposes #define CMD_SAMPLE_TASK_COMMAND 10 /// SpuSampleTaskProcess handles SPU processing of collision pairs. /// When PPU issues a task, it will look for completed task buffers /// PPU will do postprocessing, dependent on workunit output (not likely) class SpuSampleTaskProcess { // track task buffers that are being used, and total busy tasks btAlignedObjectArray<bool> m_taskBusy; btAlignedObjectArray<SpuSampleTaskDesc>m_spuSampleTaskDesc; int m_numBusyTasks; // the current task and the current entry to insert a new work unit int m_currentTask; bool m_initialized; void postProcess(int taskId, int outputSize); class btThreadSupportInterface* m_threadInterface; int m_maxNumOutstandingTasks; public: SpuSampleTaskProcess(btThreadSupportInterface* threadInterface, int maxNumOutstandingTasks); ~SpuSampleTaskProcess(); ///call initialize in the beginning of the frame, before addCollisionPairToTask void initialize(); void issueTask(void* sampleMainMemPtr,int sampleValue,int sampleCommand); ///call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished void flush(); }; #if defined(USE_LIBSPE2) && defined(__SPU__) ////////////////////MAIN///////////////////////////// #include "../SpuLibspe2Support.h" #include <spu_intrinsics.h> #include <spu_mfcio.h> #include <SpuFakeDma.h> void * SamplelsMemoryFunc(); void SampleThreadFunc(void* userPtr,void* lsMemory); //#define DEBUG_LIBSPE2_MAINLOOP int main(unsigned long long speid, addr64 argp, addr64 envp) { printf("SPU is up \n"); ATTRIBUTE_ALIGNED128(btSpuStatus status); ATTRIBUTE_ALIGNED16( SpuSampleTaskDesc taskDesc ) ; unsigned int received_message = Spu_Mailbox_Event_Nothing; bool shutdown = false; cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0); cellDmaWaitTagStatusAll(DMA_MASK(3)); status.m_status = Spu_Status_Free; status.m_lsMemory.p = SamplelsMemoryFunc(); cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0); cellDmaWaitTagStatusAll(DMA_MASK(3)); while (!shutdown) { received_message = spu_read_in_mbox(); switch(received_message) { case Spu_Mailbox_Event_Shutdown: shutdown = true; break; case Spu_Mailbox_Event_Task: // refresh the status #ifdef DEBUG_LIBSPE2_MAINLOOP printf("SPU recieved Task \n"); #endif //DEBUG_LIBSPE2_MAINLOOP cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0); cellDmaWaitTagStatusAll(DMA_MASK(3)); btAssert(status.m_status==Spu_Status_Occupied); cellDmaGet(&taskDesc, status.m_taskDesc.p, sizeof(SpuSampleTaskDesc), DMA_TAG(3), 0, 0); cellDmaWaitTagStatusAll(DMA_MASK(3)); SampleThreadFunc((void*)&taskDesc, reinterpret_cast<void*> (taskDesc.m_mainMemoryPtr) ); break; case Spu_Mailbox_Event_Nothing: default: break; } // set to status free and wait for next task status.m_status = Spu_Status_Free; cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0); cellDmaWaitTagStatusAll(DMA_MASK(3)); } return 0; } ////////////////////////////////////////////////////// #endif #endif // SPU_SAMPLE_TASK_PROCESS_H
#ifndef QORMRELATION1NMODEL_H #define QORMRELATION1NMODEL_H #include <QOrmAbstractModel> class QOrmRelation1NModel : public QOrmAbstractModel { Q_OBJECT public: QOrmRelation1NModel(QOrmTableInfo *meta); void setRootIndex(const QModelIndex &root); protected: }; #endif // QORMRELATION1NMODEL_H
// // SignupViewModel.h // XujcClient // // Created by 田奕焰 on 16/3/8. // Copyright © 2016年 luckytianyiyan. All rights reserved. // #import "AccountViewModel.h" @class ServiceProtocolViewModel; @class VerificationCodeTextFieldViewModel; @interface SignupViewModel : AccountViewModel @property (copy, nonatomic) NSString *nickname; @property (strong, nonatomic) RACCommand *executeSignup; @property (nonatomic, assign, readonly) BOOL isValidNickname; @property (readonly, strong, nonatomic) VerificationCodeTextFieldViewModel *verificationCodeTextFieldViewModel; - (ServiceProtocolViewModel *)serviceProtocolViewModel; @end
#ifndef XS_COMMAND_SET_FLOSS_PALETTE_H #define XS_COMMAND_SET_FLOSS_PALETTE_H #include "XSCommand.h" #include "XSCommandSetFlossPalette.h" #include "XSFlossPalette.h" /** */ class XSCommandSetFlossPalette : public XSCommand { public: XSCommandSetFlossPalette(XSFlossPalette const& flossPalette); virtual int doCommand(); virtual int undoCommand(); virtual char const* getDescription() const; private: XSFlossPalette m_oldFlossPalette; XSFlossPalette m_newFlossPalette; // Disallow copying XSCommandSetFlossPalette(XSCommandSetFlossPalette const&); XSCommandSetFlossPalette& operator=(XSCommandSetFlossPalette const&); }; #endif
#ifndef __PROXYSQL_CONFIG_H__ #define __PROXYSQL_CONFIG_H__ #include <string> class SQLite3DB; extern const char* config_header; class ProxySQL_Config { public: SQLite3DB* admindb; ProxySQL_Config(SQLite3DB* db); virtual ~ProxySQL_Config(); int Read_Global_Variables_from_configfile(const char *prefix); int Read_MySQL_Users_from_configfile(); int Read_MySQL_Query_Rules_from_configfile(); int Read_MySQL_Servers_from_configfile(); int Read_Scheduler_from_configfile(); int Read_Restapi_from_configfile(); int Read_ProxySQL_Servers_from_configfile(); void addField(std::string& data, const char* name, const char* value, const char* dq="\""); int Write_Global_Variables_to_configfile(std::string& data); int Write_MySQL_Users_to_configfile(std::string& data); int Write_MySQL_Query_Rules_to_configfile(std::string& data); int Write_MySQL_Servers_to_configfile(std::string& data); int Write_Scheduler_to_configfile(std::string& data); int Write_Restapi_to_configfile(std::string& data); int Write_ProxySQL_Servers_to_configfile(std::string& data); }; #endif
#include "genmath.h" /* Langevin function */ double langevin_function (double x) { return 1./tanh (x) - 1./x; }
/* $Id: EmoticonData.h 3089 2012-09-16 15:35:14Z IMPOMEZIA $ * IMPOMEZIA Simple Chat * Copyright © 2008-2012 IMPOMEZIA <schat@impomezia.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef EMOTICONDATA_H_ #define EMOTICONDATA_H_ #include <QSharedPointer> #include <QStringList> #include <QVariant> /*! * Информация о смайле. */ class EmoticonData { public: EmoticonData(const QString &file, const QString &id, const QVariantMap &data); bool isValid() const; inline bool isHidden() const { return m_hidden; } inline const QString& file() const { return m_file; } inline const QString& id() const { return m_id; } inline const QStringList& texts() const { return m_texts; } inline int height() const { return m_height; } inline int width() const { return m_width; } private: bool m_hidden; ///< \b true если смайл скрыт. int m_height; ///< Высота смайла. int m_width; ///< Ширина смайла. QString m_file; ///< Имя файла смайла. QString m_id; ///< Идентификатор набора смайлов. QStringList m_texts; ///< Список текстовых сокращений смайла. }; typedef QSharedPointer<EmoticonData> Emoticon; #endif /* EMOTICONDATA_H_ */
/* * GEM-Mapper v3 (GEM3) * Copyright (c) 2011-2017 by Santiago Marco-Sola <santiagomsola@gmail.com> * * This file is part of GEM-Mapper v3 (GEM3). * * 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/>. * * PROJECT: GEM-Mapper v3 (GEM3) * AUTHOR(S): Santiago Marco-Sola <santiagomsola@gmail.com> * DESCRIPTION: Simple Hash Implementation (String Key, Generic Value) */ #include "utils/hash.h" #include "system/mm.h" /* * Allocators */ #undef uthash_malloc #define uthash_malloc(sz) (shash->mm_allocator!=NULL ? mm_allocator_malloc(shash->mm_allocator,sz) : malloc(sz)) #undef uthash_free #define uthash_free(ptr,sz) if (shash->mm_allocator==NULL) free(ptr); /* * Constructor */ shash_t* shash_new(mm_allocator_t* const mm_allocator) { shash_t* const shash = mm_alloc(shash_t); shash->head = NULL; // uthash initializer shash->mm_allocator = mm_allocator; return shash; } void shash_clear(shash_t* shash) { shash_element_t *shash_element, *tmp; if (shash->mm_allocator != NULL) { shash->head = NULL; // uthash initializer } else { HASH_ITER(hh,shash->head,shash_element,tmp) { HASH_DEL(shash->head,shash_element); mm_free(shash_element); } } } void shash_delete(shash_t* shash) { shash_clear(shash); mm_free(shash); } /* * Basic (Type-unsafe) Accessors */ shash_element_t* shash_get_shash_element(shash_t* const shash,char* const key) { shash_element_t* shash_element; HASH_FIND_STR(shash->head,key,shash_element); return shash_element; } void shash_insert_element( shash_t* const shash, char* const key, const uint64_t key_length, void* const element) { shash_element_t* shash_element = shash_get_shash_element(shash,key); if (gem_expect_true(shash_element==NULL)) { shash_element = uthash_malloc(sizeof(shash_element_t)); shash_element->key = key; shash_element->element = element; HASH_ADD_KEYPTR(hh,shash->head,shash_element->key,key_length,shash_element); } else { // No removal of replaced element shash_element->element = element; } } void shash_remove(shash_t* shash,char* const key) { shash_element_t* shash_element = shash_get_shash_element(shash,key); if (shash_element) { HASH_DEL(shash->head,shash_element); } } void* shash_get_element(shash_t* const shash,char* const key) { shash_element_t* shash_element = shash_get_shash_element(shash,key); return gem_expect_true(shash_element!=NULL) ? shash_element->element : NULL; } /* * Type-safe Accessors */ bool shash_is_contained(shash_t* const shash,char* const key) { return (shash_get_shash_element(shash,key)!=NULL); } uint64_t shash_get_num_elements(shash_t* const shash) { return (uint64_t)HASH_COUNT(shash->head); } /* * Iterator */ shash_iterator_t* shash_iterator_new(shash_t* const shash) { // Allocate shash_iterator_t* const iterator = mm_alloc(shash_iterator_t); // Init iterator->current = NULL; iterator->next = shash->head; return iterator; } void shash_iterator_delete(shash_iterator_t* const iterator) { mm_free(iterator); } bool shash_iterator_eoi(shash_iterator_t* const iterator) { return (iterator->next!=NULL); } bool shash_iterator_next(shash_iterator_t* const iterator) { if (gem_expect_true(iterator->next!=NULL)) { iterator->current = iterator->next; iterator->next = iterator->next->hh.next; return true; } else { iterator->current = NULL; return false; } } char* shash_iterator_get_key(shash_iterator_t* const iterator) { return iterator->current->key; } void* shash_iterator_get_element(shash_iterator_t* const iterator) { return iterator->current->element; }
#ifndef CIC_CORE_CUT_H #define CIC_CORE_CUT_H #include "instancecut.h" namespace cIcCore{ class Cut: public Cell { public: Cut(QString layer1,QString layer2,int horizontal_cuts, int vertical_cuts); Cut(QString layer1,QString layer2,Rect* r); static QString makeName(QString layer1, QString layer2, int horizontal_cuts, int vertical_cuts); static Instance * getInstance(QString layer1, QString layer2, int horizontal_cuts, int vertical_cuts); ~Cut(); static QList<Rect*> getCutsForRects(QString layer1, QList<Rect*>, int horizontal_cuts,int vertical_cuts); static QList<Rect*> getCutsForRects(QString layer1, QList<Rect*>, int horizontal_cuts,int vertical_cuts,bool alignLeft); static QList<Rect*> getVerticalFillCutsForRects(QString layer1, QList<Rect*> rects, int horizontal_cuts); static QList<Cut*> getCuts(); protected: static QMap<QString,Cut*> cuts_; }; } #endif // CUT_H
/* This file is part of Hardwar - A remake of the classic flight sim shooter Copyright © 2010-2012 Andrew Fenn Hardwar 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. Hardwar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <OIS.h> #include <Ogre.h> #include <Rocket/Core.h> #include <Rocket/Controls.h> #include <Rocket/Debugger.h> #include "rocket/RenderInterfaceOgre3D.h" #include "rocket/SystemInterfaceOgre3D.h" #include "GameTask.h" namespace Client { class GuiTask : public GameTask, public Ogre::RenderQueueListener { public: GuiTask(Ogre::RenderWindow*, Ogre::SceneManager*); void init(); void shutdown(); void update(); /// Called from Ogre before a queue group is rendered. virtual void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation); /// Called from Ogre after a queue group is rendered. virtual void renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation); void mouseMoved(const OIS::MouseState mouseState); void mousePressed(const OIS::MouseState mouseState, OIS::MouseButtonID id); void mouseReleased(const OIS::MouseState mouseState, OIS::MouseButtonID id); Rocket::Core::Context* getRocket(); //int getKeyModifierState(); private: // Configures Ogre's rendering system for rendering Rocket. void ConfigureRenderSystem(); // Builds an OpenGL-style orthographic projection matrix. void BuildProjectionMatrix(Ogre::Matrix4& matrix); typedef std::map<OIS::KeyCode, Rocket::Core::Input::KeyIdentifier> KeyIdentifierMap; KeyIdentifierMap mKeyIdentifiers; Ogre::RenderWindow* mWindow; Rocket::Core::Context* mContext; SystemInterfaceOgre3D* mOgreSystem; RenderInterfaceOgre3D* mOgreRenderer; }; }
#ifndef CONFIG_H_INCLUDED #include "config.h" /** * All this is to keep Vala happy & configured.. */ const char *BUDGIE_EXTRAS_DATADIR = DATADIR; const char *BUDGIE_EXTRAS_SYSCONFDIR = SYSCONFDIR; const char *BUDGIE_EXTRAS_DAEMONNAME = DAEMONNAME; #else #error config.h missing! #endif
/*==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Additional permissions under GNU GPL version 3 section 7 If you modify this Program, or any covered work, by linking or combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK (or a modified version of those libraries), containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of OpenSSL and IJG JPEG Library used as well as that of the covered work. You can contact Cyan Worlds, Inc. by email legal@cyan.com or by snail mail at: Cyan Worlds, Inc. 14617 N Newport Hwy Mead, WA 99021 *==LICENSE==*/ #ifndef PL_FOOTSTEP_COMPONENT_H #define PL_FOOTSTEP_COMPONENT_H #include "plComponent.h" class plFootstepSoundComponent : public plComponent { public: plFootstepSoundComponent(); virtual void DeleteThis() { delete this; } virtual hsBool SetupProperties(plMaxNode* node, plErrorMsg* pErrMsg) { return true; } virtual hsBool PreConvert(plMaxNode *node, plErrorMsg *pErrMsg) { return true; } virtual hsBool Convert(plMaxNode *node, plErrorMsg *pErrMsg); enum // ParamBlock indices { kSurface, kSurfaceList, kNodePicker, }; }; #define FOOTSTEP_SOUND_COMPONENT_CLASS_ID Class_ID(0x15c93f12, 0x4c3f050f) class plFootstepSoundComponentProc : public ParamMap2UserDlgProc { public: plFootstepSoundComponentProc() {} BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); void DeleteThis() {} }; #endif
/*************************************************************************** * blitz/array/cgsolve.h Basic conjugate gradient solver for linear systems * * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org> * * This code was relicensed under the modified BSD license for use in SciPy * by Todd Veldhuizen (see LICENSE.txt in the weave directory). * * * Suggestions: blitz-dev@oonumerics.org * Bugs: blitz-bugs@oonumerics.org * * For more information, please see the Blitz++ Home Page: * http://oonumerics.org/blitz/ * ****************************************************************************/ #ifndef BZ_CGSOLVE_H #define BZ_CGSOLVE_H BZ_NAMESPACE(blitz) template<typename T_numtype> void dump(const char* name, Array<T_numtype,3>& A) { T_numtype normA = 0; for (int i=A.lbound(0); i <= A.ubound(0); ++i) { for (int j=A.lbound(1); j <= A.ubound(1); ++j) { for (int k=A.lbound(2); k <= A.ubound(2); ++k) { T_numtype tmp = A(i,j,k); normA += ::fabs(tmp); } } } normA /= A.numElements(); cout << "Average magnitude of " << name << " is " << normA << endl; } template<typename T_stencil, typename T_numtype, int N_rank, typename T_BCs> int conjugateGradientSolver(T_stencil stencil, Array<T_numtype,N_rank>& x, Array<T_numtype,N_rank>& rhs, double haltrho, const T_BCs& boundaryConditions) { // NEEDS_WORK: only apply CG updates over interior; need to handle // BCs separately. // x = unknowns being solved for (initial guess assumed) // r = residual // p = descent direction for x // q = descent direction for r RectDomain<N_rank> interior = interiorDomain(stencil, x, rhs); cout << "Interior: " << interior.lbound() << ", " << interior.ubound() << endl; // Calculate initial residual Array<T_numtype,N_rank> r = rhs.copy(); r *= -1.0; boundaryConditions.applyBCs(x); applyStencil(stencil, r, x); dump("r after stencil", r); cout << "Slice through r: " << endl << r(23,17,Range::all()) << endl; cout << "Slice through x: " << endl << x(23,17,Range::all()) << endl; cout << "Slice through rhs: " << endl << rhs(23,17,Range::all()) << endl; r *= -1.0; dump("r", r); // Allocate the descent direction arrays Array<T_numtype,N_rank> p, q; allocateArrays(x.shape(), p, q); int iteration = 0; int converged = 0; T_numtype rho = 0.; T_numtype oldrho = 0.; const int maxIterations = 1000; // Get views of interior of arrays (without boundaries) Array<T_numtype,N_rank> rint = r(interior); Array<T_numtype,N_rank> pint = p(interior); Array<T_numtype,N_rank> qint = q(interior); Array<T_numtype,N_rank> xint = x(interior); while (iteration < maxIterations) { rho = sum(r * r); if ((iteration % 20) == 0) cout << "CG: Iter " << iteration << "\t rho = " << rho << endl; // Check halting condition if (rho < haltrho) { converged = 1; break; } if (iteration == 0) { p = r; } else { T_numtype beta = rho / oldrho; p = beta * p + r; } q = 0.; // boundaryConditions.applyBCs(p); applyStencil(stencil, q, p); T_numtype pq = sum(p*q); T_numtype alpha = rho / pq; x += alpha * p; r -= alpha * q; oldrho = rho; ++iteration; } if (!converged) cout << "Warning: CG solver did not converge" << endl; return iteration; } BZ_NAMESPACE_END #endif // BZ_CGSOLVE_H
#ifndef __HEADER_HARDWARE_H #define __HEADER_HARDWARE_H #include "stm32f10x_conf.h" #include "fonts.h" /** @addtogroup Header Pin Assignment and ports. * @{ */ /** @brief SPI Pins pin configuration * @addtogroup Header Pin controls * @{ */ #define HEADER_SPI SPI1 #define HEADER_SPI_Cmd RCC_APB2Periph_SPI1 #define HEADER_PIN_MOSI GPIO_Pin_5 #define HEADER_PORT_MOSI GPIOB #define HEADER_PIN_MISO GPIO_Pin_4 #define HEADER_PORT_MISO GPIOB #define HEADER_PIN_SCK GPIO_Pin_3 #define HEADER_PORT_SCK GPIOB #define HEADER_SPI_PORT_CLK RCC_APB2Periph_GPIOB /** * @} * @brief Control Pins pin configuration * @addtogroup Header Pin controls * @{ */ #define VH_PIN GPIO_Pin_6 #define VH_PORT GPIOC #define LATCH_PIN GPIO_Pin_8 #define LATCH_PORT GPIOE #define PEM_PIN GPIO_Pin_9 #define PEM_PORT GPIOE #define STB1_PIN GPIO_Pin_10 #define STB1_PORT GPIOE #define STB2_PIN GPIO_Pin_11 #define STB2_PORT GPIOE #define STB3_PIN GPIO_Pin_12 #define STB3_PORT GPIOE #define STB4_PIN GPIO_Pin_13 #define STB4_PORT GPIOE #define STB5_PIN GPIO_Pin_14 #define STB5_PORT GPIOE #define STB6_PIN GPIO_Pin_15 #define STB6_PORT GPIOE #define HEADER_CRTL_PORT_CLK RCC_APB2Periph_GPIOE #define PH11_PIN GPIO_Pin_9 //IN1 pin at L293D #define PH11_PORT GPIOB #define PH12_PIN GPIO_Pin_8 //IN3 pin at L293D #define PH12_PORT GPIOD #define PH21_PIN GPIO_Pin_10 //IN2 pin at L293D #define PH21_PORT GPIOD #define PH22_PIN GPIO_Pin_9 //IN4 pin at L293D #define PH22_PORT GPIOD #define HEADER_M1CRTL_PORT_CLK RCC_APB2Periph_GPIOB #define HEADER_M2CRTL_PORT_CLK RCC_APB2Periph_GPIOD #define ENABLE1_PIN GPIO_Pin_7 #define ENABLE1_PORT GPIOC #define ENABLE2_PIN GPIO_Pin_11 #define ENABLE2_PORT GPIOD #define HEADER_E1CRTL_PORT_CLK RCC_APB2Periph_GPIOC #define HEADER_E2CRTL_PORT_CLK RCC_APB2Periph_GPIOD /** * @} */ #define HEADER_PORT_GROUP_B GPIOB #define HEADER_PORT_GROUP_C GPIOC #define HEADER_PORT_GROUP_D GPIOD #define HEADER_PORT_GROUP_E GPIOE /** * @} */ #define MOTOR_ENABLE1 GPIO_SetBits(ENABLE1_PORT,ENABLE1_PIN) #define MOTOR_ENABLE2 GPIO_SetBits(ENABLE2_PORT,ENABLE2_PIN) #define MOTOR_DISABLE1 GPIO_ResetBits(ENABLE1_PORT,ENABLE1_PIN) #define MOTOR_DISABLE2 GPIO_ResetBits(ENABLE2_PORT,ENABLE2_PIN) #define ENABLE_VH GPIO_SetBits(VH_PORT,VH_PIN) #define DISABLE_VH GPIO_ResetBits(VH_PORT,VH_PIN) #define LATCH_ENABLE GPIO_ResetBits(LATCH_PORT,LATCH_PIN) #define LATCH_DISABLE GPIO_SetBits(LATCH_PORT,LATCH_PIN) #define ASK4PAPER GPIO_ReadInputDataBit(PEM_PORT,PEM_PIN) #define ERROR_FEED_PITCH ((uint8_t) 0x01) #define IS_PAPER 0x01 #define NO_PAPER 0x00 #define FORWARD 0x00 #define BACKWARD 0x01 /** * @} * @brief Thermistor variables and definition * @addtogroup Thermistor * @{ */ #define THERMISTORPIN GPIO_Pin_0 #define THERMISTORPORT GPIOC #define RCCTHERMISTORPORT RCC_APB2Periph_GPIOC #define BCoefficent 3950 #define RthNominal 30000 #define TempNominal 25 #define ADCResolution 4096 #define SeriesResistor 10000 #define NumSamples 10 #define KELVIN 1 #define CELSIUS 0 /** * @} */ extern uint8_t Header_Init(void); extern void Init_ADC(void); extern void Init_PrinterSPI(void); extern void PrintDots(uint16_t *Array, uint8_t max) ; extern uint8_t feed_pitch(uint64_t lines, uint8_t forward_backward); extern void ClearPrinterBuffer(void); static void Motor_Stepper_Pos(uint8_t Position); static void Delay_motor(__IO uint32_t nCount); static void Printer_SendWorld(uint16_t World); #endif
/****************************************************************************** * * IG - Informática Gráfica * Grado en Ingeniería Informática * * 2014 - Ernesto Serrano <erseco@correo.ugr.es> * --------------------------------------------- * * Cabeceras del codigo del modelo, funciona tanto en linux como en mac * ******************************************************************************/ #ifndef _MODEL_ #define _MODEL_ #ifdef __MACH__ // Incluimos las librerías necesarias para que funcione en OSX #include <OpenGL/gl.h> #else #include <GL/gl.h> #endif #include <stdlib.h> // pulls in declaration of malloc, free #include <vector> #include <math.h> // Librerias matemáticas #include "jpg_imagen.hpp" // Librerias para texturas #include <vertex.h> using namespace std; class Model { protected: vector<_vertex3f> _vertices; vector<_vertex3i> _caras; void setVertices(vector<_vertex3f> vertex); void setFaces(vector<_vertex3i> faces); _vertex4f _color; // Informacion del color // int zoom; // Texturas GLuint ident_textura ;// 'nombre' o identif. de textura para OpenGL jpg::Imagen * imagen; // objeto con los bytes de la imagen de textura unsigned char id_objeto; vector<_vertex2f> _texturas; // aqui hay que meter el sI y sj vector<_vertex3f> _normales_vertices; public: Model() { x = 0; y = 0; z = 0; imagen = NULL; _color = _vertex4f(1.0,1.0,1.0,1.0); // zoom = 0; } void loadImage(const string & nombreArchivoJPG); void setColor(float r, float g, float b, float alpha) { _color = _vertex4f(r, g, b, alpha); } // Posicion central del objeto float x, y, z; void setCenter(float pX, float pY, float pZ) { x = pX; y = pY; z = pZ; }; // void setZoom(int value) // { // zoom = value; // } // Obtiene los vertices, se usa porque en determinados casos nos // pasamos los vertices de un modelo a otro (cargamos un ply y lo pasamos a uno de revolucion) vector<_vertex3f> getVertices(){ return _vertices; }; enum DrawMode { POINTS, LINES, SOLID, CHESS }; // Esta funcion pinta el modelo, como es virtual, es sobrecargable virtual void draw(DrawMode mode = SOLID); // Esta funcion procesa una letra en el modelo, sirve para extender el procesado // de teclas, de ahí que sea virtual virtual void process_key(unsigned char Tecla) {}; }; #endif
#ifndef OTPCOMMAND_H #define OTPCOMMAND_H #include "ICommand.h" #include "../Conn/Connection.h" #include "../Arg/BromOTPArg.h" namespace APCore { class OTPCommand: public ICommand { public: OTPCommand(APKey key); virtual ~OTPCommand(); void set_otp_file(const std::string &path) { this->path_ = path; } virtual void exec(const QSharedPointer<APCore::Connection> &conn); private: friend class OTPSetting; BromOTPArg otp_arg_; std::string path_; }; } #endif // OTPCOMMAND_H
///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2011-2012 Statoil ASA, Ceetron AS // // ResInsight 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. // // ResInsight 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 at <http://www.gnu.org/licenses/gpl.html> // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "cvfBase.h" #include "cvfObject.h" #include "cvfVector3.h" #include "cafPdmPointer.h" #include <list> #include "RigSingleWellResultsData.h" namespace cvf { class Part; class ModelBasicList; class Transform; class Effect; class DrawableGeo; class ScalarMapper; } class RivPipeGeometryGenerator; class RimReservoirView; class RimWell; class RivWellPipesPartMgr : public cvf::Object { public: RivWellPipesPartMgr(RimReservoirView* reservoirView, RimWell* well); ~RivWellPipesPartMgr(); void setScaleTransform(cvf::Transform * scaleTransform) { m_scaleTransform = scaleTransform; scheduleGeometryRegen();} void scheduleGeometryRegen() { m_needsTransformUpdate = true; } void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex); void updatePipeResultColor(size_t frameIndex); private: caf::PdmPointer<RimReservoirView> m_rimReservoirView; caf::PdmPointer<RimWell> m_rimWell; cvf::ref<cvf::Transform> m_scaleTransform; bool m_needsTransformUpdate; void buildWellPipeParts(); //void calculateWellPipeCenterline(std::vector<cvf::Vec3d>& coords) const; void calculateWellPipeCenterline(std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords, std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds ) const; void finishPipeCenterLine( std::vector< std::vector<cvf::Vec3d> > &pipeBranchesCLCoords, const cvf::Vec3d& lastCellCenter ) const; struct RivPipeBranchData { std::vector <RigWellResultPoint> m_cellIds; //std::vector< std::vector<WellCellStatus> > m_cellStatusPrFrame; cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator; cvf::ref<cvf::Part> m_surfacePart; cvf::ref<cvf::DrawableGeo> m_surfaceDrawable; cvf::ref<cvf::Part> m_centerLinePart; cvf::ref<cvf::DrawableGeo> m_centerLineDrawable; }; std::list<RivPipeBranchData> m_wellBranches; cvf::ref<cvf::ScalarMapper> m_scalarMapper; cvf::ref<cvf::Effect> m_scalarMapperSurfaceEffect; cvf::ref<cvf::Effect> m_scalarMapperMeshEffect; };
/* * Copyright(C) 2011-2016 Pedro H. Penna <pedrohenriquepenna@gmail.com> * 2016-2016 Davidson Francis <davidsondfgl@gmail.com> * * This file is part of Nanvix. * * Nanvix 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. * * Nanvix 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 Nanvix. If not, see <http://www.gnu.org/licenses/>. */ #include <nanvix/syscall.h> #include <stdlib.h> #include <signal.h> #include <errno.h> #include <reent.h> /* Forward definitions. */ extern void restorer(void); /* * Manages signal handling. */ sighandler_t signal(int sig, sighandler_t func) { sighandler_t ret; __asm__ volatile ( "int $0x80" : "=a" (ret) : "0" (NR_signal), "b" (sig), "c" (func), "d" (restorer) ); /* Error. */ if (ret == SIG_ERR) { errno = EINVAL; _REENT->_errno = EINVAL; return (SIG_ERR); } return (ret); }
/******************************************************************* * Copyright(c) 2000-2013 linghegu * All rights reserved. * Author: wangbin * Email: wang70bin@163.com * CreateTime: 2014/05/28 ******************************************************************/ #ifndef __MODULE_MONGOSWARE_CONNECTION_POOL_H__ #define __MODULE_MONGOSWARE_CONNECTION_POOL_H__ #include <queue> #include "mongodef.h" class DBConnection; class DBConnectionPool { public: DBConnectionPool(); ~DBConnectionPool(); public: /* *@conn_num: the number of connection in this poll *@address: like 127.0.0.1 , 127.0.0.1:5555 *@autoreconn: auto reconnect *@wrtimeoutsec: timeout of write/read * */ bool init_pool(int conn_num,const char* address,bool autoreconn,int wrtimeoutsec); DBConnection* get_free_connection(); void recycle_connection(DBConnection* con); private: std::queue<DBConnection*> db_conn_pool_; }; #endif
/* * Gearboy - Nintendo Game Boy Emulator * Copyright (C) 2012 Ignacio Sanchez * 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/ * */ #ifndef MBC3MEMORYRULE_H #define MBC3MEMORYRULE_H #include "MemoryRule.h" struct RTC_Registers { s32 Seconds; s32 Minutes; s32 Hours; s32 Days; s32 Control; s32 LatchedSeconds; s32 LatchedMinutes; s32 LatchedHours; s32 LatchedDays; s32 LatchedControl; s32 LastTime; s32 padding; }; class MBC3MemoryRule : public MemoryRule { public: MBC3MemoryRule(Processor* pProcessor, Memory* pMemory, Video* pVideo, Input* pInput, Cartridge* pCartridge, Audio* pAudio); virtual ~MBC3MemoryRule(); virtual u8 PerformRead(u16 address); virtual void PerformWrite(u16 address, u8 value); virtual void Reset(bool bCGB); virtual void SaveRam(std::ostream &file); virtual bool LoadRam(std::istream &file, s32 fileSize); virtual size_t GetRamSize(); virtual size_t GetRTCSize(); virtual u8* GetRamBanks(); virtual u8* GetCurrentRamBank(); virtual int GetCurrentRamBankIndex(); virtual u8* GetRomBank0(); virtual int GetCurrentRomBank0Index(); virtual u8* GetCurrentRomBank1(); virtual int GetCurrentRomBank1Index(); virtual u8* GetRTCMemory(); virtual void SaveState(std::ostream& stream); virtual void LoadState(std::istream& stream); private: void UpdateRTC(); private: int m_iCurrentRAMBank; int m_iCurrentROMBank; bool m_bRamEnabled; bool m_bRTCEnabled; u8* m_pRAMBanks; s32 m_iRTCLatch; u8 m_RTCRegister; s32 m_RTCLastTimeCache; int m_CurrentROMAddress; int m_CurrentRAMAddress; RTC_Registers m_RTC; }; #endif /* MBC3MEMORYRULE_H */
/*! * @file * @brief Short description. * * Long description. I would paste some Loren Ipsum rubbish here, but I'm afraid * It would stay that way. Not that this comment is by any means ingenious but * at least people can understand it. */ #pragma once #include "IRecognizer.h" #include "struct/SafeHash.h" #define ENGINE_NAME "DNS Recognizer" class IConnection; class IDNSCache; class DnsRecognizer: public IRecognizer { public: typedef SafeHash<const IConnection*, QVariant> CommentStore; DnsRecognizer(): mCache( NULL ) {}; inline const QString name() const { return ENGINE_NAME; }; virtual bool guess( const IConnection* connection ); virtual bool parse( IConnection* connection); virtual QVariant comment( IConnection* connection ) { return mComments.value( connection, "No comment" ); } virtual bool showDetails( IConnection* connection ); inline void setDnsCache( IDNSCache* cache ) { mCache = cache; }; private: const QString parsePacket( const QByteArray& data ) const; const QStringList parseQuestions( uint count, const QByteArray& data, uint& strpos ) const; const QStringList parseAnswers( uint count, const QByteArray& data, uint& strpos ) const; const QString parseName( const char* data, uint& pos, uint size, uint depth = 0 ) const; IDNSCache* mCache; CommentStore mComments; static const int DEFAULT_DEPTH = 5; };
/* * This file is part of Bipscript. * * Bipscript 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. * * Bipscript 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 Bipscript. If not, see <http://www.gnu.org/licenses/>. */ #ifndef BUFFEREVENT_H #define BUFFEREVENT_H #include "clip.h" #include "clock.h" #include "eventlist.h" #include "fevent.h" #include "transport.h" #include <map> #define BETL_UPDATE_MAX_EVENTS 32 // TODO: function of period size namespace bipscript { using transport::Clock; using transport::Transport; namespace audio { class BufferEvent : public FEvent { Buffer *mbuffer; public: BufferEvent(Buffer *buffer, float measure) : FEvent(measure), mbuffer(buffer) {} ~BufferEvent() { if(mbuffer->delref() == 0) { delete mbuffer; } } long end() { return start() + static_cast<long>(mbuffer->size()) - 1; } // index of last frame float *buffer(uint32_t start) { return mbuffer->data() + start; } }; /** * class that holds buffer events in a sorted list with associated clock * * methods allow accessing the events at the scheduled clock time */ class BufferEventTimeline : public Listable { boost::lockfree::spsc_queue<BufferEvent *> eventQueue; // script thread -> process thread EventList<BufferEvent> sortedEvents; // local to process thread List<BufferEvent> deletedEvents; bool eventsPending; Clock &clock; float updateMeasure; public: BufferEventTimeline(Clock &clock) : eventQueue(2048), clock(clock), updateMeasure(0.0) {} // script thread void add(BufferEvent *); // process thread void applyEvents(float *buffer); bool finished(); void clearEvents(); private: void update(); }; class BufferEventTimelineSet { std::map<Clock *, BufferEventTimeline *> timelines; BufferEventTimeline defaultTimeline; QueueList<BufferEventTimeline> activeList; public: BufferEventTimelineSet() : defaultTimeline(Clock::defaultClock()), activeList(16) { activeList.add(&defaultTimeline); } void add(BufferEvent *evt, Clock &clock) { BufferEventTimeline *timeline = timelines[&clock]; if(timeline == nullptr) { timeline = new BufferEventTimeline(clock); activeList.add(timeline); timelines[&clock] = timeline; } timeline->add(evt); } void add(BufferEvent *evt) { defaultTimeline.add(evt); } void addBufferEvents(float *buffer) { BufferEventTimeline *timeline = activeList.getFirst(); while(timeline) { timeline->applyEvents(buffer); timeline = activeList.getNext(timeline); } } bool active() { BufferEventTimeline *timeline = activeList.getFirst(); while(timeline) { if(!timeline->finished()) { return true; } timeline = activeList.getNext(timeline); } return false; } void clearEvents() { BufferEventTimeline *timeline = activeList.getFirst(); while(timeline) { timeline->clearEvents(); timeline = activeList.getNext(timeline); } } }; } } #endif // BUFFEREVENT_H
#include <stdio.h> main() { char c; char lengths[20]; /* limit to 20 words */ int wc; int i; int n; int last; /* indicate last written character */ wc = 0; lengths[wc] = 0; last = 1; while ((c = getchar()) != EOF) { if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) { if (last < 0) { wc++; lengths[wc] = 0; last = 1; } lengths[wc]++; } else { last = -1; /* set indicator for non-letters */ } } /* print the histogramm */ printf("word\tletters\thist\n"); for (i = 0; i <= wc; i++) { printf("%2i\t%2i\t", i, lengths[i]); for (n = 0; n < lengths[i]; n++) { printf("#"); } printf("\n"); } }
#ifndef BLOOM_H_ #define BLOOM_H_ #include "shared.h" struct bloom_params { int size; // bits in the bloom filter int bytesize; // ceil(size / 8) int nbit; // number of bits set per input key int keylen; // length of key, in bytes int bitperf; // bits consumed per F_i }; /* * Set up a cohort of Bloom filters. bloom_setup initializes shared state and * validates the settings. * * @sz: size of the Bloom bitarray, in bits. * @nb: number of bits set per key inserted into filter. * @kl: length of input keys, in bytes. */ struct bloom_params *bloom_setup(int sz, int nb, int kl); /* * Initialize a single filter given the established settings. * * @b: bitarray to initialize. Must be of the appropriate size. */ void bloom_init(struct bloom_params *p, u8 *b); /* Insert KEY into filter B. * * Returns 1 if the key collided with existing entries (that is, all of the bits * set due to B were already set). Returns 0 if B caused a bit to be set. */ int bloom_insert(struct bloom_params *p, u8 *b, const u8 *key); /* Check if KEY is present in filter B. * * Returns 1 if KEY may have been inserted (all of the bits set due to KEY are * set). Returns 0 if KEY was not inserted. */ int bloom_present(struct bloom_params *p, const u8 *b, const u8 *key); /* Dump debug info about bloom filter B under params P to F. */ void bloom_dump(struct bloom_params *p, const u8 *b, FILE *f, const u8 *key); /* Returns weight (number of bits set) of bloom filter B. */ int bloom_weight(struct bloom_params *p, const u8 *b); #endif /* BLOOM_H_ */
/* =========================================================================== Doom 3 GPL Source Code Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code"). Doom 3 Source Code 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. Doom 3 Source Code 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 Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #ifndef __roq_h__ #define __roq_h__ #include "gdefs.h" #include "roqParam.h" #include "quaddefs.h" #define JPEG_INTERNALS extern "C" { #include "../../../renderer/jpeg-6/jpeglib.h" } #pragma once class codec; class roqParam; class NSBitmapImageRep { public: NSBitmapImageRep( void ); NSBitmapImageRep( const char *filename ); NSBitmapImageRep( int wide, int high ); ~NSBitmapImageRep(); NSBitmapImageRep & operator=( const NSBitmapImageRep &a ); int samplesPerPixel( void ); int pixelsWide( void ); int pixelsHigh( void ); byte * bitmapData( void ); bool hasAlpha( void ); bool isPlanar( void ); private: byte * bmap; int width; int height; ID_TIME_T timestamp; }; class roq { public: roq(); ~roq(); //void WriteLossless( void ); void LoadAndDisplayImage( const char *filename ); void CloseRoQFile( bool which ); void InitRoQFile( const char *roqFilename ); void InitRoQPatterns( void ); void EncodeStream( const char *paramInputFile ); void EncodeQuietly( bool which ); bool IsQuiet( void ); bool IsLastFrame( void ); NSBitmapImageRep * CurrentImage( void ); void MarkQuadx( int xat, int yat, int size, float cerror, int choice ); void WritePuzzleFrame( quadcel *pquad ); void WriteFrame( quadcel *pquad ); void WriteCodeBook( byte *codebook ); void WwriteCodeBookToStream( byte *codes, int csize, word cflags ); int PreviousFrameSize( void ); bool MakingVideo( void ); bool ParamNoAlpha( void ); bool SearchType( void ); bool HasSound( void ); const char * CurrentFilename( void ); int NormalFrameSize( void ); int FirstFrameSize( void ); bool Scaleable( void ); void WriteHangFrame( void ); int NumberOfFrames( void ); private: void Write16Word( word *aWord, idFile *stream ); void Write32Word( unsigned int *aWord, idFile *stream ); int SizeFile( idFile *ftosize ); void CloseRoQFile( void ); void WriteCodeBookToStream( byte *codebook, int csize, word cflags ); #if 0 static void JPEGInitDestination( j_compress_ptr cinfo ); static boolean JPEGEmptyOutputBuffer( j_compress_ptr cinfo ); static void JPEGTermDestination( j_compress_ptr cinfo ); void JPEGStartCompress( j_compress_ptr cinfo, bool write_all_tables ); JDIMENSION JPEGWriteScanlines( j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines ); void JPEGDest( j_compress_ptr cinfo, byte* outfile, int size ); void JPEGSave( char * filename, int quality, int image_width, int image_height, unsigned char *image_buffer ); #endif codec * encoder; roqParam * paramFile; idFile * RoQFile; NSBitmapImageRep * image; int numQuadCels; bool quietMode; bool lastFrame; idStr roqOutfile; idStr currentFile; int numberOfFrames; int previousSize; byte codes[4096]; bool dataStuff; }; extern roq *theRoQ; // current roq #endif /* !__roq_h__ */
// Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool. If making changes by // hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // #ifndef CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_ #pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED #include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" #include "include/cef_client.h" #include "include/capi/cef_client_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefNavigationEntryVisitorCToCpp : public CefCToCpp<CefNavigationEntryVisitorCToCpp, CefNavigationEntryVisitor, cef_navigation_entry_visitor_t> { public: CefNavigationEntryVisitorCToCpp(); // CefNavigationEntryVisitor methods. bool Visit(CefRefPtr<CefNavigationEntry> entry, bool current, int index, int total) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_
/* * Copyright 2014-present by Andrew Ian William Griffin <griffin@beerdragon.co.uk> and McLeod Moores Software Limited. * See distribution for license. */ #pragma once #include "../core/core_h.h" class CFileWriter : public IFileWriter { private: volatile ULONG m_lRefCount; HANDLE m_hFile; ~CFileWriter (); public: CFileWriter (HANDLE hFile); // IUnknown HRESULT STDMETHODCALLTYPE QueryInterface ( /* [in] */ REFIID riid, /* [iid_is][out] */ _COM_Outptr_ void __RPC_FAR *__RPC_FAR *ppvObject); ULONG STDMETHODCALLTYPE AddRef (); ULONG STDMETHODCALLTYPE Release (); // IFileWriter HRESULT STDMETHODCALLTYPE Close (); HRESULT STDMETHODCALLTYPE Write ( /* [in] */ BYTE_SIZEDARR *pData); };
#include <swilib.h> //__inl //const char * _dlerror() //__def( 0x2F7, const char *) const char *dlerror(void) { return _dlerror(); }
/* * Copyright (c) 2013-2019 Thomas Isaac Lightburn * * * This file is part of OpenKJ. * * OpenKJ 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 DLGKEYCHANGE_H #define DLGKEYCHANGE_H #include <QDialog> #include "src/models/tablemodelqueuesongs.h" namespace Ui { class DlgKeyChange; } class DlgKeyChange : public QDialog { Q_OBJECT private: Ui::DlgKeyChange *ui; TableModelQueueSongs *qModel; int m_activeSong; public: explicit DlgKeyChange(TableModelQueueSongs *queueModel, QWidget *parent = 0); void setActiveSong(int songId); ~DlgKeyChange(); private slots: void on_buttonBox_accepted(); void on_spinBoxKey_valueChanged(int arg1); }; #endif // DLGKEYCHANGE_H
// ************************************************************************************************ // // qt-mvvm: Model-view-view-model framework for large GUI applications // //! @file mvvm/viewmodel/mvvm/editors/coloreditor.h //! @brief Defines class CLASS? //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) //! @copyright Forschungszentrum Jülich GmbH 2020 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS) // // ************************************************************************************************ #ifndef BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_COLOREDITOR_H #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_COLOREDITOR_H #include "mvvm/editors/customeditor.h" class QLabel; namespace ModelView { class LostFocusFilter; //! Custom editor for QVariant based on QColor. class MVVM_VIEWMODEL_EXPORT ColorEditor : public CustomEditor { Q_OBJECT public: explicit ColorEditor(QWidget* parent = nullptr); protected: void mousePressEvent(QMouseEvent* event) override; private: QColor currentColor() const; void update_components() override; QLabel* m_textLabel{nullptr}; QLabel* m_pixmapLabel{nullptr}; LostFocusFilter* m_focusFilter; }; } // namespace ModelView #endif // BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_COLOREDITOR_H
#ifndef ROOM_ORDER_WRITER_H #define ROOM_ORDER_WRITER_H #include "../Common_SMB1_Files/Level.h" #include <QByteArray> #include <QVector> #include <QFile> class Room_ID_Handler; class Level_Offset; class Room_Order_Writer { public: Room_Order_Writer(QFile *file, Level_Offset *levelOffset, Room_ID_Handler *roomIDHandler); ~Room_Order_Writer(); bool Read_Room_Order_Table(); bool Write_Room_Order_Table(); bool Set_Next_Level(Level::Level level); QVector<unsigned char> *Get_Midpoints_From_Room_Order_Table(unsigned char id); private: bool Write_Bytes_To_Offset(qint64 offset, const QByteArray &bytes); void Populate_Midpoint_Indexes_In_Handler(); bool Fix_Room_Order_Table_Header(); bool Scan_Level_For_End_Objects(Level::Level level, bool &endOfWorld); QFile *file; Room_ID_Handler *roomIDHandler; Level_Offset *levelOffset; QByteArray *buffer; int currentByte; friend class Room_ID_Handler; }; #endif // ROOM_ORDER_WRITER_H
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ /*************************************************************************** * nc_reduced_shear_calib_wtg.h * * Tue December 04 23:47:36 2018 * Copyright 2018 Mariana Penna Lima * <pennalima@gmail.com> ****************************************************************************/ /* * nc_reduced_shear_calib_wtg.h * Copyright (C) 2018 Mariana Penna Lima <pennalima@gmail.com> * * numcosmo 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. * * numcosmo 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 _NC_REDUCED_SHEAR_CALIB_WTG_H_ #define _NC_REDUCED_SHEAR_CALIB_WTG_H_ #include <glib.h> #include <glib-object.h> #include <numcosmo/build_cfg.h> #include <numcosmo/math/ncm_mset.h> #include <numcosmo/math/ncm_model.h> #include <numcosmo/lss/nc_reduced_shear_calib.h> G_BEGIN_DECLS #define NC_TYPE_REDUCED_SHEAR_CALIB_WTG (nc_reduced_shear_calib_wtg_get_type ()) #define NC_REDUCED_SHEAR_CALIB_WTG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NC_TYPE_REDUCED_SHEAR_CALIB_WTG, NcReducedShearCalibWtg)) #define NC_REDUCED_SHEAR_CALIB_WTG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NC_TYPE_REDUCED_SHEAR_CALIB_WTG, NcReducedShearCalibWtgClass)) #define NC_IS_REDUCED_SHEAR_CALIB_WTG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NC_TYPE_REDUCED_SHEAR_CALIB_WTG)) #define NC_IS_REDUCED_SHEAR_CALIB_WTG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NC_TYPE_REDUCED_SHEAR_CALIB_WTG)) #define NC_REDUCED_SHEAR_CALIB_WTG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NC_TYPE_REDUCED_SHEAR_CALIB_WTG, NcReducedShearCalibWtgClass)) typedef struct _NcReducedShearCalibWtgClass NcReducedShearCalibWtgClass; typedef struct _NcReducedShearCalibWtg NcReducedShearCalibWtg; typedef struct _NcReducedShearCalibWtgPrivate NcReducedShearCalibWtgPrivate; struct _NcReducedShearCalibWtgClass { /*< private >*/ NcReducedShearCalibClass parent_class; }; struct _NcReducedShearCalibWtg { /*< private >*/ NcReducedShearCalib parent_instance; NcReducedShearCalibWtgPrivate *priv; }; /** * NcReducedShearCalibWtgSParams: * @NC_REDUCED_SHEAR_CALIB_WTG_MSLOPE: FIXME * @NC_REDUCED_SHEAR_CALIB_WTG_MB: FIXME * @NC_REDUCED_SHEAR_CALIB_WTG_C: FIXME * @NC_REDUCED_SHEAR_CALIB_WTG_SIZE_RATIO: ratio between galaxy and psf sizes * * WtG calibration parameters. * */ typedef enum _NcReducedShearCalibWtgSParams { NC_REDUCED_SHEAR_CALIB_WTG_MSLOPE, NC_REDUCED_SHEAR_CALIB_WTG_MB, NC_REDUCED_SHEAR_CALIB_WTG_C, NC_REDUCED_SHEAR_CALIB_WTG_SIZE_RATIO, /* < private > */ NNC_REDUCED_SHEAR_CALIB_WTG_SPARAM_LEN, /*< skip >*/ } NcReducedShearCalibWtgSParams; GType nc_reduced_shear_calib_wtg_get_type (void) G_GNUC_CONST; NcReducedShearCalibWtg *nc_reduced_shear_calib_wtg_new (void); NcReducedShearCalibWtg *nc_reduced_shear_calib_wtg_ref (NcReducedShearCalibWtg *rs_wtg); void nc_reduced_shear_calib_wtg_free (NcReducedShearCalibWtg *rs_wtg); void nc_reduced_shear_calib_wtg_clear (NcReducedShearCalibWtg **rs_wtg); G_END_DECLS #endif /* _NC_REDUCED_SHEAR_CALIB_WTG_H_ */
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Assistant of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef BOOKMARKMANAGER_H #define BOOKMARKMANAGER_H #include <QtCore/QMutex> #include <QtWidgets/QTreeView> #include "ui_bookmarkwidget.h" QT_BEGIN_NAMESPACE class BookmarkManagerWidget; class BookmarkModel; class BookmarkFilterModel; class QKeyEvent; class QSortFilterProxyModel; class QToolBar; class BookmarkManager : public QObject { Q_OBJECT class BookmarkWidget; class BookmarkTreeView; class BookmarkListView; Q_DISABLE_COPY(BookmarkManager); public: static BookmarkManager* instance(); static void destroy(); QWidget* bookmarkDockWidget() const; void setBookmarksMenu(QMenu* menu); void setBookmarksToolbar(QToolBar *toolBar); public slots: void addBookmark(const QString &title, const QString &url); signals: void escapePressed(); void setSource(const QUrl &url); void setSourceInNewTab(const QUrl &url); private: BookmarkManager(); ~BookmarkManager(); void removeItem(const QModelIndex &index); bool eventFilter(QObject *object, QEvent *event) override; void buildBookmarksMenu(const QModelIndex &index, QMenu *menu); void showBookmarkDialog(const QString &name, const QString &url); private slots: void setupFinished(); void addBookmarkActivated(); void removeBookmarkActivated(); void manageBookmarks(); void refreshBookmarkMenu(); void refreshBookmarkToolBar(); void renameBookmark(const QModelIndex &index); void setSourceFromAction(); void setSourceFromIndex(const QModelIndex &index, bool newTab); void focusInEventOccurred(); void managerWidgetAboutToClose(); void textChanged(const QString &text); void customContextMenuRequested(const QPoint &point); private: bool typeAndSearch; static QMutex mutex; static BookmarkManager *bookmarkManager; QMenu *bookmarkMenu; QToolBar *m_toolBar; BookmarkModel *bookmarkModel; BookmarkFilterModel *bookmarkFilterModel; QSortFilterProxyModel *typeAndSearchModel; BookmarkWidget *bookmarkWidget; BookmarkTreeView *bookmarkTreeView; BookmarkManagerWidget *bookmarkManagerWidget; }; class BookmarkManager::BookmarkWidget : public QWidget { Q_OBJECT public: BookmarkWidget(QWidget *parent = 0) : QWidget(parent) { ui.setupUi(this); } virtual ~BookmarkWidget() {} Ui::BookmarkWidget ui; signals: void focusInEventOccurred(); private: void focusInEvent(QFocusEvent *event) override; }; class BookmarkManager::BookmarkTreeView : public QTreeView { Q_OBJECT public: BookmarkTreeView(QWidget *parent = 0); ~BookmarkTreeView() {} void subclassKeyPressEvent(QKeyEvent *event); private slots: void setExpandedData(const QModelIndex &index); }; QT_END_NAMESPACE #endif // BOOKMARKMANAGER_H
#ifndef PROTOCOL_WAYLAND_H #define PROTOCOL_WAYLAND_H //****************************************************************************** //this code is protected by the GNU affero GPLv3 //author:Sylvain BERTRAND <sylvain.bertrand AT gmail dot com> // <digital.ragnarok AT gmail dot com> //****************************************************************************** //names reference global objects on the server //ids reference "client binded" objects #define WL_INVALID_STR "wl_invalid" #define WL_INVALID_STR_DWS 3 #define WL_INVALID 0 #define WL_DISPLAY 1 #define WL_CALLBACK 2 #define WL_COMPOSITOR 3 #define WL_REGISTRY 4 #define WL_SHM 5 #define WL_SHM_POOL 6 #define WL_BUFFER 7 #define WL_SEAT 8 #define WL_OUTPUT 9 #define WL_KEYBOARD 10 #define WL_POINTER 11 #define WL_SURFACE 12 #define WL_REGION 13 #define WL_DATA_DEVICE_MANAGER 14 #define WL_SHELL 15 #define WL_SHELL_SURFACE 16 #define WL_UNKNOWN 17 #ifdef WAYLAND_C void *wl_itfs_strs[]={ [WL_INVALID]=WL_INVALID_STR, [WL_DISPLAY]=WL_DISPLAY_STR, [WL_CALLBACK]=WL_CALLBACK_STR, [WL_COMPOSITOR]=WL_COMPOSITOR_STR, [WL_REGISTRY]=WL_REGISTRY_STR, [WL_SHM]=WL_SHM_STR, [WL_SHM_POOL]=WL_SHM_POOL_STR, [WL_BUFFER]=WL_BUFFER_STR, [WL_SEAT]=WL_SEAT_STR, [WL_OUTPUT]=WL_OUTPUT_STR, [WL_KEYBOARD]=WL_KEYBOARD_STR, [WL_POINTER]=WL_POINTER_STR, [WL_SURFACE]=WL_SURFACE_STR, [WL_REGION]=WL_REGION_STR, [WL_DATA_DEVICE_MANAGER]=WL_DATA_DEVICE_MANAGER_STR, [WL_SHELL]=WL_SHELL_STR, [WL_SHELL_SURFACE]=WL_SHELL_SURFACE_STR }; u8 wl_itfs_strs_sz[]={ [WL_INVALID]=sizeof(WL_INVALID_STR), [WL_DISPLAY]=sizeof(WL_DISPLAY_STR), [WL_CALLBACK]=sizeof(WL_CALLBACK_STR), [WL_COMPOSITOR]=sizeof(WL_COMPOSITOR_STR), [WL_REGISTRY]=sizeof(WL_REGISTRY_STR), [WL_SHM]=sizeof(WL_SHM_STR), [WL_SHM_POOL]=sizeof(WL_SHM_POOL_STR), [WL_BUFFER]=sizeof(WL_BUFFER_STR), [WL_SEAT]=sizeof(WL_SEAT_STR), [WL_OUTPUT]=sizeof(WL_OUTPUT_STR), [WL_KEYBOARD]=sizeof(WL_KEYBOARD_STR), [WL_POINTER]=sizeof(WL_POINTER_STR), [WL_SURFACE]=sizeof(WL_SURFACE_STR), [WL_REGION]=sizeof(WL_REGION_STR), [WL_DATA_DEVICE_MANAGER]=sizeof(WL_DATA_DEVICE_MANAGER_STR), [WL_SHELL]=sizeof(WL_SHELL_STR), [WL_SHELL_SURFACE]=sizeof(WL_SHELL_SURFACE_STR) }; u8 wl_itfs_strs_dws[]={ [WL_INVALID]=WL_INVALID_STR_DWS, [WL_DISPLAY]=WL_DISPLAY_STR_DWS, [WL_CALLBACK]=WL_CALLBACK_STR_DWS, [WL_COMPOSITOR]=WL_COMPOSITOR_STR_DWS, [WL_REGISTRY]=WL_REGISTRY_STR_DWS, [WL_SHM]=WL_SHM_STR_DWS, [WL_SHM_POOL]=WL_SHM_POOL_STR_DWS, [WL_BUFFER]=WL_BUFFER_STR_DWS, [WL_SEAT]=WL_SEAT_STR_DWS, [WL_OUTPUT]=WL_OUTPUT_STR_DWS, [WL_KEYBOARD]=WL_KEYBOARD_STR_DWS, [WL_POINTER]=WL_POINTER_STR_DWS, [WL_SURFACE]=WL_SURFACE_STR_DWS, [WL_REGION]=WL_REGION_STR_DWS, [WL_DATA_DEVICE_MANAGER]=WL_DATA_DEVICE_MANAGER_STR_DWS, [WL_SHELL]=WL_SHELL_STR_DWS, [WL_SHELL_SURFACE]=WL_SHELL_SURFACE_STR_DWS }; #else extern void *wl_itfs_strs[]; extern u8 wl_itfs_strs_sz[]; extern u8 wl_itfs_strs_dws[]; #endif //data_device_manager is the biggest #define WL_ITFS_STRS_DWS_MAX WL_DATA_DEVICE_MANAGER_STR_DWS #ifdef __GNUC__ # define UNUSED __attribute__ ((unused)) #else # define UNUSED #endif static UNUSED u8 wl_strn2itf(void *s,u64 n) { if(!strncmp(s,WL_DISPLAY_STR,n)) return WL_DISPLAY; else if(!strncmp(s,WL_CALLBACK_STR,n)) return WL_CALLBACK; else if(!strncmp(s,WL_COMPOSITOR_STR,n)) return WL_COMPOSITOR; else if(!strncmp(s,WL_REGISTRY_STR,n)) return WL_REGISTRY; else if(!strncmp(s,WL_SHM_STR,n)) return WL_SHM; else if(!strncmp(s,WL_SHM_POOL_STR,n)) return WL_SHM_POOL; else if(!strncmp(s,WL_BUFFER_STR,n)) return WL_BUFFER; else if(!strncmp(s,WL_SEAT_STR,n)) return WL_SEAT; else if(!strncmp(s,WL_OUTPUT_STR,n)) return WL_OUTPUT; else if(!strncmp(s,WL_KEYBOARD_STR,n)) return WL_KEYBOARD; else if(!strncmp(s,WL_POINTER_STR,n)) return WL_POINTER; else if(!strncmp(s,WL_SURFACE_STR,n)) return WL_SURFACE; else if(!strncmp(s,WL_REGION_STR,n)) return WL_REGION; else if(!strncmp(s,WL_DATA_DEVICE_MANAGER_STR,n)) return WL_DATA_DEVICE_MANAGER; else if(!strncmp(s,WL_SHELL_STR,n)) return WL_SHELL; else if(!strncmp(s,WL_SHELL_SURFACE_STR,n)) return WL_SHELL_SURFACE; return WL_UNKNOWN; } #undef UNUSED #endif
#ifndef HAM_STATE_H #define HAM_STATE_H #include <string> #include <vector> #include <set> #include <stdint.h> #include <stdlib.h> #include <bitset> #include "text.h" #include "emission.h" #include "transitions.h" #include "yaml-cpp/yaml.h" using namespace std; namespace ham { class Transition; class State { public: State(); void Parse(YAML::Node node, vector<string> state_names, Track *track); void RescaleOverallMuteFreq(double factor); // Rescale emissions by the ratio <factor> void UnRescaleOverallMuteFreq(); // undo the above ~State(); inline string name() { return name_; } inline string abbreviation() { return name_.substr(0, 1); } inline size_t index() { return index_; } // index of this state in the HMM model inline vector<Transition*> *transitions() { return transitions_; } inline bitset<STATE_MAX> *to_states() { return &to_states_; } inline bitset<STATE_MAX> *from_states() { return &from_states_; } inline vector<size_t> *from_state_indices() { return &from_state_indices_; } inline Transition *transition(size_t iter) { return (*transitions_)[iter]; } inline Transition *trans_to_end() { return trans_to_end_; } double EmissionLogprob(uint8_t ch); double EmissionLogprob(Sequences *seqs, size_t pos); inline double transition_logprob(size_t to_state) { return (*transitions_)[to_state]->log_prob(); } double end_transition_logprob(); // property-setters for use in model::finalize() inline void AddToState(State *st) { to_states_[st->index()] = 1; } // set bit in <to_states_> corresponding to <st> inline void AddFromState(State *st) { from_states_[st->index()] = 1; } // set bit in <from_states_> corresponding to <st> inline void SetIndex(size_t val) { index_ = val; } void ReorderTransitions(map<string, State*>& state_indices); void SetFromStateIndices(); void Print(); private: string name_, germline_nuc_; double ambiguous_emission_logprob_; string ambiguous_char_; vector<Transition*> *transitions_; Transition *trans_to_end_; Emission emission_; // hmm model-level information (assigned in model::finalize) size_t index_; // position of this state in the vector model::states_ (set in model::finalize) bitset<STATE_MAX> to_states_; bitset<STATE_MAX> from_states_; vector<size_t> from_state_indices_; // same information as <from_states_>, but hopefully faster to iterate over }; } #endif
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include <ctype.h> #include <unistd.h> #include <getopt.h> #include <sys/time.h> #include <math.h> //#include "dbench.h" #include "nfs.h" #include "mount.h" #include "libnfs.h" #include "comm.h" int main(int argc, char **argv) { char *hostname, *directory, *filename; nfsstat3 nfs_status; struct nfsio * nfsio; /* hostname directory pathname */ if (argc < 4) { printf("Not enough arguments to %s\n", argv[0]); printf("Usage: %s hostname exportdir filename\n", argv[0]); exit(1); } hostname = argv[1]; directory = argv[2]; filename = argv[3]; /* Connect */ nfsio = nfs_connect(hostname, directory); if (nfsio == NULL) { printf("FAIL: Could not connect to server\n"); return -1; } nfs_status = nfsio_create(nfsio, filename); if (nfs_status != NFS3_OK) { printf ("FAIL: Could not create file: %d\n", nfs_status); print_nfs_status(nfs_status); return -1; } /* Disconnect */ if (nfsio != NULL) nfsio_disconnect(nfsio); return 0; }
#include <stdlib.h> #include "mean.h" int mean(int size, int *values, double *result) { int i; int sum; if ( (values == NULL) || (result == NULL) || (size<0) ) { return 1; } sum=0; for (i=0; i<size; i++) { sum += values[i]; } *result = ((double)sum)/size; return 0; }
/* -*- c++ -*- */ /* * Copyright 2015 <+YOU OR YOUR COMPANY+>. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_PMT_CPP_ACK_H #define INCLUDED_PMT_CPP_ACK_H #include <pmt_cpp/api.h> #include <gnuradio/block.h> namespace gr { namespace pmt_cpp { /*! * \brief <+description of block+> * \ingroup pmt_cpp * */ class PMT_CPP_API ACK : virtual public gr::block { public: typedef boost::shared_ptr<ACK> sptr; /*! * \brief Return a shared_ptr to a new instance of pmt_cpp::ACK. * * To avoid accidental use of raw pointers, pmt_cpp::ACK's * constructor is in a private implementation * class. pmt_cpp::ACK::make is the public interface for * creating new instances. */ static sptr make(); }; } // namespace pmt_cpp } // namespace gr #endif /* INCLUDED_PMT_CPP_ACK_H */
fprintf(stderr, "%s/%s()/%d\n", __FILE__, __FUNCTION__, __LINE__ );
// Copyright (C) Explorer++ Project // SPDX-License-Identifier: GPL-3.0-only // See LICENSE in the top level directory #pragma once // The CustomGripper control uses the appropriate functions provided by Windows to draw the size // grip shown in the bottom right corner of a window. namespace CustomGripper { inline const TCHAR CLASS_NAME[] = L"CustomGripper"; void Initialize(HWND mainWindow, COLORREF backgroundColor); SIZE GetDpiScaledSize(HWND parentWindow); }
/* AUTHOR: Destan Sarpkaya - 2012 destan@dorukdestan.com LICENSE: Cevirgec 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. Cevirgec 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 Cevirgec. If not, see <http://www.gnu.org/licenses/>. */ #ifndef EDITDICTIONARYDIALOG_H #define EDITDICTIONARYDIALOG_H #include <QDialog> #include "core/Dictionary.h" namespace Ui { class EditDictionaryDialog; } class EditDictionaryDialog : public QDialog { Q_OBJECT public: explicit EditDictionaryDialog(QWidget *parent = 0); ~EditDictionaryDialog(); void clear(); int showAddDialog(); void showUpdateDialog(QByteArray dictionaryHash); public slots: void accept(); protected: void changeEvent(QEvent *e); private: Ui::EditDictionaryDialog *ui; bool isUpdateMode; QVariantMap m_dictionaryMap; void fillFields(); }; #endif // EDITDICTIONARYDIALOG_H
/*************************************************************************** * This file is part of the Lime Report project * * Copyright (C) 2015 by Alexander Arin * * arin_a@bk.ru * * * ** 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 LRIMAGEEDITOR_H #define LRIMAGEEDITOR_H #include <QPushButton> #include <QWidget> namespace LimeReport { class ImageEditor : public QWidget { Q_OBJECT public: ImageEditor(QWidget *parent = 0); QImage image(); void setImage(const QImage &image) { m_image = image; } signals: void editingFinished(); private slots: void slotButtonClicked(); void slotClearButtonClicked(); private: QPushButton m_button; QPushButton m_clearButton; QImage m_image; }; } // namespace LimeReport #endif // LRIMAGEEDITOR_H
/* Copyright (C) 2018 Magnus Lång and Tuan Phong Ngo * This benchmark is part of SWSC */ #include <assert.h> #include <stdint.h> #include <stdatomic.h> #include <pthread.h> atomic_int vars[2]; atomic_int atom_1_r1_1; atomic_int atom_2_r1_3; void *t0(void *arg){ label_1:; atomic_store_explicit(&vars[0], 2, memory_order_seq_cst); int v2_r3 = atomic_load_explicit(&vars[1], memory_order_seq_cst); atomic_store_explicit(&vars[1], 1, memory_order_seq_cst); atomic_store_explicit(&vars[1], 3, memory_order_seq_cst); return NULL; } void *t1(void *arg){ label_2:; int v4_r1 = atomic_load_explicit(&vars[1], memory_order_seq_cst); atomic_store_explicit(&vars[1], 2, memory_order_seq_cst); int v18 = (v4_r1 == 1); atomic_store_explicit(&atom_1_r1_1, v18, memory_order_seq_cst); return NULL; } void *t2(void *arg){ label_3:; int v6_r1 = atomic_load_explicit(&vars[1], memory_order_seq_cst); int v7_r3 = v6_r1 ^ v6_r1; int v8_r3 = v7_r3 + 1; atomic_store_explicit(&vars[0], v8_r3, memory_order_seq_cst); int v19 = (v6_r1 == 3); atomic_store_explicit(&atom_2_r1_3, v19, memory_order_seq_cst); return NULL; } int main(int argc, char *argv[]){ pthread_t thr0; pthread_t thr1; pthread_t thr2; atomic_init(&vars[0], 0); atomic_init(&vars[1], 0); atomic_init(&atom_1_r1_1, 0); atomic_init(&atom_2_r1_3, 0); pthread_create(&thr0, NULL, t0, NULL); pthread_create(&thr1, NULL, t1, NULL); pthread_create(&thr2, NULL, t2, NULL); pthread_join(thr0, NULL); pthread_join(thr1, NULL); pthread_join(thr2, NULL); int v9 = atomic_load_explicit(&vars[1], memory_order_seq_cst); int v10 = (v9 == 3); int v11 = atomic_load_explicit(&atom_1_r1_1, memory_order_seq_cst); int v12 = atomic_load_explicit(&vars[0], memory_order_seq_cst); int v13 = (v12 == 2); int v14 = atomic_load_explicit(&atom_2_r1_3, memory_order_seq_cst); int v15_conj = v13 & v14; int v16_conj = v11 & v15_conj; int v17_conj = v10 & v16_conj; if (v17_conj == 1) assert(0); return 0; }
/* * CMysqlHandler.h * * Created on: 2017年2月13日 * Author: jugo */ #pragma once #include <mysql/mysql.h> #include <string> #include <list> #include <map> #include <set> class CMysqlHandler { public: CMysqlHandler(); virtual ~CMysqlHandler(); int connect(std::string strHost, std::string strDB, std::string strUser, std::string strPassword, const char *szConnTimeout = "5"); void close(); int sqlExec(std::string strSQL); int query(std::string strSQL, std::list<std::map<std::string, std::string> > &listRest); std::string getLastError(); int getLastErrorNo(); int getFields(std::string strTableName, std::set<std::string> &sFields); bool isValid(); private: void setError(std::string strMsg); private: std::string mstrLastError; int mnLastErrorNo; MYSQL *mpMySQL; };
// Copyright (c) the JPEG XL Project Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #ifndef LIB_JXL_BASE_COMPILER_SPECIFIC_H_ #define LIB_JXL_BASE_COMPILER_SPECIFIC_H_ // Macros for compiler version + nonstandard keywords, e.g. __builtin_expect. #include <stdint.h> // #if is shorter and safer than #ifdef. *_VERSION are zero if not detected, // otherwise 100 * major + minor version. Note that other packages check for // #ifdef COMPILER_MSVC, so we cannot use that same name. #ifdef _MSC_VER #define JXL_COMPILER_MSVC _MSC_VER #else #define JXL_COMPILER_MSVC 0 #endif #ifdef __GNUC__ #define JXL_COMPILER_GCC (__GNUC__ * 100 + __GNUC_MINOR__) #else #define JXL_COMPILER_GCC 0 #endif #ifdef __clang__ #define JXL_COMPILER_CLANG (__clang_major__ * 100 + __clang_minor__) // Clang pretends to be GCC for compatibility. #undef JXL_COMPILER_GCC #define JXL_COMPILER_GCC 0 #else #define JXL_COMPILER_CLANG 0 #endif #if JXL_COMPILER_MSVC #define JXL_RESTRICT __restrict #elif JXL_COMPILER_GCC || JXL_COMPILER_CLANG #define JXL_RESTRICT __restrict__ #else #define JXL_RESTRICT #endif #if JXL_COMPILER_MSVC #define JXL_INLINE __forceinline #define JXL_NOINLINE __declspec(noinline) #else #define JXL_INLINE inline __attribute__((always_inline)) #define JXL_NOINLINE __attribute__((noinline)) #endif #if JXL_COMPILER_MSVC #define JXL_NORETURN __declspec(noreturn) #elif JXL_COMPILER_GCC || JXL_COMPILER_CLANG #define JXL_NORETURN __attribute__((noreturn)) #endif #if JXL_COMPILER_MSVC #define JXL_UNREACHABLE __assume(false) #elif JXL_COMPILER_CLANG || JXL_COMPILER_GCC >= 405 #define JXL_UNREACHABLE __builtin_unreachable() #else #define JXL_UNREACHABLE #endif #if JXL_COMPILER_MSVC #define JXL_MAYBE_UNUSED #else // Encountered "attribute list cannot appear here" when using the C++17 // [[maybe_unused]], so only use the old style attribute for now. #define JXL_MAYBE_UNUSED __attribute__((unused)) #endif #if JXL_COMPILER_MSVC // Unsupported, __assume is not the same. #define JXL_LIKELY(expr) expr #define JXL_UNLIKELY(expr) expr #else #define JXL_LIKELY(expr) __builtin_expect(!!(expr), 1) #define JXL_UNLIKELY(expr) __builtin_expect(!!(expr), 0) #endif #if JXL_COMPILER_MSVC #include <intrin.h> #pragma intrinsic(_ReadWriteBarrier) #define JXL_COMPILER_FENCE _ReadWriteBarrier() #elif JXL_COMPILER_GCC || JXL_COMPILER_CLANG #define JXL_COMPILER_FENCE asm volatile("" : : : "memory") #else #define JXL_COMPILER_FENCE #endif // Returns a void* pointer which the compiler then assumes is N-byte aligned. // Example: float* JXL_RESTRICT aligned = (float*)JXL_ASSUME_ALIGNED(in, 32); // // The assignment semantics are required by GCC/Clang. ICC provides an in-place // __assume_aligned, whereas MSVC's __assume appears unsuitable. #if JXL_COMPILER_CLANG // Early versions of Clang did not support __builtin_assume_aligned. #define JXL_HAS_ASSUME_ALIGNED __has_builtin(__builtin_assume_aligned) #elif JXL_COMPILER_GCC #define JXL_HAS_ASSUME_ALIGNED 1 #else #define JXL_HAS_ASSUME_ALIGNED 0 #endif #if JXL_HAS_ASSUME_ALIGNED #define JXL_ASSUME_ALIGNED(ptr, align) __builtin_assume_aligned((ptr), (align)) #else #define JXL_ASSUME_ALIGNED(ptr, align) (ptr) /* not supported */ #endif #ifdef __has_attribute #define JXL_HAVE_ATTRIBUTE(x) __has_attribute(x) #else #define JXL_HAVE_ATTRIBUTE(x) 0 #endif // Raises warnings if the function return value is unused. Should appear as the // first part of a function definition/declaration. #if JXL_HAVE_ATTRIBUTE(nodiscard) #define JXL_MUST_USE_RESULT [[nodiscard]] #elif JXL_COMPILER_CLANG && JXL_HAVE_ATTRIBUTE(warn_unused_result) #define JXL_MUST_USE_RESULT __attribute__((warn_unused_result)) #else #define JXL_MUST_USE_RESULT #endif // Disable certain -fsanitize flags for functions that are expected to include // things like unsigned integer overflow. For example use in the function // declaration JXL_NO_SANITIZE("unsigned-integer-overflow") to silence unsigned // integer overflow ubsan messages. #if JXL_COMPILER_CLANG && JXL_HAVE_ATTRIBUTE(no_sanitize) #define JXL_NO_SANITIZE(X) __attribute__((no_sanitize(X))) #else #define JXL_NO_SANITIZE(X) #endif #if JXL_HAVE_ATTRIBUTE(__format__) #define JXL_FORMAT(idx_fmt, idx_arg) \ __attribute__((__format__(__printf__, idx_fmt, idx_arg))) #else #define JXL_FORMAT(idx_fmt, idx_arg) #endif #if JXL_COMPILER_MSVC using ssize_t = intptr_t; #endif #endif // LIB_JXL_BASE_COMPILER_SPECIFIC_H_
/* * (C) 2013 Varun Mittal <varunmittal91@gmail.com> * NeweraHPC program is distributed under the terms of the GNU General Public License v3 * * This file is part of NeweraHPC. * * NeweraHPC is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation version 3 of the License. * * NeweraHPC 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 NeweraHPC. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _CONNECTION_H_ #define _CONNECTION_H_ #include <poll.h> #include "neweraHPC.h" //#define CONNECTION_BACKLOG 551 static int connection_backlog = 551; #define BUFFER_SIZE 10000 #define NHPC_BUFFER_EMPTY 0 #define NHPC_BUFFER_FULL 1 #define NHPC_BUFFER_LOCKED 2 #define NHPC_CONNECTION_OCCUPIED 1 #define NHPC_CONNECTION_READING 2 #define NHPC_CONNECTION_WRITING 4 #define NHPC_CONNECTION_ENABLE_READ 8 #define NHPC_CONNECTION_ENABLE_WRITE 16 #define NHPC_CONNECTION_CLOSE 32 struct nhpc_peer_addr_t { char addr[16]; char port[6]; }; struct nhpc_connection_s { nhpc_socket_t socket; nhpc_peer_addr_t peer; nhpc_listening_t *ls; nhpc_event_t rev; nhpc_event_t wev; nhpc_pool_t *pool; nhpc_communication_t *communication; }; struct nhpc_listening_s { nhpc_socket_t socket; nhpc_peer_addr_t host; nhpc_pool_t *pool; nhpc_stack_t *connections_stack; nhpc_int_t nconnections; nhpc_event_t lsev; nhpc_rbtree_t *network_addons; int backlog; }; #define nhpc_lock_listening_connection(ls, m) (nhpc_mutex_lock(&(ls)->mutex, m)) #define nhpc_unlock_listening_connection(ls, m) (nhpc_mutex_unlock(&(ls)->mutex, m)) void nhpc_get_addr_info(nhpc_connection_t *c); void nhpc_init_listening(nhpc_listening_t *ls); void nhpc_destroy_listeneing(nhpc_listening_t *ls); nhpc_status_t nhpc_init_connections(nhpc_config_t *config); void nhpc_init_connection(nhpc_connection_t *c); void nhpc_destroy_connection(nhpc_connection_t *c); void nhpc_shutdown_connection(nhpc_connection_t *c, int how); void nhpc_close_connection(nhpc_connection_t *c); #endif