idx int64 0 34.9k | question stringlengths 12 26.4k | target stringlengths 15 2.15k |
|---|---|---|
200 | public boolean showJoinPartAndQuit ( ) { return preferences . getBoolean ( resources . getString ( R . string . key_show_joinpartquit ) , Boolean . parseBoolean ( resources . getString ( R . string . default_show_joinpartquit ) ) ) ; } | Process an attribute string of type T_NUMBER into a double value. |
201 | public void reset ( ) { lastMtd = null ; map . clear ( ) ; loadCnt . set ( 0 ) ; putCnt . set ( 0 ) ; putAllCnt . set ( 0 ) ; ts = System . currentTimeMillis ( ) ; txs . clear ( ) ; } | Attempts to create an instance of junit's ComparisonFailure exception using reflection. |
202 | public static Configuration load ( InputStream stream ) throws IOException { try { Properties properties = new Properties ( ) ; properties . load ( stream ) ; return from ( properties ) ; } finally { stream . close ( ) ; } } | Pop the last stylesheet pushed, and return the stylesheet that this handler is constructing, and set the last popped stylesheet member. Also pop the stylesheet locator stack. |
203 | private static String encode_base64 ( final byte d [ ] , final int len ) throws IllegalArgumentException { int off = 0 ; final StringBuffer rs = new StringBuffer ( ) ; int c1 , c2 ; if ( len <= 0 || len > d . length ) { throw new IllegalArgumentException ( "Invalid len" ) ; } while ( off < len ) { c1 = d [ off ++ ] & 0... | The client failed to login. If an invalid login record exists for that client, increment the error count of that record. If that record does nor exists, create new entry. |
204 | protected byte readByteProtected ( DataInputStream istream ) throws java . io . IOException { while ( true ) { int nchars ; nchars = istream . read ( rcvBuffer , 0 , 1 ) ; if ( nchars > 0 ) { return rcvBuffer [ 0 ] ; } } } | Create a new MemberCellRenderer. |
205 | public JSONException ( Throwable cause ) { super ( cause . getMessage ( ) ) ; this . cause = cause ; } | Ensures that two paths refer to the same host. |
206 | public static PcRunner serializableInstance ( ) { return PcRunner . serializableInstance ( ) ; } | Post process method to correct the start and end indices of BallNodes on the right of the node where the instance was added. |
207 | public void drawFigure ( Graphics2D g ) { AffineTransform savedTransform = null ; if ( get ( TRANSFORM ) != null ) { savedTransform = g . getTransform ( ) ; g . transform ( get ( TRANSFORM ) ) ; } Paint paint = SVGAttributeKeys . getFillPaint ( this ) ; if ( paint != null ) { g . setPaint ( paint ) ; drawFill ( g ) ; }... | Determines a basis defining a subspace described by the specified alpha values. |
208 | protected Object [ ] parseArguments ( final byte [ ] theBytes ) { Object [ ] myArguments = new Object [ 0 ] ; int myTagIndex = 0 ; int myIndex = 0 ; myArguments = new Object [ _myTypetag . length ] ; isArray = ( _myTypetag . length > 0 ) ? true : false ; while ( myTagIndex < _myTypetag . length ) { if ( myTagIndex == 0... | close the input stream, and ignore eventual errors. |
209 | private boolean hasNextPostponed ( ) { return ! postponedRoutes . isEmpty ( ) ; } | Build URL encoded query |
210 | public static String decodeAttributeCode ( String attributeCode ) { return attributeCode . startsWith ( "+" ) ? attributeCode . substring ( 1 ) : attributeCode ; } | Creates a list of prefix and suffix decorator components |
211 | public boolean toBoolean ( Element el , String attributeName ) { return Caster . toBooleanValue ( el . getAttribute ( attributeName ) , false ) ; } | Add two positive numbers of different length. The second is longer. |
212 | 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 .... | Add a fixed view to appear at the bottom of the list. If addFooterView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want. <p> NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that wil... |
213 | void saveToStream ( DataOutputStream out ) throws IOException { out . writeUTF ( mUrl ) ; out . writeUTF ( mName ) ; out . writeUTF ( mValue ) ; out . writeUTF ( mDomain ) ; out . writeUTF ( mPath ) ; out . writeLong ( mCreation ) ; out . writeLong ( mExpiration ) ; out . writeLong ( mLastAccess ) ; out . writeBoolean ... | Returns all known URLs which point to the specified resource. |
214 | public boolean delete ( File f ) { if ( f . isDirectory ( ) ) { for ( File child : f . listFiles ( ) ) { if ( ! delete ( child ) ) { return ( false ) ; } } } boolean result = f . delete ( ) ; MediaScannerConnection . scanFile ( this , new String [ ] { f . getAbsolutePath ( ) } , null , null ) ; return ( result ) ; } | Handle the supplied event that signals that mysqld has stopped. |
215 | public static void replaceHttpHeaderMapNodeSpecific ( Map < String , String > httpHeaderMap , Map < String , String > requestParameters ) { boolean needToReplaceVarInHttpHeader = false ; for ( String parameter : requestParameters . keySet ( ) ) { if ( parameter . contains ( PcConstants . NODE_REQUEST_PREFIX_REPLACE_VAR... | Returns a copy of the given node or subtree with this document as its owner. |
216 | private void mapPut ( Map map , String name , Object preference ) throws IOException { isEmpty = false ; if ( ( name . length ( ) == 0 ) || ( name == null ) ) { throw new IOException ( "no name specified in preference" + " expression" ) ; } if ( map . put ( name , preference ) != null ) { throw new IOException ( "dupli... | thenAcceptBoth result completes exceptionally if either source cancelled |
217 | public Builder withTags ( Map < String , String > tags ) { this . tags = Collections . unmodifiableMap ( tags ) ; return this ; } | Class Hierarchy is: Department(name : String, employees : Array[Person]) Person(name : String, department : Department, manager : Manager) Manager(subordinates : Array[Person]) extends Person <p/> Persons can have SecurityClearance(level : Int) clearance. |
218 | public static Script createMultiSigInputScript ( List < TransactionSignature > signatures ) { List < byte [ ] > sigs = new ArrayList < byte [ ] > ( signatures . size ( ) ) ; for ( TransactionSignature signature : signatures ) sigs . add ( signature . encodeToBitcoin ( ) ) ; return createMultiSigInputScriptBytes ( sigs ... | Create an instance of a class using the specified ClassLoader |
219 | @ Override public Object [ ] toArray ( ) { final ArrayList < Object > out = new ArrayList < Object > ( ) ; final Iterator < IGPO > gpos = iterator ( ) ; while ( gpos . hasNext ( ) ) { out . add ( gpos . next ( ) ) ; } return out . toArray ( ) ; } | Formats the given number to the given number of decimals, and returns the number as a string, maximum 35 characters. |
220 | public static Angle rhumbAzimuth ( LatLon p1 , LatLon p2 ) { if ( p1 == null || p2 == null ) { throw new IllegalArgumentException ( "LatLon Is Null" ) ; } double lat1 = p1 . getLatitude ( ) . radians ; double lon1 = p1 . getLongitude ( ) . radians ; double lat2 = p2 . getLatitude ( ) . radians ; double lon2 = p2 . getL... | Extract parameters from a configuration map. Keys that are on the ignoreParams list are ignored. |
221 | public void takeColumnFamilySnapshot ( String keyspaceName , String columnFamilyName , String tag ) throws IOException { if ( keyspaceName == null ) throw new IOException ( "You must supply a keyspace name" ) ; if ( operationMode == Mode . JOINING ) throw new IOException ( "Cannot snapshot until bootstrap completes" ) ... | Adds a list of deleted integers to the current action. If possible, merges integerList with the list in the previous call to this method. |
222 | public void clear ( ) { oredCriteria . clear ( ) ; orderByClause = null ; distinct = false ; } | Gets OS JDK string. |
223 | @ Override public Enumeration < Option > listOptions ( ) { Vector < Option > newVector = new Vector < Option > ( 6 ) ; newVector . addElement ( new Option ( "\tGenerate network (instead of instances)\n" , "B" , 0 , "-B" ) ) ; newVector . addElement ( new Option ( "\tNr of nodes\n" , "N" , 1 , "-N <integer>" ) ) ; newVe... | Load values from a Properties instance. Current values are obliterated. |
224 | private void dialogChanged ( ) { String fileName = getFilename ( ) ; String set = getSetname ( ) ; if ( ( null == fileName ) || ( fileName . length ( ) < 1 ) ) { updateStatus ( "File name must be specified" ) ; return ; } if ( ( null == set ) || ( set . length ( ) < 1 ) ) { updateStatus ( "Set name must be specified" )... | Abstract method for creating a specific resource in the sub-class |
225 | @ SuppressWarnings ( "unchecked" ) private void applyToGroupAndSubGroups ( final AST2BOpContext context , final QueryRoot queryRoot , final QueryHintScope scope , final GraphPatternGroup < IGroupMemberNode > group , final String name , final String value ) { for ( IGroupMemberNode child : group ) { _applyQueryHint ( co... | Create costing for client. Handles Transaction if not in a transaction |
226 | @ Override public boolean equals ( Object otherRules ) { if ( this == otherRules ) { return true ; } if ( otherRules instanceof ZoneRules ) { ZoneRules other = ( ZoneRules ) otherRules ; return Arrays . equals ( standardTransitions , other . standardTransitions ) && Arrays . equals ( standardOffsets , other . standardO... | Determine whether or not given signature denotes a reference type. |
227 | public static int readInt ( final JSONObject jsonObject , final String key , final boolean required , final boolean notNull ) throws JSONException { if ( required ) { return jsonObject . getInt ( key ) ; } if ( notNull && jsonObject . isNull ( key ) ) { throw new JSONException ( String . format ( Locale . US , NULL_VAL... | Needed for standard java dynamic proxy. |
228 | public TimeTableXYDataset ( ) { this ( TimeZone . getDefault ( ) , Locale . getDefault ( ) ) ; } | Finishes the activity when the up button is pressed on the action bar. |
229 | protected void onPageScrolled ( int position , float offset , int offsetPixels ) { if ( mDecorChildCount > 0 ) { if ( mOrientation == Orientation . VERTICAL ) { final int scrollY = getScrollY ( ) ; int paddingTop = getPaddingTop ( ) ; int paddingBottom = getPaddingBottom ( ) ; final int height = getHeight ( ) ; final i... | Sorts the specified array into ascending numerical order. |
230 | public void removeTmpStore ( IMXStore store ) { if ( null != store ) { mTmpStores . remove ( store ) ; } } | Add all the elements into the adapter if they're not already there |
231 | public static List < AnnotationDto > transformToDto ( List < Annotation > annotations ) { if ( annotations == null ) { throw new WebApplicationException ( "Null entity object cannot be converted to Dto object." , Status . INTERNAL_SERVER_ERROR ) ; } List < AnnotationDto > result = new ArrayList < > ( ) ; for ( Annotati... | Initializing default values for tuple separator, stream expiry, rotation windows |
232 | protected void enableButtons ( ) { m_M_Product_ID = - 1 ; m_ProductName = null ; m_Price = null ; int row = m_table . getSelectedRow ( ) ; boolean enabled = row != - 1 ; if ( enabled ) { Integer ID = m_table . getSelectedRowKey ( ) ; if ( ID != null ) { m_M_Product_ID = ID . intValue ( ) ; m_ProductName = ( String ) m_... | Construct a sided plane from a pair of vectors describing points, and including origin, plus a point p which describes the side. |
233 | public static Matrix random ( int m , int n ) { Matrix A = new Matrix ( m , n ) ; double [ ] [ ] X = A . getArray ( ) ; for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { X [ i ] [ j ] = Math . random ( ) ; } } return A ; } | Test's same eventId being same for the Instantiators at all clients & servers |
234 | public static List < IAType > validatePartitioningExpressions ( ARecordType recType , ARecordType metaRecType , List < List < String > > partitioningExprs , List < Integer > keySourceIndicators , boolean autogenerated ) throws AsterixException { List < IAType > partitioningExprTypes = new ArrayList < IAType > ( partiti... | Rolls back pending events for a particular task. |
235 | public static void d ( String tag , String msg , Object ... args ) { if ( sLevel > LEVEL_DEBUG ) { return ; } if ( args . length > 0 ) { msg = String . format ( msg , args ) ; } Log . d ( tag , msg ) ; } | This is called from the Java Plug-in to print an Applet's contents as EPS to a postscript stream provided by the browser. |
236 | public void start ( ) { managedPorts . add ( createPort ( ) ) ; fixNames ( ) ; ports . addObserver ( observer , false ) ; } | Adds bytes to the buffer |
237 | public HessianDebugOutputStream ( OutputStream os , PrintWriter dbg ) { _os = os ; _state = new HessianDebugState ( dbg ) ; } | Adds the argument to the end of the receiver's list. |
238 | public Configurator fromFile ( File file ) { if ( ! file . exists ( ) ) { throw new FileNotFoundException ( file . getAbsolutePath ( ) + " does not exist." ) ; } return new Configurator ( file . getAbsolutePath ( ) , false ) ; } | Writes a String to a file creating the file if it does not exist using the default encoding for the VM. |
239 | public synchronized void insertText ( String inputtype , String outputtype , String locale , String voice , String outputparams , String style , String effects , String inputtext , String outputtext ) throws SQLException { if ( inputtype == null || outputtype == null || locale == null || voice == null || inputtext == n... | this method will test the functionality of writing and reading one dictionary chunk |
240 | public boolean isEmpty ( ) { return true ; } | Returns a CRC of the remaining bytes in the stream. |
241 | public static boolean isNumericOrPunctuationOrSymbols ( String token ) { int len = token . length ( ) ; for ( int i = 0 ; i < len ; ++ i ) { char c = token . charAt ( i ) ; if ( ! ( Character . isDigit ( c ) || Characters . isPunctuation ( c ) || Characters . isSymbol ( c ) ) ) { return false ; } } return true ; } | get hop distance of one GeneralName from another in links where the names need not have an ancestor/descendant relationship. For example, the hop distance from ou=D,ou=C,o=B,c=US to ou=F,ou=E,ou=C,o=B,c=US is 3: D->C, C->E, E->F. The hop distance from ou=C,o=B,c=US to ou=D,ou=C,o=B,c=US is -1: C->D |
242 | @ Deprecated public DCCppMessage ( String s ) { setBinary ( false ) ; setRetries ( _nRetries ) ; setTimeout ( DCCppMessageTimeout ) ; myMessage = new StringBuilder ( s ) ; _nDataChars = myMessage . length ( ) ; _dataChars = new int [ _nDataChars ] ; } | Install core extensions (that the IPT is configured to use). |
243 | @ Override public void start ( ) throws BaleenException { } | Remove all the element from the db og this <T> instance. |
244 | public ObjectInstance ( ObjectName objectName , String className ) { if ( objectName . isPattern ( ) ) { final IllegalArgumentException iae = new IllegalArgumentException ( "Invalid name->" + objectName . toString ( ) ) ; throw new RuntimeOperationsException ( iae ) ; } this . name = objectName ; this . className = cla... | Stores kth nearest elements (if there are more than one). |
245 | public static void flushEL ( Writer w ) { try { if ( w != null ) w . flush ( ) ; } catch ( Exception e ) { } } | Handles the deselection of all rows in the library table, disabling all necessary buttons and menu items. |
246 | public Dimension maximumLayoutSize ( Container target ) { Dimension size ; synchronized ( this ) { checkContainer ( target ) ; checkRequests ( ) ; size = new Dimension ( xTotal . maximum , yTotal . maximum ) ; } Insets insets = target . getInsets ( ) ; size . width = ( int ) Math . min ( ( long ) size . width + ( long ... | Get the URI as a string specification. See RFC 2396 Section 5.2. |
247 | private void addGroupText ( FormEntryCaption [ ] groups ) { StringBuilder s = new StringBuilder ( "" ) ; String t = "" ; int i ; for ( FormEntryCaption g : groups ) { i = g . getMultiplicity ( ) + 1 ; t = g . getLongText ( ) ; if ( t != null ) { s . append ( t ) ; if ( g . repeats ( ) && i > 0 ) { s . append ( " (" + i... | Used when key is put into a Map to look up the monitor |
248 | public static Number plus ( Number left , Character right ) { return NumberNumberPlus . plus ( left , Integer . valueOf ( right ) ) ; } | Query by HBase rowkey. |
249 | public void addFlag ( OptionID optionid ) { parameters . add ( new ParameterPair ( optionid , Flag . SET ) ) ; } | Creates a new dialog. |
250 | public static ByteBuffer toBuffer ( String spacedHex ) { return ByteBuffer . wrap ( toByteArray ( spacedHex ) ) ; } | Left pad a String with a specified string. Pad to a size of n. |
251 | protected void print ( char v ) throws IOException { os . write ( v ) ; } | Called when the Writer should be opened again - eg when replication replaces all of the index files. |
252 | public void runTest ( ) throws Throwable { Document doc ; NodeList elementList ; Node nameNode ; CharacterData child ; String childData ; doc = ( Document ) load ( "hc_staff" , true ) ; elementList = doc . getElementsByTagName ( "acronym" ) ; nameNode = elementList . item ( 0 ) ; child = ( CharacterData ) nameNode . ge... | Generates the instructions for a switch statement. |
253 | public static boolean isRightTurn ( Point p1 , Point p2 , Point p3 ) { if ( p1 . equals ( p2 ) || p2 . equals ( p3 ) ) { return false ; } double val = ( p2 . x * p3 . y + p1 . x * p2 . y + p3 . x * p1 . y ) - ( p2 . x * p1 . y + p3 . x * p2 . y + p1 . x * p3 . y ) ; return val > 0 ; } | Sorts the provided list by time, most recent first |
254 | private String convertLessThanOneThousand ( int number ) { String soFar ; if ( number % 100 < 20 ) { soFar = numNames [ number % 100 ] ; number /= 100 ; } else { soFar = numNames [ number % 10 ] ; number /= 10 ; String s = Double . toString ( number ) ; if ( s . endsWith ( "2" ) && ! soFar . equals ( "" ) ) soFar = " V... | Add an associated table name into the list to clear. |
255 | public boolean isRefreshTokenExpired ( ) { return refreshTokenExpiresAt . before ( new Date ( ) ) ; } | Returns a list of the names in this object in document order. The returned list is backed by this object and will reflect subsequent changes. It cannot be used to modify this object. Attempts to modify the returned list will result in an exception. |
256 | public static String encodeECC200 ( String codewords , SymbolInfo symbolInfo ) { if ( codewords . length ( ) != symbolInfo . getDataCapacity ( ) ) { throw new IllegalArgumentException ( "The number of codewords does not match the selected symbol" ) ; } StringBuilder sb = new StringBuilder ( symbolInfo . getDataCapacity... | Check all nodes agree to power off Work flow: Each node publishes NOTICED, then wait to see if all other nodes got the NOTICED. If true, continue to publish ACKNOWLEDGED; if false, return false immediately. Poweroff will fail. Same for ACKNOWLEDGED. After a node see others have the ACKNOWLEDGED published, it can power... |
257 | public String toString ( ) { if ( m_FilteredInstances == null ) { return "RandomizableFilteredClassifier: No model built yet." ; } String result = "RandomizableFilteredClassifier using " + getClassifierSpec ( ) + " on data filtered through " + getFilterSpec ( ) + "\n\nFiltered Header\n" + m_FilteredInstances . toString... | True if a CharSequence only contains whitespace characters. |
258 | public void addSlide ( @ NonNull Fragment fragment ) { fragments . add ( fragment ) ; if ( isWizardMode ) { setOffScreenPageLimit ( fragments . size ( ) ) ; } mPagerAdapter . notifyDataSetChanged ( ) ; } | Multiply two numbers of different length and different signs. The first is positive. The first is longer. |
259 | @ Bean public SpringProcessEngineConfiguration activitiProcessEngineConfiguration ( AsyncExecutor activitiAsyncExecutor ) { SpringProcessEngineConfiguration configuration = new SpringProcessEngineConfiguration ( ) ; configuration . setDataSource ( herdDataSource ) ; configuration . setTransactionManager ( herdTransacti... | Produce a string from a double. The string "null" will be returned if the number is not finite. |
260 | protected < T > void runTasksConcurrent ( final List < AbstractTask < T > > tasks ) throws InterruptedException { assert resourceManager . overflowTasksConcurrent >= 0 ; try { final List < Future < T > > futures = resourceManager . getConcurrencyManager ( ) . invokeAll ( tasks , resourceManager . overflowTimeout , Time... | Print a new content tag with no attributes, consisting of an open tag, content text, and a closing tag, all on one line. |
261 | public void initComponents ( ) { setTitle ( Bundle . getMessage ( "WindowTitle" ) ) ; Container contentPane = getContentPane ( ) ; contentPane . setLayout ( new BoxLayout ( contentPane , BoxLayout . Y_AXIS ) ) ; contentPane . add ( initAddressPanel ( ) ) ; contentPane . add ( initNotesPanel ( ) ) ; contentPane . add ( ... | Test Method results in a segmentation fault |
262 | public void makeImmutable ( ) { if ( isMutable ) { isMutable = false ; } } | Multiple solutions where an empty solution appears in the middle of the sequence. |
263 | public void accumulate ( TaggedLogAPIEntity entity ) throws Exception { AggregateAPIEntity current = root ; for ( String groupby : groupbys ) { String tagv = locateGroupbyField ( groupby , entity ) ; if ( tagv == null || tagv . isEmpty ( ) ) { tagv = UNASSIGNED_GROUPBY_ROOT_FIELD_NAME ; } Map < String , AggregateAPIEnt... | set drawable if any thing goes wrong and app don't able to display the particular its display this drawable |
264 | private static double CallDoubleMethodV ( JNIEnvironment env , int objJREF , int methodID , Address argAddress ) throws Exception { if ( traceJNI ) VM . sysWrite ( "JNI called: CallDoubleMethodV \n" ) ; RuntimeEntrypoints . checkJNICountDownToGC ( ) ; try { Object obj = env . getJNIRef ( objJREF ) ; Object returnObj =... | Test verifies that the checksum of the buffer is being computed correctly. |
265 | private final int tradeBonus ( Position pos ) { final int wM = pos . wMtrl ; final int bM = pos . bMtrl ; final int wPawn = pos . wMtrlPawns ; final int bPawn = pos . bMtrlPawns ; final int deltaScore = wM - bM ; int pBonus = 0 ; pBonus += interpolate ( ( deltaScore > 0 ) ? wPawn : bPawn , 0 , - 30 * deltaScore / 100 ,... | Adjust the column widths of a table based on the table contents. |
266 | private List < Vcenter > filterVcentersByTenant ( List < Vcenter > vcenters , URI tenantId ) { List < Vcenter > tenantVcenterList = new ArrayList < Vcenter > ( ) ; Iterator < Vcenter > vcenterIt = vcenters . iterator ( ) ; while ( vcenterIt . hasNext ( ) ) { Vcenter vcenter = vcenterIt . next ( ) ; if ( vcenter == null... | Calculates the time it should take to scroll the given distance (in pixels) |
267 | public void updateVisiblityValue ( int referenceIndex ) { mCachedVisibleArea = mLayoutTab . computeVisibleArea ( ) ; mCachedIndexDistance = Math . abs ( mIndex - referenceIndex ) ; mOrderSortingValue = computeOrderSortingValue ( mCachedIndexDistance , mCacheStackVisibility ) ; mVisiblitySortingValue = computeVisibility... | Runs the test case. |
268 | public boolean contains ( EventPoint ep ) { return events . contains ( ep ) ; } | Sends the given message back in the http response. |
269 | public FacebookException ( String format , Object ... args ) { this ( String . format ( format , args ) ) ; } | Cancel this packet from sending |
270 | private List < String > convertByteArrayListToStringValueList ( List < byte [ ] > dictionaryByteArrayList ) { List < String > valueList = new ArrayList < > ( dictionaryByteArrayList . size ( ) ) ; for ( byte [ ] value : dictionaryByteArrayList ) { valueList . add ( new String ( value , Charset . forName ( CarbonCommonC... | Compute new maxServiceLease and maxEventLease values. This needs to be called whenever the number of services (#S) or number of events (#E) changes, or whenever any of the configuration parameters change. The two base equations driving the computation are: #S/maxServiceLease + #E/maxEventLease <= 1/minRenewalInterval... |
271 | public static void main ( String [ ] args ) { Log . printLine ( "Starting NetworkExample2..." ) ; try { int num_user = 1 ; Calendar calendar = Calendar . getInstance ( ) ; boolean trace_flag = false ; CloudSim . init ( num_user , calendar , trace_flag ) ; Datacenter datacenter0 = createDatacenter ( "Datacenter_0" ) ; D... | Returns an approximate number of words based on number of whitespace blocks. |
272 | private boolean isNanpaNumberWithNationalPrefix ( ) { return ( currentMetadata . getCountryCode ( ) == 1 ) && ( nationalNumber . charAt ( 0 ) == '1' ) && ( nationalNumber . charAt ( 1 ) != '0' ) && ( nationalNumber . charAt ( 1 ) != '1' ) ; } | Format this string by performing the variable replacements. |
273 | public static void zipFiles ( File zip , File ... files ) throws IOException { try ( BufferedOutputStream bufferedOut = new BufferedOutputStream ( new FileOutputStream ( zip ) ) ) { zipFiles ( bufferedOut , files ) ; } } | Write part of a byte string. |
274 | protected void processClientPom ( ) throws IOException { File pom = new File ( projectRoot , CLIENT_POM ) ; String pomContent = readFileContent ( pom ) ; String depString = GEN_START + String . format ( "<dependency>%n<groupId>%s</groupId>%n<artifactId>%s</artifactId>%n</dependency>%n" , mavenGroupId , mavenArtifactId ... | Paints a graphical representation of the object. It just prints the format. |
275 | private void push ( final int type ) { if ( outputStack == null ) { outputStack = new int [ 10 ] ; } int n = outputStack . length ; if ( outputStackTop >= n ) { int [ ] t = new int [ Math . max ( outputStackTop + 1 , 2 * n ) ] ; System . arraycopy ( outputStack , 0 , t , 0 , n ) ; outputStack = t ; } outputStack [ outp... | This method writes data to the in buffer. |
276 | public void put ( URI uri , byte [ ] bimg , BufferedImage img ) { synchronized ( bytemap ) { while ( bytesize > 1000 * 1000 * 50 ) { URI olduri = bytemapAccessQueue . removeFirst ( ) ; byte [ ] oldbimg = bytemap . remove ( olduri ) ; bytesize -= oldbimg . length ; log ( "removed 1 img from byte cache" ) ; } bytemap . p... | Adds a parameters to the method invocation. |
277 | public static void overScrollBy ( final PullToRefreshBase < ? > view , final int deltaX , final int scrollX , final int deltaY , final int scrollY , final int scrollRange , final int fuzzyThreshold , final float scaleFactor , final boolean isTouchEvent ) { final int deltaValue , currentScrollValue , scrollValue ; switc... | Populates fcandSafeNNZ with all <functionKey,hopID> pairs where it is safe to propagate nnz into the function. |
278 | public static AttribKey forAttribute ( Namespaces inScope , ElKey el , String qname ) { Namespaces ns ; String localName ; int colon = qname . indexOf ( ':' ) ; if ( colon < 0 ) { ns = el . ns ; localName = qname ; } else { ns = inScope . forAttrName ( el . ns , qname ) ; if ( ns == null ) { return null ; } ns = inScop... | adds a node event to the cache. |
279 | public void removeMapEventsListener ( MapEventsListener listener ) { if ( mapEventsListeners != null ) { mapEventsListeners . remove ( listener ) ; } } | Create a list from passed objX parameters |
280 | @ RequestMapping ( value = { "/{cg}/{k}" , "{cg}/{k}/" } , method = RequestMethod . GET ) @ ResponseBody public RestWrapper listUsingKey ( @ PathVariable ( "cg" ) String configGroup , @ PathVariable ( "k" ) String key , Principal principal ) { RestWrapper restWrapper = null ; GetGeneralConfig getGeneralConfig = new Get... | Returns a location URI from a source and table name. |
281 | private ColorStateList applyTextAppearance ( Paint p , int resId ) { TextView tv = new TextView ( mContext ) ; if ( SUtils . isApi_23_OrHigher ( ) ) { tv . setTextAppearance ( resId ) ; } else { tv . setTextAppearance ( mContext , resId ) ; } p . setTypeface ( tv . getTypeface ( ) ) ; p . setTextSize ( tv . getTextSize... | Selects the given object in the stepping control, if the object is currently in the combo-box. |
282 | public void removeDiscoveryListener ( DiscoveryListener l ) { synchronized ( registrars ) { if ( terminated ) { throw new IllegalStateException ( "discovery terminated" ) ; } listeners . remove ( l ) ; } } | This method changes image scale (animating zoom for given duration), related to given center (x,y). |
283 | public static void copyFile ( File in , File out ) throws IOException { FileInputStream fis = new FileInputStream ( in ) ; FileOutputStream fos = new FileOutputStream ( out ) ; try { copyStream ( fis , fos ) ; } finally { fis . close ( ) ; fos . close ( ) ; } } | Converts the given integer (given as String or Integer object) to a localized String version. |
284 | private boolean airAppTerminated ( ProcessListener pl ) { if ( pl != null ) { if ( pl . isAIRApp ( ) ) { if ( pl . isProcessDead ( ) ) { return true ; } } } return false ; } | Returns a new iterator that treats the mapped data as big-endian. |
285 | private int xToScreenCoords ( int mapCoord ) { return ( int ) ( mapCoord * map . getScale ( ) - map . getScrollX ( ) ) ; } | Changes the program and arguments of this process builder. |
286 | public Alias filter ( Map < String , Object > filter ) { if ( filter == null || filter . isEmpty ( ) ) { this . filter = null ; return this ; } try { XContentBuilder builder = XContentFactory . contentBuilder ( XContentType . JSON ) ; builder . map ( filter ) ; this . filter = builder . string ( ) ; return this ; } cat... | Copy NodeList members into this nodelist, adding in document order. Null references are not added. |
287 | public void connectToBeanContext ( BeanContext in_bc ) throws PropertyVetoException { if ( in_bc != null ) { in_bc . addBeanContextMembershipListener ( this ) ; beanContextChildSupport . setBeanContext ( in_bc ) ; } } | Print the matrix to the output stream. Line the elements up in columns. Use the format object, and right justify within columns of width characters. Note that is the matrix is to be read back in, you probably will want to use a NumberFormat that is set to US Locale. |
288 | public static CertificateID createCertId ( BigInteger subjectSerialNumber , X509Certificate issuer ) throws Exception { return new CertificateID ( createDigestCalculator ( SHA1_ID ) , new X509CertificateHolder ( issuer . getEncoded ( ) ) , subjectSerialNumber ) ; } | Generate children for specified root element from delphi node |
289 | public static final String convertToText ( final String input , final boolean isXMLExtraction ) { final StringBuffer output_data ; if ( isXMLExtraction ) { final byte [ ] rawData = StringUtils . toBytes ( input ) ; final int length = rawData . length ; int ptr = 0 ; boolean inToken = false ; for ( int i = 0 ; i < lengt... | Add a DropTarget to the list of potential places to receive drop events. |
290 | private int parseKey ( final byte [ ] b , final int off ) throws ParseException { final int bytesToParseLen = b . length - off ; if ( bytesToParseLen >= encryptedKeyLen_ ) { encryptedKey_ = Arrays . copyOfRange ( b , off , off + encryptedKeyLen_ ) ; return encryptedKeyLen_ ; } else { throw new ParseException ( "Not eno... | Asserts if the provided text is part of some text, ignoring any uppercase characters |
291 | private void calculateIntersectPoints ( ) { intersectPoints . clear ( ) ; if ( center . x - menuBounds . left < expandedRadius ) { int dy = ( int ) Math . sqrt ( Math . pow ( expandedRadius , 2 ) - Math . pow ( center . x - menuBounds . left , 2 ) ) ; if ( center . y - dy > menuBounds . top ) { intersectPoints . add ( ... | Generates a title of a content String (reads fist linew which is not empty) |
292 | public static ReplyProcessor21 send ( Set recipients , DM dm , int prId , int bucketId , BucketProfile bp , boolean requireAck ) { if ( recipients . isEmpty ( ) ) { return null ; } ReplyProcessor21 rp = null ; int procId = 0 ; if ( requireAck ) { rp = new ReplyProcessor21 ( dm , recipients ) ; procId = rp . getProcesso... | Returns true if the two sets intersect |
293 | static boolean isCallerSensitive ( MemberName mem ) { if ( ! mem . isInvocable ( ) ) return false ; return mem . isCallerSensitive ( ) || canBeCalledVirtual ( mem ) ; } | Execute a Http Command with a given read Timeout |
294 | public void stopSearch ( ) { mMatchedNode . clear ( ) ; mQueryText . setLength ( 0 ) ; mSearchOverlay . hide ( ) ; mActive = false ; } | Stop all audio players and recorders on navigate. |
295 | boolean persistManagedSchema ( boolean createOnly ) { if ( loader instanceof ZkSolrResourceLoader ) { return persistManagedSchemaToZooKeeper ( createOnly ) ; } File managedSchemaFile = new File ( loader . getConfigDir ( ) , managedSchemaResourceName ) ; OutputStreamWriter writer = null ; try { File parentDir = managedS... | Save lyric to local app directory |
296 | public static String makeXmlSafe ( String text ) { if ( StringUtil . isNullOrEmpty ( text ) ) return "" ; text = text . replace ( ESC_AMPERSAND , "&" ) ; text = text . replace ( "\"" , ESC_QUOTE ) ; text = text . replace ( "&" , ESC_AMPERSAND ) ; text = text . replace ( "'" , ESC_APOSTROPHE ) ; text = text . replace ( ... | Calculate the current burn rate, given a list of datapoints from Amazon AWS. |
297 | private static float strength ( final Collection < Unit > units , final boolean attacking , final boolean sea , final boolean transportsFirst ) { float strength = 0.0F ; if ( units . isEmpty ( ) ) { return strength ; } if ( attacking && Match . noneMatch ( units , Matches . unitHasAttackValueOfAtLeast ( 1 ) ) ) { retur... | Adds fill components to empty cells in the first row and first column of the grid. This ensures that the grid spacing will be the same as shown in the designer. |
298 | final public MutableString toUpperCase ( ) { int n = length ( ) ; final char [ ] a = array ; while ( n -- != 0 ) a [ n ] = Character . toUpperCase ( a [ n ] ) ; changed ( ) ; return this ; } | Check the nullability of the column definitions for the ResultSet matches the expected values. |
299 | @ Override public void handleMousePressed ( ChartCanvas canvas , MouseEvent e ) { this . mousePressedPoint = new Point2D . Double ( e . getX ( ) , e . getY ( ) ) ; } | this function converts between the string passed into the client property and the internal representation (currently and int) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.