idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
11,400 | @ SuppressWarnings ( "unchecked" ) public static < T > Predicate < T > and ( final Predicate < ? extends T > ... ps ) { return c -> { for ( final Predicate < ? extends T > p : ps ) { if ( ! ( ( Predicate < T > ) p ) . test ( c ) ) { return false ; } } return true ; } ; } | Combines many predicates into a predicate that accepts its input only if it passes all predicates . |
11,401 | public static < T > Predicate < T > predicate ( final Function < T , Boolean > predicate ) { return predicate :: apply ; } | Turns a function that results in a boxed Boolean into a Predicate . |
11,402 | public void actionPerformed ( ActionEvent e ) { int x = calendarButton . getWidth ( ) - ( int ) popup . getPreferredSize ( ) . getWidth ( ) ; int y = calendarButton . getY ( ) + calendarButton . getHeight ( ) ; Calendar calendar = Calendar . getInstance ( ) ; Date date = dateEditor . getDate ( ) ; if ( date != null ) {... | Called when the jalendar button was pressed . |
11,403 | public void propertyChange ( PropertyChangeEvent evt ) { if ( evt . getPropertyName ( ) . equals ( "day" ) ) { if ( popup . isVisible ( ) && jcalendar . getCalendar ( ) . get ( Calendar . MONTH ) == jcalendar . monthChooser . getMonth ( ) ) { dateSelected = true ; popup . setVisible ( false ) ; setDate ( jcalendar . ge... | Listens for a date property change or a day property change event from the JCalendar . Updates the date editor and closes the popup . |
11,404 | public void setCalendar ( Calendar calendar ) { if ( calendar == null ) { dateEditor . setDate ( null ) ; } else { dateEditor . setDate ( calendar . getTime ( ) ) ; } } | Sets the calendar . Value null will set the null date on the date editor . |
11,405 | public void setEnabled ( boolean enabled ) { super . setEnabled ( enabled ) ; if ( dateEditor != null ) { dateEditor . setEnabled ( enabled ) ; calendarButton . setEnabled ( enabled ) ; } } | Enable or disable the JDateChooser . |
11,406 | public void setFont ( Font font ) { if ( isInitialized ) { dateEditor . getUiComponent ( ) . setFont ( font ) ; jcalendar . setFont ( font ) ; } super . setFont ( font ) ; } | Sets the font of all subcomponents . |
11,407 | public static void main ( String [ ] s ) { JFrame frame = new JFrame ( "JDateChooser" ) ; JDateChooser dateChooser = new JDateChooser ( ) ; frame . getContentPane ( ) . add ( dateChooser ) ; frame . pack ( ) ; frame . setVisible ( true ) ; } | Creates a JFrame with a JDateChooser inside and can be used for testing . |
11,408 | public int getDays ( ) { switch ( _units ) { case Days : return _amount ; case Weeks : return _amount * 7 ; case Months : if ( _amount <= 1 ) return _amount * 30 ; else if ( _amount < 12 ) return ( _amount * 61 ) / 2 ; else return ( _amount * 365 ) / 12 ; default : throw new UnsupportedOperationException ( ) ; } } | Get amount of this Duration in days |
11,409 | public static boolean compare ( Duration a , Duration b ) { if ( null == a || null == b ) return ( null == a ) && ( null == b ) ; return a . equals ( b ) ; } | Compare two Duration instances |
11,410 | public void setAbove ( T assetToRankAheadOf ) { instance . rankAbove ( asset , assetToRankAheadOf , rankAttribute ) ; asset . save ( ) ; } | Set this Entity ahead of the passed in Entity in rank order . |
11,411 | public void setBelow ( T assetToRankAfter ) { instance . rankBelow ( asset , assetToRankAfter , rankAttribute ) ; asset . save ( ) ; } | Set this Entity after the passed in Entity in rank order . |
11,412 | public void bind ( String flavor , Class < ? extends ConsoleEditor > editorClass ) { flavorMap . put ( flavor , editorClass ) ; } | Binds the specified flavor to the specified class . |
11,413 | public Collection < Issue > getIssues ( IssueFilter filter ) { filter = ( filter == null ) ? new IssueFilter ( ) : filter ; filter . team . clear ( ) ; filter . team . add ( this ) ; return getInstance ( ) . get ( ) . issues ( filter ) ; } | Gets the Issues assigned to this Team . |
11,414 | public Collection < Retrospective > getRetrospectives ( RetrospectiveFilter filter ) { filter = ( filter == null ) ? new RetrospectiveFilter ( ) : filter ; filter . team . clear ( ) ; filter . team . add ( this ) ; return getInstance ( ) . get ( ) . retrospectives ( filter ) ; } | Gets the Retrospectives assigned to this Team . |
11,415 | public String getContextUrl ( HttpServletRequest request ) { StringBuffer url = request . getRequestURL ( ) ; String context = request . getContextPath ( ) ; String contextUrl = url . substring ( 0 , url . indexOf ( context ) + context . length ( ) ) ; return contextUrl ; } | Return the full URL of the context . |
11,416 | public Timestamp parse ( String source , ParsePosition pos ) { if ( nanoPattern ) throw new UnsupportedOperationException ( "Not supporting parsing of nanosecond field." ) ; return Timestamp . of ( dateFormat . parse ( source , pos ) ) ; } | Parses the source at the given position . |
11,417 | public Timestamp parse ( String source ) throws ParseException { ParsePosition pos = new ParsePosition ( 0 ) ; Timestamp result = parse ( source , pos ) ; if ( pos . getIndex ( ) == 0 ) throw new ParseException ( "Unparseable date: \"" + source + "\"" , pos . getErrorIndex ( ) ) ; return result ; } | Parses a String and converts it to a Timestamp . |
11,418 | static String defaultPattern ( Locale locale ) { return ( ( SimpleDateFormat ) DateFormat . getDateTimeInstance ( DateFormat . SHORT , DateFormat . MEDIUM , locale ) ) . toPattern ( ) . replace ( "ss" , "ss.SSS" ) ; } | This method returns the default pattern modified to add millisecond after the seconds . |
11,419 | public Project createSubProject ( String name , DateTime beginDate , Schedule schedule ) { return getInstance ( ) . create ( ) . project ( name , this , beginDate , schedule ) ; } | Create a sub project under this project with a name begin date and optional schedule . |
11,420 | public Project createSubProject ( String name , DateTime beginDate ) { return createSubProject ( name , beginDate , null ) ; } | Create a sub project under this project with a name and begin date . |
11,421 | public Epic createEpic ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . epic ( name , this , attributes ) ; } | Create a new Epic in this Project . |
11,422 | public Defect createDefect ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . defect ( name , this , attributes ) ; } | Create a new Defect in this Project . |
11,423 | public Theme createTheme ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . theme ( name , this , attributes ) ; } | Create a new Theme in this Project . |
11,424 | public Goal createGoal ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . goal ( name , this , attributes ) ; } | Create a new Goal in this Project . |
11,425 | public Request createRequest ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . request ( name , this , attributes ) ; } | Create a new Request in this Project . |
11,426 | public Issue createIssue ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . issue ( name , this , attributes ) ; } | Create a new Issue in this Project . |
11,427 | public Retrospective createRetrospective ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . retrospective ( name , this , attributes ) ; } | Create a new Retrospective in this Project . |
11,428 | public Iteration createIteration ( Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . iteration ( this , attributes ) ; } | Create a new Iteration in the Project where the schedule is defined . Use the suggested system values for the new iteration . |
11,429 | public RegressionPlan createRegressionPlan ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . regressionPlan ( name , this , attributes ) ; } | Creates a new Regression Plan in the Project with additional attributes . |
11,430 | public Environment createEnvironment ( String name , Map < String , Object > attributes ) { return getInstance ( ) . create ( ) . environment ( name , this , attributes ) ; } | Creates a new Environment in the Project with additional attributes . |
11,431 | public Collection < Project > getChildProjects ( ProjectFilter filter , boolean includeSubprojects ) { if ( filter == null ) { filter = new ProjectFilter ( ) ; } filter . parent . clear ( ) ; if ( includeSubprojects ) { filter . parent . addAll ( getThisAndAllChildProjects ( ) ) ; } else { filter . parent . add ( this ... | A collection of sub - projects that belong to this project . |
11,432 | public Collection < Effort > getEffortRecords ( EffortFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new EffortFilter ( ) ; filter . project . clear ( ) ; if ( includeSubprojects ) { for ( Project p : getThisAndAllChildProjects ( ) ) { filter . project . add ( p ) ; } } else { fil... | A collection of Effort records that belong to this project . |
11,433 | public Collection < Epic > getEpics ( EpicFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new EpicFilter ( ) ; return getInstance ( ) . get ( ) . epics ( getFilter ( filter , includeSubprojects ) ) ; } | Get Epics in this Project filtered as specified in the passed in filter . |
11,434 | public Collection < Epic > GetTrackedEpics ( ) { Collection < Project > projects = new ArrayList < Project > ( ) ; projects . add ( this ) ; return getInstance ( ) . get ( ) . trackedEpics ( projects ) ; } | Get tracked Epics that belong to current Project . |
11,435 | public Collection < Story > getStories ( StoryFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new StoryFilter ( ) ; return getInstance ( ) . get ( ) . story ( getFilter ( filter , includeSubprojects ) ) ; } | Get stories in this Project filtered as specified in the passed in filter . |
11,436 | public Collection < Defect > getDefects ( DefectFilter filter , boolean includeSubprojects ) { if ( filter == null ) filter = new DefectFilter ( ) ; return getInstance ( ) . get ( ) . defects ( getFilter ( filter , includeSubprojects ) ) ; } | Get Defects in this Project filtered as specified in the passed in filter . |
11,437 | public Collection < PrimaryWorkitem > getPrimaryWorkitems ( PrimaryWorkitemFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new PrimaryWorkitemFilter ( ) ; return getInstance ( ) . get ( ) . primaryWorkitems ( getFilter ( filter , includeSubprojects ) ) ; } | Get PrimaryWorkitems in this Project filtered as specified in the passed in filter . |
11,438 | public Collection < Iteration > getIterations ( IterationFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new IterationFilter ( ) ; filter . schedule . clear ( ) ; if ( includeSubprojects ) { for ( Project p : getThisAndAllChildProjects ( ) ) { filter . schedule . add ( p . getSched... | Get Iterations in this Project s schedule filtered as specified in the passed in filter . This returns iterations even if the schedule is defined in a parent project . |
11,439 | public Collection < Theme > getThemes ( ThemeFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new ThemeFilter ( ) ; return getInstance ( ) . get ( ) . themes ( getFilter ( filter , includeSubprojects ) ) ; } | Get Themes in this Project filtered as specified in the passed in filter . |
11,440 | public Collection < SecondaryWorkitem > getSecondaryWorkitems ( SecondaryWorkitemFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new SecondaryWorkitemFilter ( ) ; return getInstance ( ) . get ( ) . secondaryWorkitems ( getFilter ( filter , includeSubprojects ) ) ; } | Get SecondaryWorkitems in this Project filtered as specified in the passed in filter . |
11,441 | public Collection < Task > getTasks ( TaskFilter filter ) { filter = ( filter != null ) ? filter : new TaskFilter ( ) ; return getInstance ( ) . get ( ) . tasks ( getFilter ( filter , false ) ) ; } | Get Tasks in this Project filtered as specified in the passed in filter . |
11,442 | public Collection < Request > getRequests ( RequestFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new RequestFilter ( ) ; return getInstance ( ) . get ( ) . requests ( getFilter ( filter , includeSubprojects ) ) ; } | Get Requests in this Project filtered as specified in the passed in filter . |
11,443 | public Collection < Goal > getGoals ( GoalFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new GoalFilter ( ) ; return getInstance ( ) . get ( ) . goals ( getFilter ( filter , includeSubprojects ) ) ; } | Get Goals in this Project filtered as specified in the passed in filter . |
11,444 | public Collection < Retrospective > getRetrospectives ( RetrospectiveFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new RetrospectiveFilter ( ) ; return getInstance ( ) . get ( ) . retrospectives ( getFilter ( filter , includeSubprojects ) ) ; } | Get Retrospective in this Project filtered as specified in the passed in filter . |
11,445 | public Collection < Issue > getIssues ( IssueFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new IssueFilter ( ) ; return getInstance ( ) . get ( ) . issues ( getFilter ( filter , includeSubprojects ) ) ; } | Get Issues in this Project filtered as specified in the passed in filter . |
11,446 | public Collection < RegressionPlan > getRegressionPlans ( RegressionPlanFilter filter , boolean includeSubprojects ) { filter = ( filter != null ) ? filter : new RegressionPlanFilter ( ) ; filter . project . clear ( ) ; if ( includeSubprojects ) { for ( Project project : getThisAndAllChildProjects ( ) ) { filter . proj... | A collection of regression plans that belong to this project . |
11,447 | public Double getTotalEstimate ( PrimaryWorkitemFilter filter , boolean includeChildProjects ) { filter = ( filter != null ) ? filter : new PrimaryWorkitemFilter ( ) ; return getRollup ( "Workitems:PrimaryWorkitem" , "Estimate" , filter , includeChildProjects ) ; } | Retrieves the total estimate for all stories and defects in this project optionally filtered . |
11,448 | public Double getTotalDetailEstimate ( WorkitemFilter filter , boolean includeChildProjects ) { filter = ( filter != null ) ? filter : new WorkitemFilter ( ) ; return getRollup ( "Workitems" , "DetailEstimate" , filter , includeChildProjects ) ; } | Count the total detail estimate for all workitems in this project optionally filtered . |
11,449 | public Double getTotalToDo ( WorkitemFilter filter , boolean includeChildProjects ) { filter = ( filter != null ) ? filter : new WorkitemFilter ( ) ; return getRollup ( "Workitems" , "ToDo" , filter , includeChildProjects ) ; } | Retrieves the total to do for all workitems in this project optionally filtered . |
11,450 | public Double getTotalDone ( WorkitemFilter filter , boolean includeChildProjects ) { filter = ( filter != null ) ? filter : new WorkitemFilter ( ) ; return getRollup ( "Workitems" , "Actuals.Value" , filter , includeChildProjects ) ; } | Retrieves the total done for all workitems in this project optionally filtered . |
11,451 | public Set < String > keySet ( ) throws IOException { Set < String > ret = new HashSet < > ( ) ; JsonParser p = this . getParser ( ) ; JsonToken t ; t = p . nextToken ( ) ; while ( t != null ) { if ( t == JsonToken . FIELD_NAME ) { ret . add ( p . getCurrentName ( ) ) ; } t = p . nextToken ( ) ; } p . close ( ) ; retur... | Return a set of all key names in the component |
11,452 | public String getValue ( String name ) { Properties properties = loadProperties ( ) ; return ( String ) properties . getProperty ( name ) ; } | Get the value associated with name . |
11,453 | public void setValue ( String name , String value ) { Properties properties = loadProperties ( ) ; try ( OutputStream output = new FileOutputStream ( file ) ; ) { properties . setProperty ( name , value ) ; properties . store ( output , "" ) ; output . close ( ) ; } catch ( IOException e ) { logger . warn ( String . fo... | Set the value associated with name . |
11,454 | public synchronized boolean markIsTransaction ( String uuid , boolean isTransaction ) { if ( this . isTransaction == null ) { return false ; } this . isTransaction . put ( uuid , isTransaction ) ; return true ; } | Marks a UUID as either a transaction or a query |
11,455 | public void enterInitState ( Event event ) { logger . debug ( String . format ( "Entered state %s" , fsm . current ( ) ) ) ; ChaincodeMessage message = messageHelper ( event ) ; logger . debug ( String . format ( "[%s]Received %s, initializing chaincode" , shortID ( message ) , message . getType ( ) . toString ( ) ) ) ... | enterInitState will initialize the chaincode if entering init from established . |
11,456 | public void handleTransaction ( ChaincodeMessage message ) { Runnable task = ( ) -> { ChaincodeMessage nextStatemessage = null ; boolean send = true ; try { ChaincodeInput input ; try { input = ChaincodeInput . parseFrom ( message . getPayload ( ) ) ; } catch ( Exception e ) { logger . debug ( String . format ( "[%s]In... | handleTransaction Handles request to execute a transaction . |
11,457 | public void handleQuery ( ChaincodeMessage message ) { Runnable task = ( ) -> { ChaincodeMessage serialSendMessage = null ; try { ChaincodeInput input ; try { input = ChaincodeInput . parseFrom ( message . getPayload ( ) ) ; } catch ( Exception e ) { logger . debug ( String . format ( "[%s]Incorrect payload format. Sen... | handleQuery handles request to execute a query . |
11,458 | public void enterTransactionState ( Event event ) { ChaincodeMessage message = messageHelper ( event ) ; logger . debug ( String . format ( "[%s]Received %s, invoking transaction on chaincode(src:%s, dst:%s)" , shortID ( message ) , message . getType ( ) . toString ( ) , event . src , event . dst ) ) ; if ( message . g... | enterTransactionState will execute chaincode s Run if coming from a TRANSACTION event . |
11,459 | public void afterCompleted ( Event event ) { ChaincodeMessage message = messageHelper ( event ) ; logger . debug ( String . format ( "[%s]sending COMPLETED to validator for tid" , shortID ( message ) ) ) ; try { serialSend ( message ) ; } catch ( Exception e ) { event . cancel ( new Exception ( "send COMPLETED failed %... | afterCompleted will need to handle COMPLETED event by sending message to the peer |
11,460 | public void afterResponse ( Event event ) { ChaincodeMessage message = messageHelper ( event ) ; try { sendChannel ( message ) ; logger . debug ( String . format ( "[%s]Received %s, communicated (state:%s)" , shortID ( message ) , message . getType ( ) , fsm . current ( ) ) ) ; } catch ( Exception e ) { logger . error ... | afterResponse is called to deliver a response or error to the chaincode stub . |
11,461 | public void prepare ( Collection < String > urls , String userAgent ) { List < String > safeUrls = new ArrayList < String > ( urls ) ; FetchThread threads [ ] = new FetchThread [ PREPARE_THREAD_COUNT ] ; for ( int i = 0 ; i < PREPARE_THREAD_COUNT ; i ++ ) { threads [ i ] = new FetchThread ( safeUrls , userAgent ) ; thr... | Prepare the cache to lookup info for a given set of urls . The fetches happen in parallel so this also makes a good option for speeding up bulk lookups . |
11,462 | public static Statistics statisticsOf ( CollectionNumber data ) { IteratorNumber iterator = data . iterator ( ) ; if ( ! iterator . hasNext ( ) ) { return null ; } int count = 0 ; double min = iterator . nextDouble ( ) ; while ( Double . isNaN ( min ) ) { if ( ! iterator . hasNext ( ) ) { return null ; } else { min = i... | Calculates data statistics excluding NaN values . |
11,463 | public static Statistics statisticsOf ( List < Statistics > data ) { if ( data . isEmpty ( ) ) return null ; Iterator < Statistics > iterator = data . iterator ( ) ; if ( ! iterator . hasNext ( ) ) { return null ; } Statistics first = null ; while ( first == null && iterator . hasNext ( ) ) { first = iterator . next ( ... | Aggregates statistical information . |
11,464 | public void start ( String [ ] args ) { Options options = new Options ( ) ; options . addOption ( "a" , "peerAddress" , true , "Address of peer to connect to" ) ; options . addOption ( "s" , "securityEnabled" , false , "Present if security is enabled" ) ; options . addOption ( "i" , "id" , true , "Identity of chaincode... | Start entry point for chaincodes bootstrap . |
11,465 | public static Range range ( final double minValue , final double maxValue ) { if ( minValue > maxValue ) { throw new IllegalArgumentException ( "minValue should be less then or equal to maxValue (" + minValue + ", " + maxValue + ")" ) ; } return new Range ( ) { public Number getMinimum ( ) { return minValue ; } public ... | Range from given min and max . |
11,466 | public static boolean contains ( Range range , Range subrange ) { return range . getMinimum ( ) . doubleValue ( ) <= subrange . getMinimum ( ) . doubleValue ( ) && range . getMaximum ( ) . doubleValue ( ) >= subrange . getMaximum ( ) . doubleValue ( ) ; } | Determines whether the subrange is contained in the range or not . |
11,467 | public static Range sum ( Range range1 , Range range2 ) { if ( range1 . getMinimum ( ) . doubleValue ( ) <= range2 . getMinimum ( ) . doubleValue ( ) ) { if ( range1 . getMaximum ( ) . doubleValue ( ) >= range2 . getMaximum ( ) . doubleValue ( ) ) { return range1 ; } else { return range ( range1 . getMinimum ( ) . doub... | Determines the range that can contain both ranges . If one of the ranges in contained in the other the bigger range is returned . |
11,468 | public static double normalize ( Range range , double value ) { return normalize ( value , range . getMinimum ( ) . doubleValue ( ) , range . getMaximum ( ) . doubleValue ( ) ) ; } | Returns the value normalized within the range . It performs a linear transformation where the minimum value of the range becomes 0 while the maximum becomes 1 . |
11,469 | public static boolean contains ( Range range , double value ) { return value >= range . getMinimum ( ) . doubleValue ( ) && value <= range . getMaximum ( ) . doubleValue ( ) ; } | Determines whether the value is contained by the range or not . |
11,470 | public static double overlap ( Range range , Range otherRange ) { double minOverlap = Math . max ( range . getMinimum ( ) . doubleValue ( ) , otherRange . getMinimum ( ) . doubleValue ( ) ) ; double maxOverlap = Math . min ( range . getMaximum ( ) . doubleValue ( ) , otherRange . getMaximum ( ) . doubleValue ( ) ) ; do... | Percentage from 0 to 1 of the first range that is contained by the second range . |
11,471 | public static boolean isValid ( Range range ) { if ( range == null ) { return false ; } double min = range . getMinimum ( ) . doubleValue ( ) ; double max = range . getMaximum ( ) . doubleValue ( ) ; return min != max && ! Double . isNaN ( min ) && ! Double . isInfinite ( min ) && ! Double . isNaN ( max ) && ! Double .... | Checks whether the range is of non - zero size and the boundaries are neither NaN or Infinity . |
11,472 | private void loadDefaultConfig ( ) { this . configDir = System . getProperty ( CONFIG_DIR_SYS_PROP ) ; if ( this . configDir == null ) { this . configDir = getDefaultConfigDir ( ) ; } if ( this . configDir == null ) { throw new AssertionError ( "eureka.config.dir not specified in " + FALLBACK_CONFIG_FILE ) ; } File con... | Loads the application configuration . |
11,473 | public Collection < Story > getIdentifiedStories ( StoryFilter filter ) { filter = ( filter != null ) ? filter : new StoryFilter ( ) ; filter . identifiedIn . clear ( ) ; filter . identifiedIn . add ( this ) ; return getInstance ( ) . get ( ) . story ( filter ) ; } | A read - only collection of Stories Identified in the Retrospective . |
11,474 | public ChannelFuture respondEventSource ( Object data , String event ) throws Exception { if ( ! nonChunkedResponseOrFirstChunkSent ) { HttpUtil . setTransferEncodingChunked ( response , true ) ; response . headers ( ) . set ( CONTENT_TYPE , "text/event-stream; charset=UTF-8" ) ; return respondText ( "\r\n" ) ; } retur... | To respond event source call this method as many time as you want . |
11,475 | public boolean isTwitterJsonStringRelatedTo ( String tweet , boolean sender , boolean userMentions , boolean retweetOrigin ) { StatusRepresentation s = new StatusRepresentation ( ) ; s . init ( null , tweet ) ; boolean matches = s . isRelatedTo ( this , true , true , true ) ; return matches ; } | Determines whether the Twitter status is related to one of the users in the set of influential contributors . |
11,476 | public synchronized int purge ( ) { int recordsRemaining = - 1 ; SQLiteDatabase db = null ; Cursor cursor = null ; try { db = getWritableDatabase ( ) ; long earliestValidTime = System . currentTimeMillis ( ) - RECORD_EXPIRY_TIME ; int recordsDeleted = db . delete ( ShareRequestTable . NAME , WHERE_CLAUSE_PURGE_POLICY ,... | Purges the database based on the purge policy . |
11,477 | public synchronized void resetProcessingShareRequests ( ) { SQLiteDatabase db = null ; try { db = getWritableDatabase ( ) ; ContentValues values = new ContentValues ( ) ; values . put ( ShareRequestTable . COLUMN_STATE , ShareRequest . STATE_PENDING ) ; int recordsUpdated = db . update ( ShareRequestTable . NAME , valu... | Reset all records that somehow got stuck in a processing state . |
11,478 | public ChainCodeResponse deploy ( DeployRequest deployRequest ) throws ChainCodeException , NoAvailableTCertException , CryptoException , IOException { logger . debug ( String . format ( "Received deploy request: %s" , deployRequest ) ) ; if ( null == getMyTCert ( ) && getChain ( ) . isSecurityEnabled ( ) ) { logger . ... | Issue a deploy transaction |
11,479 | public ChainCodeResponse invoke ( InvokeRequest invokeRequest ) throws ChainCodeException , NoAvailableTCertException , CryptoException , IOException { logger . debug ( String . format ( "Received invoke request: %s" , invokeRequest ) ) ; setAttrs ( invokeRequest . getAttributes ( ) ) ; if ( null == getMyTCert ( ) && g... | Issue an invoke on chaincode |
11,480 | private Fabric . Response execute ( Transaction tx ) throws CryptoException , IOException { logger . debug ( String . format ( "Executing transaction [%s]" , tx ) ) ; tx . getTxBuilder ( ) . setNonce ( ByteString . copyFrom ( this . nonce ) ) ; logger . debug ( "Process Confidentiality..." ) ; this . processConfidentia... | Execute a transaction |
11,481 | public static Object wrappedArray ( CollectionNumber coll ) { Object data = wrappedFloatArray ( coll ) ; if ( data != null ) { return data ; } data = wrappedDoubleArray ( coll ) ; if ( data != null ) { return data ; } data = wrappedByteArray ( coll ) ; if ( data != null ) { return data ; } data = wrappedShortArray ( co... | If available return the array wrapped by the collection - USE WITH CAUTION AS IT EXPOSES THE INTERNAL STATE OF THE COLLECTION . This is provided in case an external routine for computation requires you to use array and you want to avoid the copy for performance reason . |
11,482 | public static String generateParameterHash ( String path , String func , List < String > args ) { logger . debug ( String . format ( "GenerateParameterHash : path=%s, func=%s, args=%s" , path , func , args ) ) ; StringBuilder param = new StringBuilder ( path ) ; param . append ( func ) ; args . forEach ( param :: appen... | Generate parameter hash for the given chain code path func and args |
11,483 | public static void generateTarGz ( String src , String target ) throws IOException { File sourceDirectory = new File ( src ) ; File destinationArchive = new File ( target ) ; String sourcePath = sourceDirectory . getAbsolutePath ( ) ; FileOutputStream destinationOutputStream = new FileOutputStream ( destinationArchive ... | Compress the given directory src to target tar . gz file |
11,484 | public View viewByContentType ( String contentType ) { for ( View view : views . values ( ) ) { if ( view . getContentType ( ) . equals ( contentType ) ) { return view ; } } return null ; } | Return the first view with the given content type . |
11,485 | public String register ( RegistrationRequest req , Member registrar ) throws RegistrationException { if ( StringUtil . isNullOrEmpty ( req . getEnrollmentID ( ) ) ) { throw new IllegalArgumentException ( "EntrollmentID cannot be null or empty" ) ; } if ( registrar == null ) { throw new IllegalArgumentException ( "Regis... | Register the member and return an enrollment secret . |
11,486 | private List < TCert > processTCertBatch ( GetTCertBatchRequest req , TCertCreateSetResp resp ) throws NoSuchPaddingException , InvalidKeyException , NoSuchAlgorithmException , IllegalBlockSizeException , BadPaddingException , InvalidAlgorithmParameterException , CryptoException , IOException { String enrollKey = req .... | Process a batch of tcerts after having retrieved them from the TCA . |
11,487 | public double getRMSError ( ) { double r = covarCalc . getSumSquaredDeviations ( ) / Math . sqrt ( varCalcX . getSumSquaredDeviations ( ) * varCalcY . getSumSquaredDeviations ( ) ) ; return Math . sqrt ( 1 - r ) * varCalcX . getStdDev ( ) ; } | Returns the r . m . s . error of this regression line . |
11,488 | public boolean isSymbolNull ( String name ) { CommandSymbol s = findSymbol ( name ) ; if ( s == null ) return true ; if ( s instanceof VarCommand ) { VarCommand var = ( VarCommand ) s ; Value v = var . getValue ( this ) ; if ( v == null || v . get ( ) == null || v instanceof NilValue ) return true ; } return false ; } | Returns true if the symbol is null or has not been defined . |
11,489 | public final String [ ] tokenize ( String value ) { StringTokenizer stringTokenizer = new StringTokenizer ( value , getDelimiters ( ) ) ; String [ ] broken = new String [ stringTokenizer . countTokens ( ) ] ; for ( int index = 0 ; index < broken . length ; index ++ ) { broken [ index ] = stringTokenizer . nextToken ( )... | Implementation of this method breaks down passed string into tokens . |
11,490 | protected String getLogFormat ( ) { final String [ ] formats = getResources ( ) . getStringArray ( R . array . format_list ) ; if ( mFormat >= 0 && mFormat < formats . length ) { return formats [ mFormat ] ; } return formats [ FORMAT_DEFAULT ] ; } | The log format to use . Default is time . Override to use a different format . Return null to prompt for format . |
11,491 | protected String getMessageText ( final File pZipFile , final PackageManager pPackageManager ) { String version = "" ; try { final PackageInfo pi = pPackageManager . getPackageInfo ( getPackageName ( ) , 0 ) ; version = " " + pi . versionName ; } catch ( final PackageManager . NameNotFoundException e ) { Log . e ( TAG ... | The text of the email . Override to use different text . |
11,492 | protected void beforeWaitForSynchronization ( final T message ) throws CouldNotPerformException { transactionIdField = ProtoBufFieldProcessor . getFieldDescriptor ( message , TransactionIdProvider . TRANSACTION_ID_FIELD_NAME ) ; if ( transactionIdField == null ) { throw new NotAvailableException ( "transaction id field... | Verify that the internal future has a transaction id field and that this field is of type long . |
11,493 | protected boolean check ( T message ) throws CouldNotPerformException { final long transactionId = ( long ) message . getField ( transactionIdField ) ; if ( ! message . hasField ( transactionIdField ) || transactionId == 0 ) { logger . warn ( "Received return value without transactionId" ) ; return true ; } return data... | Verify that the transaction id of the data provider is greater or equal to the transaction id in the given message . |
11,494 | public static FadeTransition createFadeTransition ( final Node node , final double fromValue , final double toValue , final int cycleCount , final double duration ) { assert node != null ; final FadeTransition fadeTransition = new FadeTransition ( Duration . millis ( duration ) , node ) ; fadeTransition . setFromValue ... | Method to create a FadeTransition with several parameters . |
11,495 | public static RotateTransition createRotateTransition ( final Node node , final double fromAngle , final double toAngle , final int cycleCount , final double duration , final Interpolator interpolator , final boolean autoReverse ) { assert node != null ; final RotateTransition rotateTransition = new RotateTransition ( ... | Method to create a RotateTransition with several parameters . |
11,496 | protected void println ( int priority , String msg ) { Log . println ( priority , processTag ( packageName ) , processMessage ( msg ) ) ; } | Print the message . |
11,497 | protected String processMessage ( String msg ) { return String . format ( MSG_FORMAT , Thread . currentThread ( ) . getName ( ) , msg ) ; } | Provide a message for logging . This prepends the current thread to the message . Override this if you want to filter sensitive information or add extra information to each message before dispatching . |
11,498 | protected String processTag ( String packageName ) { final int skipDepth = 6 ; final Thread thread = Thread . currentThread ( ) ; final StackTraceElement trace = thread . getStackTrace ( ) [ skipDepth ] ; return String . format ( TAG_FORMAT , packageName , trace . getFileName ( ) , trace . getLineNumber ( ) ) ; } | Provide a tag for logging . By default this returns a tag with the package name file name and line number of the calling function . Override this to show different information in the tag . |
11,499 | public void waitForData ( ) throws InterruptedException { try { if ( registryRemote == null ) { waitForValue ( ) ; return ; } getRegistryRemote ( ) . waitForData ( ) ; } catch ( CouldNotPerformException ex ) { ExceptionPrinter . printHistory ( "Could not wait until " + getName ( ) + " is ready!" , ex , logger ) ; } } | Method blocks until the remote registry is synchronized . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.