hexsha
stringlengths
40
40
size
int64
22
2.4M
ext
stringclasses
5 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
260
max_stars_repo_name
stringlengths
5
109
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
260
max_issues_repo_name
stringlengths
5
109
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
260
max_forks_repo_name
stringlengths
5
109
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
22
2.4M
avg_line_length
float64
5
169k
max_line_length
int64
5
786k
alphanum_fraction
float64
0.06
0.95
matches
listlengths
1
11
701c5ddf3c55ef5d49a7827417baecaa601f4139
712
h
C
Source/Game/SkyBox.h
Batzer/Tank-Wars
3cb0ebdb63d228e1307311986643e163096fe744
[ "MIT" ]
null
null
null
Source/Game/SkyBox.h
Batzer/Tank-Wars
3cb0ebdb63d228e1307311986643e163096fe744
[ "MIT" ]
null
null
null
Source/Game/SkyBox.h
Batzer/Tank-Wars
3cb0ebdb63d228e1307311986643e163096fe744
[ "MIT" ]
null
null
null
#pragma once #include <string> #include <GL/gl3w.h> namespace tankwars { // The textures must have the same dimensions and have to be in 24bit rgb class SkyBox { public: SkyBox( const std::string& leftPath, const std::string& frontPath, const std::string& rightPath, const std::string& backPath, const std::string& topPath, const std::string& bottomPath, bool generateMipmaps = true, bool srgb = true); SkyBox(SkyBox&&) = default; ~SkyBox(); void render() const; private: GLuint vbo; GLuint ibo; GLuint vao; GLuint cubemap; }; }
23.733333
77
0.549157
[ "render" ]
7021a7922740f4f4f746bca62010f126a6dbad23
290
h
C
M5Stack_MMD/Polygon.h
elect-gombe/M5Stack_MMD
6a879de6da12783df70a08700a0a40df66eed45c
[ "MIT" ]
16
2018-08-17T18:04:37.000Z
2022-01-13T05:01:36.000Z
M5Stack_MMD/Polygon.h
elect-gombe/M5Stack_MMD
6a879de6da12783df70a08700a0a40df66eed45c
[ "MIT" ]
null
null
null
M5Stack_MMD/Polygon.h
elect-gombe/M5Stack_MMD
6a879de6da12783df70a08700a0a40df66eed45c
[ "MIT" ]
2
2021-09-09T04:14:37.000Z
2022-01-17T10:26:49.000Z
#ifndef _POLYGON_H #define _POLYGON_H #include "Affine.h" class Polygon { public : // uint16_t color; Vector vertices[3]; Vector normal[3]; Vector texture_uv[3]; Polygon(){} }; class Material { public : uint16_t color; byte texture_file_name[21]; }; #endif // _POLYGON_H
13.181818
29
0.686207
[ "vector" ]
7022696aa9c9cac926773fa72dcbcd9ecb020c8a
454
h
C
gbe/base.h
malandrin/gbe
51822b0723cfdcf42b061862a83c814be553ba16
[ "MIT" ]
2
2016-02-17T14:24:11.000Z
2019-12-05T12:36:29.000Z
gbe/base.h
malandrin/gbe
51822b0723cfdcf42b061862a83c814be553ba16
[ "MIT" ]
null
null
null
gbe/base.h
malandrin/gbe
51822b0723cfdcf42b061862a83c814be553ba16
[ "MIT" ]
1
2020-05-18T05:08:47.000Z
2020-05-18T05:08:47.000Z
#pragma once #ifndef __BASE_H #define __BASE_H #include <iostream> #include <string> #include <vector> #include <unordered_set> #include <map> #include <memory> using namespace std; typedef unsigned char u8; typedef char i8; typedef unsigned short u16; typedef short i16; typedef int i32; typedef unsigned int u32; string Int2Hex (int _value, int _minLength = 0, bool _addSign = true); bool FileExists (const string &_filename); #endif
18.16
75
0.740088
[ "vector" ]
70280d14d2e82ad1d7c6a3e40c0782d6ba808e79
896
h
C
ext/candc/src/include/prob.h
TeamSPoon/logicmoo_nlu
5c3e5013a3048da7d68a8a43476ad84d3ea4bb47
[ "MIT" ]
6
2020-01-27T12:08:02.000Z
2020-02-28T19:30:28.000Z
pack/logicmoo_nlu/prolog/candc/src/include/prob.h
logicmoo/old_logicmoo_workspace
44025b6e389e2f2f7d86b46c1301cab0604bba26
[ "MIT" ]
2
2017-03-13T02:56:09.000Z
2019-07-27T02:47:29.000Z
ext/candc/src/include/prob.h
TeamSPoon/logicmoo_nlu
5c3e5013a3048da7d68a8a43476ad84d3ea4bb47
[ "MIT" ]
1
2020-11-25T06:09:33.000Z
2020-11-25T06:09:33.000Z
/* -*- Mode: C++; -*- */ // C&C NLP tools // Copyright (c) Universities of Edinburgh, Oxford and Sydney // Copyright (c) James R. Curran // // This software is covered by a non-commercial use licence. // See LICENCE.txt for the full text of the licence. // // If LICENCE.txt is not included in this distribution // please email candc@it.usyd.edu.au to obtain a copy. // NLP::Probability, NLP::PDF and NLP::Actives // probability distributions and per class active features namespace NLP { // probability typedef double Probability; // probability distribution typedef std::vector<Probability> PDF; // number of active features for each class typedef std::vector<ulong> Actives; template <class Vector> void zero(Vector &vec){ memset(&vec.front(), 0, sizeof(vec[0])*vec.size()); } template <class Vector> void identity(Vector &vec){ vec.assign(vec.size(), 1.0); } }
26.352941
74
0.696429
[ "vector" ]
7029bbb9f0a817c40f1a4ad306e4bc78d2b1de50
1,366
h
C
System/Library/PrivateFrameworks/iWorkImport.framework/Frameworks/TSCharts.framework/TSCH3DRayPickRenderProcessor.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
1
2020-11-04T15:43:01.000Z
2020-11-04T15:43:01.000Z
System/Library/PrivateFrameworks/iWorkImport.framework/Frameworks/TSCharts.framework/TSCH3DRayPickRenderProcessor.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/iWorkImport.framework/Frameworks/TSCharts.framework/TSCH3DRayPickRenderProcessor.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
/* * This header is generated by classdump-dyld 1.0 * on Sunday, September 27, 2020 at 12:31:22 PM Mountain Standard Time * Operating System: Version 14.0 (Build 18A373) * Image Source: /System/Library/PrivateFrameworks/iWorkImport.framework/Frameworks/TSCharts.framework/TSCharts * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ #import <TSCharts/TSCharts-Structs.h> #import <TSCharts/TSCH3DRetargetRenderProcessor.h> @class TSCH3DDataBuffer, NSMutableArray, TSCH3DRayPickPipelineDelegate, NSArray; @interface TSCH3DRayPickRenderProcessor : TSCH3DRetargetRenderProcessor { TSCH3DDataBuffer* mBuffer; NSMutableArray* mPickedPoints; tvec2<float> mPosition; float mSlack; TSCH3DRayPickPipelineDelegate* mSceneObjectDelegate; } @property (assign,nonatomic) tvec2<float> position; @property (assign,nonatomic) float slack; @property (nonatomic,retain) TSCH3DRayPickPipelineDelegate * sceneObjectDelegate; @property (nonatomic,readonly) NSArray * pickedPoints; -(void)setPosition:(tvec2<float>)arg1 ; -(void)submit:(id)arg1 ; -(id)matrix; -(void)dealloc; -(tvec2<float>)position; -(float)slack; -(id)init; -(void)geometry:(id)arg1 ; -(void)setSceneObjectDelegate:(TSCH3DRayPickPipelineDelegate *)arg1 ; -(NSArray *)pickedPoints; -(void)setSlack:(float)arg1 ; -(TSCH3DRayPickPipelineDelegate *)sceneObjectDelegate; @end
32.52381
110
0.792094
[ "geometry" ]
7030b19d5d0fc1311014a3506155dc4433962686
247
h
C
httpserver/dns_text_records.h
arqma/arqma-storage-server
cfeed1b67bed07e0816d7465b7b1ba7c7edcb5f0
[ "MIT" ]
null
null
null
httpserver/dns_text_records.h
arqma/arqma-storage-server
cfeed1b67bed07e0816d7465b7b1ba7c7edcb5f0
[ "MIT" ]
null
null
null
httpserver/dns_text_records.h
arqma/arqma-storage-server
cfeed1b67bed07e0816d7465b7b1ba7c7edcb5f0
[ "MIT" ]
1
2021-01-09T16:04:29.000Z
2021-01-09T16:04:29.000Z
#pragma once #include "arqma_logger.h" struct pow_difficulty_t; namespace arqma { namespace dns { std::vector<pow_difficulty_t> query_pow_difficulty(std::error_code& ec); void check_latest_version(); } // namespace dns } // namespace arqma
14.529412
72
0.761134
[ "vector" ]
7042d312b9abd4dbaadc5152d81f2c95a9dbea51
6,846
h
C
ytree.h
yorickdewid/ytree
372fde75a20bf4c445d08c57c0c53e0808c0b011
[ "BSD-3-Clause" ]
1
2018-09-14T13:42:41.000Z
2018-09-14T13:42:41.000Z
ytree.h
yorickdewid/ytree
372fde75a20bf4c445d08c57c0c53e0808c0b011
[ "BSD-3-Clause" ]
null
null
null
ytree.h
yorickdewid/ytree
372fde75a20bf4c445d08c57c0c53e0808c0b011
[ "BSD-3-Clause" ]
null
null
null
/* * ----------------------------- ytree.h ------------------------------ * * Copyright (c) 2016, Yorick de Wid <yorick17 at outlook dot com> * 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 Redis nor the names of its contributors may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * ytree definitions. */ #ifndef _YTREE_H_ #define _YTREE_H_ #include <stdbool.h> #include <stdint.h> /* Enable for debug compilation */ #ifdef STANDALONE #define DEBUG 1 #endif /* * Tree options. These can be set when * a new tree is created. */ #define DB_FLAG_DUPLICATE 0x01 // Allow duplicated keys #define DB_FLAG_HASH 0x02 // Use hash buckets where possible #define DB_FLAG_VERBOSE 0x04 // Verbose output #define DB_FLAG_PREF_SPEED 0x08 // Prefer speed #define DB_FLAG_PREF_SIZE 0x10 // Prefer small database size /* ******************************** * TYPES * ********************************/ /* * Funtion pointer declarations for the * object hooks. */ typedef void (*hook_release)(void *object); typedef void (*hook_serialize)(void *object, size_t *sz, void *out); /* * Datatypes are used to * identify record values. */ enum datatype { DT_CHAR, DT_INT, DT_FLOAT, DT_DATA, }; /* * Type representing the record * to which a given key refers. * The record can hold native types * or user defined structures. These * structures must be serializable. */ typedef struct { union { char _char; int _int; float _float; void *_data; } value; enum datatype value_type; size_t value_size; } record_t; /* * Type representing a node in the B+ tree. * This type is general enough to serve for both * the leaf and the internal node. * The heart of the node is the array * of keys and the array of corresponding * pointers holding the values. The relation between * keys and pointers differs between leaves and * internal nodes. In a leaf, the index * of each key equals the index of its corresponding * pointer, with a maximum of order - 1 key-pointer * pairs. The last pointer points to the * sequencial leaf to the right (or NULL in the * case of the rightmost leaf). * In an internal node, the first pointer * refers to lower nodes with keys less than * the smallest key in the keys array. Then, * with indices i starting at 0, the pointer * at i + 1 points to the subtree with keys * greater than or equal to the key in this * node at index i. * The num_keys field is used to keep * track of the number of valid keys. * In an internal node, the number of valid * pointers is always num_keys + 1. * In a leaf, the number of valid pointers * to data is always num_keys. The * last leaf pointer points to the next sequential * leaf. */ typedef struct node { void **pointers; // Array of pointers to records uint32_t *_pointers; // Array of pointers to offset int *keys; // Array of keys with size: order struct node *parent; // Parent node or NULL for root bool is_leaf; // Internal node or leaf int num_keys; // Number of keys in node struct node *next; // Used for queue } node_t; /* Database environment */ typedef struct { int schema; // Offset to database schema int free_front; // Offset to free block from front int free_back; // Offset to free block from back size_t page_size; // Page size char flags; // Bitmap defining tree options FILE *pdb; // Database file pointer } env_t; /* Single database */ typedef struct { int schema_id; // Id in schema short order; // Tree order (B+Tree only) int _root; // Offset to root env_t *env; // Pointer to current environment node_t *root; // Pointer to root node struct { hook_release object_release; // Called on record release hook_serialize object_serialize; // Called on record serialization } hooks; } db_t; /* Key value pair */ typedef struct { void *data; size_t size; } keypair_t, valuepair_t; /* ******************************** * FUNCTION PROTOTYPES * ********************************/ /* Output */ #ifdef DEBUG void ytree_print_leaves(db_t **db); void ytree_print_value(record_t *record); void ytree_print_tree(db_t **db); //TODO ytree? void find_and_print(db_t **db, int key, bool verbose); void find_and_print_range(db_t **db, int range1, int range2, bool verbose); #endif // DEBUG /* Miscellaneous */ int ytree_height(db_t **db); int ytree_count(db_t **db); void ytree_purge(db_t **db); void ytree_order(db_t **db, unsigned int order); const char *ytree_version(); void ytree_insert(db_t **db, int key, record_t *pointer); record_t *ytree_find(db_t **db, int key); void ytree_delete(db_t **db, int key); /* Tree operations */ void ytree_env_init(const char *dbname, env_t **tree, uint8_t flags); void ytree_env_close(env_t **tree); void ytree_db_init(short index, db_t **db, env_t **env); void ytree_db_close(db_t **db); /* Record */ record_t *make_record(enum datatype type, char c_value, int i_value, float f_value, void *p_value, size_t vsize); record_t *ytree_new_record(valuepair_t *pair); int ytree_record_size(record_t *record); /* Helper macros */ #define ytree_new_char(c) make_record(DT_CHAR, c, 0, 0, NULL, 0) #define ytree_new_int(i) make_record(DT_INT, 0, i, 0, NULL, 0) #define ytree_new_float(f) make_record(DT_FLOAT, 0, 0, f, NULL, 0) #define ytree_new_data(d,n) make_record(DT_DATA, 0, 0, 0, d, n) #define ytree_db_empty(d) ((*d)->root == NULL) #endif // _YTREE_H_
32.6
113
0.697926
[ "object" ]
7058d8b403a5fe5c20292c0433219c7a1ea1a1e5
84,212
h
C
FrameWorkCode/ui_mainwindow.h
ayushbits/udaan-post-editing
499303a641598978d89cf0210776e80d98d2212a
[ "BSD-3-Clause" ]
1
2022-01-25T19:27:55.000Z
2022-01-25T19:27:55.000Z
FrameWorkCode/ui_mainwindow.h
ayushbits/udaan-post-editing
499303a641598978d89cf0210776e80d98d2212a
[ "BSD-3-Clause" ]
null
null
null
FrameWorkCode/ui_mainwindow.h
ayushbits/udaan-post-editing
499303a641598978d89cf0210776e80d98d2212a
[ "BSD-3-Clause" ]
null
null
null
/******************************************************************************** ** Form generated from reading UI file 'mainwindow.ui' ** ** Created by: Qt User Interface Compiler version 5.12.8 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_MAINWINDOW_H #define UI_MAINWINDOW_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QGraphicsView> #include <QtWidgets/QGridLayout> #include <QtWidgets/QGroupBox> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QLineEdit> #include <QtWidgets/QMainWindow> #include <QtWidgets/QMenu> #include <QtWidgets/QMenuBar> #include <QtWidgets/QPushButton> #include <QtWidgets/QSlider> #include <QtWidgets/QSpacerItem> #include <QtWidgets/QSplitter> #include <QtWidgets/QTabWidget> #include <QtWidgets/QTextBrowser> #include <QtWidgets/QTextEdit> #include <QtWidgets/QToolBar> #include <QtWidgets/QTreeView> #include <QtWidgets/QVBoxLayout> #include <QtWidgets/QWidget> QT_BEGIN_NAMESPACE class Ui_MainWindow { public: QAction *actionOpen_Project; QAction *actionSave; QAction *actionSave_As; QAction *actionNew; QAction *actionSpell_Check; QAction *actionLoad_Next_Page; QAction *actionLoad_Prev_Page; QAction *actionLoadGDocPage; QAction *actionToDevanagari; QAction *actionLoadData; QAction *actionLoadDict; QAction *actionLoadOCRWords; QAction *actionLoadDomain; QAction *actionLoadSubPS; QAction *actionLoadConfusions; QAction *actionSugg; QAction *actionCreateBest2OCR; QAction *actionToSlp1; QAction *actionCreateSuggestionLog; QAction *actionCreateSuggestionLogNearestPriority; QAction *actionErrorDetectionRep; QAction *actionErrorDetectWithoutAdaptation; QAction *actionCPair; QAction *actionToSlp1_2; QAction *actionToDev; QAction *actionExtractDev; QAction *actionPrimarySecOCRPair; QAction *actionCPairIEROcrVsCorrect; QAction *actionEditDistRep; QAction *actionConfusionFreqHist; QAction *actionCPairGEROcrVsCorrect; QAction *actionFilterOutGT50EditDisPairs; QAction *actionErrorDetectionRepUniq; QAction *actionAllFontProperties; QAction *actionBold; QAction *actionUnBold; QAction *actionLeftAlign; QAction *actionRightAlign; QAction *actionCentreAlign; QAction *actionJusitfiedAlign; QAction *actionAccuracyLog; QAction *actionView_File_Hierarchy; QAction *actionTurn_In; QAction *actionFetch; QAction *actionCompare_Verifier; QAction *actionCompare_Corrector; QAction *actionAverage_Accuracy; QAction *actionView_Comments; QAction *actionCommit; QAction *actionFetch_2; QAction *actionPush; QAction *actionVerifier_Turn_In; QAction *actionHighlight; QAction *actionZoom_In; QAction *actionZoom_Out; QAction *actionSymbols; QAction *actionSuperscript; QAction *actionSubscript; QAction *actionInsert_Horizontal_Line; QAction *actionFontBlack; QAction *actionLineSpace; QAction *actionViewAverageAccuracies; QAction *actionInsert_Tab_Space; QAction *actionAdd_Image; QAction *actionResize_Image; QAction *actionUndo; QAction *actionRedo; QAction *actionNew_Project; QAction *actionInsert_Table_2; QAction *actionInsert_Columnleft; QAction *actionInsert_Columnright; QAction *actionInsert_Rowabove; QAction *actionInsert_Rowbelow; QAction *actionRemove_Column; QAction *actionRemove_Row; QAction *actionItalic; QAction *actionNonitalic; QAction *actionSave_All; QAction *actionFind_and_Replace; QAction *actionas_PDF; QAction *actionGet_Help; QAction *actionTutorial; QAction *actionLinux; QAction *actionWindows; QAction *actionas_Doc; QAction *actionSanskrit; QAction *actionHindi; QAction *actionEnglish; QAction *actionShortcut_Guide; QAction *action1; QAction *actionSanskrit_2; QAction *actionUndo_Global_Replace; QAction *actionUpload; QAction *justify; QAction *actionFont_Color; QWidget *centralWidget; QVBoxLayout *verticalLayout_5; QVBoxLayout *verticalLayout_4; QHBoxLayout *horizontalLayout; QSpacerItem *horizontalSpacer; QPushButton *pushButton_2; QPushButton *pushButton; QPushButton *viewComments; QPushButton *compareCorrectorOutput; QPushButton *compareVerifierOutput; QSplitter *splitter; QSplitter *splitter_2; QTabWidget *tabWidget; QWidget *tab; QVBoxLayout *verticalLayout_2; QVBoxLayout *verticalLayout; QHBoxLayout *horizontalLayout_2; QPushButton *hinButton; QPushButton *sanButton; QTextEdit *textEdit; QWidget *tab_2; QVBoxLayout *verticalLayout_3; QLineEdit *lineEditSearch; QTreeView *treeView; QTextEdit *textEdit_dict; QTabWidget *tabWidget_2; QWidget *tab_5; QGridLayout *gridLayout_4; QTextBrowser *textBrowser; QGraphicsView *graphicsView; QHBoxLayout *Buttom_Slider; QLineEdit *lineEdit; QLineEdit *lineEdit_3; QLineEdit *lineEdit_2; QSpacerItem *horizontalSpacer_2; QGroupBox *groupBox; QHBoxLayout *horizontalLayout_3; QPushButton *zoom_Out_Button; QSlider *horizontalSlider; QPushButton *zoom_In_Button; QLabel *zoom_level_value; QMenuBar *menuBar; QMenu *menuCreateReports; QMenu *menuFontAndLayout; QMenu *menuTables; QMenu *menuGit; QMenu *menuEdit; QMenu *menuDownload; QMenu *menuHelp; QMenu *menuInstallation_Guide; QMenu *menuSelectLanguage; QMenu *menuOCR_Correction_Window; QMenu *menuRecent_Project; QToolBar *mainToolBar; void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName(QString::fromUtf8("MainWindow")); MainWindow->resize(1366, 1190); QFont font; font.setFamily(QString::fromUtf8("WorkSans,Sans")); font.setBold(false); font.setItalic(false); font.setWeight(50); MainWindow->setFont(font); MainWindow->setMouseTracking(true); MainWindow->setStyleSheet(QString::fromUtf8("background:rgb(32, 33, 72); \n" "color:white;\n" "\n" "")); actionOpen_Project = new QAction(MainWindow); actionOpen_Project->setObjectName(QString::fromUtf8("actionOpen_Project")); QIcon icon; icon.addFile(QString::fromUtf8(":/Images/Resources/open file.png"), QSize(), QIcon::Normal, QIcon::Off); actionOpen_Project->setIcon(icon); actionSave = new QAction(MainWindow); actionSave->setObjectName(QString::fromUtf8("actionSave")); QIcon icon1; icon1.addFile(QString::fromUtf8(":/Images/Resources/save.png"), QSize(), QIcon::Normal, QIcon::Off); actionSave->setIcon(icon1); actionSave_As = new QAction(MainWindow); actionSave_As->setObjectName(QString::fromUtf8("actionSave_As")); QIcon icon2; icon2.addFile(QString::fromUtf8(":/Images/Resources/save as.png"), QSize(), QIcon::Normal, QIcon::Off); actionSave_As->setIcon(icon2); actionNew = new QAction(MainWindow); actionNew->setObjectName(QString::fromUtf8("actionNew")); QIcon icon3; icon3.addFile(QString::fromUtf8(":/Images/Resources/add.png"), QSize(), QIcon::Normal, QIcon::Off); actionNew->setIcon(icon3); actionNew->setVisible(true); actionSpell_Check = new QAction(MainWindow); actionSpell_Check->setObjectName(QString::fromUtf8("actionSpell_Check")); actionSpell_Check->setEnabled(true); QIcon icon4; icon4.addFile(QString::fromUtf8(":/Images/Resources/spell check.png"), QSize(), QIcon::Normal, QIcon::Off); icon4.addFile(QString::fromUtf8(":/Images/spellcheck.png"), QSize(), QIcon::Normal, QIcon::On); actionSpell_Check->setIcon(icon4); actionSpell_Check->setVisible(true); actionLoad_Next_Page = new QAction(MainWindow); actionLoad_Next_Page->setObjectName(QString::fromUtf8("actionLoad_Next_Page")); QIcon icon5; icon5.addFile(QString::fromUtf8(":/Images/Resources/preivious page.png"), QSize(), QIcon::Normal, QIcon::Off); icon5.addFile(QString::fromUtf8(":/Images/next-page.png"), QSize(), QIcon::Normal, QIcon::On); actionLoad_Next_Page->setIcon(icon5); actionLoad_Prev_Page = new QAction(MainWindow); actionLoad_Prev_Page->setObjectName(QString::fromUtf8("actionLoad_Prev_Page")); QIcon icon6; icon6.addFile(QString::fromUtf8(":/Images/Resources/next page.png"), QSize(), QIcon::Normal, QIcon::Off); icon6.addFile(QString::fromUtf8(":/Images/previous-page.png"), QSize(), QIcon::Normal, QIcon::On); actionLoad_Prev_Page->setIcon(icon6); actionLoadGDocPage = new QAction(MainWindow); actionLoadGDocPage->setObjectName(QString::fromUtf8("actionLoadGDocPage")); QIcon icon7; icon7.addFile(QString::fromUtf8(":/Images/Resources/save load p words.png"), QSize(), QIcon::Normal, QIcon::Off); actionLoadGDocPage->setIcon(icon7); actionToDevanagari = new QAction(MainWindow); actionToDevanagari->setObjectName(QString::fromUtf8("actionToDevanagari")); QIcon icon8; icon8.addFile(QString::fromUtf8(":/Images/Resources/english to hindi.png"), QSize(), QIcon::Normal, QIcon::Off); icon8.addFile(QString::fromUtf8(":/Images/toDevangari.png"), QSize(), QIcon::Normal, QIcon::On); actionToDevanagari->setIcon(icon8); actionLoadData = new QAction(MainWindow); actionLoadData->setObjectName(QString::fromUtf8("actionLoadData")); actionLoadData->setEnabled(true); QIcon icon9; icon9.addFile(QString::fromUtf8(":/Images/Resources/load data.png"), QSize(), QIcon::Normal, QIcon::Off); icon9.addFile(QString::fromUtf8(":/Images/LoadData.png"), QSize(), QIcon::Normal, QIcon::On); actionLoadData->setIcon(icon9); actionLoadData->setVisible(true); actionLoadDict = new QAction(MainWindow); actionLoadDict->setObjectName(QString::fromUtf8("actionLoadDict")); actionLoadOCRWords = new QAction(MainWindow); actionLoadOCRWords->setObjectName(QString::fromUtf8("actionLoadOCRWords")); actionLoadDomain = new QAction(MainWindow); actionLoadDomain->setObjectName(QString::fromUtf8("actionLoadDomain")); actionLoadSubPS = new QAction(MainWindow); actionLoadSubPS->setObjectName(QString::fromUtf8("actionLoadSubPS")); actionLoadConfusions = new QAction(MainWindow); actionLoadConfusions->setObjectName(QString::fromUtf8("actionLoadConfusions")); actionSugg = new QAction(MainWindow); actionSugg->setObjectName(QString::fromUtf8("actionSugg")); actionCreateBest2OCR = new QAction(MainWindow); actionCreateBest2OCR->setObjectName(QString::fromUtf8("actionCreateBest2OCR")); actionToSlp1 = new QAction(MainWindow); actionToSlp1->setObjectName(QString::fromUtf8("actionToSlp1")); QIcon icon10; icon10.addFile(QString::fromUtf8(":/Images/Resources/tospl.png"), QSize(), QIcon::Normal, QIcon::Off); actionToSlp1->setIcon(icon10); actionCreateSuggestionLog = new QAction(MainWindow); actionCreateSuggestionLog->setObjectName(QString::fromUtf8("actionCreateSuggestionLog")); actionCreateSuggestionLogNearestPriority = new QAction(MainWindow); actionCreateSuggestionLogNearestPriority->setObjectName(QString::fromUtf8("actionCreateSuggestionLogNearestPriority")); actionErrorDetectionRep = new QAction(MainWindow); actionErrorDetectionRep->setObjectName(QString::fromUtf8("actionErrorDetectionRep")); actionErrorDetectWithoutAdaptation = new QAction(MainWindow); actionErrorDetectWithoutAdaptation->setObjectName(QString::fromUtf8("actionErrorDetectWithoutAdaptation")); actionCPair = new QAction(MainWindow); actionCPair->setObjectName(QString::fromUtf8("actionCPair")); actionToSlp1_2 = new QAction(MainWindow); actionToSlp1_2->setObjectName(QString::fromUtf8("actionToSlp1_2")); actionToDev = new QAction(MainWindow); actionToDev->setObjectName(QString::fromUtf8("actionToDev")); actionExtractDev = new QAction(MainWindow); actionExtractDev->setObjectName(QString::fromUtf8("actionExtractDev")); actionPrimarySecOCRPair = new QAction(MainWindow); actionPrimarySecOCRPair->setObjectName(QString::fromUtf8("actionPrimarySecOCRPair")); actionCPairIEROcrVsCorrect = new QAction(MainWindow); actionCPairIEROcrVsCorrect->setObjectName(QString::fromUtf8("actionCPairIEROcrVsCorrect")); actionEditDistRep = new QAction(MainWindow); actionEditDistRep->setObjectName(QString::fromUtf8("actionEditDistRep")); actionConfusionFreqHist = new QAction(MainWindow); actionConfusionFreqHist->setObjectName(QString::fromUtf8("actionConfusionFreqHist")); actionCPairGEROcrVsCorrect = new QAction(MainWindow); actionCPairGEROcrVsCorrect->setObjectName(QString::fromUtf8("actionCPairGEROcrVsCorrect")); actionFilterOutGT50EditDisPairs = new QAction(MainWindow); actionFilterOutGT50EditDisPairs->setObjectName(QString::fromUtf8("actionFilterOutGT50EditDisPairs")); actionErrorDetectionRepUniq = new QAction(MainWindow); actionErrorDetectionRepUniq->setObjectName(QString::fromUtf8("actionErrorDetectionRepUniq")); actionAllFontProperties = new QAction(MainWindow); actionAllFontProperties->setObjectName(QString::fromUtf8("actionAllFontProperties")); QIcon icon11; icon11.addFile(QString::fromUtf8(":/Images/Resources/all font properties 2.png"), QSize(), QIcon::Normal, QIcon::Off); icon11.addFile(QString::fromUtf8(":/Images/AllFont.png"), QSize(), QIcon::Normal, QIcon::On); actionAllFontProperties->setIcon(icon11); actionBold = new QAction(MainWindow); actionBold->setObjectName(QString::fromUtf8("actionBold")); QIcon icon12; icon12.addFile(QString::fromUtf8(":/Images/Resources/bold.png"), QSize(), QIcon::Normal, QIcon::Off); actionBold->setIcon(icon12); actionUnBold = new QAction(MainWindow); actionUnBold->setObjectName(QString::fromUtf8("actionUnBold")); actionUnBold->setEnabled(false); actionUnBold->setVisible(false); actionLeftAlign = new QAction(MainWindow); actionLeftAlign->setObjectName(QString::fromUtf8("actionLeftAlign")); QIcon icon13; icon13.addFile(QString::fromUtf8(":/Images/Resources/allign left.png"), QSize(), QIcon::Normal, QIcon::Off); icon13.addFile(QString::fromUtf8(":/Images/AlignLeft.png"), QSize(), QIcon::Normal, QIcon::On); actionLeftAlign->setIcon(icon13); actionRightAlign = new QAction(MainWindow); actionRightAlign->setObjectName(QString::fromUtf8("actionRightAlign")); QIcon icon14; icon14.addFile(QString::fromUtf8(":/Images/Resources/align right.png"), QSize(), QIcon::Normal, QIcon::Off); icon14.addFile(QString::fromUtf8(":/Images/AlignCenter.png"), QSize(), QIcon::Normal, QIcon::On); actionRightAlign->setIcon(icon14); actionCentreAlign = new QAction(MainWindow); actionCentreAlign->setObjectName(QString::fromUtf8("actionCentreAlign")); QIcon icon15; icon15.addFile(QString::fromUtf8(":/Images/Resources/align center.png"), QSize(), QIcon::Normal, QIcon::Off); icon15.addFile(QString::fromUtf8(":/Images/AlignCenter.png"), QSize(), QIcon::Normal, QIcon::On); actionCentreAlign->setIcon(icon15); actionJusitfiedAlign = new QAction(MainWindow); actionJusitfiedAlign->setObjectName(QString::fromUtf8("actionJusitfiedAlign")); QIcon icon16; icon16.addFile(QString::fromUtf8(":/Images/Resources/align para.png"), QSize(), QIcon::Normal, QIcon::Off); icon16.addFile(QString::fromUtf8(":/Images/JustifiedAlign.png"), QSize(), QIcon::Normal, QIcon::On); actionJusitfiedAlign->setIcon(icon16); actionAccuracyLog = new QAction(MainWindow); actionAccuracyLog->setObjectName(QString::fromUtf8("actionAccuracyLog")); actionView_File_Hierarchy = new QAction(MainWindow); actionView_File_Hierarchy->setObjectName(QString::fromUtf8("actionView_File_Hierarchy")); actionTurn_In = new QAction(MainWindow); actionTurn_In->setObjectName(QString::fromUtf8("actionTurn_In")); actionFetch = new QAction(MainWindow); actionFetch->setObjectName(QString::fromUtf8("actionFetch")); actionCompare_Verifier = new QAction(MainWindow); actionCompare_Verifier->setObjectName(QString::fromUtf8("actionCompare_Verifier")); actionCompare_Corrector = new QAction(MainWindow); actionCompare_Corrector->setObjectName(QString::fromUtf8("actionCompare_Corrector")); actionAverage_Accuracy = new QAction(MainWindow); actionAverage_Accuracy->setObjectName(QString::fromUtf8("actionAverage_Accuracy")); actionView_Comments = new QAction(MainWindow); actionView_Comments->setObjectName(QString::fromUtf8("actionView_Comments")); actionCommit = new QAction(MainWindow); actionCommit->setObjectName(QString::fromUtf8("actionCommit")); actionFetch_2 = new QAction(MainWindow); actionFetch_2->setObjectName(QString::fromUtf8("actionFetch_2")); actionFetch_2->setEnabled(false); actionPush = new QAction(MainWindow); actionPush->setObjectName(QString::fromUtf8("actionPush")); actionPush->setEnabled(false); actionVerifier_Turn_In = new QAction(MainWindow); actionVerifier_Turn_In->setObjectName(QString::fromUtf8("actionVerifier_Turn_In")); actionHighlight = new QAction(MainWindow); actionHighlight->setObjectName(QString::fromUtf8("actionHighlight")); actionHighlight->setEnabled(true); QIcon icon17; icon17.addFile(QString::fromUtf8(":/Images/Resources/highlighter.png"), QSize(), QIcon::Normal, QIcon::Off); icon17.addFile(QString::fromUtf8(":/Images/highlight-icon.png"), QSize(), QIcon::Normal, QIcon::On); actionHighlight->setIcon(icon17); actionHighlight->setVisible(true); actionZoom_In = new QAction(MainWindow); actionZoom_In->setObjectName(QString::fromUtf8("actionZoom_In")); QIcon icon18; icon18.addFile(QString::fromUtf8(":/Images/Resources/zoom in.png"), QSize(), QIcon::Normal, QIcon::Off); actionZoom_In->setIcon(icon18); actionZoom_Out = new QAction(MainWindow); actionZoom_Out->setObjectName(QString::fromUtf8("actionZoom_Out")); QIcon icon19; icon19.addFile(QString::fromUtf8(":/Images/Resources/zoom out.png"), QSize(), QIcon::Normal, QIcon::Off); actionZoom_Out->setIcon(icon19); actionSymbols = new QAction(MainWindow); actionSymbols->setObjectName(QString::fromUtf8("actionSymbols")); QIcon icon20; icon20.addFile(QString::fromUtf8(":/Images/Resources/spl symbol.png"), QSize(), QIcon::Normal, QIcon::Off); icon20.addFile(QString::fromUtf8(":/Images/symbols.png"), QSize(), QIcon::Normal, QIcon::On); actionSymbols->setIcon(icon20); actionSuperscript = new QAction(MainWindow); actionSuperscript->setObjectName(QString::fromUtf8("actionSuperscript")); QIcon icon21; icon21.addFile(QString::fromUtf8(":/Images/Resources/superscrpt.png"), QSize(), QIcon::Normal, QIcon::Off); actionSuperscript->setIcon(icon21); actionSubscript = new QAction(MainWindow); actionSubscript->setObjectName(QString::fromUtf8("actionSubscript")); QIcon icon22; icon22.addFile(QString::fromUtf8(":/Images/Resources/subscpt.png"), QSize(), QIcon::Normal, QIcon::Off); actionSubscript->setIcon(icon22); actionInsert_Horizontal_Line = new QAction(MainWindow); actionInsert_Horizontal_Line->setObjectName(QString::fromUtf8("actionInsert_Horizontal_Line")); QIcon icon23; icon23.addFile(QString::fromUtf8(":/Images/Resources/underline 2.png"), QSize(), QIcon::Normal, QIcon::Off); actionInsert_Horizontal_Line->setIcon(icon23); actionFontBlack = new QAction(MainWindow); actionFontBlack->setObjectName(QString::fromUtf8("actionFontBlack")); QIcon icon24; icon24.addFile(QString::fromUtf8(":/Images/Resources/font black.png"), QSize(), QIcon::Normal, QIcon::Off); actionFontBlack->setIcon(icon24); actionLineSpace = new QAction(MainWindow); actionLineSpace->setObjectName(QString::fromUtf8("actionLineSpace")); actionLineSpace->setEnabled(false); QIcon icon25; icon25.addFile(QString::fromUtf8(":/Images/linespacing.png"), QSize(), QIcon::Normal, QIcon::On); actionLineSpace->setIcon(icon25); actionViewAverageAccuracies = new QAction(MainWindow); actionViewAverageAccuracies->setObjectName(QString::fromUtf8("actionViewAverageAccuracies")); actionInsert_Tab_Space = new QAction(MainWindow); actionInsert_Tab_Space->setObjectName(QString::fromUtf8("actionInsert_Tab_Space")); actionAdd_Image = new QAction(MainWindow); actionAdd_Image->setObjectName(QString::fromUtf8("actionAdd_Image")); actionResize_Image = new QAction(MainWindow); actionResize_Image->setObjectName(QString::fromUtf8("actionResize_Image")); actionUndo = new QAction(MainWindow); actionUndo->setObjectName(QString::fromUtf8("actionUndo")); QIcon icon26; icon26.addFile(QString::fromUtf8(":/Images/Resources/undo.png"), QSize(), QIcon::Normal, QIcon::Off); icon26.addFile(QString::fromUtf8(":/Images/undo.png"), QSize(), QIcon::Normal, QIcon::On); actionUndo->setIcon(icon26); actionRedo = new QAction(MainWindow); actionRedo->setObjectName(QString::fromUtf8("actionRedo")); QIcon icon27; icon27.addFile(QString::fromUtf8(":/Images/Resources/redo.png"), QSize(), QIcon::Normal, QIcon::Off); icon27.addFile(QString::fromUtf8(":/Images/redo.png"), QSize(), QIcon::Normal, QIcon::On); actionRedo->setIcon(icon27); actionNew_Project = new QAction(MainWindow); actionNew_Project->setObjectName(QString::fromUtf8("actionNew_Project")); actionNew_Project->setVisible(false); actionInsert_Table_2 = new QAction(MainWindow); actionInsert_Table_2->setObjectName(QString::fromUtf8("actionInsert_Table_2")); actionInsert_Columnleft = new QAction(MainWindow); actionInsert_Columnleft->setObjectName(QString::fromUtf8("actionInsert_Columnleft")); actionInsert_Columnright = new QAction(MainWindow); actionInsert_Columnright->setObjectName(QString::fromUtf8("actionInsert_Columnright")); actionInsert_Rowabove = new QAction(MainWindow); actionInsert_Rowabove->setObjectName(QString::fromUtf8("actionInsert_Rowabove")); actionInsert_Rowbelow = new QAction(MainWindow); actionInsert_Rowbelow->setObjectName(QString::fromUtf8("actionInsert_Rowbelow")); actionRemove_Column = new QAction(MainWindow); actionRemove_Column->setObjectName(QString::fromUtf8("actionRemove_Column")); actionRemove_Row = new QAction(MainWindow); actionRemove_Row->setObjectName(QString::fromUtf8("actionRemove_Row")); actionItalic = new QAction(MainWindow); actionItalic->setObjectName(QString::fromUtf8("actionItalic")); QIcon icon28; icon28.addFile(QString::fromUtf8(":/Images/Resources/ittalic.png"), QSize(), QIcon::Normal, QIcon::Off); actionItalic->setIcon(icon28); actionNonitalic = new QAction(MainWindow); actionNonitalic->setObjectName(QString::fromUtf8("actionNonitalic")); actionSave_All = new QAction(MainWindow); actionSave_All->setObjectName(QString::fromUtf8("actionSave_All")); actionFind_and_Replace = new QAction(MainWindow); actionFind_and_Replace->setObjectName(QString::fromUtf8("actionFind_and_Replace")); QIcon icon29; icon29.addFile(QString::fromUtf8(":/Images/Resources/find 1.png"), QSize(), QIcon::Normal, QIcon::Off); actionFind_and_Replace->setIcon(icon29); actionas_PDF = new QAction(MainWindow); actionas_PDF->setObjectName(QString::fromUtf8("actionas_PDF")); actionGet_Help = new QAction(MainWindow); actionGet_Help->setObjectName(QString::fromUtf8("actionGet_Help")); QIcon icon30; icon30.addFile(QString::fromUtf8(":/Images/Resources/help.png"), QSize(), QIcon::Normal, QIcon::Off); actionGet_Help->setIcon(icon30); actionTutorial = new QAction(MainWindow); actionTutorial->setObjectName(QString::fromUtf8("actionTutorial")); actionLinux = new QAction(MainWindow); actionLinux->setObjectName(QString::fromUtf8("actionLinux")); actionWindows = new QAction(MainWindow); actionWindows->setObjectName(QString::fromUtf8("actionWindows")); actionas_Doc = new QAction(MainWindow); actionas_Doc->setObjectName(QString::fromUtf8("actionas_Doc")); actionSanskrit = new QAction(MainWindow); actionSanskrit->setObjectName(QString::fromUtf8("actionSanskrit")); QFont font1; actionSanskrit->setFont(font1); actionHindi = new QAction(MainWindow); actionHindi->setObjectName(QString::fromUtf8("actionHindi")); actionEnglish = new QAction(MainWindow); actionEnglish->setObjectName(QString::fromUtf8("actionEnglish")); actionShortcut_Guide = new QAction(MainWindow); actionShortcut_Guide->setObjectName(QString::fromUtf8("actionShortcut_Guide")); action1 = new QAction(MainWindow); action1->setObjectName(QString::fromUtf8("action1")); actionSanskrit_2 = new QAction(MainWindow); actionSanskrit_2->setObjectName(QString::fromUtf8("actionSanskrit_2")); actionUndo_Global_Replace = new QAction(MainWindow); actionUndo_Global_Replace->setObjectName(QString::fromUtf8("actionUndo_Global_Replace")); actionUpload = new QAction(MainWindow); actionUpload->setObjectName(QString::fromUtf8("actionUpload")); justify = new QAction(MainWindow); justify->setObjectName(QString::fromUtf8("justify")); QIcon icon31; icon31.addFile(QString::fromUtf8(":/Images/Resources/align para.png"), QSize(), QIcon::Normal, QIcon::Off); justify->setIcon(icon31); actionFont_Color = new QAction(MainWindow); actionFont_Color->setObjectName(QString::fromUtf8("actionFont_Color")); QIcon icon32; icon32.addFile(QString::fromUtf8(":/Images/Resources/font color.png"), QSize(), QIcon::Normal, QIcon::Off); actionFont_Color->setIcon(icon32); centralWidget = new QWidget(MainWindow); centralWidget->setObjectName(QString::fromUtf8("centralWidget")); centralWidget->setStyleSheet(QString::fromUtf8("mainToolBar{background:rgb(143, 89, 2)}")); verticalLayout_5 = new QVBoxLayout(centralWidget); verticalLayout_5->setSpacing(6); verticalLayout_5->setContentsMargins(11, 11, 11, 11); verticalLayout_5->setObjectName(QString::fromUtf8("verticalLayout_5")); verticalLayout_4 = new QVBoxLayout(); verticalLayout_4->setSpacing(6); verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4")); horizontalLayout = new QHBoxLayout(); horizontalLayout->setSpacing(6); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout->addItem(horizontalSpacer); pushButton_2 = new QPushButton(centralWidget); pushButton_2->setObjectName(QString::fromUtf8("pushButton_2")); pushButton_2->setStyleSheet(QString::fromUtf8("QPushButton{background-color:rgb(227, 228, 228);border:0px; color: rgb(32, 33, 72); height:26.96px; width: 113.5px; padding-top:1px; border-radius:4.8px; padding-left:1.3px; selection-color: rgb(32, 33, 72); selection-background-color: rgb(136, 138, 133);\n" "} QPushButton:checked{background-color: rgb(136, 138, 133);} QPushButton:pressed {background-color: rgb(136, 138, 133);}")); horizontalLayout->addWidget(pushButton_2); pushButton = new QPushButton(centralWidget); pushButton->setObjectName(QString::fromUtf8("pushButton")); pushButton->setStyleSheet(QString::fromUtf8("QPushButton{background-color:rgb(227, 228, 228);border:0px; color: rgb(32, 33, 72); height:26.96px; width: 109.11px; padding-top:1px; border-radius:4.8px; padding-left:1.3px;}QPushButton:checked{background-color: rgb(136, 138, 133);}QPushButton:pressed {background-color: rgb(136, 138, 133);}")); horizontalLayout->addWidget(pushButton); viewComments = new QPushButton(centralWidget); viewComments->setObjectName(QString::fromUtf8("viewComments")); viewComments->setStyleSheet(QString::fromUtf8("QPushButton{background-color:rgb(227, 228, 228);border:0px; color: rgb(32, 33, 72); height:26.96px; width: 176.03px; padding-top:1px; border-radius:4.8px; padding-left:1.3px;} QPushButton:checked{background-color: rgb(136, 138, 133);}QPushButton:pressed {background-color: rgb(136, 138, 133);}\n" "")); horizontalLayout->addWidget(viewComments); compareCorrectorOutput = new QPushButton(centralWidget); compareCorrectorOutput->setObjectName(QString::fromUtf8("compareCorrectorOutput")); compareCorrectorOutput->setStyleSheet(QString::fromUtf8("QPushButton{background-color:rgb(227, 228, 228);border:0px; color: rgb(32, 33, 72); height:26.96px; width: 210.62px; padding-top:1px; border-radius:4.8px; padding-left:1.3px;} QPushButton:checked{background-color: rgb(136, 138, 133);}QPushButton:pressed {background-color: rgb(136, 138, 133);}\n" "")); horizontalLayout->addWidget(compareCorrectorOutput); compareVerifierOutput = new QPushButton(centralWidget); compareVerifierOutput->setObjectName(QString::fromUtf8("compareVerifierOutput")); compareVerifierOutput->setMinimumSize(QSize(0, 0)); compareVerifierOutput->setStyleSheet(QString::fromUtf8("QPushButton{background-color:rgb(227, 228, 228);border:0px; color: rgb(32, 33, 72); height:26.96px; width: 210.62px; padding-top:1px; border-radius:4.8px; padding-left:1.3px;}QPushButton:checked{background-color: rgb(136, 138, 133);}QPushButton:pressed {background-color: rgb(136, 138, 133);}\n" "")); horizontalLayout->addWidget(compareVerifierOutput); verticalLayout_4->addLayout(horizontalLayout); splitter = new QSplitter(centralWidget); splitter->setObjectName(QString::fromUtf8("splitter")); splitter->setStyleSheet(QString::fromUtf8("QSplitter{\n" "QGraphicsView{background-color:white;}\n" "}\n" "QGraphicsView{background-color:white;}\n" "QScrollBar:vertical { \n" " border: none;\n" " background: white;\n" " width: 9.81px;\n" " }\n" "QScrollBar::handle:vertical { \n" " background-color: rgba(1, 22, 51, 0.5);\n" " border-radius:4.905px;\n" " border: 0px solid red; \n" " \n" " \n" " }\n" "QScrollBar::add-line:vertical { \n" " height: 0px;\n" " subcontrol-position: bottom; \n" " subcontrol-origin: margin; \n" " \n" " } \n" "QScrollBar::sub-line:vertical { \n" " " " height: 0 px; \n" " subcontrol-position: top; \n" " subcontrol-origin: margin; \n" " }\n" "\n" "QScrollBar:horizontal { \n" " border: none;\n" " background: white;\n" " \n" " \n" " }\n" "QScrollBar::handle:horizontal { \n" " background-color: rgba(1, 22, 51, 0.5);\n" " border: 0px solid red; \n" " border-radius:4.905px;\n" " \n" " }\n" "QScrollBar::add-line:horizontal { \n" " height: 0px;\n" " subcontrol-position: bottom; \n" " subcontrol-origin: margin; \n" " \n" " } \n" "QScrollBa" "r::sub-line:horizontal { \n" " height: 0 px; \n" " subcontrol-position: top; \n" " subcontrol-origin: margin; \n" " }\n" "\n" "")); splitter->setOrientation(Qt::Horizontal); splitter_2 = new QSplitter(splitter); splitter_2->setObjectName(QString::fromUtf8("splitter_2")); splitter_2->setOrientation(Qt::Vertical); tabWidget = new QTabWidget(splitter_2); tabWidget->setObjectName(QString::fromUtf8("tabWidget")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(tabWidget->sizePolicy().hasHeightForWidth()); tabWidget->setSizePolicy(sizePolicy); tabWidget->setMinimumSize(QSize(0, 0)); tabWidget->setMaximumSize(QSize(16777215, 16777215)); tabWidget->setStyleSheet(QString::fromUtf8("QTabBar::tab {\n" " border-radius: 0px;\n" " padding: 5px 15px;\n" " color: #1F2046;\n" "\n" "}\n" "\n" "QTabBar::tab:selected {\n" " background-color: #BCBDBD;\n" "}\n" "\n" "QTabBar::tab:!selected {\n" " background-color: #E3E4E4;\n" "}\n" "\n" "QTabWidget::pane {\n" " top: -1px;\n" " bottom: 0px;\n" " border: 0px solid #BCBDBD;\n" " padding: 0px;\n" " margin: -10px -9px -10px -9px;\n" "}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "")); tab = new QWidget(); tab->setObjectName(QString::fromUtf8("tab")); verticalLayout_2 = new QVBoxLayout(tab); verticalLayout_2->setSpacing(6); verticalLayout_2->setContentsMargins(11, 11, 11, 11); verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2")); verticalLayout = new QVBoxLayout(); verticalLayout->setSpacing(6); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); horizontalLayout_2 = new QHBoxLayout(); horizontalLayout_2->setSpacing(6); horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); hinButton = new QPushButton(tab); hinButton->setObjectName(QString::fromUtf8("hinButton")); hinButton->setMaximumSize(QSize(16777215, 16777215)); hinButton->setStyleSheet(QString::fromUtf8("QPushButton{\n" "background-color:rgb(227, 228, 228);\n" "border:0px;\n" "color: rgb(32, 33, 72);\n" "height:26.96px;\n" "width: 113.5px; \n" "padding-top:1px; \n" "border-radius:4.8px; \n" "padding-left:1.3px; \n" "selection-color: rgb(32, 33, 72);\n" " selection-background-color: rgb(136, 138, 133);\n" "margin-top: 5px;\n" "} \n" "QPushButton:checked{\n" "background-color: rgb(136, 138, 133);\n" "}\n" "QPushButton:pressed {\n" "background-color: rgb(136, 138, 133);\n" "}")); hinButton->setCheckable(true); horizontalLayout_2->addWidget(hinButton); sanButton = new QPushButton(tab); sanButton->setObjectName(QString::fromUtf8("sanButton")); sanButton->setMaximumSize(QSize(16777215, 16777215)); sanButton->setStyleSheet(QString::fromUtf8("QPushButton{background-color:rgb(227, 228, 228);border:0px; color: rgb(32, 33, 72); width: 113.5px;height:26.96px; padding-top:1px; border-radius:4.8px; padding-left:1.3px; selection-color: rgb(32, 33, 72); selection-background-color: rgb(136, 138, 133); margin-top: 5px;\n" "} QPushButton:checked{background-color: rgb(136, 138, 133);} QPushButton:pressed {background-color: rgb(136, 138, 133);}")); sanButton->setCheckable(true); sanButton->setChecked(false); horizontalLayout_2->addWidget(sanButton); verticalLayout->addLayout(horizontalLayout_2); textEdit = new QTextEdit(tab); textEdit->setObjectName(QString::fromUtf8("textEdit")); sizePolicy.setHeightForWidth(textEdit->sizePolicy().hasHeightForWidth()); textEdit->setSizePolicy(sizePolicy); textEdit->setMinimumSize(QSize(0, 0)); textEdit->setMaximumSize(QSize(16777215, 16777215)); textEdit->setFont(font); textEdit->setStyleSheet(QString::fromUtf8("QTextEdit{\n" " color:rgb(32, 33, 72);\n" "\n" " background-color:white;\n" "}\n" "QScrollBar:vertical { \n" " border: none;\n" " background: white;\n" " \n" " }\n" "QScrollBar::handle:vertical { \n" " background-color: rgba(1, 22, 51, 0.5);\n" " min-height: 273.41px;\n" " border: 0px solid red; \n" " border-radius:4.905px;\n" " }\n" "QScrollBar::add-line:vertical { \n" " height: 0px;\n" " subcontrol-position: bottom; \n" " subcontrol-origin: margin; \n" " \n" " } \n" "QScrollBar::sub-line:vertical { \n" " height: 0 px; \n" " " " subcontrol-position: top; \n" " subcontrol-origin: margin; \n" " }\n" "")); textEdit->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); textEdit->setReadOnly(true); verticalLayout->addWidget(textEdit); verticalLayout_2->addLayout(verticalLayout); tabWidget->addTab(tab, QString()); tab_2 = new QWidget(); tab_2->setObjectName(QString::fromUtf8("tab_2")); verticalLayout_3 = new QVBoxLayout(tab_2); verticalLayout_3->setSpacing(6); verticalLayout_3->setContentsMargins(11, 11, 11, 11); verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3")); lineEditSearch = new QLineEdit(tab_2); lineEditSearch->setObjectName(QString::fromUtf8("lineEditSearch")); lineEditSearch->setStyleSheet(QString::fromUtf8("#lineEditSearch{\n" "background-color: rgb(255, 255, 255);\n" "color:black;\n" "border:0px;\n" "height:26.96px;\n" "padding-top:1pxx; \n" "border-radius:4.8px; \n" "padding-left:1.3px; \n" "margin-top: 8px;\n" "\n" "}")); verticalLayout_3->addWidget(lineEditSearch); treeView = new QTreeView(tab_2); treeView->setObjectName(QString::fromUtf8("treeView")); sizePolicy.setHeightForWidth(treeView->sizePolicy().hasHeightForWidth()); treeView->setSizePolicy(sizePolicy); treeView->setMinimumSize(QSize(0, 0)); treeView->setMaximumSize(QSize(16777215, 16777215)); treeView->setStyleSheet(QString::fromUtf8("#treeView {\n" " color:rgb(32, 33, 72);\n" " border: 5px solid #BCBDBD;\n" " background-color:white;\n" " margin: 0px;\n" "}\n" "\n" "QHeaderView {\n" " background-color: #ffffff;\n" "}\n" "\n" "\n" "QHeaderView::section {\n" " background-color: #ffffff;\n" " color: #202148;\n" " font-size: 15px;\n" " line-height: 18px;\n" " border: none;\n" " margin: 11px 242px 13px 20px;\n" "}\n" "\n" "QTreeView::item {\n" " padding: 12px 100px 12px 17px;\n" " border: 0.5px solid #202148;\n" " color: #202148;\n" " font-size: 15px;\n" "}\n" "\n" "QTreeView::branch {\n" " background-color: white;\n" "}\n" "\n" "QTreeView::item:selected{\n" " background: #0267d4;\n" " color: #ffffff;\n" "}\n" "\n" "QTreeView::branch:open:has-children:!has-siblings,\n" "QTreeView::branch:open:has-children:has-siblings {\n" " image: url(\":/Images/Resources/stylesheet-branch-open.png\");\n" "}\n" "\n" "QTreeView::branch:has-children:!has-siblings:closed,\n" "QTreeView::branch:closed:has-children:has-siblings {\n" " image: url(\":/Imag" "es/Resources/stylesheet-branch-closed.png\");\n" "}\n" "QScrollBar:vertical { \n" " border: none;\n" " background: white;\n" " \n" " }\n" "QScrollBar::handle:vertical { \n" " background-color: rgba(1, 22, 51, 0.5);\n" " min-height: 50px;\n" " max-height: 300px;\n" " border: 0px solid red; \n" " border-radius:4.905px;\n" " }\n" "QScrollBar::add-line:vertical { \n" " height: 0px;\n" " subcontrol-position: bottom; \n" " subcontrol-origin: margin; \n" " \n" " } \n" "QScrollBar::sub-line:vertical { \n" " height: 0 px; \n" "" " subcontrol-position: top; \n" " subcontrol-origin: margin; \n" " }\n" "")); verticalLayout_3->addWidget(treeView); tabWidget->addTab(tab_2, QString()); splitter_2->addWidget(tabWidget); textEdit_dict = new QTextEdit(splitter_2); textEdit_dict->setObjectName(QString::fromUtf8("textEdit_dict")); textEdit_dict->setStyleSheet(QString::fromUtf8("QTextEdit{\n" "color:#18182F;\n" " border: 5px solid #BCBDBD;\n" " background-color:white;\n" "}\n" "QScrollBar:vertical { \n" " border: none;\n" " background: white;\n" " \n" " }\n" "QScrollBar::handle:vertical { \n" " background-color: rgba(1, 22, 51, 0.5);\n" " min-height: 273.41px;\n" " border: 0px solid red; \n" " border-radius:4.905px;\n" " \n" " }\n" "QScrollBar::add-line:vertical { \n" " height: 0px;\n" " subcontrol-position: bottom; \n" " subcontrol-origin: margin; \n" " \n" " } \n" "QScrollBar::sub-line:vertical { \n" " " " height: 0 px; \n" " subcontrol-position: top; \n" " subcontrol-origin: margin; \n" " }\n" "\n" "\n" "")); textEdit_dict->setReadOnly(true); splitter_2->addWidget(textEdit_dict); splitter->addWidget(splitter_2); tabWidget_2 = new QTabWidget(splitter); tabWidget_2->setObjectName(QString::fromUtf8("tabWidget_2")); sizePolicy.setHeightForWidth(tabWidget_2->sizePolicy().hasHeightForWidth()); tabWidget_2->setSizePolicy(sizePolicy); tabWidget_2->setMinimumSize(QSize(0, 0)); tabWidget_2->setMaximumSize(QSize(16777215, 16777215)); tabWidget_2->setStyleSheet(QString::fromUtf8("background-color:white; color:black;\n" "")); tabWidget_2->setTabsClosable(true); tabWidget_2->setMovable(true); tabWidget_2->setTabBarAutoHide(false); tab_5 = new QWidget(); tab_5->setObjectName(QString::fromUtf8("tab_5")); gridLayout_4 = new QGridLayout(tab_5); gridLayout_4->setSpacing(6); gridLayout_4->setContentsMargins(11, 11, 11, 11); gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); textBrowser = new QTextBrowser(tab_5); textBrowser->setObjectName(QString::fromUtf8("textBrowser")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Expanding); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); sizePolicy1.setHeightForWidth(textBrowser->sizePolicy().hasHeightForWidth()); textBrowser->setSizePolicy(sizePolicy1); textBrowser->setMinimumSize(QSize(400, 0)); QFont font2; font2.setFamily(QString::fromUtf8("WorkSans,Sans")); font2.setPointSize(20); font2.setBold(false); font2.setItalic(false); font2.setWeight(50); textBrowser->setFont(font2); textBrowser->setMouseTracking(true); textBrowser->setStyleSheet(QString::fromUtf8("QTextBrowser{\n" " border: 0px;\n" " background-color:white;\n" "font-size: 20pt;\n" "}\n" "QScrollBar:vertical { \n" " border: none;\n" " background: white;\n" " \n" " }\n" "QScrollBar::handle:vertical { \n" " background-color: rgba(1, 22, 51, 0.5);\n" " \n" " border: 0px solid red; \n" " \n" " \n" " }\n" "QScrollBar::add-line:vertical { \n" " height: 0px;\n" " subcontrol-position: bottom; \n" " subcontrol-origin: margin; \n" " \n" " } \n" "QScrollBar::sub-line:vertical { \n" " height: 0 px; \n" " " " subcontrol-position: top; \n" " subcontrol-origin: margin; \n" " }\n" "")); textBrowser->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); textBrowser->setUndoRedoEnabled(true); textBrowser->setReadOnly(false); textBrowser->setAcceptRichText(true); textBrowser->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); gridLayout_4->addWidget(textBrowser, 0, 0, 1, 1); tabWidget_2->addTab(tab_5, QString()); splitter->addWidget(tabWidget_2); graphicsView = new QGraphicsView(splitter); graphicsView->setObjectName(QString::fromUtf8("graphicsView")); sizePolicy.setHeightForWidth(graphicsView->sizePolicy().hasHeightForWidth()); graphicsView->setSizePolicy(sizePolicy); graphicsView->setMinimumSize(QSize(0, 0)); graphicsView->setMaximumSize(QSize(16777215, 16777215)); graphicsView->setStyleSheet(QString::fromUtf8("QGraphicsView{background-color:white;}\n" "QScrollBar:vertical { \n" " border: none;\n" " background: white;\n" " \n" " }\n" "QScrollBar::handle:vertical { \n" " background-color: rgba(1, 22, 51, 0.5);\n" " \n" " border: 0px solid red; \n" " \n" " \n" " }\n" "QScrollBar::add-line:vertical { \n" " height: 0px;\n" " subcontrol-position: bottom; \n" " subcontrol-origin: margin; \n" " \n" " } \n" "QScrollBar::sub-line:vertical { \n" " height: 0 px; \n" " subcontrol-position: top; \n" " " " subcontrol-origin: margin; \n" " }\n" "\n" "QScrollBar:horizontal { \n" " border: none;\n" " background: white;\n" " \n" " }\n" "QScrollBar::handle:horizontal { \n" " background-color: rgba(1, 22, 51, 0.5);\n" " border: 0px solid red; \n" " \n" " }\n" "QScrollBar::add-line:horizontal { \n" " height: 0px;\n" " subcontrol-position: bottom; \n" " subcontrol-origin: margin; \n" " \n" " } \n" "QScrollBar::sub-line:horizontal { \n" " height: 0 px; \n" " subcontrol-position: top; \n" " s" "ubcontrol-origin: margin; \n" " }\n" "\n" "")); graphicsView->setSizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored); graphicsView->setAlignment(Qt::AlignCenter); graphicsView->setDragMode(QGraphicsView::ScrollHandDrag); graphicsView->setTransformationAnchor(QGraphicsView::AnchorViewCenter); graphicsView->setResizeAnchor(QGraphicsView::AnchorViewCenter); splitter->addWidget(graphicsView); verticalLayout_4->addWidget(splitter); verticalLayout_5->addLayout(verticalLayout_4); Buttom_Slider = new QHBoxLayout(); Buttom_Slider->setSpacing(6); Buttom_Slider->setObjectName(QString::fromUtf8("Buttom_Slider")); Buttom_Slider->setSizeConstraint(QLayout::SetDefaultConstraint); lineEdit = new QLineEdit(centralWidget); lineEdit->setObjectName(QString::fromUtf8("lineEdit")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Fixed); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); sizePolicy2.setHeightForWidth(lineEdit->sizePolicy().hasHeightForWidth()); lineEdit->setSizePolicy(sizePolicy2); lineEdit->setMinimumSize(QSize(0, 0)); lineEdit->setMaximumSize(QSize(16777215, 16777215)); lineEdit->setStyleSheet(QString::fromUtf8("background-color:white;\n" "color: rgb(0, 0, 0); height:37.39px; width: 469.37px; border:0px; padding-left:7.81px;")); Buttom_Slider->addWidget(lineEdit); lineEdit_3 = new QLineEdit(centralWidget); lineEdit_3->setObjectName(QString::fromUtf8("lineEdit_3")); lineEdit_3->setMaximumSize(QSize(119, 16777215)); lineEdit_3->setAutoFillBackground(false); lineEdit_3->setStyleSheet(QString::fromUtf8("color: rgb(0, 0, 0);\n" "background-color: rgb(255, 255, 255); height:37.39px; width:32.73px; border:0px; padding-left:7.81px;")); Buttom_Slider->addWidget(lineEdit_3); lineEdit_2 = new QLineEdit(centralWidget); lineEdit_2->setObjectName(QString::fromUtf8("lineEdit_2")); lineEdit_2->setMinimumSize(QSize(0, 0)); lineEdit_2->setMaximumSize(QSize(184, 16777215)); lineEdit_2->setStyleSheet(QString::fromUtf8("background-color:white;\n" "color: rgb(0, 0, 0); height:37.39px; border:0px; width:184.8px; padding-left:7.81px;")); Buttom_Slider->addWidget(lineEdit_2); horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); Buttom_Slider->addItem(horizontalSpacer_2); groupBox = new QGroupBox(centralWidget); groupBox->setObjectName(QString::fromUtf8("groupBox")); QSizePolicy sizePolicy3(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy3.setHorizontalStretch(0); sizePolicy3.setVerticalStretch(0); sizePolicy3.setHeightForWidth(groupBox->sizePolicy().hasHeightForWidth()); groupBox->setSizePolicy(sizePolicy3); groupBox->setMinimumSize(QSize(264, 37)); groupBox->setMaximumSize(QSize(264, 37)); groupBox->setStyleSheet(QString::fromUtf8("QGroupBox {\n" " background: white;\n" " padding-top:15px;\n" " margin-top:-15px; \n" " height:37.9px;\n" " font-size: 11pt !important;\n" "}\n" "")); horizontalLayout_3 = new QHBoxLayout(groupBox); horizontalLayout_3->setSpacing(6); horizontalLayout_3->setContentsMargins(11, 11, 11, 11); horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3")); zoom_Out_Button = new QPushButton(groupBox); zoom_Out_Button->setObjectName(QString::fromUtf8("zoom_Out_Button")); zoom_Out_Button->setStyleSheet(QString::fromUtf8("#zoom_Out_Button {\n" " color: #202148;\n" " background: white;\n" " font-size: 24px;\n" " padding-right: 12px;\n" " padding-left: 12px;\n" " border: none;\n" "}")); horizontalLayout_3->addWidget(zoom_Out_Button); horizontalSlider = new QSlider(groupBox); horizontalSlider->setObjectName(QString::fromUtf8("horizontalSlider")); horizontalSlider->setStyleSheet(QString::fromUtf8("QSlider {\n" " background: white;\n" "}\n" "\n" "QSlider::groove:horizontal {\n" "border: none;\n" "background: rgba(1, 22, 51, 0.72);\n" "height: 3.47px;\n" "border-radius: 4px;\n" "}\n" "\n" "QSlider::sub-page:horizontal {\n" "height: 10px;\n" "border-radius: 4px;\n" "}\n" "\n" "QSlider::add-page:horizontal {\n" "height: 10px;\n" "border-radius: 4px;\n" "}\n" "\n" "QSlider::handle:horizontal {\n" "background: #202148;\n" "border-radius: 1.7px;\n" "width: 10px;\n" "height: 26px;\n" "margin-top: -10px;\n" "margin-bottom: -10px;\n" "}\n" "\n" "QSlider::sub-page:horizontal:disabled {\n" "background: grey;\n" "}\n" "\n" "QSlider::add-page:horizontal:disabled {\n" "background: grey;\n" "}\n" "\n" "QSlider::handle:horizontal:disabled {\n" "background: grey;\n" "}\n" "")); horizontalSlider->setMinimum(1); horizontalSlider->setMaximum(100); horizontalSlider->setSingleStep(10); horizontalSlider->setPageStep(0); horizontalSlider->setOrientation(Qt::Horizontal); horizontalLayout_3->addWidget(horizontalSlider); zoom_In_Button = new QPushButton(groupBox); zoom_In_Button->setObjectName(QString::fromUtf8("zoom_In_Button")); zoom_In_Button->setStyleSheet(QString::fromUtf8("#zoom_In_Button {\n" " color: #202148;\n" " background: white;\n" " font-size: 24px;\n" " padding-right: 12px;\n" " padding-left: 12px;\n" " border: none;\n" "}")); horizontalLayout_3->addWidget(zoom_In_Button); zoom_level_value = new QLabel(groupBox); zoom_level_value->setObjectName(QString::fromUtf8("zoom_level_value")); sizePolicy3.setHeightForWidth(zoom_level_value->sizePolicy().hasHeightForWidth()); zoom_level_value->setSizePolicy(sizePolicy3); zoom_level_value->setStyleSheet(QString::fromUtf8("#zoom_level_value {\n" " color: #202148;\n" " background: white;\n" "}")); horizontalLayout_3->addWidget(zoom_level_value); Buttom_Slider->addWidget(groupBox); verticalLayout_5->addLayout(Buttom_Slider); MainWindow->setCentralWidget(centralWidget); menuBar = new QMenuBar(MainWindow); menuBar->setObjectName(QString::fromUtf8("menuBar")); menuBar->setGeometry(QRect(0, 0, 1366, 50)); menuBar->setStyleSheet(QString::fromUtf8("QMenuBar{\n" "font-size:17px;\n" "}\n" "QMenuBar::item{\n" " /* spacing between menu bar items */\n" "padding: 15px 15px 15px 15px;\n" "background: transparent;\n" "}\n" "QMenuBar::item:selected{\n" " background-color: rgb(52,73,94);\n" "}\n" "QMenu::item {\n" " spacing: 2px; /* spacing between menu bar items */\n" " padding: 10px 85px 10px 20px;\n" " background: transparent;\n" "}\n" "QMenu::item:selected{\n" " background-color: rgb(52,73,94);\n" " border-top: none;\n" " border-left:none;\n" " border-bottom:none;\n" " border-left:3px solid #EEF0F2;\n" "}\n" "\n" "\n" "\n" "\n" "\n" "")); menuCreateReports = new QMenu(menuBar); menuCreateReports->setObjectName(QString::fromUtf8("menuCreateReports")); menuCreateReports->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuFontAndLayout = new QMenu(menuBar); menuFontAndLayout->setObjectName(QString::fromUtf8("menuFontAndLayout")); menuFontAndLayout->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuTables = new QMenu(menuFontAndLayout); menuTables->setObjectName(QString::fromUtf8("menuTables")); menuTables->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuGit = new QMenu(menuBar); menuGit->setObjectName(QString::fromUtf8("menuGit")); menuGit->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuEdit = new QMenu(menuBar); menuEdit->setObjectName(QString::fromUtf8("menuEdit")); menuEdit->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuDownload = new QMenu(menuBar); menuDownload->setObjectName(QString::fromUtf8("menuDownload")); menuDownload->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuHelp = new QMenu(menuBar); menuHelp->setObjectName(QString::fromUtf8("menuHelp")); menuHelp->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuInstallation_Guide = new QMenu(menuHelp); menuInstallation_Guide->setObjectName(QString::fromUtf8("menuInstallation_Guide")); menuInstallation_Guide->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuSelectLanguage = new QMenu(menuBar); menuSelectLanguage->setObjectName(QString::fromUtf8("menuSelectLanguage")); menuSelectLanguage->setStyleSheet(QString::fromUtf8("font-size: 17px;")); menuOCR_Correction_Window = new QMenu(menuBar); menuOCR_Correction_Window->setObjectName(QString::fromUtf8("menuOCR_Correction_Window")); menuOCR_Correction_Window->setStyleSheet(QString::fromUtf8("font-size: 17px;\n" "\n" "")); menuOCR_Correction_Window->setToolTipsVisible(true); menuRecent_Project = new QMenu(menuOCR_Correction_Window); menuRecent_Project->setObjectName(QString::fromUtf8("menuRecent_Project")); menuRecent_Project->setStyleSheet(QString::fromUtf8("font-size: 17px;")); MainWindow->setMenuBar(menuBar); mainToolBar = new QToolBar(MainWindow); mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); mainToolBar->setStyleSheet(QString::fromUtf8("QToolBar {\n" "spacing: 3px; /* spacing between items in the tool bar */\n" "padding: 5px; \n" "color: rgb(0, 0, 0);\n" "}\n" "QToolTip{\n" "color:#202148;\n" "background-color: #EEF0F2;\n" "}")); mainToolBar->setIconSize(QSize(32, 32)); MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); menuBar->addAction(menuOCR_Correction_Window->menuAction()); menuBar->addAction(menuEdit->menuAction()); menuBar->addAction(menuSelectLanguage->menuAction()); menuBar->addAction(menuCreateReports->menuAction()); menuBar->addAction(menuFontAndLayout->menuAction()); menuBar->addAction(menuGit->menuAction()); menuBar->addAction(menuDownload->menuAction()); menuBar->addAction(menuHelp->menuAction()); menuCreateReports->addAction(actionAccuracyLog); menuCreateReports->addAction(actionViewAverageAccuracies); menuFontAndLayout->addAction(actionAllFontProperties); menuFontAndLayout->addAction(actionBold); menuFontAndLayout->addAction(actionUnBold); menuFontAndLayout->addAction(actionItalic); menuFontAndLayout->addAction(actionHighlight); menuFontAndLayout->addSeparator(); menuFontAndLayout->addAction(actionLeftAlign); menuFontAndLayout->addAction(actionRightAlign); menuFontAndLayout->addAction(actionCentreAlign); menuFontAndLayout->addAction(actionSuperscript); menuFontAndLayout->addAction(actionSubscript); menuFontAndLayout->addAction(actionInsert_Horizontal_Line); menuFontAndLayout->addAction(actionFontBlack); menuFontAndLayout->addAction(actionInsert_Tab_Space); menuFontAndLayout->addAction(menuTables->menuAction()); menuTables->addAction(actionInsert_Table_2); menuTables->addAction(actionInsert_Columnleft); menuTables->addAction(actionInsert_Columnright); menuTables->addAction(actionInsert_Rowabove); menuTables->addAction(actionInsert_Rowbelow); menuTables->addAction(actionRemove_Column); menuTables->addAction(actionRemove_Row); menuGit->addAction(actionFetch_2); menuGit->addAction(actionVerifier_Turn_In); menuGit->addAction(actionTurn_In); menuEdit->addAction(actionUndo); menuEdit->addAction(actionRedo); menuEdit->addSeparator(); menuEdit->addAction(actionFind_and_Replace); menuEdit->addSeparator(); menuEdit->addAction(actionUndo_Global_Replace); menuEdit->addAction(actionUpload); menuDownload->addAction(actionas_PDF); menuHelp->addAction(actionGet_Help); menuHelp->addAction(menuInstallation_Guide->menuAction()); menuHelp->addAction(actionTutorial); menuHelp->addAction(actionShortcut_Guide); menuInstallation_Guide->addAction(actionLinux); menuInstallation_Guide->addAction(actionWindows); menuSelectLanguage->addAction(actionSanskrit_2); menuSelectLanguage->addAction(actionHindi); menuSelectLanguage->addAction(actionEnglish); menuOCR_Correction_Window->addAction(actionNew); menuOCR_Correction_Window->addAction(actionNew_Project); menuOCR_Correction_Window->addAction(actionOpen_Project); menuOCR_Correction_Window->addAction(menuRecent_Project->menuAction()); menuOCR_Correction_Window->addAction(actionSave); menuOCR_Correction_Window->addAction(actionSave_As); menuOCR_Correction_Window->addAction(actionSpell_Check); menuOCR_Correction_Window->addAction(actionLoad_Next_Page); menuOCR_Correction_Window->addAction(actionLoad_Prev_Page); menuOCR_Correction_Window->addSeparator(); menuOCR_Correction_Window->addAction(actionToDevanagari); menuOCR_Correction_Window->addAction(actionToSlp1); menuOCR_Correction_Window->addAction(actionLoadGDocPage); menuOCR_Correction_Window->addAction(actionLoadData); menuOCR_Correction_Window->addAction(actionLoadDict); menuOCR_Correction_Window->addAction(actionLoadOCRWords); menuOCR_Correction_Window->addAction(actionLoadDomain); menuOCR_Correction_Window->addAction(actionLoadSubPS); menuOCR_Correction_Window->addAction(actionLoadConfusions); menuOCR_Correction_Window->addAction(actionSugg); menuRecent_Project->addAction(action1); mainToolBar->addAction(actionNew); mainToolBar->addAction(actionOpen_Project); mainToolBar->addAction(actionSave); mainToolBar->addAction(actionSave_As); mainToolBar->addAction(actionLoadData); mainToolBar->addSeparator(); mainToolBar->addAction(actionLoad_Prev_Page); mainToolBar->addAction(actionLoad_Next_Page); mainToolBar->addSeparator(); mainToolBar->addAction(actionUndo); mainToolBar->addAction(actionRedo); mainToolBar->addAction(actionFind_and_Replace); mainToolBar->addSeparator(); mainToolBar->addAction(actionLoadGDocPage); mainToolBar->addAction(actionToDevanagari); mainToolBar->addSeparator(); mainToolBar->addAction(actionAllFontProperties); mainToolBar->addAction(actionFont_Color); mainToolBar->addAction(actionBold); mainToolBar->addAction(actionItalic); mainToolBar->addAction(actionUnBold); mainToolBar->addAction(actionFontBlack); mainToolBar->addAction(actionSuperscript); mainToolBar->addAction(actionSubscript); mainToolBar->addSeparator(); mainToolBar->addAction(actionLeftAlign); mainToolBar->addAction(actionCentreAlign); mainToolBar->addAction(actionRightAlign); mainToolBar->addAction(justify); mainToolBar->addAction(actionInsert_Horizontal_Line); mainToolBar->addSeparator(); mainToolBar->addAction(actionHighlight); mainToolBar->addAction(actionSymbols); mainToolBar->addSeparator(); mainToolBar->addAction(actionZoom_In); mainToolBar->addAction(actionZoom_Out); mainToolBar->addSeparator(); mainToolBar->addAction(actionGet_Help); retranslateUi(MainWindow); tabWidget->setCurrentIndex(1); tabWidget_2->setCurrentIndex(0); QMetaObject::connectSlotsByName(MainWindow); } // setupUi void retranslateUi(QMainWindow *MainWindow) { MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", nullptr)); actionOpen_Project->setText(QApplication::translate("MainWindow", "Open Project", nullptr)); #ifndef QT_NO_SHORTCUT actionOpen_Project->setShortcut(QApplication::translate("MainWindow", "Ctrl+O", nullptr)); #endif // QT_NO_SHORTCUT actionSave->setText(QApplication::translate("MainWindow", "Save", nullptr)); #ifndef QT_NO_SHORTCUT actionSave->setShortcut(QApplication::translate("MainWindow", "Ctrl+S", nullptr)); #endif // QT_NO_SHORTCUT actionSave_As->setText(QApplication::translate("MainWindow", "Save As", nullptr)); #ifndef QT_NO_SHORTCUT actionSave_As->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+S", nullptr)); #endif // QT_NO_SHORTCUT actionNew->setText(QApplication::translate("MainWindow", "New", nullptr)); #ifndef QT_NO_SHORTCUT actionNew->setShortcut(QApplication::translate("MainWindow", "Ctrl+N", nullptr)); #endif // QT_NO_SHORTCUT actionSpell_Check->setText(QApplication::translate("MainWindow", "Spell Check(CntrlShftC)", nullptr)); #ifndef QT_NO_SHORTCUT actionSpell_Check->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+C", nullptr)); #endif // QT_NO_SHORTCUT actionLoad_Next_Page->setText(QApplication::translate("MainWindow", "Page(CntlShiftR)>>", nullptr)); #ifndef QT_NO_TOOLTIP actionLoad_Next_Page->setToolTip(QApplication::translate("MainWindow", "Page(CntlShiftR)>>", nullptr)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_SHORTCUT actionLoad_Next_Page->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+R", nullptr)); #endif // QT_NO_SHORTCUT actionLoad_Prev_Page->setText(QApplication::translate("MainWindow", "<<Page(CntrlShftL)", nullptr)); #ifndef QT_NO_TOOLTIP actionLoad_Prev_Page->setToolTip(QApplication::translate("MainWindow", "<<Page(CntrlShftL)", nullptr)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_SHORTCUT actionLoad_Prev_Page->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+L", nullptr)); #endif // QT_NO_SHORTCUT actionLoadGDocPage->setText(QApplication::translate("MainWindow", "SaveLoadPWords(CntrlShftP)", nullptr)); #ifndef QT_NO_SHORTCUT actionLoadGDocPage->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+P", nullptr)); #endif // QT_NO_SHORTCUT actionToDevanagari->setText(QApplication::translate("MainWindow", "toDevanagari(CntrlD)", nullptr)); #ifndef QT_NO_SHORTCUT actionToDevanagari->setShortcut(QApplication::translate("MainWindow", "Ctrl+D", nullptr)); #endif // QT_NO_SHORTCUT actionLoadData->setText(QApplication::translate("MainWindow", "LoadData", nullptr)); actionLoadDict->setText(QApplication::translate("MainWindow", "LoadDict", nullptr)); actionLoadOCRWords->setText(QApplication::translate("MainWindow", "LoadOCRWords", nullptr)); actionLoadDomain->setText(QApplication::translate("MainWindow", "LoadDomain", nullptr)); actionLoadSubPS->setText(QApplication::translate("MainWindow", "LoadSubPS", nullptr)); actionLoadConfusions->setText(QApplication::translate("MainWindow", "LoadConfusions", nullptr)); actionSugg->setText(QApplication::translate("MainWindow", "sugg", nullptr)); #ifndef QT_NO_SHORTCUT actionSugg->setShortcut(QApplication::translate("MainWindow", "Menu", nullptr)); #endif // QT_NO_SHORTCUT actionCreateBest2OCR->setText(QApplication::translate("MainWindow", "CreateBest2OCR", nullptr)); actionToSlp1->setText(QApplication::translate("MainWindow", "toSlp1(CntrlG)", nullptr)); #ifndef QT_NO_SHORTCUT actionToSlp1->setShortcut(QApplication::translate("MainWindow", "Ctrl+G", nullptr)); #endif // QT_NO_SHORTCUT actionCreateSuggestionLog->setText(QApplication::translate("MainWindow", "CreateSuggestionLog", nullptr)); actionCreateSuggestionLogNearestPriority->setText(QApplication::translate("MainWindow", "CreateSuggestionLogNearestPriority", nullptr)); actionErrorDetectionRep->setText(QApplication::translate("MainWindow", "ErrorDetectionRep", nullptr)); actionErrorDetectWithoutAdaptation->setText(QApplication::translate("MainWindow", "ErrorDetectWithoutAdaptation", nullptr)); actionCPair->setText(QApplication::translate("MainWindow", "CPair", nullptr)); actionToSlp1_2->setText(QApplication::translate("MainWindow", "toSlp1", nullptr)); actionToDev->setText(QApplication::translate("MainWindow", "toDev", nullptr)); actionExtractDev->setText(QApplication::translate("MainWindow", "ExtractDevWords", nullptr)); #ifndef QT_NO_TOOLTIP actionExtractDev->setToolTip(QApplication::translate("MainWindow", "ExtractDevWords", nullptr)); #endif // QT_NO_TOOLTIP actionPrimarySecOCRPair->setText(QApplication::translate("MainWindow", "PrimarySecOCRPairs", nullptr)); actionCPairIEROcrVsCorrect->setText(QApplication::translate("MainWindow", "CPairIEROcrVsCorrect", nullptr)); actionEditDistRep->setText(QApplication::translate("MainWindow", "EditDistRep", nullptr)); actionConfusionFreqHist->setText(QApplication::translate("MainWindow", "ConfusionFreqHist", nullptr)); actionCPairGEROcrVsCorrect->setText(QApplication::translate("MainWindow", "CPairGEROcrVsCorrect", nullptr)); actionFilterOutGT50EditDisPairs->setText(QApplication::translate("MainWindow", "FilterOutGT50EditDisPairs", nullptr)); actionErrorDetectionRepUniq->setText(QApplication::translate("MainWindow", "ErrorSuggRepUniq", nullptr)); actionAllFontProperties->setText(QApplication::translate("MainWindow", "AllFontProperties", nullptr)); actionBold->setText(QApplication::translate("MainWindow", "Bold", nullptr)); #ifndef QT_NO_TOOLTIP actionBold->setToolTip(QApplication::translate("MainWindow", "Bold/Unbold - Ctrl+B", nullptr)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_SHORTCUT actionBold->setShortcut(QApplication::translate("MainWindow", "Ctrl+B", nullptr)); #endif // QT_NO_SHORTCUT actionUnBold->setText(QApplication::translate("MainWindow", "UnBold", nullptr)); #ifndef QT_NO_TOOLTIP actionUnBold->setToolTip(QApplication::translate("MainWindow", "UnBold (Deprecated - Use Bold button for bold/unbold)", nullptr)); #endif // QT_NO_TOOLTIP actionLeftAlign->setText(QApplication::translate("MainWindow", "LeftAlign", nullptr)); actionRightAlign->setText(QApplication::translate("MainWindow", "RightAlign", nullptr)); actionCentreAlign->setText(QApplication::translate("MainWindow", "CentreAlign", nullptr)); actionJusitfiedAlign->setText(QApplication::translate("MainWindow", "JusitfiedAlign", nullptr)); actionAccuracyLog->setText(QApplication::translate("MainWindow", "AccuracyLog", nullptr)); actionView_File_Hierarchy->setText(QApplication::translate("MainWindow", "View File Hierarchy", nullptr)); actionTurn_In->setText(QApplication::translate("MainWindow", "Submit Corrector", nullptr)); actionFetch->setText(QApplication::translate("MainWindow", "Fetch", nullptr)); actionCompare_Verifier->setText(QApplication::translate("MainWindow", "Verifier Diff View", nullptr)); actionCompare_Corrector->setText(QApplication::translate("MainWindow", "Corrector Diff View", nullptr)); actionAverage_Accuracy->setText(QApplication::translate("MainWindow", "Average Accuracy", nullptr)); actionView_Comments->setText(QApplication::translate("MainWindow", "View Comments", nullptr)); actionCommit->setText(QApplication::translate("MainWindow", "Commit", nullptr)); actionFetch_2->setText(QApplication::translate("MainWindow", "Pull", nullptr)); actionPush->setText(QApplication::translate("MainWindow", "Push", nullptr)); actionVerifier_Turn_In->setText(QApplication::translate("MainWindow", "Submit Verifier", nullptr)); actionHighlight->setText(QApplication::translate("MainWindow", "Highlight", nullptr)); #ifndef QT_NO_TOOLTIP actionHighlight->setToolTip(QApplication::translate("MainWindow", "Highlight (Ctrl+H)", nullptr)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_SHORTCUT actionHighlight->setShortcut(QApplication::translate("MainWindow", "Ctrl+H", nullptr)); #endif // QT_NO_SHORTCUT actionZoom_In->setText(QApplication::translate("MainWindow", "Zoom In", nullptr)); #ifndef QT_NO_TOOLTIP actionZoom_In->setToolTip(QApplication::translate("MainWindow", "Zoom In (Ctrl + +)", nullptr)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_SHORTCUT actionZoom_In->setShortcut(QApplication::translate("MainWindow", "Ctrl++", nullptr)); #endif // QT_NO_SHORTCUT actionZoom_Out->setText(QApplication::translate("MainWindow", "Zoom_Out", nullptr)); #ifndef QT_NO_TOOLTIP actionZoom_Out->setToolTip(QApplication::translate("MainWindow", "Zoom Out (Ctrl + -)", nullptr)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_SHORTCUT actionZoom_Out->setShortcut(QApplication::translate("MainWindow", "Ctrl+-", nullptr)); #endif // QT_NO_SHORTCUT actionSymbols->setText(QApplication::translate("MainWindow", "Symbols", nullptr)); #ifndef QT_NO_TOOLTIP actionSymbols->setToolTip(QApplication::translate("MainWindow", "Special Symbols", nullptr)); #endif // QT_NO_TOOLTIP actionSuperscript->setText(QApplication::translate("MainWindow", "Superscript", nullptr)); #ifndef QT_NO_SHORTCUT actionSuperscript->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+`", nullptr)); #endif // QT_NO_SHORTCUT actionSubscript->setText(QApplication::translate("MainWindow", "Subscript", nullptr)); #ifndef QT_NO_SHORTCUT actionSubscript->setShortcut(QApplication::translate("MainWindow", "Ctrl+`", nullptr)); #endif // QT_NO_SHORTCUT actionInsert_Horizontal_Line->setText(QApplication::translate("MainWindow", "Horizontal Line", nullptr)); #ifndef QT_NO_TOOLTIP actionInsert_Horizontal_Line->setToolTip(QApplication::translate("MainWindow", "Horizontal Line", nullptr)); #endif // QT_NO_TOOLTIP actionFontBlack->setText(QApplication::translate("MainWindow", "FontBlack", nullptr)); actionLineSpace->setText(QApplication::translate("MainWindow", "LineSpace", nullptr)); actionViewAverageAccuracies->setText(QApplication::translate("MainWindow", "ViewAverageAccuracies", nullptr)); actionInsert_Tab_Space->setText(QApplication::translate("MainWindow", "Insert Tab Space", nullptr)); #ifndef QT_NO_TOOLTIP actionInsert_Tab_Space->setToolTip(QApplication::translate("MainWindow", "Insert Tab Space (Ctrl+T)", nullptr)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_SHORTCUT actionInsert_Tab_Space->setShortcut(QApplication::translate("MainWindow", "Ctrl+T", nullptr)); #endif // QT_NO_SHORTCUT actionAdd_Image->setText(QApplication::translate("MainWindow", "Add Image", nullptr)); actionResize_Image->setText(QApplication::translate("MainWindow", "Resize Image", nullptr)); actionUndo->setText(QApplication::translate("MainWindow", "Undo", nullptr)); #ifndef QT_NO_SHORTCUT actionUndo->setShortcut(QApplication::translate("MainWindow", "Ctrl+Z", nullptr)); #endif // QT_NO_SHORTCUT actionRedo->setText(QApplication::translate("MainWindow", "Redo", nullptr)); #ifndef QT_NO_SHORTCUT actionRedo->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+Z", nullptr)); #endif // QT_NO_SHORTCUT actionNew_Project->setText(QApplication::translate("MainWindow", "New Project", nullptr)); actionInsert_Table_2->setText(QApplication::translate("MainWindow", "Insert Table", nullptr)); actionInsert_Columnleft->setText(QApplication::translate("MainWindow", "Insert Column at Left", nullptr)); actionInsert_Columnright->setText(QApplication::translate("MainWindow", "Insert Column at Right", nullptr)); actionInsert_Rowabove->setText(QApplication::translate("MainWindow", "Insert Row above", nullptr)); actionInsert_Rowbelow->setText(QApplication::translate("MainWindow", "Insert Row Below", nullptr)); actionRemove_Column->setText(QApplication::translate("MainWindow", "Remove Column", nullptr)); actionRemove_Row->setText(QApplication::translate("MainWindow", "Remove Row", nullptr)); actionItalic->setText(QApplication::translate("MainWindow", "Italic", nullptr)); #ifndef QT_NO_SHORTCUT actionItalic->setShortcut(QApplication::translate("MainWindow", "Ctrl+I", nullptr)); #endif // QT_NO_SHORTCUT actionNonitalic->setText(QApplication::translate("MainWindow", "Non Italic", nullptr)); actionSave_All->setText(QApplication::translate("MainWindow", "Save All", nullptr)); actionFind_and_Replace->setText(QApplication::translate("MainWindow", "Find and Replace", nullptr)); #ifndef QT_NO_SHORTCUT actionFind_and_Replace->setShortcut(QApplication::translate("MainWindow", "Ctrl+F", nullptr)); #endif // QT_NO_SHORTCUT actionas_PDF->setText(QApplication::translate("MainWindow", "as PDF", nullptr)); actionGet_Help->setText(QApplication::translate("MainWindow", "Get Help", nullptr)); actionTutorial->setText(QApplication::translate("MainWindow", "Tutorial", nullptr)); actionLinux->setText(QApplication::translate("MainWindow", "Linux", nullptr)); actionWindows->setText(QApplication::translate("MainWindow", "Windows", nullptr)); actionas_Doc->setText(QApplication::translate("MainWindow", "as Doc", nullptr)); actionSanskrit->setText(QApplication::translate("MainWindow", "Sanskrit", nullptr)); actionHindi->setText(QApplication::translate("MainWindow", "Hindi/Marathi", nullptr)); actionEnglish->setText(QApplication::translate("MainWindow", "English", nullptr)); actionShortcut_Guide->setText(QApplication::translate("MainWindow", "Shortcut Guide", nullptr)); action1->setText(QApplication::translate("MainWindow", "1| ", nullptr)); actionSanskrit_2->setText(QApplication::translate("MainWindow", "Sanskrit", nullptr)); actionUndo_Global_Replace->setText(QApplication::translate("MainWindow", "Undo Global Replace", nullptr)); actionUpload->setText(QApplication::translate("MainWindow", "Upload and Replace", nullptr)); justify->setText(QApplication::translate("MainWindow", "AlignJustify", nullptr)); actionFont_Color->setText(QApplication::translate("MainWindow", "Font Color", nullptr)); pushButton_2->setText(QApplication::translate("MainWindow", "Resize Image", nullptr)); pushButton->setText(QApplication::translate("MainWindow", "Mark Regions", nullptr)); viewComments->setText(QApplication::translate("MainWindow", "Comments Accuracy", nullptr)); compareCorrectorOutput->setText(QApplication::translate("MainWindow", "Compare Corrector Output", nullptr)); compareVerifierOutput->setText(QApplication::translate("MainWindow", "Compare Verifier Output", nullptr)); hinButton->setText(QApplication::translate("MainWindow", "Hindi/Marathi", nullptr)); sanButton->setText(QApplication::translate("MainWindow", "Sanskrit", nullptr)); tabWidget->setTabText(tabWidget->indexOf(tab), QApplication::translate("MainWindow", "SLP", nullptr)); tabWidget->setTabText(tabWidget->indexOf(tab_2), QApplication::translate("MainWindow", "Project", nullptr)); textBrowser->setHtml(QApplication::translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'WorkSans,Sans'; font-size:20pt; font-weight:400; font-style:normal;\" bgcolor=\"#ffffff\">\n" "<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Ubuntu'; font-size:11pt;\">Please Select the Language from top left menu before loading any document.</span></p></body></html>", nullptr)); tabWidget_2->setTabText(tabWidget_2->indexOf(tab_5), QApplication::translate("MainWindow", "Tab 1", nullptr)); lineEdit_3->setText(QApplication::translate("MainWindow", "Words 0", nullptr)); groupBox->setTitle(QString()); zoom_Out_Button->setText(QApplication::translate("MainWindow", "-", nullptr)); zoom_In_Button->setText(QApplication::translate("MainWindow", "+", nullptr)); zoom_level_value->setText(QApplication::translate("MainWindow", "100%", nullptr)); menuCreateReports->setTitle(QApplication::translate("MainWindow", "Reports", nullptr)); menuFontAndLayout->setTitle(QApplication::translate("MainWindow", "View", nullptr)); menuTables->setTitle(QApplication::translate("MainWindow", "Tables", nullptr)); menuGit->setTitle(QApplication::translate("MainWindow", "Versions", nullptr)); menuEdit->setTitle(QApplication::translate("MainWindow", "Edit", nullptr)); menuDownload->setTitle(QApplication::translate("MainWindow", "Download", nullptr)); menuHelp->setTitle(QApplication::translate("MainWindow", "Help", nullptr)); menuInstallation_Guide->setTitle(QApplication::translate("MainWindow", "Installation Guide", nullptr)); menuSelectLanguage->setTitle(QApplication::translate("MainWindow", "Language", nullptr)); menuOCR_Correction_Window->setTitle(QApplication::translate("MainWindow", "File", nullptr)); menuRecent_Project->setTitle(QApplication::translate("MainWindow", "Recent Project", nullptr)); } // retranslateUi }; namespace Ui { class MainWindow: public Ui_MainWindow {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_MAINWINDOW_H
50.73012
361
0.663967
[ "solid" ]
7059fdc6237337bb25bde07e5e47f1f7f992c5d7
1,180
h
C
src/mesh/AbstractMeshProvider.h
kamleshbhalui/MADYPG
b91c7af0b7a1382fed0a5fb3147f13594ddec71e
[ "MIT" ]
null
null
null
src/mesh/AbstractMeshProvider.h
kamleshbhalui/MADYPG
b91c7af0b7a1382fed0a5fb3147f13594ddec71e
[ "MIT" ]
null
null
null
src/mesh/AbstractMeshProvider.h
kamleshbhalui/MADYPG
b91c7af0b7a1382fed0a5fb3147f13594ddec71e
[ "MIT" ]
null
null
null
#ifndef __ABSTRACTMESHPROVIDER__H__ #define __ABSTRACTMESHPROVIDER__H__ #include "Mesh.h" #include "Trafo.h" // abstraction of mesh animation, to provide updating meshes to the YarnMapper // specialized for obj-file sequences and PBD-simulation class AbstractMeshProvider { public: struct Obstacle { Trafo transformation; Mesh mesh; }; AbstractMeshProvider() {} virtual ~AbstractMeshProvider() {} // update/step the simulation/replay/animation virtual void update() = 0; // mesh topology has changed in the last update bool meshIndicesDirty() { return m_indicesDirty; } // for rendering // material space has changed (coords or topology) in the last update // currently assuming no coord-changes bool materialSpaceChanged() { return m_indicesDirty; } Mesh &getMesh() { return m_mesh; } const Mesh &getMesh() const { return m_mesh; } const std::vector<Obstacle> &getObstacles() const { return m_obstacles; } // only implemented for pbd virtual void applyForce(float fx, float fy, float fz) {} protected: std::vector<Obstacle> m_obstacles; bool m_indicesDirty = false; Mesh m_mesh; }; #endif // __ABSTRACTMESHPROVIDER__H__
28.095238
78
0.738136
[ "mesh", "vector" ]
705aafc499ad7d16fa0205cb213a07fa2c21c6fd
10,810
h
C
SABuilder/sa_builder_params.h
paldier/eip97
ce4edaca76d0e253c98eb1611a7a6b6f45fadb17
[ "BSD-2-Clause" ]
null
null
null
SABuilder/sa_builder_params.h
paldier/eip97
ce4edaca76d0e253c98eb1611a7a6b6f45fadb17
[ "BSD-2-Clause" ]
null
null
null
SABuilder/sa_builder_params.h
paldier/eip97
ce4edaca76d0e253c98eb1611a7a6b6f45fadb17
[ "BSD-2-Clause" ]
null
null
null
/* sa_builder_params.h * * Type definitions for the parameter structure for the SA Builder. */ /***************************************************************************** * Copyright (c) 2011-2013 INSIDE Secure B.V. 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 2 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 SA_BUILDER_PARAMS_H_ #define SA_BUILDER_PARAMS_H_ /*---------------------------------------------------------------------------- * This module uses (requires) the following interface(s): */ // Driver Framework Basic Definitions API #include "basic_defs.h" /*---------------------------------------------------------------------------- * Definitions and macros */ /* This specifies one of the supported protocols. For each of the * supported protocols, the SABuilder_Params_t record contains a * protocol-specific extension, defined in a separate header file. */ typedef enum { SAB_PROTO_BASIC, SAB_PROTO_IPSEC, SAB_PROTO_SSLTLS, SAB_PROTO_MACSEC, SAB_PROTO_SRTP } SABuilder_Protocol_t; /* Specify direction: outbound (encrypt) or inbound (decrypt) */ typedef enum { SAB_DIRECTION_OUTBOUND, SAB_DIRECTION_INBOUND } SABuilder_Direction_t; /* Values for the flags field. Combine any values using a bitwise or. If no flags apply, use the value zero. */ #define SAB_FLAG_GATHER BIT_0 #define SAB_FLAG_SCATTER BIT_1 #define SAB_FLAG_SUPPRESS_HDRPROC BIT_2 #define SAB_FLAG_SUPPRESS_HEADER BIT_3 #define SAB_FLAG_SUPPRESS_PAYLOAD BIT_4 #define SAB_FLAG_IV_SAVE BIT_5 /* Save IV back into SA */ #define SAB_FLAG_ARC4_STATE_SAVE BIT_6 /* Save ARCFOUR state back */ #define SAB_FLAG_ARC4_STATE_LOAD BIT_7 /* Load ARCFOUR state */ #define SAB_FLAG_HASH_LOAD BIT_8 /* Load digest value from SA */ #define SAB_FLAG_HASH_SAVE BIT_9 /* Save digest value into SA */ #define SAB_FLAG_HASH_INTERMEDIATE BIT_10 /* hash message crosses multiple packets: load/store intermediate digest */ #define SAB_FLAG_COPY_IV BIT_11 /* Insert the IV into the output packet (basic crypto) */ /* Specify one of the crypto algorithms */ typedef enum { SAB_CRYPTO_NULL, SAB_CRYPTO_DES, SAB_CRYPTO_3DES, SAB_CRYPTO_AES, SAB_CRYPTO_ARCFOUR, SAB_CRYPTO_KASUMI, SAB_CRYPTO_SNOW, SAB_CRYPTO_ZUC } SABuilder_Crypto_t; /* Specify one of the crypto modes */ typedef enum { SAB_CRYPTO_MODE_ECB, SAB_CRYPTO_MODE_CBC, SAB_CRYPTO_MODE_OFB, SAB_CRYPTO_MODE_CFB, SAB_CRYPTO_MODE_CFB1, SAB_CRYPTO_MODE_CFB8, SAB_CRYPTO_MODE_CTR, SAB_CRYPTO_MODE_ICM, SAB_CRYPTO_MODE_CCM, /* Only use with AES, set SAB_AUTH_AES_CCM */ SAB_CRYPTO_MODE_GCM, /* Only use with AES, set SAB_AUTH_AES_GCM */ SAB_CRYPTO_MODE_GMAC, /* Only use with AES, set SAB_AUTH_AES_GMAC */ SAB_CRYPTO_MODE_STATELESS, /* For ARC4 */ SAB_CRYPTO_MODE_STATEFUL, /* For ARC4 */ SAB_CRYPTO_MODE_XTS, /* Only use with AES, no authentication */ SAB_CRYPTO_MODE_XTS_STATEFUL, /* Only use with AES, no authentication. Stateful operation, allow multiple operations on the same 'sector' */ SAB_CRYPTO_MODE_BASIC, SAB_CRYPTO_MODE_F8, /* Only with Kasumi */ SAB_CRYPTO_MODE_UEA2, /* Only with SNOW */ SAB_CRYPTO_MODE_EEA3, /* Only with ZUC */ } SABuilder_Crypto_Mode_t; /* Specify one of the IV sources. Not all methods are supported with all protocols.*/ typedef enum { SAB_IV_SRC_DEFAULT, /* Default mode for the protocol */ SAB_IV_SRC_SA, /* IV is loaded from SA */ SAB_IV_SRC_PRNG, /* IV is derived from PRNG */ SAB_IV_SRC_INPUT, /* IV is prepended to the input packet. */ SAB_IV_SRC_TOKEN, /* IV is included in the packet token. */ SAB_IV_SRC_SEQ, /* IV is derived from packet sequence number. */ } SABuilder_IV_Src_t; /* Specify one of the hash or authentication methods */ typedef enum { SAB_AUTH_NULL, SAB_AUTH_HASH_MD5, SAB_AUTH_HASH_SHA1, SAB_AUTH_HASH_SHA2_224, SAB_AUTH_HASH_SHA2_256, SAB_AUTH_HASH_SHA2_384, SAB_AUTH_HASH_SHA2_512, SAB_AUTH_SSLMAC_MD5, SAB_AUTH_SSLMAC_SHA1, SAB_AUTH_HMAC_MD5, SAB_AUTH_HMAC_SHA1, SAB_AUTH_HMAC_SHA2_224, SAB_AUTH_HMAC_SHA2_256, SAB_AUTH_HMAC_SHA2_384, SAB_AUTH_HMAC_SHA2_512, SAB_AUTH_AES_XCBC_MAC, SAB_AUTH_AES_CMAC_128, /* Identical to AES_XCBC_MAC */ SAB_AUTH_AES_CMAC_192, SAB_AUTH_AES_CMAC_256, SAB_AUTH_AES_CCM, /* Set matching crypto algorithm and mode */ SAB_AUTH_AES_GCM, /* Set matching crypto algorithm and mode */ SAB_AUTH_AES_GMAC, /* Set matching crypto algorithm and mode */ SAB_AUTH_KASUMI_F9, SAB_AUTH_SNOW_UIA2, SAB_AUTH_ZUC_EIA3, } SABuilder_Auth_t; /* This is the main SA parameter structure. * * This contains the common fields for all protocol families. * Each protocol has a special extension. * * The entire data structure (including protocol-specific extension) must be * prepared before calling SABuilder_GetSizes() and SABuilder_Build_SA(). * * See the SABuilder_Init* functions in the protocol specific headers * (sa_builder_ipsec.h etc.) for helper functions to prepare it. * All these initialization functions will provide sensible defaults for all * fields, but both the crypto algorithm and the authentication algorithm * are set to NULL. * * For a practical use, at least the following fields must be filled in * after calling the initialization functions: * - CryptoAlgo, Key_p and KeyByteCount if encryption is required. * - CryptoMode if anything other than CBC is required. * - Nonce_p if counter mode is used. * - AuthAlgo if authentication is desired and (depending on the * authentication algorithm), one or more of * AuthKey1_p, AuthKey2_p or AuthKey3_p. */ typedef struct { /* Protocol related fields */ SABuilder_Protocol_t protocol; SABuilder_Direction_t direction; void * ProtocolExtension_p; /* Pointer to the extension record */ uint32_t flags; /* Generic flags */ /* Crypto related fields */ SABuilder_Crypto_t CryptoAlgo; /* Cryptographic algorithm */ SABuilder_Crypto_Mode_t CryptoMode; SABuilder_IV_Src_t IVSrc; /* source of IV */ uint8_t KeyByteCount; /* Key length in bytes */ uint8_t *Key_p; /* pointer to crypto key */ uint8_t *IV_p; /* pointer to initialization vector. IV size is implied by crypto algorithm and mode */ uint8_t *Nonce_p; /* Cryptographic nonce, e.g. for counter mode */ /* Note: for ARCFOUR, the stream cipher state will be loaded if the SAB_FLAG_ARC4_STATE_LOAD flag is set. Nonce_p[0] is the I variable, Nonce_p[1] is the J variable and IV_p points to the 256-byte S-array. If this flag is not set, the stream cipher state will not be loaded at SA build time and the first packet has to specify the ARCFOUR state to be initialized from the key. For AES-XTS, the Nonce represents Key2, */ /* Authentication related fields */ SABuilder_Auth_t AuthAlgo; /* Authentication algorithm */ uint8_t *AuthKey1_p; uint8_t *AuthKey2_p; uint8_t *AuthKey3_p; /* The SA Builder expects authentication keys in their preprocessed form. The sizes of the authentication keys are implied by AuthAlgo. For details on the preprocessed authentication keys, see the Implementation Notes document. Plain hash functions with no digest loading: No authentication keys are used. Plain hash functions with digest loading: AuthKey1 is the digest to be loaded. Any of the HMAC functions: AuthKey1 is precomputed inner digest. AuthKey2 is precomputed outer digest. SSL-MAC-MD$: AuthKey1 is precomputed inner digest. AuthKey2 is precomputed outer digest. SSL-HAC-SHA1: AuthKey1 is the authentication key (not pre-processed). GCM or GMAC: AuthKey1 is H = E(K,0). This is an all-zero block encrypted with the encryption key. XCBC_MAC (RFC3566): AuthKey1 = K1 AuthKey2 = K2 AuthKey3 = K3 CMAC (RFC4493,RFC4494): AuthKey1 = K AuthKey2 = K1 AuthKey3 = K2 CCM: No authentication keys required: the SA builder will use the encryption key. Unused AuthKey fields may be NULL. */ uint32_t OffsetARC4StateRecord; /* Offset of the ARC4 State record with respect to the start of the SA record. The application can set this to specify a desired offset for this record. If left 0, the SA Builder will put the ARC4 state right after the SA. This parameter is only used when SAB_ARC4_STATE_IN_SA is defined. */ /* The following values reflext control words. The application shall not touch those */ uint32_t CW0, CW1; /* The following values reflect. offsets of certain fields in the SA buffer. The application shall not touch these.*/ uint8_t OffsetDigest0; /* Word-offset of Digest 0 */ uint8_t OffsetDigest1; /* Word-offset of Digest 1 */ uint8_t OffsetSeqNum; /* Word-offset of Sequence Number */ uint8_t OffsetSeqMask; /* Word-offset of Sequence Number Mask */ uint8_t OffsetIV; /* Word-offset of IV */ uint8_t OffsetIJPtr; /* Word-offset of IJ Pointer for ARC4 */ uint8_t OffsetARC4State; /* Word-offset of ARC4 state */ /* The following values reflect the width of certain fields in the SA (those that may be updated and may be read back)*/ uint8_t SeqNumWord32Count; /* Width of the sequence number */ uint8_t SeqMaskWord32Count;/* Width of the sequence number masks*/ uint8_t IVWord32Count; /* Width of the IV */ } SABuilder_Params_t; #endif /* SA_BUILDER_PARAMS_H_ */ /* end of file sa_builder_params.h */
38.19788
99
0.672895
[ "vector" ]
705de61776abaaa3c39c694a08971c5f4e7ad222
7,294
c
C
3pxnet-inference/util/xnor_base.c
SRavit1/3pxnet
1f81a2bdcbb97c42163e914b01dba4e6c73ade60
[ "MIT" ]
7
2020-12-11T16:06:03.000Z
2022-02-13T20:56:06.000Z
3pxnet-inference/util/xnor_base.c
SRavit1/3pxnet
1f81a2bdcbb97c42163e914b01dba4e6c73ade60
[ "MIT" ]
4
2021-07-13T10:50:49.000Z
2021-08-13T16:06:20.000Z
3pxnet-inference/util/xnor_base.c
SRavit1/3pxnet
1f81a2bdcbb97c42163e914b01dba4e6c73ade60
[ "MIT" ]
1
2021-07-06T03:41:55.000Z
2021-07-06T03:41:55.000Z
/* * MIT License * * Copyright (c) 2019 UCLA NanoCAD Laboratory * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /*! * \file xnor_base.c * \brief Support functions for binarized neural networks * \author Wojciech Romaszkan * \author NanoCAD Laboratory, University of California Los Angeles * \copyright MIT License */ #include "xnor_base.h" /** * @details Pack a vector of inputs into binary containers (words) - pointer version * * @param[in] pSrc - pointer to the source vector * @param[out] pDst - pointer to the destination vector * @param[in] numIn - length of the input vector * @param[in] threshold - binarization threshold */ void packBinThrsPtr(actDtype * restrict pSrc, pckDtype * restrict pDst, uint32_t numIn, int32_t threshold) { // Temporary input pckDtype actTemp; // For holding batches of input values pckDtype pckTemp = 0; // Loop counter uint32_t blkCnt = numIn; // Packing/shifting index uint8_t packIdx = pckWdt-1; while (blkCnt > 0) { // Load value actTemp = (pckDtype) *pSrc++; // Threshold actTemp = actTemp >= threshold; // Shift actTemp = actTemp << packIdx; // Pack pckTemp |= actTemp; // Full output block - write out if (packIdx == 0) { *pDst++ = pckTemp; pckTemp = 0; packIdx = pckWdt-1; } // Decrement packing index else { packIdx--; } // Decrement input counter blkCnt--; // Write the last block if (blkCnt == 0 && packIdx != pckWdt-1) { *pDst++ = pckTemp; } } } /** * @details Pack a vector of inputs into binary containers (words) - pointer version/ floating input * * @param[in] pSrc - pointer to the source vector * @param[out] pDst - pointer to the destination vector * @param[in] numIn - length of the input vector * @param[in] threshold - binarization threshold */ void packBinThrsPtrFlt(float * restrict pSrc, pckDtype * restrict pDst, uint32_t numIn, float threshold) { // Temporary input float actTemp; // Integer conversion pckDtype actInt; // For holding batches of input values pckDtype pckTemp = 0; // Loop counter uint32_t blkCnt = numIn; // Packing/shifting index uint8_t packIdx = pckWdt-1; while (blkCnt > 0) { // Load value actTemp = *pSrc++; // Threshold actInt = actTemp >= threshold; // Shift actInt = actInt << packIdx; // Pack pckTemp |= actInt; // Full output block - write out if (packIdx == 0) { *pDst++ = pckTemp; pckTemp = 0; packIdx = pckWdt-1; } // Decrement packing index else { packIdx--; } // Decrement input counter blkCnt--; // Write the last block if (blkCnt == 0 && packIdx != pckWdt-1) { *pDst++ = pckTemp; } } } /** * @details Pack a vector of inputs into binary containers (words) - array version * * @param[in] pSrc - pointer to the source vector * @param[out] pDst - pointer to the destination vector * @param[in] numIn - length of the input vector * @param[in] threshold - binarization threshold */ void packBinThrsArr(uint8_t * restrict pSrc, pckDtype * restrict pDst, uint32_t numIn, int32_t threshold) { // Temporary input pckDtype actTemp; // For holding batches of input values pckDtype pckTemp = 0; for (uint16_t blkCnt = 0; blkCnt < numIn/pckWdt; blkCnt++) { pckTemp = 0; for (uint8_t packIdx = 0; packIdx < pckWdt; packIdx++) { // Binarize actTemp = pSrc[blkCnt*pckWdt + packIdx] >= threshold; // Shift actTemp = actTemp << (pckWdt-1-packIdx); // Pack pckTemp |= actTemp; } // Write output block pDst[blkCnt] = pckTemp; } } /** * @details Permute inputs through matrix multiplication - pointer version * * @param[in] pSrc - pointer to the source vector * @param[in] pPerm - pointer to the permutation matrix (row-major flattened) * @param[in] numIn - length of the input vector * @param[out] pDst - pointer to the destination vector */ void permInMatPtr(actDtype * restrict pSrc, uint8_t * restrict pPerm, uint16_t numIn, actDtype * restrict pDst) { // Temporary accumulation value actDtype temp; // Source vector pointer actDtype *pIn = pSrc; // Loop through outputs for (int i = 0; i< numIn; i++) { // Reset the accumulator and source pointer temp = 0; pIn = pSrc; // Loop through inputs for (int j=0; j<numIn; j++) { temp += (*pIn++) * (*pPerm++); } // Write output out *pDst++ = temp; } } /** * @details Permute inputs through permutation indices - pointer version. * Note: Ideally this should be done in place to save buffer space. * This would require changing the order of indices. * * @param[in] pSrc - pointer to the source vector * @param[in] pPermInd - pointer to the permutation vector (containing indices after permutation) * @param[in] numIn - length of the input vector * @param[out] pDst - pointer to the destination vector */ void permInIndPtr(float * restrict pSrc, uint16_t * restrict pPermInd, uint16_t numIn, float * restrict pDst) { for (int i = 0; i<numIn; i++) { *(pDst + *pPermInd++) = *pSrc++; } } /** * @details Permute inputs through permutation indices - array version. * Note: Ideally this should be done in place to save buffer space. * This would require changing the order of indices. * * @param[in] pSrc - pointer to the source vector * @param[in] pPermInd - pointer to the permutation vector (containing indices after permutation) * @param[in] numIn - length of the input vector * @param[out] pDst - pointer to the destination vector */ void permInIndArr(actDtype * restrict pSrc, uint16_t * restrict pPermInd, uint16_t numIn, actDtype * restrict pDst) { for (int i = 0; i<numIn; i++) { pDst[pPermInd[i]] = pSrc[i]; } }
31.851528
118
0.629284
[ "vector" ]
7063d86607bcb4e731a52dff74b8c72815c8e353
11,785
h
C
Development/Src/UnrealEd/Inc/New/Dialogs.h
addstone/unrealengine3
4579d360dfd52b12493292120b27bb430f978fc8
[ "FSFAP" ]
37
2020-05-22T18:18:47.000Z
2022-03-19T06:51:54.000Z
Development/Src/UnrealEd/Inc/New/Dialogs.h
AdanosGotoman/unrealengine3
4579d360dfd52b12493292120b27bb430f978fc8
[ "FSFAP" ]
null
null
null
Development/Src/UnrealEd/Inc/New/Dialogs.h
AdanosGotoman/unrealengine3
4579d360dfd52b12493292120b27bb430f978fc8
[ "FSFAP" ]
27
2020-05-17T01:03:30.000Z
2022-03-06T19:10:14.000Z
/*============================================================================= Dialogs.h: Dialog boxes used within the editor Revision history: * Created by Warren Marshall =============================================================================*/ /*----------------------------------------------------------------------------- WxDlgAbout. -----------------------------------------------------------------------------*/ class WxDlgAbout : public wxDialog { public: WxDlgAbout(); ~WxDlgAbout(); WxBitmap Bitmap; wxStaticBitmap* BitmapStatic; wxStaticText* VersionStatic; void OnOK( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgRename. -----------------------------------------------------------------------------*/ class WxDlgRename : public wxDialog { public: WxDlgRename(); ~WxDlgRename(); FString OldPackage, OldGroup, OldName, NewPackage, NewGroup, NewName; wxTextCtrl *PackageEdit, *GroupEdit, *NameEdit; int ShowModal( FString InPackage, FString InGroup, FString InName ); virtual bool Validate(); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgPackageGroupName. -----------------------------------------------------------------------------*/ class WxDlgPackageGroupName : public wxDialog { public: WxDlgPackageGroupName(); ~WxDlgPackageGroupName(); FString Package, Group, Name; wxTextCtrl *PackageEdit, *GroupEdit, *NameEdit; int ShowModal( FString InPackage, FString InGroup, FString InName ); void OnOK( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgAddSpecial. -----------------------------------------------------------------------------*/ class WxDlgAddSpecial : public wxDialog { public: WxDlgAddSpecial(); ~WxDlgAddSpecial(); wxComboBox *PrefabsCombo; wxCheckBox *AntiPortalCheck, *PortalCheck, *MirrorCheck, *InvisibleCheck, *TwoSidedCheck; wxRadioButton *SolidRadio, *SemiSolidRadio, *NonSolidRadio; void OnOK( wxCommandEvent& In ); void OnPrefabsSelChange( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgImportBrush. -----------------------------------------------------------------------------*/ class WxDlgImportBrush : public wxDialog { public: WxDlgImportBrush(); ~WxDlgImportBrush(); wxCheckBox *MergeFacesCheck; wxRadioButton *SolidRadio, *NonSolidRadio; FString Filename; int ShowModal( FString InFilename ); void OnOK( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgImportBase. -----------------------------------------------------------------------------*/ class WxDlgImportBase : public wxDialog { public: WxDlgImportBase(); WxDlgImportBase( FString InResourceName ); ~WxDlgImportBase(); FString Package, Group, Name; TArray<FFilename>* Filenames; UBOOL bOKToAll; INT iCurrentFilename; wxStaticText *FilenameStatic; wxTextCtrl *PackageText, *GroupText, *NameText; virtual UBOOL GetDataFromUser( void ); virtual void ImportFile( FString Filename ); void SetNextFilename(); virtual void RefreshName(); int ShowModal( FString InPackage, FString InGroup, TArray<FFilename>* InFilenames ); void OnOK( wxCommandEvent& In ); void OnOKAll( wxCommandEvent& In ); void OnSkip( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgGroup. -----------------------------------------------------------------------------*/ class WxDlgGroup : public wxDialog { public: WxDlgGroup(); ~WxDlgGroup(); FString Name; wxTextCtrl *NameEdit; int ShowModal( UBOOL InNew, FString InName ); void OnOK( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgNewGeneric. -----------------------------------------------------------------------------*/ class WxDlgNewGeneric : public wxDialog { public: WxDlgNewGeneric(); ~WxDlgNewGeneric(); FString Package, Group, Name; UFactory* Factory; WxPropertyWindow* PropertyWindow; wxTextCtrl *PackageEdit, *GroupEdit, *NameEdit; wxComboBox *FactoryCombo; wxBoxSizer* PropsPanelSizer; int ShowModal( FString InPackage, FString InGroup, UClass* DefaultFactoryClass=NULL ); virtual bool Validate(); void OnFactorySelChange( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgImportGeneric. -----------------------------------------------------------------------------*/ class WxDlgImportGeneric : public wxDialog { public: WxDlgImportGeneric(); ~WxDlgImportGeneric(); FString Package, Group, Name; UFactory* Factory; UClass* Class; FFilename Filename; WxPropertyWindow* PropertyWindow; wxTextCtrl *PackageEdit, *GroupEdit, *NameEdit; wxComboBox *FactoryCombo; wxBoxSizer* PropsPanelSizer; int ShowModal( FFilename InFilename, FString InPackage, FString InGroup, UClass* InClass, UFactory* InFactory ); void OnOK( wxCommandEvent& In ); void OnOKAll( wxCommandEvent& In ); void DoImport( UBOOL bOKToAll ); void OnSize( wxSizeEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgExportGeneric. -----------------------------------------------------------------------------*/ class WxDlgExportGeneric : public wxDialog { public: WxDlgExportGeneric(); ~WxDlgExportGeneric(); UObject* Object; UExporter* Exporter; FFilename Filename; WxPropertyWindow* PropertyWindow; wxTextCtrl *NameText; int ShowModal( FFilename InFilename, UObject* InObject, UExporter* InExporter ); void OnOK( wxCommandEvent& In ); void DoExport(); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgTextureProperties. -----------------------------------------------------------------------------*/ class WxDlgTextureProperties : public wxDialog, FViewportClient, public FNotifyHook { public: WxDlgTextureProperties(); ~WxDlgTextureProperties(); UTexture* Texture; EViewportHolder* ViewportHolder; FChildViewport* Viewport; WxPropertyWindow* PropertyWindow; virtual void Draw(FChildViewport* Viewport,FRenderInterface* RI); bool Show( const bool InShow, UTexture* InTexture ); void OnOK( wxCommandEvent& In ); void OnSize( wxSizeEvent& In ); // FNotify interface void NotifyDestroy( void* Src ); void NotifyPreChange( void* Src, UProperty* PropertyAboutToChange ); void NotifyPostChange( void* Src, UProperty* PropertyThatChanged ); void NotifyExec( void* Src, const TCHAR* Cmd ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgBrushBuilder. -----------------------------------------------------------------------------*/ class WxDlgBrushBuilder : public wxDialog { public: WxDlgBrushBuilder(); ~WxDlgBrushBuilder(); UBrushBuilder* BrushBuilder; WxPropertyWindow* PropertyWindow; UBOOL Show( UBrushBuilder* InBrushBuilder, UBOOL InShow = 1 ); void OnOK( wxCommandEvent& In ); void OnClose( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgGenericOptions. -----------------------------------------------------------------------------*/ class WxDlgGenericOptions : public wxDialog { public: WxDlgGenericOptions(); ~WxDlgGenericOptions(); UObject* Object; FString Caption; WxPropertyWindow* PropertyWindow; UBOOL ShowModal( UObject* InObject, FString InCaption ); void OnOK( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgGenericStringEntry -----------------------------------------------------------------------------*/ class WxDlgGenericStringEntry : public wxDialog { public: WxDlgGenericStringEntry(); ~WxDlgGenericStringEntry(); FString EnteredString; wxTextCtrl *StringEntry; wxStaticText *StringCaption; int ShowModal( const TCHAR* DialogTitle, const TCHAR* Caption, const TCHAR* DefaultString ); void OnOK( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgGenericComboEntry -----------------------------------------------------------------------------*/ class WxDlgGenericComboEntry : public wxDialog { public: WxDlgGenericComboEntry(); ~WxDlgGenericComboEntry(); FString SelectedString; wxComboBox* ComboBox; wxStaticText* ComboCaption; int ShowModal(const TCHAR* InDialogTitle, const TCHAR* INComboCaption, TArray<FString>& InComboOptions); void OnOK( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgActorFactory -----------------------------------------------------------------------------*/ class WxDlgActorFactory : public wxDialog { public: WxDlgActorFactory(); ~WxDlgActorFactory(); UActorFactory* Factory; WxPropertyWindow* PropertyWindow; wxStaticText *NameText; int ShowModal( UActorFactory* InFactory ); void OnOK( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxSurfPropPage1 -----------------------------------------------------------------------------*/ class WxSurfPropPage1 : public wxPanel { public: WxSurfPropPage1( wxWindow* InParent ); ~WxSurfPropPage1(); wxPanel* Panel; wxRadioButton *SimpleScaleButton; wxComboBox *SimpleCB; wxStaticText *CustomULabel, *CustomVLabel; wxTextCtrl *CustomUEdit, *CustomVEdit; wxCheckBox *RelativeCheck; wxComboBox *LightMapResCombo; void RefreshPage(); void Pan( INT InU, INT InV ); void Scale( FLOAT InScaleU, FLOAT InScaleV, UBOOL InRelative ); void OnU1( wxCommandEvent& In ); void OnU4( wxCommandEvent& In ); void OnU16( wxCommandEvent& In ); void OnU64( wxCommandEvent& In ); void OnV1( wxCommandEvent& In ); void OnV4( wxCommandEvent& In ); void OnV16( wxCommandEvent& In ); void OnV64( wxCommandEvent& In ); void OnFlipU( wxCommandEvent& In ); void OnFlipV( wxCommandEvent& In ); void OnRot45( wxCommandEvent& In ); void OnRot90( wxCommandEvent& In ); void OnApply( wxCommandEvent& In ); void OnScaleSimple( wxCommandEvent& In ); void OnScaleCustom( wxCommandEvent& In ); void OnLightMapResSelChange( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxSurfPropPage2 -----------------------------------------------------------------------------*/ class WxSurfPropPage2 : public wxPanel { public: WxSurfPropPage2( wxWindow* InParent ); ~WxSurfPropPage2(); wxPanel* Panel; WxPropertyWindow* PropertyWindow; wxListBox *AlignList; void RefreshPage(); void OnAlignSelChange( wxCommandEvent& In ); void OnApply( wxCommandEvent& In ); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- WxDlgSurfaceProperties -----------------------------------------------------------------------------*/ class WxDlgSurfaceProperties : public wxDialog { public: WxDlgSurfaceProperties(); ~WxDlgSurfaceProperties(); wxNotebook *Notebook; WxSurfPropPage1* Page1; WxSurfPropPage2* Page2; void RefreshPages(); DECLARE_EVENT_TABLE() }; /*----------------------------------------------------------------------------- The End. -----------------------------------------------------------------------------*/
25.344086
113
0.546966
[ "object" ]
706897af081a9a2b925ce06899d276499a8b7949
3,267
h
C
ortools/math_opt/core/sparse_submatrix.h
kharazian/or-tools-em
8df912821e013203523ba433ff2babbbc91c6a4b
[ "Apache-2.0" ]
null
null
null
ortools/math_opt/core/sparse_submatrix.h
kharazian/or-tools-em
8df912821e013203523ba433ff2babbbc91c6a4b
[ "Apache-2.0" ]
null
null
null
ortools/math_opt/core/sparse_submatrix.h
kharazian/or-tools-em
8df912821e013203523ba433ff2babbbc91c6a4b
[ "Apache-2.0" ]
null
null
null
// Copyright 2010-2021 Google LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Tools to extract some sub-components of sparse matrices. #ifndef OR_TOOLS_MATH_OPT_CORE_SPARSE_SUBMATRIX_H_ #define OR_TOOLS_MATH_OPT_CORE_SPARSE_SUBMATRIX_H_ #include <cstdint> #include <optional> #include <utility> #include <vector> #include "ortools/math_opt/core/sparse_vector.h" #include "ortools/math_opt/core/sparse_vector_view.h" #include "ortools/math_opt/sparse_containers.pb.h" namespace operations_research::math_opt { // A vector that contains one pair (row_id, columns_coefficients) per row, // sorted by row_id. The columns_coefficients are views. using SparseSubmatrixRowsView = std::vector<std::pair<int64_t, SparseVectorView<double>>>; // Returns the coefficients of columns in the range [start_col_id, end_col_id) // for each row in the range [start_row_id, end_row_id). // // Returns a vector that contains one pair (row_id, columns_coefficients) per // row. It CHECKs that the input matrix is valid. The coefficients are returned // in a views that points to the input matrix's data. Therefore they should not // be used after the proto is modified/deleted. // // When end_(col|row)_id is nullopt, includes all indices greater or equal to // start_(col|row)_id. // // This functions runs in O(size of matrix). // // Use TransposeSparseSubmatrix() to transpose the submatrix and get the // columns instead of the rows. // // Usage example: // // // With this input sparse matrix: // // |0 1 2 3 4 5 6 // // -+------------- // // 0|2 - - - 3 4 - // // 1|- - - - - - - // // 2|- 5 - 1 - - 3 // // 3|9 - - 8 - - 7 // const SparseDoubleMatrixProto matrix = ...; // // // Keeping coefficients of lines >= 1 and columns in [1, 6). // const auto rows = SparseSubmatrixByRows( // matrix, // /*start_row_id=*/1, /*end_row_id=*/std::nullopt, // /*start_col_id=*/1, /*end_col_id=*/6); // // // The returned rows and coefficients will be: // // {2, {{1, 5.0}, {3, 1.0}}} // // {3, { {3, 8.0}}} // SparseSubmatrixRowsView SparseSubmatrixByRows( const SparseDoubleMatrixProto& matrix, int64_t start_row_id, std::optional<int64_t> end_row_id, int64_t start_col_id, std::optional<int64_t> end_col_id); // Returns a vector that contains one pair (row_id, rows_coefficients) per // column. // // The coefficients are returned as copies of the input views. // // This functions runs in: // O(num_non_zeros + num_non_empty_cols * lg(num_non_empty_cols)). std::vector<std::pair<int64_t, SparseVector<double>>> TransposeSparseSubmatrix( const SparseSubmatrixRowsView& submatrix_by_rows); } // namespace operations_research::math_opt #endif // OR_TOOLS_MATH_OPT_CORE_SPARSE_SUBMATRIX_H_
36.707865
79
0.710438
[ "vector" ]
706b7c2d387f606308612dc7dc260846f8a86f0e
2,023
h
C
src/Binary/binaryWriter.h
NativeScript/ios-metadata-generator
a7284c1e74e56335aa35988b17c3672ef5d63fa4
[ "Apache-2.0" ]
14
2015-03-28T18:02:45.000Z
2020-11-12T04:33:55.000Z
src/Binary/binaryWriter.h
NativeScript/ios-metadata-generator
a7284c1e74e56335aa35988b17c3672ef5d63fa4
[ "Apache-2.0" ]
32
2015-04-15T10:11:06.000Z
2016-09-02T14:23:47.000Z
src/Binary/binaryWriter.h
NativeScript/ios-metadata-generator
a7284c1e74e56335aa35988b17c3672ef5d63fa4
[ "Apache-2.0" ]
6
2015-03-12T16:23:41.000Z
2020-03-05T20:58:48.000Z
#pragma once #include "Utils/stream.h" #include "binaryOperation.h" #include "binaryStructures.h" #include <map> #include <string> namespace binary { /* * \class BinaryWriter * \brief Writes primitive data types to a given stream. */ class BinaryWriter : public BinaryOperation { private: std::map<std::string, MetaFileOffset> uniqueStrings; MetaFileOffset push_number(long number, int bytesCount); public: /* * \brief Constructs \c BinaryWriter for a given stream. * \param stream The stream from which data will be read */ BinaryWriter(std::shared_ptr<utils::Stream> stream) : BinaryOperation(stream) { } /* * \brief Gets current stream position. */ MetaFileOffset currentPosition() const { return this->_stream->position(); } /* * \brief Writes a nil terminated string. * \param str * \param shouldIntern Specifies if this string should be unique in this stream. Default \c true */ MetaFileOffset push_string(const std::string& str, bool shouldIntern = true); /* * \brief Writes a pointer. * \param offset */ MetaFileOffset push_pointer(MetaFileOffset offset); /* * \brief Writes an array count. * \param count */ MetaFileOffset push_arrayCount(MetaArrayCount count); /* * \brief Writes a binary array * A binary array is a collection of offsets * \param binaryArray */ MetaFileOffset push_binaryArray(std::vector<MetaFileOffset>& binaryArray); /* * \brief Writes a 4 byte integer. * \param value */ MetaFileOffset push_int(int32_t value); /* * \brief Writes a 2 byte short. * \param value */ MetaFileOffset push_short(int16_t value); /* * \brief Writes a single byte. * \param value */ MetaFileOffset push_byte(uint8_t value); }; }
24.670732
104
0.606525
[ "vector" ]
247d71762ec7eb73e4b8831db64ce86f17f24aa8
585
h
C
QRongIM/RongIMKit/Sections/CustomerService/View/RCCSLeaveMessagesCell.h
loginSin/TestIMSDK
f2231e23aa397cfae317045fff2fe2d2f5b99684
[ "MIT" ]
14
2021-03-06T08:47:30.000Z
2022-02-11T09:42:24.000Z
QRongIM/RongIMKit/Sections/CustomerService/View/RCCSLeaveMessagesCell.h
loginSin/TestIMSDK
f2231e23aa397cfae317045fff2fe2d2f5b99684
[ "MIT" ]
3
2021-03-19T11:12:42.000Z
2021-11-29T14:56:33.000Z
IMKit/Sections/CustomerService/View/RCCSLeaveMessagesCell.h
Zuzi007/ios-ui-sdk-set
2e51added5d697b4d1ab1ba2887ad297b408e7b0
[ "MIT" ]
12
2021-07-02T02:44:52.000Z
2022-03-01T05:15:22.000Z
// // RCCSLeaveMessagesCell.h // RongIMKit // // Created by 张改红 on 2016/12/5. // Copyright © 2016年 RongCloud. All rights reserved. // #import <UIKit/UIKit.h> @class RCCSLeaveMessageItem; @interface RCCSLeaveMessagesCell : UITableViewCell @property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UITextField *infoTextField; @property (nonatomic, strong) UITextView *infoTextView; @property (nonatomic, copy) void (^leaveMessageInfomation)(NSDictionary *info); - (void)setDataWithModel:(RCCSLeaveMessageItem *)model indexPath:(NSIndexPath *)indexPath; @end
30.789474
90
0.77094
[ "model" ]
247ec1897a8539dc459f8bbc26f4e99b22364b10
2,874
c
C
rtt-2.1/components/external/espruino/src/jswrap_pin.c
qingxianren/rtthreadLWIP-3
c096728f55eec6a5aead808f214b3762955d2e26
[ "MIT" ]
275
2018-06-15T14:34:36.000Z
2022-03-26T17:09:40.000Z
rtt-2.1/components/external/espruino/src/jswrap_pin.c
qingxianren/rtthreadLWIP-3
c096728f55eec6a5aead808f214b3762955d2e26
[ "MIT" ]
3
2018-07-19T08:39:15.000Z
2018-07-26T17:47:24.000Z
rtt-2.1/components/external/espruino/src/jswrap_pin.c
qingxianren/rtthreadLWIP-3
c096728f55eec6a5aead808f214b3762955d2e26
[ "MIT" ]
164
2018-06-15T14:47:47.000Z
2022-03-25T09:54:53.000Z
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * ---------------------------------------------------------------------------- * This file is designed to be parsed during the build process * * JavaScript Pin Object Functions * ---------------------------------------------------------------------------- */ #include "jswrap_pin.h" /*JSON{ "type":"class", "class" : "Pin", "check" : "jsvIsPin(var)", "description" : ["This is the built-in class for Pins, such as D0,D1,LED1, or BTN", "You can call the methods on Pin, or you can use Wiring-style functions such as digitalWrite" ] }*/ /*JSON{ "type":"method", "class": "Pin", "name" : "read", "description" : "Returns the input state of the pin as a boolean", "generate" : "jswrap_pin_read", "return" : ["bool", "Whether pin is a logical 1 or 0"] }*/ bool jswrap_pin_read(JsVar *parent) { Pin pin = jshGetPinFromVar(parent); return jshPinInput(pin); } /*JSON{ "type":"method", "class": "Pin", "name" : "set", "description" : "Sets the output state of the pin to a 1", "generate" : "jswrap_pin_set" }*/ void jswrap_pin_set(JsVar *parent) { Pin pin = jshGetPinFromVar(parent); jshPinOutput(pin, 1); } /*JSON{ "type":"method", "class": "Pin", "name" : "reset", "description" : "Sets the output state of the pin to a 0", "generate" : "jswrap_pin_reset" }*/ void jswrap_pin_reset(JsVar *parent) { Pin pin = jshGetPinFromVar(parent); jshPinOutput(pin, 0); } /*JSON{ "type":"method", "class": "Pin", "name" : "write", "description" : "Sets the output state of the pin to the parameter given", "generate" : "jswrap_pin_write", "params" : [ [ "value", "bool", "Whether to set output high (true/1) or low (false/0)"] ] }*/ void jswrap_pin_write(JsVar *parent, bool value) { Pin pin = jshGetPinFromVar(parent); jshPinOutput(pin, value); } /*JSON{ "type":"method", "class": "Pin", "name" : "writeAtTime", "ifndef" : "SAVE_ON_FLASH", "description" : "Sets the output state of the pin to the parameter given at the specified time", "generate" : "jswrap_pin_writeAtTime", "params" : [ [ "value", "bool", "Whether to set output high (true/1) or low (false/0)"], ["time", "float", "Time at which to write"] ] }*/ void jswrap_pin_writeAtTime(JsVar *parent, bool value, JsVarFloat time) { Pin pin = jshGetPinFromVar(parent); JsSysTime sTime = jshGetTimeFromMilliseconds(time*1000); jshPinOutputAtTime(sTime, pin, value); }
38.837838
120
0.598817
[ "object" ]
2483388f69e97633862dab0582dfe1599c01e693
865
h
C
landmark-tool/src/include/action/ShowAddLandmarksDialog.h
ahewer/mri-shape-tools
4268499948f1330b983ffcdb43df62e38ca45079
[ "MIT" ]
null
null
null
landmark-tool/src/include/action/ShowAddLandmarksDialog.h
ahewer/mri-shape-tools
4268499948f1330b983ffcdb43df62e38ca45079
[ "MIT" ]
2
2017-05-29T09:43:01.000Z
2017-05-29T09:50:05.000Z
landmark-tool/src/include/action/ShowAddLandmarksDialog.h
ahewer/mri-shape-tools
4268499948f1330b983ffcdb43df62e38ca45079
[ "MIT" ]
4
2017-05-17T11:56:02.000Z
2022-03-05T09:12:24.000Z
#ifndef __SHOW_ADD_LANDMARKS_DIALOG_H__ #define __SHOW_ADD_LANDMARKS_DIALOG_H__ #include "action/Action.h" #include "singleton/GuiDescription.h" /** Class that shows a "Add Landmarks" Dialog */ class ShowAddLandmarksDialog: public Action { public: /** Contructor that needs a Gtk builder object */ ShowAddLandmarksDialog() { Glib::RefPtr<Gtk::Builder> builder = GuiDescription::get_instance()->get_builder(); // get the dialog ui element builder->get_widget("addLandmarksDialog", this->addDialog); } /*-----------------------------------------------------------------------*/ virtual void execute() { addDialog->show(); } /*-----------------------------------------------------------------------*/ private: /** ui element for the dialog */ Gtk::FileChooserDialog* addDialog; }; #endif
27.03125
79
0.563006
[ "object" ]
24874da93b1eff476fd87fc8e226a1b361713926
3,257
c
C
extern/gtk/gtk/inspector/highlightoverlay.c
PableteProgramming/download
013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8
[ "MIT" ]
null
null
null
extern/gtk/gtk/inspector/highlightoverlay.c
PableteProgramming/download
013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8
[ "MIT" ]
null
null
null
extern/gtk/gtk/inspector/highlightoverlay.c
PableteProgramming/download
013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8
[ "MIT" ]
null
null
null
/* * Copyright © 2018 Benjamin Otte * * 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 for more details. * * 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/>. * * Authors: Benjamin Otte <otte@gnome.org> */ #include "config.h" #include "highlightoverlay.h" #include "gtkintl.h" #include "gtkwidget.h" struct _GtkHighlightOverlay { GtkInspectorOverlay parent_instance; GtkWidget *widget; GdkRGBA color; }; struct _GtkHighlightOverlayClass { GtkInspectorOverlayClass parent_class; }; G_DEFINE_TYPE (GtkHighlightOverlay, gtk_highlight_overlay, GTK_TYPE_INSPECTOR_OVERLAY) static void gtk_highlight_overlay_snapshot (GtkInspectorOverlay *overlay, GtkSnapshot *snapshot, GskRenderNode *node, GtkWidget *widget) { GtkHighlightOverlay *self = GTK_HIGHLIGHT_OVERLAY (overlay); graphene_rect_t bounds; if (!gtk_widget_compute_bounds (self->widget, widget, &bounds)) return; gtk_snapshot_append_color (snapshot, &self->color, &bounds); } static void gtk_highlight_overlay_queue_draw (GtkInspectorOverlay *overlay) { GtkHighlightOverlay *self = GTK_HIGHLIGHT_OVERLAY (overlay); gtk_widget_queue_draw (self->widget); } static void gtk_highlight_overlay_dispose (GObject *object) { GtkHighlightOverlay *self = GTK_HIGHLIGHT_OVERLAY (object); g_clear_object (&self->widget); G_OBJECT_CLASS (gtk_highlight_overlay_parent_class)->dispose (object); } static void gtk_highlight_overlay_class_init (GtkHighlightOverlayClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkInspectorOverlayClass *overlay_class = GTK_INSPECTOR_OVERLAY_CLASS (klass); overlay_class->snapshot = gtk_highlight_overlay_snapshot; overlay_class->queue_draw = gtk_highlight_overlay_queue_draw; gobject_class->dispose = gtk_highlight_overlay_dispose; } static void gtk_highlight_overlay_init (GtkHighlightOverlay *self) { self->color = (GdkRGBA) { 0.0, 0.0, 1.0, 0.2 }; } GtkInspectorOverlay * gtk_highlight_overlay_new (GtkWidget *widget) { GtkHighlightOverlay *self; self = g_object_new (GTK_TYPE_HIGHLIGHT_OVERLAY, NULL); self->widget = g_object_ref (widget); return GTK_INSPECTOR_OVERLAY (self); } GtkWidget * gtk_highlight_overlay_get_widget (GtkHighlightOverlay *self) { return self->widget; } void gtk_highlight_overlay_set_color (GtkHighlightOverlay *self, const GdkRGBA *color) { if (gdk_rgba_equal (&self->color, color)) return; self->color = *color; gtk_inspector_overlay_queue_draw (GTK_INSPECTOR_OVERLAY (self)); }
26.479675
86
0.725821
[ "object" ]
248c2833cf5978d6013677d977683e8cb16ba50a
35,105
c
C
linux/ibus-keyman/tests/ibusimcontext.c
srl295/keyman
4dfd0f71f3f4ccf81d1badbd824900deee1bb6d1
[ "MIT" ]
219
2017-06-21T03:37:03.000Z
2022-03-27T12:09:28.000Z
linux/ibus-keyman/tests/ibusimcontext.c
srl295/keyman
4dfd0f71f3f4ccf81d1badbd824900deee1bb6d1
[ "MIT" ]
4,451
2017-05-29T02:52:06.000Z
2022-03-31T23:53:23.000Z
linux/ibus-keyman/tests/ibusimcontext.c
srl295/keyman
4dfd0f71f3f4ccf81d1badbd824900deee1bb6d1
[ "MIT" ]
72
2017-05-26T04:08:37.000Z
2022-03-03T10:26:20.000Z
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ /* vim:set et sts=4: */ /* ibus - The Input Bus * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com> * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com> * Copyright (C) 2008-2021 Red Hat, Inc. * * 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 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 Street, Fifth Floor, Boston, MA 02110-1301 * USA */ // This file is based on https://github.com/ibus/ibus/blob/master/client/gtk2/ibusimcontext.c #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "ibusimcontext.h" #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> #include <ibus.h> #include <string.h> #ifdef GDK_WINDOWING_WAYLAND #include <gdk/gdkwayland.h> #endif #ifdef DEBUG #define IDEBUG g_debug #else #define IDEBUG(a...) #endif #define MAX_QUEUED_EVENTS 20 struct _IBusIMContext { GtkIMContext parent; /* instance members */ GdkWindow *client_window; IBusInputContext *ibuscontext; GdkRectangle cursor_area; gboolean has_focus; guint32 time; gint caps; /* cancellable */ GCancellable *cancellable; GQueue *events_queue; gboolean use_button_press_event; GMainLoop *thread_loop; // test properties GString *text; }; static gboolean surrounding_text_supported = TRUE; struct _IBusIMContextClass { GtkIMContextClass parent; /* class members */ }; typedef struct _timeout_data { GMainLoop *thread_loop; gboolean timed_out; } timeout_data; static GtkIMContext *_focus_im_context = NULL; static IBusInputContext *_fake_context = NULL; static GdkWindow *_input_window = NULL; static GtkWidget *_input_widget = NULL; /* functions prototype */ static void ibus_im_context_class_init(IBusIMContextClass *class); static void ibus_im_context_class_fini(IBusIMContextClass *class); static void ibus_im_context_init(GObject *obj); static void ibus_im_context_notify(GObject *obj, GParamSpec *pspec); static void ibus_im_context_finalize(GObject *obj); static void ibus_im_context_reset(GtkIMContext *context); static gboolean ibus_im_context_filter_keypress(GtkIMContext *context, GdkEventKey *key); static void ibus_im_context_focus_in(GtkIMContext *context); static void ibus_im_context_focus_out(GtkIMContext *context); static void ibus_im_context_set_client_window(GtkIMContext *context, GdkWindow *client); static void ibus_im_context_set_cursor_location(GtkIMContext *context, GdkRectangle *area); static void ibus_im_context_set_surrounding(GtkIMContext *context, const gchar *text, int len, int cursor_index); static void ibus_im_context_set_surrounding_with_selection( GtkIMContext *context, const gchar *text, int len, int cursor_index, int anchor_index); /* static methods*/ static void _create_input_context(IBusIMContext *context); static gboolean _set_cursor_location_internal(IBusIMContext *context); static void _bus_connected_cb(IBusBus *bus, IBusIMContext *context); static void _request_surrounding_text(IBusIMContext *context); static gboolean _set_content_type(IBusIMContext *context); static void _commit_text(IBusIMContext *context, const gchar *text); static gboolean _retrieve_surrounding(IBusIMContext *context); static gboolean _delete_surrounding(IBusIMContext *context, gint offset_from_cursor, guint nchars); static gboolean _timeout_callback(gpointer *user_data); static void _run_main_loop_with_timeout(IBusIMContext *ibusimcontext); static GType _ibus_type_im_context = 0; static GtkIMContextClass *parent_class = NULL; static IBusBus *_bus = NULL; static guint _daemon_name_watch_id = 0; static gboolean _daemon_is_running = FALSE; void ibus_im_context_register_type(GTypeModule *type_module) { IDEBUG("%s", __FUNCTION__); static const GTypeInfo ibus_im_context_info = { sizeof(IBusIMContextClass), (GBaseInitFunc)NULL, (GBaseFinalizeFunc)NULL, (GClassInitFunc)ibus_im_context_class_init, (GClassFinalizeFunc)ibus_im_context_class_fini, NULL, /* class data */ sizeof(IBusIMContext), 0, (GInstanceInitFunc)ibus_im_context_init, }; if (!_ibus_type_im_context) { if (type_module) { _ibus_type_im_context = g_type_module_register_type(type_module, GTK_TYPE_IM_CONTEXT, "IBusIMContext", &ibus_im_context_info, (GTypeFlags)0); } else { _ibus_type_im_context = g_type_register_static(GTK_TYPE_IM_CONTEXT, "IBusIMContext", &ibus_im_context_info, (GTypeFlags)0); } } } GType ibus_im_context_get_type(void) { IDEBUG("%s", __FUNCTION__); if (_ibus_type_im_context == 0) { ibus_im_context_register_type(NULL); } g_assert(_ibus_type_im_context != 0); return _ibus_type_im_context; } IBusIMContext * ibus_im_context_new(void) { IDEBUG("%s", __FUNCTION__); GObject *obj = g_object_new(IBUS_TYPE_IM_CONTEXT, NULL); return IBUS_IM_CONTEXT(obj); } static gboolean _focus_in_cb(GtkWidget *widget, GdkEventFocus *event, gpointer user_data) { if (_focus_im_context == NULL && _fake_context != NULL) { ibus_input_context_focus_in(_fake_context); } return FALSE; } static gboolean _focus_out_cb(GtkWidget *widget, GdkEventFocus *event, gpointer user_data) { if (_focus_im_context == NULL && _fake_context != NULL) { ibus_input_context_focus_out(_fake_context); } return FALSE; } static gboolean ibus_im_context_commit_event(IBusIMContext *ibusimcontext, GdkEventKey *event) { IDEBUG("%s", __FUNCTION__); guint keyval = 0; GdkModifierType state = 0; int i; GdkModifierType no_text_input_mask; gunichar ch; if (event->type == GDK_KEY_RELEASE) return FALSE; keyval = event->keyval; state = event->state; /* Ignore modifier key presses */ for (i = 0; i < G_N_ELEMENTS(IBUS_COMPOSE_IGNORE_KEYLIST); i++) if (keyval == IBUS_COMPOSE_IGNORE_KEYLIST[i]) return FALSE; no_text_input_mask = gdk_keymap_get_modifier_mask(gdk_keymap_get_for_display(gdk_display_get_default()), GDK_MODIFIER_INTENT_NO_TEXT_INPUT); if (state & no_text_input_mask || keyval == GDK_KEY_Return || keyval == GDK_KEY_ISO_Enter || keyval == GDK_KEY_KP_Enter) { return FALSE; } ch = ibus_keyval_to_unicode(keyval); if (ch != 0 && !g_unichar_iscntrl(ch)) { IBusText *text = ibus_text_new_from_unichar(ch); IDEBUG("%s: text=%p", __FUNCTION__, text); _request_surrounding_text(ibusimcontext); _commit_text(ibusimcontext, text->text); return TRUE; } return FALSE; } struct _ProcessKeyEventData { GdkEvent *event; IBusIMContext *ibusimcontext; }; typedef struct _ProcessKeyEventData ProcessKeyEventData; static void _process_key_event_done(GObject *object, GAsyncResult *res, gpointer user_data) { IBusInputContext *context = (IBusInputContext *)object; ProcessKeyEventData *data = (ProcessKeyEventData *)user_data; GdkEvent *event = data->event; GError *error = NULL; g_slice_free(ProcessKeyEventData, data); gboolean retval = ibus_input_context_process_key_event_async_finish(context, res, &error); if (error != NULL) { g_warning("Process Key Event failed: %s.", error->message); g_error_free(error); } if (retval == FALSE) { ((GdkEventKey *)event)->state |= IBUS_IGNORED_MASK; gdk_event_put(event); } gdk_event_free(event); } static gboolean _process_key_event(IBusInputContext *context, GdkEventKey *event, IBusIMContext *ibusimcontext) { guint state; guint keyval = 0; guint16 hardware_keycode = 0; guint keycode = 0; gboolean retval = FALSE; state = event->state; if (event->type == GDK_KEY_RELEASE) state |= IBUS_RELEASE_MASK; keyval = event->keyval; hardware_keycode = event->hardware_keycode; keycode = hardware_keycode; ProcessKeyEventData *data = g_slice_new0(ProcessKeyEventData); data->event = gdk_event_copy((GdkEvent *)event); data->ibusimcontext = ibusimcontext; ibus_input_context_process_key_event_async(context, keyval, keycode, state, -1, NULL, _process_key_event_done, data); retval = TRUE; if (retval) event->state |= IBUS_HANDLED_MASK; else event->state |= IBUS_IGNORED_MASK; return retval; } /* emit "retrieve-surrounding" glib signal of GtkIMContext, if * context->caps has IBUS_CAP_SURROUNDING_TEXT and the current IBus * engine needs surrounding-text. */ static void _request_surrounding_text(IBusIMContext *context) { if (context && (context->caps & IBUS_CAP_SURROUNDING_TEXT) != 0 && context->ibuscontext != NULL && ibus_input_context_needs_surrounding_text(context->ibuscontext)) { _retrieve_surrounding(context); } else { // g_debug("%s has no capability of surrounding-text feature", g_get_prgname()); } } static gboolean _set_content_type(IBusIMContext *context) { if (context->ibuscontext != NULL) { GtkInputPurpose purpose; GtkInputHints hints; g_object_get(G_OBJECT(context), "input-purpose", &purpose, "input-hints", &hints, NULL); ibus_input_context_set_content_type(context->ibuscontext, purpose, hints); } return TRUE; } static gboolean _get_boolean_env(const gchar *name, gboolean defval) { const gchar *value = g_getenv(name); if (value == NULL) return defval; if (g_strcmp0(value, "") == 0 || g_strcmp0(value, "0") == 0 || g_strcmp0(value, "false") == 0 || g_strcmp0(value, "False") == 0 || g_strcmp0(value, "FALSE") == 0) return FALSE; return TRUE; } static void daemon_name_appeared(GDBusConnection *connection, const gchar *name, const gchar *owner, gpointer data) { if (!g_strcmp0(ibus_bus_get_service_name(_bus), IBUS_SERVICE_PORTAL)) { _daemon_is_running = TRUE; return; } /* If ibus-daemon is running and run ssh -X localhost, * daemon_name_appeared() is called but ibus_get_address() == NULL * because the hostname and display number are different between * ibus-daemon and clients. So IBusBus would not be connected and * ibusimcontext->ibuscontext == NULL and ibusimcontext->events_queue * could go beyond MAX_QUEUED_EVENTS . */ _daemon_is_running = (ibus_get_address() != NULL); } static void daemon_name_vanished(GDBusConnection *connection, const gchar *name, gpointer data) { _daemon_is_running = FALSE; } static void ibus_im_context_class_init(IBusIMContextClass *class) { IDEBUG("%s", __FUNCTION__); GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS(class); GObjectClass *gobject_class = G_OBJECT_CLASS(class); parent_class = (GtkIMContextClass *)g_type_class_peek_parent(class); im_context_class->reset = ibus_im_context_reset; im_context_class->focus_in = ibus_im_context_focus_in; im_context_class->focus_out = ibus_im_context_focus_out; im_context_class->filter_keypress = ibus_im_context_filter_keypress; im_context_class->set_client_window = ibus_im_context_set_client_window; im_context_class->set_cursor_location = ibus_im_context_set_cursor_location; im_context_class->set_surrounding = ibus_im_context_set_surrounding; gobject_class->notify = ibus_im_context_notify; gobject_class->finalize = ibus_im_context_finalize; /* init bus object */ if (_bus == NULL) { _bus = ibus_bus_new_async_client(); g_signal_connect(_bus, "connected", G_CALLBACK(_bus_connected_cb), NULL); } _daemon_name_watch_id = g_bus_watch_name( G_BUS_TYPE_SESSION, ibus_bus_get_service_name(_bus), G_BUS_NAME_WATCHER_FLAGS_NONE, daemon_name_appeared, daemon_name_vanished, NULL, NULL); } static void ibus_im_context_class_fini(IBusIMContextClass *class) { g_bus_unwatch_name(_daemon_name_watch_id); } static void ibus_im_context_init(GObject *obj) { IDEBUG("%s", __FUNCTION__); IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT(obj); ibusimcontext->client_window = NULL; // Init cursor area ibusimcontext->cursor_area.x = -1; ibusimcontext->cursor_area.y = -1; ibusimcontext->cursor_area.width = 0; ibusimcontext->cursor_area.height = 0; ibusimcontext->ibuscontext = NULL; ibusimcontext->has_focus = FALSE; ibusimcontext->time = GDK_CURRENT_TIME; ibusimcontext->caps = IBUS_CAP_FOCUS | IBUS_CAP_AUXILIARY_TEXT | IBUS_CAP_PROPERTY; if (surrounding_text_supported) { ibusimcontext->caps |= IBUS_CAP_SURROUNDING_TEXT; } ibusimcontext->events_queue = g_queue_new(); if (ibus_bus_is_connected(_bus)) { _create_input_context(ibusimcontext); } g_signal_connect(_bus, "connected", G_CALLBACK(_bus_connected_cb), obj); _daemon_is_running = (ibus_get_address() != NULL); } static void ibus_im_context_notify(GObject *obj, GParamSpec *pspec) { IDEBUG("%s", __FUNCTION__); if (g_strcmp0(pspec->name, "input-purpose") == 0 || g_strcmp0(pspec->name, "input-hints") == 0) { _set_content_type(IBUS_IM_CONTEXT(obj)); } } static void ibus_im_context_finalize(GObject *obj) { IDEBUG("%s", __FUNCTION__); IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT(obj); g_signal_handlers_disconnect_by_func(_bus, G_CALLBACK(_bus_connected_cb), obj); if (ibusimcontext->cancellable != NULL) { /* Cancel any ongoing create input context request */ g_cancellable_cancel(ibusimcontext->cancellable); g_object_unref(ibusimcontext->cancellable); ibusimcontext->cancellable = NULL; } if (ibusimcontext->ibuscontext) { ibus_proxy_destroy((IBusProxy *)ibusimcontext->ibuscontext); } ibus_im_context_set_client_window((GtkIMContext *)ibusimcontext, NULL); g_queue_free_full(ibusimcontext->events_queue, (GDestroyNotify)gdk_event_free); G_OBJECT_CLASS(parent_class)->finalize(obj); } static gboolean ibus_im_context_filter_keypress(GtkIMContext *context, GdkEventKey *event) { IDEBUG("%s", __FUNCTION__); IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT(context); if (event->state & IBUS_HANDLED_MASK) return TRUE; /* Do not call gtk_im_context_filter_keypress() because * gtk_im_context_simple_filter_keypress() binds Ctrl-Shift-u */ if (event->state & IBUS_IGNORED_MASK) return ibus_im_context_commit_event(ibusimcontext, event); /* XXX it is a workaround for some applications do not set client * window. */ if (ibusimcontext->client_window == NULL && event->window != NULL) gtk_im_context_set_client_window((GtkIMContext *)ibusimcontext, event->window); _request_surrounding_text(ibusimcontext); ibusimcontext->time = event->time; if (ibusimcontext->ibuscontext) { gboolean result = _process_key_event(ibusimcontext->ibuscontext, event, ibusimcontext); if (result) { _run_main_loop_with_timeout(ibusimcontext); } return result; } /* At this point we _should_ be waiting for the IBus context to be * created or the connection to IBus to be established. If that's * the case we queue events to be processed when the IBus context * is ready. */ g_return_val_if_fail(ibusimcontext->cancellable != NULL || ibus_bus_is_connected(_bus) == FALSE, FALSE); g_queue_push_tail(ibusimcontext->events_queue, gdk_event_copy((GdkEvent *)event)); if (g_queue_get_length(ibusimcontext->events_queue) > MAX_QUEUED_EVENTS) { g_warning("Events queue growing too big, will start to drop."); gdk_event_free((GdkEvent *)g_queue_pop_head(ibusimcontext->events_queue)); } return TRUE; } static void ibus_im_context_focus_in(GtkIMContext *context) { IBusIMContext *ibusimcontext = (IBusIMContext *)context; GtkWidget *widget = NULL; IDEBUG("%s: context=%p", __FUNCTION__, context); if (ibusimcontext->has_focus) return; /* don't set focus on password entry */ if (ibusimcontext->client_window != NULL) { gdk_window_get_user_data(ibusimcontext->client_window, (gpointer *)&widget); } if (widget && GTK_IS_ENTRY(widget) && !gtk_entry_get_visibility(GTK_ENTRY(widget))) { return; } /* Do not call gtk_im_context_focus_out() here. * google-chrome's notification popup window (Pushbullet) * takes the focus and the popup window disappears. * So other applications lose the focus because * ibusimcontext->has_focus is FALSE if * gtk_im_context_focus_out() is called here when * _focus_im_context != context. */ if (_focus_im_context == NULL) { /* focus out fake context */ if (_fake_context != NULL) { ibus_input_context_focus_out(_fake_context); } } ibusimcontext->has_focus = TRUE; if (ibusimcontext->ibuscontext) { if (!_set_content_type(ibusimcontext)) { ibusimcontext->has_focus = FALSE; return; } ibus_input_context_focus_in(ibusimcontext->ibuscontext); } /* set_cursor_location_internal() will get origin from X server, * it blocks UI. So delay it to idle callback. */ g_idle_add_full( G_PRIORITY_DEFAULT_IDLE, (GSourceFunc)_set_cursor_location_internal, g_object_ref(ibusimcontext), (GDestroyNotify)g_object_unref); /* retrieve the initial surrounding-text (regardless of whether * the current IBus engine needs surrounding-text) */ _request_surrounding_text(ibusimcontext); g_object_add_weak_pointer((GObject *)context, (gpointer *)&_focus_im_context); _focus_im_context = context; } static void ibus_im_context_focus_out(GtkIMContext *context) { IDEBUG("%s", __FUNCTION__); IBusIMContext *ibusimcontext = (IBusIMContext *)context; if (ibusimcontext->has_focus == FALSE) { return; } if (_focus_im_context) { g_object_remove_weak_pointer((GObject *)context, (gpointer *)&_focus_im_context); _focus_im_context = NULL; } ibusimcontext->has_focus = FALSE; if (ibusimcontext->ibuscontext) { ibus_input_context_focus_out(ibusimcontext->ibuscontext); } /* focus in the fake ic */ if (_fake_context != NULL) { ibus_input_context_focus_in(_fake_context); } } static void ibus_im_context_reset(GtkIMContext *context) { IDEBUG("%s", __FUNCTION__); IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT(context); if (ibusimcontext->ibuscontext) { ibus_input_context_reset(ibusimcontext->ibuscontext); } } /* Use the button-press-event signal until GtkIMContext always emits the reset * signal. * https://gitlab.gnome.org/GNOME/gtk/merge_requests/460 */ static gboolean ibus_im_context_button_press_event_cb(GtkWidget *widget, GdkEventButton *event, IBusIMContext *ibusimcontext) { IDEBUG("%s", __FUNCTION__); if (event->button != 1) return FALSE; if (ibusimcontext->ibuscontext) { ibus_input_context_reset(ibusimcontext->ibuscontext); } return FALSE; } static void _connect_button_press_event(IBusIMContext *ibusimcontext, gboolean do_connect) { GtkWidget *widget = NULL; g_assert(ibusimcontext->client_window); gdk_window_get_user_data(ibusimcontext->client_window, (gpointer *)&widget); /* firefox needs GtkWidget instead of GtkWindow */ if (GTK_IS_WIDGET(widget)) { if (do_connect) { g_signal_connect(widget, "button-press-event", G_CALLBACK(ibus_im_context_button_press_event_cb), ibusimcontext); ibusimcontext->use_button_press_event = TRUE; } else { g_signal_handlers_disconnect_by_func(widget, G_CALLBACK(ibus_im_context_button_press_event_cb), ibusimcontext); ibusimcontext->use_button_press_event = FALSE; } } } static void ibus_im_context_set_client_window(GtkIMContext *context, GdkWindow *client) { IBusIMContext *ibusimcontext; IDEBUG("%s", __FUNCTION__); ibusimcontext = IBUS_IM_CONTEXT(context); if (ibusimcontext->client_window) { if (ibusimcontext->use_button_press_event) _connect_button_press_event(ibusimcontext, FALSE); g_object_unref(ibusimcontext->client_window); ibusimcontext->client_window = NULL; } if (client != NULL) { ibusimcontext->client_window = g_object_ref(client); if (!ibusimcontext->use_button_press_event) _connect_button_press_event(ibusimcontext, TRUE); } } static void _set_rect_scale_factor_with_window(GdkRectangle *area, GdkWindow *window) { int scale_factor; g_assert(area); g_assert(GDK_IS_WINDOW(window)); scale_factor = gdk_window_get_scale_factor(window); area->x *= scale_factor; area->y *= scale_factor; area->width *= scale_factor; area->height *= scale_factor; } static gboolean _set_cursor_location_internal(IBusIMContext *ibusimcontext) { GdkRectangle area; if (ibusimcontext->client_window == NULL || ibusimcontext->ibuscontext == NULL) { return FALSE; } area = ibusimcontext->cursor_area; if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) { gdouble px, py; GdkWindow *parent; GdkWindow *window = ibusimcontext->client_window; while ((parent = gdk_window_get_effective_parent(window)) != NULL) { gdk_window_coords_to_parent(window, area.x, area.y, &px, &py); area.x = px; area.y = py; window = parent; } _set_rect_scale_factor_with_window(&area, ibusimcontext->client_window); ibus_input_context_set_cursor_location_relative(ibusimcontext->ibuscontext, area.x, area.y, area.width, area.height); return FALSE; } if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { area.x = 0; area.y += gdk_window_get_height(ibusimcontext->client_window); } gdk_window_get_root_coords(ibusimcontext->client_window, area.x, area.y, &area.x, &area.y); _set_rect_scale_factor_with_window(&area, ibusimcontext->client_window); ibus_input_context_set_cursor_location(ibusimcontext->ibuscontext, area.x, area.y, area.width, area.height); return FALSE; } static void ibus_im_context_set_cursor_location(GtkIMContext *context, GdkRectangle *area) { IDEBUG("%s", __FUNCTION__); IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT(context); /* The area is the relative coordinates and this has to get the absolute * ones in _set_cursor_location_internal() since GTK 4.0. */ if (ibusimcontext->cursor_area.x == area->x && ibusimcontext->cursor_area.y == area->y && ibusimcontext->cursor_area.width == area->width && ibusimcontext->cursor_area.height == area->height) { return; } ibusimcontext->cursor_area = *area; _set_cursor_location_internal(ibusimcontext); } static guint get_selection_anchor_point(IBusIMContext *ibusimcontext, guint cursor_pos, guint surrounding_text_len) { if (cursor_pos <= 0) { return ibusimcontext->text->len; } return cursor_pos; } static void ibus_im_context_set_surrounding(GtkIMContext *context, const gchar *text, int len, int cursor_index) { ibus_im_context_set_surrounding_with_selection(context, text, len, cursor_index, cursor_index); } static void ibus_im_context_set_surrounding_with_selection( GtkIMContext *context, const gchar *text, int len, int cursor_index, int anchor_index) { g_return_if_fail(context != NULL); g_return_if_fail(IBUS_IS_IM_CONTEXT(context)); g_return_if_fail(text != NULL); g_return_if_fail(strlen(text) >= len); g_return_if_fail(0 <= cursor_index && cursor_index <= len); IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT(context); if (ibusimcontext->ibuscontext) { IBusText *ibustext; guint cursor_pos; guint utf8_len; gchar *p; p = g_strndup(text, len); cursor_pos = g_utf8_strlen(p, cursor_index); utf8_len = g_utf8_strlen(p, len); ibustext = ibus_text_new_from_string(p); IDEBUG("%s: ibustext=%p", __FUNCTION__, ibustext); g_free(p); gint anchor_pos = get_selection_anchor_point(ibusimcontext, cursor_pos, utf8_len); ibus_input_context_set_surrounding_text(ibusimcontext->ibuscontext, ibustext, cursor_pos, anchor_pos); } } static void _bus_connected_cb(IBusBus *bus, IBusIMContext *ibusimcontext) { IDEBUG("%s", __FUNCTION__); if (ibusimcontext) _create_input_context(ibusimcontext); } static void _ibus_context_commit_text_cb(IBusInputContext *ibuscontext, IBusText *text, IBusIMContext *ibusimcontext) { IDEBUG("%s: text=%p", __FUNCTION__, text); _request_surrounding_text(ibusimcontext); _commit_text(ibusimcontext, ibus_text_get_text(text)); g_main_loop_quit(ibusimcontext->thread_loop); } static void _commit_text(IBusIMContext *ibusimcontext, const gchar *text) { // g_signal_emit(ibusimcontext, _signal_commit_id, 0, text->text); ibus_im_test_set_text(ibusimcontext, text); } static gboolean _retrieve_surrounding(IBusIMContext *ibusimcontext) { // No-op in our simulation since we store the text return TRUE; } static gboolean _delete_surrounding(IBusIMContext *ibusimcontext, gint offset_from_cursor, guint nchars) { // g_signal_emit(ibusimcontext, _signal_delete_surrounding_id, 0); if (offset_from_cursor < 0) { for (guint val = nchars; val <= ibusimcontext->text->len && (guint)ibusimcontext->text->str[ibusimcontext->text->len - val] >= 0x80; val++) { nchars = val; } g_string_erase(ibusimcontext->text, ibusimcontext->text->len - nchars, nchars); } else { g_string_erase(ibusimcontext->text, offset_from_cursor, nchars); } return TRUE; } static gboolean _key_is_modifier(guint keyval) { /* See gdkkeys-x11.c:_gdk_keymap_key_is_modifier() for how this * really should be implemented */ switch (keyval) { case GDK_KEY_Shift_L: case GDK_KEY_Shift_R: case GDK_KEY_Control_L: case GDK_KEY_Control_R: case GDK_KEY_Caps_Lock: case GDK_KEY_Shift_Lock: case GDK_KEY_Meta_L: case GDK_KEY_Meta_R: case GDK_KEY_Alt_L: case GDK_KEY_Alt_R: case GDK_KEY_Super_L: case GDK_KEY_Super_R: case GDK_KEY_Hyper_L: case GDK_KEY_Hyper_R: case GDK_KEY_ISO_Lock: case GDK_KEY_ISO_Level2_Latch: case GDK_KEY_ISO_Level3_Shift: case GDK_KEY_ISO_Level3_Latch: case GDK_KEY_ISO_Level3_Lock: case GDK_KEY_ISO_Level5_Shift: case GDK_KEY_ISO_Level5_Latch: case GDK_KEY_ISO_Level5_Lock: case GDK_KEY_ISO_Group_Shift: case GDK_KEY_ISO_Group_Latch: case GDK_KEY_ISO_Group_Lock: return TRUE; default: return FALSE; } } /* Copy from gdk */ static GdkEventKey * _create_gdk_event(IBusIMContext *ibusimcontext, guint keyval, guint keycode, guint state) { gunichar c = 0; gchar buf[8]; GdkEventKey *event = (GdkEventKey *)gdk_event_new((state & IBUS_RELEASE_MASK) ? GDK_KEY_RELEASE : GDK_KEY_PRESS); if (ibusimcontext && ibusimcontext->client_window) event->window = g_object_ref(ibusimcontext->client_window); else if (_input_window) event->window = g_object_ref(_input_window); /* The time is copied the latest value from the previous * GdkKeyEvent in filter_keypress(). * * We understand the best way would be to pass the all time value * to IBus functions process_key_event() and IBus DBus functions * ProcessKeyEvent() in IM clients and IM engines so that the * _create_gdk_event() could get the correct time values. * However it would causes to change many functions and the time value * would not provide the useful meanings for each IBus engines but just * pass the original value to ForwardKeyEvent(). * We use the saved value at the moment. * * Another idea might be to have the time implementation in X servers * but some Xorg uses clock_gettime() and others use gettimeofday() * and the values would be different in each implementation and * locale/remote X server. So probably that idea would not work. */ if (ibusimcontext) { event->time = ibusimcontext->time; } else { event->time = GDK_CURRENT_TIME; } event->send_event = FALSE; event->state = state; event->keyval = keyval; event->string = NULL; event->length = 0; event->hardware_keycode = (keycode != 0) ? keycode + 8 : 0; event->group = 0; event->is_modifier = _key_is_modifier(keyval); if (keyval != GDK_KEY_VoidSymbol) c = gdk_keyval_to_unicode(keyval); if (c) { gsize bytes_written; gint len; /* Apply the control key - Taken from Xlib */ if (event->state & GDK_CONTROL_MASK) { if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F; else if (c == '2') { #if GLIB_CHECK_VERSION(2, 68, 0) event->string = g_memdup2("\0\0", 2); #else event->string = g_memdup("\0\0", 2); #endif event->length = 1; buf[0] = '\0'; goto out; } else if (c >= '3' && c <= '7') c -= ('3' - '\033'); else if (c == '8') c = '\177'; else if (c == '/') c = '_' & 0x1F; } len = g_unichar_to_utf8(c, buf); buf[len] = '\0'; event->string = g_locale_from_utf8(buf, len, NULL, &bytes_written, NULL); if (event->string) event->length = bytes_written; } else if (keyval == GDK_KEY_Escape) { event->length = 1; event->string = g_strdup("\033"); } else if (keyval == GDK_KEY_Return || keyval == GDK_KEY_KP_Enter) { event->length = 1; event->string = g_strdup("\r"); } if (!event->string) { event->length = 0; event->string = g_strdup(""); } out: return event; } static void _ibus_context_forward_key_event_cb( IBusInputContext *ibuscontext, guint keyval, guint keycode, guint state, IBusIMContext *ibusimcontext) { IDEBUG("%s", __FUNCTION__); if (keycode == 0 && ibusimcontext->client_window) { GdkDisplay *display = gdk_window_get_display(ibusimcontext->client_window); GdkKeymap *keymap = gdk_keymap_get_for_display(display); GdkKeymapKey *keys = NULL; gint n_keys = 0; if (gdk_keymap_get_entries_for_keyval(keymap, keyval, &keys, &n_keys)) keycode = keys->keycode; else g_warning("Failed to parse keycode from keyval %x", keyval); } GdkEventKey *event = _create_gdk_event(ibusimcontext, keyval, keycode, state); gdk_event_put((GdkEvent *)event); if (!surrounding_text_supported && keyval == IBUS_KEY_BackSpace && ibusimcontext->text->len > 0) { int index = ibusimcontext->text->len - 1; int len = 1; do { guchar c = (guchar)ibusimcontext->text->str[index]; // delete a single UTF-8 codepoint, code unit (byte) by code unit if (c <= 0x7F) { // ASCII character break; } else if (c >= 0x80 && c <= 0xBF) { // Trailing byte of multi-byte character index--; len++; } else if (c >= 0xC2 && c <= 0xF4) { // First byte of 2-/3-/4-byte character break; } else { g_error("Illegal code unit value 0x%2x in %s", c, ibusimcontext->text->str); g_test_fail(); } } while (index >= 0); g_string_erase(ibusimcontext->text, index, len); } gdk_event_free((GdkEvent *)event); } static void _ibus_context_delete_surrounding_text_cb( IBusInputContext *ibuscontext, gint offset_from_cursor, guint nchars, IBusIMContext *ibusimcontext) { IDEBUG("%s: offset %d, nchar: %d", __FUNCTION__, offset_from_cursor, nchars); _delete_surrounding(ibusimcontext, offset_from_cursor, nchars); } static void _ibus_context_destroy_cb(IBusInputContext *ibuscontext, IBusIMContext *ibusimcontext) { IDEBUG("%s", __FUNCTION__); g_assert(ibusimcontext->ibuscontext == ibuscontext); g_object_unref(ibusimcontext->ibuscontext); ibusimcontext->ibuscontext = NULL; } static gboolean _timeout_callback(gpointer *user_data) { timeout_data *data = (timeout_data *)user_data; g_main_loop_quit(data->thread_loop); data->timed_out = TRUE; return FALSE; } static void _run_main_loop_with_timeout(IBusIMContext *ibusimcontext) { timeout_data data; data.thread_loop = ibusimcontext->thread_loop; data.timed_out = FALSE; int timeout_id = g_timeout_add(1000 /*ms*/, (GSourceFunc)_timeout_callback, &data); g_main_loop_run(ibusimcontext->thread_loop); if (!data.timed_out) { g_source_remove(timeout_id); } } static void _create_input_context(IBusIMContext *ibusimcontext) { IDEBUG("%s", __FUNCTION__); g_assert(ibusimcontext->ibuscontext == NULL); IBusInputContext *context = ibus_bus_create_input_context(_bus, "gtk-im"); if (context == NULL) { g_warning("Create input context failed."); } else { ibusimcontext->ibuscontext = context; g_signal_connect(ibusimcontext->ibuscontext, "commit-text", G_CALLBACK(_ibus_context_commit_text_cb), ibusimcontext); g_signal_connect( ibusimcontext->ibuscontext, "forward-key-event", G_CALLBACK(_ibus_context_forward_key_event_cb), ibusimcontext); g_signal_connect( ibusimcontext->ibuscontext, "delete-surrounding-text", G_CALLBACK(_ibus_context_delete_surrounding_text_cb), ibusimcontext); g_signal_connect(ibusimcontext->ibuscontext, "destroy", G_CALLBACK(_ibus_context_destroy_cb), ibusimcontext); ibus_input_context_set_capabilities(ibusimcontext->ibuscontext, ibusimcontext->caps); if (ibusimcontext->has_focus) { /* The time order is _create_input_context() -> * ibus_im_context_notify() -> ibus_im_context_focus_in() -> * _create_input_context_done() * so _set_content_type() is called at the beginning here * because ibusimcontext->ibuscontext == NULL before. */ _set_content_type(ibusimcontext); ibus_input_context_focus_in(ibusimcontext->ibuscontext); _set_cursor_location_internal(ibusimcontext); } if (!g_queue_is_empty(ibusimcontext->events_queue)) { GdkEventKey *event; while ((event = g_queue_pop_head(ibusimcontext->events_queue))) { _process_key_event(context, event, ibusimcontext); gboolean result = _process_key_event(context, event, ibusimcontext); if (result) { _run_main_loop_with_timeout(ibusimcontext); } gdk_event_free((GdkEvent *)event); } } } } void ibus_im_test_set_thread_loop(IBusIMContext *context, GMainLoop *loop) { context->thread_loop = loop; } void ibus_im_test_set_text(IBusIMContext *context, const gchar *text) { if (!context->text) { context->text = g_string_new(""); } g_string_append(context->text, text); ibus_im_context_set_surrounding_with_selection( (GtkIMContext *)context, context->text->str, context->text->len, context->text->len, context->text->len); } const gchar * ibus_im_test_get_text(IBusIMContext *context) { if (context->text) { return context->text->str; } return NULL; } void ibus_im_test_clear_text(IBusIMContext *context) { if (context->text) { g_string_free(context->text, TRUE); context->text = NULL; } } void ibus_im_test_set_surrounding_text_supported(gboolean supported) { surrounding_text_supported = supported; }
31.798007
129
0.726734
[ "object" ]
248d474355babfaae94eadc5b64ae361741eb62e
943
h
C
src/engine/objects/curve/Curve.h
ferdikoomen/Capture3
e4fe57d0c14e4deecddf9f1a9d19824076a49a03
[ "MIT" ]
18
2018-04-07T18:52:27.000Z
2022-03-22T09:23:32.000Z
src/engine/objects/curve/Curve.h
ferdikoomen/Capture3
e4fe57d0c14e4deecddf9f1a9d19824076a49a03
[ "MIT" ]
1
2020-10-13T07:51:45.000Z
2020-10-13T07:51:45.000Z
src/engine/objects/curve/Curve.h
ferdikoomen/Capture3
e4fe57d0c14e4deecddf9f1a9d19824076a49a03
[ "MIT" ]
3
2019-03-12T06:10:14.000Z
2021-05-20T12:54:52.000Z
#ifndef CAPTURE3_CURVE_H #define CAPTURE3_CURVE_H #include <cmath> #include <vector> #include "CurvePoint.h" #include "CurveDataLinear.h" #include "CurveDataLowess.h" #include "CurveDataCubic.h" #include "../colorChart/ColorChartPatch.h" namespace Capture3 { class Curve { public: Curve(); virtual ~Curve(); void add(const double x, const double y, const ColorChartPatch *patch); void finalize(); double getY(const double x) const; double getX(const double y) const; const std::vector<const CurvePoint *> &getPoints() const; const CurveDataLinear &getDataLinear() const; const CurveDataLowess &getDataLowess() const; const CurveDataCubic &getDataCubic() const; private: std::vector<const CurvePoint *> points; CurveDataLinear dataLinear; CurveDataLowess dataLowess; CurveDataCubic dataCubic; }; } #endif // CAPTURE3_CURVE_H
18.134615
75
0.685048
[ "vector" ]
24ab780680d1b2ee8171e00c14e272b9b19b135c
8,536
h
C
Include/SystemQOR/Posix/Basestdlib.h
mfaithfull/QOR
0fa51789344da482e8c2726309265d56e7271971
[ "BSL-1.0" ]
9
2016-05-27T01:00:39.000Z
2021-04-01T08:54:46.000Z
Include/SystemQOR/Posix/Basestdlib.h
mfaithfull/QOR
0fa51789344da482e8c2726309265d56e7271971
[ "BSL-1.0" ]
1
2016-03-03T22:54:08.000Z
2016-03-03T22:54:08.000Z
Include/SystemQOR/Posix/Basestdlib.h
mfaithfull/QOR
0fa51789344da482e8c2726309265d56e7271971
[ "BSL-1.0" ]
4
2016-05-27T01:00:43.000Z
2018-08-19T08:47:49.000Z
//Basestdlib.h // Copyright Querysoft Limited 2013 // // Permission is hereby granted, free of charge, to any person or organization // obtaining a copy of the software and accompanying documentation covered by // this license (the "Software") to use, reproduce, display, distribute, // execute, and transmit the Software, and to prepare derivative works of the // Software, and to permit third-parties to whom the Software is furnished to // do so, all subject to the following: // // The copyright notices in the Software and this entire statement, including // the above license grant, this restriction and the following disclaimer, // must be included in all copies of the Software, in whole or in part, and // all derivative works of the Software, unless such copies or derivative // works are solely in the form of machine-executable object code generated by // a source language processor. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. //Base CRT class for Cstdlib #ifndef SYSTEMQOR_POSIX_STDLIB_H_3 #define SYSTEMQOR_POSIX_STDLIB_H_3 #include "SystemQOR.h" #include QOR_SYS_PLATFORMTYPES(stdlib) #include "CodeQOR/ClassReg/ClassRegEntry.h" struct clib_execution_context; //-------------------------------------------------------------------------------- namespace nsBaseCRT { using nsPlatform::div_t; using nsPlatform::ldiv_t; using nsPlatform::lldiv_t; using nsPlatform::errno_t; //-------------------------------------------------------------------------------- class __QOR_INTERFACE( __CQOR ) Cstdlib { public: __QOR_DECLARE_OCLASS_ID( Cstdlib ); __QCMP_STATIC_CONSTANT( int, CUTOFF = 8 ); __QCMP_STATIC_CONSTANT( int, STKSIZ = ( 8 * sizeof( void* ) -2 ) ); Cstdlib(); virtual ~Cstdlib(); virtual void _Exit( int status ); virtual long a64l( const char* pInput ); __QCMP_NORETURN virtual void abort( void ); virtual int abs( int j ); virtual int atexit( void (*func)(void) ); virtual errno_t _get_doserrno( int* pValue ); virtual errno_t _set_doserrno( int value ); virtual double atof( const char* nptr ); virtual int atoi( const char* nptr ); virtual long int atol( const char* nptr ); virtual long long int atoll( const char* nptr ); virtual void* bsearch( const void* key, const void* base, size_t num, size_t width, int (*compare)(const void *, const void *) ); virtual void* bsearch_s( const void* key, const void* base, size_t num, size_t width, int ( *compare )( void*, const void*, const void* ), void* pvContext ); virtual void* calloc(size_t nmemb, size_t size) = 0; virtual div_t div( int numer, int denom ); virtual double drand48( void ); virtual char* ecvt( double dValue, int iDigit, int* pDecpt, int* pSign ); virtual double erand48( unsigned short xsubi[ 3 ] ); virtual void exit( int status ); virtual char* fcvt( double dValue, int iDigit, int* pDecpt, int* pSign ); virtual void free( void* ptr ); virtual char* gcvt( double dValue, int iDigit, char* pBuf ); virtual char* getenv( const char* name ); virtual errno_t getenv_s( size_t* pReturnSize, char* pDstBuf, size_t DstSize, const char* pszVarName ); virtual int getsubopt( char** optionp, char* const* tokens, char** valuep ); virtual int grantpt( int iFileDes ); virtual char* initstate( unsigned int uiSeed, char* pState, size_t Size ); virtual long jrand48( unsigned short xsubi[ 3 ] ); virtual char* l64a( long lValue ); virtual long int labs( long int j ); virtual void lcong48( unsigned short param[ 7 ] ); virtual ldiv_t ldiv( long int numer, long int denom ); virtual Cmp_long_long llabs(long long int j); virtual lldiv_t lldiv(long long int numer, long long int denom); virtual long lrand48( void ); virtual void* malloc( size_t size ); virtual int mblen( const char* s, size_t n ); virtual size_t mbstowcs( wchar_t* pwcs, const char* s, size_t n ); virtual errno_t mbstowcs_s( size_t* pNumOfCharConverted, wchar_t* pDstBuf, size_t SizeInWords, const char* s, size_t MaxCount ); virtual int mbtowc( wchar_t* pwc, const char* s, size_t n ); virtual char* mktemp( char* pTemplate ); virtual int mkstemp( char* pTemplate ); virtual long mrand48( void ); virtual long nrand48( unsigned short xsubi[ 3 ] ); virtual int posix_memalign( void** memptr, size_t alignment, size_t size ); virtual int posix_openpt( int oflag ); virtual char* ptsname( int iFileDes ); virtual int putenv( const char* str ); virtual int _putenv( const char* envstring ); virtual void qsort( void* base, size_t num, size_t width, int (*comp)(const void *, const void *) ); virtual void qsort_s( void* base, size_t nmemb, size_t SizeOfElements, int ( *pFuncCompare )( void*, const void*, const void* ), void* pvContext ); virtual int rand(void); virtual errno_t rand_s( unsigned int* puiRandomValue ); virtual int rand_r( unsigned int* pSeed ); virtual long random( void ); virtual void* realloc( void* ptr, size_t size ); virtual char* realpath( const char* path, char* resolved_path ); virtual unsigned short* seed48( unsigned short seed16v[ 3 ] ); virtual int setenv( const char* envname, const char* envval, int overwrite ); virtual void setkey( const char* key ); virtual char* setstate( const char* ); virtual void srand( unsigned int /*seed*/ ); virtual void srand48( long /*seed*/ ); virtual void srandom( unsigned int uiSeed ); virtual double strtod( const char* /*nptr*/, char** /*endptr*/ ); virtual float strtof( const char* nptr, char** endptr ); virtual long int strtol( const char* nptr, char** endptr, int base ); virtual long double strtold( const char* nptr, char** endptr ); virtual long long int strtoll( const char* /*nptr*/, char** /*endptr*/, int /*base*/ ); virtual unsigned long int strtoul( const char* /*nptr*/, char** /*endptr*/, int /*base*/ ); virtual unsigned long long int strtoull( const char* /*nptr*/, char** /*endptr*/, int /*base*/ ); virtual int system( const char* string ); virtual int unlockpt( int ); virtual int unsetenv( const char* /*name*/ ); virtual size_t wcstombs( char* s, const wchar_t* pwcs, size_t n ) ; virtual int wctomb( char* s, wchar_t wchar ); virtual errno_t wcstombs_s( size_t* pReturnValue, char* mbstr, size_t sizeInBytes, const wchar_t* wcstr, size_t count ); virtual errno_t wctomb_s( int* pRetValue, char* mbchar, size_t sizeInBytes, wchar_t wchar ); protected: char* suboptarg; static int _gettemp( /*ptr,*/ char* /*path*/, int /*doopen*/ ); char* cvt( double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag ); char* _gcvt( double /*invalue*/, int /*ndigit*/, char* buf, char /*type*/, int /*dot*/ ); virtual void __dorand48( clib_execution_context* pEC, unsigned short xseed[3] ); //-------------------------------------------------------------------------------- // Undocumented behaviour: when given NULL as a buffer, return a pointer to static space in //the rent structure. This is only to support ecvt and fcvt, which aren't ANSI anyway. char* fcvtbuf( double /*invalue*/, int /*ndigit*/, int* /*decpt*/, int* /*sign*/, char* /*fcvt_buf*/ ); virtual char* ecvtbuf( double /*invalue*/, int /*ndigit*/, int* /*decpt*/, int* /*sign*/, char* /*fcvt_buf*/ ); virtual void swap( char* a, char* b, size_t width ); virtual void shortsort( char* lo, char* hi, size_t width, int (*comp)( const void*, const void* ) ); virtual long double strtox( const char* s, char** p, int prec ) = 0; private: unsigned int m_uiSeed; }; }//nsBaseCRT #endif//_QCRT_BASE_STDLIB_H_
51.733333
165
0.646673
[ "object" ]
24b13b1e38cbc3a28b0d76e22e4f7ba5d8b54d91
177
h
C
src/data/triangle.h
happanda/renderize
2b2666a83c78df2cd838bdb2cebca58c27a8c5f1
[ "MIT" ]
null
null
null
src/data/triangle.h
happanda/renderize
2b2666a83c78df2cd838bdb2cebca58c27a8c5f1
[ "MIT" ]
null
null
null
src/data/triangle.h
happanda/renderize
2b2666a83c78df2cd838bdb2cebca58c27a8c5f1
[ "MIT" ]
null
null
null
#pragma once #include <vector> #include <glm/vec3.hpp> extern float const sMinFillDist; std::vector<glm::vec3> fill(glm::vec3 const* triangle, float minDist = sMinFillDist);
19.666667
85
0.745763
[ "vector" ]
24c0bc820daa09b0caf08d9606b7d74235b95aac
1,519
h
C
src/developer/forensics/feedback_data/system_log_recorder/listener.h
dahlia-os/fuchsia-pine64-pinephone
57aace6f0b0bd75306426c98ab9eb3ff4524a61d
[ "BSD-3-Clause" ]
14
2020-10-25T05:48:36.000Z
2021-09-20T02:46:20.000Z
src/developer/forensics/feedback_data/system_log_recorder/listener.h
JokeZhang/fuchsia
d6e9dea8dca7a1c8fa89d03e131367e284b30d23
[ "BSD-3-Clause" ]
1
2022-01-14T23:38:40.000Z
2022-01-14T23:38:40.000Z
src/developer/forensics/feedback_data/system_log_recorder/listener.h
JokeZhang/fuchsia
d6e9dea8dca7a1c8fa89d03e131367e284b30d23
[ "BSD-3-Clause" ]
4
2020-12-28T17:04:45.000Z
2022-03-12T03:20:44.000Z
// Copyright 2020 The Fuchsia 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 SRC_DEVELOPER_FORENSICS_FEEDBACK_DATA_SYSTEM_LOG_RECORDER_LISTENER_H_ #define SRC_DEVELOPER_FORENSICS_FEEDBACK_DATA_SYSTEM_LOG_RECORDER_LISTENER_H_ #include <fuchsia/logger/cpp/fidl.h> #include <lib/fidl/cpp/binding.h> #include <lib/sys/cpp/service_directory.h> #include <memory> #include <vector> #include "src/developer/forensics/feedback_data/system_log_recorder/log_message_store.h" namespace forensics { namespace feedback_data { namespace system_log_recorder { // Listens to incoming logs and immediately adds them to a store. class SystemLogListener : public fuchsia::logger::LogListenerSafe { public: SystemLogListener(std::shared_ptr<sys::ServiceDirectory> services, LogMessageStore* store); void StartListening(); private: // |fuchsia::logger::LogListenerSafe| void Log(fuchsia::logger::LogMessage message, LogCallback done) override; void LogMany(std::vector<fuchsia::logger::LogMessage> messages, LogManyCallback done) override; void Done() override; const std::shared_ptr<sys::ServiceDirectory> services_; LogMessageStore* store_; ::fidl::Binding<fuchsia::logger::LogListenerSafe> binding_; fuchsia::logger::LogPtr logger_; }; } // namespace system_log_recorder } // namespace feedback_data } // namespace forensics #endif // SRC_DEVELOPER_FORENSICS_FEEDBACK_DATA_SYSTEM_LOG_RECORDER_LISTENER_H_
33.021739
97
0.797893
[ "vector" ]
24ec089d52c570e01a8dda18c1d9274fd50b84a9
2,796
h
C
extern/audaspace/include/util/ThreadPool.h
rbabari/blender
6daa85f14b2974abfc3d0f654c5547f487bb3b74
[ "Naumen", "Condor-1.1", "MS-PL" ]
365
2015-02-10T15:10:55.000Z
2022-03-03T15:50:51.000Z
extern/audaspace/include/util/ThreadPool.h
rbabari/blender
6daa85f14b2974abfc3d0f654c5547f487bb3b74
[ "Naumen", "Condor-1.1", "MS-PL" ]
45
2015-01-09T15:34:20.000Z
2021-10-05T14:44:23.000Z
extern/audaspace/include/util/ThreadPool.h
rbabari/blender
6daa85f14b2974abfc3d0f654c5547f487bb3b74
[ "Naumen", "Condor-1.1", "MS-PL" ]
172
2015-01-25T15:16:53.000Z
2022-01-31T08:25:36.000Z
/******************************************************************************* * Copyright 2015-2016 Juan Francisco Crespo Galán * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ #pragma once /** * @file ThreadPool.h * @ingroup util * The ThreadPool class. */ #include "Audaspace.h" #include <mutex> #include <condition_variable> #include <vector> #include <thread> #include <queue> #include <future> #include <functional> AUD_NAMESPACE_BEGIN /** * This represents pool of threads. */ class AUD_API ThreadPool { private: /** * A queue of tasks. */ std::queue<std::function<void()>> m_queue; /** * A vector of thread objects. */ std::vector<std::thread> m_threads; /** * A mutex for synchronization. */ std::mutex m_mutex; /** * A condition variable used to stop the threads when there are no tasks. */ std::condition_variable m_condition; /** * Stop flag. */ bool m_stopFlag; /** * The number fo threads. */ unsigned int m_numThreads; // delete copy constructor and operator= ThreadPool(const ThreadPool&) = delete; ThreadPool& operator=(const ThreadPool&) = delete; public: /** * Creates a new ThreadPool object. * \param count The number of threads of the pool. It must not be 0. */ ThreadPool(unsigned int count); virtual ~ThreadPool(); /** * Enqueues a new task for the threads to realize. * \param t A function that realices a task. * \param args The arguments of the task. * \return A future of the same type as the return type of the task. */ template<class T, class... Args> std::future<typename std::result_of<T(Args...)>::type> enqueue(T&& t, Args&&... args) { using pkgdTask = std::packaged_task<typename std::result_of<T(Args...)>::type()>; std::shared_ptr<pkgdTask> task = std::make_shared<pkgdTask>(std::bind(std::forward<T>(t), std::forward<Args>(args)...)); auto result = task->get_future(); m_mutex.lock(); m_queue.emplace([task]() { (*task)(); }); m_mutex.unlock(); m_condition.notify_one(); return result; } /** * Retrieves the number of threads of the pool. * \return The number of threads. */ unsigned int getNumOfThreads(); private: /** * Worker thread function. */ void threadFunction(); }; AUD_NAMESPACE_END
23.3
122
0.657725
[ "object", "vector" ]
24edb5e6823fe0d239b94119b807ec346b9d4afd
2,462
h
C
assignments/assignment_04/Assignment_04/Assignment_04/ConsoleCanvas.h
h0han/SE271_OOP
5b57b3a1664397d3c2d9cd9052626f8a17e7f6f8
[ "MIT" ]
null
null
null
assignments/assignment_04/Assignment_04/Assignment_04/ConsoleCanvas.h
h0han/SE271_OOP
5b57b3a1664397d3c2d9cd9052626f8a17e7f6f8
[ "MIT" ]
null
null
null
assignments/assignment_04/Assignment_04/Assignment_04/ConsoleCanvas.h
h0han/SE271_OOP
5b57b3a1664397d3c2d9cd9052626f8a17e7f6f8
[ "MIT" ]
null
null
null
#pragma once //////////////////////////////////////////////////////////////////////////////// // SE271 - Assignment 4: Snake Arena // Note: You will not submit this file // Draw texts into the console // This class is platform-dependent. // The current code is implemented and tested in VS2019 using Console mode. //////////////////////////////////////////////////////////////////////////////// #include "Canvas.h" #include <vector> namespace snake_arena { class TextPixel; // Canvas to draw frames into the console class ConsoleCanvas final : public Canvas { public: /** * \brief Constructor * \param width: frame width * \param height: frame height **/ ConsoleCanvas(size_t width, size_t height); // Destructor virtual ~ConsoleCanvas() override; /** * \brief Add a new line in the current canvas * \param line: null-terminated character string. * The length should be smaller than width. * \return return if it succeeds **/ virtual bool addLine(const char* line) override; /** * \brief Draw the current canvas frame and pause for sleep_millisecond * \param sleep_millisecond: time to sleep in ms **/ virtual void draw(int sleep_millisecond); /** * \brief Draw the current canvas frame and pause for 50 ms **/ virtual void draw() override { draw(def_sleep_millisecond); }; /** * \brief Set the default sleep time called in draw() * \param default_sleep_ms: the sleep time **/ virtual void setDefaultSleepTime(int sleep_millisecond) { def_sleep_millisecond = sleep_millisecond; } private: int width; // Frame width int height; // Frame height int def_sleep_millisecond = 50; // default sleep time // Double buffering int line_index = 0; // line index of current buffer char* prev_buffer = nullptr; // buffer already drawn char* curr_buffer = nullptr; // buffer currently filled private: size_t convertCoord(int x, int y); std::vector<TextPixel> _getFrameDifference(); }; // A simple class to represent a pixel on a certain location class TextPixel { public: TextPixel(int x, int y, char c) : x(x), y(y), c(c) {} int x; int y; char c; }; }
30.775
80
0.5658
[ "vector" ]
24febe9da88e1913f2706ff1573a3e26ee4d5aa1
1,971
h
C
SolidStateOutput.h
per1234/SolidStateOutput
b896e37d0e40939566d08196ac7c585666fa59a0
[ "MIT" ]
null
null
null
SolidStateOutput.h
per1234/SolidStateOutput
b896e37d0e40939566d08196ac7c585666fa59a0
[ "MIT" ]
null
null
null
SolidStateOutput.h
per1234/SolidStateOutput
b896e37d0e40939566d08196ac7c585666fa59a0
[ "MIT" ]
null
null
null
/* SolidStateOutput.h Library for Solid State Outputs Created by Brandon Myers - Myers Made Industries, LLC. Sept 15, 2017 MIT License Copyright (c) 2017 Myers Made Industries, LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _SOLIDSTATEOUTPUT_h #define _SOLIDSTATEOUTPUT_h #if defined(ARDUINO) && ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif class SolidStateOutput { public: SolidStateOutput(int pin); SolidStateOutput(int pin, unsigned long t1, byte p1, byte p2); SolidStateOutput(int pin, unsigned long t1, byte p1, byte p2, unsigned long t2); void Process(); bool State; byte Feedback(); bool Invert; unsigned long ScanTime; private: int _pin; int _mode; unsigned long _t1; byte _p1; unsigned long _t2; byte _p2; int _command; bool _statelastscan; unsigned long _t1start; unsigned long _t2start; float _m; int _b; unsigned long _x; int _y; }; #endif
28.565217
83
0.749366
[ "solid" ]
24fedcb8670ca6ae52f1098239d3801dbad9ddd3
6,485
h
C
src/core/system_types.h
psettle/particles
eae4b515781a2f8aca0dc5c3ba02d103f0fd86c3
[ "MIT" ]
null
null
null
src/core/system_types.h
psettle/particles
eae4b515781a2f8aca0dc5c3ba02d103f0fd86c3
[ "MIT" ]
null
null
null
src/core/system_types.h
psettle/particles
eae4b515781a2f8aca0dc5c3ba02d103f0fd86c3
[ "MIT" ]
null
null
null
/** * @file system_types.h * * @brief Type defs for the core openGL functions */ #ifndef SYSTEM_TYPES_H #define SYSTEM_TYPES_H /********************************************************************** GENERAL INCLUDES **********************************************************************/ #include "common_types.h" #include "opengl_includes.h" #include "shader.h" #include "texture.h" #include "vector.h" #include "matrix_math.h" /********************************************************************** CAMERA TYPES **********************************************************************/ /** * @brief */ typedef struct camera_struct { mat4_type projection_matrix; mat4_type view_matrix; mat4_type projection_view_matrix; vec3_type position; } camera_type; /********************************************************************** FRAME EVENT TYPES **********************************************************************/ /** * @brief */ typedef struct frame_event_struct { GLdouble timestamp; GLdouble timesince_last_frame; } frame_event_type; /** * @brief */ typedef void ( * frame_event_callback ) ( frame_event_type const * event_data ); /********************************************************************** OBJECT GROUP TYPES **********************************************************************/ /** * @brief */ typedef struct uv_struct { GLfloat u; GLfloat v; } uv_type; typedef struct vertex_struct { vec3_type vertex; vec3_type normal; uv_type uv; } vertex_type; /** * @brief */ typedef struct bone_struct { uint16_t bone_id; mat4_type bone_transform_matrix; } bone_type; /** * @brief */ typedef struct object_struct { uint16_t object_id; boolean is_visible; vec3_type position; mat4_type model_matrix; shader_type* shader; vector_type* bones; /* Vector of bone_type, for each bone in the object */ } object_type; /** * @brief */ typedef uint8_t object_event_type_t8; enum { OBJECT_EVENT_TYPE_RENDER_START, /* Rendering of an object type has started, the shader is bound and uniforms can be passed in. */ OBJECT_EVENT_TYPE_RENDER_OBJECT, /* Rendering of a particular object is about to start. Changes to that objects position, rotation or scale will appear in the next frame. */ OBJECT_EVENT_TYPE_RENDER_COUNT }; /** * @brief */ typedef struct object_event_type_render_start_data_struct { shader_type const * shader; } object_event_type_render_start_data_type; /** * @brief */ typedef struct object_event_type_render_object_data_struct { object_type* object; GLdouble time_since_last_frame; } object_event_type_render_object_data_type; /** * @brief */ typedef union object_event_data_union { object_event_type_render_start_data_type render_start_data; /* Data for OBJECT_EVENT_TYPE_RENDER_START */ object_event_type_render_object_data_type render_object_data; /* Data for OBJECT_EVENT_TYPE_RENDER_OBJECT */ } object_event_data_type; /** * @brief */ typedef struct object_event_struct { object_event_type_t8 event_type; object_event_data_type event_data; } object_event_type; /** * @brief */ typedef void (*object_cb_type) ( object_event_type const * event_data ); /** * @brief */ typedef struct object_group_struct { uint32_t next_id; GLuint vertex_array_object; camera_type * camera; shader_type * shader; sint8_t const * model_uniform_name; texture_type * texture; vector_type * objects; /* Array of object_type* representing each unique object in the group */ uint32_t vertex_count; vector_type * buffers_to_delete; /* GLuint Random buffers that must be deleted when the object goes out of scope */ object_cb_type object_cb; } object_group_type; /** * @brief Arguments for creating a new dynamic object class. */ typedef struct object_group_create_argument_struct { shader_type* shader; /* A shader object (@see shader.h), will be automatically deleted when the object group goes out of scope. */ sint8_t const * model_uniform_name; /* (Optional) A model uniform name to automatically set objects model matrix each frame. */ vec3_type* vertices; /* A pointer to all vertices for the model, count is vertex_count */ uint8_t vertex_channel; vec3_type* normals; uint8_t normal_channel; uv_type* uvs; uint8_t uv_channel; uint32_t vertex_count; texture_type* texture; /* A texture object (@see texture.h), will be automatically deleted when the object group goes out of scope. */ object_cb_type object_cb; /* Will be called on every frame for each instance of this object type. @see object_event_type_t8 */ } object_group_create_argument_type; /********************************************************************** SYSTEM EVENT TYPES **********************************************************************/ /** * @brief */ typedef uint8_t system_event_code_t8; enum { SYSTEM_EVENT_INIT_START = 0x00, SYSTEM_EVENT_DEINIT_START, SYSTEM_EVENT_NEW_CAMERA }; /** * @brief */ typedef union system_event_data_union { camera_type * new_camera_data; } system_event_data_type; /** * @brief */ typedef struct system_event_struct { system_event_code_t8 event_type; system_event_data_type event_data; } system_event_type; /** * @brief */ typedef void ( * system_event_callback ) ( system_event_type const * event_data ); /********************************************************************** SYSTEM TYPES **********************************************************************/ /** * @brief */ typedef struct system_listener_callbacks_struct { system_event_callback system_event_cb; frame_event_callback frame_event_cb; } system_listener_callbacks_type; /** * @brief */ typedef struct system_struct { GLFWwindow * glfw_window; camera_type * system_camera; vector_type * system_event_listeners; vector_type * frame_event_listeners; boolean should_close_window; } system_type; #endif /* SYSTEM_TYPES_H */
25.332031
180
0.589206
[ "object", "vector", "model" ]
2a252d6bdc88c8db1163d037a32d461aef9601ef
7,587
h
C
include/gentl/learning/supervised.h
OpenGen/GenTL
ee29ac4a954d3951ae6d9ad5ae0ab8285d30d3a5
[ "Apache-2.0" ]
1
2022-03-19T06:16:09.000Z
2022-03-19T06:16:09.000Z
include/gentl/learning/supervised.h
OpenGen/GenTL
ee29ac4a954d3951ae6d9ad5ae0ab8285d30d3a5
[ "Apache-2.0" ]
null
null
null
include/gentl/learning/supervised.h
OpenGen/GenTL
ee29ac4a954d3951ae6d9ad5ae0ab8285d30d3a5
[ "Apache-2.0" ]
null
null
null
/* Copyright 2021-2022 Massachusetts Institute of Technology Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef GENTL_SUPERVISED_H #define GENTL_SUPERVISED_H #include <cassert> #include <vector> #include <utility> #include <random> #include <barrier> // NOTE: requires C++20 or c++17 with experimental (consider using boost version or re-implementing) #include <gentl/util/chunks.h> #include <gentl/types.h> #include <gentl/concepts.h> // TODO implement BBVI and VIMCO... // TODO implement various learning algorithms like RWS // TODO provide a callback for generating data on-demand, that defaults to reading from a data set namespace gentl::sgd { template <typename RNGType> std::vector<size_t> generate_minibatch(RNGType& rng, size_t dataset_size, size_t minibatch_size) { std::vector<size_t> minibatch(minibatch_size); std::uniform_int_distribution<size_t> dist {0, dataset_size-1}; for (int i = 0; i < minibatch_size; i++) { minibatch[i] = dist(rng); } return minibatch; } template <typename RNGType, typename ParametersType, typename DatumType, typename UnpackDatumType> double estimate_objective(RNGType& rng, ParametersType& parameters, const std::vector<DatumType>& data, UnpackDatumType& unpack_datum) { double total = 0.0; for (const auto& datum : data) { auto [model, constraints] = unpack_datum(datum); auto trace_and_log_weight = model.generate(rng, parameters, constraints, GenerateOptions()); total += trace_and_log_weight.second; } return total / static_cast<double>(data.size()); } template <typename ParametersType, typename RNGType, typename StepCallbackType, typename DatasetType, typename UnpackDatumType> void train_supervised_single_threaded(ParametersType& parameters, const StepCallbackType& callback, const DatasetType& data, const UnpackDatumType& unpack_datum, const size_t minibatch_size, RNGType& rng) { typedef typename ParametersType::accumulator_t GradientAccumulatorType; GradientAccumulatorType accum {parameters}; bool done = false; const double scaler = 1.0 / static_cast<double>(minibatch_size); while (!done) { std::vector<size_t> minibatch = generate_minibatch(rng, data.size(), minibatch_size); for (size_t i = 0; i < minibatch_size; i++) { auto [model, constraints] = unpack_datum(data[minibatch[i]]); auto [trace, log_weight] = model.generate(rng, parameters, constraints, GenerateOptions().precompute_gradient(true)); //const auto& retval = trace->return_value(); trace->parameter_gradient(accum, scaler); } accum.update_module_gradients(); done = callback(minibatch); } } template <typename ParametersType, typename StepCallbackType, typename DatasetType, typename UnpackDatumType, typename SeedSequenceType> void train_supervised(ParametersType& parameters, const StepCallbackType& callback, const DatasetType& data, const UnpackDatumType& unpack_datum, const size_t minibatch_size, const size_t num_threads, SeedSequenceType& seed) { typedef typename ParametersType::accumulator_t GradientAccumulatorType; // one gradient accumulator per thread std::vector<GradientAccumulatorType> accums; for (int i = 0; i < num_threads; i++) { accums.emplace_back(GradientAccumulatorType{parameters}); } const size_t data_size = data.size(); const double scaler = 1.0 / static_cast<double>(minibatch_size); size_t iter = 0; bool done = false; // initialize RNG that will be used to generate minibatches std::mt19937 rng(seed); std::vector<size_t> minibatch = generate_minibatch(rng, data.size(), minibatch_size); auto iteration_serial_stage = [data_size,&iter,&done,&accums,&rng, &minibatch,&parameters,&data,&callback]() { // increments the gradients in the shared parameters object // and resets the per-thread gradient accumulators to zero for (auto& accum : accums) { accum.update_module_gradients(); } // user callback, which implements the gradient step and decides whether we are done or not done = callback(minibatch); // compute minibatch for next iteration if (!done) { minibatch = generate_minibatch(rng, data_size, minibatch.size()); } iter++; }; std::barrier sync_point(num_threads, iteration_serial_stage); auto stochastic_gradient_chunk = [ &sync_point, &minibatch = std::as_const(minibatch), &data = std::as_const(data), &parameters, scaler, &done = std::as_const(done), &unpack_datum](GradientAccumulatorType& accum, SeedSequenceType& seed, size_t start, size_t stop) { std::mt19937 rng(seed); while (!done) { for (size_t i = start; i < stop; i++) { auto [model, constraints] = unpack_datum(data[minibatch[i]]); auto [trace, log_weight] = model.generate(rng, parameters, constraints, GenerateOptions().precompute_gradient(true)); //const auto& retval = trace->return_value(); trace->parameter_gradient(accum, scaler); } sync_point.arrive_and_wait(); } }; // launch worker threads std::vector<std::pair<size_t,size_t>> blocks = even_blocks(minibatch_size, num_threads); std::vector<std::thread> threads; std::vector<SeedSequenceType> worker_seeds; for (size_t i = 0; i < num_threads; i++) { auto [start, stop] = blocks[i]; auto& worker_seed = worker_seeds.emplace_back(seed.spawn()); threads.emplace_back(stochastic_gradient_chunk, std::ref(accums[i]), std::ref(worker_seed), start, stop); start = stop; } // wait for each worker threads to exit its loop for (auto& thread : threads) { thread.join(); } } } #endif //GENTL_SUPERVISED_H
43.107955
119
0.590879
[ "object", "vector", "model" ]
2a34a1ffaa92a7ce932e971ba9963c8e55fd139c
403
h
C
framework/PVRAssets/fileio/GltfReader.h
amaiorano/Native_SDK
0a5b48fd1f4ad251f5b4f0e07c46744c4841255b
[ "MIT" ]
559
2015-01-10T21:22:11.000Z
2022-03-31T02:32:14.000Z
framework/PVRAssets/fileio/GltfReader.h
amaiorano/Native_SDK
0a5b48fd1f4ad251f5b4f0e07c46744c4841255b
[ "MIT" ]
69
2015-06-27T11:08:37.000Z
2022-03-26T02:14:36.000Z
framework/PVRAssets/fileio/GltfReader.h
amaiorano/Native_SDK
0a5b48fd1f4ad251f5b4f0e07c46744c4841255b
[ "MIT" ]
213
2015-01-25T01:20:52.000Z
2022-03-24T00:57:05.000Z
#pragma once #include "PVRAssets/Model.h" #include "PVRCore/stream/Stream.h" #include "PVRCore/IAssetProvider.h" namespace pvr { namespace assets { void readGLTF(const ::pvr::Stream& stream, const IAssetProvider& assetProvider, ::pvr::assets::Model& outModel); ::pvr::assets::Model readGLTF(const ::pvr::Stream& stream, const IAssetProvider& assetProvider); } // namespace assets } // namespace pvr
26.866667
112
0.74938
[ "model" ]
2a3730e6550d267e75d1f81d3e88b9d8d40754fe
14,381
h
C
ObitSystem/Obit/include/ObitDConCleanWindow.h
sarrvesh/Obit
e4ce6029e9beb2a8c0316ee81ea710b66b2b7986
[ "Linux-OpenIB" ]
5
2019-08-26T06:53:08.000Z
2020-10-20T01:08:59.000Z
ObitSystem/Obit/include/ObitDConCleanWindow.h
sarrvesh/Obit
e4ce6029e9beb2a8c0316ee81ea710b66b2b7986
[ "Linux-OpenIB" ]
null
null
null
ObitSystem/Obit/include/ObitDConCleanWindow.h
sarrvesh/Obit
e4ce6029e9beb2a8c0316ee81ea710b66b2b7986
[ "Linux-OpenIB" ]
8
2017-08-29T15:12:32.000Z
2022-03-31T12:16:08.000Z
/* $Id$ */ /*--------------------------------------------------------------------*/ /*; Copyright (C) 2004-2009 */ /*; Associated Universities, Inc. Washington DC, USA. */ /*; */ /*; 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., 675 Massachusetts Ave, Cambridge, */ /*; MA 02139, USA. */ /*; */ /*;Correspondence about this software should be addressed as follows: */ /*; Internet email: bcotton@nrao.edu. */ /*; Postal address: William Cotton */ /*; National Radio Astronomy Observatory */ /*; 520 Edgemont Road */ /*; Charlottesville, VA 22903-2475 USA */ /*--------------------------------------------------------------------*/ #ifndef OBITDCONCLEANWINDOW_H #define OBITDCONCLEANWINDOW_H #include "Obit.h" #include "ObitImageMosaic.h" #include "ObitErr.h" /*-------- Obit: Merx mollis mortibus nuper ------------------*/ /** * \file ObitDConCleanWindow.h * ObitDConCleanWindow class defining CLEAN windows. * * This class is derived from the #Obit class. * * This class contains specifications of which pixels in the images of an * #ObitImageMosaic are candidates for a CLEAN component. * The current implementation uses a GList for each field so that the number of windows * is arbitrary. However, this should be transparent outside the class. * Each field in an ImageMosaic has two potential sets of CLEAN windows, * the traditional "inner" window with an arbitrary number of components and an * "outer", single window which sets the region in which the autoWindow feature * is allowed to place windows. * "Unwindows" are inner windows in which CLEANing is NOT allowed. * * \section ObitDConCleanWindowaccess Creators and Destructors * An ObitDConCleanWindow will usually be created using ObitDConCleanWindowCreate * which allows specifying a name for the object as well as dimensionality of the array. * * A copy of a pointer to an ObitDConCleanWindow should always be made using the * #ObitDConCleanWindowRef function which updates the reference count in the object. * Then whenever freeing an ObitDConCleanWindow or changing a pointer, the function * #ObitDConCleanWindowUnref will decrement the reference count and destroy the object * when the reference count hits 0. * There is no explicit destructor. * * The contents can be modified using the #ObitDConCleanWindowAdd and * #ObitDConCleanWindowUpdate functions. * The presence of valid pixels in an image is indicated by * #ObitDConCleanWindowImage and in a row by #ObitDConCleanWindowRow this also * computes a mask for the row indicating valid pixels. * * This class supports the autoWindow facility and has different behavior when the * autoWindow member is TRUE or FALSE. * If TRUE then if no inner window is specified then all pixels are invalid. * If FALSE then the default is that all pixels are selected. */ /*--------------Class definitions-------------------------------------*/ /** ObitDConCleanWindow Class structure. */ typedef struct { #include "ObitDConCleanWindowDef.h" /* this class definition */ } ObitDConCleanWindow; /*----------------- enums ---------------------------*/ /** * enum for window types * Should be coordinated with ObitErrorLevelString in ObitErr.c. */ enum ObitDConCleanWindowType { /** rectangle, specified by blc, trc corners */ OBIT_DConCleanWindow_rectangle = 0, /** round, specified by radius, center x, center y pixel */ OBIT_DConCleanWindow_round, /** rectangle unwindow, specified by blc, trc corners */ OBIT_DConCleanWindow_unrectangle, /** round unwindow, specified by radius, center x, center y pixel */ OBIT_DConCleanWindow_unround };/* end enum ObitDConObitCleanWindowType */ /** * typedef for enum for window types */ typedef enum ObitDConCleanWindowType ObitDConCleanWindowType; /*----------------- Macroes ---------------------------*/ /** * Macro to unreference (and possibly destroy) an ObitDConCleanWindow * returns a ObitDConCleanWindow*. * in = object to unreference */ #define ObitDConCleanWindowUnref(in) ObitUnref (in) /** * Macro to reference (update reference count) an ObitDConCleanWindow. * returns a ObitDConCleanWindow*. * in = object to reference */ #define ObitDConCleanWindowRef(in) ObitRef (in) /** * Macro to determine if an object is the member of this or a * derived class. * Returns TRUE if a member, else FALSE * in = object to reference */ #define ObitDConCleanWindowIsA(in) ObitIsA (in, ObitDConCleanWindowGetClass()) /*---------------Public functions---------------------------*/ /** Public: Class initializer. */ void ObitDConCleanWindowClassInit (void); /** Public: Default Constructor. */ ObitDConCleanWindow* newObitDConCleanWindow (gchar* name); /** Public: Create/initialize ObitDConCleanWindow structures */ ObitDConCleanWindow* ObitDConCleanWindowCreate (gchar* name, ObitImageMosaic *mosaic, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef ObitDConCleanWindow* (*ObitDConCleanWindowCreateFP) (gchar* name, ObitImageMosaic *mosaic, ObitErr *err); /** Public: Create/initialize ObitDConCleanWindow structure with 1 field */ ObitDConCleanWindow* ObitDConCleanWindowCreate1 (gchar* name, olong naxis[2], ObitErr *err); /** Typedef for definition of class pointer structure */ typedef ObitDConCleanWindow* (*ObitDConCleanWindowCreate1FP) (gchar* name, olong naxis[2], ObitErr *err); /** Public: ClassInfo pointer */ gconstpointer ObitDConCleanWindowGetClass (void); /** Public: Copy (deep) constructor. */ ObitDConCleanWindow* ObitDConCleanWindowCopy (ObitDConCleanWindow *in, ObitDConCleanWindow *out, ObitErr *err); /** Public: Copy structure. */ void ObitDConCleanWindowClone (ObitDConCleanWindow *in, ObitDConCleanWindow *out, ObitErr *err); /** Public: Ask window definition */ gboolean ObitDConCleanWindowInfo (ObitDConCleanWindow *in, olong field, olong Id, ObitDConCleanWindowType *type, olong **window, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef gboolean (*ObitDConCleanWindowInfoFP) (ObitDConCleanWindow *in, olong field, olong Id, ObitDConCleanWindowType *type, olong **window, ObitErr *err); /** Public: Search for a window near a given pixel */ olong ObitDConCleanWindowSearch (ObitDConCleanWindow *in, olong field, olong pixel[2], olong toler, olong *which, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef olong (*ObitDConCleanWindowSearchFP) (ObitDConCleanWindow *in, olong field, olong pixel[2], olong toler, olong *which, ObitErr *err); /** Public: Add a new window definition */ olong ObitDConCleanWindowAdd (ObitDConCleanWindow *in, olong field, ObitDConCleanWindowType type, olong *window, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef olong (*ObitDConCleanWindowAddFP) (ObitDConCleanWindow *in, olong field, ObitDConCleanWindowType type, olong *window, ObitErr *err); /** Public: Delete a window */ void ObitDConCleanWindowDel (ObitDConCleanWindow *in, olong field, olong Id, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef void (*ObitDConCleanWindowDelFP) (ObitDConCleanWindow *in, olong field, olong Id, ObitErr *err); /** Public: Modify an existing window */ void ObitDConCleanWindowUpdate (ObitDConCleanWindow *in, olong field, olong Id, ObitDConCleanWindowType type, olong *window, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef void (*ObitDConCleanWindowUpdateFP) (ObitDConCleanWindow *in, olong field, olong Id, ObitDConCleanWindowType type, olong *window, ObitErr *err); /** Public: Set outer window for a field */ void ObitDConCleanWindowOuter (ObitDConCleanWindow *in, olong field, ObitDConCleanWindowType type, olong *window, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef void (*ObitDConCleanWindowOuterFP) (ObitDConCleanWindow *in, olong field, ObitDConCleanWindowType type, olong *window, ObitErr *err); /** Public: Are there any valid pixels in this field's image? */ gboolean ObitDConCleanWindowImage (ObitDConCleanWindow *in, olong field, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef gboolean (*ObitDConCleanWindowImageFP) (ObitDConCleanWindow *in, olong field, ObitErr *err); /** Public: Are there any valid pixels in a specified row within inner window? */ gboolean ObitDConCleanWindowRow (ObitDConCleanWindow *in, olong field, olong row, gboolean **mask, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef gboolean (*ObitDConCleanWindowRowFP) (ObitDConCleanWindow *in, olong field, olong row, gboolean **mask, ObitErr *err); /** Public: Are there any valid pixels in a specified row in positive boxes? */ gboolean ObitDConCleanWindowInnerRow (ObitDConCleanWindow *in, olong field, olong row, gboolean **mask, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef gboolean (*ObitDConCleanWindowInnerRowFP) (ObitDConCleanWindow *in, olong field, olong row, gboolean **mask, ObitErr *err); /** Public: Are there any valid pixels in a specified row in unboxes? */ gboolean ObitDConCleanWindowUnrow (ObitDConCleanWindow *in, olong field, olong row, gboolean **mask, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef gboolean (*ObitDConCleanWindowUnrowFP) (ObitDConCleanWindow *in, olong field, olong row, gboolean **mask, ObitErr *err); /** Public: Are there any valid pixels in a specified row with outer window? */ gboolean ObitDConCleanWindowOuterRow (ObitDConCleanWindow *in, olong field, olong row, gboolean **mask, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef gboolean (*ObitDConCleanWindowOuterRowFP) (ObitDConCleanWindow *in, olong field, olong row, gboolean **mask, ObitErr *err); /** Public: What is the maximum region covered in x or y? */ olong ObitDConCleanWindowSize (ObitDConCleanWindow *in, olong field, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef olong (*ObitDConCleanWindowSizeFP) (ObitDConCleanWindow *in, olong field, ObitErr *err); /** Public: How many pixels are selected */ olong ObitDConCleanWindowCount (ObitDConCleanWindow *in, olong field, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef olong (*ObitDConCleanWindowCountFP) (ObitDConCleanWindow *in, olong field, ObitDConCleanWindowType type, olong *window, ObitErr *err); /** Public: add autoWindow */ gboolean ObitDConCleanWindowAutoWindow (ObitDConCleanWindow *in, olong field, ObitFArray *image, gboolean doAbs, ofloat *PeakIn, olong *PeakInPos, ofloat *PeakOut, ofloat *RMS, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef gboolean (*ObitDConCleanWindowAutoWindowFP) (ObitDConCleanWindow *in, olong field, ObitFArray *image, ofloat *PeakIn, olong *PeakInPos, ofloat *PeakOut, ofloat *RMS, ObitErr *err); /** Public: Replace all windows for a given field with those from another window */ void ObitDConCleanWindowReplaceField (ObitDConCleanWindow *in, olong ifield, ObitDConCleanWindow *out, olong ofield, ObitErr *err); /** Typedef for definition of class pointer structure */ typedef void (*ObitDConCleanWindowReplaceFieldFP) (ObitDConCleanWindow *in, olong ifield, ObitDConCleanWindow *out, olong ofield, ObitErr *err); /** Public: Add a field to a window object */ olong ObitDConCleanWindowAddField (ObitDConCleanWindow *in, olong inaxes[2], ObitErr *err); /** Typedef for definition of class pointer structure */ typedef olong (*ObitDConCleanWindowAddFieldFP) (ObitDConCleanWindow *in, olong inaxes[2], ObitErr *err); /** Public: Get Statistics on a field using windows */ void ObitDConCleanWindowStats (ObitDConCleanWindow *in, olong field, ObitFArray *image, gboolean doAbs, ofloat *PeakIn, olong *PeakInPos, ofloat *PeakOut, ofloat *RMS, ObitErr *err); typedef void (*ObitDConCleanWindowStatsFP) (ObitDConCleanWindow *in, olong field, ObitFArray *image, gboolean doAbs, ofloat *PeakIn, olong *PeakInPos, ofloat *PeakOut, ofloat *RMS, ObitErr *err); /*----------- ClassInfo Structure -----------------------------------*/ /** * ClassInfo Structure. * Contains class name, a pointer to any parent class * (NULL if none) and function pointers. */ typedef struct { #include "ObitDConCleanWindowClassDef.h" } ObitDConCleanWindowClassInfo; #endif /* OBITFDCONCLEANWINDOW_H */
42.800595
88
0.672067
[ "object" ]
2a3de981921f78793a7ca4e8f752bf7bfafe2aae
11,043
h
C
drlvm/vm/jitrino/src/optimizer/memoryoptrep.h
sirinath/Harmony
724deb045a85b722c961d8b5a83ac7a697319441
[ "Apache-2.0" ]
8
2015-11-04T06:06:35.000Z
2021-07-04T13:47:36.000Z
drlvm/vm/jitrino/src/optimizer/memoryoptrep.h
sirinath/Harmony
724deb045a85b722c961d8b5a83ac7a697319441
[ "Apache-2.0" ]
1
2021-10-17T13:07:28.000Z
2021-10-17T13:07:28.000Z
drlvm/vm/jitrino/src/optimizer/memoryoptrep.h
sirinath/Harmony
724deb045a85b722c961d8b5a83ac7a697319441
[ "Apache-2.0" ]
13
2015-11-27T03:14:50.000Z
2022-02-26T15:12:20.000Z
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author Intel, Pavel A. Ozhdikhin * */ #ifndef _MEMORY_OPT_REP_H #define _MEMORY_OPT_REP_H #include "./ssa/SSA.h" namespace Jitrino { class Type; class AliasAnalyzer; // each AliasRep represents a set of memory locations // note that we don't distinguish singletons, that's a separate issue // overlap between sets is tested by using AliasManager::mayAlias() class AliasRep { public: enum Kind { NullKind, // empty set GlobalKind, // overlaps all globals LocalKind, // overlaps all non-globals AnyKind, // full set: everything UnknownKind, // other opnd, should not be vtable, methodptr, arraylen, field ObjectFieldKind, // parameterized by object and field desc UnresolvedObjectFieldKind, // field of unresolved type ArrayElementKind, // offset into array, parameterized by array object and offset opnd StaticFieldKind, // just field, type is pulled out too UnresolvedStaticFieldKind, // just field, type is pulled out too ObjectVtableKind, // opnd MethodPtrKind, // opnd, desc FunPtrKind, // opnd TypeVtableKind, // type ArrayLenKind, // opnd NewObjectKind, // opnd (all fields initialized by NewObject or NewArray) NewTypeKind, // type (all fields initialized by <clinit> FinishObjectKind, // all final fields of an object FinishTypeKind, // all final fields of a type LockKind, // opnd TypeLockKind // type } kind; Opnd *opnd; Opnd *idx; Opnd *enclClass; Type *type; TypeMemberDesc *desc; int id; AliasRep(int) : kind(NullKind), opnd(0), idx(0), enclClass(0), type(0), desc(0), id(0) {}; AliasRep(Kind k=NullKind) : kind(k), opnd(0), idx(0), enclClass(0),type(0), desc(0), id(0) {}; AliasRep(Kind k, Opnd *op) : kind(k), opnd(op), idx(0), enclClass(0),type(0), desc(0), id(0) { }; AliasRep(Kind k, Opnd *op, Opnd *idx0) : kind(k), opnd(op), idx(idx0), enclClass(0), type(0), desc(0), id(0) { }; AliasRep(Kind k, Opnd *op, TypeMemberDesc *md) : kind(k), opnd(op), idx(0), enclClass(0), type(0), desc(md), id(0) { }; AliasRep(Kind k, Type *t) : kind(k), opnd(0), idx(0), enclClass(0), type(t), desc(0), id(0) { }; AliasRep(Kind k, TypeMemberDesc *md) : kind(k), opnd(0), idx(0), enclClass(0), type(0), desc(md), id(0) { }; AliasRep(Kind k, Opnd* op, Opnd* enc, Opnd* idx0) : kind(k), opnd(op), idx(idx0), enclClass(enc), type(0), desc(0), id(0) { }; void dump(::std::ostream &os) const; void print(::std::ostream &os) const; bool isObjectFinal() const; // all pointed to locations are final for one object Opnd *getFinalObject() const; // get a representation for that object bool isTypeFinal() const; // all pointed to locations are final for one type NamedType *getFinalType() const; // get a representation for that type bool isEmpty() const { return (kind == NullKind); }; bool operator < (const AliasRep &other) const { return ((kind < other.kind) || ((kind == other.kind) && ((opnd < other.opnd) || ((opnd == other.opnd) && ((enclClass < other.enclClass) || ((enclClass== other.enclClass) && ((type < other.type) || ((type == other.type) && ((desc < other.desc) || ((desc == other.desc) && (idx < other.idx))))))))))); } bool operator == (const AliasRep &other) const { return ((kind == other.kind) && (opnd == other.opnd) && (enclClass == other.enclClass) && (type == other.type) && (desc == other.desc) && (idx == other.idx)); } operator size_t() const { return (((size_t) kind) ^ ((size_t) opnd) ^ ((size_t) type) ^ ((size_t) desc) ^ ((size_t) enclClass)); } }; class AliasManager { friend class MemoryOpt; public: typedef StlVector<AliasRep> AliasList; private: U_32 numAliasReps; AliasList allAliasReps; typedef StlHashMap<AliasRep, StlVectorSet<AliasRep> *> AliasRep2AliasReps; AliasRep2AliasReps canon2others; typedef StlHashMap<AliasRep, AliasRep> Alias2Alias; Alias2Alias other2canon; typedef StlHashMap<AliasRep, AliasList *> Ancestors; Ancestors ancestors; AliasRep findOrInsertAlias(AliasRep rep); // use only during initial alias set construction bool isDuplicate(const AliasRep &a, const AliasRep &b); void sawDuplicate(const AliasRep &ar, const AliasRep &canon); public: AliasRep getReference(Opnd *addr); // examine for an indirect addr AliasRep getObjectField(Opnd *obj, TypeMemberDesc *field); AliasRep getUnresolvedObjectField(Opnd *obj, Opnd* enclClass, Opnd* cpIdx); AliasRep getStaticField(TypeMemberDesc *field); AliasRep getUnresolvedStaticField(Opnd* enclClass, Opnd* cpIdx); AliasRep getArrayElementByType(Type *elementType); AliasRep getLock(Opnd *obj); AliasRep getLock(Type *type); AliasRep getAny(); AliasRep getAnyGlobal(); AliasRep getVtableOf(Opnd *opnd); AliasRep getMethodPtr(Opnd *opnd, MethodDesc *desc); AliasRep getFunPtr(Opnd *opnd); AliasRep getNoMemory(); AliasRep getAnyEscaping(); AliasRep getAnyLocal(); AliasRep getVtableOf(NamedType *type); AliasRep getArrayLen(Opnd *opnd); AliasRep getArrayElements(Opnd *array, Opnd *offset, Opnd *length); AliasRep getObjectNew(Opnd *opnd); // fields initialized by NewObject or NewArray AliasRep getTypeNew(NamedType *type); // (final static) fields initialized by type initialization AliasRep getFinishObject(Opnd *obj); // final fields of object AliasRep getFinishType(NamedType *type); // final fields of type MemoryManager &mm; AliasAnalyzer *analyzer; TypeManager* typeManager; void dumpAliasReps(::std::ostream &os) const; AliasManager(MemoryManager &mm0, AliasAnalyzer *aa, TypeManager* tm) : numAliasReps(0), allAliasReps(mm0), canon2others(mm0), other2canon(mm0), ancestors(mm0), mm(mm0), analyzer(aa), typeManager(tm) {}; bool mayAlias(const AliasRep &a, const AliasRep &b); // yields a list of ancestors in any order const AliasList *getAncestors(const AliasRep &a); private: // adds parents to result, returning true if nonempty // yields a list of ancestors in any order void computeAncestors(const AliasRep &a, AliasList *result); }; class InstMemBehavior { public: bool acquire, release; StlVectorSet<AliasRep> defs; StlVectorSet<AliasRep> uses; InstMemBehavior(MemoryManager &mm) : acquire(false), release(false), defs(mm), uses(mm) {}; InstMemBehavior(const StlVectorSet<AliasRep> &defs0, const StlVectorSet<AliasRep> &uses0) : acquire(false), release(false), defs(defs0), uses(uses0) {}; }; class AliasDefSites : public StlHashMap<AliasRep, VarDefSites *> { MemoryManager &mm; U_32 numNodes; public: typedef StlHashMap<AliasRep, VarDefSites *> BaseType; AliasDefSites(MemoryManager &m, U_32 n): BaseType(m), mm(m), numNodes(n) {}; void addAliasDefSite(const AliasRep &rep, Node* node) { VarDefSites* aliasSites = (*this)[rep]; if (!aliasSites) { aliasSites = new (mm) VarDefSites(mm, numNodes); (*this)[rep] = aliasSites; } aliasSites->addDefSite(node); }; bool hasAliasDefSite(const AliasRep &rep, Node* node) { iterator aliasSitesIter = this->find(rep); if (aliasSitesIter == end()) { return false; } VarDefSites* aliasSites = (*aliasSitesIter).second; return aliasSites->isDefSite(node); }; }; class MemPhiSites { public: MemoryManager &mm; size_t numNodes; StlVector<AliasRep> **nodeArray; MemPhiSites(MemoryManager &mm0, size_t numNodes) : mm(mm0), nodeArray() { nodeArray = new (mm0) StlVector<AliasRep> *[numNodes]; for (size_t i = 0; i < numNodes; i++) { nodeArray[i] = 0; } } void addMemPhi(Node *n, const AliasRep &rep) { size_t i = n->getDfNum(); StlVector<AliasRep> *a = nodeArray[i]; if (!a) { a = new (mm) StlVector<AliasRep>(mm); nodeArray[i] = a; } a->push_back(rep); } const StlVector<AliasRep> *getMemPhis(Node *n) const { size_t i = n->getDfNum(); return nodeArray[i]; } }; struct AliasBinding { Inst *inst; U_32 when; AliasBinding(Inst *inst0=0, U_32 when0=0) : inst(inst0), when(when0) {}; }; bool operator !=(const AliasBinding &a, const AliasBinding &b) { return ((a.inst != b.inst) || (a.when != b.when)); } class DescendentSet : public StlVectorSet<AliasRep> { public: DescendentSet(MemoryManager &m, U_32 depth0) : StlVectorSet<AliasRep>(m), depth(depth0) {}; DescendentSet(MemoryManager &m, DescendentSet *other, U_32 depth0) : StlVectorSet<AliasRep>(m), depth(depth0) { insert(other->begin(), other->end()); } U_32 depth; }; class AliasRenameMap { typedef SparseScopedMap<AliasRep, AliasBinding> DefMap; typedef SparseScopedMap<AliasRep, DescendentSet *> DescendentMap; DefMap defMap; DescendentMap activeDescendents; U_32 depth; U_32 timeCount; AliasManager *aliasManager; MemoryManager &mm; public: AliasRenameMap(MemoryManager &m, AliasManager *am0, size_t sizeEstimate1, size_t sizeEstimate2) : defMap(sizeEstimate1, m), activeDescendents(sizeEstimate2, m), depth(0), timeCount(0), aliasManager(am0), mm(m) {}; void enter_scope(); void exit_scope(); void insert(const AliasRep &rep, Inst *defInst); // finds most recent relevant defs typedef StlVectorSet<Inst *> DefsSet; void lookup(const AliasRep &rep, DefsSet &defs); }; } //namespace Jitrino #endif // _MEMORY_OPT_REP_H
35.970684
139
0.634429
[ "object" ]
2a41700d9611e50b154147262b46d9e94172241e
5,949
h
C
hkc/third_party/hkc/hk.h
AdySan/ESP8266-HomeKit
164f8d13b5ad66532d934d325652e5ae8013f625
[ "Apache-2.0" ]
3
2017-04-25T18:26:02.000Z
2021-06-24T06:15:58.000Z
hkc/third_party/hkc/hk.h
AdySan/ESP8266-HomeKit
164f8d13b5ad66532d934d325652e5ae8013f625
[ "Apache-2.0" ]
null
null
null
hkc/third_party/hkc/hk.h
AdySan/ESP8266-HomeKit
164f8d13b5ad66532d934d325652e5ae8013f625
[ "Apache-2.0" ]
1
2017-03-02T16:50:46.000Z
2017-03-02T16:50:46.000Z
/* Copyright 2016 HomeACcessoryKid - HacK - homeaccessorykid@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef __HK_H__ #define __HK_H__ #include "wolfssl/wolfcrypt/chacha20_poly1305.h" #include "cJSON.h" #include "hkc.h" //#define DEMO #define FACTORY #define DEBUG0 #define DEBUG1 #define DEBUG2 #define DEBUG3 #define DEBUG4 //#define DEBUG5 //#define DEBUG6 //#define DEBUG7 //#define DEBUG8 //#define DEBUG9 #define PASSWORD "031-45-154" #define PASSWORD_LEN 10 #define BOOLEAN "bool" #define STRING "string" #define INT "int" #define TLVNUM 12 typedef struct _acc_item { cJSON *json; uint32 events; acc_cb change_cb; } acc_item; typedef struct _espconn_msg{ struct espconn *pespconn; void *pcommon; //at least that is what I suspect int rport; uint8 rip[4]; void *p05; void *p06; void *p07; void *p08; void *p09; void *p10; void *p11; void *p12; int i13; void *p14; void *p15; void *p16; void *p17; void *p18; int i19; void *p20; void *p21; void *p22; void *preverse; void *pssl; struct _espconn_msg *pnext; void *p26; void *p27; int i28; }espconn_msg;/**/ typedef struct _crypto_parm { xSemaphoreHandle semaphore; struct espconn *pespconn; int state; int stale; uint32_t connectionid; int encrypted; long countwr; long countrd; word32 sessionkey_len; byte sessionkey[32]; byte verKey[CHACHA20_POLY1305_AEAD_KEYSIZE]; byte readKey[CHACHA20_POLY1305_AEAD_KEYSIZE]; byte writeKey[CHACHA20_POLY1305_AEAD_KEYSIZE]; char object[0x1cb]; int objects_len[TLVNUM]; } crypto_parm; /* int objects_maxlen[TLVNUM] = {1,0x50,0,0x180,0x40,0xd0,1,0,0,0,0x40,9}; //global //old system, now all in one object array char object3[0x180]; //reuse for object10, object 1 and object5 //char object10[0x40]; //overlap object3 from 0x20 //char object1[0x50]; //overlap object3 from 0x60 //36 is enough //char object5[0xd0]; //overlap object3 from 0xb0 //154 is enough char object4[0x40]; //make dynamic memory during pair-setup char object0[1]; char object6[1]; char object11[9]; //for invited persons //normally length 1?? char *objects[TLVNUM] = {object0,object3+0x60,NULL,object3,object4,object3+0xb0,object6,NULL,NULL,NULL,object3+0x20,object11};/**/ //new system /*char object[0x1cb]; char *objects[TLVNUM] = {object+0x1c0,object+0x60,NULL,object,object+0x180,object+0xb0,object+0x1c1,NULL,NULL,NULL,object+0x20,object+0x1c2}; int objects_len[TLVNUM];/**/ //XXXXXXXXXXXXX recreate objects and objects_len inside each routine, using object from crypto_parm #define URLSize 16 typedef enum Result_Resp { RespFail = 0, RespSuc, } Result_Resp; typedef enum ProtocolType { GET = 0, POST, PUT, } ProtocolType; typedef enum _ParmType { SWITCH_STATUS = 0, INFOMATION, WIFI, SCAN, REBOOT, DEEP_SLEEP, LIGHT_STATUS, CONNECT_STATUS, USER_BIN } ParmType; typedef struct URL_Frame { enum ProtocolType Type; char pSelect[URLSize]; char pCommand[URLSize]; char pFilename[URLSize]; } URL_Frame; typedef struct _rst_parm { ParmType parmtype; struct espconn *pespconn; } rst_parm; void json_init(void *arg); char *parse_cgi(char *in); void parse_chas(void *arg, char *json); void crypto_prepare(void *arg); void crypto_init(); void crypto_setup1(void *arg); void crypto_setup3(void *arg); void crypto_setup5(void *arg); void crypto_verify1(void *arg); void crypto_verify3(void *arg); void crypto_tasks(); void pairadd(void *arg); void pairdel(void *arg); void decrypt(void *arg, char *data, unsigned short *length); void encrypt(void *arg, char *data, unsigned short *length); /****************************************************************************** * FunctionName : tlv8_parse * Description : take incoming buffer and deliver tlv structure array * Parameters : pbuf -- pointer to buffer * len -- the length of the buffer * objects -- the pointer to the struct array * objects_len -- array of lengths of the struct * Returns : *******************************************************************************/ void tlv8_parse(char *pbuf, uint16 len, char *objects[], int objects_len[]); /****************************************************************************** * FunctionName : tlv8_add * Description : adds one item to buffer in chunked and tlv8 encoding * Parameters : pbuf -- pointer to buffer * index -- distance to buffer insertion point will be updated * type -- type of item to add * len -- the length of the value to add (max 4094) * value -- pointer to buffer with value content * Returns : *******************************************************************************/ void tlv8_add(char *pbuf, uint16 *index, int type, uint16 len, char *value); /****************************************************************************** * FunctionName : tlv8_close * Description : add the final chunked close item of zero length * Parameters : pbuf -- pointer to buffer * index -- distance to buffer insertion point will be updated * Returns : *******************************************************************************/ void tlv8_close(char *pbuf, uint16 *index); void event_send(void *arg, char *psend); void tlv8_send(void *arg, char *pbuf, uint16 len); void server_init(uint32 port); #endif
26.44
141
0.650361
[ "object" ]
2a463650c0297dcf2bb3766474556e542e029fbe
9,793
h
C
Engine/RenderingTestLevel.h
metalheadjohny/Stale_Memes
69717ff036471fa642141ac2ff9a23525b475cea
[ "MIT" ]
1
2019-09-02T08:23:40.000Z
2019-09-02T08:23:40.000Z
Engine/RenderingTestLevel.h
metalheadjohny/Stale_Memes
69717ff036471fa642141ac2ff9a23525b475cea
[ "MIT" ]
null
null
null
Engine/RenderingTestLevel.h
metalheadjohny/Stale_Memes
69717ff036471fa642141ac2ff9a23525b475cea
[ "MIT" ]
null
null
null
#pragma once #include "Level.h" #include "Model.h" #include "Light.h" #include "Scene.h" #include "NavGrid.h" #include "AStar.h" #include "Skybox.h" #include "GUI.h" #include "CSM.h" #include "RenderStage.h" #include "FPSCounter.h" #include "CParentLink.h" #include "CTransform.h" #include "CModel.h" #include "CSkModel.h" #include "LevelAsset.h" #include "RuntimeAnimation.h" #include "SkAnimRenderer.h" #include "ComputeShader.h" #include "StagingBuffer.h" #include "RendererSystem.h" // Clean version of TDLevel without all the accumulated cruft. class RenderingTestLevel : public Level { private: GeoClipmap _geoClipmap; Scene _scene; SceneEditor _sceneEditor; FPSCounter _fpsCounter; // Make it cozy in here for now, but move these to world/scene/renderer ultimately! DirectionalLight _dirLight; CBuffer _dirLightCB; CBuffer _positionBuffer; CBuffer _skMatsBuffer; Skybox _skybox; SkAnimRender _skAnimRenderer; std::vector<RenderStage> _stages; VertexShader _fullScreenVS; PixelShader _fullScreenPS; RendererSystem _rendererSystem; uint32_t numCulled; public: RenderingTestLevel(Engine& sys) : Level(sys), _scene(_sys, AABB(SVec3(), SVec3(500.f * .5)), 5), _geoClipmap(3, 4, 10.), _fpsCounter(64), _rendererSystem(&_scene._registry) { //_rendererSystem._registry = &(_scene._registry); } void init(Engine& sys) override final { auto device = S_DEVICE; auto context = S_CONTEXT; // All of this should not have to be here! Goal of this refactor is to kill it. _sys._shaderCache.createAllShadersBecauseIAmTooLazyToMakeThisDataDriven(&sys._shaderCompiler); auto skyBoxMat = std::make_shared<Material>(_sys._shaderCache.getVertShader("FSTriangleVS"), _sys._shaderCache.getPixShader("skyboxTrianglePS"), true); // TODO make this optional by storing it in the registry as a "component" would be in unreal/unity _skybox = Skybox(device, "../Textures/day.dds", std::move(skyBoxMat)); LightData lightData(SVec3(0.1, 0.7, 0.9), .03f, SVec3(0.8, 0.8, 1.0), .2, SVec3(0.3, 0.5, 1.0), 0.7); _dirLight = DirectionalLight(lightData, SVec4(0, -1, 0, 0)); _dirLight.createCBuffer(device, _dirLightCB); _dirLight.updateCBuffer(context, _dirLightCB); _skMatsBuffer.init(device, CBuffer::createDesc(sizeof(SMatrix) * 200)); std::vector<SMatrix> wat(200); _skMatsBuffer.update(context, wat.data(), sizeof(SMatrix) * 200); _skMatsBuffer.bindToVS(context, 1); _geoClipmap.init(device); _sceneEditor.init(&_scene, &S_INMAN); _scene._csm.init(device, 1024u, 1024u, S_SHCACHE.getVertShader("csmVS")); S_RANDY._cam._controller->setFlying(true); //auto _renderGroup = _scene._registry.group<CTransform, CSkModel>(); //auto _physGroup = _scene._registry.group<CTransform, SphereHull>(); // No longer needs manual fixup for shader pointers but will need setupMesh called! auto modelPtr = _sys._skModelManager.getBlocking(9916003768089073041); for (auto& mesh : modelPtr->_meshes) { mesh.setupMesh(device); } // @TODO test this //BuildRuntimeAnimation(*modelPtr->_skeleton.get(), *modelPtr->_anims[0].get()); for (UINT i = 0; i < 100; ++i) { auto entity = _scene._registry.create(); auto position = SVec3(i / 10, 0, (i % 10)) * 100.f; auto transform = SMatrix::CreateTranslation(position); _scene._registry.emplace<CSkModel>(entity, modelPtr.get()); _scene._registry.emplace<CTransform>(entity, transform); _scene._registry.emplace<CEntityName>(entity, "Entity name"); _scene._registry.emplace<SphereHull>(entity, SphereHull(position, 120)); _scene._registry.emplace<VisibleFlag>(entity, VisibleFlag{false}); } _positionBuffer.init(device, CBuffer::createDesc(sizeof(SMatrix) * 1024)); _positionBuffer.bindToVS(context, 0); { // This works as expected. Thanks Skypjack! JSON is a poor choice for matrices though (or anything that should load fast) // so it's a good idea to use a binary format if nothing at least for part of the data. In general, only serialization test runs are to use json //std::ofstream ofs("AAAAAA.json", std::ios::binary); //cereal::JSONOutputArchive joa(ofs); //LevelAsset::serializeScene(joa, _scene._registry); } _sys._renderer._mainStage = RenderStage( S_RANDY.device(), &(S_RANDY._cam), &(S_RANDY.d3d()->_renderTarget), &(S_RANDY.d3d()->_viewport)); RenderStage shadowStage( S_RANDY.device(), &(S_RANDY._cam), &(S_RANDY.d3d()->_renderTarget), &(S_RANDY.d3d()->_viewport)); RenderStage mainStage( S_RANDY.device(), &(S_RANDY._cam), &(S_RANDY.d3d()->_renderTarget), &(S_RANDY.d3d()->_viewport)); _stages.push_back(std::move(shadowStage)); _stages.push_back(std::move(mainStage)); _fullScreenVS = VertexShader(sys._shaderCompiler, L"Shaders/FullScreenTriNoBufferVS.hlsl", {}); _fullScreenPS = PixelShader(sys._shaderCompiler, L"Shaders/FullScreenTriNoBufferPS.hlsl", {}); } void fakeRenderSystem(ID3D11DeviceContext1* context, entt::registry& registry) { // Can try a single buffer for position //_positionBuffer.bindToVS(context, 0); //auto& mainPass = _sys._renderer._mainStage; //mainPass.prepare(context, _sys._clock.deltaTime(), _sys._clock.totalTime()); _rendererSystem.frustumCull(_sys._renderer._cam); auto group = _scene._registry.group<CTransform, CSkModel, VisibleFlag>(); uint32_t i = 0; numCulled = 0; group.each([&context, &posBuffer = _positionBuffer, &skBuffer = _skMatsBuffer, &i, &cullCount = numCulled](CTransform& transform, CSkModel& renderComp, VisibleFlag& isVisible) { if (!isVisible.val) { ++cullCount; return; } auto skModel = renderComp.skModel; if (!skModel) return; // Use VSSetConstantBuffers1 as an experiment // One shader constant = 16 bytes constexpr uint32_t size = std::max(16u, static_cast<uint32_t>(sizeof(SMatrix)) / 16); uint32_t offset = i * size; ++i; context->VSSetConstantBuffers1(0, 1, posBuffer.ptrAddr(), &offset, &size); posBuffer.bindToVS(context, 0); skBuffer.bindToVS(context, 1); // This won't work if meshes aren't all under a single node, it just happens to. Trivial to change though for (auto& mesh : skModel->_meshes) { mesh.bind(context); posBuffer.updateWithStruct(context, transform.transform.Transpose()); Material* mat = mesh._material.get(); mat->getVS()->bind(context); mat->getPS()->bind(context); // Set shaders and textures. mat->bindTextures(context); context->DrawIndexed(mesh._indexBuffer.getIdxCount(), 0, 0); } }); } void update(const RenderContext& rc) override final { _scene.update(); _fpsCounter.tickFast(rc.dTime); static uint64_t frameCount{ 0u }; if (frameCount++ % 512 == 0) { //enity 0 was a hack, not sure what i was trying to do with this anyway //AnimationInstance instance = AnimationInstance(_scene._registry.get<CSkModel>(entt::entity{ 0 }).skModel->_anims[0]); //_skAnimRenderer.addInstance(); } _skAnimRenderer.update(_scene._registry, rc.dTime); } void draw(const RenderContext& rc) override final { const auto context = rc.d3d->getContext(); //_sys._renderer.setDefaultRenderTarget(); _dirLight.updateCBuffer(context, _dirLightCB); _dirLight.bind(context, _dirLightCB); _scene.draw(); //_sys._renderer.setDefaultRenderTarget(); fakeRenderSystem(static_cast<ID3D11DeviceContext1*>(rc.d3d->getContext()), _scene._registry); S_RANDY.d3d()->setRSWireframe(); _geoClipmap.draw(context); S_RANDY.d3d()->setRSSolidCull(); _skybox.renderSkybox(*rc.cam, S_RANDY); // testing full screen shader - works, confirmed //S_RANDY.d3d()->setRSSolidNoCull(); //context->VSSetShader(_fullScreenVS._vsPtr.Get(), nullptr, 0); //context->PSSetShader(_fullScreenPS._psPtr.Get(), nullptr, 0); //context->Draw(3, 0); GUI::BeginFrame(); _sceneEditor.display(); std::vector<GuiElement> guiElems = { {"Octree", std::string("OCT node count " + std::to_string(_scene._octree.getNodeCount()))}, {"Octree", std::string("OCT hull count " + std::to_string(_scene._octree.getHullCount()))}, {"FPS", std::string("FPS: " + std::to_string(_fpsCounter.getAverageFPS()))}, {"Culling", std::string("Objects culled:" + std::to_string(numCulled))} //numCulled }; GUI::RenderGuiElems(guiElems); GUI::EndFrame(); rc.d3d->present(); } }; /* Do not discard this, it works as intended // Implementation of init CBuffer _frustumBuffer; SBuffer _spheresBuffer; ID3D11ShaderResourceView* _spheresSRV; SBuffer _resultBuffer; ID3D11UnorderedAccessView* _resultUAV; ComputeShader _cullShader; constexpr uint32_t test_sphere_count = 1024 * 1024; _frustumBuffer.init(device, CBuffer::createDesc(sizeof(SVec4) * 6)); _spheresBuffer = SBuffer(device, sizeof(SVec4), test_sphere_count, D3D11_BIND_UNORDERED_ACCESS); SBuffer::CreateSBufferSRV(device, _spheresBuffer.getPtr(), test_sphere_count, _spheresSRV); _resultBuffer = SBuffer(device, sizeof(float), test_sphere_count, D3D11_BIND_UNORDERED_ACCESS); SBuffer::createSBufferUAV(device, _resultBuffer.getPtr(), test_sphere_count, _resultUAV); _cullShader.createFromFile(device, L"Shaders/FrustumCull.hlsl"); // Implementation of draw // Instead of a real cull we will just get anything right of the origin to pass to see if the shader works std::array<SPlane, 6> planes; for (auto& p : planes) { p.x = 1; p.y = 0; p.z = 0; p.w = 0; } _frustumBuffer.update(S_RANDY.context(), &planes, sizeof(SPlane) * 6); _frustumBuffer.bindToCS(S_RANDY.context(), 0); std::vector<ID3D11ShaderResourceView*> wat1{_spheresSRV}; std::vector<ID3D11UnorderedAccessView*> wat2{_resultUAV}; _cullShader.execute(S_RANDY.context(), {16, 16, 1}, wat1, wat2); */
28.887906
177
0.716226
[ "mesh", "vector", "model", "transform" ]
2a49dafb7341732f1476bcc32c728ab45a4f40b9
6,231
h
C
tileset.h
inniyah/random_tiled_map
e1fbfc6797ceb585a9e65428c2632178bb69e2e6
[ "Unlicense" ]
null
null
null
tileset.h
inniyah/random_tiled_map
e1fbfc6797ceb585a9e65428c2632178bb69e2e6
[ "Unlicense" ]
null
null
null
tileset.h
inniyah/random_tiled_map
e1fbfc6797ceb585a9e65428c2632178bb69e2e6
[ "Unlicense" ]
null
null
null
// Copyright (c) 2013, Miriam Ruiz <miriam@debian.org> - All rights reserved // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. // // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef TILESET_H_D0E4AD5C_90C1_11E2_BDF1__525400DA3F0D #define TILESET_H_D0E4AD5C_90C1_11E2_BDF1__525400DA3F0D #include <SFML/Graphics.hpp> #include <SFML/System.hpp> class ITileSet { public: struct TileConfig { const char * FileName; uint32_t SolidFlags; int EdgeUp; int EdgeDown; int EdgeLeft; int EdgeRight; int Fill; }; struct TileRuntime { sf::Texture Texture; sf::Sprite Sprite; }; ITileSet(const TileConfig * config_data) : NumberOfTiles(0), TileConfigData(config_data), TileRuntimeData(NULL) { for (const TileConfig * tile = config_data; tile->FileName != NULL; ++tile) { ++NumberOfTiles; } TileRuntimeData = new TileRuntime[NumberOfTiles]; } virtual ~ITileSet() { if (TileRuntimeData) delete[] TileRuntimeData; } virtual int HMirrorEdge(int edge) const { return edge; } virtual int VMirrorEdge(int edge) const { return edge; } virtual int EdgesMatchError(int e1, int e2) const = 0; virtual unsigned int SolidTile() const = 0; virtual unsigned int EmptyTile() const = 0; // env is a binary number representing flags that describe the environment: // 0b(ul)(u)(ur)(l)(c)(r)(dl)(d)(dr) virtual unsigned int InitialTileGuess(uint32_t env) const = 0; // Load the sprite images and create the sprites bool LoadTileTextures(const char * base_dir); inline unsigned int NumTiles() const { return NumberOfTiles; } inline const TileConfig &GetTileConfig(unsigned int index) const { return TileConfigData[index]; } inline const char * BaseFileName(unsigned int index) const { return TileConfigData[index].FileName; } inline uint32_t SolidFlags(unsigned int index) const { return TileConfigData[index].SolidFlags; } inline int EdgeUp(unsigned int index) const { return TileConfigData[index].EdgeUp; } inline int EdgeDown(unsigned int index) const { return TileConfigData[index].EdgeDown; } inline int EdgeLeft(unsigned int index) const { return TileConfigData[index].EdgeLeft; } inline int EdgeRight(unsigned int index) const { return TileConfigData[index].EdgeRight; } inline int Fill(unsigned int index) const { return TileConfigData[index].Fill; } inline TileRuntime & GetTileRuntimeData(unsigned int index) { return TileRuntimeData[index]; } inline sf::Texture & GetTexture(unsigned int index) { return TileRuntimeData[index].Texture; } inline sf::Sprite & GetSprite(unsigned int index) { return TileRuntimeData[index].Sprite; } protected: unsigned int NumberOfTiles; const TileConfig * TileConfigData; TileRuntime * TileRuntimeData; }; class TileSet : public ITileSet { public: TileSet() : ITileSet(TileData_Config) { } virtual ~TileSet() { } enum { // B(lock) + S(olid)/E(mpty) + U(p)/D(own)/L(eft)/R(ight) BS = 1 << 0, BSU = 1 << 1, BSD = 1 << 2, BSL = 1 << 3, BSR = 1 << 4, BE = 1 << 5, BEU = 1 << 6, BED = 1 << 7, BEL = 1 << 8, BER = 1 << 9, }; enum { EMPTY, SOLID, HALF_UP, HALF_DOWN, HALF_LEFT, HALF_RIGHT, SYMMETRIC_EDGES_MAX = HALF_RIGHT, // E(mpty)/S(olid)/H(alf)/O(ppositehalf) + COR(ner) + _ + UP/DOWN/LEFT/RIGHT + T(angential)/N(ormal) ECOR_UPT = ((SYMMETRIC_EDGES_MAX + 1) & 254), ECOR_UPN, SCOR_UPT, SCOR_UPN, HCOR_UPT, HCOR_UPN, OCOR_UPT, OCOR_UPN, ECOR_DOWNT, ECOR_DOWNN, SCOR_DOWNT, SCOR_DOWNN, HCOR_DOWNT, HCOR_DOWNN, OCOR_DOWNT, OCOR_DOWNN, ECOR_LEFTT, ECOR_LEFTN, SCOR_LEFTT, SCOR_LEFTN, HCOR_LEFTT, HCOR_LEFTN, OCOR_LEFTT, OCOR_LEFTN, ECOR_RIGHTT, ECOR_RIGHTN, SCOR_RIGHTT, SCOR_RIGHTN, HCOR_RIGHTT, HCOR_RIGHTN, OCOR_RIGHTT, OCOR_RIGHTN, // E(mpty)/S(olid) + BI + CORNER + T(angential)/N(ormal) EBICORNERT, EBICORNERN, SBICORNERT, SBICORNERN, COMPLEMENTARY_EDGES_MAX = SBICORNERN, }; virtual int HMirrorEdge(int edge) const { return edge; } virtual int VMirrorEdge(int edge) const { return edge; } virtual int EdgesMatchError(int e1, int e2) const; enum { TILE_EMPTY = 0, TILE_SOLID = 1, TILE_HALF_U = 4, TILE_HALF_D = 2, TILE_HALF_L = 3, TILE_HALF_R = 5, TILE_HALF_UL = 32, TILE_HALF_UR = 33, TILE_HALF_DL = 31, TILE_HALF_DR = 30, TILE_ECOR_UL = 6, TILE_ECOR_UR = 7, TILE_ECOR_DL = 8, TILE_ECOR_DR = 9, TILE_SCOR_UL = 10, TILE_SCOR_UR = 11, TILE_SCOR_DL = 13, TILE_SCOR_DR = 12, TILE_OUT_U = 78, TILE_OUT_D = 80, TILE_OUT_L = 81, TILE_OUT_R = 79, TILE_IN_U = 82, TILE_IN_D = 84, TILE_IN_L = 85, TILE_IN_R = 83, }; virtual unsigned int SolidTile() const { return TILE_SOLID; } virtual unsigned int EmptyTile() const { return TILE_EMPTY; } // env is a binary number representing flags that describe the environment: // 0b(ul)(u)(ur)(l)(c)(r)(dl)(d)(dr) virtual unsigned int InitialTileGuess(uint32_t env) const; private: static const TileConfig TileData_Config[]; }; #endif // TILESET_H_D0E4AD5C_90C1_11E2_BDF1__525400DA3F0D
28.19457
105
0.720591
[ "solid" ]
2a51828fc41906ac2cd1d594daf9156c9abe7f9c
2,432
h
C
include/plasma_zlaebz2_work.h
luszczek/plasma
a3cf431cd84d98cde0f4746a28891fd9cf3990a6
[ "BSD-3-Clause" ]
null
null
null
include/plasma_zlaebz2_work.h
luszczek/plasma
a3cf431cd84d98cde0f4746a28891fd9cf3990a6
[ "BSD-3-Clause" ]
null
null
null
include/plasma_zlaebz2_work.h
luszczek/plasma
a3cf431cd84d98cde0f4746a28891fd9cf3990a6
[ "BSD-3-Clause" ]
null
null
null
/** * * @file * * PLASMA header. * PLASMA is a software package provided by Univ. of Tennessee, * Univ. of Manchester, Univ. of California Berkeley and * Univ. of Colorado Denver. * * @precisions normal z -> s d c * **/ #ifndef PLASMA_ZLAEBZ2_H #define PLASMA_ZLAEBZ2_H /******************************************************************************* * These structures support the ZLAEBZ2 code and ZSTEVX2 code, for eigenvalue * and eigenvector discovery. *******************************************************************************/ /******************************************************************************* * zstein needs work areas to function. Instead of allocating and deallocating * these work areas for every vector, we provide a set of work areas per thread. * They are allocated as needed; so we don't allocate more often than we need, * and only allocate at most once per thread and not once per eigenvector. *******************************************************************************/ typedef struct { int *IBLOCK; int *ISPLIT; plasma_complex64_t *WORK; int *IWORK; int *IFAIL; } zlaebz2_Stein_Array_t; /******************************************************************************* * Control is all the global variables needed. *******************************************************************************/ typedef struct { int N; plasma_complex64_t *diag; /* pointers the threads need. */ plasma_complex64_t *offd; plasma_enum_t range; /* PlasmaRangeV or PlasmaRangeI. */ plasma_enum_t jobtype; /* PlasmaNoVec, PlasmaVec, PlasmaCount */ int il; /* For PlasmaRangeI, least index desired. */ int iu; /* For PlasmaRangeI, max index desired. */ zlaebz2_Stein_Array_t* stein_arrays; /* Workspaces per thread for useStein.*/ int baseIdx; /* Number of EV less than user's low threshold. */ int error; /* first error, if non-zero. */ plasma_complex64_t *pVal; /* where to store eigenvalues. */ plasma_complex64_t *pVec; /* where to store eigenvectors. */ int *pMul; /* where to store Multiplicity. */ } zlaebz2_Control_t; #endif /* PLASMA_ZLAEBZ2_H */
41.931034
82
0.48972
[ "vector" ]
2a6a4c2860ff90932b90d53dfdfe6d3955238740
684
h
C
Molecularity/Levels/Credits_Level.h
kyle-robinson/directx-game
ff5964a6edd3241b703409976f27d68205b9ddd3
[ "CC-BY-4.0" ]
1
2021-06-14T22:44:01.000Z
2021-06-14T22:44:01.000Z
Molecularity/Levels/Credits_Level.h
kyle-robinson/directx-game
ff5964a6edd3241b703409976f27d68205b9ddd3
[ "CC-BY-4.0" ]
null
null
null
Molecularity/Levels/Credits_Level.h
kyle-robinson/directx-game
ff5964a6edd3241b703409976f27d68205b9ddd3
[ "CC-BY-4.0" ]
1
2021-06-04T12:44:06.000Z
2021-06-04T12:44:06.000Z
#pragma once #ifndef CREDITS_LEVEL_H #define CREDITS_LEVEL_H #include "LevelContainer.h" #include "LevelStateMachine.h" #include "UI_Manager.h" #include "Credits_UI.h" /// <summary> /// The end credits of the game. Displays the developers and their roles throughout the development process. /// </summary> class Credits_Level : public LevelContainer { public: Credits_Level( LevelStateMachine& stateMachine ); bool OnCreate() override; void OnSwitch() override; void Render() override; void Update(const float dt) override; void CleanUp() override; private: void RenderFrame() override; std::shared_ptr<Credits_UI> credits; LevelStateMachine& levelStateMachine; }; #endif
23.586207
108
0.77193
[ "render" ]
2a71078dfdee7167804a0cb1c54e072f26e51b1c
5,452
h
C
framework/decode/vulkan_handle_mapping_util.h
xooiamd/gfxreconstruct
18a13b510baa0d9a84b1219f62149fe1abc8101e
[ "Apache-2.0" ]
null
null
null
framework/decode/vulkan_handle_mapping_util.h
xooiamd/gfxreconstruct
18a13b510baa0d9a84b1219f62149fe1abc8101e
[ "Apache-2.0" ]
null
null
null
framework/decode/vulkan_handle_mapping_util.h
xooiamd/gfxreconstruct
18a13b510baa0d9a84b1219f62149fe1abc8101e
[ "Apache-2.0" ]
2
2020-06-19T20:25:17.000Z
2021-05-24T22:00:25.000Z
/* ** Copyright (c) 2020 LunarG, Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ #ifndef GFXRECON_DECODE_VULKAN_HANDLE_MAPPING_UTIL_H #define GFXRECON_DECODE_VULKAN_HANDLE_MAPPING_UTIL_H #include "decode/vulkan_object_info_table.h" #include "format/format.h" #include "vulkan/vulkan.h" #include <cassert> GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(decode) GFXRECON_BEGIN_NAMESPACE(handle_mapping) template <typename T> static typename T::HandleType MapHandle(format::HandleId id, const VulkanObjectInfoTable& object_info_table, const T* (VulkanObjectInfoTable::*MapFunc)(format::HandleId) const) { typename T::HandleType handle = VK_NULL_HANDLE; const T* info = (object_info_table.*MapFunc)(id); if (info != nullptr) { handle = info->handle; } return handle; } template <typename T> static typename T::HandleType* MapHandleArray(HandlePointerDecoder<typename T::HandleType>* handle_pointer, const VulkanObjectInfoTable& object_info_table, const T* (VulkanObjectInfoTable::*MapFunc)(format::HandleId) const) { assert(handle_pointer != nullptr); typename T::HandleType* handles = nullptr; if (!handle_pointer->IsNull()) { size_t len = handle_pointer->GetLength(); const format::HandleId* ids = handle_pointer->GetPointer(); handle_pointer->SetHandleLength(len); handles = handle_pointer->GetHandlePointer(); for (size_t i = 0; i < len; ++i) { const T* info = (object_info_table.*MapFunc)(ids[i]); if (info != nullptr) { handles[i] = info->handle; } else { handles[i] = VK_NULL_HANDLE; } } } return handles; } template <typename T> static void AddHandle(const format::HandleId id, const typename T::HandleType handle, T&& initial_info, VulkanObjectInfoTable* object_info_table, void (VulkanObjectInfoTable::*AddFunc)(T&&)) { assert(object_info_table != nullptr); initial_info.handle = handle; initial_info.capture_id = id; (object_info_table->*AddFunc)(std::forward<T>(initial_info)); } template <typename T> static void AddHandle(format::HandleId id, typename T::HandleType handle, VulkanObjectInfoTable* object_info_table, void (VulkanObjectInfoTable::*AddFunc)(T&&)) { assert(object_info_table != nullptr); T info; info.handle = handle; info.capture_id = id; (object_info_table->*AddFunc)(std::move(info)); } template <typename T> static void AddHandleArray(const format::HandleId* ids, size_t ids_len, const typename T::HandleType* handles, size_t handles_len, std::vector<T>&& initial_infos, VulkanObjectInfoTable* object_info_table, void (VulkanObjectInfoTable::*AddFunc)(T&&)) { assert(object_info_table != nullptr); if ((ids != nullptr) && (handles != nullptr)) { size_t len = std::min(ids_len, handles_len); assert(len <= initial_infos.size()); for (size_t i = 0; i < len; ++i) { auto info_iter = std::next(initial_infos.begin(), i); info_iter->handle = handles[i]; info_iter->capture_id = ids[i]; (object_info_table->*AddFunc)(std::move(*info_iter)); } } } template <typename T> static void AddHandleArray(const format::HandleId* ids, size_t ids_len, const typename T::HandleType* handles, size_t handles_len, VulkanObjectInfoTable* object_info_table, void (VulkanObjectInfoTable::*AddFunc)(T&&)) { assert(object_info_table != nullptr); if ((ids != nullptr) && (handles != nullptr)) { size_t len = std::min(ids_len, handles_len); for (size_t i = 0; i < len; ++i) { T info; info.handle = handles[i]; info.capture_id = ids[i]; (object_info_table->*AddFunc)(std::move(info)); } } } GFXRECON_END_NAMESPACE(handle_mapping) GFXRECON_END_NAMESPACE(decode) GFXRECON_END_NAMESPACE(gfxrecon) #endif // GFXRECON_DECODE_VULKAN_HANDLE_MAPPING_UTIL_H
33.042424
113
0.569883
[ "vector" ]
2a78772c3371bf7bbe3b473890d07c97907b9219
44,115
c
C
sdk-6.5.20/src/appl/diag/sand/diag_sand_resource.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/src/appl/diag/sand/diag_sand_resource.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/src/appl/diag/sand/diag_sand_resource.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/** * \file diag_sand_resource.c * * Framework for sand shell commands development */ /* * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2020 Broadcom Inc. All rights reserved. */ #include <sal/appl/sal.h> #include <shared/dbx/dbx_file.h> #include <appl/diag/sand/diag_sand_prt.h> #include <appl/diag/sand/diag_sand_utils.h> #include "diag_sand_framework_internal.h" #include <soc/sand/auto_generated/dbx_pre_compiled_common.h> #include <soc/sand/auto_generated/dbx_pre_compiled_jr2_devices.h> #define BSL_LOG_MODULE BSL_LS_APPL_SHELL /* * Commonly used condition callbacks for shell commands * { */ #include <soc/drv.h> shr_error_e sh_cmd_is_dnx( int unit, rhlist_t * test_list) { SHR_FUNC_INIT_VARS(unit); if (!SOC_IS_DNX(unit)) { SHR_SET_CURRENT_ERR(_SHR_E_UNIT); } SHR_FUNC_EXIT; } shr_error_e sh_cmd_is_dnxf( int unit, rhlist_t * test_list) { SHR_FUNC_INIT_VARS(unit); if (!SOC_IS_DNXF(unit)) { SHR_SET_CURRENT_ERR(_SHR_E_UNIT); } SHR_FUNC_EXIT; } shr_error_e sh_cmd_is_device( int unit, rhlist_t * test_list) { SHR_FUNC_INIT_VARS(unit); #ifdef ADAPTER_SERVER_MODE SHR_SET_CURRENT_ERR(_SHR_E_NOT_FOUND); #endif SHR_FUNC_EXIT; } shr_error_e sh_deinit_cb_void( int unit) { SHR_FUNC_INIT_VARS(unit); SHR_FUNC_EXIT; } /* * } */ static sh_sand_enum_t sh_enum_table_core[] = { {"max", 0, "max core ID", "DNX_DATA.device.general.nof_cores-1"}, {"all", _SHR_CORE_ALL, "all cores"}, {NULL} }; sh_sand_enum_t sh_enum_table_lag_pool[] = { { /** No need to define value if plugin_str was defined */ .string = "max", .desc = "Number of lag pools supported", .plugin_str = "DNX_DATA.trunk.parameters.nof_pools-1"}, {NULL} }; /* *INDENT-OFF* */ sh_sand_man_t sh_sand_sys_arguments_man = { .brief = "Options available for all commands", .full = "This set of options is available for any leaf command." "Functionality of these options is universal, although it may not be relevant for all commands" }; sh_sand_man_t sh_dnxc_sys_ctest_cmd_man = { .brief = "Commands available for all tests in CTest", .full = "This set of commands is available for any leaf command." }; sh_sand_option_t sh_sand_sys_arguments[] = { {"columns", SAL_FIELD_TYPE_STR, "Comma-separated list of PRT columns to show", "all"}, {"core", SAL_FIELD_TYPE_INT32, "Core ID for multi-core devices", "all", (void *)sh_enum_table_core}, {"file", SAL_FIELD_TYPE_STR, "File name where command output will be placed", ""}, {"gold", SAL_FIELD_TYPE_BOOL, "Save PRT XML output file under the DB gold result folder", "No"}, {"new", SAL_FIELD_TYPE_BOOL, "Overwrite output file with the new one", "No"}, {"xpath", SAL_FIELD_TYPE_STR, "XPath in output file, relative to top, where output will be added", ""}, {"folder", SAL_FIELD_TYPE_STR, "Directory name where command output will be placed", ""}, {"silence", SAL_FIELD_TYPE_BOOL, "Deprecate certain info messages from tabular printing", "No"}, {"cell", SAL_FIELD_TYPE_STR, "Filter to choose which rows will be presented. Filter pattern \"columns:cell_content\"", ""}, {"time", SAL_FIELD_TYPE_BOOL, "Requests to measure command duration and print at the end", "no"}, {"seed", SAL_FIELD_TYPE_UINT32, "Set test seed, must be parsed from within", "123456789"}, {"logger", SAL_FIELD_TYPE_BOOL, "Set logger mode", "No"}, {"custom_verify", SAL_FIELD_TYPE_STR, "File to compare with custom gold one", "No"}, {NULL} }; /* * All command and option keywords should be present to below global keyword list. * Before adding new keywords to this list: * Please verify that there are no already existing keywords that may fit your needs * Capital letters will represent shortcut that may be used instead of full keyword * List should be arranged in alphabet order, assuming all letters are 'small' case. * Note that the special sign '_' is placed before 'a' (or 'A') */ sh_sand_keyword_t sh_sand_keywords[] = { {"ACCess"}, {"AccessId"}, {"ACCessOnly"}, {"ACE"}, {"ACL"}, {"AclConTeXt"}, {"ACTion"}, {"ACTIVATE"}, {"ACTIVe_actions"}, {"ADaPTeR"}, {"Add", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"ADDED"}, {"ADdRess"}, {"ADVanced"}, {"ALarM"}, {"ALGO_Path"}, {"AliAS"}, {"ALL"}, {"Alloc_Combinations"}, {"ALLocaTion"}, {"AllocationManager"}, {"ALLOW_wb_test"}, {"APP_ID"}, {"APPLication"}, {"APT"}, {"ARMor"}, {"ARR"}, {"ARray"}, {"AsExtPresent"}, {"ATTach"}, {"AUTOcredit"}, {"AutoNeg"}, {"AVS"}, {"BaCKGRouNDThreads"}, {"BandWidth"}, {"BaNK"}, {"BaNK_MoDe"}, {"BaNK_SeeD"}, {"BaseQueue"}, {"BCM"}, {"BER"}, {"Ber_Scan_Mode"}, {"BerProJ"}, {"BFD"}, {"BFDEndPoint"}, {"BIST"}, {"BLock"}, {"BUFfer"}, {"BURST"}, {"BY_ConTeXt"}, {"BY_Fg"}, {"C45"}, {"CacHe"}, {"CaLenDAR"}, {"CallBack"}, {"CaNDidate"}, {"CAPACITY"}, {"CDR"}, {"CELL"}, {"CFC"}, {"CGM"}, {"CHanGed"}, {"CHaNnel"}, {"CL72"}, {"CLASS"}, {"ClassiFier"}, {"ClassOfService"}, {"CLeaN"}, {"CLear"}, {"ClearHitBit"}, {"CLIENT"}, {"CLoSe"}, {"CLUSTER"}, {"CoLoR"}, {"CoLuMN"}, {"CoLuMN_MoDe"}, {"CoLuMN_SeeD"}, {"CoMBiNe"}, {"CoMBo"}, {"CoMmanD"}, {"Command_ID"}, {"CoMmanD_Reg"}, {"CoMmit"}, {"CoMPare"}, {"COMPensation"}, {"CoMPoSe"}, {"COMPRession"}, {"CoNDITion"}, {"ConFiG"}, {"ConFiG_Path"}, {"CoNGeSTion"}, {"CONNection"}, {"CONnectivity"}, {"ConTeXt"}, {"ContextSelect"}, {"CORE"}, {"CoreDiSPlay"}, {"CouNT"}, {"COUnter"}, {"CouNTerSet"}, {"CRC"}, {"CReate"}, {"CRoss_CoNnect"}, {"Cross_Connect_Traverse"}, {"CRPS"}, /* CounteRProceSsor */ {"CTest"}, {"CURrent"}, {"CuSToM"}, {"CuSToM_VeRiFY"}, {"Da_Is_Mc"}, {"DaTa"}, {"DaTaBaSe"}, {"DaTaIN_Reg"}, {"DaTaOUT_Reg"}, {"DaTaTyPe"}, {"DB"}, {"DBaL"}, {"DBI_MoDe"}, {"DBI_PatTeRN"}, {"DeBuG"}, {"DeCoDe"}, {"DeFaulT"}, {"DEFine"}, {"DeINiT"}, {"DeLeTe"}, {"DeMuX"}, {"DESC"}, {"DeSTination"}, {"DestMac"}, {"DestMacInc"}, {"DeSTRoY"}, {"DETach"}, {"DETAiled"}, {"DEV_ADdr"}, {"DeViCe"}, {"Device_Data"}, {"DEviceReset"}, {"DIAG"}, {"DIRECT"}, {"DIRection"}, {"DIRTY"}, {"DISaBle"}, {"DIsplay"}, {"DIVisoR"}, {"DMAC"}, {"DmaDescAgg"}, {"DNX"}, {"DNXF"}, {"DPC"}, {"DRAM"}, {"DropPrecedence"}, {"DSC"}, {"DuMP"}, {"DURation"}, {"DYNAMIC"}, {"DynamicCalibration"}, {"ECC"}, {"ECMP"}, {"EEDB"}, {"EEDB_LL"}, {"EFES"}, {"EGQ"}, {"EGress"}, {"EgressVlanEditing"}, {"EKLeaP"}, {"EM"}, {"ENAble"}, {"Enabled_Only"}, {"ENCap"}, {"END"}, {"ENGiNe"}, {"ENTrieS"}, {"ENTry"}, {"EPEPort"}, {"EPNI"}, {"ERPP"}, {"ERROR"}, {"ERRor_Recovery"}, {"EthRif"}, {"ETPP"}, {"ETPS_Decode"}, {"EXec"}, {"EXPort"}, {"EXTended"}, {"EXTended_Vref_Range"}, {"EYEScan"}, {"Fabric", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"FAILed"}, {"FEATURE"}, {"FEC"}, {"FECStat"}, {"FEM"}, {"FER"}, {"FieLD"}, {"FILE"}, {"FILENaMe"}, {"FiLTeR"}, {"FIND"}, {"FirmWare"}, {"FLaG"}, {"FLexE"}, {"FLOW"}, {"Flow_Control"}, {"FlowId"}, {"FoLDeR"}, {"FORCE"}, {"FoRMat"}, {"ForWarD"}, {"ForwardDecisionTrace"}, {"FRameWork"}, {"FRom"}, {"FSM"}, {"FULL"}, {"FwdActStrength"}, {"Get", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT | SH_SAND_KEYWORD_ALLOW_DOUBLE}, {"GLOBal"}, {"GoLD"}, {"GPM"}, /** GPort_Management */ {"GPort"}, {"GRaNuLarity"}, {"Graphical", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT | SH_SAND_KEYWORD_ALLOW_DOUBLE}, {"GRouP"}, {"GRouP_Type"}, {"HanDLe"}, {"HanDLeR"}, {"HeaDeR"}, {"HeaDeR_APPend"}, {"Help", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"HEX"}, {"HieRarChy"}, {"Hist_Errcnt_Threshold"}, {"HIT"}, {"HIT_Clr"}, {"HL"}, {"HOST"}, {"HW"}, {"HWElement"}, {"HwPortBitMap"}, {"ID"}, {"IGnore_Address"}, {"IKLeaP"}, {"ILKN"}, {"ILKN_ID"}, {"IMaGe_SPecific"}, {"INDex"}, {"INDex_RANGE"}, {"INDiCation"}, {"INDirectACCess"}, {"INFo"}, {"INGress"}, {"IngressVlanEditing"}, {"INiT"}, {"Init_DNX"}, {"INITial"}, {"INJect"}, {"InLIF"}, {"InMirrDisable"}, {"INPut_CORE"}, {"INSTance"}, {"INTerFace"}, {"INTERNAL"}, {"INTeRrupt"}, {"InTerVal"}, {"InVerT"}, {"IP"}, {"IP6Mask"}, {"IPS"}, {"IPT"}, {"IRE"}, {"IS_Flow"}, {"ItmhBaseExtPresent"}, {"ItmhBaseExtType"}, {"ItmhBaseExtValue"}, {"ItmhPRESent"}, {"IVL"}, {"KBP"}, {"KBP_FWD"}, {"KBP_RPF"}, {"KEY"}, {"Key_Only"}, {"Key_SIZE"}, {"LaBeL"}, {"LAG"}, {"LANE"}, {"LANE_MAP"}, {"LAST"}, {"Last_lookUp"}, {"Layer", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"LENgth"}, {"LeVeL"}, {"LIF"}, {"LiNK"}, #ifdef PHYMOD_LINKCAT_SUPPORT {"LiNKCat"}, #endif {"LiNKSCan"}, {"LIST"}, {"Ll_Exists"}, {"LOAD"}, {"Load_Balancing"}, {"Local_To_Sys"}, {"LocalOutLIF"}, {"LoGger"}, {"LooKuP"}, {"LooPBack"}, {"LooPBack_Mode"}, {"LPM"}, {"MAC"}, {"MaCRo"}, {"MAINThread"}, {"ManaGeMenT"}, {"MANual"}, {"MAPping"}, {"MaRGin"}, {"MaRK"}, {"MAsK"}, {"MaTuRity"}, {"MAX"}, {"Max_Alloc"}, {"Max_Err_Control"}, {"MBIST"}, {"MC_Group"}, {"MC_IP"}, {"MC_IP6Mask"}, {"MC_Mask"}, {"MDB"}, {"MDL"}, {"MeaSuRe"}, {"MEMory"}, {"MEMoryUSE"}, {"MEMREG"}, {"MEP_DB"}, {"MESH"}, {"Mesh_Topology"}, {"METER"}, {"METER_ID"}, {"MidStack"}, {"MIN"}, {"MINICONtroller"}, {"MoDe"}, {"ModeRegisters"}, {"MODID"}, {"MODify"}, {"MODULE"}, {"Module_Id"}, {"Module_List"}, {"MOST"}, {"MPLS_ACTION"}, {"MTA"}, {"MTU"}, {"MultiCast"}, {"MUX"}, {"MYMAC"}, {"NaMe"}, {"NEW"}, {"NIF"}, {"NO"}, {"No_Rates"}, {"NO_WB_test"}, {"NoDeinit"}, {"NoElk"}, {"NoFabric"}, {"NoInit"}, {"NON_empty"}, {"NonZero"}, {"Num_BIts"}, {"Num_ENTries"}, {"Num_Lifs"}, {"NUMber"}, {"NUMERIC"}, {"OAM"}, {"OAM_ID"}, {"OAMEndPoint"}, {"OAMP"}, {"OAMP_PE"}, {"OCCupation"}, {"OFF"}, {"OFFSet"}, {"ON"}, {"One_PKT"}, {"OOB_InterFace"}, {"OPcode"}, {"OPeRation"}, {"ORDER"}, {"OverHead"}, {"OVERwrite"}, {"PacKeT"}, {"PacketParsingInfo"}, {"PacKeTTM"}, {"PARAMeter"}, {"PaRSer"}, {"PARTition"}, {"PATCH"}, {"PATH"}, {"PatTeRN"}, {"PatternINC"}, {"PatternRandom"}, {"PayLoad"}, {"PayLoad_SIZE"}, {"PBMP"}, {"PEM"}, {"PEMLA"}, {"PHASE"}, {"PHY"}, {"PHY_ID"}, {"PhyDB"}, {"PhyMaP"}, {"PIPE"}, {"Pll_INDeX"}, {"PLOT"}, {"PM_ID"}, {"PMF_Context"}, {"POLL_Delay"}, {"POLL_NOF_times"}, {"POLYnomial"}, {"POOL"}, {"PoPuLate"}, {"Port", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"PortBitMap"}, {"PoRtDrop"}, {"PortInfo"}, {"PortMod"}, {"PortScheDuler"}, {"POSITION"}, {"PP"}, {"PphType"}, {"PQP"}, {"PRBS"}, {"PRBS_DaTa_SeeD"}, {"PRBSStat"}, {"PRE"}, {"PreCharge"}, {"PReDeFined"}, #ifdef PHYMOD_NEW_LINKCAT {"PRefix"}, #endif {"PRefix_LeNgth"}, {"PRinT"}, {"PRinT_Flow_and_Up"}, {"PRinT_Status"}, {"PRIOrity"}, {"PRoFiLe"}, {"PRoGram"}, {"PRoPerty"}, {"PRoPerty_MANual"}, {"PROTEct"}, {"PROTOcol"}, {"PtchHeader"}, {"PtchSRCport"}, {"PVT"}, {"QUALifier"}, {"Queue", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"QuieT"}, {"RaNDom"}, {"RaNGe"}, {"RATE"}, {"Rate_Class"}, {"RAW"}, {"REACHability"}, {"Read", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"Read_WEIGHT"}, {"REASSembly"}, {"RedirectToOCB"}, {"REFresh"}, {"REG_ADdr"}, {"REGister"}, {"RELease"}, {"ReMoVe"}, {"ReQueST"}, {"ReSeT"}, {"ReSouRCe"}, {"ReSPoNSe"}, {"ReSuLt"}, {"RESult_Dir"}, {"ReSuLt_Type"}, {"ReSuMe"}, {"RoLLBaCK"}, {"ROP"}, {"ROP_ReaD"}, {"ROP_TeST"}, {"ROP_WRite"}, {"ROUTE"}, {"ROUTES_FILE"}, {"ROW"}, {"ROW_MoDe"}, {"ROW_Seed"}, {"RPF"}, {"RQP"}, {"RUN"}, {"RX"}, {"SaMe_ROW_CouNT"}, {"SaMPle_Time"}, {"SAT"}, {"SBUS"}, {"SCHeduler"}, {"SCheMe"}, {"SCReeN"}, {"SeaRCH"}, {"SeC"}, {"SEC_GRouP"}, {"SEED"}, {"SEMantic"}, {"SePaRaTe"}, {"SER"}, {"Set", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"SeVeRity"}, {"ShaDoW"}, {"ShaPeR"}, {"SHMoo_Type"}, {"SHORT"}, {"SHOW"}, {"SHOW_DESC"}, {"SHOW_SIG"}, {"SIGnal"}, {"SIGNALS"}, {"SiLence"}, {"SIMulate"}, {"SiZe"}, {"SKiP"}, {"SLOT"}, {"SMAC"}, {"SniF"}, {"SnoopProfile"}, {"SOC"}, {"SoFT"}, {"SoFT_NoFabric"}, {"SouRCe"}, {"SourceMac"}, {"SourceMacInc"}, {"SPeeD"}, {"SQM"}, {"SRv6"}, {"STAGE"}, {"START"}, {"STAT"}, {"STaTe"}, {"STaTe_EYE"}, {"STatiC"}, {"STATS"}, {"StaTuS"}, {"STG"}, {"STIF"}, {"STOP"}, {"Stop_On_Error"}, {"STP"}, {"STRUCTure"}, {"SuSPenD"}, {"SVL"}, {"SVTag"}, {"SW"}, {"SW_STate_SiZe"}, {"SwPortBitMap"}, {"SWSTate"}, {"SYMbol"}, {"SYNC"}, {"SYS_Header"}, {"SYSTEM"}, {"SYStem_MODE"}, {"SYStem_PORT"}, {"SYStem_RED"}, {"TaBLe"}, {"TABular"}, {"TagProtocolIdentifier"}, {"TCAM"}, {"TCL"}, {"TDM"}, {"TEMPerature"}, {"TeMPLate"}, {"TERMination"}, {"TeST"}, {"Test_MoDe"}, {"TGID"}, {"THreaD"}, {"THreShold"}, {"TIME"}, /** System argument - not to be used by regular shell command */ {"TimeAnalyzer"}, {"Timer_ConTRoL"}, {"TM"}, {"TO"}, {"TP_InDex"}, {"Traffic_Profile"}, {"TrafficClass"}, {"TRANSACTion"}, {"TRAP"}, {"TRUNK"}, {"TTL"}, {"TUNe"}, {"TX"}, {"TXUnit"}, {"TYpe"}, {"UNIT"}, {"UNMask"}, {"UntagBitMap"}, {"UnTagged"}, {"UPDate"}, {"USaGe"}, {"UsageTEST"}, {"USeR"}, {"V6"}, {"ValiD"}, {"VALue"}, {"VendorInfo"}, {"VERBose"}, {"VeRiFY"}, {"VERSion"}, {"VID"}, {"VIRTual"}, {"VirtualWire"}, {"VISibility"}, {"VLan"}, {"VlanPrio"}, {"VRF"}, {"VSI"}, {"VSQ"}, {"VW_NAME"}, {"WarmBoot"}, {"WatchDog"}, {"WIDEData"}, {"Write", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {"Write_Command"}, {"Write_WEIGHT"}, {"XOR"}, {"XPATH"}, {"YDV"}, {"YES"}, {"Zero", SH_SAND_KEYWORD_SINGLE_CHARACTER_SHORTCUT}, {NULL} }; /* *INDENT-ON* */ shr_error_e sh_sand_keyword_shortcut_get( char *keyword, char *short_key) { int i_ch, i_sh = 0; int len = sal_strlen(keyword); SHR_FUNC_INIT_VARS(NO_UNIT); for (i_ch = 0; i_ch < len; i_ch++) { if (isupper(keyword[i_ch]) || isdigit(keyword[i_ch])) { short_key[i_sh++] = keyword[i_ch]; } /* * Shortcut size includes string ending, so limit by size -1 */ if (i_sh >= SH_SAND_MAX_SHORTCUT_SIZE) { SHR_CLI_EXIT(_SHR_E_INIT, "Keyword:%s requires shortcut more than max %d characters,\n", keyword, SH_SAND_MAX_SHORTCUT_SIZE - 1); } } /* * Null terminate the string. If no capital - no shortcut was defined, shortcut will be empty string */ short_key[i_sh] = 0; exit: SHR_FUNC_EXIT; } shr_error_e sh_sand_keyword_list_init( int unit) { int i_key; int len; char keyword_var_str[SH_SAND_MAX_RESOURCE_SIZE]; rhhandle_t keyword_handle; SHR_FUNC_INIT_VARS(unit); for (i_key = 0; sh_sand_keywords[i_key].keyword != NULL; i_key++) { /* Build shortcut */ /* * Skip the entry if list was already initialized */ if (sh_sand_keywords[i_key].var_list[unit] != NULL) { continue; } len = sal_strlen(sh_sand_keywords[i_key].keyword); /* * Verify max size - it also insures that plural will not go over its allocation size */ if (len >= SH_SAND_MAX_KEYWORD_SIZE) { SHR_CLI_EXIT(_SHR_E_INIT, "Keyword:\"%s\" length:%d is longer than max(%d)\n", sh_sand_keywords[i_key].keyword, len, SH_SAND_MAX_KEYWORD_SIZE - 1); } #ifdef END_DIGIT_VERIFY if (isdigit(sh_sand_keywords[i_key].keyword[len - 1])) { SHR_CLI_EXIT(_SHR_E_INIT, "Instead of keyword:\"%s\" define one without digit at the end\n" "Once defined any keyword with digits at the end may be used freely\n", sh_sand_keywords[i_key].keyword); } #endif SHR_IF_ERR_EXIT(sh_sand_keyword_shortcut_get (sh_sand_keywords[i_key].keyword, sh_sand_keywords[i_key].short_key)); /* * Create list for all keyword variations */ if ((sh_sand_keywords[i_key].var_list[unit] = utilex_rhlist_create("KeywordVars", sizeof(sh_sand_keyword_var_t), 1)) == NULL) { SHR_CLI_EXIT(_SHR_E_MEMORY, "ERROR - No memory for vars list\n"); } /* * Fill plural form and null terminate it, pay attention that allocation is 3 characters longer than keyword */ sal_strncpy(keyword_var_str, sh_sand_keywords[i_key].keyword, len + 1); if (sh_sand_keywords[i_key].keyword[len - 1] == 'y') { sal_strncpy((keyword_var_str + (len - 1)), "ies", 4); } /* s, x, z, ch, sh */ else if ((sal_strcasecmp((sh_sand_keywords[i_key].keyword + len - 1), "s") == 0) || (sal_strcasecmp((sh_sand_keywords[i_key].keyword + len - 1), "x") == 0) || (sal_strcasecmp((sh_sand_keywords[i_key].keyword + len - 1), "z") == 0) || (sal_strcasecmp((sh_sand_keywords[i_key].keyword + len - 2), "ch") == 0) || (sal_strcasecmp((sh_sand_keywords[i_key].keyword + len - 2), "sh") == 0)) { sal_strncpy((keyword_var_str + len), "es", 3); } else { sal_strncpy((keyword_var_str + len), "s", 2); } /* * Add plural to the list, shortcut is the same as for keyword itself */ if (utilex_rhlist_entry_add_tail(sh_sand_keywords[i_key].var_list[unit], keyword_var_str, RHID_TO_BE_GENERATED, &keyword_handle) != _SHR_E_NONE) { SHR_CLI_EXIT(_SHR_E_MEMORY, "ERROR - Cannot add plural:%s to keyword variants list\n", keyword_var_str); } sal_strncpy(((sh_sand_keyword_var_t *) keyword_handle)->short_key, sh_sand_keywords[i_key].short_key, SH_SAND_MAX_SHORTCUT_SIZE - 1); } exit: SHR_FUNC_EXIT; } shr_error_e sh_sand_keyword_list_deinit( int unit) { int i_key; SHR_FUNC_INIT_VARS(unit); for (i_key = 0; sh_sand_keywords[i_key].keyword != NULL; i_key++) { /* Build shortcut */ if (sh_sand_keywords[i_key].var_list[unit] != NULL) { utilex_rhlist_free_all(sh_sand_keywords[i_key].var_list[unit]); sh_sand_keywords[i_key].var_list[unit] = NULL; } if (sh_sand_keywords[i_key].cmd_list[unit] != NULL) { utilex_rhlist_free_all(sh_sand_keywords[i_key].cmd_list[unit]); sh_sand_keywords[i_key].cmd_list[unit] = NULL; } sh_sand_keywords[i_key].count = 0; } SHR_FUNC_EXIT; } shr_error_e sh_sand_keyword_fetch( int unit, char *command, char *keyword_in, char **shortcut_out_p, char **keyword_out_p, int flags) { int i_key; char *keyword = NULL, *shortcut = NULL; rhhandle_t keyword_handle; int i_ch, in_len, cur_len, short_len, suffix_len = 0; char keyword_temp[SH_SAND_MAX_RESOURCE_SIZE]; char *keyword_short; SHR_FUNC_INIT_VARS(unit); /* * Check the keyword on illegal characters */ SHR_CLI_EXIT_IF_ERR(utilex_str_verify(keyword_in), "'%s' contain illegal characters", keyword_in); if ((in_len = sal_strlen(keyword_in)) >= SH_SAND_MAX_KEYWORD_SIZE) { if (!(flags & SH_CMD_VERIFY)) { /* * Assign default values for keywords that do not require verification */ keyword = keyword_in; shortcut = NULL; SHR_EXIT(); } else { SHR_CLI_EXIT(_SHR_E_MEMORY, "ERROR - Keyword:%s length:%d is over the limit:%d\n", keyword_in, in_len, SH_SAND_MAX_KEYWORD_SIZE); } } /* * If there are digits with or without underscore ('_'), strip it and search without * IF it is the case add keyword_in in modified form to the list to be have available pointers */ for (i_ch = in_len - 1; i_ch >= 0; i_ch--) { if (!isdigit(keyword_in[i_ch]) && (keyword_in[i_ch] != '_')) { suffix_len = in_len - (i_ch + 1); break; } } /* * If digits discovered */ if (suffix_len != 0) { sal_memcpy(keyword_temp, keyword_in, in_len - suffix_len); keyword_temp[in_len - suffix_len] = 0; } for (i_key = 0; sh_sand_keywords[i_key].keyword != NULL; i_key++) { cur_len = sal_strlen(sh_sand_keywords[i_key].keyword); /* * First compare input to head keyword */ if (!sal_strcasecmp(sh_sand_keywords[i_key].keyword, keyword_in)) { keyword = sh_sand_keywords[i_key].keyword; if (ISEMPTY(sh_sand_keywords[i_key].short_key)) { /* * IF there is no shortcut yes - try to fill it, assign short_key pointer anyway * Useful in case where keyword_init_list was not called before keyword fetching */ sh_sand_keyword_shortcut_get(sh_sand_keywords[i_key].keyword, sh_sand_keywords[i_key].short_key); } shortcut = sh_sand_keywords[i_key].short_key; break; } /* * Now look for any existing variants already in the list * May be plurals or already registered numbered keyword */ else if ((keyword_handle = utilex_rhlist_entry_get_by_name(sh_sand_keywords[i_key].var_list[unit], keyword_in)) != NULL) { keyword = RHNAME(keyword_handle); shortcut = ((sh_sand_keyword_var_t *) keyword_handle)->short_key; break; } /* * Now if it was numbered keyword, compare striped version and add to the list, if there was a match */ else if ((suffix_len != 0) && !sal_strcasecmp(sh_sand_keywords[i_key].keyword, keyword_temp)) { /* * First - overwrite keyword_temp with capitalized resource one */ sal_strncpy(keyword_temp, sh_sand_keywords[i_key].keyword, SH_SAND_MAX_RESOURCE_SIZE - 1); /* * Add the rest of original keyword to capitalized version */ sal_memcpy(keyword_temp + cur_len, keyword_in + cur_len, suffix_len); /* * End the string in_len is a sum of cur_len and suffix_len */ keyword_temp[in_len] = 0; if (utilex_rhlist_entry_add_tail(sh_sand_keywords[i_key].var_list[unit], keyword_temp, RHID_TO_BE_GENERATED, &keyword_handle) != _SHR_E_NONE) { SHR_CLI_EXIT(_SHR_E_MEMORY, "ERROR - Cannot add:%s to keyword variants list\n", keyword_temp); } /* * Now fill appropriate shortcut according to the same pattern as the keyword itself */ /* * First - copy original shortcut */ keyword_short = ((sh_sand_keyword_var_t *) keyword_handle)->short_key; sal_strncpy(keyword_short, sh_sand_keywords[i_key].short_key, SH_SAND_MAX_SHORTCUT_SIZE - 1); short_len = sal_strlen(sh_sand_keywords[i_key].short_key); /* * Add the rest of original keyword to capitalized version * Skip first "_" in appended number string */ if (keyword_in[cur_len] == '_') { suffix_len--; } sal_memcpy(keyword_short + short_len, keyword_in + in_len - suffix_len, suffix_len); short_len += suffix_len; /* * End the string */ keyword_short[short_len] = 0; /* * Now we can finally assign return values */ keyword = RHNAME(keyword_handle); shortcut = ((sh_sand_keyword_var_t *) keyword_handle)->short_key; break; } } if (sh_sand_keywords[i_key].keyword == NULL) { if (!(flags & SH_CMD_VERIFY)) { /* * We tried to find shortcut even for keyword without verification request, but no failure if not * Assign default values for keywords that do not require verification */ keyword = keyword_in; shortcut = NULL; SHR_EXIT(); } else { SHR_CLI_EXIT(_SHR_E_NOT_FOUND, "ERROR: Keyword:\"%s\" was not registered\n" "\tTo register use sh_sand_keywords in diag_sand_resource.c\n", keyword_in); } } /** Update resource statistics only for requests with verification */ sh_sand_keywords[i_key].count++; if (command != NULL) { if (sh_sand_keywords[i_key].cmd_list[unit] == NULL) { if ((sh_sand_keywords[i_key].cmd_list[unit] = utilex_rhlist_create("Commands", sizeof(rhentry_t), FALSE)) == NULL) { SHR_CLI_EXIT(_SHR_E_MEMORY, "ERROR - No memory for commands list\n"); } } /* * Add command to the list */ if (utilex_rhlist_entry_add_tail(sh_sand_keywords[i_key].cmd_list[unit], command, RHID_TO_BE_GENERATED, &keyword_handle) != _SHR_E_NONE) { SHR_CLI_EXIT(_SHR_E_MEMORY, "ERROR - Cannot add command:%s to keyword commands list\n", command); } } exit: if (keyword_out_p != NULL) { *keyword_out_p = keyword; } if (shortcut_out_p != NULL) { *shortcut_out_p = shortcut; } SHR_FUNC_EXIT; } #ifndef NO_FILEIO static shr_error_e compare_filter_get_list( int unit, char *filter_n, rhlist_t ** token_list_p) { xml_node curTop = NULL, curSubTop = NULL, curLine; char filename[RHSTRING_MAX_SIZE]; SHR_FUNC_INIT_VARS(unit); SHR_NULL_CHECK(token_list_p, _SHR_E_PARAM, "token_list_p"); if (ISEMPTY(filter_n)) { SHR_CLI_EXIT(_SHR_E_PARAM, "Empty filter name\n"); } if (((curTop = dbx_pre_compiled_common_top_get(unit, "DNX-Devices.xml", "top", 0)) == NULL) || ((curSubTop = dbx_xml_child_get_first(curTop, "case-objects")) == NULL)) { /* * No parsing objects - just leave */ SHR_SET_CURRENT_ERR(_SHR_E_NOT_FOUND); SHR_EXIT(); } RHDATA_ITERATOR(curLine, curSubTop, "include") { char type[RHNAME_MAX_SIZE]; RHDATA_GET_STR_DEF_NULL(curLine, "type", type); if (!sal_strcasecmp(type, "filters")) { xml_node curFile, curSection, curFilter, curToken; int device_specific = 0; RHDATA_GET_INT_DEF(curLine, "device_specific", device_specific, 0); RHDATA_GET_STR_CONT(curLine, "file", filename); if (device_specific == TRUE) { if ((curFile = dbx_pre_compiled_devices_top_get(unit, filename, "top", CONF_OPEN_PER_DEVICE)) == NULL) continue; } else { if ((curFile = dbx_pre_compiled_common_top_get(unit, filename, "top", 0)) == NULL) continue; } /* * Go through packets and found the requested one */ if ((curSection = dbx_xml_child_get_first(curFile, "filters")) == NULL) { dbx_xml_top_close(curFile); continue; } RHDATA_ITERATOR(curFilter, curSection, "filter") { char name[RHNAME_MAX_SIZE]; RHDATA_GET_STR_DEF_NULL(curFilter, "name", name); if (!sal_strcasecmp(filter_n, name)) { rhhandle_t token; rhlist_t *token_list; if ((token_list = utilex_rhlist_create("FilterTokens", sizeof(rhentry_t), 1)) == NULL) break; RHDATA_ITERATOR(curToken, curFilter, "token") { char name[RHNAME_MAX_SIZE]; RHDATA_GET_STR_CONT(curToken, "name", name); if (utilex_rhlist_entry_add_tail(token_list, name, RHID_TO_BE_GENERATED, &token) != _SHR_E_NONE) break; } *token_list_p = token_list; dbx_xml_top_close(curFile); SHR_EXIT(); } } dbx_xml_top_close(curFile); } } exit: dbx_xml_top_close(curTop); SHR_FUNC_EXIT; } /* * see diag_sand_framework.h */ void sh_sand_gold_filename( char *command, char *filename) { /* * Currently all dumps will start from shell_ - we may change it if we need */ sal_snprintf(filename, SH_SAND_MAX_TOKEN_SIZE - 1, "shell_"); /* * Each command contain space separated command line, append entire command chain (spaces will be turned to _ below */ sal_strncat(filename, command, SH_SAND_MAX_TOKEN_SIZE - 1 - strlen(filename)); /* * Finally append xml extension */ sal_strncat(filename, ".xml", SH_SAND_MAX_TOKEN_SIZE - 1 - strlen(filename)); /* * Replace all non-compliant characters in the test name by underscore */ utilex_str_escape(filename, '_'); /* * Make it all lower case to ease the view */ utilex_str_to_lower(filename); return; } /* * see diag_sand_framework.h */ shr_error_e sh_sand_gold_path( int unit, int flags, char *gold_name, char *gold_path) { char temp_filename[RHFILE_MAX_SIZE]; char temp_custom[RHFILE_MAX_SIZE]; SHR_FUNC_INIT_VARS(unit); if (_SHR_IS_FLAG_SET(flags, SH_CMD_CUSTOM_XML_VERIFY)) { sal_snprintf(temp_custom, RHFILE_MAX_SIZE, "%s", "custom/"); } else { sal_snprintf(temp_custom, RHFILE_MAX_SIZE, "%s", ""); } if (sh_cmd_is_device(unit, NULL) == _SHR_E_NONE) { sal_snprintf(temp_filename, RHFILE_MAX_SIZE, "gold/%s%s", temp_custom, gold_name); } else { sal_snprintf(temp_filename, RHFILE_MAX_SIZE, "gold/adapter/%s%s", temp_custom, gold_name); } if (dbx_file_get_file_path(unit, temp_filename, CONF_OPEN_CREATE | CONF_OPEN_PER_DEVICE, gold_path) != _SHR_E_NONE) { SHR_CLI_EXIT(_SHR_E_PARAM, "Gold result file:'%s' cannot be obtained\n", temp_filename); } exit: SHR_FUNC_EXIT; } shr_error_e sh_sand_gold_compare( int unit, char *local_filename, char *gold_name, char *filter_n, int flags) { int i_line = 0; char gold_filepath[RHFILE_MAX_SIZE]; char local_line[SH_SAND_MAX_TOKEN_SIZE], gold_line[SH_SAND_MAX_TOKEN_SIZE]; FILE *local_result = NULL, *gold_result = NULL; rhlist_t *token_list = NULL; SHR_FUNC_INIT_VARS(unit); if (ISEMPTY(local_filename)) { SHR_CLI_EXIT(_SHR_E_PARAM, "No local input file for comparison\n"); } if (ISEMPTY(gold_name)) { SHR_CLI_EXIT(_SHR_E_PARAM, "No gold input file for comparison\n"); } if (sh_sand_gold_path(unit, flags, gold_name, gold_filepath) != _SHR_E_NONE) { SHR_CLI_EXIT(_SHR_E_PARAM, "Gold result file:'%s' cannot be obtained\n", gold_name); } if (!dbx_file_exists(local_filename)) { SHR_CLI_EXIT(_SHR_E_EMPTY, "Local file doens't exist\n"); } if (!dbx_file_exists(gold_filepath)) { SHR_CLI_EXIT(_SHR_E_EMPTY, "Gold file doesn't exist\n"); } if ((local_result = sal_fopen(local_filename, "r")) == NULL) { /* Could not open the file, usually means that path was illegal */ SHR_CLI_EXIT(_SHR_E_PARAM, "Local file to be compared:'%s' cannot be opened\n", local_filename); } if ((gold_result = sal_fopen(gold_filepath, "r")) == NULL) { /* Could not open the file, usually means that path was illegal */ LOG_INFO(BSL_LOG_MODULE, (BSL_META_U(unit, "Gold result file:'%s' cannot be opened\n"), gold_filepath)); SHR_CLI_EXIT(_SHR_E_NOT_FOUND, ""); } if (!ISEMPTY(filter_n)) { SHR_IF_ERR_EXIT(compare_filter_get_list(unit, filter_n, &token_list)); } while (NULL != sal_fgets(local_line, SH_SAND_MAX_TOKEN_SIZE - 1, local_result)) { i_line++; if (sal_fgets(gold_line, SH_SAND_MAX_TOKEN_SIZE - 1, gold_result) == NULL) { SHR_CLI_EXIT(_SHR_E_FAIL, "Current - %s:%d\n\t%sGold - - %s EOF\n", local_filename, i_line, local_line, gold_name); } if (sal_strcasecmp(local_line, gold_line)) { rhentry_t *token_entry; /* * Skip line with timestamp and command itself and token from token_list */ if ((sal_strcasestr(gold_line, "timestamp") != NULL) || (sal_strcasestr(local_line, "timestamp") != NULL)) continue; /* * Token from list should be present in both files in order to be able to skip the difference */ RHITERATOR(token_entry, token_list) { if ((sal_strcasestr(gold_line, RHNAME(token_entry)) != NULL) && (sal_strcasestr(local_line, RHNAME(token_entry)) != NULL)) break; } /* * If we have not reached the end of the list - line should be skipped, otherwise we have an error */ if (token_entry != NULL) continue; if (flags & SH_CMD_LOG) { LOG_CLI((BSL_META("Current - %s:%d\n\t%sGold - %s:%d\n\t%s"), local_filename, i_line, local_line, gold_name, i_line, gold_line)); } /* * We do not exit in order to show all error - but we may consider to do it to avoid log flooding */ SHR_SET_CURRENT_ERR(_SHR_E_FAIL); } } exit: if (local_result != NULL) dbx_file_close(local_result); if (gold_result != NULL) dbx_file_close(gold_result); SHR_FUNC_EXIT; } shr_error_e sh_sand_gold_exists( int unit, char *command) { char gold_filepath[RHFILE_MAX_SIZE]; char gold_name[SH_SAND_MAX_TOKEN_SIZE]; SHR_FUNC_INIT_VARS(unit); /* * Add test only if gold result exists */ /* * Generate file name */ sh_sand_gold_filename(command, gold_name); /* * Obtain gold path */ if (sh_sand_gold_path(unit, 0, gold_name, gold_filepath) != _SHR_E_NONE) { if (sh_sand_gold_path(unit, SH_CMD_CUSTOM_XML_VERIFY, gold_name, gold_filepath) != _SHR_E_NONE) { SHR_CLI_EXIT(_SHR_E_PARAM, "Gold result file:'%s' cannot be obtained\n", gold_name); } } /* * Check existence and leave peacefully if there is no gold */ if (!dbx_file_exists(gold_filepath)) { SHR_CLI_EXIT(_SHR_E_NOT_FOUND, ""); } exit: SHR_FUNC_EXIT; } static sh_sand_man_t compare_man = { .brief = "Compare XML file with its golden analog", .examples = "list=simple" }; static sh_sand_option_t compare_arguments[] = { {"list", SAL_FIELD_TYPE_STR, "Filter list name from XML file", ""}, {"filename", SAL_FIELD_TYPE_STR, "File name to compare", "", NULL, NULL, SH_SAND_ARG_QUIET}, {NULL} }; static shr_error_e compare_cmd( int unit, args_t * args, sh_sand_control_t * sand_control) { char *filename; char *filter_n; int in_flag, flags = 0; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_STR("fil", filename); SH_SAND_GET_STR("list", filter_n); SH_SAND_GET_BOOL("logger", in_flag); if (in_flag == TRUE) flags |= SH_CMD_LOG; /* * In this case local filename and gold to compare to are equal */ SHR_CLI_EXIT_IF_ERR(sh_sand_gold_compare(unit, filename, filename, filter_n, flags), ""); exit: SHR_FUNC_EXIT; } static shr_error_e custom_compare_cmd( int unit, args_t * args, sh_sand_control_t * sand_control) { char *filename; char *filter_n; int in_flag, flags = 0; int rv = 0; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_STR("filename", filename); SH_SAND_GET_STR("list", filter_n); SH_SAND_GET_BOOL("logger", in_flag); if (ISEMPTY(filename)) { SHR_CLI_EXIT(_SHR_E_NONE, "No input file for comparison.\n"); } if (in_flag == TRUE) { flags |= SH_CMD_LOG; } flags |= SH_CMD_CUSTOM_XML_VERIFY; /* * In this case local filename and gold to compare to are equal */ rv = sh_sand_gold_compare(unit, filename, filename, filter_n, flags); if (rv) { SHR_CLI_EXIT(_SHR_E_FAIL, "Custom gold comparison fails.\n"); } exit: SHR_FUNC_EXIT; } static sh_sand_man_t delete_man = { .brief = "Compare XML file with its golden analog", .examples = "file=1234.xml" }; static shr_error_e delete_cmd( int unit, args_t * args, sh_sand_control_t * sand_control) { char *filename; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_STR("file", filename); if (ISEMPTY(filename)) { SHR_CLI_EXIT(_SHR_E_PARAM, "No input file for deletion\n"); } SHR_CLI_EXIT_IF_ERR(dbx_file_remove(filename), ""); exit: SHR_FUNC_EXIT; } #endif static sh_sand_man_t resource_man = { .brief = "Show all keywords", .full = "Print keywords, their plural forms and shortcuts, filtered by options", .synopsis = NULL, /* synopsis will be autogenerated */ .examples = "name=size\n" "name=LIF count=1-4 full\n" "path=\"dbal table\" full", }; static sh_sand_option_t resource_arguments[] = { {"name", SAL_FIELD_TYPE_STR, "String or substring to filter keywords upon", ""}, {"path", SAL_FIELD_TYPE_STR, "String or substring to filter command path", ""}, {"count", SAL_FIELD_TYPE_INT32, "Filter according the number of appearances", "-1"}, {"full", SAL_FIELD_TYPE_BOOL, "Show commands requested this keyword", "NO"}, {"all", SAL_FIELD_TYPE_BOOL, "Print all keywords", "no", NULL, NULL, SH_SAND_ARG_QUIET}, {NULL} }; static shr_error_e resource_cmd( int unit, args_t * args, sh_sand_control_t * sand_control) { char *match_n, *path_n; int all_flag; int i_key; int full_flag; int keyword_count = 0; int count_low, count_high; rhentry_t *cmd_entry; PRT_INIT_VARS; SHR_FUNC_INIT_VARS(unit); PRT_TITLE_SET("Registered Keywords"); /* * Prepare header, pay attention to put header items and content in the same order */ SH_SAND_GET_BOOL("all", all_flag); SH_SAND_GET_BOOL("full", full_flag); SH_SAND_GET_STR("name", match_n); SH_SAND_GET_STR("path", path_n); SH_SAND_GET_INT32_RANGE("count", count_low, count_high); PRT_COLUMN_ADD("Keyword"); PRT_COLUMN_ADD("Shortcut"); PRT_COLUMN_ADD("Count"); if (full_flag == TRUE) { PRT_COLUMN_ADD("Command"); } if (ISEMPTY(match_n) && ISEMPTY(path_n) && all_flag == FALSE) { SHR_CLI_EXIT(_SHR_E_PARAM, "Please specify filtering criteria or use \"all\" to show all keywords\n"); } for (i_key = 0; sh_sand_keywords[i_key].keyword != NULL; i_key++) { if ((all_flag != TRUE) && (sal_strcasestr(sh_sand_keywords[i_key].keyword, match_n) == NULL)) continue; if (!ISEMPTY(path_n)) { RHITERATOR(cmd_entry, sh_sand_keywords[i_key].cmd_list[unit]) { if (sal_strcasestr(RHNAME(cmd_entry), path_n) != NULL) break; } /** Check if at least one command matched the criteria */ if (cmd_entry == NULL) continue; } if ((count_low != -1) && ((sh_sand_keywords[i_key].count < count_low) || (sh_sand_keywords[i_key].count > count_high))) continue; PRT_ROW_ADD(PRT_ROW_SEP_NONE); PRT_CELL_SET("%s", sh_sand_keywords[i_key].keyword); PRT_CELL_SET("%s", sh_sand_keywords[i_key].short_key); PRT_CELL_SET("%d", sh_sand_keywords[i_key].count); keyword_count++; if (full_flag == FALSE) { sh_sand_keyword_var_t *keyword_var; RHITERATOR(keyword_var, sh_sand_keywords[i_key].var_list[unit]) { PRT_ROW_ADD(PRT_ROW_SEP_NONE); PRT_CELL_SET_SHIFT(1, "%s", RHNAME(keyword_var)); PRT_CELL_SET("%s", keyword_var->short_key); } } else { int first = TRUE; RHITERATOR(cmd_entry, sh_sand_keywords[i_key].cmd_list[unit]) { if (!ISEMPTY(path_n) && (sal_strcasestr(RHNAME(cmd_entry), path_n) == NULL)) continue; if (first == TRUE) { first = FALSE; } else { PRT_ROW_ADD(PRT_ROW_SEP_NONE); PRT_CELL_SKIP(3); } PRT_CELL_SET("%s", RHNAME(cmd_entry)); } } } PRT_INFO_ADD("%d keywords in the list", keyword_count); PRT_INFO_SET_MODE(PRT_ROW_SEP_UNDERSCORE_BEFORE); PRT_COMMITX; exit: PRT_FREE; SHR_FUNC_EXIT; } sh_sand_man_t sh_sand_shell_man = { .brief = "Shell management commands", }; sh_sand_cmd_t sh_sand_shell_cmds[] = { #ifndef NO_FILEIO {"compare", compare_cmd, NULL, compare_arguments, &compare_man, NULL, NULL, SH_CMD_SKIP_EXEC} , {"custom", custom_compare_cmd, NULL, compare_arguments, &compare_man, NULL, NULL, SH_CMD_NO_XML_VERIFY} , {"delete", delete_cmd, NULL, NULL, &delete_man, NULL, NULL, SH_CMD_SKIP_EXEC} , #endif {"resource", resource_cmd, NULL, resource_arguments, &resource_man} , {NULL} };
26.495495
134
0.559878
[ "mesh" ]
2a7b77f8b4f0944f19f49501ae325dff811bdd00
4,065
h
C
engine/kotek.core.api/include/kotek_api.h
wh1t3lord/kotek
1e3eb61569974538661ad121ed8eb28c9e608ae6
[ "Apache-2.0" ]
null
null
null
engine/kotek.core.api/include/kotek_api.h
wh1t3lord/kotek
1e3eb61569974538661ad121ed8eb28c9e608ae6
[ "Apache-2.0" ]
null
null
null
engine/kotek.core.api/include/kotek_api.h
wh1t3lord/kotek
1e3eb61569974538661ad121ed8eb28c9e608ae6
[ "Apache-2.0" ]
null
null
null
#pragma once #include "kotek_api_resource_manager.h" #include "kotek_sdk_ui_element.h" namespace Kotek { namespace Core { class ktkMainManager; class ktkIRenderDevice; class ktkIRenderSwapchain; class ktkIRenderGraph; class kotek_i_render_imgui; class ktkIRenderResourceManager; class kotek_i_renderer; class ktkProfiler; class ktkConsole; } // namespace Core namespace Engine { class ktkWindow; } namespace ktk { class string; } } // namespace Kotek struct GLFWwindow; namespace Kotek { namespace Core { class ktkIRenderDevice { public: virtual ~ktkIRenderDevice(void) {} virtual void Initialize(Core::ktkMainManager& main_manager) = 0; virtual void Shutdown(void) = 0; virtual void Resize(ktkIRenderSwapchain* p_raw_swapchain, kotek_i_renderer* p_raw_renderer, ktkIRenderResourceManager* p_raw_resource_manager, int width, int height) = 0; virtual int GetWidth(void) const noexcept = 0; virtual int GetHeight(void) const noexcept = 0; virtual void GPUFlush(void) = 0; }; class ktkIRenderSwapchain { public: virtual ~ktkIRenderSwapchain(void) {} virtual void Initialize(ktkIRenderDevice* p_render_device) = 0; virtual void Shutdown(ktkIRenderDevice* p_render_device) = 0; virtual void Resize( ktkIRenderDevice* p_render_device, int width, int height) = 0; }; class ktkIRenderResourceManager { public: virtual ~ktkIRenderResourceManager(void) {} // TODO: change signature on void virtual void initialize(ktkIRenderDevice* p_raw_device, ktkIRenderSwapchain* p_raw_swapchain) = 0; // TODO: change signature on void virtual void shutdown(ktkIRenderDevice* p_raw_device) = 0; virtual void Resize(ktkIRenderDevice* p_raw_device, ktkIRenderSwapchain* p_raw_swapchain) = 0; }; class kotek_i_render_imgui { public: virtual ~kotek_i_render_imgui(void) {} // TODO: change signature on void virtual void initialize(ktkMainManager& main_manager) noexcept = 0; // TODO: change signature on void virtual void shutdown(ktkIRenderDevice* p_raw_device) noexcept = 0; }; class ktkIRenderGraph { public: virtual ~ktkIRenderGraph(void) {} virtual void Initialize(void) = 0; virtual void Shutdown(void) = 0; }; class kotek_i_renderer { public: virtual ~kotek_i_renderer(void) {} virtual void draw(void) = 0; virtual void Shutdown(void) = 0; virtual void Resize(void) = 0; virtual ktk::string GetName(void) const noexcept = 0; }; class ktkIConsole { public: virtual ~ktkIConsole(void) {} virtual void Initialize(void) = 0; virtual void Shutdown(void) = 0; }; class ktkIFileSystem { public: virtual ~ktkIFileSystem(void) {} virtual void Initialize(void) = 0; virtual void Shutdown(void) = 0; }; class ktkIInput { public: virtual ~ktkIInput(void) {} virtual void Initialize(void) = 0; virtual void Shutdown(void) = 0; }; class ktkIGameManager { public: virtual ~ktkIGameManager(void) {} virtual void Initialize( Kotek::Core::ktkMainManager* p_main_manager) = 0; virtual void Shutdown( Kotek::Core::ktkMainManager* p_main_manager) = 0; virtual kotek_i_renderer* GetRenderer(void) const noexcept = 0; virtual void* GetWindowHandle(void) const noexcept = 0; virtual ktkProfiler* GetProfiler(void) const noexcept = 0; virtual int GetWindowWidth(void) const noexcept = 0; virtual int GetWindowHeight(void) const noexcept = 0; virtual ktkConsole* GetConsole(void) const noexcept = 0; // @ returns USER render resource manager it's not kotek virtual void* GetRenderResourceManager(void) const noexcept = 0; virtual void* CreateSurface(ktkMainManager* p_main_manager, void* p_instance, const void* p_callbacks) = 0; }; bool InitializeModule_Core_API(ktkMainManager*); bool ShutdownModule_Core_API(ktkMainManager*); bool SerializeModule_Core_API(ktkMainManager*); bool DeserializeModule_Core_API(ktkMainManager*); } // namespace Core } // namespace Kotek
23.911765
70
0.723493
[ "render" ]
2a7d5deee61ce676442a08eb611f3e7ea2cce8dc
670
h
C
Dynamic Programming/counting-bits.h
apricot2012/Leetcode-Practice
3cfdf21a5dba3f3dd0c0722825a14bdebcb70e2c
[ "MIT" ]
null
null
null
Dynamic Programming/counting-bits.h
apricot2012/Leetcode-Practice
3cfdf21a5dba3f3dd0c0722825a14bdebcb70e2c
[ "MIT" ]
null
null
null
Dynamic Programming/counting-bits.h
apricot2012/Leetcode-Practice
3cfdf21a5dba3f3dd0c0722825a14bdebcb70e2c
[ "MIT" ]
null
null
null
// // Created by GHT on 1/14/2021. // #ifndef DYNAMIC_PROGRAMMING_COUNTING_BITS_H #define DYNAMIC_PROGRAMMING_COUNTING_BITS_H #include <iostream> #include <cstring> #include <vector> using namespace std; class Solution { public: vector<int> countBits(int num) { vector<int> dp; if(num == 0){ dp.push_back(0); return dp; } dp.push_back(0); dp.push_back(1); int mult = 2; for(int i = 2; i <= num; i++) { if(i == mult * 2) mult*=2; dp.push_back(dp[i - mult] + 1); } return dp; } }; #endif //DYNAMIC_PROGRAMMING_COUNTING_BITS_H
20.9375
44
0.547761
[ "vector" ]
2a8415e8705301301d173808a2e0db18b21e6071
2,171
h
C
content/common/possibly_associated_interface_ptr_info.h
zipated/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
content/common/possibly_associated_interface_ptr_info.h
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
content/common/possibly_associated_interface_ptr_info.h
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
// Copyright 2017 The Chromium 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 CONTENT_COMMON_POSSIBLY_ASSOCIATED_INTERFACE_PTR_INFO_H_ #define CONTENT_COMMON_POSSIBLY_ASSOCIATED_INTERFACE_PTR_INFO_H_ #include "base/macros.h" #include "mojo/public/cpp/bindings/associated_interface_ptr_info.h" #include "mojo/public/cpp/bindings/interface_ptr_info.h" namespace content { // PossiblyAssociatedInterfacePtrInfo<T> contains mojo::InterfacePtrInfo<T> or // mojo::AssociatedInterfacePtrInfo<T>, but not both. Mojo-related functions in // mojo::InterfacePtrInfo<T> and mojo::AssociatedInterfacePtrInfo<T> are not // accessible, but a user can Bind this object into a // PossiblyAssociatedInterfacePtr. template <typename T> class PossiblyAssociatedInterfacePtrInfo final { public: PossiblyAssociatedInterfacePtrInfo() {} PossiblyAssociatedInterfacePtrInfo(std::nullptr_t) {} PossiblyAssociatedInterfacePtrInfo( mojo::InterfacePtrInfo<T> independent_ptr_info) : independent_ptr_info_(std::move(independent_ptr_info)) {} PossiblyAssociatedInterfacePtrInfo( mojo::AssociatedInterfacePtrInfo<T> associated_ptr_info) : associated_ptr_info_(std::move(associated_ptr_info)) {} PossiblyAssociatedInterfacePtrInfo( PossiblyAssociatedInterfacePtrInfo&& other) = default; ~PossiblyAssociatedInterfacePtrInfo() {} PossiblyAssociatedInterfacePtrInfo& operator=( PossiblyAssociatedInterfacePtrInfo&& other) = default; mojo::InterfacePtrInfo<T> TakeIndependentPtrInfo() { return std::move(independent_ptr_info_); } mojo::AssociatedInterfacePtrInfo<T> TakeAssociatedPtrInfo() { return std::move(associated_ptr_info_); } explicit operator bool() const { return independent_ptr_info_.is_valid() || associated_ptr_info_.is_valid(); } private: mojo::InterfacePtrInfo<T> independent_ptr_info_; mojo::AssociatedInterfacePtrInfo<T> associated_ptr_info_; DISALLOW_COPY_AND_ASSIGN(PossiblyAssociatedInterfacePtrInfo); }; } // namespace content #endif // CONTENT_COMMON_POSSIBLY_ASSOCIATED_INTERFACE_PTR_INFO_H_
36.183333
79
0.799171
[ "object" ]
2a9009c103d0193c8c4e70a5ba548ebe5e92f33f
1,651
h
C
src/class/renderables/obj/Player.h
harryprabowo/engifarm-destructor
8d57107fa819da7ba6986bbeaec02ba760a994d8
[ "BSD-3-Clause" ]
null
null
null
src/class/renderables/obj/Player.h
harryprabowo/engifarm-destructor
8d57107fa819da7ba6986bbeaec02ba760a994d8
[ "BSD-3-Clause" ]
null
null
null
src/class/renderables/obj/Player.h
harryprabowo/engifarm-destructor
8d57107fa819da7ba6986bbeaec02ba760a994d8
[ "BSD-3-Clause" ]
null
null
null
#ifndef PLAYER_H #define PLAYER_H #include <string> #include <vector> #include "Cell.h" #include "FarmAnimal.h" #include "../../Product/Product.h" #include "../../map/Map.h" #include "../../Product/FarmProduct.h" #include "../../Product/SideProduct.h" #include "cell/Facility.h" #include "cell/Land.h" #include "cell/land/Grassland.h" #include "cell/land/Coop.h" #include "cell/land/Barn.h" #include "cell/facility/Mixer.h" #include "cell/facility/Truck.h" #include "cell/facility/Well.h" using namespace std; class Player : public Renderables { public: /* Constructor */ Player(Map *m); // call map constructor as well /* Destructor */ virtual ~Player(); /* Getters */ int getBottle(); int getTick(); double getMoney(); Cell* getLocation(); vector<Product*> getInventory(); Map* getMap(); /* Setters */ void setBottle(int); /* Methods concerning processTick() */ void move(int, int); void moveUp(); void moveDown(); void moveLeft(); void moveRight(); void talk(); // talk to animal void mix(string,string); void interact(Facility&); void interact(FarmAnimal); void kill(); void grow(); /* Other methods */ void printInventory(); private: Map *map; // permanent(?) reference to map int tick; // menghitung jumlah aksi yang dilalui int bottle; double money; Cell *location; vector<Product*> inventory; void processTick(); FarmProduct* searchInInvent(string p); int searchInInventPos(string p); /* dipanggil setiap aksi : - move - talk - mix - interact - kill - grow mengatur penambahan tick, pergerakan random farm animal, dan juga mengecek kondisi berakhirnya game. */ }; #endif
19.423529
58
0.687462
[ "vector" ]
2a916a347232a1019761d47eead93d0ed3f9e712
48,895
c
C
engine/menu.c
solemnwarning/KatanaEngine
9234d380b6f805f767d2afdf8246e53d1b6f1576
[ "BSD-3-Clause" ]
1
2021-05-05T00:19:02.000Z
2021-05-05T00:19:02.000Z
engine/menu.c
solemnwarning/KatanaEngine
9234d380b6f805f767d2afdf8246e53d1b6f1576
[ "BSD-3-Clause" ]
null
null
null
engine/menu.c
solemnwarning/KatanaEngine
9234d380b6f805f767d2afdf8246e53d1b6f1576
[ "BSD-3-Clause" ]
1
2021-06-03T11:23:43.000Z
2021-06-03T11:23:43.000Z
/* Copyright (C) 1996-2001 Id Software, Inc. Copyright (C) 2002-2009 John Fitzgibbons and others Copyright (C) 2011-2016 OldTimes Software 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 "engine_base.h" #include "video.h" #include "EngineGame.h" #include "EngineMenu.h" #define MENU_MAINITEMS 5 // Main Menu # define MENU_NEWITEMS 4 // New Game # define MENU_OPTIONSITEMS 6 // Options #define MENU_MAIN 1 // Main Menu # define MENU_NEW 2 // New Game # define MENU_LOAD 3 // Load Game # define MENU_OPTIONS 5 // Options # define MENU_OPTIONS_SOUND 0 // Sound Volume # define MENU_OPTIONS_CD 1 // CD Volume # define MENU_OPTIONS_CONTROL 2 // Customize Control # define MENU_OPTIONS_MOUSE 3 // Mouse Config # define MENU_OPTIONS_VIDEO 4 // Video Mode # define MENU_OPTIONS_MISC 5 // Misc Settings # define MENU_OPTIONS_MISC_SCREEN 0 // Screen Size # define MENU_OPTIONS_MISC_BRIGHTNESS 1 // Brightness # define MENU_OPTIONS_MISC_RUN 2 // Always Run # define MENU_OPTIONS_MISC_LOOKSPRING 3 // Lookspring # define MENU_OPTIONS_MISC_LOOKSTRAFE 4 // Lookstrafe # define MENU_QUIT 6 // Quit #define MENU_SLIDERRANGE 10 void (*vid_menucmdfn)(void); //johnfitz void (*vid_menudrawfn)(void); void (*vid_menukeyfn)(int key); enum { m_none, m_main, m_singleplayer, m_load, m_save, m_multiplayer, m_setup, m_net, m_options, m_video, m_keys, m_help, m_quit, m_serialconfig, m_modemconfig, m_lanconfig, m_gameoptions, m_search, m_slist } m_state; void M_Menu_Main_f (void); void M_Menu_SinglePlayer_f (void); void M_Menu_Load_f (void); void M_Menu_Save_f (void); void M_Menu_MultiPlayer_f (void); void M_Menu_Setup_f (void); void M_Menu_Net_f (void); void M_Menu_LanConfig_f (void); void M_Menu_SerialConfig_f (void); void M_Menu_ModemConfig_f (void); void M_Menu_GameOptions_f (void); void M_Menu_Search_f (void); void M_Menu_ServerList_f (void); void M_Menu_Keys_f (void); void M_Menu_Video_f (void); void M_Menu_Help_f (void); void M_Menu_Quit_f (void); void M_Main_Draw (void); void M_SinglePlayer_Draw (void); void M_Save_Draw (void); void M_MultiPlayer_Draw (void); void M_Setup_Draw (void); void M_Net_Draw (void); void M_SerialConfig_Draw (void); void M_ModemConfig_Draw (void); void M_LanConfig_Draw (void); void M_GameOptions_Draw (void); void M_Keys_Draw (void); void M_Video_Draw (void); void M_Help_Draw (void); void M_Main_Key (int key); void M_SinglePlayer_Key (int key); void M_Load_Key (int key); void M_Save_Key (int key); void M_MultiPlayer_Key (int key); void M_Setup_Key (int key); void M_Net_Key (int key); void M_SerialConfig_Key (int key); void M_ModemConfig_Key (int key); void M_LanConfig_Key (int key); void M_GameOptions_Key (int key); void M_ServerList_Key (int key); void M_Options_Key (int key); void M_Keys_Key (int key); void M_Video_Key (int key); void M_Help_Key (int key); void M_Quit_Key (int key); bool m_entersound; // play after drawing a frame, so caching // won't disrupt the sound bool m_recursiveDraw; int m_return_state; bool m_return_onerror; char m_return_reason [32]; #define StartingGame (m_multiplayer_cursor == 1) #define JoiningGame (m_multiplayer_cursor == 0) #define SerialConfig (m_net_cursor == 0) #define DirectConfig (m_net_cursor == 1) #define IPXConfig (m_net_cursor == 2) #define TCPIPConfig (m_net_cursor == 3) void M_ConfigureNetSubsystem(void); /* Draws one solid graphics character */ void M_DrawCharacter (int cx, int line, int num) { } void M_Print (int cx, int cy, char *str) { } void M_PrintWhite (int cx, int cy, char *str) { } void M_DrawTransPic (int x, int y, qpic_t *pic) { } void M_DrawPic (int x, int y, qpic_t *pic) { } void M_DrawTextBox (int x, int y, int width, int lines) { } void M_AdjustSliders(int menu,int optionnum,int dir) { } void M_DrawIcons(int menu,int optionnum) { } int m_save_demonum; void M_ToggleMenu_f (void) { } //============================================================================= /* MAIN MENU */ int m_main_cursor; void M_Menu_Main_f (void) { } void M_Main_Draw (void) { } void M_Main_Key (int key) { switch (key) { case K_ESCAPE: S_LocalSound(MENU_ESCAPE); key_dest = key_game; m_state = m_none; cls.demonum = m_save_demonum; if (cls.demonum != -1 && !cls.demoplayback && cls.state != ca_connected) CL_NextDemo (); break; case K_LEFTARROW: S_LocalSound (MENU_SELECT); if (++m_main_cursor >= MENU_MAINITEMS) m_main_cursor = 0; break; case K_RIGHTARROW: S_LocalSound (MENU_SELECT); if (--m_main_cursor < 0) m_main_cursor = MENU_MAINITEMS - 1; break; case INPUT_KEY_ENTER: m_entersound = TRUE; switch (m_main_cursor) { case 0: M_Menu_SinglePlayer_f(); break; case 1: M_Menu_Load_f(); break; case 2: M_Menu_MultiPlayer_f(); break; case 3: break; case 4: M_Menu_Quit_f(); break; } } } int m_singleplayer_cursor; void M_Menu_SinglePlayer_f (void) { key_dest = key_menu; m_state = m_singleplayer; m_entersound = TRUE; } void M_SinglePlayer_Draw (void) { M_DrawIcons(MENU_NEW,m_singleplayer_cursor); } void M_SinglePlayer_Key (int key) { switch (key) { case K_ESCAPE: M_Menu_Main_f (); break; case K_LEFTARROW: S_LocalSound (MENU_SELECT); if (++m_singleplayer_cursor >= MENU_NEWITEMS) m_singleplayer_cursor = 0; break; case K_RIGHTARROW: S_LocalSound (MENU_SELECT); if (--m_singleplayer_cursor < 0) m_singleplayer_cursor = MENU_NEWITEMS - 1; break; case INPUT_KEY_ENTER: m_entersound = TRUE; switch (m_singleplayer_cursor) { case 0: if (sv.active) if (!SCR_ModalMessage("Are you sure you want to\nstart a new game?\n", 0.0f)) break; key_dest = key_game; if (sv.active) Cbuf_AddText ("disconnect\n"); Cbuf_AddText ("maxplayers 1\n"); Cbuf_AddText ("deathmatch 0\n"); //johnfitz Cbuf_AddText ("coop 0\n"); //johnfitz Cbuf_AddText ("map e1m1\n"); break; case 1: if (sv.active) if (!SCR_ModalMessage("Are you sure you want to\nstart a new game?\n", 0.0f)) break; key_dest = key_game; if (sv.active) Cbuf_AddText ("disconnect\n"); Cbuf_AddText ("maxplayers 1\n"); Cbuf_AddText ("deathmatch 0\n"); //johnfitz Cbuf_AddText ("coop 0\n"); //johnfitz Cbuf_AddText ("map e2m1\n"); break; case 2: if (sv.active) if (!SCR_ModalMessage("Are you sure you want to\nstart a new game?\n", 0.0f)) break; key_dest = key_game; if (sv.active) Cbuf_AddText ("disconnect\n"); Cbuf_AddText ("maxplayers 1\n"); Cbuf_AddText ("deathmatch 0\n"); //johnfitz Cbuf_AddText ("coop 0\n"); //johnfitz Cbuf_AddText ("map e3m1\n"); break; case 3: if (sv.active) if (!SCR_ModalMessage("Are you sure you want to\nstart a new game?\n", 0.0f)) break; key_dest = key_game; if (sv.active) Cbuf_AddText ("disconnect\n"); Cbuf_AddText ("maxplayers 1\n"); Cbuf_AddText ("deathmatch 0\n"); //johnfitz Cbuf_AddText ("coop 0\n"); //johnfitz Cbuf_AddText ("map e4m1\n"); break; } } } //============================================================================= /* LOAD/SAVE MENU */ int load_cursor; // 0 < load_cursor < MAX_SAVEGAMES #define MAX_SAVEGAMES 20 //johnfitz -- increased from 12 char m_filenames[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH+1]; int loadable[MAX_SAVEGAMES]; void M_ScanSaves (void) { #if 0 int i,j,version; char name[PLATFORM_MAX_PATH]; FILE *f; for (i=0 ; i<MAX_SAVEGAMES ; i++) { strcpy(m_filenames[i],"--- UNUSED SLOT ---"); loadable[i] = false; sprintf(name,"%s/s%i.sav", com_gamedir, i); f = fopen (name, "r"); if(!f) continue; fscanf(f,"%i\n",&version); fscanf(f,"%79s\n",name); strncpy(m_filenames[i], name, sizeof(m_filenames[i]) - 1); // Change _ back to space. for(j = 0; j < SAVEGAME_COMMENT_LENGTH; j++) if(m_filenames[i][j] == '_') m_filenames[i][j] = ' '; loadable[i] = true; fclose (f); } #endif } void M_Menu_Load_f (void) { m_entersound = true; m_state = m_load; key_dest = key_menu; M_ScanSaves(); } void M_Menu_Save_f (void) { if(!sv.active || cl.intermission || svs.maxclients != 1) return; m_entersound = true; m_state = m_save; key_dest = key_menu; M_ScanSaves(); } void M_Save_Draw (void) { int i; qpic_t *p; p = Draw_CachePic ("gfx/p_save.lmp"); M_DrawPic ( (320-p->width)/2, 4, p); for (i=0 ; i<MAX_SAVEGAMES ; i++) M_Print (16, 32 + 8*i, m_filenames[i]); // line cursor M_DrawCharacter (8, 32 + load_cursor*8, 12+((int)(realtime*4)&1)); } void M_Load_Key(int k) { switch(k) { case K_ESCAPE: M_Menu_SinglePlayer_f (); break; case INPUT_KEY_ENTER: S_LocalSound ("misc/menu2.wav"); if (!loadable[load_cursor]) return; m_state = m_none; key_dest = key_game; // Host_Loadgame_f can't bring up the loading plaque because too much // stack space has been used, so do it now SCR_BeginLoadingPlaque (); // issue the load command Cbuf_AddText (va ("load s%i\n", load_cursor) ); return; case K_UPARROW: case K_LEFTARROW: S_LocalSound ("misc/menu1.wav"); load_cursor--; if (load_cursor < 0) load_cursor = MAX_SAVEGAMES-1; break; case K_DOWNARROW: case K_RIGHTARROW: S_LocalSound ("misc/menu1.wav"); load_cursor++; if (load_cursor >= MAX_SAVEGAMES) load_cursor = 0; break; } } void M_Save_Key (int k) { switch (k) { case K_ESCAPE: M_Menu_SinglePlayer_f (); break; case INPUT_KEY_ENTER: m_state = m_none; key_dest = key_game; Cbuf_AddText (va("save s%i\n", load_cursor)); return; case K_UPARROW: case K_LEFTARROW: S_LocalSound ("misc/menu1.wav"); load_cursor--; if (load_cursor < 0) load_cursor = MAX_SAVEGAMES-1; break; case K_DOWNARROW: case K_RIGHTARROW: S_LocalSound ("misc/menu1.wav"); load_cursor++; if (load_cursor >= MAX_SAVEGAMES) load_cursor = 0; break; } } //============================================================================= /* MULTIPLAYER MENU */ int m_multiplayer_cursor; #define MULTIPLAYER_ITEMS 3 void M_Menu_MultiPlayer_f (void) { key_dest = key_menu; m_state = m_multiplayer; m_entersound = TRUE; } void M_MultiPlayer_Draw (void) { int f; qpic_t *p; M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); p = Draw_CachePic ("gfx/p_multi.lmp"); M_DrawPic ( (320-p->width)/2, 4, p); M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mp_menu.lmp") ); f = (int)(realtime * 10)%6; //johnfitz -- was host_time M_DrawTransPic (54, 32 + m_multiplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) ); if (serialAvailable || tcpipAvailable) return; M_PrintWhite ((320/2) - ((27*8)/2), 148, "No Communications Available"); } void M_MultiPlayer_Key (int key) { switch (key) { case K_ESCAPE: M_Menu_Main_f (); break; case K_DOWNARROW: S_LocalSound ("misc/menu1.wav"); if (++m_multiplayer_cursor >= MULTIPLAYER_ITEMS) m_multiplayer_cursor = 0; break; case K_UPARROW: S_LocalSound ("misc/menu1.wav"); if (--m_multiplayer_cursor < 0) m_multiplayer_cursor = MULTIPLAYER_ITEMS - 1; break; case INPUT_KEY_ENTER: m_entersound = TRUE; switch (m_multiplayer_cursor) { case 0: if (serialAvailable || tcpipAvailable) M_Menu_Net_f (); break; case 1: if (serialAvailable || tcpipAvailable) M_Menu_Net_f (); break; case 2: M_Menu_Setup_f (); break; } } } //============================================================================= /* SETUP MENU */ int setup_cursor = 4; int setup_cursor_table[] = {40, 56, 80, 104, 140}; char setup_hostname[16]; char setup_myname[16]; int setup_oldtop; int setup_oldbottom; int setup_top; int setup_bottom; #define NUM_SETUP_CMDS 5 void M_Menu_Setup_f (void) { key_dest = key_menu; m_state = m_setup; m_entersound = TRUE; strcpy(setup_myname, cl_name.string); strcpy(setup_hostname, hostname.string); setup_top = setup_oldtop = ((int)cl_color.value) >> 4; setup_bottom = setup_oldbottom = ((int)cl_color.value) & 15; } void M_Setup_Draw (void) { qpic_t *p; M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); p = Draw_CachePic ("gfx/p_multi.lmp"); M_DrawPic ( (320-p->width)/2, 4, p); M_Print (64, 40, "Hostname"); M_DrawTextBox (160, 32, 16, 1); M_Print (168, 40, setup_hostname); M_Print (64, 56, "Your name"); M_DrawTextBox (160, 48, 16, 1); M_Print (168, 56, setup_myname); M_DrawTextBox (64, 140-8, 14, 1); M_Print (72, 140, "Accept Changes"); p = Draw_CachePic ("gfx/bigbox.lmp"); M_DrawTransPic (160, 64, p); p = Draw_CachePic ("gfx/menuplyr.lmp"); M_DrawCharacter (56, setup_cursor_table [setup_cursor], 12+((int)(realtime*4)&1)); if (setup_cursor == 0) M_DrawCharacter (168 + 8*strlen(setup_hostname), setup_cursor_table [setup_cursor], 10+((int)(realtime*4)&1)); if (setup_cursor == 1) M_DrawCharacter (168 + 8*strlen(setup_myname), setup_cursor_table [setup_cursor], 10+((int)(realtime*4)&1)); } void M_Setup_Key (int k) { int l; switch (k) { case K_ESCAPE: M_Menu_MultiPlayer_f (); break; case K_UPARROW: S_LocalSound ("misc/menu1.wav"); setup_cursor--; if (setup_cursor < 0) setup_cursor = NUM_SETUP_CMDS-1; break; case K_DOWNARROW: S_LocalSound ("misc/menu1.wav"); setup_cursor++; if (setup_cursor >= NUM_SETUP_CMDS) setup_cursor = 0; break; case K_LEFTARROW: if (setup_cursor < 2) return; S_LocalSound ("misc/menu3.wav"); if (setup_cursor == 2) setup_top = setup_top - 1; if (setup_cursor == 3) setup_bottom = setup_bottom - 1; break; case K_RIGHTARROW: if (setup_cursor < 2) return; forward: S_LocalSound ("misc/menu3.wav"); if (setup_cursor == 2) setup_top = setup_top + 1; if (setup_cursor == 3) setup_bottom = setup_bottom + 1; break; case INPUT_KEY_ENTER: if (setup_cursor == 0 || setup_cursor == 1) return; if (setup_cursor == 2 || setup_cursor == 3) goto forward; // setup_cursor == 4 (OK) if (strcmp(cl_name.string, setup_myname) != 0) Cbuf_AddText ( va ("name \"%s\"\n", setup_myname) ); if (strcmp(hostname.string, setup_hostname) != 0) Cvar_Set("hostname", setup_hostname); if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom) Cbuf_AddText( va ("color %i %i\n", setup_top, setup_bottom) ); m_entersound = TRUE; M_Menu_MultiPlayer_f (); break; case K_BACKSPACE: if (setup_cursor == 0) if(strlen(setup_hostname)) setup_hostname[strlen(setup_hostname)-1] = 0; if (setup_cursor == 1) if(strlen(setup_myname)) setup_myname[strlen(setup_myname)-1] = 0; break; default: if (k < 32 || k > 127) break; if (setup_cursor == 0) { l = strlen(setup_hostname); if (l < 15) { setup_hostname[l+1] = 0; setup_hostname[l] = k; } } if (setup_cursor == 1) { l = strlen(setup_myname); if (l < 15) { setup_myname[l+1] = 0; setup_myname[l] = k; } } } if (setup_top > 13) setup_top = 0; if (setup_top < 0) setup_top = 13; if (setup_bottom > 13) setup_bottom = 0; if (setup_bottom < 0) setup_bottom = 13; } //============================================================================= /* NET MENU */ int m_net_cursor; int m_net_items; int m_net_saveHeight; char *net_helpMessage [] = { /* .........1.........2.... */ " ", " Two computers connected", " through two modems. ", " ", " ", " Two computers connected", " by a null-modem cable. ", " ", " Novell network LANs ", " or Windows 95 DOS-box. ", " ", "(LAN=Local Area Network)", " Commonly used to play ", " over the Internet, but ", " also used on a Local ", " Area Network. " }; void M_Menu_Net_f (void) { key_dest = key_menu; m_state = m_net; m_entersound = TRUE; m_net_items = 4; if (m_net_cursor >= m_net_items) m_net_cursor = 0; m_net_cursor--; M_Net_Key (K_DOWNARROW); } void M_Net_Draw (void) { int f; qpic_t *p; M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); p = Draw_CachePic ("gfx/p_multi.lmp"); M_DrawPic ( (320-p->width)/2, 4, p); f = 32; if (serialAvailable) p = Draw_CachePic ("gfx/netmen1.lmp"); else { #ifdef _WIN32 p = NULL; #else p = Draw_CachePic ("gfx/dim_modm.lmp"); #endif } if (p) M_DrawTransPic (72, f, p); f += 19; if (serialAvailable) p = Draw_CachePic ("gfx/netmen2.lmp"); else { #ifdef _WIN32 p = NULL; #else p = Draw_CachePic ("gfx/dim_drct.lmp"); #endif } if (p) M_DrawTransPic (72, f, p); f += 19; p = Draw_CachePic ("gfx/dim_ipx.lmp"); M_DrawTransPic (72, f, p); f += 19; if (tcpipAvailable) p = Draw_CachePic ("gfx/netmen4.lmp"); else p = Draw_CachePic ("gfx/dim_tcp.lmp"); M_DrawTransPic (72, f, p); if (m_net_items == 5) // JDC, could just be removed { f += 19; p = Draw_CachePic ("gfx/netmen5.lmp"); M_DrawTransPic (72, f, p); } f = (320-26*8)/2; M_DrawTextBox (f, 134, 24, 4); f += 8; M_Print (f, 142, net_helpMessage[m_net_cursor*4+0]); M_Print (f, 150, net_helpMessage[m_net_cursor*4+1]); M_Print (f, 158, net_helpMessage[m_net_cursor*4+2]); M_Print (f, 166, net_helpMessage[m_net_cursor*4+3]); f = (int)(realtime * 10)%6; //johnfitz -- was host_time M_DrawTransPic (54, 32 + m_net_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) ); } void M_Net_Key (int k) { again: switch (k) { case K_ESCAPE: M_Menu_MultiPlayer_f (); break; case K_DOWNARROW: S_LocalSound ("misc/menu1.wav"); if (++m_net_cursor >= m_net_items) m_net_cursor = 0; break; case K_UPARROW: S_LocalSound ("misc/menu1.wav"); if (--m_net_cursor < 0) m_net_cursor = m_net_items - 1; break; case INPUT_KEY_ENTER: m_entersound = TRUE; switch (m_net_cursor) { case 0: M_Menu_SerialConfig_f (); break; case 1: M_Menu_SerialConfig_f (); break; case 2: M_Menu_LanConfig_f (); break; case 3: M_Menu_LanConfig_f (); break; case 4: // multiprotocol break; } } if (m_net_cursor == 0 && !serialAvailable) goto again; if (m_net_cursor == 1 && !serialAvailable) goto again; if (m_net_cursor == 3 && !tcpipAvailable) goto again; } int options_cursor; void M_Menu_Options_f (void) { key_dest = key_menu; m_state = m_options; m_entersound = true; } void M_Options_Key (int k) { switch(k) { case K_ESCAPE: M_Menu_Main_f (); break; case K_LEFTARROW: S_LocalSound(MENU_SELECT); if (++options_cursor >= MENU_OPTIONSITEMS) options_cursor = 0; break; case K_RIGHTARROW: S_LocalSound (MENU_SELECT); if (--options_cursor < 0) options_cursor = MENU_OPTIONSITEMS - 1; break; case K_UPARROW: M_AdjustSliders(MENU_OPTIONS,options_cursor,1); break; case K_DOWNARROW: M_AdjustSliders(MENU_OPTIONS,options_cursor,-1); break; } } //============================================================================= /* KEYS MENU */ char *bindnames[][2] = { {"+attack", "attack"}, {"impulse 10", "change weapon"}, {"+jump", "jump / swim up"}, {"+forward", "walk forward"}, {"+back", "backpedal"}, {"+left", "turn left"}, {"+right", "turn right"}, {"+speed", "run"}, {"+moveleft", "step left"}, {"+moveright", "step right"}, {"+strafe", "sidestep"}, {"+lookup", "look up"}, {"+lookdown", "look down"}, {"centerview", "center view"}, {"+mlook", "mouse look"}, {"+klook", "keyboard look"}, {"+moveup", "swim up"}, {"+movedown", "swim down"} }; #define NUMCOMMANDS (sizeof(bindnames)/sizeof(bindnames[0])) int keys_cursor; int bind_grab; void M_Menu_Keys_f (void) { key_dest = key_menu; m_state = m_keys; m_entersound = TRUE; } void M_FindKeysForCommand (char *command, int *twokeys) { int count; int j; int l; char *b; twokeys[0] = twokeys[1] = -1; l = strlen(command); count = 0; for(j = 0; j < 256; j++) { b = keybindings[j]; if(!b) continue; if(!strncmp(b, command, l)) { twokeys[count] = j; count++; if (count == 2) break; } } } void M_UnbindCommand (char *command) { int j; int l; char *b; l = strlen(command); for (j=0 ; j<256 ; j++) { b = keybindings[j]; if (!b) continue; if (!strncmp (b, command, l) ) Key_SetBinding (j, ""); } } void M_Keys_Draw (void) { #if 0 int i; int keys[2]; char *name; int x, y; qpic_t *p; p = Draw_CachePic ("gfx/ttl_cstm.lmp"); M_DrawPic ( (320-p->width)/2, 4, p); if (bind_grab) M_Print (12, 32, "Press a key or button for this action"); else M_Print (18, 32, "Enter to change, backspace to clear"); // search for known bindings for (i=0 ; i<NUMCOMMANDS ; i++) { y = 48 + 8*i; M_Print (16, y, bindnames[i][1]); l = Q_strlen(bindnames[i][0]); M_FindKeysForCommand (bindnames[i][0], keys); if (keys[0] == -1) M_Print (140, y, "???"); else { name = Key_KeynumToString (keys[0]); M_Print (140, y, name); x = Q_strlen(name) * 8; if (keys[1] != -1) { M_Print (140 + x + 8, y, "or"); M_Print (140 + x + 32, y, Key_KeynumToString (keys[1])); } } } if (bind_grab) M_DrawCharacter (130, 48 + keys_cursor*8, '='); else M_DrawCharacter (130, 48 + keys_cursor*8, 12+((int)(realtime*4)&1)); #endif } void M_Keys_Key (int k) { char cmd[80]; int keys[2]; if (bind_grab) { // defining a key S_LocalSound ("misc/menu1.wav"); if (k == K_ESCAPE) { bind_grab = FALSE; } else if (k != '`') { sprintf (cmd, "bind \"%s\" \"%s\"\n", Key_KeynumToString (k), bindnames[keys_cursor][0]); Cbuf_InsertText (cmd); } bind_grab = FALSE; return; } switch (k) { case K_ESCAPE: break; case K_LEFTARROW: case K_UPARROW: S_LocalSound ("misc/menu1.wav"); keys_cursor--; if (keys_cursor < 0) keys_cursor = NUMCOMMANDS-1; break; case K_DOWNARROW: case K_RIGHTARROW: S_LocalSound ("misc/menu1.wav"); keys_cursor++; if (keys_cursor >= NUMCOMMANDS) keys_cursor = 0; break; case INPUT_KEY_ENTER: // go into bind mode M_FindKeysForCommand (bindnames[keys_cursor][0], keys); S_LocalSound ("misc/menu2.wav"); if (keys[1] != -1) M_UnbindCommand (bindnames[keys_cursor][0]); bind_grab = TRUE; break; case K_BACKSPACE: // delete bindings case K_DEL: // delete bindings S_LocalSound ("misc/menu2.wav"); M_UnbindCommand (bindnames[keys_cursor][0]); break; } } //============================================================================= /* VIDEO MENU */ void M_Menu_Video_f (void) { (*vid_menucmdfn) (); //johnfitz } void M_Video_Draw (void) { (*vid_menudrawfn) (); } void M_Video_Key (int key) { (*vid_menukeyfn) (key); } //============================================================================= /* HELP MENU */ int help_page; #define NUM_HELP_PAGES 6 void M_Menu_Help_f (void) { key_dest = key_menu; m_state = m_help; m_entersound = TRUE; help_page = 0; } void M_Help_Draw (void) { M_DrawPic (0, 0, Draw_CachePic ( va("gfx/help%i.lmp", help_page)) ); } void M_Help_Key (int key) { switch (key) { case K_ESCAPE: M_Menu_Main_f (); break; case K_UPARROW: case K_RIGHTARROW: m_entersound = TRUE; if (++help_page >= NUM_HELP_PAGES) help_page = 0; break; case K_DOWNARROW: case K_LEFTARROW: m_entersound = TRUE; if (--help_page < 0) help_page = NUM_HELP_PAGES-1; break; } } //============================================================================= /* QUIT MENU */ int msgNumber; int m_quit_prevstate; bool wasInMenus; void M_Menu_Quit_f (void) { if(m_state == m_quit) return; wasInMenus = (key_dest == key_menu); key_dest = key_menu; m_quit_prevstate = m_state; m_state = m_quit; m_entersound = true; msgNumber = rand()&7; } void M_Quit_Key (int key) { switch (key) { case K_ESCAPE: case 'n': case 'N': if (wasInMenus) { m_state = m_quit_prevstate; m_entersound = true; } else { key_dest = key_game; m_state = m_none; } break; case 'Y': case 'y': key_dest = key_console; Host_Quit_f (); break; default: break; } } //============================================================================= /* SERIAL CONFIG MENU */ int serialConfig_cursor; int serialConfig_cursor_table[] = {48, 64, 80, 96, 112, 132}; #define NUM_SERIALCONFIG_CMDS 6 static int ISA_uarts[] = {0x3f8,0x2f8,0x3e8,0x2e8}; static int ISA_IRQs[] = {4,3,4,3}; int serialConfig_baudrate[] = {9600,14400,19200,28800,38400,57600}; int serialConfig_comport; int serialConfig_irq ; int serialConfig_baud; char serialConfig_phone[16]; void M_Menu_SerialConfig_f (void) { int n, port, baudrate; bool useModem; key_dest = key_menu; m_state = m_serialconfig; m_entersound = TRUE; if (JoiningGame && SerialConfig) serialConfig_cursor = 4; else serialConfig_cursor = 5; (*GetComPortConfig) (0, &port, &serialConfig_irq, &baudrate, &useModem); // map uart's port to COMx for (n = 0; n < 4; n++) if (ISA_uarts[n] == port) break; if (n == 4) { n = 0; serialConfig_irq = 4; } serialConfig_comport = n + 1; // map baudrate to index for (n = 0; n < 6; n++) if (serialConfig_baudrate[n] == baudrate) break; if (n == 6) n = 5; serialConfig_baud = n; m_return_onerror = FALSE; m_return_reason[0] = 0; } void M_SerialConfig_Draw (void) { qpic_t *p; int basex; char *startJoin; char *directModem; M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); p = Draw_CachePic ("gfx/p_multi.lmp"); basex = (320-p->width)/2; M_DrawPic (basex, 4, p); if (StartingGame) startJoin = "New Game"; else startJoin = "Join Game"; if (SerialConfig) directModem = "Modem"; else directModem = "Direct Connect"; M_Print (basex, 32, va ("%s - %s", startJoin, directModem)); basex += 8; M_Print (basex, serialConfig_cursor_table[0], "Port"); M_DrawTextBox (160, 40, 4, 1); M_Print (168, serialConfig_cursor_table[0], va("COM%u", serialConfig_comport)); M_Print (basex, serialConfig_cursor_table[1], "IRQ"); M_DrawTextBox (160, serialConfig_cursor_table[1]-8, 1, 1); M_Print (168, serialConfig_cursor_table[1], va("%u", serialConfig_irq)); M_Print (basex, serialConfig_cursor_table[2], "Baud"); M_DrawTextBox (160, serialConfig_cursor_table[2]-8, 5, 1); M_Print (168, serialConfig_cursor_table[2], va("%u", serialConfig_baudrate[serialConfig_baud])); if (SerialConfig) { M_Print (basex, serialConfig_cursor_table[3], "Modem Setup..."); if (JoiningGame) { M_Print (basex, serialConfig_cursor_table[4], "Phone number"); M_DrawTextBox (160, serialConfig_cursor_table[4]-8, 16, 1); M_Print (168, serialConfig_cursor_table[4], serialConfig_phone); } } if (JoiningGame) { M_DrawTextBox (basex, serialConfig_cursor_table[5]-8, 7, 1); M_Print (basex+8, serialConfig_cursor_table[5], "Connect"); } else { M_DrawTextBox (basex, serialConfig_cursor_table[5]-8, 2, 1); M_Print (basex+8, serialConfig_cursor_table[5], "OK"); } M_DrawCharacter (basex-8, serialConfig_cursor_table [serialConfig_cursor], 12+((int)(realtime*4)&1)); if (serialConfig_cursor == 4) M_DrawCharacter (168 + 8*strlen(serialConfig_phone), serialConfig_cursor_table [serialConfig_cursor], 10+((int)(realtime*4)&1)); if (*m_return_reason) M_PrintWhite (basex, 148, m_return_reason); } void M_SerialConfig_Key (int key) { int l; switch (key) { case K_ESCAPE: M_Menu_Net_f (); break; case K_UPARROW: S_LocalSound ("misc/menu1.wav"); serialConfig_cursor--; if (serialConfig_cursor < 0) serialConfig_cursor = NUM_SERIALCONFIG_CMDS-1; break; case K_DOWNARROW: S_LocalSound ("misc/menu1.wav"); serialConfig_cursor++; if (serialConfig_cursor >= NUM_SERIALCONFIG_CMDS) serialConfig_cursor = 0; break; case K_LEFTARROW: if (serialConfig_cursor > 2) break; S_LocalSound ("misc/menu3.wav"); if (serialConfig_cursor == 0) { serialConfig_comport--; if (serialConfig_comport == 0) serialConfig_comport = 4; serialConfig_irq = ISA_IRQs[serialConfig_comport-1]; } if (serialConfig_cursor == 1) { serialConfig_irq--; if (serialConfig_irq == 6) serialConfig_irq = 5; if (serialConfig_irq == 1) serialConfig_irq = 7; } if (serialConfig_cursor == 2) { serialConfig_baud--; if (serialConfig_baud < 0) serialConfig_baud = 5; } break; case K_RIGHTARROW: if (serialConfig_cursor > 2) break; forward: S_LocalSound ("misc/menu3.wav"); if (serialConfig_cursor == 0) { serialConfig_comport++; if (serialConfig_comport > 4) serialConfig_comport = 1; serialConfig_irq = ISA_IRQs[serialConfig_comport-1]; } if (serialConfig_cursor == 1) { serialConfig_irq++; if (serialConfig_irq == 6) serialConfig_irq = 7; if (serialConfig_irq == 8) serialConfig_irq = 2; } if (serialConfig_cursor == 2) { serialConfig_baud++; if (serialConfig_baud > 5) serialConfig_baud = 0; } break; case INPUT_KEY_ENTER: if (serialConfig_cursor < 3) goto forward; m_entersound = TRUE; if (serialConfig_cursor == 3) { (*SetComPortConfig) (0, ISA_uarts[serialConfig_comport-1], serialConfig_irq, serialConfig_baudrate[serialConfig_baud], SerialConfig); M_Menu_ModemConfig_f (); break; } if (serialConfig_cursor == 4) { serialConfig_cursor = 5; break; } // serialConfig_cursor == 5 (OK/CONNECT) (*SetComPortConfig) (0, ISA_uarts[serialConfig_comport-1], serialConfig_irq, serialConfig_baudrate[serialConfig_baud], SerialConfig); M_ConfigureNetSubsystem (); if (StartingGame) { M_Menu_GameOptions_f (); break; } m_return_state = m_state; m_return_onerror = TRUE; key_dest = key_game; m_state = m_none; if (SerialConfig) Cbuf_AddText (va ("connect \"%s\"\n", serialConfig_phone)); else Cbuf_AddText ("connect\n"); break; case K_BACKSPACE: if (serialConfig_cursor == 4) { if (strlen(serialConfig_phone)) serialConfig_phone[strlen(serialConfig_phone)-1] = 0; } break; default: if (key < 32 || key > 127) break; if (serialConfig_cursor == 4) { l = strlen(serialConfig_phone); if (l < 15) { serialConfig_phone[l+1] = 0; serialConfig_phone[l] = key; } } } if (DirectConfig && (serialConfig_cursor == 3 || serialConfig_cursor == 4)) { if (key == K_UPARROW) serialConfig_cursor = 2; else serialConfig_cursor = 5; } if (SerialConfig && StartingGame && serialConfig_cursor == 4) { if (key == K_UPARROW) serialConfig_cursor = 3; else serialConfig_cursor = 5; } } //============================================================================= /* MODEM CONFIG MENU */ int modemConfig_cursor; int modemConfig_cursor_table [] = {40, 56, 88, 120, 156}; #define NUM_MODEMCONFIG_CMDS 5 char modemConfig_dialing; char modemConfig_clear [16]; char modemConfig_init [32]; char modemConfig_hangup [16]; void M_Menu_ModemConfig_f (void) { key_dest = key_menu; m_state = m_modemconfig; m_entersound = TRUE; (*GetModemConfig) (0, &modemConfig_dialing, modemConfig_clear, modemConfig_init, modemConfig_hangup); } void M_ModemConfig_Draw (void) { qpic_t *p; int basex; M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); p = Draw_CachePic ("gfx/p_multi.lmp"); basex = (320-p->width)/2; M_DrawPic (basex, 4, p); basex += 8; if (modemConfig_dialing == 'P') M_Print (basex, modemConfig_cursor_table[0], "Pulse Dialing"); else M_Print (basex, modemConfig_cursor_table[0], "Touch Tone Dialing"); M_Print (basex, modemConfig_cursor_table[1], "Clear"); M_DrawTextBox (basex, modemConfig_cursor_table[1]+4, 16, 1); M_Print (basex+8, modemConfig_cursor_table[1]+12, modemConfig_clear); if (modemConfig_cursor == 1) M_DrawCharacter (basex+8 + 8*strlen(modemConfig_clear), modemConfig_cursor_table[1]+12, 10+((int)(realtime*4)&1)); M_Print (basex, modemConfig_cursor_table[2], "Init"); M_DrawTextBox (basex, modemConfig_cursor_table[2]+4, 30, 1); M_Print (basex+8, modemConfig_cursor_table[2]+12, modemConfig_init); if (modemConfig_cursor == 2) M_DrawCharacter (basex+8 + 8*strlen(modemConfig_init), modemConfig_cursor_table[2]+12, 10+((int)(realtime*4)&1)); M_Print (basex, modemConfig_cursor_table[3], "Hangup"); M_DrawTextBox (basex, modemConfig_cursor_table[3]+4, 16, 1); M_Print (basex+8, modemConfig_cursor_table[3]+12, modemConfig_hangup); if (modemConfig_cursor == 3) M_DrawCharacter (basex+8 + 8*strlen(modemConfig_hangup), modemConfig_cursor_table[3]+12, 10+((int)(realtime*4)&1)); M_DrawTextBox (basex, modemConfig_cursor_table[4]-8, 2, 1); M_Print (basex+8, modemConfig_cursor_table[4], "OK"); M_DrawCharacter (basex-8, modemConfig_cursor_table [modemConfig_cursor], 12+((int)(realtime*4)&1)); } void M_ModemConfig_Key (int key) { int l; switch (key) { case K_ESCAPE: M_Menu_SerialConfig_f (); break; case K_UPARROW: S_LocalSound ("misc/menu1.wav"); modemConfig_cursor--; if (modemConfig_cursor < 0) modemConfig_cursor = NUM_MODEMCONFIG_CMDS-1; break; case K_DOWNARROW: S_LocalSound ("misc/menu1.wav"); modemConfig_cursor++; if (modemConfig_cursor >= NUM_MODEMCONFIG_CMDS) modemConfig_cursor = 0; break; case K_LEFTARROW: case K_RIGHTARROW: if (modemConfig_cursor == 0) { if (modemConfig_dialing == 'P') modemConfig_dialing = 'T'; else modemConfig_dialing = 'P'; S_LocalSound ("misc/menu1.wav"); } break; case INPUT_KEY_ENTER: if (modemConfig_cursor == 0) { if (modemConfig_dialing == 'P') modemConfig_dialing = 'T'; else modemConfig_dialing = 'P'; m_entersound = TRUE; } if (modemConfig_cursor == 4) { (*SetModemConfig) (0, va ("%c", modemConfig_dialing), modemConfig_clear, modemConfig_init, modemConfig_hangup); m_entersound = TRUE; M_Menu_SerialConfig_f (); } break; case K_BACKSPACE: if (modemConfig_cursor == 1) { if (strlen(modemConfig_clear)) modemConfig_clear[strlen(modemConfig_clear)-1] = 0; } if (modemConfig_cursor == 2) { if (strlen(modemConfig_init)) modemConfig_init[strlen(modemConfig_init)-1] = 0; } if (modemConfig_cursor == 3) { if (strlen(modemConfig_hangup)) modemConfig_hangup[strlen(modemConfig_hangup)-1] = 0; } break; default: if (key < 32 || key > 127) break; if (modemConfig_cursor == 1) { l = strlen(modemConfig_clear); if (l < 15) { modemConfig_clear[l+1] = 0; modemConfig_clear[l] = key; } } if (modemConfig_cursor == 2) { l = strlen(modemConfig_init); if (l < 29) { modemConfig_init[l+1] = 0; modemConfig_init[l] = key; } } if (modemConfig_cursor == 3) { l = strlen(modemConfig_hangup); if (l < 15) { modemConfig_hangup[l+1] = 0; modemConfig_hangup[l] = key; } } } } //============================================================================= /* LAN CONFIG MENU */ int lanConfig_cursor = -1; int lanConfig_cursor_table [] = {72, 92, 124}; #define NUM_LANCONFIG_CMDS 3 int lanConfig_port; char lanConfig_portname[6]; char lanConfig_joinname[22]; void M_Menu_LanConfig_f (void) { #if 0 key_dest = key_menu; m_state = m_lanconfig; m_entersound = TRUE; if (lanConfig_cursor == -1) { if (JoiningGame && TCPIPConfig) lanConfig_cursor = 2; else lanConfig_cursor = 1; } if (StartingGame && lanConfig_cursor == 2) lanConfig_cursor = 1; lanConfig_port = DEFAULTnet_hostport; sprintf(lanConfig_portname, "%u", lanConfig_port); m_return_onerror = FALSE; m_return_reason[0] = 0; #endif } void M_LanConfig_Draw (void) { qpic_t *p; int basex; char *startJoin; char *protocol; M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); p = Draw_CachePic ("gfx/p_multi.lmp"); basex = (320-p->width)/2; M_DrawPic (basex, 4, p); if (StartingGame) startJoin = "New Game"; else startJoin = "Join Game"; if (IPXConfig) protocol = "IPX"; else protocol = "TCP/IP"; M_Print (basex, 32, va ("%s - %s", startJoin, protocol)); basex += 8; M_Print (basex, 52, "Address:"); if (IPXConfig) M_Print (basex+9*8, 52, my_ipx_address); else M_Print (basex+9*8, 52, my_tcpip_address); M_Print (basex, lanConfig_cursor_table[0], "Port"); M_DrawTextBox (basex+8*8, lanConfig_cursor_table[0]-8, 6, 1); M_Print (basex+9*8, lanConfig_cursor_table[0], lanConfig_portname); if (JoiningGame) { M_Print (basex, lanConfig_cursor_table[1], "Search for local games..."); M_Print (basex, 108, "Join game at:"); M_DrawTextBox (basex+8, lanConfig_cursor_table[2]-8, 22, 1); M_Print (basex+16, lanConfig_cursor_table[2], lanConfig_joinname); } else { M_DrawTextBox (basex, lanConfig_cursor_table[1]-8, 2, 1); M_Print (basex+8, lanConfig_cursor_table[1], "OK"); } M_DrawCharacter (basex-8, lanConfig_cursor_table [lanConfig_cursor], 12+((int)(realtime*4)&1)); if (lanConfig_cursor == 0) M_DrawCharacter (basex+9*8 + 8*strlen(lanConfig_portname), lanConfig_cursor_table [0], 10+((int)(realtime*4)&1)); if (lanConfig_cursor == 2) M_DrawCharacter (basex+16 + 8*strlen(lanConfig_joinname), lanConfig_cursor_table [2], 10+((int)(realtime*4)&1)); if (*m_return_reason) M_PrintWhite (basex, 148, m_return_reason); } void M_LanConfig_Key (int key) { #if 0 int l; switch (key) { case K_ESCAPE: M_Menu_Net_f (); break; case K_UPARROW: S_LocalSound ("misc/menu1.wav"); lanConfig_cursor--; if (lanConfig_cursor < 0) lanConfig_cursor = NUM_LANCONFIG_CMDS-1; break; case K_DOWNARROW: S_LocalSound ("misc/menu1.wav"); lanConfig_cursor++; if (lanConfig_cursor >= NUM_LANCONFIG_CMDS) lanConfig_cursor = 0; break; case INPUT_KEY_ENTER: if (lanConfig_cursor == 0) break; m_entersound = TRUE; M_ConfigureNetSubsystem (); if (lanConfig_cursor == 1) { if (StartingGame) { M_Menu_GameOptions_f (); break; } M_Menu_Search_f(); break; } if (lanConfig_cursor == 2) { m_return_state = m_state; m_return_onerror = TRUE; key_dest = key_game; m_state = m_none; Cbuf_AddText ( va ("connect \"%s\"\n", lanConfig_joinname) ); break; } break; case K_BACKSPACE: if (lanConfig_cursor == 0) { if (strlen(lanConfig_portname)) lanConfig_portname[strlen(lanConfig_portname)-1] = 0; } if (lanConfig_cursor == 2) { if (strlen(lanConfig_joinname)) lanConfig_joinname[strlen(lanConfig_joinname)-1] = 0; } break; default: if (key < 32 || key > 127) break; if (lanConfig_cursor == 2) { l = strlen(lanConfig_joinname); if (l < 21) { lanConfig_joinname[l+1] = 0; lanConfig_joinname[l] = key; } } if (key < '0' || key > '9') break; if (lanConfig_cursor == 0) { l = strlen(lanConfig_portname); if (l < 5) { lanConfig_portname[l+1] = 0; lanConfig_portname[l] = key; } } } if (StartingGame && lanConfig_cursor == 2) { if (key == K_UPARROW) lanConfig_cursor = 1; else lanConfig_cursor = 0; } l = Q_atoi(lanConfig_portname); if (l > 65535) l = lanConfig_port; else lanConfig_port = l; sprintf(lanConfig_portname, "%u", lanConfig_port); #endif } //============================================================================= /* GAME OPTIONS MENU */ typedef struct { char *name; char *description; } level_t; level_t levels[] = { {"start", "Entrance"}, // 0 {"e1m1", "Slipgate Complex"}, // 1 {"e1m2", "Castle of the Damned"}, {"e1m3", "The Necropolis"}, {"e1m4", "The Grisly Grotto"}, {"e1m5", "Gloom Keep"}, {"e1m6", "The Door To Chthon"}, {"e1m7", "The House of Chthon"}, {"e1m8", "Ziggurat Vertigo"}, {"e2m1", "The Installation"}, // 9 {"e2m2", "Ogre Citadel"}, {"e2m3", "Crypt of Decay"}, {"e2m4", "The Ebon Fortress"}, {"e2m5", "The Wizard's Manse"}, {"e2m6", "The Dismal Oubliette"}, {"e2m7", "Underearth"}, {"e3m1", "Termination Central"}, // 16 {"e3m2", "The Vaults of Zin"}, {"e3m3", "The Tomb of Terror"}, {"e3m4", "Satan's Dark Delight"}, {"e3m5", "Wind Tunnels"}, {"e3m6", "Chambers of Torment"}, {"e3m7", "The Haunted Halls"}, {"e4m1", "The Sewage System"}, // 23 {"e4m2", "The Tower of Despair"}, {"e4m3", "The Elder God Shrine"}, {"e4m4", "The Palace of Hate"}, {"e4m5", "Hell's Atrium"}, {"e4m6", "The Pain Maze"}, {"e4m7", "Azure Agony"}, {"e4m8", "The Nameless City"}, {"end", "Shub-Niggurath's Pit"}, // 31 {"dm1", "Place of Two Deaths"}, // 32 {"dm2", "Claustrophobopolis"}, {"dm3", "The Abandoned Base"}, {"dm4", "The Bad Place"}, {"dm5", "The Cistern"}, {"dm6", "The Dark Zone"} }; typedef struct { char *description; int firstLevel; int levels; } episode_t; episode_t episodes[] = { {"Welcome to Quake", 0, 1}, {"Doomed Dimension", 1, 8}, {"Realm of Black Magic", 9, 7}, {"Netherworld", 16, 7}, {"The Elder World", 23, 8}, {"Final Level", 31, 1}, {"Deathmatch Arena", 32, 6} }; int startepisode; int startlevel; int maxplayers; bool m_serverInfoMessage = FALSE; double m_serverInfoMessageTime; void M_Menu_GameOptions_f (void) { key_dest = key_menu; m_state = m_gameoptions; m_entersound = TRUE; if (maxplayers == 0) maxplayers = svs.maxclients; if (maxplayers < 2) maxplayers = svs.maxclientslimit; } int gameoptions_cursor_table[] = {40, 56, 64, 72, 80, 88, 96, 112, 120}; #define NUM_GAMEOPTIONS 9 int gameoptions_cursor; void M_GameOptions_Draw (void) { qpic_t *p; int x; M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); p = Draw_CachePic ("gfx/p_multi.lmp"); M_DrawPic ( (320-p->width)/2, 4, p); M_DrawTextBox (152, 32, 10, 1); M_Print (160, 40, "begin game"); M_Print (0, 56, " Max players"); M_Print (160, 56, va("%i", maxplayers) ); M_Print (0, 64, " Game Type"); if (coop.value) M_Print (160, 64, "Cooperative"); else M_Print (160, 64, "Deathmatch"); M_Print (0, 72, " Teamplay"); { char *msg; switch((int)teamplay.value) { case 1: msg = "No Friendly Fire"; break; case 2: msg = "Friendly Fire"; break; default: msg = "Off"; break; } M_Print (160, 72, msg); } M_Print (0, 80, " Skill"); if (skill.value == 0) M_Print (160, 80, "Easy difficulty"); else if (skill.value == 1) M_Print (160, 80, "Normal difficulty"); else if (skill.value == 2) M_Print (160, 80, "Hard difficulty"); else M_Print (160, 80, "Nightmare difficulty"); M_Print (0, 112, " Episode"); M_Print (160, 112, episodes[startepisode].description); M_Print (0, 120, " Level"); M_Print (160, 120, levels[episodes[startepisode].firstLevel + startlevel].description); M_Print (160, 128, levels[episodes[startepisode].firstLevel + startlevel].name); // line cursor M_DrawCharacter (144, gameoptions_cursor_table[gameoptions_cursor], 12+((int)(realtime*4)&1)); if (m_serverInfoMessage) { if ((realtime - m_serverInfoMessageTime) < 5.0) { x = (320-26*8)/2; M_DrawTextBox (x, 138, 24, 4); x += 8; M_Print (x, 146,"More than 4 players "); M_Print (x, 154,"requires using command "); M_Print (x, 162,"line parameters. "); } else m_serverInfoMessage = FALSE; } } void M_NetStart_Change (int dir) { int count; switch (gameoptions_cursor) { case 1: maxplayers += dir; if (maxplayers > svs.maxclientslimit) { maxplayers = svs.maxclientslimit; m_serverInfoMessage = TRUE; m_serverInfoMessageTime = realtime; } if (maxplayers < 2) maxplayers = 2; break; case 2: Cvar_SetValue ("coop", coop.value ? 0 : 1); break; case 3: count = 2; Cvar_SetValue ("teamplay", teamplay.value + dir); if (teamplay.value > count) Cvar_SetValue ("teamplay", 0); else if (teamplay.value < 0) Cvar_SetValue ("teamplay", count); break; case 4: Cvar_SetValue ("skill", skill.value + dir); if (skill.value > 3) Cvar_SetValue ("skill", 0); if (skill.value < 0) Cvar_SetValue ("skill", 3); break; case 7: startepisode += dir; count = 7; if (startepisode < 0) startepisode = count - 1; if (startepisode >= count) startepisode = 0; startlevel = 0; break; case 8: startlevel += dir; count = episodes[startepisode].levels; if (startlevel < 0) startlevel = count - 1; if (startlevel >= count) startlevel = 0; break; } } void M_GameOptions_Key (int key) { switch (key) { case K_ESCAPE: M_Menu_Net_f (); break; case K_UPARROW: S_LocalSound ("misc/menu1.wav"); gameoptions_cursor--; if (gameoptions_cursor < 0) gameoptions_cursor = NUM_GAMEOPTIONS-1; break; case K_DOWNARROW: S_LocalSound ("misc/menu1.wav"); gameoptions_cursor++; if (gameoptions_cursor >= NUM_GAMEOPTIONS) gameoptions_cursor = 0; break; case K_LEFTARROW: if (gameoptions_cursor == 0) break; S_LocalSound ("misc/menu3.wav"); M_NetStart_Change (-1); break; case K_RIGHTARROW: if (gameoptions_cursor == 0) break; S_LocalSound ("misc/menu3.wav"); M_NetStart_Change (1); break; case INPUT_KEY_ENTER: S_LocalSound ("misc/menu2.wav"); if (gameoptions_cursor == 0) { if (sv.active) Cbuf_AddText ("disconnect\n"); Cbuf_AddText ("listen 0\n"); // so host_netport will be re-examined Cbuf_AddText ( va ("maxplayers %u\n", maxplayers) ); SCR_BeginLoadingPlaque (); Cbuf_AddText ( va ("map %s\n", levels[episodes[startepisode].firstLevel + startlevel].name) ); return; } M_NetStart_Change (1); break; } } //============================================================================= /* SEARCH MENU */ bool searchComplete = false; double searchCompleteTime; void M_Menu_Search_f (void) { key_dest = key_menu; m_state = m_search; m_entersound = FALSE; slistSilent = TRUE; slistLocal = FALSE; searchComplete = FALSE; NET_Slist_f(); } //============================================================================= /* SLIST MENU */ int slist_cursor; bool slist_sorted; void M_Menu_ServerList_f (void) { key_dest = key_menu; m_state = m_slist; m_entersound = TRUE; slist_cursor = 0; m_return_onerror = FALSE; m_return_reason[0] = 0; slist_sorted = FALSE; } void M_ServerList_Draw (void) { #if 0 int n; char string [64]; qpic_t *p; if (!slist_sorted) { if (hostCacheCount > 1) { int i,j; hostcache_t temp; for (i = 0; i < hostCacheCount; i++) for (j = i+1; j < hostCacheCount; j++) if (strcmp(hostcache[j].name, hostcache[i].name) < 0) { Q_memcpy(&temp, &hostcache[j], sizeof(hostcache_t)); Q_memcpy(&hostcache[j], &hostcache[i], sizeof(hostcache_t)); Q_memcpy(&hostcache[i], &temp, sizeof(hostcache_t)); } } slist_sorted = TRUE; } p = Draw_CachePic ("gfx/p_multi.lmp"); M_DrawPic ( (320-p->width)/2, 4, p); for (n = 0; n < hostCacheCount; n++) { if (hostcache[n].maxusers) sprintf(string, "%-15.15s %-15.15s %2u/%2u\n", hostcache[n].name, hostcache[n].map, hostcache[n].users, hostcache[n].maxusers); else sprintf(string, "%-15.15s %-15.15s\n", hostcache[n].name, hostcache[n].map); M_Print (16, 32 + 8*n, string); } M_DrawCharacter (0, 32 + slist_cursor*8, 12+((int)(realtime*4)&1)); if (*m_return_reason) M_PrintWhite (16, 148, m_return_reason); #endif } void M_ServerList_Key (int k) { switch (k) { case K_ESCAPE: M_Menu_LanConfig_f (); break; case K_SPACE: M_Menu_Search_f (); break; case K_UPARROW: case K_LEFTARROW: S_LocalSound ("misc/menu1.wav"); slist_cursor--; if (slist_cursor < 0) slist_cursor = hostCacheCount - 1; break; case K_DOWNARROW: case K_RIGHTARROW: S_LocalSound ("misc/menu1.wav"); slist_cursor++; if (slist_cursor >= hostCacheCount) slist_cursor = 0; break; case INPUT_KEY_ENTER: S_LocalSound ("misc/menu2.wav"); m_return_state = m_state; m_return_onerror = TRUE; slist_sorted = FALSE; key_dest = key_game; m_state = m_none; Cbuf_AddText ( va ("connect \"%s\"\n", hostcache[slist_cursor].cname) ); break; default: break; } } //============================================================================= /* Menu Subsystem */ void M_ConfigureNetSubsystem(void) { // enable/disable net systems to match desired config Cbuf_AddText ("stopdemo\n"); if (SerialConfig || DirectConfig) { Cbuf_AddText ("com1 enable\n"); } if (IPXConfig || TCPIPConfig) net_hostport = lanConfig_port; }
20.957994
136
0.645874
[ "solid" ]
2a951fc7a363fa3672ca2ef27460b2dbb49dbd33
3,353
h
C
include/SL_user_main_core.h
sschaal2/SL
9d05bbc9c323bccda12f28d75428851c3406a614
[ "Apache-2.0" ]
1
2020-04-20T15:32:18.000Z
2020-04-20T15:32:18.000Z
include/SL_user_main_core.h
sschaal2/SL
9d05bbc9c323bccda12f28d75428851c3406a614
[ "Apache-2.0" ]
null
null
null
include/SL_user_main_core.h
sschaal2/SL
9d05bbc9c323bccda12f28d75428851c3406a614
[ "Apache-2.0" ]
null
null
null
int i,j,n,c=0; char argv_array[100][50]; char *argv_ptr[100]; char start_task[50]; int graphics_flag = TRUE; int hold_flag = FALSE; int ros_flag = FALSE; char string[100]; char xstring[100]; char gstring[100]; int delta_width = 600; int geometry_argv; int servo_argv; int background_argv; int title_argv; int nice_argv; int stat_loc; int options = 0; int rc; int x,y,h,w; Display *display; int screen_num; int display_width; int display_height; // init the parameter pool init_parameter_pool(); // connect to X server using the DISPLAY environment variable if ( (display=XOpenDisplay(NULL)) == NULL ) { printf("Cannot connect to X servo %s\n",XDisplayName(NULL)); exit(-1); } // get screen size from display structure macro screen_num = DefaultScreen(display); display_width = DisplayWidth(display, screen_num); display_height = DisplayHeight(display, screen_num); // assign the servo_name variable with the calling program as default sprintf(servo_name,"%s",argv[0]); // NOTE: the sequence of initialization of the servos // is important for the initial semaphore synchronization // check for no-graphics flag for (i=1; i<argc; ++i) if (strcmp(argv[i],"-ng")==0 || strcmp(argv[i],"-no-graphics")==0) graphics_flag = FALSE; // check if starting task flag // i.e. task that must start along with SL strcmp(start_task,""); for (i=1;i<argc;++i){ if(strcmp(argv[i],"-task")==0){ // following argument expected to be the name of the task to start if(i>=(argc-1)){ printf("name of task expected after '-task' command line argument"); return FALSE; } else { sprintf(start_task,"%s",argv[i+1]); } } } // check for hold flag for (i=1; i<argc; ++i) if (strcmp(argv[i],"-hold")==0) hold_flag = TRUE; // check for ros flag, but only if ROS_MASTER_URI is defined if (getenv("ROS_MASTER_URI") != NULL) for (i=1; i<argc; ++i) if (strcmp(argv[i],"-ros")==0) ros_flag = TRUE; // get the current process ID parent_process_id = getpid(); // need the config file names initialized setRealRobotOptions() ; // build the command array sprintf(argv_array[c++],"xterm"); sprintf(argv_array[c++],"-wf"); sprintf(argv_array[c++],"-leftbar"); sprintf(argv_array[c++],"-geometry"); geometry_argv = c; sprintf(argv_array[c++],"90x10+0+0"); sprintf(argv_array[c++],"-bg"); background_argv = c; sprintf(argv_array[c++],"red"); sprintf(argv_array[c++],"-fg"); sprintf(argv_array[c++],"black"); if (hold_flag) sprintf(argv_array[c++],"-hold"); sprintf(argv_array[c++],"-title"); title_argv = c; sprintf(argv_array[c++],"%s",argv[0]); sprintf(argv_array[c++],"-e"); sprintf(argv_array[c++],"env"); sprintf(argv_array[c++],"LD_LIBRARY_PATH=%s",getenv("LD_LIBRARY_PATH")); sprintf(argv_array[c++],"nice"); sprintf(argv_array[c++],"-n"); nice_argv = c; sprintf(argv_array[c++],"0"); servo_argv = c; sprintf(argv_array[c++],"xdummy"); sprintf(argv_array[c++],"-pid"); sprintf(argv_array[c++],"%d",parent_process_id); if (!graphics_flag) sprintf(argv_array[c++],"-ng"); if (strcmp(start_task,"")!=0){ sprintf(argv_array[c++],"-task"); sprintf(argv_array[c++],"%s",start_task); } // detach process #if sparc #else rc=daemon(1,0); #endif // initialize shared memories and shared semaphores if (!init_shared_memory()) exit(-1); // signal handlers installSignalHandlers();
24.837037
74
0.680286
[ "geometry" ]
2a9c29ed6adcc1adf9cf8f9c837a7f9facffe362
1,249
h
C
src/PersonalExcept.h
khongsomeo/GPA-OOP
6605ad08d5c963bbbf0d7e1a235cd924df110bf1
[ "MIT" ]
null
null
null
src/PersonalExcept.h
khongsomeo/GPA-OOP
6605ad08d5c963bbbf0d7e1a235cd924df110bf1
[ "MIT" ]
9
2022-01-27T19:06:11.000Z
2022-02-13T11:05:28.000Z
src/PersonalExcept.h
khongsomeo/GPA-OOP
6605ad08d5c963bbbf0d7e1a235cd924df110bf1
[ "MIT" ]
4
2022-01-27T02:02:08.000Z
2022-01-30T15:01:59.000Z
/** * PersonalExcept.h * * Code by @trhgquan - https://github.com/trhgquan */ #ifndef PERSONAL_EXCEPT_H #define PERSONAL_EXCEPT_H #include "PersonalGPA.h" /** * PersonalExcept class * * This class is used when we need to calculate GPA except some courses. * * For example, I need to calculate my GPA except PE, English and National * Defense. So I'll add these courses's code to except.txt, and use this class * instead. */ class PersonalExcept : public PersonalGPA { private: std::multiset<std::string> _ignoredCourses; public: /** * PersonalExcept default constructor * * @return void */ PersonalExcept(); /** * PersonalExcept destructor * * @return void */ ~PersonalExcept(); /** * Parameterised constructor for PersonalExcept * * @param const std::vector<Course>& * @param const std::vector<std::string>& */ PersonalExcept(const std::vector<Course> &, const std::vector<std::string> &); public: /** * Parse a PersonalExcept object. * * @param const std::vector<std::string>& * * @return std::shared_ptr<PersonalGPA> */ virtual std::shared_ptr<PersonalGPA> parse( const std::vector<std::string> &) override; }; #endif // PERSONAL_EXCEPT_H
20.816667
80
0.665332
[ "object", "vector" ]
2a9fd167b33b13ca506c7dc601b41404a7fc2846
1,620
h
C
Modules/D3D12/Sources/RND3D12ShaderLibrary.h
uberpixel/Rayne
94f601561aedfc3200e67ff9522f64fbc5ca4d8c
[ "MIT" ]
13
2020-08-08T11:57:05.000Z
2022-03-10T17:29:19.000Z
Modules/D3D12/Sources/RND3D12ShaderLibrary.h
uberpixel/Rayne
94f601561aedfc3200e67ff9522f64fbc5ca4d8c
[ "MIT" ]
1
2022-03-10T17:35:28.000Z
2022-03-10T18:21:57.000Z
Modules/D3D12/Sources/RND3D12ShaderLibrary.h
uberpixel/Rayne
94f601561aedfc3200e67ff9522f64fbc5ca4d8c
[ "MIT" ]
3
2020-08-08T14:22:34.000Z
2021-05-15T21:12:17.000Z
// // RND3D12ShaderLibrary.h // Rayne // // Copyright 2015 by Überpixel. All rights reserved. // Unauthorized use is punishable by torture, mutilation, and vivisection. // #ifndef __RAYNE_D3D12SHADERLIBRARY_H_ #define __RAYNE_D3D12SHADERLIBRARY_H_ #include "RND3D12.h" namespace RN { class D3D12Renderer; class D3D12SpecificShaderLibrary : public Object { public: friend class D3D12ShaderLibrary; ~D3D12SpecificShaderLibrary(); Shader *GetShaderWithOptions(ShaderLibrary *library, const Shader::Options *options); private: D3D12SpecificShaderLibrary(const String *fileName, const String *entryPoint, Shader::Type type, Dictionary *signatureDescription); const Shader::Options *GetCleanedShaderOptions(const Shader::Options *options) const; const Array *GetSamplerSignature(const Shader::Options *options) const; size_t GetPermutationIndexForOptions(const Shader::Options *options) const; Dictionary *_shaders; const String *_entryPoint; const String *_fileName; Shader::Type _type; Dictionary *_signatureDescription; RNDeclareMetaAPI(D3D12SpecificShaderLibrary, D3DAPI) }; class D3D12ShaderLibrary : public ShaderLibrary { public: friend class D3D12Renderer; D3DAPI ~D3D12ShaderLibrary() override; D3DAPI Shader *GetShaderWithName(const String *name, const Shader::Options *options = nullptr) final; D3DAPI Shader *GetInstancedShaderForShader(Shader *shader) final; private: D3D12ShaderLibrary(const String *file); Dictionary *_specificShaderLibraries; RNDeclareMetaAPI(D3D12ShaderLibrary, D3DAPI) }; } #endif /* __RAYNE_D3D12SHADERLIBRARY_H_ */
24.923077
132
0.784568
[ "object" ]
2aabf2741ce8c72b91ba145e08de41c7fc0010d4
3,180
h
C
FDTD/operations/ForwardEH.h
plisdku/trogdor6
d77eb137dd0c03635c0016801ada54117697e521
[ "MIT" ]
null
null
null
FDTD/operations/ForwardEH.h
plisdku/trogdor6
d77eb137dd0c03635c0016801ada54117697e521
[ "MIT" ]
null
null
null
FDTD/operations/ForwardEH.h
plisdku/trogdor6
d77eb137dd0c03635c0016801ada54117697e521
[ "MIT" ]
null
null
null
/* * ForwardEH.h * Trogdor6 * * Created by Paul Hansen on 6/22/10. * Copyright 2010 Stanford University. All rights reserved. * * This file is covered by the MIT license. See LICENSE.txt. */ #ifndef _UPDATEEH_ #define _UPDATEEH_ #include "../PrecisionRationalFunction.h" #include "../FieldEnum.h" #include "../GridFields.h" #include "../Operation.h" #include <vector> #include <map> #include "Pointer.h" struct RunlineEH { RunlineEH() {} RunlineEH(long inEH, long inDB, long inAux, long inCoeff, long inCoeffStride, long length) : eh(inEH), db(inDB), aux(inAux), coeff(inCoeff), coeffStride(inCoeffStride), mLength(length) { assert(length > 0); } long length() const { return mLength; } long eh; long db; long aux; long coeff; long coeffStride; long mLength; }; std::ostream & operator<<(std::ostream & str, const RunlineEH & rl); class ForwardEH : public Operation { public: ForwardEH(); // I take the coefficients to be permittivity or permeability. // The numerator is associated with E or H. // The denominator is associated with D or B. ForwardEH(Field eh, Field db, int ehOrder, int dbOrder, const std::vector<RunlineEH> & runlines, const std::vector<Precision::RationalFunction> & coefficients, Precision::Float eps0_or_mu0); void allocate(); // void setPointers(Precision::Float* headDB, Precision::Float* headEH); void setPointers(GridFields & currentGridFields, std::map<int, Pointer<GridFields> > & allGridFields); unsigned long bytes() const; void apply(long timestep, Precision::Float dt); void printRunlines(std::ostream & str) const; long numCells() const { long cells = 0; for (int nn = 0; nn < mRunlines.size(); nn++) cells += mRunlines[nn].length(); return cells; } private: /** * Return the buffer currently representing the given lag. Because the * buffers are circular, the correct buffer will depend on the current * timestep. */ std::vector<Precision::Float> & bufferDB(unsigned long lag) { assert(lag > 0); // lag 0 is always available on the grid! return mBufferDB[(mCircularBufferLag - lag + mBufferDB.size()) % mBufferDB.size()]; } std::vector<Precision::Float> & bufferEH(unsigned long lag) { return mBufferEH[(mCircularBufferLag - lag + mBufferEH.size()) % mBufferEH.size()]; } unsigned long mCircularBufferLag; Field mField; Field mAuxField; std::vector<RunlineEH> mRunlines; std::vector<std::vector<Precision::Float> > mCoefficientsDB; // [order][coeff run] std::vector<std::vector<Precision::Float> > mCoefficientsEH; // [order][coeff run] std::vector<std::vector<Precision::Float> > mBufferDB; // [lag][cell] std::vector<std::vector<Precision::Float> > mBufferEH; // [lag][cell] Precision::Float* mHeadDB; Precision::Float* mHeadEH; int mOrderEH; int mOrderDB; // Precision::Float m_eps0_or_mu0; // either eps0 or mu0 }; #endif
27.894737
96
0.638365
[ "vector" ]
2ac75ddda28fbfa86273622ade1451e3b72546b6
1,459
h
C
branch/old_angsys/angsys_beta1/include/angsys/ang/platform/angwin/gdi.h
ChuyX3/angsys
89b2eaee866bcfd11e66efda49b38acc7468c780
[ "Apache-2.0" ]
null
null
null
branch/old_angsys/angsys_beta1/include/angsys/ang/platform/angwin/gdi.h
ChuyX3/angsys
89b2eaee866bcfd11e66efda49b38acc7468c780
[ "Apache-2.0" ]
null
null
null
branch/old_angsys/angsys_beta1/include/angsys/ang/platform/angwin/gdi.h
ChuyX3/angsys
89b2eaee866bcfd11e66efda49b38acc7468c780
[ "Apache-2.0" ]
null
null
null
#ifndef __ANGWIN_H__ #error ... #elif !defined __ANGDI_H__ #define __ANGDI_H__ namespace ang { namespace graphics { class device_context; class paint_dc; typedef object_wrapper<device_context> device_context_t; typedef object_wrapper<paint_dc> paint_dc_t; class LINK device_context : public object , public platform::icore_context { protected: pointer handle; public: device_context(platform::windows::window_t wnd); ANG_DECLARE_INTERFACE(); bool is_valid()const; virtual pointer get_core_context_handle()const override; virtual bool bind_graphic_native_surface(pointer) override; protected: virtual bool create(pointer); virtual bool close(); public: //properties virtual pointer get_HDC()const; foundation::point<float> move_to(foundation::point<float>); foundation::point<float> current_position()const; foundation::point<float> draw_line_to(foundation::point<float>); void draw_primitive(primitive_t, const collections::ienum<foundation::point<float>>* ptns, bool solid = true); protected: virtual~device_context(); }; class LINK paint_dc : public device_context { public: paint_dc(platform::windows::window_t); ANG_DECLARE_INTERFACE(); protected: virtual bool create(pointer); virtual bool close(); public: //Properties foundation::rect<float> clip_area()const; protected: virtual~paint_dc(); }; } } #endif//__ANGWIN_H__
20.842857
113
0.730637
[ "object", "solid" ]
2ae0814418578dd96d8e59c5ef96995619f63a0e
2,866
h
C
scandsp/include/circlebuf.h
kit-transue/software-emancipation-discover
bec6f4ef404d72f361d91de954eae9a3bd669ce3
[ "BSD-2-Clause" ]
2
2015-11-24T03:31:12.000Z
2015-11-24T16:01:57.000Z
scandsp/include/circlebuf.h
radtek/software-emancipation-discover
bec6f4ef404d72f361d91de954eae9a3bd669ce3
[ "BSD-2-Clause" ]
null
null
null
scandsp/include/circlebuf.h
radtek/software-emancipation-discover
bec6f4ef404d72f361d91de954eae9a3bd669ce3
[ "BSD-2-Clause" ]
1
2019-05-19T02:26:08.000Z
2019-05-19T02:26:08.000Z
/************************************************************************* * Copyright (c) 2015, Synopsys, Inc. * * All rights reserved. * * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions are * * met: * * * * 1. Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * * * 2. Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * * * 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 CIRCLEBUF_H #define CIRCLEBUF_H // A buffer to hold the recent history of bytes read from a file. // A CircleBuf object is created with a fixed limit on how // many bytes it can hold. 'track' is called to keep the buffer up-to-date. class CircleBuf { public: CircleBuf(unsigned long); ~CircleBuf(); void track(char ch); unsigned long count(); unsigned long trackCount(); char operator[](long idx); private: CircleBuf(const CircleBuf &); // unimplemented unsigned long bufsize; char *circle; const char *circle_back; unsigned long circle_count; unsigned long track_count; char *circle_p; }; extern short getBufShort(CircleBuf &buf, long offset); extern void reportBuf(CircleBuf &c, long num); extern bool bufAt(CircleBuf &buf, const char *p, long count); #endif // CIRCLEBUF_H
49.413793
76
0.576413
[ "object" ]
2ae820a8f59d5df11d966bb6d2e9004b48bc6b37
517
h
C
src/CoverBinRangePartitioner.h
fvutils/libvsc
1e52ad16fe3ca39e7807eee11e38ca30cb23f827
[ "Apache-2.0" ]
4
2021-08-04T07:42:55.000Z
2022-03-23T05:08:03.000Z
src/CoverBinRangePartitioner.h
fvutils/libvsc
1e52ad16fe3ca39e7807eee11e38ca30cb23f827
[ "Apache-2.0" ]
null
null
null
src/CoverBinRangePartitioner.h
fvutils/libvsc
1e52ad16fe3ca39e7807eee11e38ca30cb23f827
[ "Apache-2.0" ]
1
2020-11-20T02:36:49.000Z
2020-11-20T02:36:49.000Z
/* * CoverBinRangePartitioner.h * * Created on: Nov 21, 2021 * Author: mballance */ #pragma once #include <vector> #include "CoverBinSpec.h" #include "ModelValRangelist.h" namespace vsc { class CoverBinRangePartitioner { public: CoverBinRangePartitioner(); virtual ~CoverBinRangePartitioner(); void partition( std::vector<CoverBinSpecUP> &specs, const ModelValRangelist &ranges, int32_t auto_bin_max); private: std::vector<CoverBinSpecUP> *m_specs; }; } /* namespace vsc */
16.677419
41
0.705996
[ "vector" ]
2aea003d6f0580afde2980912e425a6d70edef07
1,491
h
C
src/qt/appearancewidget.h
thelazier/dash
22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd
[ "MIT" ]
null
null
null
src/qt/appearancewidget.h
thelazier/dash
22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd
[ "MIT" ]
null
null
null
src/qt/appearancewidget.h
thelazier/dash
22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd
[ "MIT" ]
null
null
null
// Copyright (c) 2020 The Dash Core developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_APPEARANCEWIDGET_H #define BITCOIN_QT_APPEARANCEWIDGET_H #include <QWidget> #include <qt/guiutil.h> namespace Ui { class AppearanceWidget; } class OptionsModel; class QDataWidgetMapper; class QSlider; class QComboBox; class AppearanceWidget : public QWidget { Q_OBJECT public: explicit AppearanceWidget(QWidget* parent = 0); ~AppearanceWidget(); void setModel(OptionsModel* model); Q_SIGNALS: void appearanceChanged(); public Q_SLOTS: void accept(); private Q_SLOTS: void updateTheme(const QString& toTheme = QString()); void updateFontFamily(int index); void updateFontScale(int nScale); void updateFontWeightNormal(int nValue, bool fForce = false); void updateFontWeightBold(int nValue, bool fForce = false); private: Ui::AppearanceWidget* ui; QDataWidgetMapper* mapper; OptionsModel* model; bool fAcceptChanges{false}; QString prevTheme{GUIUtil::getActiveTheme()}; int prevScale{GUIUtil::getFontScale()}; GUIUtil::FontFamily prevFontFamily{GUIUtil::getFontFamily()}; QFont::Weight prevWeightNormal{GUIUtil::getFontWeightNormal()}; QFont::Weight prevWeightBold{GUIUtil::getFontWeightBold()}; void updateWeightSlider(bool fForce = false); }; #endif // BITCOIN_QT_APPEARANCEWIDGET_H
24.85
71
0.751174
[ "model" ]
2af8c6788192c308e91ae5da5d853a10533fb39d
14,994
h
C
hardware/codebase/N7G1/node_modules/node-manatee/src/BarcodeScanner.h
ubavic/lamassu-machine
742de417524a9623d741317e84fb76168bcf3d2a
[ "Unlicense" ]
87
2015-02-11T07:47:35.000Z
2022-02-08T22:09:26.000Z
hardware/codebase/N7G1/node_modules/node-manatee/src/BarcodeScanner.h
ubavic/lamassu-machine
742de417524a9623d741317e84fb76168bcf3d2a
[ "Unlicense" ]
452
2015-01-14T01:57:03.000Z
2021-11-29T16:20:48.000Z
hardware/codebase/N7G1/node_modules/node-manatee/src/BarcodeScanner.h
ubavic/lamassu-machine
742de417524a9623d741317e84fb76168bcf3d2a
[ "Unlicense" ]
156
2015-01-24T22:50:14.000Z
2022-03-23T06:35:10.000Z
/** * @file BarcodeScanner.h * @brief Barcode Decoders Library * @n (C) Manatee Works, 2011-2012. * * Main user public header. */ #ifndef _BARCODESCANNER_H_ #define _BARCODESCANNER_H_ #ifdef __cplusplus extern "C" { #endif #ifndef uint32_t #define uint32_t unsigned int #define uint8_t unsigned char #endif /** * @name General configuration ** @{ */ /** @name Grayscale image size range ** @{ */ #define MWB_GRAYSCALE_LENX_MIN 10 #define MWB_GRAYSCALE_LENX_MAX 3000 #define MWB_GRAYSCALE_LENY_MIN 10 #define MWB_GRAYSCALE_LENY_MAX 3000 /** @} */ /** * @name Basic return values for API functions * @{ */ #define MWB_RT_OK 0 #define MWB_RT_FAIL -1 #define MWB_RT_NOT_SUPPORTED -2 #define MWB_RT_BAD_PARAM -3 /** @} */ /** ** @name Configuration values for use with MWB_setFlags ** @{ */ /** @brief Global decoder flags value: apply sharpening on input image */ #define MWB_CFG_GLOBAL_HORIZONTAL_SHARPENING 0x01 #define MWB_CFG_GLOBAL_VERTICAL_SHARPENING 0x02 #define MWB_CFG_GLOBAL_SHARPENING 0x03 /** @brief Global decoder flags value: apply rotation on input image */ #define MWB_CFG_GLOBAL_ROTATE90 0x04 /** @brief Code39 decoder flags value: select VIN mode */ #define MWB_CFG_CODE39_VIN_MODE 0x1 /** @brief Code39 decoder flags value: require checksum check */ #define MWB_CFG_CODE39_REQ_CHKSUM 0x2 /**/ /** @brief Code25 decoder flags value: require checksum check */ #define MWB_CFG_CODE25_REQ_CHKSUM 0x1 /**/ /** * @brief Datamatrix decoder flag value: select VIN mode */ #define MWB_CFG_DM_VIN_MODE 0x1 /** * @brief Code 128 decoder flag value: select VIN mode */ #define MWB_CFG_CODE128_VIN_MODE 0x1 /** @} */ /** * @name Bit mask identifiers for supported decoder types * @{ */ #define MWB_CODE_MASK_NONE 0x00000000u #define MWB_CODE_MASK_QR 0x00000001u #define MWB_CODE_MASK_DM 0x00000002u #define MWB_CODE_MASK_RSS 0x00000004u #define MWB_CODE_MASK_39 0x00000008u #define MWB_CODE_MASK_EANUPC 0x00000010u #define MWB_CODE_MASK_128 0x00000020u #define MWB_CODE_MASK_PDF 0x00000040u #define MWB_CODE_MASK_AZTEC 0x00000080u #define MWB_CODE_MASK_25 0x00000100u #define MWB_CODE_MASK_ALL 0xffffffffu /** @} */ /** * @name Bit mask identifiers for RSS decoder types * @{ */ #define MWB_SUBC_MASK_RSS_14 0x00000001u #define MWB_SUBC_MASK_RSS_LIM 0x00000004u #define MWB_SUBC_MASK_RSS_EXP 0x00000008u /** @} */ /** * @name Bit mask identifiers for 2 of 5 decoder types * @{ */ #define MWB_SUBC_MASK_C25_INTERLEAVED 0x00000001u #define MWB_SUBC_MASK_C25_STANDARD 0x00000002u /** @} */ /** * @name Bit mask identifiers for 1D scanning direction * @{ */ #define MWB_SCANDIRECTION_HORIZONTAL 0x00000001u #define MWB_SCANDIRECTION_VERTICAL 0x00000002u #define MWB_SCANDIRECTION_OMNI 0x00000004u #define MWB_SCANDIRECTION_AUTODETECT 0x00000008u /** @} */ /** * @name Result values for all code types * @{ */ enum res_types { FOUND_NONE = 0, FOUND_DM, FOUND_39, FOUND_RSS_14, FOUND_RSS_14_STACK, FOUND_RSS_LIM, FOUND_RSS_EXP, FOUND_EAN_13, FOUND_EAN_8, FOUND_UPC_A, FOUND_UPC_E, FOUND_128, FOUND_PDF, FOUND_QR, FOUND_AZTEC, FOUND_25_INTERLEAVED, FOUND_25_STANDARD }; /** @} */ /** * @name User API function headers * @{ */ /** * Returns version code of Barcode Scanner Library. * * @return 32-bit version code in x.y.z format. * @n Byte 3 (most significant byte): reserved (0) * @n Byte 2: value x * @n Byte 1: value y * @n Byte 0 (least significant byte): value z */ extern unsigned int MWB_getLibVersion(void); /** * Returns supported decoders in this library release. * * @returns 32-bit bit mask where each non-zero bit represents * supported decoder according to MWB_CODE_MASK_... values * defined in BarcodeScanner.h header file. */ extern unsigned int MWB_getSupportedCodes(void); /** * Sets rectangular area for barcode scanning with selected single decoder type. * After MWB_setScanningRect() call, all subseqent scans will be restricted * to this region. If rectangle is not set, whole image is scanned. * Also, if width or height is zero, whole image is scanned. * * Parameters are interpreted as percentage of image dimensions, i.e. ranges are * 0 - 100 for all parameters. * * @param[in] codeMask Single decoder type selector (MWB_CODE_MASK_...) * @param[in] left X coordinate of left edge (percentage) * @param[in] top Y coordinate of top edge (percentage) * @param[in] width Rectangle witdh (x axis) (percentage) * @param[in] height Rectangle height (y axis) (percentage) * * @retval MWB_RT_OK Rectangle set successfully * @retval MWB_RT_BAD_PARAM Rectange percentages invalid (out of range) */ extern int MWB_setScanningRect(const uint32_t codeMask, float left, float top, float width, float height); /** * Registers licensing information with single selected decoder type. * If registering information is correct, enables full support for selected * decoder type. * It should be called once per decoder type. * * @param[in] codeMask Single decoder type selector (MWB_CODE_MASK_...) * @param[in] userName User name string * @param[in] key License key string * * @retval MWB_RT_OK Registration successful * @retval MWB_RT_FAIL Registration failed * @retval MWB_RT_BAD_PARAM More than one decoder flag selected * @retval MWB_RT_NOT_SUPPORTED Selected decoder type or its registration * is not supported */ extern int MWB_registerCode(const uint32_t codeMask, char * userName, char * key); /** * Sets active or inactive status of decoder types and updates decoder execution priority list. * Upon library load, all decoder types are inactive by default. User must call this function * at least once to choose active set of active decoders. * * @param[in] codeMask ORed bit flags (MWB_CODE_MASK_...) of decoder types * to be activated. * Bit value '1' activates corresponding decoder, while bit value * deactivates it. * * @retval MWB_RT_OK All requested decoder types supported and activated. * @retval MWB_RT_NOT_SUPPORTED One or more requested decoder types is not * supported in this library release. On this error, * activation status of all supported types will not be changed. */ extern int MWB_setActiveCodes(const uint32_t codeMask); /** * Set active subcodes for given code group flag. * Subcodes under some decoder type are all activated by default. * * @param[in] codeMask Single decoder type/group (MWB_CODE_MASK_...) * @param[in] subMask ORed bit flags of requested decoder subtypes (MWB_SUBC_MASK_) * * @retval MWB_RT_OK Activation successful * @retval MWB_RT_BAD_PARAM No decoder group selected * @retval MWB_RT_NOT_SUPPORTED Decoder group or subtype not supported */ extern int MWB_setActiveSubcodes(const uint32_t codeMask, const uint32_t subMask); /** * @brief Sets code priority level for selected decoder group or groups. * @details If this library release supports multiple decoder types, user * can activate more than one type to be invoked when main scan image * function is called by user. MWB_setCodePriority enables user to * control order by which decoders will be called. * * @param[in] codeMask Single decoder type/group (MWB_CODE_MASK_...) * @param[in] priority 0 to 254 priority value (0 is the highest priority) * * @retval MWB_RT_OK Success * @retval MWB_RT_NOT_SUPPORTED Decoder group not supported */ extern int MWB_setCodePriority(const uint32_t codeMask, const uint8_t priority); /** * Free memory resources allocated by library. * Should be invoked when library is not needed anymore, which is typically * at application closing time. * This cleanup is not necessary on most platforms, as memory resources are * deallocated automatically by operating system. * * @retval MWB_RT_OK Success */ extern int MWB_cleanupLib(void); /** * Retrieves actual detected code type after successful MWB_scanGrayscaleImage * call. If last call was not successful, it will return FOUND_NONE. * * @retval res_types Last decoded type * @retval MWB_RT_FAIL Library error */ int MWB_getLastType(void); /** * Main scan function. Invokes all activated decoders by priority. * For successful scan, allocates pp_data buffer and pass it to user. * User should deallocate *pp_data pointer when no more needed. * * @param[in] pp_image Byte array representing grayscale value of image pixels. * Array shold be stored in row after row fashion, starting with top row. * @param[in] lenX X axis size (width) of image. * @param[in] lenY Y axis size (length) of image. * @param[out] pp_data On successful decode, library allocates new byte array where it stores decoded * string result. Pointer to string is passed here. User application is responsible * for deallocating this buffer after use. * * @retval >0 Result string length for successful decode * @retval MWB_RT_BAD_PARAM Null pointer or out of range parameters * @retval MWB_RT_NOT_SUPPORTED Unsupported decoder found in execution list - library error */ extern int MWB_scanGrayscaleImage(uint8_t* pp_image, int lenX, int lenY, uint8_t **pp_data); /** * @brief Configure options for single barcode type. * @details MWB_setFlags configures options (if any) for decoder type specified in \a codeMask. * Options are given in \a flags as bitwise OR of option bits. Available options depend on selected decoder type. * @param[in] codeMask Single decoder type (MWB_CODE_MASK_...) * @param[in] flags ORed bit mask of selected decoder type options (MWB_FLAG_...) * @n <b>RSS decoder</b> - no configuration options * @n <b>Datamatrix decoder (DM)</b> * @n - MWB_CFG_DM_VIN_MODE - VIN code support for Datamatrix * @n <b>Code39 decoder</b> * @n - MWB_CFG_CODE39_VIN_MODE - VIN code support for Code39 * @n - MWB_CFG_CODE39_REQ_CHKSUM - Checksum check mandatory * * @retval MWB_RT_OK Success * @retval MWB_RT_FAIL No code found in image * @retval MWB_RT_BAD_PARAM Flag values out of range * @retval MWB_RT_NOT_SUPPORTED Flag values not supported for selected decoder */ extern int MWB_setFlags(const uint32_t codeMask, const uint32_t flags); /** * @brief Configure global library effort level * @details Barcode detector relies on image processing and geometry inerpolation for * extracting optimal data for decoding. Higher effort level involves more processing * and intermediate parameter values, thus increasing probability of successful * detection with low quality images, but also consuming more CPU time. * Although level is global on library level, each decoder type has its * own parameter set for each level. * * @param[in] level Effort level - available values are 1, 2, 3, 4 and 5. * * @retval MWB_RT_OK Success * @retval MWB_RT_BAD_PARAM Level out of range for selected decoder */ extern int MWB_setLevel(const int level); /** * @brief Configure scanning direction for 1D barcodes * @details This function enables some control over scanning lines choice * for 1D barcodes. By ORing available bit-masks user can add * one or more direction options to scanning lines set. * Density of lines and angle step for omni scan can be controlled * with MWB_setLevel API function. Available options are: * @n - MWB_SCANDIRECTION_HORIZONTAL - horizontal lines * @n - MWB_SCANDIRECTION_VERTICAL - vertical lines * @n - MWB_SCANDIRECTION_OMNI - omnidirectional lines * @n - MWB_SCANDIRECTION_AUTODETECT - enables BarcodeScanner's * autodetection of barcode direction * * @param[in] direction ORed bit mask of direction modes given with * MWB_SCANDIRECTION_... bit-masks * * @retval MWB_RT_OK Success * @retval MWB_RT_BAD_PARAM Direction out of range */ extern int MWB_setDirection(const uint32_t direction); /** * Check if code is a valid Vehicle Identification Number. * * @param[in] vin Input code string. * @param[in] length Length of input string. * * @retval >=0 Position of detected VIN * @retval MWB_RT_FAIL Code is not a valid VIN */ extern int MWB_validateVIN(char *vin, int length); /** * @brief QR debug helper. * @details Returns list of coordinates of key points in QR symbol in last * scanned image. * @param[out] buffer User provided buffer to be filled with * coordinates * @param[in] maxLength Buffer size - max number of points * multiplied by two * @retval > 0 Number of points in buffer */ extern int MWB_getPointsQR(float *buffer, int maxLength); extern int MWB_getPointsAZTEC(float *buffer, int maxLength); #ifdef __cplusplus } #endif #endif /* _BARCODESCANNER_H_ */
38.744186
126
0.627051
[ "geometry" ]
630150466133f2d17d41e5b3eec2f47c80b8672d
6,067
c
C
v3/lib/testdata/bug/sqlite2.c
zchee/cznic-ccgo
b552a7d16ef3c3d801f2439c756cdfc7d02b8060
[ "BSD-3-Clause" ]
null
null
null
v3/lib/testdata/bug/sqlite2.c
zchee/cznic-ccgo
b552a7d16ef3c3d801f2439c756cdfc7d02b8060
[ "BSD-3-Clause" ]
null
null
null
v3/lib/testdata/bug/sqlite2.c
zchee/cznic-ccgo
b552a7d16ef3c3d801f2439c756cdfc7d02b8060
[ "BSD-3-Clause" ]
null
null
null
typedef struct Expr Expr; typedef struct Table Table; typedef struct Column Column; struct Column { char *zName; /* Name of this column, \000, then the type */ Expr *pDflt; /* Default value of this column */ char *zColl; /* Collating sequence. If NULL, use the default */ unsigned char notNull; /* An OE_ code for handling a NOT NULL constraint */ char affinity; /* One of the SQLITE_AFF_... values */ unsigned char szEst; /* Estimated size of value in this column. sizeof(INT)==1 */ unsigned char colFlags; /* Boolean properties. See COLFLAG_ defines below */ }; struct Table { char *zName; /* Name of the table or view */ Column *aCol; /* Information about each column */ void /*Index*/ *pIndex; /* List of SQL indexes on this table. */ void /*Select*/ *pSelect; /* NULL for tables. Points to definition if a view. */ void /*FKey*/ *pFKey; /* Linked list of all foreign keys in this table */ char *zColAff; /* String defining the affinity of each column */ void /*ExprList*/ *pCheck; /* All CHECK constraints */ /* ... also used as column name list in a VIEW */ int tnum; /* Root BTree page for this table */ unsigned nTabRef; /* Number of pointers to this Table */ unsigned tabFlags; /* Mask of TF_* values */ short iPKey; /* If not negative, use aCol[iPKey] as the rowid */ short nCol; /* Number of columns in this table */ int /*LogEst*/ nRowLogEst; /* Estimated rows in table - from sqlite_stat1 table */ int /*LogEst*/ szTabRow; /* Estimated size of each table row in bytes */ #ifdef SQLITE_ENABLE_COSTMULT int /*LogEst*/ costMult; /* Cost multiplier for using this table */ #endif unsigned char keyConf; /* What to do in case of uniqueness conflict on iPKey */ #ifndef SQLITE_OMIT_ALTERTABLE int addColOffset; /* Offset in CREATE TABLE stmt to add a new column */ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE int nModuleArg; /* Number of arguments to the module */ char **azModuleArg; /* 0: module 1: schema 2: vtab name 3...: args */ void /*VTable*/ *pVTable; /* List of VTable objects. */ #endif void /*Trigger*/ *pTrigger; /* List of triggers stored in pSchema */ void /*Schema*/ *pSchema; /* Schema that contains this table */ Table *pNextZombie; /* Next on the Parse.pZombieTab list */ }; struct Expr { unsigned char op; /* Operation performed by this node */ char affExpr; /* affinity, or RAISE type */ unsigned flags; /* Various flags. EP_* See below */ union { char *zToken; /* Token value. Zero terminated and dequoted */ int iValue; /* Non-negative integer value if EP_IntValue */ } u; /* If the EP_TokenOnly flag is set in the Expr.flags mask, then no ** space is allocated for the fields below this point. An attempt to ** access them will result in a segfault or malfunction. *********************************************************************/ Expr *pLeft; /* Left subnode */ Expr *pRight; /* Right subnode */ union { void /*ExprList*/ *pList; /* op = IN, EXISTS, SELECT, CASE, FUNCTION, BETWEEN */ void /*Select*/ *pSelect; /* EP_xIsSelect and op = IN, EXISTS, SELECT */ } x; /* If the EP_Reduced flag is set in the Expr.flags mask, then no ** space is allocated for the fields below this point. An attempt to ** access them will result in a segfault or malfunction. *********************************************************************/ #if SQLITE_MAX_EXPR_DEPTH>0 int nHeight; /* Height of the tree headed by this node */ #endif int iTable; /* TK_COLUMN: cursor number of table holding column ** TK_REGISTER: register number ** TK_TRIGGER: 1 -> new, 0 -> old ** EP_Unlikely: 134217728 times likelihood ** TK_IN: ephemerial table holding RHS ** TK_SELECT_COLUMN: Number of columns on the LHS ** TK_SELECT: 1st register of result vector */ int /*ynVar*/ iColumn; /* TK_COLUMN: column index. -1 for rowid. ** TK_VARIABLE: variable number (always >= 1). ** TK_SELECT_COLUMN: column of the result vector */ short iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */ short iRightJoinTable; /* If EP_FromJoin, the right table of the join */ unsigned char op2; /* TK_REGISTER/TK_TRUTH: original value of Expr.op ** TK_COLUMN: the value of p5 for OP_Column ** TK_AGG_FUNCTION: nesting depth */ void /*AggInfo*/ *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */ union { Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL ** for a column of an index on an expression */ void /*Window*/ *pWin; /* EP_WinFunc: Window/Filter defn for a function */ struct { /* TK_IN, TK_SELECT, and TK_EXISTS */ int iAddr; /* Subroutine entry address */ int regReturn; /* Register used to hold return address */ } sub; } y; }; void f1(Column c) { __builtin_printf("%i: c.zColl %s\n", __LINE__, c.zColl); } void f2(Column *cols) { __builtin_printf("%i: cols[1].zColl %s\n", __LINE__, cols[1].zColl); } Table table; Table *pTab = &table; void f3(Table *pTab) { __builtin_printf("%i: pTab->aCol[1].zColl %s\n", __LINE__, pTab->aCol[1].zColl); } Expr expr; void f4(Expr *p) { __builtin_printf("%i: p->y.pTab->aCol[1].zColl %s\n", __LINE__, p->y.pTab->aCol[1].zColl); } // const char *zColl = p->y.pTab->aCol[j].zColl; int main() { Column c; c.zColl = "foo"; f1(c); Column *cols = __builtin_malloc(3*sizeof(Column)); cols[1] = c; f2(cols); table.aCol = cols; f3(pTab); expr.y.pTab = pTab; f4(&expr); }
43.335714
92
0.589748
[ "vector" ]
630d44c7092ce62429245b6554c2247b69023d0b
2,384
h
C
ROBOTIS/ROBOTIS-Math/robotis_math/include/robotis_math/minimum_jerk_trajectory_with_via_point.h
andy-Chien/timda_dual_arm
94170d8889218ea0dc4e6031dcbbf59b7e37e70c
[ "MIT" ]
227
2021-01-20T05:34:32.000Z
2022-03-29T12:43:05.000Z
ROBOTIS/ROBOTIS-Math/robotis_math/include/robotis_math/minimum_jerk_trajectory_with_via_point.h
andy-Chien/timda_dual_arm
94170d8889218ea0dc4e6031dcbbf59b7e37e70c
[ "MIT" ]
12
2019-05-14T12:24:02.000Z
2020-03-24T14:00:48.000Z
ROBOTIS/ROBOTIS-Math/robotis_math/include/robotis_math/minimum_jerk_trajectory_with_via_point.h
andy-Chien/timda_dual_arm
94170d8889218ea0dc4e6031dcbbf59b7e37e70c
[ "MIT" ]
239
2021-01-28T02:59:53.000Z
2022-03-29T08:02:17.000Z
/******************************************************************************* * Copyright 2018 ROBOTIS CO., LTD. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ #ifndef ROBOTIS_MATH_MINIMUM_JERK_TRAJECTORY_WITH_VIA_POINT_H_ #define ROBOTIS_MATH_MINIMUM_JERK_TRAJECTORY_WITH_VIA_POINT_H_ #define EIGEN_NO_DEBUG #define EIGEN_NO_STATIC_ASSERT #include "robotis_linear_algebra.h" #include "robotis_math_base.h" #include <ros/ros.h> #include <stdint.h> #include <vector> namespace robotis_framework { class MinimumJerkViaPoint { public: MinimumJerkViaPoint(double ini_time, double fin_time, double via_time, double ratio, std::vector<double_t> ini_pos, std::vector<double_t> ini_vel, std::vector<double_t> ini_acc, std::vector<double_t> fin_pos, std::vector<double_t> fin_vel, std::vector<double_t> fin_acc, std::vector<double_t> via_pos, std::vector<double_t> via_vel, std::vector<double_t> via_acc); virtual ~MinimumJerkViaPoint(); std::vector<double_t> getPosition(double time); std::vector<double_t> getVelocity(double time); std::vector<double_t> getAcceleration(double time); double cur_time_; std::vector<double_t> cur_pos_; std::vector<double_t> cur_vel_; std::vector<double_t> cur_acc_; Eigen::MatrixXd position_coeff_; Eigen::MatrixXd velocity_coeff_; Eigen::MatrixXd acceleration_coeff_; Eigen::MatrixXd time_variables_; private: int number_of_joint_; double ratio_; double input_ini_time_, input_fin_time_; double ini_time_, fin_time_, via_time_; std::vector<double_t> ini_pos_, ini_vel_, ini_acc_; std::vector<double_t> fin_pos_, fin_vel_, fin_acc_; std::vector<double_t> via_pos_, via_vel_, via_acc_; }; } #endif /* ROBOTIS_MATH_MINIMUM_JERK_TRAJECTORY_WITH_VIA_POINT_H_ */
34.550725
115
0.708054
[ "vector" ]
63190ec4c471e821d2f580e795381c334c5b0f4b
1,838
h
C
engine/source/system/physics/material/physics_material.h
skarab/coffee-master
6c3ff71b7f15735e41c9859b6db981b94414c783
[ "MIT" ]
null
null
null
engine/source/system/physics/material/physics_material.h
skarab/coffee-master
6c3ff71b7f15735e41c9859b6db981b94414c783
[ "MIT" ]
null
null
null
engine/source/system/physics/material/physics_material.h
skarab/coffee-master
6c3ff71b7f15735e41c9859b6db981b94414c783
[ "MIT" ]
null
null
null
#ifndef _COFFEE_PHYSICS_MATERIAL_H_ #define _COFFEE_PHYSICS_MATERIAL_H_ #include "coffee_includes.h" #include "kernel/basic/basic.h" #include "kernel/resource/resources.h" namespace coffee { namespace physics { //--------------------------------------------------------------------------------------------// /// Defines the physical properties //--------------------------------------------------------------------------------------------// class COFFEE_API Material : public resource::Object { COFFEE_Resource(Material); public: //-CONSTRUCTORS---------------------------------------------------------------------------// Material(); ~Material(); //-ACCESSORS------------------------------------------------------------------------------// void SetElasticity(real elasticity); real GetElasticity() const { return _Elasticity.Get(); } void SetSoftness(real softness); real GetSoftness() const { return _Softness.Get(); } void SetStaticFriction(real static_friction); real GetStaticFriction() const { return _StaticFriction.Get(); } void SetKineticFriction(real kinetic_friction); real GetKineticFriction() const { return _KineticFriction.Get(); } void SetIsCollidable(bool it_is_collidable); bool IsCollidable() const { return _ItIsCollidable.Get(); } private: //-ATTRIBUTES-----------------------------------------------------------------------------// resource::Property<real> _Elasticity; resource::Property<real> _Softness; resource::Property<real> _StaticFriction; resource::Property<real> _KineticFriction; resource::Property<bool> _ItIsCollidable; }; COFFEE_RegisterType(COFFEE_EXPORT_STATICS, Material); } } #endif
34.037037
100
0.519042
[ "object" ]
466e8925513212081da9d3e0ff3809657e976ad8
9,991
h
C
library/include/m2etis/pubsub/routing/ScribeRouting.h
ClockworkOrigins/m2etis
3b9c0f98c172f48889e75fe0b80a61a0e47670f5
[ "Apache-2.0" ]
2
2016-01-24T22:08:27.000Z
2017-01-01T13:06:44.000Z
library/include/m2etis/pubsub/routing/ScribeRouting.h
ClockworkOrigins/m2etis
3b9c0f98c172f48889e75fe0b80a61a0e47670f5
[ "Apache-2.0" ]
null
null
null
library/include/m2etis/pubsub/routing/ScribeRouting.h
ClockworkOrigins/m2etis
3b9c0f98c172f48889e75fe0b80a61a0e47670f5
[ "Apache-2.0" ]
null
null
null
/* Copyright (2016) Michael Baer, Daniel Bonrath, All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * \addtogroup pubsub * @{ */ #ifndef __M2ETIS_PUBSUB_ROUTING_SCRIBEROUTING_H__ #define __M2ETIS_PUBSUB_ROUTING_SCRIBEROUTING_H__ #include <algorithm> #include <string> #include <vector> #include "m2etis/message/MessageType.h" #include "m2etis/message/info/routing/ScribeRoutingInfo.h" #include "m2etis/pubsub/PubSubSystemEnvironment.h" #include "boost/thread.hpp" namespace m2etis { namespace pubsub { namespace routing { template<class NetworkType> class ScribeRouting : public BaseRouting<NetworkType> { public: typedef message::ScribeRoutingInfo<NetworkType> RoutingInfoType; typedef std::vector<typename NetworkType::Key> KeyList; typedef std::pair<uint64_t, typename NetworkType::Key> TimePair; typedef std::vector<TimePair> TimeList; // [EOC] The next variables are more or less generic to all // routing policies and describe their behavior! // whether or not to register for subscribe messages in forward static const bool register_forward_subscribe = true; // whether or not to register for subscribe messages in deliver static const bool register_deliver_subscribe = false; // whether or not to register for unsubscribe messages in forward static const bool register_forward_unsubscribe = true; // whether or not to register for unsubscribe messages in deliver static const bool register_deliver_unsubscribe = false; // [EOC] // whether or not to activate an automatic periodic resent subscribtion static const bool periodicSubscribtion = true; // the time_duration between resent periodic subscribtions const uint64_t periodic_; // the time_duration to decide if a subscriber is purged form the list const uint64_t purge_distance_; PubSubSystemEnvironment * _pssi; // inform listener, whether a subscriber has been purged, e.g. by timeout // currently only needed for filter strategies boost::function<void(const typename NetworkType::Key)> removed_subscriber_eventlistener_; uint64_t purgeID_; ScribeRouting(const uint16_t topic_name, PubSubSystemEnvironment * pssi, const typename NetworkType::Key & root) : BaseRouting<NetworkType>(topic_name, pssi) , periodic_(scribe::RESUBSCRIPTION_INTERVAL), purge_distance_(scribe::PURGE_DISTANCE), _pssi(pssi) , topic_name_(topic_name), self_(), subscribed_(false), subscriber_() , purging_(true), _root(root) { purgeID_ = pssi->scheduler_.runRepeated(purge_distance_, boost::bind(&ScribeRouting::purgeList, this), 0); } virtual ~ScribeRouting() { purging_ = false; _pssi->scheduler_.stop(purgeID_); } void setSelf(const typename NetworkType::Key & self) { self_ = self; } void setUnsubscriptionListener(const boost::function<void(const typename NetworkType::Key)> & listener) { removed_subscriber_eventlistener_ = listener; } // set the self subscription status void selfSubscribed(const bool b) { subscribed_ = b; } // get the self subscribtion status bool selfSubscribed() const { return subscribed_; } void configureRoutingInfo(message::ActionType & msgType, typename message::RoutingInfo<NetworkType>::Ptr routingInfo, typename NetworkType::Key & receiver) { typename RoutingInfoType::Ptr rInfo = cast(routingInfo); switch (msgType) { case message::SUBSCRIBE: { msgType = message::SUBSCRIBE; break; } case message::UNSUBSCRIBE: { msgType = message::UNSUBSCRIBE; break; } case message::PUBLISH: { msgType = message::PUBLISH; break; } default: { M2ETIS_LOG_ERROR("Scribe Routing", "configureRoutingInfo called with wrong action type"); } } } KeyList getTargetNodes(const message::ActionType mtype, typename message::RoutingInfo<NetworkType>::Ptr routingInfo, typename NetworkType::Key & receiver) const { typename RoutingInfoType::Ptr rInfo = cast(routingInfo); /* * All messages must be sent to root. * Even if it's a publishmessage and root is subscribed, too. * In deliver::publish, root will take care to deliver the message and spread it to the subscribers. */ KeyList m; if (mtype == message::SUBSCRIBE || mtype == message::UNSUBSCRIBE) { // If the current node is root, then we don't need to send a message to ourself! if (self_ == _root) { return m; } m.push_back(_root); } else if (mtype == message::PUBLISH) { // TODO: (???) use the IP address if it is known, publish messages are sent to the root who starts the distribution // if root is not known, use pastry routing to localize it m.push_back(_root); } else { // message must be published, that means from root to subscribers // Simply return a list of subscribed nodes // That's nicer than for_each and push_back, isn't it? // std::transform is really good! struct T { static typename NetworkType::Key get_from_pair(const ScribeRouting::TimePair & p) { return p.second; } }; m.resize(subscriber_.size()); std::transform(subscriber_.begin(), subscriber_.end(), m.begin(), T::get_from_pair); } return m; } bool processSubscribePayload(typename message::RoutingInfo<NetworkType>::Ptr routingInfo, const typename NetworkType::Key & sender, typename NetworkType::Key & receiver, message::ActionType & msgType) { if (sender == self_) { // TODO: (Daniel) hack, not sure that's right, but otherwise nodes subscribe on itself return false; } typename RoutingInfoType::Ptr rInfo = cast(routingInfo); bool found = false; typename TimeList::iterator iter; for (iter = subscriber_.begin(); iter != subscriber_.end(); ++iter) { if (iter->second == sender) { found = true; break; } } if (found) { // update entry iter->first = _pssi->clock_.getTime(); } else { // insert entry subscriber_.push_back(std::make_pair(_pssi->clock_.getTime(), sender)); } // stop the subscribe message if (selfSubscribed()) { rInfo->action = message::RoutingInfo<NetworkType>::RoutingType::STOP; } return true; } void processUnsubscribePayload(typename message::RoutingInfo<NetworkType>::Ptr routingInfo, const typename NetworkType::Key & sender, typename NetworkType::Key & receiver, message::ActionType & msgType) { // TODO: (???) use subscribed_ to check if I am a subscriber or just forwarder struct T { static bool test(const typename NetworkType::Key & send, const TimePair & paar) { return paar.second == send; } }; subscriber_.erase(std::remove_if(subscriber_.begin(), subscriber_.end(), boost::bind(T::test, sender, _1)), subscriber_.end()); } /** * Handle a publish message */ void processPublishPayload(typename message::RoutingInfo<NetworkType>::Ptr routingInfo, const typename NetworkType::Key & sender, typename NetworkType::Key & receiver, message::ActionType & msgType) { M2ETIS_LOG_INFO("Received Publish msg", ""); typename RoutingInfoType::Ptr rInfo = cast(routingInfo); msgType = message::NOTIFY; } void processNotifyPayload(typename message::RoutingInfo<NetworkType>::Ptr routingInfo, const typename NetworkType::Key & sender, typename NetworkType::Key & receiver, message::ActionType & msgType) { } void processControlPayload(typename message::RoutingInfo<NetworkType>::Ptr routingInfo, const typename NetworkType::Key & sender, typename NetworkType::Key & receiver, message::ActionType & msgType) { return; } private: // The topic name const uint16_t topic_name_; // The own key of this actual node typename NetworkType::Key self_; // Is this node subscribed on the topic? bool subscribed_; // List of all subscribers (TimeStamp and Key) TimeList subscriber_; // Control variables for the purging thread boost::thread purger_; volatile bool purging_; typename NetworkType::Key _root; typename RoutingInfoType::Ptr cast(typename message::RoutingInfo<NetworkType>::Ptr ptr) const { typename RoutingInfoType::Ptr ret = boost::dynamic_pointer_cast<RoutingInfoType>(ptr); if (!ret) { M2ETIS_LOG_ERROR("Routing Strategy", "Downcast error of routingInfo"); } return ret; } bool purgeList() { // Helper-Struct to create a specialized method which can be used to generically erase from a vector struct T { static bool test(const uint64_t & p, const uint64_t & jetzt, const ScribeRouting::TimePair & paar) { if ((jetzt - paar.first) > p) { return true; } return false; } }; if (subscriber_.empty()) { return true; } // lock the list // get the acutal timestamp // and remove every subscriber which hasn't resubscribed within the "purge_distance" uint64_t jetzt = _pssi->clock_.getTime(); auto iter_first_erased_subscriber = std::remove_if(subscriber_.begin(), subscriber_.end(), boost::bind(T::test, purge_distance_, jetzt, _1)); // notify listeners about erased subscribers: for (auto iter_subscriber = iter_first_erased_subscriber; iter_subscriber != subscriber_.end(); ++iter_subscriber) { removed_subscriber_eventlistener_(iter_subscriber->second); } subscriber_.erase(iter_first_erased_subscriber, subscriber_.end()); return true; } }; } /* namespace routing */ } /* namespace pubsub */ } /* namespace m2etis */ #endif /* __M2ETIS_PUBSUB_ROUTING_SCRIBEROUTING_H__ */ /** * @} */
34.215753
206
0.717145
[ "vector", "transform" ]
4676d24ca934b86e1c48dcedcb8c073ee90a6f8d
3,155
h
C
src/pf_imgui/elements/MarkdownText.h
PetrFlajsingr/pf_imgui
ffddd99d0e01e03f829108294de7c5f13afa9281
[ "MIT" ]
13
2021-04-19T12:29:30.000Z
2022-03-27T10:54:11.000Z
src/pf_imgui/elements/MarkdownText.h
PetrFlajsingr/pf_imgui
ffddd99d0e01e03f829108294de7c5f13afa9281
[ "MIT" ]
34
2021-01-22T19:16:28.000Z
2022-03-31T19:06:29.000Z
src/pf_imgui/elements/MarkdownText.h
PetrFlajsingr/pf_imgui
ffddd99d0e01e03f829108294de7c5f13afa9281
[ "MIT" ]
4
2021-01-22T18:44:41.000Z
2021-11-19T04:40:31.000Z
// // Created by petr on 5/22/21. // #ifndef PF_IMGUI_MARKDOWNTEXT_H #define PF_IMGUI_MARKDOWNTEXT_H #include <imgui.h> #include <imgui_markdown.h> #include <pf_imgui/ImGuiInterface.h> #include <pf_imgui/interface/ItemElement.h> namespace pf::ui::ig { namespace details { struct FontData { ImFont *fontH1 = nullptr; ImFont *fontH2 = nullptr; ImFont *fontH3 = nullptr; }; static inline FontData DefaultFontData; } /** * @brief Markdown text render area. * * @todo: custom font * @todo: style? * @todo: link icon by user * @todo: tooltip callback */ class PF_IMGUI_EXPORT MarkdownText : public ItemElement { public: struct ImageData { ImTextureID textureId; Size size; }; using ImageLoader = std::function<std::optional<ImageData>(std::string_view)>; struct FontDefault; /** * Construct MarkdownText. * @param elementName ID of the element * @param imguiInterface for automatic font upload @todo: change this * @param markdownSrc markdown source to render * @param fontSize size of font * @param imageLoader function for image loading & texture creation, arg is path to load */ explicit MarkdownText(const std::string &elementName, ImGuiInterface &imguiInterface, std::u8string markdownSrc = u8"", float fontSize = 12.f, std::optional<ImageLoader> imageLoader = std::nullopt); /** * Get currently rendered markdown source. * @return currently rendered markdown source */ [[nodiscard]] const std::u8string &getMarkdownSrc() const; /** * Set markdown source to be rendered * @param markdownSrc source to render */ void setMarkdownSrc(const std::u8string &markdownSrc); /** * Get current font size. * @return current font size */ [[nodiscard]] float getFontSize() const; /** * Set new font size. * @param fontSize new font size */ void setFontSize(float fontSize); /** * Set callback for user clicking a link. * @param onLinkClicked callback - first argument is link itself, second is true if it is an image */ void setOnLinkClicked(const std::function<void(std::string_view, bool)> &onLinkClicked); /** * Set function for image loading & texture creation. * @param imageLoader function for image loading & texture creation, arg is path to load */ void setImageLoader(ImageLoader imageLoader); // TODO: static void SetFont(ImFont *font, ImGuiInterface &imGuiInterface); protected: void renderImpl() override; private: void configure(); void loadHeaderFonts(); static void MarkdownFormatCallback(const ImGui::MarkdownFormatInfo &markdownFormatInfo, bool start); static void MarkdownLinkCallback(ImGui::MarkdownLinkCallbackData data); static ImGui::MarkdownImageData MarkdownImageCallback(ImGui::MarkdownLinkCallbackData data); ImGui::MarkdownConfig markdownConfig; ImGuiInterface &imGuiInterface; std::u8string markdownSrc; float fontSize = 12.f; std::function<void(std::string_view, bool)> onLinkClicked = [](auto, auto) {}; std::optional<ImageLoader> loadImage = std::nullopt; }; }// namespace pf::ui::ig #endif//PF_IMGUI_MARKDOWNTEXT_H
29.485981
102
0.713471
[ "render" ]
46851a650419e5752a5c2007d0a09b2d7699e8be
26,568
h
C
include/cutlass/epilogue/threadblock/predicated_tile_iterator.h
MegEngine/cutlass-bak
f6272f0d74df54af1358fd399f9bc6d3d5f3fb4e
[ "BSD-3-Clause" ]
2
2020-10-26T11:15:57.000Z
2022-01-16T03:58:31.000Z
include/cutlass/epilogue/threadblock/predicated_tile_iterator.h
MegEngine/cutlass-bak
f6272f0d74df54af1358fd399f9bc6d3d5f3fb4e
[ "BSD-3-Clause" ]
null
null
null
include/cutlass/epilogue/threadblock/predicated_tile_iterator.h
MegEngine/cutlass-bak
f6272f0d74df54af1358fd399f9bc6d3d5f3fb4e
[ "BSD-3-Clause" ]
null
null
null
/*************************************************************************************************** * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without *modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, *this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. * * Neither the name of the NVIDIA CORPORATION nor the names of its *contributors may be used to endorse or promote products derived from this *software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" *AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY DIRECT, *INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY *OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TOR (INCLUDING *NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, *EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * **************************************************************************************************/ /*! \file \brief Epilogue for threadblock scoped GEMMs using Tensor Ops. The epilogue rearranges the result of a matrix product through shared memory to match canonical tensor layouts in global memory. Epilogues support conversion and reduction operations. */ /** * \file include/cutlass/epilogue/threadblock/predicated_tile_iterator.h * * Copyright (c) 2014-2020 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #pragma once #include "cutlass/arch/memory.h" #include "cutlass/array.h" #include "cutlass/cutlass.h" #include "cutlass/epilogue/threadblock/output_tile_thread_map.h" #include "cutlass/layout/matrix.h" #include "cutlass/layout/tensor.h" #include "cutlass/matrix_shape.h" #include "cutlass/numeric_types.h" #include "cutlass/tensor_ref.h" #include "cutlass/transform/pitch_linear_thread_map.h" //////////////////////////////////////////////////////////////////////////////// namespace cutlass { //////////////////////////////////////////////////////////////////////////////// namespace epilogue { namespace threadblock { //////////////////////////////////////////////////////////////////////////////// /// Tile iterator used to load output tile from shared memory in epilogue. /// /// Satisfies: ReadableTileIterator | PredicatedTileIterator | /// ForwardTileIterator /// template <typename ThreadMap_, ///< Thread map (conept: OutputTileThreadMap) typename Element_ ///< Element data type > class PredicatedTileIterator { public: using ThreadMap = ThreadMap_; using Shape = typename ThreadMap::Shape; using Element = Element_; using Layout = layout::RowMajor; using TensorRef = TensorRef<Element, Layout>; using ConstTensorRef = typename TensorRef::ConstTensorRef; using Index = typename Layout::Index; using LongIndex = typename Layout::LongIndex; using TensorCoord = MatrixCoord; static int const kElementsPerAccess = ThreadMap::kElementsPerAccess; static int const kThreads = ThreadMap::kThreads; static int const kIterations = ThreadMap::Count::kTile; static_assert(ThreadMap::Iterations::kRow > 0, "ThreadMap::Iterations::kRow must be > 0"); static_assert(ThreadMap::Iterations::kGroup > 0, "ThreadMap::Iterations::kGroup must be > 0"); static_assert(ThreadMap::Iterations::kCluster > 0, "ThreadMap::Iterations::kCluster must be > 0"); static_assert(ThreadMap::Iterations::kColumn > 0, "ThreadMap::Iterations::kColumn must be > 0"); /// Fragment object using Fragment = Array<Element, ThreadMap::Iterations::kColumn * ThreadMap::Iterations::kRow * ThreadMap::Iterations::kGroup * ThreadMap::Iterations::kCluster * ThreadMap::kElementsPerAccess>; /// Memory access size using AccessType = AlignedArray<Element, ThreadMap::kElementsPerAccess>; // // Parameters struct // struct Params { // // Data members // LongIndex stride; ///< stride in bytes between rows LongIndex increment_row; ///< increment quantity (in bytes) to advance ///< when moving between rows LongIndex increment_group; ///< increment quantity (in bytes) to ///< advance when moving to the next group LongIndex increment_cluster; ///< increment quantity (in bytes) to ///< advance when moving to the next cluster LongIndex advance_row; ///< amount to add to move to the next 'row' ///< position LongIndex advance_group; ///< amount to add to move to the next 'group' ///< position LongIndex advance_cluster; ///< amount to add to move to the next ///< 'cluster' position LongIndex advance_tile; ///< amount to add to move to the next 'tile' // // Methods // CUTLASS_HOST_DEVICE Status initialize(Index stride_) { stride = LongIndex(stride_); increment_row = stride * ThreadMap::Delta::kRow; increment_group = stride * ThreadMap::Delta::kGroup - stride * ThreadMap::Delta::kRow * (ThreadMap::Iterations::kRow - 1); increment_cluster = stride * ThreadMap::Delta::kCluster - stride * ThreadMap::Delta::kGroup * (ThreadMap::Iterations::kGroup - 1) - stride * ThreadMap::Delta::kRow * (ThreadMap::Iterations::kRow - 1); advance_row = stride * ThreadMap::Shape::kRow; advance_group = stride * (ThreadMap::Shape::kGroup - 1) * ThreadMap::Shape::kRow * ThreadMap::Count::kRow; advance_cluster = stride * ThreadMap::Count::kGroup * ThreadMap::Shape::kGroup * ThreadMap::Count::kRow * ThreadMap::Shape::kRow; ; advance_tile = stride * ThreadMap::Shape::kGroup * ThreadMap::Shape::kRow * ThreadMap::Shape::kCluster * ThreadMap::Shape::kTile; return Status::kSuccess; } CUTLASS_HOST_DEVICE Params() { initialize(0); } CUTLASS_HOST_DEVICE Params(Layout const& layout) { initialize(layout.stride(0) * int(sizeof(AccessType)) / kElementsPerAccess); } }; /// Mask object struct Mask { static int const kCount = ThreadMap::Iterations::kColumn; /// Predicate state bool predicates[kCount]; // // Mask // CUTLASS_HOST_DEVICE Mask() { enable(); } ///< Efficiently disables all accesses guarded by mask CUTLASS_HOST_DEVICE void clear() { CUTLASS_PRAGMA_UNROLL for (int i = 0; i < kCount; ++i) { predicates[i] = false; } } ///< CUTLASS_HOST_DEVICE enables all accesses guarded by mask CUTLASS_DEVICE void enable() { CUTLASS_PRAGMA_UNROLL for (int i = 0; i < kCount; ++i) { predicates[i] = true; } } }; private: // // Data members // /// Parameters structure containing reference and precomputed state. Params params_; /// Byte-level pointer uint8_t* byte_pointer_; /// Array of boolean values to contain steady-state predicates Mask mask_; /// Extent of the matrix tile in rows Index extent_row_; /// A thread's starting row position (assuming steady-state predicates have /// been computed) Index thread_start_row_; /// Internal state counter int state_[3]; private: // // Methods // public: // // Methods // /// Constructor CUTLASS_DEVICE PredicatedTileIterator(Params const& params, Element* pointer, TensorCoord extent, int thread_idx, TensorCoord threadblock_offset = TensorCoord()) : params_(params) { TensorCoord thread_offset = ThreadMap::initial_offset(thread_idx) + threadblock_offset; extent_row_ = extent.row(); thread_start_row_ = thread_offset.row(); // Initialize predicates CUTLASS_PRAGMA_UNROLL for (int c = 0; c < ThreadMap::Iterations::kColumn; ++c) { mask_.predicates[c] = ((thread_offset.column() + ThreadMap::Delta::kColumn * c) < extent.column()); } // Initialize pointer byte_pointer_ = reinterpret_cast<uint8_t*>(pointer) + LongIndex(thread_offset.row()) * LongIndex(params_.stride) + LongIndex(thread_offset.column()) * sizeof(AccessType) / kElementsPerAccess; // Initialize internal state counter state_[0] = state_[1] = state_[2] = 0; } /// Adds a pointer offset in units of Element CUTLASS_HOST_DEVICE void add_pointer_offset(LongIndex pointer_offset) { byte_pointer_ += pointer_offset * sizeof_bits<Element>::value / 8; } /// Loads a fragment from memory CUTLASS_DEVICE void load_with_byte_offset(Fragment& frag, int64_t byte_offset) { uint8_t* byte_pointer = byte_pointer_; AccessType* frag_ptr = reinterpret_cast<AccessType*>(&frag); CUTLASS_PRAGMA_UNROLL for (int cluster = 0; cluster < ThreadMap::Iterations::kCluster; ++cluster) { CUTLASS_PRAGMA_UNROLL for (int group = 0; group < ThreadMap::Iterations::kGroup; ++group) { CUTLASS_PRAGMA_UNROLL for (int row = 0; row < ThreadMap::Iterations::kRow; ++row) { int frag_row_idx = (row + ThreadMap::Iterations::kRow * (group + ThreadMap::Iterations::kGroup * cluster)); int row_offset = row * ThreadMap::Delta::kRow + group * ThreadMap::Delta::kGroup + cluster * ThreadMap::Delta::kCluster; bool row_guard = ((row_offset + thread_start_row_) < extent_row_); AccessType* memory_pointer = reinterpret_cast<AccessType*>( byte_pointer + byte_offset); CUTLASS_PRAGMA_UNROLL for (int column = 0; column < ThreadMap::Iterations::kColumn; ++column) { bool guard = row_guard && mask_.predicates[column]; cutlass::arch::global_load<AccessType, sizeof(AccessType)>( frag_ptr[frag_row_idx * ThreadMap::Iterations:: kColumn + column], (void*)&memory_pointer [column * ThreadMap::Delta::kColumn / kElementsPerAccess], guard); } if (row + 1 < ThreadMap::Iterations::kRow) { byte_pointer += params_.increment_row; } } if (group + 1 < ThreadMap::Iterations::kGroup) { byte_pointer += params_.increment_group; } } if (cluster + 1 < ThreadMap::Iterations::kCluster) { byte_pointer += params_.increment_cluster; } } } /// Loads a fragment from memory CUTLASS_DEVICE void load(Fragment& frag) { load_with_byte_offset(frag, 0); } /// Stores a fragment to memory CUTLASS_DEVICE void store_with_byte_offset(Fragment const& frag, int64_t byte_offset) { uint8_t* byte_pointer = byte_pointer_; AccessType const* frag_ptr = reinterpret_cast<AccessType const*>(&frag); CUTLASS_PRAGMA_UNROLL for (int cluster = 0; cluster < ThreadMap::Iterations::kCluster; ++cluster) { CUTLASS_PRAGMA_UNROLL for (int group = 0; group < ThreadMap::Iterations::kGroup; ++group) { CUTLASS_PRAGMA_UNROLL for (int row = 0; row < ThreadMap::Iterations::kRow; ++row) { int frag_row_idx = (row + ThreadMap::Iterations::kRow * (group + ThreadMap::Iterations::kGroup * cluster)); int row_offset = row * ThreadMap::Delta::kRow + group * ThreadMap::Delta::kGroup + cluster * ThreadMap::Delta::kCluster; bool row_guard = ((row_offset + thread_start_row_) < extent_row_); AccessType* memory_pointer = reinterpret_cast<AccessType*>( byte_pointer + byte_offset); CUTLASS_PRAGMA_UNROLL for (int column = 0; column < ThreadMap::Iterations::kColumn; ++column) { bool guard = row_guard && mask_.predicates[column]; cutlass::arch::global_store<AccessType, sizeof(AccessType)>( frag_ptr[frag_row_idx * ThreadMap::Iterations:: kColumn + column], (void*)&memory_pointer [column * ThreadMap::Delta::kColumn / kElementsPerAccess], guard); } if (row + 1 < ThreadMap::Iterations::kRow) { byte_pointer += params_.increment_row; } } if (group + 1 < ThreadMap::Iterations::kGroup) { byte_pointer += params_.increment_group; } } if (cluster + 1 < ThreadMap::Iterations::kCluster) { byte_pointer += params_.increment_cluster; } } } /// Stores a fragment to memory CUTLASS_DEVICE void store(Fragment const& frag) { store_with_byte_offset(frag, 0); } /// Advances to the next position to load or store CUTLASS_HOST_DEVICE PredicatedTileIterator& operator++() { ++state_[0]; byte_pointer_ += params_.advance_row; thread_start_row_ += ThreadMap::Shape::kRow; if (state_[0] == ThreadMap::Count::kRow) { state_[0] = 0; ++state_[1]; byte_pointer_ += params_.advance_group; thread_start_row_ += (ThreadMap::Shape::kGroup - 1) * ThreadMap::Shape::kRow * ThreadMap::Count::kRow; if (state_[1] == ThreadMap::Count::kGroup) { state_[1] = 0; ++state_[2]; byte_pointer_ += params_.advance_cluster; thread_start_row_ += ThreadMap::Count::kGroup * ThreadMap::Shape::kGroup * ThreadMap::Count::kRow * ThreadMap::Shape::kRow; if (state_[2] == ThreadMap::Count::kCluster) { state_[2] = 0; byte_pointer_ += params_.advance_tile; } } } return *this; } ///< Efficiently disables all accesses guarded by mask CUTLASS_DEVICE void clear_mask() { mask_.clear(); } ///< Efficiently enables all accesses guarded by mask CUTLASS_DEVICE void enable_mask() { mask_.enable(); } ///< Sets the mask CUTLASS_DEVICE void get_mask(Mask& mask) { return mask_; } ///< Sets the mask CUTLASS_DEVICE void set_mask(Mask const& mask) { mask_ = mask; } }; //////////////////////////////////////////////////////////////////////////////// /// Tile iterator used to load output tile from shared memory in epilogue. /// /// Satisfies: ReadableTileIterator | InterleavedPredicatedTileIterator | /// ForwardTileIterator /// template <typename ThreadMap_, ///< Thread map (conept: OutputTileThreadMap) typename Element_, ///< Element data type int InterleavedN ///< Number of Interleaved N > class InterleavedPredicatedTileIterator { public: using ThreadMap = ThreadMap_; using Element = Element_; using Layout = layout::ColumnMajorInterleaved<InterleavedN>; using TensorRef = TensorRef<Element, Layout>; using ConstTensorRef = typename TensorRef::ConstTensorRef; using Index = typename Layout::Index; using LongIndex = typename Layout::LongIndex; using TensorCoord = layout::PitchLinearCoord; static int const kElementsPerAccess = ThreadMap::kElementsPerAccess; static int const kThreads = ThreadMap::kThreads; static int const kIterations = ThreadMap::Iterations::kCount; /// Fragment object using Fragment = Array<Element, ThreadMap::kElementsPerAccess>; /// Memory access size using AccessType = AlignedArray<Element, ThreadMap::kElementsPerAccess>; // // Parameters struct // struct Params { // // Data members // LongIndex stride; ///< stride in bytes between columns LongIndex advance_row; ///< amount to add to move to the next 'row' ///< position LongIndex advance_column; ///< amount to add to move to the next ///< 'column' position // // Methods // CUTLASS_HOST_DEVICE Status initialize(Index stride_) { stride = LongIndex(stride_); advance_row = ThreadMap::Delta::kContiguous * sizeof_bits<Element>::value / 8; advance_column = LongIndex(stride_) - ThreadMap::Iterations::kContiguous * kElementsPerAccess * sizeof_bits<Element>::value * ThreadMap::kWarpSize / 8; return Status::kSuccess; } CUTLASS_HOST_DEVICE Params() { initialize(0); } CUTLASS_HOST_DEVICE Params(Layout const& layout) { initialize(layout.stride(0) * int(sizeof(AccessType)) / kElementsPerAccess); } }; /// Mask object struct Mask { static int const kCount = (ThreadMap::Iterations::kContiguous < 8) ? 8 : ThreadMap::Iterations::kContiguous; /// Predicate state bool predicates[kCount]; // // Mask // CUTLASS_HOST_DEVICE Mask() { enable(); } ///< Efficiently disables all accesses guarded by mask CUTLASS_HOST_DEVICE void clear() { CUTLASS_PRAGMA_UNROLL for (int i = 0; i < kCount; ++i) { predicates[i] = false; } } ///< CUTLASS_HOST_DEVICE enables all accesses guarded by mask CUTLASS_DEVICE void enable() { CUTLASS_PRAGMA_UNROLL for (int i = 0; i < kCount; ++i) { predicates[i] = true; } } }; private: // // Data members // /// Parameters structure containing reference and precomputed state. Params params_; /// Byte-level pointer uint8_t* byte_pointer_; /// Array of boolean values to contain steady-state predicates Mask mask_; /// Extent of the matrix tile in columns Index extent_col_; /// A thread's starting column position (assuming steady-state predicates /// have been computed) Index thread_start_col_; /// Internal iteration counter int iteration_contiguous_; int iteration_strided_; private: // // Methods // public: // // Methods // /// Constructor CUTLASS_DEVICE InterleavedPredicatedTileIterator(Params const& params, Element* pointer, TensorCoord extent, int thread_idx, TensorCoord threadblock_offset) : params_(params) { TensorCoord thread_offset = ThreadMap::initial_offset(thread_idx) + TensorCoord(threadblock_offset.contiguous() * InterleavedN, threadblock_offset.strided() / InterleavedN); extent_col_ = extent.strided() / InterleavedN; thread_start_col_ = thread_offset.strided(); // Initialize predicates CUTLASS_PRAGMA_UNROLL for (int c = 0; c < ThreadMap::Iterations::kContiguous; ++c) { mask_.predicates[c] = ((thread_offset.contiguous() + ThreadMap::Delta::kContiguous * c) < (extent.contiguous() * InterleavedN)); } // Initialize pointer byte_pointer_ = reinterpret_cast<uint8_t*>(pointer) + LongIndex(thread_offset.strided()) * LongIndex(params_.stride) + LongIndex(thread_offset.contiguous()) * sizeof(AccessType) / kElementsPerAccess; // Initialize internal state counter iteration_contiguous_ = iteration_strided_ = 0; } /// Adds a pointer offset in units of Element CUTLASS_HOST_DEVICE void add_pointer_offset(LongIndex pointer_offset) { byte_pointer_ += pointer_offset * sizeof_bits<Element>::value / 8; } /// Loads a fragment from memory CUTLASS_DEVICE void load(Fragment& frag) { uint8_t* byte_pointer = byte_pointer_; AccessType* frag_ptr = reinterpret_cast<AccessType*>(&frag); AccessType* memory_pointer = reinterpret_cast<AccessType*>(byte_pointer); int col_offset = iteration_strided_ * ThreadMap::Delta::kStrided; bool col_guard = ((thread_start_col_ + col_offset) < extent_col_); bool guard = col_guard && mask_.predicates[iteration_contiguous_]; cutlass::arch::global_load<AccessType, sizeof(AccessType)>( *frag_ptr, (void*)memory_pointer, guard); } /// Stores a fragment to memory CUTLASS_DEVICE void store(Fragment const& frag) { uint8_t* byte_pointer = byte_pointer_; AccessType const* frag_ptr = reinterpret_cast<AccessType const*>(&frag); AccessType* memory_pointer = reinterpret_cast<AccessType*>(byte_pointer); int col_offset = iteration_strided_ * ThreadMap::Delta::kStrided; bool col_guard = ((thread_start_col_ + col_offset) < extent_col_); bool guard = col_guard && mask_.predicates[iteration_contiguous_]; cutlass::arch::global_store<AccessType, sizeof(AccessType)>( *frag_ptr, (void*)memory_pointer, guard); } /// Overrides the internal iteration index CUTLASS_HOST_DEVICE void set_iteration_index(int iteration) { iteration_contiguous_ = iteration % ThreadMap::Iterations::kContiguous; iteration_strided_ = iteration / ThreadMap::Iterations::kContiguous; } /// Advances to the next position to load or store CUTLASS_HOST_DEVICE InterleavedPredicatedTileIterator& operator++() { ++iteration_contiguous_; byte_pointer_ += params_.advance_row; if (iteration_contiguous_ == ThreadMap::Iterations::kContiguous) { iteration_contiguous_ = 0; ++iteration_strided_; byte_pointer_ += params_.advance_column; if (iteration_strided_ == ThreadMap::Iterations::kStrided) { iteration_strided_ = 0; } } return *this; } ///< Efficiently disables all accesses guarded by mask CUTLASS_DEVICE void clear_mask() { mask_.clear(); } ///< Efficiently enables all accesses guarded by mask CUTLASS_DEVICE void enable_mask() { mask_.enable(); } ///< Sets the mask CUTLASS_DEVICE void get_mask(Mask& mask) { return mask_; } ///< Sets the mask CUTLASS_DEVICE void set_mask(Mask const& mask) { mask_ = mask; } }; /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// } // namespace threadblock } // namespace epilogue } // namespace cutlass ////////////////////////////////////////////////////////////////////////////////
35.854251
100
0.548893
[ "object", "shape", "transform" ]
468537e197a47cb807463fe72b01a0ce37ea3bda
2,373
h
C
include/observables/TimeSliceObservable.h
benruijl/cdt
340f00488f46167112dbc763810d7ebfbd1056d5
[ "MIT" ]
1
2017-06-30T16:07:31.000Z
2017-06-30T16:07:31.000Z
include/observables/TimeSliceObservable.h
benruijl/cdt
340f00488f46167112dbc763810d7ebfbd1056d5
[ "MIT" ]
null
null
null
include/observables/TimeSliceObservable.h
benruijl/cdt
340f00488f46167112dbc763810d7ebfbd1056d5
[ "MIT" ]
1
2019-11-28T15:44:21.000Z
2019-11-28T15:44:21.000Z
/* * File: TimeSliceObservable.h * Author: bruijl * * Created on November 21, 2012, 2:41 PM */ #ifndef TIMESLICEOBSERVABLE_H #define TIMESLICEOBSERVABLE_H #include "Observable.h" #include <fstream> #include <boost/unordered_map.hpp> #include "Vertex.h" #define WINDING_ERROR 1 /** * This class tries to identify a time for each vertex. It uses the average * distance to a time slice */ class TimeSliceObservable : public Observable { private: std::string filename; typedef std::pair<double, double> averageLabel; typedef boost::unordered_map<Vertex*, averageLabel> vertexTimeLabel; vertexTimeLabel distance; VertSet timeslice; // time slice T = 0 double maxTime; VertSet loopCheck; // detect infinite loops /** * Calculate time labels recursively. * @param v Vertex to find time of * @param prev Previous vertex, fixing time orientation. This can be seen * as the vertex from the future. * @return Pair of sum of timelike links required to get from start to this * vertex and the number of paths. * */ averageLabel labelTime(Vertex* v, Vertex* prev); /** * Creates an initial minimal spacelike slice, which attempts to include * vertex start. This may not be possible in all cases. * @param start Vertex to start search from * @return Spacelike slice */ std::vector<Vertex*> createInitialSlice(Vertex* start); /** * Find shortest slice using breadth-first search. If the vertex start * is not a member of a slice, another slice in the search path is picked. * @param start Starting vertex * @param neighbour Neighbour of the vertex, specifying direction * @return Cycle */ std::vector<Vertex*> findShortestSlice(Vertex* start, Vertex* neighbour); void process(const std::vector<Vertex*>& state); public: TimeSliceObservable(unsigned long writeFrequency); virtual ~TimeSliceObservable(); void printToScreen(); void printToFile(); /** * Gets the time label of a vertex. * @param v Vertex * @return Time label */ double getTimeLabel(Vertex* v) { vertexTimeLabel::iterator it = distance.find(v); if (it == distance.end()) { return -1; } return it->second.first; } }; #endif /* TIMESLICEOBSERVABLE_H */
26.076923
79
0.667931
[ "vector" ]
46960eaf958256205592ee1e9a6e3aebb733a658
1,218
h
C
CptS122_PA9/GameObject.h
pjrader1/CptS122_PA9
8571f7d50eea73ada8c07ac69e1ce4e8044c858a
[ "Unlicense" ]
null
null
null
CptS122_PA9/GameObject.h
pjrader1/CptS122_PA9
8571f7d50eea73ada8c07ac69e1ce4e8044c858a
[ "Unlicense" ]
null
null
null
CptS122_PA9/GameObject.h
pjrader1/CptS122_PA9
8571f7d50eea73ada8c07ac69e1ce4e8044c858a
[ "Unlicense" ]
null
null
null
#pragma once #include <SFML/Graphics.hpp> #include <set> /** Base game object class that all other objects in the game extend from. */ class GameObject { public: /** Updates the object. @param gameObjects Global list of game objects. @param dt Time since last frame (change in time since last frame). */ virtual void update(std::set<GameObject*>& gameObjects, const sf::Time& dt) = 0; /** Draws the object to the window. @param window SFML Window to draw to. */ virtual void draw(sf::RenderWindow& window) = 0; /** Returns the position of the object. @return Position of the object. */ virtual const sf::Vector2f& getPosition() const = 0; /** Returns the rotation of the object, in degrees. @return Rotation of the object. */ virtual const float& getRotation() const = 0; /** Returns the bounding box of the object for collision detection. @return Bounding box of the object. */ virtual sf::FloatRect getBoundingBox() const = 0; /** Returns bool to indicate whether the object is ready to be deleted @return toDelete */ bool toDelete() { return _toDelete; } /** Sets toDelete value to true */ void setToDelete() { _toDelete = true; } protected: bool _toDelete = false; };
21.75
81
0.703612
[ "object" ]
469ecc8b1b5a193d751b8270444d88df6b1cd920
2,930
h
C
dp/util/FrameProfiler.h
asuessenbach/pipeline
2e49968cc3b9948a57f7ee6c4cc3258925c92ab2
[ "BSD-3-Clause" ]
217
2015-01-06T09:26:53.000Z
2022-03-23T14:03:18.000Z
dp/util/FrameProfiler.h
asuessenbach/pipeline
2e49968cc3b9948a57f7ee6c4cc3258925c92ab2
[ "BSD-3-Clause" ]
10
2015-01-25T12:42:05.000Z
2017-11-28T16:10:16.000Z
dp/util/FrameProfiler.h
asuessenbach/pipeline
2e49968cc3b9948a57f7ee6c4cc3258925c92ab2
[ "BSD-3-Clause" ]
44
2015-01-13T01:19:41.000Z
2022-02-21T21:35:08.000Z
// Copyright NVIDIA Corporation 2013 // 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 NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once #include <dp/util/Config.h> #include <dp/util/Timer.h> #include <string> #include <vector> namespace dp { namespace util { class FrameProfiler { public: DP_UTIL_API FrameProfiler(); DP_UTIL_API void beginFrame(); /** \brief Enable/disable the frame profiler. If the profiler is disabled it'll ignore. all addEntry calls. If the profiler is enabled it'll display the entries of the last frame. TODO Display the average values of the last frame. **/ DP_UTIL_API void setEnabled( bool enabled ); DP_UTIL_API bool isEnabled() const; /** \brief Time is in seconds **/ DP_UTIL_API void addEntry( std::string const& key, double time ); DP_UTIL_API void endFrame(); DP_UTIL_API static FrameProfiler& instance(); private: bool m_enabled; struct Entry { std::string key; double time; }; std::vector< Entry > m_entries; dp::util::Timer m_lastDisplay; }; class ProfileEntry { public: DP_UTIL_API ProfileEntry( std::string const& key ); DP_UTIL_API ~ProfileEntry(); private: std::string m_key; dp::util::Timer m_timer; }; } // namespace util } // namespace dp
34.069767
94
0.675085
[ "vector" ]
f225f1dfb9d957b91e00a1a43ee2c0dba52bbd14
1,415
h
C
bag_detection-master/src/bag_flip_detection_node.h
jamesxiu/Oystermaran2021
f3703bb220dc5b415942f90bd5761a9985381067
[ "MIT" ]
1
2021-09-08T14:22:50.000Z
2021-09-08T14:22:50.000Z
bag_detection-master/src/bag_flip_detection_node.h
jamesxiu/Oystermaran2021
f3703bb220dc5b415942f90bd5761a9985381067
[ "MIT" ]
null
null
null
bag_detection-master/src/bag_flip_detection_node.h
jamesxiu/Oystermaran2021
f3703bb220dc5b415942f90bd5761a9985381067
[ "MIT" ]
1
2021-12-27T18:08:55.000Z
2021-12-27T18:08:55.000Z
#ifndef BAG_FLIP_DETECTION_NODE_H_ #define BAG_FLIP_DETECTION_NODE_H_ //some generically useful stuff to include... #include <math.h> #include <stdlib.h> #include <string> #include <vector> #include <ros/ros.h> //ALWAYS need to include this #include <iostream> #include "cv_bridge/cv_bridge.h" #include "sensor_msgs/Image.h" #include <opencv2/opencv.hpp> #include <image_transport/image_transport.h> //message types used in this example code; include more message types, as needed #include <std_msgs/Bool.h> #include <std_msgs/Float32.h> using namespace std; using namespace cv; // define a class, including a constructor, member variables and member functions class BagFlipDetection { public: BagFlipDetection(ros::NodeHandle* nodehandle); //"main" will need to instantiate a ROS nodehandle, then pass it to the constructor // may choose to define public methods or public variables, if desired private: // put private member data here; "private" data will only be available to member functions of this class; ros::NodeHandle nh_; // we will need this, to pass between "main" and constructor // some objects to support subscriber and publisher ros::Subscriber sub; image_transport::Publisher pub; // member methods as well: void initializeSubscribers(); void initializePublishers(); void imageCallback(const sensor_msgs::ImageConstPtr& msg); }; #endif
32.159091
134
0.751943
[ "vector" ]
f2295f09adb6bb6d9440aa5402bac44d399b751c
559
h
C
inc/Settings.h
igorglotov/tizen-vk-client
de213ede7185818285f78abad36592bc864f76cc
[ "Unlicense" ]
null
null
null
inc/Settings.h
igorglotov/tizen-vk-client
de213ede7185818285f78abad36592bc864f76cc
[ "Unlicense" ]
null
null
null
inc/Settings.h
igorglotov/tizen-vk-client
de213ede7185818285f78abad36592bc864f76cc
[ "Unlicense" ]
null
null
null
/* * Settings.h * * Created on: Nov 24, 2013 * Author: Igor Glotov */ #ifndef SETTINGS_H_ #define SETTINGS_H_ #include <FBaseObject.h> #include <FBase.h> class Settings: public Tizen::Base::Object { public: Settings(); virtual ~Settings(); static void SetSetting(const Tizen::Base::String & key, const int value); static int GetSetting(const Tizen::Base::String & key); static void Read(); static void Replace(); private: static bool IsExists(); static int sound; static int vibe; static int resize; }; #endif /* SETTINGS_H_ */
15.527778
74
0.686941
[ "object" ]
f24ab09f6b2b1c7cf636678a16bb70f4dad90d04
1,784
h
C
dbms/src/Columns/Cuda/CudaColumnString.h
callaby/ClickHouse
0b4e7d46e9f73382a35a3806818b60bf62b6096e
[ "Apache-2.0" ]
null
null
null
dbms/src/Columns/Cuda/CudaColumnString.h
callaby/ClickHouse
0b4e7d46e9f73382a35a3806818b60bf62b6096e
[ "Apache-2.0" ]
null
null
null
dbms/src/Columns/Cuda/CudaColumnString.h
callaby/ClickHouse
0b4e7d46e9f73382a35a3806818b60bf62b6096e
[ "Apache-2.0" ]
null
null
null
#pragma once #include <memory> #include <cstdint> #include <vector> #include <cuda.h> #include <cuda_runtime.h> #include <Core/Cuda/Types.h> /// TODO make some kind of simple cuda/host buffer object with once defined size and min alloc/free capabilities namespace DB { /** Analog of ColumnString for GPU storage */ class CudaColumnString { public: CudaColumnString(size_t max_str_num_,size_t max_sz_); bool empty()const { return (str_num == 0)||(sz == 0); } size_t getStrNum()const { return str_num; } size_t getBufSz()const { return sz; } char *getBuf()const { return buf; } UInt32 *getLens()const { return lens; } UInt32 *getOffsets()const { return offsets; } UInt64 *getOffsets64()const { return offsets64; } bool hasSpace(size_t str_num_, size_t str_buf_sz_)const; void addData(size_t str_num_, size_t str_buf_sz_, const char *str_buf_, const UInt64 *offsets_, cudaStream_t stream = 0); void setSize(size_t str_num_, size_t sz_); void reset(); /// it is nonblocking wrt host method void calcLengths(cudaStream_t stream = 0); ~CudaColumnString(); protected: //TODO decide about size_t here (simply take UInt32?) size_t str_num, max_str_num; size_t sz, max_sz; char *buf; UInt32 *lens, *offsets; /// that is initial offsets UInt64 *offsets64; std::vector<UInt32> blocks_sizes, blocks_buf_sizes; /// tmp_buf4 is used for exclusive scan //size_t buf4_sz; //char *tmp_buf4; }; using CudaColumnStringPtr = std::shared_ptr<CudaColumnString>; }
30.758621
112
0.610987
[ "object", "vector" ]
f24b6058b1489ce90ae8e7048435915b9c470764
465
h
C
src/ConfigurationSpace/ReachableVolumes.h
parasol-ppl/PPL
04de04b23e0368e576d2136fee8729de44a3eda5
[ "BSD-3-Clause" ]
null
null
null
src/ConfigurationSpace/ReachableVolumes.h
parasol-ppl/PPL
04de04b23e0368e576d2136fee8729de44a3eda5
[ "BSD-3-Clause" ]
null
null
null
src/ConfigurationSpace/ReachableVolumes.h
parasol-ppl/PPL
04de04b23e0368e576d2136fee8729de44a3eda5
[ "BSD-3-Clause" ]
null
null
null
#ifndef PMPL_REACHABLE_VOLUMES_H_ #define PMPL_REACHABLE_VOLUMES_H_ class Chain; class WorkspaceBoundingSphericalShell; /// Compute the reachable volume of a chain. /// @param _dimension The workspace dimension. /// @param _chain The chain. /// @return The reachable volume of _chain's end relative to its root. WorkspaceBoundingSphericalShell ComputeReachableVolume(const size_t _dimension, const std::vector<double>& _center, const Chain& _chain); #endif
27.352941
70
0.797849
[ "vector" ]
f24fb5845374c113995af6e2e90d0f1e83b74698
786
h
C
immaterial-engine/TorusObject.h
Norseman055/immaterial-engine
6aca0fad64f5b2b9fe6eb351528a79a39dc94625
[ "MIT" ]
null
null
null
immaterial-engine/TorusObject.h
Norseman055/immaterial-engine
6aca0fad64f5b2b9fe6eb351528a79a39dc94625
[ "MIT" ]
null
null
null
immaterial-engine/TorusObject.h
Norseman055/immaterial-engine
6aca0fad64f5b2b9fe6eb351528a79a39dc94625
[ "MIT" ]
null
null
null
#ifndef TORUS_OBJECT_H #define TORUS_OBJECT_H #include "GraphicsObject.h" #include "TextureNode.h" #include "ShaderTypes.h" #include "SphereObject.h" class TorusObject : public GraphicsObject { public: TorusObject(); // Specific to Sphere void setStartPos( const Vect & v); void setLightColor( const Vect & v); void setLightPos( const Vect & v); void setTextureName( TextureName inName ); void setStockShaderMode ( ShaderType inVal ); void setOriginalSphere( Sphere &origSphere ); void setSphereObject (); // must define, base class has abstract methods void transform( void ); void draw( void ); void setRenderState(void); void checkCulling(void); private: // internal variables for the instance float angle_y; float angle_z; SphereObject *sphereObj; }; #endif
21.243243
48
0.750636
[ "transform" ]
f258d3948902767f9ead0eb7a1a2a54dddaf02e8
554
h
C
src/dsp/generalizedcrosscorrelation.h
mohabouje/AcousticLPS
e8201be6c8e7a3f64ed9e7d2823f47f24f0d012a
[ "MIT" ]
2
2017-09-27T15:06:30.000Z
2018-12-26T07:06:03.000Z
src/dsp/generalizedcrosscorrelation.h
mohabouje/AcousticLPS
e8201be6c8e7a3f64ed9e7d2823f47f24f0d012a
[ "MIT" ]
null
null
null
src/dsp/generalizedcrosscorrelation.h
mohabouje/AcousticLPS
e8201be6c8e7a3f64ed9e7d2823f47f24f0d012a
[ "MIT" ]
2
2018-08-17T03:33:15.000Z
2021-03-15T16:35:33.000Z
#ifndef GENERALIZEDCROSSCORRELATION_H #define GENERALIZEDCROSSCORRELATION_H #include "dsp.h" namespace DSP { class GeneralizedCrossCorrelation { public: enum Algorithm { Standard = 0, Phat}; GeneralizedCrossCorrelation(); static Vector compute(const Vector&, const Vector&, Algorithm algorithm = Standard); private: static Vector computePhat(const Vector&, const Vector&); static Vector computeStandard(const Vector &original, const Vector &delayed); }; } #endif // GENERALIZEDCROSSCORRELATION_H
30.777778
92
0.723827
[ "vector" ]
f2694955dc29f749e250ce8d90c0f785ee869d08
7,625
h
C
cli/fpga_tool/src/Secure_c/include/securec.h
fpga-accel/ctyun-fpga
20862d3e19e3602087fc770addfe89e98c5a9d2c
[ "BSD-3-Clause" ]
null
null
null
cli/fpga_tool/src/Secure_c/include/securec.h
fpga-accel/ctyun-fpga
20862d3e19e3602087fc770addfe89e98c5a9d2c
[ "BSD-3-Clause" ]
null
null
null
cli/fpga_tool/src/Secure_c/include/securec.h
fpga-accel/ctyun-fpga
20862d3e19e3602087fc770addfe89e98c5a9d2c
[ "BSD-3-Clause" ]
null
null
null
/*- * BSD LICENSE * * Copyright(c) 2017 Huawei Technologies Co., Ltd. All rights reserved. * 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 Huawei Technologies Co., Ltd nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __SECUREC_H__ #define __SECUREC_H__ #include "securectype.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> /* success */ #define EOK (0) /*define error code*/ #ifndef errno_t typedef int errno_t; #endif #define EOVERLAP_AND_RESET (54 | 0X80) #ifdef __cplusplus extern "C" { #endif /** * @Description: The strtok_s function parses a string into a sequence of tokens,On the first call to strtok_s the string to be parsed should be specified in strToken. * In each subsequent call that should parse the same string, strToken should be NULL * @param strToken - the string to be delimited * @param strDelimit -specifies a set of characters that delimit the tokens in the parsed string * @param context -is a pointer to a char * variable that is used internally by strtok_s function * @return:returns a pointer to the first character of a token, or a null pointer if there is no token or there is a runtime-constraint violation. */ char* strtok_s(char* strToken, const char* strDelimit, char** context); /** * @Description: The snprintf_s function is equivalent to the snprintf function except for the parameter destMax/count and the explicit runtime-constraints violation * @param strDest - produce output according to a format ,write to the character string strDest * @param destMax - The maximum length of destination buffer(including the terminating null byte ('\0')) * @param count - do not write more than count bytes to strDest(not including the terminating null byte ('\0')) * @param format - fromat string * @param argptr - instead of a variable number of arguments * @return:return the number of characters printed(not including the terminating null byte ('\0')), If an error occurred return -1. */ int snprintf_s(char* strDest, size_t destMax, size_t count, const char* format, ...); /** * @Description:The memset_s function copies the value of c (converted to an unsigned char) into each of the first count characters of the object pointed to by dest. * @param dest - destination address * @param destMax -The maximum length of destination buffer * @param c - the value to be copied * @param count -copies fisrt count characters of dest * @return EOK if there was no runtime-constraint violation */ int memset_s(void* dest, size_t destMax, int c, size_t count); /** * @Description:The memcpy_s function copies n characters from the object pointed to by src into the object pointed to by dest. * @param dest - destination address * @param destMax -The maximum length of destination buffer * @param src -source address * @param count -copies count characters from the src * @return EOK if there was no runtime-constraint violation */ int memcpy_s(void* dest, size_t destMax, const void* src, size_t count); /** * @Description:The strcpy_s function copies the string pointed to by strSrc (including the terminating null character) into the array pointed to by strDest * @param strDest - destination address * @param destMax -The maximum length of destination buffer(including the terminating null character) * @param strSrc -source address * @return EOK if there was no runtime-constraint violation */ int strcpy_s(char* strDest, size_t destMax, const char* strSrc); /** * @Description: The fscanf_s function is equivalent to fscanf except that the c, s, and [ conversion specifiers apply to a pair of arguments (unless assignment suppression is indicated by a*) * @param stream - stdio file stream * @param format - fromat string * @return:returns the number of input items assigned, If an error occurred return -1. */ int fscanf_s(FILE* stream, const char* format, ...); /** * @Description:The strncpy_s function copies not more than n successive characters (not including the terminating null character) * from the array pointed to by strSrc to the array pointed to by strDest * @param strDest - destination address * @param destMax -The maximum length of destination buffer(including the terminating null character) * @param strSrc -source address * @param count -copies count characters from the src * @return EOK if there was no runtime-constraint violation */ errno_t strncpy_s(char* strDest, size_t destMax, const char* strSrc, size_t count); /** * @Description: The sscanf_s function is equivalent to fscanf_s, except that input is obtained from a string (specified by the argument buffer) rather than from a stream * @param buffer - read character from buffer * @param format - fromat string * @return:returns the number of input items assigned, If an error occurred return -1. */ int sscanf_s(const char* buffer, const char* format, ...); /** * @Description: The vsnprintf_s function is equivalent to the vsnprintf function except for the parameter destMax/count and the explicit runtime-constraints violation * @param strDest - produce output according to a format ,write to the character string strDest * @param destMax - The maximum length of destination buffer(including the terminating null byte ('\0')) * @param count - do not write more than count bytes to strDest(not including the terminating null byte ('\0')) * @param format - fromat string * @param argptr - instead of a variable number of arguments * @return:return the number of characters printed(not including the terminating null byte ('\0')), If an error occurred return -1. */ int vsnprintf_s(char* strDest, size_t destMax, size_t count, const char* format, va_list arglist) SECUREC_ATTRIBUTE(4,0); #ifdef __cplusplus } #endif /* __cplusplus */ #endif/* __SECUREC_H__ */
47.955975
195
0.717508
[ "object" ]
f273fb2d8e7b2704b329e7c5334c1b9afa743f1b
1,180
h
C
MatrixCalculator/matrixfunction.h
KirollousMoheb/Mat
e23d33a8aae56014ebd75753b6895e7fdf09bd4a
[ "MIT" ]
2
2020-06-28T04:21:20.000Z
2021-06-01T14:00:21.000Z
MatrixCalculator/matrixfunction.h
KirollousMoheb/Mat
e23d33a8aae56014ebd75753b6895e7fdf09bd4a
[ "MIT" ]
null
null
null
MatrixCalculator/matrixfunction.h
KirollousMoheb/Mat
e23d33a8aae56014ebd75753b6895e7fdf09bd4a
[ "MIT" ]
null
null
null
#ifndef MATRIXFUNCTION_H #define MATRIXFUNCTION_H using namespace std; //the use of extern to prevent the duplication of the variables in two files extern int a, b, c, d, n ,x,y,An,Bn; extern string operation, userinput;; extern float MatrixA[100][100], MatrixB[100][100], MatrixSum[100][100], Matrixdiff[100][100], MatrixMult[100][100], MatrixTa[100][100], MatrixTb[100][100], Matrix[100][100], Identity[100][100]; extern float Det; extern float t; ///////////////////// int GetMatA(); int GetMatB(); int printMatA(); int printMatB(); ////////////////// int add(); int subtract(); int multiply(float mat1[100][100], float mat2[100][100]); void TransposeA(); void TransposeB(); int swap(float matt1[100][100], float matt2[100][100]); int identity(); int powerA(); float det(int a, float mat[100][100]); float inverse(float Matrix[100][100]); /////////////////////////////////////////// int printsum(); int printdiff(); int printmult(); int printIdentity(); int printpower(); //////////////////////////////////////////////// vector<string> ParseToRows(); vector<string> ParseToColumns(const string rows); void GetMatrix(float matrix[100][100], int& order); #endif
21.454545
135
0.636441
[ "vector" ]
f294502f7ce6c543788038a1a345fae63be1b393
2,164
h
C
include/libchecksum/crc.h
Darth-Revan/libchecksum
44d1d733a449ff33fc58f60fb58eadc56ba66ddf
[ "MIT" ]
null
null
null
include/libchecksum/crc.h
Darth-Revan/libchecksum
44d1d733a449ff33fc58f60fb58eadc56ba66ddf
[ "MIT" ]
null
null
null
include/libchecksum/crc.h
Darth-Revan/libchecksum
44d1d733a449ff33fc58f60fb58eadc56ba66ddf
[ "MIT" ]
null
null
null
/* * Copyright (c) 2018 Kevin Kirchner * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * @author Kevin Kirchner * @date 2018 * @copyright MIT License * @brief Header file of \p libchecksum declaring CRC algorithms * * This header file declares the CRC algorithms of \p libchecksum. */ #ifndef CHECKSUM_CRC_H #define CHECKSUM_CRC_H #include <libchecksum/common.h> namespace libchecksum { /// Class that implements the CRC checksum from the GNU coreutil cksum class Cksum final : public CyclicRedundancyChecksum<uint32_t> { public: using ChecksumAlgorithm::operator(); uint32_t operator()(const std::vector<uint8_t>& input) const override; uint32_t getGeneratorPolynomial() const override { return 0x04C11DB7; } }; /// Class that implements the CRC-32 algorithm used in Ethernet, etc. class CRC32 final : public CyclicRedundancyChecksum<uint32_t> { public: using ChecksumAlgorithm::operator(); uint32_t operator()(const std::vector<uint8_t>& input) const override; uint32_t getGeneratorPolynomial() const override { return 0xedb88320; } }; } #endif //CHECKSUM_CRC_H
32.298507
80
0.749076
[ "vector" ]
f134c7c440326023513423badcd85d0f7be1c46e
4,490
h
C
app/lib_thingy/libs/bv32fp-1.2/bv32externs.h
chlee4831/thingy52-ubinos-old
ed5d9891b9af94bf6f89b00b8194d5fd9e430ed9
[ "Apache-2.0" ]
1
2022-01-26T09:57:52.000Z
2022-01-26T09:57:52.000Z
app/lib_thingy/libs/bv32fp-1.2/bv32externs.h
chlee4831/thingy52-ubinos-old
ed5d9891b9af94bf6f89b00b8194d5fd9e430ed9
[ "Apache-2.0" ]
null
null
null
app/lib_thingy/libs/bv32fp-1.2/bv32externs.h
chlee4831/thingy52-ubinos-old
ed5d9891b9af94bf6f89b00b8194d5fd9e430ed9
[ "Apache-2.0" ]
null
null
null
/*****************************************************************************/ /* BroadVoice(R)32 (BV32) Floating-Point ANSI-C Source Code */ /* Revision Date: October 5, 2012 */ /* Version 1.2 */ /*****************************************************************************/ /*****************************************************************************/ /* Copyright 2000-2012 Broadcom Corporation */ /* */ /* This software is provided under the GNU Lesser General Public License, */ /* version 2.1, as published by the Free Software Foundation ("LGPL"). */ /* This program is distributed in the hope that it will be useful, but */ /* WITHOUT ANY SUPPORT OR WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LGPL for */ /* more details. A copy of the LGPL is available at */ /* http://www.broadcom.com/licenses/LGPLv2.1.php, */ /* or by writing to the Free Software Foundation, Inc., */ /* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*****************************************************************************/ /***************************************************************************** bv32externs.h : BV32 Floating-Point externs $Log$ ******************************************************************************/ /* POINTERS */ extern Float winl[]; extern Float sstwin[]; extern int idxord[]; extern Float hpfa[]; extern Float hpfb[]; extern Float adf[]; extern Float bdf[]; extern Float x[]; extern Float x2[]; extern Float invk[]; extern Float MPTH[]; /* LSP Quantization */ extern Float lspecb1[LSPECBSZ1*LPCO]; extern Float lspecb21[LSPECBSZ21*SVD1]; extern Float lspecb22[LSPECBSZ22*SVD2]; extern Float lspmean[LPCO]; extern Float lspp[LSPPORDER*LPCO]; /* Pitch Predictor Codebook */ extern Float pp9cb[]; /* Log-Gain Quantization */ extern Float lgpecb[LGPECBSZ]; extern Float lgp[LGPORDER]; extern Float lgmean; /* Log-Gain Limitation */ extern Float lgclimit[]; /* Excitation Codebook */ extern Float cccb[CBSZ*VDIM]; extern Float lgpecb_nh[]; extern Float a_pre[]; extern Float b_pre[]; /* Function Prototypes */ extern Float estlevel( Float lg, Float *level, Float *lmax, Float *lmin, Float *lmean, Float *x1); extern void excdec_w_LT_synth( Float *ltsymd, /* long-term synthesis filter memory at decoder*/ short *idx, /* excitation codebook index array for current subframe */ Float *gainq, /* quantized linear gains for sub-subframes */ Float *b, /* coefficient of 3-tap pitch predictor */ short pp, /* pitch period (# of 8 kHz samples) */ Float *EE); extern Float gaindec( Float *lgq, short gidx, Float *lgpm, Float *prevlg, Float level, short *nclglim, short lctimer); void gainplc(Float E, Float *lgeqm, Float *lgqm); extern void lspdec( Float *lspq, short *lspidx, Float *lsppm, Float *lspq_last); extern void lspplc( Float *lspq, Float *lsppm); extern int coarsepitch( Float *xw, Float *xwd, Float *dfm, int cpplast); extern int refinepitch( Float *x, int cpp, Float *ppt); extern int pitchtapquan( Float *x, int pp, Float *b); extern void excquan( Float *qv, /* output quantized excitation signal vector */ short *idx, /* quantizer codebook index for uq[] vector */ Float *d, /* input prediction residual signal vector */ Float *h, /* noise feedback filter coefficient array */ Float *b, /* coefficient of 3-tap pitch predictor */ Float beta, /* coefficient of weighted 3-tap pitch predictor */ Float *ltsym, /* long-term synthesis filter memory */ Float *ltnfm, /* long-term noise feedback filter memory */ Float *stnfm, /* short-term noise feedback filter memory */ Float *cb, /* scalar quantizer codebook */ int pp); /* pitch period (# of 8 kHz samples) */ extern int gainquan( Float *gainq, Float lg, Float *lgpm, Float *prevlg, Float level); extern void lspquan( Float *lspq, short *lspidx, Float *lsp, Float *lsppm);
29.933333
79
0.541648
[ "vector" ]
f135b8965ac5b9c1a2ada8450574251412b8a605
6,114
c
C
OpenGL ES_Test/OpenGL ES Test/starship.c
iOScontiue/OpenGL-ES-SkyboxEffect
dfc1352dd09665919577de1df87d5b16ddfc6354
[ "MIT" ]
6
2015-03-26T06:58:48.000Z
2021-06-06T17:08:21.000Z
OpenGL ES_Test/OpenGL ES Test/starship.c
iOScontiue/OpenGL-ES-SkyboxEffect
dfc1352dd09665919577de1df87d5b16ddfc6354
[ "MIT" ]
1
2016-02-29T15:53:58.000Z
2016-03-02T10:31:26.000Z
OpenGL ES_Test/OpenGL ES Test/starship.c
iOScontiue/OpenGL-ES-SkyboxEffect
dfc1352dd09665919577de1df87d5b16ddfc6354
[ "MIT" ]
7
2015-07-20T08:19:50.000Z
2020-05-10T17:40:13.000Z
// This is a .c file for the model: starship #include "starship.h" const int starshipVertices = 66; const float starshipPositions[198] = { -0.215379, -0.018131, 0.254635, -0.130827, -0.03062, -0.229209, -0.605928, 0.226597, 0.656825, -0.130827, -0.03062, -0.229209, -0.457512, -0.151435, 0.173292, -0.605928, 0.226597, 0.656825, -0.130827, -0.03062, -0.229209, -0.215379, -0.018131, 0.254635, -0.457512, -0.151435, 0.173292, -0.457512, -0.151435, 0.173292, -0.215379, -0.018131, 0.254635, -0.605928, 0.226597, 0.656825, -0.457512, -0.151435, 0.173292, -0.215379, -0.018131, 0.254635, -0.301224, -0.276743, 0.205711, 0.219197, -0.018172, 0.253044, 0.605928, 0.226597, 0.656825, 0.134193, -0.030673, -0.229209, 0.134193, -0.030673, -0.229209, 0.605928, 0.226597, 0.656825, 0.457512, -0.151435, 0.173292, 0.457512, -0.151435, 0.173292, 0.219197, -0.018172, 0.253044, 0.134193, -0.030673, -0.229209, 0.457512, -0.151435, 0.173292, 0.605928, 0.226597, 0.656825, 0.219197, -0.018172, 0.253044, 0.301224, -0.276743, 0.205711, 0.219197, -0.018172, 0.253044, 0.457512, -0.151435, 0.173292, -0.301224, -0.276743, 0.205711, -0.762492, -0.313925, 0.985007, -0.457512, -0.151435, 0.173292, -0.301224, -0.276743, 0.205711, -0.215379, -0.018131, 0.254635, -0.762492, -0.313925, 0.985007, -0.762492, -0.313925, 0.985007, -0.215379, -0.018131, 0.254635, -0.457512, -0.151435, 0.173292, 0.001113, 0.122996, 0.372016, 0.219197, -0.018172, 0.253044, 0.012398, 0.313925, 0.213513, 0.012398, 0.313925, 0.213513, -0.215379, -0.018131, 0.254635, 0.001113, 0.122996, 0.372016, 0.001113, -0.050108, -0.985007, -0.215379, -0.018131, 0.254635, 0.012398, 0.313925, 0.213513, 0.219197, -0.018172, 0.253044, 0.001113, -0.050108, -0.985007, 0.012398, 0.313925, 0.213513, 0.219197, -0.018172, 0.253044, -0.215379, -0.018131, 0.254635, 0.001113, -0.050108, -0.985007, 0.301224, -0.276743, 0.205711, 0.457512, -0.151435, 0.173292, 0.762492, -0.313925, 0.985007, 0.301224, -0.276743, 0.205711, 0.762492, -0.313925, 0.985007, 0.219197, -0.018172, 0.253044, 0.762492, -0.313925, 0.985007, 0.457512, -0.151435, 0.173292, 0.219197, -0.018172, 0.253044, 0.001113, 0.122996, 0.372016, -0.215379, -0.018131, 0.254635, 0.219197, -0.018172, 0.253044, }; const float starshipTexels[132] = { 0.80337, 0.558166, 0.81902, 0.647724, 0.73108, 0.483722, 0.767232, 0.88906, 0.789595, 0.949528, 0.719622, 0.977, 0.581876, 0.736858, 0.566226, 0.826416, 0.521408, 0.81136, 0.533119, 0.828372, 0.577937, 0.843428, 0.505647, 0.917873, 0.866665, 0.826555, 0.911483, 0.801881, 0.895593, 0.849749, 0.825057, 0.558461, 0.870363, 0.483722, 0.822743, 0.647724, 0.840763, 0.976377, 0.793144, 0.88906, 0.863116, 0.916531, 0.71645, 0.963562, 0.672338, 0.978323, 0.656604, 0.88906, 0.625285, 0.883059, 0.652756, 0.97256, 0.581174, 0.897821, 0.930543, 0.835986, 0.915361, 0.788125, 0.959472, 0.812791, 0.959683, 0.489722, 0.874303, 0.633968, 0.930754, 0.483722, 0.649513, 0.736858, 0.697382, 0.745914, 0.642631, 0.881104, 0.892341, 0.635923, 0.99361, 0.771113, 0.948792, 0.786169, 0.474469, 0.009653, 0.54845, 0.12269, 0.307351, 0.080678, 0.252763, 0.082693, 0.01227, 0.122925, 0.086477, 0.011623, 0.247367, 0.9955, 0.01227, 0.122925, 0.252763, 0.082693, 0.54845, 0.12269, 0.310909, 0.997262, 0.307351, 0.080678, 0.727495, 0.712881, 0.647056, 0.713176, 0.687128, 0.483722, 0.803956, 0.65568, 0.832884, 0.64968, 0.889335, 0.799926, 0.591765, 0.881104, 0.584882, 0.736858, 0.639625, 0.872342, 0.80095, 0.736858, 0.744499, 0.887104, 0.700387, 0.872342, 0.687128, 0.734903, 0.647056, 0.713176, 0.727495, 0.712881, }; const float starshipNormals[198] = { 0.588526, 0.8043, 0.082085, 0.588526, 0.8043, 0.082085, 0.588526, 0.8043, 0.082085, -0.774133, 0.361102, -0.519927, -0.774133, 0.361102, -0.519927, -0.774133, 0.361102, -0.519927, 0.453233, -0.88553, 0.10206, 0.453233, -0.88553, 0.10206, 0.453233, -0.88553, 0.10206, 0.193934, -0.743086, 0.640479, 0.193934, -0.743086, 0.640479, 0.193934, -0.743086, 0.640479, 0.271729, 0.091046, -0.958057, 0.271729, 0.091046, -0.958057, 0.271729, 0.091046, -0.958057, -0.594033, 0.800046, 0.083968, -0.594033, 0.800046, 0.083968, -0.594033, 0.800046, 0.083968, 0.777665, 0.356782, -0.517633, 0.777665, 0.356782, -0.517633, 0.777665, 0.356782, -0.517633, -0.458759, -0.882484, 0.103739, -0.458759, -0.882484, 0.103739, -0.458759, -0.882484, 0.103739, -0.199995, -0.741166, 0.640839, -0.199995, -0.741166, 0.640839, -0.199995, -0.741166, 0.640839, -0.270659, 0.089597, -0.958497, -0.270659, 0.089597, -0.958497, -0.270659, 0.089597, -0.958497, -0.538745, -0.763868, -0.355331, -0.538745, -0.763868, -0.355331, -0.538745, -0.763868, -0.355331, 0.811241, -0.356906, 0.463148, 0.811241, -0.356906, 0.463148, 0.811241, -0.356906, 0.463148, -0.480937, 0.87674, -0.005192, -0.480937, 0.87674, -0.005192, -0.480937, 0.87674, -0.005192, 0.637297, 0.469581, 0.611021, 0.637297, 0.469581, 0.611021, 0.637297, 0.469581, 0.611021, -0.642687, 0.511493, 0.570375, -0.642687, 0.511493, 0.570375, -0.642687, 0.511493, 0.570375, -0.823307, 0.545207, -0.157847, -0.823307, 0.545207, -0.157847, -0.823307, 0.545207, -0.157847, 0.846183, 0.507623, -0.16215, 0.846183, 0.507623, -0.16215, 0.846183, 0.507623, -0.16215, 0, -0.999667, 0.025787, 0, -0.999667, 0.025787, 0, -0.999667, 0.025787, 0.538745, -0.763868, -0.355331, 0.538745, -0.763868, -0.355331, 0.538745, -0.763868, -0.355331, -0.81516, -0.343915, 0.466087, -0.81516, -0.343915, 0.466087, -0.81516, -0.343915, 0.466087, 0.486085, 0.873877, -0.0077, 0.486085, 0.873877, -0.0077, 0.486085, 0.873877, -0.0077, 0.002747, -0.641946, 0.766745, 0.002747, -0.641946, 0.766745, 0.002747, -0.641946, 0.766745, }; const int starshipMaterials = 3; const int starshipFirsts[3] = { 0, 30, 63, }; const int starshipCounts[3] = { 30, 33, 3, }; const float starshipDiffuses[3][3] = { 0, 0, 0.75, 0.75, 0.75, 0.75, 1, 0.5, 0, }; const float starshipSpeculars[3][3] = { 0, 0.25, 0.25, 1, 1, 1, 0.5, 0, 0, };
24.753036
44
0.646549
[ "model" ]
f13dcfcf7c2f530c3f341c8db4ccee9a288818e5
3,243
h
C
Project3_BinarySearchTree/item.h
Mibblez/DataStructAndAlgorithms_Assignments
d8fed25114a59a6b3b69da31c22d8893cf5622b3
[ "MIT" ]
null
null
null
Project3_BinarySearchTree/item.h
Mibblez/DataStructAndAlgorithms_Assignments
d8fed25114a59a6b3b69da31c22d8893cf5622b3
[ "MIT" ]
null
null
null
Project3_BinarySearchTree/item.h
Mibblez/DataStructAndAlgorithms_Assignments
d8fed25114a59a6b3b69da31c22d8893cf5622b3
[ "MIT" ]
null
null
null
// // item.h // #include <iostream> #include <iomanip> #include <utility> using namespace std; #ifndef ITEM_H #define ITEM_H // Models a single item from the catalog class Item { private: int itemID; // Item ID number (search key) string itemName; // Item name float itemPrice; // Item price public: Item(); Item(int id, string name, float price); Item(const Item &otherItem); friend bool operator==(const Item &leftop, const Item &rightop); friend bool operator<(const Item &leftop, const Item &rightop); friend bool operator>(const Item &leftop, const Item &rightop); void operator=(const Item &op); // Overloaded >> operator // This allows all data associated with a Item object to be input simultaneously from an input stream friend istream &operator>>(istream &leftop, Item &rightop) { leftop >> rightop.itemID >> rightop.itemName >> rightop.itemPrice; return leftop; } // Overloaded << operator // This allows all data associated with a Item object to be output simultaneously to an output stream friend ostream &operator<<(ostream &leftop, const Item &rightop) { leftop << "[" << rightop.itemID << ", " << rightop.itemName << ", $" << fixed << showpoint << setprecision(2) << rightop.itemPrice << "]"; return leftop; } // Print() // Outputs Item information in desired format. void Print() const { cout << "[" << itemID << ", " << itemName << ",$" << fixed << showpoint << setprecision(2) << itemPrice << "]"; } // End Print() }; // Default constructor initializes itemID to -1, itemPrice to -1.00, and itemName to empty string Item::Item() { this->itemID = -1; this->itemName = ""; this->itemPrice = -1.00; } // Constructor initializes itemID, itemName, itemPrice to id, name, and price respectively Item::Item(int id, string name, float price) { this->itemID = id; this->itemName = std::move(name); this->itemPrice = price; } // Copy constructor -- copies attributes of item into attribute variables of current object Item::Item(const Item &otherItem) { this->itemID = otherItem.itemID; this->itemName = otherItem.itemName; this->itemPrice = otherItem.itemPrice; } // Overloaded SAME AS operator // Returns true if leftop.itemID == rightop.itemID. Returns false otherwise bool operator==(const Item &leftop, const Item &rightop) { return leftop.itemID == rightop.itemID; } // Overloaded LESS THAN operator // Returns true if leftop.itemID < rightop.itemID. Returns false otherwise bool operator<(const Item &leftop, const Item &rightop) { return leftop.itemID < rightop.itemID; } // Overloaded GREATER THAN operator // Returns true if leftop.itemID > rightop.itemID. Returns false otherwise bool operator>(const Item &leftop, const Item &rightop) { return leftop.itemID > rightop.itemID; } // Overloaded ASSIGNMENT operator // Sets this->itemID = op.itemID, this->itemName = op.itemName, this->itemPrice = op.itemPrice void Item::operator=(const Item &op) { this->itemID = op.itemID; this->itemName = op.itemName; this->itemPrice = op.itemPrice; } #endif
30.027778
105
0.660808
[ "object" ]
f13f4348ed2e639fa09d7b18f9a96209fe56a075
994
h
C
System/Library/PrivateFrameworks/PodcastsKit.framework/MTDBConfig.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
2
2021-11-02T09:23:27.000Z
2022-03-28T08:21:57.000Z
System/Library/PrivateFrameworks/PodcastsKit.framework/MTDBConfig.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/PodcastsKit.framework/MTDBConfig.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
1
2022-03-28T08:21:59.000Z
2022-03-28T08:21:59.000Z
/* * This header is generated by classdump-dyld 1.5 * on Wednesday, October 27, 2021 at 3:22:48 PM Mountain Standard Time * Operating System: Version 13.5.1 (Build 17F80) * Image Source: /System/Library/PrivateFrameworks/PodcastsKit.framework/PodcastsKit * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley. */ #import <libobjc.A.dylib/MTCoreDataContainerConfigProvider.h> @class NSManagedObjectModel; @interface MTDBConfig : NSObject <MTCoreDataContainerConfigProvider> { NSManagedObjectModel* _model; } @property (nonatomic,retain) NSManagedObjectModel * model; //@synthesize model=_model - In the implementation block -(NSManagedObjectModel *)model; -(void)setModel:(NSManagedObjectModel *)arg1 ; -(id)managedObjectModel; -(id)databaseFileUrl; -(id)peristentStoreOptions; @end
36.814815
130
0.669014
[ "model" ]
f1531acfee9d611530a4145122ae5baf57620bf9
80,152
h
C
windows/generated/NameData.pb.h
protoblock/prebuiltLibs
2705da5e74038cc6dce878bbd64c31af5c5485f1
[ "MIT" ]
null
null
null
windows/generated/NameData.pb.h
protoblock/prebuiltLibs
2705da5e74038cc6dce878bbd64c31af5c5485f1
[ "MIT" ]
null
null
null
windows/generated/NameData.pb.h
protoblock/prebuiltLibs
2705da5e74038cc6dce878bbd64c31af5c5485f1
[ "MIT" ]
1
2018-04-27T10:41:47.000Z
2018-04-27T10:41:47.000Z
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: NameData.proto #ifndef GOOGLE_PROTOBUF_INCLUDED_NameData_2eproto #define GOOGLE_PROTOBUF_INCLUDED_NameData_2eproto #include <limits> #include <string> #include <google/protobuf/port_def.inc> #if PROTOBUF_VERSION < 3012000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif #if 3012003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif #include <google/protobuf/port_undef.inc> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_table_driven.h> #include <google/protobuf/generated_message_util.h> #include <google/protobuf/inlined_string_field.h> #include <google/protobuf/metadata_lite.h> #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/message.h> #include <google/protobuf/repeated_field.h> // IWYU pragma: export #include <google/protobuf/extension_set.h> // IWYU pragma: export #include <google/protobuf/unknown_field_set.h> #include "ExData.pb.h" // @@protoc_insertion_point(includes) #include <google/protobuf/port_def.inc> #define PROTOBUF_INTERNAL_EXPORT_NameData_2eproto PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; } // namespace internal PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_NameData_2eproto { static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[5] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_NameData_2eproto; namespace fantasybit { class FantasyBitAward; class FantasyBitAwardDefaultTypeInternal; extern FantasyBitAwardDefaultTypeInternal _FantasyBitAward_default_instance_; class FantasyBitPnl; class FantasyBitPnlDefaultTypeInternal; extern FantasyBitPnlDefaultTypeInternal _FantasyBitPnl_default_instance_; class FantasyBitProj; class FantasyBitProjDefaultTypeInternal; extern FantasyBitProjDefaultTypeInternal _FantasyBitProj_default_instance_; class FantasyNameBal; class FantasyNameBalDefaultTypeInternal; extern FantasyNameBalDefaultTypeInternal _FantasyNameBal_default_instance_; class GameFantasyBitProj; class GameFantasyBitProjDefaultTypeInternal; extern GameFantasyBitProjDefaultTypeInternal _GameFantasyBitProj_default_instance_; } // namespace fantasybit PROTOBUF_NAMESPACE_OPEN template<> ::fantasybit::FantasyBitAward* Arena::CreateMaybeMessage<::fantasybit::FantasyBitAward>(Arena*); template<> ::fantasybit::FantasyBitPnl* Arena::CreateMaybeMessage<::fantasybit::FantasyBitPnl>(Arena*); template<> ::fantasybit::FantasyBitProj* Arena::CreateMaybeMessage<::fantasybit::FantasyBitProj>(Arena*); template<> ::fantasybit::FantasyNameBal* Arena::CreateMaybeMessage<::fantasybit::FantasyNameBal>(Arena*); template<> ::fantasybit::GameFantasyBitProj* Arena::CreateMaybeMessage<::fantasybit::GameFantasyBitProj>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace fantasybit { // =================================================================== class FantasyNameBal PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:fantasybit.FantasyNameBal) */ { public: inline FantasyNameBal() : FantasyNameBal(nullptr) {}; virtual ~FantasyNameBal(); FantasyNameBal(const FantasyNameBal& from); FantasyNameBal(FantasyNameBal&& from) noexcept : FantasyNameBal() { *this = ::std::move(from); } inline FantasyNameBal& operator=(const FantasyNameBal& from) { CopyFrom(from); return *this; } inline FantasyNameBal& operator=(FantasyNameBal&& from) noexcept { if (GetArena() == from.GetArena()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return GetMetadataStatic().reflection; } static const FantasyNameBal& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FantasyNameBal* internal_default_instance() { return reinterpret_cast<const FantasyNameBal*>( &_FantasyNameBal_default_instance_); } static constexpr int kIndexInFileMessages = 0; friend void swap(FantasyNameBal& a, FantasyNameBal& b) { a.Swap(&b); } inline void Swap(FantasyNameBal* other) { if (other == this) return; if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } void UnsafeArenaSwap(FantasyNameBal* other) { if (other == this) return; GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- inline FantasyNameBal* New() const final { return CreateMaybeMessage<FantasyNameBal>(nullptr); } FantasyNameBal* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<FantasyNameBal>(arena); } void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const FantasyNameBal& from); void MergeFrom(const FantasyNameBal& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FantasyNameBal* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "fantasybit.FantasyNameBal"; } protected: explicit FantasyNameBal(::PROTOBUF_NAMESPACE_ID::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; private: static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_NameData_2eproto); return ::descriptor_table_NameData_2eproto.file_level_metadata[kIndexInFileMessages]; } public: // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kNameFieldNumber = 10, kPublicKeyFieldNumber = 20, kBitsFieldNumber = 30, kStakeFieldNumber = 40, kChashFieldNumber = 50, kBlockFieldNumber = 60, kCountFieldNumber = 70, }; // optional string name = 10; bool has_name() const; private: bool _internal_has_name() const; public: void clear_name(); const std::string& name() const; void set_name(const std::string& value); void set_name(std::string&& value); void set_name(const char* value); void set_name(const char* value, size_t size); std::string* mutable_name(); std::string* release_name(); void set_allocated_name(std::string* name); private: const std::string& _internal_name() const; void _internal_set_name(const std::string& value); std::string* _internal_mutable_name(); public: // optional string public_key = 20; bool has_public_key() const; private: bool _internal_has_public_key() const; public: void clear_public_key(); const std::string& public_key() const; void set_public_key(const std::string& value); void set_public_key(std::string&& value); void set_public_key(const char* value); void set_public_key(const char* value, size_t size); std::string* mutable_public_key(); std::string* release_public_key(); void set_allocated_public_key(std::string* public_key); private: const std::string& _internal_public_key() const; void _internal_set_public_key(const std::string& value); std::string* _internal_mutable_public_key(); public: // optional uint64 bits = 30; bool has_bits() const; private: bool _internal_has_bits() const; public: void clear_bits(); ::PROTOBUF_NAMESPACE_ID::uint64 bits() const; void set_bits(::PROTOBUF_NAMESPACE_ID::uint64 value); private: ::PROTOBUF_NAMESPACE_ID::uint64 _internal_bits() const; void _internal_set_bits(::PROTOBUF_NAMESPACE_ID::uint64 value); public: // optional int64 stake = 40; bool has_stake() const; private: bool _internal_has_stake() const; public: void clear_stake(); ::PROTOBUF_NAMESPACE_ID::int64 stake() const; void set_stake(::PROTOBUF_NAMESPACE_ID::int64 value); private: ::PROTOBUF_NAMESPACE_ID::int64 _internal_stake() const; void _internal_set_stake(::PROTOBUF_NAMESPACE_ID::int64 value); public: // optional uint64 chash = 50; bool has_chash() const; private: bool _internal_has_chash() const; public: void clear_chash(); ::PROTOBUF_NAMESPACE_ID::uint64 chash() const; void set_chash(::PROTOBUF_NAMESPACE_ID::uint64 value); private: ::PROTOBUF_NAMESPACE_ID::uint64 _internal_chash() const; void _internal_set_chash(::PROTOBUF_NAMESPACE_ID::uint64 value); public: // optional int32 block = 60; bool has_block() const; private: bool _internal_has_block() const; public: void clear_block(); ::PROTOBUF_NAMESPACE_ID::int32 block() const; void set_block(::PROTOBUF_NAMESPACE_ID::int32 value); private: ::PROTOBUF_NAMESPACE_ID::int32 _internal_block() const; void _internal_set_block(::PROTOBUF_NAMESPACE_ID::int32 value); public: // optional int32 count = 70; bool has_count() const; private: bool _internal_has_count() const; public: void clear_count(); ::PROTOBUF_NAMESPACE_ID::int32 count() const; void set_count(::PROTOBUF_NAMESPACE_ID::int32 value); private: ::PROTOBUF_NAMESPACE_ID::int32 _internal_count() const; void _internal_set_count(::PROTOBUF_NAMESPACE_ID::int32 value); public: // @@protoc_insertion_point(class_scope:fantasybit.FantasyNameBal) private: class _Internal; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr public_key_; ::PROTOBUF_NAMESPACE_ID::uint64 bits_; ::PROTOBUF_NAMESPACE_ID::int64 stake_; ::PROTOBUF_NAMESPACE_ID::uint64 chash_; ::PROTOBUF_NAMESPACE_ID::int32 block_; ::PROTOBUF_NAMESPACE_ID::int32 count_; friend struct ::TableStruct_NameData_2eproto; }; // ------------------------------------------------------------------- class FantasyBitAward PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:fantasybit.FantasyBitAward) */ { public: inline FantasyBitAward() : FantasyBitAward(nullptr) {}; virtual ~FantasyBitAward(); FantasyBitAward(const FantasyBitAward& from); FantasyBitAward(FantasyBitAward&& from) noexcept : FantasyBitAward() { *this = ::std::move(from); } inline FantasyBitAward& operator=(const FantasyBitAward& from) { CopyFrom(from); return *this; } inline FantasyBitAward& operator=(FantasyBitAward&& from) noexcept { if (GetArena() == from.GetArena()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return GetMetadataStatic().reflection; } static const FantasyBitAward& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FantasyBitAward* internal_default_instance() { return reinterpret_cast<const FantasyBitAward*>( &_FantasyBitAward_default_instance_); } static constexpr int kIndexInFileMessages = 1; friend void swap(FantasyBitAward& a, FantasyBitAward& b) { a.Swap(&b); } inline void Swap(FantasyBitAward* other) { if (other == this) return; if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } void UnsafeArenaSwap(FantasyBitAward* other) { if (other == this) return; GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- inline FantasyBitAward* New() const final { return CreateMaybeMessage<FantasyBitAward>(nullptr); } FantasyBitAward* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<FantasyBitAward>(arena); } void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const FantasyBitAward& from); void MergeFrom(const FantasyBitAward& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FantasyBitAward* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "fantasybit.FantasyBitAward"; } protected: explicit FantasyBitAward(::PROTOBUF_NAMESPACE_ID::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; private: static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_NameData_2eproto); return ::descriptor_table_NameData_2eproto.file_level_metadata[kIndexInFileMessages]; } public: // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kNameFieldNumber = 10, kProjFieldNumber = 20, kAwardFieldNumber = 30, }; // optional string name = 10; bool has_name() const; private: bool _internal_has_name() const; public: void clear_name(); const std::string& name() const; void set_name(const std::string& value); void set_name(std::string&& value); void set_name(const char* value); void set_name(const char* value, size_t size); std::string* mutable_name(); std::string* release_name(); void set_allocated_name(std::string* name); private: const std::string& _internal_name() const; void _internal_set_name(const std::string& value); std::string* _internal_mutable_name(); public: // optional int32 proj = 20; bool has_proj() const; private: bool _internal_has_proj() const; public: void clear_proj(); ::PROTOBUF_NAMESPACE_ID::int32 proj() const; void set_proj(::PROTOBUF_NAMESPACE_ID::int32 value); private: ::PROTOBUF_NAMESPACE_ID::int32 _internal_proj() const; void _internal_set_proj(::PROTOBUF_NAMESPACE_ID::int32 value); public: // optional uint64 award = 30; bool has_award() const; private: bool _internal_has_award() const; public: void clear_award(); ::PROTOBUF_NAMESPACE_ID::uint64 award() const; void set_award(::PROTOBUF_NAMESPACE_ID::uint64 value); private: ::PROTOBUF_NAMESPACE_ID::uint64 _internal_award() const; void _internal_set_award(::PROTOBUF_NAMESPACE_ID::uint64 value); public: // @@protoc_insertion_point(class_scope:fantasybit.FantasyBitAward) private: class _Internal; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::int32 proj_; ::PROTOBUF_NAMESPACE_ID::uint64 award_; friend struct ::TableStruct_NameData_2eproto; }; // ------------------------------------------------------------------- class FantasyBitPnl PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:fantasybit.FantasyBitPnl) */ { public: inline FantasyBitPnl() : FantasyBitPnl(nullptr) {}; virtual ~FantasyBitPnl(); FantasyBitPnl(const FantasyBitPnl& from); FantasyBitPnl(FantasyBitPnl&& from) noexcept : FantasyBitPnl() { *this = ::std::move(from); } inline FantasyBitPnl& operator=(const FantasyBitPnl& from) { CopyFrom(from); return *this; } inline FantasyBitPnl& operator=(FantasyBitPnl&& from) noexcept { if (GetArena() == from.GetArena()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return GetMetadataStatic().reflection; } static const FantasyBitPnl& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FantasyBitPnl* internal_default_instance() { return reinterpret_cast<const FantasyBitPnl*>( &_FantasyBitPnl_default_instance_); } static constexpr int kIndexInFileMessages = 2; friend void swap(FantasyBitPnl& a, FantasyBitPnl& b) { a.Swap(&b); } inline void Swap(FantasyBitPnl* other) { if (other == this) return; if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } void UnsafeArenaSwap(FantasyBitPnl* other) { if (other == this) return; GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- inline FantasyBitPnl* New() const final { return CreateMaybeMessage<FantasyBitPnl>(nullptr); } FantasyBitPnl* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<FantasyBitPnl>(arena); } void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const FantasyBitPnl& from); void MergeFrom(const FantasyBitPnl& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FantasyBitPnl* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "fantasybit.FantasyBitPnl"; } protected: explicit FantasyBitPnl(::PROTOBUF_NAMESPACE_ID::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; private: static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_NameData_2eproto); return ::descriptor_table_NameData_2eproto.file_level_metadata[kIndexInFileMessages]; } public: // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kNameFieldNumber = 10, kSposFieldNumber = 20, kPnlFieldNumber = 30, }; // optional string name = 10; bool has_name() const; private: bool _internal_has_name() const; public: void clear_name(); const std::string& name() const; void set_name(const std::string& value); void set_name(std::string&& value); void set_name(const char* value); void set_name(const char* value, size_t size); std::string* mutable_name(); std::string* release_name(); void set_allocated_name(std::string* name); private: const std::string& _internal_name() const; void _internal_set_name(const std::string& value); std::string* _internal_mutable_name(); public: // optional .fantasybit.SettlePos spos = 20; bool has_spos() const; private: bool _internal_has_spos() const; public: void clear_spos(); const ::fantasybit::SettlePos& spos() const; ::fantasybit::SettlePos* release_spos(); ::fantasybit::SettlePos* mutable_spos(); void set_allocated_spos(::fantasybit::SettlePos* spos); private: const ::fantasybit::SettlePos& _internal_spos() const; ::fantasybit::SettlePos* _internal_mutable_spos(); public: void unsafe_arena_set_allocated_spos( ::fantasybit::SettlePos* spos); ::fantasybit::SettlePos* unsafe_arena_release_spos(); // optional int64 pnl = 30; bool has_pnl() const; private: bool _internal_has_pnl() const; public: void clear_pnl(); ::PROTOBUF_NAMESPACE_ID::int64 pnl() const; void set_pnl(::PROTOBUF_NAMESPACE_ID::int64 value); private: ::PROTOBUF_NAMESPACE_ID::int64 _internal_pnl() const; void _internal_set_pnl(::PROTOBUF_NAMESPACE_ID::int64 value); public: // @@protoc_insertion_point(class_scope:fantasybit.FantasyBitPnl) private: class _Internal; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::fantasybit::SettlePos* spos_; ::PROTOBUF_NAMESPACE_ID::int64 pnl_; friend struct ::TableStruct_NameData_2eproto; }; // ------------------------------------------------------------------- class FantasyBitProj PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:fantasybit.FantasyBitProj) */ { public: inline FantasyBitProj() : FantasyBitProj(nullptr) {}; virtual ~FantasyBitProj(); FantasyBitProj(const FantasyBitProj& from); FantasyBitProj(FantasyBitProj&& from) noexcept : FantasyBitProj() { *this = ::std::move(from); } inline FantasyBitProj& operator=(const FantasyBitProj& from) { CopyFrom(from); return *this; } inline FantasyBitProj& operator=(FantasyBitProj&& from) noexcept { if (GetArena() == from.GetArena()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return GetMetadataStatic().reflection; } static const FantasyBitProj& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FantasyBitProj* internal_default_instance() { return reinterpret_cast<const FantasyBitProj*>( &_FantasyBitProj_default_instance_); } static constexpr int kIndexInFileMessages = 3; friend void swap(FantasyBitProj& a, FantasyBitProj& b) { a.Swap(&b); } inline void Swap(FantasyBitProj* other) { if (other == this) return; if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } void UnsafeArenaSwap(FantasyBitProj* other) { if (other == this) return; GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- inline FantasyBitProj* New() const final { return CreateMaybeMessage<FantasyBitProj>(nullptr); } FantasyBitProj* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<FantasyBitProj>(arena); } void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const FantasyBitProj& from); void MergeFrom(const FantasyBitProj& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FantasyBitProj* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "fantasybit.FantasyBitProj"; } protected: explicit FantasyBitProj(::PROTOBUF_NAMESPACE_ID::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; private: static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_NameData_2eproto); return ::descriptor_table_NameData_2eproto.file_level_metadata[kIndexInFileMessages]; } public: // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kNameFieldNumber = 10, kPlayeridFieldNumber = 30, kBlockFieldNumber = 50, kProjFieldNumber = 20, kCountFieldNumber = 40, }; // optional string name = 10; bool has_name() const; private: bool _internal_has_name() const; public: void clear_name(); const std::string& name() const; void set_name(const std::string& value); void set_name(std::string&& value); void set_name(const char* value); void set_name(const char* value, size_t size); std::string* mutable_name(); std::string* release_name(); void set_allocated_name(std::string* name); private: const std::string& _internal_name() const; void _internal_set_name(const std::string& value); std::string* _internal_mutable_name(); public: // optional string playerid = 30; bool has_playerid() const; private: bool _internal_has_playerid() const; public: void clear_playerid(); const std::string& playerid() const; void set_playerid(const std::string& value); void set_playerid(std::string&& value); void set_playerid(const char* value); void set_playerid(const char* value, size_t size); std::string* mutable_playerid(); std::string* release_playerid(); void set_allocated_playerid(std::string* playerid); private: const std::string& _internal_playerid() const; void _internal_set_playerid(const std::string& value); std::string* _internal_mutable_playerid(); public: // optional int32 block = 50; bool has_block() const; private: bool _internal_has_block() const; public: void clear_block(); ::PROTOBUF_NAMESPACE_ID::int32 block() const; void set_block(::PROTOBUF_NAMESPACE_ID::int32 value); private: ::PROTOBUF_NAMESPACE_ID::int32 _internal_block() const; void _internal_set_block(::PROTOBUF_NAMESPACE_ID::int32 value); public: // optional int32 proj = 20; bool has_proj() const; private: bool _internal_has_proj() const; public: void clear_proj(); ::PROTOBUF_NAMESPACE_ID::int32 proj() const; void set_proj(::PROTOBUF_NAMESPACE_ID::int32 value); private: ::PROTOBUF_NAMESPACE_ID::int32 _internal_proj() const; void _internal_set_proj(::PROTOBUF_NAMESPACE_ID::int32 value); public: // optional int32 count = 40; bool has_count() const; private: bool _internal_has_count() const; public: void clear_count(); ::PROTOBUF_NAMESPACE_ID::int32 count() const; void set_count(::PROTOBUF_NAMESPACE_ID::int32 value); private: ::PROTOBUF_NAMESPACE_ID::int32 _internal_count() const; void _internal_set_count(::PROTOBUF_NAMESPACE_ID::int32 value); public: // @@protoc_insertion_point(class_scope:fantasybit.FantasyBitProj) private: class _Internal; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr playerid_; ::PROTOBUF_NAMESPACE_ID::int32 block_; ::PROTOBUF_NAMESPACE_ID::int32 proj_; ::PROTOBUF_NAMESPACE_ID::int32 count_; friend struct ::TableStruct_NameData_2eproto; }; // ------------------------------------------------------------------- class GameFantasyBitProj PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:fantasybit.GameFantasyBitProj) */ { public: inline GameFantasyBitProj() : GameFantasyBitProj(nullptr) {}; virtual ~GameFantasyBitProj(); GameFantasyBitProj(const GameFantasyBitProj& from); GameFantasyBitProj(GameFantasyBitProj&& from) noexcept : GameFantasyBitProj() { *this = ::std::move(from); } inline GameFantasyBitProj& operator=(const GameFantasyBitProj& from) { CopyFrom(from); return *this; } inline GameFantasyBitProj& operator=(GameFantasyBitProj&& from) noexcept { if (GetArena() == from.GetArena()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return GetMetadataStatic().reflection; } static const GameFantasyBitProj& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const GameFantasyBitProj* internal_default_instance() { return reinterpret_cast<const GameFantasyBitProj*>( &_GameFantasyBitProj_default_instance_); } static constexpr int kIndexInFileMessages = 4; friend void swap(GameFantasyBitProj& a, GameFantasyBitProj& b) { a.Swap(&b); } inline void Swap(GameFantasyBitProj* other) { if (other == this) return; if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } void UnsafeArenaSwap(GameFantasyBitProj* other) { if (other == this) return; GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- inline GameFantasyBitProj* New() const final { return CreateMaybeMessage<GameFantasyBitProj>(nullptr); } GameFantasyBitProj* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<GameFantasyBitProj>(arena); } void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const GameFantasyBitProj& from); void MergeFrom(const GameFantasyBitProj& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(GameFantasyBitProj* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "fantasybit.GameFantasyBitProj"; } protected: explicit GameFantasyBitProj(::PROTOBUF_NAMESPACE_ID::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; private: static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_NameData_2eproto); return ::descriptor_table_NameData_2eproto.file_level_metadata[kIndexInFileMessages]; } public: // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kHomeFieldNumber = 20, kAwayFieldNumber = 30, kGameidFieldNumber = 10, }; // repeated .fantasybit.FantasyBitProj home = 20; int home_size() const; private: int _internal_home_size() const; public: void clear_home(); ::fantasybit::FantasyBitProj* mutable_home(int index); ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj >* mutable_home(); private: const ::fantasybit::FantasyBitProj& _internal_home(int index) const; ::fantasybit::FantasyBitProj* _internal_add_home(); public: const ::fantasybit::FantasyBitProj& home(int index) const; ::fantasybit::FantasyBitProj* add_home(); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj >& home() const; // repeated .fantasybit.FantasyBitProj away = 30; int away_size() const; private: int _internal_away_size() const; public: void clear_away(); ::fantasybit::FantasyBitProj* mutable_away(int index); ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj >* mutable_away(); private: const ::fantasybit::FantasyBitProj& _internal_away(int index) const; ::fantasybit::FantasyBitProj* _internal_add_away(); public: const ::fantasybit::FantasyBitProj& away(int index) const; ::fantasybit::FantasyBitProj* add_away(); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj >& away() const; // optional string gameid = 10; bool has_gameid() const; private: bool _internal_has_gameid() const; public: void clear_gameid(); const std::string& gameid() const; void set_gameid(const std::string& value); void set_gameid(std::string&& value); void set_gameid(const char* value); void set_gameid(const char* value, size_t size); std::string* mutable_gameid(); std::string* release_gameid(); void set_allocated_gameid(std::string* gameid); private: const std::string& _internal_gameid() const; void _internal_set_gameid(const std::string& value); std::string* _internal_mutable_gameid(); public: // @@protoc_insertion_point(class_scope:fantasybit.GameFantasyBitProj) private: class _Internal; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj > home_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj > away_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr gameid_; friend struct ::TableStruct_NameData_2eproto; }; // =================================================================== // =================================================================== #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ // FantasyNameBal // optional string name = 10; inline bool FantasyNameBal::_internal_has_name() const { bool value = (_has_bits_[0] & 0x00000001u) != 0; return value; } inline bool FantasyNameBal::has_name() const { return _internal_has_name(); } inline void FantasyNameBal::clear_name() { name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& FantasyNameBal::name() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyNameBal.name) return _internal_name(); } inline void FantasyNameBal::set_name(const std::string& value) { _internal_set_name(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyNameBal.name) } inline std::string* FantasyNameBal::mutable_name() { // @@protoc_insertion_point(field_mutable:fantasybit.FantasyNameBal.name) return _internal_mutable_name(); } inline const std::string& FantasyNameBal::_internal_name() const { return name_.Get(); } inline void FantasyNameBal::_internal_set_name(const std::string& value) { _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); } inline void FantasyNameBal::set_name(std::string&& value) { _has_bits_[0] |= 0x00000001u; name_.Set( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); // @@protoc_insertion_point(field_set_rvalue:fantasybit.FantasyNameBal.name) } inline void FantasyNameBal::set_name(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena()); // @@protoc_insertion_point(field_set_char:fantasybit.FantasyNameBal.name) } inline void FantasyNameBal::set_name(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArena()); // @@protoc_insertion_point(field_set_pointer:fantasybit.FantasyNameBal.name) } inline std::string* FantasyNameBal::_internal_mutable_name() { _has_bits_[0] |= 0x00000001u; return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* FantasyNameBal::release_name() { // @@protoc_insertion_point(field_release:fantasybit.FantasyNameBal.name) if (!_internal_has_name()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void FantasyNameBal::set_allocated_name(std::string* name) { if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, GetArena()); // @@protoc_insertion_point(field_set_allocated:fantasybit.FantasyNameBal.name) } // optional string public_key = 20; inline bool FantasyNameBal::_internal_has_public_key() const { bool value = (_has_bits_[0] & 0x00000002u) != 0; return value; } inline bool FantasyNameBal::has_public_key() const { return _internal_has_public_key(); } inline void FantasyNameBal::clear_public_key() { public_key_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); _has_bits_[0] &= ~0x00000002u; } inline const std::string& FantasyNameBal::public_key() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyNameBal.public_key) return _internal_public_key(); } inline void FantasyNameBal::set_public_key(const std::string& value) { _internal_set_public_key(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyNameBal.public_key) } inline std::string* FantasyNameBal::mutable_public_key() { // @@protoc_insertion_point(field_mutable:fantasybit.FantasyNameBal.public_key) return _internal_mutable_public_key(); } inline const std::string& FantasyNameBal::_internal_public_key() const { return public_key_.Get(); } inline void FantasyNameBal::_internal_set_public_key(const std::string& value) { _has_bits_[0] |= 0x00000002u; public_key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); } inline void FantasyNameBal::set_public_key(std::string&& value) { _has_bits_[0] |= 0x00000002u; public_key_.Set( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); // @@protoc_insertion_point(field_set_rvalue:fantasybit.FantasyNameBal.public_key) } inline void FantasyNameBal::set_public_key(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; public_key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena()); // @@protoc_insertion_point(field_set_char:fantasybit.FantasyNameBal.public_key) } inline void FantasyNameBal::set_public_key(const char* value, size_t size) { _has_bits_[0] |= 0x00000002u; public_key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArena()); // @@protoc_insertion_point(field_set_pointer:fantasybit.FantasyNameBal.public_key) } inline std::string* FantasyNameBal::_internal_mutable_public_key() { _has_bits_[0] |= 0x00000002u; return public_key_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* FantasyNameBal::release_public_key() { // @@protoc_insertion_point(field_release:fantasybit.FantasyNameBal.public_key) if (!_internal_has_public_key()) { return nullptr; } _has_bits_[0] &= ~0x00000002u; return public_key_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void FantasyNameBal::set_allocated_public_key(std::string* public_key) { if (public_key != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; } public_key_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), public_key, GetArena()); // @@protoc_insertion_point(field_set_allocated:fantasybit.FantasyNameBal.public_key) } // optional uint64 bits = 30; inline bool FantasyNameBal::_internal_has_bits() const { bool value = (_has_bits_[0] & 0x00000004u) != 0; return value; } inline bool FantasyNameBal::has_bits() const { return _internal_has_bits(); } inline void FantasyNameBal::clear_bits() { bits_ = PROTOBUF_ULONGLONG(0); _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::uint64 FantasyNameBal::_internal_bits() const { return bits_; } inline ::PROTOBUF_NAMESPACE_ID::uint64 FantasyNameBal::bits() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyNameBal.bits) return _internal_bits(); } inline void FantasyNameBal::_internal_set_bits(::PROTOBUF_NAMESPACE_ID::uint64 value) { _has_bits_[0] |= 0x00000004u; bits_ = value; } inline void FantasyNameBal::set_bits(::PROTOBUF_NAMESPACE_ID::uint64 value) { _internal_set_bits(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyNameBal.bits) } // optional int64 stake = 40; inline bool FantasyNameBal::_internal_has_stake() const { bool value = (_has_bits_[0] & 0x00000008u) != 0; return value; } inline bool FantasyNameBal::has_stake() const { return _internal_has_stake(); } inline void FantasyNameBal::clear_stake() { stake_ = PROTOBUF_LONGLONG(0); _has_bits_[0] &= ~0x00000008u; } inline ::PROTOBUF_NAMESPACE_ID::int64 FantasyNameBal::_internal_stake() const { return stake_; } inline ::PROTOBUF_NAMESPACE_ID::int64 FantasyNameBal::stake() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyNameBal.stake) return _internal_stake(); } inline void FantasyNameBal::_internal_set_stake(::PROTOBUF_NAMESPACE_ID::int64 value) { _has_bits_[0] |= 0x00000008u; stake_ = value; } inline void FantasyNameBal::set_stake(::PROTOBUF_NAMESPACE_ID::int64 value) { _internal_set_stake(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyNameBal.stake) } // optional uint64 chash = 50; inline bool FantasyNameBal::_internal_has_chash() const { bool value = (_has_bits_[0] & 0x00000010u) != 0; return value; } inline bool FantasyNameBal::has_chash() const { return _internal_has_chash(); } inline void FantasyNameBal::clear_chash() { chash_ = PROTOBUF_ULONGLONG(0); _has_bits_[0] &= ~0x00000010u; } inline ::PROTOBUF_NAMESPACE_ID::uint64 FantasyNameBal::_internal_chash() const { return chash_; } inline ::PROTOBUF_NAMESPACE_ID::uint64 FantasyNameBal::chash() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyNameBal.chash) return _internal_chash(); } inline void FantasyNameBal::_internal_set_chash(::PROTOBUF_NAMESPACE_ID::uint64 value) { _has_bits_[0] |= 0x00000010u; chash_ = value; } inline void FantasyNameBal::set_chash(::PROTOBUF_NAMESPACE_ID::uint64 value) { _internal_set_chash(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyNameBal.chash) } // optional int32 block = 60; inline bool FantasyNameBal::_internal_has_block() const { bool value = (_has_bits_[0] & 0x00000020u) != 0; return value; } inline bool FantasyNameBal::has_block() const { return _internal_has_block(); } inline void FantasyNameBal::clear_block() { block_ = 0; _has_bits_[0] &= ~0x00000020u; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyNameBal::_internal_block() const { return block_; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyNameBal::block() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyNameBal.block) return _internal_block(); } inline void FantasyNameBal::_internal_set_block(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000020u; block_ = value; } inline void FantasyNameBal::set_block(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_block(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyNameBal.block) } // optional int32 count = 70; inline bool FantasyNameBal::_internal_has_count() const { bool value = (_has_bits_[0] & 0x00000040u) != 0; return value; } inline bool FantasyNameBal::has_count() const { return _internal_has_count(); } inline void FantasyNameBal::clear_count() { count_ = 0; _has_bits_[0] &= ~0x00000040u; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyNameBal::_internal_count() const { return count_; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyNameBal::count() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyNameBal.count) return _internal_count(); } inline void FantasyNameBal::_internal_set_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000040u; count_ = value; } inline void FantasyNameBal::set_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_count(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyNameBal.count) } // ------------------------------------------------------------------- // FantasyBitAward // optional string name = 10; inline bool FantasyBitAward::_internal_has_name() const { bool value = (_has_bits_[0] & 0x00000001u) != 0; return value; } inline bool FantasyBitAward::has_name() const { return _internal_has_name(); } inline void FantasyBitAward::clear_name() { name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& FantasyBitAward::name() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitAward.name) return _internal_name(); } inline void FantasyBitAward::set_name(const std::string& value) { _internal_set_name(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitAward.name) } inline std::string* FantasyBitAward::mutable_name() { // @@protoc_insertion_point(field_mutable:fantasybit.FantasyBitAward.name) return _internal_mutable_name(); } inline const std::string& FantasyBitAward::_internal_name() const { return name_.Get(); } inline void FantasyBitAward::_internal_set_name(const std::string& value) { _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); } inline void FantasyBitAward::set_name(std::string&& value) { _has_bits_[0] |= 0x00000001u; name_.Set( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); // @@protoc_insertion_point(field_set_rvalue:fantasybit.FantasyBitAward.name) } inline void FantasyBitAward::set_name(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena()); // @@protoc_insertion_point(field_set_char:fantasybit.FantasyBitAward.name) } inline void FantasyBitAward::set_name(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArena()); // @@protoc_insertion_point(field_set_pointer:fantasybit.FantasyBitAward.name) } inline std::string* FantasyBitAward::_internal_mutable_name() { _has_bits_[0] |= 0x00000001u; return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* FantasyBitAward::release_name() { // @@protoc_insertion_point(field_release:fantasybit.FantasyBitAward.name) if (!_internal_has_name()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void FantasyBitAward::set_allocated_name(std::string* name) { if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, GetArena()); // @@protoc_insertion_point(field_set_allocated:fantasybit.FantasyBitAward.name) } // optional int32 proj = 20; inline bool FantasyBitAward::_internal_has_proj() const { bool value = (_has_bits_[0] & 0x00000002u) != 0; return value; } inline bool FantasyBitAward::has_proj() const { return _internal_has_proj(); } inline void FantasyBitAward::clear_proj() { proj_ = 0; _has_bits_[0] &= ~0x00000002u; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyBitAward::_internal_proj() const { return proj_; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyBitAward::proj() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitAward.proj) return _internal_proj(); } inline void FantasyBitAward::_internal_set_proj(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000002u; proj_ = value; } inline void FantasyBitAward::set_proj(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_proj(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitAward.proj) } // optional uint64 award = 30; inline bool FantasyBitAward::_internal_has_award() const { bool value = (_has_bits_[0] & 0x00000004u) != 0; return value; } inline bool FantasyBitAward::has_award() const { return _internal_has_award(); } inline void FantasyBitAward::clear_award() { award_ = PROTOBUF_ULONGLONG(0); _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::uint64 FantasyBitAward::_internal_award() const { return award_; } inline ::PROTOBUF_NAMESPACE_ID::uint64 FantasyBitAward::award() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitAward.award) return _internal_award(); } inline void FantasyBitAward::_internal_set_award(::PROTOBUF_NAMESPACE_ID::uint64 value) { _has_bits_[0] |= 0x00000004u; award_ = value; } inline void FantasyBitAward::set_award(::PROTOBUF_NAMESPACE_ID::uint64 value) { _internal_set_award(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitAward.award) } // ------------------------------------------------------------------- // FantasyBitPnl // optional string name = 10; inline bool FantasyBitPnl::_internal_has_name() const { bool value = (_has_bits_[0] & 0x00000001u) != 0; return value; } inline bool FantasyBitPnl::has_name() const { return _internal_has_name(); } inline void FantasyBitPnl::clear_name() { name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& FantasyBitPnl::name() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitPnl.name) return _internal_name(); } inline void FantasyBitPnl::set_name(const std::string& value) { _internal_set_name(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitPnl.name) } inline std::string* FantasyBitPnl::mutable_name() { // @@protoc_insertion_point(field_mutable:fantasybit.FantasyBitPnl.name) return _internal_mutable_name(); } inline const std::string& FantasyBitPnl::_internal_name() const { return name_.Get(); } inline void FantasyBitPnl::_internal_set_name(const std::string& value) { _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); } inline void FantasyBitPnl::set_name(std::string&& value) { _has_bits_[0] |= 0x00000001u; name_.Set( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); // @@protoc_insertion_point(field_set_rvalue:fantasybit.FantasyBitPnl.name) } inline void FantasyBitPnl::set_name(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena()); // @@protoc_insertion_point(field_set_char:fantasybit.FantasyBitPnl.name) } inline void FantasyBitPnl::set_name(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArena()); // @@protoc_insertion_point(field_set_pointer:fantasybit.FantasyBitPnl.name) } inline std::string* FantasyBitPnl::_internal_mutable_name() { _has_bits_[0] |= 0x00000001u; return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* FantasyBitPnl::release_name() { // @@protoc_insertion_point(field_release:fantasybit.FantasyBitPnl.name) if (!_internal_has_name()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void FantasyBitPnl::set_allocated_name(std::string* name) { if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, GetArena()); // @@protoc_insertion_point(field_set_allocated:fantasybit.FantasyBitPnl.name) } // optional .fantasybit.SettlePos spos = 20; inline bool FantasyBitPnl::_internal_has_spos() const { bool value = (_has_bits_[0] & 0x00000002u) != 0; PROTOBUF_ASSUME(!value || spos_ != nullptr); return value; } inline bool FantasyBitPnl::has_spos() const { return _internal_has_spos(); } inline const ::fantasybit::SettlePos& FantasyBitPnl::_internal_spos() const { const ::fantasybit::SettlePos* p = spos_; return p != nullptr ? *p : *reinterpret_cast<const ::fantasybit::SettlePos*>( &::fantasybit::_SettlePos_default_instance_); } inline const ::fantasybit::SettlePos& FantasyBitPnl::spos() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitPnl.spos) return _internal_spos(); } inline void FantasyBitPnl::unsafe_arena_set_allocated_spos( ::fantasybit::SettlePos* spos) { if (GetArena() == nullptr) { delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(spos_); } spos_ = spos; if (spos) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:fantasybit.FantasyBitPnl.spos) } inline ::fantasybit::SettlePos* FantasyBitPnl::release_spos() { _has_bits_[0] &= ~0x00000002u; ::fantasybit::SettlePos* temp = spos_; spos_ = nullptr; if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } return temp; } inline ::fantasybit::SettlePos* FantasyBitPnl::unsafe_arena_release_spos() { // @@protoc_insertion_point(field_release:fantasybit.FantasyBitPnl.spos) _has_bits_[0] &= ~0x00000002u; ::fantasybit::SettlePos* temp = spos_; spos_ = nullptr; return temp; } inline ::fantasybit::SettlePos* FantasyBitPnl::_internal_mutable_spos() { _has_bits_[0] |= 0x00000002u; if (spos_ == nullptr) { auto* p = CreateMaybeMessage<::fantasybit::SettlePos>(GetArena()); spos_ = p; } return spos_; } inline ::fantasybit::SettlePos* FantasyBitPnl::mutable_spos() { // @@protoc_insertion_point(field_mutable:fantasybit.FantasyBitPnl.spos) return _internal_mutable_spos(); } inline void FantasyBitPnl::set_allocated_spos(::fantasybit::SettlePos* spos) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); if (message_arena == nullptr) { delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(spos_); } if (spos) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(spos)->GetArena(); if (message_arena != submessage_arena) { spos = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, spos, submessage_arena); } _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; } spos_ = spos; // @@protoc_insertion_point(field_set_allocated:fantasybit.FantasyBitPnl.spos) } // optional int64 pnl = 30; inline bool FantasyBitPnl::_internal_has_pnl() const { bool value = (_has_bits_[0] & 0x00000004u) != 0; return value; } inline bool FantasyBitPnl::has_pnl() const { return _internal_has_pnl(); } inline void FantasyBitPnl::clear_pnl() { pnl_ = PROTOBUF_LONGLONG(0); _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::int64 FantasyBitPnl::_internal_pnl() const { return pnl_; } inline ::PROTOBUF_NAMESPACE_ID::int64 FantasyBitPnl::pnl() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitPnl.pnl) return _internal_pnl(); } inline void FantasyBitPnl::_internal_set_pnl(::PROTOBUF_NAMESPACE_ID::int64 value) { _has_bits_[0] |= 0x00000004u; pnl_ = value; } inline void FantasyBitPnl::set_pnl(::PROTOBUF_NAMESPACE_ID::int64 value) { _internal_set_pnl(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitPnl.pnl) } // ------------------------------------------------------------------- // FantasyBitProj // optional string name = 10; inline bool FantasyBitProj::_internal_has_name() const { bool value = (_has_bits_[0] & 0x00000001u) != 0; return value; } inline bool FantasyBitProj::has_name() const { return _internal_has_name(); } inline void FantasyBitProj::clear_name() { name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& FantasyBitProj::name() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitProj.name) return _internal_name(); } inline void FantasyBitProj::set_name(const std::string& value) { _internal_set_name(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitProj.name) } inline std::string* FantasyBitProj::mutable_name() { // @@protoc_insertion_point(field_mutable:fantasybit.FantasyBitProj.name) return _internal_mutable_name(); } inline const std::string& FantasyBitProj::_internal_name() const { return name_.Get(); } inline void FantasyBitProj::_internal_set_name(const std::string& value) { _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); } inline void FantasyBitProj::set_name(std::string&& value) { _has_bits_[0] |= 0x00000001u; name_.Set( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); // @@protoc_insertion_point(field_set_rvalue:fantasybit.FantasyBitProj.name) } inline void FantasyBitProj::set_name(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena()); // @@protoc_insertion_point(field_set_char:fantasybit.FantasyBitProj.name) } inline void FantasyBitProj::set_name(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArena()); // @@protoc_insertion_point(field_set_pointer:fantasybit.FantasyBitProj.name) } inline std::string* FantasyBitProj::_internal_mutable_name() { _has_bits_[0] |= 0x00000001u; return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* FantasyBitProj::release_name() { // @@protoc_insertion_point(field_release:fantasybit.FantasyBitProj.name) if (!_internal_has_name()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void FantasyBitProj::set_allocated_name(std::string* name) { if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, GetArena()); // @@protoc_insertion_point(field_set_allocated:fantasybit.FantasyBitProj.name) } // optional int32 proj = 20; inline bool FantasyBitProj::_internal_has_proj() const { bool value = (_has_bits_[0] & 0x00000008u) != 0; return value; } inline bool FantasyBitProj::has_proj() const { return _internal_has_proj(); } inline void FantasyBitProj::clear_proj() { proj_ = 0; _has_bits_[0] &= ~0x00000008u; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyBitProj::_internal_proj() const { return proj_; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyBitProj::proj() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitProj.proj) return _internal_proj(); } inline void FantasyBitProj::_internal_set_proj(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000008u; proj_ = value; } inline void FantasyBitProj::set_proj(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_proj(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitProj.proj) } // optional string playerid = 30; inline bool FantasyBitProj::_internal_has_playerid() const { bool value = (_has_bits_[0] & 0x00000002u) != 0; return value; } inline bool FantasyBitProj::has_playerid() const { return _internal_has_playerid(); } inline void FantasyBitProj::clear_playerid() { playerid_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); _has_bits_[0] &= ~0x00000002u; } inline const std::string& FantasyBitProj::playerid() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitProj.playerid) return _internal_playerid(); } inline void FantasyBitProj::set_playerid(const std::string& value) { _internal_set_playerid(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitProj.playerid) } inline std::string* FantasyBitProj::mutable_playerid() { // @@protoc_insertion_point(field_mutable:fantasybit.FantasyBitProj.playerid) return _internal_mutable_playerid(); } inline const std::string& FantasyBitProj::_internal_playerid() const { return playerid_.Get(); } inline void FantasyBitProj::_internal_set_playerid(const std::string& value) { _has_bits_[0] |= 0x00000002u; playerid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); } inline void FantasyBitProj::set_playerid(std::string&& value) { _has_bits_[0] |= 0x00000002u; playerid_.Set( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); // @@protoc_insertion_point(field_set_rvalue:fantasybit.FantasyBitProj.playerid) } inline void FantasyBitProj::set_playerid(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; playerid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena()); // @@protoc_insertion_point(field_set_char:fantasybit.FantasyBitProj.playerid) } inline void FantasyBitProj::set_playerid(const char* value, size_t size) { _has_bits_[0] |= 0x00000002u; playerid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArena()); // @@protoc_insertion_point(field_set_pointer:fantasybit.FantasyBitProj.playerid) } inline std::string* FantasyBitProj::_internal_mutable_playerid() { _has_bits_[0] |= 0x00000002u; return playerid_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* FantasyBitProj::release_playerid() { // @@protoc_insertion_point(field_release:fantasybit.FantasyBitProj.playerid) if (!_internal_has_playerid()) { return nullptr; } _has_bits_[0] &= ~0x00000002u; return playerid_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void FantasyBitProj::set_allocated_playerid(std::string* playerid) { if (playerid != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; } playerid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), playerid, GetArena()); // @@protoc_insertion_point(field_set_allocated:fantasybit.FantasyBitProj.playerid) } // optional int32 count = 40; inline bool FantasyBitProj::_internal_has_count() const { bool value = (_has_bits_[0] & 0x00000010u) != 0; return value; } inline bool FantasyBitProj::has_count() const { return _internal_has_count(); } inline void FantasyBitProj::clear_count() { count_ = 0; _has_bits_[0] &= ~0x00000010u; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyBitProj::_internal_count() const { return count_; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyBitProj::count() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitProj.count) return _internal_count(); } inline void FantasyBitProj::_internal_set_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000010u; count_ = value; } inline void FantasyBitProj::set_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_count(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitProj.count) } // optional int32 block = 50; inline bool FantasyBitProj::_internal_has_block() const { bool value = (_has_bits_[0] & 0x00000004u) != 0; return value; } inline bool FantasyBitProj::has_block() const { return _internal_has_block(); } inline void FantasyBitProj::clear_block() { block_ = 0; _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyBitProj::_internal_block() const { return block_; } inline ::PROTOBUF_NAMESPACE_ID::int32 FantasyBitProj::block() const { // @@protoc_insertion_point(field_get:fantasybit.FantasyBitProj.block) return _internal_block(); } inline void FantasyBitProj::_internal_set_block(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000004u; block_ = value; } inline void FantasyBitProj::set_block(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_block(value); // @@protoc_insertion_point(field_set:fantasybit.FantasyBitProj.block) } // ------------------------------------------------------------------- // GameFantasyBitProj // optional string gameid = 10; inline bool GameFantasyBitProj::_internal_has_gameid() const { bool value = (_has_bits_[0] & 0x00000001u) != 0; return value; } inline bool GameFantasyBitProj::has_gameid() const { return _internal_has_gameid(); } inline void GameFantasyBitProj::clear_gameid() { gameid_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& GameFantasyBitProj::gameid() const { // @@protoc_insertion_point(field_get:fantasybit.GameFantasyBitProj.gameid) return _internal_gameid(); } inline void GameFantasyBitProj::set_gameid(const std::string& value) { _internal_set_gameid(value); // @@protoc_insertion_point(field_set:fantasybit.GameFantasyBitProj.gameid) } inline std::string* GameFantasyBitProj::mutable_gameid() { // @@protoc_insertion_point(field_mutable:fantasybit.GameFantasyBitProj.gameid) return _internal_mutable_gameid(); } inline const std::string& GameFantasyBitProj::_internal_gameid() const { return gameid_.Get(); } inline void GameFantasyBitProj::_internal_set_gameid(const std::string& value) { _has_bits_[0] |= 0x00000001u; gameid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); } inline void GameFantasyBitProj::set_gameid(std::string&& value) { _has_bits_[0] |= 0x00000001u; gameid_.Set( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); // @@protoc_insertion_point(field_set_rvalue:fantasybit.GameFantasyBitProj.gameid) } inline void GameFantasyBitProj::set_gameid(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; gameid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena()); // @@protoc_insertion_point(field_set_char:fantasybit.GameFantasyBitProj.gameid) } inline void GameFantasyBitProj::set_gameid(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; gameid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArena()); // @@protoc_insertion_point(field_set_pointer:fantasybit.GameFantasyBitProj.gameid) } inline std::string* GameFantasyBitProj::_internal_mutable_gameid() { _has_bits_[0] |= 0x00000001u; return gameid_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* GameFantasyBitProj::release_gameid() { // @@protoc_insertion_point(field_release:fantasybit.GameFantasyBitProj.gameid) if (!_internal_has_gameid()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return gameid_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void GameFantasyBitProj::set_allocated_gameid(std::string* gameid) { if (gameid != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } gameid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), gameid, GetArena()); // @@protoc_insertion_point(field_set_allocated:fantasybit.GameFantasyBitProj.gameid) } // repeated .fantasybit.FantasyBitProj home = 20; inline int GameFantasyBitProj::_internal_home_size() const { return home_.size(); } inline int GameFantasyBitProj::home_size() const { return _internal_home_size(); } inline void GameFantasyBitProj::clear_home() { home_.Clear(); } inline ::fantasybit::FantasyBitProj* GameFantasyBitProj::mutable_home(int index) { // @@protoc_insertion_point(field_mutable:fantasybit.GameFantasyBitProj.home) return home_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj >* GameFantasyBitProj::mutable_home() { // @@protoc_insertion_point(field_mutable_list:fantasybit.GameFantasyBitProj.home) return &home_; } inline const ::fantasybit::FantasyBitProj& GameFantasyBitProj::_internal_home(int index) const { return home_.Get(index); } inline const ::fantasybit::FantasyBitProj& GameFantasyBitProj::home(int index) const { // @@protoc_insertion_point(field_get:fantasybit.GameFantasyBitProj.home) return _internal_home(index); } inline ::fantasybit::FantasyBitProj* GameFantasyBitProj::_internal_add_home() { return home_.Add(); } inline ::fantasybit::FantasyBitProj* GameFantasyBitProj::add_home() { // @@protoc_insertion_point(field_add:fantasybit.GameFantasyBitProj.home) return _internal_add_home(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj >& GameFantasyBitProj::home() const { // @@protoc_insertion_point(field_list:fantasybit.GameFantasyBitProj.home) return home_; } // repeated .fantasybit.FantasyBitProj away = 30; inline int GameFantasyBitProj::_internal_away_size() const { return away_.size(); } inline int GameFantasyBitProj::away_size() const { return _internal_away_size(); } inline void GameFantasyBitProj::clear_away() { away_.Clear(); } inline ::fantasybit::FantasyBitProj* GameFantasyBitProj::mutable_away(int index) { // @@protoc_insertion_point(field_mutable:fantasybit.GameFantasyBitProj.away) return away_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj >* GameFantasyBitProj::mutable_away() { // @@protoc_insertion_point(field_mutable_list:fantasybit.GameFantasyBitProj.away) return &away_; } inline const ::fantasybit::FantasyBitProj& GameFantasyBitProj::_internal_away(int index) const { return away_.Get(index); } inline const ::fantasybit::FantasyBitProj& GameFantasyBitProj::away(int index) const { // @@protoc_insertion_point(field_get:fantasybit.GameFantasyBitProj.away) return _internal_away(index); } inline ::fantasybit::FantasyBitProj* GameFantasyBitProj::_internal_add_away() { return away_.Add(); } inline ::fantasybit::FantasyBitProj* GameFantasyBitProj::add_away() { // @@protoc_insertion_point(field_add:fantasybit.GameFantasyBitProj.away) return _internal_add_away(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::fantasybit::FantasyBitProj >& GameFantasyBitProj::away() const { // @@protoc_insertion_point(field_list:fantasybit.GameFantasyBitProj.away) return away_; } #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) } // namespace fantasybit // @@protoc_insertion_point(global_scope) #include <google/protobuf/port_undef.inc> #endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_NameData_2eproto
37.055941
148
0.737574
[ "object" ]
f154c3fc7f6de6c165c10227264310a85e8d75d4
2,667
c
C
_examples/cellrenderercombo.c
RainMark/gtk3-tutorial
a2c0cc82e4e9a090b1617ab43f8256146c7150c2
[ "CC0-1.0" ]
28
2018-11-29T02:49:29.000Z
2022-03-27T04:13:17.000Z
_examples/cellrenderercombo.c
RainMark/gtk3-tutorial
a2c0cc82e4e9a090b1617ab43f8256146c7150c2
[ "CC0-1.0" ]
null
null
null
_examples/cellrenderercombo.c
RainMark/gtk3-tutorial
a2c0cc82e4e9a090b1617ab43f8256146c7150c2
[ "CC0-1.0" ]
14
2019-04-05T09:23:50.000Z
2022-02-17T09:18:48.000Z
#include <gtk/gtk.h> static void destroy(GtkWidget *widget, gpointer data) { gtk_main_quit(); } int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(window, "destroy", G_CALLBACK(destroy), NULL); GtkListStore *liststore = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); GtkTreeIter treeiter; gtk_list_store_append(liststore, &treeiter); gtk_list_store_set(liststore, &treeiter, 0, "Television", 1, "", -1); gtk_list_store_append(liststore, &treeiter); gtk_list_store_set(liststore, &treeiter, 0, "Mobile Phone", 1, "", -1); gtk_list_store_append(liststore, &treeiter); gtk_list_store_set(liststore, &treeiter, 0, "DVD Player", 1, "", -1); GtkListStore *liststoreManufacturer = gtk_list_store_new(1, G_TYPE_STRING); GtkTreeIter treeiter2; gtk_list_store_append(liststoreManufacturer, &treeiter2); gtk_list_store_set(liststoreManufacturer, &treeiter2, 0, "Sony", -1); gtk_list_store_append(liststoreManufacturer, &treeiter2); gtk_list_store_set(liststoreManufacturer, &treeiter2, 0, "Samsung", -1); gtk_list_store_append(liststoreManufacturer, &treeiter2); gtk_list_store_set(liststoreManufacturer, &treeiter2, 0, "LG", -1); GtkWidget *treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(liststore)); gtk_container_add(GTK_CONTAINER(window), treeview); GtkTreeViewColumn *treeviewcolumn; GtkCellRenderer *cellrenderertext; GtkCellRenderer *cellrenderercombo; cellrenderertext = gtk_cell_renderer_text_new(); treeviewcolumn = gtk_tree_view_column_new_with_attributes("Device", cellrenderertext, "text", 0, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), treeviewcolumn); cellrenderercombo = gtk_cell_renderer_combo_new(); gtk_widget_set_property(GTK_WIDGET(cellrenderercombo), "model", liststoreManufacturer); treeviewcolumn = gtk_tree_view_column_new_with_attributes("Manufacturer", cellrenderercombo, "editable", TRUE, "model", liststoreManufacturer, "text-column", 0, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), treeviewcolumn); gtk_widget_show_all(window); gtk_main(); return 0; }
43.016129
93
0.63892
[ "model" ]
f160b7968b6de8a2cd1045ae2e47254693200702
447
c
C
nitan/cmds/adm/reclaim.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
1
2019-03-27T07:25:16.000Z
2019-03-27T07:25:16.000Z
nitan/cmds/adm/reclaim.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
nitan/cmds/adm/reclaim.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
// claim.c inherit F_CLEAN_UP; int filter(object ob); int main(object me, string arg) { object *ob; int i; int n; //#if 0 if (! SECURITY_D->valid_grant(me, "(admin)")) return 0; //#endif write(sprintf("一共清除了 %d 個變量.\n", reclaim_objects())); return 1; } int help() { write(@TEXT 指令格式: reclaim 查閲所有的對象,清除那些不應繼續保存在內存中的變量。 TEXT ); return 1; }
14.419355
53
0.516779
[ "object" ]
f16a2d011f7f56499e30116d4f07fbfcadb5f358
7,671
h
C
src/bkDataset/image/filter/DistanceMapImageFilter.h
BenKoehler/bk
53d9ce99cf54fe01dbb3b22ff2418cd102e20ee3
[ "MIT" ]
4
2018-12-08T15:35:38.000Z
2021-08-06T03:23:06.000Z
src/bkDataset/image/filter/DistanceMapImageFilter.h
BenKoehler/bk
53d9ce99cf54fe01dbb3b22ff2418cd102e20ee3
[ "MIT" ]
null
null
null
src/bkDataset/image/filter/DistanceMapImageFilter.h
BenKoehler/bk
53d9ce99cf54fe01dbb3b22ff2418cd102e20ee3
[ "MIT" ]
null
null
null
/* * MIT License * * Copyright (c) 2018-2019 Benjamin Köhler * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #pragma once #ifndef BK_DISTANCEMAPIMAGEFILTER_H #define BK_DISTANCEMAPIMAGEFILTER_H #include <algorithm> #include <vector> #include <bkMath/functions/list_grid_id_conversion.h> #include <bkDataset/lib/bkDataset_export.h> #ifdef BK_EMIT_PROGRESS #include <bk/Progress> #include <bk/Localization> #endif namespace bk { class BKDATASET_EXPORT DistanceMapImageFilter { //==================================================================================================== //===== DEFINITIONS //==================================================================================================== using self_type = DistanceMapImageFilter; //==================================================================================================== //===== MEMBERS //==================================================================================================== double _val; bool _value_was_set; //==================================================================================================== //===== CONSTRUCTORS & DESTRUCTOR //==================================================================================================== public: /// @{ -------------------------------------------------- CTOR DistanceMapImageFilter(); DistanceMapImageFilter(const self_type&); DistanceMapImageFilter(self_type&&) noexcept; /// @} /// @{ -------------------------------------------------- DTOR ~DistanceMapImageFilter(); /// @} //==================================================================================================== //===== GETTER //==================================================================================================== /// @{ -------------------------------------------------- GET TARGET VALUE [[nodiscard]] double value() const; [[nodiscard]] bool custom_value_was_set() const; /// @} //==================================================================================================== //===== SETTER //==================================================================================================== /// @{ -------------------------------------------------- OPERATOR = [[maybe_unused]] auto operator=(const self_type&) -> self_type&; [[maybe_unused]] auto operator=(self_type&&) noexcept -> self_type&; /// @} /// @{ -------------------------------------------------- SET VALUE //! distance to pixels with this value will be determined void set_value(double val); /// @} //==================================================================================================== //===== FUNCTIONS //==================================================================================================== /// @{ -------------------------------------------------- HELPER private: template<typename TDistanceMap, typename TVec> void _distance_map(TDistanceMap& dst, unsigned int d, unsigned int dimId, unsigned int stride, TVec& gid, bool first = false) const { if (d < dst.num_dimensions()) // outer loops (other dimensions) { if (d != dimId) { if (first) { #pragma omp parallel for for (unsigned int i = 0; i < dst.size(d); ++i) { TVec gid2 = gid; gid2[d] = i; _distance_map(dst, d + 1, dimId, stride, gid2); } } else { for (unsigned int i = 0; i < dst.size(d); ++i) { gid[d] = i; _distance_map(dst, d + 1, dimId, stride, gid, first); } } } } else // inner loop (target dimension) { // low to high gid[dimId] = 1; unsigned int lid = bk::grid_to_list_id(dst.size(), gid, dst.num_dimensions()); for (unsigned int i = 1; i < dst.size(dimId); ++i, lid += stride) { dst[lid] = std::min(dst[lid - stride] + 1, dst[lid]); } // high to low gid[dimId] = dst.size(dimId) - 2; lid = bk::grid_to_list_id(dst.size(), gid, dst.num_dimensions()); for (int i = static_cast<int>(dst.size(dimId)) - 2; i >= 0; --i, lid -= stride) { dst[lid] = std::min(dst[lid + stride] + 1, dst[lid]); } } } public: /// @} /// @{ -------------------------------------------------- APPLY template<typename TImage> [[nodiscard]] typename TImage::template self_template_type<unsigned int> apply(const TImage& img) { #ifdef BK_EMIT_PROGRESS bk::Progress& prog = bk_progress.emplace_task(4 + img.num_dimensions(), ___("Creating distance map")); #endif if (!_value_was_set) { _val = img.max_value(); } #ifdef BK_EMIT_PROGRESS prog.increment(1); #endif const unsigned int numValues = img.num_values(); const unsigned int maxdst = numValues; typename TImage::template self_template_type<unsigned int> dst; dst.set_size(img.size()); #ifdef BK_EMIT_PROGRESS prog.increment(1); #endif // init #pragma omp parallel for for (unsigned int i = 0; i < numValues; ++i) { dst[i] = img[i] == _val ? 0 : maxdst; } #ifdef BK_EMIT_PROGRESS prog.increment(2); #endif // process dims for (unsigned int dimId = 0; dimId < img.num_dimensions(); ++dimId) { const unsigned int stride = bk::stride_of_dim(img.size(), dimId, img.num_dimensions()); std::vector<unsigned int> gid(dst.num_dimensions(), 0); _distance_map(dst, 0, dimId, stride, gid, true); #ifdef BK_EMIT_PROGRESS prog.increment(1); #endif } // for dimId #ifdef BK_EMIT_PROGRESS prog.set_finished(); #endif return dst; } /// @} }; // class DistanceMapImageFilter } // namespace bk #endif //BK_DISTANCEMAPIMAGEFILTER_H
37.975248
137
0.436319
[ "vector" ]
f16b7831b69d7d818f222a9a7a3bb3dbe764fb0b
1,132
h
C
include/server_lib/network/app_connection_i.h
romualdo-bar/barbacoa-server-lib
d0778f08958b6f2d37f67d577c98ebf46c42b2b9
[ "MIT" ]
1
2020-10-27T19:23:17.000Z
2020-10-27T19:23:17.000Z
include/server_lib/network/app_connection_i.h
romualdo-bar/barbacoa-server-lib
d0778f08958b6f2d37f67d577c98ebf46c42b2b9
[ "MIT" ]
null
null
null
include/server_lib/network/app_connection_i.h
romualdo-bar/barbacoa-server-lib
d0778f08958b6f2d37f67d577c98ebf46c42b2b9
[ "MIT" ]
1
2021-08-16T13:38:15.000Z
2021-08-16T13:38:15.000Z
#pragma once #include <server_lib/network/app_unit_builder_i.h> #include <server_lib/event_loop.h> #include <functional> #include <string> #include <vector> namespace server_lib { namespace network { /** * @brief wrapper for TCP connetion (used by both server and client) for app_unit */ class app_connection_i { public: virtual ~app_connection_i() = default; /** * @return whether the client is currently connected or not * */ virtual bool is_connected() const = 0; public: virtual app_unit_builder_i& protocol() = 0; virtual app_connection_i& send(const app_unit& unit) = 0; virtual app_connection_i& commit() = 0; using receive_callback_type = std::function<void(app_connection_i&, app_unit&)>; virtual void set_on_receive_handler(const receive_callback_type&) = 0; using disconnection_callback_type = std::function<void(app_connection_i&)>; virtual void set_on_disconnect_handler(const disconnection_callback_type&) = 0; }; } // namespace network } // namespace server_lib
24.608696
88
0.673145
[ "vector" ]
f16e8ba9dd774413f9c3866948f3f614e6582b29
5,815
h
C
sdl_exp/visualisation/HUD.h
Robadob/sdl_exp
a40d4cae105933d7baa06a02c3f588938a8ef379
[ "MIT" ]
2
2018-01-12T18:52:53.000Z
2018-12-05T23:05:22.000Z
sdl_exp/visualisation/HUD.h
Robadob/sdl_exp
a40d4cae105933d7baa06a02c3f588938a8ef379
[ "MIT" ]
43
2015-11-22T22:02:06.000Z
2021-03-27T12:33:07.000Z
sdl_exp/visualisation/HUD.h
Robadob/sdl_exp
a40d4cae105933d7baa06a02c3f588938a8ef379
[ "MIT" ]
2
2015-11-23T09:30:30.000Z
2016-10-26T09:30:09.000Z
#ifndef __HUD_h__ #define __HUD_h__ #include <list> #include <tuple> #include <memory> #include "util/GLcheck.h" #include <glm/glm.hpp> class Overlay; /* Represents the orthographic plane covering the screen Add/Remove overlays (e.g. Text, Sprite2D) to control where HUD elements are to be rendered. */ class HUD { public: enum class AnchorV { North, Center, South }; enum class AnchorH { West, Center, East }; /* Wraps Overlays which have been added to the HUD, to include details necessary for rendering them */ class Item { public: /** * Convenience constructor * @param overlay The overlay element to be rendered as part of the HUD * @param x The horizontal offset from the anchored position * @param y The vertical offset from the anchored position * @param window_w The width of the HUD * @param window_h The height of the HUD * @param anchorV Vertical Anchoring location (North|Center|South), defaults Center * @param anchorH Horizontal Anchoring location (East|Center|West), defaults Center * @param zIndex The priority for which overlay should be on-top. */ Item(std::shared_ptr<Overlay> overlay, const int &x, const int &y, const unsigned int &window_w, const unsigned int &window_h, AnchorV anchorV = AnchorV::Center, AnchorH anchorH = AnchorH::Center, const int &zIndex = 0); /** * Initialises the HUDItem, by calculating the elements position * @param overlay The overlay element to be rendered as part of the HUD * @param offset The offset from the anchored position * @param windowDims The width and height of the HUD * @param anchorV Vertical Anchoring location (North|Center|South), defaults Center * @param anchorH Horizontal Anchoring location (East|Center|West), defaults Center * @param zIndex The priority for which overlay should be on-top. */ Item(std::shared_ptr<Overlay> overlay, const glm::ivec2 &offset, const glm::uvec2 &windowDims, AnchorV anchorV = AnchorV::Center, AnchorH anchorH = AnchorH::Center, const int &zIndex = 0); /** * Convenience resizeWindow(const glm::uvec2 &) * @param w The new window width * @param h The new window height */ void resizeWindow(const unsigned int &w, const unsigned int &h) { resizeWindow({ w, h }); } /** * Update the overlays quad location, based on new window size, anchors, offsets and overlay dimensions * @param dims The new window width and height * @note if glm::uvec2(0) is passed, the previous value will be used (this allows overlays to trigger themselves. */ void resizeWindow(const glm::uvec2 &dims = glm::uvec2(0)); std::shared_ptr<Overlay> overlay; const glm::ivec2 offset; const AnchorV anchorV; const AnchorH anchorH; const int zIndex; GLuint vbo; GLuint fvbo; void *data; }; /** * Convenience constructor * @param width Window width * @param height Window height * @note This is done within Visualisation, regular users have no reason to instaniate a HUD */ HUD(const unsigned int &width, const unsigned int &height); /** * Creates a new HUD, specifying the window dimensions * @param dims Window width and height * @note This is done within Visualisation, regular users have no reason to instaniate a HUD */ HUD(const glm::uvec2 &dims); /** * Adds an overlay element to the HUD * @param overlay The overlay element to be rendered as part of the HUD * @param anchorV Vertical Anchoring location (North|Center|South), defaults Center * @param anchorH Horizontal Anchoring location (East|Center|West), defaults Center * @param offset The horizontal and vertical offsets from the anchored position * @param zIndex The priority for which overlay should be on-top. * @note If two items share the same z-index, the new item will insert as though it has the lower z-index (and be rendered underneath) * @note Adding the same overlay to HUD a second time, will remove it's first instance. */ void add(std::shared_ptr<Overlay> overlay, AnchorV anchorV = AnchorV::Center, AnchorH anchorH = AnchorH::Center, const glm::ivec2 &offset = glm::ivec2(0), int zIndex = 0); /** * Removes the specified overlay from the HUD * @return The number of overlays removed */ unsigned int remove(std::shared_ptr<Overlay> overlay); /** * all overlays from the HUD */ void clear(); /** * Returns the number of overlays currently on the HUD * @return The number of overlays */ unsigned int getCount(); /** * Calls reload on all held overlay elements * @note Some overlay subclasses may not implement reload, however their shaders will be reloaded */ void reload(); /** * Renders all HUD elements in reverse z-index order, with GL_DEPTH_TEST disabled */ void render(); /** * Convenience resizeWindow(const glm::uvec2 &) * @param width New window width * @param height New window height */ void resizeWindow(const unsigned int &width, const unsigned int &height) { resizeWindow(glm::uvec2(width, height)); } /** * Repositions all HUD ovlerays according to the new window dimensions and their repsective anchoring/offset args * @param dims New window width and height */ void resizeWindow(const glm::uvec2 &dims); private: const glm::mat4 modelViewMat; glm::mat4 projectionMat; //Holds the overlay elements to be rendered in reverse z-index order std::list<std::shared_ptr<Item>> stack; glm::uvec2 dims; }; #endif //ifndef __Scene_h__
42.757353
228
0.675322
[ "render" ]
f1755b78d8712a2d8773664a8b4f0dc48d663717
3,709
h
C
annotations-acc-pack/ios/AnnotationAccPackKit/OTAnnotationKit/OTAnnotationUI/Toolbar/OTAnnotationToolbarView.h
marinaserranomontes/misc-opentok-accelerators
5898ed038f78feebf6fb7afd48a8d80d7b8c922d
[ "Apache-2.0" ]
33
2017-02-03T17:33:54.000Z
2021-05-27T05:51:41.000Z
annotations-acc-pack/ios/AnnotationAccPackKit/OTAnnotationKit/OTAnnotationUI/Toolbar/OTAnnotationToolbarView.h
opentok/misc-opentok-accelerators
5898ed038f78feebf6fb7afd48a8d80d7b8c922d
[ "Apache-2.0" ]
23
2017-02-04T04:55:38.000Z
2020-11-11T10:46:19.000Z
annotations-acc-pack/ios/AnnotationAccPackKit/OTAnnotationKit/OTAnnotationUI/Toolbar/OTAnnotationToolbarView.h
opentok/misc-opentok-accelerators
5898ed038f78feebf6fb7afd48a8d80d7b8c922d
[ "Apache-2.0" ]
22
2017-02-13T09:56:12.000Z
2022-01-26T04:52:01.000Z
// // OTAnnotationToolbarView.h // // Copyright © 2016 Tokbox, Inc. All rights reserved. // #import <UIKit/UIKit.h> #import "OTAnnotationPath.h" #import "OTAnnotationTextView.h" extern NSString *const kOTAnnotationToolbarDidPressEraseButton; extern NSString *const kOTAnnotationToolbarDidPressCleanButton; extern NSString *const kOTAnnotationToolbarDidAddTextAnnotation; @class OTAnnotationToolbarView; @protocol OTAnnotationToolbarViewDataSource <NSObject> @optional - (UIView *)annotationToolbarViewForRootViewForScreenShot:(OTAnnotationToolbarView *)toolbarView; @end @protocol OTAnnotationToolbarViewDelegate <NSObject> @optional - (BOOL)annotationToolbarViewAttemptToPressDoneButton:(OTAnnotationToolbarView *)annotationToolbarView; - (void)annotationToolbarViewDidPressDoneButton:(OTAnnotationToolbarView *)annotationToolbarView; - (void)annotationToolbarViewDidSelectDrawButton:(OTAnnotationToolbarView *)annotationToolbarView path:(OTAnnotationPath *)path; - (void)annotationToolbarViewDidPressEraseButton:(OTAnnotationToolbarView *)annotationToolbarView; - (void)annotationToolbarViewDidPressCleanButton:(OTAnnotationToolbarView *)annotationToolbarView; - (void)annotationToolbarViewDidStartTextAnnotation:(OTAnnotationToolbarView *)annotationToolbarView; - (void)annotationToolbarViewDidAddTextAnnotation:(OTAnnotationToolbarView *)annotationToolbarView annotationTextView:(OTAnnotationTextView *)textView; - (void)annotationToolbarViewDidCancelTextAnnotation:(OTAnnotationToolbarView *)annotationToolbarView annotationTextView:(OTAnnotationTextView *)textView; @end typedef NS_ENUM(NSUInteger, OTAnnotationToolbarViewOrientation) { OTAnnotationToolbarViewOrientationPortraitlBottom = 0, OTAnnotationToolbarViewOrientationLandscapeLeft, OTAnnotationToolbarViewOrientationLandscapeRight }; @interface OTAnnotationToolbarView : UIView /** * The object that acts as the data source of the annotation toolbar view. * * The delegate must adopt the OTAnnotationToolbarViewDataSource protocol. The data source is not retained. */ @property (weak, nonatomic) id<OTAnnotationToolbarViewDataSource> toolbarViewDataSource; /** * The object that acts as the delegate object of the annotation toolbar view. * * The delegate must adopt the OTAnnotationToolbarViewDelegate protocol. The delegate object is not retained. */ @property (weak, nonatomic) id<OTAnnotationToolbarViewDelegate> toolbarViewDelegate; /** * The orientation of this annotation toolbar. * * @discussion The default value is OTAnnotationToolbarViewOrientationPortraitlBottom. It assumes the position of toolbar view is at the bottom and all assosiated animation will be performed upwards. * Set it to OTAnnotationToolbarViewOrientationLandscapeLeft, it assumes the position of toolbar view is on the left and all assosiated animation will be performed towards right. * Set it to OTAnnotationToolbarViewOrientationLandscapeRight, it assumes the position of toolbar view is on the right and all assosiated animation will be performed towards left. * */ @property (nonatomic) OTAnnotationToolbarViewOrientation toolbarViewOrientation; @property (readonly, nonatomic) UIButton *doneButton; @property (readonly, nonatomic) UIButton *annotateButton; @property (readonly, nonatomic) UIButton *colorButton; @property (readonly, nonatomic) UIButton *textButton; @property (readonly, nonatomic) UIButton *screenshotButton; @property (readonly, nonatomic) UIButton *eraseButton; @property (readonly, nonatomic) UIButton *eraseAllButton; @property (nonatomic) BOOL showDoneButton; @end
40.758242
200
0.807765
[ "object" ]
f1761226c9c8bd7278a9f9993e820bba2d65f51a
692
h
C
source/render/include/animation.h
zhanghao00925/glTF_viewer
5fd8ebc08148acb6eb855bc657443013d4358dd9
[ "MIT" ]
3
2020-12-27T17:40:49.000Z
2021-03-16T10:54:07.000Z
source/render/include/animation.h
zhanghao00925/glTF_viewer
5fd8ebc08148acb6eb855bc657443013d4358dd9
[ "MIT" ]
null
null
null
source/render/include/animation.h
zhanghao00925/glTF_viewer
5fd8ebc08148acb6eb855bc657443013d4358dd9
[ "MIT" ]
null
null
null
/****************************/ /* FILE NAME: animation.h */ /****************************/ #ifndef _ANIMATION_H_ #define _ANIMATION_H_ #include "render_core.h" /**************/ /* INCLUDES */ /**************/ #include <string> #include <vector> #include "animation_channel.h" #include "animation_sampler.h" /***************************/ /* CLASS NAME: Animation */ /***************************/ class Animation { public: Animation(); Animation(const Animation& other); public: std::string name; std::vector<AnimationSampler> samplers; std::vector<AnimationChannel> channels; float start_time; float end_time; }; // class Animation #endif // !_ANIMATION_H_
21.625
43
0.547688
[ "vector" ]
f180aeec5997736c89cb62a3c6fd19208ca03097
38,435
c
C
NGSpice/ngspice-30/src/frontend/commands.c
Surya-98/Snapcuit
9789a779485d8af2426a2d4e6403a06f44acadcb
[ "MIT" ]
null
null
null
NGSpice/ngspice-30/src/frontend/commands.c
Surya-98/Snapcuit
9789a779485d8af2426a2d4e6403a06f44acadcb
[ "MIT" ]
null
null
null
NGSpice/ngspice-30/src/frontend/commands.c
Surya-98/Snapcuit
9789a779485d8af2426a2d4e6403a06f44acadcb
[ "MIT" ]
null
null
null
/* NG-SPICE -- An electrical circuit simulator * * Copyright (c) 1990 University of California * Copyright (c) 2000 Arno W. Peters * * Permission to use, copy, modify, and distribute this software and * its documentation without fee, and without a written agreement is * hereby granted, provided that the above copyright notice, this * paragraph and the following three paragraphs appear in all copies. * * This software program and documentation are copyrighted by their * authors. The software program and documentation are supplied "as * is", without any accompanying services from the authors. The * authors do not warrant that the operation of the program will be * uninterrupted or error-free. The end-user understands that the * program was developed for research purposes and is advised not to * rely exclusively on the program for any reason. * * IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS * DOCUMENTATION, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. THE AUTHORS SPECIFICALLY DISCLAIMS ANY * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE * SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHORS * HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, * ENHANCEMENTS, OR MODIFICATIONS. */ /* Table of available commands. Note that they're sorted so that the * commands that appear in the spiceinit file are at the top. */ #include "ngspice/ngspice.h" #include "ngspice/ftedefs.h" #include "ngspice/cpdefs.h" #include "ftehelp.h" #include "commands.h" #include "com_ahelp.h" #include "com_ghelp.h" #include "com_asciiplot.h" #include "com_compose.h" #include "com_display.h" #include "com_hardcopy.h" #include "com_help.h" #include "com_let.h" #include "com_plot.h" #include "com_setscale.h" #include "com_xgraph.h" #include "com_gnuplot.h" #include "com_state.h" #include "com_chdir.h" #include "com_echo.h" #include "com_rehash.h" #include "com_shell.h" #include "com_shift.h" #include "com_unset.h" #include "fourier.h" #include "newcoms.h" #include "define.h" #include "com_set.h" #include "misccoms.h" #include "com_commands.h" #include "runcoms.h" #include "com_alias.h" #include "typesdef.h" #include "postcoms.h" #include "com_option.h" #include "inp.h" #include "com_dump.h" #include "com_fft.h" #include "spec.h" #include "runcoms2.h" #include "breakp.h" #include "breakp2.h" #include "aspice.h" #include "com_history.h" #include "com_cdump.h" #include "linear.h" #include "where.h" #include "mw_coms.h" #include "resource.h" #include "diff.h" #include "com_strcmp.h" #include "ngspice/randnumb.h" #include "arg.h" #include "spiceif.h" /* for com_snload() and com_snsave() */ #include "com_dl.h" #ifdef XSPICE /* gtri - begin - wbk - add include files */ #include "ngspice/evtproto.h" /* gtri - end - wbk - add include files */ #endif /* Information about spice commands (struct comm). */ // char *co_comname; /* The name of the command. */ // void (*co_func) (wordlist *wl); /* The function that handles the command. */ // bool co_spiceonly; /* These can't be used from nutmeg. */ // bool co_major; /* Is this a "major" command? */ // long co_cctypes[4]; /* Bitmasks for command completion. */ // unsigned int co_env; /* print help message on this environment mask */ // int co_minargs; /* minimum number of arguments required */ // int co_maxargs; /* maximum number of arguments allowed */ // void (*co_argfn) (wordlist *wl, struct comm *command); /* The fn that prompts the user. */ // char *co_help; /* When these are printed, printf(string, av[0]) .. */ struct comm spcp_coms[] = { { "let", com_let, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, arg_let, "varname = expr : Assign vector variables." } , { "reshape", com_reshape, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, arg_let, "vector ... [ shape ] : change the dimensions of a vector." } , { "define", com_define, FALSE, TRUE, { 010000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, "[[func (args)] stuff] : Define a user-definable function." } , { "set", com_set, FALSE, TRUE, { 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, arg_set, "[option] [option = value] ... : Set a variable." } , /* support for altering options in interactive mode, using either command 'option' or 'options'*/ { "option", com_option, TRUE, TRUE, { 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, arg_set, "[option] [option = value] ... : Set a simulator option." } , { "options", com_option, TRUE, TRUE, { 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, arg_set, "[option] [option = value] ... : Set a simulator option." } , { "snsave", com_snsave, FALSE, TRUE, { 1, 040000, 040000, 040000 }, E_DEFHMASK, 1, 1, NULL, "file : Save a snapshot." } , { "snload", com_snload, FALSE, TRUE, { 1, 040000, 040000, 040000 }, E_DEFHMASK, 2, 2, NULL, "file : Load a snapshot." } , { "circbyline", com_circbyline, FALSE, TRUE, { 1, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "line : Enter a circuit line." } , { "alias", com_alias, FALSE, FALSE, { 02, 04, 04, 04 }, E_ADVANCED, 0, LOTS, NULL, "[[word] alias] : Define an alias." } , { "deftype", com_dftype, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 3, LOTS, NULL, "spec name pat ... : Redefine vector and plot types.\n" } , #ifdef TCL_MODULE { "bltplot", com_bltplot, FALSE, TRUE, { 041000, 041000, 041000, 041000 }, E_BEGINNING | E_HASPLOTS, 1, LOTS, arg_plot, "expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things." }, { "plot", com_bltplot, FALSE, TRUE, { 041000, 041000, 041000, 041000 }, E_BEGINNING | E_HASPLOTS, 1, LOTS, arg_plot, "expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things." }, #else { "plot", com_plot, FALSE, TRUE, { 041000, 041000, 041000, 041000 }, E_BEGINNING | E_HASPLOTS, 1, LOTS, arg_plot, "expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things." }, #endif { "display", com_display, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 0, LOTS, arg_display, ": Display vector status." } , { "destroy", com_destroy, FALSE, FALSE, { 0400, 0400, 0400, 0400 }, E_DEFHMASK, 0, LOTS, NULL, "[plotname] ... : Throw away all the data in the plot." } , { "setplot", com_splot, FALSE, TRUE, { 0400, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[plotname] : Change the current working plot." } , { "setcirc", com_scirc, TRUE, FALSE, { 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[circuit name] : Change the current circuit." } , { "setscale", com_setscale, FALSE, FALSE, { 040000, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[vecname] : Change default scale of current working plot." } , { "setseed", com_sseed, FALSE, FALSE, { 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[seed value] : Reset the random number generator with new seed value." } , { "transpose", com_transpose, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "varname ... : Perform matrix transposition on multi-D vectors." } , { "xgraph", com_xgraph, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, NULL, "file plotargs : Send plot to Xgraph-11." } , { "gnuplot", com_gnuplot, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 2, LOTS, NULL, "file plotargs : Send plot to gnuplot." } , { "wrdata", com_write_simple, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 2, NLOTS, NULL, "file plotargs : Send plot data to file." } , { "wrs2p", com_write_sparam, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 0, LOTS, NULL, "file : Send s-param data to file." } , { "hardcopy", com_hardcopy, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 0, LOTS, NULL, "file plotargs : Produce hardcopy plots." } , { "asciiplot", com_asciiplot, FALSE, TRUE, { 041000, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, NULL, "plotargs : Produce ascii plots." } , { "write", com_write, FALSE, TRUE, { 1, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, "file expr ... : Write data to a file." } , { "compose", com_compose, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 2, LOTS, NULL, "var parm=val ... : Compose a vector." } , { "unlet", com_unlet, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "varname ... : Undefine vectors." } , { "print", com_print, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, arg_print, "[col] expr ... : Print vector values." } , #ifdef XSPICE { "eprint", EVTprint, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, NULL, "node node ... : Print event values." } , { "eprvcd", EVTprintvcd, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, NULL, "node node ... : Print event values into vcd file." }, { "edisplay", EVTdisplay, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 0, 0, NULL, "node node ... : Print all event nodes." }, { "codemodel", com_codemodel, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, NULL, "library library ... : Loads the code model libraries." } , #endif #ifdef DEVLIB { "use", com_use, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, NULL, "library library ... : Loads the device libraries." } , #endif { "load", com_load, FALSE, TRUE, { 1, 1, 1, 1 }, E_BEGINNING | E_NOPLOTS, 1, LOTS, arg_load, "file ... : Load in data." } , { "cross", com_cross, FALSE, TRUE, { 040000, 0, 040000, 040000 }, E_DEFHMASK, 2, LOTS, NULL, "vecname number [ vector ... ] : Make a vector in a strange way." } , { "undefine", com_undefine, FALSE, FALSE, { 010000, 010000, 010000, 010000 }, E_DEFHMASK, 0, LOTS, NULL, "[func ...] : Undefine a user-definable function." } , { "op", com_op, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.op line args] : Determine the operating point of the circuit." } , { "tf", com_tf, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.tran line args] : Do a transient analysis." } , { "tran", com_tran, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.tran line args] : Do a transient analysis." } , #ifdef WITH_PSS /* SP: Steady State Analysis */ { "pss", com_pss, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.pss line args] : Do a periodic state analysis." } , /* SP */ #endif { "ac", com_ac, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.ac line args] : Do an ac analysis." } , { "dc", com_dc, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.dc line args] : Do a dc analysis." } , { "pz", com_pz, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.pz line args] : Do a pole / zero analysis." } , { "sens", com_sens, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.sens line args] : Do a sensitivity analysis." } , { "disto", com_disto, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.disto line args] : Do an distortion analysis." } , { "noise", com_noise, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.noise line args] : Do a noise analysis." } , { "listing", com_listing, TRUE, TRUE, { 0100, 0100, 0100, 0100 }, E_DEFHMASK, 0, LOTS, NULL, "[logical] [physical] [deck] : Print the current circuit." } , { "edit", com_edit, TRUE, TRUE, { 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[filename] : Edit a spice deck and then load it in." } , { "mc_source", com_mc_source, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Re-source the actual circuit deck for MC simulation." }, { "dump", com_dump, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Print a dump of the current circuit." } , { "fft", com_fft, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 1, LOTS, NULL, "vector ... : Create a frequency domain plot with FFT." } , { "psd", com_psd, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 2, LOTS, NULL, "vector ... : Create a power spetral density plot with FFT." } , { "fourier", com_fourier, FALSE, TRUE, { 0, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "fund_freq vector ... : Do a fourier analysis of some data." } , { "spec", com_spec, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 4, LOTS, NULL, "start_freq stop_freq step_freq vector ... : Create a frequency domain plot." } , { "meas", com_meas, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 1, LOTS, NULL, "various ... : User defined signal evaluation." } , { "show", com_show, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, NULL, "devices ... : parameters ... : Print out device summary." } , { "showmod", com_showmod, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, NULL, "models ... : parameters ... : Print out model summary." } , { "sysinfo", com_sysinfo, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, NULL, "Print out system info summary." } , { "alter", com_alter, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, NULL, "devspecs : parmname value : Alter device parameters." } , { "altermod", com_altermod, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, NULL, "devspecs : parmname value : Alter model parameters." } , { "alterparam", com_alterparam, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 1, LOTS, NULL, "devspecs : parmname value : Alter .param parameters." }, { "resume", com_resume, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Continue after a stop." } , { "state", com_state, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "(unimplemented) : Print the state of the circuit." }, { "stop", com_stop, TRUE, FALSE, { 04200, 04200, 04200, 04200 }, E_DEFHMASK, 0, LOTS, NULL, "[stop args] : Set a breakpoint." } , { "trace", com_trce, TRUE, FALSE, { 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, NULL, "[all] [node ...] : Trace a node." } , { "save", com_save, TRUE, FALSE, { 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, NULL, "[all] [node ...] : Save a spice output." } , { "iplot", com_iplot, TRUE, TRUE, { 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, NULL, "[all] [node ...] : Incrementally plot a node." } , { "status", com_sttus, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Print the current breakpoints and traces." } , { "delete", com_delete, TRUE, FALSE, { 020, 020, 020, 020 }, E_DEFHMASK, 0, LOTS, NULL, "[all] [break number ...] : Delete breakpoints and traces." } , { "step", com_step, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[number] : Iterate number times, or one." } , { "remcirc", com_remcirc, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Remove current citcuit." } , { "reset", com_rset, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Terminate a simulation after a breakpoint (formerly 'end')." } , { "run", com_run, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[rawfile] : Run the simulation as specified in the input file." } , { "aspice", com_aspice, FALSE, FALSE, { 1, 1, 1, 1 }, E_DEFHMASK, 1, 2, NULL, "file [outfile] : Run a spice job asynchronously." } , { "jobs", com_jobs, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Report on asynchronous spice jobs." } , { "rspice", com_rspice, FALSE, FALSE, { 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, NULL, "[input file] : Run a spice job remotely." } , { "bug", com_bug, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Report a %s bug." } , { "where", com_where, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Print last non-converging node or device" } , { "newhelp", com_ahelp, FALSE, TRUE, { 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, NULL, "[command name] ... : help." }, { "tutorial", com_ghelp, FALSE, TRUE, { 023010, 023010, 023010, 023010 }, E_BEGINNING, 0, LOTS, NULL, "[subject] ... : Hierarchical documentation browser." } , { "help", com_ghelp, FALSE, TRUE, { 023010, 023010, 023010, 023010 }, E_DEFHMASK, 0, LOTS, NULL, "[subject] ... : Hierarchical documentation browser." } , { "oldhelp", com_help, FALSE, TRUE, { 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, NULL, "[command name] ... : Print help." } , /* to remove circuits loaded */ { "removecirc", com_removecirc, TRUE, FALSE, { 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[circuit name] : Remove the current circuit from memory." } , { "quit", com_quit, FALSE, TRUE, { 0, 0, 0, 0 }, E_BEGINNING, 0, 1, NULL, ": Quit %s." } , { "source", com_source, FALSE, TRUE, { 1, 1, 1, 1 }, E_DEFHMASK, 1, LOTS, NULL, "file : Source a %s file." } , { "shift", com_shift, FALSE, FALSE, { 020000, 0, 0, 0 }, E_DEFHMASK, 0, 2, NULL, "[var] [number] : Shift argv or the named list var to the left." } , { "unset", com_unset, FALSE, FALSE, { 020000, 020000, 020000, 020000 }, E_DEFHMASK, 1, LOTS, NULL, "varname ... : Unset a variable." } , { "unalias", com_unalias, FALSE, FALSE, { 02, 02, 02, 02 }, E_DEFHMASK, 1, LOTS, NULL, "word ... : Undefine an alias." } , { "history", com_history, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 2, NULL, "[-r] [number] : Print command history." } , { "echo", com_echo, FALSE, FALSE, { 1, 1, 1, 1 }, E_DEFHMASK, 0, NLOTS, NULL, "[stuff ...] : Print stuff." } , { "shell", com_shell, FALSE, TRUE, { 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, NULL, "[args] : Fork a shell, or execute the command." } , { "rusage", com_rusage, FALSE, FALSE, { 02000, 02000, 02000, 02000 }, E_DEFHMASK, 0, LOTS, NULL, "[resource ...] : Print current resource usage." } , { "cd", com_chdir, FALSE, FALSE, { 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[directory] : Change working directory." } , { "getcwd", com_getcwd, FALSE, FALSE, { 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[directory] : Print current working directory." } , { "version", com_version, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[number] : Print the version number." } , { "diff", com_diff, FALSE, FALSE, { 0400, 0400, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, "plotname plotname [vec ...] : 'diff' two plots." } , { "rehash", com_rehash, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Rebuild the unix command database." } , { "while", NULL, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "condition : Execute while the condition is TRUE." } , { "repeat", NULL, FALSE, FALSE, { 0, 0, 0, 0}, E_DEFHMASK, 0, 1, NULL, "[number] : Repeat number times, or forever." } , { "dowhile", NULL, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "condition : Execute while the condition is TRUE." } , { "foreach", NULL, FALSE, FALSE, { 0, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, NULL, "variable value ... : Do once for each value." } , { "if", NULL, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "condition : Execute if the condition is TRUE." } , { "else", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Goes with if." } , { "end", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": End a block." } , { "break", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Break out of a block." } , { "continue", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Continue a loop." } , { "label", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 1, 1, NULL, "word : Create someplace to go to." } , { "goto", NULL, FALSE, FALSE, { 0100000, 0, 0, 0 }, E_DEFHMASK, 1, 1, NULL, "word : Go to a label." } , { "cdump", com_cdump, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Dump the current control structures." } , { "mdump", com_mdump, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "outfile: Dump the current matrix." } , { "mrdump", com_rdump, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "outfile: Dump the current RHS to file." } , { "settype", com_stype, FALSE, FALSE, { 0200000, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, NULL, "type vec ... : Change the type of a vector." } , { "strcmp", com_strcmp, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 3, 3, NULL, "varname s1 s2 : Set $varname to strcmp(s1, s2)." } , { "linearize", com_linearize, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, " [ vec ... ] : Convert plot into one with linear scale." } , { "devhelp", com_devhelp, FALSE, FALSE, { 040000, 0400000, 040000, 040000 }, E_DEFHMASK, 0, 5 , NULL, "devspecs : show device information." }, { "inventory", com_inventory, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Print circuit inventory" }, #ifdef HAVE_TSEARCH { "check_ifparm", com_check_ifparm, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Check model ifparm descriptors (for developpers)" }, #endif { NULL, NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, NULL } }; /* Bool fields: spiceonly, major */ struct comm nutcp_coms[] = { { "let", com_let, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, arg_let, "varname = expr : Assign vector variables." } , { "reshape", com_reshape, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, arg_let, "vector ... [ shape ] : change the dimensions of a vector." } , { "define", com_define, FALSE, TRUE, { 010000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, "[[func (args)] stuff] : Define a user-definable function." } , { "set", com_set, FALSE, TRUE, { 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, arg_set, "[option] [option = value] ... : Set a variable." } , #ifdef EXPERIMENTAL_CODE /* PN support for altering options in interactive mode */ { "option", com_option, TRUE, TRUE, { 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, arg_set, "[option] [option = value] ... : Set a simulator option." } , #endif { "alias", com_alias, FALSE, FALSE, { 02, 04, 04, 04 }, E_ADVANCED, 0, LOTS, NULL, "[[word] alias] : Define an alias." } , { "deftype", com_dftype, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 3, LOTS, NULL, "spec name pat ... : Redefine vector and plot types.\n" } , { "plot", com_plot, FALSE, TRUE, { 041000, 041000, 041000, 041000 }, E_BEGINNING | E_HASPLOTS, 1, LOTS, arg_plot, "expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things." }, { "display", com_display, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 0, LOTS, arg_display, ": Display vector status." } , { "destroy", com_destroy, FALSE, FALSE, { 0400, 0400, 0400, 0400 }, E_DEFHMASK, 0, LOTS, NULL, "[plotname] ... : Throw away all the data in the plot." } , { "setplot", com_splot, FALSE, TRUE, { 0400, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[plotname] : Change the current working plot." } , { "setcirc", com_scirc, TRUE, FALSE, { 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[circuit name] : Change the current circuit." } , { "setscale", com_setscale, FALSE, FALSE, { 040000, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[vecname] : Change default scale of current working plot." } , { "setseed", com_sseed, FALSE, FALSE, { 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[seed value] : Reset the random number generator with new seed value." } , { "transpose", com_transpose, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "varname ... : Perform matrix transposition on multi-D vectors." } , { "xgraph", com_xgraph, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, NULL, "file plotargs : Send plot to Xgraph-11." } , { "gnuplot", com_gnuplot, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 2, LOTS, NULL, "file plotargs : Send plot to gnuplot." } , { "wrdata", com_write_simple, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 2, NLOTS, NULL, "file plotargs : Send plot data to file." } , { "wrs2p", com_write_sparam, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 0, LOTS, NULL, "file : Send s-param data to file." } , { "hardcopy", com_hardcopy, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 0, LOTS, NULL, "file plotargs : Produce hardcopy plots." } , { "asciiplot", com_asciiplot, FALSE, TRUE, { 041000, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, NULL, "plotargs : Produce ascii plots." } , { "write", com_write, FALSE, TRUE, { 1, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, "file expr ... : Write data to a file." } , { "compose", com_compose, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 2, LOTS, NULL, "var parm=val ... : Compose a vector." } , { "unlet", com_unlet, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "varname ... : Undefine vectors." } , { "print", com_print, FALSE, TRUE, { 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, arg_print, "[col] expr ... : Print vector values." } , { "load", com_load, FALSE, TRUE, { 1, 1, 1, 1 }, E_BEGINNING | E_NOPLOTS, 1, LOTS, arg_load, "file ... : Load in data." } , { "cross", com_cross, FALSE, TRUE, { 040000, 0, 040000, 040000 }, E_DEFHMASK, 2, LOTS, NULL, "vecname number [ vector ... ] : Make a vector in a strange way." } , { "undefine", com_undefine, FALSE, FALSE, { 010000, 010000, 010000, 010000 }, E_DEFHMASK, 0, LOTS, NULL, "[func ...] : Undefine a user-definable function." } , { "op", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.op line args] : Determine the operating point of the circuit." } , { "tran", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.tran line args] : Do a transient analysis." } , #ifdef WITH_PSS /* SP: Steady State Analysis */ { "pss", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.pss line args] : Do a periodic steady state analysis." } , /* SP */ #endif { "ac", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.ac line args] : Do an ac analysis." } , { "dc", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.dc line args] : Do a dc analysis." } , { "pz", NULL, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.pz line args] : Do a pole / zero analysis." } , { "sens", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.ac line args] : Do a sensitivity analysis." } , { "disto", NULL, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.disto line args] : Do an distortion analysis." } , { "noise", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.noise line args] : Do a noise analysis." } , { "listing", NULL, TRUE, TRUE, { 0100, 0100, 0100, 0100 }, E_DEFHMASK, 0, LOTS, NULL, "[logical] [physical] [deck] : Print the current circuit." } , { "edit", NULL, TRUE, TRUE, { 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[filename] : Edit a spice deck and then load it in." } , { "dump", NULL, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Print a dump of the current circuit." } , { "fft", com_fft, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 1, LOTS, NULL, "vector ... : Create a frequency domain plot with FFT." } , { "psd", com_psd, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 2, LOTS, NULL, "vector ... : Create a power spetral density plot with FFT." } , { "fourier", com_fourier, FALSE, TRUE, { 0, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "fund_freq vector ... : Do a fourier analysis of some data." } , { "spec", com_spec, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 4, LOTS, NULL, "start_freq stop_freq step_freq vector ... : Create a frequency domain plot." } , { "show", NULL, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, NULL, "devspecs ... : parmspecs ... : Print out device parameters." } , { "alter", NULL, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 3, LOTS, NULL, "devspecs : parmname value : Alter device parameters." } , { "altermod", NULL, TRUE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 3, LOTS, NULL, "devspecs : parmname value : Alter model parameters." } , { "resume", NULL, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Continue after a stop." } , { "state", NULL, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "(unimplemented) : Print the state of the circuit." }, { "stop", NULL, TRUE, FALSE, { 04200, 04200, 04200, 04200 }, E_DEFHMASK, 0, LOTS, NULL, "[stop args] : Set a breakpoint." } , { "trace", NULL, TRUE, FALSE, { 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, NULL, "[all] [node ...] : Trace a node." } , { "save", NULL, TRUE, FALSE, { 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, NULL, "[all] [node ...] : Save a spice output." } , { "iplot", NULL, TRUE, TRUE, { 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, NULL, "[all] [node ...] : Incrementally plot a node." } , { "status", NULL, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Print the current breakpoints and traces." } , { "delete", NULL, TRUE, FALSE, { 020, 020, 020, 020 }, E_DEFHMASK, 0, LOTS, NULL, "[all] [break number ...] : Delete breakpoints and traces." } , { "step", NULL, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[number] : Iterate number times, or one." } , { "reset", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Terminate a simulation after a breakpoint (formerly 'end')." } , { "run", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[rawfile] : Run the simulation as specified in the input file." } , { "bug", com_bug, FALSE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Report a %s bug." } , { "newhelp", com_ahelp, FALSE, TRUE, { 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, NULL, "[command name] ... : help." }, { "tutorial", com_ghelp, FALSE, TRUE, { 023010, 023010, 023010, 023010 }, E_BEGINNING, 0, LOTS, NULL, "[subject] ... : Hierarchical documentation browser." } , { "help", com_ghelp, FALSE, TRUE, { 023010, 023010, 023010, 023010 }, E_DEFHMASK, 0, LOTS, NULL, "[subject] ... : Hierarchical documentation browser." } , { "oldhelp", com_help, FALSE, TRUE, { 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, NULL, "[command name] ... : Print help." } , { "quit", com_quit, FALSE, TRUE, { 0, 0, 0, 0 }, E_BEGINNING, 0, 1, NULL, ": Quit %s." } , /* to remove circuits loaded */ { "removecirc", com_removecirc, TRUE, FALSE, { 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[circuit name] : Remove the current circuit from memory." } , { "source", nutcom_source, FALSE, TRUE, { 1, 1, 1, 1 }, E_DEFHMASK, 1, LOTS, NULL, "file : Source a %s file." } , { "shift", com_shift, FALSE, FALSE, { 020000, 0, 0, 0 }, E_DEFHMASK, 0, 2, NULL, "[var] [number] : Shift argv or the named list var to the left." } , { "unset", com_unset, FALSE, FALSE, { 020000, 020000, 020000, 020000 }, E_DEFHMASK, 1, LOTS, NULL, "varname ... : Unset a variable." } , { "unalias", com_unalias, FALSE, FALSE, { 02, 02, 02, 02 }, E_DEFHMASK, 1, LOTS, NULL, "word ... : Undefine an alias." } , { "history", com_history, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 2, NULL, "[-r] [number] : Print command history." } , { "echo", com_echo, FALSE, FALSE, { 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, NULL, "[stuff ...] : Print stuff." } , { "shell", com_shell, FALSE, TRUE, { 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, NULL, "[args] : Fork a shell, or execute the command." } , { "rusage", com_rusage, FALSE, FALSE, { 02000, 02000, 02000, 02000 }, E_DEFHMASK, 0, LOTS, NULL, "[resource ...] : Print current resource usage." } , { "cd", com_chdir, FALSE, FALSE, { 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[directory] : Change working directory." } , { "getcwd", com_getcwd, FALSE, FALSE, { 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, NULL, "[directory] : Print current working directory." } , { "version", com_version, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[number] : Print the version number." } , { "diff", com_diff, FALSE, FALSE, { 0400, 0400, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, "plotname plotname [vec ...] : 'diff' two plots." } , { "rehash", com_rehash, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Rebuild the unix command database." } , { "while", NULL, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "condition : Execute while the condition is TRUE." } , { "repeat", NULL, FALSE, FALSE, { 0, 0, 0, 0}, E_DEFHMASK, 0, 1, NULL, "[number] : Repeat number times, or forever." } , { "dowhile", NULL, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "condition : Execute while the condition is TRUE." } , { "foreach", NULL, FALSE, FALSE, { 0, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, NULL, "variable value ... : Do once for each value." } , { "if", NULL, FALSE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "condition : Execute if the condition is TRUE." } , { "else", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Goes with if." } , { "end", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": End a block." } , { "break", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Break out of a block." } , { "continue", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Continue a loop." } , { "label", NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 1, 1, NULL, "word : Create someplace to go to." } , { "goto", NULL, FALSE, FALSE, { 0100000, 0, 0, 0 }, E_DEFHMASK, 1, 1, NULL, "word : Go to a label." } , { "cdump", com_cdump, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Dump the current control structures." } , { "settype", com_stype, FALSE, FALSE, { 0200000, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, NULL, "type vec ... : Change the type of a vector." } , { "strcmp", com_strcmp, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 3, 3, NULL, "varname s1 s2 : Set $varname to strcmp(s1, s2)." } , { "linearize", com_linearize, TRUE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, " [ vec ... ] : Convert plot into one with linear scale." } , { "devhelp", NULL, FALSE, FALSE, { 040, 040, 040, 040 }, E_DEFHMASK, 0, 5 , NULL, " devspecs : show device information." }, { "inventory", NULL, TRUE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, NULL, ": Print circuit inventory" } , { NULL, NULL, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, NULL } };
37.829724
93
0.55936
[ "shape", "vector", "model" ]
f18582e42e087b547005803a79758bb79d2fba3f
755
h
C
eagleeye/engine/nano/op/identity.h
nihui/eagleeye
eeb69204b7322e79904a4406b44d61a1a30a5c9a
[ "Apache-2.0" ]
4
2020-06-19T06:46:01.000Z
2021-05-14T08:10:42.000Z
eagleeye/engine/nano/op/identity.h
nihui/eagleeye
eeb69204b7322e79904a4406b44d61a1a30a5c9a
[ "Apache-2.0" ]
null
null
null
eagleeye/engine/nano/op/identity.h
nihui/eagleeye
eeb69204b7322e79904a4406b44d61a1a30a5c9a
[ "Apache-2.0" ]
null
null
null
#ifndef _EAGLEEYE_EMPTY_H_ #define _EAGLEEYE_EMPTY_H_ #include "eagleeye/common/EagleeyeMacro.h" #include "eagleeye/basic/Tensor.h" #include "eagleeye/common/EagleeyeRuntime.h" #include <vector> #include "eagleeye/engine/nano/op/FixedCNNOp.h" namespace eagleeye{ namespace nano{ class Identity:public FixedCNNOp{ public: Identity(int input_data_num, int output_data_num, std::string op_name); virtual ~Identity(); void run_on_cpu(std::vector<Tensor<float>>& output); void run_on_gpu(std::vector<Tensor<float>>& output); void run_on_cpu(std::vector<Tensor<float>>& output, std::vector<Tensor<float>>& input); void run_on_gpu(std::vector<Tensor<float>>& output, std::vector<Tensor<float>>& input); private: }; } } #endif
27.962963
91
0.740397
[ "vector" ]
f1894440ecb673a634a4547a90f50e5136c80d58
6,836
h
C
exelius/source/engine/gameobjectsystem/GameObject.h
GroverErin/ExeliusEngine
88f71084ebfcaa140526ee3895fb659963d28f28
[ "Apache-2.0" ]
null
null
null
exelius/source/engine/gameobjectsystem/GameObject.h
GroverErin/ExeliusEngine
88f71084ebfcaa140526ee3895fb659963d28f28
[ "Apache-2.0" ]
null
null
null
exelius/source/engine/gameobjectsystem/GameObject.h
GroverErin/ExeliusEngine
88f71084ebfcaa140526ee3895fb659963d28f28
[ "Apache-2.0" ]
1
2022-01-17T17:25:15.000Z
2022-01-17T17:25:15.000Z
#pragma once #include "source/resource/ResourceListener.h" #include "source/engine/gameobjectsystem/components/Component.h" #include "source/engine/gameobjectsystem/components/ComponentHandle.h" #include "source/debug/Log.h" #include <EASTL/string.h> #include <EASTL/unordered_map.h> #include <rapidjson/document.h> /// <summary> /// Engine namespace. Everything owned by the engine will be inside this namespace. /// </summary> namespace Exelius { class GameObject : public ResourceListener { /// <summary> /// Log for the GameObjectSystem. /// </summary> Log m_gameObjectSystemLog; /// <summary> /// List of the components (Handles to) by component type. /// </summary> eastl::unordered_map<Component::Type, Handle> m_components; /// <summary> /// The user defined name of a GameObject. /// @todo Possibly consider combining this with ID? /// </summary> eastl::string m_name; /// <summary> /// Unique ID of this game object. /// @todo Possibly consider combining this with name? /// </summary> uint32_t m_id; /// <summary> /// The mode determining how this GameObject should /// create itself. /// </summary> CreationMode m_createMode; public: /// <summary> /// Is this game object enabled? /// </summary> bool m_enabled; /// <summary> /// Constructor - Initializes member variables. /// TODO: This should not be publicly accessable! /// </summary> /// <param name="id">The unique object ID given by the GameObjectSystem.</param> GameObject(uint32_t id, CreationMode createMode = CreationMode::kQueueAndSignal); /*GameObject(const GameObject& other) { __debugbreak(); } GameObject(GameObject&& other) { __debugbreak(); } GameObject& operator=(const GameObject& other) { __debugbreak(); return *this; } GameObject& operator=(GameObject&& other) { __debugbreak(); return *this; }*/ GameObject(const GameObject&) = delete; GameObject(GameObject&&) = delete; GameObject& operator=(const GameObject&) = delete; GameObject& operator=(GameObject&&) = delete; ~GameObject() = default; /// <summary> /// Initialize this object using a JSON text file. /// This will set any values specified in the file, /// and will create (or get from the pool) any necessary /// components and intialize those. /// </summary> /// <param name="pResource">The JSON TextFile resource containing object data.</param> /// <returns>True on success, false on failure.</returns> bool Initialize(const eastl::string& rawText); /// <summary> /// Removes all the components attached to this GameObject. /// This returns them to their respective pools. /// </summary> void RemoveComponents(); /// <summary> /// Check if this GameObject is enabled. /// This should typically mean that none of the components /// will be rendered or updated if not enabled. /// </summary> /// <returns>True if enabled, false if disabled.</returns> bool IsEnabled() const { return m_enabled; } /// <summary> /// Sets the state of the GameObject. /// </summary> /// <param name="isEnabled"> /// True if the object should update and render, false if it should not update or render. /// More specifically, it will be the components, as the GameObjects do not tick. /// </param> void SetEnabled(bool isEnabled = true) { m_enabled = isEnabled; } /// <summary> /// Get the objects unique ID. /// </summary> /// <returns>This objects ID.</returns> uint32_t GetId() const { return m_id; } /// <summary> /// Get the objects name. /// </summary> /// <returns>Name of this object.</returns> const eastl::string& GetName() const { return m_name; } /// <summary> /// Adds a component of the templated type to game object. /// </summary> /// <returns>The Handle to the component.</returns> template <class ComponentType> Handle AddComponent() { EXE_ASSERT(ComponentType::kType.IsValid()); Handle newHandle = GameObjectSystem::GetInstance()->CreateComponent<ComponentType>(); EXE_ASSERT(newHandle.IsValid()); m_components[ComponentType::kType] = newHandle; return newHandle; } /// <summary> /// Get the ComponentHandle of the templated component type. /// A ComponentHandle is a safe wrapper around a component. /// </summary> /// <returns> /// The ComponentHandle used to interface with the component. /// Use the operator->() to interface with the component. /// The ComponentHandle will be invalid if there is a failure. /// </returns> template <class ComponentType> ComponentHandle<ComponentType> GetComponent() { auto found = m_components.find(ComponentType::kType); // Component was not found, return invalid ComponentHandle. if (found == m_components.end()) { m_gameObjectSystemLog.Warn("Component of type '{}' was not found.", ComponentType::kType); return {}; // Invalid. } // Create the ComponentHandle from the available handle. return ComponentHandle<ComponentType>(m_components[ComponentType::kType]); } /// <summary> /// This function is called when a game object file has successfully loaded. /// This means we should have the data we need to initialize the object, /// so we pass the data to the intialize function. /// </summary> /// <param name="resourceID">- The ID of the loaded resource.</param> /// <returns>True if the resource was flushed here, false if not.</returns> virtual bool OnResourceLoaded(const ResourceID& resourceID) final override; private: /// <summary> /// Parses and creates the components in the JSON object document. /// This will create (or get from the pool), attach, and initialize these components. /// </summary> /// <param name="jsonDoc">The JSON document with the Object data.</param> void ParseComponentArray(const rapidjson::Document& jsonDoc); }; }
35.790576
106
0.590843
[ "render", "object" ]
f18cfbed361d46ed1dc67e5512a085b7a82152ae
997
h
C
src/util/CardsParser.h
MattSkala/bang-game
42b174fef07a8c6b7af1895e6ddf75507bd2fa42
[ "MIT" ]
9
2015-05-29T22:51:53.000Z
2021-03-07T15:46:28.000Z
src/util/CardsParser.h
MattSkala/bang-game
42b174fef07a8c6b7af1895e6ddf75507bd2fa42
[ "MIT" ]
null
null
null
src/util/CardsParser.h
MattSkala/bang-game
42b174fef07a8c6b7af1895e6ddf75507bd2fa42
[ "MIT" ]
4
2017-01-07T02:25:47.000Z
2021-11-04T08:18:07.000Z
#ifndef BANG_CARDSPARSER_H #define BANG_CARDSPARSER_H #include <vector> #include "../entity/Card.h" /// A helper class for reading cards configuration from CSV file. class CardsParser { private: static const int COL_ORIGINAL_NAME = 0; static const int COL_NAME = 1; static const int COL_COUNT = 2; static const int COL_TYPE = 3; static const int COL_LIFE = 4; static const int COL_DISTANCE = 5; static const int COL_MISSED = 6; static const int COL_BANG = 7; static const int COL_HEAL = 8; static const int COL_DRAW = 9; static const int COL_DISCARD = 10; static const int COL_TARGET_ANY = 11; static const int COL_TARGET_OTHERS = 12; static const int COL_TARGET_DISTANCE = 13; static const int COL_TARGET_SELF = 14; static const int COL_SPECIAL = 15; static const int COL_UNLIMITED_BANG = 16; Card * createCard(vector<string> row); public: vector<Card *> parseFile(string filename); }; #endif //BANG_CARDSPARSER_H
27.694444
65
0.709127
[ "vector" ]
f195f65aabc461750fbfb5e89c58a09b497cfe20
870
h
C
Minuit/Minuit/MnPlot.h
cdeil/iminuit
8880106e8ba0df18c529c48cd193ba4411ef58b9
[ "MIT" ]
null
null
null
Minuit/Minuit/MnPlot.h
cdeil/iminuit
8880106e8ba0df18c529c48cd193ba4411ef58b9
[ "MIT" ]
null
null
null
Minuit/Minuit/MnPlot.h
cdeil/iminuit
8880106e8ba0df18c529c48cd193ba4411ef58b9
[ "MIT" ]
null
null
null
#ifndef MN_MnPlot_H_ #define MN_MnPlot_H_ #include "Minuit/MnConfig.h" #include <vector> #include <utility> /** MnPlot produces a text-screen graphical output of (x,y) points, e.g. from Scan or Contours. */ class MnPlot { public: MnPlot() : thePageWidth(80), thePageLength(30) {} MnPlot(unsigned int width, unsigned int length) : thePageWidth(width), thePageLength(length) { if(thePageWidth > 120) thePageWidth = 120; if(thePageLength > 56) thePageLength = 56; } ~MnPlot() {} void operator()(const std::vector<std::pair<double,double> >&) const; void operator()(double, double, const std::vector<std::pair<double,double> >&) const; unsigned int width() const {return thePageWidth;} unsigned int length() const {return thePageLength;} private: unsigned int thePageWidth; unsigned int thePageLength; }; #endif //MN_MnPlot_H_
22.894737
96
0.706897
[ "vector" ]
f19f354bbbb237fe74dceae02e975b80e22cbc66
1,674
c
C
toolbox-dssynth/dssynth-tool/benchmark-runner/AACegar/FWL_LTI.c
SSV-Group/dsverifier
1daca4704216edf9a360b4a39e00663d94646ad1
[ "Apache-2.0" ]
10
2016-08-29T19:23:25.000Z
2020-10-18T22:27:21.000Z
toolbox-dssynth/dssynth-tool/benchmark-runner/AACegar/FWL_LTI.c
SSV-Group/dsverifier
1daca4704216edf9a360b4a39e00663d94646ad1
[ "Apache-2.0" ]
64
2016-09-10T16:29:44.000Z
2019-01-15T14:31:06.000Z
toolbox-dssynth/dssynth-tool/benchmark-runner/AACegar/FWL_LTI.c
SSV-Group/dsverifier
1daca4704216edf9a360b4a39e00663d94646ad1
[ "Apache-2.0" ]
5
2016-10-09T21:38:41.000Z
2017-07-05T10:05:32.000Z
#include <assert.h> #include <stdbool.h> #include "FWL_LTI.h" #include "types.h" #include "system.h" void print_vector(char *name,vectort vector) { #ifndef __CPROVER cnttype i; printf("%s ",name); for (i=0;i<_DIMENSION;i++) printf("%f ", vector[i]); puts(""); #endif } void print_matrix(char *name,matrixt matrix) { #ifndef __CPROVER cnttype i,j; printf("%s ",name); for (i=0;i<_DIMENSION;i++) { for (j=0;j<_DIMENSION;j++) printf("%f ", matrix[i][j]); printf(";"); } puts(""); #endif } vectort plant_cbmc,controller_cbmc; matrixt transform_cbmc; matrixt loop_cbmc; #include "FWL_LTI_FWL.h" #include "FWL_LTI_nondet.h" #include "FWL_LTI_stability.h" #ifdef _NUM_ITERATIONS #include "FWL_LTI_iters.h" #endif //struct implt impl={ .int_bits=_CONTROLER_INT_BITS, .frac_bits=_CONTROLER_FRAC_BITS}; int initialization() { get_bounds(); int result=validation(); return result; } #ifndef __CPROVER void print_poly(control_floatt *pol,cnttype n) { cnttype i; for (i=0;i<n;i++) { printf("%fz%d ", pol[i], n-i-1); } puts(""); } #endif // main int main() { cnttype i; int result=initialization(); #ifndef __CPROVER if (result!=0) return 10; #endif make_closed_loop(); #ifndef __CPROVER print_matrix("dynamics",dynamics); print_matrix("loop",loop_cbmc); #endif result=check_stability_closedloop(plant_cbmc); #ifndef __CPROVER printf("stability=%d\n",result); #endif #ifdef _NUM_ITERATIONS if (result>0) checkIterations(loop_cbmc); #endif #ifdef __CPROVER __CPROVER_array_copy(controller_cbmc, controller); verify_assert(0); #else printf("end\n"); if (result != 0) return 10; #endif return 0; }
17.808511
86
0.686977
[ "vector" ]
f1ac24a79cce3e5449463de997574507cfd37041
8,704
h
C
SofaKernel/modules/SofaBaseTopology/QuadSetTopologyModifier.h
sofa-framework/issofa
94855f488465bc3ed41223cbde987581dfca5389
[ "OML" ]
null
null
null
SofaKernel/modules/SofaBaseTopology/QuadSetTopologyModifier.h
sofa-framework/issofa
94855f488465bc3ed41223cbde987581dfca5389
[ "OML" ]
null
null
null
SofaKernel/modules/SofaBaseTopology/QuadSetTopologyModifier.h
sofa-framework/issofa
94855f488465bc3ed41223cbde987581dfca5389
[ "OML" ]
null
null
null
/****************************************************************************** * SOFA, Simulation Open-Framework Architecture, development version * * (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************* * Authors: The SOFA Team and external contributors (see Authors.txt) * * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ #ifndef SOFA_COMPONENT_TOPOLOGY_QUADSETTOPOLOGYMODIFIER_H #define SOFA_COMPONENT_TOPOLOGY_QUADSETTOPOLOGYMODIFIER_H #include "config.h" #include <SofaBaseTopology/EdgeSetTopologyModifier.h> namespace sofa { namespace component { namespace topology { class QuadSetTopologyContainer; /** * A class that modifies the topology by adding and removing quads */ class SOFA_BASE_TOPOLOGY_API QuadSetTopologyModifier : public EdgeSetTopologyModifier { public: SOFA_CLASS(QuadSetTopologyModifier,EdgeSetTopologyModifier); typedef core::topology::BaseMeshTopology::QuadID QuadID; typedef core::topology::BaseMeshTopology::Quad Quad; typedef core::topology::BaseMeshTopology::SeqQuads SeqQuads; typedef core::topology::BaseMeshTopology::QuadsAroundVertex QuadsAroundVertex; typedef core::topology::BaseMeshTopology::QuadsAroundEdge QuadsAroundEdge; typedef core::topology::BaseMeshTopology::EdgesInQuad EdgesInQuad; protected: QuadSetTopologyModifier() : EdgeSetTopologyModifier() { } virtual ~QuadSetTopologyModifier() {} public: virtual void init(); /// \brief function to propagate topological change events by parsing the list of topologyEngines linked to this topology. virtual void propagateTopologicalEngineChanges(); /** \brief add a set of quads @param quads an array of vertex indices describing the quads to be created */ virtual void addQuads(const sofa::helper::vector< Quad > &quads); /** \brief add a set of quads @param quads an array of vertex indices describing the quads to be created @param ancestors for each quad to be created provides an array of quad ancestors (optional) @param baryCoefs for each quad provides the barycentric coordinates (sum to 1) associated with each ancestor (optional) * */ virtual void addQuads(const sofa::helper::vector< Quad > &quads, const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors, const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs) ; /** \brief Sends a message to warn that some quads were added in this topology. * * \sa addQuadsProcess */ void addQuadsWarning(const unsigned int nQuads, const sofa::helper::vector< Quad >& quadsList, const sofa::helper::vector< unsigned int >& quadsIndexList); /** \brief Sends a message to warn that some quads were added in this topology. * * \sa addQuadsProcess */ void addQuadsWarning(const unsigned int nQuads, const sofa::helper::vector< Quad >& quadsList, const sofa::helper::vector< unsigned int >& quadsIndexList, const sofa::helper::vector< sofa::helper::vector< unsigned int > > & ancestors, const sofa::helper::vector< sofa::helper::vector< double > >& baryCoefs); /** \brief Effectively Add a quad. */ void addQuadProcess(Quad e); /** \brief Effectively Add some quads to this topology. * * \sa addQuadsWarning */ virtual void addQuadsProcess(const sofa::helper::vector< Quad > &quads); /** \brief Sends a message to warn that some quads are about to be deleted. * * \sa removeQuadsProcess * * Important : parameter indices is not const because it is actually sorted from the highest index to the lowest one. */ virtual void removeQuadsWarning( sofa::helper::vector<unsigned int> &quads); /** \brief Remove a subset of quads. Eventually remove isolated edges and vertices * * Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removeEdgesWarning before calling removeEdgesProcess. * \sa removeQuadsWarning * * @param removeIsolatedEdges if true isolated edges are also removed * @param removeIsolatedPoints if true isolated vertices are also removed */ virtual void removeQuadsProcess( const sofa::helper::vector<unsigned int> &indices, const bool removeIsolatedEdges=false, const bool removeIsolatedPoints=false); /** \brief Add some edges to this topology. * * \sa addEdgesWarning */ void addEdgesProcess(const sofa::helper::vector< Edge > &edges); /** \brief Remove a subset of edges * * Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removeEdgesWarning before calling removeEdgesProcess. * \sa removeEdgesWarning * * @param removeIsolatedItems if true isolated vertices are also removed * Important : parameter indices is not const because it is actually sorted from the highest index to the lowest one. */ virtual void removeEdgesProcess( const sofa::helper::vector<unsigned int> &indices, const bool removeIsolatedItems=false); /** \brief Add some points to this topology. * * \sa addPointsWarning */ virtual void addPointsProcess(const unsigned int nPoints); /** \brief Remove a subset of points * * Elements corresponding to these points are removed from the mechanical object's state vectors. * * Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removePointsWarning before calling removePointsProcess. * \sa removePointsWarning * Important : the points are actually deleted from the mechanical object's state vectors iff (removeDOF == true) */ virtual void removePointsProcess(const sofa::helper::vector<unsigned int> &indices, const bool removeDOF = true); /** \brief Reorder this topology. * * Important : the points are actually renumbered in the mechanical object's state vectors iff (renumberDOF == true) * \see MechanicalObject::renumberValues */ virtual void renumberPointsProcess( const sofa::helper::vector<unsigned int>& index, const sofa::helper::vector<unsigned int>& inv_index, const bool renumberDOF = true); /** \brief Remove a set of quads @param quads an array of quad indices to be removed (note that the array is not const since it needs to be sorted) * @param removeIsolatedEdges if true isolated edges are also removed @param removeIsolatedPoints if true isolated vertices are also removed * */ virtual void removeQuads(const sofa::helper::vector<unsigned int> &quadIds, const bool removeIsolatedEdges, const bool removeIsolatedPoints); /** \brief Generic method to remove a list of items. */ virtual void removeItems(const sofa::helper::vector< unsigned int >& items); /** \brief Generic method for points renumbering */ virtual void renumberPoints( const sofa::helper::vector<unsigned int>& index, const sofa::helper::vector<unsigned int>& inv_index); private: QuadSetTopologyContainer* m_container; }; } // namespace topology } // namespace component } // namespace sofa #endif
42.666667
174
0.651654
[ "object", "vector" ]
f1b645242090d1d64962cb7d4116974dfcd17806
7,427
h
C
lib/sse2neon.h
dinosaure/art
4dff34f21f1c730e5502b00f46cab0e2ccd3c6cb
[ "MIT" ]
41
2019-11-19T19:44:43.000Z
2021-12-17T15:07:31.000Z
lib/sse2neon.h
dinosaure/art
4dff34f21f1c730e5502b00f46cab0e2ccd3c6cb
[ "MIT" ]
20
2020-11-23T16:58:31.000Z
2022-03-18T16:47:13.000Z
lib/sse2neon.h
dinosaure/art
4dff34f21f1c730e5502b00f46cab0e2ccd3c6cb
[ "MIT" ]
2
2021-01-29T01:36:04.000Z
2021-11-03T14:57:32.000Z
/* Copyright to: John W. Ratcliff <jratcliffscarab@gmail.com> Brandon Rowlett <browlett@nvidia.com> Ken Fast <kfast@gdeb.com> Eric van Beurden <evanbeurden@nvidia.com> Alexander Potylitsin <apotylitsin@nvidia.com> Hasindu Gamaarachchi <hasindu2008@gmail.com> Jim Huang <jserv@biilabs.io> Mark Cheng <marktwtn@biilabs.io> Malcolm James MacLeod <malcolm@gulden.com> Devin Hussey (easyaspi314) <husseydevin@gmail.com> Sebastian Pop <spop@amazon.com> Developer Ecosystem Engineering <DeveloperEcosystemEngineering@apple.com> Danila Kutenin <danilak@google.com> François Turban (JishinMaster) <francois.turban@gmail.com> Pei-Hsuan Hung <afcidk@gmail.com> Yang-Hao Yuan <yanghau@biilabs.io> This file comes from https://github.com/DLTcollab/sse2neon and it is under MIT license. */ #ifndef SSE2NEON_H #define SSE2NEON_H #if defined(__GNUC__) || defined(__clang__) #pragma push_macro("FORCE_INLINE") #pragma push_macro("ALIGN_STRUCT") #define FORCE_INLINE static inline __attribute__((always_inline)) #define ALIGN_STRUCT(x) __attribute__((aligned(x))) #else #ifdef FORCE_INLINE #undef FORCE_INLINE #endif #define FORCE_INLINE static inline #ifndef ALIGN_STRUCT #define ALIGN_STRUCT(x) __declspec(align(x)) #endif #endif #if defined(__GNUC__) #if defined(__arm__) && __ARM_ARCH == 7 #if !defined(__ARM_NEON) || !defined(__ARM_NEON__) #error "You must enable NEON instruction (e.g. -mfpu=neon) to use ROWEX" #endif #pragma GCC push_options #pragma GCC target("fpu=neon") #elif defined(__aarch64__) #pragma GCC push_options #pragma GCC target("+simd") #else #error "Unsupported target. Must be either ARMv7-A+NEON or ARMv8-A." #endif #endif #include <arm_neon.h> typedef int64x2_t __m128i ; #define vreinterpretq_m128i_s32(x) vreinterpretq_s64_s32(x) #define vreinterpretq_s32_m128i(x) vreinterpretq_s32_s64(x) #define vreinterpretq_s8_m128i(x) vreinterpretq_s8_s64(x) #define vreinterpretq_u8_m128i(x) vreinterpretq_u8_s64(x) #define vreinterpretq_m128i_s8(x) vreinterpretq_s64_s8(x) #define vreinterpretq_m128i_u8(x) vreinterpretq_s64_u8(x) FORCE_INLINE __m128i _mm_loadu_si128(const __m128i *p) { return vreinterpretq_m128i_s32(vld1q_s32((const int32_t *) p)) ; } FORCE_INLINE __m128i _mm_storeu_si128(__m128i *p, __m128i a) { vst1q_s32((int32_t *) p, vreinterpretq_s32_m128i(a)); } FORCE_INLINE __m128i _mm_set_epi32(int i3, int i2, int i1, int i0) { int32_t ALIGN_STRUCT(16) data[4] = {i0, i1, i2, i3}; return vreinterpretq_m128i_s32(vld1q_s32(data)); } FORCE_INLINE __m128i _mm_shuffle_epi8(__m128i a, __m128i b) { int8x16_t tbl = vreinterpretq_s8_m128i(a); uint8x16_t idx = vreinterpretq_u8_m128i(b); uint8x16_t idx_masked = vandq_u8(idx, vdupq_n_u8(0x8F)); #if defined(__aarch64__) return vreinterpretq_m128i_s8(vqtbl1q_s8(tbl, idx_masked)) ; #elif defined(__GNUC__) int8x16_t ret; __asm__ __volatile__( "vtbl.8 %e[ret], {%e[tbl], %f[tbl]}, %e[idx]\n" "vtbl.8 %f[ret], {%e[tbl], %f[tbl]}, %f[idx]\n" : [ret] "=&w"(ret) : [tbl] "w"(tbl), [idx] "w"(idx_masked)); return vreinterpretq_m128i_s8(ret) ; #else int8x8x2_t a_split {vget_low_s8(tbl), vget_high_s8(tbl)}; return vreinterpretq_m128i_s8( vcombine_s8(vtbl2_s8(a_split, vget_loag_u8(idx_masked)), vtbl2_s8(a_split, vget_high_u8(idx_masked)))); #endif } FORCE_INLINE __m128i _mm_cmpeq_epi8(__m128i a, __m128i b) { return vreinterpretq_m128i_u8( vceqq_s8(vreinterpretq_s8_m128i(a), vreinterpretq_s8_m128i(b))); } FORCE_INLINE __m128i _mm_set1_epi8(signed char w) { return vreinterpretq_m128i_s8(vdupq_n_s8(w)); } FORCE_INLINE void _mm_pause(void) { __asm__ __volatile__ ("yield"); } FORCE_INLINE int _mm_movemask_epi8(__m128i a) { #if defined(__aarch64__) uint8x16_t input = vreinterpretq_u8_m128i(a); const int8_t ALIGN_STRUCT(16) xr[16] = {-7, -6, -5, -4, -3, -2, -1, 0, -7, -6, -5, -4, -3, -2, -1, 0}; const uint8x16_t mask_and = vdupq_n_u8(0x80); const int8x16_t mask_shift = vld1q_s8(xr); const uint8x16_t mask_result = vshlq_u8(vandq_u8(input, mask_and), mask_shift); uint8x8_t lo = vget_low_u8(mask_result); uint8x8_t hi = vget_high_u8(mask_result); return vaddv_u8(lo) + (vaddv_u8(hi) << 8); #else // Use increasingly wide shifts+adds to collect the sign bits // together. // Since the widening shifts would be rather confusing to follow in little // endian, everything will be illustrated in big endian order instead. This // has a different result - the bits would actually be reversed on a big // endian machine. // Starting input (only half the elements are shown): // 89 ff 1d c0 00 10 99 33 uint8x16_t input = vreinterpretq_u8_m128i(a); // Shift out everything but the sign bits with an unsigned shift right. // // Bytes of the vector:: // 89 ff 1d c0 00 10 99 33 // \ \ \ \ \ \ \ \ high_bits = (uint16x4_t)(input >> 7) // | | | | | | | | // 01 01 00 01 00 00 01 00 // // Bits of first important lane(s): // 10001001 (89) // \______ // | // 00000001 (01) uint16x8_t high_bits = vreinterpretq_u16_u8(vshrq_n_u8(input, 7)); // Merge the even lanes together with a 16-bit unsigned shift right + add. // 'xx' represents garbage data which will be ignored in the final result. // In the important bytes, the add functions like a binary OR. // // 01 01 00 01 00 00 01 00 // \_ | \_ | \_ | \_ | paired16 = (uint32x4_t)(input + (input >> 7)) // \| \| \| \| // xx 03 xx 01 xx 00 xx 02 // // 00000001 00000001 (01 01) // \_______ | // \| // xxxxxxxx xxxxxx11 (xx 03) uint32x4_t paired16 = vreinterpretq_u32_u16(vsraq_n_u16(high_bits, high_bits, 7)); // Repeat with a wider 32-bit shift + add. // xx 03 xx 01 xx 00 xx 02 // \____ | \____ | paired32 = (uint64x1_t)(paired16 + (paired16 >> // 14)) // \| \| // xx xx xx 0d xx xx xx 02 // // 00000011 00000001 (03 01) // \\_____ || // '----.\|| // xxxxxxxx xxxx1101 (xx 0d) uint64x2_t paired32 = vreinterpretq_u64_u32(vsraq_n_u32(paired16, paired16, 14)); // Last, an even wider 64-bit shift + add to get our result in the low 8 bit // lanes. xx xx xx 0d xx xx xx 02 // \_________ | paired64 = (uint8x8_t)(paired32 + (paired32 >> // 28)) // \| // xx xx xx xx xx xx xx d2 // // 00001101 00000010 (0d 02) // \ \___ | | // '---. \| | // xxxxxxxx 11010010 (xx d2) uint8x16_t paired64 = vreinterpretq_u8_u64(vsraq_n_u64(paired32, paired32, 28)); // Extract the low 8 bits from each 64-bit lane with 2 8-bit extracts. // xx xx xx xx xx xx xx d2 // || return paired64[0] // d2 // Note: Little endian would return the correct value 4b (01001011) instead. return vgetq_lane_u8(paired64, 0) | ((int) vgetq_lane_u8(paired64, 8) << 8); #endif } #if defined(__GNUC__) || defined(__clang__) #pragma pop_macro("ALIGN_STRUCT") #pragma pop_macro("FORCE_INLINE") #endif #if defined(__GNUC__) #pragma GCC pop_options #endif #endif
31.875536
80
0.655716
[ "vector" ]
f1bd45051a5a3d42c49d693f6c80bf01cc45ecdb
2,767
h
C
src/server/Game.h
ferendo/Snakes
525a22710642a38a79cd01be6cc5f07fe0e80eff
[ "MIT" ]
4
2020-01-13T13:19:22.000Z
2021-08-19T21:01:43.000Z
src/server/Game.h
ferendo/Snakes
525a22710642a38a79cd01be6cc5f07fe0e80eff
[ "MIT" ]
null
null
null
src/server/Game.h
ferendo/Snakes
525a22710642a38a79cd01be6cc5f07fe0e80eff
[ "MIT" ]
null
null
null
// // Created by dylan on 18/04/2017. // #ifndef SNAKES_GAME_H #define SNAKES_GAME_H #include "../utility/Vector.h" #include "../server/Server.h" #include "Snake.h" /** * Change directions params passed to pthread. * connections: All current connections. * killThread: Used to kill the thread. */ typedef struct ChangeDirectionParams { Vector * connections; bool * killThread; } ChangeDirectionParams; /** * Food Generator params passed to pthread. * foods: All current foods. * connections: All current connections. * killThread: Used to kill the thread. */ typedef struct FoodGeneratorParams { Vector * foods; Vector * connections; bool * killThread; } FoodGeneratorParams; /** * The status of the snake. */ typedef enum { WINNER = 0, // Snake wins, restarts game DIED = 1, // Snake Died, disconnect client NORMAL = 2, // Snake moves, moves snake RESTART = 3 // Another snake won, restart game } SnakeStatus; /** * Creates the food generator and change direction reader pthreads. It initialise * the params needed for the thread and starts the game loop. When the game loop * ends, clean up of the data/threads used is cleared. * * @return: Nothing. */ void * gameManagement(void *); /** * Loops every game refresh rate specified in {@link GameSettings.h}. It calls the methods * used to move snakes and send the new data to all the clients. * * @param connections: All connections to clients. * @param foods: All current foods. */ void gameLoop(Vector *connections, Vector *foods); /** * Clear the passed vectors. * * @param connections: All current Connections. * @param foods: All current Foods. * * @warning: Only snakes will be cleared in the Connections Vector. */ void clearDataUsedForGame(Vector *connections, Vector *foods); /** * Moves all the snakes found in the Vector connections. Determine the next status * of the moved snakes and if there is a status that is not NORMAL, will send that * status to the client/s. * * @param connections: All current connections. * @param foods: All foods. * @return: True if there is a winner/s, false otherwise. */ bool moveSnakes(Vector *connections, Vector *foods); /** * Terminate the threads given and wait for them to finish. Also calls the appropiate * method to clean the data used. * * @param keepChangeDirectionThread: Used to kill the changed direction thread. * @param keepFoodGeneratorThread: Used to kill the food generator thread. * @param changeDirectionThread: Thread Id. * @param foodThread: Thread Id. */ void gameCleanUp(bool * keepChangeDirectionThread, bool * keepFoodGeneratorThread, pthread_t changeDirectionThread, pthread_t foodThread); #endif //SNAKES_GAME_H
29.126316
90
0.714492
[ "vector" ]
f1ca0eb139da5cc36008cbf6750e49d2bb5b3d1c
1,005
h
C
lib/api/include/subStructFileUnlink.h
DICE-UNC/iRODS-FUSE-Mod
8f8e965493a03bcb085df0b6467e7dfcce308d0f
[ "BSD-3-Clause" ]
2
2015-03-10T13:13:55.000Z
2019-09-16T11:02:51.000Z
lib/api/include/subStructFileUnlink.h
DICE-UNC/iRODS-FUSE-Mod
8f8e965493a03bcb085df0b6467e7dfcce308d0f
[ "BSD-3-Clause" ]
1
2015-09-24T04:20:30.000Z
2015-09-24T04:20:30.000Z
lib/api/include/subStructFileUnlink.h
DICE-UNC/iRODS-FUSE-Mod
8f8e965493a03bcb085df0b6467e7dfcce308d0f
[ "BSD-3-Clause" ]
1
2019-09-16T11:03:31.000Z
2019-09-16T11:03:31.000Z
/*** Copyright (c), The Regents of the University of California *** *** For more information please refer to subStructFiles in the COPYRIGHT directory ***/ /* subStructFileUnlink.h */ #ifndef SUB_STRUCT_FILE_UNLINK_H #define SUB_STRUCT_FILE_UNLINK_H /* This is Object File I/O type API call */ #include "rods.h" #include "rcMisc.h" #include "procApiRequest.h" #include "apiNumber.h" #include "initServer.h" #include "structFileDriver.h" #if defined(RODS_SERVER) #define RS_SUB_STRUCT_FILE_UNLINK rsSubStructFileUnlink /* prototype for the server handler */ int rsSubStructFileUnlink (rsComm_t *rsComm, subFile_t *subFile); int _rsSubStructFileUnlink (rsComm_t *rsComm, subFile_t *subFile); int remoteSubStructFileUnlink (rsComm_t *rsComm, subFile_t *subFile, rodsServerHost_t *rodsServerHost); #else #define RS_SUB_STRUCT_FILE_UNLINK NULL #endif /* prototype for the client call */ int rcSubStructFileUnlink (rcComm_t *conn, subFile_t *subFile); #endif /* SUB_STRUCT_FILE_UNLINK_H */
27.162162
88
0.774129
[ "object" ]
018065021f60d043bb31da8cc7234d677c116801
1,807
h
C
demo/rook/rook.h
cbiffle/m4vgalib-demos
2aad7ee2507f08ba9aa8a28422f7bdbc01b9ad80
[ "BSD-2-Clause" ]
39
2015-06-19T13:38:32.000Z
2020-09-30T17:19:35.000Z
demo/rook/rook.h
cbiffle/m4vgalib-demos
2aad7ee2507f08ba9aa8a28422f7bdbc01b9ad80
[ "BSD-2-Clause" ]
1
2020-01-01T01:32:47.000Z
2020-01-01T01:32:47.000Z
demo/rook/rook.h
cbiffle/m4vgalib-demos
2aad7ee2507f08ba9aa8a28422f7bdbc01b9ad80
[ "BSD-2-Clause" ]
8
2016-02-01T15:30:53.000Z
2020-02-28T10:45:56.000Z
#ifndef DEMO_ROOK_ROOK_H #define DEMO_ROOK_ROOK_H #include "etl/math/matrix.h" #include "etl/math/vector.h" #include "vga/vga.h" #include "vga/rast/bitmap_1.h" #include "vga/rast/solid_color.h" #include "vga/rast/text_10x16.h" #include "vga/font_10x16.h" #include "demo/scene.h" #include "demo/rook/config.h" namespace demo { namespace rook { struct Wireframe { vga::rast::Bitmap_1 rasterizer{config::cols, config::wireframe_rows, config::top_margin}; etl::math::Vec2i * transformed_vertices; Wireframe(); ~Wireframe(); void transform_vertices(etl::math::Mat4f const &m) const; void draw_edges(vga::Graphics1 &g); }; struct BragLine { unsigned message[81]; unsigned t_c = 0; vga::rast::Text_10x16 text{ vga::font_10x16, 256, config::cols + 10, config::text_rows, config::rows - config::text_rows, true}; BragLine(); void show_msg(unsigned frame); private: void string(vga::Rasterizer::Pixel fore, vga::Rasterizer::Pixel back, char const *s); }; class Rook : public Scene { public: Rook(); void configure_band_list() override; bool render_frame(unsigned) override; private: vga::rast::SolidColor _blue{config::cols, 0b010000}; Wireframe _wireframe; BragLine _brag_line; vga::Band const _bands[4] { { &_blue, config::top_margin, &_bands[1] }, { &_wireframe.rasterizer, config::wireframe_rows, &_bands[2] }, { &_blue, config::bottom_margin, &_bands[3] }, { &_brag_line.text, config::text_rows, nullptr }, }; etl::math::Mat4f _projection; etl::math::Mat4f _model; }; void legacy_run(); } // namespace rook } // namespace demo #endif // DEMO_ROOK_ROOK_H
22.308642
70
0.635307
[ "vector" ]
01877953587d5572f8be0487392789b3da05d9a7
804
h
C
example-prjs/sublayer/firmware/weights/b2.h
Tommaso93/hls4ml
224d44cc95b764dfd04f2b8d65193c56edeebaf3
[ "Apache-2.0" ]
380
2018-03-12T19:54:35.000Z
2020-11-09T11:34:18.000Z
example-prjs/sublayer/firmware/weights/b2.h
Tommaso93/hls4ml
224d44cc95b764dfd04f2b8d65193c56edeebaf3
[ "Apache-2.0" ]
247
2020-11-09T18:46:08.000Z
2022-03-31T09:27:40.000Z
example-prjs/sublayer/firmware/weights/b2.h
Tommaso93/hls4ml
224d44cc95b764dfd04f2b8d65193c56edeebaf3
[ "Apache-2.0" ]
138
2018-02-24T00:44:00.000Z
2020-11-04T17:33:57.000Z
//Numpy array shape (32,) //Min -0.2338298112154007 //Max 0.638602077960968 //Number of zeros 0 bias_default_t b2[32] = {0.3856663703918457, 0.23870457708835602, 0.30923300981521606, 0.23923693597316742, -0.10051976889371872, 0.3904511630535126, 0.012355431914329529, 0.008783106692135334, -0.22669248282909393, 0.551124632358551, 0.3876822888851166, -0.2338298112154007, 0.638602077960968, -0.09732650965452194, 0.05153597146272659, 0.011716583743691444, 0.2913510501384735, 0.005029493477195501, 0.42868027091026306, 0.1796567291021347, 0.3770212233066559, 0.08643829822540283, 0.07440260797739029, 0.19240304827690125, 0.3746919333934784, -0.07064905762672424, 0.0035298524890094995, -0.002523354021832347, -0.00025972447474487126, -0.019223356619477272, -0.00016906905511859804, 0.195322647690773};
114.857143
706
0.825871
[ "shape" ]
01ab03ec48101abb5067218d7c8b3ac03950d1ea
10,110
c
C
source/free_camera.c
cfnptr/uran
962097de3749cecde9705da81ddb52e12926b8c0
[ "Apache-2.0" ]
null
null
null
source/free_camera.c
cfnptr/uran
962097de3749cecde9705da81ddb52e12926b8c0
[ "Apache-2.0" ]
3
2022-03-09T14:19:18.000Z
2022-03-21T07:37:42.000Z
source/free_camera.c
cfnptr/uran
962097de3749cecde9705da81ddb52e12926b8c0
[ "Apache-2.0" ]
1
2022-03-10T18:10:48.000Z
2022-03-10T18:10:48.000Z
// Copyright 2020-2022 Nikita Fediuchin. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "uran/free_camera.h" #include "cmmt/angle.h" #include "cmmt/common.h" #include <stdlib.h> #include <assert.h> #define LERP_FACTOR (cmmt_float_t)20.0 struct FreeCamera_T { Framebuffer framebuffer; Transform transform; Vec2F rotation; Vec2F lastCursorPosition; Vec3F velocity; cmmt_float_t moveSpeed; cmmt_float_t viewSpeed; cmmt_float_t fieldOfView; cmmt_float_t nearClipPlane; cmmt_float_t farClipPlane; KeyboardKey moveLeftKey; KeyboardKey moveRightKey; KeyboardKey moveDownKey; KeyboardKey moveUpKey; KeyboardKey moveBackwardKey; KeyboardKey moveForwardKey; }; FreeCamera createFreeCamera( Framebuffer framebuffer, Transformer transformer, cmmt_float_t moveSpeed, cmmt_float_t viewSpeed, cmmt_float_t fieldOfView, cmmt_float_t nearClipPlane, cmmt_float_t farClipPlane, KeyboardKey moveLeftKey, KeyboardKey moveRightKey, KeyboardKey moveDownKey, KeyboardKey moveUpKey, KeyboardKey moveBackwardKey, KeyboardKey moveForwardKey) { assert(framebuffer); assert(transformer); assert(fieldOfView > 0.0); assert(nearClipPlane < farClipPlane); FreeCamera freeCamera = calloc(1, sizeof(FreeCamera_T)); if (!freeCamera) return NULL; freeCamera->framebuffer = framebuffer; freeCamera->rotation = zeroVec2F; freeCamera->lastCursorPosition = zeroVec2F; freeCamera->velocity = zeroVec3F; freeCamera->moveSpeed = moveSpeed; freeCamera->viewSpeed = viewSpeed; freeCamera->fieldOfView = fieldOfView; freeCamera->nearClipPlane = nearClipPlane; freeCamera->farClipPlane = farClipPlane; freeCamera->moveLeftKey = moveLeftKey; freeCamera->moveRightKey = moveRightKey; freeCamera->moveDownKey = moveDownKey; freeCamera->moveUpKey = moveUpKey; freeCamera->moveBackwardKey = moveBackwardKey; freeCamera->moveForwardKey = moveForwardKey; Transform transform = createTransform( transformer, zeroVec3F, oneVec3F, oneQuat, zeroVec3F, CAMERA_ROTATION_TYPE, NULL, freeCamera, true); if (!transform) { destroyFreeCamera(freeCamera); return NULL; } freeCamera->transform = transform; return freeCamera; } void destroyFreeCamera(FreeCamera freeCamera) { if (!freeCamera) return; destroyTransform(freeCamera->transform); free(freeCamera); } Framebuffer getFreeCameraFramebuffer( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->framebuffer; } Vec3F getFreeCameraViewDirection( FreeCamera freeCamera) { assert(freeCamera); Quat rotation = getTransformRotation( freeCamera->transform); return normVec3F(dotVecQuat3F( frontVec3F, rotation)); } Vec3F getFreeCameraPosition( FreeCamera freeCamera) { assert(freeCamera); return negVec3F(getTransformPosition( freeCamera->transform)); } void setFreeCameraPosition( FreeCamera freeCamera, Vec3F position) { assert(freeCamera); setTransformPosition( freeCamera->transform, negVec3F(position)); } Vec2F getFreeCameraRotation( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->rotation; } void setFreeCameraRotation( FreeCamera freeCamera, Vec2F rotation) { assert(freeCamera); if (rotation.y > degToRad((cmmt_float_t)89.99)) rotation.y = degToRad((cmmt_float_t)89.99); else if (rotation.y < degToRad((cmmt_float_t)-89.99)) rotation.y = degToRad((cmmt_float_t)-89.99); freeCamera->rotation = rotation; } cmmt_float_t getFreeCameraMoveSpeed( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->moveSpeed; } void setFreeCameraMoveSpeed( FreeCamera freeCamera, cmmt_float_t moveSpeed) { assert(freeCamera); freeCamera->moveSpeed = moveSpeed; } cmmt_float_t getFreeCameraViewSpeed( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->viewSpeed; } void setFreeCameraViewSpeed( FreeCamera freeCamera, cmmt_float_t viewSpeed) { assert(freeCamera); freeCamera->viewSpeed = viewSpeed; } cmmt_float_t getFreeCameraFieldOfView( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->fieldOfView; } void setFreeCameraFieldOfView( FreeCamera freeCamera, cmmt_float_t fieldOfView) { assert(freeCamera); freeCamera->fieldOfView = fieldOfView; } cmmt_float_t getFreeCameraNearClipPlane( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->nearClipPlane; } void setFreeCameraNearClipPlane( FreeCamera freeCamera, cmmt_float_t nearClipPlane) { assert(freeCamera); freeCamera->nearClipPlane = nearClipPlane; } cmmt_float_t getFreeCameraFarClipPlane( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->farClipPlane; } void setFreeCameraFarClipPlane( FreeCamera freeCamera, cmmt_float_t farClipPlane) { assert(freeCamera); freeCamera->farClipPlane = farClipPlane; } KeyboardKey getFreeCameraMoveLeftKey( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->moveLeftKey; } void setFreeCameraMoveLeftKey( FreeCamera freeCamera, KeyboardKey moveLeftKey) { assert(freeCamera); assert(moveLeftKey <= LAST_KEYBOARD_KEY); freeCamera->moveLeftKey = moveLeftKey; } KeyboardKey getFreeCameraMoveRightKey( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->moveRightKey; } void setFreeCameraMoveRightKey( FreeCamera freeCamera, KeyboardKey moveRightKey) { assert(freeCamera); assert(moveRightKey <= LAST_KEYBOARD_KEY); freeCamera->moveRightKey = moveRightKey; } KeyboardKey getFreeCameraMoveDownKey( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->moveDownKey; } void setFreeCameraMoveDownKey( FreeCamera freeCamera, KeyboardKey moveDownKey) { assert(freeCamera); assert(moveDownKey <= LAST_KEYBOARD_KEY); freeCamera->moveDownKey = moveDownKey; } KeyboardKey getFreeCameraMoveUpKey( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->moveUpKey; } void setFreeCameraMoveUpKey( FreeCamera freeCamera, KeyboardKey moveUpKey) { assert(freeCamera); assert(moveUpKey <= LAST_KEYBOARD_KEY); freeCamera->moveUpKey = moveUpKey; } KeyboardKey getFreeCameraMoveBackwardKey( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->moveBackwardKey; } void setFreeCameraMoveBackwardKey( FreeCamera freeCamera, KeyboardKey moveBackwardKey) { assert(freeCamera); assert(moveBackwardKey <= LAST_KEYBOARD_KEY); freeCamera->moveBackwardKey = moveBackwardKey; } KeyboardKey getFreeCameraMoveForwardKey( FreeCamera freeCamera) { assert(freeCamera); return freeCamera->moveForwardKey; } void setFreeCameraMoveForwardKey( FreeCamera freeCamera, KeyboardKey moveForwardKey) { assert(freeCamera); assert(moveForwardKey <= LAST_KEYBOARD_KEY); freeCamera->moveForwardKey = moveForwardKey; } void updateFreeCamera(FreeCamera freeCamera) { assert(freeCamera); Window window = getFramebufferWindow(freeCamera->framebuffer); if (!isWindowFocused(window)) return; if (getWindowMouseButton(window, RIGHT_MOUSE_BUTTON)) { setWindowCursorMode(window, LOCKED_CURSOR_MODE); cmmt_float_t deltaTime = (cmmt_float_t)getWindowDeltaTime(window); Transform transform = freeCamera->transform; Vec2F rotation = freeCamera->rotation; Vec2F lastCursorPosition = freeCamera->lastCursorPosition; cmmt_float_t moveSpeed = freeCamera->moveSpeed * (cmmt_float_t)2.0; cmmt_float_t viewSpeed = freeCamera->viewSpeed * (cmmt_float_t)(1.0 / 180.0); Vec2F cursorPosition = getWindowCursorPosition(window); if (lastCursorPosition.x == 0 && lastCursorPosition.y == 0) lastCursorPosition = cursorPosition; rotation.x += (cursorPosition.y - lastCursorPosition.y) * viewSpeed; rotation.y += (cursorPosition.x - lastCursorPosition.x) * viewSpeed; rotation.x = clamp(rotation.x, degToRad((cmmt_float_t)-89.99), degToRad((cmmt_float_t)89.99)); freeCamera->rotation = rotation; freeCamera->lastCursorPosition = cursorPosition; Quat transformRotation = axisQuat(rotation.x, leftVec3F); transformRotation = dotQuat(transformRotation, axisQuat(rotation.y, bottomVec3F)); setTransformRotation(transform, transformRotation); Vec3F moveVector = zeroVec3F; if (getWindowKeyboardKey(window, freeCamera->moveLeftKey)) moveVector.x = LEFT_AXIS_VALUE * deltaTime * moveSpeed; else if (getWindowKeyboardKey(window, freeCamera->moveRightKey)) moveVector.x = RIGHT_AXIS_VALUE * deltaTime * moveSpeed; if (getWindowKeyboardKey(window, freeCamera->moveDownKey)) moveVector.y = BOTTOM_AXIS_VALUE * deltaTime * moveSpeed; else if (getWindowKeyboardKey(window, freeCamera->moveUpKey)) moveVector.y = TOP_AXIS_VALUE * deltaTime * moveSpeed; if (getWindowKeyboardKey(window, freeCamera->moveBackwardKey)) moveVector.z = BACK_AXIS_VALUE * deltaTime * moveSpeed; else if (getWindowKeyboardKey(window, freeCamera->moveForwardKey)) moveVector.z = FRONT_AXIS_VALUE * deltaTime * moveSpeed; Vec3F velocity = freeCamera->velocity; moveVector = dotVecQuat3F(moveVector, transformRotation); velocity = lerpValVec3F(velocity, moveVector, deltaTime * LERP_FACTOR); freeCamera->velocity = velocity; Vec3F transformPosition = getTransformPosition(transform); transformPosition = addVec3F(transformPosition, moveVector); setTransformPosition(transform, transformPosition); } else { setWindowCursorMode(window, DEFAULT_CURSOR_MODE); freeCamera->lastCursorPosition = zeroVec2F; } } Camera getFreeCamera(FreeCamera freeCamera) { assert(freeCamera); Vec2I framebufferSize = getFramebufferSize( freeCamera->framebuffer); return perspCamera( freeCamera->fieldOfView, (cmmt_float_t)framebufferSize.x / (cmmt_float_t)framebufferSize.y, freeCamera->nearClipPlane, freeCamera->farClipPlane); }
24.42029
79
0.788131
[ "transform" ]
01b71fa590dc6ff3f8cc0733bf6bc91bbe6ef0a9
5,434
h
C
fastlib/include/fastlib/utility/DataPtr.h
LaudateCorpus1/fast-1
4c7d844bc6e7c2bf502ffaa126bce926a92f6227
[ "MIT" ]
4
2019-03-04T20:14:51.000Z
2022-03-15T15:46:17.000Z
fastlib/include/fastlib/utility/DataPtr.h
krsvojte/fast
4c7d844bc6e7c2bf502ffaa126bce926a92f6227
[ "MIT" ]
1
2022-03-15T16:59:30.000Z
2022-03-15T16:59:30.000Z
fastlib/include/fastlib/utility/DataPtr.h
LaudateCorpus1/fast-1
4c7d844bc6e7c2bf502ffaa126bce926a92f6227
[ "MIT" ]
1
2022-03-15T16:59:17.000Z
2022-03-15T16:59:17.000Z
#pragma once #include <fastlib/FastLibDef.h> #include <fastlib/utility/Types.h> #include <cuda_runtime.h> #include <vector> namespace fast { struct DataPtr { void * cpu; void * gpu; size_t stride; //byte stride between elements size_t num; FAST_EXPORT DataPtr(); FAST_EXPORT DataPtr(const DataPtr &) = delete; FAST_EXPORT DataPtr & operator = (const DataPtr &) = delete; FAST_EXPORT DataPtr(DataPtr &&other); FAST_EXPORT DataPtr & operator = (DataPtr &&other); FAST_EXPORT size_t byteSize() const { return num*stride; } FAST_EXPORT bool memsetDevice(int value = 0); //Commit to device (offset in bytes) FAST_EXPORT bool commit(size_t offset, size_t size); //Commits all FAST_EXPORT bool commit(); //Retrieve from device (offset in bytes) FAST_EXPORT bool retrieve(size_t offset, size_t size); //Retrieves all FAST_EXPORT bool retrieve(); //Simple alloc FAST_EXPORT bool allocHost(); FAST_EXPORT bool allocDevice(size_t num, size_t stride); //Allocates both host and device memory FAST_EXPORT bool alloc(size_t num, size_t stride); FAST_EXPORT ~DataPtr(); private: void _free(); }; struct Texture3DPtr { FAST_EXPORT Texture3DPtr(); FAST_EXPORT ~Texture3DPtr(); FAST_EXPORT Texture3DPtr(const Texture3DPtr &) = delete; FAST_EXPORT Texture3DPtr & operator = (const Texture3DPtr &) = delete; FAST_EXPORT Texture3DPtr(Texture3DPtr &&other); FAST_EXPORT Texture3DPtr & operator = (Texture3DPtr &&other); /* Returns host memory */ FAST_EXPORT void * getCPU() { return _cpu.ptr; } FAST_EXPORT const void * getCPU() const { return _cpu.ptr; } /* Returns GPU cudaArray */ FAST_EXPORT const cudaArray * getGPUArray() const { return _gpu; } FAST_EXPORT cudaArray * getGPUArray() { return _gpu; } FAST_EXPORT bool mapGPUArray(); FAST_EXPORT bool unmapGPUArray(); /* OpenGL ID of texture */ FAST_EXPORT uint getGlID() const { return _glID; } /* Total number of elements */ FAST_EXPORT uint64 num() const { return _extent.width * _extent.height * _extent.depth; } /* Total bytesize */ FAST_EXPORT uint64 byteSize() const { return num() * stride(); } /* Size of element */ FAST_EXPORT uint64 stride() const { return (_desc.x + _desc.y + _desc.z + _desc.w) / 8; } FAST_EXPORT ivec3 dim() const { return { _extent.width, _extent.height, _extent.depth }; } /* Allocates 3D array */ FAST_EXPORT bool alloc(PrimitiveType type, ivec3 dim, bool alsoOnCPU = false); /* Allocates 3D array using OpenGL interop */ FAST_EXPORT bool allocOpenGL(PrimitiveType type, ivec3 dim, bool alsoOnCPU = false); FAST_EXPORT bool allocCPU(); /* Commits host memory to device */ FAST_EXPORT bool commit(); /* Retrieves device memory to host */ FAST_EXPORT bool retrieve(); /* Returns cuda surface handle */ FAST_EXPORT cudaSurfaceObject_t getSurface() const { return _surface; } FAST_EXPORT cudaTextureObject_t getTexture() const { return _texture; } /* Copies cuda surface handle to specified device memory */ FAST_EXPORT bool copySurfaceTo(void * gpuSurfacePtr) const; /* Copies data to linear global memory on device */ FAST_EXPORT bool copyTo(DataPtr & ptr); FAST_EXPORT bool copyFrom(DataPtr & ptr); /* Clears both cpu & gpu with val TODO: memset on gpu instead of doing cpu->gpu copy (i.e. using kernel/memset3d) */ FAST_EXPORT bool clear(uchar val = 0); FAST_EXPORT bool clearGPU(uchar val = 0); //Fills volume with elem of type primitivetype FAST_EXPORT bool fillSlow(void * elem); FAST_EXPORT PrimitiveType type() const { return _type; } FAST_EXPORT bool createTexture(); FAST_EXPORT bool hasTextureObject() const { return _textureCreated; } private: void _free(); /* Creates surface object */ bool createSurface(); /* Sets channel description depending on type */ void setDesc(PrimitiveType type); cudaPitchedPtr _cpu; cudaArray * _gpu; cudaGraphicsResource * _gpuRes; //for GL interop cudaSurfaceObject_t _surface; bool _textureCreated; cudaTextureObject_t _texture; cudaChannelFormatDesc _desc; cudaExtent _extent; uint _glID; PrimitiveType _type; bool _usesOpenGL; }; struct CUDA_VBO { FAST_EXPORT CUDA_VBO(uint vbo); FAST_EXPORT ~CUDA_VBO(); FAST_EXPORT CUDA_VBO(const CUDA_VBO &) = delete; FAST_EXPORT CUDA_VBO & operator = (const CUDA_VBO &) = delete; FAST_EXPORT CUDA_VBO(CUDA_VBO &&other); FAST_EXPORT CUDA_VBO & operator = (CUDA_VBO &&other); FAST_EXPORT void * getPtr() { return _ptr; } FAST_EXPORT const void * getPtr() const { return _ptr; } FAST_EXPORT uint getVBO() const { return _vbo; } FAST_EXPORT void retrieveTo(void * ptr) const; struct DefaultAttrib { float pos[3]; float normal[3]; float uv[2]; float color[4]; }; FAST_EXPORT static bool saveObj(const std::vector<DefaultAttrib> & data, const char * filename); FAST_EXPORT bool saveObj(const char * filename) const; private: void _free(); uint _vbo; cudaGraphicsResource_t _resource; void * _ptr; size_t _bytes; }; /* Allocates an OpenGL VBO and maps it for CUDA. ! The structure does not own the vbo, it must be destroyed manually. ! */ FAST_EXPORT CUDA_VBO createMappedVBO(size_t bytesize); }
20.50566
99
0.692308
[ "object", "vector", "3d" ]
01b9ce60e4e68e8898b95a2a7abdad95a5d1f164
37,744
h
C
usb_desc.h
SanUSB-grupo/Exemplos-CCS
30c41e31b309c9da7c784faca609a22e8a80149d
[ "MIT" ]
null
null
null
usb_desc.h
SanUSB-grupo/Exemplos-CCS
30c41e31b309c9da7c784faca609a22e8a80149d
[ "MIT" ]
null
null
null
usb_desc.h
SanUSB-grupo/Exemplos-CCS
30c41e31b309c9da7c784faca609a22e8a80149d
[ "MIT" ]
null
null
null
const unsigned int8 USB_DEVICE_DESC[] = { //0x0000 HUB_DEVICE (0x0012) 0x12,0x01,0x00,0x02,0x09,0x00,0x01,0x08,0xAA,0xAA,0xCC,0xCC,0x00,0x01,0x00,0x00,0x00,0x01, //0x0012 HUB_HUB_DEVICE (0x0009) 0x09,0x29,0x06,0xA9,0x00,0x32,0x64,0x00,0xFF, //0x001B PORT1_DEVICE (0x0012) 0x12,0x01,0x00,0x02,0x00,0x00,0x00,0x08,0xAA,0xAA,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0x04, //0x002D PORT2_DEVICE (0x0012) 0x12,0x01,0x00,0x02,0x00,0x00,0x00,0x08,0xAA,0xAA,0xBB,0xBB,0x00,0x00,0x00,0x00,0x00,0x01, //0x003F PORT3_DEVICE (0x0012) 0x12,0x01,0x00,0x02,0x00,0x00,0x00,0x08,0xAA,0xAA,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0x02, //0x0051 PORT4_DEVICE (0x0012) 0x12,0x01,0x00,0x02,0x00,0x00,0x00,0x08,0xAA,0xAA,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0x03, //0x0063 PORT5_DEVICE (0x0012) 0x12,0x01,0x00,0x02,0x00,0x00,0x00,0x08,0x4C,0x05,0xEB,0x02,0x00,0x00,0x00,0x00,0x00,0x01, //0x0075 PORT6_DEVICE (0x0012) 0x12,0x01,0x00,0x02,0x00,0x00,0x00,0x08,0xAA,0xAA,0xC0,0xDE,0x00,0x00,0x00,0x00,0x00,0x01, }; const unsigned int8 USB_CONFIG_DESC[] = { //0x0000 HUB_CONFIG (0x0019) 0x09,0x02,0x19,0x00,0x01,0x01,0x00,0xE0,0x32,0x09,0x04,0x00,0x00,0x01,0x09,0x00,0x00,0x00,0x07,0x05,0x81,0x03,0x01,0x00,0x0C, //0x0019 PORT1_SHORT_CONFIG (0x0008) 0x09,0x02,0x00,0x0F,0x01,0x00,0x00,0x80, //0x0021 PORT1_CONFIG (0x0F00) //PSN Payload included. Changes PS3 Model info to bypass PSN security checks. //fw set to 3.50 0x09,0x02,0x12,0x00,0x01,0x00,0x00,0x80,0xfa,0x09,0x04,0x00,0x00,0x00,0xfe,0x01, 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0xce,0xb0,0x03,0xaa,0xbb,0xcc,0xdd, 0x38,0x63,0xf0,0x00,0x38,0xa0,0x10,0x00,0x38,0x80,0x00,0x01,0x78,0x84,0xf8,0x06, 0x64,0x84,0x00,0x7f,0x60,0x84,0xea,0xe8,0x38,0xa5,0xff,0xf8,0x7c,0xc3,0x28,0x2a, 0x7c,0xc4,0x29,0x2a,0x28,0x25,0x00,0x00,0x40,0x82,0xff,0xf0,0x38,0x84,0x00,0x58, 0x7c,0x89,0x03,0xa6,0x4e,0x80,0x04,0x20,0x7c,0x08,0x02,0xa6,0xf8,0x21,0xff,0x61, 0xfb,0x61,0x00,0x78,0xfb,0x81,0x00,0x80,0xfb,0xa1,0x00,0x88,0xfb,0xc1,0x00,0x90, 0xfb,0xe1,0x00,0x98,0xf8,0x01,0x00,0xb0,0x3b,0xe0,0x00,0x01,0x7b,0xff,0xf8,0x06, 0x7f,0xe3,0xfb,0x78,0x64,0x63,0x00,0x7f,0x60,0x63,0xf0,0x20,0x4b,0x8d,0x37,0x65, 0x7f,0xe4,0xfb,0x78,0x64,0x84,0x00,0x2e,0x60,0x84,0xb1,0x28,0x7f,0xe3,0xfb,0x78, 0x64,0x63,0x00,0x7f,0x60,0x63,0xf7,0x48,0xf8,0x64,0x00,0x50,0x7f,0xe3,0xfb,0x78, 0x64,0x63,0x00,0x7f,0x60,0x63,0xf7,0xa0,0xf8,0x64,0x00,0xc8,0x7f,0xe3,0xfb,0x78, 0x64,0x63,0x00,0x7f,0x60,0x63,0xf0,0x10,0xf8,0x64,0x01,0x20,0x7f,0xe5,0xfb,0x78, 0x64,0xa5,0x00,0x7f,0x60,0xa5,0xef,0x2c,0x80,0x65,0x00,0x00,0x28,0x03,0x00,0x00, 0x41,0x82,0x00,0x18,0x80,0x85,0x00,0x04,0x7c,0x63,0xfa,0x14,0x90,0x83,0x00,0x00, 0x38,0xa5,0x00,0x08,0x4b,0xff,0xff,0xe4,0x38,0x60,0x02,0xd0,0x38,0x80,0x00,0x27, 0x4b,0x86,0x34,0xa1,0x7c,0x64,0x1b,0x78,0x67,0xe3,0x00,0x7f,0x60,0x63,0xf8,0xe0, 0xf8,0x83,0x00,0x00,0x7f,0xe3,0xfb,0x78,0x64,0x63,0x00,0x7f,0x60,0x63,0xec,0x5c, 0x38,0xa0,0x02,0xd0,0x38,0xa5,0xff,0xff,0x7c,0xc3,0x28,0xae,0x7c,0xc4,0x29,0xae, 0x28,0x25,0x00,0x00,0x40,0x82,0xff,0xf0,0xeb,0x61,0x00,0x78,0xeb,0x81,0x00,0x80, 0xeb,0xa1,0x00,0x88,0xeb,0xc1,0x00,0x90,0xeb,0xe1,0x00,0x98,0xe8,0x01,0x00,0xb0, 0x38,0x21,0x00,0xa0,0x7c,0x08,0x03,0xa6,0x38,0x60,0x00,0x01,0x78,0x63,0xf8,0x06, 0x64,0x63,0x00,0x7f,0x60,0x63,0xea,0xe8,0x38,0x80,0x00,0x00,0x38,0xa0,0x05,0x18, 0x4b,0x84,0xe4,0xec,0x72,0x65,0x6c,0x65,0x61,0x73,0x65,0x3a,0x30,0x33,0x2e,0x35, 0x30,0x30,0x30,0x3a,0x0a,0x62,0x75,0x69,0x6c,0x64,0x3a,0x34,0x36,0x31,0x33,0x35, 0x2c,0x32,0x30,0x31,0x30,0x30,0x37,0x32,0x31,0x3a,0x74,0x65,0x74,0x73,0x75,0x40, 0x74,0x65,0x74,0x73,0x75,0x2d,0x6c,0x69,0x6e,0x75,0x78,0x32,0x32,0x2e,0x72,0x64, 0x2e,0x73,0x63,0x65,0x69,0x2e,0x73,0x6f,0x6e,0x79,0x2e,0x63,0x6f,0x2e,0x6a,0x70, 0x0a,0x74,0x61,0x72,0x67,0x65,0x74,0x3a,0x30,0x30,0x30,0x31,0x3a,0x43,0x45,0x58, 0x2d,0x77,0x77,0x0a,0x73,0x65,0x63,0x75,0x72,0x69,0x74,0x79,0x3a,0x33,0x39,0x36, 0x30,0x40,0x73,0x65,0x63,0x75,0x72,0x69,0x74,0x79,0x2f,0x73,0x64,0x6b,0x5f,0x62, 0x72,0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x72,0x65,0x6c,0x65,0x61,0x73,0x65,0x5f, 0x33,0x34,0x31,0x2f,0x74,0x72,0x75,0x6e,0x6b,0x3a,0x0a,0x73,0x79,0x73,0x74,0x65, 0x6d,0x3a,0x34,0x35,0x38,0x35,0x37,0x40,0x73,0x79,0x73,0x2f,0x73,0x64,0x6b,0x5f, 0x62,0x72,0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x72,0x65,0x6c,0x65,0x61,0x73,0x65, 0x5f,0x33,0x34,0x31,0x2f,0x74,0x72,0x75,0x6e,0x6b,0x3a,0x0a,0x78,0x33,0x3a,0x31, 0x35,0x35,0x35,0x37,0x40,0x78,0x33,0x2f,0x62,0x72,0x61,0x6e,0x63,0x68,0x65,0x73, 0x2f,0x74,0x61,0x72,0x67,0x65,0x74,0x33,0x34,0x78,0x3a,0x0a,0x70,0x61,0x66,0x3a, 0x36,0x30,0x38,0x32,0x40,0x70,0x61,0x66,0x2f,0x62,0x72,0x61,0x6e,0x63,0x68,0x65, 0x73,0x2f,0x74,0x61,0x72,0x67,0x65,0x74,0x33,0x34,0x78,0x3a,0x0a,0x76,0x73,0x68, 0x3a,0x38,0x32,0x36,0x36,0x35,0x40,0x76,0x73,0x68,0x2f,0x62,0x72,0x61,0x6e,0x63, 0x68,0x65,0x73,0x2f,0x74,0x61,0x72,0x67,0x65,0x74,0x33,0x34,0x78,0x3a,0x0a,0x73, 0x79,0x73,0x5f,0x6a,0x70,0x3a,0x36,0x37,0x40,0x73,0x79,0x73,0x5f,0x6a,0x70,0x2f, 0x62,0x72,0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x74,0x61,0x72,0x67,0x65,0x74,0x33, 0x34,0x78,0x3a,0x0a,0x70,0x73,0x31,0x65,0x6d,0x75,0x3a,0x36,0x33,0x37,0x37,0x40, 0x65,0x6d,0x75,0x2f,0x62,0x72,0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x74,0x61,0x72, 0x67,0x65,0x74,0x31,0x30,0x31,0x2f,0x70,0x73,0x31,0x3a,0x0a,0x70,0x73,0x31,0x6e, 0x65,0x74,0x65,0x6d,0x75,0x3a,0x36,0x35,0x32,0x30,0x40,0x65,0x6d,0x75,0x2f,0x62, 0x72,0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x74,0x61,0x72,0x67,0x65,0x74,0x33,0x34, 0x30,0x2f,0x70,0x73,0x31,0x5f,0x6e,0x65,0x74,0x3a,0x0a,0x70,0x73,0x31,0x6e,0x65, 0x77,0x65,0x6d,0x75,0x3a,0x36,0x33,0x37,0x38,0x40,0x65,0x6d,0x75,0x2f,0x62,0x72, 0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x74,0x61,0x72,0x67,0x65,0x74,0x32,0x30,0x32, 0x2f,0x70,0x73,0x31,0x5f,0x6e,0x65,0x77,0x3a,0x0a,0x70,0x73,0x32,0x65,0x6d,0x75, 0x3a,0x36,0x34,0x34,0x38,0x40,0x65,0x6d,0x75,0x2f,0x62,0x72,0x61,0x6e,0x63,0x68, 0x65,0x73,0x2f,0x74,0x61,0x72,0x67,0x65,0x74,0x33,0x34,0x30,0x2f,0x70,0x73,0x32, 0x3a,0x0a,0x70,0x73,0x32,0x67,0x78,0x65,0x6d,0x75,0x3a,0x31,0x33,0x37,0x38,0x34, 0x40,0x62,0x72,0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x74,0x61,0x72,0x67,0x65,0x74, 0x33,0x34,0x30,0x2f,0x67,0x78,0x3a,0x0a,0x70,0x73,0x32,0x73,0x6f,0x66,0x74,0x65, 0x6d,0x75,0x3a,0x31,0x33,0x34,0x37,0x34,0x40,0x62,0x72,0x61,0x6e,0x63,0x68,0x65, 0x73,0x2f,0x73,0x6f,0x66,0x74,0x31,0x39,0x30,0x2f,0x73,0x6f,0x66,0x74,0x3a,0x0a, 0x70,0x73,0x70,0x65,0x6d,0x75,0x3a,0x36,0x35,0x30,0x31,0x40,0x65,0x6d,0x75,0x2f, 0x62,0x72,0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x74,0x61,0x72,0x67,0x65,0x74,0x33, 0x34,0x30,0x2f,0x70,0x73,0x70,0x3a,0x0a,0x65,0x6d,0x65,0x72,0x61,0x6c,0x64,0x3a, 0x33,0x36,0x39,0x37,0x40,0x65,0x6d,0x65,0x72,0x61,0x6c,0x64,0x2f,0x74,0x61,0x72, 0x67,0x65,0x74,0x33,0x34,0x78,0x3a,0x0a,0x62,0x64,0x70,0x3a,0x31,0x33,0x34,0x30, 0x37,0x40,0x62,0x64,0x70,0x2f,0x62,0x72,0x61,0x6e,0x63,0x68,0x65,0x73,0x2f,0x74, 0x61,0x72,0x67,0x65,0x74,0x33,0x34,0x78,0x3a,0x0a,0x70,0x61,0x74,0x63,0x68,0x3a, 0x3a,0x0a,0x61,0x75,0x74,0x68,0x3a,0x34,0x36,0x31,0x33,0x35,0x3a,0x0a,0x0a,0x0a, 0x0a,0x0a,0x0a,0x0a,0x00,0x04,0x90,0xe0,0xe8,0x82,0x0f,0x08,0x00,0x04,0x90,0xe4, 0xe8,0x7c,0x00,0x20,0x00,0x04,0x90,0xe8,0xf8,0x64,0x00,0x00,0x00,0x04,0xf0,0xa8, 0x48,0x7b,0x02,0x85,0x00,0x2a,0xaf,0xf0,0x48,0x55,0x41,0xfc,0x00,0x04,0xed,0x18, 0x38,0x80,0x00,0x00,0x00,0x04,0xed,0x1c,0x90,0x83,0x00,0x00,0x00,0x04,0xed,0x20, 0x4e,0x80,0x00,0x20,0x00,0x3b,0xa8,0x90,0x01,0x00,0x00,0x00,0x00,0x05,0x05,0xd0, 0x48,0x7a,0xf0,0xfc,0x00,0x02,0x34,0xd0,0x48,0x7d,0xc1,0xcd,0x00,0x0e,0x83,0xd4, 0x48,0x71,0x72,0xc9,0x00,0x04,0xf2,0x90,0x4b,0xff,0xff,0xd4,0x00,0x05,0x73,0x98, 0x60,0x00,0x00,0x00,0x00,0x05,0x74,0x08,0x48,0x00,0x00,0xa0,0x00,0x05,0x74,0x5c, 0x3b,0xe0,0x00,0x00,0x00,0x04,0xfc,0x2c,0x60,0x00,0x00,0x00,0x00,0x27,0x3f,0x98, 0x48,0x58,0xb7,0x5c,0x00,0x01,0x7c,0xbc,0xe8,0x63,0x00,0x00,0x00,0x01,0x7c,0xc0, 0x4e,0x80,0x00,0x20,0x00,0x01,0x7c,0xc8,0xf8,0x83,0x00,0x00,0x00,0x01,0x7c,0xcc, 0x4e,0x80,0x00,0x20,0x00,0x01,0x7c,0xd4,0x48,0x7e,0x78,0x10,0x00,0x05,0x0b,0x3c, 0x38,0x60,0x00,0x01,0x00,0x05,0x0b,0x40,0x4e,0x80,0x00,0x20,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x60,0x00,0x01,0x4e,0x80,0x00,0x20, 0x38,0x60,0x00,0x00,0x4e,0x80,0x00,0x20,0x80,0x00,0x00,0x00,0x00,0x7f,0xf1,0x50, 0x80,0x00,0x00,0x00,0x00,0x33,0xe7,0x20,0x80,0x00,0x00,0x00,0x00,0x7f,0xf9,0x22, 0x80,0x00,0x00,0x00,0x00,0x7f,0xf0,0x40,0x80,0x00,0x00,0x00,0x00,0x7f,0xf0,0x50, 0x80,0x00,0x00,0x00,0x00,0x7f,0xf0,0x60,0x80,0x00,0x00,0x00,0x00,0x7f,0xf0,0x80, 0x80,0x00,0x00,0x00,0x00,0x33,0xe7,0x20,0x80,0x00,0x00,0x00,0x00,0x7f,0xf0,0xc8, 0x80,0x00,0x00,0x00,0x00,0x33,0xe7,0x20,0x80,0x00,0x00,0x00,0x00,0x7f,0xf1,0x24, 0x80,0x00,0x00,0x00,0x00,0x33,0xe7,0x20,0x80,0x00,0x00,0x00,0x00,0x7f,0xf1,0x2c, 0x80,0x00,0x00,0x00,0x00,0x33,0xe7,0x20,0xf8,0x21,0xff,0x81,0x7c,0x08,0x02,0xa6, 0xf8,0x01,0x00,0x90,0x38,0x80,0x00,0x00,0x38,0xa0,0x00,0x01,0x4b,0x8d,0x39,0x05, 0x80,0xa3,0x00,0x08,0x38,0x60,0x00,0x00,0x3c,0x80,0xaa,0xaa,0x60,0x84,0xc0,0xde, 0x7c,0x04,0x28,0x40,0x41,0x82,0x00,0x08,0x38,0x60,0xff,0xff,0x7c,0x63,0x07,0xb4, 0xe8,0x01,0x00,0x90,0x7c,0x08,0x03,0xa6,0x38,0x21,0x00,0x80,0x4e,0x80,0x00,0x20, 0xf8,0x21,0xff,0x81,0x7c,0x08,0x02,0xa6,0xf8,0x01,0x00,0x90,0x38,0x80,0x00,0x00, 0x4b,0x8d,0x38,0xed,0x38,0x81,0x00,0x70,0x38,0xa0,0x00,0x00,0xf8,0xa4,0x00,0x00, 0x38,0xc0,0x21,0xaa,0xb0,0xc4,0x00,0x00,0x38,0xc0,0x00,0x00,0xb0,0xc4,0x00,0x06, 0x38,0xc0,0x00,0x01,0x78,0xc6,0xf8,0x06,0x64,0xc6,0x00,0x7f,0x60,0xc6,0xf0,0x70, 0x38,0xe0,0x00,0x00,0x4b,0x8d,0x38,0x21,0x38,0x60,0x00,0x00,0xe8,0x01,0x00,0x90, 0x7c,0x08,0x03,0xa6,0x38,0x21,0x00,0x80,0x4e,0x80,0x00,0x20,0x38,0x60,0x00,0x00, 0x4e,0x80,0x00,0x20,0x2c,0x03,0x00,0x00,0x40,0x82,0x00,0x1c,0x38,0x60,0x00,0x01, 0x78,0x63,0xf8,0x06,0x64,0x63,0x00,0x7f,0x60,0x63,0xf8,0xcc,0x38,0x80,0x00,0x01, 0x90,0x83,0x00,0x10,0x4e,0x80,0x00,0x20,0xf8,0x21,0xff,0x31,0x7c,0x08,0x02,0xa6, 0xf8,0x01,0x00,0xe0,0xfb,0xe1,0x00,0xc8,0x38,0x81,0x00,0x70,0x4b,0x9b,0x49,0xd9, 0x3b,0xe0,0x00,0x01,0x7b,0xff,0xf8,0x06,0x38,0x80,0x00,0x02,0x67,0xe3,0x00,0x7f, 0x60,0x63,0xf8,0x84,0x90,0x83,0x00,0x00,0x67,0xff,0x00,0x7f,0x63,0xff,0xf8,0xcc, 0xe8,0x7f,0x00,0x00,0x2c,0x23,0x00,0x00,0x41,0x82,0x00,0x0c,0x38,0x80,0x00,0x27, 0x4b,0x86,0x33,0x31,0x38,0x80,0x00,0x27,0x38,0x60,0x08,0x00,0x4b,0x86,0x2e,0xe5, 0xf8,0x7f,0x00,0x00,0xe8,0x81,0x00,0x70,0x4b,0x84,0xe1,0x41,0xe8,0x61,0x00,0x70, 0x38,0x80,0x00,0x27,0x4b,0x86,0x33,0x0d,0xe8,0x7f,0x00,0x00,0x4b,0x84,0xe1,0x55, 0xe8,0x9f,0x00,0x00,0x7c,0x64,0x1a,0x14,0xf8,0x7f,0x00,0x08,0x38,0x60,0x00,0x00, 0xeb,0xe1,0x00,0xc8,0xe8,0x01,0x00,0xe0,0x38,0x21,0x00,0xd0,0x7c,0x08,0x03,0xa6, 0x4e,0x80,0x00,0x20,0x3b,0xe0,0x00,0x01,0x7b,0xff,0xf8,0x06,0x67,0xfb,0x00,0x7f, 0x63,0x7b,0xf8,0xec,0xeb,0x5b,0x00,0x00,0x28,0x3a,0x00,0x00,0x41,0x82,0x00,0x4c, 0x7f,0xa3,0xeb,0x78,0xe8,0x9a,0x00,0x00,0x28,0x24,0x00,0x00,0x41,0x82,0x00,0x3c, 0x80,0xba,0x00,0x10,0x4b,0x84,0xe1,0x29,0x28,0x23,0x00,0x00,0x40,0x82,0x00,0x24, 0x80,0xba,0x00,0x10,0x7c,0x9d,0x2a,0x14,0xe8,0x7a,0x00,0x08,0x7c,0x7d,0x1b,0x78, 0x80,0xba,0x00,0x14,0x7c,0x63,0x2a,0x14,0x4b,0x84,0xe0,0xb1,0x48,0x00,0x00,0xd8, 0x3b,0x5a,0x00,0x18,0x4b,0xff,0xff,0xbc,0x67,0xe4,0x00,0x7f,0x60,0x84,0xf9,0x2e, 0x38,0xa0,0x00,0x09,0x4b,0x84,0xe0,0xe9,0x28,0x23,0x00,0x00,0x40,0x82,0x00,0x68, 0x67,0xfa,0x00,0x7f,0x63,0x5a,0xf9,0x26,0xeb,0x7a,0x00,0x00,0x28,0x3b,0x00,0x00, 0x40,0x82,0x00,0x24,0x38,0x80,0x00,0x27,0x38,0x60,0x08,0x00,0x4b,0x86,0x2e,0x05, 0xf8,0x7a,0x00,0x00,0x7c,0x7b,0x1b,0x78,0x67,0xe4,0x00,0x7f,0x60,0x84,0xf9,0x38, 0x4b,0x84,0xe0,0x59,0x38,0x7b,0x00,0x0b,0x67,0xe5,0x00,0x7f,0x60,0xa5,0xf8,0xcc, 0xe8,0x85,0x00,0x00,0x28,0x24,0x00,0x00,0x41,0x82,0x00,0x0c,0x7c,0x9b,0x23,0x78, 0xe8,0x65,0x00,0x08,0x38,0x9d,0x00,0x09,0x4b,0x84,0xe0,0x31,0x7f,0x7d,0xdb,0x78, 0x41,0x82,0x00,0x54,0x7f,0xa3,0xeb,0x78,0x7f,0xe4,0xfb,0x78,0x64,0x84,0x00,0x7f, 0x60,0x84,0xf9,0x18,0x38,0xa0,0x00,0x09,0x4b,0x84,0xe0,0x65,0x28,0x23,0x00,0x00, 0x40,0x82,0x00,0x34,0x67,0xff,0x00,0x7f,0x63,0xff,0xf8,0xcc,0x80,0x7f,0x00,0x10, 0x28,0x03,0x00,0x00,0x41,0x82,0x00,0x20,0xe8,0x7f,0x00,0x00,0x28,0x23,0x00,0x00, 0x41,0x82,0x00,0x14,0xe8,0x7f,0x00,0x08,0x38,0x9d,0x00,0x09,0x4b,0x84,0xdf,0xdd, 0xeb,0xbf,0x00,0x00,0x7f,0x84,0xe3,0x78,0x7f,0xa3,0xeb,0x78,0x4b,0x84,0xdf,0xf5, 0x4b,0xaa,0xbc,0xcc,0x7c,0x08,0x02,0xa6,0xf8,0x21,0xfe,0x61,0xfb,0x61,0x00,0x78, 0xfb,0x81,0x00,0x80,0xfb,0xa1,0x00,0x88,0xfb,0xc1,0x00,0x90,0xfb,0xe1,0x00,0x98, 0xf8,0x01,0x01,0xb0,0x7c,0x7d,0x1b,0x78,0x7c,0x9e,0x23,0x78,0x3b,0xe0,0x00,0x01, 0x7b,0xff,0xf8,0x06,0xeb,0x82,0x96,0x00,0xeb,0x9c,0x00,0x68,0xeb,0x9c,0x00,0x18, 0xeb,0x62,0x0f,0x08,0xe9,0x3d,0x00,0x18,0x81,0x29,0x00,0x30,0x79,0x29,0x84,0x02, 0x2c,0x09,0x00,0x29,0x40,0x82,0x00,0x58,0xe8,0x9c,0x00,0x10,0x78,0x85,0xc1,0xe4, 0x78,0xa5,0x46,0x20,0x2c,0x05,0x00,0xff,0x41,0x82,0x00,0x18,0x60,0x84,0x00,0x03, 0xf8,0x9c,0x00,0x10,0x38,0x60,0x00,0x06,0x90,0x7e,0x00,0x00,0x48,0x00,0x00,0x14, 0x60,0x84,0x00,0x02,0xf8,0x9c,0x00,0x10,0x38,0x60,0x00,0x2c,0x90,0x7e,0x00,0x00, 0x80,0xbc,0x00,0x04,0xe8,0x9c,0x00,0x08,0xe8,0x7b,0x00,0x00,0x7d,0x23,0x2a,0x14, 0xf9,0x3b,0x00,0x00,0x4b,0x87,0xcc,0x51,0x48,0x00,0x00,0xec,0x7f,0xa3,0xeb,0x78, 0x7f,0xc4,0xf3,0x78,0x4b,0x84,0xf4,0x41,0x7f,0xfd,0xfb,0x78,0x67,0xbd,0x00,0x7f, 0x63,0xbd,0xf8,0xe8,0x80,0x7d,0x00,0x00,0x80,0xbc,0x00,0x04,0x7c,0x63,0x2a,0x14, 0x90,0x7d,0x00,0x00,0xe8,0x9c,0x00,0x10,0x78,0x85,0xc1,0xe4,0x78,0xa5,0x46,0x20, 0x2c,0x05,0x00,0xff,0x40,0x82,0x00,0xb0,0xe8,0x7b,0x00,0x00,0x38,0x80,0x00,0x00, 0x38,0xc0,0x00,0x00,0x7c,0xe3,0x22,0x14,0x80,0xa7,0x00,0x00,0x7c,0xc6,0x2a,0x78, 0x38,0x84,0x00,0x04,0x28,0x24,0x04,0x00,0x40,0x82,0xff,0xec,0x80,0x7d,0x00,0x00, 0x78,0xc6,0x07,0xc6,0x7c,0xc6,0x1b,0x78,0x38,0x60,0x00,0x00,0x90,0x7d,0x00,0x00, 0x7f,0xe7,0xfb,0x78,0x64,0xe7,0x00,0x7f,0x60,0xe7,0xf7,0xd4,0xe8,0x67,0x00,0x00, 0x28,0x23,0x00,0x00,0x41,0x82,0x00,0x60,0x38,0xe7,0x00,0x10,0x7c,0x23,0x30,0x40, 0x40,0x82,0xff,0xec,0xe8,0xa7,0xff,0xf8,0xe8,0xfb,0x00,0x00,0x80,0x65,0x00,0x00, 0x28,0x03,0x00,0x00,0x41,0x82,0x00,0x40,0x28,0x03,0x00,0x01,0x41,0x82,0x00,0x20, 0x28,0x03,0x00,0x02,0x41,0x82,0x00,0x28,0x80,0x85,0x00,0x04,0x7c,0x63,0x3a,0x14, 0x90,0x83,0x00,0x00,0x38,0xa5,0x00,0x08,0x4b,0xff,0xff,0xd4,0x80,0x65,0x00,0x04, 0x7c,0xa5,0x1a,0x14,0x38,0xa5,0x00,0x08,0x4b,0xff,0xff,0xc4,0x38,0xa5,0x00,0x08, 0x4b,0xff,0xff,0xbc,0x38,0x60,0x00,0x00,0xeb,0x61,0x00,0x78,0xeb,0x81,0x00,0x80, 0xeb,0xa1,0x00,0x88,0xeb,0xc1,0x00,0x90,0xeb,0xe1,0x00,0x98,0xe8,0x01,0x01,0xb0, 0x38,0x21,0x01,0xa0,0x7c,0x08,0x03,0xa6,0x4e,0x80,0x00,0x20,0x7c,0x08,0x02,0xa6, 0xf8,0x21,0xff,0x61,0xfb,0x61,0x00,0x78,0xfb,0x81,0x00,0x80,0xfb,0xa1,0x00,0x88, 0xfb,0xc1,0x00,0x90,0xfb,0xe1,0x00,0x98,0xf8,0x01,0x00,0xb0,0x3b,0xe0,0x00,0x01, 0x7b,0xff,0xf8,0x06,0x67,0xfb,0x00,0x7f,0x63,0x7b,0xf8,0xf4,0x83,0x9b,0x00,0x00, 0x28,0x1c,0x00,0x00,0x41,0x82,0x00,0x6c,0x28,0x1c,0x00,0x08,0x40,0x80,0x00,0xb8, 0x28,0x23,0x00,0x01,0x40,0x82,0x00,0xb0,0x28,0x24,0x00,0x00,0x41,0x82,0x00,0x0c, 0x3b,0x9c,0x00,0x01,0x93,0x9b,0x00,0x00,0xeb,0x9b,0x00,0x08,0x7c,0x24,0xe0,0x40, 0x40,0x82,0x00,0x94,0x3b,0x80,0x00,0x01,0x93,0x9b,0x00,0x00,0x67,0xe4,0x00,0x2e, 0x60,0x84,0xb1,0x28,0xeb,0x9b,0x00,0x10,0xfb,0x84,0x00,0x30,0xeb,0x9b,0x00,0x18, 0xfb,0x84,0x00,0x38,0x67,0xfc,0x00,0x7f,0x63,0x9c,0xf0,0x10,0xfb,0x84,0x01,0x20, 0x3b,0x80,0x00,0x00,0x93,0x9b,0x00,0x00,0x38,0x60,0x01,0x00,0x48,0x00,0x00,0x34, 0x70,0x63,0x00,0xff,0x28,0x23,0x00,0x0a,0x40,0x80,0x00,0x58,0x67,0xfb,0x00,0x7f, 0x63,0x7b,0xf9,0x44,0x78,0x7c,0x1f,0x24,0x7f,0x7b,0xe2,0x14,0xeb,0xbb,0x00,0x00, 0x7c,0x83,0x23,0x78,0x7c,0xa4,0x2b,0x78,0x7c,0xc5,0x33,0x78,0x48,0x00,0x00,0x3d, 0xeb,0x61,0x00,0x78,0xeb,0x81,0x00,0x80,0xeb,0xa1,0x00,0x88,0xeb,0xc1,0x00,0x90, 0xeb,0xe1,0x00,0x98,0xe8,0x01,0x00,0xb0,0x38,0x21,0x00,0xa0,0x7c,0x08,0x03,0xa6, 0x4e,0x80,0x00,0x20,0x3c,0x60,0x80,0x01,0x60,0x63,0x00,0x03,0x4b,0xff,0xff,0xd4, 0x38,0x60,0xff,0xff,0x4b,0xff,0xff,0xcc,0x7f,0xa9,0x03,0xa6,0x4e,0x80,0x04,0x20, 0x67,0xfb,0x00,0x7f,0x63,0x7b,0xf8,0xf4,0xf8,0x7b,0x00,0x08,0x3b,0x80,0x00,0x01, 0x93,0x9b,0x00,0x00,0x67,0xe4,0x00,0x2e,0x60,0x84,0xb1,0x28,0xe8,0x64,0x01,0x28, 0xeb,0x84,0x00,0x30,0xf8,0x64,0x00,0x30,0xfb,0x9b,0x00,0x10,0xeb,0x84,0x00,0x38, 0xf8,0x64,0x00,0x38,0xfb,0x9b,0x00,0x18,0xf8,0x64,0x01,0x20,0x38,0x60,0x00,0x00, 0x4e,0x80,0x00,0x20,0x38,0x60,0x01,0x00,0x4e,0x80,0x00,0x20,0x4b,0x87,0xc9,0xd8, 0x4b,0x84,0xda,0xfc,0x7c,0x69,0x03,0xa6,0x7c,0x83,0x23,0x78,0x7c,0xa4,0x2b,0x78, 0x4e,0x80,0x04,0x20,0x4b,0x86,0x2a,0x2c,0x4b,0x86,0x2e,0x68,0x38,0x60,0x00,0x00, 0x39,0x60,0x00,0xff,0x44,0x00,0x00,0x22,0x67,0xfb,0x00,0x7f,0x63,0x7b,0xf9,0x14, 0x90,0x7b,0x00,0x00,0x38,0x60,0x00,0x00,0x4e,0x80,0x00,0x20,0x7c,0x64,0x1b,0x78, 0x67,0xfb,0x00,0x7f,0x63,0x7b,0xf8,0xec,0xe8,0x7b,0x00,0x00,0xf8,0x9b,0x00,0x00, 0x4e,0x80,0x00,0x20,0x39,0x20,0x00,0x01,0x79,0x29,0xf8,0x06,0x65,0x29,0x00,0x7f, 0x61,0x29,0xf9,0x14,0x80,0x09,0x00,0x00,0x28,0x00,0x00,0x01,0x41,0x82,0xf9,0x4c, 0x28,0x00,0x00,0x02,0x41,0x82,0xf9,0x4c,0xe9,0x22,0x96,0x88,0x7c,0x08,0x02,0xa6, 0x4b,0x85,0x0f,0x10,0x39,0x20,0x00,0x01,0x79,0x29,0xf8,0x06,0x65,0x29,0x00,0x7f, 0x61,0x29,0xf9,0x14,0x80,0x09,0x00,0x00,0x28,0x00,0x00,0x00,0x40,0x82,0xf9,0x1c, 0xe9,0x22,0x96,0x88,0x7c,0x08,0x02,0xa6,0x4b,0x85,0x0e,0xe8,0x3f,0xe0,0x00,0x01, 0x63,0xff,0x90,0x04,0x7c,0x1f,0x18,0x00,0x40,0x82,0x00,0x40,0x3b,0xa0,0x00,0x82, 0x9b,0xa4,0x00,0x03,0x3b,0xa0,0x00,0x09,0x9b,0xa4,0x00,0x05,0x3b,0xa0,0x00,0x01, 0x9b,0xa4,0x00,0x01,0x9b,0xa4,0x00,0x07,0xe8,0x01,0x00,0xc0,0xeb,0xa1,0x00,0x98, 0xeb,0xc1,0x00,0xa0,0x7c,0x08,0x03,0xa6,0xeb,0xe1,0x00,0xa8,0x38,0x21,0x00,0xb0, 0x38,0x60,0x00,0x00,0x4e,0x80,0x00,0x20,0x7c,0x7e,0x1b,0x78,0x4b,0xa7,0x48,0x58, 0x80,0x00,0x00,0x00,0x00,0x7f,0xf7,0x58,0x80,0x00,0x00,0x00,0x00,0x33,0xe7,0x20, 0xf8,0x21,0xff,0x81,0xfb,0xe1,0x00,0x78,0x7c,0x08,0x02,0xa6,0xf8,0x01,0x00,0x90, 0x3b,0xe0,0x00,0x01,0x7b,0xff,0xf8,0x06,0x38,0x63,0x00,0x20,0x67,0xe4,0x00,0x7f, 0x60,0x84,0xf8,0xe0,0xe8,0x84,0x00,0x00,0x38,0xa0,0x02,0xd0,0x4b,0x87,0xc8,0x99, 0x38,0x60,0x00,0x00,0xe8,0x01,0x00,0x90,0xeb,0xe1,0x00,0x78,0x7c,0x08,0x03,0xa6, 0x38,0x21,0x00,0x80,0x4e,0x80,0x00,0x20,0x80,0x00,0x00,0x00,0x00,0x7f,0xf7,0xb0, 0x80,0x00,0x00,0x00,0x00,0x33,0xe7,0x20,0x3c,0xa0,0x01,0x00,0x60,0xa5,0x03,0x00, 0x7c,0x03,0x28,0x00,0x40,0x82,0x00,0x14,0x3c,0xa0,0x00,0x35,0x90,0xa4,0x00,0x00, 0x38,0x60,0x00,0x00,0x4e,0x80,0x00,0x20,0x4b,0x81,0x8c,0xb8,0xa0,0x55,0x6f,0x3d, 0x00,0x2c,0xb8,0xfd,0x80,0x00,0x00,0x00,0x00,0x7f,0xf8,0x1c,0x8c,0x0a,0x94,0x8c, 0x00,0x0d,0x99,0xb1,0x80,0x00,0x00,0x00,0x00,0x7f,0xf8,0x64,0xa2,0xbc,0x1a,0x56, 0x00,0x05,0x2a,0xdc,0x80,0x00,0x00,0x00,0x00,0x7f,0xf8,0xa8,0x6b,0x70,0x28,0x02, 0x00,0x02,0x00,0x17,0x80,0x00,0x00,0x00,0x00,0x7f,0xf8,0x58,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x30,0x53,0x54,0x38,0x60,0x00,0x82,0x00,0x5f,0x3f,0xc0, 0x38,0x60,0x00,0x01,0x00,0x5f,0x3f,0xc4,0x4e,0x80,0x00,0x20,0x00,0x19,0x0c,0x90, 0x39,0x60,0x00,0x0a,0x00,0x19,0x0c,0x94,0x44,0x00,0x00,0x02,0x00,0x65,0xa1,0xf0, 0x34,0x36,0x31,0x33,0x00,0x65,0xa1,0xf4,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x02,0xee,0xf0,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x22,0xb8,0x88, 0x5f,0x74,0x6f,0x6f,0x00,0x22,0xb8,0x8c,0x6c,0x32,0x2e,0x78,0x00,0x22,0xb8,0x90, 0x6d,0x6c,0x23,0x72,0x00,0x22,0xb8,0x94,0x6f,0x6f,0x74,0x00,0x00,0x00,0x00,0x01, 0x00,0x00,0x00,0x18,0x00,0x23,0x67,0xe8,0x2f,0x64,0x65,0x76,0x00,0x23,0x67,0xec, 0x5f,0x62,0x64,0x76,0x00,0x23,0x67,0xf0,0x64,0x2f,0x50,0x53,0x00,0x00,0x00,0x00, 0x00,0x0d,0x68,0xb8,0x5f,0x74,0x6f,0x6f,0x00,0x0d,0x68,0xbc,0x6c,0x32,0x2e,0x78, 0x00,0x0d,0x68,0xc0,0x6d,0x6c,0x23,0x72,0x00,0x0d,0x68,0xc4,0x6f,0x6f,0x74,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, 0x2f,0x64,0x65,0x76,0x5f,0x62,0x64,0x76,0x64,0x00,0x6d,0x6f,0x64,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x2f,0x61,0x70,0x70,0x5f,0x68,0x6f,0x6d,0x65,0x00, 0x2f,0x64,0x65,0x76,0x5f,0x75,0x73,0x62,0x30,0x30,0x30,0x00,0x80,0x00,0x00,0x00, 0x00,0x7f,0xf5,0xf8,0x80,0x00,0x00,0x00,0x00,0x7f,0xf6,0x3c,0x80,0x00,0x00,0x00, 0x00,0x7f,0xf6,0x44,0x80,0x00,0x00,0x00,0x00,0x7f,0xf6,0x48,0x80,0x00,0x00,0x00, 0x00,0x7f,0xf6,0x4c,0x80,0x00,0x00,0x00,0x00,0x7f,0xf6,0x5c,0x80,0x00,0x00,0x00, 0x00,0x7f,0xf6,0x60,0x80,0x00,0x00,0x00,0x00,0x7f,0xf6,0x64,0x80,0x00,0x00,0x00, 0x00,0x7f,0xf6,0x70,0x80,0x00,0x00,0x00,0x00,0x7f,0xf6,0x84,0x80,0x00,0x00,0x00, 0x00,0x7f,0xf6,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //0x0F21 PORT2_CONFIG (0x0016) 0x09,0x02,0x16,0x00,0x01,0x01,0x00,0x80,0x01,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x04,0x21,0xB4,0x2F, //0x0F37 PORT3_CONFIG (0x0A4D) 0x09,0x02,0x4D,0x0A,0x01,0x01,0x00,0x80,0x01,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, 0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00, 0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, 0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04, 0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01, 0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09, 0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE, 0x00,0xFE,0x01,0x02,0x00,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02, //0x1984 PORT4_CONFIG_1 (0x0012) 0x09,0x02,0x12,0x00,0x01,0x01,0x00,0x80,0x01,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, //0x1996 PORT4_SHORT_CONFIG_2 (0x0008) 0x09,0x02,0x12,0x00,0x01,0x01,0x00,0x80, //0x199E PORT4_CONFIG_2 (0x0012) 0x09,0x02,0x00,0x00,0x01,0x01,0x00,0x80,0x01,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, //0x19B0 PORT4_CONFIG_3 (0x0030) 0x09,0x02,0x30,0x00,0x01,0x01,0x00,0x80,0x01,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00,0x3E,0x21,0x00,0x00,0x00,0x00,0xFA,0xCE,0xB0,0x03,0xAA,0xBB,0xCC,0xDD, 0x80,0x00,0x00,0x00,0x00,0x46,0x50,0x00,0x80,0x00,0x00,0x00,0x00,0x3D,0xEE,0x70, //0x19E0 PORT5_CONFIG (0x0020) 0x09,0x02,0x20,0x00,0x01,0x00,0x00,0x80,0x01,0x09,0x04,0x00,0x00,0x02,0xFF,0x00,0x00,0x00,0x07,0x05,0x02,0x02,0x08,0x00,0x00,0x07,0x05,0x81,0x02,0x08,0x00,0x00, //0x1A00 PORT6_CONFIG (0x0012) 0x09,0x02,0x12,0x00,0x01,0x01,0x00,0x80,0x01,0x09,0x04,0x00,0x00,0x00,0xFE,0x01,0x02,0x00, }; const unsigned int8 jig_response[64] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x3d, 0xee, 0x78, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3d, 0xee, 0x88, 0x80, 0x00, 0x00, 0x00, 0x00, 0x33, 0xe7, 0x20, 0xe8, 0x83, 0xff, 0xf0, 0xe8, 0x63, 0xff, 0xf8, 0xe8, 0xa3, 0x00, 0x18, 0x38, 0x63, 0x10, 0x00, 0x7c, 0x04, 0x28, 0x00, 0x40, 0x82, 0xff, 0xf4, 0x38, 0xc3, 0xf0, 0x20, 0x7c, 0xc9, 0x03, 0xa6, 0x4e, 0x80, 0x04, 0x20, 0x04, 0x00, 0x00, 0x00, }; #define HUB_DEVICE_OFFSET 0x0000 #define HUB_DEVICE_SIZE 0x0012 #define HUB_HUB_DEVICE_OFFSET 0x0012 #define HUB_HUB_DEVICE_SIZE 0x0009 #define PORT1_DEVICE_OFFSET 0x001B #define PORT1_DEVICE_SIZE 0x0012 #define PORT2_DEVICE_OFFSET 0x002D #define PORT2_DEVICE_SIZE 0x0012 #define PORT3_DEVICE_OFFSET 0x003F #define PORT3_DEVICE_SIZE 0x0012 #define PORT4_DEVICE_OFFSET 0x0051 #define PORT4_DEVICE_SIZE 0x0012 #define PORT5_DEVICE_OFFSET 0x0063 #define PORT5_DEVICE_SIZE 0x0012 #define PORT6_DEVICE_OFFSET 0x0075 #define PORT6_DEVICE_SIZE 0x0012 #define HUB_CONFIG_OFFSET 0x0000 #define HUB_CONFIG_SIZE 0x0019 #define PORT1_SHORT_CONFIG_OFFSET 0x0019 #define PORT1_SHORT_CONFIG_SIZE 0x0008 #define PORT1_CONFIG_OFFSET 0x0021 #define PORT1_CONFIG_SIZE 0x0F00 #define PORT2_CONFIG_OFFSET 0x0F21 #define PORT2_CONFIG_SIZE 0x0016 #define PORT3_CONFIG_OFFSET 0x0F37 #define PORT3_CONFIG_SIZE 0x0A4D #define PORT4_CONFIG_1_OFFSET 0x1984 #define PORT4_CONFIG_1_SIZE 0x0012 #define PORT4_SHORT_CONFIG_2_OFFSET 0x1996 #define PORT4_SHORT_CONFIG_2_SIZE 0x0008 #define PORT4_CONFIG_2_OFFSET 0x199E #define PORT4_CONFIG_2_SIZE 0x0012 #define PORT4_CONFIG_3_OFFSET 0x19B0 #define PORT4_CONFIG_3_SIZE 0x0030 #define PORT5_CONFIG_OFFSET 0x19E0 #define PORT5_CONFIG_SIZE 0x0020 #define PORT6_CONFIG_OFFSET 0x1A00 #define PORT6_CONFIG_SIZE 0x0012
91.169082
164
0.776521
[ "model" ]
01bf73370b496333c1c1f9da7c933dd65dd18f27
578
h
C
ftp_client/FrontEnd.h
wxk6b1203/ftp_exercise
a17ea519d1725b2c3f6b5454fda889604593138f
[ "MIT" ]
null
null
null
ftp_client/FrontEnd.h
wxk6b1203/ftp_exercise
a17ea519d1725b2c3f6b5454fda889604593138f
[ "MIT" ]
null
null
null
ftp_client/FrontEnd.h
wxk6b1203/ftp_exercise
a17ea519d1725b2c3f6b5454fda889604593138f
[ "MIT" ]
null
null
null
#include "Connector.h" #include "header.h" #pragma once class FrontEnd final { private: FrontEnd(); ~FrontEnd(); FrontEnd(FrontEnd const&); FrontEnd& operator=(FrontEnd const&) = delete; string pwd; map<string, string> helpMsg; vector<Connector> connections; map<string, std::function<int(vector<string>)> > command; bool linked; bool loggedin; void importCommandTable(); void cmdRegister(); public: static FrontEnd& Impl() { static FrontEnd f; return f; } void Start(); }; typedef FrontEnd f;
20.642857
61
0.634948
[ "vector" ]
01c09063f08b22ba45071231a0b14d3d85e69144
1,684
h
C
gcrSelectRootData/GcrSelect.h
fermi-lat/gcrSelectRootData
ce168c9b859e856f97d503b0b6f04762230f877e
[ "BSD-3-Clause" ]
null
null
null
gcrSelectRootData/GcrSelect.h
fermi-lat/gcrSelectRootData
ce168c9b859e856f97d503b0b6f04762230f877e
[ "BSD-3-Clause" ]
null
null
null
gcrSelectRootData/GcrSelect.h
fermi-lat/gcrSelectRootData
ce168c9b859e856f97d503b0b6f04762230f877e
[ "BSD-3-Clause" ]
null
null
null
#ifndef ROOT_GCRSELECT_H #define ROOT_GCRSELECT_H #include "TObject.h" #include "TClonesArray.h" #include "GcrSelectedXtal.h" #include "GcrSelectVals.h" /** @class GcrSelect * @brief Primary Root object containing GcrSelect data. * * * $Header$ */ /** @page gcrSelectRootData_doc @section GcrSelect GcrSelect Documentation <table> <tr> <th>Method</th><th>Description</th><th>Return Value</th> </tr> <small> <tr> <td>getGcrSelectedXtalCol( )</td><td>Returns the collection of hits selected for calibration</td><td>TClonesArray* of SelectedXtals</td> </tr><tr> <td>getGcrSelectVals( )</td><td>Returns a set of variables characterizing the event</td><td>GcrSelectVals*</td> </tr> </small> </table> */ class GcrSelect : public TObject { public: GcrSelect(); virtual ~GcrSelect(); void initialize(); void Clear(Option_t *option=""); void Fake( Int_t ievent, Float_t randNum ) ; // for tests Bool_t CompareInRange( const GcrSelect &, const std::string & name = "" ) const; // for tests void Print(Option_t *option="") const; const TClonesArray* getGcrSelectedXtalCol() const { return m_gcrSelectedXtalCol; }; const GcrSelectVals* getGcrSelectVals() const { return m_gcrSelectVals; }; /// C.L. 08/22/06: //void addGcrSelectedXtal(GcrSelectedXtal* gcrSelectedXtal){ m_gcrSelectedXtalCol->Add(gcrSelectedXtal); }; GcrSelectedXtal* addGcrSelectedXtal(); void addGcrSelectVals(GcrSelectVals* gcrSelectVals){ m_gcrSelectVals= gcrSelectVals; }; private: Int_t m_indGcrSelectXtal; TClonesArray* m_gcrSelectedXtalCol; GcrSelectVals* m_gcrSelectVals; ClassDef(GcrSelect,6) }; #endif
22.453333
136
0.707838
[ "object" ]
01dd7990fa1d3489af2a7c3f08ebb00e366c6ea5
1,044
h
C
src/measurement/SilhouetteValue.h
mironec/yoshiko
5fe02c9f0be3462959b334e1197ca9e6ea27345d
[ "MIT" ]
4
2017-04-13T02:11:15.000Z
2021-11-29T18:04:16.000Z
src/measurement/SilhouetteValue.h
mironec/yoshiko
5fe02c9f0be3462959b334e1197ca9e6ea27345d
[ "MIT" ]
27
2018-01-15T08:37:38.000Z
2018-04-26T13:01:58.000Z
src/measurement/SilhouetteValue.h
mironec/yoshiko
5fe02c9f0be3462959b334e1197ca9e6ea27345d
[ "MIT" ]
3
2017-07-24T13:13:28.000Z
2019-04-10T19:09:56.000Z
#ifndef SRC_MEASUREMENT_SILHOUETTEVALUE_H_ #define SRC_MEASUREMENT_SILHOUETTEVALUE_H_ #include "ClusterEditingInstance.h" #include <lemon/full_graph.h> #include <lemon/adaptors.h> #include <lemon/connectivity.h> namespace ysk{ /** * Implementation of the Silhouette Value as described in * Peter J. Rousseeuw. “Silhouettes: A graphical aid to the interpretation and validation of cluster analysis”. * In: Journal of Computational and Applied Mathematics * 20.Supplement C (1987), pp. 53–65. * issn: 0377-0427. * doi: https://doi.org/10.1016/0377-0427(87)90125-7 * url: http://www.sciencedirect.com/science/article/pii/0377042787901257 */ class SilhouetteValue { public: SilhouetteValue(ClusterEditingInstance* instance,std::vector<std::vector<int>>& solution): _instance(instance), _solution(solution) {}; virtual ~SilhouetteValue(); double getValue(); private: ClusterEditingInstance* _instance; std::vector<std::vector<int>> _solution; }; } #endif /* SRC_MEASUREMENT_SILHOUETTEVALUE_H_ */
27.473684
113
0.745211
[ "vector" ]