idx int64 0 34.9k | question stringlengths 12 26.4k | target stringlengths 15 2.3k |
|---|---|---|
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 , co... | Draws an item label. |
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 , val... | Registers an object by name. This will throw an exception if an object has already been registered under the given name. |
34,802 | protected BusinessObjectDataDdlCollectionResponse generateBusinessObjectDataDdlCollectionImpl ( BusinessObjectDataDdlCollectionRequest businessObjectDataDdlCollectionRequest ) { validateBusinessObjectDataDdlCollectionRequest ( businessObjectDataDdlCollectionRequest ) ; BusinessObjectDataDdlCollectionResponse businessOb... | Retrieves the DDL to initialize the specified type of the database system to perform queries for a collection of business object data in the specified storages. |
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 ( ) ) ; assertEqua... | Test verifies that the mark, position and limit are unchanged by the checksum operation. |
34,804 | public boolean isNamespaceRepairingMode ( ) { return namespaceRepairingMode ; } | Is StAX namespace repairing mode on or off? |
34,805 | public void addSipEventListener ( SipEventListener listener ) { mListeners . add ( listener ) ; } | Add a SIP event listener |
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 ) ;... | Escape a string to create a valid JSON string |
34,807 | public PMElement elementAt ( int i ) { return gr . elementAt ( i ) ; } | Returns element at specific index. |
34,808 | public static List < BlockNode > collectBlocksDominatedBy ( BlockNode dominator , BlockNode start ) { List < BlockNode > result = new ArrayList < BlockNode > ( ) ; collectWhileDominates ( dominator , start , result ) ; return result ; } | Collect all block dominated by 'dominator', starting from 'start' |
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 ... | Prepares and returns a 7 column DbfTableModel to accept input for columns of TYPE_CHARACTER. <br> <br> The default model used holds most of the DrawingAttributes of the OMGraphics. |
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 * loadF... | Rehashes the contents of this map into a new array with a larger capacity. This method is called automatically when the number of keys in this map reaches its threshold. If current capacity is MAXIMUM_CAPACITY, this method does not resize the map, but sets threshold to Integer.MAX_VALUE. This has the effect of prevent... |
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 ( "dome... | Runs the test case. |
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 ; } | Create a well-formed LocoNet packet from a String |
34,813 | public void removeQualifiers ( ) { PropertyOptions opts = getOptions ( ) ; opts . setHasQualifiers ( false ) ; opts . setHasLanguage ( false ) ; opts . setHasType ( false ) ; qualifier = null ; } | Removes all qualifiers from the node and sets the options appropriate. |
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 ) { suc... | Move a file. The target file may even be on external SD card. |
34,815 | public String toXMLString ( ) throws FSMsgException { return toXMLString ( true , true ) ; } | This method translates the request to an XML document String based on the Request schema described above. NOTE: this is a complete AuthnRequest xml string with RequestID, MajorVersion, etc. |
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 . toLo... | Creates the configuration object. Creates the directory for the object and the attributes properties file with the given attributes. |
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 ) ; } } } re... | Determines the number of consecutive characters that are encodable using numeric compaction. |
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 > reduced... | uses the douglas peuker algorithm to reduce the given List of entries |
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 . isDefaultC... | Returns true if the given project SDK is actually the default SDK for the workspace AND the project has a classpath container entry for the given SDK that indicates that the workspace default should actually be used (i.e. no trailing segments). Also returns true if the project SDK is the default SDK for the workspace ... |
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 Arra... | Tries the remove the provided row and column. |
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 ) ) ; } | Remove all Interval Facets on a field |
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 ( ! n... | Checks whether given object is same as this ObjectStat. |
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 .... | Adds a mapping from the specified key to the specified value, replacing the previous mapping from the specified key if there was one. |
34,824 | private static String single ( File file ) { return file . getAbsolutePath ( ) ; } | Get absolute path to a single file. |
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_salesR... | init will initialize the WebLogin Object for further use |
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 ; } | calculates the number of attributes |
34,827 | private static String dblString ( double decimalValue , int availableSpace ) { return dblString ( BigDecimal . valueOf ( decimalValue ) , - 1 , availableSpace ) ; } | Create a string from a BigDecimal making sure that it's not longer than the available space. |
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 . ge... | Runs the test case. |
34,829 | static public < T > void reset ( @ Nonnull Class < T > type ) { log . debug ( "Reset type {}" , type . getName ( ) ) ; managerLists . put ( type , new ArrayList < > ( ) ) ; } | Deregister all objects of a particular type. |
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 ; } | Returns the set of types to import. We import every type that is neither in java.lang nor in the package containing the AutoCursor class, provided that the result refers to the type unambiguously. For example, if there is a property of type java.util.Map.Entry then we will import java.util.Map.Entry and refer to the p... |
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 s... | Attempts to create an XDBE-based backbuffer for the given peer. If the requested configuration is not natively supported, an AWTException is thrown. Otherwise, if the backbuffer creation is successful, a handle to the native backbuffer is returned. |
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 . s... | Walks backwards through the dir prefixes of renamedFilename looking for a match in renamedToReferenceMap. |
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... | Generates XML in the Atom format. |
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 ; } | Given a document, find the URL associated with that document. |
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 ; SoftRefe... | Recursively builds the parents of the logger. |
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 [... | Utility method that transforms a an ascii array representing hexa data in a real hexa array. The resulting array is half the size of the one passed as parameter. |
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 == nu... | Create a daemon thread. Set up the socket now rather than in run, so that we get any exception up front. |
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 ; } | Performs domain-match as defined by the RFC2109. |
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 ConfigurableInfo... | Creates a new JList for info labels of a source |
34,840 | public void end ( ) { check ( numthreads , 0 , 0 ) ; done . set ( true ) ; } | Trigger the threads that we're done |
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 ; } | Return a list of seqno file paths or an empty list of none exist. |
34,842 | protected void includeBasis ( int selectedBasis ) { basisSet . add ( Integer . valueOf ( selectedBasis ) ) ; reestimateAlpha ( selectedBasis ) ; } | Include a basis function into the model. |
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 ) ; } | Creates redeem script with given public keys and threshold. Given public keys will be placed in redeem script in the lexicographical sorting order. |
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... | Override the processingInstruction() interface in SAX2DTM2. <p> %OPT% This one is different from SAX2DTM.processingInstruction() in that we do not use extended types for PI nodes. The name of the PI is saved in the DTMStringPool. Receive notification of a processing instruction. |
34,845 | public void union ( Set x ) { Enumeration elements = x . elements ( ) ; while ( elements . hasMoreElements ( ) ) put ( elements . nextElement ( ) ) ; } | Destructively modify this so that it becomes the union of itself with x. We iterate over the elements in x, adding to this any that are not in x. |
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 ( )... | swap the values in two random parameter slots. |
34,847 | public static AnnotatedTypeMirror leastUpperBound ( AnnotatedTypeFactory atypeFactory , AnnotatedTypeMirror type1 , AnnotatedTypeMirror type2 ) { TypeMirror lub = InternalUtils . leastUpperBound ( atypeFactory . getProcessingEnv ( ) , type1 . getUnderlyingType ( ) , type2 . getUnderlyingType ( ) ) ; return leastUpperBo... | Returns the lub of two annotated types. |
34,848 | private void writeInterfaceHash ( IndentingWriter p ) throws IOException { p . pln ( "private static final long interfaceHash = " + remoteClass . interfaceHash ( ) + "L;" ) ; } | Writes declaration and initializer for "interfaceHash" static field. |
34,849 | protected InvalidPropertyException ( final String message , final String propertyName ) { super ( String . format ( message , propertyName ) ) ; this . propertyName = propertyName ; } | Creates a new exception. |
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 ; } | add the pad bytes to the passed in block, returning the number of bytes added. |
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 ) ) ; } } } | Add all node keys (including internal bounds) to the given list. This is mainly used to visualize the internal splits. |
34,852 | static double svd_dmax ( double a , double b ) { return Math . max ( a , b ) ; } | returns the larger of two double precision numbers |
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 * s... | Returns a scaled version of the given circle. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.