code
stringlengths
5
1.01M
repo_name
stringlengths
5
84
path
stringlengths
4
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
5
1.01M
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
""" This page is in the table of contents. Skeinlayer is an analyze viewer to display each layer of a gcode file. The skeinlayer manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Skeinlayer Skeinlayer is derived from Nophead's preview script. The extruded lines are in the resistor colors red, orange, yellow, green, blue, purple & brown. When the extruder is off, the travel line is grey. Skeinlayer is useful for a detailed view of the extrusion, skeiniso is better to see the orientation of the shape. To get an initial overview of the skein, when the skeinlayer display window appears, click the Soar button (double right arrow button beside the layer field). ==Operation== The default 'Activate Skeinlayer' checkbox is on. When it is on, the functions described below will work when called from the skeinforge toolchain, when it is off, the functions will not be called from the toolchain. The functions will still be called, whether or not the 'Activate Skeinlayer' checkbox is on, when skeinlayer is run directly. Skeinlayer has trouble separating the layers when it reads gcode without comments. ==Settings== ===Animation=== ====Animation Line Quickening==== Default is one. The quickness of the tool animation over the quickness of the actual tool. ====Animation Slide Show Rate==== Default is two layers per second. The rate, in layers per second, at which the layer changes when the soar or dive button is pressed.. ===Draw Arrows=== Default is on. When selected, arrows will be drawn at the end of each line segment. ===Export Menu=== When the submenu in the export menu item in the file menu is clicked, an export canvas dialog will be displayed, which can export the canvas to a file. ===Go Around Extruder Off Travel=== Default is off. When selected, the display will include the travel when the extruder is off, which means it will include the nozzle wipe path if any. ===Layers=== ====Layer==== Default is zero. On the display window, the Up button increases the 'Layer' by one, and the Down button decreases the layer by one. When the layer displayed in the layer spin box is changed then <Return> is hit, the layer shown will be set to the spin box, to a mimimum of zero and to a maximum of the highest index layer.The Soar button increases the layer at the 'Animation Slide Show Rate', and the Dive (double left arrow button beside the layer field) button decreases the layer at the slide show rate. ====Layer Extra Span==== Default is zero. The viewer will draw the layers in the range including the 'Layer' index and the 'Layer' index plus the 'Layer Extra Span'. If the 'Layer Extra Span' is negative, the layers viewed will start at the 'Layer' index, plus the 'Layer Extra Span', and go up to and include the 'Layer' index. If the 'Layer Extra Span' is zero, only the 'Layer' index layer will be displayed. If the 'Layer Extra Span' is positive, the layers viewed will start at the 'Layer' index, and go up to and include the 'Layer' index plus the 'Layer Extra Span'. ===Line=== Default is zero. The index of the selected line on the layer that is highlighted when the 'Display Line' mouse tool is chosen. The line spin box up button increases the 'Line' by one. If the line index of the layer goes over the index of the last line, the layer index will be increased by one and the new line index will be zero. The down button decreases the line index by one. If the line index goes below the index of the first line, the layer index will be decreased by one and the new line index will be at the last line. When the line displayed in the line field is changed then <Return> is hit, the line shown will be set to the line field, to a mimimum of zero and to a maximum of the highest index line. The Soar button increases the line at the speed at which the extruder would move, times the 'Animation Line Quickening' ratio, and the Dive (double left arrow button beside the line field) button decreases the line at the animation line quickening ratio. ===Mouse Mode=== Default is 'Display Line'. The mouse tool can be changed from the 'Mouse Mode' menu button or picture button. The mouse tools listen to the arrow keys when the canvas has the focus. Clicking in the canvas gives the canvas the focus, and when the canvas has the focus a thick black border is drawn around the canvas. ====Display Line==== The 'Display Line' tool will display the highlight the selected line, and display the file line count, counting from one, and the gcode line itself. When the 'Display Line' tool is active, clicking the canvas will select the closest line to the mouse click. ====Viewpoint Move==== The 'Viewpoint Move' tool will move the viewpoint in the xy plane when the mouse is clicked and dragged on the canvas. ===Numeric Pointer=== Default is on. When selected, the distance along the ruler of the arrow pointers will be drawn next to the pointers. ===Scale=== Default is ten. The scale setting is the scale of the image in pixels per millimeter, the higher the number, the greater the size of the display. The zoom in mouse tool will zoom in the display at the point where the mouse was clicked, increasing the scale by a factor of two. The zoom out tool will zoom out the display at the point where the mouse was clicked, decreasing the scale by a factor of two. ===Screen Inset=== ====Screen Horizontal Inset==== Default is one hundred. The "Screen Horizontal Inset" determines how much the canvas will be inset in the horizontal direction from the edge of screen, the higher the number the more it will be inset and the smaller it will be. ====Screen Vertical Inset==== Default is two hundred and twenty. The "Screen Vertical Inset" determines how much the canvas will be inset in the vertical direction from the edge of screen, the higher the number the more it will be inset and the smaller it will be. ===Width=== The width of each type of thread and of each axis can be changed. If the width is set to zero, the thread will not be visible. ====Width of Extrusion Thread==== Default is three. The "Width of Extrusion Thread" sets the width of the extrusion threads. ====Width of Selection Thread==== Default is six. The "Width of Selection Thread" sets the width of the selected line. ====Width of Travel Thread==== Default is one. The "Width of Travel Thread" sets the width of the grey extruder off travel threads. ==Icons== The dive, soar and zoom icons are from Mark James' soarSilk icon set 1.3 at: http://www.famfamfam.com/lab/icons/silk/ ==Gcodes== An explanation of the gcodes is at: http://reprap.org/bin/view/Main/Arduino_GCode_Interpreter and at: http://reprap.org/bin/view/Main/MCodeReference A gode example is at: http://forums.reprap.org/file.php?12,file=565 ==Examples== Below are examples of skeinlayer being used. These examples are run in a terminal in the folder which contains Screw Holder_penultimate.gcode and skeinlayer.py. > python skeinlayer.py This brings up the skeinlayer dialog. > python skeinlayer.py Screw Holder_penultimate.gcode This brings up the skeinlayer viewer to view each layer of a gcode file. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.vector3 import Vector3 from fabmetheus_utilities import archive from fabmetheus_utilities import euclidean from fabmetheus_utilities import gcodec from fabmetheus_utilities import settings from skeinforge_application.skeinforge_plugins.analyze_plugins.analyze_utilities import display_line from skeinforge_application.skeinforge_plugins.analyze_plugins.analyze_utilities import tableau from skeinforge_application.skeinforge_plugins.analyze_plugins.analyze_utilities import view_move from skeinforge_application.skeinforge_utilities import skeinforge_polyfile from skeinforge_application.skeinforge_utilities import skeinforge_profile import os import sys __author__ = 'Enrique Perez (perez_enrique@yahoo.com)' __date__ = '$Date: 2008/21/04 $' __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' def getNewRepository(): 'Get new repository.' return SkeinlayerRepository() def getRankIndex( rulingSeparationWidthMillimeters, screenOrdinate ): "Get rank index." return int( round( screenOrdinate / rulingSeparationWidthMillimeters ) ) def getWindowAnalyzeFile(fileName): "Display a gcode file in a skeinlayer window." gcodeText = archive.getFileText(fileName) return getWindowAnalyzeFileGivenText(fileName, gcodeText) def getWindowAnalyzeFileGivenText( fileName, gcodeText, repository=None): "Display a gcode file in a skeinlayer window given the text." if gcodeText == '': return None if repository == None: repository = settings.getReadRepository( SkeinlayerRepository() ) skeinWindow = getWindowGivenTextRepository( fileName, gcodeText, repository ) skeinWindow.updateDeiconify() return skeinWindow def getWindowGivenTextRepository( fileName, gcodeText, repository ): "Display a gcode file in a skeinlayer window given the text and settings." skein = SkeinlayerSkein() skein.parseGcode( fileName, gcodeText, repository ) return SkeinWindow( repository, skein ) def writeOutput(fileName, fileNamePenultimate, fileNameSuffix, filePenultimateWritten, gcodeText=''): "Display a skeinlayered gcode file for a skeinforge gcode file, if 'Activate Skeinlayer' is selected." try: import Tkinter except: try: import tkinter as Tkinter except: print('Warning, skeinlayer will do nothing because Tkinter is not installed.') return repository = settings.getReadRepository( SkeinlayerRepository() ) if repository.activateSkeinlayer.value: gcodeText = archive.getTextIfEmpty( fileNameSuffix, gcodeText ) return getWindowAnalyzeFileGivenText( fileNameSuffix, gcodeText, repository ) class SkeinlayerRepository( tableau.TableauRepository ): "A class to handle the skeinlayer settings." def __init__(self): "Set the default settings, execute title & settings fileName." skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.analyze_plugins.skeinlayer.html', self) self.baseNameSynonym = 'skeinview.csv' self.fileNameInput = settings.FileNameInput().getFromFileName( [ ('Gcode text files', '*.gcode') ], 'Open File for Skeinlayer', self, '') self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Skeinlayer') self.activateSkeinlayer = settings.BooleanSetting().getFromValue('Activate Skeinlayer', self, True ) self.addAnimation() self.drawArrows = settings.BooleanSetting().getFromValue('Draw Arrows', self, True ) self.goAroundExtruderOffTravel = settings.BooleanSetting().getFromValue('Go Around Extruder Off Travel', self, False ) settings.LabelSeparator().getFromRepository(self) settings.LabelDisplay().getFromName('- Layers -', self ) self.layer = settings.IntSpinNotOnMenu().getSingleIncrementFromValue( 0, 'Layer (index):', self, 912345678, 0 ) self.layerExtraSpan = settings.IntSpinUpdate().getSingleIncrementFromValue( - 3, 'Layer Extra Span (integer):', self, 3, 0 ) settings.LabelSeparator().getFromRepository(self) self.line = settings.IntSpinNotOnMenu().getSingleIncrementFromValue( 0, 'Line (index):', self, 912345678, 0 ) self.mouseMode = settings.MenuButtonDisplay().getFromName('Mouse Mode:', self ) self.displayLine = settings.MenuRadio().getFromMenuButtonDisplay( self.mouseMode, 'Display Line', self, True ) self.viewMove = settings.MenuRadio().getFromMenuButtonDisplay( self.mouseMode, 'View Move', self, False ) self.addScaleScreenSlide() self.showPosition = settings.BooleanSetting().getFromValue('Show Position', self, True ) settings.LabelSeparator().getFromRepository(self) settings.LabelDisplay().getFromName('- Width -', self ) self.widthOfExtrusionThread = settings.IntSpinUpdate().getSingleIncrementFromValue( 0, 'Width of Extrusion Thread (pixels):', self, 5, 3 ) self.widthOfSelectionThread = settings.IntSpinUpdate().getSingleIncrementFromValue( 0, 'Width of Selection Thread (pixels):', self, 10, 6 ) self.widthOfTravelThread = settings.IntSpinUpdate().getSingleIncrementFromValue( 0, 'Width of Travel Thread (pixels):', self, 5, 1 ) self.executeTitle = 'Skeinlayer' def execute(self): "Write button has been clicked." fileNames = skeinforge_polyfile.getFileOrGcodeDirectory( self.fileNameInput.value, self.fileNameInput.wasCancelled ) for fileName in fileNames: getWindowAnalyzeFile(fileName) class SkeinlayerSkein: "A class to write a get a scalable vector graphics text for a gcode skein." def __init__(self): 'Initialize.' self.extrusionNumber = 0 self.feedRateMinute = 960.1 self.isThereALayerStartWord = False self.layerCount = settings.LayerCount() self.oldZ = - 999987654321.0 self.skeinPane = None self.skeinPanes = [] def addToPath( self, line, location ): "Add a point to travel and maybe extrusion." if self.oldLocation == None: return colorName = 'gray' locationComplex = location.dropAxis() oldLocationComplex = self.oldLocation.dropAxis() begin = self.getScreenCoordinates( oldLocationComplex ) end = self.getScreenCoordinates( locationComplex ) if self.extruderActive: colorName = self.colorNames[ self.extrusionNumber % len( self.colorNames ) ] displayString = '%s %s' % ( self.lineIndex + 1, line ) tagString = 'colored_line_index: %s %s' % ( len( self.skeinPane ), len( self.skeinPanes ) - 1 ) coloredLine = tableau.ColoredLine( begin, colorName, displayString, end, tagString ) coloredLine.isExtrusionThread = self.extruderActive self.skeinPane.append( coloredLine ) def getModelCoordinates( self, screenCoordinates ): "Get the model coordinates." modelCoordinates = ( screenCoordinates + self.marginCornerLow ) / self.scale return complex( modelCoordinates.real, self.cornerImaginaryTotal - modelCoordinates.imag ) def getScreenCoordinates( self, pointComplex ): "Get the screen coordinates." pointComplex = complex( pointComplex.real, self.cornerImaginaryTotal - pointComplex.imag ) return self.scale * pointComplex - self.marginCornerLow def initializeActiveLocation(self): "Set variables to default." self.extruderActive = False self.oldLocation = None def linearCorner( self, splitLine ): "Update the bounding corners." location = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine) if self.extruderActive or self.repository.goAroundExtruderOffTravel.value: self.cornerMaximum.maximize(location) self.cornerMinimum.minimize(location) self.oldLocation = location def linearMove( self, line, location ): "Get statistics for a linear move." if self.skeinPane != None: self.addToPath(line, location) def parseCorner(self, line): "Parse a gcode line and use the location to update the bounding corners." splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line) if len(splitLine) < 1: return firstWord = splitLine[0] if firstWord == 'G1': self.linearCorner(splitLine) elif firstWord == 'M101': self.extruderActive = True elif firstWord == 'M103': self.extruderActive = False def parseGcode( self, fileName, gcodeText, repository ): "Parse gcode text and store the vector output." self.fileName = fileName self.gcodeText = gcodeText self.repository = repository self.initializeActiveLocation() self.cornerMaximum = Vector3(-987654321.0, -987654321.0, -987654321.0) self.cornerMinimum = Vector3(987654321.0, 987654321.0, 987654321.0) self.lines = archive.getTextLines(gcodeText) self.isThereALayerStartWord = (gcodec.getFirstWordIndexReverse('(<layer>', self.lines, 1) > -1) self.parseInitialization() for line in self.lines[self.lineIndex :]: self.parseCorner(line) self.cornerMaximumComplex = self.cornerMaximum.dropAxis() self.cornerMinimumComplex = self.cornerMinimum.dropAxis() self.scale = repository.scale.value self.scaleCornerHigh = self.scale * self.cornerMaximumComplex self.scaleCornerLow = self.scale * self.cornerMinimumComplex self.cornerImaginaryTotal = self.cornerMaximum.y + self.cornerMinimum.y self.margin = complex( 10.0, 10.0 ) self.marginCornerHigh = self.scaleCornerHigh + self.margin self.marginCornerLow = self.scaleCornerLow - self.margin self.screenSize = self.marginCornerHigh - self.marginCornerLow self.initializeActiveLocation() self.colorNames = ['brown', 'red', 'orange', 'yellow', 'green', 'blue', 'purple'] for self.lineIndex in xrange(self.lineIndex, len(self.lines)): line = self.lines[self.lineIndex] self.parseLine(line) def parseInitialization(self): 'Parse gcode initialization and store the parameters.' for self.lineIndex in xrange(len(self.lines)): line = self.lines[self.lineIndex] splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line) firstWord = gcodec.getFirstWord(splitLine) if firstWord == '(</extruderInitialization>)': return elif firstWord == '(<operatingFeedRatePerSecond>': self.feedRateMinute = 60.0 * float(splitLine[1]) self.lineIndex = 0 def parseLine(self, line): "Parse a gcode line and add it to the vector output." splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line) if len(splitLine) < 1: return firstWord = splitLine[0] if tableau.getIsLayerStart(firstWord, self, splitLine): self.extrusionNumber = 0 self.layerCount.printProgressIncrement('skeinlayer') self.skeinPane = [] self.skeinPanes.append( self.skeinPane ) if firstWord == 'G1': location = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine) self.linearMove(line, location) self.oldLocation = location elif firstWord == 'M101': self.extruderActive = True self.extrusionNumber += 1 elif firstWord == 'M103': self.extruderActive = False if firstWord == 'G2' or firstWord == 'G3': relativeLocation = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine) relativeLocation.z = 0.0 location = self.oldLocation + relativeLocation self.linearMove(line, location) self.oldLocation = location class SkeinWindow( tableau.TableauWindow ): def __init__(self, repository, skein): "Initialize the skein window.setWindowNewMouseTool" self.addCanvasMenuRootScrollSkein(repository, skein, '_skeinlayer', 'Skeinlayer') horizontalRulerBoundingBox = (0, 0, int( skein.screenSize.real ), self.rulingExtent) self.horizontalRulerCanvas = settings.Tkinter.Canvas(self.root, width = self.canvasWidth, height = self.rulingExtent, scrollregion=horizontalRulerBoundingBox) self.horizontalRulerCanvas.grid(row=1, column=2, columnspan=96, sticky=settings.Tkinter.E+settings.Tkinter.W) self.horizontalRulerCanvas['xscrollcommand'] = self.xScrollbar.set verticalRulerBoundingBox = (0, 0, self.rulingExtent, int(skein.screenSize.imag)) self.verticalRulerCanvas = settings.Tkinter.Canvas(self.root, width=self.rulingExtent, height=self.canvasHeight, scrollregion=verticalRulerBoundingBox) self.verticalRulerCanvas.grid(row=2, rowspan=96, column=1, sticky=settings.Tkinter.N+settings.Tkinter.S) self.verticalRulerCanvas['yscrollcommand'] = self.yScrollbar.set self.xStringVar = settings.Tkinter.StringVar(self.root) self.xLabel = settings.Tkinter.Label(self.root, textvariable=self.xStringVar) self.xLabel.grid(row=0, column=3, sticky=settings.Tkinter.W) self.yStringVar = settings.Tkinter.StringVar(self.root) self.yLabel = settings.Tkinter.Label(self.root, textvariable=self.yStringVar) self.yLabel.grid(row=0, column=4, sticky=settings.Tkinter.W) self.setWindowNewMouseTool(display_line.getNewMouseTool, repository.displayLine) self.setWindowNewMouseTool(view_move.getNewMouseTool, repository.viewMove) repository.showPosition.setUpdateFunction(self.setWindowToDisplaySaveUpdate) repository.widthOfExtrusionThread.setUpdateFunction(self.setWindowToDisplaySaveUpdate) self.addMouseToolsBind() self.createRulers() def addHorizontalRulerRuling( self, xMillimeters ): "Add a ruling to the horizontal ruler." xPixel = self.skein.getScreenCoordinates( complex( xMillimeters, 0.0 ) ).real self.createVerticalLine( 0.0, xPixel ) self.horizontalRulerCanvas.create_text( xPixel + 2, 0, anchor = settings.Tkinter.NW, text = self.getRoundedRulingText( 1, xMillimeters ) ) cumulativeDistance = xMillimeters self.createVerticalLine( self.rulingExtentTiny, self.skein.getScreenCoordinates( complex( xMillimeters + self.separationWidthMillimetersTenth, 0.0 ) ).real ) for subRulingIndex in xrange(4): cumulativeDistance += self.separationWidthMillimetersFifth self.createVerticalLine( self.rulingExtentShort, self.skein.getScreenCoordinates( complex( cumulativeDistance, 0.0 ) ).real ) self.createVerticalLine( self.rulingExtentTiny, self.skein.getScreenCoordinates( complex( cumulativeDistance + self.separationWidthMillimetersTenth, 0.0 ) ).real ) def addVerticalRulerRuling( self, yMillimeters ): "Add a ruling to the vertical ruler." fontHeight = 12 yPixel = self.skein.getScreenCoordinates( complex( 0.0, yMillimeters ) ).imag self.createHorizontalLine( 0.0, yPixel ) yPixel += 2 roundedRulingText = self.getRoundedRulingText( 1, yMillimeters ) effectiveRulingTextLength = len( roundedRulingText ) if roundedRulingText.find('.') != - 1: effectiveRulingTextLength -= 1 cumulativeDistance = yMillimeters self.createHorizontalLine( self.rulingExtentTiny, self.skein.getScreenCoordinates( complex( 0.0, yMillimeters + self.separationWidthMillimetersTenth ) ).imag ) for subRulingIndex in xrange(4): cumulativeDistance += self.separationWidthMillimetersFifth self.createHorizontalLine( self.rulingExtentShort, self.skein.getScreenCoordinates( complex( 0.0, cumulativeDistance ) ).imag ) self.createHorizontalLine( self.rulingExtentTiny, self.skein.getScreenCoordinates( complex( 0.0, cumulativeDistance + self.separationWidthMillimetersTenth ) ).imag ) if effectiveRulingTextLength < 4: self.verticalRulerCanvas.create_text( 0, yPixel, anchor = settings.Tkinter.NW, text = roundedRulingText ) return for character in roundedRulingText: if character == '.': yPixel -= fontHeight * 2 / 3 self.verticalRulerCanvas.create_text( 0, yPixel, anchor = settings.Tkinter.NW, text = character ) yPixel += fontHeight def createHorizontalLine( self, begin, yPixel ): "Create a horizontal line for the horizontal ruler." self.verticalRulerCanvas.create_line( begin, yPixel, self.rulingExtent, yPixel, fill = 'black') def createRulers(self): "Create the rulers.." self.rulingExtentShort = 0.382 * self.rulingExtent self.rulingExtentTiny = 0.764 * self.rulingExtent self.rulingExtentPointer = 0.5 * ( self.rulingExtentShort + self.rulingExtentTiny ) self.rulingPointerRadius = self.rulingExtent - self.rulingExtentPointer self.textBoxHeight = int( 0.8 * self.rulingExtent ) self.textBoxWidth = int( 2.5 * self.rulingExtent ) self.separationWidthMillimetersFifth = 0.2 * self.rulingSeparationWidthMillimeters self.separationWidthMillimetersTenth = 0.1 * self.rulingSeparationWidthMillimeters rulingSeparationWidthPixels = self.getRulingSeparationWidthPixels( self.rank ) marginOverScale = self.skein.margin / self.skein.scale cornerMaximumMargin = self.skein.cornerMaximumComplex + marginOverScale cornerMinimumMargin = self.skein.cornerMinimumComplex - marginOverScale xRankIndexHigh = getRankIndex( self.rulingSeparationWidthMillimeters, cornerMaximumMargin.real ) xRankIndexLow = getRankIndex( self.rulingSeparationWidthMillimeters, cornerMinimumMargin.real ) for xRankIndex in xrange( xRankIndexLow - 2, xRankIndexHigh + 2 ): # 1 is enough, 2 is to be on the safe side self.addHorizontalRulerRuling( xRankIndex * self.rulingSeparationWidthMillimeters ) yRankIndexHigh = getRankIndex( self.rulingSeparationWidthMillimeters, cornerMaximumMargin.imag ) yRankIndexLow = getRankIndex( self.rulingSeparationWidthMillimeters, cornerMinimumMargin.imag ) for yRankIndex in xrange( yRankIndexLow - 2, yRankIndexHigh + 2 ): # 1 is enough, 2 is to be on the safe side self.addVerticalRulerRuling( yRankIndex * self.rulingSeparationWidthMillimeters ) def createVerticalLine( self, begin, xPixel ): "Create a vertical line for the horizontal ruler." self.horizontalRulerCanvas.create_line( xPixel, begin, xPixel, self.rulingExtent, fill = 'black') def getColoredLines(self): "Get the colored lines from the skein pane." if len(self.skeinPanes) == 0: return [] return self.skeinPanes[self.repository.layer.value] def getCopy(self): "Get a copy of this window." return SkeinWindow(self.repository, self.skein) def getCopyWithNewSkein(self): "Get a copy of this window with a new skein." return getWindowGivenTextRepository( self.skein.fileName, self.skein.gcodeText, self.repository ) def getDrawnColoredLine( self, coloredLine, tags, width ): "Get the drawn colored line." return self.canvas.create_line( coloredLine.begin.real, coloredLine.begin.imag, coloredLine.end.real, coloredLine.end.imag, fill = coloredLine.colorName, arrow = self.arrowType, tags = tags, width = width ) def getDrawnColoredLineIfThick( self, coloredLine, width ): "Get the drawn colored line if it has a positive thickness." if width > 0: return self.getDrawnColoredLine( coloredLine, coloredLine.tagString, width ) def getDrawnSelectedColoredLine(self, coloredLine): "Get the drawn selected colored line." return self.getDrawnColoredLine(coloredLine, 'selection_line', self.repository.widthOfSelectionThread.value) def motion(self, event): "The mouse moved." self.mouseTool.motion(event) xString = '' yString = '' x = self.canvas.canvasx( event.x ) y = self.canvas.canvasy( event.y ) self.horizontalRulerCanvas.delete('pointer') self.horizontalRulerCanvas.create_polygon( x - self.rulingPointerRadius, self.rulingExtentPointer, x + self.rulingPointerRadius, self.rulingExtentPointer, x, self.rulingExtent, tag = 'pointer') self.verticalRulerCanvas.delete('pointer') self.verticalRulerCanvas.create_polygon( self.rulingExtentPointer, y - self.rulingPointerRadius, self.rulingExtentPointer, y + self.rulingPointerRadius, self.rulingExtent, y, tag = 'pointer') if self.repository.showPosition.value: motionCoordinate = complex(x, y) modelCoordinates = self.skein.getModelCoordinates( motionCoordinate ) roundedXText = self.getRoundedRulingText(3, modelCoordinates.real) roundedYText = self.getRoundedRulingText(3, modelCoordinates.imag) xString = 'X: ' + roundedXText yString = 'Y: ' + roundedYText self.xStringVar.set(xString) self.yStringVar.set(yString) def qqqmotion(self, event): "The mouse moved." self.mouseTool.motion(event) x = self.canvas.canvasx( event.x ) y = self.canvas.canvasy( event.y ) self.horizontalRulerCanvas.delete('pointer') self.horizontalRulerCanvas.create_polygon( x - self.rulingPointerRadius, self.rulingExtentPointer, x + self.rulingPointerRadius, self.rulingExtentPointer, x, self.rulingExtent, tag = 'pointer') self.verticalRulerCanvas.delete('pointer') self.verticalRulerCanvas.create_polygon( self.rulingExtentPointer, y - self.rulingPointerRadius, self.rulingExtentPointer, y + self.rulingPointerRadius, self.rulingExtent, y, tag = 'pointer') if not self.repository.numericPointer.value: return motionCoordinate = complex(x, y) modelCoordinates = self.skein.getModelCoordinates( motionCoordinate ) roundedXText = self.getRoundedRulingText( 3, modelCoordinates.real ) yStart = self.canvas.canvasy( 0 ) self.canvas.create_rectangle( x - 2, yStart, x + self.textBoxWidth, yStart + self.textBoxHeight + 5, fill = self.canvas['background'], tag = 'pointer') self.canvas.create_text( x, yStart + 5, anchor = settings.Tkinter.NW, tag = 'pointer', text = roundedXText ) roundedYText = self.getRoundedRulingText( 3, modelCoordinates.imag ) xStart = self.canvas.canvasx( 0 ) self.canvas.create_rectangle( xStart, y - 2, xStart + self.textBoxWidth + 5, y + self.textBoxHeight, fill = self.canvas['background'], tag = 'pointer') self.canvas.create_text( xStart + 5, y, anchor = settings.Tkinter.NW, tag = 'pointer', text = roundedYText ) xString = '' xString = 'X: ' + roundedXText self.xStringVar.set(xString) def relayXview( self, *args ): "Relay xview changes." self.canvas.xview( *args ) self.horizontalRulerCanvas.xview( *args ) def relayYview( self, *args ): "Relay yview changes." self.canvas.yview( *args ) self.verticalRulerCanvas.yview( *args ) def update(self): "Update the window." if len( self.skeinPanes ) < 1: return self.limitIndexSetArrowMouseDeleteCanvas() for coloredLines in self.getUpdateSkeinPanes(): for coloredLine in coloredLines: if coloredLine.isExtrusionThread: self.getDrawnColoredLineIfThick( coloredLine, self.repository.widthOfExtrusionThread.value ) else: self.getDrawnColoredLineIfThick( coloredLine, self.repository.widthOfTravelThread.value ) self.setDisplayLayerIndex() def main(): "Display the skeinlayer dialog." if len(sys.argv) > 1: settings.startMainLoopFromWindow(getWindowAnalyzeFile(' '.join(sys.argv[1 :]))) else: settings.startMainLoopFromConstructor(getNewRepository()) if __name__ == "__main__": main()
jetty840/ReplicatorG
skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/analyze_plugins/skeinlayer.py
Python
gpl-2.0
29,441
[ 30522, 1000, 1000, 1000, 2023, 3931, 2003, 1999, 1996, 2795, 1997, 8417, 1012, 15315, 12377, 24314, 2003, 2019, 17908, 13972, 2000, 4653, 2169, 6741, 1997, 1037, 1043, 16044, 5371, 1012, 1996, 15315, 12377, 24314, 6410, 3931, 2003, 2012, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** xxHash64 implementation in pure Javascript Copyright (C) 2016, Pierre Curto MIT license */ var UINT64 = require('cuint').UINT64 /* * Constants */ var PRIME64_1 = UINT64( '11400714785074694791' ) var PRIME64_2 = UINT64( '14029467366897019727' ) var PRIME64_3 = UINT64( '1609587929392839161' ) var PRIME64_4 = UINT64( '9650029242287828579' ) var PRIME64_5 = UINT64( '2870177450012600261' ) /** * Convert string to proper UTF-8 array * @param str Input string * @returns {Uint8Array} UTF8 array is returned as uint8 array */ function toUTF8Array (str) { var utf8 = [] for (var i=0, n=str.length; i < n; i++) { var charcode = str.charCodeAt(i) if (charcode < 0x80) utf8.push(charcode) else if (charcode < 0x800) { utf8.push(0xc0 | (charcode >> 6), 0x80 | (charcode & 0x3f)) } else if (charcode < 0xd800 || charcode >= 0xe000) { utf8.push(0xe0 | (charcode >> 12), 0x80 | ((charcode>>6) & 0x3f), 0x80 | (charcode & 0x3f)) } // surrogate pair else { i++; // UTF-16 encodes 0x10000-0x10FFFF by // subtracting 0x10000 and splitting the // 20 bits of 0x0-0xFFFFF into two halves charcode = 0x10000 + (((charcode & 0x3ff)<<10) | (str.charCodeAt(i) & 0x3ff)) utf8.push(0xf0 | (charcode >>18), 0x80 | ((charcode>>12) & 0x3f), 0x80 | ((charcode>>6) & 0x3f), 0x80 | (charcode & 0x3f)) } } return new Uint8Array(utf8) } /** * XXH64 object used as a constructor or a function * @constructor * or * @param {Object|String} input data * @param {Number|UINT64} seed * @return ThisExpression * or * @return {UINT64} xxHash */ function XXH64 () { if (arguments.length == 2) return new XXH64( arguments[1] ).update( arguments[0] ).digest() if (!(this instanceof XXH64)) return new XXH64( arguments[0] ) init.call(this, arguments[0]) } /** * Initialize the XXH64 instance with the given seed * @method init * @param {Number|Object} seed as a number or an unsigned 32 bits integer * @return ThisExpression */ function init (seed) { this.seed = seed instanceof UINT64 ? seed.clone() : UINT64(seed) this.v1 = this.seed.clone().add(PRIME64_1).add(PRIME64_2) this.v2 = this.seed.clone().add(PRIME64_2) this.v3 = this.seed.clone() this.v4 = this.seed.clone().subtract(PRIME64_1) this.total_len = 0 this.memsize = 0 this.memory = null return this } XXH64.prototype.init = init /** * Add data to be computed for the XXH64 hash * @method update * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer * @return ThisExpression */ XXH64.prototype.update = function (input) { var isArrayBuffer // Convert all strings to utf-8 first (issue #5) if (typeof input == 'string') { input = toUTF8Array(input) isArrayBuffer = true } if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) { isArrayBuffer = true input = new Uint8Array(input); } var p = 0 var len = input.length var bEnd = p + len if (len == 0) return this this.total_len += len if (this.memsize == 0) { if (isArrayBuffer) { this.memory = new Uint8Array(32) } else { this.memory = new Buffer(32) } } if (this.memsize + len < 32) // fill in tmp buffer { // XXH64_memcpy(this.memory + this.memsize, input, len) if (isArrayBuffer) { this.memory.set( input.subarray(0, len), this.memsize ) } else { input.copy( this.memory, this.memsize, 0, len ) } this.memsize += len return this } if (this.memsize > 0) // some data left from previous update { // XXH64_memcpy(this.memory + this.memsize, input, 16-this.memsize); if (isArrayBuffer) { this.memory.set( input.subarray(0, 32 - this.memsize), this.memsize ) } else { input.copy( this.memory, this.memsize, 0, 32 - this.memsize ) } var p64 = 0 var other other = UINT64( (this.memory[p64+1] << 8) | this.memory[p64] , (this.memory[p64+3] << 8) | this.memory[p64+2] , (this.memory[p64+5] << 8) | this.memory[p64+4] , (this.memory[p64+7] << 8) | this.memory[p64+6] ) this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); p64 += 8 other = UINT64( (this.memory[p64+1] << 8) | this.memory[p64] , (this.memory[p64+3] << 8) | this.memory[p64+2] , (this.memory[p64+5] << 8) | this.memory[p64+4] , (this.memory[p64+7] << 8) | this.memory[p64+6] ) this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); p64 += 8 other = UINT64( (this.memory[p64+1] << 8) | this.memory[p64] , (this.memory[p64+3] << 8) | this.memory[p64+2] , (this.memory[p64+5] << 8) | this.memory[p64+4] , (this.memory[p64+7] << 8) | this.memory[p64+6] ) this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); p64 += 8 other = UINT64( (this.memory[p64+1] << 8) | this.memory[p64] , (this.memory[p64+3] << 8) | this.memory[p64+2] , (this.memory[p64+5] << 8) | this.memory[p64+4] , (this.memory[p64+7] << 8) | this.memory[p64+6] ) this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); p += 32 - this.memsize this.memsize = 0 } if (p <= bEnd - 32) { var limit = bEnd - 32 do { var other other = UINT64( (input[p+1] << 8) | input[p] , (input[p+3] << 8) | input[p+2] , (input[p+5] << 8) | input[p+4] , (input[p+7] << 8) | input[p+6] ) this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); p += 8 other = UINT64( (input[p+1] << 8) | input[p] , (input[p+3] << 8) | input[p+2] , (input[p+5] << 8) | input[p+4] , (input[p+7] << 8) | input[p+6] ) this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); p += 8 other = UINT64( (input[p+1] << 8) | input[p] , (input[p+3] << 8) | input[p+2] , (input[p+5] << 8) | input[p+4] , (input[p+7] << 8) | input[p+6] ) this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); p += 8 other = UINT64( (input[p+1] << 8) | input[p] , (input[p+3] << 8) | input[p+2] , (input[p+5] << 8) | input[p+4] , (input[p+7] << 8) | input[p+6] ) this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); p += 8 } while (p <= limit) } if (p < bEnd) { // XXH64_memcpy(this.memory, p, bEnd-p); if (isArrayBuffer) { this.memory.set( input.subarray(p, bEnd), this.memsize ) } else { input.copy( this.memory, this.memsize, p, bEnd ) } this.memsize = bEnd - p } return this } /** * Finalize the XXH64 computation. The XXH64 instance is ready for reuse for the given seed * @method digest * @return {UINT64} xxHash */ XXH64.prototype.digest = function () { var input = this.memory var p = 0 var bEnd = this.memsize var h64, h var u = new UINT64 if (this.total_len >= 32) { h64 = this.v1.clone().rotl(1) h64.add( this.v2.clone().rotl(7) ) h64.add( this.v3.clone().rotl(12) ) h64.add( this.v4.clone().rotl(18) ) h64.xor( this.v1.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) ) h64.multiply(PRIME64_1).add(PRIME64_4) h64.xor( this.v2.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) ) h64.multiply(PRIME64_1).add(PRIME64_4) h64.xor( this.v3.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) ) h64.multiply(PRIME64_1).add(PRIME64_4) h64.xor( this.v4.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) ) h64.multiply(PRIME64_1).add(PRIME64_4) } else { h64 = this.seed.clone().add( PRIME64_5 ) } h64.add( u.fromNumber(this.total_len) ) while (p <= bEnd - 8) { u.fromBits( (input[p+1] << 8) | input[p] , (input[p+3] << 8) | input[p+2] , (input[p+5] << 8) | input[p+4] , (input[p+7] << 8) | input[p+6] ) u.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) h64 .xor(u) .rotl(27) .multiply( PRIME64_1 ) .add( PRIME64_4 ) p += 8 } if (p + 4 <= bEnd) { u.fromBits( (input[p+1] << 8) | input[p] , (input[p+3] << 8) | input[p+2] , 0 , 0 ) h64 .xor( u.multiply(PRIME64_1) ) .rotl(23) .multiply( PRIME64_2 ) .add( PRIME64_3 ) p += 4 } while (p < bEnd) { u.fromBits( input[p++], 0, 0, 0 ) h64 .xor( u.multiply(PRIME64_5) ) .rotl(11) .multiply(PRIME64_1) } h = h64.clone().shiftRight(33) h64.xor(h).multiply(PRIME64_2) h = h64.clone().shiftRight(29) h64.xor(h).multiply(PRIME64_3) h = h64.clone().shiftRight(32) h64.xor(h) // Reset the state this.init( this.seed ) return h64 } module.exports = XXH64
pierrec/js-xxhash
lib/xxhash64.js
JavaScript
mit
8,389
[ 30522, 1013, 1008, 1008, 22038, 14949, 2232, 21084, 7375, 1999, 5760, 9262, 22483, 9385, 1006, 1039, 1007, 2355, 1010, 5578, 20099, 2080, 10210, 6105, 1008, 1013, 13075, 21318, 3372, 21084, 1027, 5478, 1006, 1005, 12731, 18447, 1005, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef __ASMARM_HWCAP_H #define __ASMARM_HWCAP_H /* * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP */ #define HWCAP_SWP (1 << 0) #define HWCAP_HALF (1 << 1) #define HWCAP_THUMB (1 << 2) #define HWCAP_26BIT (1 << 3) /* Play it safe */ #define HWCAP_FAST_MULT (1 << 4) #define HWCAP_FPA (1 << 5) #define HWCAP_VFP (1 << 6) #define HWCAP_EDSP (1 << 7) #define HWCAP_JAVA (1 << 8) #define HWCAP_IWMMXT (1 << 9) #define HWCAP_CRUNCH (1 << 10) #define HWCAP_THUMBEE (1 << 11) #define HWCAP_NEON (1 << 12) #define HWCAP_VFPv3 (1 << 13) #define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */ #define HWCAP_TLS (1 << 15) #define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ #define HWCAP_VFPv4 (1 << 16) #define HWCAP_IDIVA (1 << 17) #define HWCAP_IDIVT (1 << 18) #define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) #if defined(__KERNEL__) && !defined(__ASSEMBLY__) /* * This yields a mask that user programs can use to figure out what * instruction set this cpu supports. */ #define ELF_HWCAP (elf_hwcap) extern unsigned int elf_hwcap; #endif #endif
ChronoMonochrome/Chrono_Kernel
arch/arm/include/asm/hwcap.h
C
gpl-2.0
1,146
[ 30522, 1001, 2065, 13629, 2546, 1035, 1035, 2004, 7849, 2213, 1035, 1044, 16526, 9331, 1035, 1044, 1001, 9375, 1035, 1035, 2004, 7849, 2213, 1035, 1044, 16526, 9331, 1035, 1044, 1013, 1008, 1008, 1044, 16526, 9331, 9245, 1011, 2005, 17163, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>menhirlib: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.14.0 / menhirlib - 20200211</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> menhirlib <small> 20200211 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-12-03 21:53:52 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-03 21:53:52 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 3 Virtual package relying on a GMP lib system installation coq 8.14.0 Formal proof management system dune 2.9.1 Fast, portable, and opinionated build system ocaml 4.06.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.06.1 Official 4.06.1 release ocaml-config 1 OCaml Switch Configuration ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler ocamlfind 1.9.1 A library manager for OCaml ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; synopsis: &quot;A support library for verified Coq parsers produced by Menhir&quot; maintainer: &quot;francois.pottier@inria.fr&quot; authors: [ &quot;Jacques-Henri Jourdan &lt;jacques-henri.jourdan@lri.fr&gt;&quot; ] homepage: &quot;https://gitlab.inria.fr/fpottier/menhir&quot; dev-repo: &quot;git+https://gitlab.inria.fr/fpottier/menhir.git&quot; bug-reports: &quot;jacques-henri.jourdan@lri.fr&quot; license: &quot;LGPL-3.0-or-later&quot; build: [ [make &quot;-C&quot; &quot;coq-menhirlib&quot; &quot;-j%{jobs}%&quot;] ] install: [ [make &quot;-C&quot; &quot;coq-menhirlib&quot; &quot;install&quot;] ] depends: [ &quot;coq&quot; { &gt;= &quot;8.7&quot; &amp; &lt; &quot;8.12&quot; } ] conflicts: [ &quot;menhir&quot; { != &quot;20200211&quot; } ] tags: [ &quot;date:2020-02-11&quot; &quot;logpath:MenhirLib&quot; ] url { src: &quot;https://gitlab.inria.fr/fpottier/menhir/-/archive/20200211/archive.tar.gz&quot; checksum: [ &quot;md5=01577e5f15380c35bdaa8fd818204560&quot; &quot;sha512=a686c4b047d5236c425afcd7f179964191268ff448b8d18510579d742a7256855049bc4fe568bb8f1b0d6cbfb758d95cd05e621e3410b75245bb799d623725d6&quot; ] } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-menhirlib.20200211 coq.8.14.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.14.0). The following dependencies couldn&#39;t be met: - coq-menhirlib -&gt; coq &lt; 8.12 -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-menhirlib.20200211</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.06.1-2.0.5/released/8.14.0/menhirlib/20200211.html
HTML
mit
7,258
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 30524, 1027, 1015, 1000, 1028, 1026, 2516, 1028, 2273, 11961, 29521, 1024, 2025, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * **/ #pragma once /** * @file TrueLocalEstimatorOnPoints.h * @brief Computes the true quantity to each element of a range associated to a parametric shape. * @author David Coeurjolly (\c david.coeurjolly@liris.cnrs.fr ) * Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France * * @date 2011/06/27 * * Header file for module TrueLocalEstimatorOnPoints.cpp * * This file is part of the DGtal library. * * @see testLengthEstimators.cpp, testTrueLocalEstimator.cpp */ #if defined(TrueLocalEstimatorOnPoints_RECURSES) #error Recursive header files inclusion detected in TrueLocalEstimatorOnPoints.h #else // defined(TrueLocalEstimatorOnPoints_RECURSES) /** Prevents recursive inclusion of headers. */ #define TrueLocalEstimatorOnPoints_RECURSES #if !defined TrueLocalEstimatorOnPoints_h /** Prevents repeated inclusion of headers. */ #define TrueLocalEstimatorOnPoints_h ////////////////////////////////////////////////////////////////////////////// // Inclusions #include <iostream> #include "DGtal/base/Common.h" ////////////////////////////////////////////////////////////////////////////// namespace DGtal { ///////////////////////////////////////////////////////////////////////////// // template class TrueLocalEstimatorOnPoints /** * Description of template class 'TrueLocalEstimatorOnPoints' <p> * \brief Aim: Computes the true quantity to each element of a range associated to * a parametric shape. * * @tparam TConstIteratorOnPoints type of iterator on points used as * query points. * @tparam TParametricShape type of the parametric shape. * @tparam TParametricShapeFunctor type of Functor used to evaluate * the quantity. */ template <typename TConstIteratorOnPoints, typename TParametricShape, typename TParametricShapeFunctor> class TrueLocalEstimatorOnPoints { // ----------------------- Types ------------------------------ public: typedef TConstIteratorOnPoints ConstIterator; typedef TParametricShape ParametricShape; typedef typename TParametricShape::RealPoint RealPoint; typedef TParametricShapeFunctor ParametricShapeFunctor; typedef typename ParametricShapeFunctor::Quantity Quantity; // ----------------------- Standard services ------------------------------ public: /** * Default constructor. */ TrueLocalEstimatorOnPoints(); /** * Destructor. */ ~TrueLocalEstimatorOnPoints(); // ----------------------- Interface -------------------------------------- public: /** * Initialisation. * @param h grid size (must be >0). * @param itb begin iterator * @param ite end iterator */ void init(const double h, const ConstIterator& itb, const ConstIterator& ite); /** * Attach a shape * @param aShapePtr parametric shape */ void attach(ParametricShape* aShapePtr); /** * Estimation at *it * @return the estimated quantity at *it */ Quantity eval(const ConstIterator& it) const; /** * Estimation at each element of [@e itb , @e ite ) * @param itb begin iterator * @param ite end iterator * @return the estimated quantity * from itb till ite (excluded) */ template <typename OutputIterator> OutputIterator eval(const ConstIterator& itb, const ConstIterator& ite, OutputIterator result) const; /** * Checks the validity/consistency of the object. * @return 'true' if the object is valid, 'false' otherwise. */ bool isValid() const; // ------------------------- Protected Datas ------------------------------ protected: // ------------------------- Private Datas -------------------------------- private: ///Grid size double myH; ///Copy of the begin iterator ConstIterator myBegin; ///Copy of the end iterator ConstIterator myEnd; ///Owning pointer on a parametric shape functor ParametricShapeFunctor* myFunctorPtr; // ------------------------- Hidden services ------------------------------ private: /** * Copy constructor. * @param other the object to clone. * Forbidden by default. */ TrueLocalEstimatorOnPoints ( const TrueLocalEstimatorOnPoints & other ); /** * Assignment. * @param other the object to copy. * @return a reference on 'this'. * Forbidden by default. */ TrueLocalEstimatorOnPoints & operator= ( const TrueLocalEstimatorOnPoints & other ); }; // end of class TrueLocalEstimatorOnPoints } // namespace DGtal /////////////////////////////////////////////////////////////////////////////// // Includes inline functions. #include "DGtal/geometry/curves/estimation/TrueLocalEstimatorOnPoints.ih" // // /////////////////////////////////////////////////////////////////////////////// #endif // !defined TrueLocalEstimatorOnPoints_h #undef TrueLocalEstimatorOnPoints_RECURSES #endif // else defined(TrueLocalEstimatorOnPoints_RECURSES)
kerautret/DGtal0.6-ForIPOL
src/DGtal/geometry/curves/estimation/TrueLocalEstimatorOnPoints.h
C
lgpl-3.0
5,868
[ 30522, 1013, 1008, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1008, 2009, 2104, 1996, 3408, 1997, 1996, 27004, 8276, 2236, 2270, 6105, 2004, 1008, 2405, 2011, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * @version $Id: textarea.php 9764 2007-12-30 07:48:11Z ircmaxell $ * @package Joomla.Framework * @subpackage Parameter * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // Check to ensure this file is within the rest of the framework defined('JPATH_BASE') or die(); /** * Renders a textarea element * * @author Johan Janssens <johan.janssens@joomla.org> * @package Joomla.Framework * @subpackage Parameter * @since 1.5 */ class JElementTextarea extends JElement { /** * Element name * * @access protected * @var string */ var $_name = 'Textarea'; function fetchElement($name, $value, &$node, $control_name) { $rows = $node->attributes('rows'); $cols = $node->attributes('cols'); $class = ( $node->attributes('class') ? 'class="'.$node->attributes('class').'"' : 'class="text_area"' ); // convert <br /> tags so they are not visible when editing $value = str_replace('<br />', "\n", $value); return '<textarea name="'.$control_name.'['.$name.']" cols="'.$cols.'" rows="'.$rows.'" '.$class.' id="'.$control_name.$name.'" >'.$value.'</textarea>'; } }
shafiqissani/IgenxSolutions
libraries/joomla/html/parameter/element/textarea.php
PHP
gpl-2.0
1,534
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 1030, 2544, 1002, 8909, 1024, 3793, 12069, 2050, 1012, 25718, 5989, 21084, 2289, 1011, 2260, 1011, 2382, 5718, 1024, 4466, 1024, 2340, 2480, 20868, 27487, 8528, 5349, 1002, 1008, 1030, 7427,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using Renci.SshNet.Messages.Connection; namespace Renci.SshNet.Channels { internal abstract class ServerChannel : Channel { internal void Initialize(Session session, uint localWindowSize, uint localPacketSize, uint remoteChannelNumber, uint remoteWindowSize, uint remotePacketSize) { Initialize(session, localWindowSize, localPacketSize); InitializeRemoteInfo(remoteChannelNumber, remoteWindowSize, remotePacketSize); //Session.ChannelOpenReceived += OnChannelOpen; } //private void OnChannelOpen(object sender, MessageEventArgs<ChannelOpenMessage> e) //{ // var channelOpenMessage = e.Message; // if (channelOpenMessage.LocalChannelNumber == LocalChannelNumber) // { // _remoteChannelNumber = channelOpenMessage.LocalChannelNumber; // RemoteWindowSize = channelOpenMessage.InitialWindowSize; // _remotePacketSize = channelOpenMessage.MaximumPacketSize; // OnOpen(e.Message.Info); // } //} protected void SendMessage(ChannelOpenConfirmationMessage message) { // No need to check whether channel is open when trying to open a channel Session.SendMessage(message); // When we act as server, consider the channel open when we've sent the // confirmation message to the peer IsOpen = true; } ///// <summary> ///// Called when channel need to be open on the client. ///// </summary> ///// <param name="info">Channel open information.</param> //protected virtual void OnOpen(ChannelOpenInfo info) //{ //} protected override void Dispose(bool disposing) { if (disposing) { var session = Session; if (session != null) { //session.ChannelOpenReceived -= OnChannelOpen; } } base.Dispose(disposing); } } }
EddyBeaupre/Renci.SshNet
Channels/ServerChannel.cs
C#
bsd-3-clause
2,118
[ 30522, 2478, 2291, 1025, 2478, 14916, 6895, 1012, 7020, 7295, 3388, 1012, 7696, 1012, 4434, 1025, 3415, 15327, 14916, 6895, 1012, 7020, 7295, 3388, 1012, 6833, 1063, 4722, 10061, 2465, 8241, 26058, 1024, 3149, 1063, 4722, 11675, 3988, 4697,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} module React.Flux.Mui.RadioButton.RadioButtonGroup where import Protolude import Data.Aeson import Data.Aeson.Casing import Data.String (String) import React.Flux import React.Flux.Mui.Types import React.Flux.Mui.Util data RadioButtonGroup = RadioButtonGroup { radioButtonGroupClassName :: !(Maybe Text) , radioButtonGroupLabelPosition :: !(Maybe (MuiSymbolEnum '[ "left", "right"])) , radioButtonGroupName :: !Text } deriving (Generic, Show) instance ToJSON RadioButtonGroup where toJSON = genericToJSON $ aesonDrop (length ("RadioButtonGroup" :: String)) camelCase defRadioButtonGroup :: Text -> RadioButtonGroup defRadioButtonGroup radioButtonGroupName_ = RadioButtonGroup { radioButtonGroupClassName = Nothing , radioButtonGroupLabelPosition = Nothing , radioButtonGroupName = radioButtonGroupName_ } radioButtonGroup_ :: RadioButtonGroup -> [PropertyOrHandler handler] -> ReactElementM handler () -> ReactElementM handler () radioButtonGroup_ args props = foreign_ "RadioButtonGroup" (fromMaybe [] (toProps args) ++ props)
pbogdan/react-flux-mui
react-flux-mui/src/React/Flux/Mui/RadioButton/RadioButtonGroup.hs
Haskell
bsd-3-clause
1,165
[ 30522, 1063, 1011, 1001, 2653, 18547, 6914, 22420, 1001, 1011, 1065, 1063, 1011, 1001, 2653, 2058, 17468, 3367, 4892, 2015, 1001, 1011, 1065, 1063, 1011, 1001, 2653, 2951, 18824, 2015, 1001, 1011, 1065, 11336, 10509, 30524, 29347, 3385, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_05) on Tue Mar 25 10:54:12 CET 2008 --> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <TITLE> TransponderType (hal 0.4.1-SNAPSHOT API) </TITLE> <META NAME="date" CONTENT="2008-03-25"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="TransponderType (hal 0.4.1-SNAPSHOT API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TransponderType.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../org/accada/hal/transponder/TransponderSystemInformationISO.html" title="class in org.accada.hal.transponder"><B>PREV CLASS</B></A>&nbsp; &nbsp;NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/accada/hal/transponder/TransponderType.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="TransponderType.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#enum_constant_summary">ENUM CONSTANTS</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#enum_constant_detail">ENUM CONSTANTS</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.accada.hal.transponder</FONT> <BR> Enum TransponderType</H2> <PRE> java.lang.Object <IMG SRC="../../../../resources/inherit.gif" ALT="extended by ">java.lang.Enum&lt;<A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A>&gt; <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.accada.hal.transponder.TransponderType</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Comparable&lt;<A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A>&gt;</DD> </DL> <HR> <DL> <DT><PRE>public enum <B>TransponderType</B><DT>extends java.lang.Enum&lt;<A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A>&gt;</DL> </PRE> <P> <HR> <P> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <A NAME="enum_constant_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Enum Constant Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#EM4222">EM4222</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#EPCclass0Gen1">EPCclass0Gen1</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#EPCclass1Gen1">EPCclass1Gen1</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#EPCclass1Gen2">EPCclass1Gen2</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#ICode1">ICode1</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#ICodeEPC">ICodeEPC</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#ICodeUID">ICodeUID</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#ISO15693">ISO15693</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#ISO18000_6A">ISO18000_6A</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#ISO18000_6B">ISO18000_6B</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#TagItHF">TagItHF</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#UNKNOWN">UNKNOWN</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#code()">code</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#dataSize()">dataSize</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#getType(byte)">getType</A></B>(byte&nbsp;trType)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#getType(java.lang.String)">getType</A></B>(java.lang.String&nbsp;trTypeName)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#valueOf(java.lang.String)">valueOf</A></B>(java.lang.String&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the enum constant of this type with the specified name.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A>[]</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/accada/hal/transponder/TransponderType.html#values()">values</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing the constants of this enum type, in the order they are declared.</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Enum"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Enum</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>getClass, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ ENUM CONSTANT DETAIL =========== --> <A NAME="enum_constant_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Enum Constant Detail</B></FONT></TH> </TR> </TABLE> <A NAME="ICode1"><!-- --></A><H3> ICode1</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>ICode1</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="TagItHF"><!-- --></A><H3> TagItHF</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>TagItHF</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="ISO15693"><!-- --></A><H3> ISO15693</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>ISO15693</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="ICodeEPC"><!-- --></A><H3> ICodeEPC</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>ICodeEPC</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="ICodeUID"><!-- --></A><H3> ICodeUID</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>ICodeUID</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="ISO18000_6A"><!-- --></A><H3> ISO18000_6A</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>ISO18000_6A</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="ISO18000_6B"><!-- --></A><H3> ISO18000_6B</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>ISO18000_6B</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="EM4222"><!-- --></A><H3> EM4222</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>EM4222</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="EPCclass1Gen2"><!-- --></A><H3> EPCclass1Gen2</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>EPCclass1Gen2</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="EPCclass0Gen1"><!-- --></A><H3> EPCclass0Gen1</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>EPCclass0Gen1</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="EPCclass1Gen1"><!-- --></A><H3> EPCclass1Gen1</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>EPCclass1Gen1</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="UNKNOWN"><!-- --></A><H3> UNKNOWN</H3> <PRE> public static final <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>UNKNOWN</B></PRE> <DL> <DL> </DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="values()"><!-- --></A><H3> values</H3> <PRE> public static <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A>[] <B>values</B>()</PRE> <DL> <DD>Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: <pre> for (TransponderType c : TransponderType.values()) &nbsp; System.out.println(c); </pre> <P> <DD><DL> <DT><B>Returns:</B><DD>an array containing the constants of this enum type, in the order they are declared</DL> </DD> </DL> <HR> <A NAME="valueOf(java.lang.String)"><!-- --></A><H3> valueOf</H3> <PRE> public static <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>valueOf</B>(java.lang.String&nbsp;name)</PRE> <DL> <DD>Returns the enum constant of this type with the specified name. The string must match <I>exactly</I> an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the enum constant to be returned. <DT><B>Returns:</B><DD>the enum constant with the specified name <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if this enum type has no constant with the specified name <DD><CODE>java.lang.NullPointerException</CODE> - if the argument is null</DL> </DD> </DL> <HR> <A NAME="code()"><!-- --></A><H3> code</H3> <PRE> public int <B>code</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="dataSize()"><!-- --></A><H3> dataSize</H3> <PRE> public int <B>dataSize</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getType(byte)"><!-- --></A><H3> getType</H3> <PRE> public static <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>getType</B>(byte&nbsp;trType)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getType(java.lang.String)"><!-- --></A><H3> getType</H3> <PRE> public static <A HREF="../../../../org/accada/hal/transponder/TransponderType.html" title="enum in org.accada.hal.transponder">TransponderType</A> <B>getType</B>(java.lang.String&nbsp;trTypeName)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TransponderType.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../org/accada/hal/transponder/TransponderSystemInformationISO.html" title="class in org.accada.hal.transponder"><B>PREV CLASS</B></A>&nbsp; &nbsp;NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/accada/hal/transponder/TransponderType.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="TransponderType.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#enum_constant_summary">ENUM CONSTANTS</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#enum_constant_detail">ENUM CONSTANTS</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2008. All Rights Reserved. </BODY> </HTML>
Fosstrak/fosstrak.github.io
hal/apidocs/org/accada/hal/transponder/TransponderType.html
HTML
lgpl-2.1
21,823
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var models = require('../models'); var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { console.log(req.session); res.render('layout'); }); module.exports = router;
NUSPartTime/NUSPartTime
routes/index.js
JavaScript
mit
248
[ 30522, 13075, 4275, 1027, 5478, 1006, 1005, 1012, 1012, 1013, 4275, 1005, 1007, 1025, 13075, 4671, 1027, 5478, 1006, 1005, 4671, 1005, 1007, 1025, 13075, 2799, 2099, 1027, 4671, 1012, 2799, 2099, 1006, 1007, 1025, 1013, 1008, 2131, 2188, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\SRF; use JMS\Serializer\Annotation\ExclusionPolicy; use PHPExiftool\Driver\AbstractTag; /** * @ExclusionPolicy("all") */ class WBGreenCloudy extends AbstractTag { protected $Id = 196; protected $Name = 'WBGreenCloudy'; protected $FullName = 'Sony::SRF2'; protected $GroupName = 'SRF#'; protected $g0 = 'MakerNotes'; protected $g1 = 'SRF#'; protected $g2 = 'Camera'; protected $Type = '?'; protected $Writable = false; protected $Description = 'WB Green Cloudy'; protected $flag_Permanent = true; }
romainneutron/PHPExiftool
lib/PHPExiftool/Driver/Tag/SRF/WBGreenCloudy.php
PHP
mit
821
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 25718, 10288, 10128, 3406, 4747, 1012, 1008, 1008, 1006, 1039, 1007, 2262, 12836, 2378, 20393, 1026, 17727, 2890, 2278, 1030, 20917, 4014, 1012, 4012, 1028, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; using System.Text; using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; namespace SnapMark.Objects.Entities.Mapping { internal class ApplicationUserMap : EntityMap<ApplicationUser> { public ApplicationUserMap(EntityTypeBuilder<ApplicationUser> entityTypeBuilder) : base(entityTypeBuilder) { entityTypeBuilder.ToTable("ApplicationUser"); entityTypeBuilder.HasKey(x => x.ApplicationUserId); entityTypeBuilder.Property(x => x.ApplicationUserId).HasDefaultValueSql("newid()"); entityTypeBuilder.Property(x => x.UserName).IsRequired().HasMaxLength(50); entityTypeBuilder.Property(x => x.Password).IsRequired().HasMaxLength(1000); } } }
johne3/SnapMark
src/SnapMark.Objects/Entities/Mapping/ApplicationUserMap.cs
C#
mit
820
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 3793, 1025, 2478, 7513, 1012, 9178, 15643, 6198, 17345, 1012, 27425, 1012, 16472, 1025, 2478, 7513, 1012, 9178, 15643, 6198, 17345, 1025, 3415, 15327, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_91) on Tue Dec 29 12:43:46 AEDT 2015 --> <title>org.bouncycastle.crypto.tls Class Hierarchy (Bouncy Castle Library 1.54 API Specification)</title> <meta name="date" content="2015-12-29"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.bouncycastle.crypto.tls Class Hierarchy (Bouncy Castle Library 1.54 API Specification)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.54</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/bouncycastle/crypto/test/cavp/package-tree.html">Prev</a></li> <li><a href="../../../../org/bouncycastle/crypto/tls/test/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/bouncycastle/crypto/tls/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For Package org.bouncycastle.crypto.tls</h1> <span class="strong">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.Object <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsCipherFactory.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsCipherFactory</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCipherFactory.html" title="interface in org.bouncycastle.crypto.tls">TlsCipherFactory</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DefaultTlsCipherFactory.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DefaultTlsCipherFactory</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsCredentials.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsCredentials</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCredentials.html" title="interface in org.bouncycastle.crypto.tls">TlsCredentials</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsAgreementCredentials.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsAgreementCredentials</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsAgreementCredentials.html" title="interface in org.bouncycastle.crypto.tls">TlsAgreementCredentials</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DefaultTlsAgreementCredentials.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DefaultTlsAgreementCredentials</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsEncryptionCredentials.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsEncryptionCredentials</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsEncryptionCredentials.html" title="interface in org.bouncycastle.crypto.tls">TlsEncryptionCredentials</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DefaultTlsEncryptionCredentials.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DefaultTlsEncryptionCredentials</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsSignerCredentials.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsSignerCredentials</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSignerCredentials.html" title="interface in org.bouncycastle.crypto.tls">TlsSignerCredentials</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DefaultTlsSignerCredentials.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DefaultTlsSignerCredentials</span></a></li> </ul> </li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsKeyExchange.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsKeyExchange</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsKeyExchange.html" title="interface in org.bouncycastle.crypto.tls">TlsKeyExchange</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsDHKeyExchange.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsDHKeyExchange</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsDHEKeyExchange.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsDHEKeyExchange</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsECDHKeyExchange.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsECDHKeyExchange</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsECDHEKeyExchange.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsECDHEKeyExchange</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsPSKKeyExchange.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsPSKKeyExchange</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsRSAKeyExchange.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsRSAKeyExchange</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSRPKeyExchange.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsSRPKeyExchange</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsPeer.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsPeer</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsPeer.html" title="interface in org.bouncycastle.crypto.tls">TlsPeer</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsClient.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsClient</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsClient.html" title="interface in org.bouncycastle.crypto.tls">TlsClient</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DefaultTlsClient.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DefaultTlsClient</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/PSKTlsClient.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">PSKTlsClient</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SRPTlsClient.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SRPTlsClient</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsServer.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsServer</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsServer.html" title="interface in org.bouncycastle.crypto.tls">TlsServer</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DefaultTlsServer.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DefaultTlsServer</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/PSKTlsServer.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">PSKTlsServer</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SRPTlsServer.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SRPTlsServer</span></a></li> </ul> </li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AbstractTlsSigner.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AbstractTlsSigner</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSigner.html" title="interface in org.bouncycastle.crypto.tls">TlsSigner</a>) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsDSASigner.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsDSASigner</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsDSSSigner.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsDSSSigner</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsECDSASigner.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsECDSASigner</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsRSASigner.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsRSASigner</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AlertDescription.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AlertDescription</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/AlertLevel.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">AlertLevel</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/BasicTlsPSKIdentity.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">BasicTlsPSKIdentity</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsPSKIdentity.html" title="interface in org.bouncycastle.crypto.tls">TlsPSKIdentity</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/BulkCipherAlgorithm.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">BulkCipherAlgorithm</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ByteQueue.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ByteQueue</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CertChainType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CertChainType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/Certificate.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">Certificate</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CertificateRequest.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CertificateRequest</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CertificateStatus.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CertificateStatus</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CertificateStatusRequest.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CertificateStatusRequest</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CertificateStatusType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CertificateStatusType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CertificateURL.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CertificateURL</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/Chacha20Poly1305.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">Chacha20Poly1305</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCipher.html" title="interface in org.bouncycastle.crypto.tls">TlsCipher</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ChangeCipherSpec.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ChangeCipherSpec</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CipherSuite.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CipherSuite</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CipherType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CipherType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ClientAuthenticationType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ClientAuthenticationType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ClientCertificateType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ClientCertificateType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/CompressionMethod.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">CompressionMethod</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ConnectionEnd.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ConnectionEnd</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ContentType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ContentType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DefaultTlsSRPGroupVerifier.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DefaultTlsSRPGroupVerifier</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSRPGroupVerifier.html" title="interface in org.bouncycastle.crypto.tls">TlsSRPGroupVerifier</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DigitallySigned.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DigitallySigned</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DTLSClientProtocol.ClientHandshakeState.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DTLSClientProtocol.ClientHandshakeState</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DTLSProtocol.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DTLSProtocol</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DTLSClientProtocol.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DTLSClientProtocol</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DTLSServerProtocol.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DTLSServerProtocol</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DTLSServerProtocol.ServerHandshakeState.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DTLSServerProtocol.ServerHandshakeState</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DTLSTransport.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">DTLSTransport</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DatagramTransport.html" title="interface in org.bouncycastle.crypto.tls">DatagramTransport</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ECBasisType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ECBasisType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ECCurveType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ECCurveType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ECPointFormat.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ECPointFormat</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/EncryptionAlgorithm.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">EncryptionAlgorithm</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ExporterLabel.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ExporterLabel</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ExtensionType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ExtensionType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/FiniteFieldDHEGroup.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">FiniteFieldDHEGroup</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/HandshakeType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">HandshakeType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/HashAlgorithm.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">HashAlgorithm</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/HeartbeatExtension.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">HeartbeatExtension</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/HeartbeatMessage.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">HeartbeatMessage</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/HeartbeatMessageType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">HeartbeatMessageType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/HeartbeatMode.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">HeartbeatMode</span></a></li> <li type="circle">java.io.InputStream (implements java.io.Closeable) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ByteQueueInputStream.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ByteQueueInputStream</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/KeyExchangeAlgorithm.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">KeyExchangeAlgorithm</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/MACAlgorithm.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">MACAlgorithm</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/MaxFragmentLength.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">MaxFragmentLength</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/NamedCurve.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">NamedCurve</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/NameType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">NameType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/NewSessionTicket.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">NewSessionTicket</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/OCSPStatusRequest.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">OCSPStatusRequest</span></a></li> <li type="circle">java.io.OutputStream (implements java.io.Closeable, java.io.Flushable) <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ByteQueueOutputStream.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ByteQueueOutputStream</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/PRFAlgorithm.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">PRFAlgorithm</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ProtocolVersion.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ProtocolVersion</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SecurityParameters.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SecurityParameters</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ServerDHParams.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ServerDHParams</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ServerName.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ServerName</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ServerNameList.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ServerNameList</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ServerOnlyTlsAuthentication.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ServerOnlyTlsAuthentication</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsAuthentication.html" title="interface in org.bouncycastle.crypto.tls">TlsAuthentication</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/ServerSRPParams.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">ServerSRPParams</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SessionParameters.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SessionParameters</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SessionParameters.Builder.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SessionParameters.Builder</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SignatureAlgorithm.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SignatureAlgorithm</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SignatureAndHashAlgorithm.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SignatureAndHashAlgorithm</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SimulatedTlsSRPIdentityManager.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SimulatedTlsSRPIdentityManager</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSRPIdentityManager.html" title="interface in org.bouncycastle.crypto.tls">TlsSRPIdentityManager</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SRTPProtectionProfile.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SRTPProtectionProfile</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SSL3Mac.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SSL3Mac</span></a> (implements org.bouncycastle.crypto.<a href="../../../../org/bouncycastle/crypto/Mac.html" title="interface in org.bouncycastle.crypto">Mac</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SupplementalDataEntry.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SupplementalDataEntry</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/SupplementalDataType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">SupplementalDataType</span></a></li> <li type="circle">java.lang.Throwable (implements java.io.Serializable) <ul> <li type="circle">java.lang.Exception <ul> <li type="circle">java.io.IOException <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsFatalAlert.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsFatalAlert</span></a></li> </ul> </li> </ul> </li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsAEADCipher.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsAEADCipher</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCipher.html" title="interface in org.bouncycastle.crypto.tls">TlsCipher</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsBlockCipher.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsBlockCipher</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCipher.html" title="interface in org.bouncycastle.crypto.tls">TlsCipher</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsDHUtils.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsDHUtils</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsECCUtils.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsECCUtils</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsExtensionsUtils.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsExtensionsUtils</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsMac.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsMac</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsNullCipher.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsNullCipher</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCipher.html" title="interface in org.bouncycastle.crypto.tls">TlsCipher</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsNullCompression.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsNullCompression</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCompression.html" title="interface in org.bouncycastle.crypto.tls">TlsCompression</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsProtocol.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsProtocol</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsClientProtocol.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsClientProtocol</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsServerProtocol.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsServerProtocol</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsRSAUtils.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsRSAUtils</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSRPLoginParameters.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsSRPLoginParameters</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSRPUtils.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsSRPUtils</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSRTPUtils.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsSRTPUtils</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsStreamCipher.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsStreamCipher</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCipher.html" title="interface in org.bouncycastle.crypto.tls">TlsCipher</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsUtils.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">TlsUtils</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/UDPTransport.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">UDPTransport</span></a> (implements org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DatagramTransport.html" title="interface in org.bouncycastle.crypto.tls">DatagramTransport</a>)</li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/URLAndHash.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">URLAndHash</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/UserMappingType.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">UserMappingType</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/UseSRTPData.html" title="class in org.bouncycastle.crypto.tls"><span class="strong">UseSRTPData</span></a></li> </ul> </li> </ul> <h2 title="Interface Hierarchy">Interface Hierarchy</h2> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/DatagramTransport.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">DatagramTransport</span></a></li> <li type="circle">org.bouncycastle.crypto.<a href="../../../../org/bouncycastle/crypto/Digest.html" title="interface in org.bouncycastle.crypto"><span class="strong">Digest</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsHandshakeHash.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsHandshakeHash</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsAuthentication.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsAuthentication</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCipher.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsCipher</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCipherFactory.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsCipherFactory</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCompression.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsCompression</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsContext.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsContext</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsClientContext.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsClientContext</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsServerContext.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsServerContext</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsCredentials.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsCredentials</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsAgreementCredentials.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsAgreementCredentials</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsEncryptionCredentials.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsEncryptionCredentials</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSignerCredentials.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsSignerCredentials</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsKeyExchange.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsKeyExchange</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsPeer.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsPeer</span></a> <ul> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsClient.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsClient</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsServer.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsServer</span></a></li> </ul> </li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsPSKIdentity.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsPSKIdentity</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsPSKIdentityManager.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsPSKIdentityManager</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSession.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsSession</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSigner.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsSigner</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSRPGroupVerifier.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsSRPGroupVerifier</span></a></li> <li type="circle">org.bouncycastle.crypto.tls.<a href="../../../../org/bouncycastle/crypto/tls/TlsSRPIdentityManager.html" title="interface in org.bouncycastle.crypto.tls"><span class="strong">TlsSRPIdentityManager</span></a></li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.54</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/bouncycastle/crypto/test/cavp/package-tree.html">Prev</a></li> <li><a href="../../../../org/bouncycastle/crypto/tls/test/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/bouncycastle/crypto/tls/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
GaloisInc/hacrypto
src/Java/BouncyCastle/BouncyCastle-1.54/bcprov-jdk15on-154/javadoc/org/bouncycastle/crypto/tls/package-tree.html
HTML
bsd-3-clause
40,895
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
CSwiftV ======= A csv parser conforming (and tested as much) to [rfc4180](http://tools.ietf.org/html/rfc4180#section-2) i.e the closest thing to a csv spec. It is currently all in memory so not suitable for very large files. ###TL;DR ```swift let inputString = "Year,Make,Model,Description,Price\r\n1997,Ford,E350,descrition,3000.00\r\n1999,Chevy,Venture,another description,4900.00\r\n" let csv = CSwiftV(String: inputString) let rows = csv.rows // [ // ["1997","Ford","E350","descrition","3000.00"], // ["1999","Chevy","Venture","another description","4900.00"] // ] let headers = csv.headers // ["Year","Make","Model","Description","Price"] let keyedRows = csv.keyedRows // [ // ["Year":"1997","Make":"Ford","Model":"E350","Description":"descrition","Price":"3000.00"], // ["Year":"1999","Make":"Chevy","Model":"Venture","Description":"another, description","Price":"4900.00"] // ] ```
bearing/dosenet-apps
iOS/DoseNet/Pods/CSwiftV/README.md
Markdown
mit
1,054
[ 30522, 20116, 9148, 6199, 2615, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1037, 20116, 2615, 11968, 8043, 23758, 2075, 1006, 1998, 7718, 2004, 2172, 1007, 2000, 1031, 14645, 23632, 17914, 1033, 1006, 8299, 1024, 1013, 1013, 5906, 1012, 2946...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include "weakset_test.h" #include "weakset.h" CPPUNIT_TEST_SUITE_REGISTRATION(WeaksetTest); template <typename T> uint weak_set_size(weak_set<T>& w) { uint c = 0; for (typename weak_set<T>::iterator i = w.begin(); i != w.end(); ++i) { ++c; } return c; } void WeaksetTest::test_insertion() { boost::shared_ptr<int> n(new int(8)); boost::shared_ptr<int> m(new int(1)); weak_set<int> s; s.insert(n); s.insert(m); CPPUNIT_ASSERT_EQUAL(2U, weak_set_size(s)); } void WeaksetTest::test_garbage_collection() { weak_set<int> s; boost::shared_ptr<int> u(new int(37)); s.insert(u); { boost::shared_ptr<int> m(new int(1)); s.insert(m); } boost::shared_ptr<int> n(new int(8)); s.insert(n); CPPUNIT_ASSERT_EQUAL(2U, weak_set_size(s)); } void WeaksetTest::test_get() { weak_set<int> s; boost::shared_ptr<int> n(new int(42)); s.insert(n); CPPUNIT_ASSERT_EQUAL(42, *s.begin()); } void WeaksetTest::test_empty() { weak_set<int> s; { boost::shared_ptr<int> m(new int(37)); s.insert(m); } CPPUNIT_ASSERT_EQUAL(0U, weak_set_size(s)); }
ruphy/tagua
tests/weak_set/weakset_test.cpp
C++
gpl-2.0
1,132
[ 30522, 1001, 2421, 1000, 5410, 13462, 1035, 3231, 1012, 1044, 1000, 1001, 2421, 1000, 5410, 13462, 1012, 1044, 1000, 18133, 14289, 3490, 2102, 1035, 3231, 1035, 7621, 1035, 8819, 1006, 5410, 21678, 4355, 1007, 1025, 23561, 1026, 2828, 18442...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
There are both a positive and negative trait implementation for the same type. Erroneous code example: ```compile_fail,E0751 trait MyTrait {} impl MyTrait for i32 { } impl !MyTrait for i32 { } // error! ``` Negative implementations are a promise that the trait will never be implemented for the given types. Therefore, both cannot exists at the same time.
graydon/rust
compiler/rustc_error_codes/src/error_codes/E0751.md
Markdown
apache-2.0
359
[ 30522, 2045, 2024, 2119, 1037, 3893, 1998, 4997, 18275, 7375, 2005, 1996, 2168, 2828, 1012, 9413, 20793, 3560, 3642, 2742, 1024, 1036, 1036, 1036, 4012, 22090, 1035, 8246, 1010, 1041, 2692, 23352, 2487, 18275, 2026, 6494, 4183, 1063, 1065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* NicEdit - Micro Inline WYSIWYG * Copyright 2007-2008 Brian Kirchoff * * NicEdit is distributed under the terms of the MIT license * For more information visit http://nicedit.com/ * Do not remove this copyright message */ var bkExtend = function(){ var args = arguments; if (args.length == 1) args = [this, args[0]]; for (var prop in args[1]) args[0][prop] = args[1][prop]; return args[0]; }; function bkClass() { } bkClass.prototype.construct = function() {}; bkClass.extend = function(def) { var classDef = function() { if (arguments[0] !== bkClass) { return this.construct.apply(this, arguments); } }; var proto = new this(bkClass); bkExtend(proto,def); classDef.prototype = proto; classDef.extend = this.extend; return classDef; }; var bkElement = bkClass.extend({ construct : function(elm,d) { if(typeof(elm) == "string") { elm = (d || document).createElement(elm); } elm = $BK(elm); return elm; }, appendTo : function(elm) { elm.appendChild(this); return this; }, appendBefore : function(elm) { elm.parentNode.insertBefore(this,elm); return this; }, addEvent : function(type, fn) { bkLib.addEvent(this,type,fn); return this; }, setContent : function(c) { this.innerHTML = c; return this; }, pos : function() { var curleft = curtop = 0; var o = obj = this; if (obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent); } var b = (!window.opera) ? parseInt(this.getStyle('border-width') || this.style.border) || 0 : 0; return [curleft+b,curtop+b+this.offsetHeight]; }, noSelect : function() { bkLib.noSelect(this); return this; }, parentTag : function(t) { var elm = this; do { if(elm && elm.nodeName && elm.nodeName.toUpperCase() == t) { return elm; } elm = elm.parentNode; } while(elm); return false; }, hasClass : function(cls) { return this.className.match(new RegExp('(\\s|^)nicEdit-'+cls+'(\\s|$)')); }, addClass : function(cls) { if (!this.hasClass(cls)) { this.className += " nicEdit-"+cls }; return this; }, removeClass : function(cls) { if (this.hasClass(cls)) { this.className = this.className.replace(new RegExp('(\\s|^)nicEdit-'+cls+'(\\s|$)'),' '); } return this; }, setStyle : function(st) { var elmStyle = this.style; for(var itm in st) { switch(itm) { case 'float': elmStyle['cssFloat'] = elmStyle['styleFloat'] = st[itm]; break; case 'opacity': elmStyle.opacity = st[itm]; elmStyle.filter = "alpha(opacity=" + Math.round(st[itm]*100) + ")"; break; case 'className': this.className = st[itm]; break; default: //if(document.compatMode || itm != "cursor") { // Nasty Workaround for IE 5.5 elmStyle[itm] = st[itm]; //} } } return this; }, getStyle : function( cssRule, d ) { var doc = (!d) ? document.defaultView : d; if(this.nodeType == 1) return (doc && doc.getComputedStyle) ? doc.getComputedStyle( this, null ).getPropertyValue(cssRule) : this.currentStyle[ bkLib.camelize(cssRule) ]; }, remove : function() { this.parentNode.removeChild(this); return this; }, setAttributes : function(at) { for(var itm in at) { this[itm] = at[itm]; } return this; } }); var bkLib = { isMSIE : (navigator.appVersion.indexOf("MSIE") != -1), addEvent : function(obj, type, fn) { (obj.addEventListener) ? obj.addEventListener( type, fn, false ) : obj.attachEvent("on"+type, fn); }, toArray : function(iterable) { var length = iterable.length, results = new Array(length); while (length--) { results[length] = iterable[length] }; return results; }, noSelect : function(element) { if(element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { element.setAttribute('unselectable','on'); } for(var i=0;i<element.childNodes.length;i++) { bkLib.noSelect(element.childNodes[i]); } }, camelize : function(s) { return s.replace(/\-(.)/g, function(m, l){return l.toUpperCase()}); }, inArray : function(arr,item) { return (bkLib.search(arr,item) != null); }, search : function(arr,itm) { for(var i=0; i < arr.length; i++) { if(arr[i] == itm) return i; } return null; }, cancelEvent : function(e) { e = e || window.event; if(e.preventDefault && e.stopPropagation) { e.preventDefault(); e.stopPropagation(); } return false; }, domLoad : [], domLoaded : function() { if (arguments.callee.done) return; arguments.callee.done = true; for (i = 0;i < bkLib.domLoad.length;i++) bkLib.domLoad[i](); }, onDomLoaded : function(fireThis) { this.domLoad.push(fireThis); if (document.addEventListener) { document.addEventListener("DOMContentLoaded", bkLib.domLoaded, null); } else if(bkLib.isMSIE) { document.write("<style>.nicEdit-main p { margin: 0; }</style><scr"+"ipt id=__ie_onload defer " + ((location.protocol == "https:") ? "src='javascript:void(0)'" : "src=//0") + "><\/scr"+"ipt>"); $BK("__ie_onload").onreadystatechange = function() { if (this.readyState == "complete"){bkLib.domLoaded();} }; } window.onload = bkLib.domLoaded; } }; function $BK(elm) { if(typeof(elm) == "string") { elm = document.getElementById(elm); } return (elm && !elm.appendTo) ? bkExtend(elm,bkElement.prototype) : elm; } var bkEvent = { addEvent : function(evType, evFunc) { if(evFunc) { this.eventList = this.eventList || {}; this.eventList[evType] = this.eventList[evType] || []; this.eventList[evType].push(evFunc); } return this; }, fireEvent : function() { var args = bkLib.toArray(arguments), evType = args.shift(); if(this.eventList && this.eventList[evType]) { for(var i=0;i<this.eventList[evType].length;i++) { this.eventList[evType][i].apply(this,args); } } } }; function __(s) { return s; } Function.prototype.closure = function() { var __method = this, args = bkLib.toArray(arguments), obj = args.shift(); return function() { if(typeof(bkLib) != 'undefined') { return __method.apply(obj,args.concat(bkLib.toArray(arguments))); } }; } Function.prototype.closureListener = function() { var __method = this, args = bkLib.toArray(arguments), object = args.shift(); return function(e) { e = e || window.event; if(e.target) { var target = e.target; } else { var target = e.srcElement }; return __method.apply(object, [e,target].concat(args) ); }; } /* START CONFIG */ var nicEditorConfig = bkClass.extend({ buttons : { 'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'}, 'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'}, 'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'}, 'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true}, 'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true}, 'right' : {name : __('Right Align'), command : 'justifyright', noActive : true}, 'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true}, 'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']}, 'ul' : {name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']}, 'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']}, 'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']}, 'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}}, 'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true}, 'indent' : {name : __('Indent Text'), command : 'indent', noActive : true}, 'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true}, 'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true} }, iconsPath : '../nicEditorIcons.gif', buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'], iconList : {"xhtml":1,"bgcolor":2,"forecolor":3,"bold":4,"center":5,"hr":6,"indent":7,"italic":8,"justify":9,"left":10,"ol":11,"outdent":12,"removeformat":13,"right":14,"save":25,"strikethrough":16,"subscript":17,"superscript":18,"ul":19,"underline":20,"image":21,"link":22,"unlink":23,"close":24,"arrow":26,"upload":27} }); /* END CONFIG */ var nicEditors = { nicPlugins : [], editors : [], registerPlugin : function(plugin,options) { this.nicPlugins.push({p : plugin, o : options}); }, allTextAreas : function(nicOptions) { var textareas = document.getElementsByTagName("textarea"); for(var i=0;i<textareas.length;i++) { nicEditors.editors.push(new nicEditor(nicOptions).panelInstance(textareas[i])); } return nicEditors.editors; }, findEditor : function(e) { var editors = nicEditors.editors; for(var i=0;i<editors.length;i++) { if(editors[i].instanceById(e)) { return editors[i].instanceById(e); } } } }; var nicEditor = bkClass.extend({ construct : function(o) { this.options = new nicEditorConfig(); bkExtend(this.options,o); this.nicInstances = new Array(); this.loadedPlugins = new Array(); var plugins = nicEditors.nicPlugins; for(var i=0;i<plugins.length;i++) { this.loadedPlugins.push(new plugins[i].p(this,plugins[i].o)); } nicEditors.editors.push(this); bkLib.addEvent(document.body,'mousedown', this.selectCheck.closureListener(this) ); }, panelInstance : function(e,o) { e = this.checkReplace($BK(e)); var panelElm = new bkElement('DIV').setStyle({width : (parseInt(e.getStyle('width')) || e.clientWidth)+'px'}).appendBefore(e); this.setPanel(panelElm); return this.addInstance(e,o); }, checkReplace : function(e) { var r = nicEditors.findEditor(e); if(r) { r.removeInstance(e); r.removePanel(); } return e; }, addInstance : function(e,o) { e = this.checkReplace($BK(e)); if( e.contentEditable || !!window.opera ) { var newInstance = new nicEditorInstance(e,o,this); } else { var newInstance = new nicEditorIFrameInstance(e,o,this); } this.nicInstances.push(newInstance); return this; }, removeInstance : function(e) { e = $BK(e); var instances = this.nicInstances; for(var i=0;i<instances.length;i++) { if(instances[i].e == e) { instances[i].remove(); this.nicInstances.splice(i,1); } } }, removePanel : function(e) { if(this.nicPanel) { this.nicPanel.remove(); this.nicPanel = null; } }, instanceById : function(e) { e = $BK(e); var instances = this.nicInstances; for(var i=0;i<instances.length;i++) { if(instances[i].e == e) { return instances[i]; } } }, setPanel : function(e) { this.nicPanel = new nicEditorPanel($BK(e),this.options,this); this.fireEvent('panel',this.nicPanel); return this; }, nicCommand : function(cmd,args) { if(this.selectedInstance) { this.selectedInstance.nicCommand(cmd,args); } }, getIcon : function(iconName,options) { var icon = this.options.iconList[iconName]; var file = (options.iconFiles) ? options.iconFiles[iconName] : ''; return {backgroundImage : "url('"+((icon) ? this.options.iconsPath : file)+"')", backgroundPosition : ((icon) ? ((icon-1)*-18) : 0)+'px 0px'}; }, selectCheck : function(e,t) { var found = false; do{ if(t.className && t.className.indexOf('nicEdit') != -1) { return false; } } while(t = t.parentNode); this.fireEvent('blur',this.selectedInstance,t); this.lastSelectedInstance = this.selectedInstance; this.selectedInstance = null; return false; } }); nicEditor = nicEditor.extend(bkEvent); var nicEditorInstance = bkClass.extend({ isSelected : false, construct : function(e,options,nicEditor) { this.ne = nicEditor; this.elm = this.e = e; this.options = options || {}; newX = parseInt(e.getStyle('width')) || e.clientWidth; newY = parseInt(e.getStyle('height')) || e.clientHeight; this.initialHeight = newY-8; var isTextarea = (e.nodeName.toLowerCase() == "textarea"); if(isTextarea || this.options.hasPanel) { var ie7s = (bkLib.isMSIE && !((typeof document.body.style.maxHeight != "undefined") && document.compatMode == "CSS1Compat")) var s = {width: newX+'px', border : '1px solid #ccc', borderTop : 0, overflowY : 'auto', overflowX: 'hidden' }; s[(ie7s) ? 'height' : 'maxHeight'] = (this.ne.options.maxHeight) ? this.ne.options.maxHeight+'px' : null; this.editorContain = new bkElement('DIV').setStyle(s).appendBefore(e); var editorElm = new bkElement('DIV').setStyle({width : (newX-8)+'px', margin: '4px', minHeight : newY+'px'}).addClass('main').appendTo(this.editorContain); e.setStyle({display : 'none'}); editorElm.innerHTML = e.innerHTML; if(isTextarea) { editorElm.setContent(e.value); this.copyElm = e; var f = e.parentTag('FORM'); if(f) { bkLib.addEvent( f, 'submit', this.saveContent.closure(this)); } } editorElm.setStyle((ie7s) ? {height : newY+'px'} : {overflow: 'hidden'}); this.elm = editorElm; } this.ne.addEvent('blur',this.blur.closure(this)); this.init(); this.blur(); }, init : function() { this.elm.setAttribute('contentEditable','true'); if(this.getContent() == "") { this.setContent('<br />'); } this.instanceDoc = document.defaultView; this.elm.addEvent('mousedown',this.selected.closureListener(this)).addEvent('keypress',this.keyDown.closureListener(this)).addEvent('focus',this.selected.closure(this)).addEvent('blur',this.blur.closure(this)).addEvent('keyup',this.selected.closure(this)); this.ne.fireEvent('add',this); }, remove : function() { this.saveContent(); if(this.copyElm || this.options.hasPanel) { this.editorContain.remove(); this.e.setStyle({'display' : 'block'}); this.ne.removePanel(); } this.disable(); this.ne.fireEvent('remove',this); }, disable : function() { this.elm.setAttribute('contentEditable','false'); }, getSel : function() { return (window.getSelection) ? window.getSelection() : document.selection; }, getRng : function() { var s = this.getSel(); if(!s || s.rangeCount === 0) { return; } return (s.rangeCount > 0) ? s.getRangeAt(0) : s.createRange(); }, selRng : function(rng,s) { if(window.getSelection) { s.removeAllRanges(); s.addRange(rng); } else { rng.select(); } }, selElm : function() { var r = this.getRng(); if(!r) { return; } if(r.startContainer) { var contain = r.startContainer; if(r.cloneContents().childNodes.length == 1) { for(var i=0;i<contain.childNodes.length;i++) { var rng = contain.childNodes[i].ownerDocument.createRange(); rng.selectNode(contain.childNodes[i]); if(r.compareBoundaryPoints(Range.START_TO_START,rng) != 1 && r.compareBoundaryPoints(Range.END_TO_END,rng) != -1) { return $BK(contain.childNodes[i]); } } } return $BK(contain); } else { return $BK((this.getSel().type == "Control") ? r.item(0) : r.parentElement()); } }, saveRng : function() { this.savedRange = this.getRng(); this.savedSel = this.getSel(); }, restoreRng : function() { if(this.savedRange) { this.selRng(this.savedRange,this.savedSel); } }, keyDown : function(e,t) { if(e.ctrlKey) { this.ne.fireEvent('key',this,e); } }, selected : function(e,t) { if(!t && !(t = this.selElm)) { t = this.selElm(); } if(!e.ctrlKey) { var selInstance = this.ne.selectedInstance; if(selInstance != this) { if(selInstance) { this.ne.fireEvent('blur',selInstance,t); } this.ne.selectedInstance = this; this.ne.fireEvent('focus',selInstance,t); } this.ne.fireEvent('selected',selInstance,t); this.isFocused = true; this.elm.addClass('selected'); } return false; }, blur : function() { this.isFocused = false; this.elm.removeClass('selected'); }, saveContent : function() { if(this.copyElm || this.options.hasPanel) { this.ne.fireEvent('save',this); (this.copyElm) ? this.copyElm.value = this.getContent() : this.e.innerHTML = this.getContent(); } }, getElm : function() { return this.elm; }, getContent : function() { this.content = this.getElm().innerHTML; this.ne.fireEvent('get',this); return this.content; }, setContent : function(e) { this.content = e; this.ne.fireEvent('set',this); this.elm.innerHTML = this.content; }, nicCommand : function(cmd,args) { document.execCommand(cmd,false,args); } }); var nicEditorIFrameInstance = nicEditorInstance.extend({ savedStyles : [], init : function() { var c = this.elm.innerHTML.replace(/^\s+|\s+$/g, ''); this.elm.innerHTML = ''; (!c) ? c = "<br />" : c; this.initialContent = c; this.elmFrame = new bkElement('iframe').setAttributes({'src' : 'javascript:;', 'frameBorder' : 0, 'allowTransparency' : 'true', 'scrolling' : 'no'}).setStyle({height: '100px', width: '100%'}).addClass('frame').appendTo(this.elm); if(this.copyElm) { this.elmFrame.setStyle({width : (this.elm.offsetWidth-4)+'px'}); } var styleList = ['font-size','font-family','font-weight','color']; for(itm in styleList) { this.savedStyles[bkLib.camelize(itm)] = this.elm.getStyle(itm); } setTimeout(this.initFrame.closure(this),50); }, disable : function() { this.elm.innerHTML = this.getContent(); }, initFrame : function() { var fd = $BK(this.elmFrame.contentWindow.document); fd.designMode = "on"; fd.open(); var css = this.ne.options.externalCSS; fd.write('<html><head>'+((css) ? '<link href="'+css+'" rel="stylesheet" type="text/css" />' : '')+'</head><body id="nicEditContent" style="margin: 0 !important; background-color: transparent !important;">'+this.initialContent+'</body></html>'); fd.close(); this.frameDoc = fd; this.frameWin = $BK(this.elmFrame.contentWindow); this.frameContent = $BK(this.frameWin.document.body).setStyle(this.savedStyles); this.instanceDoc = this.frameWin.document.defaultView; this.heightUpdate(); this.frameDoc.addEvent('mousedown', this.selected.closureListener(this)).addEvent('keyup',this.heightUpdate.closureListener(this)).addEvent('keydown',this.keyDown.closureListener(this)).addEvent('keyup',this.selected.closure(this)); this.ne.fireEvent('add',this); }, getElm : function() { return this.frameContent; }, setContent : function(c) { this.content = c; this.ne.fireEvent('set',this); this.frameContent.innerHTML = this.content; this.heightUpdate(); }, getSel : function() { return (this.frameWin) ? this.frameWin.getSelection() : this.frameDoc.selection; }, heightUpdate : function() { this.elmFrame.style.height = Math.max(this.frameContent.offsetHeight,this.initialHeight)+'px'; }, nicCommand : function(cmd,args) { this.frameDoc.execCommand(cmd,false,args); setTimeout(this.heightUpdate.closure(this),100); } }); var nicEditorPanel = bkClass.extend({ construct : function(e,options,nicEditor) { this.elm = e; this.options = options; this.ne = nicEditor; this.panelButtons = new Array(); this.buttonList = bkExtend([],this.ne.options.buttonList); this.panelContain = new bkElement('DIV').setStyle({overflow : 'hidden', width : '100%', border : '1px solid #cccccc', backgroundColor : '#efefef'}).addClass('panelContain'); this.panelElm = new bkElement('DIV').setStyle({margin : '2px', marginTop : '0px', zoom : 1, overflow : 'hidden'}).addClass('panel').appendTo(this.panelContain); this.panelContain.appendTo(e); var opt = this.ne.options; var buttons = opt.buttons; for(button in buttons) { this.addButton(button,opt,true); } this.reorder(); e.noSelect(); }, addButton : function(buttonName,options,noOrder) { var button = options.buttons[buttonName]; var type = (button['type']) ? eval('(typeof('+button['type']+') == "undefined") ? null : '+button['type']+';') : nicEditorButton; var hasButton = bkLib.inArray(this.buttonList,buttonName); if(type && (hasButton || this.ne.options.fullPanel)) { this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne)); if(!hasButton) { this.buttonList.push(buttonName); } } }, findButton : function(itm) { for(var i=0;i<this.panelButtons.length;i++) { if(this.panelButtons[i].name == itm) return this.panelButtons[i]; } }, reorder : function() { var bl = this.buttonList; for(var i=0;i<bl.length;i++) { var button = this.findButton(bl[i]); if(button) { this.panelElm.appendChild(button.margin); } } }, remove : function() { this.elm.remove(); } }); var nicEditorButton = bkClass.extend({ construct : function(e,buttonName,options,nicEditor) { this.options = options.buttons[buttonName]; this.name = buttonName; this.ne = nicEditor; this.elm = e; this.margin = new bkElement('DIV').setStyle({'float' : 'left', marginTop : '2px'}).appendTo(e); this.contain = new bkElement('DIV').setStyle({width : '20px', height : '20px'}).addClass('buttonContain').appendTo(this.margin); this.border = new bkElement('DIV').setStyle({backgroundColor : '#efefef', border : '1px solid #efefef'}).appendTo(this.contain); this.button = new bkElement('DIV').setStyle({width : '18px', height : '18px', overflow : 'hidden', zoom : 1, cursor : 'pointer'}).addClass('button').setStyle(this.ne.getIcon(buttonName,options)).appendTo(this.border); this.button.addEvent('mouseover', this.hoverOn.closure(this)).addEvent('mouseout',this.hoverOff.closure(this)).addEvent('mousedown',this.mouseClick.closure(this)).noSelect(); if(!window.opera) { this.button.onmousedown = this.button.onclick = bkLib.cancelEvent; } nicEditor.addEvent('selected', this.enable.closure(this)).addEvent('blur', this.disable.closure(this)).addEvent('key',this.key.closure(this)); this.disable(); this.init(); }, init : function() { }, hide : function() { this.contain.setStyle({display : 'none'}); }, updateState : function() { if(this.isDisabled) { this.setBg(); } else if(this.isHover) { this.setBg('hover'); } else if(this.isActive) { this.setBg('active'); } else { this.setBg(); } }, setBg : function(state) { switch(state) { case 'hover': var stateStyle = {border : '1px solid #666', backgroundColor : '#ddd'}; break; case 'active': var stateStyle = {border : '1px solid #666', backgroundColor : '#ccc'}; break; default: var stateStyle = {border : '1px solid #efefef', backgroundColor : '#efefef'}; } this.border.setStyle(stateStyle).addClass('button-'+state); }, checkNodes : function(e) { var elm = e; do { if(this.options.tags && bkLib.inArray(this.options.tags,elm.nodeName)) { this.activate(); return true; } } while(elm = elm.parentNode && elm.className != "nicEdit"); elm = $BK(e); while(elm.nodeType == 3) { elm = $BK(elm.parentNode); } if(this.options.css) { for(itm in this.options.css) { if(elm.getStyle(itm,this.ne.selectedInstance.instanceDoc) == this.options.css[itm]) { this.activate(); return true; } } } this.deactivate(); return false; }, activate : function() { if(!this.isDisabled) { this.isActive = true; this.updateState(); this.ne.fireEvent('buttonActivate',this); } }, deactivate : function() { this.isActive = false; this.updateState(); if(!this.isDisabled) { this.ne.fireEvent('buttonDeactivate',this); } }, enable : function(ins,t) { this.isDisabled = false; this.contain.setStyle({'opacity' : 1}).addClass('buttonEnabled'); this.updateState(); this.checkNodes(t); }, disable : function(ins,t) { this.isDisabled = true; this.contain.setStyle({'opacity' : 0.6}).removeClass('buttonEnabled'); this.updateState(); }, toggleActive : function() { (this.isActive) ? this.deactivate() : this.activate(); }, hoverOn : function() { if(!this.isDisabled) { this.isHover = true; this.updateState(); this.ne.fireEvent("buttonOver",this); } }, hoverOff : function() { this.isHover = false; this.updateState(); this.ne.fireEvent("buttonOut",this); }, mouseClick : function() { if(this.options.command) { this.ne.nicCommand(this.options.command,this.options.commandArgs); if(!this.options.noActive) { this.toggleActive(); } } this.ne.fireEvent("buttonClick",this); }, key : function(nicInstance,e) { if(this.options.key && e.ctrlKey && String.fromCharCode(e.keyCode || e.charCode).toLowerCase() == this.options.key) { this.mouseClick(); if(e.preventDefault) e.preventDefault(); } } }); var nicPlugin = bkClass.extend({ construct : function(nicEditor,options) { this.options = options; this.ne = nicEditor; this.ne.addEvent('panel',this.loadPanel.closure(this)); this.init(); }, loadPanel : function(np) { var buttons = this.options.buttons; for(var button in buttons) { np.addButton(button,this.options); } np.reorder(); }, init : function() { } }); /* START CONFIG */ var nicPaneOptions = { }; /* END CONFIG */ var nicEditorPane = bkClass.extend({ construct : function(elm,nicEditor,options,openButton) { this.ne = nicEditor; this.elm = elm; this.pos = elm.pos(); this.contain = new bkElement('div').setStyle({zIndex : '99999', overflow : 'hidden', position : 'absolute', left : this.pos[0]+'px', top : this.pos[1]+'px'}) this.pane = new bkElement('div').setStyle({fontSize : '12px', border : '1px solid #ccc', 'overflow': 'hidden', padding : '4px', textAlign: 'left', backgroundColor : '#ffffc9'}).addClass('pane').setStyle(options).appendTo(this.contain); if(openButton && !openButton.options.noClose) { this.close = new bkElement('div').setStyle({'float' : 'right', height: '16px', width : '16px', cursor : 'pointer'}).setStyle(this.ne.getIcon('close',nicPaneOptions)).addEvent('mousedown',openButton.removePane.closure(this)).appendTo(this.pane); } this.contain.noSelect().appendTo(document.body); this.position(); this.init(); }, init : function() { }, position : function() { if(this.ne.nicPanel) { var panelElm = this.ne.nicPanel.elm; var panelPos = panelElm.pos(); var newLeft = panelPos[0]+parseInt(panelElm.getStyle('width'))-(parseInt(this.pane.getStyle('width'))+8); if(newLeft < this.pos[0]) { this.contain.setStyle({left : newLeft+'px'}); } } }, toggle : function() { this.isVisible = !this.isVisible; this.contain.setStyle({display : ((this.isVisible) ? 'block' : 'none')}); }, remove : function() { if(this.contain) { this.contain.remove(); this.contain = null; } }, append : function(c) { c.appendTo(this.pane); }, setContent : function(c) { this.pane.setContent(c); } }); var nicEditorAdvancedButton = nicEditorButton.extend({ init : function() { this.ne.addEvent('selected',this.removePane.closure(this)).addEvent('blur',this.removePane.closure(this)); }, mouseClick : function() { if(!this.isDisabled) { if(this.pane && this.pane.pane) { this.removePane(); } else { this.pane = new nicEditorPane(this.contain,this.ne,{width : (this.width || '270px'), backgroundColor : '#fff'},this); this.addPane(); this.ne.selectedInstance.saveRng(); } } }, addForm : function(f,elm) { this.form = new bkElement('form').addEvent('submit',this.submit.closureListener(this)); this.pane.append(this.form); this.inputs = {}; for(itm in f) { var field = f[itm]; var val = ''; if(elm) { val = elm.getAttribute(itm); } if(!val) { val = field['value'] || ''; } var type = f[itm].type; if(type == 'title') { new bkElement('div').setContent(field.txt).setStyle({fontSize : '14px', fontWeight: 'bold', padding : '0px', margin : '2px 0'}).appendTo(this.form); } else { var contain = new bkElement('div').setStyle({overflow : 'hidden', clear : 'both'}).appendTo(this.form); if(field.txt) { new bkElement('label').setAttributes({'for' : itm}).setContent(field.txt).setStyle({margin : '2px 4px', fontSize : '13px', width: '50px', lineHeight : '20px', textAlign : 'right', 'float' : 'left'}).appendTo(contain); } switch(type) { case 'text': this.inputs[itm] = new bkElement('input').setAttributes({id : itm, 'value' : val, 'type' : 'text'}).setStyle({margin : '2px 0', fontSize : '13px', 'float' : 'left', height : '20px', border : '1px solid #ccc', overflow : 'hidden'}).setStyle(field.style).appendTo(contain); break; case 'select': this.inputs[itm] = new bkElement('select').setAttributes({id : itm}).setStyle({border : '1px solid #ccc', 'float' : 'left', margin : '2px 0'}).appendTo(contain); for(opt in field.options) { var o = new bkElement('option').setAttributes({value : opt, selected : (opt == val) ? 'selected' : ''}).setContent(field.options[opt]).appendTo(this.inputs[itm]); } break; case 'content': this.inputs[itm] = new bkElement('textarea').setAttributes({id : itm}).setStyle({border : '1px solid #ccc', 'float' : 'left'}).setStyle(field.style).appendTo(contain); this.inputs[itm].value = val; } } } new bkElement('input').setAttributes({'type' : 'submit'}).setStyle({backgroundColor : '#efefef',border : '1px solid #ccc', margin : '3px 0', 'float' : 'left', 'clear' : 'both'}).appendTo(this.form); this.form.onsubmit = bkLib.cancelEvent; }, submit : function() { }, findElm : function(tag,attr,val) { var list = this.ne.selectedInstance.getElm().getElementsByTagName(tag); for(var i=0;i<list.length;i++) { if(list[i].getAttribute(attr) == val) { return $BK(list[i]); } } }, removePane : function() { if(this.pane) { this.pane.remove(); this.pane = null; this.ne.selectedInstance.restoreRng(); } } }); var nicButtonTips = bkClass.extend({ construct : function(nicEditor) { this.ne = nicEditor; nicEditor.addEvent('buttonOver',this.show.closure(this)).addEvent('buttonOut',this.hide.closure(this)); }, show : function(button) { this.timer = setTimeout(this.create.closure(this,button),400); }, create : function(button) { this.timer = null; if(!this.pane) { this.pane = new nicEditorPane(button.button,this.ne,{fontSize : '12px', marginTop : '5px'}); this.pane.setContent(button.options.name); } }, hide : function(button) { if(this.timer) { clearTimeout(this.timer); } if(this.pane) { this.pane = this.pane.remove(); } } }); nicEditors.registerPlugin(nicButtonTips); /* START CONFIG */ var nicSelectOptions = { buttons : { 'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'}, 'fontFamily' : {name : __('Select Font Family'), type : 'nicEditorFontFamilySelect', command : 'fontname'}, 'fontFormat' : {name : __('Select Font Format'), type : 'nicEditorFontFormatSelect', command : 'formatBlock'} } }; /* END CONFIG */ var nicEditorSelect = bkClass.extend({ construct : function(e,buttonName,options,nicEditor) { this.options = options.buttons[buttonName]; this.elm = e; this.ne = nicEditor; this.name = buttonName; this.selOptions = new Array(); this.margin = new bkElement('div').setStyle({'float' : 'left', margin : '2px 1px 0 1px'}).appendTo(this.elm); this.contain = new bkElement('div').setStyle({width: '90px', height : '20px', cursor : 'pointer', overflow: 'hidden'}).addClass('selectContain').addEvent('click',this.toggle.closure(this)).appendTo(this.margin); this.items = new bkElement('div').setStyle({overflow : 'hidden', zoom : 1, border: '1px solid #ccc', paddingLeft : '3px', backgroundColor : '#fff'}).appendTo(this.contain); this.control = new bkElement('div').setStyle({overflow : 'hidden', 'float' : 'right', height: '18px', width : '16px'}).addClass('selectControl').setStyle(this.ne.getIcon('arrow',options)).appendTo(this.items); this.txt = new bkElement('div').setStyle({overflow : 'hidden', 'float' : 'left', width : '66px', height : '14px', marginTop : '1px', fontFamily : 'sans-serif', textAlign : 'center', fontSize : '12px'}).addClass('selectTxt').appendTo(this.items); if(!window.opera) { this.contain.onmousedown = this.control.onmousedown = this.txt.onmousedown = bkLib.cancelEvent; } this.margin.noSelect(); this.ne.addEvent('selected', this.enable.closure(this)).addEvent('blur', this.disable.closure(this)); this.disable(); this.init(); }, disable : function() { this.isDisabled = true; this.close(); this.contain.setStyle({opacity : 0.6}); }, enable : function(t) { this.isDisabled = false; this.close(); this.contain.setStyle({opacity : 1}); }, setDisplay : function(txt) { this.txt.setContent(txt); }, toggle : function() { if(!this.isDisabled) { (this.pane) ? this.close() : this.open(); } }, open : function() { this.pane = new nicEditorPane(this.items,this.ne,{width : '88px', padding: '0px', borderTop : 0, borderLeft : '1px solid #ccc', borderRight : '1px solid #ccc', borderBottom : '0px', backgroundColor : '#fff'}); for(var i=0;i<this.selOptions.length;i++) { var opt = this.selOptions[i]; var itmContain = new bkElement('div').setStyle({overflow : 'hidden', borderBottom : '1px solid #ccc', width: '88px', textAlign : 'left', overflow : 'hidden', cursor : 'pointer'}); var itm = new bkElement('div').setStyle({padding : '0px 4px'}).setContent(opt[1]).appendTo(itmContain).noSelect(); itm.addEvent('click',this.update.closure(this,opt[0])).addEvent('mouseover',this.over.closure(this,itm)).addEvent('mouseout',this.out.closure(this,itm)).setAttributes('id',opt[0]); this.pane.append(itmContain); if(!window.opera) { itm.onmousedown = bkLib.cancelEvent; } } }, close : function() { if(this.pane) { this.pane = this.pane.remove(); } }, over : function(opt) { opt.setStyle({backgroundColor : '#ccc'}); }, out : function(opt) { opt.setStyle({backgroundColor : '#fff'}); }, add : function(k,v) { this.selOptions.push(new Array(k,v)); }, update : function(elm) { this.ne.nicCommand(this.options.command,elm); this.close(); } }); var nicEditorFontSizeSelect = nicEditorSelect.extend({ sel : {1 : '1&nbsp;(8pt)', 2 : '2&nbsp;(10pt)', 3 : '3&nbsp;(12pt)', 4 : '4&nbsp;(14pt)', 5 : '5&nbsp;(18pt)', 6 : '6&nbsp;(24pt)'}, init : function() { this.setDisplay('Font&nbsp;Size...'); for(itm in this.sel) { this.add(itm,'<font size="'+itm+'">'+this.sel[itm]+'</font>'); } } }); var nicEditorFontFamilySelect = nicEditorSelect.extend({ sel : {'arial' : 'Arial','comic sans ms' : 'Comic Sans','courier new' : 'Courier New','georgia' : 'Georgia', 'helvetica' : 'Helvetica', 'impact' : 'Impact', 'times new roman' : 'Times', 'trebuchet ms' : 'Trebuchet', 'verdana' : 'Verdana'}, init : function() { this.setDisplay('Font&nbsp;Family...'); for(itm in this.sel) { this.add(itm,'<font face="'+itm+'">'+this.sel[itm]+'</font>'); } } }); var nicEditorFontFormatSelect = nicEditorSelect.extend({ sel : {'p' : 'Paragraph', 'pre' : 'Pre', 'h6' : 'Heading&nbsp;6', 'h5' : 'Heading&nbsp;5', 'h4' : 'Heading&nbsp;4', 'h3' : 'Heading&nbsp;3', 'h2' : 'Heading&nbsp;2', 'h1' : 'Heading&nbsp;1'}, init : function() { this.setDisplay('Font&nbsp;Format...'); for(itm in this.sel) { var tag = itm.toUpperCase(); this.add('<'+tag+'>','<'+itm+' style="padding: 0px; margin: 0px;">'+this.sel[itm]+'</'+tag+'>'); } } }); nicEditors.registerPlugin(nicPlugin,nicSelectOptions); /* START CONFIG */ var nicLinkOptions = { buttons : { 'link' : {name : 'Add Link', type : 'nicLinkButton', tags : ['A']}, 'unlink' : {name : 'Remove Link', command : 'unlink', noActive : true} } }; /* END CONFIG */ var nicLinkButton = nicEditorAdvancedButton.extend({ addPane : function() { this.ln = this.ne.selectedInstance.selElm().parentTag('A'); this.addForm({ '' : {type : 'title', txt : 'Add/Edit Link'}, 'href' : {type : 'text', txt : 'URL', value : 'http://', style : {width: '150px'}}, 'title' : {type : 'text', txt : 'Title'}, 'target' : {type : 'select', txt : 'Open In', options : {'' : 'Current Window', '_blank' : 'New Window'},style : {width : '100px'}} },this.ln); }, submit : function(e) { var url = this.inputs['href'].value; if(url == "http://" || url == "") { alert("You must enter a URL to Create a Link"); return false; } this.removePane(); if(!this.ln) { var tmp = 'javascript:nicTemp();'; this.ne.nicCommand("createlink",tmp); this.ln = this.findElm('A','href',tmp); } if(this.ln) { this.ln.setAttributes({ href : this.inputs['href'].value, title : this.inputs['title'].value, target : this.inputs['target'].options[this.inputs['target'].selectedIndex].value }); } } }); nicEditors.registerPlugin(nicPlugin,nicLinkOptions); /* START CONFIG */ var nicColorOptions = { buttons : { 'forecolor' : {name : __('Change Text Color'), type : 'nicEditorColorButton', noClose : true}, 'bgcolor' : {name : __('Change Background Color'), type : 'nicEditorBgColorButton', noClose : true} } }; /* END CONFIG */ var nicEditorColorButton = nicEditorAdvancedButton.extend({ addPane : function() { var colorList = {0 : '00',1 : '33',2 : '66',3 :'99',4 : 'CC',5 : 'FF'}; var colorItems = new bkElement('DIV').setStyle({width: '270px'}); for(var r in colorList) { for(var b in colorList) { for(var g in colorList) { var colorCode = '#'+colorList[r]+colorList[g]+colorList[b]; var colorSquare = new bkElement('DIV').setStyle({'cursor' : 'pointer', 'height' : '15px', 'float' : 'left'}).appendTo(colorItems); var colorBorder = new bkElement('DIV').setStyle({border: '2px solid '+colorCode}).appendTo(colorSquare); var colorInner = new bkElement('DIV').setStyle({backgroundColor : colorCode, overflow : 'hidden', width : '11px', height : '11px'}).addEvent('click',this.colorSelect.closure(this,colorCode)).addEvent('mouseover',this.on.closure(this,colorBorder)).addEvent('mouseout',this.off.closure(this,colorBorder,colorCode)).appendTo(colorBorder); if(!window.opera) { colorSquare.onmousedown = colorInner.onmousedown = bkLib.cancelEvent; } } } } this.pane.append(colorItems.noSelect()); }, colorSelect : function(c) { this.ne.nicCommand('foreColor',c); this.removePane(); }, on : function(colorBorder) { colorBorder.setStyle({border : '2px solid #000'}); }, off : function(colorBorder,colorCode) { colorBorder.setStyle({border : '2px solid '+colorCode}); } }); var nicEditorBgColorButton = nicEditorColorButton.extend({ colorSelect : function(c) { this.ne.nicCommand('hiliteColor',c); this.removePane(); } }); nicEditors.registerPlugin(nicPlugin,nicColorOptions); /* START CONFIG */ var nicImageOptions = { buttons : { 'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']} } }; /* END CONFIG */ var nicImageButton = nicEditorAdvancedButton.extend({ addPane : function() { this.im = this.ne.selectedInstance.selElm().parentTag('IMG'); this.addForm({ '' : {type : 'title', txt : 'Add/Edit Image'}, 'src' : {type : 'text', txt : 'URL', 'value' : 'http://', style : {width: '150px'}}, 'alt' : {type : 'text', txt : 'Alt Text', style : {width: '100px'}}, 'align' : {type : 'select', txt : 'Align', options : {none : 'Default','left' : 'Left', 'right' : 'Right'}} },this.im); }, submit : function(e) { var src = this.inputs['src'].value; if(src == "" || src == "http://") { alert("You must enter a Image URL to insert"); return false; } this.removePane(); if(!this.im) { var tmp = 'javascript:nicImTemp();'; this.ne.nicCommand("insertImage",tmp); this.im = this.findElm('IMG','src',tmp); } if(this.im) { this.im.setAttributes({ src : this.inputs['src'].value, alt : this.inputs['alt'].value, align : this.inputs['align'].value }); } } }); nicEditors.registerPlugin(nicPlugin,nicImageOptions); /* START CONFIG */ var nicSaveOptions = { buttons : { 'save' : {name : __('Save this content'), type : 'nicEditorSaveButton'} } }; /* END CONFIG */ var nicEditorSaveButton = nicEditorButton.extend({ init : function() { if(!this.ne.options.onSave) { this.margin.setStyle({'display' : 'none'}); } }, mouseClick : function() { var onSave = this.ne.options.onSave; var selectedInstance = this.ne.selectedInstance; onSave(selectedInstance.getContent(), selectedInstance.elm.id, selectedInstance); } }); nicEditors.registerPlugin(nicPlugin,nicSaveOptions); /* START CONFIG */ var nicUploadOptions = { buttons : { 'upload' : {name : 'Upload Image', type : 'nicUploadButton'} } }; /* END CONFIG */ var nicUploadButton = nicEditorAdvancedButton.extend({ nicURI : 'http://api.imgur.com/2/upload.json', errorText : 'Failed to upload image', addPane : function() { if(typeof window.FormData === "undefined") { return this.onError("Image uploads are not supported in this browser, use Chrome, Firefox, or Safari instead."); } this.im = this.ne.selectedInstance.selElm().parentTag('IMG'); var container = new bkElement('div') .setStyle({ padding: '10px' }) .appendTo(this.pane.pane); new bkElement('div') .setStyle({ fontSize: '14px', fontWeight : 'bold', paddingBottom: '5px' }) .setContent('Insert an Image') .appendTo(container); this.fileInput = new bkElement('input') .setAttributes({ 'type' : 'file' }) .appendTo(container); this.progress = new bkElement('progress') .setStyle({ width : '100%', display: 'none' }) .setAttributes('max', 100) .appendTo(container); this.fileInput.onchange = this.uploadFile.closure(this); }, onError : function(msg) { this.removePane(); alert(msg || "Failed to upload image"); }, uploadFile : function() { var file = this.fileInput.files[0]; if (!file || !file.type.match(/image.*/)) { this.onError("Only image files can be uploaded"); return; } this.fileInput.setStyle({ display: 'none' }); this.setProgress(0); var fd = new FormData(); // https://hacks.mozilla.org/2011/01/how-to-develop-a-html5-image-uploader/ fd.append("image", file); fd.append("key", "b7ea18a4ecbda8e92203fa4968d10660"); var xhr = new XMLHttpRequest(); xhr.open("POST", this.ne.options.uploadURI || this.nicURI); xhr.onload = function() { try { var res = JSON.parse(xhr.responseText); } catch(e) { return this.onError(); } this.onUploaded(res.upload); }.closure(this); xhr.onerror = this.onError.closure(this); xhr.upload.onprogress = function(e) { this.setProgress(e.loaded / e.total); }.closure(this); xhr.send(fd); }, setProgress : function(percent) { this.progress.setStyle({ display: 'block' }); if(percent < .98) { this.progress.value = percent; } else { this.progress.removeAttribute('value'); } }, onUploaded : function(options) { this.removePane(); var src = options.links.original; if(!this.im) { this.ne.selectedInstance.restoreRng(); var tmp = 'javascript:nicImTemp();'; this.ne.nicCommand("insertImage", src); this.im = this.findElm('IMG','src', src); } var w = parseInt(this.ne.selectedInstance.elm.getStyle('width')); if(this.im) { this.im.setAttributes({ src : src, width : (w && options.image.width) ? Math.min(w, options.image.width) : '' }); } } }); nicEditors.registerPlugin(nicPlugin,nicUploadOptions); var nicXHTML = bkClass.extend({ stripAttributes : ['_moz_dirty','_moz_resizing','_extended'], noShort : ['style','title','script','textarea','a'], cssReplace : {'font-weight:bold;' : 'strong', 'font-style:italic;' : 'em'}, sizes : {1 : 'xx-small', 2 : 'x-small', 3 : 'small', 4 : 'medium', 5 : 'large', 6 : 'x-large'}, construct : function(nicEditor) { this.ne = nicEditor; if(this.ne.options.xhtml) { nicEditor.addEvent('get',this.cleanup.closure(this)); } }, cleanup : function(ni) { var node = ni.getElm(); var xhtml = this.toXHTML(node); ni.content = xhtml; }, toXHTML : function(n,r,d) { var txt = ''; var attrTxt = ''; var cssTxt = ''; var nType = n.nodeType; var nName = n.nodeName.toLowerCase(); var nChild = n.hasChildNodes && n.hasChildNodes(); var extraNodes = new Array(); switch(nType) { case 1: var nAttributes = n.attributes; switch(nName) { case 'b': nName = 'strong'; break; case 'i': nName = 'em'; break; case 'font': nName = 'span'; break; } if(r) { for(var i=0;i<nAttributes.length;i++) { var attr = nAttributes[i]; var attributeName = attr.nodeName.toLowerCase(); var attributeValue = attr.nodeValue; if(!attr.specified || !attributeValue || bkLib.inArray(this.stripAttributes,attributeName) || typeof(attributeValue) == "function") { continue; } switch(attributeName) { case 'style': var css = attributeValue.replace(/ /g,""); for(itm in this.cssReplace) { if(css.indexOf(itm) != -1) { extraNodes.push(this.cssReplace[itm]); css = css.replace(itm,''); } } cssTxt += css; attributeValue = ""; break; case 'class': attributeValue = attributeValue.replace("Apple-style-span",""); break; case 'size': cssTxt += "font-size:"+this.sizes[attributeValue]+';'; attributeValue = ""; break; } if(attributeValue) { attrTxt += ' '+attributeName+'="'+attributeValue+'"'; } } if(cssTxt) { attrTxt += ' style="'+cssTxt+'"'; } for(var i=0;i<extraNodes.length;i++) { txt += '<'+extraNodes[i]+'>'; } if(attrTxt == "" && nName == "span") { r = false; } if(r) { txt += '<'+nName; if(nName != 'br') { txt += attrTxt; } } } if(!nChild && !bkLib.inArray(this.noShort,attributeName)) { if(r) { txt += ' />'; } } else { if(r) { txt += '>'; } for(var i=0;i<n.childNodes.length;i++) { var results = this.toXHTML(n.childNodes[i],true,true); if(results) { txt += results; } } } if(r && nChild) { txt += '</'+nName+'>'; } for(var i=0;i<extraNodes.length;i++) { txt += '</'+extraNodes[i]+'>'; } break; case 3: //if(n.nodeValue != '\n') { txt += n.nodeValue; //} break; } return txt; } }); nicEditors.registerPlugin(nicXHTML); var nicBBCode = bkClass.extend({ construct : function(nicEditor) { this.ne = nicEditor; if(this.ne.options.bbCode) { nicEditor.addEvent('get',this.bbGet.closure(this)); nicEditor.addEvent('set',this.bbSet.closure(this)); var loadedPlugins = this.ne.loadedPlugins; for(itm in loadedPlugins) { if(loadedPlugins[itm].toXHTML) { this.xhtml = loadedPlugins[itm]; } } } }, bbGet : function(ni) { var xhtml = this.xhtml.toXHTML(ni.getElm()); ni.content = this.toBBCode(xhtml); }, bbSet : function(ni) { ni.content = this.fromBBCode(ni.content); }, toBBCode : function(xhtml) { function rp(r,m) { xhtml = xhtml.replace(r,m); } rp(/\n/gi,""); rp(/<strong>(.*?)<\/strong>/gi,"[b]$1[/b]"); rp(/<em>(.*?)<\/em>/gi,"[i]$1[/i]"); rp(/<span.*?style="text-decoration:underline;">(.*?)<\/span>/gi,"[u]$1[/u]"); rp(/<ul>(.*?)<\/ul>/gi,"[list]$1[/list]"); rp(/<li>(.*?)<\/li>/gi,"[*]$1[/*]"); rp(/<ol>(.*?)<\/ol>/gi,"[list=1]$1[/list]"); rp(/<img.*?src="(.*?)".*?>/gi,"[img]$1[/img]"); rp(/<a.*?href="(.*?)".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"); rp(/<br.*?>/gi,"\n"); rp(/<.*?>.*?<\/.*?>/gi,""); return xhtml; }, fromBBCode : function(bbCode) { function rp(r,m) { bbCode = bbCode.replace(r,m); } rp(/\[b\](.*?)\[\/b\]/gi,"<strong>$1</strong>"); rp(/\[i\](.*?)\[\/i\]/gi,"<em>$1</em>"); rp(/\[u\](.*?)\[\/u\]/gi,"<span style=\"text-decoration:underline;\">$1</span>"); rp(/\[list\](.*?)\[\/list\]/gi,"<ul>$1</ul>"); rp(/\[list=1\](.*?)\[\/list\]/gi,"<ol>$1</ol>"); rp(/\[\*\](.*?)\[\/\*\]/gi,"<li>$1</li>"); rp(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"); rp(/\[url=(.*?)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>"); rp(/\n/gi,"<br />"); //rp(/\[.*?\](.*?)\[\/.*?\]/gi,"$1"); return bbCode; } }); nicEditors.registerPlugin(nicBBCode); nicEditor = nicEditor.extend({ floatingPanel : function() { this.floating = new bkElement('DIV').setStyle({position: 'absolute', top : '-1000px'}).appendTo(document.body); this.addEvent('focus', this.reposition.closure(this)).addEvent('blur', this.hide.closure(this)); this.setPanel(this.floating); }, reposition : function() { var e = this.selectedInstance.e; this.floating.setStyle({ width : (parseInt(e.getStyle('width')) || e.clientWidth)+'px' }); var top = e.offsetTop-this.floating.offsetHeight; if(top < 0) { top = e.offsetTop+e.offsetHeight; } this.floating.setStyle({ top : top+'px', left : e.offsetLeft+'px', display : 'block' }); }, hide : function() { this.floating.setStyle({ top : '-1000px'}); } }); /* START CONFIG */ var nicCodeOptions = { buttons : { 'xhtml' : {name : 'Edit HTML', type : 'nicCodeButton'} } }; /* END CONFIG */ var nicCodeButton = nicEditorAdvancedButton.extend({ width : '350px', addPane : function() { this.addForm({ '' : {type : 'title', txt : 'Edit HTML'}, 'code' : {type : 'content', 'value' : this.ne.selectedInstance.getContent(), style : {width: '340px', height : '200px'}} }); }, submit : function(e) { var code = this.inputs['code'].value; this.ne.selectedInstance.setContent(code); this.removePane(); } }); nicEditors.registerPlugin(nicPlugin,nicCodeOptions);
drupaals/demo.com
d7/sites/all/libraries/nicedit/nicEdit.js
JavaScript
gpl-2.0
50,796
[ 30522, 1013, 1008, 3835, 23194, 1011, 12702, 23881, 1059, 7274, 2072, 18418, 2290, 1008, 9385, 2289, 1011, 2263, 4422, 11382, 11140, 7245, 1008, 1008, 3835, 23194, 2003, 5500, 2104, 1996, 3408, 1997, 1996, 10210, 6105, 1008, 2005, 2062, 259...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
body, html { margin: 0px; background-color: black; overflow: hidden; height: 100%; } canvas[resize] { width: 100%; height: 100%; } #container { display: flex; height: 100vh; align-content: center; align-items: center; position: absolute; top: 0px; } video { flex: 1 1 100vw; align-self: center; width: 100vw; /*transform: translateY(-50%);*/ } .draw { position: absolute; top: 0px; left: 0px; } #render canvas{ width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; } #htmlUI { position: absolute; top: 0px; background: #00AFEF; width: 100vw; height: 100vh; }
alex4o/Graphene
src/css/global.css
CSS
gpl-3.0
618
[ 30522, 2303, 1010, 16129, 1063, 7785, 1024, 1014, 2361, 2595, 1025, 4281, 1011, 3609, 1024, 2304, 1025, 2058, 12314, 1024, 5023, 1025, 4578, 1024, 2531, 1003, 1025, 1065, 10683, 1031, 24501, 4697, 1033, 1063, 9381, 1024, 2531, 1003, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2010-2021 Google LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef OR_TOOLS_GLOP_PRIMAL_EDGE_NORMS_H_ #define OR_TOOLS_GLOP_PRIMAL_EDGE_NORMS_H_ #include <cstdint> #include "ortools/glop/basis_representation.h" #include "ortools/glop/parameters.pb.h" #include "ortools/glop/update_row.h" #include "ortools/glop/variables_info.h" #include "ortools/lp_data/lp_data.h" #include "ortools/lp_data/lp_types.h" #include "ortools/lp_data/scattered_vector.h" #include "ortools/util/stats.h" namespace operations_research { namespace glop { // This class maintains the primal edge squared norms (and other variants) to be // used in the primal pricing step. Instead of computing the needed values from // scractch at each iteration, it is more efficient to update them incrementally // for each basis pivot applied to the simplex basis matrix B. // // Terminology: // - To each non-basic column 'a' of a matrix A, we can associate an "edge" in // the kernel of A equal to 1.0 on the index of 'a' and '-B^{-1}.a' on the // basic variables. // - 'B^{-1}.a' is called the "right inverse" of 'a'. // - The entering edge is the edge we are following during a simplex step, // and we call "direction" the reverse of this edge restricted to the // basic variables, i.e. the right inverse of the entering column. // // Papers: // - D. Goldfarb, J.K. Reid, "A practicable steepest-edge simplex algorithm" // Mathematical Programming 12 (1977) 361-371, North-Holland. // http://www.springerlink.com/content/g8335137n3j16934/ // - J.J. Forrest, D. Goldfarb, "Steepest-edge simplex algorithms for linear // programming", Mathematical Programming 57 (1992) 341-374, North-Holland. // http://www.springerlink.com/content/q645w3t2q229m248/ // - Ping-Qi Pan "A fast simplex algorithm for linear programming". // http://www.optimization-online.org/DB_FILE/2007/10/1805.pdf // - Ping-Qi Pan, "Efficient nested pricing in the simplex algorithm", // http://www.optimization-online.org/DB_FILE/2007/10/1810.pdf class PrimalEdgeNorms { public: // Takes references to the linear program data we need. Note that we assume // that the matrix will never change in our back, but the other references are // supposed to reflect the correct state. PrimalEdgeNorms(const CompactSparseMatrix& compact_matrix, const VariablesInfo& variables_info, const BasisFactorization& basis_factorization); // Clears, i.e. resets the object to its initial value. This will trigger // a recomputation for the next Get*() method call. void Clear(); // If this is true, then the caller must re-factorize the basis before the // next call to GetEdgeSquaredNorms(). This is because the latter will // recompute the norms from scratch and therefore needs a hightened precision // and speed. bool NeedsBasisRefactorization() const; // Depending on the SetPricingRule(), this returns one of the "norms" vector // below. Note that all norms are squared. const DenseRow& GetSquaredNorms(); // Returns the primal edge squared norms. This is only valid if the caller // properly called UpdateBeforeBasisPivot() before each basis pivot, or if // this is the first call to this function after a Clear(). Note that only the // relevant columns are filled. const DenseRow& GetEdgeSquaredNorms(); // Returns an approximation of the edges norms "devex". // This is only valid if the caller properly called UpdateBeforeBasisPivot() // before each basis pivot, or if this is the first call to this function // after a Clear(). const DenseRow& GetDevexWeights(); // Returns the L2 norms of all the columns of A. // Note that this is currently not cleared by Clear(). const DenseRow& GetMatrixColumnNorms(); // Compares the current entering edge norm with its precise version (using the // direction that wasn't avaible before) and triggers a full recomputation if // the precision is not good enough (see recompute_edges_norm_threshold in // GlopParameters). As a side effect, this replace the entering_col edge // norm with its precise version. void TestEnteringEdgeNormPrecision(ColIndex entering_col, const ScatteredColumn& direction); // Updates any internal data BEFORE the given simplex pivot is applied to B. // Note that no updates are needed in case of a bound flip. // The arguments are in order: // - The index of the entering non-basic column of A. // - The index in B of the leaving basic variable. // - The 'direction', i.e. the right inverse of the entering column. // - The update row (see UpdateRow), which will only be computed if needed. void UpdateBeforeBasisPivot(ColIndex entering_col, ColIndex leaving_col, RowIndex leaving_row, const ScatteredColumn& direction, UpdateRow* update_row); // Sets the algorithm parameters. void SetParameters(const GlopParameters& parameters) { parameters_ = parameters; } // This changes what GetSquaredNorms() returns. void SetPricingRule(GlopParameters::PricingRule rule) { pricing_rule_ = rule; } // Registers a boolean that will be set to true each time the norms are or // will be recomputed. This allows anyone that depends on this to know that it // cannot just assume an incremental changes and needs to updates its data. // Important: UpdateBeforeBasisPivot() will not trigger this. void AddRecomputationWatcher(bool* watcher) { watchers_.push_back(watcher); } // Returns a string with statistics about this class. std::string StatString() const { return stats_.StatString(); } // Deterministic time used by the scalar product computation of this class. double DeterministicTime() const { return DeterministicTimeForFpOperations(num_operations_); } private: // Statistics about this class. struct Stats : public StatsGroup { Stats() : StatsGroup("PrimalEdgeNorms"), direction_left_inverse_density("direction_left_inverse_density", this), direction_left_inverse_accuracy("direction_left_inverse_accuracy", this), edges_norm_accuracy("edges_norm_accuracy", this), lower_bounded_norms("lower_bounded_norms", this) {} RatioDistribution direction_left_inverse_density; DoubleDistribution direction_left_inverse_accuracy; DoubleDistribution edges_norm_accuracy; IntegerDistribution lower_bounded_norms; }; // Recompute the matrix column L2 norms from scratch. void ComputeMatrixColumnNorms(); // Recompute the edge squared L2 norms from scratch. void ComputeEdgeSquaredNorms(); // Compute the left inverse of the direction. // The first argument is there for checking precision. void ComputeDirectionLeftInverse(ColIndex entering_col, const ScatteredColumn& direction); // Updates edges_squared_norm_ according to the given pivot. void UpdateEdgeSquaredNorms(ColIndex entering_col, ColIndex leaving_col, RowIndex leaving_row, const DenseColumn& direction, const UpdateRow& update_row); // Resets all devex weights to 1.0 . void ResetDevexWeights(); // Updates devex_weights_ according to the given pivot. void UpdateDevexWeights(ColIndex entering_col, ColIndex leaving_col, RowIndex leaving_row, const DenseColumn& direction, const UpdateRow& update_row); // Problem data that should be updated from outside. const CompactSparseMatrix& compact_matrix_; const VariablesInfo& variables_info_; const BasisFactorization& basis_factorization_; // Internal data. GlopParameters parameters_; GlopParameters::PricingRule pricing_rule_ = GlopParameters::DANTZIG; Stats stats_; // Booleans to control what happens on the next ChooseEnteringColumn() call. bool must_refactorize_basis_; bool recompute_edge_squared_norms_; bool reset_devex_weights_; // Norm^2 of the edges of the relevant columns of A. DenseRow edge_squared_norms_; // Norm of all the columns of A. DenseRow matrix_column_norms_; // Approximation of edges norms "devex". // Denoted by vector 'w' in Pin Qi Pan (1810.pdf section 1.1.4) // At any time, devex_weights_ >= 1.0. DenseRow devex_weights_; // Tracks number of updates of the devex weights since we have to reset // them to 1.0 every now and then. int num_devex_updates_since_reset_; // Left inverse by B of the 'direction'. This is the transpose of 'v' in the // steepest edge paper. Its scalar product with a column 'a' of A gives the // value of the scalar product of the 'direction' with the right inverse of // 'a'. ScatteredRow direction_left_inverse_; // Used by DeterministicTime(). int64_t num_operations_; // Boolean(s) to set to false when the norms are changed outside of the // UpdateBeforeBasisPivot() function. std::vector<bool*> watchers_; DISALLOW_COPY_AND_ASSIGN(PrimalEdgeNorms); }; } // namespace glop } // namespace operations_research #endif // OR_TOOLS_GLOP_PRIMAL_EDGE_NORMS_H_
google/or-tools
ortools/glop/primal_edge_norms.h
C
apache-2.0
9,810
[ 30522, 1013, 1013, 9385, 2230, 1011, 25682, 8224, 11775, 1013, 1013, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1013, 1013, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# PermissionsTime ### 支持跨服的权限限时插件 ##### PermissionsTime插件下载地址:[https://ci.frog.gg/job/PermissionsTime/](https://ci.frog.gg/job/PermissionsTime/) ##### [插件使用说明](https://github.com/geekfrog/PermissionsTime/wiki/PermissionsTime-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E) ##### 前置插件FrogsPluginLib(宅宅蛙的插件前置库) 下载地址:[https://ci.frog.gg/job/FrogsPluginLib/](https://ci.frog.gg/job/FrogsPluginLib/) ##### 前置插件Vault 下载地址:[https://dev.bukkit.org/projects/vault/](https://dev.bukkit.org/projects/vault/) ### 可选前置插件: ##### 前置插件PlaceholderAPI下载地址:[https://www.spigotmc.org/resources/placeholderapi.6245/](https://www.spigotmc.org/resources/placeholderapi.6245/) 本插件并非权限插件, 而是权限扩展插件. 可以限制权限和权限组的使用时间. 使用时必须同时使用FrogsPluginLib及Vault两个前置插件. 使用跨服权限, 要在配置文件里开启MySQl功能. 经测试支持大部分1.7.10-1.12的服务器. 其他版本未做测试. #### 插件截图: ![image](http://i.imgur.com/cnnd5hb.jpg) ![image](http://i.imgur.com/bqvIVvz.jpg) ![image](http://i.imgur.com/NFK3WKa.jpg) #### 已知问题(作者提醒): - 如果出现问题一般退出服务器重进就能解决。一次不行再来一次。 - 插件重载不会重置在线玩家的权限, 如有必要请重启服务器。 - 玩家每次登陆会重置权限包涉及的权限。请不要单独给予玩家涉及的权限。 - 服务器关闭时, 插件被禁用的顺序不一, 会导致玩家有权限留存。 如果配置的权限包删掉原来设置的权限(或修改世界), 会导致插件无法清理原有的权限及权限组。(你可以配置一个不使用的权限包, 权限包内含有你想清理的权限及权限组即可。) #### 插件进度: 加粗项已完成 - **在配置文件中编辑权限包(可含有多个权限组和多个权限)** - **时间可以累加** - **支持重载** - **支持UUID** - **命令支持给玩家添加、设置、移除、查询自身权限包时间** - **添加、设置、移除-命令执行失败记录** - **支持多世界权限(需要权限插件支持)** - **调用vault API 设置玩家权限 -- 登录时(添加 移除)、游戏中(命令添加/移除 延迟移除)、退出时移除** - **mysql保存数据** - **支持跨服** - **gui显示自己的权限包** - **语言支持整理** - **支持自定义哪个玩家的头颅** - **支持物品发光(附魔效果)** - **玩家进入游戏时赋予权限更早** - **管理员查看玩家到期时间** - **检测是否有新版本** - **提示权限包到期** - **玩家登录时删除过期的或无效数据** - **提示剩余时间** - **权限包到期可执行自定义命令** - 支持分页? #### 使用统计: [https://bstats.org/plugin/bukkit/PermissionsTime](https://bstats.org/plugin/bukkit/PermissionsTime)
geekfrog/PermissionsTime
README.md
Markdown
gpl-3.0
2,959
[ 30522, 1001, 6656, 16643, 4168, 1001, 1001, 1001, 100, 100, 100, 100, 1916, 100, 100, 100, 100, 100, 100, 1001, 1001, 1001, 1001, 1001, 6656, 16643, 4168, 100, 100, 1743, 100, 1802, 100, 1024, 1031, 16770, 1024, 1013, 1013, 25022, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `ELOOP` constant in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, ELOOP"> <title>libc::ELOOP - Rust</title> <link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'ELOOP', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='index.html'>libc</a>::<wbr><a class='constant' href=''>ELOOP</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-2856' class='srclink' href='../src/libc/unix/notbsd/linux/other/mod.rs.html#195' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const ELOOP: <a class='type' href='../libc/type.c_int.html' title='libc::c_int'>c_int</a><code> = </code><code>40</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>
servo/doc.servo.org
libc/constant.ELOOP.html
HTML
mpl-2.0
4,262
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 418...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace eidss.winclient.FlexForms.Controls { partial class DesignerHost { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { components = new System.ComponentModel.Container(); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; } #endregion } }
EIDSS/EIDSS-Legacy
EIDSS v6/eidss.winclient/FlexForms/Controls/DesignerHost.Designer.cs
C#
bsd-2-clause
1,165
[ 30522, 3415, 15327, 1041, 9821, 2015, 1012, 2663, 20464, 11638, 1012, 23951, 22694, 1012, 7711, 1063, 7704, 2465, 5859, 15006, 2102, 1063, 1013, 1013, 1013, 1026, 12654, 1028, 1013, 1013, 1013, 3223, 5859, 8023, 1012, 1013, 1013, 1013, 1026...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php include_once "./_common.php"; //pc버전에서 모바일가기 링크 타고 들어올 경우 세션을 삭제한다. 세션이 삭제되면 모바일 기기에서 PC버전 접속시 자동으로 모바일로 이동된다. /extend/g4m.config.php 파일 참고. if($_GET['from'] == 'pc'){ set_session("frommoblie", ""); } include_once './_head.php'; // 최신글 $sql = " select bo_table, bo_subject,bo_m_latest_skin from {$g4['board_table']} where bo_m_use='1' order by gr_id, bo_m_sort, bo_table "; $result = sql_query($sql); for ($i = 0; $row = sql_fetch_array($result); $i++) { echo g4m_latest($row['bo_m_latest_skin'], $row['bo_table']); } include_once './_tail.php'; ?>
typeofb/SmartTongsin
m/index.php
PHP
gpl-2.0
690
[ 30522, 1026, 1029, 25718, 2421, 1035, 2320, 1000, 1012, 1013, 1035, 2691, 1012, 25718, 1000, 1025, 1013, 1013, 7473, 29996, 30008, 30000, 30008, 30021, 29999, 30009, 29997, 30008, 1459, 30011, 29996, 30006, 29999, 30019, 30022, 29991, 30006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html> <head> <script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"> </script> <script type="text/javascript" src="opengraphbox.js"> </script> </head> <body> <form> <input type="url" name="share-url" class="share-url"> </form> <script> $("input.share-url").change(function() { OGBox.crawlForURL(this.value); }); </script> </body> </html>
david90/opengraphbox
test/test.html
HTML
gpl-2.0
426
[ 30522, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 5896, 2828, 1027, 1000, 3793, 1013, 9262, 22483, 1000, 5034, 2278, 1027, 1000, 1013, 1013, 3642, 1012, 1046, 4226, 2854, 1012, 4012, 1013, 1046, 4226, 2854, 1011, 1016, 1012, 1015, 1012, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
$curDir = pwd $dir = Split-Path -Parent $MyInvocation.MyCommand.Path echo "`n## Building Admin" echo "`nBuilding app" echo ".NET Core version $(dotnet --version)" echo "Restore" dotnet restore $dir\Admin.csproj echo "Clean" dotnet clean $dir\Admin.csproj -c "Release" -o $dir\obj\Azure\publish echo "Node Build" cd $dir npm install cd $curDir gulp --gulpfile $dir\gulpfile.js build echo "Publish" dotnet publish $dir\Admin.csproj -c "Release" -o $dir\obj\Azure\publish
bitwarden/core
src/Admin/build.ps1
PowerShell
agpl-3.0
471
[ 30522, 1002, 12731, 17080, 2099, 1027, 1052, 21724, 1002, 16101, 1027, 3975, 1011, 4130, 1011, 6687, 1002, 2026, 2378, 19152, 1012, 2026, 9006, 2386, 2094, 1012, 4130, 9052, 1000, 1036, 1050, 1001, 1001, 2311, 4748, 10020, 1000, 9052, 1000,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) Lex Li. All rights reserved. // // Licensed under the MIT license. See LICENSE file in the project root for full license information. /* * Created by SharpDevelop. * User: lextm * Time: 11:06 AM * * To change this template use Tools | Options | Coding | Edit Standard Headers. */ namespace JexusManager.Features.Main { using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Resources; using System.Windows.Forms; using JexusManager.Dialogs; using JexusManager.Main.Properties; using JexusManager.Services; using Microsoft.Web.Administration; using Microsoft.Web.Management.Client; using Microsoft.Web.Management.Client.Win32; using Binding = Microsoft.Web.Administration.Binding; using Module = Microsoft.Web.Management.Client.Module; using System.Linq; /// <summary> /// Description of DefaultDocumentFeature. /// </summary> internal class SitesFeature { private sealed class FeatureTaskList : DefaultTaskList { private readonly SitesFeature _owner; public FeatureTaskList(SitesFeature owner) { _owner = owner; } public override ICollection GetTaskItems() { var result = new ArrayList(); result.Add( new MethodTaskItem("Add", "Add Website...", string.Empty, string.Empty, Resources.site_new_16) .SetUsage()); result.Add(new MethodTaskItem("Set", "Set Website Defaults", string.Empty).SetUsage()); if (_owner.SelectedItem != null) { result.Add(new MethodTaskItem(string.Empty, "-", string.Empty).SetUsage()); result.Add(new TextTaskItem("Edit Site", string.Empty, true)); result.Add(new MethodTaskItem("Bindings", "Bindings...", string.Empty).SetUsage()); result.Add( new MethodTaskItem("Basic", "Basic Settings...", string.Empty, string.Empty, Resources.basic_settings_16).SetUsage()); result.Add(new MethodTaskItem(string.Empty, "-", string.Empty).SetUsage()); result.Add( new MethodTaskItem("Explore", "Explore", string.Empty, string.Empty, Resources.explore_16) .SetUsage()); result.Add(new MethodTaskItem("Permissions", "Edit Permissions...", string.Empty).SetUsage()); result.Add(RemoveTaskItem); result.Add(new MethodTaskItem("Rename", "Rename", string.Empty).SetUsage()); result.Add(new MethodTaskItem(string.Empty, "-", string.Empty).SetUsage()); result.Add(new MethodTaskItem("Applications", "View Applications", string.Empty).SetUsage()); result.Add( new MethodTaskItem("VirtualDirectories", "View Virtual Directories", string.Empty).SetUsage()); if (_owner.SelectedItem.Bindings.Any(item => item.CanBrowse)) { result.Add(new MethodTaskItem(string.Empty, "-", string.Empty).SetUsage()); var manageGroup = new GroupTaskItem(string.Empty, "Manage Website", string.Empty, true); result.Add(manageGroup); manageGroup.Items.Add( new MethodTaskItem("Restart", "Restart", string.Empty, string.Empty, Resources.restart_16) .SetUsage(!_owner.IsBusy)); manageGroup.Items.Add( new MethodTaskItem("Start", "Start", string.Empty, string.Empty, Resources.start_16).SetUsage( !_owner.IsBusy && _owner.SelectedItem.State != ObjectState.Started)); manageGroup.Items.Add(new MethodTaskItem("Stop", "Stop", string.Empty, string.Empty, Resources.stop_16) .SetUsage( !_owner.IsBusy && _owner.SelectedItem.State == ObjectState.Started)); manageGroup.Items.Add(new MethodTaskItem(string.Empty, "-", string.Empty).SetUsage()); manageGroup.Items.Add(new TextTaskItem("Browse Website", string.Empty, true)); foreach (Binding binding in _owner.SelectedItem.Bindings) { if (binding.CanBrowse) { var uri = binding.ToUri(); manageGroup.Items.Add( new MethodTaskItem("Browse", $"Browse {uri}", string.Empty, string.Empty, Resources.browse_16, uri).SetUsage()); } } manageGroup.Items.Add(new MethodTaskItem(string.Empty, "-", string.Empty).SetUsage()); manageGroup.Items.Add( new MethodTaskItem("Advanced", "Advanced Settings...", string.Empty).SetUsage()); manageGroup.Items.Add(new MethodTaskItem(string.Empty, "-", string.Empty).SetUsage()); manageGroup.Items.Add(new TextTaskItem("Configure", string.Empty, true)); manageGroup.Items.Add( new MethodTaskItem("Tracing", "Failed Request Tracing...", string.Empty).SetUsage()); manageGroup.Items.Add(new MethodTaskItem("Limits", "Limits...", string.Empty).SetUsage()); } } return result.ToArray(typeof(TaskItem)) as TaskItem[]; } [Obfuscation(Exclude = true)] public void Add() { _owner.Add(); } [Obfuscation(Exclude = true)] public void Set() { _owner.Set(); } [Obfuscation(Exclude = true)] public override void Remove() { _owner.Remove(); } [Obfuscation(Exclude = true)] public void Rename() { _owner.Rename(); } [Obfuscation(Exclude = true)] public void Explore() { _owner.Explore(); } [Obfuscation(Exclude = true)] public void Permissions() { _owner.Permissions(); } [Obfuscation(Exclude = true)] public void Bindings() { _owner.Bindings(); } [Obfuscation(Exclude = true)] public void Basic() { _owner.Basic(); } [Obfuscation(Exclude = true)] public void Applications() { _owner.Applications(); } [Obfuscation(Exclude = true)] public void VirtualDirectories() { _owner.VirtualDirectories(); } [Obfuscation(Exclude = true)] public void Restart() { _owner.Restart(); } [Obfuscation(Exclude = true)] public void Start() { _owner.Start(); } [Obfuscation(Exclude = true)] public void Stop() { _owner.Stop(); } [Obfuscation(Exclude = true)] public void Browse(object uri) { _owner.Browse(uri); } [Obfuscation(Exclude = true)] public void Advanced() { _owner.Advanced(); } [Obfuscation(Exclude = true)] public void Tracing() { _owner.Tracing(); } [Obfuscation(Exclude = true)] public void Limits() { _owner.Limits(); } } public SitesFeature(Module module) { Module = module; } protected static readonly Version FxVersion10 = new Version("1.0"); protected static readonly Version FxVersion11 = new Version("1.1"); protected static readonly Version FxVersion20 = new Version("2.0"); protected static readonly Version FxVersionNotRequired = new Version(); private FeatureTaskList _taskList; protected void DisplayErrorMessage(Exception ex, ResourceManager resourceManager) { var service = (IManagementUIService)GetService(typeof(IManagementUIService)); service.ShowError(ex, resourceManager.GetString("General"), "", false); } protected object GetService(Type type) { return (Module as IServiceProvider).GetService(type); } public TaskList GetTaskList() { return _taskList ?? (_taskList = new FeatureTaskList(this)); } public void Load() { var service = (IConfigurationService)GetService(typeof(IConfigurationService)); Items = service.Server.Sites; OnSitesSettingsSaved(); } public SiteCollection Items { get; set; } public Site SelectedItem { get; set; } public List<Site> SelectedItems { get; set; } protected void OnSitesSettingsSaved() { SitesSettingsUpdated?.Invoke(); } public virtual bool ShowHelp() { DialogHelper.ProcessStart("http://go.microsoft.com/fwlink/?LinkId=210531"); return false; } private void Add() { var dialog = new NewSiteDialog(Module, Items); if (dialog.ShowDialog() != DialogResult.OK) { return; } Items.Add(dialog.NewSite); dialog.NewSite.Applications[0].Save(); SelectedItem = dialog.NewSite; SelectedItem.Server.CommitChanges(); var service = (IConfigurationService)GetService(typeof(IConfigurationService)); ((MainForm)service.Form).AddSiteNode(dialog.NewSite); } private void Set() { } internal void Remove() { // Change : modify remove single site to remove multiple all selected sites if (SelectedItems == null) { return; } var dialog = (IManagementUIService)GetService(typeof(IManagementUIService)); var result = dialog.ShowMessage("Are you sure that you want to remove the selected site?", "Confirm Remove", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result != DialogResult.Yes) { return; } var index = Items.IndexOf(SelectedItem); foreach (var selectedItem in SelectedItems) { Items.Remove(selectedItem); } SelectedItem.Server.CommitChanges(); var service = (IConfigurationService)GetService(typeof(IConfigurationService)); ((MainForm)service.Form).RemoveSiteNode(SelectedItem); if (Items.Count == 0) { SelectedItem = null; } else { SelectedItem = index > Items.Count - 1 ? Items[Items.Count - 1] : Items[index]; } OnSitesSettingsSaved(); } private void Rename() { // TODO: use service to find node and trigger rename. } private void Limits() { } private void Tracing() { } private void Advanced() { } private void Browse(object uri) { // IMPORTANT: help users launch IIS Express instance. var site = SelectedItem; if (site.Server.Mode == WorkingMode.IisExpress && site.State != ObjectState.Started) { var message = (IManagementUIService)GetService(typeof(IManagementUIService)); var result = message.ShowMessage( "This website is not yet running. Do you want to start it now?", "Question", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (result != DialogResult.Yes) { return; } Start(); } DialogHelper.ProcessStart(uri.ToString()); } private void Stop() { if (SelectedItem == null) { return; } if (SelectedItem.Bindings.ElevationRequired && !PublicNativeMethods.IsProcessElevated) { var dialog = (IManagementUIService)GetService(typeof(IManagementUIService)); dialog.ShowMessage("This site cannot be stopped. Please run Jexus Manager as administrator.", Name); return; } IsBusy = true; OnSitesSettingsSaved(); SelectedItem.Stop(); IsBusy = false; OnSitesSettingsSaved(); } private void Start() { if (SelectedItem == null) { return; } var dialog = (IManagementUIService)GetService(typeof(IManagementUIService)); if (SelectedItem.Bindings.ElevationRequired && !PublicNativeMethods.IsProcessElevated) { dialog.ShowMessage("This site cannot be started. Please run Jexus Manager as administrator.", Name, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } IsBusy = true; OnSitesSettingsSaved(); try { SelectedItem.Start(); } catch (Exception ex) { dialog.ShowMessage(ex.Message, Name, MessageBoxButtons.OK, MessageBoxIcon.Error); } IsBusy = false; OnSitesSettingsSaved(); } private void Restart() { if (SelectedItem == null) { return; } var dialog = (IManagementUIService)GetService(typeof(IManagementUIService)); if (SelectedItem.Bindings.ElevationRequired && !PublicNativeMethods.IsProcessElevated) { dialog.ShowMessage("This site cannot be restarted. Please run Jexus Manager as administrator.", Name); return; } IsBusy = true; OnSitesSettingsSaved(); try { SelectedItem.Restart(); } catch (Exception ex) { dialog.ShowMessage(ex.Message, Name, MessageBoxButtons.OK, MessageBoxIcon.Error); } IsBusy = false; OnSitesSettingsSaved(); } private void VirtualDirectories() { } private void Applications() { } private void Basic() { if (SelectedItem == null) { return; } var dialog = new EditSiteDialog(Module, SelectedItem.Applications[0]); if (dialog.ShowDialog() != DialogResult.OK) { return; } SelectedItem.Applications[0].Save(); OnSitesSettingsSaved(); } private void Permissions() { var path = SelectedItem.PhysicalPath.ExpandIisExpressEnvironmentVariables(); if (!string.IsNullOrWhiteSpace(path)) { NativeMethods.ShowFileProperties(path); } } private void Explore() { var path = SelectedItem.PhysicalPath.ExpandIisExpressEnvironmentVariables(); if (!string.IsNullOrWhiteSpace(path)) { DialogHelper.Explore(path); } } private void Bindings() { if (SelectedItem == null) { return; } var dialog = new BindingsDialog(Module, SelectedItem); dialog.ShowDialog(); OnSitesSettingsSaved(); } public bool IsBusy { get; set; } public SitesSettingsSavedEventHandler SitesSettingsUpdated { get; set; } public string Description { get; } public virtual bool IsFeatureEnabled { get { return true; } } public virtual Version MinimumFrameworkVersion { get { return FxVersionNotRequired; } } public Module Module { get; } public string Name { get; } } public delegate void SitesSettingsSavedEventHandler(); }
68681395/JexusManager
JexusManager/Features/Main/SitesFeature.cs
C#
mit
17,508
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 17244, 5622, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 1013, 1013, 7000, 2104, 1996, 10210, 6105, 1012, 2156, 6105, 5371, 1999, 1996, 2622, 7117, 2005, 2440, 6105, 2592, 1012, 1013, 1008, 1008, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright (c) 2018 Inria * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer; * redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution; * neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Authors: Daniel Carvalho */ /** * @file * Declaration of a Most Recently Used replacement policy. * The victim is chosen using the timestamp. The entry that was accessed the * last is the one chosen to be replaced. */ #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_MRU_RP_HH__ #define __MEM_CACHE_REPLACEMENT_POLICIES_MRU_RP_HH__ #include "base/types.hh" #include "mem/cache/replacement_policies/base.hh" struct MRURPParams; class MRURP : public BaseReplacementPolicy { protected: /** MRU-specific implementation of replacement data. */ struct MRUReplData : ReplacementData { /** Tick on which the entry was last touched. */ Tick lastTouchTick; /** * Default constructor. Invalidate data. */ MRUReplData() : lastTouchTick(0) {} }; public: /** Convenience typedef. */ typedef MRURPParams Params; /** * Construct and initiliaze this replacement policy. */ MRURP(const Params *p); /** * Destructor. */ ~MRURP() {} /** * Invalidate replacement data to set it as the next probable victim. * Sets its last touch tick as the starting tick. * * @param replacement_data Replacement data to be invalidated. */ void invalidate(const std::shared_ptr<ReplacementData>& replacement_data) const override; /** * Touch an entry to update its replacement data. * Sets its last touch tick as the current tick. * * @param replacement_data Replacement data to be touched. */ void touch(const std::shared_ptr<ReplacementData>& replacement_data) const override; /** * Reset replacement data. Used when an entry is inserted. * Sets its last touch tick as the current tick. * * @param replacement_data Replacement data to be reset. */ void reset(const std::shared_ptr<ReplacementData>& replacement_data) const override; /** * Find replacement victim using access timestamps. * * @param cands Replacement candidates, selected by indexing policy. * @return Replacement entry to be replaced. */ ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const override; /** * Instantiate a replacement data entry. * * @return A shared pointer to the new replacement data. */ std::shared_ptr<ReplacementData> instantiateEntry() override; }; #endif // __MEM_CACHE_REPLACEMENT_POLICIES_MRU_RP_HH__
vineodd/PIMSim
GEM5Simulation/gem5/src/mem/cache/replacement_policies/mru_rp.hh
C++
gpl-3.0
4,281
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2760, 1999, 4360, 1008, 2035, 2916, 9235, 1012, 1008, 1008, 25707, 1998, 2224, 1999, 3120, 1998, 12441, 3596, 1010, 2007, 2030, 2302, 1008, 14080, 1010, 2024, 7936, 3024, 2008, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require "rails_helper" RSpec.describe UserMailer, type: :mailer do # describe "follow_up_email" do # let(:mail) { UserMailer.follow_up_email } # # it "renders the headers" do # expect(mail.subject).to eq("Follow up email") # expect(mail.to).to eq(["to@example.org"]) # expect(mail.from).to eq(["from@example.com"]) # end # # it "renders the body" do # expect(mail.body.encoded).to match("Hi") # end # end end
kirbrown/movies_sherlock_rails
spec/mailers/user_mailer_spec.rb
Ruby
mit
463
[ 30522, 5478, 1000, 15168, 1035, 2393, 2121, 1000, 12667, 5051, 2278, 1012, 6235, 5310, 21397, 2121, 1010, 2828, 1024, 1024, 5653, 2121, 2079, 1001, 6235, 1000, 3582, 1035, 2039, 1035, 10373, 1000, 2079, 1001, 2292, 1006, 1024, 5653, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import isEnabled from 'ember-metal/features'; import run from 'ember-metal/run_loop'; import { observer } from 'ember-metal/mixin'; import { set } from 'ember-metal/property_set'; import { bind } from 'ember-metal/binding'; import { beginPropertyChanges, endPropertyChanges } from 'ember-metal/property_events'; import { testBoth } from 'ember-metal/tests/props_helper'; import EmberObject from 'ember-runtime/system/object'; import { peekMeta } from 'ember-metal/meta'; QUnit.module('ember-runtime/system/object/destroy_test'); testBoth('should schedule objects to be destroyed at the end of the run loop', function(get, set) { var obj = EmberObject.create(); var meta; run(function() { obj.destroy(); meta = peekMeta(obj); ok(meta, 'meta is not destroyed immediately'); ok(get(obj, 'isDestroying'), 'object is marked as destroying immediately'); ok(!get(obj, 'isDestroyed'), 'object is not destroyed immediately'); }); meta = peekMeta(obj); ok(!meta, 'meta is destroyed after run loop finishes'); ok(get(obj, 'isDestroyed'), 'object is destroyed after run loop finishes'); }); if (isEnabled('mandatory-setter')) { // MANDATORY_SETTER moves value to meta.values // a destroyed object removes meta but leaves the accessor // that looks it up QUnit.test('should raise an exception when modifying watched properties on a destroyed object', function() { var obj = EmberObject.extend({ fooDidChange: observer('foo', function() { }) }).create({ foo: 'bar' }); run(function() { obj.destroy(); }); throws(function() { set(obj, 'foo', 'baz'); }, Error, 'raises an exception'); }); } QUnit.test('observers should not fire after an object has been destroyed', function() { var count = 0; var obj = EmberObject.extend({ fooDidChange: observer('foo', function() { count++; }) }).create(); obj.set('foo', 'bar'); equal(count, 1, 'observer was fired once'); run(function() { beginPropertyChanges(); obj.set('foo', 'quux'); obj.destroy(); endPropertyChanges(); }); equal(count, 1, 'observer was not called after object was destroyed'); }); QUnit.test('destroyed objects should not see each others changes during teardown but a long lived object should', function () { var shouldChange = 0; var shouldNotChange = 0; var objs = {}; var A = EmberObject.extend({ objs: objs, isAlive: true, willDestroy() { this.set('isAlive', false); }, bDidChange: observer('objs.b.isAlive', function () { shouldNotChange++; }), cDidChange: observer('objs.c.isAlive', function () { shouldNotChange++; }) }); var B = EmberObject.extend({ objs: objs, isAlive: true, willDestroy() { this.set('isAlive', false); }, aDidChange: observer('objs.a.isAlive', function () { shouldNotChange++; }), cDidChange: observer('objs.c.isAlive', function () { shouldNotChange++; }) }); var C = EmberObject.extend({ objs: objs, isAlive: true, willDestroy() { this.set('isAlive', false); }, aDidChange: observer('objs.a.isAlive', function () { shouldNotChange++; }), bDidChange: observer('objs.b.isAlive', function () { shouldNotChange++; }) }); var LongLivedObject = EmberObject.extend({ objs: objs, isAliveDidChange: observer('objs.a.isAlive', function () { shouldChange++; }) }); objs.a = new A(); objs.b = new B(); objs.c = new C(); new LongLivedObject(); run(function () { var keys = Object.keys(objs); for (var i = 0; i < keys.length; i++) { objs[keys[i]].destroy(); } }); equal(shouldNotChange, 0, 'destroyed graph objs should not see change in willDestroy'); equal(shouldChange, 1, 'long lived should see change in willDestroy'); }); QUnit.test('bindings should be synced when are updated in the willDestroy hook', function() { var bar = EmberObject.create({ value: false, willDestroy() { this.set('value', true); } }); var foo = EmberObject.create({ value: null, bar: bar }); run(function() { bind(foo, 'value', 'bar.value'); }); ok(bar.get('value') === false, 'the initial value has been bound'); run(function() { bar.destroy(); }); ok(foo.get('value'), 'foo is synced when the binding is updated in the willDestroy hook'); });
topaxi/ember.js
packages/ember-runtime/tests/system/object/destroy_test.js
JavaScript
mit
4,435
[ 30522, 12324, 2003, 8189, 23242, 2013, 1005, 7861, 5677, 1011, 3384, 1013, 2838, 1005, 1025, 12324, 2448, 2013, 1005, 7861, 5677, 1011, 3384, 1013, 2448, 1035, 7077, 1005, 1025, 12324, 1063, 9718, 1065, 2013, 1005, 7861, 5677, 1011, 3384, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; using System.Linq; using System.Drawing; using Duality.Resources; using Duality.Properties; using Duality.Plugins.Tilemaps; using Duality.Editor.Plugins.Tilemaps.Properties; namespace Duality.Editor.Plugins.Tilemaps.EditorActions { public class OpenTileset : EditorSingleAction<Tileset> { public override string Name { get { return TilemapsRes.ActionName_OpenTileset; } } public override string Description { get { return TilemapsRes.ActionDesc_OpenTileset; } } public override void Perform(Tileset obj) { DualityEditorApp.Select(this, new ObjectSelection(obj)); TilemapsEditorPlugin.Instance.RequestTilesetEditor(); } public override bool CanPerformOn(Tileset obj) { return obj != null && base.CanPerformOn(obj); } public override bool MatchesContext(string context) { return context == DualityEditorApp.ActionContextOpenRes; } } }
RockyTV/duality
Source/Plugins/Tilemaps/Editor/EditorActions/OpenTileset.cs
C#
mit
938
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 5059, 1025, 2478, 7037, 3012, 1012, 4219, 1025, 2478, 7037, 3012, 1012, 5144, 1025, 2478, 7037, 3012, 1012, 13354, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright(C) 1999-2020 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * * See packages/seacas/LICENSE for details */ /***************************************************************************** * * expmp - ex_put_attr_param * * entry conditions - * input parameters: * int exoid exodus file id * int obj_type block/set type (node, edge, face, elem) * int obj_id block/set id (ignored for NODAL) * int num_attrs number of attributes * * exit conditions - * * *****************************************************************************/ #include "exodusII.h" // for ex_err, etc #include "exodusII_int.h" // for EX_FATAL, EX_WARN, etc /*! * defines the number of attributes. * \param exoid exodus file id * \param obj_type block/set type (node, edge, face, elem) * \param obj_id block/set id (ignored for NODAL) * \param num_attrs number of attributes */ int ex_put_attr_param(int exoid, ex_entity_type obj_type, ex_entity_id obj_id, int num_attrs) { int status; int dims[2]; int strdim, varid; char errmsg[MAX_ERR_LENGTH]; const char *dnumobjent; const char *dnumobjatt; const char *vobjatt; const char *vattnam; int numobjentdim; int obj_id_ndx; int numattrdim; #if NC_HAS_HDF5 int fill = NC_FILL_CHAR; #endif EX_FUNC_ENTER(); if (ex__check_valid_file_id(exoid, __func__) == EX_FATAL) { EX_FUNC_LEAVE(EX_FATAL); } /* Determine index of obj_id in obj_type id array */ if (obj_type == EX_NODAL) { obj_id_ndx = 0; } else { obj_id_ndx = ex__id_lkup(exoid, obj_type, obj_id); if (obj_id_ndx <= 0) { ex_get_err(NULL, NULL, &status); if (status != 0) { if (status == EX_NULLENTITY) { snprintf(errmsg, MAX_ERR_LENGTH, "Warning: no attributes found for NULL %s %" PRId64 " in file id %d", ex_name_of_object(obj_type), obj_id, exoid); ex_err_fn(exoid, __func__, errmsg, EX_NULLENTITY); EX_FUNC_LEAVE(EX_WARN); /* no attributes for this object */ } snprintf(errmsg, MAX_ERR_LENGTH, "Warning: failed to locate %s id %" PRId64 " in id array in file id %d", ex_name_of_object(obj_type), obj_id, exoid); ex_err_fn(exoid, __func__, errmsg, status); EX_FUNC_LEAVE(EX_WARN); } } } switch (obj_type) { case EX_SIDE_SET: dnumobjent = DIM_NUM_SIDE_SS(obj_id_ndx); dnumobjatt = DIM_NUM_ATT_IN_SS(obj_id_ndx); vobjatt = VAR_SSATTRIB(obj_id_ndx); vattnam = VAR_NAME_SSATTRIB(obj_id_ndx); break; case EX_NODE_SET: dnumobjent = DIM_NUM_NOD_NS(obj_id_ndx); dnumobjatt = DIM_NUM_ATT_IN_NS(obj_id_ndx); vobjatt = VAR_NSATTRIB(obj_id_ndx); vattnam = VAR_NAME_NSATTRIB(obj_id_ndx); break; case EX_EDGE_SET: dnumobjent = DIM_NUM_EDGE_ES(obj_id_ndx); dnumobjatt = DIM_NUM_ATT_IN_ES(obj_id_ndx); vobjatt = VAR_ESATTRIB(obj_id_ndx); vattnam = VAR_NAME_ESATTRIB(obj_id_ndx); break; case EX_FACE_SET: dnumobjent = DIM_NUM_FACE_FS(obj_id_ndx); dnumobjatt = DIM_NUM_ATT_IN_FS(obj_id_ndx); vobjatt = VAR_FSATTRIB(obj_id_ndx); vattnam = VAR_NAME_FSATTRIB(obj_id_ndx); break; case EX_ELEM_SET: dnumobjent = DIM_NUM_ELE_ELS(obj_id_ndx); dnumobjatt = DIM_NUM_ATT_IN_ELS(obj_id_ndx); vobjatt = VAR_ELSATTRIB(obj_id_ndx); vattnam = VAR_NAME_ELSATTRIB(obj_id_ndx); break; case EX_NODAL: dnumobjent = DIM_NUM_NODES; dnumobjatt = DIM_NUM_ATT_IN_NBLK; vobjatt = VAR_NATTRIB; vattnam = VAR_NAME_NATTRIB; break; case EX_EDGE_BLOCK: dnumobjent = DIM_NUM_ED_IN_EBLK(obj_id_ndx); dnumobjatt = DIM_NUM_ATT_IN_EBLK(obj_id_ndx); vobjatt = VAR_EATTRIB(obj_id_ndx); vattnam = VAR_NAME_EATTRIB(obj_id_ndx); break; case EX_FACE_BLOCK: dnumobjent = DIM_NUM_FA_IN_FBLK(obj_id_ndx); dnumobjatt = DIM_NUM_ATT_IN_FBLK(obj_id_ndx); vobjatt = VAR_FATTRIB(obj_id_ndx); vattnam = VAR_NAME_FATTRIB(obj_id_ndx); break; case EX_ELEM_BLOCK: dnumobjent = DIM_NUM_EL_IN_BLK(obj_id_ndx); dnumobjatt = DIM_NUM_ATT_IN_BLK(obj_id_ndx); vobjatt = VAR_ATTRIB(obj_id_ndx); vattnam = VAR_NAME_ATTRIB(obj_id_ndx); break; default: snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: Bad block type (%d) specified for file id %d", obj_type, exoid); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); EX_FUNC_LEAVE(EX_FATAL); } if ((status = nc_inq_dimid(exoid, dnumobjent, &numobjentdim)) != NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to locate number of entries for %s %" PRId64 " in file id %d", ex_name_of_object(obj_type), obj_id, exoid); ex_err_fn(exoid, __func__, errmsg, status); EX_FUNC_LEAVE(EX_FATAL); } /* put netcdf file into define mode */ if ((status = nc_redef(exoid)) != NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to place file id %d into define mode", exoid); ex_err_fn(exoid, __func__, errmsg, status); EX_FUNC_LEAVE(EX_FATAL); } if ((status = nc_def_dim(exoid, dnumobjatt, num_attrs, &numattrdim)) != NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to define number of attributes in %s %" PRId64 " in file id %d", ex_name_of_object(obj_type), obj_id, exoid); ex_err_fn(exoid, __func__, errmsg, status); goto error_ret; /* exit define mode and return */ } dims[0] = numobjentdim; dims[1] = numattrdim; if ((status = nc_def_var(exoid, vobjatt, nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to define attributes for %s %" PRId64 " in file id %d", ex_name_of_object(obj_type), obj_id, exoid); ex_err_fn(exoid, __func__, errmsg, status); goto error_ret; /* exit define mode and return */ } ex__compress_variable(exoid, varid, 2); /* inquire previously defined dimensions */ if ((status = nc_inq_dimid(exoid, DIM_STR_NAME, &strdim)) != NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get string length in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); EX_FUNC_LEAVE(EX_FATAL); } /* Attribute names... */ dims[0] = numattrdim; dims[1] = strdim; if ((status = nc_def_var(exoid, vattnam, NC_CHAR, 2, dims, &varid)) != NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to define %s attribute name array in file id %d", ex_name_of_object(obj_type), exoid); ex_err_fn(exoid, __func__, errmsg, status); goto error_ret; /* exit define mode and return */ } #if NC_HAS_HDF5 nc_def_var_fill(exoid, varid, 0, &fill); #endif /* leave define mode */ if ((status = ex__leavedef(exoid, __func__)) != NC_NOERR) { EX_FUNC_LEAVE(EX_FATAL); } EX_FUNC_LEAVE(EX_NOERR); /* Fatal error: exit definition mode and return */ error_ret: ex__leavedef(exoid, __func__); EX_FUNC_LEAVE(EX_FATAL); }
BalticPinguin/libmesh
contrib/exodusii/v8.11/exodus/src/ex_put_attr_param.c
C
lgpl-2.1
7,307
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2639, 1011, 12609, 2120, 2974, 1004, 3330, 7300, 1008, 1997, 5472, 2401, 1010, 11775, 1006, 23961, 7971, 1007, 1012, 2104, 1996, 3408, 1997, 3206, 2139, 1011, 6583, 8889, 2692, 19481, 17788, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Kipskool
douggy12/Kipskool
README.md
Markdown
mit
9
[ 30522, 11382, 4523, 3683, 4747, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html lang="en"> <head> <title>Working Directory - Debugging with GDB</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Debugging with GDB"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Running.html#Running" title="Running"> <link rel="prev" href="Environment.html#Environment" title="Environment"> <link rel="next" href="Input_002fOutput.html#Input_002fOutput" title="Input/Output"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being ``Free Software'' and ``Free Software Needs Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' and with the Back-Cover Texts as in (a) below. (a) The FSF's Back-Cover Text is: ``You are free to copy and modify this GNU Manual. Buying copies from GNU Press supports the FSF in developing GNU and promoting software freedom.''--> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> <link rel="stylesheet" type="text/css" href="../cs.css"> </head> <body> <div class="node"> <a name="Working-Directory"></a> <p> Next:&nbsp;<a rel="next" accesskey="n" href="Input_002fOutput.html#Input_002fOutput">Input/Output</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="Environment.html#Environment">Environment</a>, Up:&nbsp;<a rel="up" accesskey="u" href="Running.html#Running">Running</a> <hr> </div> <h3 class="section">4.5 Your Program's Working Directory</h3> <p><a name="index-working-directory-_0028of-your-program_0029-119"></a>Each time you start your program with <code>run</code>, it inherits its working directory from the current working directory of <span class="sc">gdb</span>. The <span class="sc">gdb</span> working directory is initially whatever it inherited from its parent process (typically the shell), but you can specify a new working directory in <span class="sc">gdb</span> with the <code>cd</code> command. <p>The <span class="sc">gdb</span> working directory also serves as a default for the commands that specify files for <span class="sc">gdb</span> to operate on. See <a href="Files.html#Files">Commands to Specify Files</a>. <a name="index-cd-120"></a> <a name="index-change-working-directory-121"></a> <dl><dt><code>cd </code><var>directory</var><dd>Set the <span class="sc">gdb</span> working directory to <var>directory</var>. <p><a name="index-pwd-122"></a><br><dt><code>pwd</code><dd>Print the <span class="sc">gdb</span> working directory. </dl> <p>It is generally impossible to find the current working directory of the process being debugged (since a program can change its directory during its run). If you work on a system where <span class="sc">gdb</span> is configured with the <samp><span class="file">/proc</span></samp> support, you can use the <code>info proc</code> command (see <a href="SVR4-Process-Information.html#SVR4-Process-Information">SVR4 Process Information</a>) to find out the current working directory of the debuggee. </body></html>
byeonggonlee/lynx-ns-gb
toolchain/share/doc/arm-arm-none-eabi/html/gdb/Working-Directory.html
HTML
gpl-2.0
3,960
[ 30522, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 2516, 1028, 2551, 14176, 1011, 2139, 8569, 12588, 2007, 1043, 18939, 1026, 1013, 2516, 1028, 1026, 18804, 8299, 1011, 1041, 15549, 2615, 1027, 1000, 4180, 1011...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) 2020 The Open-Transactions developers // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef OPENTXS_PROTO_LISTENADDRESS_HPP #define OPENTXS_PROTO_LISTENADDRESS_HPP #include "VerifyContracts.hpp" namespace opentxs { namespace proto { OPENTXS_PROTO_EXPORT bool CheckProto_1( const ListenAddress& address, const bool silent); OPENTXS_PROTO_EXPORT bool CheckProto_2(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_3(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_4(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_5(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_6(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_7(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_8(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_9(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_10(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_11(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_12(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_13(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_14(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_15(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_16(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_17(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_18(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_19(const ListenAddress&, const bool); OPENTXS_PROTO_EXPORT bool CheckProto_20(const ListenAddress&, const bool); } // namespace proto } // namespace opentxs #endif // OPENTXS_PROTO_LISTENADDRESS_HPP
Open-Transactions/opentxs-proto
include/opentxs-proto/verify/ListenAddress.hpp
C++
mpl-2.0
2,014
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 12609, 1996, 2330, 1011, 11817, 9797, 1013, 1013, 2023, 3120, 3642, 2433, 2003, 3395, 2000, 1996, 3408, 1997, 1996, 9587, 5831, 4571, 2270, 1013, 1013, 6105, 1010, 1058, 1012, 1016, 1012, 1014, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>higman-cf: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1 / higman-cf - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> higman-cf <small> 8.10.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-11-16 15:55:17 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-16 15:55:17 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.7.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.08.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.08.1 Official release 4.08.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/higman-cf&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/HigmanCF&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: Higman&#39;s lemma&quot; &quot;keyword: extraction&quot; &quot;category: Mathematics/Combinatorics and Graph Theory&quot; &quot;category: Miscellaneous/Extracted Programs/Combinatorics&quot; ] authors: [ &quot;Stefan Berghofer&quot; ] bug-reports: &quot;https://github.com/coq-contribs/higman-cf/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/higman-cf.git&quot; synopsis: &quot;A direct constructive proof of Higman&#39;s Lemma&quot; description: &quot;&quot;&quot; This development formalizes in Coq the Coquand-Friedlender proof of Higman&#39;s lemma for a two-letter alphabet. An efficient program can be extracted from the proof.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/higman-cf/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=27d30246ec18035e8a687c43531a5c23&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-higman-cf.8.10.0 coq.8.7.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1). The following dependencies couldn&#39;t be met: - coq-higman-cf -&gt; coq &gt;= 8.10 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-higman-cf.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.08.1-2.0.5/released/8.7.1/higman-cf/8.10.0.html
HTML
mit
7,021
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 418...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var searchData= [ ['backtrace',['backtrace',['../class_logger.html#a5deb9b10c43285287a9113f280ee8fab',1,'Logger']]], ['baseexception',['BaseException',['../class_base_exception.html',1,'']]], ['baseexception_2ephp',['BaseException.php',['../_base_exception_8php.html',1,'']]], ['basic_2ephp',['Basic.php',['../_menu_2_basic_8php.html',1,'']]], ['basic_2ephp',['Basic.php',['../_paginator_2_basic_8php.html',1,'']]], ['basic_2ephp',['Basic.php',['../_auth_2_basic_8php.html',1,'']]], ['basic_2ephp',['Basic.php',['../_t_mail_2_basic_8php.html',1,'']]], ['basic_2ephp',['Basic.php',['../_form_2_basic_8php.html',1,'']]], ['basic_2ephp',['Basic.php',['../_grid_2_basic_8php.html',1,'']]], ['basicauth',['BasicAuth',['../class_basic_auth.html',1,'']]], ['basicauth_2ephp',['BasicAuth.php',['../_basic_auth_8php.html',1,'']]], ['beforedelete',['beforeDelete',['../class_s_q_l___relation.html#a44c9d7a3b22619b53d4f49f1070d5235',1,'SQL_Relation']]], ['beforefield',['beforeField',['../class_form___field.html#aa4bbfb40048e1c3fe939621179652be1',1,'Form_Field']]], ['beforeinsert',['beforeInsert',['../class_s_q_l___relation.html#ada6a7f2abf3ba1c19e4ba3711da1a61e',1,'SQL_Relation']]], ['beforeload',['beforeLoad',['../class_s_q_l___relation.html#a665492752f54f9cbc3fd2cae51ca4373',1,'SQL_Relation']]], ['beforemodify',['beforeModify',['../class_s_q_l___relation.html#a3ad587772d12f99af11a3db64d879210',1,'SQL_Relation']]], ['beforesave',['beforeSave',['../class_s_q_l___relation.html#ab9e4fb36c177d9633b81fc184f7bd933',1,'SQL_Relation']]], ['begintransaction',['beginTransaction',['../class_d_b.html#af3380f3b13931d581fa973a382946b32',1,'DB\beginTransaction()'],['../class_d_blite__mysql.html#a06fdc3063ff49b8de811683aae3483e6',1,'DBlite_mysql\beginTransaction()']]], ['belowfield',['belowField',['../class_form___field.html#a27cd7c6e75ed8c09aae8af32905a888d',1,'Form_Field']]], ['box_2ephp',['Box.php',['../_box_8php.html',1,'']]], ['breakhook',['breakHook',['../class_abstract_object.html#a446b3f8327b3272c838ae46f40a9da06',1,'AbstractObject']]], ['bt',['bt',['../class_d_b__dsql.html#aa374d1bfaabf3f546fe8862d09f4a096',1,'DB_dsql']]], ['button',['Button',['../class_button.html',1,'']]], ['button_2ephp',['Button.php',['../_button_8php.html',1,'']]], ['button_2ephp',['Button.php',['../_form_2_button_8php.html',1,'']]], ['button_2ephp',['Button.php',['../_view_2_button_8php.html',1,'']]], ['buttonset',['ButtonSet',['../class_button_set.html',1,'']]], ['buttonset_2ephp',['ButtonSet.php',['../_button_set_8php.html',1,'']]], ['buttonset_2ephp',['ButtonSet.php',['../_view_2_button_set_8php.html',1,'']]] ];
atk4/atk4-web
dox/html/search/all_62.js
JavaScript
agpl-3.0
2,662
[ 30522, 13075, 3945, 2850, 2696, 1027, 1031, 1031, 1005, 2067, 6494, 3401, 1005, 1010, 1031, 1005, 2067, 6494, 3401, 1005, 1010, 1031, 1005, 1012, 1012, 1013, 2465, 1035, 8833, 4590, 1012, 16129, 1001, 1037, 2629, 3207, 2497, 2683, 2497, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env python import urllib.request import re import argparse parser = argparse.ArgumentParser() parser.add_argument("url", help="the URL whose HTML you want to extract telephone numbers from", type=str) args = parser.parse_args() with urllib.request.urlopen(args.url) as response: html = response.read().decode('utf-8') # Naive, simple regex; can be further refined (overinclusive in some respects (e.g., any 10-digit numerical string), no detection when non-parentheses phone number first in a parenthetical clause, no real international support, no extension support, no letters-as-numbers support) regex = re.compile(r'0?0?1?-?\(?[0-9]{3}\)?\s?-?[0-9]{3}-?[0-9]{4}') print(regex.findall(html))
ArthurZey/toyproblems
phone_number_extractor.py
Python
mit
711
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 12324, 24471, 6894, 2497, 1012, 5227, 12324, 2128, 12324, 12098, 21600, 11650, 2063, 11968, 8043, 1027, 12098, 21600, 11650, 2063, 1012, 6685, 19362, 8043, 1006, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# HiomoBot [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) HiomoBot is a Telegram bot that will send you messages containing the lunch menu of the day from the Hiomotie 32 Sodexo restaurant. You can use commands to ask for the menu whenever you like, but you can also subscribe for daily messages and HiomoBot will send you a message everyday at 10:30 AM listing the available food for lunch. Here are the commands that trigger a response from HiomoBot: **/food** - Tells you the complete menu of the day. **/fooden** - Tells you the menu of the day in English only. **/foodfi** - Tells you the menu of the day in Finnish only. **/foodtomorrow** - I'll tell you the complete menu of tomorrow. **/open** - Tells you the opening hours of the restaurant. **/subscribe** - Sends you a message everyday with the complete menu of the day at 10:30 AM. **/unsubscribe** - Stops sending daily messages. HiomoBot will also answer inline queries so you don't need to add him to your groups. Here are the inline queries that will trigger a response from him: **@hiomo_bot food** - Tells you the complete menu of the day. **@hiomo_bot fooden** - Tells you the menu of the day in English only. **@hiomo_bot foodfi** - Tells you the menu of the day in Finnish only. **@hiomo_bot foodtomorrow** - Tells you the complete menu of tomorrow. **@hiomo_bot open** - Tells you the opening hours of the restaurant.
robertomlsoares/hiomo-tg-bot
README.md
Markdown
mit
1,465
[ 30522, 1001, 7632, 19506, 18384, 1031, 999, 1031, 6105, 1024, 10210, 1033, 1006, 16770, 1024, 1013, 1013, 10047, 2290, 1012, 11824, 1012, 22834, 1013, 10780, 1013, 6105, 1011, 10210, 1011, 2630, 1012, 17917, 2290, 1007, 1033, 1006, 16770, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{% load prefixed_i18n %} {% set_i18n_prefix 'mtr.sync' %} {% if admin.show_quick_settings_menu and False %} <select name="quick_settings"> {% for st in mtr.sync.settings %} <option value="{{ st.id }}">{{ st }}</option> {% endfor %} </select> {% endif %} <li> <a class="grp-state-focus" href="{% url 'admin:mtr_sync_settings_add' %}?action=export&amp;model={{ opts.app_label }}.{{ opts.model_name }}{% if request.GET.keys %}&amp;filter={{ request.GET.urlencode|urlencode }}%26fields={{ cl.list_display|join:','|urlencode }}{% endif %}">{% trans 'Export' %}</a> </li> <li> <a class="grp-state-focus" href="{% url 'admin:mtr_sync_settings_add' %}?action=import&amp;model={{ opts.app_label }}.{{ opts.model_name }}{% if request.GET.keys %}&amp;filter={{ request.GET.urlencode|urlencode }}%26fields={{ cl.list_display|join:','|urlencode }}{% endif %}">{% trans 'Import' %}</a> </li>
mtrgroup/django-mtr-sync
mtr/sync/templates/themes/grappelli/base/mtr/sync/admin/object_tools.html
HTML
mit
889
[ 30522, 1063, 1003, 7170, 17576, 2098, 1035, 1045, 15136, 2078, 1003, 1065, 1063, 1003, 2275, 1035, 1045, 15136, 2078, 1035, 17576, 1005, 11047, 2099, 1012, 26351, 1005, 1003, 1065, 1063, 1003, 2065, 4748, 10020, 1012, 2265, 1035, 4248, 1035...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Blog Powered by Jekyll | Theme H2O
kehr/kehr.github.io
README.md
Markdown
mit
36
[ 30522, 9927, 6113, 2011, 15333, 4801, 3363, 1064, 4323, 1044, 2475, 2080, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.spark.sql.execution.datasources.json import org.apache.spark.rdd.RDD import org.apache.spark.sql.SparkSession private[json] trait TestJsonData { protected def spark: SparkSession def primitiveFieldAndType: RDD[String] = spark.sparkContext.parallelize( """{"string":"this is a simple string.", "integer":10, "long":21474836470, "bigInteger":92233720368547758070, "double":1.7976931348623157E308, "boolean":true, "null":null }""" :: Nil) def primitiveFieldValueTypeConflict: RDD[String] = spark.sparkContext.parallelize( """{"num_num_1":11, "num_num_2":null, "num_num_3": 1.1, "num_bool":true, "num_str":13.1, "str_bool":"str1"}""" :: """{"num_num_1":null, "num_num_2":21474836470.9, "num_num_3": null, "num_bool":12, "num_str":null, "str_bool":true}""" :: """{"num_num_1":21474836470, "num_num_2":92233720368547758070, "num_num_3": 100, "num_bool":false, "num_str":"str1", "str_bool":false}""" :: """{"num_num_1":21474836570, "num_num_2":1.1, "num_num_3": 21474836470, "num_bool":null, "num_str":92233720368547758070, "str_bool":null}""" :: Nil) def jsonNullStruct: RDD[String] = spark.sparkContext.parallelize( """{"nullstr":"","ip":"27.31.100.29","headers":{"Host":"1.abc.com","Charset":"UTF-8"}}""" :: """{"nullstr":"","ip":"27.31.100.29","headers":{}}""" :: """{"nullstr":"","ip":"27.31.100.29","headers":""}""" :: """{"nullstr":null,"ip":"27.31.100.29","headers":null}""" :: Nil) def complexFieldValueTypeConflict: RDD[String] = spark.sparkContext.parallelize( """{"num_struct":11, "str_array":[1, 2, 3], "array":[], "struct_array":[], "struct": {}}""" :: """{"num_struct":{"field":false}, "str_array":null, "array":null, "struct_array":{}, "struct": null}""" :: """{"num_struct":null, "str_array":"str", "array":[4, 5, 6], "struct_array":[7, 8, 9], "struct": {"field":null}}""" :: """{"num_struct":{}, "str_array":["str1", "str2", 33], "array":[7], "struct_array":{"field": true}, "struct": {"field": "str"}}""" :: Nil) def arrayElementTypeConflict: RDD[String] = spark.sparkContext.parallelize( """{"array1": [1, 1.1, true, null, [], {}, [2,3,4], {"field":"str"}], "array2": [{"field":214748364700}, {"field":1}]}""" :: """{"array3": [{"field":"str"}, {"field":1}]}""" :: """{"array3": [1, 2, 3]}""" :: Nil) def missingFields: RDD[String] = spark.sparkContext.parallelize( """{"a":true}""" :: """{"b":21474836470}""" :: """{"c":[33, 44]}""" :: """{"d":{"field":true}}""" :: """{"e":"str"}""" :: Nil) def complexFieldAndType1: RDD[String] = spark.sparkContext.parallelize( """{"struct":{"field1": true, "field2": 92233720368547758070}, "structWithArrayFields":{"field1":[4, 5, 6], "field2":["str1", "str2"]}, "arrayOfString":["str1", "str2"], "arrayOfInteger":[1, 2147483647, -2147483648], "arrayOfLong":[21474836470, 9223372036854775807, -9223372036854775808], "arrayOfBigInteger":[922337203685477580700, -922337203685477580800], "arrayOfDouble":[1.2, 1.7976931348623157E308, 4.9E-324, 2.2250738585072014E-308], "arrayOfBoolean":[true, false, true], "arrayOfNull":[null, null, null, null], "arrayOfStruct":[{"field1": true, "field2": "str1"}, {"field1": false}, {"field3": null}], "arrayOfArray1":[[1, 2, 3], ["str1", "str2"]], "arrayOfArray2":[[1, 2, 3], [1.1, 2.1, 3.1]] }""" :: Nil) def complexFieldAndType2: RDD[String] = spark.sparkContext.parallelize( """{"arrayOfStruct":[{"field1": true, "field2": "str1"}, {"field1": false}, {"field3": null}], "complexArrayOfStruct": [ { "field1": [ { "inner1": "str1" }, { "inner2": ["str2", "str22"] }], "field2": [[1, 2], [3, 4]] }, { "field1": [ { "inner2": ["str3", "str33"] }, { "inner1": "str4" }], "field2": [[5, 6], [7, 8]] }], "arrayOfArray1": [ [ [5] ], [ [6, 7], [8] ]], "arrayOfArray2": [ [ [ { "inner1": "str1" } ] ], [ [], [ {"inner2": ["str3", "str33"]}, {"inner2": ["str4"], "inner1": "str11"} ] ], [ [ {"inner3": [[{"inner4": 2}]]} ] ]] }""" :: Nil) def mapType1: RDD[String] = spark.sparkContext.parallelize( """{"map": {"a": 1}}""" :: """{"map": {"b": 2}}""" :: """{"map": {"c": 3}}""" :: """{"map": {"c": 1, "d": 4}}""" :: """{"map": {"e": null}}""" :: Nil) def mapType2: RDD[String] = spark.sparkContext.parallelize( """{"map": {"a": {"field1": [1, 2, 3, null]}}}""" :: """{"map": {"b": {"field2": 2}}}""" :: """{"map": {"c": {"field1": [], "field2": 4}}}""" :: """{"map": {"c": {"field2": 3}, "d": {"field1": [null]}}}""" :: """{"map": {"e": null}}""" :: """{"map": {"f": {"field1": null}}}""" :: Nil) def nullsInArrays: RDD[String] = spark.sparkContext.parallelize( """{"field1":[[null], [[["Test"]]]]}""" :: """{"field2":[null, [{"Test":1}]]}""" :: """{"field3":[[null], [{"Test":"2"}]]}""" :: """{"field4":[[null, [1,2,3]]]}""" :: Nil) def jsonArray: RDD[String] = spark.sparkContext.parallelize( """[{"a":"str_a_1"}]""" :: """[{"a":"str_a_2"}, {"b":"str_b_3"}]""" :: """{"b":"str_b_4", "a":"str_a_4", "c":"str_c_4"}""" :: """[]""" :: Nil) def corruptRecords: RDD[String] = spark.sparkContext.parallelize( """{""" :: """""" :: """{"a":1, b:2}""" :: """{"a":{, b:3}""" :: """{"b":"str_b_4", "a":"str_a_4", "c":"str_c_4"}""" :: """]""" :: Nil) def additionalCorruptRecords: RDD[String] = spark.sparkContext.parallelize( """{"dummy":"test"}""" :: """[1,2,3]""" :: """":"test", "a":1}""" :: """42""" :: """ ","ian":"test"}""" :: Nil) def emptyRecords: RDD[String] = spark.sparkContext.parallelize( """{""" :: """""" :: """{"a": {}}""" :: """{"a": {"b": {}}}""" :: """{"b": [{"c": {}}]}""" :: """]""" :: Nil) def timestampAsLong: RDD[String] = spark.sparkContext.parallelize( """{"ts":1451732645}""" :: Nil) def arrayAndStructRecords: RDD[String] = spark.sparkContext.parallelize( """{"a": {"b": 1}}""" :: """{"a": []}""" :: Nil) def floatingValueRecords: RDD[String] = spark.sparkContext.parallelize( s"""{"a": 0.${"0" * 38}1, "b": 0.01}""" :: Nil) def bigIntegerRecords: RDD[String] = spark.sparkContext.parallelize( s"""{"a": 1${"0" * 38}, "b": 92233720368547758070}""" :: Nil) def datesRecords: RDD[String] = spark.sparkContext.parallelize( """{"date": "26/08/2015 18:00"}""" :: """{"date": "27/10/2014 18:30"}""" :: """{"date": "28/01/2016 20:00"}""" :: Nil) lazy val singleRow: RDD[String] = spark.sparkContext.parallelize("""{"a":123}""" :: Nil) def empty: RDD[String] = spark.sparkContext.parallelize(Seq[String]()) }
gioenn/xSpark
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/TestJsonData.scala
Scala
apache-2.0
8,452
[ 30522, 1013, 1008, 1008, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 2030, 2062, 1008, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 5500, 2007, 1008, 2023, 2147, 2005, 3176, 2592, 4953, 9385, 6095, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package cfvbaibai.cardfantasy.engine.feature; import java.util.List; import cfvbaibai.cardfantasy.CardFantasyRuntimeException; import cfvbaibai.cardfantasy.data.Feature; import cfvbaibai.cardfantasy.engine.CardInfo; import cfvbaibai.cardfantasy.engine.EntityInfo; import cfvbaibai.cardfantasy.engine.FeatureInfo; import cfvbaibai.cardfantasy.engine.FeatureResolver; import cfvbaibai.cardfantasy.engine.HeroDieSignal; import cfvbaibai.cardfantasy.engine.Player; public final class WeakenAllFeature { public static void apply(FeatureResolver resolver, FeatureInfo featureInfo, EntityInfo attacker, Player defenderPlayer) throws HeroDieSignal { if (defenderPlayer == null) { throw new CardFantasyRuntimeException("defenderPlayer is null"); } if (attacker == null) { return; } Feature feature = featureInfo.getFeature(); List<CardInfo> defenders = defenderPlayer.getField().getAliveCards(); resolver.getStage().getUI().useSkill(attacker, defenders, feature, true); WeakenFeature.weakenCard(resolver, featureInfo, featureInfo.getFeature().getImpact(), attacker, defenders); } }
catree1988/CardFantasy-master
workspace/CardFantasyCore/src/cfvbaibai/cardfantasy/engine/feature/WeakenAllFeature.java
Java
bsd-2-clause
1,173
[ 30522, 7427, 12935, 26493, 4886, 26068, 1012, 4003, 15143, 10230, 2100, 1012, 3194, 1012, 3444, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 2862, 1025, 12324, 12935, 26493, 4886, 26068, 1012, 4003, 15143, 10230, 2100, 1012, 4003, 15143, 10230...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Blocks &amp; Guidelines</title> <link rel="stylesheet" type="text/css" href="./css/ui.css"> <script src='https://code.jquery.com/jquery-2.1.3.min.js' type='application/javascript'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.8/ace.js' type='application/javascript'></script> <script src='./js/blocks.and.guidelines.js' type='application/javascript'></script> <script src='./js/rapheal-min.js' type='application/javascript'></script> <script src='./js/util.js' type='application/javascript'></script> <script src='./js/ui.js' type='application/javascript'></script> </head> <body id='body'> <!-- <div id='canvas'></div> --> <div id='rendering-context'></div> <div id='documents'> <div class='addlevel'>+</div> <h3>Diagrams</h3> <span class='button' id='Import'><input type="file" id="input"></span><p></p> <span class='button' id='Export'><a href='' target="_blank">Export</a></span> <span class='button' id='Delete'>Delete</span> <div id='scroller'> <ul id="saves"></ul> </div> </div> </body> </html>
OSU-Infovis/BlocksAndGuides
ui.html
HTML
mit
1,378
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 8299, 1011, 1041, 15549, 2615, 1027, 1000, 1060, 1011, 25423, 1011, 11892, 1000, 4180, 1027, 1000, 29464, 1027, 3341, 1000, 1028, 1026, 18804, 258...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2010-2011 Raisonne Techonologies. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * */ package com.raisonne.quartz.scheduler.job.service.impl; /** * <p>A helper class which is responsible for fetching list of all jobs * under a certain group as well individual jobs matching search criteria.</p> * <p> * Triggers associated with the * </p> * @author Umesh Awasthi * * */ public class JobUtil { }
umeshawasthi/blooddonor
src/main/java/com/raisonne/quartz/scheduler/job/service/impl/JobUtil.java
Java
apache-2.0
935
[ 30522, 1013, 1008, 1008, 9385, 2230, 1011, 2249, 15547, 3385, 2638, 6627, 17175, 21615, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 1008, 2224, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef _ASM_X86_PVCLOCK_ABI_H #define _ASM_X86_PVCLOCK_ABI_H #ifndef __ASSEMBLY__ /* * These structs MUST NOT be changed. * They are the ABI between hypervisor and guest OS. * Both Xen and KVM are using this. * * pvclock_vcpu_time_info holds the system time and the tsc timestamp * of the last update. So the guest can use the tsc delta to get a * more precise system time. There is one per virtual cpu. * * pvclock_wall_clock references the point in time when the system * time was zero (usually boot time), thus the guest calculates the * current wall clock by adding the system time. * * Protocol for the "version" fields is: hypervisor raises it (making * it uneven) before it starts updating the fields and raises it again * (making it even) when it is done. Thus the guest can make sure the * time values it got are consistent by checking the version before * and after reading them. */ struct pvclock_vcpu_time_info { u32 version; u32 pad0; u64 tsc_timestamp; u64 system_time; u32 tsc_to_system_mul; s8 tsc_shift; u8 pad[3]; } __attribute__((__packed__)); /* 32 bytes */ struct pvclock_wall_clock { u32 version; u32 sec; u32 nsec; } __attribute__((__packed__)); #endif /* __ASSEMBLY__ */ #endif /* _ASM_X86_PVCLOCK_ABI_H */
MicroTrustRepos/microkernel
src/l4/pkg/dde/linux26/contrib/arch/x86/include/asm/pvclock-abi.h
C
gpl-2.0
1,288
[ 30522, 1001, 2065, 13629, 2546, 1035, 2004, 2213, 1035, 1060, 20842, 1035, 26189, 20464, 7432, 1035, 11113, 2072, 1035, 1044, 1001, 9375, 1035, 2004, 2213, 1035, 1060, 20842, 1035, 26189, 20464, 7432, 1035, 11113, 2072, 1035, 1044, 1001, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # pylint: disable=invalid-name """Unique operator""" from tvm import te, tir from ..te import hybrid from .scan import cumsum from .sort import sort, argsort def _calc_adjacent_diff_ir(data, output, binop=tir.Sub): """Low level IR to calculate adjacent difference in an 1-D array. Parameters ---------- data : Buffer Input 1-D Buffer. output: Buffer A buffer to store adjacent difference, of the same shape as data. The adjacent difference is defined as: output[0] = 0, output[i] = binop(data[i], data[i-1]) where i > 0 and i < len(data). binop: function, optional A binary associative op to use for calculating adjacent difference. The function takes two TIR expressions and produce a new TIR expression. By default it uses tvm.tir.Sub to compute the adjacent difference. """ ib = tir.ir_builder.create() data_ptr = ib.buffer_ptr(data) output_ptr = ib.buffer_ptr(output) with ib.for_range(0, data.shape[0], kind="parallel") as i: with ib.if_scope(i == 0): output_ptr[0] = 0 with ib.else_scope(): output_ptr[i] = tir.Cast(output.dtype, binop(data_ptr[i], data_ptr[i - 1])) return ib.get() def _calc_adjacent_diff(data, out_dtype="int32", binop=tir.Sub): """Function calculate adjacent difference in an 1-D array. Parameters ---------- data : tvm.te.Tensor Input 1-D tensor. output_dtype : str The output tensor data type. binop: function, optional A binary associative op to use for calculating difference. The function takes two TIR expressions and produce a new TIR expression. By default it uses tvm.tir.Sub to compute the adjacent difference. Returns ------- output : tvm.te.Tensor 1-D tensor storing the adjacent difference of the input tensor. The adjacent difference is defined as: output[0] = 0, output[i] = binop(data[i], data[i-1]) where i > 0 and i < len(data). """ return te.extern( [data.shape], [data], lambda ins, outs: _calc_adjacent_diff_ir(ins[0], outs[0], binop=binop), dtype=[out_dtype], name="_calc_adjacent_diff", tag="_calc_adjacent_diff_cpu", ) @hybrid.script def _calc_num_unique(inc_scan): """Helper function to get the number of unique elements fron inc_scan tensor""" output = output_tensor((1,), "int32") output[0] = inc_scan[inc_scan.shape[0] - 1] + int32(1) return output def _calc_unique_ir( data, argsorted_indices, inc_scan, index_converter, unique_elements, inverse_indices, counts ): """Low level IR to calculate unique elements, inverse indices, and counts (optional) of unique elements of 1-D array. Parameters ---------- data : Buffer Input 1-D Buffer. argsorted_indices : Buffer A buffer that stores the argsorted indices of the input data. inc_scan : Buffer A buffer that stores the inclusive scan of the binary tir.NE adjacent difference of the sorted data. index_converter (optional) : Buffer An optional index converter that transforms the unique element index such that new_idx = index_converter[old_idx]. unique_elements : Buffer A buffer that stores the unique elements. inverse_indices : Buffer A buffer that stores the the index of each input data element in the unique element array. counts (optional) : Buffer A buffer that stores the count of each unique element. """ ib = tir.ir_builder.create() data_ptr = ib.buffer_ptr(data) argsorted_indices_ptr = ib.buffer_ptr(argsorted_indices) inc_scan_ptr = ib.buffer_ptr(inc_scan) unique_elements_ptr = ib.buffer_ptr(unique_elements) inverse_indices_ptr = ib.buffer_ptr(inverse_indices) index_converter_ptr = None if isinstance(index_converter, tir.Buffer): index_converter_ptr = ib.buffer_ptr(index_converter) if isinstance(counts, tir.Buffer): counts_ptr = ib.buffer_ptr(counts) # use indices_ptr as a tmp buffer to store tids with inc_scan[tid] != inc_scan[tid-1] unique_seq_indices_ptr = ib.buffer_ptr(inverse_indices) data_length = data.shape[0] # if need to return counts if isinstance(counts, tir.Buffer): num_unique = inc_scan_ptr[inc_scan.shape[0] - 1] + 1 num_elements = data.shape[0] unique_seq_indices_ptr[num_unique - 1] = num_elements with ib.new_scope(): with ib.for_range(0, data_length, kind="parallel") as i: with ib.if_scope(i > 0): with ib.if_scope(inc_scan_ptr[i] != inc_scan_ptr[i - 1]): unique_seq_indices_ptr[inc_scan_ptr[i] - 1] = i with ib.new_scope(): with ib.for_range(0, num_unique, kind="parallel") as i: unique_idx = i if not index_converter_ptr else index_converter_ptr[i] with ib.if_scope(i == 0): counts_ptr[unique_idx] = unique_seq_indices_ptr[i] with ib.else_scope(): counts_ptr[unique_idx] = ( unique_seq_indices_ptr[i] - unique_seq_indices_ptr[i - 1] ) # calculate unique elements and inverse indices with ib.new_scope(): with ib.for_range(0, data_length, kind="parallel") as i: data_idx = argsorted_indices_ptr[i] unique_idx = ( inc_scan_ptr[i] if not index_converter_ptr else index_converter_ptr[inc_scan_ptr[i]] ) inverse_indices_ptr[data_idx] = unique_idx with ib.if_scope(i == 0): unique_elements_ptr[unique_idx] = data_ptr[data_idx] with ib.else_scope(): with ib.if_scope(inc_scan_ptr[i] != inc_scan_ptr[i - 1]): unique_elements_ptr[unique_idx] = data_ptr[data_idx] return ib.get() @hybrid.script def _calc_first_occurence(argsorted_indices, inc_scan): """Hybrid script to calculate the first occurence of each unique element in the input data. Parameters ---------- argsorted_indices : tvm.te.Tensor A tensor that stores the argsorted indices of the input data. inc_scan : tvm.te.Tensor A tensor that stores the inclusive scan of the binary tir.NE adjacent difference of the sorted data. first_occurence : tvm.te.Tensor A tensor that stores the first occurence of each unique element in the input data. """ first_occurence = output_tensor(argsorted_indices.shape, "int32") for i in parallel(argsorted_indices.shape[0]): first_occurence[i] = argsorted_indices.shape[0] for i in parallel(argsorted_indices.shape[0]): if i == 0 or inc_scan[i] != inc_scan[i - 1]: first_occurence[inc_scan[i]] = argsorted_indices[i] return first_occurence def unique(data, is_sorted=True, return_counts=False): """ Find the unique elements of a 1-D tensor. Please note `output` and `counts` are all padded to have the same length of `data` and element with index >= num_unique[0] has undefined value. Parameters ---------- data : tvm.te.Tensor A 1-D tensor of integers. sorted : bool Whether to sort the unique elements in ascending order before returning as output. return_counts : bool Whether to return the count of each unique element. Returns ------- unique : tvm.te.Tensor A 1-D tensor containing the unique elements of the input data tensor. The same size as the input data. If there are less unique elements than input data, the end of the tensor is padded with zeros. indices : tvm.te.Tensor A 1-D tensor. The same size as output. For each entry in output, it contains the index of its first occurence in the input data. The end of the tensor is padded with the length of the input data. inverse_indices : tvm.te.Tensor A 1-D tensor. For each entry in data, it contains the index of that data element in the unique array. (Note that inverse_indices is very similar to indices if output is not sorted.) num_unique : tvm.te.Tensor A 1-D tensor with size=1 containing the number of unique elements in the input data tensor. counts (optional) : tvm.te.Tensor A 1-D tensor containing the count of each unique element in the output. Examples -------- .. code-block:: python [output, indices, num_unique] = unique([4, 5, 1, 2, 3, 3, 4, 5], False, False) output = [4, 5, 1, 2, 3, _, _, _] indices = [0, 1, 2, 3, 4, _, _, _] inverse_indices = [0, 1, 2, 3, 4, 4, 0, 1] num_unique = [5] [output, indices, num_unique, counts] = unique([4, 5, 1, 2, 3, 3, 4, 5], False, True) output = [4, 5, 1, 2, 3, _, _, _] indices = [0, 1, 2, 3, 4, _, _, _] inverse_indices = [0, 1, 2, 3, 4, 4, 0, 1] num_unique = [5] counts = [2, 2, 1, 1, 2, _, _, _] [output, indices, num_unique] = unique([4, 5, 1, 2, 3, 3, 4, 5], True) output = [1, 2, 3, 4, 5, _, _, _] indices = [2, 3, 4, 0, 1, _, _, _] inverse_indices = [3, 4, 0, 1, 2, 2, 3, 4] num_unique = [5] """ sorted_data = sort(data) argsorted_indices = argsort(data, dtype="int32") # adjacent difference adjacent_diff = _calc_adjacent_diff(sorted_data, "int32", tir.NE) # inclusive scan inc_scan = cumsum(adjacent_diff, dtype="int32", exclusive=0) # total number of unique elements num_unique_elements = _calc_num_unique(inc_scan) # prepare outputs if return_counts: out_data_shape = [data.shape] * 3 out_dtypes = [data.dtype, "int32", "int32"] else: out_data_shape = [data.shape] * 2 out_dtypes = [data.dtype, "int32"] # prepare inputs and fcompute first_occurence = _calc_first_occurence(argsorted_indices, inc_scan) if is_sorted: in_data = [data, argsorted_indices, inc_scan] if return_counts: fcompute = lambda ins, outs: _calc_unique_ir(*ins, None, *outs) else: fcompute = lambda ins, outs: _calc_unique_ir(*ins, None, *outs, None) indices = first_occurence else: # calculate index converter by sorting unique elements by their first occurence argsorted_first_occurence = argsort(first_occurence, dtype="int32") index_converter = argsort(argsorted_first_occurence, dtype="int32") in_data = [data, argsorted_indices, inc_scan, index_converter] if return_counts: fcompute = lambda ins, outs: _calc_unique_ir(*ins, *outs) else: fcompute = lambda ins, outs: _calc_unique_ir(*ins, *outs, None) # First occurence is in order of sorted unique output, if we sort the first_occurence array # we get the correct result indices = sort(first_occurence) outs = te.extern( out_data_shape, in_data, fcompute, dtype=out_dtypes, name="_calc_unique", tag="_calc_unique_cpu", ) if return_counts: return [outs[0], indices, outs[1], num_unique_elements, outs[2]] return [outs[0], indices, outs[1], num_unique_elements]
Laurawly/tvm-1
python/tvm/topi/unique.py
Python
apache-2.0
12,249
[ 30522, 1001, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 1001, 2030, 2062, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 1001, 5500, 2007, 2023, 2147, 2005, 3176, 2592, 1001, 4953, 9385, 6095, 1012, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// ----------------------------------------------------------------------- // Licensed to The .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // ----------------------------------------------------------------------- using System; namespace Kerberos.NET.Entities { [Flags] public enum ContextFlags { DelegFlag = 1 << 6, MutualFlag = 1 << 5, ReplayFlag = 1 << 4, SequenceFlag = 1 << 3, AnonFlag = 1 << 2, ConfFlag = 1 << 1, IntegFlag = 1 << 0 } }
SteveSyfuhs/Kerberos.NET
Kerberos.NET/Entities/Krb/ContextFlags.cs
C#
mit
589
[ 30522, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright 2005, 2006, 2007 Dennis van Weeren Copyright 2008, 2009 Jakub Bednarski This file is part of Minimig Minimig is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Minimig is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ // 2009-11-14 - OSD labels changed // 2009-12-15 - added display of directory name extensions // 2010-01-09 - support for variable number of tracks //#include "AT91SAM7S256.h" //#include "stdbool.h" #include "stdio.h" #include "string.h" #include "errors.h" #include "mmc.h" #include "fat.h" #include "osd.h" #include "fpga.h" #include "fdd.h" #include "hdd.h" #include "hardware.h" #include "firmware.h" #include "config.h" #include "menu.h" // other constants #define DIRSIZE 8 // number of items in directory display window unsigned char menustate = MENU_NONE1; unsigned char parentstate; unsigned char menusub = 0; unsigned int menumask = 0; // Used to determine which rows are selectable... unsigned long menu_timer; extern unsigned char drives; extern adfTYPE df[4]; extern configTYPE config; extern fileTYPE file; extern char s[40]; extern unsigned char fat32; extern DIRENTRY DirEntry[MAXDIRENTRIES]; extern unsigned char sort_table[MAXDIRENTRIES]; extern unsigned char nDirEntries; extern unsigned char iSelectedEntry; extern unsigned long iCurrentDirectory; extern char DirEntryLFN[MAXDIRENTRIES][261]; char DirEntryInfo[MAXDIRENTRIES][5]; // disk number info of dir entries char DiskInfo[5]; // disk number info of selected entry extern const char version[]; const char *config_filter_msg[] = {"none", "HORIZONTAL", "VERTICAL", "H+V"}; const char *config_memory_chip_msg[] = {"0.5 MB", "1.0 MB", "1.5 MB", "2.0 MB"}; const char *config_memory_slow_msg[] = {"none ", "0.5 MB", "1.0 MB", "1.5 MB"}; const char *config_scanlines_msg[] = {"off", "dim", "black"}; const char *config_memory_fast_msg[] = {"none ", "2.0 MB", "4.0 MB"}; const char *config_cpu_msg[] = {"68000 ", "68010", "-----","020 alpha"}; const char *config_hdf_msg[] = {"Disabled", "Hardfile (disk img)", "MMC/SD card", "MMC/SD partition 1", "MMC/SD partition 2", "MMC/SD partition 3", "MMC/SD partition 4"}; const char *config_chipset_msg[] = {"OCS-A500", "OCS-A1000", "ECS", "---"}; char *config_autofire_msg[] = {" AUTOFIRE OFF", " AUTOFIRE FAST", " AUTOFIRE MEDIUM", " AUTOFIRE SLOW"}; enum HelpText_Message {HELPTEXT_NONE,HELPTEXT_MAIN,HELPTEXT_HARDFILE,HELPTEXT_CHIPSET,HELPTEXT_MEMORY,HELPTEXT_VIDEO}; const char *helptexts[]={ 0, " Welcome to Minimig! Use the cursor keys to navigate the menus. Use space bar or enter to select an item. Press Esc or F12 to exit the menus. Joystick emulation on the numeric keypad can be toggled with the numlock key, while pressing Ctrl-Alt-0 (numeric keypad) toggles autofire mode.", " Minimig can emulate an A600 IDE harddisk interface. The emulation can make use of Minimig-style hardfiles (complete disk images) or UAE-style hardfiles (filesystem images with no partition table). It is also possible to use either the entire SD card or an individual partition as an emulated harddisk.", " Minimig's processor core can emulate a 68000 or 68020 processor (though the 68020 mode is still experimental.) If you're running software built for 68000, there's no advantage to using the 68020 mode, since the 68000 emulation runs just as fast.", #ifdef ACTIONREPLAY_BROKEN " Minimig can make use of up to 2 megabytes of Chip RAM, up to 1.5 megabytes of Slow RAM (A500 Trapdoor RAM), and up to 8 megabytes of true Fast RAM.", #else " Minimig can make use of up to 2 megabytes of Chip RAM, up to 1.5 megabytes of Slow RAM (A500 Trapdoor RAM), and up to 8 megabytes of true Fast RAM. To use the Action Replay feature you will need an Action Replay 3 ROM file on the SD card, named AR3.ROM. You will also need to set Fast RAM to no more than 2 megabytes.", #endif " Minimig's video features include a blur filter, to simulate the poorer picture quality on older monitors, and also scanline generation to simulate the appearance of a screen with low vertical resolution.", 0 }; //extern unsigned char DEBUG; unsigned char config_autofire = 0; // file selection menu variables char *fs_pFileExt = NULL; unsigned char fs_Options; unsigned char fs_MenuSelect; unsigned char fs_MenuCancel; static char debuglines[8*32+1]; static char debugptr=0; void _showdebugmessages() { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L2); int i; for(i=0;i<8;++i) { int j=(debugptr+i)&7; debuglines[j*32+31]=0; OsdWrite(i,&debuglines[j*32],i==7,0); } DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L2); } void SelectFile(char* pFileExt, unsigned char Options, unsigned char MenuSelect, unsigned char MenuCancel) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L1); // this function displays file selection menu if (strncmp(pFileExt, fs_pFileExt, 3) != 0) // check desired file extension { // if different from the current one go to the root directory and init entry buffer ChangeDirectory(DIRECTORY_ROOT); ScanDirectory(SCAN_INIT, pFileExt, Options); } fs_pFileExt = pFileExt; fs_Options = Options; fs_MenuSelect = MenuSelect; fs_MenuCancel = MenuCancel; menustate = MENU_FILE_SELECT1; DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L1); } #define STD_EXIT " exit" #define HELPTEXT_DELAY 10000 #define FRAME_DELAY 150 void ShowSplash() { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L0); OsdSetTitle("Welcome",0); OsdWrite(0, "", 0,0); OsdDrawLogo(1,0,0); OsdDrawLogo(2,1,0); OsdDrawLogo(3,2,0); OsdDrawLogo(4,3,0); OsdDrawLogo(5,4,0); OsdWrite(6, "", 0,0); OsdWrite(7, "", 0,0); OsdEnable(0); DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L0); } void HideSplash() { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L0); OsdDisable(); DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L0); } void HandleUI(void) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L2); unsigned char i, c, up, down, select, menu, right, left, plus, minus; unsigned long len; static hardfileTYPE t_hardfile[2]; // temporary copy of former hardfile configuration static unsigned char ctrl = false; static unsigned char lalt = false; char enable; static long helptext_timer; static const char *helptext; static char helpstate=0; // get user control codes c = OsdGetCtrl(); // decode and set events menu = false; select = false; up = false; down = false; left = false; right = false; plus=false; minus=false; switch (c) { case KEY_CTRL : ctrl = true; break; case KEY_CTRL | KEY_UPSTROKE : ctrl = false; break; case KEY_LALT : lalt = true; break; case KEY_LALT | KEY_UPSTROKE : lalt = false; break; case KEY_KPPLUS : if (ctrl && lalt) { config.chipset |= CONFIG_TURBO; ConfigChipset(config.chipset); if (menustate == MENU_SETTINGS_CHIPSET2) menustate = MENU_SETTINGS_CHIPSET1; else if (menustate == MENU_NONE2 || menustate == MENU_INFO) InfoMessage(" TURBO"); } else plus=true; break; case KEY_KPMINUS : if (ctrl && lalt) { config.chipset &= ~CONFIG_TURBO; ConfigChipset(config.chipset); if (menustate == MENU_SETTINGS_CHIPSET2) menustate = MENU_SETTINGS_CHIPSET1; else if (menustate == MENU_NONE2 || menustate == MENU_INFO) InfoMessage(" NORMAL"); } else minus=true; break; case KEY_KP0 : if (ctrl && lalt) { if (menustate == MENU_NONE2 || menustate == MENU_INFO) { config_autofire++; config_autofire &= 3; ConfigAutofire(config_autofire); if (menustate == MENU_NONE2 || menustate == MENU_INFO) InfoMessage(config_autofire_msg[config_autofire]); } } break; case KEY_MENU : if (ctrl && lalt) { OsdSetTitle("Debug",0); DebugMode=DebugMode^1; menustate = MENU_NONE1; } else menu = true; break; case KEY_ESC : if (menustate != MENU_NONE2) menu = true; break; case KEY_ENTER : case KEY_SPACE : select = true; break; case KEY_UP : up = true; break; case KEY_DOWN : down = true; break; case KEY_LEFT : left = true; break; case KEY_RIGHT : right = true; break; } if(menu || select || up || down || left || right ) { if(helpstate) OsdWrite(7,STD_EXIT,(menumask-((1<<(menusub+1))-1))<=0,0); // Redraw the Exit line... helpstate=0; helptext_timer=GetTimer(HELPTEXT_DELAY); } if(helptext) { if(helpstate<9) { if(CheckTimer(helptext_timer)) { helptext_timer=GetTimer(FRAME_DELAY); OsdWriteOffset(7,STD_EXIT,0,0,helpstate); ++helpstate; } } else if(helpstate==9) { ScrollReset(); ++helpstate; } else ScrollText(7,helptext,0,0,0); } // Standardised menu up/down. // The screen should set menumask, bit 0 to make the top line selectable, bit 1 for the 2nd line, etc. // (Lines in this context don't have to correspond to rows on the OSD.) // Also set parentstate to the appropriate menustate. if(menumask) { if ((unsigned)down && ((unsigned)menumask>=(unsigned)(1<<(menusub+1)))) // Any active entries left? { do menusub++; while((menumask & (1<<menusub)) == 0); menustate = parentstate; } if (up && menusub > 0 && (menumask<<(8-menusub))) { do --menusub; while((menumask & (1<<menusub)) == 0); menustate = parentstate; } } switch (menustate) { /******************************************************************/ /* no menu selected */ /******************************************************************/ case MENU_NONE1 : helptext=helptexts[HELPTEXT_NONE]; menumask=0; if(DebugMode) { helptext=helptexts[HELPTEXT_NONE]; OsdEnable(0); } else OsdDisable(); menustate = MENU_NONE2; break; case MENU_NONE2 : if(DebugMode) _showdebugmessages(); if (menu) { menustate = MENU_MAIN1; menusub = 0; OsdClear(); OsdEnable(DISABLE_KEYBOARD); } break; /******************************************************************/ /* main menu */ /******************************************************************/ case MENU_MAIN1 : menumask=0x70; // b01110000 Floppy turbo, Harddisk options & Exit. OsdSetTitle("Minimig",OSD_ARROW_RIGHT); helptext=helptexts[HELPTEXT_MAIN]; // floppy drive info // We display a line for each drive that's active // in the config file, but grey out any that the FPGA doesn't think are active. // We also print a help text in place of the last drive if it's inactive. for (i = 0; i < 4; i++) { if(i==config.floppy.drives+1) OsdWrite(i," KP +/- to add/remove drives",0,1); else { strcpy(s, " dfx: "); s[3] = i + '0'; if(i<=drives) { menumask|=(1<<i); // Make enabled drives selectable if (df[i].status & DSK_INSERTED) // floppy disk is inserted { strncpy(&s[6], df[i].name, sizeof(df[0].name)); if(!(df[i].status & DSK_WRITABLE)) strcpy(&s[6 + sizeof(df[i].name)-1], " \x17"); // padlock icon for write-protected disks else strcpy(&s[6 + sizeof(df[i].name)-1], " "); // clear padlock icon for write-enabled disks } else // no floppy disk { strcat(s, "* no disk *"); } } else if(i<=config.floppy.drives) { strcat(s,"* active after reset *"); } else strcpy(s,""); OsdWrite(i, s, menusub == i,(i>drives)||(i>config.floppy.drives)); } } sprintf(s," Floppy disk turbo : %s",config.floppy.speed ? "on" : "off"); OsdWrite(4, s, menusub==4,0); OsdWrite(5, " Hard disk settings \x16", menusub == 5,0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 6,0); menustate = MENU_MAIN2; parentstate=MENU_MAIN1; break; case MENU_MAIN2 : if (menu) menustate = MENU_NONE1; else if(plus && (config.floppy.drives<3)) { config.floppy.drives++; ConfigFloppy(config.floppy.drives,config.floppy.speed); menustate = MENU_MAIN1; } else if(minus && (config.floppy.drives>0)) { config.floppy.drives--; ConfigFloppy(config.floppy.drives,config.floppy.speed); menustate = MENU_MAIN1; } else if (select) { if (menusub < 4) { if (df[menusub].status & DSK_INSERTED) // eject selected floppy { df[menusub].status = 0; menustate = MENU_MAIN1; } else { df[menusub].status = 0; SelectFile("ADF", SCAN_DIR | SCAN_LFN, MENU_FILE_SELECTED, MENU_MAIN1); } } else if (menusub == 4) // Toggle floppy turbo { config.floppy.speed^=1; ConfigFloppy(config.floppy.drives,config.floppy.speed); menustate = MENU_MAIN1; } else if (menusub == 5) // Go to harddrives page. { t_hardfile[0] = config.hardfile[0]; t_hardfile[1] = config.hardfile[1]; menustate = MENU_SETTINGS_HARDFILE1; menusub=0; } else if (menusub == 6) menustate = MENU_NONE1; } else if (c == KEY_BACK) // eject all floppies { for (i = 0; i <= drives; i++) df[i].status = 0; menustate = MENU_MAIN1; } else if (right) { menustate = MENU_MAIN2_1; menusub = 0; } break; case MENU_FILE_SELECTED : // file successfully selected InsertFloppy(&df[menusub]); menustate = MENU_MAIN1; menusub++; if (menusub > drives) menusub = 6; break; /******************************************************************/ /* second part of the main menu */ /******************************************************************/ case MENU_MAIN2_1 : helptext=helptexts[HELPTEXT_MAIN]; menumask=0x3f; OsdSetTitle("Settings",OSD_ARROW_LEFT|OSD_ARROW_RIGHT); OsdWrite(0, " load configuration", menusub == 0,0); OsdWrite(1, " save configuration", menusub == 1,0); OsdWrite(2, "", 0,0); OsdWrite(3, " chipset settings \x16", menusub == 2,0); OsdWrite(4, " memory settings \x16", menusub == 3,0); OsdWrite(5, " video settings \x16", menusub == 4,0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 5,0); parentstate = menustate; menustate = MENU_MAIN2_2; break; case MENU_MAIN2_2 : if (menu) menustate = MENU_NONE1; else if (select) { if (menusub == 0) { menusub = 0; menustate = MENU_LOADCONFIG_1; } else if (menusub == 1) { menusub = 0; menustate = MENU_SAVECONFIG_1; } else if (menusub == 2) { menustate = MENU_SETTINGS_CHIPSET1; menusub = 0; } else if (menusub == 3) { menustate = MENU_SETTINGS_MEMORY1; menusub = 0; } else if (menusub == 4) { menustate = MENU_SETTINGS_VIDEO1; menusub = 0; } else if (menusub == 5) menustate = MENU_NONE1; } else if (left) { menustate = MENU_MAIN1; menusub = 0; } else if (right) { menustate = MENU_MISC1; menusub = 0; } break; case MENU_MISC1 : helptext=helptexts[HELPTEXT_MAIN]; menumask=0x0f; // Reset, about and exit. OsdSetTitle("Misc",OSD_ARROW_LEFT); OsdWrite(0, " Reset", menusub == 0,0); OsdWrite(1, "", 0,0); OsdWrite(2, " Return to Chameleon", menusub == 1,0); // OsdWrite(3, " (Not yet implemented)", 0,1); OsdWrite(3, "", 0,0); OsdWrite(4, " About", menusub == 2,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 3,0); parentstate = menustate; menustate = MENU_MISC2; break; case MENU_MISC2 : if (menu) menusub=0, menustate = MENU_NONE1; if (left) menusub=0, menustate = MENU_MAIN2_1; else if (select) { if (menusub == 0) // Reset { menusub = 0; menustate=MENU_RESET1; } if (menusub == 1) // Reconfig { menusub=0; menustate=MENU_RECONF1; } if (menusub == 2) // About { menusub=0; menustate=MENU_ABOUT1; } if (menusub == 3) // Exit { menustate=MENU_NONE1; } } break; case MENU_ABOUT1 : helptext=helptexts[HELPTEXT_NONE]; menumask=0x01; // Just Exit OsdSetTitle("About",0); OsdDrawLogo(0,0,1); OsdDrawLogo(1,1,1); OsdDrawLogo(2,2,1); OsdDrawLogo(3,3,1); OsdDrawLogo(4,4,1); OsdDrawLogo(6,6,1); // OsdWrite(1, "", 0,0); // OsdWriteDoubleSize(2," Minimig",0); // OsdWriteDoubleSize(3," Minimig",1); // OsdWrite(4, "", 0,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 0,0); StarsInit(); ScrollReset(); parentstate = menustate; menustate = MENU_ABOUT2; break; case MENU_ABOUT2 : StarsUpdate(); OsdDrawLogo(0,0,1); OsdDrawLogo(1,1,1); OsdDrawLogo(2,2,1); OsdDrawLogo(3,3,1); OsdDrawLogo(4,4,1); OsdDrawLogo(6,6,1); ScrollText(5," Minimig by Dennis van Weeren. Chipset improvements by Jakub Bednarski and Sascha Boing. TG68 softcore and Chameleon port by Tobias Gubener. Menu / disk code by Dennis van Weeren, Jakub Bednarski and Alastair M. Robinson. Build process, repository and tooling by Christian Vogelgsang. Minimig logo based on a design by Loriano Pagni. Minimig is distributed under the terms of the GNU General Public License version 3.",0,0,0); if (select || menu) { menusub = 2; menustate=MENU_MISC1; } break; case MENU_LOADCONFIG_1 : helptext=helptexts[HELPTEXT_NONE]; if(parentstate!=menustate) // First run? { menumask=0x20; SetConfigurationFilename(0); if(ConfigurationExists(0)) menumask|=0x01; SetConfigurationFilename(1); if(ConfigurationExists(0)) menumask|=0x02; SetConfigurationFilename(2); if(ConfigurationExists(0)) menumask|=0x04; SetConfigurationFilename(3); if(ConfigurationExists(0)) menumask|=0x08; SetConfigurationFilename(4); if(ConfigurationExists(0)) menumask|=0x10; } parentstate=menustate; OsdSetTitle("Load",0); OsdWrite(0, "", 0,0); OsdWrite(1, " Default", menusub == 0,(menumask & 1)==0); OsdWrite(2, " 1", menusub == 1,(menumask & 2)==0); OsdWrite(3, " 2", menusub == 2,(menumask & 4)==0); OsdWrite(4, " 3", menusub == 3,(menumask & 8)==0); OsdWrite(5, " 4", menusub == 4,(menumask & 0x10)==0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 5,0); menustate = MENU_LOADCONFIG_2; break; case MENU_LOADCONFIG_2 : if (down) { // if (menusub < 3) if (menusub < 5) menusub++; menustate = MENU_LOADCONFIG_1; } else if (select) { if(menusub<5) { OsdDisable(); SetConfigurationFilename(menusub); LoadConfiguration(NULL); // OsdReset(RESET_NORMAL); menustate = MENU_NONE1; } else { menustate = MENU_MAIN2_1; menusub = 0; } } if (menu) // exit menu { menustate = MENU_MAIN2_1; menusub = 0; } break; /******************************************************************/ /* file selection menu */ /******************************************************************/ case MENU_FILE_SELECT1 : helptext=helptexts[HELPTEXT_NONE]; OsdSetTitle("Select",0); PrintDirectory(); menustate = MENU_FILE_SELECT2; break; case MENU_FILE_SELECT2 : menumask=0; ScrollLongName(); // scrolls file name if longer than display line if (c == KEY_HOME) { ScanDirectory(SCAN_INIT, fs_pFileExt, fs_Options); menustate = MENU_FILE_SELECT1; } if (c == KEY_BACK) { if (iCurrentDirectory) // if not root directory { ScanDirectory(SCAN_INIT, fs_pFileExt, fs_Options); ChangeDirectory(DirEntry[sort_table[iSelectedEntry]].StartCluster + (fat32 ? (DirEntry[sort_table[iSelectedEntry]].HighCluster & 0x0FFF) << 16 : 0)); if (ScanDirectory(SCAN_INIT_FIRST, fs_pFileExt, fs_Options)) ScanDirectory(SCAN_INIT_NEXT, fs_pFileExt, fs_Options); menustate = MENU_FILE_SELECT1; } } if (c == KEY_PGUP) { ScanDirectory(SCAN_PREV_PAGE, fs_pFileExt, fs_Options); menustate = MENU_FILE_SELECT1; } if (c == KEY_PGDN) { ScanDirectory(SCAN_NEXT_PAGE, fs_pFileExt, fs_Options); menustate = MENU_FILE_SELECT1; } if (down) // scroll down one entry { ScanDirectory(SCAN_NEXT, fs_pFileExt, fs_Options); menustate = MENU_FILE_SELECT1; } if (up) // scroll up one entry { ScanDirectory(SCAN_PREV, fs_pFileExt, fs_Options); menustate = MENU_FILE_SELECT1; } if ((i = GetASCIIKey(c))) { // find an entry beginning with given character if (nDirEntries) { if (DirEntry[sort_table[iSelectedEntry]].Attributes & ATTR_DIRECTORY) { // it's a directory if (i < DirEntry[sort_table[iSelectedEntry]].Name[0]) { if (!ScanDirectory(i, fs_pFileExt, fs_Options | FIND_FILE)) ScanDirectory(i, fs_pFileExt, fs_Options | FIND_DIR); } else if (i > DirEntry[sort_table[iSelectedEntry]].Name[0]) { if (!ScanDirectory(i, fs_pFileExt, fs_Options | FIND_DIR)) ScanDirectory(i, fs_pFileExt, fs_Options | FIND_FILE); } else { if (!ScanDirectory(i, fs_pFileExt, fs_Options)) // find nexr if (!ScanDirectory(i, fs_pFileExt, fs_Options | FIND_FILE)) ScanDirectory(i, fs_pFileExt, fs_Options | FIND_DIR); } } else { // it's a file if (i < DirEntry[sort_table[iSelectedEntry]].Name[0]) { if (!ScanDirectory(i, fs_pFileExt, fs_Options | FIND_DIR)) ScanDirectory(i, fs_pFileExt, fs_Options | FIND_FILE); } else if (i > DirEntry[sort_table[iSelectedEntry]].Name[0]) { if (!ScanDirectory(i, fs_pFileExt, fs_Options | FIND_FILE)) ScanDirectory(i, fs_pFileExt, fs_Options | FIND_DIR); } else { if (!ScanDirectory(i, fs_pFileExt, fs_Options)) // find next if (!ScanDirectory(i, fs_pFileExt, fs_Options | FIND_DIR)) ScanDirectory(i, fs_pFileExt, fs_Options | FIND_FILE); } } } menustate = MENU_FILE_SELECT1; } if (select) { if (DirEntry[sort_table[iSelectedEntry]].Attributes & ATTR_DIRECTORY) { ChangeDirectory(DirEntry[sort_table[iSelectedEntry]].StartCluster + (fat32 ? (DirEntry[sort_table[iSelectedEntry]].HighCluster & 0x0FFF) << 16 : 0)); { if (strncmp((char*)DirEntry[sort_table[iSelectedEntry]].Name, "..", 2) == 0) { // parent dir selected if (ScanDirectory(SCAN_INIT_FIRST, fs_pFileExt, fs_Options)) ScanDirectory(SCAN_INIT_NEXT, fs_pFileExt, fs_Options); else ScanDirectory(SCAN_INIT, fs_pFileExt, fs_Options); } else ScanDirectory(SCAN_INIT, fs_pFileExt, fs_Options); menustate = MENU_FILE_SELECT1; } } else { if (nDirEntries) { file.long_name[0] = 0; len = strlen(DirEntryLFN[sort_table[iSelectedEntry]]); if (len > 4) if (DirEntryLFN[sort_table[iSelectedEntry]][len-4] == '.') len -= 4; // remove extension if (len > sizeof(file.long_name)) len = sizeof(file.long_name); strncpy(file.name, (const char*)DirEntry[sort_table[iSelectedEntry]].Name, sizeof(file.name)); memset(file.long_name, 0, sizeof(file.long_name)); strncpy(file.long_name, DirEntryLFN[sort_table[iSelectedEntry]], len); strncpy(DiskInfo, DirEntryInfo[iSelectedEntry], sizeof(DiskInfo)); file.size = DirEntry[sort_table[iSelectedEntry]].FileSize; file.attributes = DirEntry[sort_table[iSelectedEntry]].Attributes; file.start_cluster = DirEntry[sort_table[iSelectedEntry]].StartCluster + (fat32 ? (DirEntry[sort_table[iSelectedEntry]].HighCluster & 0x0FFF) << 16 : 0); file.cluster = file.start_cluster; file.sector = 0; menustate = fs_MenuSelect; } } } if (menu) { menustate = fs_MenuCancel; } break; /******************************************************************/ /* reset menu */ /******************************************************************/ case MENU_RESET1 : helptext=helptexts[HELPTEXT_NONE]; OsdSetTitle("Reset",0); menumask=0x03; // Yes / No parentstate=menustate; OsdWrite(0, "", 0,0); OsdWrite(1, " Reset Minimig?", 0,0); OsdWrite(2, "", 0,0); OsdWrite(3, " yes", menusub == 0,0); OsdWrite(4, " no", menusub == 1,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, "", 0,0); menustate = MENU_RESET2; break; case MENU_RESET2 : if (select && menusub == 0) { menustate = MENU_NONE1; OsdReset(RESET_NORMAL); } if (menu || (select && (menusub == 1))) // exit menu { menustate = MENU_MISC1; menusub = 0; } break; /******************************************************************/ /* reconfigure confirmation */ /******************************************************************/ case MENU_RECONF1 : helptext=helptexts[HELPTEXT_NONE]; OsdSetTitle("Exit",0); menumask=0x03; // Yes / No parentstate=menustate; OsdWrite(0, "", 0,0); OsdWrite(1, " Return to Chameleon?", 0,0); OsdWrite(2, "", 0,0); OsdWrite(3, " yes", menusub == 0,0); OsdWrite(4, " no", menusub == 1,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, "", 0,0); menustate = MENU_RECONF2; break; case MENU_RECONF2 : if (select && menusub == 0) { OsdReconfig(); } if (menu || (select && (menusub == 1))) // exit menu { menustate = MENU_MISC1; menusub = 1; } break; /******************************************************************/ /* settings menu */ /******************************************************************/ /* case MENU_SETTINGS1 : menumask=0; OsdSetTitle("Settings",0); OsdWrite(0, "", 0,0); OsdWrite(1, " chipset", menusub == 0,0); OsdWrite(2, " memory", menusub == 1,0); OsdWrite(3, " drives", menusub == 2,0); OsdWrite(4, " video", menusub == 3,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); if (menusub == 5) OsdWrite(7, " \x12 save \x12", 1,0); else if (menusub == 4) OsdWrite(7, " \x13 exit \x13", 1,0); else OsdWrite(7, STD_EXIT, 0,0); menustate = MENU_SETTINGS2; break; case MENU_SETTINGS2 : if (down && menusub < 5) { menusub++; menustate = MENU_SETTINGS1; } if (up && menusub > 0) { menusub--; menustate = MENU_SETTINGS1; } if (select) { if (menusub == 0) { menustate = MENU_SETTINGS_CHIPSET1; menusub = 0; } else if (menusub == 1) { menustate = MENU_SETTINGS_MEMORY1; menusub = 0; } else if (menusub == 2) { menustate = MENU_SETTINGS_DRIVES1; menusub = 0; } else if (menusub == 3) { menustate = MENU_SETTINGS_VIDEO1; menusub = 0; } else if (menusub == 4) { menustate = MENU_MAIN2_1; menusub = 1; } else if (menusub == 5) { // SaveConfiguration(0); // Use slot-based config filename instead menustate = MENU_SAVECONFIG_1; menusub = 0; } } if (menu) { menustate = MENU_MAIN2_1; menusub = 1; } break; */ case MENU_SAVECONFIG_1 : helptext=helptexts[HELPTEXT_NONE]; menumask=0x3f; parentstate=menustate; OsdSetTitle("Save",0); OsdWrite(0, "", 0, 0); OsdWrite(1, " Default", menusub == 0,0); OsdWrite(2, " 1", menusub == 1,0); OsdWrite(3, " 2", menusub == 2,0); OsdWrite(4, " 3", menusub == 3,0); OsdWrite(5, " 4", menusub == 4,0); OsdWrite(6, "", 0,0); // OsdWrite(7, " exit", menusub == 3); OsdWrite(7, STD_EXIT, menusub == 5,0); menustate = MENU_SAVECONFIG_2; break; case MENU_SAVECONFIG_2 : if (menu) { menustate = MENU_MAIN2_1; menusub = 5; } else if (up) { if (menusub > 0) menusub--; menustate = MENU_SAVECONFIG_1; } else if (down) { // if (menusub < 3) if (menusub < 5) menusub++; menustate = MENU_SAVECONFIG_1; } else if (select) { if(menusub<5) { SetConfigurationFilename(menusub); SaveConfiguration(NULL); menustate = MENU_NONE1; } else { menustate = MENU_MAIN2_1; menusub = 1; } } if (menu) // exit menu { menustate = MENU_MAIN2_1; menusub = 1; } break; /******************************************************************/ /* chipset settings menu */ /******************************************************************/ case MENU_SETTINGS_CHIPSET1 : helptext=helptexts[HELPTEXT_CHIPSET]; menumask=0; OsdSetTitle("Chipset",OSD_ARROW_LEFT|OSD_ARROW_RIGHT); OsdWrite(0, "", 0,0); strcpy(s, " CPU : "); // strcat(s, config.chipset & CONFIG_TURBO ? "turbo" : "normal"); strcat(s, config_cpu_msg[config.cpu & 0x03]); OsdWrite(1, s, menusub == 0,0); strcpy(s, " Video : "); strcat(s, config.chipset & CONFIG_NTSC ? "NTSC" : "PAL"); OsdWrite(2, s, menusub == 1,0); strcpy(s, " Chipset : "); strcat(s, config_chipset_msg[config.chipset >> 2 & 3]); OsdWrite(3, s, menusub == 2,0); OsdWrite(4, "", 0,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 3,0); menustate = MENU_SETTINGS_CHIPSET2; break; case MENU_SETTINGS_CHIPSET2 : if (down && menusub < 3) { menusub++; menustate = MENU_SETTINGS_CHIPSET1; } if (up && menusub > 0) { menusub--; menustate = MENU_SETTINGS_CHIPSET1; } if (select) { if (menusub == 0) { // config.chipset ^= CONFIG_TURBO; menustate = MENU_SETTINGS_CHIPSET1; config.cpu += 1; if ((config.cpu & 0x03)==0x02) config.cpu += 1; // ConfigChipset(config.chipset); ConfigCPU(config.cpu); } else if (menusub == 1) { config.chipset ^= CONFIG_NTSC; menustate = MENU_SETTINGS_CHIPSET1; ConfigChipset(config.chipset); } else if (menusub == 2) { if (config.chipset & CONFIG_ECS) config.chipset &= ~(CONFIG_ECS|CONFIG_A1000); else config.chipset += CONFIG_A1000; menustate = MENU_SETTINGS_CHIPSET1; ConfigChipset(config.chipset); } else if (menusub == 3) { menustate = MENU_MAIN2_1; menusub = 2; } } if (menu) { menustate = MENU_MAIN2_1; menusub = 2; } else if (right) { menustate = MENU_SETTINGS_MEMORY1; menusub = 0; } else if (left) { menustate = MENU_SETTINGS_VIDEO1; menusub = 0; } break; /******************************************************************/ /* memory settings menu */ /******************************************************************/ case MENU_SETTINGS_MEMORY1 : helptext=helptexts[HELPTEXT_MEMORY]; menumask=0x3f; parentstate=menustate; OsdSetTitle("Memory",OSD_ARROW_LEFT|OSD_ARROW_RIGHT); OsdWrite(0, "", 0,0); strcpy(s, " CHIP : "); strcat(s, config_memory_chip_msg[config.memory & 0x03]); OsdWrite(1, s, menusub == 0,0); strcpy(s, " SLOW : "); strcat(s, config_memory_slow_msg[config.memory >> 2 & 0x03]); OsdWrite(2, s, menusub == 1,0); strcpy(s, " FAST : "); strcat(s, config_memory_fast_msg[config.memory >> 4 & 0x03]); OsdWrite(3, s, menusub == 2,0); OsdWrite(4, "", 0,0); strcpy(s, " ROM : "); if (config.kickstart.long_name[0]) strncat(s, config.kickstart.long_name, sizeof(config.kickstart.long_name)); else strncat(s, config.kickstart.name, sizeof(config.kickstart.name)); OsdWrite(5, s, menusub == 3,0); #ifdef ACTIONREPLAY_BROKEN OsdWrite(0, "", 0,0); menumask&=0xef; // Remove bit 4 #else strcpy(s, " AR3 : "); strcat(s, config.disable_ar3 ? "disabled" : "enabled "); OsdWrite(6, s, menusub == 4,config.memory&0x20); // Grey out AR3 if more than 2MB fast memory #endif OsdWrite(7, STD_EXIT, menusub == 5,0); menustate = MENU_SETTINGS_MEMORY2; break; case MENU_SETTINGS_MEMORY2 : if (select) { if (menusub == 0) { config.memory = ((config.memory + 1) & 0x03) | (config.memory & ~0x03); menustate = MENU_SETTINGS_MEMORY1; ConfigMemory(config.memory); } else if (menusub == 1) { config.memory = ((config.memory + 4) & 0x0C) | (config.memory & ~0x0C); menustate = MENU_SETTINGS_MEMORY1; ConfigMemory(config.memory); } else if (menusub == 2) { config.memory = ((config.memory + 0x10) & 0x30) | (config.memory & ~0x30); if ((config.memory & 0x30) == 0x30) config.memory -= 0x30; // if (!(config.disable_ar3 & 0x01)&&(config.memory & 0x20)) // config.memory &= ~0x30; menustate = MENU_SETTINGS_MEMORY1; ConfigMemory(config.memory); } else if (menusub == 3) { SelectFile("ROM", SCAN_LFN, MENU_ROMFILE_SELECTED, MENU_SETTINGS_MEMORY1); } else if (menusub == 4) { if (!(config.disable_ar3 & 0x01)||(config.memory & 0x20)) config.disable_ar3 |= 0x01; else config.disable_ar3 &= 0xFE; menustate = MENU_SETTINGS_MEMORY1; } else if (menusub == 5) { menustate = MENU_MAIN2_1; menusub = 3; } } if (menu) { menustate = MENU_MAIN2_1; menusub = 3; } else if (right) { menustate = MENU_SETTINGS_VIDEO1; menusub = 0; } else if (left) { menustate = MENU_SETTINGS_CHIPSET1; menusub = 0; } break; /******************************************************************/ /* drive settings menu */ /******************************************************************/ /* case MENU_SETTINGS_DRIVES1 : menumask=0; OsdSetTitle("Drives",OSD_ARROW_LEFT|OSD_ARROW_RIGHT); OsdWrite(0, "", 0,0); sprintf(s, " drives : %d", config.floppy.drives + 1,0); OsdWrite(1, s, menusub == 0,0); strcpy(s, " speed : "); strcat(s, config.floppy.speed ? "fast " : "normal"); OsdWrite(2, s, menusub == 1,0); OsdWrite(3, "", 0,0); strcpy(s, " A600 IDE : "); strcat(s, config.enable_ide ? "on " : "off"); OsdWrite(4, s, menusub == 2,0); sprintf(s, " hardfiles : %d", (config.hardfile[0].present & config.hardfile[0].enabled) + (config.hardfile[1].present & config.hardfile[1].enabled)); OsdWrite(5,s, menusub == 3,0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 4,0); menustate = MENU_SETTINGS_DRIVES2; break; case MENU_SETTINGS_DRIVES2 : if (down && menusub < 4) { menusub++; menustate = MENU_SETTINGS_DRIVES1; } if (up && menusub > 0) { menusub--; menustate = MENU_SETTINGS_DRIVES1; } if (select) { if (menusub == 0) { config.floppy.drives++; config.floppy.drives &= 0x03; menustate = MENU_SETTINGS_DRIVES1; ConfigFloppy(config.floppy.drives, config.floppy.speed); } else if (menusub == 1) { config.floppy.speed++; config.floppy.speed &= 0x01; menustate = MENU_SETTINGS_DRIVES1; ConfigFloppy(config.floppy.drives, config.floppy.speed); } else if (menusub == 2) { config.enable_ide ^= 0x01; menustate = MENU_SETTINGS_DRIVES1; ConfigIDE(config.enable_ide, config.hardfile[0].present && config.hardfile[0].enabled, config.hardfile[1].present && config.hardfile[1].enabled); } else if (menusub == 3) { t_hardfile[0] = config.hardfile[0]; t_hardfile[1] = config.hardfile[1]; menustate = MENU_SETTINGS_HARDFILE1; menusub = 4; } else if (menusub == 4) { menustate = MENU_SETTINGS1; menusub = 2; } } if (menu) { menustate = MENU_SETTINGS1; menusub = 2; } else if (right) { menustate = MENU_SETTINGS_VIDEO1; menusub = 0; } else if (left) { menustate = MENU_SETTINGS_MEMORY1; menusub = 0; } break; */ /******************************************************************/ /* hardfile settings menu */ /******************************************************************/ // FIXME! Nasty race condition here. Changing HDF type has immediate effect // which could be disastrous if the user's writing to the drive at the time! // Make the menu work on the copy, not the original, and copy on acceptance, // not on rejection. case MENU_SETTINGS_HARDFILE1 : helptext=helptexts[HELPTEXT_HARDFILE]; OsdSetTitle("Harddisks",0); parentstate = menustate; menumask=0x21; // b00100001 - On/off & exit enabled by default... if(config.enable_ide) menumask|=0x0a; // b00001010 - HD0 and HD1 type strcpy(s, " A600 IDE : "); strcat(s, config.enable_ide ? "on " : "off"); OsdWrite(0, s, menusub == 0,0); OsdWrite(1, "", 0,0); strcpy(s, " Master : "); if(config.hardfile[0].enabled==(HDF_FILE|HDF_SYNTHRDB)) strcat(s,"Hardfile (filesys)"); else strcat(s, config_hdf_msg[config.hardfile[0].enabled & HDF_TYPEMASK]); OsdWrite(2, s, config.enable_ide ? (menusub == 1) : 0 ,config.enable_ide==0); if (config.hardfile[0].present) { strcpy(s, " "); if (config.hardfile[0].long_name[0]) strncpy(&s[14], config.hardfile[0].long_name, sizeof(config.hardfile[0].long_name)); else strncpy(&s[14], config.hardfile[0].name, sizeof(config.hardfile[0].name)); } else strcpy(s, " ** file not found **"); enable=config.enable_ide && ((config.hardfile[0].enabled&HDF_TYPEMASK)==HDF_FILE); if(enable) menumask|=0x04; // Make hardfile selectable OsdWrite(3, s, enable ? (menusub == 2) : 0 , enable==0); strcpy(s, " Slave : "); if(config.hardfile[1].enabled==(HDF_FILE|HDF_SYNTHRDB)) strcat(s,"Hardfile (filesys)"); else strcat(s, config_hdf_msg[config.hardfile[1].enabled & HDF_TYPEMASK]); OsdWrite(4, s, config.enable_ide ? (menusub == 3) : 0 ,config.enable_ide==0); if (config.hardfile[1].present) { strcpy(s, " "); if (config.hardfile[1].long_name[0]) strncpy(&s[14], config.hardfile[1].long_name, sizeof(config.hardfile[0].long_name)); else strncpy(&s[14], config.hardfile[1].name, sizeof(config.hardfile[0].name)); } else strcpy(s, " ** file not found **"); enable=config.enable_ide && ((config.hardfile[1].enabled&HDF_TYPEMASK)==HDF_FILE); if(enable) menumask|=0x10; // Make hardfile selectable OsdWrite(5, s, enable ? (menusub == 4) : 0 ,enable==0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 5,0); menustate = MENU_SETTINGS_HARDFILE2; break; case MENU_SETTINGS_HARDFILE2 : if (select) { if (menusub == 0) { config.enable_ide=(config.enable_ide==0); menustate = MENU_SETTINGS_HARDFILE1; } if (menusub == 1) { if(config.hardfile[0].enabled==HDF_FILE) { config.hardfile[0].enabled|=HDF_SYNTHRDB; } else if(config.hardfile[0].enabled==(HDF_FILE|HDF_SYNTHRDB)) { config.hardfile[0].enabled&=~HDF_SYNTHRDB; config.hardfile[0].enabled +=1; } else { config.hardfile[0].enabled +=1; config.hardfile[0].enabled %=HDF_CARDPART0+partitioncount; } menustate = MENU_SETTINGS_HARDFILE1; } else if (menusub == 2) { SelectFile("HDF", SCAN_LFN, MENU_HARDFILE_SELECTED, MENU_SETTINGS_HARDFILE1); } else if (menusub == 3) { if(config.hardfile[1].enabled==HDF_FILE) { config.hardfile[1].enabled|=HDF_SYNTHRDB; } else if(config.hardfile[1].enabled==(HDF_FILE|HDF_SYNTHRDB)) { config.hardfile[1].enabled&=~HDF_SYNTHRDB; config.hardfile[1].enabled +=1; } else { config.hardfile[1].enabled +=1; config.hardfile[1].enabled %=HDF_CARDPART0+partitioncount; } menustate = MENU_SETTINGS_HARDFILE1; } else if (menusub == 4) { SelectFile("HDF", SCAN_LFN, MENU_HARDFILE_SELECTED, MENU_SETTINGS_HARDFILE1); } else if (menusub == 5) // return to previous menu { menustate = MENU_HARDFILE_EXIT; } } if (menu) // return to previous menu { menustate = MENU_HARDFILE_EXIT; } break; /******************************************************************/ /* hardfile selected menu */ /******************************************************************/ case MENU_HARDFILE_SELECTED : if (menusub == 2) // master drive selected { // Read RDB from selected drive and determine type... memcpy((void*)config.hardfile[0].name, (void*)file.name, sizeof(config.hardfile[0].name)); memcpy((void*)config.hardfile[0].long_name, (void*)file.long_name, sizeof(config.hardfile[0].long_name)); switch(GetHDFFileType(file.name)) { case HDF_FILETYPE_RDB: config.hardfile[0].enabled=HDF_FILE; config.hardfile[0].present = 1; menustate = MENU_SETTINGS_HARDFILE1; break; case HDF_FILETYPE_DOS: config.hardfile[0].enabled=HDF_FILE|HDF_SYNTHRDB; config.hardfile[0].present = 1; menustate = MENU_SETTINGS_HARDFILE1; break; case HDF_FILETYPE_UNKNOWN: config.hardfile[0].present = 1; if(config.hardfile[0].enabled==HDF_FILE) // Warn if we can't detect the type menustate=MENU_SYNTHRDB1; else menustate=MENU_SYNTHRDB2_1; menusub=0; break; case HDF_FILETYPE_NOTFOUND: default: config.hardfile[0].present = 0; menustate = MENU_SETTINGS_HARDFILE1; break; } } if (menusub == 4) // slave drive selected { memcpy((void*)config.hardfile[1].name, (void*)file.name, sizeof(config.hardfile[1].name)); memcpy((void*)config.hardfile[1].long_name, (void*)file.long_name, sizeof(config.hardfile[1].long_name)); switch(GetHDFFileType(file.name)) { case HDF_FILETYPE_RDB: config.hardfile[1].enabled=HDF_FILE; config.hardfile[1].present = 1; menustate = MENU_SETTINGS_HARDFILE1; break; case HDF_FILETYPE_DOS: config.hardfile[1].enabled=HDF_FILE|HDF_SYNTHRDB; config.hardfile[1].present = 1; menustate = MENU_SETTINGS_HARDFILE1; break; case HDF_FILETYPE_UNKNOWN: config.hardfile[1].present = 1; if(config.hardfile[1].enabled==HDF_FILE) // Warn if we can't detect the type... menustate=MENU_SYNTHRDB1; else menustate=MENU_SYNTHRDB2_1; menusub=0; break; case HDF_FILETYPE_NOTFOUND: default: config.hardfile[1].present = 0; menustate = MENU_SETTINGS_HARDFILE1; break; } } break; // check if hardfile configuration has changed case MENU_HARDFILE_EXIT : if (memcmp(config.hardfile, t_hardfile, sizeof(t_hardfile)) != 0) { menustate = MENU_HARDFILE_CHANGED1; menusub = 1; } else { menustate = MENU_MAIN1; menusub = 5; } break; // hardfile configuration has changed, ask user if he wants to use the new settings case MENU_HARDFILE_CHANGED1 : menumask=0x03; parentstate=menustate; OsdSetTitle("Confirm",0); OsdWrite(0, "", 0,0); OsdWrite(1, " Changing configuration", 0,0); OsdWrite(2, " requires reset.", 0,0); OsdWrite(3, "", 0,0); OsdWrite(4, " Reset Minimig?", 0,0); OsdWrite(5, "", 0,0); OsdWrite(6, " yes", menusub == 0,0); OsdWrite(7, " no", menusub == 1,0); menustate = MENU_HARDFILE_CHANGED2; break; case MENU_HARDFILE_CHANGED2 : if (select) { if (menusub == 0) // yes { // FIXME - waiting for user-confirmation increases the window of opportunity for file corruption! if ((config.hardfile[0].enabled != t_hardfile[0].enabled) || (strncmp(config.hardfile[0].name, t_hardfile[0].name, sizeof(t_hardfile[0].name)) != 0)) { OpenHardfile(0); // if((config.hardfile[0].enabled == HDF_FILE) && !FindRDB(0)) // menustate = MENU_SYNTHRDB1; } if (config.hardfile[1].enabled != t_hardfile[1].enabled || (strncmp(config.hardfile[1].name, t_hardfile[1].name, sizeof(t_hardfile[1].name)) != 0)) { OpenHardfile(1); // if((config.hardfile[1].enabled == HDF_FILE) && !FindRDB(1)) // menustate = MENU_SYNTHRDB2_1; } if(menustate==MENU_HARDFILE_CHANGED2) { ConfigIDE(config.enable_ide, config.hardfile[0].present && config.hardfile[0].enabled, config.hardfile[1].present && config.hardfile[1].enabled); OsdReset(RESET_NORMAL); menustate = MENU_NONE1; } } else if (menusub == 1) // no { memcpy(config.hardfile, t_hardfile, sizeof(t_hardfile)); // restore configuration menustate = MENU_MAIN1; menusub = 3; } } if (menu) { memcpy(config.hardfile, t_hardfile, sizeof(t_hardfile)); // restore configuration menustate = MENU_MAIN1; menusub = 3; } break; case MENU_SYNTHRDB1 : menumask=0x01; parentstate=menustate; OsdSetTitle("Warning",0); OsdWrite(0, "", 0,0); OsdWrite(1, " No partition table found -", 0,0); OsdWrite(2, " Hardfile image may need", 0,0); OsdWrite(3, " to be prepped with HDToolbox,", 0,0); OsdWrite(4, " then formatted.", 0,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, " OK", menusub == 0,0); menustate = MENU_SYNTHRDB2; break; case MENU_SYNTHRDB2_1 : menumask=0x01; parentstate=menustate; OsdSetTitle("Warning",0); OsdWrite(0, "", 0,0); OsdWrite(1, " No filesystem recognised.", 0,0); OsdWrite(2, " Hardfile may need formatting", 0,0); OsdWrite(3, " (or may simply be an", 0,0); OsdWrite(4, " unrecognised filesystem)", 0,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, " OK", menusub == 0,0); menustate = MENU_SYNTHRDB2; break; case MENU_SYNTHRDB2 : if (select || menu) { if (menusub == 0) // OK menustate = MENU_SETTINGS_HARDFILE1; } break; /******************************************************************/ /* video settings menu */ /******************************************************************/ case MENU_SETTINGS_VIDEO1 : menumask=0x0f; parentstate=menustate; helptext=helptexts[HELPTEXT_VIDEO]; OsdSetTitle("Video",OSD_ARROW_LEFT|OSD_ARROW_RIGHT); OsdWrite(0, "", 0,0); strcpy(s, " Lores Filter : "); strcat(s, config_filter_msg[config.filter.lores & 0x03]); OsdWrite(1, s, menusub == 0,0); strcpy(s, " Hires Filter : "); strcat(s, config_filter_msg[config.filter.hires & 0x03]); OsdWrite(2, s, menusub == 1,0); strcpy(s, " Scanlines : "); strcat(s, config_scanlines_msg[config.scanlines % 3]); OsdWrite(3, s, menusub == 2,0); OsdWrite(4, "", 0,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, STD_EXIT, menusub == 3,0); menustate = MENU_SETTINGS_VIDEO2; break; case MENU_SETTINGS_VIDEO2 : if (select) { if (menusub == 0) { config.filter.lores++; config.filter.lores &= 0x03; menustate = MENU_SETTINGS_VIDEO1; //ConfigFilter(config.filter.lores, config.filter.hires); ConfigVideo(config.filter.hires, config.filter.lores, config.scanlines); } else if (menusub == 1) { config.filter.hires++; config.filter.hires &= 0x03; menustate = MENU_SETTINGS_VIDEO1; //ConfigFilter(config.filter.lores, config.filter.hires); ConfigVideo(config.filter.hires, config.filter.lores, config.scanlines); } else if (menusub == 2) { config.scanlines++; if (config.scanlines > 2) config.scanlines = 0; menustate = MENU_SETTINGS_VIDEO1; //ConfigScanlines(config.scanlines); ConfigVideo(config.filter.hires, config.filter.lores, config.scanlines); } else if (menusub == 3) { menustate = MENU_MAIN2_1; menusub = 4; } } if (menu) { menustate = MENU_MAIN2_1; menusub = 4; } else if (right) { menustate = MENU_SETTINGS_CHIPSET1; menusub = 0; } else if (left) { menustate = MENU_SETTINGS_MEMORY1; menusub = 0; } break; /******************************************************************/ /* rom file selected menu */ /******************************************************************/ case MENU_ROMFILE_SELECTED : menusub = 1; menustate=MENU_ROMFILE_SELECTED1; // no break intended case MENU_ROMFILE_SELECTED1 : menumask=0x03; parentstate=menustate; OsdSetTitle("Confirm",0); OsdWrite(0, "", 0,0); OsdWrite(1, " Reload Kickstart?", 0,0); OsdWrite(2, "", 0,0); OsdWrite(3, " yes", menusub == 0,0); OsdWrite(4, " no", menusub == 1,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, "", 0,0); menustate = MENU_ROMFILE_SELECTED2; break; case MENU_ROMFILE_SELECTED2 : if (select) { if (menusub == 0) { memcpy((void*)config.kickstart.name, (void*)file.name, sizeof(config.kickstart.name)); memcpy((void*)config.kickstart.long_name, (void*)file.long_name, sizeof(config.kickstart.long_name)); OsdDisable(); //OsdReset(RESET_BOOTLOADER); //ConfigChipset(config.chipset | CONFIG_TURBO); //ConfigFloppy(config.floppy.drives, CONFIG_FLOPPY2X); EnableOsd(); SPI(OSD_CMD_RST); rstval = (SPI_RST_CPU | SPI_CPU_HLT); SPI(rstval); DisableOsd(); SPIN(); SPIN(); SPIN(); SPIN(); UploadKickstart(config.kickstart.name); EnableOsd(); SPI(OSD_CMD_RST); rstval = (SPI_RST_USR | SPI_RST_CPU); SPI(rstval); DisableOsd(); SPIN(); SPIN(); SPIN(); SPIN(); EnableOsd(); SPI(OSD_CMD_RST); rstval = 0; SPI(rstval); DisableOsd(); SPIN(); SPIN(); SPIN(); SPIN(); //ConfigChipset(config.chipset); // restore CPU speed mode //ConfigFloppy(config.floppy.drives, config.floppy.speed); // restore floppy speed mode menustate = MENU_NONE1; } else if (menusub == 1) { menustate = MENU_SETTINGS_MEMORY1; menusub = 2; } } if (menu) { menustate = MENU_SETTINGS_MEMORY1; menusub = 2; } break; // /******************************************************************/ // /* firmware menu */ // /******************************************************************/ // case MENU_FIRMWARE1 : // // OsdWrite(0, " *** Firmware ***", 0); // OsdWrite(1, "", 0); // sprintf(s, " ARM s/w ver. %s", version + 5); // OsdWrite(2, s, 0); // OsdWrite(3, "", 0); // OsdWrite(4, " update", menusub == 0); // OsdWrite(5, " options", menusub == 1); // OsdWrite(6, "", 0); // OsdWrite(7, " exit", menusub == 2); // // menustate = MENU_FIRMWARE2; // break; // // case MENU_FIRMWARE2 : // // if (menu) // { // menusub = 2; // menustate = MENU_MAIN2_1; // } // else if (up) // { // if (menusub > 0) // menusub--; // menustate = MENU_FIRMWARE1; // } // else if (down) // { // if (menusub < 2) // menusub++; // menustate = MENU_FIRMWARE1; // } // else if (select) // { // if (menusub == 0) // { //// if (CheckFirmware(&file, "FIRMWAREUPG")) //// menustate = MENU_FIRMWARE_UPDATE1; //// else // menustate = MENU_FIRMWARE_UPDATE_ERROR1; // menusub = 1; // OsdClear(); // } // else if (menusub == 1) // { // menustate = MENU_FIRMWARE_OPTIONS1; // menusub = 1; // OsdClear(); // } // else if (menusub == 2) // { // menustate = MENU_MAIN2_1; // menusub = 2; // } // } // break; // // /******************************************************************/ // /* firmware update message menu */ // /******************************************************************/ // case MENU_FIRMWARE_UPDATE1 : // // OsdWrite(2, " Are you sure?", 0); // // OsdWrite(6, " yes", menusub == 0); // OsdWrite(7, " no", menusub == 1); // // menustate = MENU_FIRMWARE_UPDATE2; // break; // // case MENU_FIRMWARE_UPDATE2 : // // if (down && menusub < 1) // { // menusub++; // menustate = MENU_FIRMWARE_UPDATE1; // } // // if (up && menusub > 0) // { // menusub--; // menustate = MENU_FIRMWARE_UPDATE1; // } // // if (select) // { // if (menusub == 0) // { // menustate = MENU_FIRMWARE_UPDATING1; // menusub = 0; // OsdClear(); // } // else if (menusub == 1) // { // menustate = MENU_FIRMWARE1; // menusub = 2; // } // } // break; // // /******************************************************************/ // /* firmware update in progress message menu*/ // /******************************************************************/ // case MENU_FIRMWARE_UPDATING1 : // // OsdWrite(1, " Updating firmware", 0); // OsdWrite(3, " Please wait", 0); // menustate = MENU_FIRMWARE_UPDATING2; // break; // // case MENU_FIRMWARE_UPDATING2 : // //// WriteFirmware(&file); // Error = ERROR_UPDATE_FAILED; // menustate = MENU_FIRMWARE_UPDATE_ERROR1; // menusub = 0; // OsdClear(); // break; // // /******************************************************************/ // /* firmware update error message menu*/ // /******************************************************************/ // case MENU_FIRMWARE_UPDATE_ERROR1 : // // switch (Error) // { // case ERROR_FILE_NOT_FOUND : // OsdWrite(1, " Update file", 0); // OsdWrite(2, " not found!", 0); // break; // case ERROR_INVALID_DATA : // OsdWrite(1, " Invalid ", 0); // OsdWrite(2, " update file!", 0); // break; // case ERROR_UPDATE_FAILED : // OsdWrite(2, " Update failed!", 0); // break; // } // OsdWrite(7, " OK", 1); // menustate = MENU_FIRMWARE_UPDATE_ERROR2; // break; // // case MENU_FIRMWARE_UPDATE_ERROR2 : // // if (select) // { // menustate = MENU_FIRMWARE1; // menusub = 2; // } // break; // // /******************************************************************/ // /* firmware options menu */ // /******************************************************************/ // case MENU_FIRMWARE_OPTIONS1 : // // OsdWrite(0, " ** Options **", 0); // //// if (GetSPIMode() == SPIMODE_FAST) //// OsdWrite(2, " Fast SPI enabled", menusub == 0); //// else // OsdWrite(2, " Enable Fast SPI ", menusub == 0); // // OsdWrite(7, " exit", menusub == 1); // // menustate = MENU_FIRMWARE_OPTIONS2; // break; // // case MENU_FIRMWARE_OPTIONS2 : // // if (c == KEY_F8) // { // if (DEBUG) // { // DEBUG = 0; // printf("DEBUG OFF\r"); // } // else // { // DEBUG = 1; // printf("DEBUG ON\r"); // } // } // else if (menu) // { // menusub = 1; // menustate = MENU_FIRMWARE1; // } // else if (up) // { //// if (menusub > 0 && GetSPIMode() != SPIMODE_FAST) // menusub--; // // menustate = MENU_FIRMWARE_OPTIONS1; // } // else if (down) // { // if (menusub < 1) // menusub++; // menustate = MENU_FIRMWARE_OPTIONS1; // } // else if (select) // { // if (menusub == 0) // { // menusub = 1; // menustate = MENU_FIRMWARE_OPTIONS_ENABLE1; // OsdClear(); // } // else if (menusub == 1) // { // menusub = 1; // menustate = MENU_FIRMWARE1; // } // } // break; // // /******************************************************************/ // /* SPI high speed mode enable message menu*/ // /******************************************************************/ // case MENU_FIRMWARE_OPTIONS_ENABLE1 : // // OsdWrite(0, " Enabling fast SPI without", 0); // OsdWrite(1, " hardware modification", 0); // OsdWrite(2, " will be fatal!", 0); // OsdWrite(4, " Enable?", 0); // OsdWrite(6, " yes", menusub == 0); // OsdWrite(7, " no", menusub == 1); // // menustate = MENU_FIRMWARE_OPTIONS_ENABLE2; // break; // // case MENU_FIRMWARE_OPTIONS_ENABLE2 : // // if (down && menusub < 1) // { // menusub++; // menustate = MENU_FIRMWARE_OPTIONS_ENABLE1; // } // // if (up && menusub > 0) // { // menusub--; // menustate = MENU_FIRMWARE_OPTIONS_ENABLE1; // } // // if (select) // { // if (menusub == 0) // { //// SetSPIMode(SPIMODE_FAST); // menustate = MENU_FIRMWARE_OPTIONS_ENABLED1; // menusub = 0; // OsdClear(); // } // else if (menusub == 1) // { // menustate = MENU_FIRMWARE_OPTIONS1; // menusub = 0; // OsdClear(); // } // } // break; // // /******************************************************************/ // /* SPI high speed mode enabled message menu*/ // /******************************************************************/ // case MENU_FIRMWARE_OPTIONS_ENABLED1 : // // OsdWrite(1, " Fast SPI mode will be", 0); // OsdWrite(2, " activated after restart.", 0); // OsdWrite(3, " Hold MENU button while", 0); // OsdWrite(4, " powering-on to disable it.", 0); // // OsdWrite(7, " OK", menusub == 0); // // menustate = MENU_FIRMWARE_OPTIONS_ENABLED2; // break; // // case MENU_FIRMWARE_OPTIONS_ENABLED2 : // // if (select) // { // menustate = MENU_NONE1; // menusub = 0; // OsdClear(); // } // break; /******************************************************************/ /* error message menu */ /******************************************************************/ case MENU_ERROR : if (menu) menustate = MENU_MAIN1; break; /******************************************************************/ /* popup info menu */ /******************************************************************/ case MENU_INFO : if (menu) menustate = MENU_MAIN1; else if (CheckTimer(menu_timer)) menustate = MENU_NONE1; break; /******************************************************************/ /* we should never come here */ /******************************************************************/ default : break; } DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L2); } void ScrollLongName(void) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L2); // this function is called periodically when file selection window is displayed // it checks if predefined period of time has elapsed and scrolls the name if necessary char k = sort_table[iSelectedEntry]; static int len; int max_len; if (DirEntryLFN[k][0]) // && CheckTimer(scroll_timer)) // scroll if long name and timer delay elapsed { // FIXME - yuk, we don't want to do this every frame! len = strlen(DirEntryLFN[k]); // get name length if (len > 4) if (DirEntryLFN[k][len - 4] == '.') len -= 4; // remove extension max_len = 30; // number of file name characters to display (one more required for scrolling) if (DirEntry[k].Attributes & ATTR_DIRECTORY) max_len = 25; // number of directory name characters to display ScrollText(iSelectedEntry,DirEntryLFN[k],len,max_len,1); } DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L2); } char* GetDiskInfo(char* lfn, long len) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L1); // extracts disk number substring form file name // if file name contains "X of Y" substring where X and Y are one or two digit number // then the number substrings are extracted and put into the temporary buffer for further processing // comparision is case sensitive short i, k; static char info[] = "XX/XX"; // temporary buffer static char template[4] = " of "; // template substring to search for char *ptr1, *ptr2, c; unsigned char cmp; if (len > 20) // scan only names which can't be fully displayed { for (i = (unsigned short)len - 1 - sizeof(template); i > 0; i--) // scan through the file name starting from its end { ptr1 = &lfn[i]; // current start position ptr2 = template; cmp = 0; for (k = 0; (unsigned int)k < sizeof(template); k++) // scan through template { cmp |= *ptr1++ ^ *ptr2++; // compare substrings' characters one by one if (cmp) break; // stop further comparing if difference already found } if (!cmp) // match found { k = i - 1; // no need to check if k is valid since i is greater than zero c = lfn[k]; // get the first character to the left of the matched template substring if (c >= '0' && c <= '9') // check if a digit { info[1] = c; // copy to buffer info[0] = ' '; // clear previous character k--; // go to the preceding character if (k >= 0) // check if index is valid { c = lfn[k]; if (c >= '0' && c <= '9') // check if a digit info[0] = c; // copy to buffer } k = i + sizeof(template); // get first character to the right of the mached template substring c = lfn[k]; // no need to check if index is valid if (c >= '0' && c <= '9') // check if a digit { info[3] = c; // copy to buffer info[4] = ' '; // clear next char k++; // go to the followwing character if (k < len) // check if index is valid { c = lfn[k]; if (c >= '0' && c <= '9') // check if a digit info[4] = c; // copy to buffer } return info; } } } } } return NULL; DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L1); } // print directory contents void PrintDirectory(void) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L1); unsigned char i; unsigned char k; unsigned long len; char *lfn; char *info; char *p; unsigned char j; s[32] = 0; // set temporary string length to OSD line length ScrollReset(); for (i = 0; i < 8; i++) { memset(s, ' ', 32); // clear line buffer if (i < nDirEntries) { k = sort_table[i]; // ordered index in storage buffer lfn = DirEntryLFN[k]; // long file name pointer DirEntryInfo[i][0] = 0; // clear disk number info buffer if (lfn[0]) // item has long name { len = strlen(lfn); // get name length info = NULL; // no disk info if (!(DirEntry[k].Attributes & ATTR_DIRECTORY)) // if a file { if (len > 4) if (lfn[len-4] == '.') len -= 4; // remove extension info = GetDiskInfo(lfn, len); // extract disk number info if (info != NULL) memcpy(DirEntryInfo[i], info, 5); // copy disk number info if present } if (len > 30) len = 30; // trim display length if longer than 30 characters if (i != iSelectedEntry && info != NULL) { // display disk number info for not selected items strncpy(s + 1, lfn, 30-6); // trimmed name strncpy(s + 1+30-5, info, 5); // disk number } else strncpy(s + 1, lfn, len); // display only name } else // no LFN { strncpy(s + 1, (const char*)DirEntry[k].Name, 8); // if no LFN then display base name (8 chars) if (DirEntry[k].Attributes & ATTR_DIRECTORY && DirEntry[k].Extension[0] != ' ') { p = (char*)&DirEntry[k].Name[7]; j = 8; do { if (*p-- != ' ') break; } while (--j); s[1 + j++] = '.'; strncpy(s + 1 + j, (const char*)DirEntry[k].Extension, 3); // if no LFN then display base name (8 chars) } } if (DirEntry[k].Attributes & ATTR_DIRECTORY) // mark directory with suffix strcpy(&s[22], " <DIR>"); } else { if (i == 0 && nDirEntries == 0) // selected directory is empty strcpy(s, " No files!"); } OsdWrite(i, s, i == iSelectedEntry,0); // display formatted line text } DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L1); } void _strncpy(char* pStr1, const char* pStr2, size_t nCount) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L2); // customized strncpy() function to fill remaing destination string part with spaces while (*pStr2 && nCount) { *pStr1++ = *pStr2++; // copy strings nCount--; } while (nCount--) *pStr1++ = ' '; // fill remaining space with spaces DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L2); } // insert floppy image pointed to to by global <file> into <drive> void InsertFloppy(adfTYPE *drive) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L1); unsigned char i, j; unsigned long tracks; // calculate number of tracks in the ADF image file tracks = file.size / (512*11); if (tracks > MAX_TRACKS) { printf("UNSUPPORTED ADF SIZE!!! Too many tracks: %lu\r", tracks); tracks = MAX_TRACKS; } drive->tracks = (unsigned char)tracks; // fill index cache for (i = 0; i < tracks; i++) // for every track get its start position within image file { drive->cache[i] = file.cluster; // start of the track within image file for (j = 0; j < 11; j++) FileNextSector(&file); // advance by track length (11 sectors) } // copy image file name into drive struct if (file.long_name[0]) // file has long name _strncpy(drive->name, file.long_name, sizeof(drive->name)); // copy long name else { strncpy(drive->name, file.name, 8); // copy base name memset(&drive->name[8], ' ', sizeof(drive->name) - 8); // fill the rest of the name with spaces } if (DiskInfo[0]) // if selected file has valid disk number info then copy it to its name in drive struct { drive->name[16] = ' '; // precede disk number info with space character strncpy(&drive->name[17], DiskInfo, sizeof(DiskInfo)); // copy disk number info } // initialize the rest of drive struct drive->status = DSK_INSERTED; if (!(file.attributes & ATTR_READONLY)) // read-only attribute drive->status |= DSK_WRITABLE; drive->cluster_offset = drive->cache[0]; drive->sector_offset = 0; drive->track = 0; drive->track_prev = -1; // some debug info if (file.long_name[0]) printf("Inserting floppy: \"%s\"\r", file.long_name); else printf("Inserting floppy: \"%.11s\"\r", file.name); printf("file attributes: 0x%02X\r", file.attributes); printf("file size: %lu (%lu KB)\r", file.size, file.size >> 10); printf("drive tracks: %u\r", drive->tracks); printf("drive status: 0x%02X\r", drive->status); DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L1); } /* Error Message */ void ErrorMessage(const char *message, unsigned char code) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L1); if (menustate == MENU_NONE2) menustate = MENU_ERROR; if (menustate == MENU_ERROR) { // OsdClear(); OsdSetTitle("Error",0); OsdWrite(0, " *** ERROR ***", 1,0); OsdWrite(1, "", 0,0); strncpy(s, message, 32); s[32] = 0; OsdWrite(2, s, 0,0); s[0] = 0; if (code) sprintf(s, " #%d", code); OsdWrite(3, "", 0,0); OsdWrite(4, s, 0,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, "", 0,0); OsdEnable(0); // do not disable KEYBOARD } DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L1); } void InfoMessage(char *message) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L1); OsdWaitVBL(); if (menustate != MENU_INFO) { // OsdClear(); OsdSetTitle("Message",0); OsdEnable(0); // do not disable keyboard } OsdWrite(0, "", 0,0); OsdWrite(1, message, 0,0); OsdWrite(2, "", 0,0); OsdWrite(3, "", 0,0); OsdWrite(4, "", 0,0); OsdWrite(5, "", 0,0); OsdWrite(6, "", 0,0); OsdWrite(7, "", 0,0); menu_timer = GetTimer(1000); menustate = MENU_INFO; DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L1); } void DebugMessage(char *message) { DEBUG_FUNC_IN(DEBUG_F_MENU | DEBUG_L1); strncpy(&debuglines[debugptr*32],message,31); debuglines[debugptr*32+31]=0; debugptr=(debugptr+1)&7; DEBUG_FUNC_OUT(DEBUG_F_MENU | DEBUG_L1); }
rkrajnc/minimig-mist
fw/ctrl/menu.c
C
gpl-3.0
80,458
[ 30522, 1013, 1008, 9385, 2384, 1010, 2294, 1010, 2289, 6877, 3158, 16776, 7389, 9385, 2263, 1010, 2268, 14855, 5283, 2497, 2793, 11802, 5488, 2023, 5371, 2003, 2112, 1997, 7163, 4328, 2290, 7163, 4328, 2290, 2003, 2489, 4007, 1025, 2017, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.codeInsight.actions; import com.intellij.lang.LanguageFormatting; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NonNls; public class ShowReformatFileDialog extends AnAction implements DumbAware { private static final @NonNls String HELP_ID = "editing.codeReformatting"; @Override public void update(AnActionEvent event) { Presentation presentation = event.getPresentation(); DataContext dataContext = event.getDataContext(); Project project = dataContext.getData(CommonDataKeys.PROJECT); Editor editor = dataContext.getData(CommonDataKeys.EDITOR); if (project == null || editor == null) { presentation.setEnabled(false); return; } PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (file == null || file.getVirtualFile() == null) { presentation.setEnabled(false); return; } if (LanguageFormatting.INSTANCE.forContext(file) != null) { presentation.setEnabled(true); } } @Override public void actionPerformed(AnActionEvent event) { Presentation presentation = event.getPresentation(); DataContext dataContext = event.getDataContext(); Project project = dataContext.getData(CommonDataKeys.PROJECT); Editor editor = dataContext.getData(CommonDataKeys.EDITOR); if (project == null || editor == null) { presentation.setEnabled(false); return; } PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (file == null || file.getVirtualFile() == null) { presentation.setEnabled(false); return; } boolean hasSelection = editor.getSelectionModel().hasSelection(); LayoutCodeDialog dialog = new LayoutCodeDialog(project, file, hasSelection, HELP_ID); dialog.show(); if (dialog.isOK()) { new FileInEditorProcessor(file, editor, dialog.getRunOptions()).processCode(); } } }
consulo/consulo
modules/base/lang-impl/src/main/java/com/intellij/codeInsight/actions/ShowReformatFileDialog.java
Java
apache-2.0
2,785
[ 30522, 1013, 1008, 1008, 9385, 2456, 1011, 2297, 6892, 10024, 7076, 1055, 1012, 1054, 1012, 1051, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2013 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package com.google.api.client.googleapis.testing.json; import com.google.api.client.googleapis.json.GoogleJsonResponseException; import com.google.api.client.http.HttpRequest; import com.google.api.client.http.HttpResponse; import com.google.api.client.json.Json; import com.google.api.client.json.JsonFactory; import com.google.api.client.testing.http.HttpTesting; import com.google.api.client.testing.http.MockHttpTransport; import com.google.api.client.testing.http.MockLowLevelHttpResponse; import com.google.api.client.util.Beta; import java.io.IOException; /** * {@link Beta} <br> * Factory class that builds {@link GoogleJsonResponseException} instances for testing. * * @since 1.18 */ @Beta public final class GoogleJsonResponseExceptionFactoryTesting { /** * Convenience factory method that builds a {@link GoogleJsonResponseException} from its * arguments. The method builds a dummy {@link HttpRequest} and {@link HttpResponse}, sets the * response's status to a user-specified HTTP error code, suppresses exceptions, and executes the * request. This forces the underlying framework to create, but not throw, a {@link * GoogleJsonResponseException}, which the method retrieves and returns to the invoker. * * @param jsonFactory the JSON factory that will create all JSON required by the underlying * framework * @param httpCode the desired HTTP error code. Note: do nut specify any codes that indicate * successful completion, e.g. 2XX. * @param reasonPhrase the HTTP reason code that explains the error. For example, if {@code * httpCode} is {@code 404}, the reason phrase should be {@code NOT FOUND}. * @return the generated {@link GoogleJsonResponseException}, as specified. * @throws IOException if request transport fails. */ public static GoogleJsonResponseException newMock( JsonFactory jsonFactory, int httpCode, String reasonPhrase) throws IOException { MockLowLevelHttpResponse otherServiceUnavaiableLowLevelResponse = new MockLowLevelHttpResponse() .setStatusCode(httpCode) .setReasonPhrase(reasonPhrase) .setContentType(Json.MEDIA_TYPE) .setContent( "{ \"error\": { \"errors\": [ { \"reason\": \"" + reasonPhrase + "\" } ], " + "\"code\": " + httpCode + " } }"); MockHttpTransport otherTransport = new MockHttpTransport.Builder() .setLowLevelHttpResponse(otherServiceUnavaiableLowLevelResponse) .build(); HttpRequest otherRequest = otherTransport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); otherRequest.setThrowExceptionOnExecuteError(false); HttpResponse otherServiceUnavailableResponse = otherRequest.execute(); return GoogleJsonResponseException.from(jsonFactory, otherServiceUnavailableResponse); } }
googleapis/google-api-java-client
google-api-client/src/main/java/com/google/api/client/googleapis/testing/json/GoogleJsonResponseExceptionFactoryTesting.java
Java
apache-2.0
3,555
[ 30522, 1013, 1008, 1008, 9385, 2286, 8224, 4297, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1008, 1999, 12646, 2007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using NSubstitute; using Project.UnitOfWorkProject.Entities; using Project.UnitOfWorkProject.Services; using System; using System.Threading.Tasks; namespace Project.TestingProject.RepositoriesTests.UsuarioServiceTests { [TestClass] public class AddAsyncShould : UsuarioServiceTestsBase { #region - TESTS - // Deve retornar o Id do usuário quando criado corretamente no banco de dados [TestMethod, TestProperty("Usuário", "Service")] public async Task ReturnIdWhenUserCreatedCorrectlyOnDatabase() { // Arrange & Act UnitOfWorkContextAware.CommitAsync().Returns(1); var result = await AddAsync(new Usuario()); // Assert result.Should().NotBeNull(); } // Deve retornar um erro quando um valor nulo for passado [TestMethod, TestProperty("Usuário", "Service")] public void ReturnErrorWhenNullDataHasPassed() { // Arrange & Act Func<Task> act = async () => await AddAsync(null); act.ShouldThrow<ArgumentNullException>(); } // Deve retornar um erro quando o banco de dados retorna um erro ao criar um usuário [TestMethod, TestProperty("Usuário", "Service")] public async Task ReturnErrorWhenDatabaseReturnErrorOnCreateAUser() { // Arrange & Act UnitOfWorkContextAware.When(x => x.CommitAsync()).Throw<Exception>(); try { await AddAsync(Arg.Any<Usuario>()); } catch (Exception ex) { // Assert ex.Message.Should().NotBeNullOrWhiteSpace(); } } #endregion #region - SECONDARY METHODS - private async Task<int?> AddAsync(Usuario usuario) { var service = new UsuarioService(UnitOfWorkContextAwareFactory); return await service.AddAsync(usuario); } #endregion } }
TaigoSantos/Visual-Studio-Architecture
provas-de-conceitos/unit-tests/Project.TestingProject/ServicesTests/UsuarioServiceTests/AddAsyncShould.cs
C#
apache-2.0
2,108
[ 30522, 2478, 19376, 27241, 28228, 5644, 1025, 2478, 7513, 1012, 26749, 8525, 20617, 1012, 3231, 3406, 27896, 1012, 3131, 22199, 2075, 1025, 2478, 24978, 12083, 16643, 24518, 1025, 2478, 2622, 1012, 3131, 11253, 6198, 21572, 20614, 1012, 11422...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Demo CSS to use as a basis for the CMS tool. Adjust as needed for your site */ .borderless { border:0; padding:0 0.5em 0 0 } .hidden { display:none } object[type="image/svg+xml"] { overflow:hidden } div.admonition,div.attention,div.caution,div.danger,div.error,div.hint,div.important,div.note,div.tip,div.warning,div.sidebar { margin-bottom:20px; background-color:#fff; border:1px solid #ddd; border-radius:4px; -webkit-box-shadow:0 1px 1px rgba(0, 0, 0, .05); box-shadow:0 1px 1px rgba(0, 0, 0, .05); padding:0 15px 15px 15px } div.attention,div.caution,div.danger,div.error,div.warning { border-color:#EBCCD1 } { font-size:16px; color:#333; background-color:#F5F5F5; padding:10px 15px; margin-left:-15px; margin-right:-15px; border-bottom:1px solid rgba(0, 0, 0, 0); border-top-left-radius:3px; border-top-right-radius:3px; color:#333; background-color:#F5F5F5; border-color:#DDD } div.dedication { margin:2em 5em; text-align:center; font-style:italic } div.dedication p.topic-title { font-weight:bold; font-style:normal } div.footer,div.header { clear:both; font-size:smaller } div.line-block { display:block; margin-top:1em; margin-bottom:1em } div.line-block div.line-block { margin-top:0; margin-bottom:0; margin-left:1.5em } html[dir="rtl"] div.line-block div.line-block { margin-top:0; margin-bottom:0; margin-right:1.5em; margin-left:0 } div.sidebar { margin-left:2em; min-height:20px; width:40%; float:right; clear:right } div.sidebar p.rubric { font-size:medium } div.topic { margin:2em } img.align-left,.figure.align-left,object.align-left { clear:left; float:left; margin-right:1em } img.align-right,.figure.align-right,object.align-right { clear:right; float:right; margin-left:1em } img.align-center,.figure.align-center,object.align-center { display:block; margin-left:auto; margin-right:auto } .align-left { text-align:left } .align-center { clear:both; text-align:center } .align-right { text-align:right } div.align-right { text-align:inherit } ol.simple,ul.simple { margin-bottom:1em } ol.arabic { list-style:decimal } ol.loweralpha { list-style:lower-alpha } ol.upperalpha { list-style:upper-alpha } ol.lowerroman { list-style:lower-roman } ol.upperroman { list-style:upper-roman } p.attribution { text-align:right; margin-left:50% } p.caption { font-style:italic } p.credits { font-style:italic; font-size:smaller } p.label { white-space:nowrap } p.rubric { font-weight:bold; font-size:larger; color:maroon; text-align:center } p.sidebar-subtitle { font-weight:bold } p.topic-title { font-weight:bold } pre.address { margin-bottom:0; margin-top:0; font:inherit } pre.code .ln { color:gray } span.option { white-space:nowrap } span.pre { white-space:pre } span.problematic { color:red } span.section-subtitle { font-size:.8rem } table.citation { border-left:solid 1px gray; margin-left:1px } ul.auto-toc { list-style-type:none } a.footnote-reference { line-height:0px } * { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box } html,body { overflow-x:hidden; margin:0; padding:0; font-family:'PT Serif', Georgia, "Times New Roman", serif; line-height:1.5; background-color:white; color:#0C090A; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100% } @media (min-width: 38em) { html { font-size:20px } } h1,h2,h3,h4,h5,h6 { font-family:'PT Sans', Helvetica, Arial, sans-serif; font-weight:400; color:#313131; letter-spacing:-.025rem; margin-bottom:.5rem; margin-top:1rem; text-rendering:optimizeLegibility } h1 { font-size:2rem } h2,h3,h4 { font-size:1.55rem } h5,h6 { font-size:1.25rem } @font-face { font-family:'PT Sans'; font-style:normal; font-weight:400; src:local('PT Sans'), local('PTSans-Regular'), url(https://fonts.gstatic.com/s/ptsans/v8/9kaD4V2pNPMMeUVBHayd7vY6323mHUZFJMgTvxaG2iE.woff2) format('woff2'),url("/fonts/PT_Sans-Web-Regular.ttf"); unicode-range:U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF } @font-face { font-family:'PT Sans'; font-style:normal; font-weight:400; src:local('PT Sans'), local('PTSans-Regular'), url(https://fonts.gstatic.com/s/ptsans/v8/ATKpv8nLYAKUYexo8iqqrg.woff2) format('woff2'),url("/fonts/PT_Sans-Web-Regular.ttf"); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000 } @font-face { font-family:'PT Serif'; font-style:normal; font-weight:400; src:local('PT Serif'), local('PTSerif-Regular'), url(https://fonts.gstatic.com/s/ptserif/v8/CPRt--GVMETgA6YEaoGitxTbgVql8nDJpwnrE27mub0.woff2) format('woff2'),url("/fonts/PT_Serif-Web-Regular.ttf"); unicode-range:U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF } @font-face { font-family:'PT Serif'; font-style:normal; font-weight:400; src:local('PT Serif'), local('PTSerif-Regular'), url(https://fonts.gstatic.com/s/ptserif/v8/I-OtoJZa3TeyH6D9oli3ifesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'),url("/fonts/PT_Serif-Web-Regular.ttf"); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000 } .wrap { position:relative; width:100% } .container { padding-left:1rem; padding-right:1rem; margin-left:auto; margin-right:auto } .masthead { padding-top:1rem; padding-bottom:1rem; margin-bottom:3rem; border-bottom:1px solid #eee } .masthead-title { margin-top:0; margin-bottom:0; color:#505555 } .masthead-title a { color:#505555 } .masthead-title small { font-size:.75rem; font-weight:400; color:#c0c0c0; letter-spacing:0 } @media (max-width: 48em) { .masthead-title { text-align:center } .masthead-title small { display:none } } @media (min-width: 20em) { .masthead-title { font-size:1.2rem } } @media (min-width: 56em) { .masthead-title { padding-left:3rem } } @media (min-width: 70em) { .masthead-title { padding-left:4rem } h3 { font-size:1.35rem } } @media (min-width: 90em) { .masthead-title { padding-left:4rem } h3 { font-size:1.55rem } } a { color:#268bd2; text-decoration:none } a strong { color:inherit } a:hover,a:focus { text-decoration:underline } p { margin-top:0; margin-bottom:1rem } strong { color:#303030 } ul,ol,dl { margin-top:0; margin-bottom:1rem } dt { font-weight:bold } dd { margin-bottom:.5rem } hr { position:relative; margin:1.5rem 0; border:0; border-top:1px solid #eee; border-bottom:1px solid #fff } abbr { font-size:85%; font-weight:bold; color:#555; text-transform:uppercase } abbr[title] { cursor:help; border-bottom:1px dotted #e5e5e5 } img { display:block; max-width:100%; margin:0 0 1rem; border-radius:5px } table { margin-bottom:1rem; width:100%; border:1px solid #e5e5e5; border-collapse:collapse } td,th { padding:.25rem .5rem; border:1px solid #e5e5e5 } tbody tr:nth-child(odd) td,tbody tr:nth-child(odd) th { background-color:#f9f9f9 } blockquote { padding:.5rem 1rem; margin:.8rem 0; color:#7a7a7a; border-left:.25rem solid #e5e5e5 } blockquote p:last-child { margin-bottom:0 } @media (min-width: 30em) { blockquote { padding-right:5rem; padding-left:1.25rem } } .highlight { margin-bottom:1rem; border-radius:4px } .highlight pre { margin-bottom:0 } .infos { font-size:0.7em; padding-left:20%; padding-right:20%; padding-top:5em; text-align:center } .logo { display:block; padding-top:5%; text-align:center; width:50%; margin-left:calc(50% - 4em) } img.logo { width:8em } img.portrait { display:block; text-align:center; width:14em; margin-left:calc(50% - 7.5em) } figcaption { text-align:center; line-height:1 } .tags { font-size:.75rem; padding:0 5px 5px; max-width:90% } img.cover { box-shadow:.5rem 0.5rem .5rem rgba(0,0,0,.25); margin-bottom:-1em; width:250px } img.divider { margin-left:35%; margin-right:35%; height:2.5em; width:30%; border:0; text-align:center } .message { margin-bottom:1rem; padding:1rem; color:#717171; background-color:#f9f9f9 } div.sidebar,.sidebar { position:fixed; top:0; bottom:0; left:-14rem; width:14rem; visibility:hidden; overflow-y:auto; padding:0; margin:0; border:none; font-family:"PT Sans", Helvetica, Arial, sans-serif; font-size:.875rem; color:rgba(255,255,255,.6); background-color:#202020; -webkit-transition:all .3s ease-in-out; transition:all .3s ease-in-out } @media (min-width: 30em) { div.sidebar { font-size:.75rem } } .sidebar a { font-weight:normal; color:#fff } .sidebar-item { padding:1rem } .sidebar-item p:last-child { margin-bottom:0 } .sidebar-nav-item.subitem { padding-left:2.2rem } .sidebar-nav { border-bottom:1px solid rgba(255,255,255,.1) } .sidebar-nav-item { display:block; padding:.5rem 1rem; border-top:1px solid rgba(255,255,255,.1) } .sidebar-nav-item.active,a.sidebar-nav-item:hover,a.sidebar-nav-item:focus { text-decoration:none; background-color:rgba(255,255,255,.1); border-color:transparent } @media (min-width: 48em) { .sidebar-item { padding:1.5rem } .sidebar-nav-item { padding-left:1.5rem; padding-right:1.5rem } } .sidebar-checkbox { display:none } .sidebar-toggle { position:absolute; top:.8rem; left:1rem; display:block; padding:.25rem .75rem; color:#505555; background-color:white; border-radius:.25rem; cursor:pointer } .sidebar-toggle:before { display:inline-block; width:1rem; height:.75rem; content:""; background-image:-webkit-linear-gradient(to bottom, #555, #555 20%, #fff 20%, #fff 40%, #555 40%, #555 60%, #fff 60%, #fff 80%, #555 80%, #555 100%); background-image:-moz-linear-gradient(to bottom, #555, #555 20%, #fff 20%, #fff 40%, #555 40%, #555 60%, #fff 60%, #fff 80%, #555 80%, #555 100%); background-image:-ms-linear-gradient(to bottom, #555, #555 20%, #fff 20%, #fff 40%, #555 40%, #555 60%, #fff 60%, #fff 80%, #555 80%, #555 100%); background-image:linear-gradient(to bottom, #555, #555 20%, #fff 20%, #fff 40%, #555 40%, #555 60%, #fff 60%, #fff 80%, #555 80%, #555 100%) } .sidebar-toggle:active,#sidebar-checkbox:focus ~ .sidebar-toggle,#sidebar-checkbox:checked ~ .sidebar-toggle { color:#fff; background-color:#555 } .sidebar-toggle:active:before,#sidebar-checkbox:focus ~ .sidebar-toggle:before,#sidebar-checkbox:checked ~ .sidebar-toggle:before { background-image:-webkit-linear-gradient(to bottom, #fff, #fff 20%, #555 20%, #555 40%, #fff 40%, #fff 60%, #555 60%, #555 80%, #fff 80%, #fff 100%); background-image:-moz-linear-gradient(to bottom, #fff, #fff 20%, #555 20%, #555 40%, #fff 40%, #fff 60%, #555 60%, #555 80%, #fff 80%, #fff 100%); background-image:-ms-linear-gradient(to bottom, #fff, #fff 20%, #555 20%, #555 40%, #fff 40%, #fff 60%, #555 60%, #555 80%, #fff 80%, #fff 100%); background-image:linear-gradient(to bottom, #fff, #fff 20%, #555 20%, #555 40%, #fff 40%, #fff 60%, #555 60%, #555 80%, #fff 80%, #fff 100%) } @media (min-width: 30.1em) { .sidebar-toggle { position:fixed } } @media print { .sidebar-toggle { display:none } } .wrap,.sidebar,.sidebar-toggle { -webkit-backface-visibility:hidden; -ms-backface-visibility:hidden; backface-visibility:hidden } .wrap,.sidebar-toggle { -webkit-transition:-webkit-transform .3s ease-in-out; transition:transform .3s ease-in-out } #sidebar-checkbox:checked + .sidebar { z-index:10; visibility:visible } #sidebar-checkbox:checked ~ .sidebar,#sidebar-checkbox:checked ~ .wrap,#sidebar-checkbox:checked ~ .sidebar-toggle { -webkit-transform:translateX(14rem); -ms-transform:translateX(14rem); transform:translateX(14rem) } .sidebar-overlay #sidebar-checkbox:checked ~ .wrap { -webkit-transform:translateX(0); -ms-transform:translateX(0); transform:translateX(0) } .sidebar-overlay #sidebar-checkbox:checked ~ .sidebar-toggle { box-shadow:0 0 0 .25rem #fff } .sidebar-overlay #sidebar-checkbox:checked ~ .sidebar { box-shadow:.25rem 0 .5rem rgba(0,0,0,.1) } .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0, 0, 0, 0); border:0 } .sr-only-focusable:active,.sr-only-focusable:focus { position:static; width:auto; height:auto; margin:0; overflow:visible; clip:auto } .breadcrumb { padding:8px 15px; margin-bottom:20px; list-style:none } .breadcrumb > li { display:inline-block; margin-right:0; margin-left:0 } .breadcrumb > li:after { content:' / '; color:#888 } .breadcrumb > li:last-of-type:after { content:''; margin-left:0 } .thumbnails > li { display:inline-block; margin-right:10px } .thumbnails > li:last-of-type { margin-right:0 } .page-title,.post-title,.post-title a { color:#303030 } .page-title,.post-title { margin-top:0 } .post-date { display:block; margin-top:-.5rem; margin-bottom:1rem; color:#9a9a9a } .related { padding-top:2rem; padding-bottom:2rem; border-top:1px solid #eee } .related-posts { padding-left:0; list-style:none } .related-posts h3 { margin-top:0 } .related-posts li small { font-size:75%; color:#999 } .related-posts li a:hover { color:#268bd2; text-decoration:none } .related-posts li a:hover small { color:inherit } figure:hover { text-decoration:underline } .pagination { overflow:hidden; margin-left:-1rem; margin-right:-1rem; font-family:"PT Sans", Helvetica, Arial, sans-serif; color:#ccc; text-align:center } .pagination-item { display:block; padding:1rem; border:1px solid #eee } .pagination-item:first-child { margin-bottom:-1px } a.pagination-item:hover { background-color:#f5f5f5 } @media (min-width: 30em) { .pagination { margin:3rem 0 } .pagination-item { float:left; width:50% } .pagination-item:first-child { margin-bottom:0; border-top-left-radius:4px; border-bottom-left-radius:4px } .pagination-item:last-child { margin-left:-1px; border-top-right-radius:4px; border-bottom-right-radius:4px } }
WereBooks/BookshelfCMS_Alpha
yoursite-core.css
CSS
apache-2.0
13,875
[ 30522, 1013, 1008, 9703, 20116, 2015, 2000, 2224, 2004, 1037, 3978, 2005, 1996, 4642, 2015, 6994, 1012, 14171, 2004, 2734, 2005, 2115, 2609, 1008, 1013, 1012, 3675, 3238, 1063, 3675, 1024, 1014, 1025, 11687, 4667, 1024, 1014, 1014, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var $content, $deferred; $(document).ready(function() { // Bind ASAP events $(window).on("request.asap", pageRequested) .on("progress.asap", pageLoadProgress) .on("load.asap", pageLoaded) .on("render.asap", pageRendered) .on("error.asap", pageLoadError); $content = $("#content"); // Init ASAP $.asap({ cache: false, selector: "a:not(.no-asap)", transitionOut: function() { if ($deferred) { $deferred.reject(); } $deferred = $.Deferred(); $content.animate({ opacity: 0 }, 1000, function() { console.log("Animate complete"); $deferred.resolve(); }); return $deferred; } }); // Remember to init first page pageRendered(); }); function pageRequested(e) { // update state to reflect loading console.log("Request new page"); } function pageLoadProgress(e, percent) { // update progress to reflect loading console.log("New page load progress", percent); } function pageLoaded(e) { // unbind old events and remove plugins console.log("Destroy old page"); } function pageRendered(e) { // bind new events and initialize plugins console.log("Render new page"); $content.animate({ opacity: 1 }, 1000); } function pageLoadError(e, error) { // watch for load errors console.warn("Error loading page: ", error); }
LoganArnett/Formstone
demo/site/extra/asap/js/main.js
JavaScript
mit
1,400
[ 30522, 13075, 1002, 4180, 1010, 1002, 13366, 28849, 2094, 1025, 1002, 1006, 6254, 1007, 1012, 3201, 1006, 3853, 1006, 1007, 1063, 1013, 1013, 14187, 17306, 2361, 2824, 1002, 1006, 3332, 1007, 1012, 2006, 1006, 1000, 5227, 1012, 17306, 2361,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#pragma once #include <memory> #include <globjects/Buffer.h> #include <gloperate/rendering/Shape.h> #include <gloperate/rendering/Drawable.h> namespace gloperate { /** * @brief * Point shape */ class GLOPERATE_API Point : public Shape { public: /** * @brief * Constructor * * @param[in] options * Shape options */ Point(cppassist::Flags<ShapeOption> options = ShapeOption::None); /** * @brief * Destructor */ virtual ~Point(); // Virtual AbstractDrawable functions virtual void draw() const override; protected: std::unique_ptr<Drawable> m_drawable; ///< Underlying drawable object std::unique_ptr<globjects::Buffer> m_vertices; ///< Vertex buffer std::unique_ptr<globjects::Buffer> m_texCoords; ///< Texture coordinate buffer }; } // namespace gloperate
cginternals/gloperate
source/gloperate/include/gloperate/rendering/Point.h
C
mit
869
[ 30522, 1001, 10975, 8490, 2863, 2320, 1001, 2421, 1026, 3638, 1028, 1001, 2421, 1026, 1043, 4135, 2497, 20614, 2015, 1013, 17698, 1012, 1044, 1028, 1001, 2421, 1026, 1043, 4135, 4842, 3686, 1013, 14259, 1013, 4338, 1012, 1044, 1028, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module Discordrb::Webhooks # An embed is a multipart-style attachment to a webhook message that can have a variety of different purposes and # appearances. class Embed def initialize(title: nil, description: nil, url: nil, timestamp: nil, colour: nil, color: nil, footer: nil, image: nil, thumbnail: nil, video: nil, provider: nil, author: nil, fields: []) @title = title @description = description @url = url @timestamp = timestamp @colour = colour || color @footer = footer @image = image @thumbnail = thumbnail @video = video @provider = provider @author = author @fields = fields end # The title of this embed that will be displayed above everything else. # @return [String] attr_accessor :title # The description for this embed. # @return [String] attr_accessor :description # The URL the title should point to. # @return [String] attr_accessor :url # The timestamp for this embed. Will be displayed just below the title. # @return [Time] attr_accessor :timestamp # @return [Integer] the colour of the bar to the side, in decimal form. attr_reader :colour alias_method :color, :colour # Sets the colour of the bar to the side of the embed to something new. # @param value [Integer, String, {Integer, Integer, Integer}] The colour in decimal, hexadecimal, or R/G/B decimal # form. def colour=(value) if value.is_a? Integer raise ArgumentError, 'Embed colour must be 24-bit!' if value >= 16_777_216 @colour = value elsif value.is_a? String self.colour = value.delete('#').to_i(16) elsif value.is_a? Array raise ArgumentError, 'Colour tuple must have three values!' if value.length != 3 self.colour = value[0] << 16 | value[1] << 8 | value[2] end end alias_method :color=, :colour= # The footer for this embed. # @example Add a footer to an embed # embed.footer = Discordrb::Webhooks::EmbedFooter.new(text: 'Hello', icon_url: 'https://i.imgur.com/j69wMDu.jpg') # @return [EmbedFooter] attr_accessor :footer # The image for this embed. # @see EmbedImage # @example Add a image to an embed # embed.image = Discordrb::Webhooks::EmbedImage.new(url: 'https://i.imgur.com/PcMltU7.jpg') # @return [EmbedImage] attr_accessor :image # The thumbnail for this embed. # @see EmbedThumbnail # @example Add a thumbnail to an embed # embed.thumbnail = Discordrb::Webhooks::EmbedThumbnail.new(url: 'https://i.imgur.com/xTG3a1I.jpg') # @return [EmbedThumbnail] attr_accessor :thumbnail # The author for this embed. # @see EmbedAuthor # @example Add a author to an embed # embed.author = Discordrb::Webhooks::EmbedAuthor.new(name: 'meew0', url: 'https://github.com/meew0', icon_url: 'https://avatars2.githubusercontent.com/u/3662915?v=3&s=466') # @return [EmbedAuthor] attr_accessor :author # Add a field object to this embed. # @param field [EmbedField] The field to add. def <<(field) @fields << field end # Convenience method to add a field to the embed without having to create one manually. # @see EmbedField # @example Add a field to an embed, conveniently # embed.add_field(name: 'A field', value: "The field's content") # @param name [String] The field's name # @param value [String] The field's value # @param inline [true, false] Whether the field should be inlined def add_field(name: nil, value: nil, inline: nil) self << EmbedField.new(name: name, value: value, inline: inline) end # @return [Array<EmbedField>] the fields attached to this embed. attr_reader :fields # @return [Hash] a hash representation of this embed, to be converted to JSON. def to_hash { title: @title, description: @description, url: @url, timestamp: @timestamp && @timestamp.utc.iso8601, color: @colour, footer: @footer && @footer.to_hash, image: @image && @image.to_hash, thumbnail: @thumbnail && @thumbnail.to_hash, video: @video && @video.to_hash, provider: @provider && @provider.to_hash, author: @author && @author.to_hash, fields: @fields.map(&:to_hash) } end end # An embed's footer will be displayed at the very bottom of an embed, together with the timestamp. An icon URL can be # set together with some text to be displayed. class EmbedFooter # Creates a new footer object. # @param text [String, nil] The text to be displayed in the footer. # @param icon_url [String, nil] The URL to an icon to be showed alongside the text. def initialize(text: nil, icon_url: nil) @text = text @icon_url = icon_url end # @return [Hash] a hash representation of this embed footer, to be converted to JSON. def to_hash { text: @text, icon_url: @icon_url } end end # An embed's image will be displayed at the bottom, in large format. It will replace a footer icon URL if one is set. class EmbedImage # Creates a new image object. # @param url [String, nil] The URL of the image. def initialize(url: nil) @url = url end # @return [Hash] a hash representation of this embed image, to be converted to JSON. def to_hash { url: @url } end end # An embed's thumbnail will be displayed at the right of the message, next to the description and fields. When clicked # it will point to the embed URL. class EmbedThumbnail # Creates a new thumbnail object. # @param url [String, nil] The URL of the thumbnail. def initialize(url: nil) @url = url end # @return [Hash] a hash representation of this embed thumbnail, to be converted to JSON. def to_hash { url: @url } end end # An embed's author will be shown at the top to indicate who "authored" the particular event the webhook was sent for. class EmbedAuthor # Creates a new author object. # @param name [String, nil] The name of the author. # @param url [String, nil] The URL the name should link to. # @param icon_url [String, nil] The URL of the icon to be displayed next to the author. def initialize(name: nil, url: nil, icon_url: nil) @name = name @url = url @icon_url = icon_url end # @return [Hash] a hash representation of this embed author, to be converted to JSON. def to_hash { name: @name, url: @url, icon_url: @icon_url } end end # A field is a small block of text with a header that can be relatively freely layouted with other fields. class EmbedField # Creates a new field object. # @param name [String, nil] The name of the field, displayed in bold at the top. # @param value [String, nil] The value of the field, displayed in normal text below the name. # @param inline [true, false] Whether the field should be displayed in-line with other fields. def initialize(name: nil, value: nil, inline: nil) @name = name @value = value @inline = inline end # @return [Hash] a hash representation of this embed field, to be converted to JSON. def to_hash { name: @name, value: @value, inline: @inline } end end end
Roughsketch/discordrb
lib/discordrb/webhooks/embeds.rb
Ruby
mit
7,499
[ 30522, 11336, 12532, 4103, 15185, 30524, 2102, 1011, 2806, 14449, 2000, 1037, 4773, 6806, 6559, 4471, 2008, 2064, 2031, 1037, 3528, 1997, 2367, 5682, 1998, 1001, 3922, 1012, 2465, 7861, 8270, 13366, 3988, 4697, 1006, 2516, 1024, 9152, 2140,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en-US"> <head> <base href="http://localhost/wordpress" /> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Wrigley-1981 The population history of England, 1541-1871: a re | Communicating with Prisoners</title> <link rel='stylesheet' id='ortext-fonts-css' href='//fonts.googleapis.com/css?family=Lato%3A300%2C400%2C700%2C900%2C300italic%2C400italic%2C700italic' type='text/css' media='all' /> <link rel='stylesheet' id='ortext-style-css' href='http://cwpc.github.io/wp-content/themes/ortext/style.css?ver=4.1' type='text/css' media='all' /> <link rel='stylesheet' id='ortext-layout-style-css' href='http://cwpc.github.io/wp-content/themes/ortext/layouts/content.css?ver=4.1' type='text/css' media='all' /> <link rel='stylesheet' id='ortext_fontawesome-css' href='http://cwpc.github.io/wp-content/themes/ortext/fonts/font-awesome/css/font-awesome.min.css?ver=4.1' type='text/css' media='all' /> <link rel='stylesheet' id='tablepress-default-css' href='http://cwpc.github.io/wp-content/plugins/tablepress/css/default.min.css?ver=1.5.1' type='text/css' media='all' /> <style id='tablepress-default-inline-css' type='text/css'> .tablepress{width:auto;border:2px solid;margin:0 auto 1em}.tablepress td,.tablepress thead th{text-align:center}.tablepress .column-1{text-align:left}.tablepress-table-name{font-weight:900;text-align:center;font-size:20px;line-height:1.3em}.tablepress tfoot th{font-size:14px}.tablepress-table-description{font-weight:900;text-align:center} </style> <script type='text/javascript' src='http://cwpc.github.io/wp-includes/js/jquery/jquery.js?ver=1.11.1'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> <link rel='next' title='X-1965 The autobiography of Malcolm X. With the assistance' href='http://cwpc.github.io/refs/x-1965-the-autobiography-of-malcolm-x-with-the-assistance/' /> <link rel='canonical' href='http://cwpc.github.io/refs/wrigley-1981-the-population-history-of-england-1541-1871-a-re/' /> <link rel='shortlink' href='http://cwpc.github.io/?p=31260' /> </head> <body class="single single-refs postid-31260 custom-background"> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-56314084-1', 'auto'); ga('send', 'pageview'); </script><div id="page" class="hfeed site"> <a class="skip-link screen-reader-text" href="#content">Skip to content</a> <header id="masthead" class="site-header" role="banner"> <div class="site-branding"> <div class="title-box"> <h1 class="site-title"><a href="http://cwpc.github.io/" rel="home">Communicating with Prisoners</a></h1> <h2 class="site-description">Public Interest Analysis</h2> </div> </div> <div id="scroller-anchor"></div> <nav id="site-navigation" class="main-navigation clear" role="navigation"> <span class="menu-toggle"><a href="#">menu</a></span> <div class="menu-left-nav-container"><ul id="menu-left-nav" class="menu"><li id="menu-item-10830" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10830"><a title="outline of sections" href="http://cwpc.github.io/outline-post/">Outline</a></li> <li id="menu-item-11571" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11571"><a title="context-sensitive notes link" href="http://cwpc.github.io/outline-notes/">Notes</a></li> <li id="menu-item-11570" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11570"><a title="context-sensitive data link" href="http://cwpc.github.io/list-datasets/">Data</a></li> </ul></div> <div id="rng"> <div id="menu-secondary" class="menu-secondary"><ul id="menu-secondary-items" class="menu-items"><li id="menu-item-10840" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10840"><a title="about this ortext" href="http://cwpc.github.io/about/">About</a></li> </ul></div> <div class="search-toggle"> <span class="fa fa-search"></span> <a href="#search-container" class="screen-reader-text">search</a> </div> </div> </nav><!-- #site-navigation --> <div id="header-search-container" class="search-box-wrapper clear hide"> <div class="search-box clear"> <form role="search" method="get" class="search-form" action="http://cwpc.github.io/"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search &hellip;" value="" name="s" title="Search for:" /> </label> <input type="submit" class="search-submit" value="Search" /> </form> </div> </div> </header><!-- #masthead --> <div id="content" class="site-content"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <div class="section-label"></div> <article id="post-31260" class="post-31260 refs type-refs status-publish hentry"> <header class="entry-header"> <h1 class="entry-title">Wrigley-1981 The population history of England, 1541-1871: a re</h1> </header><!-- .entry-header --> <div class="entry-content"> <img class="aligncenter otx-face" alt="face of a prisoner" src="http://cwpc.github.io/wp-content/uploads/faces/prisoner-148.jpg"></br><p>reference-type: Book <br />author: Wrigley, E. A. and Schofield, R. S. <br />year: 1981 <br />title: The population history of England, 1541-1871: a reconstruction <br />place-published: Cambridge, MA <br />publisher: Harvard Univ. Press <br />otx-key: Wrigley-1981 </p> </div><!-- .entry-content --> <footer class="entry-footer"> <div class="tags-footer"> </div> </footer><!-- .entry-footer --> </article><!-- #post-## --> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text">Post navigation</h1> <div class="nav-links-nd"><div class="nav-nd-title">In Series of References</div><div class="nav-previous"><a href="http://cwpc.github.io/refs/wb-2003-world-development-indicators/" rel="prev">WB-2003 World Development Indicators</a></div><div class="nav-next"><a href="http://cwpc.github.io/refs/x-1965-the-autobiography-of-malcolm-x-with-the-assistance/" rel="next">X-1965 The autobiography of Malcolm X. With the assistance</a></div> </div><!-- .nav-links --> </nav><!-- .navigation --> </main><!-- #main --> </div><!-- #primary --> </div><!-- #content --> <footer id="colophon" class="site-footer" role="contentinfo"> <div class="site-info"> <nav id="site-navigation" class="main-navigation clear" role="navigation"> <span class="menu-toggle"><a href="#">menu</a></span> <div class="menu-left-nav-container"><ul id="menu-left-nav-1" class="menu"><li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10830"><a title="outline of sections" href="http://cwpc.github.io/outline-post/">Outline</a></li> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11571"><a title="context-sensitive notes link" href="http://cwpc.github.io/outline-notes/">Notes</a></li> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11570"><a title="context-sensitive data link" href="http://cwpc.github.io/list-datasets/">Data</a></li> </ul></div> <div id="rng"> <div id="menu-secondary" class="menu-secondary"><ul id="menu-secondary-items" class="menu-items"><li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10840"><a title="about this ortext" href="http://cwpc.github.io/about/">About</a></li> </ul></div> <div class="search-toggle-bottom"> <span class="fa fa-search"></span> <a href="#search-container" class="screen-reader-text">search</a> </div> </div> <div id="header-search-container" class="search-box-wrapper-bottom clear hide"> <div class="search-box clear"> <form role="search" method="get" class="search-form" action="http://cwpc.github.io/"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search &hellip;" value="" name="s" title="Search for:" /> </label> <input type="submit" class="search-submit" value="Search" /> </form> </div> </div> <div id="footer-tagline"> <a href="http://cwpc.github.io/">Communicating with Prisoners</a> </div> </nav><!-- #site-navigation --> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/superfish.min.js?ver=1.7.4'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/superfish-settings.js?ver=1.7.4'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/navigation.js?ver=20120206'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/skip-link-focus-fix.js?ver=20130115'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/hide-search.js?ver=20120206'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/show-hide-comments.js?ver=1.0'></script> </body> </html> <!-- Dynamic page generated in 0.196 seconds. --> <!-- Cached page generated by WP-Super-Cache on 2015-01-27 23:51:17 --> <!-- super cache -->
cwpc/cwpc.github.io
refs/wrigley-1981-the-population-history-of-england-1541-1871-a-re/index.html
HTML
unlicense
9,742
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1011, 2149, 1000, 1028, 1026, 2132, 1028, 1026, 2918, 17850, 12879, 1027, 1000, 8299, 1024, 1013, 1013, 2334, 15006, 2102, 1013, 2773, 20110, 1000, 1013, 1028...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_36) on Mon Jan 04 20:30:29 CST 2016 --> <title>AppMasterToExecutor</title> <meta name="date" content="2016-01-04"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="AppMasterToExecutor"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../io/gearpump/streaming/AckSerializer.html" title="class in io.gearpump.streaming"><span class="strong">PREV CLASS</span></a></li> <li><a href="../../../io/gearpump/streaming/AppMasterToExecutor.ChangeTask.html" title="class in io.gearpump.streaming"><span class="strong">NEXT CLASS</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?io/gearpump/streaming/AppMasterToExecutor.html" target="_top">FRAMES</a></li> <li><a href="AppMasterToExecutor.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>SUMMARY:&nbsp;</li> <li><a href="#nested_class_summary">NESTED</a>&nbsp;|&nbsp;</li> <li>FIELD&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li> <li><a href="#methods_inherited_from_class_java.lang.Object">METHOD</a></li> </ul> <ul class="subNavList"> <li>DETAIL:&nbsp;</li> <li>FIELD&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li> <li>METHOD</li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <p class="subTitle">io.gearpump.streaming</p> <h2 title="Class AppMasterToExecutor" class="title">Class AppMasterToExecutor</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>io.gearpump.streaming.AppMasterToExecutor</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <strong>AppMasterToExecutor</strong> extends java.lang.Object</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== NESTED CLASS SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="nested_class_summary"> <!-- --> </a> <h3>Nested Class Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> <caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.ChangeTask.html" title="class in io.gearpump.streaming">AppMasterToExecutor.ChangeTask</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.ChangeTask$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.ChangeTask$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.ChangeTasks.html" title="class in io.gearpump.streaming">AppMasterToExecutor.ChangeTasks</a></strong></code> <div class="block">dagVersion, life, and subscribers will be changed on target task list.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.ChangeTasks$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.ChangeTasks$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.LaunchTasks.html" title="class in io.gearpump.streaming">AppMasterToExecutor.LaunchTasks</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.LaunchTasks$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.LaunchTasks$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.MsgLostException.html" title="class in io.gearpump.streaming">AppMasterToExecutor.MsgLostException</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.RestartClockService$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.RestartClockService$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.StartAllTasks.html" title="class in io.gearpump.streaming">AppMasterToExecutor.StartAllTasks</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.StartAllTasks$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.StartAllTasks$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.StartDynamicDag.html" title="class in io.gearpump.streaming">AppMasterToExecutor.StartDynamicDag</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.StartDynamicDag$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.StartDynamicDag$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.StartTask.html" title="class in io.gearpump.streaming">AppMasterToExecutor.StartTask</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.StartTask$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.StartTask$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskChanged.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskChanged</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskChanged$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskChanged$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskLocationsReady.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskLocationsReady</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskLocationsReady$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskLocationsReady$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskLocationsReceived.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskLocationsReceived</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskLocationsReceived$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskLocationsReceived$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskLocationsRejected.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskLocationsRejected</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskLocationsRejected$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskLocationsRejected$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskRegistered.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskRegistered</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskRegistered$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskRegistered$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskRejected.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskRejected</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TaskRejected$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TaskRejected$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TasksChanged.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TasksChanged</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TasksChanged$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TasksChanged$</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.TasksLaunched$.html" title="class in io.gearpump.streaming">AppMasterToExecutor.TasksLaunched$</a></strong></code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../io/gearpump/streaming/AppMasterToExecutor.html#AppMasterToExecutor()">AppMasterToExecutor</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="AppMasterToExecutor()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>AppMasterToExecutor</h4> <pre>public&nbsp;AppMasterToExecutor()</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../io/gearpump/streaming/AckSerializer.html" title="class in io.gearpump.streaming"><span class="strong">PREV CLASS</span></a></li> <li><a href="../../../io/gearpump/streaming/AppMasterToExecutor.ChangeTask.html" title="class in io.gearpump.streaming"><span class="strong">NEXT CLASS</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?io/gearpump/streaming/AppMasterToExecutor.html" target="_top">FRAMES</a></li> <li><a href="AppMasterToExecutor.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>SUMMARY:&nbsp;</li> <li><a href="#nested_class_summary">NESTED</a>&nbsp;|&nbsp;</li> <li>FIELD&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li> <li><a href="#methods_inherited_from_class_java.lang.Object">METHOD</a></li> </ul> <ul class="subNavList"> <li>DETAIL:&nbsp;</li> <li>FIELD&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li> <li>METHOD</li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
stanleyxu2005/gearpump.github.io
releases/0.7.3/api/java/io/gearpump/streaming/AppMasterToExecutor.html
HTML
apache-2.0
16,847
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2015 AppDynamics, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.appdynamicspilot.rest; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; public class ShoppingCart implements java.io.Serializable { Logger log = Logger.getLogger(ShoppingCart.class); private List<ShoppingCartItem> items; public ShoppingCart() { items = new ArrayList<ShoppingCartItem>(); } public void addItem(ShoppingCartItem item) { items.add(item); } public void removeItem(ShoppingCartItem item) { items.remove(item); } public List<ShoppingCartItem> getAllItems() { return items; } public double getCartTotal() { double total = 0.0; for (ShoppingCartItem item : items) { total += item.getPrice(); } return total; } public void clear() { items.clear(); } }
udayinfy/ECommerce-Java
ECommerce-Web/src/main/java/com/appdynamicspilot/rest/ShoppingCart.java
Java
apache-2.0
1,458
[ 30522, 1013, 1008, 1008, 9385, 2325, 10439, 5149, 28987, 6169, 1010, 4297, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
=begin Camaleon CMS is a content management system Copyright (C) 2015 by Owen Peredo Diaz Email: owenperedo@gmail.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License (GPLv3) for more details. =end class CamaleonController < ApplicationController include CamaleonHelper include SessionHelper include SiteHelper include HtmlHelper include UserRolesHelper include ShortCodeHelper include PluginsHelper include ThemeHelper include HooksHelper include ContentHelper include CaptchaHelper include UploaderHelper include Mobu::DetectMobile prepend_before_action :camaleon_add_view_paths prepend_before_action :load_custom_models before_action :site_check_existence, except: [:render_error, :captcha] before_action :before_actions, except: [:render_error, :captcha] after_action :after_actions, except: [:render_error, :captcha] # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception layout Proc.new { |controller| controller.request.xhr? ? false : 'default' } # show page error def render_error(status = 404, exception = nil) Rails.logger.info "====================#{caller.inspect}" render :file => "public/#{status}.html", :status => status, :layout => false end # generate captcha image def captcha image = captcha_build(params[:len]) send_data image.to_blob, :type => image.mime_type, :disposition => 'inline' end private def before_actions # including all helpers (system, themes, plugins) for this site PluginRoutes.enabled_apps(current_site, current_theme.slug).each{|plugin| plugin_load_helpers(plugin) } # set default cache directory for current site cache_store.cache_path = File.join(cache_store.cache_path.split("site-#{current_site.id}").first, "site-#{current_site.id}") # Rails.cache.write("#{current_site.id}-#{Time.now}", 1) # initializing short codes shortcodes_init() # initializing before and after contents html_helpers_init # initializing before and after contents content_init @_hooks_skip = [] # trigger all hooks before_load_app hooks_run("app_before_load") request.env.except!('HTTP_X_FORWARDED_HOST') if request.env['HTTP_X_FORWARDED_HOST'] # just drop the variable end def after_actions # trigger all actions app after load hooks_run("app_after_load") end # redirect to sessions login form when the session was expired. def auth_session_error redirect_to root_path end # include all custom models created by installed plugins or themes for current site def load_custom_models if current_site.present? site_load_custom_models(current_site) end end # add custom views of camaleon def camaleon_add_view_paths self.prepend_view_path(File.join($camaleon_engine_dir, "app", "apps", "plugins")) self.prepend_view_path(Rails.root.join("app", "apps", 'plugins')) self.prepend_view_path(File.join($camaleon_engine_dir, "app", "views", 'default_theme')) self.prepend_view_path(Rails.root.join("app", "views", 'default_theme')) if current_theme.present? views_dir = "app/apps/themes/#{current_theme.slug}/views" self.prepend_view_path(File.join($camaleon_engine_dir, views_dir).to_s) self.prepend_view_path(Rails.root.join(views_dir).to_s) end if current_site.present? views_site_dir = "app/apps/themes/#{current_site.id}/views" self.prepend_view_path(File.join($camaleon_engine_dir, views_site_dir).to_s) self.prepend_view_path(Rails.root.join(views_site_dir).to_s) end end end
sanbiv/camaleon-cms
app/controllers/camaleon_controller.rb
Ruby
agpl-3.0
4,087
[ 30522, 1027, 4088, 11503, 9453, 2239, 4642, 2015, 2003, 1037, 4180, 2968, 2291, 9385, 1006, 1039, 1007, 2325, 2011, 7291, 23976, 3527, 12526, 10373, 1024, 7291, 4842, 26010, 1030, 20917, 4014, 1012, 4012, 2023, 2565, 2003, 2489, 4007, 1024,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Stenanthemum waterhousii (F.Muell.) Benth. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name Spyridium waterhousii F.Muell. ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rhamnaceae/Stenanthemum/Stenanthemum waterhousii/README.md
Markdown
apache-2.0
218
[ 30522, 1001, 26261, 16885, 29122, 2819, 30524, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 1001, 2405, 1999, 19701, 1001, 1001, 1001, 1001, 2434, 2171, 8645, 14615, 5007, 2300, 6806, 2271, 6137, 1042, 1012, 14163...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package pl.dzielins42.dmtools.generator.religion; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import pl.dzielins42.dmtools.model.enumeration.Alignment; import pl.dzielins42.dmtools.model.enumeration.Gender; import pl.dzielins42.dmtools.model.religion.Deity; import pl.dzielins42.dmtools.model.religion.Domain; import pl.dzielins42.dmtools.model.religion.Pantheon; import pl.dzielins42.dmtools.util.ProbabilityDistributionTable; public class BasicPantheonGenerator implements PantheonGenerator<BasicPantheonGeneratorOptions> { protected final int MAX_DIVINE_RANK = 25; public Pantheon generate(BasicPantheonGeneratorOptions options) { // Validate options if (options == null || options.getRandom() == null || options.getDomainsProbability() == null || options.getNameGenerator() == null) { throw new IllegalArgumentException(); } // Generate number of deities as random number between minDeitiesNumber // and maxDeitiesNumber int numberOfDeities = options.getMinDeitiesNumber(); if (options.getMinDeitiesNumber() != options.getMaxDeitiesNumber()) { numberOfDeities += options.getRandom().nextInt(options.getMaxDeitiesNumber() - options.getMinDeitiesNumber() + 1); } // Generate each deity independently List<Deity> deities = new ArrayList<Deity>(numberOfDeities); Deity deity; for (int i = 0; i < numberOfDeities; i++) { deity = generateDeity(options); deities.add(deity); } return new Pantheon("The Pantheon", deities); } protected Deity generateDeity(BasicPantheonGeneratorOptions options) { // Generate rank // TODO higher ranks should be rarer, probably by some mathematical // formula // Basic pantheons should have a few greater deities (16-20) but mostly // intermediate deities (11-15) and lesser deities (6-10), demigods // (1-5) and heroes (0) if the pantheon size enables it. There should // not be many overdeities (21+). int rank = options.getRandom().nextInt(MAX_DIVINE_RANK + 1); // Generate domains // Number of deity's domains is its ceiling of its rank divided by 5 int numberOfDomains = (int) Math.ceil(((double) rank) / 5.0d); // Temporarily it is 3 numberOfDomains = 3; // If it is overdeity, its power is beyond domain partitioning - it has // power over every domain List<Domain> domains = new ArrayList<Domain>(); Domain domain; while (domains.size() < numberOfDomains) { domain = options.getDomainsProbability().getRandom(options.getRandom()); if (!domains.contains(domain)) { domains.add(domain); } } Alignment alignment = getRandomAlignmentForDomains(domains, options); Gender gender = Gender.values()[options.getRandom().nextInt(Gender.values().length)]; Deity deity = new Deity(options.getNameGenerator().generate(gender, options), alignment, gender, rank, domains); return deity; } /** * Returns deity's {@link Domain} list suited for pre-drawn * {@link Alignment}. * * @param alignment * deity's alignment. * @param options * generation options. * @return deity's {@link Domain} list suited for pre-drawn * {@link Alignment}. */ protected Domain getRandomDomainForAlignment(Alignment alignment, BasicPantheonGeneratorOptions options) { return null; } /** * Returns deity's {@link Alignment} suited for pre-drawn {@link Domain} * list. For each domain, probability for each alignment is retrieved using * {@link Domain#getAlignmentProbabilities()} method. Values are used to * create new {@link ProbabilityDistributionTable}, which is used to get * returned alignment. * * @param domains * list of domains of the deity. * @param options * generation options. * @return deity's {@link Alignment} suited for pre-drawn {@link Domain} * list. */ protected Alignment getRandomAlignmentForDomains(List<Domain> domains, BasicPantheonGeneratorOptions options) { // TODO maybe return random alignment based on uniform distribution if (domains == null || domains.isEmpty()) { throw new IllegalArgumentException(); } double[] probabilities = new double[Alignment.values().length]; Arrays.fill(probabilities, 1.0d); for (Domain domain : domains) { for (int i = 0; i < probabilities.length; i++) { probabilities[i] *= domain.getAlignmentProbabilities().getProbabilities().get(i); } } ProbabilityDistributionTable<Alignment> tempPdt = new ProbabilityDistributionTable<Alignment>(Alignment.values(), probabilities); return tempPdt.getRandom(options.getRandom()); } }
dzielins42/urban-bear
src/main/java/pl/dzielins42/dmtools/generator/religion/BasicPantheonGenerator.java
Java
apache-2.0
5,109
[ 30522, 7427, 20228, 1012, 1040, 14272, 24412, 20958, 1012, 1040, 20492, 13669, 2015, 1012, 13103, 1012, 4676, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 9140, 9863, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 27448, 1025, 12324, 9262, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// -*- C++ -*- // Copyright (C) 2005-2017 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as published by the Free Software // Foundation; either version 3, or (at your option) any later // version. // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // You should have received a copy of the GNU General Public License // along with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. // Permission to use, copy, modify, sell, and distribute this software // is hereby granted without fee, provided that the above copyright // notice appears in all copies, and that both that copyright notice // and this permission notice appear in supporting documentation. None // of the above authors, nor IBM Haifa Research Laboratories, make any // representation about the suitability of this software for any // purpose. It is provided "as is" without express or implied // warranty. /** * @file native_tree_tag.hpp * Contains a tag for native tree-based containers */ #ifndef PB_DS_NATIVE_TREE_DS_TAG_HPP #define PB_DS_NATIVE_TREE_DS_TAG_HPP namespace __gnu_pbds { namespace test { struct native_tree_tag { }; } // namespace test } // namespace __gnu_pbds #endif
mickael-guene/gcc
libstdc++-v3/testsuite/util/native_type/native_tree_tag.hpp
C++
gpl-2.0
1,637
[ 30522, 1013, 1013, 1011, 1008, 1011, 1039, 1009, 1009, 1011, 1008, 1011, 1013, 1013, 9385, 1006, 1039, 1007, 2384, 1011, 2418, 2489, 4007, 3192, 1010, 4297, 1012, 1013, 1013, 1013, 1013, 2023, 5371, 2003, 2112, 1997, 1996, 27004, 11163, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# chromium-downloader A simple utility that allows you to download the latest Chromium build for your platform.<br> It runs on macOS and Linux and depends on libcurl (please ensure you have it installed on your system).<br> This utility may be useful if you wish to update your web browser to the latest nightly build.<br> To compile, just type: <code>gcc chromium-downloader.c -o chromium-downloader -lcurl</code><br> To run: <code>./chromium-downloader</code><br>
mloporchio/chromium-downloader
README.md
Markdown
gpl-2.0
471
[ 30522, 1001, 10381, 21716, 5007, 1011, 8816, 2121, 1037, 3722, 9710, 2008, 4473, 2017, 2000, 8816, 1996, 6745, 10381, 21716, 5007, 3857, 30524, 2140, 1006, 3531, 5676, 2017, 2031, 2009, 5361, 2006, 2115, 2291, 1007, 1012, 1026, 7987, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Oro\Bundle\ActivityBundle\Form\Type; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Oro\Bundle\EntityConfigBundle\Config\Id\EntityConfigId; use Oro\Bundle\EntityExtendBundle\Form\Type\MultipleAssociationChoiceType as BaseMultipleAssociationChoiceType; class MultipleAssociationChoiceType extends BaseMultipleAssociationChoiceType { /** * {@inheritdoc} */ public function finishView(FormView $view, FormInterface $form, array $options) { parent::finishView($view, $form, $options); /** @var EntityConfigId $configId */ $configId = $options['config_id']; $targetClassName = $configId->getClassName(); /** @var FormView $choiceView */ foreach ($view->children as $choiceView) { // disable activity with same class as target entity if ((isset($view->vars['disabled']) && $view->vars['disabled']) || ($choiceView->vars['value'] === $targetClassName) ) { $choiceView->vars['disabled'] = true; } } } /** * {@inheritdoc} */ public function getName() { return 'oro_activity_multiple_association_choice'; } /** * {@inheritdoc} */ public function getParent() { return 'oro_entity_extend_multiple_association_choice'; } }
ramunasd/platform
src/Oro/Bundle/ActivityBundle/Form/Type/MultipleAssociationChoiceType.php
PHP
mit
1,402
[ 30522, 1026, 1029, 25718, 3415, 15327, 20298, 1032, 14012, 1032, 4023, 27265, 2571, 1032, 2433, 1032, 2828, 1025, 2224, 25353, 2213, 14876, 4890, 1032, 6922, 1032, 2433, 30524, 2224, 20298, 1032, 14012, 1032, 9178, 10288, 6528, 18939, 8630, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
$packageName = 'firefox-nightly' $softwareVersion = '50.0.1.2016062312-alpha' -Replace "^(\d+)\.(\d+)\.(\d+)[^-]+-([a-z]).*",'$1.$2$4$3' $softwareName = "Nightly $softwareVersion*" $installerType = 'exe' $silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' $validExitCodes = @(0) [array]$key = Get-UninstallRegistryKey -SoftwareName $softwareName $key | ForEach-Object {   Uninstall-ChocolateyPackage -PackageName $packageName `                               -FileType $installerType `                               -SilentArgs $($silentArgs) `                               -File $($_.UninstallString.Replace('"','')) `                               -ValidExitCodes $validExitCodes }
dtgm/chocolatey-packages
automatic/_output/firefox-nightly/50.0.1.2016062312/tools/chocolateyUninstall.ps1
PowerShell
apache-2.0
820
[ 30522, 1002, 7427, 18442, 1027, 1005, 2543, 14876, 2595, 1011, 22390, 1005, 1002, 4007, 27774, 1027, 1005, 2753, 1012, 1014, 1012, 1015, 1012, 2355, 2692, 2575, 21926, 12521, 1011, 6541, 1005, 1011, 5672, 1000, 1034, 1006, 1032, 1040, 1009,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Asad\Core\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class AsadCoreBundle extends Bundle { }
moinulcseduet/symfony-json-version
src/Asad/Core/Bundle/AsadCoreBundle.php
PHP
mit
125
[ 30522, 1026, 1029, 25718, 3415, 15327, 17306, 2094, 1032, 4563, 1032, 14012, 1025, 2224, 25353, 2213, 14876, 4890, 1032, 6922, 1032, 8299, 5484, 11877, 1032, 14012, 1032, 14012, 1025, 2465, 17306, 16409, 5686, 27265, 2571, 8908, 14012, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"use strict"; const test = require("tape"); const aceyDeuceyGameEngine = require("../"); const getInitialGameState = aceyDeuceyGameEngine.getInitialGameState; test("getInitialGameState", t => { t.plan(1); const gameState = { board: [ {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0}, {isPlayerOne: null, numPieces: 0} ], isPlayerOne: true, playerOne: { initialPieces: 15, barPieces: 0, winningPieces: 0 }, playerTwo: { initialPieces: 15, barPieces: 0, winningPieces:0 } }; t.deepEqual(getInitialGameState(), gameState, "returns the correct gameState object"); });
KatherineThompson/acey-deucey-game-engine
tests/get-initial-game-state.test.js
JavaScript
mit
1,758
[ 30522, 1000, 2224, 9384, 1000, 1025, 9530, 3367, 3231, 1027, 5478, 1006, 1000, 6823, 1000, 1007, 1025, 9530, 3367, 9078, 18124, 18796, 2100, 16650, 13159, 3170, 1027, 5478, 1006, 1000, 1012, 1012, 1013, 1000, 1007, 1025, 9530, 3367, 2131, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package net.sf.bitumen.util; public interface IFactory<T> { public T createInstance(); }
kumarshantanu/bitumen
src/main/java/net/sf/bitumen/util/IFactory.java
Java
epl-1.0
96
[ 30522, 7427, 5658, 1012, 16420, 1012, 2978, 27417, 1012, 21183, 4014, 1025, 2270, 8278, 2065, 18908, 10253, 1026, 1056, 1028, 1063, 2270, 1056, 3443, 7076, 26897, 1006, 1007, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
.App { text-align: center; } .App-header { background-color: #222; height: 100px; padding: 20px; color: white; position: relative; }
a12k/react-tetris
src/styles/App.css
CSS
gpl-3.0
146
[ 30522, 1012, 10439, 1063, 3793, 1011, 25705, 1024, 2415, 1025, 1065, 1012, 10439, 1011, 20346, 1063, 4281, 1011, 3609, 1024, 1001, 19015, 1025, 4578, 1024, 2531, 2361, 2595, 1025, 11687, 4667, 1024, 2322, 2361, 2595, 1025, 3609, 1024, 2317,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Copyright 2013 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from shotgun.settings import LOG_FILE def configure_logger(): """Configures shotgun logger """ logger = logging.getLogger('shotgun') logger.setLevel(logging.DEBUG) formatter = logging.Formatter( '%(asctime)s %(levelname)s %(process)d (%(module)s) %(message)s', "%Y-%m-%d %H:%M:%S") stream_handler = logging.StreamHandler() stream_handler.setLevel(logging.DEBUG) stream_handler.setFormatter(formatter) file_handler = logging.FileHandler(LOG_FILE) file_handler.setLevel(logging.DEBUG) file_handler.setFormatter(formatter) logger.addHandler(stream_handler) logger.addHandler(file_handler)
prmtl/fuel-web
shotgun/shotgun/logger.py
Python
apache-2.0
1,285
[ 30522, 1001, 9385, 2286, 18062, 16778, 2015, 1010, 4297, 1012, 1001, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 1001, 2025, 2224, 2023, 5371, 3272, 1999, 12646, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ROLES = { -- WORRIER: Close-combat specialist worrier = { name = "Worrier", description = "A powerful fighter who might be\na bit too kind for their own good.", level_cap = 20, hp = 24, hp_growth = 0.52, mp = 11, mp_growth = 0.32, str = 18, int = 9, dex = 12, con = 13, exp_to_2 = 4, exp_modifier = 0.92, pts_per_lv = 2, spellbooks = { SPBOOKS.divine }, spell_lv_table = { 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3 }, skillsets = { "Alchemy", "Pugilism" }, skill_lv_table = { 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5 }, special = false } } --[[ [ROLES] Roles represent the different possible jobs, classes, etc. available to your players. Each role can have different base statistics, growth rates, spellbooks, and skillsets. --DETAILS-- * name Represents the role's name, and how it is referred to in-game * description How the role is described in flavor text * level_cap The maximum level this role can reach * hp, mp The level 1 values for this class' health and mana pools * hp_growth, mp_growth The modifiers that increase health and mana every levelup. The default in actors.lua for the formula is: base pool + ((base pool * base pool growth) * (level - 1)) * str, int, dex, con The initial values for each of the base statistics. These do not grow automatically like health or mana, but instead are raised manually by the player with stat points. * exp_to_2 The amount of experience that would be needed to reach level 2. This is used in algorithms to determine exp to next level * exp_modifier Used with exp_to_2 and the character's level to determine the exp needed to reach the next level * pts_per_lv The amount of stat points the character obtains every level that can be spent raising statistics. * spellbooks Table of spellbooks available to this role. This role will have access to all spells in these spellbooks of their current spell level, unless they are one of the spell's restricted roles. * spell_lv_table Table that represents a role's spell level at a given character level. Characters can only cast spells at a level at or below their spell level, and this also modifies their competency with spells in general. Make sure that this table is as long as the role's level cap. * skillsets Table of skillsets available to this role. This role will be able to use any skills in these skillsets of their current skill level, unless they are one of the skill's restricted roles. * skill_lv_table Table that represents a role's skill level at a given character level. Characters can only use skills at a level at or below their skill level, and this also modifies their competency with skills in general. Make sure that this table is as long as the role's level cap. * special Boolean flag that represents whether this role is restricted during character creation. Useful for "prestige" roles, or those you want to be unique to a character. --]]
MkNiz/Love2Crawl
tables/roles.lua
Lua
mit
3,340
[ 30522, 4395, 1027, 1063, 1011, 1011, 24185, 27051, 1024, 2485, 1011, 4337, 8325, 24185, 27051, 1027, 1063, 2171, 1027, 1000, 24185, 27051, 1000, 1010, 6412, 1027, 1000, 1037, 3928, 4959, 2040, 2453, 2022, 1032, 6583, 2978, 2205, 2785, 2005,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
const times = require('lodash/times'); const {GameEngine} = require('../../lib/common/engine'); const {R, G, B, _} = require('../../lib/common/panel-league/util'); module.exports.testAdd = ((test) => { const game = new GameEngine(); game.addEvent({ time: 0, type: 'addGarbage', slab: {x: 0, width: game.width, height: 1} }); game.step(); const state = game.step(); test.expect(1); test.strictEqual(state.garbage.length, 1, "No garbage slab found"); test.done(); }); module.exports.testFit = ((test) => { const game = new GameEngine({initialRows: 0, width: 6}); game.addEvent({ time: 0, type: 'addGarbage', slab: {x: 0, width: 2, height: 1} }); game.addEvent({ time: 1, type: 'addGarbage', slab: {x: 2, width: 2, height: 2} }); times(100, () => game.step()); state = game.step(); test.expect(6); for (let i = 0; i < 4; ++i) { test.ok(state.blocks[i + state.width * (state.height - 1)].color, "Empty block found"); } for (let i = 4; i < 6; ++i) { test.ok(!state.blocks[i + state.width * (state.height - 1)].color, "Non-empty block found"); } test.done(); }); module.exports.testOverhang = ((test) => { const game = new GameEngine({initialRows: 0}); game.addEvent({ time: 0, type: 'addGarbage', slab: {x: 0, width: 1, height: 2} }); game.addEvent({ time: 1, type: 'addGarbage', slab: {x: 0, width: game.width, height: 2} }); times(100, () => game.step()); state = game.step(); test.expect(2 * game.width - 1); for (let i = 1; i < game.width; ++i) { test.ok(!state.blocks[i + state.width * (state.height - 1)].color, "Non-empty block found"); } for (let i = 0; i < game.width; ++i) { test.ok(state.blocks[i + state.width * (state.height - 3)].color, "Empty block found"); } test.done(); }); module.exports.testShock = ((test) => { setup = [ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, G, R, G, G, B, B, ]; const game = new GameEngine({width: 6, height: 5, colors: setup}); game.addEvent({ time: 0, type: 'addGarbage', slab: {x: 0, width: game.width, height: 2} }); game.addEvent({ time: 1, type: 'addGarbage', slab: {x: 0, width: game.width, height: 2} }); game.addEvent({ time: 101, type: 'swap', index: 24 }); test.expect(2 + 2 * game.width); times(99, () => game.step()); let state = game.step(); let numGarbage = state.blocks.reduce((sum, block) => sum + block.garbage, 0); test.strictEqual(numGarbage, game.width * 4, 'Not enough garbage found'); times(99, () => game.step()); state = game.step(); numGarbage = state.blocks.reduce((sum, block) => sum + block.garbage, 0); test.strictEqual(numGarbage, game.width * 2, 'Garbage not released correctly'); // We don't control RNG here so prepare for rare matches. const shift = game.width * !state.blocks[0].color; for (let i = 0; i < game.width; ++i) { test.ok(state.blocks[i + shift].garbage, "Garbage not preserved"); test.ok(!state.blocks[i + game.width + shift].garbage, "Garbage not released"); } test.done(); });
frostburn/panel-league
test/panel-league/test-garbage.js
JavaScript
mit
3,160
[ 30522, 9530, 3367, 2335, 1027, 5478, 1006, 1005, 8840, 8883, 2232, 1013, 2335, 1005, 1007, 1025, 9530, 3367, 1063, 2208, 13159, 3170, 1065, 1027, 5478, 1006, 1005, 1012, 1012, 1013, 1012, 1012, 1013, 5622, 2497, 1013, 2691, 1013, 3194, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright © 2017-2019 Cask Data, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package io.cdap.directives.transformation; import io.cdap.cdap.api.annotation.Description; import io.cdap.cdap.api.annotation.Name; import io.cdap.cdap.api.annotation.Plugin; import io.cdap.wrangler.api.Arguments; import io.cdap.wrangler.api.Directive; import io.cdap.wrangler.api.DirectiveExecutionException; import io.cdap.wrangler.api.DirectiveParseException; import io.cdap.wrangler.api.ExecutorContext; import io.cdap.wrangler.api.Row; import io.cdap.wrangler.api.annotations.Categories; import io.cdap.wrangler.api.parser.ColumnName; import io.cdap.wrangler.api.parser.TokenType; import io.cdap.wrangler.api.parser.UsageDefinition; import java.util.List; /** * A Wrangler step for upper casing the 'column' value of type String. */ @Plugin(type = Directive.TYPE) @Name(Upper.NAME) @Categories(categories = { "transform"}) @Description("Changes the column values to uppercase.") public class Upper implements Directive { public static final String NAME = "uppercase"; // Columns of the column to be upper-cased private String column; @Override public UsageDefinition define() { UsageDefinition.Builder builder = UsageDefinition.builder(NAME); builder.define("column", TokenType.COLUMN_NAME); return builder.build(); } @Override public void initialize(Arguments args) throws DirectiveParseException { this.column = ((ColumnName) args.value("column")).value(); } @Override public void destroy() { // no-op } @Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { int idx = row.find(column); if (idx != -1) { Object object = row.getValue(idx); if (object instanceof String) { if (object != null) { String value = (String) object; row.setValue(idx, value.toUpperCase()); } } } } return rows; } }
hydrator/wrangler
wrangler-core/src/main/java/io/cdap/directives/transformation/Upper.java
Java
apache-2.0
2,549
[ 30522, 1013, 1008, 1008, 9385, 1075, 2418, 1011, 10476, 25222, 2243, 2951, 1010, 4297, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 1008, 2224, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `EGLint` type in crate `glutin`."> <meta name="keywords" content="rust, rustlang, rust-lang, EGLint"> <title>glutin::api::egl::ffi::EGLint - Rust</title> <link rel="stylesheet" type="text/css" href="../../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../../../index.html'>glutin</a>::<wbr><a href='../../index.html'>api</a>::<wbr><a href='../index.html'>egl</a>::<wbr><a href='index.html'>ffi</a></p><script>window.sidebarCurrent = {name: 'EGLint', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content type"> <h1 class='fqn'><span class='in-band'><a href='../../../index.html'>glutin</a>::<wbr><a href='../../index.html'>api</a>::<wbr><a href='../index.html'>egl</a>::<wbr><a href='index.html'>ffi</a>::<wbr><a class='type' href=''>EGLint</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-5358' class='srclink' href='../../../../src/glutin/api/egl/ffi.rs.html#26' title='goto source code'>[src]</a></span></h1> <pre class='rust typedef'>type EGLint = <a class='type' href='../../../../libc/types/common/c99/type.int32_t.html' title='libc::types::common::c99::int32_t'>int32_t</a>;</pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../../../"; window.currentCrate = "glutin"; window.playgroundUrl = ""; </script> <script src="../../../../jquery.js"></script> <script src="../../../../main.js"></script> <script async src="../../../../search-index.js"></script> </body> </html>
susaing/doc.servo.org
glutin/api/egl/ffi/type.EGLint.html
HTML
mpl-2.0
4,132
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 418...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Acacia procera (Roxb.) Willd. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Albizia/Albizia procera/ Syn. Acacia procera/README.md
Markdown
apache-2.0
186
[ 30522, 1001, 24766, 4013, 19357, 1006, 20996, 2595, 2497, 1012, 1007, 2097, 2094, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 10675, 1001, 1001, 1001, 1001, 2429, 2000, 1996, 10161, 1997, 2166, 1010, 3822, 2254, 2249, 1001, 1001, 1001, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// client.express.js JavaScript Routing, version: 0.3.4 // (c) 2011 Mark Nijhof // // Released under MIT license. // ClientExpress={};ClientExpress.createServer=function(){return new ClientExpress.Server};ClientExpress.supported=function(){return typeof window.history.pushState=="function"};ClientExpress.logger=function(){return function(){var c=new ClientExpress.Logger;this.eventBroker.addListener("onLog",function(a){a.arguments.shift()=="warning"?c.warning(a.arguments):c.information(a.arguments)})}}; ClientExpress.setTitle=function(c){var a=c&&c.titleArgument;return function(){this.eventBroker.addListener("onRequestProcessed",function(c){var e;e=c.response.title;a&&c.args[a]&&(e=c.args[a]);if(e)document.title=e})}}; ClientExpress.Server=function(){var c=0,a=function(){this.version="0.3.4";this.id=[(new Date).valueOf(),c++].join("-");this.settings={};this.templateEngines={};this.router=new ClientExpress.Router;this.eventListener=new ClientExpress.EventListener;this.eventBroker=new ClientExpress.EventBroker(this);this.session={};this.content_target_element=document.childNodes[1];this.setup_functions=[];this.log=function(){this.eventBroker.fire({type:"Log",arguments:ClientExpress.utils.toArray(arguments)})}; this.eventBroker.addListener("onProcessRequest",e);this.eventBroker.addListener("onRequestProcessed",b);this.eventBroker.addListener("onRender",f);this.eventBroker.addListener("onSend",h);this.eventBroker.addListener("onRedirect",i)};a.prototype.content_target_area=function(d){var b=this;return function(){var a=document.getElementById?document.getElementById(d):document.all?document.all[d]:document.layers?document.layers[d]:null;b.content_target_element=a||document.childNodes[1];b.content_target_element== document.childNodes[1]&&this.log("warning",'Element "',d,'" could not be located!')}};a.prototype.configure=function(d,b){typeof d=="function"?this.setup_functions.push(d):this.setup_functions.push(function(){server.enabled(d)&&b.call()})};a.prototype.use=function(d,b){if(typeof d=="function")d.call(this);else{d[d.length-1]==="/"&&(d=d.substring(0,d.length-1));var a=function(d,b){if(b=="/")return d;if(b.substr(0,1)!="/")return d+"/"+b;return d+b},f=this,h=b.router.routes;ClientExpress.utils.forEach(h.get, function(b){g(f,b.method,a(d,b.path),b.action,d)});ClientExpress.utils.forEach(h.post,function(b){g(f,b.method,a(d,b.path),b.action,d)});ClientExpress.utils.forEach(h.put,function(b){g(f,b.method,a(d,b.path),b.action,d)});ClientExpress.utils.forEach(h.del,function(b){g(f,b.method,a(d,b.path),b.action,d)})}};a.prototype.set=function(d,b){if(b===void 0)if(this.settings.hasOwnProperty(d))return this.settings[d];else{if(this.parent)return this.parent.set(d)}else return this.settings[d]=b,this};a.prototype.enable= function(d){this.settings.hasOwnProperty(d);this.settings[d]=!0};a.prototype.disable=function(d){this.settings.hasOwnProperty(d);this.settings[d]=!1};a.prototype.enabled=function(d){return this.settings.hasOwnProperty(d)&&this.settings[d]};a.prototype.disabled=function(d){return this.settings.hasOwnProperty(d)&&!this.settings[d]};a.prototype.register=function(d,b){if(b===void 0)if(this.templateEngines.hasOwnProperty(d))return this.templateEngines[d];else{if(this.parent)return this.parent.set(d)}else return this.templateEngines[d]= b,this};a.prototype.get=function(d,b){return g(this,"get",d,b,"")};a.prototype.post=function(d,b){return g(this,"post",d,b,"")};a.prototype.put=function(d,b){return g(this,"put",d,b,"")};a.prototype.del=function(b,a){return g(this,"del",b,a,"")};var g=function(b,a,f,h,c){b.router.registerRoute(a,f,h,c);return b};a.prototype.listen=function(){if(ClientExpress.supported()){var b=this;ClientExpress.onDomReady(function(){ClientExpress.utils.forEach(b.setup_functions,function(a){a.call(b)});b.eventListener.registerEventHandlers(b); var a=new ClientExpress.Request({method:"get",fullPath:window.location.pathname,title:document.title,session:b.session,delegateToServer:function(){window.location.pathname=window.location.pathname}});history.replaceState(a,a.title,a.location());b.log("information","Listening");a=b.router.routes.get.concat(b.router.routes.post.concat(b.router.routes.put.concat(b.router.routes.del))).sortByName("path");ClientExpress.utils.forEach(a,function(a){b.log("information","Route registered:",a.method.toUpperCase().lpad(" "), a.path)})})}else this.log("information","Not supported on this browser")};var e=function(b){var a=b.request,f=this.router.match(a.method,a.path);f.resolved()?(this.log("information",200,a.method.toUpperCase().lpad(" "),a.path),a.attachRoute(f),b=new ClientExpress.Response(a,this),f.action(a,b)):(this.log("information",404,a.method.toUpperCase().lpad(" "),a.path),b.request.delegateToServer())},b=function(b){if(!b.request.isHistoryRequest&&!b.request.isRedirect)b=b.request,history.pushState(b, b.title,b.location())},f=function(b){var a=this.settings["view engine"]||"",f=(this.settings.views||"")+b.template;f.lastIndexOf(".")!=-1&&f.lastIndexOf(".")<=4&&(a=f.substr(f.lastIndexOf(".")-1,f.length),f=f.substr(0,f.lastIndexOf(".")-1));a=a||this.settings["view engine"]||"";a!=""&&(a="."+a,f+=a);b.target_element.innerHTML=this.templateEngines[a].compile(f,b.args);this.eventBroker.fire({type:"RequestProcessed",request:b.request,response:b.response,target_element:b.target_element,args:b.args||{}})}, h=function(b){b.target_element.innerHTML=b.content;this.eventBroker.fire({type:"RequestProcessed",request:b.request,response:b.response,target_element:b.target_element,args:{}})},i=function(b){this.log("information",302,"GET ",b.path);this.eventBroker.fire({type:"ProcessRequest",request:new ClientExpress.Request({method:"get",fullPath:b.path,title:"",isRedirect:!0,session:b.request.session,delegateToServer:function(){window.location.pathname=b.path}})});this.eventBroker.fire({type:"RequestProcessed", request:b.request,response:b.response,target_element:b.target_element,args:{}})};return a}(); ClientExpress.Route=function(){function c(a,c,b){if(a instanceof RegExp)return a;a=a.concat("/?").replace(/\/\(/g,"(?:/").replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g,function(b,a,g,d,k,j){c.push({name:d,optional:!!j});a=a||"";return""+(j?"":a)+"(?:"+(j?a:"")+(g||"")+(k||"([^/]+?)")+")"+(j||"")}).replace(/([\/.])/g,"\\$1").replace(/\*/g,"(.+)");return RegExp("^"+a+"$",b?"":"i")}var a=function(a,e,b,f,h){this.resolved=function(){return!0};this.method=a;this.path=e;this.action=b;this.base_path=f; this.params=[];this.regexp=c(e,this.keys=[],h.sensitive)};a.prototype.match=function(a){return this.regexp.exec(a)};return a}(); ClientExpress.Router=function(){var c=function(){this.routes={get:[],post:[],put:[],del:[]}};c.prototype.match=function(a,c){for(var e=this.routes[a].length,b=0;b<e;++b){var f=this.routes[a][b];if(captures=f.match(c)){keys=f.keys;f.params=[];e=1;for(b=captures.length;e<b;++e){var h=keys[e-1],i="string"==typeof captures[e]?decodeURIComponent(captures[e]):captures[e];h?f.params[h.name]=i:f.params.push(i)}return f}}return{resolved:function(){return!1}}};c.prototype.registerRoute=function(a,c,e,b){this.routes[a].push(new ClientExpress.Route(a, c,e,b,{sensitive:!1}))};return c}(); ClientExpress.EventBroker=function(){var c=function(a){this.server=a;this.eventListeners={}};c.prototype.addListener=function(a,c){typeof this.eventListeners[a]=="undefined"&&(this.eventListeners[a]=[]);this.eventListeners[a].push(c)};c.prototype.removeListener=function(a,c){if(this.eventListeners[a]instanceof Array){var e=this.eventListeners[a];e.forEach(function(b,a){b===c&&e.splice(a,1)})}};c.prototype.fire=function(a){typeof a=="string"&&(a={type:a});if(!a.target)a.target=this.server;if(!a.type)throw Error("Event object missing 'type' property."); a.type="on"+a.type;this.eventListeners[a.type]instanceof Array&&this.eventListeners[a.type].forEach(function(c){c.call(this.server,a)})};return c}(); ClientExpress.EventListener=function(){var c=function(){};c.prototype.registerEventHandlers=function(b){a(b);g(b);e(b)};var a=function(b){document.onclick=function(a){a=a||window.event;var c=a.target||a.srcElement;if(c.tagName.toLowerCase()=="a")return a=new ClientExpress.Request({method:"get",fullPath:c.href,title:c.title||"",session:b.session,delegateToServer:function(){c.href.indexOf("://")!=-1?window.location=c.href:window.location.pathname=c.href}}),b.eventBroker.fire({type:"ProcessRequest", request:a}),!1}},g=function(b){document.onsubmit=function(a){a=a||window.event;var c=a.target||a.srcElement;if(c.tagName.toLowerCase()=="form")return a=new ClientExpress.Request({method:c.method,fullPath:[c.action,ClientExpress.utils.serializeArray(c)].join("?"),title:c.title,session:b.session,delegateToServer:function(){c.submit()}}),b.eventBroker.fire({type:"ProcessRequest",request:a}),!1}},e=function(b){window.onpopstate=function(a){if(a.state)a=a.state,a.__proto__=ClientExpress.Request.prototype, a.HistoryRequest(),b.eventBroker.fire({type:"ProcessRequest",request:a})}};return c}(); ClientExpress.Request=function(){var c=function(a){var c=this;this.isHistoryRequest=!1;this.session=a.session;this.body={};this.title=a.title;this.params=[];this.base_path="";this.isRedirect=a.isRedirect||!1;(this.queryString=a.fullPath.split("?")[1])&&ClientExpress.utils.forEach(this.queryString.split("&"),function(a){var b=a.split("=")[0];a=a.split("=")[1];var f;if(f=/^(\w+)\[(\w+)\]/.exec(b)){var h=f[1];b=f[2];f=c.body[h]||{};f[b]=a;c.body[h]=f}else c.body[b]=a});this.method=(this.body._method|| a.method).toLowerCase();this.path=a.fullPath.replace(/\?.+$/,"").replace(window.location.protocol+"//"+window.location.host,"");this.delegateToServer=a.delegateToServer||function(){}};c.prototype.attachRoute=function(a){this.params=a.params;this.base_path=a.base_path};c.prototype.location=function(){return this.method==="get"?this.path:""};c.prototype.HistoryRequest=function(){this.isHistoryRequest=!0};return c}(); ClientExpress.Response=function(){var c=function(a,c){this.request=a;this.server=c;this.output=this.redirect_path="";this.title=a.title};c.prototype.send=function(a){this.server.eventBroker.fire({type:"Send",request:this.request,response:this,target_element:this.server.content_target_element,content:a})};c.prototype.render=function(a,c){this.server.eventBroker.fire({type:"Render",request:this.request,response:this,target_element:this.server.content_target_element,template:a,args:c})};c.prototype.redirect= function(a){this.server.eventBroker.fire({type:"Redirect",request:this.request,response:this,path:(a.substr(0,1)=="/"?this.request.base_path:"")+a})};return c}();ClientExpress.Logger=function(){var c=function(){};c.prototype.error=function(){window.console&&console.error(arguments[0].join(" "))};c.prototype.information=function(){window.console&&console.log(arguments[0].join(" "))};c.prototype.warning=function(){window.console&&console.warn(arguments[0].join(" "))};return c}(); String.prototype.rpad=function(c){return c.substr(0,c.length-this.length)+this};String.prototype.lpad=function(c){return this+c.substr(0,c.length-this.length)}; ClientExpress.utils=function(){var c=Array.prototype.every?function(b,a,c){return b.every(a,c)}:function(b,a,c){if(b===void 0||b===null)throw new TypeError;b=Object(b);var i=b.length>>>0;if(typeof a!=="function")throw new TypeError;for(var d=0;d<i;d++)if(d in b&&!a.call(c,b[d],d,b))return!1;return!0},a=Array.prototype.forEach?function(b,a,c){return b.forEach(a,c)}:function(b,a,c){if(b===void 0||b===null)throw new TypeError;b=Object(b);var i=b.length>>>0;if(typeof a!=="function")throw new TypeError; for(var d=0;d<i;d++)d in b&&a.call(c,b[d],d,b)},g=Array.prototype.filter?function(b,a,c){return b.filter(a,c)}:function(b,a,c){if(b===void 0||b===null)throw new TypeError;b=Object(b);var i=b.length>>>0;if(typeof a!=="function")throw new TypeError;for(var d=[],e=0;e<i;e++)if(e in b){var g=b[e];a.call(c,g,e,b)&&d.push(g)}return d},e=Array.prototype.map?function(b,a,c){return b.map(a,c)}:function(b,a,c){if(b===void 0||b===null)throw new TypeError;b=Object(b);var e=b.length>>>0;if(typeof a!=="function")throw new TypeError; for(var d=Array(e),g=0;g<e;g++)g in b&&(d[g]=a.call(c,b[g],g,b));return d};if(!Array.prototype.sortByName)Array.prototype.sortByName=function(b){if(this===void 0||this===null)throw new TypeError;if(typeof b!=="string")throw new TypeError;return this.sort(function(a,c){var e=a[b].toLowerCase(),d=c[b].toLowerCase();return e<d?-1:e>d?1:0})};return{every:c,forEach:a,filter:g,map:e,toArray:function(a,c){return Array.prototype.slice.call(a,c||0)},serializeArray:function(a){var c="";a=a.getElementsByTagName("*"); for(var e=0;e<a.length;e++){var g=a[e];if(!g.disabled&&g.name&&g.name.length>0)switch(g.tagName.toLowerCase()){case "input":switch(g.type){case "checkbox":case "radio":g.checked&&(c.length>0&&(c+="&"),c+=g.name+"="+encodeURIComponent(g.value));break;case "hidden":case "password":case "text":c.length>0&&(c+="&"),c+=g.name+"="+encodeURIComponent(g.value)}break;case "select":case "textarea":c.length>0&&(c+="&"),c+=g.name+"="+encodeURIComponent(g.value)}}return c},objectIterator:function(a,c){for(var e in a)callBackValue= {isFunction:a[e]instanceof Function,name:e,value:a[e]},c(callBackValue)}}}();
MarkNijhof/client.express.js
dist/client.express-0.3.4.min.js
JavaScript
mit
13,207
[ 30522, 1013, 1013, 7396, 1012, 4671, 1012, 1046, 2015, 9262, 22483, 16972, 1010, 2544, 1024, 1014, 1012, 1017, 1012, 1018, 1013, 1013, 1006, 1039, 1007, 2249, 2928, 9152, 3501, 14586, 1013, 1013, 1013, 1013, 2207, 2104, 10210, 6105, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_COMPILER_MLIR_TOSA_TFL_PASSES_H_ #define TENSORFLOW_COMPILER_MLIR_TOSA_TFL_PASSES_H_ #include "mlir/Pass/PassManager.h" // from @llvm-project #include "mlir/Pass/PassOptions.h" // from @llvm-project namespace mlir { namespace tosa { struct TOSATFLLegalizationPipelineOptions : public PassPipelineOptions<TOSATFLLegalizationPipelineOptions> {}; // Legalizes TFL (TensorFlow lite) dialect(s) to Tosa. void createTFLtoTOSALegalizationPipeline( OpPassManager& pm, const TOSATFLLegalizationPipelineOptions& opts); } // namespace tosa } // namespace mlir #endif // TENSORFLOW_COMPILER_MLIR_TOSA_TFL_PASSES_H_
sarvex/tensorflow
tensorflow/compiler/mlir/tosa/tfl_passes.h
C
apache-2.0
1,311
[ 30522, 1013, 1008, 9385, 12609, 1996, 23435, 12314, 6048, 1012, 2035, 2916, 9235, 1012, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'use strict'; describe('heroList', function(){ //Load module that contains the heroList component beforeEach(module('heroList')); describe('HeroListController', function(){ it('should create a `heroes` model with 6 heroes', inject(function($componentController){ var ctrl = $componentController('heroList'); expect(ctrl.heroes.length).toBe(6); })); }); });
MichaelRandall/heroes-villians
app/hero-list/hero-list.component.spec.js
JavaScript
mit
377
[ 30522, 1005, 2224, 9384, 1005, 1025, 6235, 1006, 1005, 5394, 9863, 1005, 1010, 3853, 1006, 1007, 1063, 1013, 1013, 7170, 11336, 2008, 3397, 1996, 5394, 9863, 6922, 2077, 5243, 2818, 1006, 11336, 1006, 1005, 5394, 9863, 1005, 1007, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Silverstripe Theme Framework ============= A default set of tools to create themes for Silverstripe with LESS. SiteConfig and Page extensions ------------- When adding this module, the ThemeSiteConfigExtension is activated on your SiteConfig. It will create a new theme tab where you can configure your theme. You can configure the base, primary and secondary colors of your theme and the logo/favicon. The ThemePageControllerExtension will make sure that: - You include jquery (and jquery ui if needed). It's always nice to have this loaded first to avoid any further inclusion which could break plugins (typically if loading the min version in place of the full version). - It will compile the styles if needed. Please note that the styles are only automatically refreshed in dev mode. Two conventions are used by the Theme Framework: - Your theme MUST include a "all.less" file in the css folder. This all.less must be compiled as a all.css file that will be used by default if no compiled style is found. - Your theme SHOULD include a "init.js" file in the javascript folder. All compiled styles are stored in assets/Theme folder to avoid versioning compiled versions of your theme. You can disable auto compile (which is slow if you are developing locally) by defining the following constant: define('THEME_FRAMEWORK_DISABLE_COMPILE',true); Ui Kit ------------- For webapps, I recommend using the Ui Kit framework to get most of what you need http://getuikit.com/ To enable, simply use the following yml config: ThemePageControllerExtension: uikit: enabled: true theme_enabled: false theme: 'almost-flat' You can choose to use a already compiled theme or use the less files. It is useful to use the less files if you want to overwrite variables based on your own color scheme. NOTE: don't forget that less variables are lazy evaluated, meaning that you can define variables AFTER importing the uikit.less NOTE: if you choose to import less files, you can import any of the base themes. For the icons, to avoid messing with paths, it's easier to copy the "fonts" directory right inside your theme folder Google Fonts ------------- By default the theme framework will load Open Sans as the default font. You can define the fonts of your choice or disabling this setting SiteConfig: google_fonts: 'Open+Sans:400italic,400,600&subset=latin,latin-ext' Noty ------------- The theme framework comes with a notification system that use Noty https://github.com/needim/noty Messages can also be pulled from the session by using SetSessionMessage method on the controller Outdated browsers ------------- This plugin is integrated and enabled by default with IE9 as a minimum https://github.com/burocratik/outdated-browser Icomoon ------------- This module comes bundled with a all Fontawesome. Feel free to include your own set of icons created through the online app: https://icomoon.io/app/ Default CSS for Silverstripe ------------- Libraries: - Mixins - Normalize Please note that since less files are compiled through php, your less librairies should not make use of Javascript functions (like Lesshat does). Default styles: - Layout - Typography - Form The css framework comes with a series of breakpoints that should fit most projects. You can check the "variables.less" files. The Grid ------------- This module includes a standalone grid system compatible with Silverstripe Forms How to create a theme? ------------- Create a theme as usual ! Simply include the less files you need. Typically, I'll have the following files: - all.less which includes all other files - typography.less - variables.less - layout.less - form.less - fonts.less - editor.less Include Theme Framework base less files in each, for instance in variables.less @import "../../../theme-framework/css/variables.less"; Or in layout.less @import "variables.less"; @import "../../../theme-framework/css/mixins.less"; @import "../../../theme-framework/css/layout.less"; Google Analytics Helper ------------- It is a common scenario to have Google Analytics in your project. Although modules exists to do so in Silverstripe, I always feel it is a bit of a shame to include a whole module just to add a snippet at the bottom of your pages. It is also a common scenario to let your user configure their tracking code. Therefore, this module comes with a little helper to include tracking code. Thirdparty libs ------------- Icon generator https://github.com/chrisbliss18/php-ico Less compiler https://github.com/oyejorge/less.php Compatibility ============= Tested with 3.1 Maintainer ========== LeKoala - thomas@lekoala.be
lekoala/silverstripe-theme-framework
README.md
Markdown
mit
4,667
[ 30522, 3165, 3367, 29443, 2063, 4323, 7705, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1037, 12398, 2275, 1997, 5906, 2000, 3443, 6991, 2005, 3165, 3367, 29443, 2063, 2007, 2625, 1012, 2609, 8663, 8873, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ /* */ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.nio.charset.CoderResult; import sun.nio.cs.Surrogate; /** * An abstract base class for subclasses which encodes * IBM double byte host encodings such as ibm code * pages 942,943,948, etc. * */ public abstract class DBCS_IBM_EBCDIC_Encoder extends CharsetEncoder { protected static final char REPLACE_CHAR='\uFFFD'; private byte b1; private byte b2; protected short index1[]; protected String index2; protected String index2a; protected int mask1; protected int mask2; protected int shift; private static final int SBCS = 0; private static final int DBCS = 1; private static final byte SO = 0x0e; private static final byte SI = 0x0f; private int currentState; private final Surrogate.Parser sgp = new Surrogate.Parser(); protected DBCS_IBM_EBCDIC_Encoder(Charset cs) { super(cs, 4.0f, 5.0f, new byte[] {(byte)0x6f}); } protected void implReset() { currentState = SBCS; } protected CoderResult implFlush(ByteBuffer out) { if (currentState == DBCS) { if (out.remaining() < 1) return CoderResult.OVERFLOW; out.put(SI); } implReset(); return CoderResult.UNDERFLOW; } /** * Returns true if the given character can be converted to the * target character encoding. */ public boolean canEncode(char ch) { int index; int theBytes; index = index1[((ch & mask1) >> shift)] + (ch & mask2); if (index < 15000) theBytes = (int)(index2.charAt(index)); else theBytes = (int)(index2a.charAt(index-15000)); if (theBytes != 0) return (true); // only return true if input char was unicode null - all others are // undefined return( ch == '\u0000'); } private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) { char[] sa = src.array(); int sp = src.arrayOffset() + src.position(); int sl = src.arrayOffset() + src.limit(); byte[] da = dst.array(); int dp = dst.arrayOffset() + dst.position(); int dl = dst.arrayOffset() + dst.limit(); int outputSize = 0; // size of output int spaceNeeded; try { while (sp < sl) { int index; int theBytes; char c = sa[sp]; if (Surrogate.is(c)) { if (sgp.parse(c, sa, sp, sl) < 0) return sgp.error(); return sgp.unmappableResult(); } if (c >= '\uFFFE') return CoderResult.unmappableForLength(1); index = index1[((c & mask1) >> shift)] + (c & mask2); if (index < 15000) theBytes = (int)(index2.charAt(index)); else theBytes = (int)(index2a.charAt(index-15000)); b1= (byte)((theBytes & 0x0000ff00)>>8); b2 = (byte)(theBytes & 0x000000ff); if (b1 == 0x00 && b2 == 0x00 && c != '\u0000') { return CoderResult.unmappableForLength(1); } if (currentState == DBCS && b1 == 0x00) { if (dl - dp < 1) return CoderResult.OVERFLOW; currentState = SBCS; da[dp++] = SI; } else if (currentState == SBCS && b1 != 0x00) { if (dl - dp < 1) return CoderResult.OVERFLOW; currentState = DBCS; da[dp++] = SO; } if (currentState == DBCS) spaceNeeded = 2; else spaceNeeded = 1; if (dl - dp < spaceNeeded) return CoderResult.OVERFLOW; if (currentState == SBCS) da[dp++] = b2; else { da[dp++] = b1; da[dp++] = b2; } sp++; } return CoderResult.UNDERFLOW; } finally { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); } } private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { int mark = src.position(); int outputSize = 0; // size of output int spaceNeeded; try { while (src.hasRemaining()) { int index; int theBytes; char c = src.get(); if (Surrogate.is(c)) { if (sgp.parse(c, src) < 0) return sgp.error(); return sgp.unmappableResult(); } if (c >= '\uFFFE') return CoderResult.unmappableForLength(1); index = index1[((c & mask1) >> shift)] + (c & mask2); if (index < 15000) theBytes = (int)(index2.charAt(index)); else theBytes = (int)(index2a.charAt(index-15000)); b1 = (byte)((theBytes & 0x0000ff00)>>8); b2 = (byte)(theBytes & 0x000000ff); if (b1== 0x00 && b2 == 0x00 && c != '\u0000') { return CoderResult.unmappableForLength(1); } if (currentState == DBCS && b1 == 0x00) { if (dst.remaining() < 1) return CoderResult.OVERFLOW; currentState = SBCS; dst.put(SI); } else if (currentState == SBCS && b1 != 0x00) { if (dst.remaining() < 1) return CoderResult.OVERFLOW; currentState = DBCS; dst.put(SO); } if (currentState == DBCS) spaceNeeded = 2; else spaceNeeded = 1; if (dst.remaining() < spaceNeeded) return CoderResult.OVERFLOW; if (currentState == SBCS) dst.put(b2); else { dst.put(b1); dst.put(b2); } mark++; } return CoderResult.UNDERFLOW; } finally { src.position(mark); } } protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) { if (true && src.hasArray() && dst.hasArray()) return encodeArrayLoop(src, dst); else return encodeBufferLoop(src, dst); } }
TheTypoMaster/Scaper
openjdk/jdk/test/sun/nio/cs/OLD/DBCS_IBM_EBCDIC_Encoder.java
Java
gpl-2.0
8,255
[ 30522, 1013, 1008, 1008, 9385, 2494, 1011, 2294, 3103, 12702, 29390, 1010, 4297, 1012, 2035, 2916, 9235, 1012, 1008, 2079, 2025, 11477, 2030, 6366, 9385, 14444, 2030, 2023, 5371, 20346, 1012, 1008, 1008, 2023, 3642, 2003, 2489, 4007, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*********************************************************************** Copyright (c) 2014, Carnegie Mellon University All rights reserved. Authors: Jennifer King <jeking04@gmail.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************/ #include <boost/make_shared.hpp> #include <or_ompl/TSRRobot.h> #include <or_ompl/or_conversions.h> using namespace or_ompl; TSRRobot::TSRRobot(const std::vector<TSR::Ptr> &tsrs, const OpenRAVE::EnvironmentBasePtr &penv) : _tsrs(tsrs), _penv(penv), _initialized(false), _solver("GeneralIK") { } bool TSRRobot::construct() { if(_initialized){ RAVELOG_ERROR("[TSRRobot] Already initialized. TSRRobot::construct cannot be called twice."); throw OpenRAVE::openrave_exception( "TSRRobot::construct cannot be called twice", OpenRAVE::ORE_Failed ); } _initialized = false; // Create an emtpy robot of the correct type _probot = RaveCreateRobot(_penv, "GenericRobot"); if( _probot.get() == NULL ){ RAVELOG_ERROR("[TSRRobot] Failed to create robot of type GenericRobot"); return _initialized; } // TODO: mimic body // Build the robot std::vector<OpenRAVE::KinBody::LinkInfoConstPtr> link_infos; std::vector<OpenRAVE::KinBody::JointInfoConstPtr> joint_infos; std::vector<OpenRAVE::RobotBase::ManipulatorInfoConstPtr> manip_infos; std::vector<OpenRAVE::RobotBase::AttachedSensorInfoConstPtr> sensor_infos; const std::string bodyprefix = "Body"; int bodynumber = 1; Eigen::Affine3d Tw0_e = Eigen::Affine3d::Identity(); for(unsigned int i=0; i < _tsrs.size(); i++){ TSR::Ptr tsr = _tsrs[i]; Eigen::Matrix<double, 6, 2> Bw = tsr->getBounds(); if (tsr->relative_body_name() != "NULL") { RAVELOG_ERROR("[TSRRobot] ERROR: TSRs relative to a body is not supported.\n"); return _initialized; } for(int j=0; j < 6; j++){ // Don't add a body if there is no freedom in this dimension if(Bw(j,0) == 0.0 && Bw(j,1) == 0.0){ continue; } // If the bounds are equal and non-zero, we should do something reasonable // For now, this isn't supported if(Bw(j,0) == Bw(j,1)){ RAVELOG_ERROR("[TSRRobot] ERROR: TSR Chains are currently unable to deal with cases where two bounds are equal but non-zero, cannot robotize.\n"); return _initialized; } // Check for axis flip, marked by Bw values being backwards bool bFlipAxis = false; if(Bw(j,0) > Bw(j,1)){ Bw(j,0) = -Bw(j,0); Bw(j,1) = -Bw(j,1); bFlipAxis = true; } // TODO: Handle mimic joints // Store joint limits _lowerlimits.push_back(Bw(j,0)); _upperlimits.push_back(Bw(j,1)); // Create a Link std::string prev_bodyname = (boost::format("%s%d") % bodyprefix % (bodynumber-1)).str(); std::string bodyname = (boost::format("%s%d") % bodyprefix % bodynumber).str(); OpenRAVE::KinBody::LinkInfoPtr link_info = boost::make_shared<OpenRAVE::KinBody::LinkInfo>(); link_info->_name = bodyname; link_info->_t = toOR<double>(Tw0_e); // transform OpenRAVE::KinBody::GeometryInfoPtr geom_info = boost::make_shared<OpenRAVE::KinBody::GeometryInfo>(); if(j < 3){ geom_info->_type = OpenRAVE::GT_Box; }else{ geom_info->_type = OpenRAVE::GT_Cylinder; geom_info->_vGeomData = OpenRAVE::Vector(0.03, 0.07, 0.0); //cylinder radius, height, ignored } if(j == 0){ geom_info->_vGeomData = OpenRAVE::Vector(0.04, 0.02, 0.02); // box extents }else if(j == 1){ geom_info->_vGeomData = OpenRAVE::Vector(0.02, 0.04, 0.02); // box extents }else if(j == 2){ geom_info->_vGeomData = OpenRAVE::Vector(0.02, 0.02, 0.04); // box extents }else if(j == 3){ OpenRAVE::RaveTransformMatrix<OpenRAVE::dReal> t = OpenRAVE::geometry::matrixFromAxisAngle(OpenRAVE::Vector(0, 0, 1), 90.); geom_info->_t = t; }else if(j == 4){ OpenRAVE::RaveTransformMatrix<OpenRAVE::dReal> t = OpenRAVE::geometry::matrixFromAxisAngle(OpenRAVE::Vector(0, 1, 0), 90.); geom_info->_t = t; }else if(j == 5){ OpenRAVE::RaveTransformMatrix<OpenRAVE::dReal> t = OpenRAVE::geometry::matrixFromAxisAngle(OpenRAVE::Vector(1, 0, 0), 90.); geom_info->_t = t; } geom_info->_vDiffuseColor = OpenRAVE::Vector(0.3, 0.7, 0.3); link_info->_vgeometryinfos.push_back(geom_info); link_infos.push_back(link_info); // Now create a joint OpenRAVE::KinBody::JointInfoPtr joint_info = boost::make_shared<OpenRAVE::KinBody::JointInfo>(); std::string joint_name = (boost::format("J%d") % bodynumber).str(); joint_info->_name = joint_name; if(j < 3){ joint_info->_type = OpenRAVE::KinBody::JointSlider; }else{ joint_info->_type = OpenRAVE::KinBody::JointHinge; } joint_info->_linkname0 = prev_bodyname; joint_info->_linkname1 = bodyname; joint_info->_vweights[0] = 1.; joint_info->_vmaxvel[0] = 1.; joint_info->_vresolution[0] = 1.; joint_info->_vlowerlimit[0] = Bw(j,0); joint_info->_vupperlimit[0] = Bw(j,1); joint_info->_vaxes[0] = OpenRAVE::Vector(0., 0., 0.); unsigned int aidx = (j % 3); if(j > 3 && bFlipAxis){ joint_info->_vaxes[0][aidx] = -1.; }else{ joint_info->_vaxes[0][aidx] = 1.; } joint_infos.push_back(joint_info); bodynumber++; } Tw0_e = Tw0_e * tsr->getEndEffectorOffsetTransform(); } _num_dof = bodynumber - 1; // now add a geometry to the last body with the offset of the last TSR, this will be the target for the manipulator TSR::Ptr last_tsr = _tsrs.back(); Tw0_e = last_tsr->getEndEffectorOffsetTransform(); OpenRAVE::KinBody::LinkInfoPtr link_info = boost::make_shared<OpenRAVE::KinBody::LinkInfo>(); std::string bodyname = (boost::format("%s%d") % bodyprefix % (bodynumber-1)).str(); link_info->_name = bodyname; link_info->_bStatic = false; OpenRAVE::KinBody::GeometryInfoPtr geom_info = boost::make_shared<OpenRAVE::KinBody::GeometryInfo>(); geom_info->_t = toOR<double>(Tw0_e); geom_info->_type = OpenRAVE::GT_Sphere; geom_info->_vGeomData = OpenRAVE::Vector(0.03, 0., 0.); //radius, ignored, ignored geom_info->_vDiffuseColor = OpenRAVE::Vector(0.3, 0.7, 0.3); link_info->_vgeometryinfos.push_back(geom_info); link_infos.push_back(link_info); if(bodynumber > 1){ _point_tsr = false; OpenRAVE::RobotBase::ManipulatorInfoPtr manip_info = boost::make_shared<OpenRAVE::RobotBase::ManipulatorInfo>(); manip_info->_name = "dummy"; manip_info->_sBaseLinkName = (boost::format("%s0") % bodyprefix).str(); manip_info->_sEffectorLinkName = bodyname; manip_infos.push_back(manip_info); }else{ _point_tsr = true; RAVELOG_DEBUG("[TSRRobot] This is a point TSR, no robotized TSR needed."); _initialized = true; return _initialized; } if(_point_tsr && _tsrs.size() != 1){ RAVELOG_ERROR("[TSRRobot] Can't yet handle case where the TSRChain has no freedom but multiple TSRs, try making it a chain of length 1.\n"); _initialized = false; return _initialized; } // If we made it this far, then we can build the robot. _probot->Init(link_infos, joint_infos, manip_infos, sensor_infos); // Set the name properly std::string robotname = (boost::format("TSRChain%lu") % (unsigned long int) this).str(); _probot->SetName(robotname); // Add it to the environment _penv->Add(_probot, true); // Set the pose // TODO: mimic joint stuff _probot->SetTransform(toOR<double>(_tsrs[0]->getOriginTransform())); // Create an IK Solver _ik_solver = OpenRAVE::RaveCreateIkSolver(_penv, _solver); if(_ik_solver.get() == NULL){ RAVELOG_ERROR("[TSRRobot] Cannot create IK solver, make sure you have the GeneralIK plugin loadable by OpenRAVE\n"); _initialized = false; return _initialized; } // Grab the active manipulator on our newly created robot OpenRAVE::RobotBase::ManipulatorPtr pmanip = _probot->GetActiveManipulator(); _ik_solver->Init(pmanip); // Finally, disable the robot so we don't do collision checking against it _probot->Enable(false); _initialized = true; return _initialized; } Eigen::Affine3d TSRRobot::findNearestFeasibleTransform(const Eigen::Affine3d &Ttarget) { OpenRAVE::Transform or_target = toOR<double>(Ttarget); if(_solver.compare("GeneralIK") != 0){ RAVELOG_ERROR("[TSRRobot] Only GeneralIK solver supported."); throw OpenRAVE::openrave_exception( "Only GeneralIK solver supported.", OpenRAVE::ORE_Failed ); } // Setup the free parameters - the format and meaning of these is defined directly by // the IK solver - in our case GeneralIK std::vector<OpenRAVE::dReal> ikfreeparams; ikfreeparams.resize(12); ikfreeparams[0] = 1; // The number of targets - in this case always 1 ikfreeparams[1] = 0; // The manipulator associated the target - only one manipulator to always 0 // Pose of target ikfreeparams[2] = or_target.rot.x; ikfreeparams[3] = or_target.rot.y; ikfreeparams[4] = or_target.rot.z; ikfreeparams[5] = or_target.rot.w; ikfreeparams[6] = or_target.trans.x; ikfreeparams[7] = or_target.trans.y; ikfreeparams[8] = or_target.trans.z; ikfreeparams[9] = 0; // no balancing ikfreeparams[10] = 0; // junk parameters - mode in previous versions of GeneralIK ikfreeparams[11] = 0; // not translation only - aka do rotation std::vector<OpenRAVE::dReal> q0; boost::shared_ptr<std::vector<OpenRAVE::dReal> > solution = boost::make_shared<std::vector<OpenRAVE::dReal> >(); // solve ik _ik_solver->Solve(OpenRAVE::IkParameterization(), q0, ikfreeparams, OpenRAVE::IKFO_IgnoreSelfCollisions, solution); // Set the dof values to the solution and grab the end-effector transform in world coordinates _probot->SetDOFValues(*solution); Eigen::Affine3d ee_pose = toEigen(_probot->GetActiveManipulator()->GetEndEffectorTransform()); // Convert to proper frame Eigen::Affine3d closest = ee_pose * _tsrs.back()->getEndEffectorOffsetTransform(); return closest; }
personalrobotics/or_ompl
src/TSRRobot.cpp
C++
bsd-2-clause
12,546
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef __SDCPP_H #define __SDCPP_H #ifdef _WIN32 /* declaration of alloca */ #include <malloc.h> #include <string.h> #ifdef __BORLANDC__ #define strcasecmp stricmp #else #define strcasecmp _stricmp #endif #endif #define BYTES_BIG_ENDIAN 0 /* * From defaults.h */ #ifndef GET_ENVIRONMENT #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0) #endif /* Define results of standard character escape sequences. */ #define TARGET_BELL 007 #define TARGET_BS 010 #define TARGET_TAB 011 #define TARGET_NEWLINE 012 #define TARGET_VT 013 #define TARGET_FF 014 #define TARGET_CR 015 #define TARGET_ESC 033 #define CHAR_TYPE_SIZE 8 #define WCHAR_TYPE_SIZE 32 /* ? maybe ? */ #define SUPPORTS_ONE_ONLY 0 #define TARGET_OBJECT_SUFFIX ".rel" #ifndef WCHAR_UNSIGNED #define WCHAR_UNSIGNED 0 #endif /* * From langhooks.h */ struct diagnostic_context; struct lang_hooks { /* The first callback made to the front end, for simple initialization needed before any calls to handle_option. Return the language mask to filter the switch array with. */ unsigned int (*init_options) (unsigned int argc, const char **argv); /* Handle the switch CODE, which has real type enum opt_code from options.h. If the switch takes an argument, it is passed in ARG which points to permanent storage. The handler is responsible for checking whether ARG is NULL, which indicates that no argument was in fact supplied. For -f and -W switches, VALUE is 1 or 0 for the positive and negative forms respectively. Return 1 if the switch is valid, 0 if invalid, and -1 if it's valid and should not be treated as language-independent too. */ int (*handle_option) (size_t code, const char *arg, int value); /* Return false to use the default complaint about a missing argument, otherwise output a complaint and return true. */ bool (*missing_argument) (const char *opt, size_t code); /* Called when all command line options have been parsed to allow further processing and initialization Should return true to indicate that a compiler back-end is not required, such as with the -E option. If errorcount is nonzero after this call the compiler exits immediately and the finish hook is not called. */ bool (*post_options) (const char **); /* Called after post_options to initialize the front end. Return false to indicate that no further compilation be performed, in which case the finish hook is called immediately. */ bool (*init) (void); /* Called at the end of compilation, as a finalizer. */ void (*finish) (void); }; /* Each front end provides its own. */ extern const struct lang_hooks lang_hooks; /* * From toplev.h */ /* If we haven't already defined a frontend specific diagnostics style, use the generic one. */ #ifndef GCC_DIAG_STYLE #define GCC_DIAG_STYLE __gcc_tdiag__ #endif extern void internal_error (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; /* Pass one of the OPT_W* from options.h as the first parameter. */ extern void warning (int, const char *, ...) ATTRIBUTE_PRINTF_2; extern void error (const char *, ...) ATTRIBUTE_PRINTF_1; extern void fatal_error (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; extern void inform (const char *, ...) ATTRIBUTE_PRINTF_1; extern const char *progname; extern bool exit_after_options; extern void print_version (FILE *, const char *); /* Handle -d switch. */ extern void decode_d_option (const char *); /* Functions used to get and set GCC's notion of in what directory compilation was started. */ extern const char *get_src_pwd (void); extern bool set_src_pwd (const char *); /* * From flags.h */ /* Don't suppress warnings from system headers. -Wsystem-headers. */ extern bool warn_system_headers; /* If -Werror. */ extern bool warnings_are_errors; /* Nonzero for -pedantic switch: warn about anything that standard C forbids. */ /* Temporarily suppress certain warnings. This is set while reading code from a system header file. */ extern int in_system_header; /* Nonzero means `char' should be signed. */ extern int flag_signed_char; /* Nonzero means change certain warnings into errors. Usually these are warnings about failure to conform to some standard. */ extern int flag_pedantic_errors; /* * From options.h */ extern int inhibit_warnings; /* * From c-common.h */ #include "hwint.h" #include "cpplib.h" /* Nonzero means don't output line number information. */ extern char flag_no_line_commands; /* Nonzero causes -E output not to be done, but directives such as #define that have side effects are still obeyed. */ extern char flag_no_output; /* Nonzero means dump macros in some fashion; contains the 'D', 'M' or 'N' of the command line switch. */ extern char flag_dump_macros; /* 0 means we want the preprocessor to not emit line directives for the current working directory. 1 means we want it to do it. -1 means we should decide depending on whether debugging information is being emitted or not. */ extern int flag_working_directory; /* Nonzero means warn about usage of long long when `-pedantic'. */ extern int warn_long_long; extern int sdcpp_common_handle_option (size_t code, const char *arg, int value); extern bool sdcpp_common_missing_argument (const char *opt, size_t code); extern unsigned int sdcpp_common_init_options (unsigned int, const char **); extern bool sdcpp_common_post_options (const char **); extern bool sdcpp_common_init (void); extern void sdcpp_common_finish (void); /* Nonzero means pass #include lines through to the output. */ extern char flag_dump_includes; /* In c-ppoutput.c */ extern void init_pp_output (FILE *); extern void preprocess_file (cpp_reader *); extern void pp_file_change (const struct line_map *); extern void pp_dir_change (cpp_reader *, const char *); /* * From c-pragma.h */ extern struct cpp_reader* parse_in; /* * From input.h */ extern struct line_maps *line_table; typedef source_location location_t; /* deprecated typedef */ /* Top-level source file. */ extern const char *main_input_filename; /* * From tree.h */ /* Define the overall contents of a tree node. just to make diagnostic.c happy */ union tree_node { struct tree_decl { location_t locus; } decl; }; #define DECL_SOURCE_LOCATION(NODE) ((NODE)->decl.locus) /* * From diagnostic.h */ extern int errorcount; /* * From c-tree.h */ /* In order for the format checking to accept the C frontend diagnostic framework extensions, you must include this file before toplev.h, not after. */ #if GCC_VERSION >= 4001 #define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m) #else #define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m) #endif extern bool c_cpp_error (cpp_reader *, int, int, location_t, unsigned int, const char *, va_list *) ATTRIBUTE_GCC_CDIAG(6,0); #endif /* __SDCPP_H */
pfalcon/sdcc
support/cpp/sdcpp.h
C
gpl-2.0
7,065
[ 30522, 1001, 2065, 13629, 2546, 1035, 1035, 17371, 21906, 2361, 1035, 1044, 1001, 9375, 1035, 1035, 17371, 21906, 2361, 1035, 1044, 1001, 2065, 3207, 2546, 1035, 2663, 16703, 1013, 1008, 8170, 1997, 2035, 24755, 1008, 1013, 1001, 2421, 1026...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Protocol](./puppeteer.protocol.md) &gt; [SystemInfo](./puppeteer.protocol.systeminfo.md) &gt; [GPUInfo](./puppeteer.protocol.systeminfo.gpuinfo.md) &gt; [videoEncoding](./puppeteer.protocol.systeminfo.gpuinfo.videoencoding.md) ## Protocol.SystemInfo.GPUInfo.videoEncoding property Supported accelerated video encoding capabilities. <b>Signature:</b> ```typescript videoEncoding: VideoEncodeAcceleratorCapability[]; ```
GoogleChrome/puppeteer
new-docs/puppeteer.protocol.systeminfo.gpuinfo.videoencoding.md
Markdown
apache-2.0
576
[ 30522, 1026, 999, 1011, 1011, 2079, 2025, 10086, 2023, 5371, 1012, 2009, 2003, 8073, 7013, 2011, 17928, 6254, 2121, 1012, 1011, 1011, 1028, 1031, 2188, 1033, 1006, 1012, 1013, 5950, 1012, 9108, 1007, 1004, 14181, 1025, 1031, 13997, 11510, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Escaping/unescaping methods for HTML, JSON, URLs, and others. Also includes a few other miscellaneous string manipulation functions that have crept in over time. """ from __future__ import absolute_import, division, print_function import json import re from tornado.util import PY3, unicode_type, basestring_type if PY3: from urllib.parse import parse_qs as _parse_qs import html.entities as htmlentitydefs import urllib.parse as urllib_parse unichr = chr else: from urlparse import parse_qs as _parse_qs import htmlentitydefs import urllib as urllib_parse try: import typing # noqa except ImportError: pass _XHTML_ESCAPE_RE = re.compile('[&<>"\']') _XHTML_ESCAPE_DICT = {'&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', '\'': '&#39;'} def xhtml_escape(value): """Escapes a string so it is valid within HTML or XML. Escapes the characters ``<``, ``>``, ``"``, ``'``, and ``&``. When used in attribute values the escaped strings must be enclosed in quotes. .. versionchanged:: 3.2 Added the single quote to the list of escaped characters. """ return _XHTML_ESCAPE_RE.sub(lambda match: _XHTML_ESCAPE_DICT[match.group(0)], to_basestring(value)) def xhtml_unescape(value): """Un-escapes an XML-escaped string.""" return re.sub(r"&(#?)(\w+?);", _convert_entity, _unicode(value)) # The fact that json_encode wraps json.dumps is an implementation detail. # Please see https://github.com/tornadoweb/tornado/pull/706 # before sending a pull request that adds **kwargs to this function. def json_encode(value): """JSON-encodes the given Python object.""" # JSON permits but does not require forward slashes to be escaped. # This is useful when json data is emitted in a <script> tag # in HTML, as it prevents </script> tags from prematurely terminating # the javascript. Some json libraries do this escaping by default, # although python's standard library does not, so we do it here. # http://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped return json.dumps(value).replace("</", "<\\/") def json_decode(value): """Returns Python objects for the given JSON string.""" return json.loads(to_basestring(value)) def squeeze(value): """Replace all sequences of whitespace chars with a single space.""" return re.sub(r"[\x00-\x20]+", " ", value).strip() def url_escape(value, plus=True): """Returns a URL-encoded version of the given value. If ``plus`` is true (the default), spaces will be represented as "+" instead of "%20". This is appropriate for query strings but not for the path component of a URL. Note that this default is the reverse of Python's urllib module. .. versionadded:: 3.1 The ``plus`` argument """ quote = urllib_parse.quote_plus if plus else urllib_parse.quote return quote(utf8(value)) # python 3 changed things around enough that we need two separate # implementations of url_unescape. We also need our own implementation # of parse_qs since python 3's version insists on decoding everything. if not PY3: def url_unescape(value, encoding='utf-8', plus=True): """Decodes the given value from a URL. The argument may be either a byte or unicode string. If encoding is None, the result will be a byte string. Otherwise, the result is a unicode string in the specified encoding. If ``plus`` is true (the default), plus signs will be interpreted as spaces (literal plus signs must be represented as "%2B"). This is appropriate for query strings and form-encoded values but not for the path component of a URL. Note that this default is the reverse of Python's urllib module. .. versionadded:: 3.1 The ``plus`` argument """ unquote = (urllib_parse.unquote_plus if plus else urllib_parse.unquote) if encoding is None: return unquote(utf8(value)) else: return unicode_type(unquote(utf8(value)), encoding) parse_qs_bytes = _parse_qs else: def url_unescape(value, encoding='utf-8', plus=True): """Decodes the given value from a URL. The argument may be either a byte or unicode string. If encoding is None, the result will be a byte string. Otherwise, the result is a unicode string in the specified encoding. If ``plus`` is true (the default), plus signs will be interpreted as spaces (literal plus signs must be represented as "%2B"). This is appropriate for query strings and form-encoded values but not for the path component of a URL. Note that this default is the reverse of Python's urllib module. .. versionadded:: 3.1 The ``plus`` argument """ if encoding is None: if plus: # unquote_to_bytes doesn't have a _plus variant value = to_basestring(value).replace('+', ' ') return urllib_parse.unquote_to_bytes(value) else: unquote = (urllib_parse.unquote_plus if plus else urllib_parse.unquote) return unquote(to_basestring(value), encoding=encoding) def parse_qs_bytes(qs, keep_blank_values=False, strict_parsing=False): """Parses a query string like urlparse.parse_qs, but returns the values as byte strings. Keys still become type str (interpreted as latin1 in python3!) because it's too painful to keep them as byte strings in python3 and in practice they're nearly always ascii anyway. """ # This is gross, but python3 doesn't give us another way. # Latin1 is the universal donor of character encodings. result = _parse_qs(qs, keep_blank_values, strict_parsing, encoding='latin1', errors='strict') encoded = {} for k, v in result.items(): encoded[k] = [i.encode('latin1') for i in v] return encoded _UTF8_TYPES = (bytes, type(None)) def utf8(value): # type: (typing.Union[bytes,unicode_type,None])->typing.Union[bytes,None] """Converts a string argument to a byte string. If the argument is already a byte string or None, it is returned unchanged. Otherwise it must be a unicode string and is encoded as utf8. """ if isinstance(value, _UTF8_TYPES): return value if not isinstance(value, unicode_type): raise TypeError( "Expected bytes, unicode, or None; got %r" % type(value) ) return value.encode("utf-8") _TO_UNICODE_TYPES = (unicode_type, type(None)) def to_unicode(value): """Converts a string argument to a unicode string. If the argument is already a unicode string or None, it is returned unchanged. Otherwise it must be a byte string and is decoded as utf8. """ if isinstance(value, _TO_UNICODE_TYPES): return value if not isinstance(value, bytes): raise TypeError( "Expected bytes, unicode, or None; got %r" % type(value) ) return value.decode("utf-8") # to_unicode was previously named _unicode not because it was private, # but to avoid conflicts with the built-in unicode() function/type _unicode = to_unicode # When dealing with the standard library across python 2 and 3 it is # sometimes useful to have a direct conversion to the native string type if str is unicode_type: native_str = to_unicode else: native_str = utf8 _BASESTRING_TYPES = (basestring_type, type(None)) def to_basestring(value): """Converts a string argument to a subclass of basestring. In python2, byte and unicode strings are mostly interchangeable, so functions that deal with a user-supplied argument in combination with ascii string constants can use either and should return the type the user supplied. In python3, the two types are not interchangeable, so this method is needed to convert byte strings to unicode. """ if isinstance(value, _BASESTRING_TYPES): return value if not isinstance(value, bytes): raise TypeError( "Expected bytes, unicode, or None; got %r" % type(value) ) return value.decode("utf-8") def recursive_unicode(obj): """Walks a simple data structure, converting byte strings to unicode. Supports lists, tuples, and dictionaries. """ if isinstance(obj, dict): return dict((recursive_unicode(k), recursive_unicode(v)) for (k, v) in obj.items()) elif isinstance(obj, list): return list(recursive_unicode(i) for i in obj) elif isinstance(obj, tuple): return tuple(recursive_unicode(i) for i in obj) elif isinstance(obj, bytes): return to_unicode(obj) else: return obj # I originally used the regex from # http://daringfireball.net/2010/07/improved_regex_for_matching_urls # but it gets all exponential on certain patterns (such as too many trailing # dots), causing the regex matcher to never return. # This regex should avoid those problems. # Use to_unicode instead of tornado.util.u - we don't want backslashes getting # processed as escapes. _URL_RE = re.compile(to_unicode(r"""\b((?:([\w-]+):(/{1,3})|www[.])(?:(?:(?:[^\s&()]|&amp;|&quot;)*(?:[^!"#$%&'()*+,.:;<=>?@\[\]^`{|}~\s]))|(?:\((?:[^\s&()]|&amp;|&quot;)*\)))+)""")) def linkify(text, shorten=False, extra_params="", require_protocol=False, permitted_protocols=["http", "https"]): """Converts plain text into HTML with links. For example: ``linkify("Hello http://tornadoweb.org!")`` would return ``Hello <a href="http://tornadoweb.org">http://tornadoweb.org</a>!`` Parameters: * ``shorten``: Long urls will be shortened for display. * ``extra_params``: Extra text to include in the link tag, or a callable taking the link as an argument and returning the extra text e.g. ``linkify(text, extra_params='rel="nofollow" class="external"')``, or:: def extra_params_cb(url): if url.startswith("http://example.com"): return 'class="internal"' else: return 'class="external" rel="nofollow"' linkify(text, extra_params=extra_params_cb) * ``require_protocol``: Only linkify urls which include a protocol. If this is False, urls such as www.facebook.com will also be linkified. * ``permitted_protocols``: List (or set) of protocols which should be linkified, e.g. ``linkify(text, permitted_protocols=["http", "ftp", "mailto"])``. It is very unsafe to include protocols such as ``javascript``. """ if extra_params and not callable(extra_params): extra_params = " " + extra_params.strip() def make_link(m): url = m.group(1) proto = m.group(2) if require_protocol and not proto: return url # not protocol, no linkify if proto and proto not in permitted_protocols: return url # bad protocol, no linkify href = m.group(1) if not proto: href = "http://" + href # no proto specified, use http if callable(extra_params): params = " " + extra_params(href).strip() else: params = extra_params # clip long urls. max_len is just an approximation max_len = 30 if shorten and len(url) > max_len: before_clip = url if proto: proto_len = len(proto) + 1 + len(m.group(3) or "") # +1 for : else: proto_len = 0 parts = url[proto_len:].split("/") if len(parts) > 1: # Grab the whole host part plus the first bit of the path # The path is usually not that interesting once shortened # (no more slug, etc), so it really just provides a little # extra indication of shortening. url = url[:proto_len] + parts[0] + "/" + \ parts[1][:8].split('?')[0].split('.')[0] if len(url) > max_len * 1.5: # still too long url = url[:max_len] if url != before_clip: amp = url.rfind('&') # avoid splitting html char entities if amp > max_len - 5: url = url[:amp] url += "..." if len(url) >= len(before_clip): url = before_clip else: # full url is visible on mouse-over (for those who don't # have a status bar, such as Safari by default) params += ' title="%s"' % href return u'<a href="%s"%s>%s</a>' % (href, params, url) # First HTML-escape so that our strings are all safe. # The regex is modified to avoid character entites other than &amp; so # that we won't pick up &quot;, etc. text = _unicode(xhtml_escape(text)) return _URL_RE.sub(make_link, text) def _convert_entity(m): if m.group(1) == "#": try: if m.group(2)[:1].lower() == 'x': return unichr(int(m.group(2)[1:], 16)) else: return unichr(int(m.group(2))) except ValueError: return "&#%s;" % m.group(2) try: return _HTML_UNICODE_MAP[m.group(2)] except KeyError: return "&%s;" % m.group(2) def _build_unicode_map(): unicode_map = {} for name, value in htmlentitydefs.name2codepoint.items(): unicode_map[name] = unichr(value) return unicode_map _HTML_UNICODE_MAP = _build_unicode_map()
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tornado/escape.py
Python
bsd-2-clause
14,393
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 1001, 1001, 9385, 2268, 9130, 1001, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 1001, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2011 EMC Corp. // // @filename: // CHashMapIterTest.cpp // // @doc: // Test for CHashMapIter //--------------------------------------------------------------------------- #include "gpos/base.h" #include "gpos/common/CAutoRef.h" #include "gpos/common/CHashMapIter.h" #include "gpos/memory/CAutoMemoryPool.h" #include "gpos/test/CUnittest.h" #include "unittest/gpos/common/CHashMapIterTest.h" using namespace gpos; //--------------------------------------------------------------------------- // @function: // CHashMapIterTest::EresUnittest // // @doc: // Unittest for basic hash map iterator // //--------------------------------------------------------------------------- GPOS_RESULT CHashMapIterTest::EresUnittest() { CUnittest rgut[] = { GPOS_UNITTEST_FUNC(CHashMapIterTest::EresUnittest_Basic), }; return CUnittest::EresExecute(rgut, GPOS_ARRAY_SIZE(rgut)); } //--------------------------------------------------------------------------- // @function: // CHashMapIterTest::EresUnittest_Basic // // @doc: // Basic iterator test // //--------------------------------------------------------------------------- GPOS_RESULT CHashMapIterTest::EresUnittest_Basic() { // create memory pool CAutoMemoryPool amp; IMemoryPool *pmp = amp.Pmp(); // test data ULONG rgul[] = {1,2,3,4,5,6,7,8,9}; const ULONG ulCnt = GPOS_ARRAY_SIZE(rgul); typedef CHashMap<ULONG, ULONG, UlHashPtr<ULONG>, gpos::FEqual<ULONG>, CleanupNULL<ULONG>, CleanupNULL<ULONG> > Map; typedef CHashMapIter<ULONG, ULONG, UlHashPtr<ULONG>, gpos::FEqual<ULONG>, CleanupNULL<ULONG>, CleanupNULL<ULONG> > MapIter; // using N - 2 slots guarantees collisions Map *pm = GPOS_NEW(pmp) Map(pmp, ulCnt - 2); #ifdef GPOS_DEBUG // iteration over empty map MapIter miEmpty(pm); GPOS_ASSERT(!miEmpty.FAdvance()); #endif // GPOS_DEBUG typedef CDynamicPtrArray<const ULONG, CleanupNULL> DrgPul; CAutoRef<DrgPul> pdrgpulKeys(GPOS_NEW(pmp) DrgPul(pmp)), pdrgpulValues(GPOS_NEW(pmp) DrgPul(pmp)); // load map and iterate over it after each step for (ULONG ul = 0; ul < ulCnt; ++ul) { (void) pm->FInsert(&rgul[ul], &rgul[ul]); pdrgpulKeys->Append(&rgul[ul]); pdrgpulValues->Append(&rgul[ul]); CAutoRef<DrgPul> pdrgpulIterKeys(GPOS_NEW(pmp) DrgPul(pmp)), pdrgpulIterValues(GPOS_NEW(pmp) DrgPul(pmp)); // iterate over full map MapIter mi(pm); while (mi.FAdvance()) { pdrgpulIterKeys->Append(mi.Pk()); pdrgpulIterValues->Append(mi.Pt()); } pdrgpulIterKeys->Sort(); pdrgpulIterValues->Sort(); GPOS_ASSERT(pdrgpulKeys->FEqual(pdrgpulIterKeys.Pt())); GPOS_ASSERT(pdrgpulValues->FEqual(pdrgpulIterValues.Pt())); } pm->Release(); return GPOS_OK; } // EOF
PengJi/gporca-comments
libgpos/server/src/unittest/gpos/common/CHashMapIterTest.cpp
C++
apache-2.0
2,808
[ 30522, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package scalariform.formatter import scala.PartialFunction._ import scalariform.formatter.Alignment._ import scalariform.formatter.preferences._ import scalariform.lexer.Token import scalariform.parser._ import scalariform.utils.Utils trait CaseClauseFormatter { self: HasFormattingPreferences with ExprFormatter with HasHiddenTokenInfo with ScalaFormatter ⇒ def format(caseClausesAstNode: CaseClauses)(implicit formatterState: FormatterState): FormatResult = { val clauseGroups: List[Either[ConsecutiveSingleLineCaseClauses, CaseClause]] = if (formattingPreferences(AlignSingleLineCaseStatements) && !formattingPreferences(IndentWithTabs)) groupClauses(caseClausesAstNode) else caseClausesAstNode.caseClauses.map(Right(_)) var formatResult: FormatResult = NoFormatResult var isFirstCaseClause = true val hasSingleCaseClause = clauseGroups.size == 1 // We have to decide whether to indent the hidden tokens before the CASE token (or possibly a preceding // NEWLINE token from a prior case block). def handleCaseIndent(caseClause: CaseClause): Unit = if (!isFirstCaseClause) { previousCaseClauseTrailingNewlineOpt(caseClause, caseClausesAstNode) match { case Some(newline) ⇒ formatResult = formatResult.formatNewline(newline, formatterState.currentIndentLevelInstruction) case None ⇒ if (hiddenPredecessors(caseClause.firstToken).containsNewline) formatResult = formatResult.before(caseClause.firstToken, formatterState.currentIndentLevelInstruction) } } def formatSingleCaseClause(caseClause: CaseClause): Unit = { handleCaseIndent(caseClause) formatResult ++= formatCaseClause(caseClause, None, hasSingleCaseClause) isFirstCaseClause = false } for (clauseGroup ← clauseGroups) clauseGroup match { case Left(consecutiveClauses @ ConsecutiveSingleLineCaseClauses(caseClauses, largestCasePatternLength, _)) ⇒ if (consecutiveClauses.patternLengthRange <= formattingPreferences(AlignSingleLineCaseStatements.MaxArrowIndent)) { for (caseClause @ CaseClause(_, _) ← caseClauses) { handleCaseIndent(caseClause) val arrowInstruction = PlaceAtColumn(formatterState.indentLevel, largestCasePatternLength + 1) formatResult ++= formatCaseClause( caseClause, Some(arrowInstruction), hasSingleCaseClause ) isFirstCaseClause = false } } else { caseClauses foreach formatSingleCaseClause } case Right(caseClause) ⇒ formatSingleCaseClause(caseClause) } formatResult } private def groupClauses(caseClausesAstNode: CaseClauses): List[EitherAlignableCaseClause] = { val clausesAreMultiline = containsNewline(caseClausesAstNode) || hiddenPredecessors(caseClausesAstNode.firstToken).containsNewline def groupClauses(caseClauses: List[CaseClause], first: Boolean): List[EitherAlignableCaseClause] = caseClauses match { case Nil ⇒ Nil case (caseClause @ CaseClause(casePattern, statSeq)) :: otherClauses ⇒ val otherClausesGrouped = groupClauses(otherClauses, first = false) val formattedCasePattern = formattedAstNode(casePattern) { formatCasePattern(casePattern)(FormatterState(indentLevel = 0)) } val newlineBeforeClause = hiddenPredecessors(caseClause.firstToken).containsNewline || previousCaseClauseEndsWithNewline(caseClause, caseClausesAstNode) // To evaluate whether a clause body is multiline, we ignore a trailing newline: val clauseBodyIsMultiline = containsNewline(pruneTrailingNewline(statSeq)) || statSeq.firstTokenOption.exists(hiddenPredecessors(_).containsNewline) if (formattedCasePattern.contains('\n') || (first && !clausesAreMultiline) || (!first && !newlineBeforeClause) || clauseBodyIsMultiline) Right(caseClause) :: otherClausesGrouped else { val arrowAdjust = 1 + { if (formattingPreferences(RewriteArrowSymbols)) if (formattingPreferences(UseUnicodeArrows)) 1 else 2 else casePattern.arrow.length } val casePatternLength = formattedCasePattern.length - arrowAdjust otherClausesGrouped match { case Left(consecutiveSingleLineCaseClauses) :: otherGroups ⇒ Left(consecutiveSingleLineCaseClauses.prepend(caseClause, casePatternLength)) :: otherGroups case _ ⇒ Left(ConsecutiveSingleLineCaseClauses(caseClause :: Nil, casePatternLength, casePatternLength)) :: otherClausesGrouped } } } groupClauses(caseClausesAstNode.caseClauses, first = true) } private def formatCasePattern(casePattern: CasePattern, arrowInstructionOpt: Option[PlaceAtColumn] = None)(implicit formatterState: FormatterState): FormatResult = { val CasePattern(_, pattern, guardOption, arrow) = casePattern var formatResult: FormatResult = NoFormatResult formatResult ++= format(pattern) for (guard ← guardOption) formatResult ++= format(guard) arrowInstructionOpt foreach { instruction ⇒ formatResult = formatResult.before(arrow, instruction) } formatResult } private def formatCaseClause( caseClause: CaseClause, arrowInstructionOpt: Option[PlaceAtColumn], hasSingleCaseClause: Boolean )(implicit formatterState: FormatterState): FormatResult = { val CaseClause(casePattern, statSeq) = caseClause var formatResult: FormatResult = NoFormatResult formatResult ++= formatCasePattern(casePattern, arrowInstructionOpt) val hasNewline = caseClause.casePattern.caseToken.associatedWhitespaceAndComments.containsNewline val singleCaseWithoutNewline = hasSingleCaseClause && !hasNewline && !formattingPreferences(SingleCasePatternOnNewline) val singleExpr = cond(statSeq.firstStatOpt) { case Some(Expr(_)) ⇒ true } && cond(statSeq.otherStats) { case Nil | List((_, None)) ⇒ true } val indentBlock = statSeq.firstTokenOption.isDefined && newlineBefore(statSeq) || containsNewline(statSeq) && !singleExpr def unindent(x: Map[Token, IntertokenFormatInstruction]): Map[Token, IntertokenFormatInstruction] = x.map { case (k, EnsureNewlineAndIndent(indentLevel, relativeTo)) => k -> EnsureNewlineAndIndent(indentLevel - 1, relativeTo) case z => z } if (indentBlock) { val result = formatResult.before(statSeq.firstToken, formatterState.nextIndentLevelInstruction) formatResult = if (!singleCaseWithoutNewline) result else result.copy( predecessorFormatting = unindent(result.predecessorFormatting) + ( // unindent first token in case body caseClause.casePattern.caseToken -> CompactEnsuringGap // remove `case` leading newline ) ) } val stateForStatSeq = if (singleExpr && !indentBlock) formatterState else formatterState.indent formatResult ++= { val result = format(statSeq)(stateForStatSeq) if (!singleCaseWithoutNewline) result else result.copy( // unindent body tokens predecessorFormatting = unindent(result.predecessorFormatting), inferredNewlineFormatting = unindent(result.inferredNewlineFormatting) ) } formatResult } /** * @return a NEWLINE(S) token at the end of the caseClause, if present, else None */ private def getTrailingNewline(caseClause: CaseClause): Option[Token] = for { (separator, stat) ← lastStat(caseClause.statSeq) if stat.isEmpty if separator.isNewline } yield separator /** * @return the last stat of a block which may be wrapped inside of an anonymous function definition */ def lastStat(statSeq: StatSeq): Option[(Token, Option[Stat])] = statSeq.otherStats match { case Nil ⇒ None statSeq.firstStatOpt flatMap { case Expr(List(AnonymousFunction(_, _, body))) ⇒ lastStat(body) case _ ⇒ None } case others ⇒ others.lastOption match { case Some((_, Some(Expr(List(AnonymousFunction(_, _, body)))))) ⇒ lastStat(body) case x ⇒ x } } private def previousCaseClauseTrailingNewlineOpt(caseClause: CaseClause, caseClauses: CaseClauses): Option[Token] = Utils.pairWithPrevious(caseClauses.caseClauses).collectFirst { case (Some(previousClause), `caseClause`) ⇒ previousClause }.flatMap(getTrailingNewline) private def previousCaseClauseEndsWithNewline(caseClause: CaseClause, caseClauses: CaseClauses): Boolean = previousCaseClauseTrailingNewlineOpt(caseClause, caseClauses).isDefined /** * Remove a trailing NEWLINE / NEWLINES token from the end of the StatSeq. */ private def pruneTrailingNewline(statSeq: StatSeq): StatSeq = statSeq.otherStats.lastOption match { case Some((separator, None)) if separator.isNewline ⇒ statSeq.copy(otherStats = statSeq.otherStats.init) case _ ⇒ statSeq } }
scala-ide/scalariform
scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala
Scala
mit
9,333
[ 30522, 7427, 26743, 3089, 14192, 1012, 4289, 3334, 12324, 26743, 1012, 7704, 11263, 27989, 1012, 1035, 12324, 26743, 3089, 14192, 1012, 4289, 3334, 1012, 12139, 1012, 1035, 12324, 26743, 3089, 14192, 1012, 4289, 3334, 1012, 18394, 1012, 1035,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# # Copyright 2022 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package network::f5::bigip::snmp::mode::listvirtualservers; use base qw(centreon::plugins::mode); use strict; use warnings; sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $options{options}->add_options(arguments => { 'filter-name:s' => { name => 'filter_name' }, }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); } my %map_vs_status = ( 0 => 'none', 1 => 'green', 2 => 'yellow', 3 => 'red', 4 => 'blue', # unknown 5 => 'gray', ); my %map_vs_enabled = ( 0 => 'none', 1 => 'enabled', 2 => 'disabled', 3 => 'disabledbyparent', ); my $mapping = { new => { AvailState => { oid => '.1.3.6.1.4.1.3375.2.2.10.13.2.1.2', map => \%map_vs_status }, EnabledState => { oid => '.1.3.6.1.4.1.3375.2.2.10.13.2.1.3', map => \%map_vs_enabled }, }, old => { AvailState => { oid => '.1.3.6.1.4.1.3375.2.2.10.1.2.1.22', map => \%map_vs_status }, EnabledState => { oid => '.1.3.6.1.4.1.3375.2.2.10.1.2.1.23', map => \%map_vs_enabled }, }, }; my $oid_ltmVsStatusEntry = '.1.3.6.1.4.1.3375.2.2.10.13.2.1'; # new my $oid_ltmVirtualServEntry = '.1.3.6.1.4.1.3375.2.2.10.1.2.1'; # old sub manage_selection { my ($self, %options) = @_; my $snmp_result = $options{snmp}->get_multiple_table( oids => [ { oid => $oid_ltmVirtualServEntry, start => $mapping->{old}->{AvailState}->{oid}, end => $mapping->{old}->{EnabledState}->{oid} }, { oid => $oid_ltmVsStatusEntry, start => $mapping->{new}->{AvailState}->{oid}, end => $mapping->{new}->{EnabledState}->{oid} }, ], nothing_quit => 1 ); my ($branch, $map) = ($oid_ltmVsStatusEntry, 'new'); if (!defined($snmp_result->{$oid_ltmVsStatusEntry}) || scalar(keys %{$snmp_result->{$oid_ltmVsStatusEntry}}) == 0) { ($branch, $map) = ($oid_ltmVirtualServEntry, 'old'); } my $results = {}; foreach my $oid (keys %{$snmp_result->{$branch}}) { next if ($oid !~ /^$mapping->{$map}->{AvailState}->{oid}\.(.*?)\.(.*)$/); my ($num, $index) = ($1, $2); my $result = $options{snmp}->map_instance(mapping => $mapping->{$map}, results => $snmp_result->{$branch}, instance => $num . '.' . $index); my $name = $self->{output}->decode(join('', map(chr($_), split(/\./, $index)))); if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $name !~ /$self->{option_results}->{filter_name}/) { $self->{output}->output_add(long_msg => "skipping virtual server '" . $name . "'.", debug => 1); next; } $results->{$name} = { status => $result->{AvailState}, state => $result->{EnabledState}, }; } return $results; } sub run { my ($self, %options) = @_; my $results = $self->manage_selection(snmp => $options{snmp}); foreach my $name (sort keys %$results) { $self->{output}->output_add( long_msg => sprintf( '[name: %s] [status: %s] [state: %s]', $name, $results->{$name}->{status}, $results->{$name}->{state}, ) ); } $self->{output}->output_add(severity => 'OK', short_msg => 'List virtual servers:'); $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); $self->{output}->exit(); } sub disco_format { my ($self, %options) = @_; $self->{output}->add_disco_format(elements => ['name', 'status', 'state']); } sub disco_show { my ($self, %options) = @_; my $results = $self->manage_selection(snmp => $options{snmp}); foreach my $name (sort keys %$results) { $self->{output}->add_disco_entry( name => $name, status => $results->{$name}->{status}, state => $results->{$name}->{state} ); } } 1; __END__ =head1 MODE List F-5 Virtual Servers. =over 8 =item B<--filter-name> Filter by virtual server name. =back =cut
centreon/centreon-plugins
network/f5/bigip/snmp/mode/listvirtualservers.pm
Perl
apache-2.0
5,028
[ 30522, 1001, 1001, 9385, 16798, 2475, 2803, 2239, 1006, 8299, 1024, 1013, 1013, 7479, 1012, 2803, 2239, 1012, 4012, 1013, 1007, 1001, 1001, 2803, 2239, 2003, 1037, 2440, 1011, 26712, 3068, 1011, 3997, 5576, 2008, 6010, 1001, 1996, 3791, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* This file is part of darktable, copyright (c) 2010 Henrik Andersson. darktable is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. darktable is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with darktable. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <assert.h> #include <math.h> #include <stdlib.h> #include <string.h> #include "common/darktable.h" #include "common/gaussian.h" #include "common/opencl.h" #include "control/conf.h" #include "control/control.h" #include "develop/develop.h" #include "develop/imageop.h" #include "develop/imageop_math.h" #include "dtgtk/drawingarea.h" #include "dtgtk/gradientslider.h" #include "dtgtk/togglebutton.h" #include "gui/gtk.h" #include "gui/presets.h" #include "iop/iop_api.h" #if defined(__SSE__) #include <xmmintrin.h> #endif #include <librsvg/rsvg.h> // ugh, ugly hack. why do people break stuff all the time? #ifndef RSVG_CAIRO_H #include <librsvg/rsvg-cairo.h> #endif #define CLIP(x) (((x) >= 0) ? ((x) <= 1.0 ? (x) : 1.0) : 0.0) DT_MODULE_INTROSPECTION(1, dt_iop_zonesystem_params_t) #define MAX_ZONE_SYSTEM_SIZE 24 /** gui params. */ typedef struct dt_iop_zonesystem_params_t { int size; float zone[MAX_ZONE_SYSTEM_SIZE + 1]; } dt_iop_zonesystem_params_t; /** and pixelpipe data is just the same */ typedef struct dt_iop_zonesystem_data_t { dt_iop_zonesystem_params_t params; float rzscale; float zonemap_offset[MAX_ZONE_SYSTEM_SIZE]; float zonemap_scale[MAX_ZONE_SYSTEM_SIZE]; } dt_iop_zonesystem_data_t; /* void init_presets (dt_iop_module_so_t *self) { // DT_DEBUG_SQLITE3_EXEC(darktable.db, "begin", NULL, NULL, NULL); dt_gui_presets_add_generic(_("Fill-light 0.25EV with 4 zones"), self->op, self->version(), &(dt_iop_zonesystem_params_t){0.25,0.25,4.0} , sizeof(dt_iop_zonesystem_params_t), 1); dt_gui_presets_add_generic(_("Fill-shadow -0.25EV with 4 zones"), self->op, self->version(), &(dt_iop_zonesystem_params_t){-0.25,0.25,4.0} , sizeof(dt_iop_zonesystem_params_t), 1); // DT_DEBUG_SQLITE3_EXEC(darktable.db, "commit", NULL, NULL, NULL); } */ typedef struct dt_iop_zonesystem_global_data_t { int kernel_zonesystem; } dt_iop_zonesystem_global_data_t; typedef struct dt_iop_zonesystem_gui_data_t { guchar *in_preview_buffer; guchar *out_preview_buffer; int preview_width, preview_height; GtkWidget *preview; GtkWidget *zones; float press_x, press_y, mouse_x, mouse_y; gboolean hilite_zone; gboolean is_dragging; int current_zone; int zone_under_mouse; int mouse_over_output_zones; dt_pthread_mutex_t lock; cairo_surface_t *image; guint8 *image_buffer; int image_width, image_height; } dt_iop_zonesystem_gui_data_t; const char *name() { return _("zone system"); } int flags() { return IOP_FLAGS_SUPPORTS_BLENDING | IOP_FLAGS_INCLUDE_IN_STYLES | IOP_FLAGS_ALLOW_TILING | IOP_FLAGS_PREVIEW_NON_OPENCL; } int groups() { return IOP_GROUP_TONE; } /* get the zone index of pixel lightness from zonemap */ static inline int _iop_zonesystem_zone_index_from_lightness(float lightness, float *zonemap, int size) { for(int k = 0; k < size - 1; k++) if(zonemap[k + 1] >= lightness) return k; return size - 1; } /* calculate a zonemap with scale values for each zone based on controlpoints from param */ static inline void _iop_zonesystem_calculate_zonemap(struct dt_iop_zonesystem_params_t *p, float *zonemap) { int steps = 0; int pk = 0; for(int k = 0; k < p->size; k++) { if((k > 0 && k < p->size - 1) && p->zone[k] == -1) steps++; else { /* set 0 and 1.0 for first and last element in zonesystem size, or the actually parameter value */ zonemap[k] = k == 0 ? 0.0 : k == (p->size - 1) ? 1.0 : p->zone[k]; /* for each step from pk to k, calculate values for now this is linear distributed */ for(int l = 1; l <= steps; l++) zonemap[pk + l] = zonemap[pk] + (((zonemap[k] - zonemap[pk]) / (steps + 1)) * l); /* store k into pk and reset zone steps for next range*/ pk = k; steps = 0; } } } #define GAUSS(a, b, c, x) (a * pow(2.718281828, (-pow((x - b), 2) / (pow(c, 2))))) static void process_common_setup(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) { const int width = roi_out->width; const int height = roi_out->height; if(self->dev->gui_attached && piece->pipe->type == DT_DEV_PIXELPIPE_PREVIEW) { dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; dt_pthread_mutex_lock(&g->lock); if(g->in_preview_buffer == NULL || g->out_preview_buffer == NULL || g->preview_width != width || g->preview_height != height) { g_free(g->in_preview_buffer); g_free(g->out_preview_buffer); g->in_preview_buffer = g_malloc_n((size_t)width * height, sizeof(guchar)); g->out_preview_buffer = g_malloc_n((size_t)width * height, sizeof(guchar)); g->preview_width = width; g->preview_height = height; } dt_pthread_mutex_unlock(&g->lock); } } static void process_common_cleanup(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) { dt_iop_zonesystem_data_t *d = (dt_iop_zonesystem_data_t *)piece->data; dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; const int width = roi_out->width; const int height = roi_out->height; const int ch = piece->colors; const int size = d->params.size; if(piece->pipe->mask_display) dt_iop_alpha_copy(ivoid, ovoid, width, height); /* if gui and have buffer lets gaussblur and fill buffer with zone indexes */ if(self->dev->gui_attached && piece->pipe->type == DT_DEV_PIXELPIPE_PREVIEW && g && g->in_preview_buffer && g->out_preview_buffer) { float Lmax[] = { 100.0f }; float Lmin[] = { 0.0f }; /* setup gaussian kernel */ const int radius = 8; const float sigma = 2.5 * (radius * roi_in->scale / piece->iscale); dt_gaussian_t *gauss = dt_gaussian_init(width, height, 1, Lmax, Lmin, sigma, DT_IOP_GAUSSIAN_ZERO); float *tmp = g_malloc_n((size_t)width * height, sizeof(float)); if(gauss && tmp) { #ifdef _OPENMP #pragma omp parallel for default(none) shared(tmp) schedule(static) #endif for(size_t k = 0; k < (size_t)width * height; k++) tmp[k] = ((float *)ivoid)[ch * k]; dt_gaussian_blur(gauss, tmp, tmp); /* create zonemap preview for input */ dt_pthread_mutex_lock(&g->lock); #ifdef _OPENMP #pragma omp parallel for default(none) shared(tmp, g) schedule(static) #endif for(size_t k = 0; k < (size_t)width * height; k++) { g->in_preview_buffer[k] = CLAMPS(tmp[k] * (size - 1) / 100.0f, 0, size - 2); } dt_pthread_mutex_unlock(&g->lock); #ifdef _OPENMP #pragma omp parallel for default(none) shared(tmp) schedule(static) #endif for(size_t k = 0; k < (size_t)width * height; k++) tmp[k] = ((float *)ovoid)[ch * k]; dt_gaussian_blur(gauss, tmp, tmp); /* create zonemap preview for output */ dt_pthread_mutex_lock(&g->lock); #ifdef _OPENMP #pragma omp parallel for default(none) shared(tmp, g) schedule(static) #endif for(size_t k = 0; k < (size_t)width * height; k++) { g->out_preview_buffer[k] = CLAMPS(tmp[k] * (size - 1) / 100.0f, 0, size - 2); } dt_pthread_mutex_unlock(&g->lock); } g_free(tmp); if(gauss) dt_gaussian_free(gauss); } } void process(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) { const dt_iop_zonesystem_data_t *const d = (const dt_iop_zonesystem_data_t *const)piece->data; process_common_setup(self, piece, ivoid, ovoid, roi_in, roi_out); const int ch = piece->colors; const int size = d->params.size; const float *const in = (const float *const)ivoid; float *const out = (float *const)ovoid; #ifdef _OPENMP #pragma omp parallel for SIMD() default(none) schedule(static) collapse(2) #endif for(size_t k = 0; k < (size_t)ch * roi_out->width * roi_out->height; k += ch) { for(int c = 0; c < 3; c++) { /* remap lightness into zonemap and apply lightness */ const int rz = CLAMPS(in[k] * d->rzscale, 0, size - 2); // zone index const float zs = ((rz > 0) ? (d->zonemap_offset[rz] / in[k]) : 0) + d->zonemap_scale[rz]; const size_t p = (size_t)k + c; out[p] = in[p] * zs; } } process_common_cleanup(self, piece, ivoid, ovoid, roi_in, roi_out); } #if defined(__SSE__) void process_sse2(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) { const dt_iop_zonesystem_data_t *const d = (const dt_iop_zonesystem_data_t *const)piece->data; process_common_setup(self, piece, ivoid, ovoid, roi_in, roi_out); const int ch = piece->colors; const int size = d->params.size; #ifdef _OPENMP #pragma omp parallel for default(none) schedule(static) #endif for(int j = 0; j < roi_out->height; j++) { for(int i = 0; i < roi_out->width; i++) { /* remap lightness into zonemap and apply lightness */ const float *in = (float *)ivoid + ch * ((size_t)j * roi_out->width + i); float *out = (float *)ovoid + ch * ((size_t)j * roi_out->width + i); const int rz = CLAMPS(in[0] * d->rzscale, 0, size - 2); // zone index const float zs = ((rz > 0) ? (d->zonemap_offset[rz] / in[0]) : 0) + d->zonemap_scale[rz]; _mm_stream_ps(out, _mm_mul_ps(_mm_load_ps(in), _mm_set1_ps(zs))); } } _mm_sfence(); process_common_cleanup(self, piece, ivoid, ovoid, roi_in, roi_out); } #endif #ifdef HAVE_OPENCL int process_cl(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) { dt_iop_zonesystem_data_t *data = (dt_iop_zonesystem_data_t *)piece->data; dt_iop_zonesystem_global_data_t *gd = (dt_iop_zonesystem_global_data_t *)self->data; cl_mem dev_zmo, dev_zms = NULL; cl_int err = -999; const int devid = piece->pipe->devid; const int width = roi_in->width; const int height = roi_in->height; /* calculate zonemap */ const int size = data->params.size; float zonemap[MAX_ZONE_SYSTEM_SIZE] = { -1 }; float zonemap_offset[ROUNDUP(MAX_ZONE_SYSTEM_SIZE, 16)] = { -1 }; float zonemap_scale[ROUNDUP(MAX_ZONE_SYSTEM_SIZE, 16)] = { -1 }; _iop_zonesystem_calculate_zonemap(&(data->params), zonemap); /* precompute scale and offset */ for(int k = 0; k < size - 1; k++) zonemap_scale[k] = (zonemap[k + 1] - zonemap[k]) * (size - 1); for(int k = 0; k < size - 1; k++) zonemap_offset[k] = 100.0f * ((k + 1) * zonemap[k] - k * zonemap[k + 1]); dev_zmo = dt_opencl_copy_host_to_device_constant(devid, sizeof(float) * ROUNDUP(MAX_ZONE_SYSTEM_SIZE, 16), zonemap_offset); if(dev_zmo == NULL) goto error; dev_zms = dt_opencl_copy_host_to_device_constant(devid, sizeof(float) * ROUNDUP(MAX_ZONE_SYSTEM_SIZE, 16), zonemap_scale); if(dev_zms == NULL) goto error; size_t sizes[] = { ROUNDUPWD(width), ROUNDUPHT(height), 1 }; dt_opencl_set_kernel_arg(devid, gd->kernel_zonesystem, 0, sizeof(cl_mem), (void *)&dev_in); dt_opencl_set_kernel_arg(devid, gd->kernel_zonesystem, 1, sizeof(cl_mem), (void *)&dev_out); dt_opencl_set_kernel_arg(devid, gd->kernel_zonesystem, 2, sizeof(int), (void *)&width); dt_opencl_set_kernel_arg(devid, gd->kernel_zonesystem, 3, sizeof(int), (void *)&height); dt_opencl_set_kernel_arg(devid, gd->kernel_zonesystem, 4, sizeof(int), (void *)&size); dt_opencl_set_kernel_arg(devid, gd->kernel_zonesystem, 5, sizeof(cl_mem), (void *)&dev_zmo); dt_opencl_set_kernel_arg(devid, gd->kernel_zonesystem, 6, sizeof(cl_mem), (void *)&dev_zms); err = dt_opencl_enqueue_kernel_2d(devid, gd->kernel_zonesystem, sizes); if(err != CL_SUCCESS) goto error; dt_opencl_release_mem_object(dev_zmo); dt_opencl_release_mem_object(dev_zms); return TRUE; error: dt_opencl_release_mem_object(dev_zmo); dt_opencl_release_mem_object(dev_zms); dt_print(DT_DEBUG_OPENCL, "[opencl_zonesystem] couldn't enqueue kernel! %d\n", err); return FALSE; } #endif void init_global(dt_iop_module_so_t *module) { const int program = 2; // basic.cl, from programs.conf dt_iop_zonesystem_global_data_t *gd = (dt_iop_zonesystem_global_data_t *)malloc(sizeof(dt_iop_zonesystem_global_data_t)); module->data = gd; gd->kernel_zonesystem = dt_opencl_create_kernel(program, "zonesystem"); } void cleanup_global(dt_iop_module_so_t *module) { dt_iop_zonesystem_global_data_t *gd = (dt_iop_zonesystem_global_data_t *)module->data; dt_opencl_free_kernel(gd->kernel_zonesystem); free(module->data); module->data = NULL; } void commit_params(struct dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) { dt_iop_zonesystem_params_t *p = (dt_iop_zonesystem_params_t *)p1; dt_iop_zonesystem_data_t *d = (dt_iop_zonesystem_data_t *)piece->data; d->params = *p; d->rzscale = (d->params.size - 1) / 100.0f; /* calculate zonemap */ float zonemap[MAX_ZONE_SYSTEM_SIZE] = { -1 }; _iop_zonesystem_calculate_zonemap(&(d->params), zonemap); const int size = d->params.size; // precompute scale and offset for(int k = 0; k < size - 1; k++) d->zonemap_scale[k] = (zonemap[k + 1] - zonemap[k]) * (size - 1); for(int k = 0; k < size - 1; k++) d->zonemap_offset[k] = 100.0f * ((k + 1) * zonemap[k] - k * zonemap[k + 1]); } void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) { piece->data = calloc(1, sizeof(dt_iop_zonesystem_data_t)); self->commit_params(self, self->default_params, pipe, piece); } void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) { free(piece->data); piece->data = NULL; } void gui_update(struct dt_iop_module_t *self) { // dt_iop_module_t *module = (dt_iop_module_t *)self; dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; // dt_iop_zonesystem_params_t *p = (dt_iop_zonesystem_params_t *)module->params; gtk_widget_queue_draw(GTK_WIDGET(g->zones)); } void init(dt_iop_module_t *module) { module->params = calloc(1, sizeof(dt_iop_zonesystem_params_t)); module->default_params = calloc(1, sizeof(dt_iop_zonesystem_params_t)); module->default_enabled = 0; module->priority = 656; // module order created by iop_dependencies.py, do not edit! module->params_size = sizeof(dt_iop_zonesystem_params_t); module->gui_data = NULL; dt_iop_zonesystem_params_t tmp = (dt_iop_zonesystem_params_t){ 10, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } }; memcpy(module->params, &tmp, sizeof(dt_iop_zonesystem_params_t)); memcpy(module->default_params, &tmp, sizeof(dt_iop_zonesystem_params_t)); } void cleanup(dt_iop_module_t *module) { free(module->params); module->params = NULL; } static void _iop_zonesystem_redraw_preview_callback(gpointer instance, gpointer user_data); static gboolean dt_iop_zonesystem_preview_draw(GtkWidget *widget, cairo_t *crf, dt_iop_module_t *self); static gboolean dt_iop_zonesystem_bar_draw(GtkWidget *widget, cairo_t *crf, dt_iop_module_t *self); static gboolean dt_iop_zonesystem_bar_motion_notify(GtkWidget *widget, GdkEventMotion *event, dt_iop_module_t *self); static gboolean dt_iop_zonesystem_bar_leave_notify(GtkWidget *widget, GdkEventCrossing *event, dt_iop_module_t *self); static gboolean dt_iop_zonesystem_bar_button_press(GtkWidget *widget, GdkEventButton *event, dt_iop_module_t *self); static gboolean dt_iop_zonesystem_bar_button_release(GtkWidget *widget, GdkEventButton *event, dt_iop_module_t *self); static gboolean dt_iop_zonesystem_bar_scrolled(GtkWidget *widget, GdkEventScroll *event, dt_iop_module_t *self); static void size_allocate_callback(GtkWidget *widget, GtkAllocation *allocation, gpointer user_data) { dt_iop_module_t *self = (dt_iop_module_t *)user_data; dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; if(g->image) cairo_surface_destroy(g->image); free(g->image_buffer); /* load the dt logo as a brackground */ char filename[PATH_MAX] = { 0 }; char datadir[PATH_MAX] = { 0 }; char *logo; dt_logo_season_t season = get_logo_season(); if(season != DT_LOGO_SEASON_NONE) logo = g_strdup_printf("%%s/pixmaps/idbutton-%d.svg", (int)season); else logo = g_strdup("%s/pixmaps/idbutton.svg"); dt_loc_get_datadir(datadir, sizeof(datadir)); snprintf(filename, sizeof(filename), logo, datadir); g_free(logo); RsvgHandle *svg = rsvg_handle_new_from_file(filename, NULL); if(svg) { cairo_surface_t *surface; cairo_t *cr; RsvgDimensionData dimension; rsvg_handle_get_dimensions(svg, &dimension); float svg_size = MAX(dimension.width, dimension.height); float final_size = MIN(allocation->width, allocation->height) * 0.75; float factor = final_size / svg_size; float final_width = dimension.width * factor * darktable.gui->ppd, final_height = dimension.height * factor * darktable.gui->ppd; int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, final_width); g->image_buffer = (guint8 *)calloc(stride * final_height, sizeof(guint8)); surface = dt_cairo_image_surface_create_for_data(g->image_buffer, CAIRO_FORMAT_ARGB32, final_width, final_height, stride); if(cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) { free(g->image_buffer); g->image_buffer = NULL; } else { cr = cairo_create(surface); cairo_scale(cr, factor, factor); rsvg_handle_render_cairo(svg, cr); cairo_destroy(cr); cairo_surface_flush(surface); g->image = surface; g->image_width = final_width / darktable.gui->ppd; g->image_height = final_height / darktable.gui->ppd; } g_object_unref(svg); } } void gui_init(struct dt_iop_module_t *self) { self->gui_data = malloc(sizeof(dt_iop_zonesystem_gui_data_t)); dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; g->in_preview_buffer = g->out_preview_buffer = NULL; g->is_dragging = FALSE; g->hilite_zone = FALSE; g->preview_width = g->preview_height = 0; g->mouse_over_output_zones = FALSE; dt_pthread_mutex_init(&g->lock, NULL); self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_GUI_IOP_MODULE_CONTROL_SPACING); g->preview = dtgtk_drawing_area_new_with_aspect_ratio(1.0); g_signal_connect(G_OBJECT(g->preview), "size-allocate", G_CALLBACK(size_allocate_callback), self); g_signal_connect(G_OBJECT(g->preview), "draw", G_CALLBACK(dt_iop_zonesystem_preview_draw), self); gtk_widget_add_events(GTK_WIDGET(g->preview), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK); /* create the zonesystem bar widget */ g->zones = gtk_drawing_area_new(); gtk_widget_set_tooltip_text(g->zones, _("lightness zones\nuse mouse scrollwheel to change the number of zones\n" "left-click on a border to create a marker\n" "right-click on a marker to delete it")); g_signal_connect(G_OBJECT(g->zones), "draw", G_CALLBACK(dt_iop_zonesystem_bar_draw), self); g_signal_connect(G_OBJECT(g->zones), "motion-notify-event", G_CALLBACK(dt_iop_zonesystem_bar_motion_notify), self); g_signal_connect(G_OBJECT(g->zones), "leave-notify-event", G_CALLBACK(dt_iop_zonesystem_bar_leave_notify), self); g_signal_connect(G_OBJECT(g->zones), "button-press-event", G_CALLBACK(dt_iop_zonesystem_bar_button_press), self); g_signal_connect(G_OBJECT(g->zones), "button-release-event", G_CALLBACK(dt_iop_zonesystem_bar_button_release), self); g_signal_connect(G_OBJECT(g->zones), "scroll-event", G_CALLBACK(dt_iop_zonesystem_bar_scrolled), self); gtk_widget_add_events(GTK_WIDGET(g->zones), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_SCROLL_MASK); gtk_widget_set_size_request(g->zones, -1, DT_PIXEL_APPLY_DPI(40)); gtk_box_pack_start(GTK_BOX(self->widget), g->preview, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(self->widget), g->zones, TRUE, TRUE, 0); /* add signal handler for preview pipe finish to redraw the preview */ dt_control_signal_connect(darktable.signals, DT_SIGNAL_DEVELOP_PREVIEW_PIPE_FINISHED, G_CALLBACK(_iop_zonesystem_redraw_preview_callback), self); g->image = NULL; g->image_buffer = NULL; g->image_width = 0; g->image_height = 0; } void gui_cleanup(struct dt_iop_module_t *self) { dt_control_signal_disconnect(darktable.signals, G_CALLBACK(_iop_zonesystem_redraw_preview_callback), self); dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; g_free(g->in_preview_buffer); g_free(g->out_preview_buffer); if(g->image) cairo_surface_destroy(g->image); free(g->image_buffer); dt_pthread_mutex_destroy(&g->lock); self->request_color_pick = DT_REQUEST_COLORPICK_OFF; free(self->gui_data); self->gui_data = NULL; } #define DT_ZONESYSTEM_INSET DT_PIXEL_APPLY_DPI(5) #define DT_ZONESYSTEM_BAR_SPLIT_WIDTH 0.0 #define DT_ZONESYSTEM_REFERENCE_SPLIT 0.30 static gboolean dt_iop_zonesystem_bar_draw(GtkWidget *widget, cairo_t *crf, dt_iop_module_t *self) { dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; dt_iop_zonesystem_params_t *p = (dt_iop_zonesystem_params_t *)self->params; const int inset = DT_ZONESYSTEM_INSET; GtkAllocation allocation; gtk_widget_get_allocation(widget, &allocation); int width = allocation.width, height = allocation.height; cairo_surface_t *cst = dt_cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); cairo_t *cr = cairo_create(cst); /* clear background */ cairo_set_source_rgb(cr, .15, .15, .15); cairo_paint(cr); /* translate and scale */ width -= 2 * inset; height -= 2 * inset; cairo_save(cr); cairo_translate(cr, inset, inset); cairo_scale(cr, width, height); /* render the bars */ float zonemap[MAX_ZONE_SYSTEM_SIZE] = { 0 }; _iop_zonesystem_calculate_zonemap(p, zonemap); float s = (1. / (p->size - 2)); cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); for(int i = 0; i < p->size - 1; i++) { /* draw the reference zone */ float z = s * i; cairo_rectangle(cr, (1. / (p->size - 1)) * i, 0, (1. / (p->size - 1)), DT_ZONESYSTEM_REFERENCE_SPLIT - DT_ZONESYSTEM_BAR_SPLIT_WIDTH); cairo_set_source_rgb(cr, z, z, z); cairo_fill(cr); /* draw zone mappings */ cairo_rectangle(cr, zonemap[i], DT_ZONESYSTEM_REFERENCE_SPLIT + DT_ZONESYSTEM_BAR_SPLIT_WIDTH, (zonemap[i + 1] - zonemap[i]), 1.0 - DT_ZONESYSTEM_REFERENCE_SPLIT); cairo_set_source_rgb(cr, z, z, z); cairo_fill(cr); } cairo_set_antialias(cr, CAIRO_ANTIALIAS_DEFAULT); cairo_restore(cr); /* render zonebar control lines */ cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr, 1.); cairo_rectangle(cr, inset, inset, width, height); cairo_set_source_rgb(cr, .1, .1, .1); cairo_stroke(cr); cairo_set_antialias(cr, CAIRO_ANTIALIAS_DEFAULT); /* render control points handles */ cairo_set_source_rgb(cr, 0.6, 0.6, 0.6); cairo_set_line_width(cr, DT_PIXEL_APPLY_DPI(1.)); const float arrw = DT_PIXEL_APPLY_DPI(7.0f); for(int k = 1; k < p->size - 1; k++) { float nzw = zonemap[k + 1] - zonemap[k]; float pzw = zonemap[k] - zonemap[k - 1]; if((((g->mouse_x / width) > (zonemap[k] - (pzw / 2.0))) && ((g->mouse_x / width) < (zonemap[k] + (nzw / 2.0)))) || p->zone[k] != -1) { gboolean is_under_mouse = ((width * zonemap[k]) - arrw * .5f < g->mouse_x && (width * zonemap[k]) + arrw * .5f > g->mouse_x); cairo_move_to(cr, inset + (width * zonemap[k]), height + (2 * inset) - 1); cairo_rel_line_to(cr, -arrw * .5f, 0); cairo_rel_line_to(cr, arrw * .5f, -arrw); cairo_rel_line_to(cr, arrw * .5f, arrw); cairo_close_path(cr); if(is_under_mouse) cairo_fill(cr); else cairo_stroke(cr); } } /* push mem surface into widget */ cairo_destroy(cr); cairo_set_source_surface(crf, cst, 0, 0); cairo_paint(crf); cairo_surface_destroy(cst); return TRUE; } static gboolean dt_iop_zonesystem_bar_button_press(GtkWidget *widget, GdkEventButton *event, dt_iop_module_t *self) { dt_iop_zonesystem_params_t *p = (dt_iop_zonesystem_params_t *)self->params; dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; const int inset = DT_ZONESYSTEM_INSET; GtkAllocation allocation; gtk_widget_get_allocation(widget, &allocation); int width = allocation.width - 2 * inset; /*, height = allocation.height - 2*inset;*/ /* calculate zonemap */ float zonemap[MAX_ZONE_SYSTEM_SIZE] = { -1 }; _iop_zonesystem_calculate_zonemap(p, zonemap); /* translate mouse into zone index */ int k = _iop_zonesystem_zone_index_from_lightness(g->mouse_x / width, zonemap, p->size); float zw = zonemap[k + 1] - zonemap[k]; if((g->mouse_x / width) > zonemap[k] + (zw / 2)) k++; if(event->button == 1) { if(p->zone[k] == -1) { p->zone[k] = zonemap[k]; dt_dev_add_history_item(darktable.develop, self, TRUE); } g->is_dragging = TRUE; g->current_zone = k; } else if(event->button == 3) { /* clear the controlpoint */ p->zone[k] = -1; dt_dev_add_history_item(darktable.develop, self, TRUE); } return TRUE; } static gboolean dt_iop_zonesystem_bar_button_release(GtkWidget *widget, GdkEventButton *event, dt_iop_module_t *self) { dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; if(event->button == 1) { g->is_dragging = FALSE; } return TRUE; } static gboolean dt_iop_zonesystem_bar_scrolled(GtkWidget *widget, GdkEventScroll *event, dt_iop_module_t *self) { dt_iop_zonesystem_params_t *p = (dt_iop_zonesystem_params_t *)self->params; int cs = CLAMP(p->size, 4, MAX_ZONE_SYSTEM_SIZE); if(event->direction == GDK_SCROLL_UP) p->size += 1; else if(event->direction == GDK_SCROLL_DOWN) p->size -= 1; /* sanity checks */ p->size = CLAMP(p->size, 4, MAX_ZONE_SYSTEM_SIZE); p->zone[cs] = -1; dt_dev_add_history_item(darktable.develop, self, TRUE); gtk_widget_queue_draw(widget); return TRUE; } static gboolean dt_iop_zonesystem_bar_leave_notify(GtkWidget *widget, GdkEventCrossing *event, dt_iop_module_t *self) { dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; g->hilite_zone = FALSE; gtk_widget_queue_draw(g->preview); return TRUE; } static gboolean dt_iop_zonesystem_bar_motion_notify(GtkWidget *widget, GdkEventMotion *event, dt_iop_module_t *self) { dt_iop_zonesystem_params_t *p = (dt_iop_zonesystem_params_t *)self->params; dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; const int inset = DT_ZONESYSTEM_INSET; GtkAllocation allocation; gtk_widget_get_allocation(widget, &allocation); int width = allocation.width - 2 * inset, height = allocation.height - 2 * inset; /* calculate zonemap */ float zonemap[MAX_ZONE_SYSTEM_SIZE] = { -1 }; _iop_zonesystem_calculate_zonemap(p, zonemap); /* record mouse position within control */ g->mouse_x = CLAMP(event->x - inset, 0, width); g->mouse_y = CLAMP(height - 1 - event->y + inset, 0, height); if(g->is_dragging) { if((g->mouse_x / width) > zonemap[g->current_zone - 1] && (g->mouse_x / width) < zonemap[g->current_zone + 1]) { p->zone[g->current_zone] = (g->mouse_x / width); dt_dev_add_history_item(darktable.develop, self, TRUE); } } else { /* decide which zone the mouse is over */ if(g->mouse_y >= height * (1.0 - DT_ZONESYSTEM_REFERENCE_SPLIT)) { g->zone_under_mouse = (g->mouse_x / width) / (1.0 / (p->size - 1)); g->mouse_over_output_zones = TRUE; } else { float xpos = g->mouse_x / width; for(int z = 0; z < p->size - 1; z++) { if(xpos >= zonemap[z] && xpos < zonemap[z + 1]) { g->zone_under_mouse = z; break; } } g->mouse_over_output_zones = FALSE; } g->hilite_zone = (g->mouse_y < height) ? TRUE : FALSE; } gtk_widget_queue_draw(self->widget); gtk_widget_queue_draw(g->preview); return TRUE; } static gboolean dt_iop_zonesystem_preview_draw(GtkWidget *widget, cairo_t *crf, dt_iop_module_t *self) { const int inset = DT_PIXEL_APPLY_DPI(2); GtkAllocation allocation; gtk_widget_get_allocation(widget, &allocation); int width = allocation.width, height = allocation.height; dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; dt_iop_zonesystem_params_t *p = (dt_iop_zonesystem_params_t *)self->params; cairo_surface_t *cst = dt_cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); cairo_t *cr = cairo_create(cst); /* clear background */ GtkStyleContext *context = gtk_widget_get_style_context(self->expander); gtk_render_background(context, cr, 0, 0, allocation.width, allocation.height); width -= 2 * inset; height -= 2 * inset; cairo_translate(cr, inset, inset); dt_pthread_mutex_lock(&g->lock); if(g->in_preview_buffer && g->out_preview_buffer && self->enabled) { /* calculate the zonemap */ float zonemap[MAX_ZONE_SYSTEM_SIZE] = { -1 }; _iop_zonesystem_calculate_zonemap(p, zonemap); /* let's generate a pixbuf from pixel zone buffer */ guchar *image = g_malloc_n((size_t)4 * g->preview_width * g->preview_height, sizeof(guchar)); guchar *buffer = g->mouse_over_output_zones ? g->out_preview_buffer : g->in_preview_buffer; for(int k = 0; k < g->preview_width * g->preview_height; k++) { int zone = 255 * CLIP(((1.0 / (p->size - 1)) * buffer[k])); image[4 * k + 2] = (g->hilite_zone && buffer[k] == g->zone_under_mouse) ? 255 : zone; image[4 * k + 1] = (g->hilite_zone && buffer[k] == g->zone_under_mouse) ? 255 : zone; image[4 * k + 0] = (g->hilite_zone && buffer[k] == g->zone_under_mouse) ? 0 : zone; } dt_pthread_mutex_unlock(&g->lock); const int wd = g->preview_width, ht = g->preview_height; const float scale = fminf(width / (float)wd, height / (float)ht); const int stride = cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, wd); cairo_surface_t *surface = cairo_image_surface_create_for_data(image, CAIRO_FORMAT_RGB24, wd, ht, stride); cairo_translate(cr, width / 2.0, height / 2.0f); cairo_scale(cr, scale, scale); cairo_translate(cr, -.5f * wd, -.5f * ht); cairo_rectangle(cr, DT_PIXEL_APPLY_DPI(1), DT_PIXEL_APPLY_DPI(1), wd - DT_PIXEL_APPLY_DPI(2), ht - DT_PIXEL_APPLY_DPI(2)); cairo_set_source_surface(cr, surface, 0, 0); cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_GOOD); cairo_fill_preserve(cr); cairo_surface_destroy(surface); cairo_set_line_width(cr, DT_PIXEL_APPLY_DPI(1.0)); cairo_set_source_rgb(cr, .1, .1, .1); cairo_stroke(cr); g_free(image); } else { dt_pthread_mutex_unlock(&g->lock); // draw a big, subdued dt logo if(g->image) { GdkRGBA *color; gtk_style_context_get(context, gtk_widget_get_state_flags(self->expander), "background-color", &color, NULL); cairo_set_source_surface(cr, g->image, (width - g->image_width) * 0.5, (height - g->image_height) * 0.5); cairo_rectangle(cr, 0, 0, width, height); cairo_set_operator(cr, CAIRO_OPERATOR_HSL_LUMINOSITY); cairo_fill_preserve(cr); cairo_set_operator(cr, CAIRO_OPERATOR_DARKEN); cairo_set_source_rgb(cr, color->red + 0.02, color->green + 0.02, color->blue + 0.02); cairo_fill_preserve(cr); cairo_set_operator(cr, CAIRO_OPERATOR_LIGHTEN); cairo_set_source_rgb(cr, color->red - 0.02, color->green - 0.02, color->blue - 0.02); cairo_fill(cr); gdk_rgba_free(color); } } cairo_destroy(cr); cairo_set_source_surface(crf, cst, 0, 0); cairo_paint(crf); cairo_surface_destroy(cst); return TRUE; } void _iop_zonesystem_redraw_preview_callback(gpointer instance, gpointer user_data) { dt_iop_module_t *self = (dt_iop_module_t *)user_data; dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; dt_control_queue_redraw_widget(g->preview); } // modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh // vim: shiftwidth=2 expandtab tabstop=2 cindent // kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
muessel/darktable
src/iop/zonesystem.c
C
gpl-3.0
34,849
[ 30522, 1013, 1008, 2023, 5371, 2003, 2112, 1997, 2601, 10880, 1010, 9385, 1006, 1039, 1007, 2230, 18745, 28643, 1012, 2601, 10880, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 2009, 2104, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using NPython.Converters; using NPython.Internals; namespace NPython.Console { class Program { static unsafe void Main(string[] args) { var a = Foo(); } public static int Foo() { try { return 5; } finally { System.Console.WriteLine("Hello world!"); } } } }
omershelef/NPython
NPython.Console/Program.cs
C#
mit
756
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 2951, 1025, 2478, 2291, 1012, 16474, 2015, 1025, 2478, 2291, 1012, 22834, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /** * @test * @bug 8182297 * @summary Verify that pasting multi-line snippets works properly. * @library /tools/lib * @modules * java.base/java.lang:open * java.base/java.io:open * jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.main * jdk.jshell/jdk.internal.jshell.tool.resources:open * jdk.jshell/jdk.jshell:open * @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask * @build Compiler UITesting * @build PasteAndMeasurementsUITest * @run testng/othervm PasteAndMeasurementsUITest */ import java.io.Console; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import org.testng.annotations.Test; @Test public class PasteAndMeasurementsUITest extends UITesting { public PasteAndMeasurementsUITest() { super(true); } public void testPrevNextSnippet() throws Exception { Field cons = System.class.getDeclaredField("cons"); cons.setAccessible(true); Constructor console = Console.class.getDeclaredConstructor(); console.setAccessible(true); cons.set(null, console.newInstance()); doRunTest((inputSink, out) -> { inputSink.write("void test1() {\nSystem.err.println(1);\n}\n" + //LOC + "void test2() {\nSystem.err.println(1);\n}\n"/* + LOC + LOC + LOC + LOC + LOC*/); waitOutput(out, "void test1\\(\\)\u001B\\[2D\u001B\\[2C \\{\n" + CONTINUATION_PROMPT + "System.err.println\\(1\\)\u001B\\[3D\u001B\\[3C;\n" + CONTINUATION_PROMPT + "\\}\u001B\\[2A\u001B\\[12C\n\n\u001B\\[C\n" + "\u001B\\[\\?2004l\\| created method test1\\(\\)\n" + "\u001B\\[\\?2004h" + PROMPT + "void test2\\(\\)\u001B\\[2D\u001B\\[2C \\{\n" + CONTINUATION_PROMPT + "System.err.println\\(1\\)\u001B\\[3D\u001B\\[3C;\n" + CONTINUATION_PROMPT + "\\}\u001B\\[2A\u001B\\[12C\n\n\u001B\\[C\n" + "\u001B\\[\\?2004l\\| created method test2\\(\\)\n" + "\u001B\\[\\?2004h" + PROMPT); }); } private static final String LOC = "\033[12;1R"; }
md-5/jdk10
test/langtools/jdk/jshell/PasteAndMeasurementsUITest.java
Java
gpl-2.0
3,318
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2418, 1010, 2760, 1010, 14721, 1998, 1013, 2030, 2049, 18460, 1012, 2035, 2916, 9235, 1012, 1008, 2079, 2025, 11477, 2030, 6366, 9385, 14444, 2030, 2023, 5371, 20346, 1012, 1008, 1008, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import { gql } from '@apollo/client' import fullBlockShareFragment from 'v2/components/FullBlock/components/FullBlockShare/fragments/fullBlockShare' export default gql` fragment FullBlockActions on Konnectable { __typename ... on Image { find_original_url downloadable_image: resized_image_url(downloadable: true) } ... on Text { find_original_url } ... on ConnectableInterface { source { title url } } ... on Block { can { mute potentially_edit_thumbnail edit_thumbnail } } ...FullBlockShare } ${fullBlockShareFragment} `
aredotna/ervell
src/v2/components/FullBlock/components/FullBlockActions/fragments/fullBlockActions.ts
TypeScript
mit
653
[ 30522, 12324, 1063, 1043, 4160, 2140, 1065, 2013, 1005, 1030, 9348, 1013, 7396, 1005, 12324, 2440, 23467, 7377, 2890, 27843, 21693, 4765, 2013, 1005, 1058, 2475, 1013, 6177, 1013, 2440, 23467, 1013, 6177, 1013, 2440, 23467, 7377, 2890, 1013...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: post title: "Seek for Sole External Sponsor" date: 2017-08-08 18:00:00 isStaticPost: false --- We are seeking for one more sponsor except ShanghaiTech University to cover the expenses of awarding excellent presenters. Note that you cannot title the event, you can only show here at the website and in the final awarding ceremony.
xiongzhp/FoGG2017
_posts/2017-08-08-seek-for-sole-sponsor.markdown
Markdown
mit
345
[ 30522, 1011, 1011, 1011, 9621, 1024, 2695, 2516, 1024, 1000, 6148, 2005, 7082, 6327, 10460, 1000, 3058, 1024, 2418, 1011, 5511, 1011, 5511, 2324, 1024, 4002, 1024, 4002, 26354, 29336, 2594, 19894, 1024, 6270, 1011, 1011, 1011, 2057, 2024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author Alexey A. Ivanov */ package javax.swing.text; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.Shape; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.SwingTestCase; /** * This class tests PlainView behavior. * * <p>This class is initialized with a "real" PlainView that was obtained from * JTextArea placed in JFrame. * */ public class PlainViewTest extends SwingTestCase { private JTextArea area; private Document doc; private JFrame frame; private Shape shape; private PlainView view; public void testDrawSelectedText() throws BadLocationException { area.setText("line1\nline2"); Graphics g = view.getGraphics(); FontMetrics m = view.metrics; g.setFont(m.getFont()); assertEquals(m.charWidth('l'), view.drawSelectedText(g, 0, 0, 0, 1)); assertEquals(m.stringWidth("line1"), view.drawSelectedText(g, 0, 0, 0, 5)); assertEquals(m.stringWidth("line1\nli"), view.drawSelectedText(g, 0, 0, 0, 8)); try { view.drawSelectedText(g, 0, 0, -1, 1); fail("BadLocationException expected"); } catch (BadLocationException e) { } try { view.drawUnselectedText(g, 0, 0, 13, 13); fail("BadLocationException expected"); } catch (BadLocationException e) { } try { view.drawSelectedText(g, 0, 0, 10, 2); fail("BadLocationException expected"); } catch (BadLocationException e) { } } public void testDrawUnselectedText() throws BadLocationException { area.setText("line1\nline2"); Graphics g = view.getGraphics(); FontMetrics m = view.metrics; g.setFont(m.getFont()); assertEquals(m.charWidth('l'), view.drawUnselectedText(g, 0, 0, 0, 1)); assertEquals(5 + m.charWidth('l'), view.drawUnselectedText(g, 5, 0, 0, 1)); assertEquals(m.stringWidth("line1"), view.drawUnselectedText(g, 0, 0, 0, 5)); assertEquals(m.stringWidth("line1\nli"), view.drawUnselectedText(g, 0, 0, 0, 8)); try { view.drawUnselectedText(g, 0, 0, -1, 1); fail("BadLocationException expected"); } catch (BadLocationException e) { } try { view.drawUnselectedText(g, 0, 0, 13, 13); fail("BadLocationException expected"); } catch (BadLocationException e) { } try { view.drawUnselectedText(g, 0, 0, 10, 2); fail("BadLocationException expected"); } catch (BadLocationException e) { } } public void testGetPreferredSpan() { area.setText("1: 0\n2: 012345\n3:\n"); assertEquals(view.metrics.stringWidth("2: 012345"), // longest line view.getPreferredSpan(View.X_AXIS), 0.00001f); assertEquals(view.metrics.getHeight() * 4, view.getPreferredSpan(View.Y_AXIS), 0.00001f); area.setText("\ttext\t1"); float length = view.nextTabStop(0, 0); length += view.metrics.stringWidth("text"); length = view.nextTabStop(length, 0); length += view.metrics.stringWidth("1"); assertEquals(length, view.getPreferredSpan(View.X_AXIS), 0.00001f); } /** * Generic tests of <code>modelToView(int, Shape, Position.Bias)</code>. */ public void testModelToViewintShapeBias01() throws BadLocationException { area.setText("1: 0\n2: 012345\n3:\n"); // 01234 5678901234 567 assertTrue(view.modelToView(0, shape, Position.Bias.Backward) instanceof Rectangle); assertEquals(new Rectangle(1, view.metrics.getHeight()), view.modelToView(0, shape, Position.Bias.Forward)); assertEquals(new Rectangle(1, view.metrics.getHeight()), view.modelToView(0, shape, Position.Bias.Backward)); assertEquals( new Rectangle(view.metrics.charWidth('1'), 0, 1, view.metrics.getHeight()), view.modelToView(1, shape, Position.Bias.Forward)); assertEquals( new Rectangle(view.metrics.charWidth('1'), 0, 1, view.metrics.getHeight()), view.modelToView(1, shape, Position.Bias.Backward)); assertEquals(new Rectangle(view.metrics.stringWidth("2: 012"), view.metrics.getHeight(), 1, view.metrics.getHeight()), view.modelToView(11, shape, Position.Bias.Forward)); try { view.modelToView(-1, shape, Position.Bias.Forward); fail("BadLocationException is expected"); } catch (BadLocationException e) { } assertEquals(new Rectangle(view.metrics.charWidth('\n')/*0*/, view.metrics.getHeight() * 3, 1, view.metrics.getHeight()), view.modelToView( doc.getLength() + 1, shape, Position.Bias.Forward)); try { view.modelToView(doc.getLength() + 2, shape, Position.Bias.Forward); fail("BadLocationException is expected"); } catch (BadLocationException e) { } // try { view.modelToView(0, shape, null); // isn't thrown //fail("IllegalArgumentException must be thrown"); // } catch (IllegalArgumentException e) { } doc.insertString(1, "\t", null); assertEquals( new Rectangle(view.metrics.charWidth('1'), 0, 1, view.metrics.getHeight()), view.modelToView(1, shape, Position.Bias.Forward)); assertEquals(new Rectangle((int) view.nextTabStop(view.metrics.charWidth('1'), 0), 0, 1, view.metrics.getHeight()), view.modelToView(2, shape, Position.Bias.Forward)); assertEquals(new Rectangle((int) view.nextTabStop(view.metrics.charWidth('1'), 0) + view.metrics.charWidth(':'), 0, 1, view.metrics.getHeight()), view .modelToView(3, shape, Position.Bias.Forward)); } /** * Tests <code>modelToView(int, Shape, Position.Bias)</code> when * <code>shape.getBounds().x != 0</code> and/or * <code>shape.getBounds().y != 0</code>. */ public void testModelToViewintShapeBias02() throws BadLocationException { area.setText("1: 0\n2: 012345\n3:\n"); ((Rectangle) shape).setLocation(7, 10); assertFalse(((Rectangle) shape).x == 0); assertEquals(new Rectangle(((Rectangle) shape).x, ((Rectangle) shape).y, 1, view.metrics.getHeight()), view.modelToView(0, shape, Position.Bias.Forward)); } /** * Tests <code>modelToView(int, Shape, Position.Bias)</code> * with zero-length document. */ public void testModelToViewintShapeBias03() throws BadLocationException { area.setText(""); assertEquals(0, view.getDocument().getLength()); assertEquals(new Rectangle(1, view.metrics.getHeight()), view.modelToView(0, shape, Position.Bias.Forward)); assertEquals(new Rectangle(1, view.metrics.getHeight()), view.modelToView(1, shape, Position.Bias.Forward)); try { view.modelToView(-1, shape, Position.Bias.Forward); fail("BadLocationException is expected"); } catch (BadLocationException e) { } try { view.modelToView(2, shape, Position.Bias.Forward); fail("BadLocationException is expected"); } catch (BadLocationException e) { } } /** * Tests nextTabStop method with default tab size of 8. */ public void testNextTabStop01() { float tabPos = view.getTabSize() * view.metrics.charWidth('m'); assertEquals(8, view.getTabSize()); assertEquals(tabPos, view.nextTabStop(0.0f, 0), 0.00001f); assertEquals(tabPos, view.nextTabStop(10.0f, 0), 0.00001f); assertEquals(tabPos, view.nextTabStop(tabPos - 1, 0), 0.00001f); assertEquals(tabPos * 2, view.nextTabStop(tabPos, 0), 0.00001f); // Setting tab size to 4 has no effect on already initialized view doc.putProperty(PlainDocument.tabSizeAttribute, new Integer(4)); assertEquals(4, view.getTabSize()); // The change has no effect assertEquals(tabPos, view.nextTabStop(0.0f, 0), 0.00001f); // But after metrics have been updated... view.updateMetrics(); if (isHarmony()) { // Our implemetation updates tabSize in updateMetrics tabPos = view.getTabSize() * view.metrics.charWidth('m'); } assertEquals(tabPos, view.nextTabStop(0.0f, 0), 0.00001f); assertEquals(tabPos * 2, view.nextTabStop(tabPos, 0), 0.00001f); } /* * int viewToModel(float, float, Shape, Position.Bias[]) */ public void testViewToModelfloatfloatShapeBiasArray() throws BadLocationException { area.setText("1: 0\n2: 012345\n3:\n"); // 01234 5678901234 567 int h = view.metrics.getHeight(); int w = view.metrics.charWidth('1'); Position.Bias[] bias = new Position.Bias[1]; assertNull(bias[0]); assertEquals(0, view.viewToModel(0f, 0f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(0, view.viewToModel(w / 4f, h / 4f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(1, view.viewToModel(w - 1f, h / 2f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(1, view.viewToModel(w - w / 4f, h / 2f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; w = view.metrics.charWidth('2'); // Negative coordinates assertEquals(0, view.viewToModel(-1f, h - 0.1f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(5, view.viewToModel(-1f, h, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(5, view.viewToModel(-1f, h + 0.1f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(0, view.viewToModel(1f, -1f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(0, view.viewToModel(w + 1f, -1f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; // Past last character of line 1 assertEquals(4, view.viewToModel(view.metrics.stringWidth("1: 0") + 1f, h / 2, shape, bias)); assertEquals(4, view.viewToModel(view.metrics.stringWidth("1: 0") + 1f, h - 0.1f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(9, view.viewToModel(view.metrics.stringWidth("1: 0"), h, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(9, view.viewToModel(view.metrics.stringWidth("1: 0"), h + 0.1f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; // Below last line h = (int) view.getPreferredSpan(View.Y_AXIS); int pos = doc.getLength(); assertEquals(pos, view.viewToModel(0f, h - 0.1f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(pos, view.viewToModel(0f, h, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; assertEquals(pos, view.viewToModel(0f, h + 0.1f, shape, bias)); assertSame(Position.Bias.Forward, bias[0]); bias[0] = null; // Test with tab w = view.metrics.charWidth('1'); doc.insertString(1, "\t", null); int tab = (int) view.nextTabStop(w, 0); int tabSize = tab - w; assertEquals(1, view.viewToModel(w + tabSize / 2f - 0.5f, 0f, shape, bias)); assertEquals(2, view.viewToModel(w + tabSize / 2f + 0.5f, 0f, shape, bias)); assertEquals(2, view.viewToModel(tab - 1f, 0f, shape, bias)); assertEquals(3, view .viewToModel(tab + view.metrics.charWidth(':') - 1f, 0, shape, bias)); } /** * Creates JFrame (<code>frame</code>), puts JTextArea (<code>area</code>) * into it and initializes <code>doc</code>, <code>root</code>, * <code>view</code>, and <code>shape</code> using JTextArea methods. */ @Override protected void setUp() throws Exception { super.setUp(); frame = new JFrame("PlainView Test"); area = new JTextArea(" "); frame.getContentPane().add(area); frame.setSize(100, 150); frame.pack(); doc = area.getDocument(); view = (PlainView) area.getUI().getRootView(area).getView(0); shape = area.getVisibleRect(); } /* * @see TestCase#tearDown() */ @Override protected void tearDown() throws Exception { super.tearDown(); frame.dispose(); } // Painting methods are not tested /* public void testDrawLine() { } public void testPaint() { } */ }
skyHALud/codenameone
Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/swing/src/test/api/java.injected/javax/swing/text/PlainViewTest.java
Java
gpl-2.0
14,439
[ 30522, 1013, 1008, 1008, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 2030, 2062, 1008, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 5500, 2007, 1008, 2023, 2147, 2005, 3176, 2592, 4953, 9385, 6095, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# NSParagraphStyle.rb - Add a couple of things to the Objective C NSParagraphStyle class # # $Id$ # # Copyright (C) 2001 Free Software Foundation, Inc. # # Written by: Laurent Julliard <laurent@julliard-online.org> # Date: July 2001 # # This file is part of the GNUstep Ruby Interface Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. NSParagraphStyle = Rigs.class("NSParagraphStyle") # NSTextTabType NSLeftTabStopType = 0 NSRightTabStopType = 1 NSCenterTabStopType = 2 NSDecimalTabStopType = 3 # NSLineBreakMode - What to do with long lines NSLineBreakByWordWrapping = 0 # Wrap at word boundaries = default NSLineBreakByCharWrapping = 1 # Wrap at character boundaries NSLineBreakByClipping = 2 # Simply clip NSLineBreakByTruncatingHead = 3 # Truncate at head of line: "...wxyz" NSLineBreakByTruncatingTail = 4 # Truncate at tail of line: "abcd..." NSLineBreakByTruncatingMiddle = 5 # Truncate middle of line: "ab...yz"
cappert/RIGS
Ruby/rigs/NSParagraphStyle.rb
Ruby
gpl-2.0
1,676
[ 30522, 1001, 24978, 28689, 27341, 27983, 1012, 21144, 1011, 5587, 1037, 3232, 1997, 2477, 2000, 1996, 7863, 1039, 24978, 28689, 27341, 27983, 2465, 1001, 1001, 1002, 8909, 1002, 1001, 1001, 9385, 1006, 1039, 1007, 2541, 2489, 4007, 3192, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Collections.Immutable Imports System.Composition Imports System.Threading Imports Microsoft.CodeAnalysis.Completion Imports Microsoft.CodeAnalysis.Editor.UnitTests.Extensions Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.Snippets Imports Microsoft.CodeAnalysis.Tags Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.VisualStudio.LanguageServices.VisualBasic.Snippets Imports Microsoft.VisualStudio.Text Imports Microsoft.VisualStudio.Text.Projection Imports Roslyn.Utilities Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense <[UseExportProvider]> Public Class VisualBasicCompletionCommandHandlerTests <WorkItem(546208, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546208")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function MultiWordKeywordCommitBehavior() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class C Sub M() $$ End Sub End Class </Document>) state.SendTypeChars("on") Await state.AssertSelectedCompletionItem("On Error GoTo", description:=String.Format(FeaturesResources._0_Keyword, "On Error GoTo") + vbCrLf + VBFeaturesResources.Enables_the_error_handling_routine_that_starts_at_the_line_specified_in_the_line_argument_The_specified_line_must_be_in_the_same_procedure_as_the_On_Error_statement_On_Error_GoTo_bracket_label_0_1_bracket) state.SendTypeChars(" ") Await state.AssertSelectedCompletionItem("On Error GoTo", description:=String.Format(FeaturesResources._0_Keyword, "On Error GoTo") + vbCrLf + VBFeaturesResources.Enables_the_error_handling_routine_that_starts_at_the_line_specified_in_the_line_argument_The_specified_line_must_be_in_the_same_procedure_as_the_On_Error_statement_On_Error_GoTo_bracket_label_0_1_bracket) End Using End Function <WorkItem(546208, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546208")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function MultiWordKeywordCommitBehavior2() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class C Sub M() $$ End Sub End Class </Document>) state.SendTypeChars("next") Await state.AssertSelectedCompletionItem("On Error Resume Next", description:=String.Format(FeaturesResources._0_Keyword, "On Error Resume Next") + vbCrLf + VBFeaturesResources.When_a_run_time_error_occurs_execution_transfers_to_the_statement_following_the_statement_or_procedure_call_that_resulted_in_the_error) state.SendTypeChars(" ") Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionNotShownWhenBackspacingThroughWhitespace() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Module M Sub Goo() If True Then $$Console.WriteLine() End Sub End Module </Document>) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion), WorkItem(541032, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541032")> Public Async Function CompletionNotShownWhenBackspacingThroughNewline() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Module Program Sub Main() If True And $$False Then End If End Sub End Module </Document>) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionAdjustInsertionText_CommitsOnOpenParens1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Module M Sub FogBar() End Sub Sub test() $$ End Sub End Module </document>) state.SendTypeChars("Fog(") Await state.AssertCompletionSession() Assert.Contains(" FogBar(", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionUpAfterDot() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Sub Main(args As String()) Program$$ End Sub End Class </document>) Await state.AssertNoCompletionSession() state.SendTypeChars(".") Await state.AssertCompletionSession() End Using End Function <WorkItem(546432, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546432")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub ImplementsCompletionFaultTolerance() Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Class C Sub Goo() Implements ICloneable$$ End Module </Document>) state.SendTypeChars(".") End Using End Sub <WorkItem(5487, "https://github.com/dotnet/roslyn/issues/5487")> <WpfFact(Skip:="https://github.com/dotnet/roslyn/issues/48870"), Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestCommitCharTypedAtTheBeginingOfTheFilterSpan() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Fuction F() As Boolean If $$ End Function End Class ]]></Document>) state.SendTypeChars("tru") Await state.AssertCompletionSession() state.SendLeftKey() state.SendLeftKey() state.SendLeftKey() Await state.AssertSelectedCompletionItem(isSoftSelected:=True) state.SendTypeChars("(") Assert.Equal("If (tru", state.GetLineTextFromCaretPosition().Trim()) Assert.Equal("t", state.GetCaretPoint().BufferPosition.GetChar()) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionAdjustInsertionText_CommitsOnOpenParens2() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Module M Sub FogBar(Of T)() End Sub Sub test() $$ End Sub End Module </document>) state.SendTypeChars("Fog(") Await state.AssertCompletionSession() Assert.Contains(" FogBar(", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WorkItem(543497, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543497")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionDismissedAfterEscape1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Sub Main(args As String()) Program$$ End Sub End Class </document>) Await state.AssertNoCompletionSession() state.SendTypeChars(".") Await state.AssertCompletionSession() state.SendEscape() Await state.AssertNoCompletionSession() End Using End Function <WorkItem(543497, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543497")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestEnterOnSoftSelection1() As Task ' Code must be left-aligned because of https://github.com/dotnet/roslyn/issues/27988 Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Shared Sub Main(args As String()) Program.$$ End Sub End Class </document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem("Equals", isSoftSelected:=True) Dim caretPos = state.GetCaretPoint().BufferPosition.Position state.SendReturn() state.Workspace.Documents.First().GetTextView().Caret.MoveTo(New SnapshotPoint(state.Workspace.Documents.First().GetTextBuffer().CurrentSnapshot, caretPos)) Assert.Contains("Program." + vbCrLf, state.GetLineFromCurrentCaretPosition().GetTextIncludingLineBreak(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionTestTab1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Module M Sub FogBar() End Sub Sub test() $$ End Sub End Module </document>) state.SendTypeChars("Fog") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains(" FogBar", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function DotIsInserted() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Sub Main(args As String()) $$ End Sub End Class </document>) state.SendTypeChars("Progra.") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem(displayText:="Equals", isSoftSelected:=True) Assert.Contains("Program.", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestReturn1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Sub Main(args As String()) $$ End Sub End Class </document>) state.SendTypeChars("Progra") state.SendReturn() Await state.AssertNoCompletionSession() Assert.Contains(<text> Sub Main(args As String()) Program End Sub</text>.NormalizedValue, state.GetDocumentText(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestDown1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Namespace N Class A End Class Class B End Class Class C End Class End Namespace Class Program Sub Main(args As String()) N$$ End Sub End Class </document>) state.SendTypeChars(".A") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem(displayText:="A", isHardSelected:=True) state.SendDownKey() Await state.AssertSelectedCompletionItem(displayText:="B", isHardSelected:=True) state.SendDownKey() Await state.AssertSelectedCompletionItem(displayText:="C", isHardSelected:=True) state.SendDownKey() Await state.AssertSelectedCompletionItem(displayText:="C", isHardSelected:=True) state.SendPageUp() Await state.AssertSelectedCompletionItem(displayText:="A", isHardSelected:=True) state.SendUpKey() Await state.AssertSelectedCompletionItem(displayText:="A", isHardSelected:=True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestFirstCharacterDoesNotFilter1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Namespace N Class A End Class Class B End Class Class C End Class End Namespace Class Program Sub Main(args As String()) N$$ End Sub End Class </document>) state.SendTypeChars(".A") Await state.AssertCompletionSession() Assert.Equal(3, state.GetCompletionItems().Count) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSecondCharacterDoesFilter1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Namespace N Class AAA End Class Class AAB End Class Class BB End Class Class CC End Class End Namespace Class Program Sub Main(args As String()) N$$ End Sub End Class </document>) state.SendTypeChars(".A") Await state.AssertCompletionSession() Assert.Equal(4, state.GetCompletionItems().Count) state.SendTypeChars("A") Await state.AssertCompletionSession() Assert.Equal(2, state.GetCompletionItems().Count) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNavigateSoftToHard() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Shared Sub Main(args As String()) Program.$$ End Sub End Class </document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem(displayText:="Equals", isSoftSelected:=True) state.SendUpKey() Await state.AssertSelectedCompletionItem(displayText:="Equals", isHardSelected:=True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestBackspaceBeforeCompletedComputation() As Task ' Simulate a very slow completionImplementation provider. Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Shared Sub Main(args As String()) Program$$ End Sub End Class </document>, extraExportedTypes:={GetType(TriggeredCompletionProvider)}.ToList()) Dim completionService = DirectCast(state.Workspace.Services.GetLanguageServices(LanguageNames.VisualBasic).GetRequiredService(Of CompletionService)(), CompletionServiceWithProviders) Dim provider = completionService.GetTestAccessor().GetAllProviders(ImmutableHashSet(Of String).Empty).OfType(Of TriggeredCompletionProvider)().Single() Await state.AssertNoCompletionSession() state.SendTypeChars(".M") ' We should not have a session now. Note: do not block as this will just deadlock things ' since the provider will not return. state.AssertNoCompletionSessionWithNoBlock() ' Now, navigate back. state.SendBackspace() ' allow the provider to continue provider.e.Set() ' At this point, completionImplementation will be available since the caret is still within the model's span. Await state.AssertCompletionSession() ' Now, navigate back again. Completion should be dismissed state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNavigationBeforeCompletedComputation() As Task ' Simulate a very slow completionImplementation provider. Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Shared Sub Main(args As String()) Program$$ End Sub End Class </document>, extraExportedTypes:={GetType(TriggeredCompletionProvider)}.ToList()) Dim completionService = DirectCast(state.Workspace.Services.GetLanguageServices(LanguageNames.VisualBasic).GetRequiredService(Of CompletionService)(), CompletionServiceWithProviders) Dim provider = completionService.GetTestAccessor().GetAllProviders(ImmutableHashSet(Of String).Empty).OfType(Of TriggeredCompletionProvider)().Single() Await state.AssertNoCompletionSession() state.SendTypeChars(".Ma") ' We should not have a session now. Note: do not block as this will just deadlock things ' since the provider will not return. state.AssertNoCompletionSessionWithNoBlock() ' Now, navigate using the caret. state.SendMoveToPreviousCharacter() ' allow the provider to continue provider.e.Set() ' Async provider can handle keys pressed while waiting for providers. Await state.AssertCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNavigationOutBeforeCompletedComputation() As Task ' Simulate a very slow completionImplementation provider. Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Shared Sub Main(args As String()) Program$$ End Sub End Class </document>, extraExportedTypes:={GetType(TriggeredCompletionProvider)}.ToList()) Dim completionService = DirectCast(state.Workspace.Services.GetLanguageServices(LanguageNames.VisualBasic).GetRequiredService(Of CompletionService)(), CompletionServiceWithProviders) Dim provider = completionService.GetTestAccessor().GetAllProviders(ImmutableHashSet(Of String).Empty).OfType(Of TriggeredCompletionProvider)().Single() Await state.AssertNoCompletionSession() state.SendTypeChars(".Ma") ' We should not have a session now. Note: do not block as this will just deadlock things ' since the provider will not return. state.AssertNoCompletionSessionWithNoBlock() ' Now, navigate using the caret. state.SendDownKey() ' allow the provider to continue provider.e.Set() ' Caret was intended to be moved out of the span. ' Therefore, we should cancel the completion And move the caret. Await state.AssertNoCompletionSession() Assert.Contains(" End Sub", state.GetLineFromCurrentCaretPosition().GetText(), StringComparison.Ordinal) End Using End Function <WpfFact(Skip:="https://github.com/dotnet/roslyn/issues/48870")> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNavigateOutOfItemChangeSpan() As Task ' Code must be left-aligned because of https://github.com/dotnet/roslyn/issues/27988 Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Shared Sub Main(args As String()) Program$$ End Sub End Class </document>) Await state.AssertNoCompletionSession() state.SendTypeChars(".Ma") Await state.AssertCompletionSession() state.SendMoveToPreviousCharacter() Await state.AssertCompletionSession() state.SendMoveToPreviousCharacter() Await state.AssertCompletionSession() state.SendMoveToPreviousCharacter() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestUndo1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Class Program Shared Sub Main(args As String()) Program$$ End Sub End Class </document>) Await state.AssertNoCompletionSession() state.SendTypeChars(".Ma(") Await state.AssertCompletionSession() Assert.Contains(".Main(", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) state.SendUndo() Assert.Contains(".Ma(", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestCommitAfterNavigation() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Namespace N Class A End Class Class B End Class Class C End Class End Namespace Class Program Sub Main(args As String()) N$$ End Sub End Class </document>) state.SendTypeChars(".A") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem(displayText:="A", isHardSelected:=True) state.SendDownKey() Await state.AssertSelectedCompletionItem(displayText:="B", isHardSelected:=True) state.SendTab() Assert.Contains(".B", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestFiltering1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Imports System Class c Sub Main $$ End Sub End Class</document>) state.SendTypeChars("Sy") Await state.AssertCompletionItemsContainAll("OperatingSystem", "System") Await state.AssertCompletionItemsDoNotContainAny("Exception", "Activator") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMSCorLibTypes() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Imports System Class c Inherits$$ End Class</document>) state.SendTypeChars(" ") Await state.AssertCompletionItemsContainAll("Attribute", "Exception") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestDescription1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> <![CDATA[Imports System ''' <summary> ''' TestDoc ''' </summary> Class TestException Inherits Exception End Class Class MyException Inherits $$ End Class]]></document>) state.SendTypeChars("TestEx") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem(description:="Class TestException" & vbCrLf & "TestDoc") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestObjectCreationPreselection1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim x As List(Of Integer) = New$$ End Sub End Module]]></Document>) state.SendTypeChars(" ") Await state.AssertSelectedCompletionItem(displayText:="List(Of Integer)", isHardSelected:=True) Await state.AssertCompletionItemsContainAll("LinkedList", "List", "System") state.SendTypeChars("Li") Await state.AssertSelectedCompletionItem(displayText:="List(Of Integer)", isHardSelected:=True) Await state.AssertCompletionItemsContainAll("LinkedList", "List") Await state.AssertCompletionItemsDoNotContainAny("System") state.SendTypeChars("n") Await state.AssertSelectedCompletionItem(displayText:="LinkedList", displayTextSuffix:="(Of " & ChrW(&H2026) & ")", isHardSelected:=True) state.SendBackspace() Await state.AssertSelectedCompletionItem(displayText:="List(Of Integer)", isHardSelected:=True) state.SendTab() Assert.Contains("New List(Of Integer)", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WorkItem(287, "https://github.com/dotnet/roslyn/issues/287")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function NotEnumPreselectionAfterBackspace() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Enum E Bat End Enum Class C Sub Test(param As E) Dim b As E Test(b.$$) End Sub End Class]]></Document>) state.SendBackspace() Await state.AssertSelectedCompletionItem(displayText:="b", isHardSelected:=True) End Using End Function <WorkItem(543496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543496")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNumericLiteralWithNoMatch() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Module Program Sub Main(args As String()) Dim i =$$ End Sub End Module</Document>) state.SendTypeChars(" 0") Await state.AssertNoCompletionSession() state.SendReturn() Await state.AssertNoCompletionSession() Assert.Equal(<Document> Imports System Module Program Sub Main(args As String()) Dim i = 0 End Sub End Module</Document>.NormalizedValue, state.GetDocumentText()) End Using End Function <WorkItem(543496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543496")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNumericLiteralWithPartialMatch() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Module Program Sub Main(args As String()) Dim i =$$ End Sub End Module</Document>) ' Could match Int32 ' kayleh 1/17/2013, but we decided to have #s always dismiss the list in bug 547287 state.SendTypeChars(" 3") Await state.AssertNoCompletionSession() state.SendReturn() Await state.AssertNoCompletionSession() Assert.Equal(<Document> Imports System Module Program Sub Main(args As String()) Dim i = 3 End Sub End Module</Document>.NormalizedValue, state.GetDocumentText()) End Using End Function <WorkItem(543496, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543496")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNumbersAfterLetters() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Module Program Sub Main(args As String()) Dim i =$$ End Sub End Module</Document>) ' Could match Int32 state.SendTypeChars(" I3") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem(displayText:="Int32", isHardSelected:=True) state.SendReturn() Await state.AssertNoCompletionSession() Assert.Equal(<Document> Imports System Module Program Sub Main(args As String()) Dim i = Int32 End Sub End Module</Document>.NormalizedValue, state.GetDocumentText()) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNotAfterTypingDotAfterIntegerLiteral() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> class c sub M() WriteLine(3$$ end sub end class </Document>) state.SendTypeChars(".") Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestAfterExplicitInvokeAfterDotAfterIntegerLiteral() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> class c sub M() WriteLine(3.$$ end sub end class </Document>) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll("ToString") End Using End Function <WorkItem(543669, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543669")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestDeleteWordToLeft() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> class c sub M() $$ end sub end class </Document>) state.SendTypeChars("Dim i =") Await state.AssertCompletionSession() state.SendDeleteWordToLeft() Await state.AssertNoCompletionSession() End Using End Function <WorkItem(543617, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543617")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestCompletionGenericWithOpenParen() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> class c sub Goo(Of X)() $$ end sub end class </Document>) state.SendTypeChars("Go(") Await state.AssertCompletionSession() Assert.Equal(" Goo(", state.GetLineTextFromCaretPosition()) Assert.DoesNotContain("Goo(Of", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WorkItem(543617, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543617")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestCompletionGenericWithSpace() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> class c sub Goo(Of X)() $$ end sub end class </Document>) state.SendTypeChars("Go ") Await state.AssertCompletionSession() Assert.Equal(" Goo(Of ", state.GetLineTextFromCaretPosition()) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CommitForImportsStatement1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> $$ </Document>) state.SendTypeChars("Imports Sys") Await state.AssertSelectedCompletionItem(displayText:="System", isHardSelected:=True) state.SendTypeChars("(") Await state.AssertNoCompletionSession() Assert.Contains("Imports Sys(", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CommitForImportsStatement2() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> $$ </Document>) state.SendTypeChars("Imports Sys") Await state.AssertSelectedCompletionItem(displayText:="System", isHardSelected:=True) state.SendTypeChars(".") Await state.AssertCompletionSession() Assert.Contains("Imports System.", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CommitForImportsStatement3() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> $$ </Document>) state.SendTypeChars("Imports Sys") Await state.AssertSelectedCompletionItem(displayText:="System", isHardSelected:=True) state.SendTypeChars(" ") Await state.AssertNoCompletionSession() Assert.Contains("Imports Sys ", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WorkItem(544190, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544190")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function DoNotInsertEqualsForNamedParameterCommitWithColon() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class Class1 Sub Method() Test($$ End Sub Sub Test(Optional x As Integer = 42) End Sub End Class </Document>) state.SendTypeChars("x:") Await state.AssertNoCompletionSession() Assert.DoesNotContain(":=", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WorkItem(544190, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544190")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function DoInsertEqualsForNamedParameterCommitWithSpace() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class Class1 Sub Method() Test($$ End Sub Sub Test(Optional x As Integer = 42) End Sub End Class </Document>) state.SendTypeChars("x") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains(":=", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WorkItem(544150, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544150")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function ConsumeHashForPreprocessorCompletion() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> $$ </Document>) state.SendTypeChars("#re") state.SendTab() Await state.AssertNoCompletionSession() Assert.Equal("#Region", state.GetLineTextFromCaretPosition()) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function EnumCompletionTriggeredOnSpace() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Enum Numeros Uno Dos End Enum Class Goo Sub Bar(a As Integer, n As Numeros) End Sub Sub Baz() Bar(0$$ End Sub End Class </Document>) state.SendTypeChars(", ") Await state.AssertSelectedCompletionItem(displayText:="Numeros.Dos", isSoftSelected:=True) End Using End Function <ExportCompletionProvider(NameOf(TriggeredCompletionProvider), LanguageNames.VisualBasic)> <[Shared]> <PartNotDiscoverable> Friend Class TriggeredCompletionProvider Inherits MockCompletionProvider Public ReadOnly e As ManualResetEvent = New ManualResetEvent(False) <ImportingConstructor> <Obsolete(MefConstruction.ImportingConstructorMessage, True)> Public Sub New() MyBase.New(getItems:=Function(t, p, c) Return Nothing End Function, isTriggerCharacter:=Function(t, p) True) End Sub Public Overrides Function ProvideCompletionsAsync(context As CompletionContext) As Task e.WaitOne() Return MyBase.ProvideCompletionsAsync(context) End Function End Class <WorkItem(544297, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544297")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestVerbatimNamedIdentifierFiltering() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class Class1 Private Sub Test([string] As String) Test($$ End Sub End Class </Document>) state.SendTypeChars("s") Await state.AssertCompletionSession() Await state.AssertCompletionItemsContain("string", ":=") state.SendTypeChars("t") Await state.AssertCompletionSession() Await state.AssertCompletionItemsContain("string", ":=") End Using End Function <WorkItem(544299, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544299")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestExclusiveNamedParameterCompletion() As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" LanguageVersion="15"> <Document> Class Class1 Private Sub Test() Goo(bool:=False,$$ End Sub Private Sub Goo(str As String, character As Char) End Sub Private Sub Goo(str As String, bool As Boolean) End Sub End Class </Document> </Project> </Workspace>) state.SendTypeChars(" ") Await state.AssertCompletionSession() Assert.Equal(1, state.GetCompletionItems().Count) Await state.AssertCompletionItemsContain("str", ":=") End Using End Function <WorkItem(544299, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544299")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestExclusiveNamedParameterCompletion2() As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" LanguageVersion="15"> <Document> Class Goo Private Sub Test() Dim m As Object = Nothing Method(obj:=m, $$ End Sub Private Sub Method(obj As Object, num As Integer, str As String) End Sub Private Sub Method(dbl As Double, str As String) End Sub Private Sub Method(num As Integer, b As Boolean, str As String) End Sub Private Sub Method(obj As Object, b As Boolean, str As String) End Sub End Class </Document> </Project> </Workspace>) state.SendTypeChars(" ") Await state.AssertCompletionSession() Assert.Equal(3, state.GetCompletionItems().Count) Await state.AssertCompletionItemsContain("b", ":=") Await state.AssertCompletionItemsContain("num", ":=") Await state.AssertCompletionItemsContain("str", ":=") Assert.False(state.GetCompletionItems().Any(Function(i) i.DisplayText = "dbl" AndAlso i.DisplayTextSuffix = ":=")) End Using End Function <WorkItem(544471, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544471")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestDontCrashOnEmptyParameterList() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> &lt;Obsolete()$$&gt; </Document>) state.SendTypeChars(" ") Await state.AssertNoCompletionSession() End Using End Function <WorkItem(544628, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544628")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function OnlyMatchOnLowercaseIfPrefixWordMatch() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Module Program $$ End Module </Document>) state.SendTypeChars("z") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("#Const", isSoftSelected:=True) End Using End Function <WorkItem(544989, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544989")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function MyBaseFinalize() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class C Protected Overrides Sub Finalize() MyBase.Finalize$$ End Sub End Class </Document>) state.SendTypeChars("(") Await state.AssertSignatureHelpSession() Await state.AssertSignatureHelpItemsContainAll({"Object.Finalize()"}) End Using End Function <WorkItem(551117, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/551117")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNamedParameterSortOrder() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Module Program Sub Main(args As String()) Main($$ End Sub End Module </Document>) state.SendTypeChars("a") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("args", isHardSelected:=True) state.SendDownKey() Await state.AssertSelectedCompletionItem("args", displayTextSuffix:=":=", isHardSelected:=True) End Using End Function <WorkItem(546810, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546810")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestLineContinuationCharacter() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Module Program Sub Main() Dim x = New $$ End Sub End Module </Document>) state.SendTypeChars("_") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("_AppDomain", isHardSelected:=False) End Using End Function <WorkItem(547287, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/547287")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNumberDismissesCompletion() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Module Program Sub Main() Console.WriteLine$$ End Sub End Module </Document>) state.SendTypeChars("(") Await state.AssertCompletionSession() state.SendTypeChars(".") Await state.AssertNoCompletionSession() state.SendBackspace() state.SendBackspace() state.SendTypeChars("(") Await state.AssertCompletionSession() state.SendTypeChars("-") Await state.AssertNoCompletionSession() state.SendBackspace() state.SendBackspace() state.SendTypeChars("(") Await state.AssertCompletionSession() state.SendTypeChars("1") Await state.AssertNoCompletionSession() End Using End Function <WpfFact(Skip:="https://github.com/dotnet/roslyn/issues/27446"), Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestProjections() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> {|S1: Imports System Module Program Sub Main(arg As String) Dim bbb = 234 Console.WriteLine$$ End Sub End Module|} </Document>) Dim subjectDocument = state.Workspace.Documents.First() Dim firstProjection = state.Workspace.CreateProjectionBufferDocument( <Document> {|S1:|} {|S2: some text that's mapped to the surface buffer |} </Document>.NormalizedValue, {subjectDocument}, options:=ProjectionBufferOptions.WritableLiteralSpans) Dim topProjectionBuffer = state.Workspace.CreateProjectionBufferDocument( <Document> {|S1:|} {|S2:|} </Document>.NormalizedValue, {firstProjection}, options:=ProjectionBufferOptions.WritableLiteralSpans) ' Test a view that has a subject buffer with multiple projection buffers in between Dim view = topProjectionBuffer.GetTextView() Dim subjectBuffer = subjectDocument.GetTextBuffer() state.SendTypeCharsToSpecificViewAndBuffer("(", view, subjectBuffer) Await state.AssertCompletionSession(view) state.SendTypeCharsToSpecificViewAndBuffer("a", view, subjectBuffer) Await state.AssertSelectedCompletionItem(displayText:="arg", projectionsView:=view) Dim text = view.TextSnapshot.GetText() Dim projection = DirectCast(topProjectionBuffer.GetTextBuffer(), IProjectionBuffer) Dim sourceSpans = projection.CurrentSnapshot.GetSourceSpans() ' unmap our source spans without changing the top buffer projection.ReplaceSpans(0, sourceSpans.Count, {subjectBuffer.CurrentSnapshot.CreateTrackingSpan(0, subjectBuffer.CurrentSnapshot.Length, SpanTrackingMode.EdgeInclusive)}, EditOptions.DefaultMinimalChange, editTag:=Nothing) state.SendBackspace() state.SendTypeChars("b") Await state.AssertSelectedCompletionItem(displayText:="bbb") ' prepare to remap our subject buffer Dim subjectBufferText = subjectDocument.GetTextBuffer().CurrentSnapshot.GetText() Using edit = subjectDocument.GetTextBuffer().CreateEdit(EditOptions.DefaultMinimalChange, reiteratedVersionNumber:=Nothing, editTag:=Nothing) edit.Replace(New Span(0, subjectBufferText.Length), subjectBufferText.Replace("Console.WriteLine(a", "Console.WriteLine(b")) edit.Apply() End Using Dim replacementSpans = sourceSpans.Select(Function(ss) If ss.Snapshot.TextBuffer.ContentType.TypeName = "inert" Then Return DirectCast(ss.Snapshot.GetText(ss.Span), Object) Else Return DirectCast(ss.Snapshot.CreateTrackingSpan(ss.Span, SpanTrackingMode.EdgeExclusive), Object) End If End Function).ToList() projection.ReplaceSpans(0, 1, replacementSpans, EditOptions.DefaultMinimalChange, editTag:=Nothing) ' the same completionImplementation session should still be active after the remapping. Await state.AssertSelectedCompletionItem(displayText:="bbb", projectionsView:=view) state.SendTypeCharsToSpecificViewAndBuffer("b", view, subjectBuffer) Await state.AssertSelectedCompletionItem(displayText:="bbb", projectionsView:=view) ' verify we can commit even when unmapped projection.ReplaceSpans(0, projection.CurrentSnapshot.GetSourceSpans.Count, {projection.CurrentSnapshot.GetText()}, EditOptions.DefaultMinimalChange, editTag:=Nothing) Await state.SendCommitUniqueCompletionListItemAsync() Assert.Contains(<text> Imports System Module Program Sub Main(arg As String) Dim bbb = 234 Console.WriteLine(bbb End Sub End Module </text>.NormalizedValue, state.GetDocumentText(), StringComparison.Ordinal) End Using End Function <WorkItem(622957, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/622957")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestBangFiltersInDocComment() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ ''' $$ Public Class TestClass End Class ]]></Document>) state.SendTypeChars("<") Await state.AssertCompletionSession() state.SendTypeChars("!") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("!--") End Using End Function <WpfFact(Skip:="https://github.com/dotnet/roslyn/issues/48870")> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionUpAfterBackSpacetoWord() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Public E$$ </Document>) state.SendBackspace() Await state.AssertCompletionSession() state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function NoCompletionAfterBackspaceInStringLiteral() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Sub Goo() Dim z = "aa$$" End Sub </Document>) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionUpAfterDeleteDot() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Sub Goo() Dim z = "a" z.$$ToString() End Sub </Document>) state.SendBackspace() Await state.AssertCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function NotCompletionUpAfterDeleteRParen() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Sub Goo() "a".ToString()$$ End Sub </Document>) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function NotCompletionUpAfterDeleteLParen() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Sub Goo() "a".ToString($$ End Sub </Document>) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function NotCompletionUpAfterDeleteComma() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Sub Goo(x as Integer, y as Integer) Goo(1,$$) End Sub </Document>) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionAfterDeleteKeyword() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Sub Goo(x as Integer, y as Integer) Goo(1,2) End$$ Sub </Document>) state.SendBackspace() Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("End", description:=String.Format(FeaturesResources._0_Keyword, "End") + vbCrLf + VBFeaturesResources.Stops_execution_immediately) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function NoCompletionOnBackspaceAtBeginningOfFile() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document>$$</Document>) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WpfFact(), Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionUpAfterLeftCurlyBrace() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> Imports System Imports System.Collections.Generic Imports System.Linq Module Program Sub Main(args As String()) Dim l As New List(Of Integer) From $$ End Sub End Module </document>) Await state.AssertNoCompletionSession() state.SendTypeChars("{") Await state.AssertCompletionSession() End Using End Function <WpfFact(), Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionUpAfterLeftAngleBracket() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <document> $$ Module Program Sub Main(args As String()) End Sub End Module </document>) Await state.AssertNoCompletionSession() state.SendTypeChars("<") Await state.AssertCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function InvokeCompletionDoesNotFilter() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as String$$ End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem("String") Await state.AssertCompletionItemsContainAll("Integer", "G") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function InvokeCompletionSelectsWithoutRegardToCaretPosition() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as Str$$ing End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem("String") Await state.AssertCompletionItemsContainAll("Integer", "G") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function InvokeCompletionBeforeWordDoesNotSelect() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as $$String End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem("AccessViolationException") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BackspaceCompletionInvokedSelectedAndUnfiltered() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as String$$ End Sub End Class ]]></Document>) state.SendBackspace() Await state.AssertSelectedCompletionItem("String") Await state.AssertCompletionItemsContainAll("Integer", "G") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function ListDismissedIfNoMatches() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as $$ End Sub End Class ]]></Document>) state.SendTypeChars("str") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("String", isHardSelected:=True) state.SendTypeChars("gg") Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function InvokeCompletionComesUpEvenIfNoMatches() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as gggg$$ End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertCompletionSession() End Using End Function <WorkItem(674422, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/674422")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BackspaceInvokeCompletionComesUpEvenIfNoMatches() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as gggg$$ End Sub End Class ]]></Document>) state.SendBackspace() Await state.AssertCompletionSession() state.SendBackspace() Await state.AssertCompletionSession() End Using End Function <WorkItem(674366, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/674366")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BackspaceCompletionSelects() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as Integrr$$ End Sub End Class ]]></Document>) state.SendBackspace() Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("Integer") End Using End Function <WorkItem(675555, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/675555")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BackspaceCompletionNeverFilters() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as String$$ End Sub End Class ]]></Document>) state.SendBackspace() Await state.AssertCompletionSession() Await state.AssertCompletionItemsContainAll("AccessViolationException") state.SendBackspace() Await state.AssertCompletionSession() Await state.AssertCompletionItemsContainAll("AccessViolationException") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub TabAfterQuestionMarkInEmptyLine() Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() ?$$ End Sub End Class ]]></Document>) state.SendTab() Assert.Equal(state.GetLineTextFromCaretPosition(), " ?" + vbTab) End Using End Sub <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub TabAfterTextFollowedByQuestionMark() Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() a?$$ End Sub End Class ]]></Document>) state.SendTab() Assert.Equal(state.GetLineTextFromCaretPosition(), " a") End Using End Sub <WorkItem(669942, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/669942")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function DistinguishItemsWithDifferentGlyphs() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Imports System.Linq Class Test Sub [Select]() End Sub Sub Goo() Dim k As Integer = 1 $$ End Sub End Class ]]></Document>) state.SendTypeChars("selec") Await state.AssertCompletionSession() Assert.Equal(state.GetCompletionItems().Count, 2) End Using End Function <WorkItem(670149, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/670149")> <WpfFact(), Trait(Traits.Feature, Traits.Features.Completion)> Public Sub TabAfterNullableFollowedByQuestionMark() Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Dim a As Integer?$$ End Class ]]></Document>) state.SendTab() Assert.Equal(state.GetLineTextFromCaretPosition(), " Dim a As Integer?" + vbTab) End Using End Sub <WorkItem(672474, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/672474")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestInvokeSnippetCommandDismissesCompletion() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document>$$</Document>) state.SendTypeChars("Imp") Await state.AssertCompletionSession() state.SendInsertSnippetCommand() Await state.AssertNoCompletionSession() End Using End Function <WorkItem(672474, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/672474")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSurroundWithCommandDismissesCompletion() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document>$$</Document>) state.SendTypeChars("Imp") Await state.AssertCompletionSession() state.SendSurroundWithCommand() Await state.AssertNoCompletionSession() End Using End Function <WorkItem(716117, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/716117")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function XmlCompletionNotTriggeredOnBackspaceInText() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ ''' <summary> ''' text$$ ''' </summary> Class G Dim a As Integer? End Class]]></Document>) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WorkItem(716117, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/716117")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function XmlCompletionNotTriggeredOnBackspaceInTag() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ ''' <summary$$> ''' text ''' </summary> Class G Dim a As Integer? End Class]]></Document>) state.SendBackspace() Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("summary") End Using End Function <WorkItem(674415, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/674415")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BackspacingLastCharacterDismisses() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document>$$</Document>) state.SendTypeChars("A") Await state.AssertCompletionSession() state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WorkItem(719977, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/719977")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function HardSelectionWithBuilderAndOneExactMatch() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document>Module M Public $$ End Module</Document>) state.SendTypeChars("sub") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("Sub") Assert.True(state.HasSuggestedItem()) End Using End Function <WorkItem(828603, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/828603")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function SoftSelectionWithBuilderAndNoExactMatch() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document>Module M Public $$ End Module</Document>) state.SendTypeChars("prop") Await state.AssertCompletionSession() Await state.AssertSelectedCompletionItem("Property", isSoftSelected:=True) Assert.True(state.HasSuggestedItem()) End Using End Function ' The test verifies the CommitCommandHandler isolated behavior which does not add '()' after 'Main'. ' The integrated VS behavior for the case is to get 'Main()'. <WorkItem(792569, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/792569")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub CommitOnEnter() Dim expected = <Document>Module M Sub Main() Main End Sub End Module</Document>.Value.Replace(vbLf, vbCrLf) Using state = TestStateFactory.CreateVisualBasicTestState( <Document>Module M Sub Main() Ma$$i End Sub End Module</Document>) state.SendInvokeCompletionList() state.SendReturn() Assert.Equal(expected, state.GetDocumentText()) End Using End Sub <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub TestEnterIsConsumedWithAfterFullyTypedWordOption_NotFullyTyped() Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class Class1 Sub Main(args As String()) $$ End Sub End Class </Document>) Dim workspace = state.Workspace workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options _ .WithChangedOption(CompletionOptions.EnterKeyBehavior, LanguageNames.VisualBasic, EnterKeyRule.AfterFullyTypedWord))) state.SendTypeChars("System.TimeSpan.FromMin") state.SendReturn() Assert.Equal(<text> Class Class1 Sub Main(args As String()) System.TimeSpan.FromMinutes End Sub End Class </text>.NormalizedValue, state.GetDocumentText()) End Using End Sub <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub TestEnterIsConsumedWithAfterFullyTypedWordOption_FullyTyped() Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class Class1 Sub Main(args As String()) $$ End Sub End Class </Document>) Dim workspace = state.Workspace workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options _ .WithChangedOption(CompletionOptions.EnterKeyBehavior, LanguageNames.VisualBasic, EnterKeyRule.AfterFullyTypedWord))) state.SendTypeChars("System.TimeSpan.FromMinutes") state.SendReturn() Assert.Equal(<text> Class Class1 Sub Main(args As String()) System.TimeSpan.FromMinutes End Sub End Class </text>.NormalizedValue, state.GetDocumentText()) End Using End Sub <WorkItem(546208, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546208")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function SelectKeywordFirst() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class C Sub M() $$ End Sub Sub GetType() End Sub End Class </Document>) state.SendTypeChars("GetType") Await state.AssertSelectedCompletionItem( displayText:="GetType", displayTextSuffix:=String.Empty, description:=VBFeaturesResources.GetType_function + vbCrLf + VBWorkspaceResources.Returns_a_System_Type_object_for_the_specified_type_name + vbCrLf + $"GetType({VBWorkspaceResources.typeName}) As Type") End Using End Function <WorkItem(828392, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/828392")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function ConstructorFiltersAsNew() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Public Class Base Public Sub New(x As Integer) End Sub End Class Public Class Derived Inherits Base Public Sub New(x As Integer) MyBase.$$ End Sub End Class </Document>) state.SendTypeChars("New") Await state.AssertSelectedCompletionItem("New", isHardSelected:=True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function NoUnmentionableTypeInObjectCreation() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Public Class C Sub Goo() Dim a = new$$ End Sub End Class </Document>) state.SendTypeChars(" ") Await state.AssertSelectedCompletionItem("AccessViolationException", isSoftSelected:=True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function FilterPreferEnum() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Enum E Goo Bar End Enum Class Goo End Class Public Class C Sub Goo() E e = $$ End Sub End Class</Document>) state.SendTypeChars("g") Await state.AssertSelectedCompletionItem("E.Goo", isHardSelected:=True) End Using End Function <WorkItem(883295, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/883295")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function InsertOfOnSpace() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System.Threading.Tasks Public Class C Sub Goo() Dim a as $$ End Sub End Class </Document>) state.SendTypeChars("Task") Await state.WaitForUIRenderedAsync() state.SendDownKey() state.SendTypeChars(" ") Assert.Equal(" Dim a as Task(Of ", state.GetLineTextFromCaretPosition()) End Using End Function <WorkItem(883295, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/883295")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub DoNotInsertOfOnTab() Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System.Threading.Tasks Public Class C Sub Goo() Dim a as $$ End Sub End Class </Document>) state.SendTypeChars("Task") state.SendTab() Assert.Equal(state.GetLineTextFromCaretPosition(), " Dim a as Task") End Using End Sub <WorkItem(899414, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/899414")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function NotInPartialMethodDeclaration() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Module Module1 Sub Main() End Sub End Module Public Class Class2 Partial Private Sub PartialMethod(ByVal x As Integer) $$ End Sub End Class</Document>) state.SendInvokeCompletionList() Await state.AssertNoCompletionSession() End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestCompletionInLinkedFiles() As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" AssemblyName="VBProj" PreprocessorSymbols="Thing2=True"> <Document FilePath="C.vb"> Class C Sub M() $$ End Sub #If Thing1 Then Sub Thing1() End Sub #End If #If Thing2 Then Sub Thing2() End Sub #End If End Class </Document> </Project> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Thing1=True"> <Document IsLinkFile="true" LinkAssemblyName="VBProj" LinkFilePath="C.vb"/> </Project> </Workspace>) Dim documents = state.Workspace.Documents Dim linkDocument = documents.Single(Function(d) d.IsLinkFile) state.SendTypeChars("Thi") Await state.AssertSelectedCompletionItem("Thing1") state.SendBackspace() state.SendBackspace() state.SendBackspace() state.Workspace.SetDocumentContext(linkDocument.Id) state.SendTypeChars("Thi") Await state.AssertSelectedCompletionItem("Thing1") End Using End Function <WorkItem(916452, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/916452")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function SoftSelectedWithNoFilterText() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Class C Public Sub M(day As DayOfWeek) M$$ End Sub End Class</Document>) state.SendTypeChars("(") Await state.AssertCompletionSession() Assert.True(state.IsSoftSelected()) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function EnumSortingOrder() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Class C Public Sub M(day As DayOfWeek) M$$ End Sub End Class</Document>) state.SendTypeChars("(") Await state.AssertCompletionSession() ' DayOfWeek.Monday should immediately follow DayOfWeek.Friday Dim friday = state.GetCompletionItems().First(Function(i) i.DisplayText = "DayOfWeek.Friday") Dim monday = state.GetCompletionItems().First(Function(i) i.DisplayText = "DayOfWeek.Monday") Assert.True(state.GetCompletionItems().IndexOf(friday) = state.GetCompletionItems().IndexOf(monday) - 1) End Using End Function <WorkItem(951726, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/951726")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function DismissUponSave() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C $$ End Class]]></Document>) state.SendTypeChars("Su") Await state.AssertSelectedCompletionItem("Sub") state.SendSave() Await state.AssertNoCompletionSession() state.AssertMatchesTextStartingAtLine(2, " Su") End Using End Function <WorkItem(969794, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/969794")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function DeleteCompletionInvokedSelectedAndUnfiltered() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub goo() Dim x as Stri$$ng End Sub End Class ]]></Document>) state.SendDelete() Await state.AssertSelectedCompletionItem("String") End Using End Function <WorkItem(871755, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/871755")> <WorkItem(954556, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/954556")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function FilterPrefixOnlyOnBackspace1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Public Re$$ End Class ]]></Document>) state.SendBackspace() Await state.AssertSelectedCompletionItem("ReadOnly") state.SendTypeChars("a") Await state.AssertNoCompletionSession() End Using End Function <WorkItem(969040, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/969040")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BackspaceTriggerOnlyIfOptionEnabled() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Public Re$$ End Class ]]></Document>) Dim workspace = state.Workspace workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options _ .WithChangedOption(CompletionOptions.TriggerOnTyping, LanguageNames.VisualBasic, False))) state.SendBackspace() Await state.AssertNoCompletionSession() End Using End Function <WorkItem(957450, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/957450")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function KeywordsForIntrinsicsDeduplicated() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub Goo() $$ End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertCompletionSession() ' Should only have one item called 'Double' and it should have a keyword glyph Dim doubleItem = state.GetCompletionItems().Single(Function(c) c.DisplayText = "Double") Assert.True(doubleItem.Tags.Contains(WellKnownTags.Keyword)) End Using End Function <WorkItem(957450, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/957450")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function KeywordDeduplicationLeavesEscapedIdentifiers() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class [Double] Sub Goo() Dim x as $$ End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertCompletionSession() ' We should have gotten the item corresponding to [Double] and the item for the Double keyword Dim doubleItems = state.GetCompletionItems().Where(Function(c) c.DisplayText = "Double") Assert.Equal(2, doubleItems.Count()) Assert.True(doubleItems.Any(Function(c) c.Tags.Contains(WellKnownTags.Keyword))) Assert.True(doubleItems.Any(Function(c) c.Tags.Contains(WellKnownTags.Class) AndAlso c.Tags.Contains(WellKnownTags.Internal))) End Using End Function <WorkItem(957450, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/957450")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestEscapedItemCommittedWithCloseBracket() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class [Interface] Sub Goo() Dim x As $$ End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertCompletionSession() state.SendTypeChars("Interf]") state.AssertMatchesTextStartingAtLine(4, "Dim x As [Interface]") End Using End Function <WorkItem(1075298, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1075298")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub CommitOnQuestionMarkForConditionalAccess() Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System Class G Sub Goo() Dim x = String.$$ End Sub End Class ]]></Document>) state.SendTypeChars("emp?") state.AssertMatchesTextStartingAtLine(4, "Dim x = String.Empty?") End Using End Sub <WorkItem(1659, "https://github.com/dotnet/roslyn/issues/1659")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function DismissOnSelectAllCommand() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Sub goo() $$]]></Document>) ' Note: the caret is at the file, so the Select All command's movement ' of the caret to the end of the selection isn't responsible for ' dismissing the session. state.SendInvokeCompletionList() Await state.AssertCompletionSession() state.SendSelectAll() Await state.AssertNoCompletionSession() End Using End Function <WorkItem(3088, "https://github.com/dotnet/roslyn/issues/3088")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function DoNotPreferParameterNames() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Module Program Sub Main(args As String()) Dim Table As Integer goo(table$$) End Sub Sub goo(table As String) End Sub End Module]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem("Table") End Using End Function <WorkItem(4892, "https://github.com/dotnet/roslyn/issues/4892")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BooleanPreselection1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Module Program Sub Main(args As String()) Dim x as boolean = $$ End Sub End Module]]></Document>) state.SendTypeChars("f") Await state.AssertSelectedCompletionItem("False") state.SendBackspace() state.SendTypeChars("t") Await state.AssertSelectedCompletionItem("True") End Using End Function <WorkItem(4892, "https://github.com/dotnet/roslyn/issues/4892")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BooleanPreselection2() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Module Program Sub Main(args As String()) foot($$ End Sub Sub foot(x as boolean) End Sub End Module]]></Document>) state.SendTypeChars("f") Await state.AssertSelectedCompletionItem("False") state.SendBackspace() state.SendTypeChars("t") Await state.AssertSelectedCompletionItem("True") End Using End Function <WorkItem(4892, "https://github.com/dotnet/roslyn/issues/4892")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BooleanPreselection3() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Module Program Class F End Class Class T End Class Sub Main(args As String()) $$ End Sub End Module]]></Document>) state.SendTypeChars("f") Await state.AssertSelectedCompletionItem("F") state.SendBackspace() state.SendTypeChars("t") Await state.AssertSelectedCompletionItem("T") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TargetTypePreselection1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System.Threading Module Program Sub Cancel(x As Integer, cancellationToken As CancellationToken) Cancel(x + 1, $$) End Sub End Module]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem("cancellationToken").ConfigureAwait(True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TargetTypePreselection2() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Module Program Sub Main(args As String()) Dim aaz As Integer args = $$ End Sub End Module]]></Document>) state.SendTypeChars("a") Await state.AssertSelectedCompletionItem("args").ConfigureAwait(True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TargetTypePreselection3() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class D End Class Class Program Sub Main(string() args) Dim cw = 7 Dim cx as D = new D() Dim cx2 as D = $$ End Sub End Class ]]></Document>) state.SendTypeChars("c") Await state.AssertSelectedCompletionItem("cx", isHardSelected:=True).ConfigureAwait(True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TargetTypePreselectionLocalsOverType() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class A End Class Class Program Sub Main(string() args) Dim cx = new A() Dim cx2 as A = $$ End Sub End Class ]]></Document>) state.SendTypeChars("c") Await state.AssertSelectedCompletionItem("cx", isHardSelected:=True).ConfigureAwait(True) End Using End Function <WpfFact(Skip:="https://github.com/dotnet/roslyn/issues/6942"), Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TargetTypePreselectionConvertibility1() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Mustinherit Class C End Class Class D inherits C End Class Class Program Sub Main(string() args) Dim cx = new D() Dim cx2 as C = $$ End Sub End Class ]]></Document>) state.SendTypeChars("c") Await state.AssertSelectedCompletionItem("cx", isHardSelected:=True).ConfigureAwait(True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TargetTypePreselectionParamsArray() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class Program Sub Main(string() args) Dim azc as integer M2(a$$ End Sub Sub M2(params int() yx) End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem("azc", isHardSelected:=True).ConfigureAwait(True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TargetTypePreselectionSetterValue() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class Program Private Async As Integer Public Property NewProperty() As Integer Get Return Async End Get Set(ByVal value As Integer) Async = $$ End Set End Property End Class]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem("value", isHardSelected:=False, isSoftSelected:=True).ConfigureAwait(True) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> <WorkItem(12530, "https://github.com/dotnet/roslyn/issues/12530")> Public Async Function TestAnonymousTypeDescription() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System.Linq Public Class Class1 Sub Method() Dim x = {New With {.x = 1}}.ToArr$$ End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem(description:= $"<{ VBFeaturesResources.Extension }> Function IEnumerable(Of 'a).ToArray() As 'a() { FeaturesResources.Anonymous_Types_colon } 'a { FeaturesResources.is_ } New With {{ .x As Integer }}") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> <WorkItem(12530, "https://github.com/dotnet/roslyn/issues/12530")> Public Async Function TestAnonymousTypeDescription2() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Imports System.Linq Public Class Class1 Sub Method() Dim x = {New With { Key .x = 1}}.ToArr$$ End Sub End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertSelectedCompletionItem(description:= $"<{ VBFeaturesResources.Extension }> Function IEnumerable(Of 'a).ToArray() As 'a() { FeaturesResources.Anonymous_Types_colon } 'a { FeaturesResources.is_ } New With {{ Key .x As Integer }}") End Using End Function <WorkItem(11812, "https://github.com/dotnet/roslyn/issues/11812")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestObjectCreationQualifiedName() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class A Sub Test() Dim b As B.C(Of Integer) = New$$ End Sub End Class Namespace B Class C(Of T) End Class End Namespace]]></Document>) state.SendTypeChars(" ") Await state.AssertCompletionSession() state.SendTypeChars("(") state.AssertMatchesTextStartingAtLine(3, "Dim b As B.C(Of Integer) = New B.C(Of Integer)(") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestNonTrailingNamedArgumentInVB15_3() As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" LanguageVersion="15.3" CommonReferences="true" AssemblyName="VBProj"> <Document FilePath="C.vb"> Class C Sub M() Dim better As Integer = 2 M(a:=1, $$) End Sub Sub M(a As Integer, bar As Integer, c As Integer) End Sub End Class </Document> </Project> </Workspace>) state.SendTypeChars("b") Await state.AssertSelectedCompletionItem(displayText:="bar", displayTextSuffix:=":=", isHardSelected:=True) state.SendTypeChars("e") Await state.AssertNoCompletionSession() End Using End Function <WpfFact> Public Async Function TestNonTrailingNamedArgumentInVB15_5() As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" LanguageVersion="15.5" CommonReferences="true" AssemblyName="VBProj"> <Document FilePath="C.vb"> Class C Sub M() Dim better As Integer = 2 M(a:=1, $$) End Sub Sub M(a As Integer, bar As Integer, c As Integer) End Sub End Class </Document> </Project> </Workspace>) state.SendTypeChars("bar") Await state.AssertSelectedCompletionItem(displayText:="bar", displayTextSuffix:=":=", isHardSelected:=True) state.SendBackspace() state.SendBackspace() state.SendTypeChars("et") Await state.AssertSelectedCompletionItem(displayText:="better", isHardSelected:=True) state.SendTypeChars(", ") Assert.Contains("M(a:=1, better,", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSymbolInTupleLiteral() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t = ($$) End Sub End Class }]]></Document>) state.SendTypeChars("Go") Await state.AssertSelectedCompletionItem(displayText:="Goo", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("(Go:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSymbolInTupleLiteralAfterComma() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t = (1, $$) End Sub End Class ]]></Document>) state.SendTypeChars("Go") Await state.AssertSelectedCompletionItem(displayText:="Goo", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("(1, Go:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSnippetInTupleLiteral() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t = ($$) End Sub End Class }]]></Document>, extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider), GetType(StubVsEditorAdaptersFactoryService)}.ToList()) Dim workspace = state.Workspace workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options _ .WithChangedOption(CompletionOptions.SnippetsBehavior, LanguageNames.VisualBasic, SnippetsRule.AlwaysInclude))) state.SendTypeChars("Shortcu") Await state.AssertSelectedCompletionItem(displayText:="Shortcut", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("(Shortcu:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSnippetInTupleLiteralAfterComma() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t = (1, $$) End Sub End Class }]]></Document>, extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider), GetType(StubVsEditorAdaptersFactoryService)}.ToList()) Dim workspace = state.Workspace workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options _ .WithChangedOption(CompletionOptions.SnippetsBehavior, LanguageNames.VisualBasic, SnippetsRule.AlwaysInclude))) state.SendTypeChars("Shortcu") Await state.AssertSelectedCompletionItem(displayText:="Shortcut", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("(1, Shortcu:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSnippetsNotExclusiveWhenAlwaysShowing() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim x as Integer = 3 Dim t = $$ End Sub End Class }]]></Document>, extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider), GetType(StubVsEditorAdaptersFactoryService)}.ToList()) Dim workspace = state.Workspace workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options _ .WithChangedOption(CompletionOptions.SnippetsBehavior, LanguageNames.VisualBasic, SnippetsRule.AlwaysInclude))) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll("x", "Shortcut") End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestBuiltInTypesKeywordInTupleLiteral() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t = ($$) End Sub End Class }]]></Document>) state.SendTypeChars("Intege") Await state.AssertSelectedCompletionItem(displayText:="Integer", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("(Intege:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestBuiltInTypesKeywordInTupleLiteralAfterComma() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t = (1, $$) End Sub End Class }]]></Document>) state.SendTypeChars("Intege") Await state.AssertSelectedCompletionItem(displayText:="Integer", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("(1, Intege:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestFunctionKeywordInTupleLiteral() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t = ($$) End Sub End Class }]]></Document>) state.SendTypeChars("Functio") Await state.AssertSelectedCompletionItem(displayText:="Function", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("(Functio:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestFunctionKeywordInTupleLiteralAfterComma() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t = (1, $$) End Sub End Class }]]></Document>) state.SendTypeChars("Functio") Await state.AssertSelectedCompletionItem(displayText:="Function", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("(1, Functio:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSymbolInTupleType() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo() Dim t As ($$) End Sub End Class ]]></Document>) state.SendTypeChars("Integ") Await state.AssertSelectedCompletionItem(displayText:="Integer", isHardSelected:=True) state.SendTypeChars(",") Assert.Contains("(Integer,", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestInvocationExpression() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo(Alice As Integer) Goo($$) End Sub End Class ]]></Document>) state.SendTypeChars("Alic") Await state.AssertSelectedCompletionItem(displayText:="Alice", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("Goo(Alice:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestInvocationExpressionAfterComma() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Public Sub Goo(Alice As Integer, Bob As Integer) Goo(1, $$) End Sub End Class ]]></Document>) state.SendTypeChars("B") Await state.AssertSelectedCompletionItem(displayText:="Bob", isHardSelected:=True) state.SendTypeChars(":") Assert.Contains("Goo(1, Bob:", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WorkItem(13161, "https://github.com/dotnet/roslyn/issues/13161")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub CommitGenericDoesNotInsertEllipsis() Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Interface Goo(Of T) End Interface Class Bar Implements $$ End Class]]></Document>) Dim unicodeEllipsis = ChrW(&H2026).ToString() state.SendTypeChars("Goo") state.SendTab() Assert.Equal("Implements Goo(Of", state.GetLineTextFromCaretPosition().Trim()) Assert.DoesNotContain(unicodeEllipsis, state.GetLineTextFromCaretPosition()) End Using End Sub <WorkItem(13161, "https://github.com/dotnet/roslyn/issues/13161")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub CommitGenericDoesNotInsertEllipsisCommitOnParen() Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Interface Goo(Of T) End Interface Class Bar Implements $$ End Class]]></Document>) Dim unicodeEllipsis = ChrW(&H2026).ToString() state.SendTypeChars("Goo(") Assert.Equal("Implements Goo(", state.GetLineTextFromCaretPosition().Trim()) Assert.DoesNotContain(unicodeEllipsis, state.GetLineTextFromCaretPosition()) End Using End Sub <WorkItem(13161, "https://github.com/dotnet/roslyn/issues/13161")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Sub CommitGenericItemDoesNotInsertEllipsisCommitOnTab() Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Interface Goo(Of T) End Interface Class Bar Dim x as $$ End Class]]></Document>) Dim unicodeEllipsis = ChrW(&H2026).ToString() state.SendTypeChars("Goo") state.SendTab() Assert.Equal("Dim x as Goo(Of", state.GetLineTextFromCaretPosition().Trim()) Assert.DoesNotContain(unicodeEllipsis, state.GetLineTextFromCaretPosition()) End Using End Sub <WorkItem(15011, "https://github.com/dotnet/roslyn/issues/15011")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function SymbolAndObjectPreselectionUnification() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Module Module1 Sub Main() Dim x As ProcessStartInfo = New $$ End Sub End Module ]]></Document>) state.SendInvokeCompletionList() Await state.AssertCompletionSession() Dim psi = state.GetCompletionItems().Where(Function(i) i.DisplayText.Contains("ProcessStartInfo")).ToArray() Assert.Equal(1, psi.Length) End Using End Function <WorkItem(394863, "https://devdiv.visualstudio.com/DevDiv/_workitems?_a=edit&id=394863&triage=true")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function ImplementsClause() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Partial Class TestClass Implements IComparable(Of TestClass) Public Function CompareTo(other As TestClass) As Integer Implements I$$ End Function End Class ]]></Document>) state.SendInvokeCompletionList() Await state.AssertCompletionSession() state.SendTab() Assert.Contains("IComparable(Of TestClass)", state.GetLineTextFromCaretPosition()) End Using End Function <WorkItem(18785, "https://github.com/dotnet/roslyn/issues/18785")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BackspaceSoftSelectionIfNotPrefixMatch() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Sub Do() Dim x = new System.Collections.Generic.List(Of String)() x.$$Add("stuff") End Sub End Class ]]></Document>) state.SendBackspace() Await state.AssertSelectedCompletionItem("x", isSoftSelected:=True) state.SendTypeChars(".") Assert.Contains("x.Add", state.GetLineTextFromCaretPosition()) End Using End Function <WorkItem(28767, "https://github.com/dotnet/roslyn/issues/28767")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionDoesNotRemoveBracketsOnEnum() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class C Sub S [$$] End Sub End Class </Document>) Await state.AssertNoCompletionSession() state.SendTypeChars("Enu") Await state.AssertSelectedCompletionItem(displayText:="Enum", isHardSelected:=True) state.SendTab() Assert.Contains("[Enum]", state.GetDocumentText(), StringComparison.Ordinal) End Using End Function <WorkItem(30097, "https://github.com/dotnet/roslyn/issues/30097")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMRUKeepsTwoRecentlyUsedItems() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Class C Public Sub Ma(m As Double) End Sub Public Sub Test() $$ End Sub End Class </Document>) state.SendTypeChars("M(M(M(M(") Await state.AssertCompletionSession() Assert.Equal(" Ma(m:=(Ma(m:=(", state.GetLineTextFromCaretPosition()) End Using End Function <WorkItem(36546, "https://github.com/dotnet/roslyn/issues/36546")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestDoNotDismissIfEmptyOnBackspaceIfStartedWithBackspace() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Class C Public Sub M() Console.W$$ End Sub End Class </Document>) state.SendBackspace() Await state.AssertCompletionItemsContainAll("WriteLine") End Using End Function <WorkItem(36546, "https://github.com/dotnet/roslyn/issues/36546")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestDoNotDismissIfEmptyOnMultipleBackspaceIfStartedInvoke() As Task Using state = TestStateFactory.CreateVisualBasicTestState( <Document> Imports System Class C Public Sub M() Console.Wr$$ End Sub End Class </Document>) state.SendInvokeCompletionList() Await state.AssertCompletionSession() state.SendBackspace() state.SendBackspace() Await state.AssertCompletionSession() End Using End Function <WorkItem(588, "https://github.com/dotnet/roslyn/issues/588")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround1() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Sub goo(x As Integer) String.$$ ]]></Document>) state.SendTypeChars("is") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("IsInterned") End Using End Using End Function <WorkItem(588, "https://github.com/dotnet/roslyn/issues/588")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround2() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class C Sub goo(x As Integer) String.$$]]></Document>) state.SendTypeChars("ı") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem() End Using End Using End Function <WorkItem(29938, "https://github.com/dotnet/roslyn/issues/29938")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround3() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class TARIFE End Class Class C Sub goo(x As Integer) Dim t As $$ ]]></Document>) state.SendTypeChars("tarif") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("TARIFE") End Using End Using End Function <WorkItem(29938, "https://github.com/dotnet/roslyn/issues/29938")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround4() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class IFADE End Class Class ifTest End Class Class C Sub goo(x As Integer) Dim ifade As IFADE $$]]></Document>) state.SendTypeChars("if") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("If") End Using End Using End Function <WorkItem(29938, "https://github.com/dotnet/roslyn/issues/29938")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround5() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class İFADE End Class Class ifTest End Class Class C Sub goo(x As Integer) Dim ifade As İFADE $$ ]]></Document>) state.SendTypeChars("if") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("If") End Using End Using End Function <WorkItem(29938, "https://github.com/dotnet/roslyn/issues/29938")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround6() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class TARİFE End Class Class C Sub goo(x As Integer) Dim obj As $$ ]]></Document>) state.SendTypeChars("tarif") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("TARİFE") End Using End Using End Function <WorkItem(29938, "https://github.com/dotnet/roslyn/issues/29938")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround7() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class İFADE End Class Class ifTest End Class Class C Sub goo(x As Integer) Dim obj As $$ ]]></Document>) state.SendTypeChars("ifad") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("İFADE") End Using End Using End Function <WorkItem(29938, "https://github.com/dotnet/roslyn/issues/29938")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround8() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class IFADE End Class Class ifTest End Class Class C Sub goo(x As Integer) Dim obj As $$ ]]></Document>) state.SendTypeChars("ifad") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("IFADE") End Using End Using End Function <WorkItem(29938, "https://github.com/dotnet/roslyn/issues/29938")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround9() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class IFADE End Class Class ifTest End Class Class C Sub goo(x As Integer) Dim ifade_ As İFADE $$]]></Document>) state.SendTypeChars("IF") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("If") End Using End Using End Function <WorkItem(29938, "https://github.com/dotnet/roslyn/issues/29938")> <WpfFact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestMatchWithTurkishIWorkaround10() As Task Using New CultureContext(New Globalization.CultureInfo("tr-TR", useUserOverride:=False)) Using state = TestStateFactory.CreateVisualBasicTestState( <Document><![CDATA[ Class İFADE End Class Class ifTest End Class Class C Sub goo(x As Integer) Dim ifade As İFADE $$ ]]></Document>) state.SendTypeChars("IF") Await state.WaitForAsynchronousOperationsAsync() Await state.AssertSelectedCompletionItem("If") End Using End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorIf(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#if Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorElseIf(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if false #elseif $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#elseif Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionNotInPreprocessorElse(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if false #elseif false #else $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertNoCompletionSession() End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorParenthesized(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if ($$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#if (Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorNot(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if not $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#if not Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorAnd(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if true and $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#if true and Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorAndAlso(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if true andalso $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#if true andalso Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorOr(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if true or $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#if true or Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorOrElse(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,Baz=3"> <Document> #if true orelse $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#if true orelse Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <WpfTheory, CombinatorialData> <Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function CompletionInPreprocessorCasingDifference(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateTestStateFromWorkspace( <Workspace> <Project Language="Visual Basic" CommonReferences="true" PreprocessorSymbols="Goo=1,Bar=2,BAR=2,Baz=3"> <Document> #if $$ </Document> </Project> </Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists) state.SendInvokeCompletionList() Await state.AssertCompletionItemsContainAll({"Goo", "Bar", "Baz", "True", "False"}) state.SendTypeChars("Go") state.SendTab() Await state.AssertNoCompletionSession() Assert.Contains("#if Goo", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal) End Using End Function <ExportLanguageService(GetType(ISnippetInfoService), LanguageNames.VisualBasic, ServiceLayer.Test), [Shared], PartNotDiscoverable> Friend Class MockSnippetInfoService Implements ISnippetInfoService <ImportingConstructor> <Obsolete(MefConstruction.ImportingConstructorMessage, True)> Public Sub New() End Sub Public Function GetSnippetsAsync_NonBlocking() As IEnumerable(Of SnippetInfo) Implements ISnippetInfoService.GetSnippetsIfAvailable Return SpecializedCollections.SingletonEnumerable(New SnippetInfo("Shortcut", "Title", "Description", "Path")) End Function Public Function ShouldFormatSnippet(snippetInfo As SnippetInfo) As Boolean Implements ISnippetInfoService.ShouldFormatSnippet Return False End Function Public Function SnippetShortcutExists_NonBlocking(shortcut As String) As Boolean Implements ISnippetInfoService.SnippetShortcutExists_NonBlocking Return shortcut = "Shortcut" End Function End Class End Class End Namespace
ErikSchierboom/roslyn
src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests.vb
Visual Basic
apache-2.0
141,466
[ 30522, 1005, 7000, 2000, 1996, 1012, 5658, 3192, 2104, 2028, 2030, 2062, 10540, 1012, 1005, 1996, 1012, 5658, 3192, 15943, 2023, 5371, 2000, 2017, 2104, 1996, 10210, 6105, 1012, 1005, 2156, 1996, 6105, 5371, 1999, 1996, 2622, 7117, 2005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package spgui.widgets.services import java.util.UUID import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.html_<^._ import spgui.communication._ import sp.domain._ import sp.domain.Logic._ import sp.service.{APIServiceHandler => api} object ServiceListWidget { case class State(services: List[APISP.StatusResponse]) private class Backend($: BackendScope[Unit, State]) { val wsObs = BackendCommunication.getWebSocketStatusObserver(connected => { if (connected) sendToHandler(api.GetServices) }, api.topicResponse) def handelMess(mess: SPMessage): Unit = { for { h <- mess.getHeaderAs[SPHeader] b <- mess.getBodyAs[api.Response] } yield { val res = b match { case api.Services(xs) => $.setState(State(xs)) case api.ServiceAdded(s) => $.modState(state => State(s :: state.services)) case api.ServiceRemoved(s) => $.modState(state => State(state.services.filter(x => x.instanceID != s.instanceID))) } res.runNow() } } val answerHandler = BackendCommunication.getMessageObserver(handelMess, api.topicResponse) def render(s: State) = { <.div( renderServices(s), <.div("todo: Add search and sorting. Add possibility to send messaged based on api") ) } def renderServices(s: State) = { <.table( ^.className := "table table-striped", <.caption("Services"), <.thead( <.th("service"), <.th("name"), <.th("id"), <.th("tags"), <.th("version") ), <.tbody( s.services.map(s=> { <.tr( <.td(s.service), <.td(s.instanceName), <.td(s.instanceID.toString), <.td(s.tags.toString), <.td(s.version) ) }).toTagMod ) ) } def onUnmount() = { answerHandler.kill() wsObs.kill() Callback.empty } def onMount() = { sendToHandler(api.GetServices) } def sendToHandler(mess: api.Request): Callback = { val h = SPHeader(from = "ServiceListWidget", to = api.service, reply = SPValue("ServiceListWidget")) val json = SPMessage.make[SPHeader, api.Request](h, api.GetServices) BackendCommunication.publish(json, api.topicRequest) Callback.empty } } private val component = ScalaComponent.builder[Unit]("AbilityHandlerWidget") .initialState(State(services = List())) .renderBackend[Backend] .componentDidMount(_.backend.onMount()) .componentWillUnmount(_.backend.onUnmount()) .build def apply() = spgui.SPWidget(spwb => component()) }
kristoferB/SP
spgui/src/main/scala/spgui/widgets/services/ServiceListWidget.scala
Scala
mit
2,721
[ 30522, 7427, 11867, 25698, 1012, 15536, 28682, 1012, 2578, 12324, 9262, 1012, 21183, 4014, 1012, 1057, 21272, 12324, 14855, 26952, 14511, 2100, 1012, 26743, 22578, 1012, 10509, 1012, 1035, 12324, 14855, 26952, 14511, 2100, 1012, 26743, 22578, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// -*- mode: C++ -*- // // Copyright (c) 2007, 2008, 2009, 2010, 2011 The University of Utah // All rights reserved. // // This file is part of `csmith', a random generator of C programs. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. #include <assert.h> #include <iostream> #include "CVQualifiers.h" #include "Type.h" #include "Effect.h" #include "CGContext.h" #include "CGOptions.h" #include "random.h" #include "Error.h" #include "Probabilities.h" #include "DepthSpec.h" #include "Enumerator.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CVQualifiers::CVQualifiers(void) : wildcard(false), accept_stricter(false) { // nothing else to do } CVQualifiers::CVQualifiers(bool wild, bool accept_stricter) : wildcard(wild), accept_stricter(accept_stricter) { // nothing else to do } CVQualifiers::CVQualifiers(const vector<bool>& isConsts, const vector<bool>& isVolatiles) : wildcard(false), accept_stricter(false), is_consts(isConsts), is_volatiles(isVolatiles) { // nothing else to do } CVQualifiers::CVQualifiers(const CVQualifiers &qfer) : wildcard(qfer.wildcard), accept_stricter(qfer.accept_stricter), is_consts(qfer.get_consts()), is_volatiles(qfer.get_volatiles()) { // nothing else to do } CVQualifiers::~CVQualifiers() { } CVQualifiers & CVQualifiers::operator=(const CVQualifiers &qfer) { if (this == &qfer) { return *this; } wildcard = qfer.wildcard; accept_stricter = qfer.accept_stricter; is_consts = qfer.get_consts(); is_volatiles = qfer.get_volatiles(); return *this; } // -------------------------------------------------------------- /* return true if this variable is more const-volatile qualified than v * some examples are: * const is more qualified than none * volatile is more qualified than none * const volatile is more qualified than const * const is NOT more qualified than volatile * ... * notice "const int**" is not convertable from "int**" * as explained in * http://www.embedded.com/columns/programmingpointers/180205632?_requestid=488055 **************************************************************/ bool CVQualifiers::stricter_than(const CVQualifiers& qfer) const { size_t i; assert(is_consts.size() == is_volatiles.size()); const vector<bool>& v_consts = qfer.get_consts(); const vector<bool>& v_volatiles = qfer.get_volatiles(); if (is_consts.size() != v_consts.size() || is_volatiles.size() != v_volatiles.size()) { return false; } size_t depth = is_consts.size(); // check "const" qualifier first for (i=0; i<depth; i++) { // for special rule: "const int**" is not convertable from "int**" // actually for a level that is followed by two "*"s, we have to match // "const" qualifier if (depth - i > 2 && is_consts[i] != v_consts[i]) { return false; } if (v_consts[i] && !is_consts[i]) { return false; } } // check "volatile" qualifier second // special rule: the volatile property on storage (1st in vector) must match // can be relaxed??? if (depth > 1 && is_volatiles[0] != v_volatiles[0]) { return false; } for (i=0; i<depth; i++) { // similiar to const: "volatile int**" is not convertable from "int**" // actually for a level that is followed by two "*"s, we have to match if (depth - i > 2 && is_volatiles[i] != v_volatiles[i]) { return false; } if (v_volatiles[i] && !is_volatiles[i]) { return false; } } return true; } bool CVQualifiers::match(const CVQualifiers& qfer) const { if (wildcard) { return true; } if (CGOptions::match_exact_qualifiers()) { return is_consts == qfer.get_consts() && is_volatiles == qfer.get_volatiles(); } // return true if both variables are non-pointer (has only one level qualifier) if (is_consts.size() == qfer.get_consts().size() && is_consts.size()==1) { assert(is_consts.size() == is_volatiles.size()); return true; } return (!accept_stricter && stricter_than(qfer)) || (accept_stricter && qfer.stricter_than(*this)); } bool CVQualifiers::match_indirect(const CVQualifiers& qfer) const { if (wildcard) { return true; } if (is_consts.size() == qfer.get_consts().size()) { return match(qfer); } int deref = qfer.get_consts().size() - is_consts.size(); if (deref < -1) { return false; } return match(qfer.indirect_qualifiers(deref)); } /* * make sure no volatile-pointers if volatile-pointers is false */ void CVQualifiers::make_scalar_volatiles(std::vector<bool> &volatiles) { if (!CGOptions::volatile_pointers()) { for (size_t i=1; i<volatiles.size(); i++) volatiles[i] = false; } } /* * make sure no const-pointers if const_pointers is false */ void CVQualifiers::make_scalar_consts(std::vector<bool> &consts) { if (!CGOptions::const_pointers()) { for (size_t i=1; i<consts.size(); i++) consts[i] = false; } } /* * generate a random CV qualifier vector that is looser or stricter than this one */ CVQualifiers CVQualifiers::random_qualifiers(bool no_volatile, Effect::Access access, const CGContext &cg_context) const { std::vector<bool> volatiles; std::vector<bool> consts; if (wildcard) { return CVQualifiers(true, accept_stricter); } // use non-volatile for all levels if requested if (no_volatile) { for (size_t i=0; i<is_volatiles.size(); i++) { volatiles.push_back(false); } } else { volatiles = !accept_stricter ? random_looser_volatiles() : random_stricter_volatiles(); ERROR_GUARD(CVQualifiers(consts, volatiles)); if (!cg_context.get_effect_context().is_side_effect_free()) { volatiles[volatiles.size() - 1] = false; } } ERROR_GUARD(CVQualifiers(consts, volatiles)); make_scalar_volatiles(volatiles); consts = !accept_stricter ? random_looser_consts() : random_stricter_consts(); make_scalar_consts(consts); ERROR_GUARD(CVQualifiers(consts, volatiles)); if (access == Effect::WRITE) { consts[consts.size() - 1] = false; } return CVQualifiers(consts, volatiles); } /* * generate a random CV qualifier vector that is looser than this one */ CVQualifiers CVQualifiers::random_loose_qualifiers(bool no_volatile, Effect::Access access, const CGContext &cg_context) const { std::vector<bool> volatiles; std::vector<bool> consts; if (wildcard) { return CVQualifiers(true, accept_stricter); } // use non-volatile for all levels if requested if (no_volatile) { for (size_t i=0; i<is_volatiles.size(); i++) { volatiles.push_back(false); } } else { volatiles = random_looser_volatiles(); ERROR_GUARD(CVQualifiers(consts, volatiles)); if (!cg_context.get_effect_context().is_side_effect_free()) { volatiles[volatiles.size() - 1] = false; } } ERROR_GUARD(CVQualifiers(consts, volatiles)); make_scalar_volatiles(volatiles); consts = random_looser_consts(); make_scalar_consts(consts); ERROR_GUARD(CVQualifiers(consts, volatiles)); if (access == Effect::WRITE) { consts[consts.size() - 1] = false; } return CVQualifiers(consts, volatiles); } CVQualifiers CVQualifiers::random_qualifiers(const Type* t, Effect::Access access, const CGContext &cg_context, bool no_volatile) { return random_qualifiers(t, access, cg_context, no_volatile, RegularConstProb, RegularVolatileProb); } CVQualifiers CVQualifiers::random_qualifiers(const Type* t, Effect::Access access, const CGContext &cg_context, bool no_volatile, unsigned int const_prob, unsigned int volatile_prob) { CVQualifiers ret_qfer; if (t==0) { return ret_qfer; } bool isVolatile = false; bool isConst = false; std::vector<bool> is_consts, is_volatiles; const Effect &effect_context = cg_context.get_effect_context(); // set random volatile/const properties for each level of indirection for pointers const Type* tmp = t->ptr_type; while (tmp) { DEPTH_GUARD_BY_DEPTH_RETURN(2, ret_qfer); isVolatile = rnd_flipcoin(volatile_prob); ERROR_GUARD(ret_qfer); isConst = rnd_flipcoin(const_prob); ERROR_GUARD(ret_qfer); if (isVolatile && isConst && !CGOptions::allow_const_volatile()) { isConst = false; } is_consts.push_back(isConst); is_volatiles.push_back(isVolatile); tmp = tmp->ptr_type; } // set random volatile/const properties for variable itself bool volatile_ok = effect_context.is_side_effect_free(); bool const_ok = (access != Effect::WRITE); isVolatile = false; isConst = false; if (volatile_ok && const_ok) { DEPTH_GUARD_BY_DEPTH_RETURN(2, ret_qfer); isVolatile = rnd_flipcoin(volatile_prob); ERROR_GUARD(ret_qfer); isConst = rnd_flipcoin(const_prob); ERROR_GUARD(ret_qfer); } else if (volatile_ok) { DEPTH_GUARD_BY_DEPTH_RETURN(1, ret_qfer); isVolatile = rnd_flipcoin(volatile_prob); ERROR_GUARD(ret_qfer); } else if (const_ok) { DEPTH_GUARD_BY_DEPTH_RETURN(1, ret_qfer); isConst = rnd_flipcoin(const_prob); ERROR_GUARD(ret_qfer); } if (isVolatile && isConst && !CGOptions::allow_const_volatile()) { isConst = false; } is_consts.push_back(isConst); is_volatiles.push_back(isVolatile); // use non-volatile for all levels if requested if (no_volatile) { for (size_t i=0; i<is_volatiles.size(); i++) { is_volatiles[i] = false; } } make_scalar_volatiles(is_volatiles); make_scalar_consts(is_consts); return CVQualifiers(is_consts, is_volatiles); } /* * make a random qualifier for type t, assuming non context, * and no volatile allowed */ CVQualifiers CVQualifiers::random_qualifiers(const Type* t) { return random_qualifiers(t, Effect::READ, CGContext::get_empty_context(), true); } /* * be careful to use it because it will generate volatile without knowing the context. * Only used to generate qulifiers for struct/unions */ CVQualifiers CVQualifiers::random_qualifiers(const Type* t, unsigned int const_prob, unsigned int volatile_prob) { return random_qualifiers(t, Effect::READ, CGContext::get_empty_context(), false, const_prob, volatile_prob); } vector<bool> CVQualifiers::random_stricter_consts(void) const { vector<bool> consts; size_t i; size_t depth = is_consts.size(); if (CGOptions::match_exact_qualifiers()) return is_consts; for (i=0; i<depth; i++) { // special case // const int** is not stricter than int** // int * const ** is not stricter than int*** // and so on... if (is_consts[i] || (depth - i > 2)) { consts.push_back(is_consts[i]); } else if (is_volatiles[i] && !CGOptions::allow_const_volatile()) { consts.push_back(false); } else { DEPTH_GUARD_BY_DEPTH_RETURN(1, consts); bool index = rnd_flipcoin(StricterConstProb); ERROR_GUARD(consts); consts.push_back(index); } } return consts; } vector<bool> CVQualifiers::random_stricter_volatiles(void) const { vector<bool> volatiles; size_t i; size_t depth = is_volatiles.size(); if (CGOptions::match_exact_qualifiers()) return is_volatiles; for (i=0; i<depth; i++) { // first one (storage must match, any level followed by at least two more // indirections must match if (is_volatiles[i] || (i==0 && depth>1) || (depth - i > 2)) { volatiles.push_back(is_volatiles[i]); } else if (is_consts[i] && !CGOptions::allow_const_volatile()) { volatiles.push_back(false); } else { DEPTH_GUARD_BY_DEPTH_RETURN(1, volatiles); bool index = rnd_flipcoin(RegularVolatileProb); ERROR_GUARD(volatiles); volatiles.push_back(index); } } make_scalar_volatiles(volatiles); return volatiles; } vector<bool> CVQualifiers::random_looser_consts(void) const { vector<bool> consts; size_t i; size_t depth = is_consts.size(); if (CGOptions::match_exact_qualifiers()) return is_consts; for (i=0; i<depth; i++) { // special case if (!is_consts[i] || (depth - i > 2)) { consts.push_back(is_consts[i]); } else { DEPTH_GUARD_BY_DEPTH_RETURN(1, consts); bool index = rnd_flipcoin(LooserConstProb); ERROR_GUARD(consts); consts.push_back(index); } } return consts; } vector<bool> CVQualifiers::random_looser_volatiles(void) const { vector<bool> volatiles; size_t i; size_t depth = is_volatiles.size(); if (CGOptions::match_exact_qualifiers()) return is_volatiles; for (i=0; i<depth; i++) { if (!is_volatiles[i] || (i==0 && depth>1) || (depth - i > 2)) { volatiles.push_back(is_volatiles[i]); } else { DEPTH_GUARD_BY_DEPTH_RETURN(1, volatiles); bool index = rnd_flipcoin(RegularVolatileProb); ERROR_GUARD(volatiles); volatiles.push_back(index); } } make_scalar_volatiles(volatiles); return volatiles; } void CVQualifiers::add_qualifiers(bool is_const, bool is_volatile) { is_consts.push_back(is_const); is_volatiles.push_back(is_volatile); } // actually add qualifiers to pointers CVQualifiers CVQualifiers::random_add_qualifiers(bool no_volatile) const { CVQualifiers qfer = *this; if (CGOptions::match_exact_qualifiers()) { qfer.add_qualifiers(false, false); return qfer; } //bool is_const = rnd_upto(50); if (no_volatile) { DEPTH_GUARD_BY_DEPTH_RETURN(1, qfer); } else { DEPTH_GUARD_BY_DEPTH_RETURN(2, qfer); } bool is_const; if (!CGOptions::const_pointers()) is_const = false; else is_const = rnd_flipcoin(RegularConstProb); ERROR_GUARD(qfer); //bool is_volatile = no_volatile ? false : rnd_upto(RegularVolatileProb); bool is_volatile; if (no_volatile || !CGOptions::volatile_pointers()) is_volatile = false; else is_volatile = rnd_flipcoin(RegularVolatileProb); ERROR_GUARD(qfer); qfer.add_qualifiers(is_const, is_volatile); return qfer; } void CVQualifiers::remove_qualifiers(int len) { int i; for (i=0; i<len; i++) { is_consts.pop_back(); is_volatiles.pop_back(); } } CVQualifiers CVQualifiers::indirect_qualifiers(int level) const { if (level == 0 || wildcard) { return *this; } // taking address else if (level < 0) { assert(level == -1); CVQualifiers qfer = *this; qfer.add_qualifiers(false, false); return qfer; } // dereference else { CVQualifiers qfer = *this; qfer.remove_qualifiers(level); return qfer; } } /* * check if the indirect depth of type matches qualifier size */ bool CVQualifiers::sanity_check(const Type* t) const { assert(t); int level = t->get_indirect_level(); assert(level >= 0); return wildcard || (is_consts.size() == is_volatiles.size() && (static_cast<size_t>(level)+1) == is_consts.size()); } void CVQualifiers::output_qualified_type(const Type* t, std::ostream &out) const { assert(t); assert(sanity_check(t)); size_t i; const Type* base = t->get_base_type(); for (i=0; i<is_consts.size(); i++) { if (i>0) { out << "*"; } if (is_consts[i]) { if (!CGOptions::consts()) assert(0); if (i > 0) out << " "; out << "const "; } if (is_volatiles[i]) { if (!CGOptions::volatiles()) assert(0); if (i > 0) out << " "; out << "volatile "; } if (i==0) { base->Output(out); out << " "; } } } void CVQualifiers::output_qualified_type_with_deputy_annotation(const Type* t, std::ostream &out, const vector<string>& annotations) const { assert(t); assert(sanity_check(t)); assert(is_consts.size() == annotations.size()+1); size_t i; const Type* base = t->get_base_type(); for (i=0; i<is_consts.size(); i++) { if (i>0) { out << "* "; out << annotations[i-1] << " "; } if (is_consts[i]) { if (!CGOptions::consts()) assert(0); out << "const "; } if (is_volatiles[i]) { if (!CGOptions::volatiles()) assert(0); out << "volatile "; } if (i==0) { base->Output(out); out << " "; } } } bool CVQualifiers::is_const_after_deref(int deref_level) const { if (deref_level < 0) { return false; } size_t len = is_consts.size(); assert(len > static_cast<size_t>(deref_level)); return is_consts[len - deref_level - 1]; } bool CVQualifiers::is_volatile_after_deref(int deref_level) const { if (deref_level < 0) { return false; } size_t len = is_volatiles.size(); assert(len > static_cast<size_t>(deref_level)); /* if (len <= static_cast<size_t>(deref_level)) { cout << "len = " << len << ", deref_level = " << deref_level << std::endl; assert(0); } */ return is_volatiles[len - deref_level - 1]; } void CVQualifiers::set_const(bool is_const, int pos) { int len = is_consts.size(); if (len > 0) { is_consts[len - pos - 1] = is_const; } } void CVQualifiers::set_volatile(bool is_volatile, int pos) { int len = is_volatiles.size(); if (len > 0) { is_volatiles[len - pos - 1] = is_volatile; } } void CVQualifiers::restrict(Effect::Access access, const CGContext& cg_context) { if (access == Effect::WRITE) { set_const(false); } if (!cg_context.get_effect_context().is_side_effect_free()) { set_volatile(false); } } /* * For now, only used to generate all qualifiers for struct fields. * Also, since we don't support fields with pointer types, we only * enumerate the first level of qualifiers. */ void CVQualifiers::get_all_qualifiers(vector<CVQualifiers> &quals, unsigned int const_prob, unsigned int volatile_prob) { Enumerator<string> qual_enumerator; qual_enumerator.add_bool_elem("const_prob", const_prob); qual_enumerator.add_bool_elem("volatile_prob", volatile_prob); Enumerator<string> *i; for (i = qual_enumerator.begin(); i != qual_enumerator.end(); i = i->next()) { bool isConst = i->get_elem("const_prob"); bool isVolatile = i->get_elem("volatile_prob"); vector<bool> consts; vector<bool> volatiles; consts.push_back(isConst); volatiles.push_back(isVolatile); CVQualifiers qual(consts, volatiles); quals.push_back(qual); } } void CVQualifiers::OutputFirstQuals(std::ostream &out) const { if (is_consts.size() > 0 && is_consts[0]) { if (!CGOptions::consts()) assert(0); out << "const "; } if (is_volatiles.size() > 0 && is_volatiles[0]) { if (!CGOptions::volatiles()) assert(0); out << "volatile "; } } void CVQualifiers::output() const { size_t i; for (i=0; i<is_consts.size(); i++) { cout << is_consts[i] << " "; } cout << ", "; for (i=0; i<is_volatiles.size(); i++) { cout << is_volatiles[i] << " "; } cout << endl; }
ChrisLidbury/CLSmith
src/CVQualifiers.cpp
C++
bsd-2-clause
19,286
[ 30522, 1013, 1013, 1011, 1008, 1011, 5549, 1024, 1039, 1009, 1009, 1011, 1008, 1011, 1013, 1013, 1013, 1013, 9385, 1006, 1039, 1007, 2289, 1010, 2263, 1010, 2268, 1010, 2230, 1010, 2249, 1996, 2118, 1997, 6646, 1013, 1013, 2035, 2916, 923...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php // $Id$ /*! * Dynamic display block module template: vsdupright60p - pager template * (c) Copyright Phelsa Information Technology, 2011. All rights reserved. * Version 1.2 (09-AUG-2011) * Licenced under GPL license * http://www.gnu.org/licenses/gpl.html */ /** * @file * Dynamic display block module template: vsdupright60p - pager template * - Scrollable pager with images * * Available variables: * - $views_slideshow_ddblock_pager_settings['delta']: Block number of the block. * - $views_slideshow_ddblock_pager_settings['pager']: Type of pager to add * - $views_slideshow_ddblock_pager_settings['pager2']: Add prev/next pager * - $views_slideshow_ddblock_pager_settings['pager_position']: position of the slider (top | bottom) * - $views_slideshow_ddblock_pager_items: array with pager_items * * notes: don't change the ID names, they are used by the jQuery script. */ $settings = $views_slideshow_ddblock_pager_settings; // add tools.scrollable-1.0.5.min.js file drupal_add_js(drupal_get_path('module', 'views_slideshow_ddblock') . '/js/tools.scrollable-1.0.5.min.js'); ?> <?php if ($settings['pager_position'] == 'bottom'): ?> <div class="spacer-horizontal"><b></b></div> <?php endif; ?> <!-- scrollable pager container --> <div id="views-slideshow-ddblock-scrollable-pager-<?php print $settings['delta'] ?>" class="scrollable-pager clear-block border"> <!-- prev/next page on slide --> <?php if ($settings['pager2'] == 1 && $settings['pager2_position']['slide'] === 'slide'): ?> <div class="views-slideshow-ddblock-prev-next-slide"> <div class="prev-container"> <a class="prev" href="#"><?php print $settings['pager2_slide_prev']?></a> </div> <div class="next-container"> <a class="next" href="#"><?php print $settings['pager2_slide_next'] ?></a> </div> </div> <?php endif; ?> <!-- custom "previous" links --> <!--<div class="prevPage"></div>--> <div class="prev"></div> <!-- scrollable part --> <div class="vsd-scrollable-pager clear-block border"> <div class="items <?php print $settings['pager'] ?>-inner clear-block border"> <?php if ($views_slideshow_ddblock_pager_items): ?> <?php $item_counter=1; ?> <?php foreach ($views_slideshow_ddblock_pager_items as $pager_item): ?> <div class="<?php print $settings['pager'] ?>-item <?php print $settings['pager'] ?>-item-<?php print $item_counter ?>"> <a href="#" title="navigate to topic" class="pager-link"><?php print $pager_item['pager_image'];?></a> </div> <!-- /custom-pager-item --> <?php $item_counter++; ?> <?php endforeach; ?> <?php endif; ?> </div> <!-- /pager-inner--> </div> <!-- /vsd-scrollable-pager --> <!-- custom "next" links --> <div class="next"></div> <!--<div class="nextPage"></div>--> <!-- navigator --> <div class="navi"></div> </div> <!-- /scrollable-pager--> <?php if ($settings['pager_position'] == 'top'): ?> <div class="spacer-horizontal"><b></b></div> <?php endif; ?>
54interndrupal/54intern
sites/all/themes/ffintern/custom/modules/views_slideshow_ddblock/views-slideshow-ddblock-pager-content--vsdupright60p.tpl.php
PHP
gpl-2.0
2,988
[ 30522, 1026, 1029, 25718, 1013, 1013, 1002, 8909, 1002, 1013, 1008, 999, 1008, 8790, 4653, 3796, 11336, 23561, 1024, 5443, 8566, 18098, 18743, 16086, 2361, 1011, 3931, 2099, 23561, 1008, 1006, 1039, 1007, 9385, 6887, 9050, 2050, 2592, 2974,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#define _USE_MATH_DEFINES #include <math.h> void rszset(float SR, float cf, float bw, float xinit, float *a) { double exp(),cos(); int i; a[0]=exp(-M_PI*bw/SR); a[1]=1.-a[0]; a[2]=2.*a[0]*cos(2.*M_PI*cf/SR); a[3] = -a[0]*a[0]; if(!xinit) for(i=4; i<9; i++) a[i]=0.; } float resonz(float sig, float *a) { float z; z=a[1]*(sig-a[0]*a[4])+a[2]*a[5]+a[3]*a[6]; a[4]=a[8]; a[8]=sig; a[6]=a[5]; a[5]=z; return(z); } void bresonz(float *sig, float *a, float *out, int count) { float z; int i; for(i=0; i<count; i++) { z=a[1]*(sig[i]-a[0]*a[4])+a[2]*a[5]+a[3]*a[6]; a[4]=a[8]; a[8]=sig[i]; a[6]=a[5]; out[i] = a[5] = z; } }
CLOUDS-Interactive-Documentary/RTCmix
genlib/resonz.c
C
gpl-2.0
717
[ 30522, 1001, 9375, 1035, 2224, 1035, 8785, 1035, 11859, 1001, 2421, 1026, 8785, 1012, 1044, 1028, 11675, 12667, 2480, 13462, 1006, 14257, 5034, 1010, 14257, 12935, 1010, 14257, 1038, 2860, 1010, 14257, 8418, 3490, 2102, 1010, 14257, 1008, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2014-2016 CyberVision, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <string.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include "kaa_status.h" #include "kaa_test.h" #include "kaa_context.h" #include "kaa_status.h" #include "utilities/kaa_mem.h" #include "utilities/kaa_log.h" #include "kaa_context.h" #include "kaa_profile.h" #include "kaa_defaults.h" #include "gen/kaa_profile_gen.h" #include "kaa_platform_utils.h" #include "platform/ext_status.h" #include "platform/ext_sha.h" #include "platform/ext_key_utils.h" #include "platform/sock.h" #include "platform/ext_transport_channel.h" #include "kaa_channel_manager.h" #include "kaa_private.h" static kaa_context_t kaa_context; static kaa_logger_t *logger = NULL; static kaa_status_t *status = NULL; static kaa_channel_manager_t *channel_manager = NULL; static kaa_profile_manager_t *profile_manager = NULL; #define TEST_PUB_KEY_SIZE 20 static const uint8_t test_ep_key[TEST_PUB_KEY_SIZE] = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14}; void kaa_read_status_ext(char **buffer, size_t *buffer_size, bool *needs_deallocation) { (void)buffer; (void)buffer_size; (void)needs_deallocation; } void kaa_store_status_ext(const char *buffer, size_t buffer_size) { (void)buffer; (void)buffer_size; } void kaa_get_endpoint_public_key(char **buffer, size_t *buffer_size, bool *needs_deallocation) { *buffer = (char *) KAA_MALLOC(TEST_PUB_KEY_SIZE * sizeof(char)); if (*buffer) { memcpy(*buffer, test_ep_key, TEST_PUB_KEY_SIZE); *buffer_size = TEST_PUB_KEY_SIZE; *needs_deallocation = true; } else { *buffer_size = 0; *needs_deallocation = false; } } /*----------------------------------------------------------------------------*/ /* Mock transport channel */ /* Flag to check that sync handler is actually called */ static int mock_sync_handler_called; static kaa_error_t init_channel(void *ctx, kaa_transport_context_t *tctx) { (void)ctx; (void)tctx; return KAA_ERR_NONE; } static kaa_error_t set_access_point(void *ctx, kaa_access_point_t *ap) { (void)ctx; (void)ap; return KAA_ERR_NONE; } static kaa_error_t get_protocol_id(void *ctx, kaa_transport_protocol_id_t *id) { (void)ctx; id->id = 0; id->version = 0; return KAA_ERR_NONE; } static kaa_error_t get_services(void *ctx, const kaa_extension_id **supported_list, size_t *count) { (void)ctx; /* Only profile service is "supported" by this mock */ static const kaa_extension_id services[] = { KAA_EXTENSION_PROFILE }; *supported_list = services; *count = 1; return KAA_ERR_NONE; } static kaa_error_t sync_handler(void *ctx, const kaa_extension_id services[], size_t count) { (void)ctx; ASSERT_EQUAL(1, count); ASSERT_EQUAL(KAA_EXTENSION_PROFILE, services[0]); mock_sync_handler_called = 1; return KAA_ERR_NONE; } static kaa_transport_channel_interface_t channel = { .context = NULL, .destroy = NULL, .sync_handler = sync_handler, .init = init_channel, .set_access_point = set_access_point, .get_protocol_id = get_protocol_id, .get_supported_services = get_services, }; /*----------------------------------------------------------------------------*/ void test_profile_is_set(void **state) { (void)state; #if KAA_PROFILE_SCHEMA_VERSION > 0 ASSERT_FALSE(kaa_profile_manager_is_profile_set(profile_manager)); kaa_profile_t *profile = kaa_profile_basic_endpoint_profile_test_create(); profile->profile_body = kaa_string_copy_create("test"); kaa_error_t error = kaa_profile_manager_update_profile(profile_manager, profile); profile->destroy(profile); ASSERT_EQUAL(error, KAA_ERR_NONE); ASSERT_TRUE(kaa_profile_manager_is_profile_set(profile_manager)); #else ASSERT_TRUE(kaa_profile_manager_is_profile_set(profile_manager)); #endif } void test_profile_update(void **state) { (void)state; kaa_profile_t *profile1 = kaa_profile_basic_endpoint_profile_test_create(); profile1->profile_body = kaa_string_copy_create("dummy"); kaa_error_t error = kaa_profile_manager_update_profile(profile_manager, profile1); ASSERT_EQUAL(error, KAA_ERR_NONE); bool need_resync = false; error = kaa_profile_need_profile_resync(profile_manager, &need_resync); ASSERT_EQUAL(error, KAA_ERR_NONE); ASSERT_TRUE(need_resync); error = kaa_profile_manager_update_profile(profile_manager, profile1); ASSERT_EQUAL(error, KAA_ERR_NONE); error = kaa_profile_need_profile_resync(profile_manager, &need_resync); ASSERT_EQUAL(error, KAA_ERR_NONE); ASSERT_FALSE(need_resync); profile1->destroy(profile1); kaa_profile_t *profile2 = kaa_profile_basic_endpoint_profile_test_create(); profile2->profile_body = kaa_string_copy_create("new_dummy"); error = kaa_profile_manager_update_profile(profile_manager, profile2); ASSERT_EQUAL(error, KAA_ERR_NONE); error = kaa_profile_need_profile_resync(profile_manager, &need_resync); ASSERT_EQUAL(error, KAA_ERR_NONE); ASSERT_TRUE(need_resync); profile2->destroy(profile2); } void test_profile_sync_get_size(void **state) { (void)state; kaa_profile_t *profile = kaa_profile_basic_endpoint_profile_test_create(); profile->profile_body = kaa_string_copy_create("dummy"); size_t serialized_profile_size = profile->get_size(profile); char *serialized_profile = (char *) KAA_MALLOC(serialized_profile_size * sizeof(char)); avro_writer_t writer = avro_writer_memory(serialized_profile, serialized_profile_size); profile->serialize(writer, profile); size_t expected_size = KAA_EXTENSION_HEADER_SIZE + sizeof(uint32_t) // profile size + kaa_aligned_size_get(serialized_profile_size); size_t profile_sync_size = 0; kaa_error_t error_code = kaa_profile_manager_update_profile(profile_manager, profile); ASSERT_EQUAL(error_code, KAA_ERR_NONE); status->is_registered = true; error_code = kaa_profile_request_get_size(profile_manager, &profile_sync_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); ASSERT_EQUAL(expected_size, profile_sync_size); status->is_registered = false; expected_size += sizeof(uint32_t) + TEST_PUB_KEY_SIZE; error_code = kaa_profile_request_get_size(profile_manager, &profile_sync_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); ASSERT_EQUAL(expected_size, profile_sync_size); const char *access_token = "access token"; error_code = kaa_profile_manager_set_endpoint_access_token(profile_manager, access_token); assert_int_equal(KAA_ERR_NONE, error_code); expected_size += sizeof(uint32_t) + strlen(access_token); error_code = kaa_profile_request_get_size(profile_manager, &profile_sync_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); ASSERT_EQUAL(expected_size, profile_sync_size); avro_writer_free(writer); KAA_FREE(serialized_profile); profile->destroy(profile); } void test_profile_sync_serialize(void **state) { (void)state; kaa_error_t error_code; kaa_platform_message_writer_t *manual_writer; kaa_platform_message_writer_t *auto_writer; const char *access_token = "access token"; const size_t access_token_size = strlen(access_token); kaa_profile_t *profile = kaa_profile_basic_endpoint_profile_test_create(); profile->profile_body = kaa_string_copy_create("dummy"); size_t serialized_profile_size = profile->get_size(profile); char *serialized_profile = (char *) KAA_MALLOC(serialized_profile_size * sizeof(char)); avro_writer_t avro_writer = avro_writer_memory(serialized_profile, serialized_profile_size); profile->serialize(avro_writer, profile); error_code = kaa_profile_manager_update_profile(profile_manager, profile); ASSERT_EQUAL(error_code, KAA_ERR_NONE); status->is_registered = false; error_code = kaa_profile_manager_set_endpoint_access_token(profile_manager, access_token); ASSERT_EQUAL(error_code, KAA_ERR_NONE); size_t profile_sync_size; error_code = kaa_profile_request_get_size(profile_manager, &profile_sync_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); uint8_t buffer[profile_sync_size]; error_code = kaa_platform_message_writer_create(&manual_writer, buffer, profile_sync_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); uint32_t network_order_32; error_code = kaa_platform_message_write_extension_header(manual_writer , KAA_EXTENSION_PROFILE , 0 , profile_sync_size - KAA_EXTENSION_HEADER_SIZE); ASSERT_EQUAL(error_code, KAA_ERR_NONE); bool need_resync = true; ASSERT_EQUAL(kaa_profile_need_profile_resync(profile_manager, &need_resync), KAA_ERR_NONE); network_order_32 = KAA_HTONL(0); if (need_resync) network_order_32 = KAA_HTONL(serialized_profile_size); error_code = kaa_platform_message_write(manual_writer, &network_order_32, sizeof(uint32_t)); ASSERT_EQUAL(error_code, KAA_ERR_NONE); if (need_resync) { error_code = kaa_platform_message_write_aligned(manual_writer, serialized_profile, serialized_profile_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); } network_order_32 = KAA_HTONS(TEST_PUB_KEY_SIZE) << 16 | PUB_KEY_VALUE; error_code = kaa_platform_message_write(manual_writer, &network_order_32, sizeof(uint32_t)); ASSERT_EQUAL(error_code, KAA_ERR_NONE); error_code = kaa_platform_message_write_aligned(manual_writer, test_ep_key, TEST_PUB_KEY_SIZE); ASSERT_EQUAL(error_code, KAA_ERR_NONE); network_order_32 = KAA_HTONS(access_token_size) << 16 | ACCESS_TOKEN_VALUE; error_code = kaa_platform_message_write(manual_writer, &network_order_32, sizeof(uint32_t)); ASSERT_EQUAL(error_code, KAA_ERR_NONE); error_code = kaa_platform_message_write_aligned(manual_writer, access_token, access_token_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); uint8_t buffer2[profile_sync_size]; error_code = kaa_platform_message_writer_create(&auto_writer, buffer2, profile_sync_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); error_code = kaa_profile_request_serialize(profile_manager, auto_writer); ASSERT_EQUAL(error_code, KAA_ERR_NONE); error_code = (memcmp(buffer, buffer2, profile_sync_size) == 0 ? KAA_ERR_NONE : KAA_ERR_BADDATA); ASSERT_EQUAL(error_code, KAA_ERR_NONE); KAA_FREE(serialized_profile); avro_writer_free(avro_writer); profile->destroy(profile); kaa_platform_message_writer_destroy(auto_writer); kaa_platform_message_writer_destroy(manual_writer); } void test_profile_handle_sync(void **state) { (void)state; bool need_resync = false; uint16_t extension_options = 0x1; /* Need resync */ const size_t buffer_size = 6; uint8_t buffer[buffer_size]; kaa_platform_message_reader_t *reader; kaa_error_t error_code = kaa_platform_message_reader_create(&reader, buffer, buffer_size); ASSERT_EQUAL(error_code, KAA_ERR_NONE); error_code = kaa_profile_handle_server_sync(profile_manager, reader, extension_options, 0); ASSERT_EQUAL(error_code, KAA_ERR_NONE); error_code = kaa_profile_need_profile_resync(profile_manager, &need_resync); ASSERT_EQUAL(error_code, KAA_ERR_NONE); ASSERT_TRUE(need_resync); extension_options = 0x0; /* Need resync */ error_code = kaa_profile_handle_server_sync(profile_manager, reader, extension_options, 0); ASSERT_EQUAL(error_code, KAA_ERR_NONE); error_code = kaa_profile_need_profile_resync(profile_manager, &need_resync); ASSERT_EQUAL(error_code, KAA_ERR_NONE); ASSERT_FALSE(need_resync); kaa_platform_message_reader_destroy(reader); } static void test_profile_force_sync(void **state) { (void)state; kaa_error_t rc = kaa_profile_force_sync(profile_manager); ASSERT_EQUAL(KAA_ERR_NONE, rc); ASSERT_TRUE(mock_sync_handler_called); } int test_init(void **state) { (void)state; kaa_error_t error = kaa_log_create(&logger, KAA_MAX_LOG_MESSAGE_LENGTH, KAA_MAX_LOG_LEVEL, NULL); if (error || !logger) { return error; } kaa_context.logger = logger; error = kaa_status_create(&status); if (error || !status) { return error; } error = kaa_channel_manager_create(&channel_manager, &kaa_context); if (error || !channel_manager) { return error; } /* Add channel will fail due to absent access point, but it is expected */ kaa_channel_manager_add_transport_channel(channel_manager, &channel, NULL); error = kaa_profile_manager_create(&profile_manager, status, channel_manager, logger); if (error || !profile_manager) { return error; } return 0; } int test_deinit(void **state) { (void)state; kaa_profile_manager_destroy(profile_manager); kaa_channel_manager_destroy(channel_manager); kaa_status_destroy(status); kaa_log_destroy(logger); return 0; } int main(void) { const struct CMUnitTest tests[] = { cmocka_unit_test_setup_teardown(test_profile_is_set, test_init, test_deinit), cmocka_unit_test_setup_teardown(test_profile_update, test_init, test_deinit), cmocka_unit_test_setup_teardown(test_profile_sync_get_size, test_init, test_deinit), cmocka_unit_test_setup_teardown(test_profile_sync_serialize, test_init, test_deinit), cmocka_unit_test_setup_teardown(test_profile_handle_sync, test_init, test_deinit), cmocka_unit_test_setup_teardown(test_profile_force_sync, test_init, test_deinit), }; return cmocka_run_group_tests(tests, NULL, NULL); }
forGGe/kaa
client/client-multi/client-c/test/test_kaa_profile.c
C
apache-2.0
14,769
[ 30522, 1013, 1008, 1008, 9385, 2297, 1011, 2355, 16941, 17084, 1010, 4297, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...