idx
int64
0
34.9k
question
stringlengths
12
26.4k
target
stringlengths
15
2.15k
600
public boolean start ( float startScale , float targetScale , float centerX , float centerY ) { if ( mRunning ) { return false ; } mCenterX = centerX ; mCenterY = centerY ; mTargetScale = targetScale ; mStartTime = System . currentTimeMillis ( ) ; mStartScale = startScale ; mZoomingIn = mTargetScale > mStartScale ; mVelocity = ( mTargetScale - mStartScale ) / ZOOM_ANIMATION_DURATION ; mRunning = true ; mStop = false ; mHeader . post ( this ) ; return true ; }
Decode a previously encoded context Resource.
601
private void dispatchOnThirdPartyRegistrationFailed ( ) { synchronized ( this ) { for ( ThirdPartyRegistrationListener listener : mThirdPartyRegistrationListeners ) { try { listener . onThirdPartyRegistrationFailed ( ) ; } catch ( Exception e ) { Log . e ( LOG_TAG , "onSessionsRegistrationFailed " + e . getLocalizedMessage ( ) ) ; } } mThirdPartyRegistrationListeners . clear ( ) ; } }
Handles the touch event.
602
public void removeCOSTemplates ( ) throws UMSException { ArrayList aList = ( ArrayList ) getCOSTemplates ( ) ; for ( int i = 0 ; i < aList . size ( ) ; i ++ ) { COSTemplate cosTemplate = ( COSTemplate ) aList . get ( i ) ; cosTemplate . remove ( ) ; } }
Send a message to all resources not blacklisted
603
private void writeObject ( java . io . ObjectOutputStream s ) throws java . io . IOException { s . defaultWriteObject ( ) ; for ( Node < K , V > n = findFirst ( ) ; n != null ; n = n . next ) { V v = n . getValidValue ( ) ; if ( v != null ) { s . writeObject ( n . key ) ; s . writeObject ( v ) ; } } s . writeObject ( null ) ; }
Handles edit request handler request.
604
private void collectReferences ( final IOperandTreeNode node , final Set < IAddress > references ) { for ( final IReference reference : node . getReferences ( ) ) { if ( ReferenceType . isCodeReference ( reference . getType ( ) ) ) { references . add ( reference . getTarget ( ) ) ; } } for ( final IOperandTreeNode child : node . getChildren ( ) ) { collectReferences ( child , references ) ; } }
check the email address is valid or not.
605
private ApplyDeletesResult closeSegmentStates ( IndexWriter . ReaderPool pool , SegmentState [ ] segStates , boolean success , long gen ) throws IOException { int numReaders = segStates . length ; Throwable firstExc = null ; List < SegmentCommitInfo > allDeleted = null ; long totDelCount = 0 ; for ( int j = 0 ; j < numReaders ; j ++ ) { SegmentState segState = segStates [ j ] ; if ( success ) { totDelCount += segState . rld . getPendingDeleteCount ( ) - segState . startDelCount ; segState . reader . getSegmentInfo ( ) . setBufferedDeletesGen ( gen ) ; int fullDelCount = segState . rld . info . getDelCount ( ) + segState . rld . getPendingDeleteCount ( ) ; assert fullDelCount <= segState . rld . info . info . maxDoc ( ) ; if ( fullDelCount == segState . rld . info . info . maxDoc ( ) ) { if ( allDeleted == null ) { allDeleted = new ArrayList < > ( ) ; } allDeleted . add ( segState . reader . getSegmentInfo ( ) ) ; } } try { segStates [ j ] . finish ( pool ) ; } catch ( Throwable th ) { if ( firstExc != null ) { firstExc = th ; } } } if ( success ) { IOUtils . reThrow ( firstExc ) ; } if ( infoStream . isEnabled ( "BD" ) ) { infoStream . message ( "BD" , "applyDeletes: " + totDelCount + " new deleted documents" ) ; } return new ApplyDeletesResult ( totDelCount > 0 , gen , allDeleted ) ; }
Add Text Mouse Listener
606
@ Override public double [ ] [ ] rankedAttributes ( ) throws Exception { if ( m_rankedAtts == null || m_rankedSoFar == - 1 ) { throw new Exception ( "Search must be performed before attributes " + "can be ranked." ) ; } m_doRank = true ; search ( m_ASEval , null ) ; double [ ] [ ] final_rank = new double [ m_rankedSoFar ] [ 2 ] ; for ( int i = 0 ; i < m_rankedSoFar ; i ++ ) { final_rank [ i ] [ 0 ] = m_rankedAtts [ i ] [ 0 ] ; final_rank [ i ] [ 1 ] = m_rankedAtts [ i ] [ 1 ] ; } resetOptions ( ) ; m_doneRanking = true ; if ( m_numToSelect > final_rank . length ) { throw new Exception ( "More attributes requested than exist in the data" ) ; } if ( m_numToSelect <= 0 ) { if ( m_threshold == - Double . MAX_VALUE ) { m_calculatedNumToSelect = final_rank . length ; } else { determineNumToSelectFromThreshold ( final_rank ) ; } } return final_rank ; }
Reads everything from the first opening parenthesis until line that ends to a closing parenthesis and returns the contents in one string
607
private void handleYarnContainerChange ( String containerCountAsString ) throws IOException , YarnException { String applicationId = yarnUtil . getRunningAppId ( jobName , jobID ) ; int containerCount = Integer . valueOf ( containerCountAsString ) ; int currentNumTask = getCurrentNumTasks ( ) ; int currentNumContainers = getCurrentNumContainers ( ) ; if ( containerCount == currentNumContainers ) { log . error ( "The new number of containers is equal to the current number of containers, skipping this message" ) ; return ; } if ( containerCount <= 0 ) { log . error ( "The number of containers cannot be zero or less, skipping this message" ) ; return ; } if ( containerCount > currentNumTask ) { log . error ( "The number of containers cannot be more than the number of task, skipping this message" ) ; return ; } log . info ( "Killing the current job" ) ; yarnUtil . killApplication ( applicationId ) ; coordinatorServerURL = null ; try { String state = yarnUtil . getApplicationState ( applicationId ) ; Thread . sleep ( 1000 ) ; int countSleep = 1 ; while ( ! state . equals ( "KILLED" ) ) { state = yarnUtil . getApplicationState ( applicationId ) ; log . info ( "Job kill signal sent, but job not killed yet for " + applicationId + ". Sleeping for another 1000ms" ) ; Thread . sleep ( 1000 ) ; countSleep ++ ; if ( countSleep > 10 ) { throw new IllegalStateException ( "Job has not been killed after 10 attempts." ) ; } } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } log . info ( "Killed the current job successfully" ) ; log . info ( "Staring the job again" ) ; skipUnreadMessages ( ) ; JobRunner jobRunner = new JobRunner ( config ) ; jobRunner . run ( false ) ; }
Add a char to the string buffer.
608
public final String translate ( final CharSequence input ) { if ( input == null ) { return null ; } try { final StringWriter writer = new StringWriter ( input . length ( ) * 2 ) ; translate ( input , writer ) ; return writer . toString ( ) ; } catch ( final IOException ioe ) { throw new RuntimeException ( ioe ) ; } }
Delete all IdRepo plugin for the organization
609
public static boolean compareCellValue ( Double v1 , Double v2 , double t , boolean ignoreNaN ) { if ( v1 == null ) v1 = 0.0 ; if ( v2 == null ) v2 = 0.0 ; if ( ignoreNaN && ( v1 . isNaN ( ) || v1 . isInfinite ( ) || v2 . isNaN ( ) || v2 . isInfinite ( ) ) ) return true ; if ( v1 . equals ( v2 ) ) return true ; return Math . abs ( v1 - v2 ) <= t ; }
The function UTM_To_MGRS calculates an MGRS coordinate string based on the zone, latitude, easting and northing.
610
public void testNegateMathContextNegative ( ) { String a = "-92948782094488478231212478987482988429808779810457634781384756794987" ; int aScale = 49 ; int precision = 46 ; RoundingMode rm = RoundingMode . CEILING ; MathContext mc = new MathContext ( precision , rm ) ; String c = "9294878209448847823.121247898748298842980877982" ; int cScale = 27 ; BigDecimal aNumber = new BigDecimal ( new BigInteger ( a ) , aScale ) ; BigDecimal res = aNumber . negate ( mc ) ; assertEquals ( "incorrect value" , c , res . toString ( ) ) ; assertEquals ( "incorrect scale" , cScale , res . scale ( ) ) ; }
Remove the key from the header. If there are multiple values under the same key, they are all removed. Nothing is done if the key doesn't exist. After a remove, the other pairs' order are not changed.
611
public static int ping ( String url ) throws Exception { URL u = new URL ( url ) ; HttpURLConnection c = ( HttpURLConnection ) u . openConnection ( ) ; c . connect ( ) ; int code = c . getResponseCode ( ) ; log . debug ( "ping=" + url + ", response.code=" + code ) ; c . disconnect ( ) ; return code ; }
Executes task r in the caller's thread, unless the executor has been shut down, in which case the task is discarded.
612
public static int secondaryIdentityHash ( Object key ) { return secondaryHash ( System . identityHashCode ( key ) ) ; }
Unmarshall initiate multipart upload response body to corresponding result.
613
public Config loadInstalledCodenvyConfig ( InstallType installType ) throws IOException { Map < String , String > properties = loadInstalledCodenvyProperties ( installType ) ; return new Config ( properties ) ; }
Return the value of the average algorithm on the line (compare bytes to the average of the previous byte of the same color and the same byte on the previous line)
614
private void signalNotEmpty ( ) { final ReentrantLock takeLock = this . takeLock ; takeLock . lock ( ) ; try { notEmpty . signal ( ) ; } finally { takeLock . unlock ( ) ; } }
Helper method to create a push button.
615
public GeoDistanceSortBuilder point ( double lat , double lon ) { points . add ( new GeoPoint ( lat , lon ) ) ; return this ; }
Keep last CID from an incoming SYNC message
616
private void adjustLeft ( RectF rect , float left , RectF bounds , float snapMargin , float aspectRatio , boolean topMoves , boolean bottomMoves ) { float newLeft = left ; if ( newLeft < 0 ) { newLeft /= 1.05f ; mTouchOffset . x -= newLeft / 1.1f ; } if ( newLeft < bounds . left ) { mTouchOffset . x -= ( newLeft - bounds . left ) / 2f ; } if ( newLeft - bounds . left < snapMargin ) { newLeft = bounds . left ; } if ( rect . right - newLeft < mMinCropWidth ) { newLeft = rect . right - mMinCropWidth ; } if ( rect . right - newLeft > mMaxCropWidth ) { newLeft = rect . right - mMaxCropWidth ; } if ( newLeft - bounds . left < snapMargin ) { newLeft = bounds . left ; } if ( aspectRatio > 0 ) { float newHeight = ( rect . right - newLeft ) / aspectRatio ; if ( newHeight < mMinCropHeight ) { newLeft = Math . max ( bounds . left , rect . right - mMinCropHeight * aspectRatio ) ; newHeight = ( rect . right - newLeft ) / aspectRatio ; } if ( newHeight > mMaxCropHeight ) { newLeft = Math . max ( bounds . left , rect . right - mMaxCropHeight * aspectRatio ) ; newHeight = ( rect . right - newLeft ) / aspectRatio ; } if ( topMoves && bottomMoves ) { newLeft = Math . max ( newLeft , Math . max ( bounds . left , rect . right - bounds . height ( ) * aspectRatio ) ) ; } else { if ( topMoves && rect . bottom - newHeight < bounds . top ) { newLeft = Math . max ( bounds . left , rect . right - ( rect . bottom - bounds . top ) * aspectRatio ) ; newHeight = ( rect . right - newLeft ) / aspectRatio ; } if ( bottomMoves && rect . top + newHeight > bounds . bottom ) { newLeft = Math . max ( newLeft , Math . max ( bounds . left , rect . right - ( bounds . bottom - rect . top ) * aspectRatio ) ) ; } } } rect . left = newLeft ; }
The method converts the int[] to List<Integer>
617
protected int indexFirstOf ( final String s , final String delims , int offset ) { if ( s == null || s . length ( ) == 0 ) { return - 1 ; } if ( delims == null || delims . length ( ) == 0 ) { return - 1 ; } if ( offset < 0 ) { offset = 0 ; } else if ( offset > s . length ( ) ) { return - 1 ; } int min = s . length ( ) ; final char [ ] delim = delims . toCharArray ( ) ; for ( int i = 0 ; i < delim . length ; i ++ ) { final int at = s . indexOf ( delim [ i ] , offset ) ; if ( at >= 0 && at < min ) { min = at ; } } return ( min == s . length ( ) ) ? - 1 : min ; }
Writes next block of compressed data to the output stream.
618
public NamedColor ( String [ ] namesArray , int r , int g , int b ) { super ( r , g , b ) ; names = new HashSet < > ( ) ; names . addAll ( Arrays . asList ( namesArray ) ) ; namesLowercase = new HashSet < > ( ) ; for ( String thisName : namesArray ) { namesLowercase . add ( thisName . toLowerCase ( ) ) ; } if ( namesArray . length == 0 ) { name = "" ; } else { name = namesArray [ 0 ] ; } }
Listen to all the folders from ProjectRoot, build upto any existing addons dirs.
619
public void showContent ( ) { switchState ( CONTENT , null , null , null , null , null , Collections . < Integer > emptyList ( ) ) ; }
Indicates that the specified ResourceDependency has been processed.
620
public synchronized void removeSeries ( int index ) { mSeries . remove ( index ) ; }
Compute the normal (perpendicular) distance to a vector described by a vector taken from the origin. Monotonically increasing for arc distances up to PI/2.
621
public static boolean isValidTemplate ( String template ) { template = template . trim ( ) ; if ( template . indexOf ( '{' ) == - 1 ) { return false ; } String s = template . trim ( ) ; if ( s . lastIndexOf ( '}' ) != s . length ( ) - 1 ) { return false ; } if ( getMethodSignature ( template ) == null ) { return false ; } if ( getMethodBody ( template ) == null ) { return false ; } return true ; }
Performs prereads on a list of input files
622
private double [ ] prune ( Tree tree , NodeRef node , ColourChangeMatrix mm ) { double [ ] p = new double [ colourCount ] ; if ( tree . isExternal ( node ) ) { p [ getColour ( node ) ] = 1.0 ; } else { NodeRef leftChild = tree . getChild ( node , 0 ) ; NodeRef rightChild = tree . getChild ( node , 1 ) ; double [ ] left = prune ( tree , leftChild , mm ) ; double [ ] right = prune ( tree , rightChild , mm ) ; double nodeHeight = tree . getNodeHeight ( node ) ; double leftTime = nodeHeight - tree . getNodeHeight ( tree . getChild ( node , 0 ) ) ; double rightTime = nodeHeight - tree . getNodeHeight ( tree . getChild ( node , 1 ) ) ; double maxp = 0.0 ; for ( int i = 0 ; i < colourCount ; i ++ ) { double leftSum = 0.0 ; double rightSum = 0.0 ; for ( int j = 0 ; j < colourCount ; j ++ ) { leftSum += mm . forwardTimeEvolution ( i , j , leftTime ) * left [ j ] ; rightSum += mm . forwardTimeEvolution ( i , j , rightTime ) * right [ j ] ; } p [ i ] = leftSum * rightSum ; if ( p [ i ] > maxp ) { maxp = p [ i ] ; } } if ( maxp < 1.0e-100 ) { for ( int i = 0 ; i < colourCount ; i ++ ) { p [ i ] *= 1.0e+100 ; } logNodePartialsRescaling -= Math . log ( 1.0e+100 ) ; } } nodePartials [ node . getNumber ( ) ] = p ; if ( debugNodePartials ) { prettyPrint ( "Node " + node . getNumber ( ) + " prune=" , p ) ; } return p ; }
Adds an element to the structure.
623
private void awaitOperationsAvailable ( ) throws InterruptedException { flushLock . lock ( ) ; try { do { if ( writeCache . sizex ( ) <= cacheMaxSize || cacheMaxSize == 0 ) { if ( cacheFlushFreq > 0 ) canFlush . await ( cacheFlushFreq , TimeUnit . MILLISECONDS ) ; else canFlush . await ( ) ; } } while ( writeCache . sizex ( ) == 0 && ! stopping . get ( ) ) ; } finally { flushLock . unlock ( ) ; } }
Add introFragmentAttributes to xintro activity builder.
624
public static String sortCommonTokens ( String column ) { StringBuilder order = new StringBuilder ( ) ; order . append ( " (CASE " ) ; for ( String token : commonTokens ) { order . append ( " WHEN " + column + " LIKE '" + token + " %'" + " THEN SUBSTR(" + column + "," + String . valueOf ( token . length ( ) + 2 ) + ")" + " || ', " + token + "' " ) ; } order . append ( " ELSE " + column + " END) " ) ; return order . toString ( ) ; }
Returns a value as a SVG Path attribute. as specified in http://www.w3.org/TR/SVGMobile12/paths.html#PathDataBNF
625
static boolean isFulfilling ( int m ) { return ( m & FULFILLING ) != 0 ; }
Returns the number of elements.
626
private void writeAttribute ( java . lang . String namespace , java . lang . String attName , java . lang . String attValue , javax . xml . stream . XMLStreamWriter xmlWriter ) throws javax . xml . stream . XMLStreamException { if ( namespace . equals ( "" ) ) { xmlWriter . writeAttribute ( attName , attValue ) ; } else { registerPrefix ( xmlWriter , namespace ) ; xmlWriter . writeAttribute ( namespace , attName , attValue ) ; } }
Create directory that is optionally cleaned up after the JVM shuts down through use of a Runtime shutdown hook.
627
public String toString ( ) { StringBuffer buf = new StringBuffer ( ) ; if ( _isBoot || ( _dataChars [ 0 ] == SprogMessage . STX ) ) { for ( int i = 0 ; i < _nDataChars ; i ++ ) { buf . append ( "<" ) ; buf . append ( _dataChars [ i ] ) ; buf . append ( ">" ) ; } } else { for ( int i = 0 ; i < _nDataChars ; i ++ ) { buf . append ( ( char ) _dataChars [ i ] ) ; } } return buf . toString ( ) ; }
Parses the given XML to a Java model (JAXB unmarshalling). Performs XSD validation.
628
public static boolean isNativeCodeLoaded ( ) { return NativeCodeLoader . isNativeCodeLoaded ( ) ; }
Some perl5 characters may occur in the log file format. Escape these characters to prevent parsing errors.
629
abstract void replay ( ) ;
This method starts up the monitoring agent from the common/ConfigMonitoring module (load-on-startup or at the end of AMSetupServlet/configuration). Since web-app startup is sensitive to exceptions in load-on-startup stuff, this has quite a few try/catch blocks. If any of HTML, SNMP, or RMI adaptors has a problem getting created or started, attempts to create/start the others will be made; If at least one adaptor is started, monitoring will be "active" (Agent.isRunning() will return true).
630
private boolean readyToConnect ( ) { long now = System . currentTimeMillis ( ) ; long lastExchangeMillis = mStore . getLong ( LAST_EXCHANGE_TIME_KEY , - 1 ) ; boolean timeSinceLastOK ; if ( lastExchangeMillis == - 1 ) { timeSinceLastOK = true ; } else if ( now - lastExchangeMillis < TIME_BETWEEN_EXCHANGES_MILLIS ) { timeSinceLastOK = false ; } else { timeSinceLastOK = true ; } if ( ! USE_MINIMAL_LOGGING ) { log . info ( "Ready to connect? " + ( timeSinceLastOK && ( getConnecting ( ) == null ) ) ) ; log . info ( "Connecting: " + getConnecting ( ) ) ; log . info ( "timeSinceLastOK: " + timeSinceLastOK ) ; } return timeSinceLastOK && ( getConnecting ( ) == null ) ; }
Check if the code is running in the game loop.
631
public static void putDouble ( long addr , double val ) { if ( UNALIGNED ) UNSAFE . putDouble ( addr , val ) ; else putLongByByte ( addr , Double . doubleToLongBits ( val ) , BIG_ENDIAN ) ; }
Test plain hash map.
632
public void add ( T item ) { if ( items . add ( item ) ) { notifyDataSetChanged ( ) ; } }
Or for zero and zero
633
public DsnLayerStructure ( Collection < DsnLayer > p_layer_list ) { arr = new DsnLayer [ p_layer_list . size ( ) ] ; Iterator < DsnLayer > it = p_layer_list . iterator ( ) ; for ( int i = 0 ; i < arr . length ; ++ i ) { arr [ i ] = it . next ( ) ; } }
Print an object into the comments section
634
public void writeNext ( String [ ] nextLine , boolean applyQuotesToAll ) { if ( nextLine == null ) { return ; } StringBuilder sb = new StringBuilder ( INITIAL_STRING_SIZE ) ; for ( int i = 0 ; i < nextLine . length ; i ++ ) { if ( i != 0 ) { sb . append ( separator ) ; } String nextElement = nextLine [ i ] ; if ( nextElement == null ) { continue ; } Boolean stringContainsSpecialCharacters = stringContainsSpecialCharacters ( nextElement ) ; if ( ( applyQuotesToAll || stringContainsSpecialCharacters ) && quotechar != NO_QUOTE_CHARACTER ) { sb . append ( quotechar ) ; } if ( stringContainsSpecialCharacters ) { sb . append ( processLine ( nextElement ) ) ; } else { sb . append ( nextElement ) ; } if ( ( applyQuotesToAll || stringContainsSpecialCharacters ) && quotechar != NO_QUOTE_CHARACTER ) { sb . append ( quotechar ) ; } } sb . append ( lineEnd ) ; pw . write ( sb . toString ( ) ) ; }
Creates the matching rule with the provided locale.
635
public double [ ] incomingInstanceToVectorFieldVals ( double [ ] incoming ) throws Exception { double [ ] newInst = new double [ m_vectorFields . size ( ) ] ; for ( int i = 0 ; i < m_vectorFields . size ( ) ; i ++ ) { FieldRef fr = m_vectorFields . get ( i ) ; newInst [ i ] = fr . getResult ( incoming ) ; } return newInst ; }
If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise, it is made to fit the screen according to the dimensions of the previous image matrix. This allows the image to maintain its zoom after rotation.
636
public Source resolveURI ( String base , String urlString , SourceLocator locator ) throws TransformerException , IOException { Source source = null ; if ( null != m_uriResolver ) { source = m_uriResolver . resolve ( urlString , base ) ; } if ( null == source ) { String uri = SystemIDResolver . getAbsoluteURI ( urlString , base ) ; source = new StreamSource ( uri ) ; } return source ; }
Close a server socket and ignore any exceptions.
637
private boolean checkTouchSlop ( View child , float dx , float dy ) { if ( child == null ) { return false ; } final boolean checkHorizontal = mCallback . getViewHorizontalDragRange ( child ) > 0 ; final boolean checkVertical = mCallback . getViewVerticalDragRange ( child ) > 0 ; if ( checkHorizontal && checkVertical ) { return dx * dx + dy * dy > mTouchSlop * mTouchSlop ; } else if ( checkHorizontal ) { return Math . abs ( dx ) > mTouchSlop ; } else if ( checkVertical ) { return Math . abs ( dy ) > mTouchSlop ; } return false ; }
Returns the secure cipher algorithm.
638
private static void logNodeProperties ( org . osgi . service . prefs . Preferences node ) { if ( node == null ) { return ; } try { LOG . info ( node . name ( ) + " properties: " ) ; logProperties ( node ) ; String [ ] childrenNames = node . childrenNames ( ) ; for ( int i = 0 ; i < childrenNames . length ; i ++ ) { logNodeProperties ( node . node ( childrenNames [ i ] ) ) ; } } catch ( Exception t ) { LOG . error ( "Error while logging preferences." , t ) ; } }
Helper method for querying a mirror
639
public static < T extends DataObject > T findInCollection ( Collection < T > col , T obj ) { if ( col != null && obj != null ) { return findInCollection ( col , obj . getId ( ) ) ; } return null ; }
Returns the natural log of the values in this column, after adding 1 to each so that zero values don't return -Infinity
640
public CodeViewer ( ) { setHighlightColor ( DEFAULT_HIGHLIGHT_COLOR ) ; initActions ( ) ; setLayout ( new BorderLayout ( ) ) ; codeHighlightBar = createCodeHighlightBar ( ) ; codeHighlightBar . setVisible ( false ) ; add ( codeHighlightBar , BorderLayout . NORTH ) ; codePanel = createCodePanel ( ) ; add ( codePanel , BorderLayout . CENTER ) ; applyDefaults ( ) ; }
Returns an enumeration describing the available options.
641
@ Override public boolean equals ( Object obj ) { if ( this == obj ) return true ; if ( obj == null ) return false ; if ( getClass ( ) != obj . getClass ( ) ) return false ; IfdStructure other = ( IfdStructure ) obj ; if ( count != other . count ) return false ; if ( offsetValue != other . offsetValue ) return false ; if ( tag != other . tag ) return false ; if ( type != other . type ) return false ; return true ; }
Sorts the specified range of the array.
642
public boolean isAbsoluteURI ( ) { return ( _scheme != null ) ; }
Adds wheel clicking listener
643
public synchronized boolean isConsumer ( ImageConsumer ic ) { return ics . contains ( ic ) ; }
Adds a child to the display list at the specified index, bumping children at equal or greater indexes up one, and setting its parent to this Container
644
public boolean isMandatory ( ) { return flags . contains ( DiagnosticFlag . MANDATORY ) ; }
Requests for an upload to the FileUploader service
645
public < T extends Number > double [ ] next ( Collection < T > values , int numForecasts ) { if ( values . size ( ) < period * 2 ) { throw new AggregationExecutionException ( "Holt-Winters aggregation requires at least (2 * period == 2 * " + period + " == " + ( 2 * period ) + ") data-points to function. Only [" + values . size ( ) + "] were provided." ) ; } double s = 0 ; double last_s ; double b = 0 ; double last_b = 0 ; double [ ] seasonal = new double [ values . size ( ) ] ; int counter = 0 ; double [ ] vs = new double [ values . size ( ) ] ; for ( T v : values ) { vs [ counter ] = v . doubleValue ( ) + padding ; counter += 1 ; } for ( int i = 0 ; i < period ; i ++ ) { s += vs [ i ] ; b += ( vs [ i + period ] - vs [ i ] ) / period ; } s /= ( double ) period ; b /= ( double ) period ; last_s = s ; if ( Double . compare ( s , 0.0 ) == 0 || Double . compare ( s , - 0.0 ) == 0 ) { Arrays . fill ( seasonal , 0.0 ) ; } else { for ( int i = 0 ; i < period ; i ++ ) { seasonal [ i ] = vs [ i ] / s ; } } for ( int i = period ; i < vs . length ; i ++ ) { if ( seasonalityType . equals ( SeasonalityType . MULTIPLICATIVE ) ) { s = alpha * ( vs [ i ] / seasonal [ i - period ] ) + ( 1.0d - alpha ) * ( last_s + last_b ) ; } else { s = alpha * ( vs [ i ] - seasonal [ i - period ] ) + ( 1.0d - alpha ) * ( last_s + last_b ) ; } b = beta * ( s - last_s ) + ( 1 - beta ) * last_b ; if ( seasonalityType . equals ( SeasonalityType . MULTIPLICATIVE ) ) { seasonal [ i ] = gamma * ( vs [ i ] / ( last_s + last_b ) ) + ( 1 - gamma ) * seasonal [ i - period ] ; } else { seasonal [ i ] = gamma * ( vs [ i ] - ( last_s - last_b ) ) + ( 1 - gamma ) * seasonal [ i - period ] ; } last_s = s ; last_b = b ; } double [ ] forecastValues = new double [ numForecasts ] ; for ( int i = 1 ; i <= numForecasts ; i ++ ) { int idx = values . size ( ) - period + ( ( i - 1 ) % period ) ; if ( seasonalityType . equals ( SeasonalityType . MULTIPLICATIVE ) ) { forecastValues [ i - 1 ] = ( s + ( i * b ) ) * seasonal [ idx ] ; } else { forecastValues [ i - 1 ] = s + ( i * b ) + seasonal [ idx ] ; } } return forecastValues ; }
Add a set of edges to the graph. For each edge two DirectedEdges will be created. DirectedEdges are NOT linked by this method.
646
public static AlarmCacheObject createTestAlarm1 ( ) { AlarmCacheObject alarm1 = new AlarmCacheObject ( ) ; alarm1 . setId ( Long . valueOf ( 1 ) ) ; alarm1 . setFaultFamily ( "fault family" ) ; alarm1 . setFaultMember ( "fault member" ) ; alarm1 . setFaultCode ( 0 ) ; AlarmCondition condition = AlarmCondition . fromConfigXML ( "<AlarmCondition class=\"cern.c2mon.server.common.alarm.ValueAlarmCondition\">" + "<alarm-value type=\"String\">DOWN</alarm-value></AlarmCondition>" ) ; alarm1 . setCondition ( condition ) ; alarm1 . setInfo ( "alarm info" ) ; alarm1 . setState ( AlarmCondition . TERMINATE ) ; alarm1 . setTimestamp ( new Timestamp ( System . currentTimeMillis ( ) - 2000 ) ) ; alarm1 . setDataTagId ( 100003L ) ; return alarm1 ; }
Util method to write an attribute without the ns prefix
647
public boolean justSerialized ( ) { return serialized . getAndSet ( false ) ; }
Returns a first non-null value in a given array, if such is present.
648
public Object read ( String xml ) throws Exception { return fromXML ( m_Document . read ( xml ) ) ; }
Compares two activation group descriptors for content equality.
649
protected T newInstance ( final Class < ? extends T > cls , final IIndexManager indexManager , final NT nt , final Properties properties ) { if ( cls == null ) throw new IllegalArgumentException ( ) ; if ( indexManager == null ) throw new IllegalArgumentException ( ) ; if ( nt == null ) throw new IllegalArgumentException ( ) ; if ( properties == null ) throw new IllegalArgumentException ( ) ; final Constructor < ? extends T > ctor ; try { ctor = cls . getConstructor ( new Class [ ] { IIndexManager . class , String . class , Long . class , Properties . class } ) ; } catch ( Exception e ) { throw new RuntimeException ( "No appropriate ctor?: cls=" + cls . getName ( ) + " : " + e , e ) ; } final T r ; try { r = ctor . newInstance ( new Object [ ] { indexManager , nt . getName ( ) , nt . getTimestamp ( ) , properties } ) ; r . init ( ) ; if ( INFO ) { log . info ( "new instance: " + r ) ; } return r ; } catch ( Exception ex ) { throw new RuntimeException ( "Could not instantiate relation: " + ex , ex ) ; } }
Update the text contents of an existing style element.
650
public Builder ( ) { }
Method for BeanContextMembership interface
651
protected MapTile findCovering ( int zoom , long i , long j ) { while ( zoom > 0 ) { zoom -- ; i = i / 2 ; j = j / 2 ; MapTile candidate = findTile ( zoom , i , j ) ; if ( ( candidate != null ) && ( ! candidate . loading ( ) ) ) { return candidate ; } } return null ; }
Tests if key is assignable. Key is considered assignable if annotation types match, Type matches and annotation instances match.
652
@ Override public String format ( Object obj ) throws IllegalArgumentException { return format ( obj , new StringBuffer ( ) ) ; }
Test verifies properties were renamed correctly.
653
public boolean isEmpty ( ) { return ( ( values == null ) || ( values . isEmpty ( ) ) ) ; }
Adds another ImageContainer to the list of those interested in the results of the request.
654
private static String [ ] processObjectClasses ( final String objectClass ) { String [ ] objectClasses = null ; if ( objectClass != null ) { objectClasses = objectClass . split ( "," ) ; } if ( objectClasses != null ) { String objClass = null ; for ( int i = 0 ; i < objectClasses . length ; i ++ ) { objClass = objectClasses [ i ] ; if ( objClass != null ) { objectClasses [ i ] = objClass . trim ( ) ; } } } return objectClasses ; }
Attempts to rename a file. The built-in method File.renameTo() often fails for different reasons (e.g. if the file should be moved across different file systems). This method first tries the method File.renameTo(), but tries other possibilities if the first one fails.
655
public static String [ ] filterLightColors ( String [ ] aPalette , int aThreshold ) { List < String > filtered = new ArrayList < String > ( ) ; for ( String color : aPalette ) { if ( ! isTooLight ( color , aThreshold ) ) { filtered . add ( color ) ; } } return ( String [ ] ) filtered . toArray ( new String [ filtered . size ( ) ] ) ; }
Stolen from Radford Neal's fbm package. digamma(x) is defined as (d/dx) log Gamma(x). It is computed here using an asymptotic expansion when x>5. For x<=5, the recurrence relation digamma(x) = digamma(x+1) - 1/x is used repeatedly. See Venables & Ripley, Modern Applied Statistics with S-Plus, pp. 151-152. COMPUTE THE DIGAMMA FUNCTION. Returns -inf if the argument is an integer less than or equal to zero.
656
synchronized int lookup ( final Object tx , final boolean insert ) { if ( tx == null ) { throw new IllegalArgumentException ( "transaction object is null" ) ; } Integer index = ( Integer ) mapping . get ( tx ) ; if ( index == null ) { if ( insert ) { final int capacity = capacity ( ) ; final int nvertices = mapping . size ( ) ; if ( nvertices == capacity ) { throw new MultiprogrammingCapacityExceededException ( "capacity=" + capacity + ", nvertices=" + nvertices ) ; } index = ( Integer ) indices . remove ( 0 ) ; mapping . put ( tx , index ) ; final int ndx = index . intValue ( ) ; if ( transactions [ ndx ] != null ) { throw new AssertionError ( ) ; } transactions [ ndx ] = tx ; } else { return - 1 ; } } return index . intValue ( ) ; }
Add an extension with the given oid and the passed in byte array to be wrapped in the OCTET STRING associated with the extension.
657
public void delete ( ) throws IOException { close ( ) ; Util . deleteContents ( directory ) ; }
Adds a collection of Geometries to be processed. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted.
658
public void deregister ( TrainSchedule schedule ) { if ( schedule == null ) { return ; } Integer oldSize = Integer . valueOf ( _scheduleHashTable . size ( ) ) ; _scheduleHashTable . remove ( schedule . getId ( ) ) ; setDirtyAndFirePropertyChange ( LISTLENGTH_CHANGED_PROPERTY , oldSize , Integer . valueOf ( _scheduleHashTable . size ( ) ) ) ; }
A utility method to figure out the closest distance of a border to a point. If the point is inside the rectangle, return 0.
659
public int readLEInt ( ) throws IOException { int byte1 , byte2 , byte3 , byte4 ; synchronized ( this ) { byte1 = in . read ( ) ; byte2 = in . read ( ) ; byte3 = in . read ( ) ; byte4 = in . read ( ) ; } if ( byte4 == - 1 ) { throw new EOFException ( ) ; } return ( byte4 << 24 ) + ( byte3 << 16 ) + ( byte2 << 8 ) + byte1 ; }
uRLDecoder is ambiguous because we generate the getURLDecoder getter which gets decoded to urlDecoder, so for those we have to remember the exact name.
660
protected AbstractSimplex ( final double [ ] steps ) { if ( steps == null ) { throw new NullArgumentException ( ) ; } if ( steps . length == 0 ) { throw new MathIllegalArgumentException ( LocalizedCoreFormats . ZERO_NOT_ALLOWED ) ; } dimension = steps . length ; startConfiguration = new double [ dimension ] [ dimension ] ; for ( int i = 0 ; i < dimension ; i ++ ) { final double [ ] vertexI = startConfiguration [ i ] ; for ( int j = 0 ; j < i + 1 ; j ++ ) { if ( steps [ j ] == 0 ) { throw new MathIllegalArgumentException ( LocalizedOptimFormats . EQUAL_VERTICES_IN_SIMPLEX ) ; } System . arraycopy ( steps , 0 , vertexI , 0 , j + 1 ) ; } } }
Creates a periodic action with given nano time and period.
661
protected void logDiagnostic ( String msg ) { if ( isDiagnosticsEnabled ( ) ) { logRawDiagnostic ( diagnosticPrefix + msg ) ; } }
Called when the file system tree selection has changed.
662
private void updateProgress ( String progressLabel , int progress ) { if ( myHost != null && ( ( progress != previousProgress ) || ( ! progressLabel . equals ( previousProgressLabel ) ) ) ) { myHost . updateProgress ( progressLabel , progress ) ; } previousProgress = progress ; previousProgressLabel = progressLabel ; }
Creates the list of frames to consider, based on settings. This method does a cursory check of scale settings before moving to geographical settings.
663
public void initializeAtomsForDP ( List < Datum > data , String filename , Random random ) { omega = new ArrayList < > ( K ) ; dof = new double [ K ] ; beta = new double [ K ] ; if ( filename != null ) { try { loc = BatchMixtureModel . initializeClustersFromFile ( filename , K ) ; log . debug ( "loc : {}" , loc ) ; if ( loc . size ( ) < K ) { loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( loc , data , K , random ) ; } } catch ( FileNotFoundException e ) { log . debug ( "failed to initialized from file" ) ; e . printStackTrace ( ) ; loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( data , K , random ) ; } } else { loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( data , K , random ) ; } for ( int i = 0 ; i < K ; i ++ ) { beta [ i ] = 1 ; dof [ i ] = baseNu ; omega . add ( 0 , AlgebraUtils . invertMatrix ( baseOmegaInverse ) ) ; } }
Returns true if the given word is pronounceable. This method is originally called us_aswd() in Flite 1.1.
664
private String determineEventTypeBasedOnOperationalStatus ( Hashtable < String , String > notification , String [ ] descs , String [ ] codes , String evtOKType , String evtNOTOKType , List < String > propDescriptions , List < String > propCodes ) { logMessage ( "Determiming Operational Status for Event" , new Object [ ] { } ) ; String evtType = null ; String [ ] values = descs ; if ( values . length > 0 ) { evtType = evtNOTOKType ; for ( String value : values ) { if ( propDescriptions . contains ( value ) ) { evtType = evtOKType ; break ; } } } else { values = codes ; if ( values . length > 0 ) { evtType = evtNOTOKType ; for ( String value : values ) { if ( propCodes . contains ( value ) ) { evtType = evtOKType ; break ; } } } else { logMessage ( "No Operational Status Values Found for this Event" , new Object [ ] { } ) ; } } return evtType ; }
Computes the bit-width of HLL registers necessary to estimate a set of the specified cardinality.
665
public static int toIntAccess ( String access ) throws ApplicationException { access = StringUtil . toLowerCase ( access . trim ( ) ) ; if ( access . equals ( "package" ) ) return Component . ACCESS_PACKAGE ; else if ( access . equals ( "private" ) ) return Component . ACCESS_PRIVATE ; else if ( access . equals ( "public" ) ) return Component . ACCESS_PUBLIC ; else if ( access . equals ( "remote" ) ) return Component . ACCESS_REMOTE ; throw new ApplicationException ( "invalid access type [" + access + "], access types are remote, public, package, private" ) ; }
Set up stdout/stderr redirects
666
static byte [ ] ntlm2SessionResponse ( final byte [ ] ntlmHash , final byte [ ] challenge , final byte [ ] clientChallenge ) throws AuthenticationException { try { final MessageDigest md5 = MessageDigest . getInstance ( "MD5" ) ; md5 . update ( challenge ) ; md5 . update ( clientChallenge ) ; final byte [ ] digest = md5 . digest ( ) ; final byte [ ] sessionHash = new byte [ 8 ] ; System . arraycopy ( digest , 0 , sessionHash , 0 , 8 ) ; return lmResponse ( ntlmHash , sessionHash ) ; } catch ( Exception e ) { if ( e instanceof AuthenticationException ) throw ( AuthenticationException ) e ; throw new AuthenticationException ( e . getMessage ( ) , e ) ; } }
Creates a new Repair.
667
private boolean checkTouchSlop ( View child , float dx , float dy ) { if ( child == null ) { return false ; } final boolean checkHorizontal = mCallback . getViewHorizontalDragRange ( child ) > 0 ; final boolean checkVertical = mCallback . getViewVerticalDragRange ( child ) > 0 ; if ( checkHorizontal && checkVertical ) { return dx * dx + dy * dy > mTouchSlop * mTouchSlop ; } else if ( checkHorizontal ) { return Math . abs ( dx ) > mTouchSlop ; } else if ( checkVertical ) { return Math . abs ( dy ) > mTouchSlop ; } return false ; }
Move to next element in the array.
668
public boolean isAncestorOf ( IJavaElement e ) { IJavaElement parentElement = e . getParent ( ) ; while ( parentElement != null && ! parentElement . equals ( this ) ) { parentElement = parentElement . getParent ( ) ; } return parentElement != null ; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
669
@ RequestProcessing ( value = "/member/{userName}" , method = HTTPRequestMethod . GET ) @ Before ( adviceClass = { StopwatchStartAdvice . class , AnonymousViewCheck . class , UserBlockCheck . class } ) @ After ( adviceClass = StopwatchEndAdvice . class ) public void showHome ( final HTTPRequestContext context , final HttpServletRequest request , final HttpServletResponse response , final String userName ) throws Exception { final JSONObject user = ( JSONObject ) request . getAttribute ( User . USER ) ; String pageNumStr = request . getParameter ( "p" ) ; if ( Strings . isEmptyOrNull ( pageNumStr ) || ! Strings . isNumeric ( pageNumStr ) ) { pageNumStr = "1" ; } final int pageNum = Integer . valueOf ( pageNumStr ) ; request . setAttribute ( Keys . TEMAPLTE_DIR_NAME , Symphonys . get ( "skinDirName" ) ) ; final AbstractFreeMarkerRenderer renderer = new SkinRenderer ( ) ; context . setRenderer ( renderer ) ; final Map < String , Object > dataModel = renderer . getDataModel ( ) ; filler . fillHeaderAndFooter ( request , response , dataModel ) ; final String followingId = user . optString ( Keys . OBJECT_ID ) ; dataModel . put ( Follow . FOLLOWING_ID , followingId ) ; renderer . setTemplateName ( "/home/home.ftl" ) ; dataModel . put ( User . USER , user ) ; fillHomeUser ( dataModel , user ) ; avatarQueryService . fillUserAvatarURL ( user ) ; final boolean isLoggedIn = ( Boolean ) dataModel . get ( Common . IS_LOGGED_IN ) ; if ( isLoggedIn ) { final JSONObject currentUser = ( JSONObject ) dataModel . get ( Common . CURRENT_USER ) ; final String followerId = currentUser . optString ( Keys . OBJECT_ID ) ; final boolean isFollowing = followQueryService . isFollowing ( followerId , followingId ) ; dataModel . put ( Common . IS_FOLLOWING , isFollowing ) ; } user . put ( UserExt . USER_T_CREATE_TIME , new Date ( user . getLong ( Keys . OBJECT_ID ) ) ) ; final int pageSize = Symphonys . getInt ( "userHomeArticlesCnt" ) ; final int windowSize = Symphonys . getInt ( "userHomeArticlesWindowSize" ) ; final List < JSONObject > userArticles = articleQueryService . getUserArticles ( user . optString ( Keys . OBJECT_ID ) , pageNum , pageSize ) ; dataModel . put ( Common . USER_HOME_ARTICLES , userArticles ) ; final int articleCnt = user . optInt ( UserExt . USER_ARTICLE_COUNT ) ; final int pageCount = ( int ) Math . ceil ( ( double ) articleCnt / ( double ) pageSize ) ; final List < Integer > pageNums = Paginator . paginate ( pageNum , pageSize , pageCount , windowSize ) ; if ( ! pageNums . isEmpty ( ) ) { dataModel . put ( Pagination . PAGINATION_FIRST_PAGE_NUM , pageNums . get ( 0 ) ) ; dataModel . put ( Pagination . PAGINATION_LAST_PAGE_NUM , pageNums . get ( pageNums . size ( ) - 1 ) ) ; } dataModel . put ( Pagination . PAGINATION_CURRENT_PAGE_NUM , pageNum ) ; dataModel . put ( Pagination . PAGINATION_PAGE_COUNT , pageCount ) ; dataModel . put ( Pagination . PAGINATION_PAGE_NUMS , pageNums ) ; final JSONObject currentUser = Sessions . currentUser ( request ) ; if ( null == currentUser ) { dataModel . put ( Common . IS_MY_ARTICLE , false ) ; } else { dataModel . put ( Common . IS_MY_ARTICLE , userName . equals ( currentUser . optString ( User . USER_NAME ) ) ) ; } }
Register listener to listen radio service actions
670
protected final void enableRetransmissionTimer ( int tickCount ) { if ( isInviteTransaction ( ) && ( this instanceof SIPClientTransaction ) ) { retransmissionTimerTicksLeft = tickCount ; } else { retransmissionTimerTicksLeft = Math . min ( tickCount , MAXIMUM_RETRANSMISSION_TICK_COUNT ) ; } retransmissionTimerLastTickCount = retransmissionTimerTicksLeft ; retransmissionOutdatedTime = SystemClock . elapsedRealtime ( ) + retransmissionTimerTicksLeft * BASE_TIMER_INTERVAL ; }
If necessary, register the extension namespace found compiling a function or creating an extension element. If it is a predefined namespace, create a support object to simplify the instantiate of an appropriate ExtensionHandler during transformation runtime. Otherwise, add the namespace, if necessary, to a vector of undefined extension namespaces, to be defined later.
671
void tidy ( int windowStartYear ) { if ( lastRuleList . size ( ) == 1 ) { throw new IllegalStateException ( "Cannot have only one rule defined as being forever" ) ; } if ( windowEnd . equals ( LocalDateTime . MAX ) ) { maxLastRuleStartYear = Math . max ( maxLastRuleStartYear , windowStartYear ) + 1 ; for ( TZRule lastRule : lastRuleList ) { addRule ( lastRule . year , maxLastRuleStartYear , lastRule . month , lastRule . dayOfMonthIndicator , lastRule . dayOfWeek , lastRule . time , lastRule . timeEndOfDay , lastRule . timeDefinition , lastRule . savingAmountSecs ) ; lastRule . year = maxLastRuleStartYear + 1 ; } if ( maxLastRuleStartYear == YEAR_MAX_VALUE ) { lastRuleList . clear ( ) ; } else { maxLastRuleStartYear ++ ; } } else { int endYear = windowEnd . getYear ( ) ; for ( TZRule lastRule : lastRuleList ) { addRule ( lastRule . year , endYear + 1 , lastRule . month , lastRule . dayOfMonthIndicator , lastRule . dayOfWeek , lastRule . time , lastRule . timeEndOfDay , lastRule . timeDefinition , lastRule . savingAmountSecs ) ; } lastRuleList . clear ( ) ; maxLastRuleStartYear = YEAR_MAX_VALUE ; } Collections . sort ( ruleList ) ; Collections . sort ( lastRuleList ) ; if ( ruleList . size ( ) == 0 && fixedSavingAmountSecs == null ) { fixedSavingAmountSecs = 0 ; } }
Fills a given list with nodes in scope, searching recursively.
672
private int [ ] determineDimensions ( int sourceCodeWords , int errorCorrectionCodeWords ) throws WriterException { float ratio = 0.0f ; int [ ] dimension = null ; for ( int cols = minCols ; cols <= maxCols ; cols ++ ) { int rows = calculateNumberOfRows ( sourceCodeWords , errorCorrectionCodeWords , cols ) ; if ( rows < minRows ) { break ; } if ( rows > maxRows ) { continue ; } float newRatio = ( ( 17 * cols + 69 ) * DEFAULT_MODULE_WIDTH ) / ( rows * HEIGHT ) ; if ( dimension != null && Math . abs ( newRatio - PREFERRED_RATIO ) > Math . abs ( ratio - PREFERRED_RATIO ) ) { continue ; } ratio = newRatio ; dimension = new int [ ] { cols , rows } ; } if ( dimension == null ) { int rows = calculateNumberOfRows ( sourceCodeWords , errorCorrectionCodeWords , minCols ) ; if ( rows < minRows ) { dimension = new int [ ] { minCols , minRows } ; } } if ( dimension == null ) { throw new WriterException ( "Unable to fit message in columns" ) ; } return dimension ; }
Disconnect from the server. Currently connecting to the server only works once, since it's intended to stay connected all the time, so using this should only be done when the program is closed.
673
private void logAfterLoad ( ) { Enumeration elem = properties . keys ( ) ; List lp = Collections . list ( elem ) ; Collections . sort ( lp ) ; Iterator iter = lp . iterator ( ) ; finer ( "Configuration contains " + properties . size ( ) + " keys." ) ; finer ( "List of configuration properties, after override:" ) ; while ( iter . hasNext ( ) ) { String key = ( String ) iter . next ( ) ; String val = properties . getProperty ( key ) ; finer ( " " + key + " = " + val ) ; } finer ( "Properties list complete." ) ; }
addTimeChangeListener, This adds a time change listener to this time picker. For additional details, see the TimeChangeListener class documentation.
674
public T removeItemByPosition ( int position ) { if ( position < mObjects . size ( ) && position != INVALID_POSITION ) { mObjectDeleted = mObjects . remove ( position ) ; mHasDeletedPosition = position ; notifyDataSetChanged ( ) ; return mObjectDeleted ; } else { throw new IndexOutOfBoundsException ( "The position is invalid!" ) ; } }
Add node to network at a given position, initializing instances, parentsets, distributions. Used for manual manipulation of the Bayesian network.
675
public static QName valueOf ( CharSequence name ) { QName qName = ( QName ) FULL_NAME_TO_QNAME . get ( name ) ; return ( qName != null ) ? qName : QName . createNoNamespace ( name . toString ( ) ) ; }
Return the hash of an array of bytes. This method is thread safe.
676
protected final void putChar ( char ch ) { if ( sp == sbuf . length ) { char [ ] newsbuf = new char [ sbuf . length * 2 ] ; System . arraycopy ( sbuf , 0 , newsbuf , 0 , sbuf . length ) ; sbuf = newsbuf ; } sbuf [ sp ++ ] = ch ; }
Unwraps handshake data and processes it.
677
@ Transactional ( readOnly = true ) @ Cacheable ( value = "network_download_count" , key = "#user.id" ) public int countDownloadsByUserSince ( final User user , final Long period ) { Objects . requireNonNull ( user , "'user' parameter is null" ) ; Objects . requireNonNull ( period , "'period' parameter is null" ) ; long current_timestamp = System . currentTimeMillis ( ) ; if ( period < 0 || period > current_timestamp ) { throw new IllegalArgumentException ( "period time too high" ) ; } Date date = new Date ( current_timestamp - period ) ; return networkUsageDao . countDownloadByUserSince ( user , date ) ; }
finds the closest coordinate in facilityMap to the coordinate origin
678
public UMUserPasswordResetOptionsData ( String question , String questionLocalizedName , String answer , int dataStatus ) { this . question = question . trim ( ) ; this . questionLocalizedName = questionLocalizedName ; this . answer = answer . trim ( ) ; this . dataStatus = dataStatus ; }
Get total physical memory in bytes. Return -1 when fails getting amount of total memory.
679
private void assertCharVectors ( int n ) { int k = 2 * n + 1 ; int limit = ( int ) Math . pow ( 2 , k + 2 ) ; for ( int i = 0 ; i < limit ; i ++ ) { String encoded = Integer . toString ( i , 2 ) ; assertLev ( encoded , n ) ; } }
Appends the given exception handler to the front of the exception handler list. That is, this will be called first on an exception.
680
static String expandEnvironmentVariables ( String value ) { if ( null == value ) { return null ; } Matcher m = ENV_VAR_PATTERN . matcher ( value ) ; StringBuffer sb = new StringBuffer ( ) ; while ( m . find ( ) ) { String envVarValue = null ; String envVarName = null == m . group ( 1 ) ? m . group ( 2 ) : m . group ( 1 ) ; if ( envVarName . startsWith ( ( "env." ) ) ) { envVarValue = System . getenv ( envVarName . substring ( 3 ) ) ; } else { envVarValue = System . getProperty ( envVarName ) ; } m . appendReplacement ( sb , null == envVarValue ? "" : Matcher . quoteReplacement ( envVarValue ) ) ; } m . appendTail ( sb ) ; return sb . toString ( ) ; }
Finds product variants based on a product ID and a distinct feature.
681
public HashTokenSessionMap ( Environment environment ) { int sessionTimeoutValue ; try { sessionTimeoutValue = environment . getProperty ( API_SESSION_TIMEOUT , 60 ) ; } catch ( GuacamoleException e ) { logger . error ( "Unable to read guacamole.properties: {}" , e . getMessage ( ) ) ; logger . debug ( "Error while reading session timeout value." , e ) ; sessionTimeoutValue = 60 ; } logger . info ( "Sessions will expire after {} minutes of inactivity." , sessionTimeoutValue ) ; executor . scheduleAtFixedRate ( new SessionEvictionTask ( sessionTimeoutValue * 60000l ) , 1 , 1 , TimeUnit . MINUTES ) ; }
Stops running cluster membership protocol and releases occupied resources.
682
private int oidcClaimsUsageCount ( String uuid ) throws SSOException , SMSException { SMSEntry smsEntry = new SMSEntry ( getToken ( ) , getOAuth2ProviderBaseDN ( ) ) ; Map < String , Set < String > > attributes = smsEntry . getAttributes ( ) ; try { Set < String > sunKeyValues = getMapSetThrows ( attributes , "sunKeyValue" ) ; if ( sunKeyValues . contains ( "forgerock-oauth2-provider-oidc-claims-extension-script=" + uuid ) ) { return 1 ; } } catch ( ValueNotFoundException ignored ) { } return 0 ; }
Atomically removes all of the elements from this queue. The queue will be empty after this call returns.
683
public synchronized AlphabeticIndex addLabels ( Locale locale ) { addLabels ( peer , locale . toString ( ) ) ; return this ; }
Helper function for starting scan and scheduling the scan timeout
684
public EventExpireThread ( ) { super ( "event expire" ) ; setDaemon ( true ) ; }
Format Time to String
685
public boolean isHeader ( int position ) { return position >= 0 && position < mHeaderViews . size ( ) ; }
Create a warning diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
686
public void testCase6 ( ) { byte aBytes [ ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2 , 3 } ; byte bBytes [ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70 , 10 , 20 , 30 } ; int aSign = - 1 ; int bSign = - 1 ; byte rBytes [ ] = { 9 , 18 , 27 , 36 , 45 , 54 , 63 , 9 , 18 , 27 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger bNumber = new BigInteger ( bSign , bBytes ) ; BigInteger result = aNumber . subtract ( bNumber ) ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = result . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( 1 , result . signum ( ) ) ; }
Append several int values onto the vector.
687
@ Override public void drawRangeMarker ( Graphics2D g2 , CategoryPlot plot , ValueAxis axis , Marker marker , Rectangle2D dataArea ) { Rectangle2D adjusted = new Rectangle2D . Double ( dataArea . getX ( ) , dataArea . getY ( ) + getYOffset ( ) , dataArea . getWidth ( ) - getXOffset ( ) , dataArea . getHeight ( ) - getYOffset ( ) ) ; if ( marker instanceof ValueMarker ) { ValueMarker vm = ( ValueMarker ) marker ; double value = vm . getValue ( ) ; Range range = axis . getRange ( ) ; if ( ! range . contains ( value ) ) { return ; } GeneralPath path = null ; PlotOrientation orientation = plot . getOrientation ( ) ; if ( orientation == PlotOrientation . HORIZONTAL ) { float x = ( float ) axis . valueToJava2D ( value , adjusted , plot . getRangeAxisEdge ( ) ) ; float y = ( float ) adjusted . getMaxY ( ) ; path = new GeneralPath ( ) ; path . moveTo ( x , y ) ; path . lineTo ( ( float ) ( x + getXOffset ( ) ) , y - ( float ) getYOffset ( ) ) ; path . lineTo ( ( float ) ( x + getXOffset ( ) ) , ( float ) ( adjusted . getMinY ( ) - getYOffset ( ) ) ) ; path . lineTo ( x , ( float ) adjusted . getMinY ( ) ) ; path . closePath ( ) ; } else if ( orientation == PlotOrientation . VERTICAL ) { float y = ( float ) axis . valueToJava2D ( value , adjusted , plot . getRangeAxisEdge ( ) ) ; float x = ( float ) dataArea . getX ( ) ; path = new GeneralPath ( ) ; path . moveTo ( x , y ) ; path . lineTo ( x + ( float ) this . xOffset , y - ( float ) this . yOffset ) ; path . lineTo ( ( float ) ( adjusted . getMaxX ( ) + this . xOffset ) , y - ( float ) this . yOffset ) ; path . lineTo ( ( float ) ( adjusted . getMaxX ( ) ) , y ) ; path . closePath ( ) ; } else { throw new IllegalStateException ( ) ; } g2 . setPaint ( marker . getPaint ( ) ) ; g2 . fill ( path ) ; g2 . setPaint ( marker . getOutlinePaint ( ) ) ; g2 . draw ( path ) ; String label = marker . getLabel ( ) ; RectangleAnchor anchor = marker . getLabelAnchor ( ) ; if ( label != null ) { Font labelFont = marker . getLabelFont ( ) ; g2 . setFont ( labelFont ) ; g2 . setPaint ( marker . getLabelPaint ( ) ) ; Point2D coordinates = calculateRangeMarkerTextAnchorPoint ( g2 , orientation , dataArea , path . getBounds2D ( ) , marker . getLabelOffset ( ) , LengthAdjustmentType . EXPAND , anchor ) ; TextUtilities . drawAlignedString ( label , g2 , ( float ) coordinates . getX ( ) , ( float ) coordinates . getY ( ) , marker . getLabelTextAnchor ( ) ) ; } } else { super . drawRangeMarker ( g2 , plot , axis , marker , adjusted ) ; } }
Removes the given section and all its options (does nothing if it doesn't exist)
688
public void clearBreakpointsPassive ( final BreakpointType type ) { Preconditions . checkNotNull ( type , "IE01011: Type argument can not be null" ) ; NaviLogger . info ( "Clearing all breakpoints of type '%s' passively" , type ) ; switch ( type ) { case REGULAR : throw new IllegalStateException ( "IE01018: Regular breakpoints can not be cleared passively" ) ; case ECHO : echoBreakpointStorage . clear ( ) ; return ; case STEP : stepBreakpointStorage . clear ( ) ; return ; default : throw new IllegalStateException ( String . format ( "IE01017: Invalid breakpoint type '%s'" , type ) ) ; } }
Method to add a listener
689
public Enumeration content ( ) { return table . elements ( ) ; }
process an array of bytes, producing output if necessary.
690
@ Override @ SuppressWarnings ( "unchecked" ) public synchronized < T > T [ ] toArray ( T [ ] contents ) { if ( elementCount > contents . length ) { return null ; } System . arraycopy ( elementData , 0 , contents , 0 , elementCount ) ; if ( elementCount < contents . length ) { contents [ elementCount ] = null ; } return contents ; }
Display warning with warning icon
691
static private boolean isNoncapturingParen ( String s , int pos ) { boolean isLookbehind = false ; { String pre = s . substring ( pos , pos + 4 ) ; isLookbehind = pre . equals ( "(?<=" ) || pre . equals ( "(?<!" ) ; } return s . charAt ( pos + 1 ) == '?' && ( isLookbehind || s . charAt ( pos + 2 ) != '<' ) ; }
The possible commentType arguments to writeComment.
692
public synchronized void clearDynamicProperties ( ) throws ReplicatorException { logger . info ( "Clearing dynamic properties" ) ; if ( dynamicProperties != null ) dynamicProperties . clear ( ) ; if ( dynamicPropertiesFile . exists ( ) ) { if ( ! dynamicPropertiesFile . delete ( ) ) logger . error ( "Unable to delete dynamic properties file: " + dynamicPropertiesFile . getAbsolutePath ( ) ) ; } if ( dynamicRoleFile != null ) { if ( dynamicRoleFile . exists ( ) ) { if ( ! dynamicRoleFile . delete ( ) ) logger . error ( "Unable to delete dynamic role file: " + dynamicRoleFile . getAbsolutePath ( ) ) ; } } }
Formats milliseconds to seconds.
693
public String pullRequestsUrl ( String account , String collection , String repoId ) { Objects . requireNonNull ( repoId , "Repository id required" ) ; return getTeamBaseUrl ( account , collection ) + format ( PULL_REQUESTS , repoId ) + getApiVersion ( ) ; }
Save all databases to index it in elastic search
694
public final void append ( char value ) { char [ ] chunk ; if ( m_firstFree < m_chunkSize ) chunk = m_array [ m_lastChunk ] ; else { int i = m_array . length ; if ( m_lastChunk + 1 == i ) { char [ ] [ ] newarray = new char [ i + 16 ] [ ] ; System . arraycopy ( m_array , 0 , newarray , 0 , i ) ; m_array = newarray ; } chunk = m_array [ ++ m_lastChunk ] ; if ( chunk == null ) { if ( m_lastChunk == 1 << m_rebundleBits && m_chunkBits < m_maxChunkBits ) { m_innerFSB = new FastStringBuffer ( this ) ; } chunk = m_array [ m_lastChunk ] = new char [ m_chunkSize ] ; } m_firstFree = 0 ; } chunk [ m_firstFree ++ ] = value ; }
Initialize the current coloring panel based on combo box selection.
695
protected abstract String defaultColumnName ( ) ;
Generates a uniform random complex number, i.e., a complex number whose real and imaginary parts are random.
696
private void publishRtf ( Resource resource , BigDecimal version ) throws PublicationException { if ( isLocked ( resource . getShortname ( ) ) ) { throw new PublicationException ( PublicationException . TYPE . LOCKED , "Resource " + resource . getShortname ( ) + " is currently locked by another process" ) ; } Document doc = new Document ( ) ; File rtfFile = dataDir . resourceRtfFile ( resource . getShortname ( ) , version ) ; OutputStream out = null ; try { out = new FileOutputStream ( rtfFile ) ; RtfWriter2 . getInstance ( doc , out ) ; eml2Rtf . writeEmlIntoRtf ( doc , resource ) ; } catch ( FileNotFoundException e ) { throw new PublicationException ( PublicationException . TYPE . RTF , "Can't find rtf file to write metadata to: " + rtfFile . getAbsolutePath ( ) , e ) ; } catch ( DocumentException e ) { throw new PublicationException ( PublicationException . TYPE . RTF , "RTF DocumentException while writing to file: " + rtfFile . getAbsolutePath ( ) , e ) ; } catch ( Exception e ) { throw new PublicationException ( PublicationException . TYPE . RTF , "An unexpected error occurred while writing RTF file: " + e . getMessage ( ) , e ) ; } finally { if ( out != null ) { try { out . close ( ) ; } catch ( IOException e ) { log . warn ( "FileOutputStream to RTF file could not be closed" ) ; } } } }
Create a new TeXParser with or without a first pass
697
public synchronized void returnBuf ( byte [ ] buf ) { if ( buf == null || buf . length > mSizeLimit ) { return ; } mBuffersByLastUse . add ( buf ) ; int pos = Collections . binarySearch ( mBuffersBySize , buf , BUF_COMPARATOR ) ; if ( pos < 0 ) { pos = - pos - 1 ; } mBuffersBySize . add ( pos , buf ) ; mCurrentSize += buf . length ; trim ( ) ; }
Either posts a job immediately if the chart has already setup it's dimensions or adds the job to the execution queue.
698
public static String slurpFile ( File file ) throws IOException { Reader r = new FileReader ( file ) ; return slurpReader ( r ) ; }
Finds the first '#'. Returns -1 if none found.
699
public boolean connectToBroker ( final MqttAsyncConnection connection ) { try { connection . connect ( new MqttCallbackHandler ( connection ) , new MqttAsyncConnectionRunnable ( connection ) ) ; return true ; } catch ( SpyException e ) { Platform . runLater ( new MqttEventHandler ( new MqttConnectionAttemptFailureEvent ( connection , e ) ) ) ; logger . error ( e . getMessage ( ) , e ) ; } return false ; }
Push back the remaining contents of the buffer by repositioning the input stream.