idx
int64 0
34.9k
| question
stringlengths 12
26.4k
| target
stringlengths 15
2.15k
|
---|---|---|
34,600 | protected abstract void sessionRemoved ( SSLSession session ) ; | Velocity is independent of the number of points used during the same interval |
34,601 | public static double coefficient ( double [ ] x , double [ ] y ) { final int xdim = x . length ; final int ydim = y . length ; if ( xdim != ydim ) { throw new IllegalArgumentException ( "Invalid arguments: arrays differ in length." ) ; } double sumXX = 0. , sumYY = 0. , sumXY = 0. ; double meanX = x [ 0 ] , meanY = y [ 0 ] ; int i = 1 ; while ( i < xdim ) { final double xv = x [ i ] , yv = y [ i ] ; final double deltaX = xv - meanX ; final double deltaY = yv - meanY ; ++ i ; meanX += deltaX / i ; meanY += deltaY / i ; final double neltaX = xv - meanX ; final double neltaY = yv - meanY ; sumXX += deltaX * neltaX ; sumYY += deltaY * neltaY ; sumXY += deltaX * neltaY ; } if ( ! ( sumXX > 0. && sumYY > 0. ) ) { return ( sumXX == sumYY ) ? 1. : 0. ; } return sumXY / Math . sqrt ( sumXX * sumYY ) ; } | generate array of n d-dimensional points whose coordinates are values in the range 0 .. 1 |
34,602 | private String constructAddLUNQuery ( String systemId , String targetPortId , String domainId , Map < String , String > deviceLunList , List < Path > pathList , String model ) throws Exception { Map < String , Object > attributeMap = new HashMap < String , Object > ( ) ; StorageArray array = new StorageArray ( systemId ) ; Add addOp = new Add ( HDSConstants . LUN_TARGET ) ; attributeMap . put ( HDSConstants . STORAGEARRAY , array ) ; attributeMap . put ( HDSConstants . ADD , addOp ) ; attributeMap . put ( HDSConstants . MODEL , model ) ; if ( null != deviceLunList && ! deviceLunList . isEmpty ( ) ) { for ( String device : deviceLunList . keySet ( ) ) { String lun = deviceLunList . get ( device ) ; Path path = new Path ( targetPortId , domainId , null , lun , device ) ; pathList . add ( path ) ; log . info ( "Device :{} lun:{}" , device , lun ) ; } } attributeMap . put ( HDSConstants . PATH_LIST , pathList ) ; String addLunInputXML = InputXMLGenerationClient . getInputXMLString ( HDSConstants . ADD_PATH_TO_HSD_OP , attributeMap , HDSConstants . HITACHI_INPUT_XML_CONTEXT_FILE , HDSConstants . HITACHI_SMOOKS_CONFIG_FILE ) ; return addLunInputXML ; } | Convert an array of bytes into a List of Strings using UTF-8. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.<p/> Can be used to parse the output of |
34,603 | @ Override public boolean equals ( Object object ) { if ( this == object ) { return true ; } if ( ( null == object ) || ( getClass ( ) != object . getClass ( ) ) ) { return false ; } final Player other = ( Player ) object ; return other . id == id ; } | Cleans up used resources. This method should always be called if the protocol used is TCP, so we can shutdown gracefully |
34,604 | public static String cleanBeginWhitespace ( String in ) { int len = in . length ( ) ; int st = 0 ; int off = 0 ; char [ ] val = in . toCharArray ( ) ; while ( ( st < len ) && ( val [ off + st ] <= ' ' ) ) { st ++ ; } return ( ( st > 0 ) || ( len < in . length ( ) ) ) ? in . substring ( st , len ) : in ; } | Read next message from log |
34,605 | @ Override @ SuppressForbidden ( reason = "System#out" ) public void activateOptions ( ) { if ( follow ) { if ( target . equals ( SYSTEM_ERR ) ) { setWriter ( createWriter ( new SystemErrStream ( ) ) ) ; } else { setWriter ( createWriter ( new SystemOutStream ( ) ) ) ; } } else { if ( target . equals ( SYSTEM_ERR ) ) { setWriter ( createWriter ( System . err ) ) ; } else { setWriter ( createWriter ( System . out ) ) ; } } super . activateOptions ( ) ; } | Utility method to query the modifier flags of this member. |
34,606 | private boolean addIfAbsent ( E e , Object [ ] snapshot ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { Object [ ] current = getArray ( ) ; int len = current . length ; if ( snapshot != current ) { int common = Math . min ( snapshot . length , len ) ; for ( int i = 0 ; i < common ; i ++ ) if ( current [ i ] != snapshot [ i ] && eq ( e , current [ i ] ) ) return false ; if ( indexOf ( e , current , common , len ) >= 0 ) return false ; } Object [ ] newElements = Arrays . copyOf ( current , len + 1 ) ; newElements [ len ] = e ; setArray ( newElements ) ; return true ; } finally { lock . unlock ( ) ; } } | verify Identity(String, IdentityScope) creates instance with given name and in give scope |
34,607 | static int applyMaskPenaltyRule4 ( ByteMatrix matrix ) { int numDarkCells = 0 ; byte [ ] [ ] array = matrix . getArray ( ) ; int width = matrix . getWidth ( ) ; int height = matrix . getHeight ( ) ; for ( int y = 0 ; y < height ; y ++ ) { byte [ ] arrayY = array [ y ] ; for ( int x = 0 ; x < width ; x ++ ) { if ( arrayY [ x ] == 1 ) { numDarkCells ++ ; } } } int numTotalCells = matrix . getHeight ( ) * matrix . getWidth ( ) ; int fivePercentVariances = Math . abs ( numDarkCells * 2 - numTotalCells ) * 10 / numTotalCells ; return fivePercentVariances * N4 ; } | sets the title (i.e. filename) |
34,608 | public static String formatURL ( String url ) { if ( ! Strings . isNullOrEmpty ( url ) ) { try { URI uri = URI . create ( url ) ; if ( uri . isAbsolute ( ) ) { return url ; } else { return "http://" + url ; } } catch ( IllegalArgumentException e ) { return null ; } } else { return null ; } } | Count down wait latch. |
34,609 | void recomposeVariables ( ElemVariable elemVar ) { if ( getVariableOrParamComposed ( elemVar . getName ( ) ) == null ) { elemVar . setIsTopLevel ( true ) ; elemVar . setIndex ( m_variables . size ( ) ) ; m_variables . addElement ( elemVar ) ; } } | Create a new probe and log that it started. |
34,610 | public int compareTo ( DebugScript other ) { return comparableName . compareTo ( other . comparableName ) ; } | Checks that object has valid object name. Some DB objects have dummy names (like "" or ".") - we won't use them for certain purposes. |
34,611 | public void publish ( AWSIotMessage message ) throws AWSIotException { try { publishMessage ( message ) ; } catch ( AwsIotRetryableException e ) { if ( client . getMaxOfflineQueueSize ( ) > 0 && publishQueue . size ( ) < client . getMaxOfflineQueueSize ( ) ) { publishQueue . add ( message ) ; } else { LOGGER . info ( "Failed to publish message to " + message . getTopic ( ) ) ; throw new AWSIotException ( e ) ; } } } | Append an object onto the vector. |
34,612 | public void testRotateMapViewInTrackDetailActivity ( ) { if ( ! runTest ) { Log . d ( TAG , BigTestUtils . DISABLE_MESSAGE ) ; return ; } EndToEndTestUtils . startRecording ( ) ; for ( int i = 0 ; ( System . currentTimeMillis ( ) - startTime ) < TEST_DURATION_IN_MILLISECONDS ; i ++ ) { EndToEndTestUtils . sendGps ( 10 , i * 10 ) ; EndToEndTestUtils . rotateCurrentActivity ( ) ; Log . d ( TAG , String . format ( "Totate %d times in %d minutes!" , i , ( System . currentTimeMillis ( ) - startTime ) / 1000 / 60 ) ) ; } } | New AlignerTrainer for pairs of different symbol sets with no optional info. |
34,613 | public void testWriteReadEmpty ( ) throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream ( 0 ) ; ObjectOutputStream os = new ObjectOutputStream ( out ) ; os . writeObject ( empty ) ; ObjectInputStream is = new ObjectInputStream ( new ByteArrayInputStream ( out . toByteArray ( ) ) ) ; LoadBalancingPolicy copy = ( LoadBalancingPolicy ) is . readObject ( ) ; is . close ( ) ; os . close ( ) ; assertTrue ( helper . areEquals ( empty , copy ) ) ; } | Parses the thread xml node. |
34,614 | public void trimToSize ( ) { if ( names != null ) names . trimToSize ( ) ; if ( requiredChildren != null ) { requiredChildren . trimToSize ( ) ; for ( GazEntry nextkey : requiredChildren . values ( ) ) { nextkey . trimToSize ( ) ; } } } | Creates edits from a SortedMap containing tags (as sequential key-value pairs) |
34,615 | public ImageTitle ( Image image , RectangleEdge position , HorizontalAlignment horizontalAlignment , VerticalAlignment verticalAlignment ) { this ( image , image . getHeight ( null ) , image . getWidth ( null ) , position , horizontalAlignment , verticalAlignment , Title . DEFAULT_PADDING ) ; } | Delete the restaurant's open hours and open days. |
34,616 | public boolean hasFinished ( ) { return finished . get ( ) ; } | Generates a certificate revocation list (CRL) object and initializes it with the data read from the input stream inStream. |
34,617 | TreeBin ( TreeNode < K > b ) { super ( TREEBIN , null , null ) ; this . first = b ; TreeNode < K > r = null ; for ( TreeNode < K > x = b , next ; x != null ; x = next ) { next = ( TreeNode < K > ) x . next ; x . left = x . right = null ; if ( r == null ) { x . parent = null ; x . red = false ; r = x ; } else { K k = x . key ; int h = x . hash ; Class < ? > kc = null ; for ( TreeNode < K > p = r ; ; ) { int dir , ph ; K pk = p . key ; if ( ( ph = p . hash ) > h ) dir = - 1 ; else if ( ph < h ) dir = 1 ; else if ( ( kc == null && ( kc = comparableClassFor ( k ) ) == null ) || ( dir = compareComparables ( kc , k , pk ) ) == 0 ) dir = tieBreakOrder ( k , pk ) ; TreeNode < K > xp = p ; if ( ( p = ( dir <= 0 ) ? p . left : p . right ) == null ) { x . parent = xp ; if ( dir <= 0 ) xp . left = x ; else xp . right = x ; r = balanceInsertion ( r , x ) ; break ; } } } } this . root = r ; assert checkInvariants ( root ) ; } | Append a character sequence to this Writer. |
34,618 | private void updateProgress ( String progressLabel , int progress ) { if ( myHost != null && ( ( progress != previousProgress ) || ( ! progressLabel . equals ( previousProgressLabel ) ) ) ) { myHost . updateProgress ( progressLabel , progress ) ; } previousProgress = progress ; previousProgressLabel = progressLabel ; } | Override the default behavior of the Android volume buttons. If overridden, when the volume button is pressed, the "volume[up|down]button" JavaScript event will be fired. |
34,619 | public CertId ( DerInputStream derIn ) throws IOException { hashAlgId = AlgorithmId . parse ( derIn . getDerValue ( ) ) ; issuerNameHash = derIn . getOctetString ( ) ; issuerKeyHash = derIn . getOctetString ( ) ; certSerialNumber = new SerialNumber ( derIn ) ; } | Adds all mentions in collection to this cluster |
34,620 | public void testSignerString ( ) throws Exception { Signer s = new SignerStub ( "sss3" ) ; assertNotNull ( s ) ; assertEquals ( "sss3" , s . getName ( ) ) ; assertNull ( s . getPrivateKey ( ) ) ; Signer s2 = new SignerStub ( null ) ; assertNull ( s2 . getName ( ) ) ; } | processes the requested action. |
34,621 | public void copyChars ( char [ ] otherChars , int otherOffset , int otherLength ) { grow ( otherLength ) ; System . arraycopy ( otherChars , otherOffset , ref . chars , 0 , otherLength ) ; ref . length = otherLength ; } | Fills the buffer with more bytes. Can be overridden to fill the bytes from a source other than the InputStream. |
34,622 | @ Override public String toString ( ) { return expressionStr ; } | Calculate the pointer's coordinates on the color wheel using the supplied angle. |
34,623 | void onStartTrackingTouch ( ) { mIsDragging = true ; } | Evaluates the given expression. The given variables will be substituted in the expression. Converts the result of the evaluation to a Double. Throws an IllegalStateException if the result could not be converted to a Double |
34,624 | private void updateDiskGCRVV ( RegionVersionVector diskRVV , RegionVersionVector inMemoryRVV , VersionSource member ) { long diskVersion = diskRVV . getVersionForMember ( member ) ; long memoryGCVersion = inMemoryRVV . getGCVersion ( member ) ; if ( memoryGCVersion <= diskVersion ) { diskRVV . recordGCVersion ( member , memoryGCVersion ) ; } } | URL-encodes everything between "/"-characters. Encodes spaces as '%20' instead of '+'. |
34,625 | public int length ( List < String > ls ) { return ls . size ( ) ; } | Tell the user of an error, and probably throw an exception. |
34,626 | private static void popTransactionStartStamp ( ) { ListOrderedMap map = ( ListOrderedMap ) suspendedTxStartStamps . get ( ) ; if ( map . size ( ) > 0 ) { transactionStartStamp . set ( ( Timestamp ) map . remove ( map . lastKey ( ) ) ) ; } else { Debug . logError ( "Error in transaction handling - no saved start stamp found - using NOW." , module ) ; transactionStartStamp . set ( UtilDateTime . nowTimestamp ( ) ) ; } } | Generates the code to unreify the result of the given method. For a method "int m (int i, String s)", this code is the bytecode corresponding to the "((Integer)...).intValue()" expression. |
34,627 | public static byte [ ] unPad ( byte [ ] seq , boolean forward ) { if ( seq != null && seq . length == CG2_PADDED_LENGTH ) { final int pos = forward ? CG2_PAD_POSITION : CG2_PAD_POSITION_REV ; final byte [ ] result = new byte [ seq . length - 1 ] ; System . arraycopy ( seq , 0 , result , 0 , pos ) ; System . arraycopy ( seq , pos + 1 , result , pos , seq . length - pos - 1 ) ; return result ; } else { return seq ; } } | Old style xml:lang attribute value was of form en_AU. Test this format still works. |
34,628 | Operand peek ( Register s ) { Stack < Operand > stack = get ( s ) ; if ( stack == null || stack . isEmpty ( ) ) { return null ; } else { return stack . peek ( ) ; } } | Creates a filename (where the file should be saved) from info about a download. |
34,629 | public void addUpdateListener ( AnimatorUpdateListener listener ) { if ( mUpdateListeners == null ) { mUpdateListeners = new ArrayList < AnimatorUpdateListener > ( ) ; } mUpdateListeners . add ( listener ) ; } | Or for a negative number and zero |
34,630 | public void done ( ) { m_TrainingData = null ; if ( m_NumIterationsPerformed > 0 ) { m_ZeroR = null ; } } | Selects the blocks based on col max and min value. |
34,631 | @ Override public V put ( K key , V value ) { V oldValue = super . put ( key , value ) ; return ( oldValue == null ) ? delegate . get ( key ) : oldValue ; } | Returns true if the timeout occurred. |
34,632 | protected void acceptDrag ( int dragOperation ) { DropTargetContextPeer peer = getDropTargetContextPeer ( ) ; if ( peer != null ) { peer . acceptDrag ( dragOperation ) ; } } | Deserializes column into object field |
34,633 | public boolean matches ( String line , String route ) { if ( ! lines . isEmpty ( ) && ! lines . contains ( line ) ) return false ; if ( ! routes . isEmpty ( ) && ! routes . contains ( route ) ) return false ; return true ; } | Invoke heapify-down for the root object. |
34,634 | @ Bean ( initMethod = "start" , destroyMethod = "stop" ) @ Profile ( Constants . SPRING_PROFILE_DEVELOPMENT ) public Server h2TCPServer ( ) throws SQLException { return Server . createTcpServer ( "-tcp" , "-tcpAllowOthers" ) ; } | UpdateFunctionalityTest2#testUpdate4(). Attempts to set incorrect foreign key value - expecting SQLException TODO foreign key functionality is not supported |
34,635 | public static void deleteFileIfExistsWithRetry ( Path path ) throws IOException { try { if ( Files . exists ( path ) ) deleteFileWithRetry0 ( path ) ; } catch ( InterruptedException x ) { throw new IOException ( "Interrupted while deleting." , x ) ; } } | Creates and returns a String formatted so it will fit in a box with the given width. |
34,636 | public void waitForExit ( ) throws IOException { Thread thread = Thread . currentThread ( ) ; ClassLoader oldLoader = thread . getContextClassLoader ( ) ; try { thread . setContextClassLoader ( _systemManager . getClassLoader ( ) ) ; _waitForExitService = new WaitForExitService3 ( this , _systemManager ) ; _waitForExitService . waitForExit ( ) ; } finally { thread . setContextClassLoader ( oldLoader ) ; } } | Validates actions/instructions -1 --> IPv4/IPv6 conflict 0 --> no IPv4 or IPv6 actions 1 --> IPv4 only actions 2 --> IPv6 only actions |
34,637 | void pushElemTemplateElement ( ElemTemplateElement elem ) { if ( elem . getUid ( ) == - 1 ) elem . setUid ( nextUid ( ) ) ; m_elems . push ( elem ) ; } | Creates a simple model using default resource bundle. |
34,638 | private synchronized void rebuildJournal ( ) throws IOException { if ( journalWriter != null ) { journalWriter . close ( ) ; } Writer writer = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( journalFileTmp ) , Util . US_ASCII ) ) ; try { writer . write ( MAGIC ) ; writer . write ( "\n" ) ; writer . write ( VERSION_1 ) ; writer . write ( "\n" ) ; writer . write ( Integer . toString ( appVersion ) ) ; writer . write ( "\n" ) ; writer . write ( Integer . toString ( valueCount ) ) ; writer . write ( "\n" ) ; writer . write ( "\n" ) ; for ( Entry entry : lruEntries . values ( ) ) { if ( entry . currentEditor != null ) { writer . write ( DIRTY + ' ' + entry . key + '\n' ) ; } else { writer . write ( CLEAN + ' ' + entry . key + entry . getLengths ( ) + '\n' ) ; } } } finally { writer . close ( ) ; } if ( journalFile . exists ( ) ) { renameTo ( journalFile , journalFileBackup , true ) ; } renameTo ( journalFileTmp , journalFile , false ) ; journalFileBackup . delete ( ) ; journalWriter = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( journalFile , true ) , Util . US_ASCII ) ) ; } | If this is an unbounded (streaming) pipeline, and both inputFile and pubsub topic are defined, start an 'injector' pipeline that publishes the contents of the file to the given topic, first creating the topic if necessary. |
34,639 | public void showLoading ( ) { switchState ( LOADING , null , null , null , null , null , Collections . < Integer > emptyList ( ) ) ; } | Given a BasicStroke, create an ImageIcon that shows it. |
34,640 | public void onShowNotification ( NotificationView view , View contentView , NotificationEntry entry , int layoutId ) { if ( DBG ) Log . v ( TAG , "onShowNotification - " + entry . ID ) ; final Drawable icon = entry . iconDrawable ; final CharSequence title = entry . title ; final CharSequence text = entry . text ; final CharSequence when = entry . showWhen ? entry . whenFormatted : null ; ChildViewManager mgr = view . getChildViewManager ( ) ; if ( layoutId == R . layout . notification_simple || layoutId == R . layout . notification_large_icon || layoutId == R . layout . notification_full ) { boolean titleChanged = true ; boolean contentChanged = view . isContentLayoutChanged ( ) ; NotificationEntry lastEntry = view . getLastNotification ( ) ; if ( ! contentChanged && title != null && lastEntry != null && title . equals ( lastEntry . title ) ) { titleChanged = false ; } mgr . setImageDrawable ( ICON , icon , titleChanged ) ; mgr . setText ( TITLE , title , titleChanged ) ; mgr . setText ( TEXT , text ) ; mgr . setText ( WHEN , when ) ; } else if ( layoutId == R . layout . notification_simple_2 ) { mgr . setImageDrawable ( ICON , icon ) ; mgr . setText ( TITLE , title ) ; mgr . setText ( TEXT , text ) ; mgr . setText ( WHEN , when ) ; } } | Creates and returns a new instance. |
34,641 | private double [ ] [ ] createInitialSimplex ( double [ ] initial ) { double [ ] [ ] points = new double [ initial . length + 1 ] [ ] ; for ( int i = 0 ; i < points . length ; i ++ ) { points [ i ] = new double [ initial . length ] ; } System . arraycopy ( initial , 0 , points [ 0 ] , 0 , initial . length ) ; for ( int i = 1 ; i < points . length ; i ++ ) { System . arraycopy ( initial , 0 , points [ i ] , 0 , initial . length ) ; points [ i ] [ i - 1 ] += lambda ; } return points ; } | Factory method to deliver simple values |
34,642 | private LinkedList < Diff > diff_compute ( String text1 , String text2 , boolean checklines , long deadline ) { LinkedList < Diff > diffs = new LinkedList < Diff > ( ) ; if ( text1 . length ( ) == 0 ) { diffs . add ( new Diff ( Operation . INSERT , text2 ) ) ; return diffs ; } if ( text2 . length ( ) == 0 ) { diffs . add ( new Diff ( Operation . DELETE , text1 ) ) ; return diffs ; } String longtext = text1 . length ( ) > text2 . length ( ) ? text1 : text2 ; String shorttext = text1 . length ( ) > text2 . length ( ) ? text2 : text1 ; int i = longtext . indexOf ( shorttext ) ; if ( i != - 1 ) { Operation op = ( text1 . length ( ) > text2 . length ( ) ) ? Operation . DELETE : Operation . INSERT ; diffs . add ( new Diff ( op , longtext . substring ( 0 , i ) ) ) ; diffs . add ( new Diff ( Operation . EQUAL , shorttext ) ) ; diffs . add ( new Diff ( op , longtext . substring ( i + shorttext . length ( ) ) ) ) ; return diffs ; } if ( shorttext . length ( ) == 1 ) { diffs . add ( new Diff ( Operation . DELETE , text1 ) ) ; diffs . add ( new Diff ( Operation . INSERT , text2 ) ) ; return diffs ; } String [ ] hm = diff_halfMatch ( text1 , text2 ) ; if ( hm != null ) { String text1_a = hm [ 0 ] ; String text1_b = hm [ 1 ] ; String text2_a = hm [ 2 ] ; String text2_b = hm [ 3 ] ; String mid_common = hm [ 4 ] ; LinkedList < Diff > diffs_a = diff_main ( text1_a , text2_a , checklines , deadline ) ; LinkedList < Diff > diffs_b = diff_main ( text1_b , text2_b , checklines , deadline ) ; diffs = diffs_a ; diffs . add ( new Diff ( Operation . EQUAL , mid_common ) ) ; diffs . addAll ( diffs_b ) ; return diffs ; } if ( checklines && text1 . length ( ) > 100 && text2 . length ( ) > 100 ) { return diff_lineMode ( text1 , text2 , deadline ) ; } return diff_bisect ( text1 , text2 , deadline ) ; } | Strings at even index are keys, odd-index strings are values in the returned map |
34,643 | private OptionScanNode buildTreeFromNodeList ( List < OptionScanNode > nodeList , int treeNodeType , OptionScanNode lastScanNode ) { if ( nodeList . size ( ) == mDegree ) { nodeList . add ( lastScanNode ) ; List < OptionScanNode > children = nodeList . subList ( 0 , nodeList . size ( ) - 2 ) ; OptionScanNode lastChild = createTree ( nodeList . subList ( nodeList . size ( ) - 2 , nodeList . size ( ) ) , treeNodeType ) ; children . add ( lastChild ) ; return createTree ( children , treeNodeType ) ; } else if ( nodeList . size ( ) < mDegree ) { nodeList . add ( lastScanNode ) ; return createTree ( nodeList , treeNodeType ) ; } else { List < OptionScanNode > subtrees = new ArrayList < > ( ) ; int elemNum = nodeList . size ( ) / mDegree ; int elemRemainder = nodeList . size ( ) % mDegree ; int startIndex = 0 , endIndex = 0 ; List < OptionScanNode > subtreeNodes ; while ( startIndex < nodeList . size ( ) ) { endIndex = ( elemRemainder > 0 ) ? endIndex + elemNum + 1 : endIndex + elemNum ; elemRemainder -- ; subtreeNodes = new ArrayList < > ( nodeList . subList ( startIndex , endIndex ) ) ; if ( ( subtreeNodes . size ( ) == 1 ) && ( endIndex < nodeList . size ( ) ) ) { subtrees . add ( subtreeNodes . get ( 0 ) ) ; } else { subtrees . add ( buildTreeFromNodeList ( subtreeNodes , treeNodeType , lastScanNode ) ) ; } startIndex = endIndex ; } return createTree ( subtrees , treeNodeType ) ; } } | Instantiates this generic class using the substitution to replace the type parameters. |
34,644 | public JettySolrRunner startJettySolrRunner ( ) throws Exception { return startJettySolrRunner ( newNodeName ( ) , jettyConfig . context , jettyConfig ) ; } | Dismiss the keyboard and save the updated values |
34,645 | public static long determineCeilingFromMaxValue ( long number , int yNumOfDivs ) { long tempInt = number ; tempInt = tempInt / 5 + tempInt ; if ( tempInt < 100 ) { while ( tempInt % yNumOfDivs != 0 ) { tempInt ++ ; } return tempInt ; } else { int counter = 0 ; String numStr = "" + number ; for ( int i = 0 ; i < numStr . length ( ) - 2 ; i ++ ) { tempInt = tempInt / 10 ; counter ++ ; } tempInt ++ ; while ( tempInt % yNumOfDivs != 0 ) { tempInt ++ ; } return ( long ) Math . pow ( 10 , counter ) * tempInt ; } } | Convert full-width letters in Chinese fonts to normal half-width letters in ANSI charset. Numbers are not touched. |
34,646 | boolean isEmpty ( ) { return buffer . length ( ) == 0 ; } | Removes a markerWithPosition some time in the future. |
34,647 | public ParseACL ( ParseUser owner ) { this ( ) ; setReadAccess ( owner , true ) ; setWriteAccess ( owner , true ) ; } | Throws an exception if the managed ledger has been previously fenced |
34,648 | public Object resizeCell ( Object cell , mxRectangle bounds ) { return resizeCells ( new Object [ ] { cell } , new mxRectangle [ ] { bounds } ) [ 0 ] ; } | Copies this string replacing occurrences of the specified character with another character. |
34,649 | public boolean closeDurableClientProxy ( String durableClientId ) throws CacheException { CacheClientProxy ccp = getClientProxy ( durableClientId ) ; if ( ccp == null ) { return false ; } if ( ccp . isPaused ( ) && ! ccp . isConnected ( ) ) { ccp . setKeepAlive ( false ) ; closeDeadProxies ( Collections . singletonList ( ccp ) , true ) ; return true ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Cannot close running durable client: {}" , durableClientId ) ; } throw new CacheException ( "Cannot close a running durable client : " + durableClientId ) { } ; } } | Hashes the given float array with the given hash function. |
34,650 | private static File createTempFile ( String tempSubdirectoryName , String name ) throws IOException { String tempDirName = System . getProperty ( "java.io.tmpdir" ) ; File tempSubDirectory = new File ( tempDirName + File . separator + tempSubdirectoryName ) ; if ( ! tempSubDirectory . exists ( ) ) { boolean createdDirectory = tempSubDirectory . mkdirs ( ) ; if ( ! createdDirectory ) { throw new IOException ( "Could not create directory for temporary file: " + tempSubDirectory ) ; } } String tempFileName = tempSubDirectory + File . separator + name ; File tempFile = new File ( tempFileName ) ; return tempFile ; } | Save the StringBuilder some work and guess how big your signature might be. Uses the default SignatureRules (rules for determining what to include in a signature). |
34,651 | private boolean isVpoolQuotaUpdate ( Map < String , String > updateMap ) { for ( String iter : updateMap . keySet ( ) ) { if ( iter . startsWith ( "volumes_" ) || iter . startsWith ( "snapshots_" ) || iter . startsWith ( "gigabytes_" ) ) { return true ; } } return false ; } | Generates a random IV and encrypts this plain text with the given key. Then attaches a hashed MAC, which is contained in the CipherTextIvMac class. |
34,652 | public CoreTokenException ( int errorCode , Object [ ] params , int httpStatusCode ) { this . errorCode = errorCode ; this . params = params ; this . httpStatusCode = httpStatusCode ; this . message = getLocalizedMessage ( Locale . getDefault ( ) ) ; } | Determines whether variable x is independent of variable y given a list of conditioning variables z. |
34,653 | public BufferedImage toImage ( Drawing drawing , java . util . List < Figure > figures , AffineTransform transform , Dimension imageSize ) { Color background = drawing . get ( CANVAS_FILL_COLOR ) ; double opacity = drawing . get ( CANVAS_FILL_OPACITY ) ; if ( background == null ) { background = new Color ( 0xff , 0xff , 0xff , 0x0 ) ; } else { background = new Color ( background . getRed ( ) , background . getGreen ( ) , background . getBlue ( ) , ( int ) ( background . getAlpha ( ) * opacity ) ) ; } BufferedImage buf = new BufferedImage ( Math . max ( 1 , imageSize . width ) , Math . max ( 1 , imageSize . height ) , ( background . getAlpha ( ) == 255 ) ? BufferedImage . TYPE_INT_RGB : BufferedImage . TYPE_INT_ARGB ) ; Graphics2D g = buf . createGraphics ( ) ; Composite savedComposite = g . getComposite ( ) ; g . setComposite ( AlphaComposite . getInstance ( AlphaComposite . SRC ) ) ; g . setColor ( background ) ; g . fillRect ( 0 , 0 , buf . getWidth ( ) , buf . getHeight ( ) ) ; g . setComposite ( savedComposite ) ; setRenderingHints ( g ) ; g . transform ( transform ) ; for ( Figure f : figures ) { f . draw ( g ) ; } g . dispose ( ) ; if ( imageType != BufferedImage . TYPE_INT_ARGB ) { BufferedImage buf2 = new BufferedImage ( buf . getWidth ( ) , buf . getHeight ( ) , imageType ) ; g = buf2 . createGraphics ( ) ; setRenderingHints ( g ) ; g . setComposite ( AlphaComposite . getInstance ( AlphaComposite . SRC ) ) ; g . drawImage ( buf , 0 , 0 , null ) ; g . dispose ( ) ; buf . flush ( ) ; buf = buf2 ; } return buf ; } | Creates a new journal that omits redundant information. This replaces the current journal if it exists. |
34,654 | public void testSubmitCallable ( ) throws Throwable { ExecutorService e = new ForkJoinPool ( 1 ) ; PoolCleaner cleaner = null ; try { cleaner = cleaner ( e ) ; Future < String > future = e . submit ( new StringTask ( ) ) ; assertSame ( TEST_STRING , future . get ( ) ) ; assertTrue ( future . isDone ( ) ) ; assertFalse ( future . isCancelled ( ) ) ; } finally { if ( cleaner != null ) { cleaner . close ( ) ; } } } | Reads in the specified file, splits it on whitespace, and adds all resulting words to an array which it returns. The specified label string appears in the returned array first, before any of the file's words. |
34,655 | public static void markup ( Element e , String text , String linkCssClass ) { e . setInnerHTML ( "" ) ; List < String > paragraphs = StringUtils . split ( text , "\n\n" ) ; for ( String paragraph : paragraphs ) { markupParagraph ( e , paragraph , linkCssClass ) ; } } | recalculate and set duration based on current start and end times |
34,656 | public String generateDocumentation ( String containerId ) throws Exception { StringBuilder output = new StringBuilder ( ) ; output . append ( "{note}This page has been automatically generated by Cargo's build. " + "Do not edit it directly as it'll be overwritten next time it's generated again." + "{note}" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( LINE_SEPARATOR ) ; if ( containerId . equals ( "geronimo1x" ) ) { output . append ( "{note}The Geronimo 1.x CARGO container REQUIRES Geronimo 1.1.1.{note}" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( LINE_SEPARATOR ) ; } else if ( containerId . equals ( "glassfish4x" ) ) { output . append ( "{info}The GlassFish 4.x container also works with " ) ; output . append ( "[Payara|http://www.payara.fish/].{info}" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( LINE_SEPARATOR ) ; } else if ( containerId . startsWith ( "jboss6" ) || containerId . startsWith ( "jboss7" ) || containerId . startsWith ( "wildfly10" ) ) { output . append ( "{note}With the opening of the JBoss EAP to the public and the split " ) ; output . append ( "between JBoss and WildFly, the below naming correspondance should be " ) ; output . append ( "used with JBoss EAP containers:" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( "* What Cargo calls [JBoss 6.1.x] is what JBoss refers to as JBoss " ) ; output . append ( "Application Server version 6.1; i.e. the version released in August " ) ; output . append ( "2011" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( "* What Cargo calls [JBoss 7.2.x] is what JBoss refers to as JBoss " ) ; output . append ( "Enterprise Application Platform (EAP) version 6.1; i.e. the build " ) ; output . append ( "from JBoss Application Server (AS) version 7.2 released in May 2013" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( "* What Cargo calls [JBoss 7.3.x] is what JBoss refers to as JBoss " ) ; output . append ( "Enterprise Application Platform (EAP) version 6.2; i.e. the build " ) ; output . append ( "from JBoss Application Server (AS) version 7.3 released in October " ) ; output . append ( "2013" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( "* What Cargo calls [JBoss 7.4.x] is what JBoss refers to as JBoss " ) ; output . append ( "Enterprise Application Platform (EAP) version 6.3; i.e. the build " ) ; output . append ( "from JBoss Application Server (AS) version 7.4 released in June " ) ; output . append ( "2014" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( "* What Cargo calls [JBoss 7.5.x] is what JBoss refers to as JBoss " ) ; output . append ( "Enterprise Application Platform (EAP) version 6.4; i.e. the build " ) ; output . append ( "from JBoss Application Server (AS) version 7.5 released in October " ) ; output . append ( "2015" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( "* The [WildFly 10.x] container can be used with the JBoss Enterprise " ) ; output . append ( "Application Platform (EAP) version 7; i.e. the version released in " ) ; output . append ( "May 2016" ) ; output . append ( "{note}" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( LINE_SEPARATOR ) ; } else if ( containerId . startsWith ( "weblogic12" ) ) { if ( containerId . equals ( "weblogic12x" ) ) { output . append ( "{info}The WebLogic 12.x container lacks from the many features " ) ; output . append ( "provided by the [WebLogic 12.1.x] and [WebLogic 12.2.x] " ) ; output . append ( "containers - We would hence recommend using one of these " ) ; output . append ( "instead of the WebLogic 12.x container.{info}" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( LINE_SEPARATOR ) ; } output . append ( "{note}" ) ; output . append ( "If you are using the WebLogic 12 Developer's Edition, after you have " ) ; output . append ( "downloaded the distribution, please remember to also configure " ) ; output . append ( "WebLogic." ) ; output . append ( LINE_SEPARATOR ) ; output . append ( "You can read http://www.oracle.com/webfolder/technetwork/tutorials/" ) ; output . append ( "obe/java/wls_12c_netbeans_install/wls_12c_netbeans_install.html for " ) ; output . append ( "details." ) ; output . append ( "{note}" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( LINE_SEPARATOR ) ; } else if ( containerId . startsWith ( "websphere" ) ) { output . append ( "{note}" ) ; output . append ( "The WebSphere container does +not+ support WebSphere Application " ) ; output . append ( "Server Community Edition, please prefer to use the \"full\" " ) ; output . append ( "WebSphere package or WebSphere Application Server for Developers." ) ; output . append ( "{note}" ) ; output . append ( LINE_SEPARATOR ) ; output . append ( LINE_SEPARATOR ) ; } output . append ( generateContainerFeaturesText ( containerId ) ) ; output . append ( LINE_SEPARATOR ) ; output . append ( generateConfigurationFeaturesText ( containerId ) ) ; output . append ( LINE_SEPARATOR ) ; output . append ( generateDeployerFeaturesText ( containerId ) ) ; output . append ( LINE_SEPARATOR ) ; output . append ( generateOtherFeaturesText ( containerId ) ) ; output . append ( LINE_SEPARATOR ) ; output . append ( generateConfigurationPropertiesText ( containerId ) ) ; output . append ( LINE_SEPARATOR ) ; output . append ( generateSamplesInfoText ( containerId ) ) ; output . append ( LINE_SEPARATOR ) ; return output . toString ( ) ; } | Copies the original byte array content to a new byte array. The resulting byte array is always "length" size. If length is smaller than the original byte array, the resulting byte array is truncated. If length is bigger than the original byte array, the resulting byte array is filled with zero bytes. |
34,657 | public AbstractMicroserviceClient ( String serviceName ) { this . serviceName = serviceName . toUpperCase ( ) ; } | Creates a list containing shuffled test and training instances and then recreates the training and test sets based on this list. |
34,658 | @ Override public boolean isVisible ( ) { return false ; } | This method is called after the layer is removed from the MapBean and when the projection changes. If the autoTimer is set, the timer is stopped. |
34,659 | protected List < MethodNode > findMethodsWithGenerated ( ClassNode receiver , String name ) { List < MethodNode > methods = receiver . getMethods ( name ) ; if ( methods . isEmpty ( ) || receiver . isResolved ( ) ) return methods ; List < MethodNode > result = addGeneratedMethods ( receiver , methods ) ; return result ; } | Displays all incomplete connections. |
34,660 | public static String buildString ( Consumer < StringPrinter > printer ) { StringBuilder builder = new StringBuilder ( ) ; printer . accept ( new StringPrinter ( null ) ) ; return builder . toString ( ) ; } | Checking if symbol is not eq to c |
34,661 | private boolean canAddVelocimacro ( String name , String sourceTemplate ) { if ( getAutoload ( ) ) { for ( int i = 0 ; i < macroLibVec . size ( ) ; i ++ ) { String lib = ( String ) macroLibVec . elementAt ( i ) ; if ( lib . equals ( sourceTemplate ) ) { return true ; } } } if ( ! addNewAllowed ) { logVMMessageWarn ( "Velocimacro : VM addition rejected : " + name + " : inline VMs not allowed." ) ; return false ; } if ( ! templateLocal ) { if ( isVelocimacro ( name , sourceTemplate ) && ! replaceAllowed ) { logVMMessageWarn ( "Velocimacro : VM addition rejected : " + name + " : inline not allowed to replace existing VM" ) ; return false ; } } return true ; } | Deprecated. Use static method sign2 intead. sign the contents of String. with the specified key and algorithm |
34,662 | public void initialize ( Callbacks callbacks ) { synchronized ( mLock ) { unbindItemInfosAndClearQueuedBindRunnables ( ) ; mCallbacks = new WeakReference < Callbacks > ( callbacks ) ; } } | Converts the specified markdown text to HTML. |
34,663 | public String removeOption ( String name ) { if ( options != null ) { ReplOption existingOption = null ; for ( ReplOption replOption : options ) { if ( name . equals ( replOption . getOptionName ( ) ) ) existingOption = replOption ; } if ( existingOption != null ) { options . remove ( existingOption ) ; return existingOption . getOptionValue ( ) ; } } return null ; } | Find a Page of Author using query by example. |
34,664 | public static String generatePop ( final ITranslationEnvironment environment , final long offset , final OperandSize size , final String target , final List < ReilInstruction > instructions ) throws IllegalArgumentException { Preconditions . checkNotNull ( environment , "Error: Argument environment can't be null" ) ; Preconditions . checkNotNull ( size , "Error: Argument size can't be null" ) ; Preconditions . checkNotNull ( instructions , "Error: Argument instructions can't be null" ) ; final OperandSize archSize = environment . getArchitectureSize ( ) ; final OperandSize resultSize = TranslationHelpers . getNextSize ( archSize ) ; final String loadedValue = target == null ? environment . getNextVariableString ( ) : target ; instructions . add ( ReilHelpers . createLdm ( offset , archSize , "esp" , size , loadedValue ) ) ; final String tempEsp = environment . getNextVariableString ( ) ; final String truncateMask = String . valueOf ( TranslationHelpers . getAllBitsMask ( archSize ) ) ; final String stackValue = String . valueOf ( size . getByteSize ( ) ) ; instructions . add ( ReilHelpers . createAdd ( offset + 1 , archSize , "esp" , archSize , stackValue , resultSize , tempEsp ) ) ; instructions . add ( ReilHelpers . createAnd ( offset + 2 , resultSize , tempEsp , archSize , truncateMask , archSize , "esp" ) ) ; return loadedValue ; } | Returns the a real UI to install on this text area. |
34,665 | public void loadStatus ( ) throws IOException , SolrCoreLoadException { String command = String . format ( "http://%s:%s/solr/admin/cores?action=STATUS&core=%s" , host , SolrInteractionUtils . DEFAULT_SOLR_PORT , name ) ; InputStream result = null ; try { result = SolrInteractionUtils . executeSolrCommandAndGetInputStream ( command ) ; List < String > data = SolrInteractionUtils . parseStatusResponse ( result , new String [ ] { String . format ( "/response/lst[@name='status']/lst[@name='%s']/lst[@name='index']/int[@name='numDocs']/text()" , name ) , String . format ( "/response/lst[@name='status']/lst[@name='%s']/lst[@name='index']/int[@name='maxDoc']/text()" , name ) , String . format ( "/response/lst[@name='status']/lst[@name='%s']/lst[@name='index']/int[@name='deletedDocs']/text()" , name ) , String . format ( "/response/lst[@name='status']/lst[@name='%s']/lst[@name='index']/long[@name='version']/text()" , name ) , String . format ( "/response/lst[@name='status']/lst[@name='%s']/lst[@name='index']/int[@name='segmentCount']/text()" , name ) , String . format ( "/response/lst[@name='status']/lst[@name='%s']/lst[@name='index']/date[@name='lastModified']/text()" , name ) , String . format ( "/response/lst[@name='status']/lst[@name='%s']/lst[@name='index']/long[@name='sizeInBytes']/text()" , name ) , String . format ( "/response/lst[@name='initFailures']/lst[@name='%s']/text()" , name ) , String . format ( "/response/lst[@name='status']/lst[@name='%s']/lst[@name='index']/bool[@name='current']/text()" , name ) } ) ; boolean isCleanCore = StringUtils . isBlank ( data . get ( 7 ) ) ; if ( ! isCleanCore ) { String message = String . format ( "Core %s has initialization exceptions.." , name ) ; logger . info ( message ) ; throw new SolrCoreLoadException ( message ) ; } numDocs = Integer . parseInt ( data . get ( 0 ) ) ; if ( ! StringUtils . isBlank ( data . get ( 1 ) ) ) { maxDocs = Integer . parseInt ( data . get ( 1 ) ) ; } deletedDocs = Integer . parseInt ( data . get ( 2 ) ) ; version = Long . parseLong ( data . get ( 3 ) ) ; if ( ! StringUtils . isBlank ( data . get ( 4 ) ) ) { segmentCount = Integer . parseInt ( data . get ( 4 ) ) ; } if ( ! StringUtils . isBlank ( data . get ( 5 ) ) ) { lastModified = data . get ( 5 ) ; } if ( ! StringUtils . isBlank ( data . get ( 6 ) ) ) { sizeInBytes = Long . parseLong ( data . get ( 6 ) ) ; } if ( ! StringUtils . isBlank ( data . get ( 8 ) ) ) { this . current = Boolean . parseBoolean ( data . get ( 8 ) ) ; } this . available = true ; } catch ( Exception e ) { throw new SolrCoreLoadException ( "Exception while trying to get core status for " + name ) ; } finally { if ( result != null ) { result . close ( ) ; } } } | This method is used to delete all rows from the timestamped table created by createTable() in CacheUtils class. |
34,666 | private String optNodeDigest ( ParseTreeNode node ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( '(' ) ; for ( ParseTreeNode child : node . children ( ) ) { nodeDigest ( child , sb ) ; if ( sb . length ( ) > longestKeyLength ) { return null ; } } nodeTail ( node , sb ) ; if ( sb . length ( ) > longestKeyLength ) { return null ; } return sb . toString ( ) ; } | Create a textual representation of a string literal that evaluates to the given value. |
34,667 | public Map < Span , SuffixArraySample > lookupFrequentSourceNgrams ( int sampleSize , int minOccurrences ) { if ( sampleSize >= minOccurrences ) throw new IllegalArgumentException ( ) ; if ( srcSuffixArray . length == 0 ) return Collections . emptyMap ( ) ; logger . info ( "Building query cache with threshold {}" , minOccurrences ) ; Map < Span , SuffixArraySample > queryCache = new HashMap < > ( 1000 ) ; int nCnt = 1 , nnCnt = 1 , nnnCnt = 1 ; int nStart = 0 , nnStart = 0 , nnnStart = 0 ; Suffix firstSuffix = new Suffix ( srcSuffixArray [ 0 ] , true ) ; Span nSpan = new Span ( firstSuffix , 1 ) , nnSpan = new Span ( firstSuffix , 2 ) , nnnSpan = new Span ( firstSuffix , 3 ) ; for ( int i = 1 ; i < srcSuffixArray . length ; ++ i ) { Suffix suffix = new Suffix ( srcSuffixArray [ i ] , true ) ; Span nSpanThis = new Span ( suffix , 1 ) ; Span nnSpanThis = new Span ( suffix , 2 ) ; Span nnnSpanThis = new Span ( suffix , 3 ) ; nCnt = checkSpan ( nSpan , nSpanThis , nStart , i , nCnt , minOccurrences , sampleSize , queryCache ) ; if ( nCnt == 1 ) { nStart = i ; nSpan = nSpanThis ; } nnCnt = checkSpan ( nnSpan , nnSpanThis , nnStart , i , nnCnt , minOccurrences , sampleSize , queryCache ) ; if ( nnCnt == 1 ) { nnStart = i ; nnSpan = nnSpanThis ; } nnnCnt = checkSpan ( nnnSpan , nnnSpanThis , nnnStart , i , nnnCnt , minOccurrences , sampleSize , queryCache ) ; if ( nnnCnt == 1 ) { nnnStart = i ; nnnSpan = nnnSpanThis ; } } ; logger . info ( "Query cache size: {}" , queryCache . size ( ) ) ; logger . info ( "Creating target unigram caches for the count() function..." ) ; this . tgtCountLBCache = new int [ vocabulary . size ( ) ] ; Arrays . fill ( tgtCountLBCache , - 1 ) ; this . tgtCountUBCache = new int [ vocabulary . size ( ) ] ; Arrays . fill ( tgtCountUBCache , - 1 ) ; int lastId = tgtBitext [ tgtSuffixArray [ 0 ] ] ; for ( int i = 0 ; i < tgtSuffixArray . length ; ++ i ) { int tgtId = tgtBitext [ tgtSuffixArray [ i ] ] ; assert tgtId >= 0 ; if ( tgtCountLBCache [ tgtId ] < 0 ) { tgtCountLBCache [ tgtId ] = i ; } if ( lastId != tgtId ) { tgtCountUBCache [ lastId ] = i - 1 ; assert tgtCountUBCache [ lastId ] >= tgtCountLBCache [ lastId ] : String . format ( "%d %d %d" , i , lastId , tgtId ) ; } lastId = tgtId ; } tgtCountUBCache [ lastId ] = tgtSuffixArray . length ; assert tgtCountUBCache [ lastId ] >= tgtCountLBCache [ lastId ] : String . format ( "%d %d final" , tgtSuffixArray . length , lastId ) ; logger . info ( "Finished building count() cache." ) ; return queryCache ; } | Accepts a listener that will be notified when content changes. |
34,668 | @ Override public void write ( byte [ ] b , int off , int len ) { if ( ( off < 0 ) || ( off > b . length ) || ( len < 0 ) || ( ( off + len ) > b . length ) || ( ( off + len ) < 0 ) ) { throw new IndexOutOfBoundsException ( ) ; } else if ( len == 0 ) { return ; } synchronized ( this ) { int newcount = count + len ; int remaining = len ; int inBufferPos = count - filledBufferSum ; while ( remaining > 0 ) { int part = Math . min ( remaining , currentBuffer . length - inBufferPos ) ; System . arraycopy ( b , off + len - remaining , currentBuffer , inBufferPos , part ) ; remaining -= part ; if ( remaining > 0 ) { needNewBuffer ( newcount ) ; inBufferPos = 0 ; } } count = newcount ; } } | Insert the reported position into the array using the seqno for ordering. |
34,669 | public static void copy ( String in , Writer out ) throws IOException { Assert . notNull ( in , "No input String specified" ) ; Assert . notNull ( out , "No Writer specified" ) ; try { out . write ( in ) ; } finally { try { out . close ( ) ; } catch ( IOException ex ) { } } } | Initializes this line with the specified search result. |
34,670 | public static String convertByte2HexString ( byte b ) { char u8 = convertByte2Uint8 ( b ) ; return Integer . toHexString ( u8 ) ; } | Print documentation comment, if it exists |
34,671 | @ Override protected void deviceDrawLine ( int xBegin , int yBegin , int xEnd , int yEnd , Color color ) { Stroke stroke = getStroke ( ) ; if ( stroke instanceof BasicStroke ) { BasicStroke lineStroke = ( BasicStroke ) stroke ; if ( lineStroke . getDashArray ( ) != null ) { draw ( new Line2D . Float ( xBegin , yBegin , xEnd , yEnd ) ) ; return ; } float lineWidth = lineStroke . getLineWidth ( ) ; Point2D . Float penSize = new Point2D . Float ( lineWidth , lineWidth ) ; AffineTransform deviceTransform = getTransform ( ) ; deviceTransform . deltaTransform ( penSize , penSize ) ; float deviceLineWidth = Math . min ( Math . abs ( penSize . x ) , Math . abs ( penSize . y ) ) ; Point2D . Float begin_pos = new Point2D . Float ( xBegin , yBegin ) ; deviceTransform . transform ( begin_pos , begin_pos ) ; Point2D . Float end_pos = new Point2D . Float ( xEnd , yEnd ) ; deviceTransform . transform ( end_pos , end_pos ) ; int endCap = lineStroke . getEndCap ( ) ; int lineJoin = lineStroke . getLineJoin ( ) ; if ( ( end_pos . getX ( ) == begin_pos . getX ( ) ) && ( end_pos . getY ( ) == begin_pos . getY ( ) ) ) { endCap = BasicStroke . CAP_ROUND ; } WPrinterJob wPrinterJob = ( WPrinterJob ) getPrinterJob ( ) ; if ( wPrinterJob . selectStylePen ( endCap , lineJoin , deviceLineWidth , color ) ) { wPrinterJob . moveTo ( ( float ) begin_pos . getX ( ) , ( float ) begin_pos . getY ( ) ) ; wPrinterJob . lineTo ( ( float ) end_pos . getX ( ) , ( float ) end_pos . getY ( ) ) ; } else { double lowerRes = Math . min ( wPrinterJob . getXRes ( ) , wPrinterJob . getYRes ( ) ) ; if ( ( endCap == BasicStroke . CAP_ROUND ) || ( ( ( xBegin == xEnd ) || ( yBegin == yEnd ) ) && ( deviceLineWidth / lowerRes < MAX_THINLINE_INCHES ) ) ) { wPrinterJob . selectPen ( deviceLineWidth , color ) ; wPrinterJob . moveTo ( ( float ) begin_pos . getX ( ) , ( float ) begin_pos . getY ( ) ) ; wPrinterJob . lineTo ( ( float ) end_pos . getX ( ) , ( float ) end_pos . getY ( ) ) ; } else { draw ( new Line2D . Float ( xBegin , yBegin , xEnd , yEnd ) ) ; } } } } | Check all online servers are health & remove dead online servers |
34,672 | public void seek ( long seekBytes ) throws FileNotFoundException , IOException , InterruptedException { try { if ( fileInput != null ) { fileInput . close ( ) ; } fileInput = new FileInputStream ( file ) ; fileChannel = fileInput . getChannel ( ) ; fileChannel . position ( seekBytes ) ; } catch ( ClosedByInterruptException e ) { throw new InterruptedException ( ) ; } bufferedInput = new BufferedInputStream ( fileInput , size ) ; dataInput = new DataInputStream ( bufferedInput ) ; offset = seekBytes ; markOffset = - 1 ; available ( ) ; } | creates a single xml node and return that node. |
34,673 | public NumberRangeModel ( Number lo , Number hi , Number min , Number max ) { m_type = TypeLib . getPrimitiveType ( min . getClass ( ) ) ; setValueRange ( lo , hi , min , max ) ; } | Save the document as a KML file |
34,674 | public static void printNode ( Node node , OutputStream out ) throws IOException { printNode ( node , new StreamResult ( out ) ) ; out . write ( '\n' ) ; out . flush ( ) ; } | SealedObject(Serializable object, Cipher c) method testing. Tests if the NullPointerException is thrown in the case of null cipher. |
34,675 | public void actionPerformed ( ActionEvent e ) { if ( EDIT . equals ( e . getActionCommand ( ) ) ) { button . setBackground ( currentColor ) ; colorChooser . setColor ( currentColor ) ; dialog . setVisible ( true ) ; fireEditingStopped ( ) ; } else { currentColor = colorChooser . getColor ( ) ; } } | Interrogate std out files. |
34,676 | @ Override public double cos ( int step ) { step = Math . abs ( step ) % steps ; if ( step < costable . length ) { return costable [ step ] ; } if ( step > halfsteps ) { step = steps - step ; if ( step < costable . length ) { return costable [ step ] ; } } step = halfsteps - step ; return - costable [ step ] ; } | Check if uri represents local file |
34,677 | public void addClickingListener ( OnWheelClickedListener listener ) { clickingListeners . add ( listener ) ; } | Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). |
34,678 | public static Place createPlace ( final String rawJSON ) throws TwitterException { try { final JSONObject json = new JSONObject ( rawJSON ) ; return placeConstructor . newInstance ( json ) ; } catch ( final InstantiationException e ) { throw new TwitterException ( e ) ; } catch ( final IllegalAccessException e ) { throw new AssertionError ( e ) ; } catch ( final InvocationTargetException e ) { throw new TwitterException ( e ) ; } catch ( final JSONException e ) { throw new TwitterException ( e ) ; } } | Gets base directories to discover classpath elements in. |
34,679 | private static DatabaseFieldConfig buildConfig ( DatabaseField databaseField , String tableName , Field field ) throws Exception { InvocationHandler proxy = Proxy . getInvocationHandler ( databaseField ) ; if ( proxy . getClass ( ) != annotationFactoryClazz ) { return null ; } Object elementsObject = elementsField . get ( proxy ) ; if ( elementsObject == null ) { return null ; } DatabaseFieldConfig config = new DatabaseFieldConfig ( field . getName ( ) ) ; Object [ ] objs = ( Object [ ] ) elementsObject ; for ( int i = 0 ; i < configFieldNums . length ; i ++ ) { Object value = valueField . get ( objs [ i ] ) ; if ( value != null ) { assignConfigField ( configFieldNums [ i ] , config , field , value ) ; } } return config ; } | Test fails: clearparameters should be implemented with Stmt.reset() |
34,680 | protected final void fireIndexedPropertyChange ( String propertyName , int index , Object oldValue , Object newValue ) { PropertyChangeSupport aChangeSupport = this . changeSupport ; if ( aChangeSupport == null ) { return ; } aChangeSupport . fireIndexedPropertyChange ( propertyName , index , oldValue , newValue ) ; } | Subtract two positive numbers of different length. The first is longer. |
34,681 | public void testConstrStringWithExponentWithPoint3 ( ) { String a = "2380964839238475457356735674573563567890.295784902768787678287E+21" ; int aScale = 0 ; BigInteger bA = new BigInteger ( "2380964839238475457356735674573563567890295784902768787678287" ) ; BigDecimal aNumber = new BigDecimal ( a ) ; assertEquals ( "incorrect value" , bA , aNumber . unscaledValue ( ) ) ; assertEquals ( "incorrect scale" , aScale , aNumber . scale ( ) ) ; } | Writes the contents of this CacheHeader to the specified OutputStream. |
34,682 | public static int geometric ( double p ) { return ( int ) Math . ceil ( Math . log ( uniform ( ) ) / Math . log ( 1.0 - p ) ) ; } | Demux single-dimension array (x[]) to a multi-dimension array (x[][][]) |
34,683 | @ Override public Object clone ( ) throws CloneNotSupportedException { SegmentedTimeline clone = ( SegmentedTimeline ) super . clone ( ) ; return clone ; } | Create new entity instance from database raw instance. |
34,684 | public boolean addItemUnique ( Playlist p ) { if ( ! mPlaylists . contains ( p ) ) { mPlaylists . add ( p ) ; return true ; } else { return false ; } } | Creates and enqueues node for current thread and given mode. |
34,685 | private void showFindReplaceDialog ( ) { JFrame frame = new JFrame ( ) ; FindReplaceDialog dialog = new FindReplaceDialog ( frame , this ) ; frame . setContentPane ( dialog ) ; frame . setTitle ( "Find / Replace" ) ; frame . setVisible ( true ) ; frame . pack ( ) ; frame . setLocationRelativeTo ( null ) ; } | Writes message to the socket. |
34,686 | public void clickByImage ( String targetImgPath ) { Point2D coords = getCoords ( takeScreenshot ( ) , targetImgPath ) ; if ( ( coords . getX ( ) >= 0 ) && ( coords . getY ( ) >= 0 ) ) { driver . tap ( 1 , ( int ) coords . getX ( ) , ( int ) coords . getY ( ) , 100 ) ; } else { throw new ElementNotVisibleException ( "Element not found - " + targetImgPath ) ; } } | Tag sequence MetaData, Video config, Audio config, remaining audio and video Packet prefixes: 17 00 00 00 00 = Video extra data (first video packet) 17 01 00 00 00 = Video keyframe 27 01 00 00 00 = Video interframe af 00 ... 06 = Audio extra data (first audio packet) af 01 = Audio frame Audio extra data(s): af 00 = Prefix 11 90 4f 14 = AAC Main = aottype 0 12 10 = AAC LC = aottype 1 13 90 56 e5 a5 48 00 = HE-AAC SBR = aottype 2 06 = Suffix Still not absolutely certain about this order or the bytes - need to verify later |
34,687 | public static double round ( double number ) { return ( double ) Math . round ( number * Math . pow ( 10 , 0 ) ) / Math . pow ( 10 , 0 ) ; } | Initializes all regions & its subregions using the Cache MBean and the RegionSubRegionSnapshot for this cache MBean. |
34,688 | void write ( Environment env , DataOutputStream out , ConstantPool tab ) throws IOException { out . writeByte ( CONSTANT_UTF8 ) ; out . writeUTF ( str ) ; } | Generates an invokedynamic instruction. |
34,689 | public JPopupMenu createNetworkContextMenu ( ) { JPopupMenu contextMenu = super . createNetworkContextMenu ( ) ; contextMenu . addSeparator ( ) ; contextMenu . add ( NetworkScriptMenu . getNetworkScriptMenu ( this ) ) ; return contextMenu ; } | 'properties' is not required subtag |
34,690 | @ Override public Object clone ( ) { try { return super . clone ( ) ; } catch ( CloneNotSupportedException e ) { throw new RuntimeException ( e . getMessage ( ) ) ; } } | Returns true if the named connection can be made at this time |
34,691 | public void pushStylesheet ( Stylesheet s ) { if ( m_stylesheets . size ( ) == 0 ) m_stylesheetRoot = ( StylesheetRoot ) s ; m_stylesheets . push ( s ) ; } | Draws an outline of the given circle starting from the top left to the width and height. <p/> This method will use the minimum of the width and height for the diameter of the circle. <p/> This method is useful for drawing a circle within a bounding box. |
34,692 | public Object next ( ) throws IOException { if ( prevPos <= 0 ) return null ; long endOfThisRecord = prevPos ; int thisLength = nextLength ; long recordStart = prevPos - thisLength ; prevPos = recordStart - 4 ; if ( prevPos <= 0 ) return null ; long bufferPos = fis . getBufferPos ( ) ; if ( prevPos >= bufferPos ) { } else { long seekPos = endOfThisRecord - fis . getBufferSize ( ) ; seekPos = Math . min ( seekPos , prevPos ) ; seekPos = Math . max ( seekPos , 0 ) ; fis . seek ( seekPos ) ; fis . peek ( ) ; } fis . seek ( prevPos ) ; nextLength = fis . readInt ( ) ; Object o = codec . readVal ( fis ) ; return o ; } | Replaces unprintable characters by their espaced (or unicode escaped) equivalents in the given string |
34,693 | public Element drawShape ( int x , int y , int w , int h , Map < String , Object > style ) { String fillColor = mxUtils . getString ( style , mxConstants . STYLE_FILLCOLOR , "none" ) ; String strokeColor = mxUtils . getString ( style , mxConstants . STYLE_STROKECOLOR ) ; float strokeWidth = ( float ) ( mxUtils . getFloat ( style , mxConstants . STYLE_STROKEWIDTH , 1 ) * scale ) ; String shape = mxUtils . getString ( style , mxConstants . STYLE_SHAPE ) ; Element elem = null ; Element background = null ; if ( shape . equals ( mxConstants . SHAPE_IMAGE ) ) { String img = getImageForStyle ( style ) ; if ( img != null ) { elem = document . createElement ( "image" ) ; elem . setAttribute ( "x" , String . valueOf ( x ) ) ; elem . setAttribute ( "y" , String . valueOf ( y ) ) ; elem . setAttribute ( "width" , String . valueOf ( w ) ) ; elem . setAttribute ( "height" , String . valueOf ( h ) ) ; elem . setAttributeNS ( mxConstants . NS_XLINK , "xlink:href" , img ) ; } } else if ( shape . equals ( mxConstants . SHAPE_LINE ) ) { String direction = mxUtils . getString ( style , mxConstants . STYLE_DIRECTION , mxConstants . DIRECTION_EAST ) ; String d = null ; if ( direction . equals ( mxConstants . DIRECTION_EAST ) || direction . equals ( mxConstants . DIRECTION_WEST ) ) { int mid = ( int ) ( y + h / 2 ) ; d = "M " + x + " " + mid + " L " + ( x + w ) + " " + mid ; } else { int mid = ( int ) ( x + w / 2 ) ; d = "M " + mid + " " + y + " L " + mid + " " + ( y + h ) ; } elem = document . createElement ( "path" ) ; elem . setAttribute ( "d" , d + " Z" ) ; } else if ( shape . equals ( mxConstants . SHAPE_ELLIPSE ) ) { elem = document . createElement ( "ellipse" ) ; elem . setAttribute ( "cx" , String . valueOf ( x + w / 2 ) ) ; elem . setAttribute ( "cy" , String . valueOf ( y + h / 2 ) ) ; elem . setAttribute ( "rx" , String . valueOf ( w / 2 ) ) ; elem . setAttribute ( "ry" , String . valueOf ( h / 2 ) ) ; } else if ( shape . equals ( mxConstants . SHAPE_DOUBLE_ELLIPSE ) ) { elem = document . createElement ( "g" ) ; background = document . createElement ( "ellipse" ) ; background . setAttribute ( "cx" , String . valueOf ( x + w / 2 ) ) ; background . setAttribute ( "cy" , String . valueOf ( y + h / 2 ) ) ; background . setAttribute ( "rx" , String . valueOf ( w / 2 ) ) ; background . setAttribute ( "ry" , String . valueOf ( h / 2 ) ) ; elem . appendChild ( background ) ; int inset = ( int ) ( ( 3 + strokeWidth ) * scale ) ; Element foreground = document . createElement ( "ellipse" ) ; foreground . setAttribute ( "fill" , "none" ) ; foreground . setAttribute ( "stroke" , strokeColor ) ; foreground . setAttribute ( "stroke-width" , String . valueOf ( strokeWidth ) ) ; foreground . setAttribute ( "cx" , String . valueOf ( x + w / 2 ) ) ; foreground . setAttribute ( "cy" , String . valueOf ( y + h / 2 ) ) ; foreground . setAttribute ( "rx" , String . valueOf ( w / 2 - inset ) ) ; foreground . setAttribute ( "ry" , String . valueOf ( h / 2 - inset ) ) ; elem . appendChild ( foreground ) ; } else if ( shape . equals ( mxConstants . SHAPE_RHOMBUS ) ) { elem = document . createElement ( "path" ) ; String d = "M " + ( x + w / 2 ) + " " + y + " L " + ( x + w ) + " " + ( y + h / 2 ) + " L " + ( x + w / 2 ) + " " + ( y + h ) + " L " + x + " " + ( y + h / 2 ) ; elem . setAttribute ( "d" , d + " Z" ) ; } else if ( shape . equals ( mxConstants . SHAPE_TRIANGLE ) ) { elem = document . createElement ( "path" ) ; String direction = mxUtils . getString ( style , mxConstants . STYLE_DIRECTION , "" ) ; String d = null ; if ( direction . equals ( mxConstants . DIRECTION_NORTH ) ) { d = "M " + x + " " + ( y + h ) + " L " + ( x + w / 2 ) + " " + y + " L " + ( x + w ) + " " + ( y + h ) ; } else if ( direction . equals ( mxConstants . DIRECTION_SOUTH ) ) { d = "M " + x + " " + y + " L " + ( x + w / 2 ) + " " + ( y + h ) + " L " + ( x + w ) + " " + y ; } else if ( direction . equals ( mxConstants . DIRECTION_WEST ) ) { d = "M " + ( x + w ) + " " + y + " L " + x + " " + ( y + h / 2 ) + " L " + ( x + w ) + " " + ( y + h ) ; } else { d = "M " + x + " " + y + " L " + ( x + w ) + " " + ( y + h / 2 ) + " L " + x + " " + ( y + h ) ; } elem . setAttribute ( "d" , d + " Z" ) ; } else if ( shape . equals ( mxConstants . SHAPE_HEXAGON ) ) { elem = document . createElement ( "path" ) ; String direction = mxUtils . getString ( style , mxConstants . STYLE_DIRECTION , "" ) ; String d = null ; if ( direction . equals ( mxConstants . DIRECTION_NORTH ) || direction . equals ( mxConstants . DIRECTION_SOUTH ) ) { d = "M " + ( x + 0.5 * w ) + " " + y + " L " + ( x + w ) + " " + ( y + 0.25 * h ) + " L " + ( x + w ) + " " + ( y + 0.75 * h ) + " L " + ( x + 0.5 * w ) + " " + ( y + h ) + " L " + x + " " + ( y + 0.75 * h ) + " L " + x + " " + ( y + 0.25 * h ) ; } else { d = "M " + ( x + 0.25 * w ) + " " + y + " L " + ( x + 0.75 * w ) + " " + y + " L " + ( x + w ) + " " + ( y + 0.5 * h ) + " L " + ( x + 0.75 * w ) + " " + ( y + h ) + " L " + ( x + 0.25 * w ) + " " + ( y + h ) + " L " + x + " " + ( y + 0.5 * h ) ; } elem . setAttribute ( "d" , d + " Z" ) ; } else if ( shape . equals ( mxConstants . SHAPE_CLOUD ) ) { elem = document . createElement ( "path" ) ; String d = "M " + ( x + 0.25 * w ) + " " + ( y + 0.25 * h ) + " C " + ( x + 0.05 * w ) + " " + ( y + 0.25 * h ) + " " + x + " " + ( y + 0.5 * h ) + " " + ( x + 0.16 * w ) + " " + ( y + 0.55 * h ) + " C " + x + " " + ( y + 0.66 * h ) + " " + ( x + 0.18 * w ) + " " + ( y + 0.9 * h ) + " " + ( x + 0.31 * w ) + " " + ( y + 0.8 * h ) + " C " + ( x + 0.4 * w ) + " " + ( y + h ) + " " + ( x + 0.7 * w ) + " " + ( y + h ) + " " + ( x + 0.8 * w ) + " " + ( y + 0.8 * h ) + " C " + ( x + w ) + " " + ( y + 0.8 * h ) + " " + ( x + w ) + " " + ( y + 0.6 * h ) + " " + ( x + 0.875 * w ) + " " + ( y + 0.5 * h ) + " C " + ( x + w ) + " " + ( y + 0.3 * h ) + " " + ( x + 0.8 * w ) + " " + ( y + 0.1 * h ) + " " + ( x + 0.625 * w ) + " " + ( y + 0.2 * h ) + " C " + ( x + 0.5 * w ) + " " + ( y + 0.05 * h ) + " " + ( x + 0.3 * w ) + " " + ( y + 0.05 * h ) + " " + ( x + 0.25 * w ) + " " + ( y + 0.25 * h ) ; elem . setAttribute ( "d" , d + " Z" ) ; } else if ( shape . equals ( mxConstants . SHAPE_ACTOR ) ) { elem = document . createElement ( "path" ) ; double width3 = w / 3 ; String d = " M " + x + " " + ( y + h ) + " C " + x + " " + ( y + 3 * h / 5 ) + " " + x + " " + ( y + 2 * h / 5 ) + " " + ( x + w / 2 ) + " " + ( y + 2 * h / 5 ) + " C " + ( x + w / 2 - width3 ) + " " + ( y + 2 * h / 5 ) + " " + ( x + w / 2 - width3 ) + " " + y + " " + ( x + w / 2 ) + " " + y + " C " + ( x + w / 2 + width3 ) + " " + y + " " + ( x + w / 2 + width3 ) + " " + ( y + 2 * h / 5 ) + " " + ( x + w / 2 ) + " " + ( y + 2 * h / 5 ) + " C " + ( x + w ) + " " + ( y + 2 * h / 5 ) + " " + ( x + w ) + " " + ( y + 3 * h / 5 ) + " " + ( x + w ) + " " + ( y + h ) ; elem . setAttribute ( "d" , d + " Z" ) ; } else if ( shape . equals ( mxConstants . SHAPE_CYLINDER ) ) { elem = document . createElement ( "g" ) ; background = document . createElement ( "path" ) ; double dy = Math . min ( 40 , Math . floor ( h / 5 ) ) ; String d = " M " + x + " " + ( y + dy ) + " C " + x + " " + ( y - dy / 3 ) + " " + ( x + w ) + " " + ( y - dy / 3 ) + " " + ( x + w ) + " " + ( y + dy ) + " L " + ( x + w ) + " " + ( y + h - dy ) + " C " + ( x + w ) + " " + ( y + h + dy / 3 ) + " " + x + " " + ( y + h + dy / 3 ) + " " + x + " " + ( y + h - dy ) ; background . setAttribute ( "d" , d + " Z" ) ; elem . appendChild ( background ) ; Element foreground = document . createElement ( "path" ) ; d = "M " + x + " " + ( y + dy ) + " C " + x + " " + ( y + 2 * dy ) + " " + ( x + w ) + " " + ( y + 2 * dy ) + " " + ( x + w ) + " " + ( y + dy ) ; foreground . setAttribute ( "d" , d ) ; foreground . setAttribute ( "fill" , "none" ) ; foreground . setAttribute ( "stroke" , strokeColor ) ; foreground . setAttribute ( "stroke-width" , String . valueOf ( strokeWidth ) ) ; elem . appendChild ( foreground ) ; } else { elem = document . createElement ( "rect" ) ; elem . setAttribute ( "x" , String . valueOf ( x ) ) ; elem . setAttribute ( "y" , String . valueOf ( y ) ) ; elem . setAttribute ( "width" , String . valueOf ( w ) ) ; elem . setAttribute ( "height" , String . valueOf ( h ) ) ; if ( mxUtils . isTrue ( style , mxConstants . STYLE_ROUNDED , false ) ) { elem . setAttribute ( "rx" , String . valueOf ( w * mxConstants . RECTANGLE_ROUNDING_FACTOR ) ) ; elem . setAttribute ( "ry" , String . valueOf ( h * mxConstants . RECTANGLE_ROUNDING_FACTOR ) ) ; } } Element bg = background ; if ( bg == null ) { bg = elem ; } bg . setAttribute ( "fill" , fillColor ) ; bg . setAttribute ( "stroke" , strokeColor ) ; bg . setAttribute ( "stroke-width" , String . valueOf ( strokeWidth ) ) ; Element shadowElement = null ; if ( mxUtils . isTrue ( style , mxConstants . STYLE_SHADOW , false ) && ! fillColor . equals ( "none" ) ) { shadowElement = ( Element ) bg . cloneNode ( true ) ; shadowElement . setAttribute ( "transform" , mxConstants . SVG_SHADOWTRANSFORM ) ; shadowElement . setAttribute ( "fill" , mxConstants . W3C_SHADOWCOLOR ) ; shadowElement . setAttribute ( "stroke" , mxConstants . W3C_SHADOWCOLOR ) ; shadowElement . setAttribute ( "stroke-width" , String . valueOf ( strokeWidth ) ) ; appendSvgElement ( shadowElement ) ; } double rotation = mxUtils . getDouble ( style , mxConstants . STYLE_ROTATION ) ; if ( rotation != 0 ) { int cx = x + w / 2 ; int cy = y + h / 2 ; elem . setAttribute ( "transform" , "rotate(" + rotation + "," + cx + "," + cy + ")" ) ; if ( shadowElement != null ) { shadowElement . setAttribute ( "transform" , "rotate(" + rotation + "," + cx + "," + cy + ") " + mxConstants . SVG_SHADOWTRANSFORM ) ; } } float opacity = mxUtils . getFloat ( style , mxConstants . STYLE_OPACITY , 100 ) ; if ( opacity != 100 ) { String value = String . valueOf ( opacity / 100 ) ; elem . setAttribute ( "fill-opacity" , value ) ; elem . setAttribute ( "stroke-opacity" , value ) ; if ( shadowElement != null ) { shadowElement . setAttribute ( "fill-opacity" , value ) ; shadowElement . setAttribute ( "stroke-opacity" , value ) ; } } appendSvgElement ( elem ) ; return elem ; } | Converts a collection to an array of strings. |
34,694 | private int estimateDist ( AreaPanel ap1 , AreaPanel ap2 ) { int yDist = Math . abs ( ap1 . getCenterY ( ) - ap2 . getCenterY ( ) ) ; int xDist = Math . abs ( ap1 . getCenterX ( ) - ap2 . getCenterX ( ) ) ; if ( xDist < ( yDist > > 1 ) || yDist < ( xDist > > 1 ) ) return xDist + yDist ; return ( int ) ( ( xDist + yDist ) * 7l / 10 ) ; } | Writes a byte (8 bit) to the target stream. |
34,695 | private void checkNotEqual ( UnknownFieldSet s1 , UnknownFieldSet s2 ) { String equalsError = String . format ( "%s should not be equal to %s" , s1 , s2 ) ; assertFalse ( equalsError , s1 . equals ( s2 ) ) ; assertFalse ( equalsError , s2 . equals ( s1 ) ) ; assertFalse ( String . format ( "%s should have a different hash code from %s" , s1 , s2 ) , s1 . hashCode ( ) == s2 . hashCode ( ) ) ; } | GZip compress a string of bytes |
34,696 | synchronized void discardQueue ( ) { queue . removeAllElements ( ) ; for ( Enumeration e = running . elements ( ) ; e . hasMoreElements ( ) ; ) { ResourceThread t = ( ResourceThread ) e . nextElement ( ) ; t . cancel ( ) ; } running . removeAllElements ( ) ; bgImageCompsSelected . removeAllElements ( ) ; bgImageCompsUnselected . removeAllElements ( ) ; bgImageCompsPressed . removeAllElements ( ) ; threadCount = 0 ; cssCount = - 1 ; started = false ; } | The variables here are used only to determine which columns are discrete and which are continuous; bounds checking is not done. |
34,697 | private Set < String > loadFile ( String fileName ) throws IOException { Set < String > container = new HashSet < String > ( ) ; FileInputStream fstream = null ; DataInputStream in = null ; BufferedReader br = null ; try { fstream = new FileInputStream ( fileName ) ; in = new DataInputStream ( fstream ) ; br = new BufferedReader ( new InputStreamReader ( in ) ) ; String strLine ; while ( ( strLine = br . readLine ( ) ) != null ) { container . add ( strLine ) ; } } finally { if ( br != null ) { br . close ( ) ; } if ( in != null ) { in . close ( ) ; } if ( fstream != null ) { fstream . close ( ) ; } } return container ; } | Finds the offset info for a local date-time and transition. |
34,698 | public void testConstructorStringRadix16 ( ) { String value = "fe2340a8b5ce790" ; int radix = 16 ; byte rBytes [ ] = { 15 , - 30 , 52 , 10 , - 117 , 92 , - 25 , - 112 } ; BigInteger aNumber = new BigInteger ( value , radix ) ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = aNumber . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( "incorrect sign" , 1 , aNumber . signum ( ) ) ; } | Write a line of values to the file |
34,699 | public static String toString ( int M_ [ ] [ ] ) { StringBuilder sb = new StringBuilder ( ) ; for ( int j = 0 ; j < M_ . length ; j ++ ) { for ( int k = 0 ; k < M_ [ j ] . length ; k ++ ) { String num = String . format ( "%5d" , M_ [ j ] [ k ] ) ; sb . append ( num ) ; } sb . append ( "\n" ) ; } return sb . toString ( ) ; } | Formats a number into the specified string buffer. |