text:
from PySide import QtCore, QtGui

class Ui_mainwindow(object):
    def setupUi(self, mainwindow):
        mainwindow.setObjectName("mainwindow")
        mainwindow.resize(680, 364)
        mainwindow.setDockNestingEnabled(True)
        self.centralwidget = QtGui.QWidget(mainwindow)
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName("horizontalLayout")
        mainwindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(mainwindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 680, 25))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtGui.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        self.openOntology = QtGui.QMenu(self.menuFile)
        self.openOntology.setToolTip("")
        self.openOntology.setStatusTip("")
        self.openOntology.setWhatsThis("")
        self.openOntology.setAccessibleName("")
        self.openOntology.setAccessibleDescription("")
        self.openOntology.setTitle("Open")
        self.openOntology.setObjectName("openOntology")
        self.menuRecent_Ontologies = QtGui.QMenu(self.menuFile)
        self.menuRecent_Ontologies.setObjectName("menuRecent_Ontologies")
        self.menuEdit = QtGui.QMenu(self.menubar)
        self.menuEdit.setObjectName("menuEdit")
        self.menuView = QtGui.QMenu(self.menubar)
        self.menuView.setObjectName("menuView")
        self.menuToolbar = QtGui.QMenu(self.menuView)
        self.menuToolbar.setObjectName("menuToolbar")
        self.menuAdd = QtGui.QMenu(self.menuView)
        self.menuAdd.setObjectName("menuAdd")
        self.menuTextEditorWidgets = QtGui.QMenu(self.menuView)
        self.menuTextEditorWidgets.setEnabled(False)
        self.menuTextEditorWidgets.setObjectName("menuTextEditorWidgets")
        self.menuDocumentationWidgets = QtGui.QMenu(self.menuView)
        self.menuDocumentationWidgets.setEnabled(False)
        self.menuDocumentationWidgets.setObjectName("menuDocumentationWidgets")
        self.menuHierarchyWidgets = QtGui.QMenu(self.menuView)
        self.menuHierarchyWidgets.setEnabled(False)
        self.menuHierarchyWidgets.setObjectName("menuHierarchyWidgets")
        self.menuDelete = QtGui.QMenu(self.menuView)
        self.menuDelete.setEnabled(False)
        self.menuDelete.setObjectName("menuDelete")
        self.menuGraphWidgets = QtGui.QMenu(self.menuView)
        self.menuGraphWidgets.setEnabled(False)
        self.menuGraphWidgets.setObjectName("menuGraphWidgets")
        self.menuTools = QtGui.QMenu(self.menubar)
        self.menuTools.setObjectName("menuTools")
        self.menuHelp = QtGui.QMenu(self.menubar)
        self.menuHelp.setObjectName("menuHelp")
        self.menuOntology = QtGui.QMenu(self.menubar)
        self.menuOntology.setObjectName("menuOntology")
        mainwindow.setMenuBar(self.menubar)
        self.toolBarFile = QtGui.QToolBar(mainwindow)
        self.toolBarFile.setObjectName("toolBarFile")
        mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBarFile)
        self.toolBarEdit = QtGui.QToolBar(mainwindow)
        self.toolBarEdit.setObjectName("toolBarEdit")
        mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBarEdit)
        self.toolBarOntology = QtGui.QToolBar(mainwindow)
        self.toolBarOntology.setObjectName("toolBarOntology")
        mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBarOntology)
        self.toolBarTools = QtGui.QToolBar(mainwindow)
        self.toolBarTools.setObjectName("toolBarTools")
        mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBarTools)
        self.toolBarHelp = QtGui.QToolBar(mainwindow)
        self.toolBarHelp.setObjectName("toolBarHelp")
        mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBarHelp)
        self.statusBar = QtGui.QStatusBar(mainwindow)
        self.statusBar.setObjectName("statusBar")
        mainwindow.setStatusBar(self.statusBar)
        self.newOntologyAction = QtGui.QAction(mainwindow)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/document-new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.newOntologyAction.setIcon(icon)
        self.newOntologyAction.setText("New Ontology")
        self.newOntologyAction.setIconText("New Ontology")
        self.newOntologyAction.setToolTip("New Ontology")
        self.newOntologyAction.setStatusTip("")
        self.newOntologyAction.setWhatsThis("")
        self.newOntologyAction.setShortcut("Ctrl+N")
        self.newOntologyAction.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.newOntologyAction.setIconVisibleInMenu(True)
        self.newOntologyAction.setObjectName("newOntologyAction")
        self.openLocalOntologyAction = QtGui.QAction(mainwindow)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/document-open.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.openLocalOntologyAction.setIcon(icon1)
        self.openLocalOntologyAction.setIconVisibleInMenu(True)
        self.openLocalOntologyAction.setObjectName("openLocalOntologyAction")
        self.openRemoteOntologyAction = QtGui.QAction(mainwindow)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/document-open-remote.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.openRemoteOntologyAction.setIcon(icon2)
        self.openRemoteOntologyAction.setText("Remote Ontology")
        self.openRemoteOntologyAction.setIconText("Remote Ontology")
        self.openRemoteOntologyAction.setToolTip("Remote Ontology")
        self.openRemoteOntologyAction.setStatusTip("")
        self.openRemoteOntologyAction.setWhatsThis("")
        self.openRemoteOntologyAction.setShortcut("Ctrl+R")
        self.openRemoteOntologyAction.setMenuRole(QtGui.QAction.ApplicationSpecificRole)
        self.openRemoteOntologyAction.setIconVisibleInMenu(True)
        self.openRemoteOntologyAction.setObjectName("openRemoteOntologyAction")
        self.clearHistoryAction = QtGui.QAction(mainwindow)
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-clear-history.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.clearHistoryAction.setIcon(icon3)
        self.clearHistoryAction.setIconVisibleInMenu(True)
        self.clearHistoryAction.setObjectName("clearHistoryAction")
        self.actionSave = QtGui.QAction(mainwindow)
        icon4 = QtGui.QIcon()
        icon4.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/document-save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionSave.setIcon(icon4)
        self.actionSave.setIconVisibleInMenu(True)
        self.actionSave.setObjectName("actionSave")
        self.actionSaveAs = QtGui.QAction(mainwindow)
        icon5 = QtGui.QIcon()
        icon5.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/document-save-as.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionSaveAs.setIcon(icon5)
        self.actionSaveAs.setIconVisibleInMenu(True)
        self.actionSaveAs.setObjectName("actionSaveAs")
        self.actionPrint = QtGui.QAction(mainwindow)
        icon6 = QtGui.QIcon()
        icon6.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/document-print.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionPrint.setIcon(icon6)
        self.actionPrint.setIconVisibleInMenu(True)
        self.actionPrint.setObjectName("actionPrint")
        self.actionExit = QtGui.QAction(mainwindow)
        icon7 = QtGui.QIcon()
        icon7.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/application-exit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionExit.setIcon(icon7)
        self.actionExit.setMenuRole(QtGui.QAction.QuitRole)
        self.actionExit.setIconVisibleInMenu(True)
        self.actionExit.setObjectName("actionExit")
        self.actionQuickPrint = QtGui.QAction(mainwindow)
        icon8 = QtGui.QIcon()
        icon8.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/document-quickprint.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionQuickPrint.setIcon(icon8)
        self.actionQuickPrint.setIconVisibleInMenu(True)
        self.actionQuickPrint.setObjectName("actionQuickPrint")
        self.actionUndo = QtGui.QAction(mainwindow)
        icon9 = QtGui.QIcon()
        icon9.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-undo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionUndo.setIcon(icon9)
        self.actionUndo.setIconVisibleInMenu(True)
        self.actionUndo.setObjectName("actionUndo")
        self.actionRedo = QtGui.QAction(mainwindow)
        icon10 = QtGui.QIcon()
        icon10.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-redo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionRedo.setIcon(icon10)
        self.actionRedo.setIconVisibleInMenu(True)
        self.actionRedo.setObjectName("actionRedo")
        self.actionCut = QtGui.QAction(mainwindow)
        icon11 = QtGui.QIcon()
        icon11.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-cut.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionCut.setIcon(icon11)
        self.actionCut.setIconVisibleInMenu(True)
        self.actionCut.setObjectName("actionCut")
        self.actionCopy = QtGui.QAction(mainwindow)
        icon12 = QtGui.QIcon()
        icon12.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-copy.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionCopy.setIcon(icon12)
        self.actionCopy.setIconVisibleInMenu(True)
        self.actionCopy.setObjectName("actionCopy")
        self.actionPaste = QtGui.QAction(mainwindow)
        icon13 = QtGui.QIcon()
        icon13.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-paste.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionPaste.setIcon(icon13)
        self.actionPaste.setIconVisibleInMenu(True)
        self.actionPaste.setObjectName("actionPaste")
        self.actionDelete = QtGui.QAction(mainwindow)
        icon14 = QtGui.QIcon()
        icon14.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-delete.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionDelete.setIcon(icon14)
        self.actionDelete.setIconVisibleInMenu(True)
        self.actionDelete.setObjectName("actionDelete")
        self.actionSelectAll = QtGui.QAction(mainwindow)
        icon15 = QtGui.QIcon()
        icon15.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-select-all.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionSelectAll.setIcon(icon15)
        self.actionSelectAll.setIconVisibleInMenu(True)
        self.actionSelectAll.setObjectName("actionSelectAll")
        self.actionPySUMOHelp = QtGui.QAction(mainwindow)
        icon16 = QtGui.QIcon()
        icon16.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/help-contents.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionPySUMOHelp.setIcon(icon16)
        self.actionPySUMOHelp.setIconVisibleInMenu(True)
        self.actionPySUMOHelp.setObjectName("actionPySUMOHelp")
        self.actionPySUMOTutorials = QtGui.QAction(mainwindow)
        icon17 = QtGui.QIcon()
        icon17.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/help-hint.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionPySUMOTutorials.setIcon(icon17)
        self.actionPySUMOTutorials.setIconVisibleInMenu(True)
        self.actionPySUMOTutorials.setObjectName("actionPySUMOTutorials")
        self.actionFAQ = QtGui.QAction(mainwindow)
        icon18 = QtGui.QIcon()
        icon18.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/help-faq.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionFAQ.setIcon(icon18)
        self.actionFAQ.setIconVisibleInMenu(True)
        self.actionFAQ.setObjectName("actionFAQ")
        self.actionAboutSUMO = QtGui.QAction(mainwindow)
        self.actionAboutSUMO.setObjectName("actionAboutSUMO")
        self.actionAboutSUOKIF = QtGui.QAction(mainwindow)
        self.actionAboutSUOKIF.setObjectName("actionAboutSUOKIF")
        self.actionAboutpySUMO = QtGui.QAction(mainwindow)
        icon19 = QtGui.QIcon()
        icon19.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/help-about.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionAboutpySUMO.setIcon(icon19)
        self.actionAboutpySUMO.setIconVisibleInMenu(True)
        self.actionAboutpySUMO.setObjectName("actionAboutpySUMO")
        self.actionSettings = QtGui.QAction(mainwindow)
        icon20 = QtGui.QIcon()
        icon20.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/configure.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionSettings.setIcon(icon20)
        self.actionSettings.setIconVisibleInMenu(True)
        self.actionSettings.setObjectName("actionSettings")
        self.actionHierarchyWidget = QtGui.QAction(mainwindow)
        self.actionHierarchyWidget.setCheckable(False)
        self.actionHierarchyWidget.setChecked(False)
        self.actionHierarchyWidget.setEnabled(True)
        self.actionHierarchyWidget.setObjectName("actionHierarchyWidget")
        self.actionDocumentationWidget = QtGui.QAction(mainwindow)
        self.actionDocumentationWidget.setCheckable(False)
        self.actionDocumentationWidget.setChecked(False)
        self.actionDocumentationWidget.setObjectName("actionDocumentationWidget")
        self.actionGraphWidget = QtGui.QAction(mainwindow)
        self.actionGraphWidget.setCheckable(False)
        self.actionGraphWidget.setChecked(False)
        self.actionGraphWidget.setObjectName("actionGraphWidget")
        self.actionTextEditorWidget = QtGui.QAction(mainwindow)
        self.actionTextEditorWidget.setCheckable(False)
        self.actionTextEditorWidget.setEnabled(True)
        self.actionTextEditorWidget.setVisible(True)
        self.actionTextEditorWidget.setObjectName("actionTextEditorWidget")
        self.actionZoomIn = QtGui.QAction(mainwindow)
        icon21 = QtGui.QIcon()
        icon21.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/zoom-in.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionZoomIn.setIcon(icon21)
        self.actionZoomIn.setIconVisibleInMenu(True)
        self.actionZoomIn.setObjectName("actionZoomIn")
        self.actionZoomOut = QtGui.QAction(mainwindow)
        icon22 = QtGui.QIcon()
        icon22.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/zoom-out.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionZoomOut.setIcon(icon22)
        self.actionZoomOut.setIconVisibleInMenu(True)
        self.actionZoomOut.setObjectName("actionZoomOut")
        self.actionFile = QtGui.QAction(mainwindow)
        self.actionFile.setCheckable(True)
        self.actionFile.setChecked(True)
        self.actionFile.setObjectName("actionFile")
        self.actionEdit = QtGui.QAction(mainwindow)
        self.actionEdit.setCheckable(True)
        self.actionEdit.setChecked(True)
        self.actionEdit.setObjectName("actionEdit")
        self.actionTools = QtGui.QAction(mainwindow)
        self.actionTools.setCheckable(True)
        self.actionTools.setChecked(True)
        self.actionTools.setObjectName("actionTools")
        self.actionHelp = QtGui.QAction(mainwindow)
        self.actionHelp.setCheckable(True)
        self.actionHelp.setChecked(True)
        self.actionHelp.setObjectName("actionHelp")
        self.actionConfigureToollbars = QtGui.QAction(mainwindow)
        self.actionConfigureToollbars.setObjectName("actionConfigureToollbars")
        self.actionAddTerms = QtGui.QAction(mainwindow)
        icon23 = QtGui.QIcon()
        icon23.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/list-add.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionAddTerms.setIcon(icon23)
        self.actionAddTerms.setIconVisibleInMenu(True)
        self.actionAddTerms.setObjectName("actionAddTerms")
        self.actionRemoveTerms = QtGui.QAction(mainwindow)
        icon24 = QtGui.QIcon()
        icon24.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/list-remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionRemoveTerms.setIcon(icon24)
        self.actionRemoveTerms.setIconVisibleInMenu(True)
        self.actionRemoveTerms.setObjectName("actionRemoveTerms")
        self.actionFind = QtGui.QAction(mainwindow)
        icon25 = QtGui.QIcon()
        icon25.addPixmap(QtGui.QPixmap(":/actions/gfx/actions/edit-find.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionFind.setIcon(icon25)
        self.actionFind.setIconVisibleInMenu(True)
        self.actionFind.setObjectName("actionFind")
        self.actionOntology = QtGui.QAction(mainwindow)
        self.actionOntology.setCheckable(True)
        self.actionOntology.setChecked(True)
        self.actionOntology.setObjectName("actionOntology")
        self.actionStatusbar = QtGui.QAction(mainwindow)
        self.actionStatusbar.setCheckable(True)
        self.actionStatusbar.setChecked(True)
        self.actionStatusbar.setObjectName("actionStatusbar")
        self.actionExpand = QtGui.QAction(mainwindow)
        self.actionExpand.setObjectName("actionExpand")
        self.actionCollapse = QtGui.QAction(mainwindow)
        self.actionCollapse.setObjectName("actionCollapse")
        self.actionActive_Ontologies = QtGui.QAction(mainwindow)
        self.actionActive_Ontologies.setEnabled(False)
        self.actionActive_Ontologies.setObjectName("actionActive_Ontologies")
        self.actionPrintPreview = QtGui.QAction(mainwindow)
        icon26 = QtGui.QIcon()
        icon26.addPixmap(QtGui.QPixmap(":/actions/gfx/document-print-preview.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionPrintPreview.setIcon(icon26)
        self.actionPrintPreview.setIconVisibleInMenu(True)
        self.actionPrintPreview.setObjectName("actionPrintPreview")
        self.openOntology.addAction(self.openLocalOntologyAction)
        self.openOntology.addSeparator()
        self.openOntology.addAction(self.openRemoteOntologyAction)
        self.menuRecent_Ontologies.addSeparator()
        self.menuRecent_Ontologies.addAction(self.clearHistoryAction)
        self.menuFile.addAction(self.newOntologyAction)
        self.menuFile.addAction(self.openOntology.menuAction())
        self.menuFile.addAction(self.menuRecent_Ontologies.menuAction())
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionSave)
        self.menuFile.addAction(self.actionSaveAs)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionPrint)
        self.menuFile.addAction(self.actionPrintPreview)
        self.menuFile.addAction(self.actionQuickPrint)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionExit)
        self.menuEdit.addAction(self.actionUndo)
        self.menuEdit.addAction(self.actionRedo)
        self.menuEdit.addSeparator()
        self.menuEdit.addAction(self.actionCut)
        self.menuEdit.addAction(self.actionCopy)
        self.menuEdit.addAction(self.actionPaste)
        self.menuEdit.addSeparator()
        self.menuEdit.addAction(self.actionDelete)
        self.menuEdit.addAction(self.actionSelectAll)
        self.menuEdit.addSeparator()
        self.menuEdit.addAction(self.actionFind)
        self.menuToolbar.addAction(self.actionFile)
        self.menuToolbar.addAction(self.actionEdit)
        self.menuToolbar.addAction(self.actionOntology)
        self.menuToolbar.addAction(self.actionTools)
        self.menuToolbar.addAction(self.actionHelp)
        self.menuToolbar.addSeparator()
        self.menuToolbar.addAction(self.actionConfigureToollbars)
        self.menuAdd.addAction(self.actionTextEditorWidget)
        self.menuAdd.addAction(self.actionHierarchyWidget)
        self.menuAdd.addAction(self.actionGraphWidget)
        self.menuAdd.addAction(self.actionDocumentationWidget)
        self.menuView.addAction(self.menuAdd.menuAction())
        self.menuView.addAction(self.menuTextEditorWidgets.menuAction())
        self.menuView.addAction(self.menuDocumentationWidgets.menuAction())
        self.menuView.addAction(self.menuHierarchyWidgets.menuAction())
        self.menuView.addAction(self.menuGraphWidgets.menuAction())
        self.menuView.addAction(self.menuDelete.menuAction())
        self.menuView.addSeparator()
        self.menuView.addAction(self.actionExpand)
        self.menuView.addAction(self.actionCollapse)
        self.menuView.addSeparator()
        self.menuView.addAction(self.actionZoomIn)
        self.menuView.addAction(self.actionZoomOut)
        self.menuView.addSeparator()
        self.menuView.addAction(self.menuToolbar.menuAction())
        self.menuView.addAction(self.actionStatusbar)
        self.menuTools.addAction(self.actionSettings)
        self.menuHelp.addAction(self.actionPySUMOHelp)
        self.menuHelp.addAction(self.actionPySUMOTutorials)
        self.menuHelp.addSeparator()
        self.menuHelp.addAction(self.actionFAQ)
        self.menuHelp.addSeparator()
        self.menuHelp.addAction(self.actionAboutSUMO)
        self.menuHelp.addAction(self.actionAboutSUOKIF)
        self.menuHelp.addAction(self.actionAboutpySUMO)
        self.menuOntology.addAction(self.actionAddTerms)
        self.menuOntology.addAction(self.actionRemoveTerms)
        self.menuOntology.addSeparator()
        self.menuOntology.addAction(self.actionActive_Ontologies)
        self.menubar.addAction(self.menuFile.menuAction())
        self.menubar.addAction(self.menuEdit.menuAction())
        self.menubar.addAction(self.menuOntology.menuAction())
        self.menubar.addAction(self.menuView.menuAction())
        self.menubar.addAction(self.menuTools.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())
        self.toolBarFile.addAction(self.newOntologyAction)
        self.toolBarFile.addAction(self.openLocalOntologyAction)
        self.toolBarFile.addAction(self.openRemoteOntologyAction)
        self.toolBarFile.addSeparator()
        self.toolBarFile.addAction(self.actionSave)
        self.toolBarFile.addAction(self.actionPrint)
        self.toolBarEdit.addAction(self.actionUndo)
        self.toolBarEdit.addAction(self.actionRedo)
        self.toolBarEdit.addSeparator()
        self.toolBarEdit.addAction(self.actionCut)
        self.toolBarEdit.addAction(self.actionCopy)
        self.toolBarEdit.addAction(self.actionPaste)
        self.toolBarOntology.addAction(self.actionAddTerms)
        self.toolBarOntology.addAction(self.actionRemoveTerms)
        self.toolBarTools.addAction(self.actionSettings)
        self.toolBarHelp.addAction(self.actionPySUMOHelp)
        self.toolBarHelp.addAction(self.actionPySUMOTutorials)

        self.retranslateUi(mainwindow)
        QtCore.QObject.connect(self.actionFile, QtCore.SIGNAL("triggered(bool)"), self.toolBarFile.setVisible)
        QtCore.QObject.connect(self.actionEdit, QtCore.SIGNAL("triggered(bool)"), self.toolBarEdit.setVisible)
        QtCore.QObject.connect(self.actionOntology, QtCore.SIGNAL("triggered(bool)"), self.toolBarOntology.setVisible)
        QtCore.QObject.connect(self.actionTools, QtCore.SIGNAL("triggered(bool)"), self.toolBarTools.setVisible)
        QtCore.QObject.connect(self.actionHelp, QtCore.SIGNAL("triggered(bool)"), self.toolBarHelp.setVisible)
        QtCore.QObject.connect(self.actionStatusbar, QtCore.SIGNAL("triggered(bool)"), self.statusBar.setVisible)
        QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("triggered()"), mainwindow.close)
        QtCore.QMetaObject.connectSlotsByName(mainwindow)

    def retranslateUi(self, mainwindow):
        mainwindow.setWindowTitle(QtGui.QApplication.translate("mainwindow", "pySUMO", None, QtGui.QApplication.UnicodeUTF8))
        self.menuFile.setTitle(QtGui.QApplication.translate("mainwindow", "File", None, QtGui.QApplication.UnicodeUTF8))
        self.menuRecent_Ontologies.setTitle(QtGui.QApplication.translate("mainwindow", "Recent Ontologies", None, QtGui.QApplication.UnicodeUTF8))
        self.menuEdit.setTitle(QtGui.QApplication.translate("mainwindow", "Edit", None, QtGui.QApplication.UnicodeUTF8))
        self.menuView.setTitle(QtGui.QApplication.translate("mainwindow", "View", None, QtGui.QApplication.UnicodeUTF8))
        self.menuToolbar.setTitle(QtGui.QApplication.translate("mainwindow", "Toolbar", None, QtGui.QApplication.UnicodeUTF8))
        self.menuAdd.setTitle(QtGui.QApplication.translate("mainwindow", "Add", None, QtGui.QApplication.UnicodeUTF8))
        self.menuTextEditorWidgets.setTitle(QtGui.QApplication.translate("mainwindow", "Text Editor Widgets", None, QtGui.QApplication.UnicodeUTF8))
        self.menuDocumentationWidgets.setTitle(QtGui.QApplication.translate("mainwindow", "Documentation Widgets", None, QtGui.QApplication.UnicodeUTF8))
        self.menuHierarchyWidgets.setTitle(QtGui.QApplication.translate("mainwindow", "Hierarchy Widgets", None, QtGui.QApplication.UnicodeUTF8))
        self.menuDelete.setTitle(QtGui.QApplication.translate("mainwindow", "Delete", None, QtGui.QApplication.UnicodeUTF8))
        self.menuGraphWidgets.setTitle(QtGui.QApplication.translate("mainwindow", "Graph Widgets", None, QtGui.QApplication.UnicodeUTF8))
        self.menuTools.setTitle(QtGui.QApplication.translate("mainwindow", "Tools", None, QtGui.QApplication.UnicodeUTF8))
        self.menuHelp.setTitle(QtGui.QApplication.translate("mainwindow", "Help", None, QtGui.QApplication.UnicodeUTF8))
        self.menuOntology.setTitle(QtGui.QApplication.translate("mainwindow", "Ontology", None, QtGui.QApplication.UnicodeUTF8))
        self.toolBarFile.setWindowTitle(QtGui.QApplication.translate("mainwindow", "toolBar", None, QtGui.QApplication.UnicodeUTF8))
        self.toolBarEdit.setWindowTitle(QtGui.QApplication.translate("mainwindow", "toolBar_2", None, QtGui.QApplication.UnicodeUTF8))
        self.toolBarOntology.setWindowTitle(QtGui.QApplication.translate("mainwindow", "toolBar_3", None, QtGui.QApplication.UnicodeUTF8))
        self.toolBarTools.setWindowTitle(QtGui.QApplication.translate("mainwindow", "toolBar_4", None, QtGui.QApplication.UnicodeUTF8))
        self.toolBarHelp.setWindowTitle(QtGui.QApplication.translate("mainwindow", "toolBar_5", None, QtGui.QApplication.UnicodeUTF8))
        self.openLocalOntologyAction.setText(QtGui.QApplication.translate("mainwindow", "Local Ontology", None, QtGui.QApplication.UnicodeUTF8))
        self.openLocalOntologyAction.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8))
        self.clearHistoryAction.setText(QtGui.QApplication.translate("mainwindow", "Clear History", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave.setText(QtGui.QApplication.translate("mainwindow", "Save", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSaveAs.setText(QtGui.QApplication.translate("mainwindow", "Save As...", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSaveAs.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+Shift+S", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPrint.setText(QtGui.QApplication.translate("mainwindow", "Print...", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPrint.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+P", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit.setText(QtGui.QApplication.translate("mainwindow", "Exit", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))
        self.actionQuickPrint.setText(QtGui.QApplication.translate("mainwindow", "Quick Print", None, QtGui.QApplication.UnicodeUTF8))
        self.actionQuickPrint.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+Shift+P", None, QtGui.QApplication.UnicodeUTF8))
        self.actionUndo.setText(QtGui.QApplication.translate("mainwindow", "Undo", None, QtGui.QApplication.UnicodeUTF8))
        self.actionUndo.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+Z", None, QtGui.QApplication.UnicodeUTF8))
        self.actionRedo.setText(QtGui.QApplication.translate("mainwindow", "Redo", None, QtGui.QApplication.UnicodeUTF8))
        self.actionRedo.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+Shift+Z", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCut.setText(QtGui.QApplication.translate("mainwindow", "Cut", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCut.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+X", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCopy.setText(QtGui.QApplication.translate("mainwindow", "Copy", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCopy.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+C", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPaste.setText(QtGui.QApplication.translate("mainwindow", "Paste", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPaste.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+V", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDelete.setText(QtGui.QApplication.translate("mainwindow", "Clear", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDelete.setToolTip(QtGui.QApplication.translate("mainwindow", "Clear", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDelete.setShortcut(QtGui.QApplication.translate("mainwindow", "Del", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSelectAll.setText(QtGui.QApplication.translate("mainwindow", "Select All", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSelectAll.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+A", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPySUMOHelp.setText(QtGui.QApplication.translate("mainwindow", "pySUMO Help", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPySUMOHelp.setShortcut(QtGui.QApplication.translate("mainwindow", "F1", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPySUMOTutorials.setText(QtGui.QApplication.translate("mainwindow", "pySUMO Tutorials", None, QtGui.QApplication.UnicodeUTF8))
        self.actionFAQ.setText(QtGui.QApplication.translate("mainwindow", "F.A.Q", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAboutSUMO.setText(QtGui.QApplication.translate("mainwindow", "About SUMO", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAboutSUOKIF.setText(QtGui.QApplication.translate("mainwindow", "About SUO-KIF", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAboutpySUMO.setText(QtGui.QApplication.translate("mainwindow", "About pySUMO", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSettings.setText(QtGui.QApplication.translate("mainwindow", "Settings...", None, QtGui.QApplication.UnicodeUTF8))
        self.actionHierarchyWidget.setText(QtGui.QApplication.translate("mainwindow", "Hierarchy Widget", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDocumentationWidget.setText(QtGui.QApplication.translate("mainwindow", "Documentation Widget", None, QtGui.QApplication.UnicodeUTF8))
        self.actionGraphWidget.setText(QtGui.QApplication.translate("mainwindow", "Graph Widget", None, QtGui.QApplication.UnicodeUTF8))
        self.actionTextEditorWidget.setText(QtGui.QApplication.translate("mainwindow", "Text Editor Widget", None, QtGui.QApplication.UnicodeUTF8))
        self.actionZoomIn.setText(QtGui.QApplication.translate("mainwindow", "Zoom In ", None, QtGui.QApplication.UnicodeUTF8))
        self.actionZoomIn.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl++", None, QtGui.QApplication.UnicodeUTF8))
        self.actionZoomOut.setText(QtGui.QApplication.translate("mainwindow", "Zoom Out", None, QtGui.QApplication.UnicodeUTF8))
        self.actionZoomOut.setShortcut(QtGui.QApplication.translate("mainwindow", "Ctrl+-", None, QtGui.QApplication.UnicodeUTF8))
        self.actionFile.setText(QtGui.QApplication.translate("mainwindow", "File", None, QtGui.QApplication.UnicodeUTF8))
        self.actionEdit.setText(QtGui.QApplication.translate("mainwindow", "Edit", None, QtGui.QApplication.UnicodeUTF8))
        self.actionTools.setText(QtGui.QApplication.translate("mainwindow", "Tools", None, QtGui.QApplication.UnicodeUTF8))
        self.actionHelp.setText(QtGui.QApplication.translate("mainwindow", "Help", None, QtGui.QApplication.UnicodeUTF8))
        self.actionConfigureToollbars.setText(QtGui.QApplication.translate("mainwindow", "Configure Toolbars...", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAddTerms.setText(QtGui.QApplication.translate("mainwindow", "Add Terms", None, QtGui.QApplication.UnicodeUTF8))
        self.actionRemoveTerms.setText(QtGui.QApplication.translate("mainwindow", "Remove Terms", None, QtGui.QApplication.UnicodeUTF8))
        self.actionFind.setText(QtGui.QApplication.translate("mainwindow", "Find", None, QtGui.QApplication.UnicodeUTF8))
        self.actionOntology.setText(QtGui.QApplication.translate("mainwindow", "Ontology", None, QtGui.QApplication.UnicodeUTF8))
        self.actionStatusbar.setText(QtGui.QApplication.translate("mainwindow", "Statusbar", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExpand.setText(QtGui.QApplication.translate("mainwindow", "Expand", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCollapse.setText(QtGui.QApplication.translate("mainwindow", "Collapse", None, QtGui.QApplication.UnicodeUTF8))
        self.actionActive_Ontologies.setText(QtGui.QApplication.translate("mainwindow", "Active Ontologies", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPrintPreview.setText(QtGui.QApplication.translate("mainwindow", "Print Preview...", None, QtGui.QApplication.UnicodeUTF8))

import pySUMOQt.Designer.css_rc
import pySUMOQt.Designer.gfx_rc


text:
using CorpusExplorer.Sdk.Action.Properties;
using CorpusExplorer.Sdk.Addon;
using CorpusExplorer.Sdk.Model;
using CorpusExplorer.Sdk.Utils.DataTableWriter.Abstract;
using CorpusExplorer.Sdk.ViewModel;

namespace CorpusExplorer.Sdk.Action
{
  public class Frequency3Action : IAction
  {
    public string Action => "frequency3";
    public string Description => Resources.DescFrequency3;

    public void Execute(Selection selection, string[] args, AbstractTableWriter writer)
    {
      var vm = new Frequency3LayerViewModel {Selection = selection};
      if (args != null && args.Length == 3)
      {
        vm.Layer1Displayname = args[0];
        vm.Layer2Displayname = args[1];
        vm.Layer3Displayname = args[2];
      }

      vm.Execute();

      writer.WriteTable(selection.Displayname, vm.GetNormalizedDataTable());
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
package gov.nasa.arc.spife.ui.timeline.part;

import org.eclipse.gef.GraphicalEditPart;

public class ScaleTimelineEditPart extends AbstractTimelineEditPart<Object> {

	@Override
	public GraphicalEditPart createHeaderEditPart(Object model) {
		GraphicalEditPart editPart = new ScaleTimelineHeaderEditPart();
		editPart.setModel(model);
		return editPart;
	}

	@Override
	public GraphicalEditPart createDataEditPart(Object model) {
		GraphicalEditPart editPart = new ScaleTimelineDataEditPart();
		editPart.setModel(model);
		return editPart;
	}

}


text:
Stats

            Pretty graph will go here


text:
var	exec = require('child_process').exec;
var fs = require("fs");
var path = require("path");

var RE_ASTERISK_BRANCH = /\*\s+(.*?)\n/,
	RE_STATUS_CODE = /(..)\s+(.*?)\n/,
	RE_STATUS_BRANCH = /\#\#\s+(.*?)\n/;

var git = {
	/* Get the current branch name */
	getBranch: function (callback) {
		exec('git branch --color=never', function (err, stdout, stderr) {
			if(err) {
				callback(err);
			}
			else {
				var result = RE_ASTERISK_BRANCH.exec(stdout.toString());
				if(!result) {
					callback(new Error("Could not find active branch name"));
				}
				else {
					callback(null, result[1])
				}
			}
		});
	},

	//makes new branch and pushes to origin
	newBranch: function (name, callback) {
		//remove a few illegal git characters
		name = name.replace(/\'/g, '').replace(/\!/g, '');
		exec('git checkout -b ' + name, function (err, stdout, stderr) {
			if(err) {
				callback(new Error(stderr));
			}
			else {
				exec('git push origin ' + name + ' --set-upstream', function (err, stdout, stderr) {
					if(err) {
						callback(new Error("Could not push new branch to origin -- local branch still exists"))
					}
					else {
						callback();
					}
				})
			}
		})
	},
	deleteBranch: function (branch, callback) {
		exec('git branch -d ' + branch, function (err, stdout, stderr) {
			if(err) {
				callback(new Error(stderr));
			}
			else {
				exec('git push origin :' + branch, function (err, stdout, stderr) {
					if(err) {
						callback(new Error(stderr));
					}
					else {
						callback();
					}
				});
			}
		});
	},
	deleteLocalBranch: function(opts, callback) {
		var validTypes = ["-d", "-D"];

		var branch = undefined;
		var type = "-d";
		if(typeof opts == "string"){
			branch = opts;
		}
		else{
			branch = opts.branch;
			type = opts.type || type;
		}

		if(branch==undefined){
			callback(new Error("Branch must be provided"));
		}
		else if(validTypes.indexOf(type)==-1){
			callback(new Error("Invalide deletion type"));
		}
		else{
			exec('git branch '+type+' '+ branch, function (err, stdout, stderr) {
				if(err) {
					callback(new Error(stderr));
				}
				else {
					callback();
				}
			});
		}

	},
	deleteRemoteBranch: function(branch, remote, callback) {
		remote = remote || "origin";
		exec('git push ' + remote + ' :' + branch, function (err, stdout, stderr) {
			if(err) {
				callback(new Error(stderr));
			}
			else {
				callback();
			}
		});
	},
	push: function (branch, callback) {
		exec('git push origin ' + branch, function (err, stdout, stderr) {
			if(err) {
				callback(new Error("Could not push to origin"))
			}
			else {
				callback();
			}
		});
	},

	/* Calls back with an object that contains 'branch' and 'clean'
	 * @callback(err, results)
	 *   @results {object}
	 *	   @branch {string} the name of the branch
	 *     @clean {boolean} clean if there are no changes to the repo */
	status: function (callback) {
		var results = {};
		exec('git status --branch --porcelain', function (err, stdout, stderr) {
			if(err) {
				callback(err)
			}

			var lines = stdout.toString().split('\n');
			results.branch = RE_STATUS_BRANCH.exec(lines[0])[1];
			results.clean = true;
			for(var i=1; i<lines.length; i++) {
				var code = RE_STATUS_CODE.exec(lines[i])[1];
				if(code == '??') {
					continue;
				}
				else if(code.charAt(0) != ' ') {
					results.clean = false;;
					break;
				}
			}

			callback(null, results);
		})
	},

	/* pulls from origin, will abort on merge */
	pull: function (branch, callback) {
		exec('git pull --ff-only origin ' + branch, function (err, stdout, stderr) {
			if(err) {
				callback(new Error("Could not pull from remote: " + err.message));
			}
			else {
				callback();
			}
		})
	},

	/* merges branch in to this one, squashing, committing w/ message*/
	merge: function (branch, message, callback) {

		exec('git merge --squash --ff-only ' + branch, function (err, stdout, stderr) {
			if(err) {
				callback(new Error("Could not merge trivially: " + stderr.toString()));
			}
			else {
				// Merge the given message with the commit messages from the squashed
				// commits, preserving the development history. So first we find the
				// `.git` directory and then we edit the `SQUASH_MSG` file.
				exec("git rev-parse --show-toplevel", function(err, stdout, stderr) {
					if (err) {
						callback(new Error("Could not read Git repo metadata:", stderr.toString()));
					}
					else {
						var squashMsg;
						try {

							var gitDir = path.join(stdout.toString().trim(), ".git"),
								messageFile = path.join(gitDir, "SQUASH_MSG");
							try {
								squashMsg = fs.readFileSync(messageFile, {encoding: 'utf8'});
							}
							catch (e) {
								console.error(err.stack)

								try {
									messageFile = path.join(gitDir, "MERGE_MSG");
									squashMsg = fs.readFileSync(messageFile, {encoding: 'utf8'});
								}
								catch (e) {
									console.error(err.stack)
									//try catch in try catch where does finally get called?  need callback to get called
								}
							}

							if (squashMsg) {
								message = message + "\n\n" + squashMsg;
							}
							fs.writeFileSync(messageFile, message, {encoding: 'utf8'});
						}
						catch (e) {
							// OK, that didn't work -- continue with the regular message
							console.error(e.stack)
						}
						finally {

							// At this point `SQUASH_MSG` contains all we want,
							// if it exists; otherwise just use the message
							var cmd = (squashMsg) ? 'git commit -a --no-edit' : 'git commit -am "' + message + '"';

							exec(cmd, function (err, stdout, stderr) {
								if(err) {
									callback(new Error("Could not commit squashed merge: " + stderr.toString()));
								}
								else {
									callback();
								}
							});
						}
					}
				});
			}
		});
	},

	checkout: function (branch, callback) {
		exec('git checkout ' + branch, function (err) {
			if(err) {
				callback(err);
			}
			else {
				callback();
			}
		});
	},

	/* takes either 2 of three args
	 * 2 args: gets config  (key, callback)
	 * 3 args: sets config  (key, value, callback) */
	config: function (key, arg1, arg2) {
		var value, callback;
		if(arg2 === undefined) {
			callback = arg1;
			exec('git config --get ' + key, function (err, stdout) {
				if(err) {
					callback(err);
				}
				else {
					var value = stdout.toString().trim();
					callback(null, value)
				}
			});
		}
		else {
			value = arg1;
			callback = arg2;
			exec('git config --replace-all ' + key + ' ' + value, function (err, stdout) {
				if(err) {
					callback(err);
				}
				else {
					callback(null, value)
				}
			});
		}
	},

	getConfigStore: function (callback) {
		exec('git config --local --get pivotal.store', function (err, stdout) {
			if(err) {
				git.setConfigStore({}, callback);
			}
			else {
				try {
					var store = JSON.parse(stdout.toString().trim());
				}
				catch(err) {
					return callback(new Error("Your pivotal store appears to be corrupted.  Please check it with `git config --local --get pivotal.store`"));
				}
				return callback(null, store)
			}
		});
	},

	setConfigStore: function (store, callback) {
		if(store === undefined) {
			callback(new Error("Store must be defined"));
		}
		else {
			//git escapes quotes, need to add backslashes.  need to make backslashes literal, as well
			var str = JSON.stringify(store).replace(/\\/g,'\\\\').replace(/\"/g, '\\"');
			exec('git config --local --replace-all pivotal.store "' + str + '"', function (err, stdout) {
				if(err) {
					callback(err);
				}
				else {
					callback(null, store);
				}
			});
		}
	},

	doesBranchExist: function(branch, callback) {
		exec('git branch --list ' + branch, function(err, stdout, stderr) {
			if(err) {
				callback(err);
			}
			else {
				if(stdout) {
					callback();
				} else {
					callback(new Error(stderr));
				}
			}
		});
	}
};

module.exports = git;


text:
\documentclass{article}

\begin{document}
\title{Building \LaTeX with Bazel}
\author{KK Yap}
\maketitle

This is created using Bazel.  And has no citations.

\end{document}


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <title>Document</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="description" content="Description" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0"
    />
    <link
      rel="stylesheet"
      href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/dark.css"
    />
    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-wEmeIV1mKuiNpC+IOBjI7aAzPcEZeedi5yW5f2yOq55WWLwNGmvvx4Um1vskeMj0"
      crossorigin="anonymous"
    />


text:
package org.pikater.core.agents.system.manager.graph;

/**
 * Global unique ID generator interface User: Kuba Date: 14.5.2014 Time: 11:37
 */
public interface GUIDGenerator {
	/**
	 * Gets and allocate gUID.
	 *
	 * @return the and allocate gUID
	 */
	Integer getAndAllocateGUID();
}


text:
package me.johnking.fusenet.network.event;

import com.xxmicloxx.znetworklib.codec.Request;
import com.xxmicloxx.znetworklib.codec.Result;

/**
 * Created by Marco on 18.10.2014.
 */
public abstract interface RequestHandler {

    public abstract Result handle(String sender, Request packet);
}


text:
import math

# create a function to get the factorial of 100 and also calculate the sum of digits in the factorial
def factorial(n):

    fact = math.factorial(n) # importing a function that calculates the factorial of n
    print("Factorial of ", n, "is: ", fact)

    x = str(fact) # changing factorial from int to string
    # Ref: https://stackoverflow.com/questions/6429638/how-to-split-a-string-into-integers-in-python
    s = [int(i) for i in str(x)] # taking the string and putting it into an array while splitting it into integers using loop
    print("Sum of digits in the number 100! is: ", sum(s)) # print out the sum of integers in array

factorial(100) # call the function


text:
#pragma once
/* 为StrVec类添加一个构造函数,它接受一个initializer_list<string>参数*/
#include<memory>
#include<string>
#include<initializer_list>

class StrVec {
public:
	StrVec() : elements(nullptr), first_free(nullptr), cap(nullptr) {}
	// 添加接受参数为initializer_list<string>的构造函数
	StrVec(std::initializer_list<std::string>);
	StrVec(const StrVec&);
	StrVec& operator=(const StrVec&);
	~StrVec();

	void push_back(const std::string&);
	size_t size() const { return first_free - elements; }
	size_t capacity() const { return cap - elements; }
	std::string *begin() const { return elements; }
	std::string *end() const { return first_free; }

	void reserve(size_t new_cap);
	void resize(size_t count);
	void resize(size_t count, const std::string&);

private:
	std::pair<std::string*, std::string*> alloc_n_copy(const std::string*, const std::string*);
	void chk_n_alloc()
	{
		if (size() == capacity())
			reallocate();
	}
	void free();
	void reallocate();
	void alloc_n_move(size_t new_cap);
	void range_initialize(const std::string*, const std::string*);

private:
	std::string *elements;               // 指向数组首元素并释放内存
	std::string *first_free;               // 指向数组第一个空闲元素的指针
	std::string *cap;                           // 指向数组尾后位置的指针
	static std::allocator<std::string> alloc;       // 分配元素
};


text:
// Copyright 2018-2022, University of Colorado Boulder

/**
 * InfiniteStatusBar is the status bar for games that have an infinite (open-ended) number of challenges per level.
 * See specification in https://github.com/phetsims/vegas/issues/59.
 *
 * @author Andrea Lin
 * @author Chris Malley (PixelZoom, Inc.)
 */

import TProperty from '../../axon/js/TProperty.js';
import TReadOnlyProperty from '../../axon/js/TReadOnlyProperty.js';
import Bounds2 from '../../dot/js/Bounds2.js';
import optionize from '../../phet-core/js/optionize.js';
import StrictOmit from '../../phet-core/js/types/StrictOmit.js';
import BackButton from '../../scenery-phet/js/buttons/BackButton.js';
import StatusBar, { StatusBarOptions } from '../../scenery-phet/js/StatusBar.js';
import { HBox, Node } from '../../scenery/js/imports.js';
import { PushButtonListener } from '../../sun/js/buttons/PushButtonModel.js';
import Tandem from '../../tandem/js/Tandem.js';
import ScoreDisplayNumberAndStar from './ScoreDisplayNumberAndStar.js';
import vegas from './vegas.js';

type SelfOptions = {
  backButtonListener?: PushButtonListener;
  xMargin?: number;
  yMargin?: number;
  spacing?: number;

  // score display
  createScoreDisplay?: ( scoreProperty: TProperty<number> ) => Node;
};

export type InfiniteStatusBarOptions = SelfOptions & StrictOmit<StatusBarOptions, 'children' | 'barHeight'>;

export default class InfiniteStatusBar extends StatusBar {

  private readonly disposeInfiniteStatusBar: () => void;

  /**
   * @param layoutBounds - layoutBounds of the ScreenView
   * @param visibleBoundsProperty - visible bounds of the ScreenView
   * @param messageNode - to the right of the back button, typically Text
   * @param scoreProperty
   * @param providedOptions
   */
  public constructor( layoutBounds: Bounds2, visibleBoundsProperty: TReadOnlyProperty<Bounds2>, messageNode: Node,
                      scoreProperty: TProperty<number>, providedOptions?: InfiniteStatusBarOptions ) {

    const options = optionize<InfiniteStatusBarOptions, SelfOptions, StatusBarOptions>()( {

      // SelfOptions
      backButtonListener: _.noop,
      xMargin: 20,
      yMargin: 10,
      spacing: 10,
      createScoreDisplay: scoreProperty => new ScoreDisplayNumberAndStar( scoreProperty ),

      // StatusBarOptions
      tandem: Tandem.OPTIONAL
    }, providedOptions );

    // button that typically takes us back to the level-selection UI
    const backButton = new BackButton( {
      listener: options.backButtonListener,
      xMargin: 8,
      yMargin: 10,
      tandem: options.tandem.createTandem( 'backButton' )
    } );

    // Nodes on the left end of the bar
    const leftNodes = new HBox( {
      spacing: options.spacing,
      align: 'center',
      children: [ backButton, messageNode ],
      maxWidth: 0.7 * layoutBounds.width
    } );

    // Create the score display.
    const scoreDisplay = options.createScoreDisplay( scoreProperty );
    scoreDisplay.maxWidth = 0.2 * layoutBounds.width;

    options.children = [ leftNodes, scoreDisplay ];

    options.barHeight = Math.max( leftNodes.height, scoreDisplay.height ) + ( 2 * options.yMargin );

    super( layoutBounds, visibleBoundsProperty, options );

    // Position components on the bar.
    this.positioningBoundsProperty.link( positioningBounds => {
      leftNodes.left = positioningBounds.left;
      leftNodes.centerY = positioningBounds.centerY;
      scoreDisplay.right = positioningBounds.right;
      scoreDisplay.centerY = positioningBounds.centerY;
    } );

    // Keep the score right justified.
    scoreDisplay.localBoundsProperty.link( () => {
      scoreDisplay.right = this.positioningBoundsProperty.value.right;
    } );

    this.disposeInfiniteStatusBar = () => {
      scoreDisplay.dispose();
    };
  }

  public override dispose(): void {
    this.disposeInfiniteStatusBar();
    super.dispose();
  }
}

vegas.register( 'InfiniteStatusBar', InfiniteStatusBar );


text:
package com.baidubce.services.bcm.model;

/**
 * the dimension for metric.
 */
public class Dimension {

    private String name;
    private String value;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Dimension withName(String name) {
        this.name = name;
        return this;
    }

    public Dimension withValue(String value) {
        this.value = value;
        return this;
    }
}


text:
package org.argus.amandroid.alir.pta.reachingFactsAnalysis

import org.argus.amandroid.alir.pta.model.{AndroidModelCallHandler, InterComponentCommunicationModel}
import org.argus.amandroid.core.ApkGlobal
import org.argus.jawa.flow.Context
import org.argus.jawa.flow.cfg._
import org.argus.jawa.flow.dfa._
import org.argus.jawa.flow.interprocedural.{CallHandler, Callee, IndirectCallee, MethodCallResolver}
import org.argus.jawa.flow.pta._
import org.argus.jawa.flow.pta.rfa.{RFAFact, ReachingFactsAnalysis, ReachingFactsAnalysisHelper}
import org.argus.jawa.core.ast.CallStatement
import org.argus.jawa.core._
import org.argus.jawa.core.elements.Signature
import org.argus.jawa.core.util._
import org.argus.jawa.flow.summary.SummaryManager

/**
 * @author Fengguo Wei
 * @author Sankardas Roy
 */
class AndroidReachingFactsAnalysis(
    apk: ApkGlobal,
    icfg: InterProceduralControlFlowGraph[ICFGNode],
    ptaresult: PTAResult,
    handler: AndroidModelCallHandler,
    sm: SummaryManager,
    clm: ClassLoadManager,
    resolve_static_init: Boolean,
    timeout: Option[MyTimeout]) extends ReachingFactsAnalysis(apk, icfg, ptaresult, handler, sm, clm, resolve_static_init, timeout) {

  private val registerReceiverNodes: MSet[ICFGCallNode] = msetEmpty

  var currentComponent: JawaClass = _

  def build (
      entryPointProc: JawaMethod,
      initialFacts: ISet[RFAFact] = isetEmpty,
      initContext: Context): InterProceduralDataFlowGraph = {
    currentComponent = entryPointProc.getDeclaringClass
    val idfg = process(entryPointProc, initialFacts, initContext, new Callr)
    registerReceiverNodes.foreach { node =>
      InterComponentCommunicationModel.registerReceiver(apk, ptaresult, node.recvNameOpt, node.argNames, node.context)
    }
    idfg
  }

  class Callr extends MethodCallResolver(apk, ptaresult, icfg, sm, handler) {

    /**
     * It returns the facts for each callee entry node and caller return node
     */
    override def resolveCall(s: ISet[RFAFact], cs: CallStatement, callerNode: Node): (IMap[Node, ISet[RFAFact]], ISet[RFAFact]) = {
      val callerContext = callerNode.getContext
      val calleeSet = CallHandler.getCalleeSet(apk, cs, callerContext, ptaresult)
      val icfgCallnode = icfg.getICFGCallNode(callerContext)
      icfgCallnode.asInstanceOf[ICFGCallNode].setCalleeSet(calleeSet.map(_.asInstanceOf[Callee]))
      val icfgReturnnode = icfg.getICFGReturnNode(callerContext)
      icfgReturnnode.asInstanceOf[ICFGReturnNode].setCalleeSet(calleeSet.map(_.asInstanceOf[Callee]))
      var calleeFactsMap: IMap[ICFGNode, ISet[RFAFact]] = imapEmpty
      var returnFacts: ISet[RFAFact] = ReachingFactsAnalysisHelper.aggregate(s)
      val genSet: MSet[RFAFact] = msetEmpty
      val killSet: MSet[RFAFact] = msetEmpty
      var pureNormalFlag = pureNormalFlagMap.getOrElseUpdate(callerNode, true)

      val args = (cs.recvOpt ++ cs.args).toList
      calleeSet.foreach { callee =>
        val calleeSig: Signature = callee.callee
        icfg.getCallGraph.addCall(callerNode.getOwner, calleeSig)
        val calleep = apk.getMethodOrResolve(calleeSig).get
        if(handler.isICCCall(calleeSig) || handler.isModelCall(calleep)) {
          pureNormalFlag = false
          if(handler.isICCCall(calleeSig)) {
            // don't do anything for the ICC call now.
          } else { // for non-ICC-RPC model call
            callee match {
              case _: IndirectCallee =>
              // TODO: handle indirect callee here
              case _ =>
                returnFacts = handler.doModelCall(sm, s, calleep, cs.lhsOpt.map(lhs => lhs.name), cs.recvOpt, cs.args, callerContext)
                if (InterComponentCommunicationModel.isRegisterReceiver(calleeSig)) {
                  registerReceiverNodes += callerNode.asInstanceOf[ICFGCallNode]
                }
            }
          }
        } else {
          // for normal call
          if (calleep.isConcrete) {
            if (!icfg.isProcessed(calleeSig, callerContext)) {
              icfg.collectCfgToBaseGraph(calleep, callerContext, isFirst = false, needReturnNode())
              icfg.extendGraph(calleeSig, callerContext, needReturnNode = true)
            }
            val factsForCallee = getFactsForCallee(s, cs, calleep, callerContext)
            killSet ++= factsForCallee
            calleeFactsMap += (icfg.entryNode(calleeSig, callerContext) -> callee.mapFactsToCallee(factsForCallee, args, (calleep.thisOpt ++ calleep.getParamNames).toList))
          }
        }
      }
      if(pureNormalFlag) {
        if(icfg.hasEdge(icfgCallnode, icfgReturnnode)) {
          icfg.deleteEdge(icfgCallnode, icfgReturnnode)
        }
      } else pureNormalFlagMap(callerNode) = pureNormalFlag
      cs.lhsOpt match {
        case Some(lhs) =>
          val slotsWithMark = ReachingFactsAnalysisHelper.processLHS(lhs, callerContext, ptaresult).toSet
          for (rdf <- s) {
            //if it is a strong definition, we can kill the existing definition
            if (slotsWithMark.contains(rdf.s, true)) {
              killSet += rdf
            }
          }
        case None =>
      }
      returnFacts = returnFacts -- killSet ++ genSet
      (calleeFactsMap, returnFacts)
    }

    private def getFactsForCallee(s: ISet[RFAFact], cs: CallStatement, callee: JawaMethod, callerContext: Context): ISet[RFAFact] = {
      val calleeFacts = msetEmpty[RFAFact]
      calleeFacts ++= ReachingFactsAnalysisHelper.getGlobalFacts(s)
      val args = (cs.recvOpt ++ cs.args).toList
      for(i <- args.indices) {
        val arg = args(i)
        val slot = VarSlot(arg)
        val value = ptaresult.pointsToSet(callerContext, slot)
        calleeFacts ++= value.map { r => RFAFact(VarSlot(slot.varName), r) }
        calleeFacts ++= ReachingFactsAnalysisHelper.getRelatedHeapFacts(value, s)
      }
      calleeFacts.toSet
    }
  }
}


text:
package couchauth

import (
	"context"
	"testing"

	"github.com/flimzy/kivik"
	"github.com/flimzy/kivik/errors"
	_ "github.com/go-kivik/couchdb"
	"github.com/go-kivik/kiviktest/kt"
)

type tuser struct {
	ID       string   `json:"_id"`
	Name     string   `json:"name"`
	Type     string   `json:"type"`
	Roles    []string `json:"roles"`
	Password string   `json:"password"`
}

func TestBadDSN(t *testing.T) {
	if _, err := New(context.Background(), "http://foo.com:port with spaces/"); err == nil {
		t.Errorf("Expected error for invalid URL.")
	}
	if _, err := New(context.Background(), "http://foo:bar@foo.com/"); err == nil {
		t.Error("Expected error for DSN with credentials.")
	}
}

func TestCouchAuth(t *testing.T) {
	client := kt.GetClient(t)
	db, e := client.DB(context.Background(), "_users")
	if e != nil {
		t.Fatalf("Failed to connect to db: %s", e)
	}
	name := kt.TestDBName(t)
	user := &tuser{
		ID:       kivik.UserPrefix + name,
		Name:     name,
		Type:     "user",
		Roles:    []string{"coolguy"},
		Password: "abc123",
	}
	rev, e := db.Put(context.Background(), user.ID, user)
	if e != nil {
		t.Fatalf("Failed to create user: %s", e)
	}
	defer db.Delete(context.Background(), user.ID, rev)
	auth, e := New(context.Background(), kt.NoAuthDSN(t))
	if e != nil {
		t.Fatalf("Failed to connect to remote server: %s", e)
	}
	t.Run("sync", func(t *testing.T) {
		t.Run("Validate", func(t *testing.T) {
			t.Parallel()
			t.Run("ValidUser", func(t *testing.T) {
				t.Parallel()
				uCtx, err := auth.Validate(context.Background(), user.Name, "abc123")
				if err != nil {
					t.Errorf("Validation failure for good password: %s", err)
				}
				if uCtx == nil {
					t.Errorf("User should have been validated")
				}
			})
			t.Run("WrongPassword", func(t *testing.T) {
				t.Parallel()
				uCtx, err := auth.Validate(context.Background(), user.Name, "foobar")
				if errors.StatusCode(err) != kivik.StatusUnauthorized {
					t.Errorf("Expected Unauthorized for bad password, got %s", err)
				}
				if uCtx != nil {
					t.Errorf("User should not have been validated with wrong password")
				}
			})
			t.Run("MissingUser", func(t *testing.T) {
				t.Parallel()
				uCtx, err := auth.Validate(context.Background(), "nobody", "foo")
				if errors.StatusCode(err) != kivik.StatusUnauthorized {
					t.Errorf("Expected Unauthorized for bad username, got %s", err)
				}
				if uCtx != nil {
					t.Errorf("User should not have been validated with wrong username")
				}
			})
		})
	})

	// roles, err := auth.Roles(context.Background(), "test")
	// if err != nil {
	// 	t.Errorf("Failed to get roles for valid user: %s", err)
	// }
	// if !reflect.DeepEqual(roles, []string{"coolguy"}) {
	// 	t.Errorf("Got unexpected roles.")
	// }
	// _, err = auth.Roles(context.Background(), "nobody")
	// if errors.StatusCode(err) != kivik.StatusNotFound {
	// 	var msg string
	// 	if err != nil {
	// 		msg = fmt.Sprintf(" Got: %s", err)
	// 	}
	// 	t.Errorf("Expected Not Found fetching roles for bad username.%s", msg)
	// }
}


text:
var EME_RENEWAL_MESSAGE_HEADER = 'RENEWAL';

// Default key used to encrypt many media files used in browser tests.
var KEY = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
                          0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);

var DEFAULT_LICENSE_SERVER = document.location.origin + '/license_server';

var DEFAULT_MEDIA_FILE = 'http://shadi.kir/alcatraz/Chrome_44-enc_av.webm';

// Key ID used for init data.
var KEY_ID = '0123456789012345';

// Unique strings to identify test result expectations.
var UNIT_TEST_SUCCESS = 'UNIT_TEST_SUCCESS';
var UNIT_TEST_FAILURE = 'UNIT_TEST_FAILURE';
var NOTSUPPORTEDERROR = 'NOTSUPPORTEDERROR';
var EME_GENERATEREQUEST_FAILED = 'EME_GENERATEREQUEST_FAILED';
var EME_SESSION_NOT_FOUND = 'EME_SESSION_NOT_FOUND';
var EME_LOAD_FAILED = 'EME_LOAD_FAILED';
var EME_UPDATE_FAILED = 'EME_UPDATE_FAILED';
var EME_ERROR_EVENT = 'EME_ERROR_EVENT';
var EME_MESSAGE_UNEXPECTED_TYPE = 'EME_MESSAGE_UNEXPECTED_TYPE';
var EME_RENEWAL_MISSING_HEADER = 'EME_RENEWAL_MISSING_HEADER';
var EME_SESSION_CLOSED_AND_ERROR = 'EME_SESSION_CLOSED_AND_ERROR';

// Headers used when running some specific unittests in the external CDM.
var UNIT_TEST_RESULT_HEADER = 'UNIT_TEST_RESULT';

// Available EME key systems to use.
// TODO(xhwang): Unify naming in this list.
var WIDEVINE_KEYSYSTEM = 'com.widevine.alpha';
var CLEARKEY = 'org.w3.clearkey';
var EXTERNAL_CLEARKEY = 'org.chromium.externalclearkey';
var MESSAGE_TYPE_TEST_KEYSYSTEM =
    'org.chromium.externalclearkey.messagetypetest';
var FILE_IO_TEST_KEYSYSTEM = 'org.chromium.externalclearkey.fileiotest';
var OUTPUT_PROTECTION_TEST_KEYSYSTEM =
    'org.chromium.externalclearkey.outputprotectiontest';
var PLATFORM_VERIFICATION_TEST_KEYSYSTEM =
    'org.chromium.externalclearkey.platformverificationtest';
var CRASH_TEST_KEYSYSTEM = 'org.chromium.externalclearkey.crash';
var VERIFY_HOST_FILES_TEST_KEYSYSTEM =
    'org.chromium.externalclearkey.verifycdmhosttest';
var STORAGE_ID_TEST_KEYSYSTEM = 'org.chromium.externalclearkey.storageidtest';

// Key system name:value map to show on the document page.
var KEY_SYSTEMS = {
  'Widevine': WIDEVINE_KEYSYSTEM,
  'Clearkey': CLEARKEY,
  'External Clearkey': EXTERNAL_CLEARKEY
};

var CONFIG_CHANGE_TYPE = {
  CLEAR_TO_CLEAR : '0',
  CLEAR_TO_ENCRYPTED : '1',
  ENCRYPTED_TO_CLEAR : '2',
  ENCRYPTED_TO_ENCRYPTED : '3'
};

// General WebM and MP4 name:content_type map to show on the document page.
var MEDIA_TYPES = {
  'WebM - Audio Video': 'video/webm; codecs="vorbis, vp8"',
  'WebM - Video Only': 'video/webm; codecs="vp8"',
  'WebM - Audio Only': 'video/webm; codecs="vorbis"',
  'MP4 - Video Only': 'video/mp4; codecs="avc1.4D000C"',
  'MP4 - Audio Only': 'audio/mp4; codecs="mp4a.40.2"'
};

// Global document elements ID's.
var VIDEO_ELEMENT_ID = 'video';
var MEDIA_FILE_ELEMENT_ID = 'mediaFile';
var LICENSE_SERVER_ELEMENT_ID = 'licenseServer';
var KEYSYSTEM_ELEMENT_ID = 'keySystemList';
var MEDIA_TYPE_ELEMENT_ID = 'mediaTypeList';
var USE_MSE_ELEMENT_ID = 'useMSE';
var USE_PLAY_TWICE_ELEMENT_ID = 'playTwice';

// These variables get updated every second, so better to have global pointers.
var decodedFPSElement = document.getElementById('decodedFPS');
var droppedFPSElement = document.getElementById('droppedFPS');
var droppedFramesElement = document.getElementById('droppedFrames');
var docLogs = document.getElementById('logs');


text:
(function() {
  'use strict';

  var parser = require('user-agent-parser');
  var Engine = require('./canvas/engine');

  window.GO = {
    GAME_OVER: false,
    SCORE: 0,
    TOP_SCORE: 0,
    PREV_RAMP_WAS_BROKEN: false,
    DEVICE: parser(navigator.userAgent).device.type,
    IS_NATIVE: CocoonJS.App.nativeExtensionObjectAvailable,
    WW: window.innerWidth,
    WH: window.innerHeight,
    isMobile: function() {
      if((this.DEVICE && this.DEVICE === 'mobile') || (this.DEVICE && this.DEVICE === 'tablet')) return true;
      return false;
    },

    getWidth: function() {
      if(this.isMobile() || this.IS_NATIVE || window.innerWidth < 480) return window.innerWidth;
      return 480;
    },

    getHeight: function() {
      if(this.isMobile() || this.IS_NATIVE || window.innerHeight < 640) return window.innerHeight;
      return 640;
    }
  };

  window.onload = function() {
    new Engine();
  };

})();


text:
Base64 Encoding and Decoding

        All server side languages provide base64 encoding and decoding functionality, but not JavaScript. You can use w2utils for all your
        base64 needs.

<textarea id="encode" style="width: 100%; height: 90px; border: 1px solid silver">
    This is some HTML text to be encoded.
</textarea>

<button class="w2ui-btn" onclick="$('#encode').val(w2utils.base64encode($('#encode')[0].value))">Encode base64</button>
<button class="w2ui-btn" onclick="$('#encode').val(w2utils.base64decode($('#encode')[0].value))">Decode base64</button>

<button class="w2ui-btn" onclick="w2alert(w2utils.encodeTags($('#encode')[0].value))">Encode HTML Tags</button>
<button class="w2ui-btn" onclick="w2alert(w2utils.stripTags($('#encode')[0].value))">Strip HTML Tags</button>

<button class="w2ui-btn" onclick="$('#encode').val(w2utils.md5encode($('#encode')[0].value))">Encode md5</button>


text:
<a href="<?php echo base_url(); ?>">Home

<a href="<?php echo base_url("minha-conta"); ?>">Minha conta

<a href="<?php echo base_url("minha-conta/cadastro"); ?>">Cadastro

Confirmação de cadastro

Confirmação de cadastro

Seu cadastro foi confirmado com sucesso.

    <a href="<?php echo base_url('minha-conta'); ?>" class="btn btn-default">Ir para minha conta


text:
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SampleApplication.Models.ViewModels
{

    public class ExpenseCreateViewModel
    {

        public ExpenseCreateViewModel()
        {
        }

        public IReadOnlyList<SelectListItem> Employees { get; set; }

        public IReadOnlyList<SelectListItem> Periods { get; set; }

        public ExpenseCreateItemViewModel Item { get; set; }

    }

}


text:
// +build !ignore_autogenerated

// Code generated by conversion-gen. DO NOT EDIT.

package v1alpha1

import (
	unsafe "unsafe"

	authentication_v1 "k8s.io/api/authentication/v1"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
	types "k8s.io/apimachinery/pkg/types"
	audit "k8s.io/apiserver/pkg/apis/audit"
)

func init() {
	localSchemeBuilder.Register(RegisterConversions)
}

// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
	return scheme.AddGeneratedConversionFuncs(
		Convert_v1alpha1_Event_To_audit_Event,
		Convert_audit_Event_To_v1alpha1_Event,
		Convert_v1alpha1_EventList_To_audit_EventList,
		Convert_audit_EventList_To_v1alpha1_EventList,
		Convert_v1alpha1_GroupResources_To_audit_GroupResources,
		Convert_audit_GroupResources_To_v1alpha1_GroupResources,
		Convert_v1alpha1_ObjectReference_To_audit_ObjectReference,
		Convert_audit_ObjectReference_To_v1alpha1_ObjectReference,
		Convert_v1alpha1_Policy_To_audit_Policy,
		Convert_audit_Policy_To_v1alpha1_Policy,
		Convert_v1alpha1_PolicyList_To_audit_PolicyList,
		Convert_audit_PolicyList_To_v1alpha1_PolicyList,
		Convert_v1alpha1_PolicyRule_To_audit_PolicyRule,
		Convert_audit_PolicyRule_To_v1alpha1_PolicyRule,
	)
}

func autoConvert_v1alpha1_Event_To_audit_Event(in *Event, out *audit.Event, s conversion.Scope) error {
	// WARNING: in.ObjectMeta requires manual conversion: does not exist in peer-type
	out.Level = audit.Level(in.Level)
	// WARNING: in.Timestamp requires manual conversion: does not exist in peer-type
	out.AuditID = types.UID(in.AuditID)
	out.Stage = audit.Stage(in.Stage)
	out.RequestURI = in.RequestURI
	out.Verb = in.Verb
	// TODO: Inefficient conversion - can we improve it?
	if err := s.Convert(&in.User, &out.User, 0); err != nil {
		return err
	}
	out.ImpersonatedUser = (*audit.UserInfo)(unsafe.Pointer(in.ImpersonatedUser))
	out.SourceIPs = *(*[]string)(unsafe.Pointer(&in.SourceIPs))
	if in.ObjectRef != nil {
		in, out := &in.ObjectRef, &out.ObjectRef
		*out = new(audit.ObjectReference)
		if err := Convert_v1alpha1_ObjectReference_To_audit_ObjectReference(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.ObjectRef = nil
	}
	out.ResponseStatus = (*v1.Status)(unsafe.Pointer(in.ResponseStatus))
	out.RequestObject = (*runtime.Unknown)(unsafe.Pointer(in.RequestObject))
	out.ResponseObject = (*runtime.Unknown)(unsafe.Pointer(in.ResponseObject))
	out.RequestReceivedTimestamp = in.RequestReceivedTimestamp
	out.StageTimestamp = in.StageTimestamp
	out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations))
	return nil
}

func autoConvert_audit_Event_To_v1alpha1_Event(in *audit.Event, out *Event, s conversion.Scope) error {
	out.Level = Level(in.Level)
	out.AuditID = types.UID(in.AuditID)
	out.Stage = Stage(in.Stage)
	out.RequestURI = in.RequestURI
	out.Verb = in.Verb
	// TODO: Inefficient conversion - can we improve it?
	if err := s.Convert(&in.User, &out.User, 0); err != nil {
		return err
	}
	out.ImpersonatedUser = (*authentication_v1.UserInfo)(unsafe.Pointer(in.ImpersonatedUser))
	out.SourceIPs = *(*[]string)(unsafe.Pointer(&in.SourceIPs))
	if in.ObjectRef != nil {
		in, out := &in.ObjectRef, &out.ObjectRef
		*out = new(ObjectReference)
		if err := Convert_audit_ObjectReference_To_v1alpha1_ObjectReference(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.ObjectRef = nil
	}
	out.ResponseStatus = (*v1.Status)(unsafe.Pointer(in.ResponseStatus))
	out.RequestObject = (*runtime.Unknown)(unsafe.Pointer(in.RequestObject))
	out.ResponseObject = (*runtime.Unknown)(unsafe.Pointer(in.ResponseObject))
	out.RequestReceivedTimestamp = in.RequestReceivedTimestamp
	out.StageTimestamp = in.StageTimestamp
	out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations))
	return nil
}

func autoConvert_v1alpha1_EventList_To_audit_EventList(in *EventList, out *audit.EventList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]audit.Event, len(*in))
		for i := range *in {
			if err := Convert_v1alpha1_Event_To_audit_Event(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_v1alpha1_EventList_To_audit_EventList is an autogenerated conversion function.
func Convert_v1alpha1_EventList_To_audit_EventList(in *EventList, out *audit.EventList, s conversion.Scope) error {
	return autoConvert_v1alpha1_EventList_To_audit_EventList(in, out, s)
}

func autoConvert_audit_EventList_To_v1alpha1_EventList(in *audit.EventList, out *EventList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]Event, len(*in))
		for i := range *in {
			if err := Convert_audit_Event_To_v1alpha1_Event(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_audit_EventList_To_v1alpha1_EventList is an autogenerated conversion function.
func Convert_audit_EventList_To_v1alpha1_EventList(in *audit.EventList, out *EventList, s conversion.Scope) error {
	return autoConvert_audit_EventList_To_v1alpha1_EventList(in, out, s)
}

func autoConvert_v1alpha1_GroupResources_To_audit_GroupResources(in *GroupResources, out *audit.GroupResources, s conversion.Scope) error {
	out.Group = in.Group
	out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
	out.ResourceNames = *(*[]string)(unsafe.Pointer(&in.ResourceNames))
	return nil
}

// Convert_v1alpha1_GroupResources_To_audit_GroupResources is an autogenerated conversion function.
func Convert_v1alpha1_GroupResources_To_audit_GroupResources(in *GroupResources, out *audit.GroupResources, s conversion.Scope) error {
	return autoConvert_v1alpha1_GroupResources_To_audit_GroupResources(in, out, s)
}

func autoConvert_audit_GroupResources_To_v1alpha1_GroupResources(in *audit.GroupResources, out *GroupResources, s conversion.Scope) error {
	out.Group = in.Group
	out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
	out.ResourceNames = *(*[]string)(unsafe.Pointer(&in.ResourceNames))
	return nil
}

// Convert_audit_GroupResources_To_v1alpha1_GroupResources is an autogenerated conversion function.
func Convert_audit_GroupResources_To_v1alpha1_GroupResources(in *audit.GroupResources, out *GroupResources, s conversion.Scope) error {
	return autoConvert_audit_GroupResources_To_v1alpha1_GroupResources(in, out, s)
}

func autoConvert_v1alpha1_ObjectReference_To_audit_ObjectReference(in *ObjectReference, out *audit.ObjectReference, s conversion.Scope) error {
	out.Resource = in.Resource
	out.Namespace = in.Namespace
	out.Name = in.Name
	out.UID = types.UID(in.UID)
	out.APIVersion = in.APIVersion
	out.ResourceVersion = in.ResourceVersion
	out.Subresource = in.Subresource
	return nil
}

func autoConvert_audit_ObjectReference_To_v1alpha1_ObjectReference(in *audit.ObjectReference, out *ObjectReference, s conversion.Scope) error {
	out.Resource = in.Resource
	out.Namespace = in.Namespace
	out.Name = in.Name
	out.UID = types.UID(in.UID)
	// WARNING: in.APIGroup requires manual conversion: does not exist in peer-type
	out.APIVersion = in.APIVersion
	out.ResourceVersion = in.ResourceVersion
	out.Subresource = in.Subresource
	return nil
}

func autoConvert_v1alpha1_Policy_To_audit_Policy(in *Policy, out *audit.Policy, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.Rules = *(*[]audit.PolicyRule)(unsafe.Pointer(&in.Rules))
	out.OmitStages = *(*[]audit.Stage)(unsafe.Pointer(&in.OmitStages))
	return nil
}

// Convert_v1alpha1_Policy_To_audit_Policy is an autogenerated conversion function.
func Convert_v1alpha1_Policy_To_audit_Policy(in *Policy, out *audit.Policy, s conversion.Scope) error {
	return autoConvert_v1alpha1_Policy_To_audit_Policy(in, out, s)
}

func autoConvert_audit_Policy_To_v1alpha1_Policy(in *audit.Policy, out *Policy, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.Rules = *(*[]PolicyRule)(unsafe.Pointer(&in.Rules))
	out.OmitStages = *(*[]Stage)(unsafe.Pointer(&in.OmitStages))
	return nil
}

// Convert_audit_Policy_To_v1alpha1_Policy is an autogenerated conversion function.
func Convert_audit_Policy_To_v1alpha1_Policy(in *audit.Policy, out *Policy, s conversion.Scope) error {
	return autoConvert_audit_Policy_To_v1alpha1_Policy(in, out, s)
}

func autoConvert_v1alpha1_PolicyList_To_audit_PolicyList(in *PolicyList, out *audit.PolicyList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]audit.Policy)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_v1alpha1_PolicyList_To_audit_PolicyList is an autogenerated conversion function.
func Convert_v1alpha1_PolicyList_To_audit_PolicyList(in *PolicyList, out *audit.PolicyList, s conversion.Scope) error {
	return autoConvert_v1alpha1_PolicyList_To_audit_PolicyList(in, out, s)
}

func autoConvert_audit_PolicyList_To_v1alpha1_PolicyList(in *audit.PolicyList, out *PolicyList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]Policy)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_audit_PolicyList_To_v1alpha1_PolicyList is an autogenerated conversion function.
func Convert_audit_PolicyList_To_v1alpha1_PolicyList(in *audit.PolicyList, out *PolicyList, s conversion.Scope) error {
	return autoConvert_audit_PolicyList_To_v1alpha1_PolicyList(in, out, s)
}

func autoConvert_v1alpha1_PolicyRule_To_audit_PolicyRule(in *PolicyRule, out *audit.PolicyRule, s conversion.Scope) error {
	out.Level = audit.Level(in.Level)
	out.Users = *(*[]string)(unsafe.Pointer(&in.Users))
	out.UserGroups = *(*[]string)(unsafe.Pointer(&in.UserGroups))
	out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
	out.Resources = *(*[]audit.GroupResources)(unsafe.Pointer(&in.Resources))
	out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces))
	out.NonResourceURLs = *(*[]string)(unsafe.Pointer(&in.NonResourceURLs))
	out.OmitStages = *(*[]audit.Stage)(unsafe.Pointer(&in.OmitStages))
	return nil
}

// Convert_v1alpha1_PolicyRule_To_audit_PolicyRule is an autogenerated conversion function.
func Convert_v1alpha1_PolicyRule_To_audit_PolicyRule(in *PolicyRule, out *audit.PolicyRule, s conversion.Scope) error {
	return autoConvert_v1alpha1_PolicyRule_To_audit_PolicyRule(in, out, s)
}

func autoConvert_audit_PolicyRule_To_v1alpha1_PolicyRule(in *audit.PolicyRule, out *PolicyRule, s conversion.Scope) error {
	out.Level = Level(in.Level)
	out.Users = *(*[]string)(unsafe.Pointer(&in.Users))
	out.UserGroups = *(*[]string)(unsafe.Pointer(&in.UserGroups))
	out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
	out.Resources = *(*[]GroupResources)(unsafe.Pointer(&in.Resources))
	out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces))
	out.NonResourceURLs = *(*[]string)(unsafe.Pointer(&in.NonResourceURLs))
	out.OmitStages = *(*[]Stage)(unsafe.Pointer(&in.OmitStages))
	return nil
}

// Convert_audit_PolicyRule_To_v1alpha1_PolicyRule is an autogenerated conversion function.
func Convert_audit_PolicyRule_To_v1alpha1_PolicyRule(in *audit.PolicyRule, out *PolicyRule, s conversion.Scope) error {
	return autoConvert_audit_PolicyRule_To_v1alpha1_PolicyRule(in, out, s)
}


text:
package main

import (
	"fmt"
	"os"
	"strings"

	"github.com/dokku/dokku/plugins/common"
	"github.com/dokku/dokku/plugins/registry"

	flag "github.com/spf13/pflag"
)

// main entrypoint to all subcommands
func main() {
	parts := strings.Split(os.Args[0], "/")
	subcommand := parts[len(parts)-1]

	var err error
	switch subcommand {
	case "login":
		args := flag.NewFlagSet("registry:login", flag.ExitOnError)
		passwordStdin := args.Bool("password-stdin", false, "--password-stdin: read password from stdin")
		args.Parse(os.Args[2:])
		server := args.Arg(0)
		username := args.Arg(1)
		password := args.Arg(2)
		err = registry.CommandLogin(server, username, password, *passwordStdin)
	case "report":
		args := flag.NewFlagSet("registry:report", flag.ExitOnError)
		format := args.String("format", "stdout", "format: [ stdout | json ]")
		osArgs, infoFlag, flagErr := common.ParseReportArgs("registry", os.Args[2:])
		if flagErr == nil {
			args.Parse(osArgs)
			appName := args.Arg(0)
			err = registry.CommandReport(appName, *format, infoFlag)
		}
	case "set":
		args := flag.NewFlagSet("registry:set", flag.ExitOnError)
		global := args.Bool("global", false, "--global: set a global property")
		args.Parse(os.Args[2:])
		appName := args.Arg(0)
		property := args.Arg(1)
		value := args.Arg(2)
		if *global {
			appName = "--global"
			property = args.Arg(0)
			value = args.Arg(1)
		}
		err = registry.CommandSet(appName, property, value)
	default:
		err = fmt.Errorf("Invalid plugin subcommand call: %s", subcommand)
	}

	if err != nil {
		common.LogFailWithError(err)
	}
}


text:
// The MIT License (MIT)

// Copyright (c) 2013 lailongwei<lailongwei@126.com>
//
// 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 __LLBC_CORE_LOG_LOGGER_CONFIG_INFO_H__
#define __LLBC_CORE_LOG_LOGGER_CONFIG_INFO_H__

#include "llbc/common/Common.h"

__LLBC_NS_BEGIN

/**
 * Previous declare some classes.
 */
class LLBC_Property;

__LLBC_NS_END

__LLBC_NS_BEGIN

/**
 * \brief The logger config info class encapsulation.
 */
class LLBC_LoggerConfigInfo
{
public:
    LLBC_LoggerConfigInfo();
    ~LLBC_LoggerConfigInfo();

public:
    /**
     * Initialize logger config.
     * @param[in] loggerName - the logger name.
     * @param[in] cfg        - config property.
     * @param[in] rootCfg    - the root logger config.
     * @return int - return 0 if success, otherwise return -1.
     */
    int Initialize(const LLBC_String &loggerName,
                   const LLBC_Property &cfg,
                   const LLBC_LoggerConfigInfo *rootCfg);

public:
    /**
     * Get logger name.
     * @return const LLBC_String & - the logger name.
     */
    const LLBC_String &GetLoggerName() const;

    /**
     * Get not config use option from root or not(use library default).
     * @return bool - the use root option.
     */
    bool IsNotConfigUseRoot() const;

public:
    /**
     * Get asynchronous mode switch.
     * @return bool - asynchronous mode switch.
     */
    bool IsAsyncMode() const;

    /**
     * Independent logger thread switch, only available in Async-Mode.
     * @return bool - independent logger thread switch.
     */
    bool IsIndependentThread() const;

    /**
     * Get file refresh interval.
     * @return int - the file refresh interval.
     */
    int GetFlushInterval() const;

public:
    /**
     * Get log to console switch.
     * @return bool - log to console switch.
     */
    bool IsLogToConsole() const;

    /**
     * Get console log level.
     * @return int - console log level
     */
    int GetConsoleLogLevel() const;

    /**
     * Get console log pattern.
     * @return const LLBC_String & - console log pattern.
     */
    const LLBC_String &GetConsolePattern() const;

    /**
     * Get colorful output flag(only available in WIN platform).
     * @return bool - the colorful output flag.
     */
    bool IsColourfulOutput() const;

public:
    /**
     * Get log to file switch.
     * @return bool - log to file switch.
     */
    bool IsLogToFile() const;

    /**
     * Get file log level.
     * @return int - file log level.
     */
    int GetFileLogLevel() const;

    /**
     * Get file log pattern.
     * @return const LLBC_String & - file log pattern.
     */
    const LLBC_String &GetFilePattern() const;

    /**
     * Get log directory.
     * @return const LLBC_String & - log directory.
     */
    const LLBC_String &GetLogDir() const;

    /**
     * Get log file name.
     * @return const LLBC_String & - log file name.
     */
    const LLBC_String &GetLogFile() const;

    /**
     * Get log file suffix.
     * @return const LLBC_String & - log file suffix.
     */
    const LLBC_String &GetLogFileSuffix() const;

    /**
     * Get log file path or not, when log code file name(%f).
     * @return bool - log file path flag, if true, log file path, otherwise only log file name.
     */
    bool IsLogCodeFilePath() const;

    /**
     * Get force application log path flag
     * @return const bool - log path flag
     */
    bool IsForceAppLogPath() const;

    /**
     * Get daily rolling mode switch(available in file appender).
     * @return bool - daily rolling mode switch.
     */
    bool IsDailyRollingMode() const;

    /**
     * Get max log file size.
     * @return long - max log file size.
     */
    long GetMaxFileSize() const;

    /**
     * Get max backup log file index.
     * @return int - max backup log file index.
     */
    int GetMaxBackupIndex() const;

    /**
     * Get file buffer size.
     * @return int - the file buffer size.
     */
    int GetFileBufferSize() const;

public:
    /**
     * Get take over option.
     * @return bool - take over option.
     */
    bool IsTakeOver() const;

public:
    /**
     * Get logfile create option.
     * @return bool - logfile create option.
     */
    bool IsLazyCreateLogFile() const;

private:
    /**
     * Normalize the log file name.
     */
    void NormalizeLogFileName();

    /**
     * Disable assignment.
     */
    LLBC_DISABLE_ASSIGNMENT(LLBC_LoggerConfigInfo);

private:
    LLBC_String _loggerName;
    bool _notConfigUseRoot;

    int _logLevel;
    bool _asyncMode;
    bool _independentThread;
    int _flushInterval;

    bool _logToConsole;
    int _consoleLogLevel;
    LLBC_String _consolePattern;
    bool _colourfulOutput;

    bool _logToFile;
    int _fileLogLevel;
    LLBC_String _logDir;
    LLBC_String _logFile;
    LLBC_String _logFileSuffix;
    bool _logCodeFilePath;
    bool _forceAppLogPath;
    LLBC_String _filePattern;
    bool _dailyMode;
    long _maxFileSize;
    int _maxBackupIndex;
    int _fileBufferSize;
    bool _lazyCreateLogFile;

    bool _takeOver;
};

__LLBC_NS_END

#include "llbc/core/log/LoggerConfigInfoInl.h"

#endif // !__LLBC_CORE_LOG_LOGGER_CONFIG_INFO_H__


text:
<!DOCTYPE html
      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--[if lt IE9] --><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{site.lang}}" lang="{{site.lang}}" class="oldie"><!--{endif]-->
  {% include page/head.html %}
  <body>
    {% if site.facebook.app_id %}
    {% include facebook/basescript.js %}
    {% endif %}
    {% include page/header.html %}
    {% include debug/debug_output_url.html %}
    <div id="page-wrapper">
{{ content }}
    {% include page/footer.html %}
    </div>
    {% include google/googleanalytics.html %}
    {% include google/plusone.html %}
    {% if page.uservoice.enable or site.uservoice.enableall %}
        {% include uservoice.html %}
    {% endif %}
    {% if page.custom_js %}
      {% for js_file in page.custom_js %}
        <script src='/js/{{ js_file }}.js' type="text/javascript"></script>
      {% endfor %}
    {% endif %}
    <script type="text/javascript">
        pagePosCustonFuntions = function(){
        {% for js_function in page.custom_js.functions.pos %}
          {{ js_function }};
        {% endfor %}
        };
    </script>
    <script src="{{ site.baseurl }}/js/main.js"></script>
  </body>
</html>


text:
namespace courgette {

namespace {

// Helper class to load and execute a Rel32FinderWin32X86 test case.
class Rel32FinderWin32X86TestCase {
 public:
  Rel32FinderWin32X86TestCase(const std::string& test_data)
      : text_start_rva_(0),
        text_end_rva_(0),
        relocs_start_rva_(0),
        relocs_end_rva_(0),
        image_end_rva_(0) {
    LoadTestFromString(test_data);
  }

  void RunTestBasic(std::string name) {
    Rel32FinderWin32X86_Basic finder(relocs_start_rva_, relocs_end_rva_,
                                     image_end_rva_);
    ASSERT_FALSE(text_data_.empty());
    finder.Find(&text_data_[0], &text_data_[0] + text_data_.size(),
        text_start_rva_, text_end_rva_, abs32_locations_);
    std::vector<RVA> rel32_locations;
    finder.SwapRel32Locations(&rel32_locations);
    EXPECT_EQ(expected_rel32_locations_, rel32_locations)
        << "From test case " << name << " (addresses are in hex)";
  }

 private:
  RVA text_start_rva_;
  RVA text_end_rva_;
  RVA relocs_start_rva_;
  RVA relocs_end_rva_;
  RVA image_end_rva_;
  std::vector<uint8_t> text_data_;
  std::vector<RVA> abs32_locations_;
  std::vector<RVA> expected_rel32_locations_;

  // Scans |iss| for the next non-empty line, after removing "#"-style comments
  // and stripping trailing spaces. On success, returns true and writes the
  // result to |line_out|. Otherwise returns false.
  bool ReadNonEmptyLine(std::istringstream& iss, std::string* line_out) {
    std::string line;
    while (std::getline(iss, line)) {
      // Trim comments and trailing spaces.
      size_t end_pos = std::min(line.find("#"), line.length());
      while (end_pos > 0 && line[end_pos] == ' ')
        --end_pos;
      line.resize(end_pos);
      if (!line.empty())
        break;
    }
    if (line.empty())
      return false;
    line_out->swap(line);
    return true;
  }

  // Scans |iss| for the next non-empty line, and reads (hex) uint32_t into |v|.
  // Returns true iff successful.
  bool ReadHexUInt32(std::istringstream& iss, uint32_t* v) {
    std::string line;
    if (!ReadNonEmptyLine(iss, &line))
      return false;
    return sscanf(line.c_str(), "%X", v) == 1;
  }

  // Initializes the test case by parsing the multi-line string |test_data|
  // to extract Rel32FinderWin32X86 parameters, and read expected values.
  void LoadTestFromString(const std::string& test_data) {
    // The first lines (ignoring empty ones) specify RVA bounds.
    std::istringstream iss(test_data);
    ASSERT_TRUE(ReadHexUInt32(iss, &text_start_rva_));
    ASSERT_TRUE(ReadHexUInt32(iss, &text_end_rva_));
    ASSERT_TRUE(ReadHexUInt32(iss, &relocs_start_rva_));
    ASSERT_TRUE(ReadHexUInt32(iss, &relocs_end_rva_));
    ASSERT_TRUE(ReadHexUInt32(iss, &image_end_rva_));

    std::string line;
    // The Program section specifies instruction bytes. We require lines to be
    // formatted in "DUMPBIN /DISASM" style, i.e.,
    // "00401003: E8 00 00 00 00     call        00401008"
    //            ^  ^  ^  ^  ^  ^
    // We extract up to 6 bytes per line. The remaining are ignored.
    const int kBytesBegin = 12;
    const int kBytesEnd = 17;
    ReadNonEmptyLine(iss, &line);
    ASSERT_EQ("Program:", line);
    while (ReadNonEmptyLine(iss, &line) && line != "Abs32:") {
      std::string toks = line.substr(kBytesBegin, kBytesEnd);
      uint32_t vals[6];
      int num_read = sscanf(toks.c_str(), "%X %X %X %X %X %X", &vals[0],
          &vals[1], &vals[2], &vals[3], &vals[4], &vals[5]);
      for (int i = 0; i < num_read; ++i)
        text_data_.push_back(static_cast<uint8_t>(vals[i] & 0xFF));
    }
    ASSERT_FALSE(text_data_.empty());

    // The Abs32 section specifies hex RVAs, one per line.
    ASSERT_EQ("Abs32:", line);
    while (ReadNonEmptyLine(iss, &line) && line != "Expected:") {
      RVA abs32_location;
      ASSERT_EQ(1, sscanf(line.c_str(), "%X", &abs32_location));
      abs32_locations_.push_back(abs32_location);
    }

    // The Expected section specifies hex Rel32 RVAs, one per line.
    ASSERT_EQ("Expected:", line);
    while (ReadNonEmptyLine(iss, &line)) {
      RVA rel32_location;
      ASSERT_EQ(1, sscanf(line.c_str(), "%X", &rel32_location));
      expected_rel32_locations_.push_back(rel32_location);
    }
  }
};

class Rel32FinderWin32X86Test : public BaseTest {
 public:
  void RunTest(const char* test_case_file) {
    Rel32FinderWin32X86TestCase test_case(FileContents(test_case_file));
    test_case.RunTestBasic(test_case_file);
  }
};

TEST_F(Rel32FinderWin32X86Test, TestBasic) {
  RunTest("rel32_win32_x86_01.txt");
  RunTest("rel32_win32_x86_02.txt");
  RunTest("rel32_win32_x86_03.txt");
  RunTest("rel32_win32_x86_04.txt");
}

}  // namespace

}  // namespace courgette


text:
class Gws::Board::CommentsController < ApplicationController
  include Gws::BaseFilter
  include Gws::CrudFilter
  include Gws::Board::BaseFilter
  include Gws::Memo::NotificationFilter

  model Gws::Board::Post

  navi_view "gws/board/main/navi"

  private

  def fix_params
    { cur_user: @cur_user, cur_site: @cur_site, topic_id: params[:topic_id], parent_id: params[:parent_id] }
  end

  def pre_params
    @topic.groups.active.pluck(:id) + @cur_user.groups.site(@cur_site).active.pluck(:id)
    {
      name: "Re: #{@parent.name}",
      group_ids: (@topic.groups.site(@cur_site).active.pluck(:id) + @cur_user.groups.site(@cur_site).active.pluck(:id)).uniq,
      user_ids: (@topic.users.site(@cur_site).active.pluck(:id) + [ @cur_user.id ]).uniq
    }
  end

  def editable?
    # admin?
    return true if @topic.allowed?(:edit, @cur_user, site: @cur_site, adds_error: false)

    # member?
    if @topic.member?(@cur_user)
      return true if (@item.group_ids & @cur_user.group_ids).present?
      return true if @item.user_ids.include?(@cur_user.id)
    end

    # otherwise
    false
  end

  def deletable?
    # admin?
    return true if @topic.allowed?(:delete, @cur_user, site: @cur_site, adds_error: false)

    # member?
    if @topic.member?(@cur_user)
      return true if (@item.group_ids & @cur_user.group_ids).present?
      return true if @item.user_ids.include?(@cur_user.id)
    end

    # otherwise
    false
  end

  public

  def index
    redirect_to gws_board_topic_path(id: @topic.id)
  end

  def show
    redirect_to gws_board_topic_path(id: @topic.id)
  end

  def new
    @item = @model.new pre_params.merge(fix_params)
    allowed = @item.allowed?(:edit, @cur_user, site: @cur_site, adds_error: false)
    member = @topic.member?(@cur_user)
    raise "403" if !(allowed || member)
  end

  def create
    @item = @model.new get_params
    allowed = @item.allowed?(:edit, @cur_user, site: @cur_site, strict: true, adds_error: false)
    member = @topic.member?(@cur_user)
    if !(allowed || member)
      @item.errors.add(:base, :auth_error)
      return render_create(false)
    end
    render_create @item.save
  end

  def edit
    raise "403" unless editable?

    if @item.is_a?(Cms::Addon::EditLock) && !@item.acquire_lock
      redirect_to action: :lock
      return
    end

    render
  end

  def update
    @item.attributes = get_params
    @item.in_updated = params[:_updated] if @item.respond_to?(:in_updated)
    if !editable?
      @item.errors.add(:base, :auth_error)
      return render_update(false)
    end
    render_update @item.save
  end

  def delete
    raise "403" unless deletable?

    render
  end

  def destroy
    raise "403" unless deletable?

    render_destroy @item.destroy
  end
end


text:
require 'simplecov'
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]
SimpleCov.start

require File.expand_path('../../lib/user_agent_randomizer', __FILE__)