idx
int64
0
34.9k
question
stringlengths
12
26.4k
target
stringlengths
15
2.15k
34,800
protected void drawItemLabel ( Graphics2D g2 , PlotOrientation orientation , CategoryDataset dataset , int row , int column , double x , double y , boolean negative ) { CategoryItemLabelGenerator generator = getItemLabelGenerator ( row , column ) ; if ( generator != null ) { Font labelFont = getItemLabelFont ( row , column ) ; Paint paint = getItemLabelPaint ( row , column ) ; g2 . setFont ( labelFont ) ; g2 . setPaint ( paint ) ; String label = generator . generateLabel ( dataset , row , column ) ; ItemLabelPosition position ; if ( ! negative ) { position = getPositiveItemLabelPosition ( row , column ) ; } else { position = getNegativeItemLabelPosition ( row , column ) ; } Point2D anchorPoint = calculateLabelAnchorPoint ( position . getItemLabelAnchor ( ) , x , y , orientation ) ; TextUtilities . drawRotatedString ( label , g2 , ( float ) anchorPoint . getX ( ) , ( float ) anchorPoint . getY ( ) , position . getTextAnchor ( ) , position . getAngle ( ) , position . getRotationAnchor ( ) ) ; } }
Write the preferences to the specified OutputStream using the preference list syntax. Preference expressions are written in the following order: Complete name expressions Package expressions Namespace expressions
34,801
private void register ( String key , Object value ) throws SAXException { if ( key != null ) { if ( _mapping . get ( key ) != null || ( _handler != null && _handler . hasVariable ( key ) ) ) { throw new SAXException ( "ID " + key + " is already defined" ) ; } if ( _handler != null ) { _handler . setVariable ( key , value ) ; } else { _mapping . put ( key , value ) ; } } }
Compares this name with another, for equality.
34,802
protected BusinessObjectDataDdlCollectionResponse generateBusinessObjectDataDdlCollectionImpl ( BusinessObjectDataDdlCollectionRequest businessObjectDataDdlCollectionRequest ) { validateBusinessObjectDataDdlCollectionRequest ( businessObjectDataDdlCollectionRequest ) ; BusinessObjectDataDdlCollectionResponse businessObjectDataDdlCollectionResponse = new BusinessObjectDataDdlCollectionResponse ( ) ; List < BusinessObjectDataDdl > businessObjectDataDdlResponses = new ArrayList < > ( ) ; businessObjectDataDdlCollectionResponse . setBusinessObjectDataDdlResponses ( businessObjectDataDdlResponses ) ; List < String > ddls = new ArrayList < > ( ) ; for ( BusinessObjectDataDdlRequest request : businessObjectDataDdlCollectionRequest . getBusinessObjectDataDdlRequests ( ) ) { BusinessObjectDataDdl businessObjectDataDdl = generateBusinessObjectDataDdlImpl ( request , true ) ; businessObjectDataDdlResponses . add ( businessObjectDataDdl ) ; ddls . add ( businessObjectDataDdl . getDdl ( ) ) ; } businessObjectDataDdlCollectionResponse . setDdlCollection ( StringUtils . join ( ddls , "\n\n" ) ) ; return businessObjectDataDdlCollectionResponse ; }
Runs the test case.
34,803
public void test_checksum03 ( ) { byte [ ] data = new byte [ 100 ] ; r . nextBytes ( data ) ; ByteBuffer buf = ByteBuffer . wrap ( data ) ; buf . limit ( 20 ) ; buf . position ( 9 ) ; buf . mark ( ) ; buf . position ( 12 ) ; chk . checksum ( buf , 0 , data . length ) ; assertEquals ( 20 , buf . limit ( ) ) ; assertEquals ( 12 , buf . position ( ) ) ; buf . reset ( ) ; assertEquals ( 9 , buf . position ( ) ) ; }
Deserialize the DLSN from bytes array.
34,804
public boolean isNamespaceRepairingMode ( ) { return namespaceRepairingMode ; }
Determines which cached workspace (if any) matches the workspace command line option, or the free arguments, or the current directory (in that order). Throws if no match is found. Only cached workspaces that reside on the current computer can match.
34,805
public void addSipEventListener ( SipEventListener listener ) { mListeners . add ( listener ) ; }
Convenience method for building the error messages during discover.
34,806
private static String escapeJSON ( String text ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( '"' ) ; for ( int index = 0 ; index < text . length ( ) ; index ++ ) { char chr = text . charAt ( index ) ; switch ( chr ) { case '"' : case '\\' : builder . append ( '\\' ) ; builder . append ( chr ) ; break ; case '\b' : builder . append ( "\\b" ) ; break ; case '\t' : builder . append ( "\\t" ) ; break ; case '\n' : builder . append ( "\\n" ) ; break ; case '\r' : builder . append ( "\\r" ) ; break ; default : if ( chr < ' ' ) { String t = "000" + Integer . toHexString ( chr ) ; builder . append ( "\\u" + t . substring ( t . length ( ) - 4 ) ) ; } else { builder . append ( chr ) ; } break ; } } builder . append ( '"' ) ; return builder . toString ( ) ; }
Trim whitespaces from the left.
34,807
public PMElement elementAt ( int i ) { return gr . elementAt ( i ) ; }
Flush any buffered messages.
34,808
public static List < BlockNode > collectBlocksDominatedBy ( BlockNode dominator , BlockNode start ) { List < BlockNode > result = new ArrayList < BlockNode > ( ) ; collectWhileDominates ( dominator , start , result ) ; return result ; }
Calculates CRC from a string.
34,809
public static DbfTableModel createDefaultModel ( EsriGraphicList list ) { if ( logger . isLoggable ( Level . FINE ) ) logger . fine ( "ESE: creating DbfTableModel" ) ; DbfTableModel _model = new DbfTableModel ( 7 ) ; _model . setLength ( 0 , ( byte ) 50 ) ; _model . setColumnName ( 0 , SHAPE_DBF_DESCRIPTION ) ; _model . setType ( 0 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 0 , ( byte ) 0 ) ; _model . setLength ( 1 , ( byte ) 10 ) ; _model . setColumnName ( 1 , SHAPE_DBF_LINECOLOR ) ; _model . setType ( 1 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 1 , ( byte ) 0 ) ; _model . setLength ( 2 , ( byte ) 10 ) ; _model . setColumnName ( 2 , SHAPE_DBF_FILLCOLOR ) ; _model . setType ( 2 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 2 , ( byte ) 0 ) ; _model . setLength ( 3 , ( byte ) 10 ) ; _model . setColumnName ( 3 , SHAPE_DBF_SELECTCOLOR ) ; _model . setType ( 3 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 3 , ( byte ) 0 ) ; _model . setLength ( 4 , ( byte ) 4 ) ; _model . setColumnName ( 4 , SHAPE_DBF_LINEWIDTH ) ; _model . setType ( 4 , ( byte ) DbfTableModel . TYPE_NUMERIC ) ; _model . setDecimalCount ( 4 , ( byte ) 0 ) ; _model . setLength ( 5 , ( byte ) 20 ) ; _model . setColumnName ( 5 , SHAPE_DBF_DASHPATTERN ) ; _model . setType ( 5 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; _model . setDecimalCount ( 5 , ( byte ) 0 ) ; _model . setLength ( 6 , ( byte ) 10 ) ; _model . setColumnName ( 6 , SHAPE_DBF_DASHPHASE ) ; _model . setType ( 6 , ( byte ) DbfTableModel . TYPE_NUMERIC ) ; _model . setDecimalCount ( 6 , ( byte ) 4 ) ; int count = 0 ; for ( OMGraphic omg : list ) { Object index = omg . getAttribute ( SHAPE_INDEX_ATTRIBUTE ) ; if ( index == null ) { index = new Integer ( count ) ; omg . putAttribute ( SHAPE_INDEX_ATTRIBUTE , index ) ; } count ++ ; List < Object > record = new ArrayList < Object > ( ) ; Object obj = omg . getAttribute ( SHAPE_DBF_DESCRIPTION ) ; if ( obj instanceof String ) { record . add ( obj ) ; } else { record . add ( "" ) ; } record . add ( ColorFactory . getHexColorString ( omg . getLineColor ( ) ) ) ; record . add ( ColorFactory . getHexColorString ( omg . getFillColor ( ) ) ) ; record . add ( ColorFactory . getHexColorString ( omg . getSelectColor ( ) ) ) ; BasicStroke bs = ( BasicStroke ) omg . getStroke ( ) ; record . add ( new Double ( bs . getLineWidth ( ) ) ) ; String dp = BasicStrokeEditor . dashArrayToString ( bs . getDashArray ( ) ) ; if ( dp == BasicStrokeEditor . NONE ) { dp = "" ; } record . add ( dp ) ; record . add ( new Double ( bs . getDashPhase ( ) ) ) ; _model . addRecord ( record ) ; if ( logger . isLoggable ( Level . FINER ) ) logger . finer ( "ESE: adding record: " + record ) ; } return _model ; }
Returns true if the current thread is in the given channel's thread pool and we haven't exceeded the maximum number of handler frames on the stack.
34,810
void resize ( int newCapacity ) { Entry [ ] oldTable = table ; int oldCapacity = oldTable . length ; if ( oldCapacity == MAXIMUM_CAPACITY ) { threshold = Integer . MAX_VALUE ; return ; } Entry [ ] newTable = new Entry [ newCapacity ] ; transfer ( newTable ) ; table = newTable ; threshold = ( int ) ( newCapacity * loadFactor ) ; }
Adds money to the balance of a user
34,811
public void testHasAttribute1 ( ) throws Throwable { Document doc ; NodeList elementList ; Element testNode ; boolean state ; doc = ( Document ) load ( "staff" , builder ) ; elementList = doc . getElementsByTagName ( "address" ) ; testNode = ( Element ) elementList . item ( 4 ) ; state = testNode . hasAttribute ( "domestic" ) ; assertFalse ( "throw_False" , state ) ; }
Draws an arrowhead at the 'to' end of the edge.
34,812
LocoNetMessage createPacket ( String s ) { byte b [ ] = StringUtil . bytesFromHexString ( s ) ; if ( b . length == 0 ) { return null ; } LocoNetMessage m = new LocoNetMessage ( b . length ) ; for ( int i = 0 ; i < b . length ; i ++ ) { m . setElement ( i , b [ i ] ) ; } return m ; }
Returns the version of the currently-running jvm.
34,813
public void removeQualifiers ( ) { PropertyOptions opts = getOptions ( ) ; opts . setHasQualifiers ( false ) ; opts . setHasLanguage ( false ) ; opts . setHasType ( false ) ; qualifier = null ; }
Creates tree from sorted edges (with range low and high inclusive)
34,814
public static boolean moveFile ( Context context , @ NonNull final File source , @ NonNull final File targetDir ) { File target = new File ( targetDir , source . getName ( ) ) ; boolean success = source . renameTo ( target ) ; if ( ! success ) { success = copyFile ( context , source , targetDir ) ; if ( success ) { success = deleteFile ( context , source ) ; } } return success ; }
Returns a flattened JSON as Map.
34,815
public String toXMLString ( ) throws FSMsgException { return toXMLString ( true , true ) ; }
Splits a bar into subregions (elsewhere, these subregions will have different gradients applied to them).
34,816
public void create ( SSOToken token , String objName , Map attrs ) throws SMSException , SSOException { if ( objName == null || objName . length ( ) == 0 || attrs == null ) { throw new IllegalArgumentException ( "SMSFlatFileObject.create: " + "One or more arguments is null or empty" ) ; } String objKey = objName . toLowerCase ( ) ; String filepath = null ; mRWLock . readRequest ( ) ; try { filepath = mNameMap . getProperty ( objKey ) ; if ( filepath != null ) { String errmsg = "SMSFlatFileObject.create: object " + objName + " already exists in " + filepath ; mDebug . error ( errmsg ) ; throw new ServiceAlreadyExistsException ( errmsg ) ; } } finally { mRWLock . readDone ( ) ; } mRWLock . writeRequest ( ) ; try { filepath = mNameMap . getProperty ( objKey ) ; if ( filepath != null ) { String errmsg = "SMSFlatFileObject.create: object " + objName + " already exists in " + filepath ; mDebug . error ( errmsg ) ; throw new ServiceAlreadyExistsException ( errmsg ) ; } filepath = getAttrFile ( objName ) ; File filehandle = new File ( filepath ) ; File parentDir = filehandle . getParentFile ( ) ; if ( parentDir . isDirectory ( ) ) { String errmsg = "SMSFlatFileObject.create: object " + objName + " directory " + parentDir . getPath ( ) + " exists before create!" ; mDebug . error ( errmsg ) ; throw new ServiceAlreadyExistsException ( errmsg ) ; } Set sunserviceids = null ; Set sunxmlkeyvals = null ; Properties props = new Properties ( ) ; Set keys = attrs . keySet ( ) ; if ( keys != null ) { for ( Iterator i = keys . iterator ( ) ; i . hasNext ( ) ; ) { String key = ( String ) i . next ( ) ; Set vals = ( Set ) attrs . get ( key ) ; if ( key . equalsIgnoreCase ( SMSEntry . ATTR_SERVICE_ID ) ) { sunserviceids = vals ; } else if ( key . equalsIgnoreCase ( SMSEntry . ATTR_XML_KEYVAL ) ) { sunxmlkeyvals = vals ; } props . put ( key , toValString ( vals ) ) ; } } try { if ( ! parentDir . mkdirs ( ) ) { String errmsg = "SMSFlatFileObject.create: object " + objName + ": Could not create directory " + parentDir . getPath ( ) ; mDebug . error ( errmsg ) ; throw new SMSException ( errmsg ) ; } try { if ( ! filehandle . createNewFile ( ) ) { String errmsg = "SMSFlatFileObject.create: object " + objName + ": Could not create file " + filepath ; mDebug . error ( errmsg ) ; throw new SMSException ( errmsg ) ; } } catch ( IOException e ) { String errmsg = "SMSFlatFileObject.create: object " + objName + " IOException encountered when creating file " + filehandle . getPath ( ) + ". Exception: " + e . getMessage ( ) ; mDebug . error ( "SMSFlatFileObject.create" , e ) ; throw new SMSException ( errmsg ) ; } saveProperties ( props , filehandle , objName ) ; if ( sunserviceids != null && ! sunserviceids . isEmpty ( ) ) { createSunServiceIdFiles ( parentDir , sunserviceids ) ; } if ( sunxmlkeyvals != null && ! sunxmlkeyvals . isEmpty ( ) ) { createSunXmlKeyValFiles ( parentDir , sunxmlkeyvals ) ; } mNameMap . setProperty ( objKey , filepath ) ; saveProperties ( mNameMap , mNameMapHandle , null ) ; } catch ( SMSException e ) { deleteDir ( parentDir ) ; mNameMap . remove ( objKey ) ; throw e ; } } finally { mRWLock . writeDone ( ) ; } }
Reads an arbitrary object from the input stream when the type is unknown.
34,817
public static int determineConsecutiveDigitCount ( CharSequence msg , int startpos ) { int count = 0 ; int len = msg . length ( ) ; int idx = startpos ; if ( idx < len ) { char ch = msg . charAt ( idx ) ; while ( isDigit ( ch ) && idx < len ) { count ++ ; idx ++ ; if ( idx < len ) { ch = msg . charAt ( idx ) ; } } } return count ; }
Send an ERROR log message
34,818
private List < Entry > reduceWithDouglasPeuker ( List < Entry > entries , double epsilon ) { if ( epsilon <= 0 || entries . size ( ) < 3 ) { return entries ; } keep [ 0 ] = true ; keep [ entries . size ( ) - 1 ] = true ; algorithmDouglasPeucker ( entries , epsilon , 0 , entries . size ( ) - 1 ) ; List < Entry > reducedEntries = new ArrayList < Entry > ( ) ; for ( int i = 0 ; i < entries . size ( ) ; i ++ ) { if ( keep [ i ] ) { Entry curEntry = entries . get ( i ) ; reducedEntries . add ( new Entry ( curEntry . getVal ( ) , curEntry . getXIndex ( ) ) ) ; } } return reducedEntries ; }
Write the extension to the OutputStream.
34,819
private boolean isProjectUsingDefaultSdk ( T projectSdk ) { if ( ! isDefaultSdk ( projectSdk ) ) { return false ; } try { IClasspathEntry entry = ClasspathUtilities . findClasspathEntryContainer ( javaProject . getRawClasspath ( ) , doGetContainerId ( ) ) ; if ( entry != null ) { if ( SdkClasspathContainer . isDefaultContainerPath ( doGetContainerId ( ) , entry . getPath ( ) ) ) { return true ; } } } catch ( CoreException ce ) { CorePluginLog . logError ( ce ) ; } return false ; }
Returns the name and hyper-parameters of the distribution
34,820
private ArrayList < DbEntry > tryRemove ( int col , int row , ArrayList < DbEntry > items , float [ ] outLoss ) { boolean [ ] [ ] occupied = new boolean [ mTrgX ] [ mTrgY ] ; col = mShouldRemoveX ? col : Integer . MAX_VALUE ; row = mShouldRemoveY ? row : Integer . MAX_VALUE ; ArrayList < DbEntry > finalItems = new ArrayList < > ( ) ; ArrayList < DbEntry > removedItems = new ArrayList < > ( ) ; for ( DbEntry item : items ) { if ( ( item . cellX <= col && ( item . spanX + item . cellX ) > col ) || ( item . cellY <= row && ( item . spanY + item . cellY ) > row ) ) { removedItems . add ( item ) ; if ( item . cellX >= col ) item . cellX -- ; if ( item . cellY >= row ) item . cellY -- ; } else { if ( item . cellX > col ) item . cellX -- ; if ( item . cellY > row ) item . cellY -- ; finalItems . add ( item ) ; markCells ( occupied , item , true ) ; } } OptimalPlacementSolution placement = new OptimalPlacementSolution ( occupied , removedItems ) ; placement . find ( ) ; finalItems . addAll ( placement . finalPlacedItems ) ; outLoss [ 0 ] = placement . lowestWeightLoss ; outLoss [ 1 ] = placement . lowestMoveCost ; return finalItems ; }
Read the contents of a file. <p> Note: This makes default platform assumptions about the encoding of the file.
34,821
public String [ ] removeIntervalFacets ( String field ) { while ( remove ( FacetParams . FACET_INTERVAL , field ) ) { } ; return remove ( String . format ( Locale . ROOT , "f.%s.facet.interval.set" , field ) ) ; }
From Big Integers r,s to byte[] UAF_ALG_SIGN_SECP256K1_ECDSA_SHA256_RAW 0x05 An ECDSA signature on the secp256k1 curve which must have raw R and S buffers, encoded in big-endian order. I.e.[R (32 bytes), S (32 bytes)]
34,822
@ Override public boolean equals ( Object o ) { if ( this == o ) { return true ; } if ( o == null || getClass ( ) != o . getClass ( ) ) { return false ; } ObjectStat that = ( ObjectStat ) o ; if ( length != that . length ) { return false ; } if ( ! bucketName . equals ( that . bucketName ) ) { return false ; } if ( ! name . equals ( that . name ) ) { return false ; } if ( ! createdTime . equals ( that . createdTime ) ) { return false ; } if ( ! etag . equals ( that . etag ) ) { return false ; } return contentType . equals ( that . contentType ) ; }
Creates a epoch associated with this consensus, supposedly the next
34,823
public void put ( int key , float value ) { int i = binarySearch ( mKeys , 0 , mSize , key ) ; if ( i >= 0 ) { mValues [ i ] = value ; } else { i = ~ i ; if ( mSize >= mKeys . length ) { int n = ArrayUtils . idealIntArraySize ( mSize + 1 ) ; int [ ] nkeys = new int [ n ] ; float [ ] nvalues = new float [ n ] ; System . arraycopy ( mKeys , 0 , nkeys , 0 , mKeys . length ) ; System . arraycopy ( mValues , 0 , nvalues , 0 , mValues . length ) ; mKeys = nkeys ; mValues = nvalues ; } if ( mSize - i != 0 ) { System . arraycopy ( mKeys , i , mKeys , i + 1 , mSize - i ) ; System . arraycopy ( mValues , i , mValues , i + 1 , mSize - i ) ; } mKeys [ i ] = key ; mValues [ i ] = value ; mSize ++ ; } }
Computes the azimuth angle (clockwise from North) for the rhumb path (line of constant azimuth) between this location and a specified location. This angle can be used as the starting azimuth for a rhumb path beginning at this location, and passing through the specified location. This function uses a spherical model, not elliptical.
34,824
private static String single ( File file ) { return file . getAbsolutePath ( ) ; }
Returns url with calculated signature for specific file with specific file builder parameters
34,825
public boolean init ( ) { m_session = m_request . getSession ( true ) ; m_forward = WebUtil . getParameter ( m_request , P_ForwardTo ) ; if ( m_forward != null ) m_session . setAttribute ( P_ForwardTo , m_forward ) ; else m_forward = "" ; m_salesRep = WebUtil . getParameter ( m_request , P_SalesRep_ID ) ; if ( m_salesRep != null ) m_session . setAttribute ( P_SalesRep_ID , m_salesRep ) ; m_email = WebUtil . getParameter ( m_request , P_EMail ) ; if ( m_email == null ) m_email = "" ; m_email = m_email . trim ( ) ; if ( m_email != null ) m_session . setAttribute ( P_EMail , m_email ) ; m_password = WebUtil . getParameter ( m_request , P_Password ) ; if ( m_password == null ) m_password = "" ; m_password = m_password . trim ( ) ; if ( m_session . getAttribute ( WebInfo . NAME ) != null ) { WebInfo wi = ( WebInfo ) m_session . getAttribute ( WebInfo . NAME ) ; m_wu = wi . getWebUser ( ) ; } return true ; }
Initialize the authority (userinfo, host and port) for this URI from a URI string spec.
34,826
protected int numberOfAttributes ( int total , double fraction ) { int k = ( int ) Math . round ( ( fraction < 1.0 ) ? total * fraction : fraction ) ; if ( k > total ) k = total ; if ( k < 1 ) k = 1 ; return k ; }
Called while highlighting a single result, to append a non-matching chunk of text from the suggestion to the provided fragments list.
34,827
private static String dblString ( double decimalValue , int availableSpace ) { return dblString ( BigDecimal . valueOf ( decimalValue ) , - 1 , availableSpace ) ; }
Creates a CertificateToken wrapping the provided X509Certificate.
34,828
public void runTest ( ) throws Throwable { Document doc ; NodeList elementList ; Node nameNode ; CharacterData child ; String substring ; doc = ( Document ) load ( "hc_staff" , false ) ; elementList = doc . getElementsByTagName ( "strong" ) ; nameNode = elementList . item ( 0 ) ; child = ( CharacterData ) nameNode . getFirstChild ( ) ; substring = child . substringData ( 0 , 8 ) ; assertEquals ( "characterdataSubStringValueAssert" , "Margaret" , substring ) ; }
Creates new platform cache.
34,829
static public < T > void reset ( @ Nonnull Class < T > type ) { log . debug ( "Reset type {}" , type . getName ( ) ) ; managerLists . put ( type , new ArrayList < > ( ) ) ; }
Assumes the class specified points to a file in the classpath that contains the name of a class that implements or is a subclass of the specfied class. <p/> Any class that cannot be loaded or are not assignable to the specified class will be skipped and placed in the 'resourcesNotLoaded' collection. <p/> Example classpath: <p/> META-INF/java.io.InputStream # contains the classname org.acme.AcmeInputStream META-INF/java.io.InputStream # contains the classname org.widget.NeatoInputStream META-INF/java.io.InputStream # contains the classname com.foo.BarInputStream <p/> ResourceFinder finder = new ResourceFinder("META-INF/"); List classes = finder.findAllImplementations(java.io.InputStream.class); classes.contains("org.acme.AcmeInputStream"); // true classes.contains("org.widget.NeatoInputStream"); // true classes.contains("com.foo.BarInputStream"); // true
34,830
SortedSet < String > typesToImport ( ) { SortedSet < String > typesToImport = new TreeSet < String > ( ) ; for ( Map . Entry < String , Spelling > entry : imports . entrySet ( ) ) { if ( entry . getValue ( ) . importIt ) { typesToImport . add ( entry . getKey ( ) ) ; } } return typesToImport ; }
Create a zero number from a sign and an array of zero bytes. The sign is 1.
34,831
public long createBackBuffer ( X11ComponentPeer peer , int numBuffers , BufferCapabilities caps ) throws AWTException { if ( ! X11GraphicsDevice . isDBESupported ( ) ) { throw new AWTException ( "Page flipping is not supported" ) ; } if ( numBuffers > 2 ) { throw new AWTException ( "Only double or single buffering is supported" ) ; } BufferCapabilities configCaps = getBufferCapabilities ( ) ; if ( ! configCaps . isPageFlipping ( ) ) { throw new AWTException ( "Page flipping is not supported" ) ; } long window = peer . getContentWindow ( ) ; int swapAction = getSwapAction ( caps . getFlipContents ( ) ) ; return createBackBuffer ( window , swapAction ) ; }
Verify if CIDR string is a valid CIDR address.
34,832
private String inverseRename ( String renamedFilename , Map < String , String > renamedToReferenceMap ) { List < String > renamedAllParts = FILE_SEP_SPLITTER . splitToList ( renamedFilename ) ; for ( int i = renamedAllParts . size ( ) ; i > 0 ; i -- ) { String renamedParts = FILE_SEP_JOINER . join ( renamedAllParts . subList ( 0 , i ) ) ; String partsToSubstitute = renamedToReferenceMap . get ( renamedParts ) ; if ( partsToSubstitute != null ) { return renamedFilename . replace ( renamedParts , partsToSubstitute ) ; } } return renamedFilename ; }
synchronize target from source
34,833
public void generateAtom ( XmlWriter w , ExtensionProfile extProfile ) throws IOException { ArrayList < XmlWriter . Attribute > attrs = new ArrayList < XmlWriter . Attribute > ( 3 ) ; List < XmlNamespace > nsDecls = new ArrayList < XmlNamespace > ( ) ; if ( rel != null ) { attrs . add ( new XmlWriter . Attribute ( "rel" , rel ) ) ; } if ( type != null ) { attrs . add ( new XmlWriter . Attribute ( "type" , type ) ) ; } if ( href != null ) { attrs . add ( new XmlWriter . Attribute ( "href" , href ) ) ; } if ( hrefLang != null ) { attrs . add ( new XmlWriter . Attribute ( "hreflang" , hrefLang ) ) ; } if ( title != null ) { attrs . add ( new XmlWriter . Attribute ( "title" , title ) ) ; } if ( titleLang != null ) { attrs . add ( new XmlWriter . Attribute ( "xml:lang" , titleLang ) ) ; } if ( length != - 1 ) { attrs . add ( new XmlWriter . Attribute ( "length" , String . valueOf ( length ) ) ) ; } if ( etag != null ) { nsDecls . add ( Namespaces . gNs ) ; attrs . add ( new XmlWriter . Attribute ( Namespaces . gAlias , "etag" , etag ) ) ; } generateStartElement ( w , Namespaces . atomNs , "link" , attrs , nsDecls ) ; if ( content != null ) { content . generateAtom ( w , extProfile ) ; } generateExtensions ( w , extProfile ) ; w . endElement ( Namespaces . atomNs , "link" ) ; }
Adds a listener to the set of listeners that are sent events through the life of an animation, such as start, repeat, and end.
34,834
public String findURIFromDoc ( int owner ) { int n = m_sourceTree . size ( ) ; for ( int i = 0 ; i < n ; i ++ ) { SourceTree sTree = ( SourceTree ) m_sourceTree . elementAt ( i ) ; if ( owner == sTree . m_root ) return sTree . m_url ; } return null ; }
Shift a long[] bitset inplace. Low-endian layout for the array.
34,835
private EnvironmentLogger buildParentTree ( String childName ) { if ( childName == null || childName . equals ( "" ) ) return null ; int p = childName . lastIndexOf ( '.' ) ; String parentName ; if ( p > 0 ) parentName = childName . substring ( 0 , p ) ; else parentName = "" ; EnvironmentLogger parent = null ; SoftReference < EnvironmentLogger > parentRef = _envLoggers . get ( parentName ) ; if ( parentRef != null ) parent = parentRef . get ( ) ; if ( parent != null ) return parent ; else { parent = new EnvironmentLogger ( parentName , null ) ; _envLoggers . put ( parentName , new SoftReference < EnvironmentLogger > ( parent ) ) ; EnvironmentLogger grandparent = buildParentTree ( parentName ) ; if ( grandparent != null ) parent . setParent ( grandparent ) ; return parent ; } }
Concatenates a list of double arrays into a single array.
34,836
static public byte [ ] charArrayToHexArray ( char [ ] array ) { byte [ ] ascii = new byte [ ( array . length % 2 == 0 ) ? array . length : array . length + 1 ] ; for ( int i = 0 ; i < ascii . length ; i ++ ) { if ( i < ascii . length ) { if ( 'A' <= array [ i ] && array [ i ] <= 'F' ) { ascii [ i ] = ( byte ) ( array [ i ] - 'A' ) ; } else if ( 'a' <= array [ i ] && array [ i ] <= 'f' ) { ascii [ i ] = ( byte ) ( array [ i ] - 'a' ) ; } else if ( '0' <= array [ i ] && array [ i ] <= '9' ) { ascii [ i ] = ( byte ) ( array [ i ] - '0' ) ; } else { ascii [ i ] = 0x0 ; } } else { ascii [ i ] = 0x0 ; } } byte [ ] result = new byte [ array . length / 2 ] ; for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = ( byte ) ( ( ascii [ i * 2 ] * 16 ) | ascii [ i * 2 + 1 ] ) ; } int i ; for ( i = result . length - 1 ; i >= 0 && result [ i ] == 0 ; i -- ) ; if ( i < result . length - 1 ) { result = Arrays . copyOf ( result , i + 1 ) ; } return result ; }
Find the _Fields constant that matches fieldId, or null if its not found.
34,837
public UnicastThread ( int port ) throws IOException { super ( "unicast request" ) ; setDaemon ( true ) ; if ( port == 0 ) { try { listen = new ServerSocket ( Constants . getDiscoveryPort ( ) ) ; } catch ( IOException e ) { logger . log ( Levels . HANDLED , "failed to bind to default port" , e ) ; } } if ( listen == null ) { listen = new ServerSocket ( port ) ; } this . port = listen . getLocalPort ( ) ; }
Returns a Grammar object by parsing the contents of the entity pointed to by source.
34,838
@ Override public boolean domainMatch ( final String host , final String domain ) { final boolean match = host . equals ( domain ) || ( domain . startsWith ( "." ) && host . endsWith ( domain ) ) ; return match ; }
Interrupt this thread - cancel the query if still in execution Carlos Ruiz - globalqss - [2826660] - Info product performance BIG problem
34,839
private JList < String > createNewInfoLabelJList ( String source ) { final JList < String > createdInfoLabelList = new JList < > ( ) ; createdInfoLabelList . setModel ( source == null ? localInfoLabelListModel : remoteInfoLabelListModels . get ( source ) ) ; createdInfoLabelList . setCellRenderer ( new ConfigurableInfoLabelRenderer ( ) ) ; createdInfoLabelList . setFixedCellHeight ( 20 ) ; createdInfoLabelList . setBackground ( LIGHTER_GRAY ) ; return createdInfoLabelList ; }
Returns true if there is another postponed route to try.
34,840
public void end ( ) { check ( numthreads , 0 , 0 ) ; done . set ( true ) ; }
Indicates whether or not the specified class is a dynamically generated proxy class.
34,841
private List < FilePath > listSeqnoFiles ( ) { LinkedList < FilePath > children = new LinkedList < FilePath > ( ) ; for ( String fileName : listSeqnoFileNames ( ) ) { FilePath fp = new FilePath ( serviceDir , fileName ) ; children . add ( fp ) ; } return children ; }
Departure or other codepath NOT specific to unlock requires that we cleanup suspend state that was already permitted to request. This needs to be invoked for both regular and suspend locks. <p> Synchronizes on suspendLock.
34,842
protected void includeBasis ( int selectedBasis ) { basisSet . add ( Integer . valueOf ( selectedBasis ) ) ; reestimateAlpha ( selectedBasis ) ; }
Initializes the disk cache. Note that this includes disk access so this should not be executed on the main/UI thread. By default an ImageCache does not initialize the disk cache when it is created, instead you should call initDiskCache() to initialize it on a background thread.
34,843
public static Script createRedeemScript ( int threshold , List < ECKey > pubkeys ) { pubkeys = new ArrayList < ECKey > ( pubkeys ) ; Collections . sort ( pubkeys , ECKey . PUBKEY_COMPARATOR ) ; return ScriptBuilder . createMultiSigOutputScript ( threshold , pubkeys ) ; }
This method is supposed to be called from within the CassandraDaemon advice to signal that Cassandra setup process is completed.
34,844
public void processingInstruction ( String target , String data ) throws SAXException { charactersFlush ( ) ; int dataIndex = m_data . size ( ) ; m_previous = addNode ( DTM . PROCESSING_INSTRUCTION_NODE , DTM . PROCESSING_INSTRUCTION_NODE , m_parents . peek ( ) , m_previous , - dataIndex , false ) ; m_data . addElement ( m_valuesOrPrefixes . stringToIndex ( target ) ) ; m_values . addElement ( data ) ; m_data . addElement ( m_valueIndex ++ ) ; }
Compares two ranking based on the rank score.
34,845
public void union ( Set x ) { Enumeration elements = x . elements ( ) ; while ( elements . hasMoreElements ( ) ) put ( elements . nextElement ( ) ) ; }
Creates a new DriveSystem subsystem that uses the supplied drive train and no shifter. The voltage send to the drive train is limited to [-1.0,1.0].
34,846
public final double doOperation ( ) { List < Integer > allIndices = new ArrayList < Integer > ( masterList ) ; int left , right ; for ( int i = 0 ; i < size ; i ++ ) { left = allIndices . remove ( MathUtils . nextInt ( allIndices . size ( ) ) ) ; right = allIndices . remove ( MathUtils . nextInt ( allIndices . size ( ) ) ) ; double value1 = parameter . getParameterValue ( left ) ; double value2 = parameter . getParameterValue ( right ) ; parameter . setParameterValue ( left , value2 ) ; parameter . setParameterValue ( right , value1 ) ; } return 0.0 ; }
Creates a new wizard.
34,847
public static AnnotatedTypeMirror leastUpperBound ( AnnotatedTypeFactory atypeFactory , AnnotatedTypeMirror type1 , AnnotatedTypeMirror type2 ) { TypeMirror lub = InternalUtils . leastUpperBound ( atypeFactory . getProcessingEnv ( ) , type1 . getUnderlyingType ( ) , type2 . getUnderlyingType ( ) ) ; return leastUpperBound ( atypeFactory , type1 , type2 , lub ) ; }
Converts from the progress along the curve to a screen coordinate.
34,848
private void writeInterfaceHash ( IndentingWriter p ) throws IOException { p . pln ( "private static final long interfaceHash = " + remoteClass . interfaceHash ( ) + "L;" ) ; }
Decode a login profile from a string.
34,849
protected InvalidPropertyException ( final String message , final String propertyName ) { super ( String . format ( message , propertyName ) ) ; this . propertyName = propertyName ; }
Generic Test SOAP Service
34,850
public int addPadding ( byte [ ] in , int inOff ) { byte code = ( byte ) ( in . length - inOff ) ; while ( inOff < in . length - 1 ) { if ( random == null ) { in [ inOff ] = 0 ; } else { in [ inOff ] = ( byte ) random . nextInt ( ) ; } inOff ++ ; } in [ inOff ] = code ; return code ; }
Writes the entire ResultSet to a CSV file. The caller is responsible for closing the ResultSet.
34,851
public void addNodeKeys ( ArrayList < SpatialKey > list , Page p ) { if ( p != null && ! p . isLeaf ( ) ) { for ( int i = 0 ; i < p . getKeyCount ( ) ; i ++ ) { list . add ( ( SpatialKey ) p . getKey ( i ) ) ; addNodeKeys ( list , p . getChildPage ( i ) ) ; } } }
Workaround for bug pre-Froyo, see here for more info: http://android-developers.blogspot.com/2011/09/androids-http-clients.html
34,852
static double svd_dmax ( double a , double b ) { return Math . max ( a , b ) ; }
When faction or subfaction is changed, refresh ratings combo box with appropriate values for selected faction.
34,853
public static final Circle scale ( Circle circle , double scale ) { if ( circle == null ) throw new NullPointerException ( Messages . getString ( "geometry.nullShape" ) ) ; if ( scale <= 0 ) throw new IllegalArgumentException ( Messages . getString ( "geometry.invalidScale" ) ) ; return new Circle ( circle . radius * scale ) ; }
Reads the contents of a file line by line to a List of Strings using the default encoding for the VM. The file is always closed.