idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
149,500 | public List < ChannelInfo > getChannels ( String connectionName ) { final URI uri = uriWithPath ( "./connections/" + encodePathSegment ( connectionName ) + "/channels/" ) ; return Arrays . asList ( this . rt . getForObject ( uri , ChannelInfo [ ] . class ) ) ; } | Retrieves state and metrics information for all channels on individual connection . | 75 | 14 |
149,501 | public ChannelInfo getChannel ( String name ) { final URI uri = uriWithPath ( "./channels/" + encodePathSegment ( name ) ) ; return this . rt . getForObject ( uri , ChannelInfo . class ) ; } | Retrieves state and metrics information for individual channel . | 55 | 11 |
149,502 | public List < BindingInfo > getQueueBindings ( String vhost , String queue ) { final URI uri = uriWithPath ( "./queues/" + encodePathSegment ( vhost ) + "/" + encodePathSegment ( queue ) + "/bindings" ) ; final BindingInfo [ ] result = this . rt . getForObject ( uri , BindingInfo [ ] . class ) ; return asListOrNull ( result ) ; } | Returns a list of bindings where provided queue is the destination . | 98 | 12 |
149,503 | public void declareShovel ( String vhost , ShovelInfo info ) { Map < String , Object > props = info . getDetails ( ) . getPublishProperties ( ) ; if ( props != null && props . isEmpty ( ) ) { throw new IllegalArgumentException ( "Shovel publish properties must be a non-empty map or null" ) ; } final URI uri = uriWithPath ( "./parameters/shovel/" + encodePathSegment ( vhost ) + "/" + encodePathSegment ( info . getName ( ) ) ) ; this . rt . put ( uri , info ) ; } | Declares a shovel . | 140 | 5 |
149,504 | public void deleteShovel ( String vhost , String shovelname ) { this . deleteIgnoring404 ( uriWithPath ( "./parameters/shovel/" + encodePathSegment ( vhost ) + "/" + encodePathSegment ( shovelname ) ) ) ; } | Deletes the specified shovel from specified virtual host . | 62 | 10 |
149,505 | public void setCharTranslator ( CharacterTranslator charTranslator ) { if ( charTranslator != null ) { this . charTranslator = charTranslator ; this . htmlElementTranslator = null ; this . targetTranslator = null ; } } | Sets the character translator . It will also remove any other translator set . Nothing will happen if the argument is null . | 53 | 24 |
149,506 | public void setHtmlElementTranslator ( HtmlElementTranslator htmlElementTranslator ) { if ( htmlElementTranslator != null ) { this . htmlElementTranslator = htmlElementTranslator ; this . charTranslator = null ; this . targetTranslator = null ; } } | Sets the HTML entity translator . It will also remove any other translator set . Nothing will happen if the argument is null . | 60 | 25 |
149,507 | public AT_CellContext setPadding ( int padding ) { if ( padding > - 1 ) { this . paddingTop = padding ; this . paddingBottom = padding ; this . paddingLeft = padding ; this . paddingRight = padding ; } return this ; } | Sets all padding to the same value . | 54 | 9 |
149,508 | public void setTargetTranslator ( TargetTranslator targetTranslator ) { if ( targetTranslator != null ) { this . targetTranslator = targetTranslator ; this . charTranslator = null ; this . htmlElementTranslator = null ; } } | Sets the target translator . It will also remove any other translator set . Nothing will happen if the argument is null . | 53 | 24 |
149,509 | public static int [ ] longestWord ( LinkedList < AT_Row > rows , int colNumbers ) { if ( rows == null ) { return null ; } if ( rows . size ( ) == 0 ) { return new int [ 0 ] ; } int [ ] ret = new int [ colNumbers ] ; for ( AT_Row row : rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { LinkedList < AT_Cell > cells = row . getCells ( ) ; for ( int i = 0 ; i < cells . size ( ) ; i ++ ) { if ( cells . get ( i ) . getContent ( ) != null ) { String [ ] ar = StringUtils . split ( Object_To_StrBuilder . convert ( cells . get ( i ) . getContent ( ) ) . toString ( ) ) ; for ( int k = 0 ; k < ar . length ; k ++ ) { int count = ar [ k ] . length ( ) + cells . get ( i ) . getContext ( ) . getPaddingLeft ( ) + cells . get ( i ) . getContext ( ) . getPaddingRight ( ) ; if ( count > ret [ i ] ) { ret [ i ] = count ; } } } } } } return ret ; } | Returns an array with the width of the longest word per column calculated from the given table . Default padding will be added per column . Padding for individual columns will be added if defined . | 279 | 37 |
149,510 | public static AT_Row createRule ( TableRowType type , TableRowStyle style ) { Validate . notNull ( type ) ; Validate . validState ( type != TableRowType . UNKNOWN ) ; Validate . validState ( type != TableRowType . CONTENT ) ; Validate . notNull ( style ) ; Validate . validState ( style != TableRowStyle . UNKNOWN ) ; return new AT_Row ( ) { @ Override public TableRowType getType ( ) { return type ; } @ Override public TableRowStyle getStyle ( ) { return style ; } } ; } | Creates a new row representing a rule . | 128 | 9 |
149,511 | public static AT_Row createContentRow ( Object [ ] content , TableRowStyle style ) { Validate . notNull ( content ) ; Validate . notNull ( style ) ; Validate . validState ( style != TableRowStyle . UNKNOWN ) ; LinkedList < AT_Cell > cells = new LinkedList < AT_Cell > ( ) ; for ( Object o : content ) { cells . add ( new AT_Cell ( o ) ) ; } return new AT_Row ( ) { @ Override public TableRowType getType ( ) { return TableRowType . CONTENT ; } @ Override public TableRowStyle getStyle ( ) { return style ; } @ Override public LinkedList < AT_Cell > getCells ( ) { return cells ; } } ; } | Creates a new row with content with given cell context and a normal row style . | 168 | 17 |
149,512 | public AT_Row setPadding ( int padding ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPadding ( padding ) ; } } return this ; } | Sets all padding for all cells in the row to the same value . | 59 | 15 |
149,513 | public AT_Row setPaddingBottom ( int paddingBottom ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingBottom ( paddingBottom ) ; } } return this ; } | Sets the bottom padding for all cells in the row . | 63 | 12 |
149,514 | public AT_Row setPaddingBottomChar ( Character paddingBottomChar ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingBottomChar ( paddingBottomChar ) ; } } return this ; } | Sets the bottom padding character for all cells in the row . | 67 | 13 |
149,515 | public AT_Row setPaddingLeft ( int paddingLeft ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingLeft ( paddingLeft ) ; } } return this ; } | Sets the left padding for all cells in the row . | 63 | 12 |
149,516 | public AT_Row setPaddingLeftChar ( Character paddingLeftChar ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingLeftChar ( paddingLeftChar ) ; } } return this ; } | Sets the left padding character for all cells in the row . | 67 | 13 |
149,517 | public AT_Row setPaddingLeftRight ( int padding ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingLeftRight ( padding ) ; } } return this ; } | Sets left and right padding for all cells in the row . | 63 | 13 |
149,518 | public AT_Row setPaddingRight ( int paddingRight ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingRight ( paddingRight ) ; } } return this ; } | Sets the right padding for all cells in the row . | 63 | 12 |
149,519 | public AT_Row setPaddingRightChar ( Character paddingRightChar ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingRightChar ( paddingRightChar ) ; } } return this ; } | Sets the right padding character for all cells in the row . | 67 | 13 |
149,520 | public AT_Row setPaddingTop ( int paddingTop ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingTop ( paddingTop ) ; } } return this ; } | Sets the top padding for all cells in the row . | 63 | 12 |
149,521 | public AT_Row setPaddingTopBottom ( int padding ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingTopBottom ( padding ) ; } } return this ; } | Sets top and bottom padding for all cells in the row . | 63 | 13 |
149,522 | public AT_Row setPaddingTopChar ( Character paddingTopChar ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingTopChar ( paddingTopChar ) ; } } return this ; } | Sets the top padding character for all cells in the row . | 67 | 13 |
149,523 | public AT_Row setTextAlignment ( TextAlignment textAlignment ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setTextAlignment ( textAlignment ) ; } } return this ; } | Sets the text alignment for all cells in the row . | 67 | 12 |
149,524 | public AT_Row setTargetTranslator ( TargetTranslator targetTranslator ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setTargetTranslator ( targetTranslator ) ; } } return this ; } | Sets the target translator for all cells in the row . It will also remove any other translator set . Nothing will happen if the argument is null . | 67 | 30 |
149,525 | public AT_Row setHtmlElementTranslator ( HtmlElementTranslator htmlElementTranslator ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setHtmlElementTranslator ( htmlElementTranslator ) ; } } return this ; } | Sets the HTML entity translator for all cells in the row . It will also remove any other translator set . Nothing will happen if the argument is null . | 75 | 31 |
149,526 | public AT_Row setCharTranslator ( CharacterTranslator charTranslator ) { if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setCharTranslator ( charTranslator ) ; } } return this ; } | Sets the character translator for all cells in the row . It will also remove any other translator set . Nothing will happen if the argument is null . | 67 | 30 |
149,527 | public AT_Context setFrameLeftRightMargin ( int frameLeft , int frameRight ) { if ( frameRight > - 1 && frameLeft > - 1 ) { this . frameLeftMargin = frameLeft ; this . frameRightMargin = frameRight ; } return this ; } | Sets the left and right frame margin . | 60 | 9 |
149,528 | public AT_Context setFrameTopBottomMargin ( int frameTop , int frameBottom ) { if ( frameTop > - 1 && frameBottom > - 1 ) { this . frameTopMargin = frameTop ; this . frameBottomMargin = frameBottom ; } return this ; } | Sets the top and bottom frame margin . | 60 | 9 |
149,529 | public final void addRule ( TableRowStyle style ) { Validate . notNull ( style ) ; Validate . validState ( style != TableRowStyle . UNKNOWN , "cannot add a rule of unknown style" ) ; this . rows . add ( AT_Row . createRule ( TableRowType . RULE , style ) ) ; } | Adds a rule row to the table with a given style . | 73 | 12 |
149,530 | public AsciiTable setPaddingBottom ( int paddingBottom ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingBottom ( paddingBottom ) ; } } return this ; } | Sets the bottom padding for all cells in the table . | 61 | 12 |
149,531 | public AsciiTable setPaddingBottomChar ( Character paddingBottomChar ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingBottomChar ( paddingBottomChar ) ; } } return this ; } | Sets the bottom padding character for all cells in the table . | 65 | 13 |
149,532 | public AsciiTable setPaddingLeft ( int paddingLeft ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingLeft ( paddingLeft ) ; } } return this ; } | Sets the left padding for all cells in the table . | 61 | 12 |
149,533 | public AsciiTable setPaddingLeftChar ( Character paddingLeftChar ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingLeftChar ( paddingLeftChar ) ; } } return this ; } | Sets the left padding character for all cells in the table . | 65 | 13 |
149,534 | public AsciiTable setPaddingLeftRight ( int padding ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingLeftRight ( padding ) ; } } return this ; } | Sets left and right padding for all cells in the table . | 61 | 13 |
149,535 | public AsciiTable setPaddingRight ( int paddingRight ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingRight ( paddingRight ) ; } } return this ; } | Sets the right padding for all cells in the table . | 61 | 12 |
149,536 | public AsciiTable setPaddingRightChar ( Character paddingRightChar ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingRightChar ( paddingRightChar ) ; } } return this ; } | Sets the right padding character for all cells in the table . | 65 | 13 |
149,537 | public AsciiTable setPaddingTop ( int paddingTop ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingTop ( paddingTop ) ; } } return this ; } | Sets the top padding for all cells in the table . | 61 | 12 |
149,538 | public AsciiTable setPaddingTopChar ( Character paddingTopChar ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingTopChar ( paddingTopChar ) ; } } return this ; } | Sets the top padding character for all cells in the table . | 65 | 13 |
149,539 | public AsciiTable setTextAlignment ( TextAlignment textAlignment ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setTextAlignment ( textAlignment ) ; } } return this ; } | Sets the text alignment for all cells in the table . | 65 | 12 |
149,540 | public AsciiTable setTargetTranslator ( TargetTranslator targetTranslator ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setTargetTranslator ( targetTranslator ) ; } } return this ; } | Sets the target translator for all cells in the table . It will also remove any other translator set . Nothing will happen if the argument is null . | 65 | 30 |
149,541 | public AsciiTable setHtmlElementTranslator ( HtmlElementTranslator htmlElementTranslator ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setHtmlElementTranslator ( htmlElementTranslator ) ; } } return this ; } | Sets the HTML entity translator for all cells in the table . It will also remove any other translator set . Nothing will happen if the argument is null . | 73 | 31 |
149,542 | public AsciiTable setCharTranslator ( CharacterTranslator charTranslator ) { for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setCharTranslator ( charTranslator ) ; } } return this ; } | Sets the character translator for all cells in the table . It will also remove any other translator set . Nothing will happen if the argument is null . | 65 | 30 |
149,543 | public static String base64Encode ( byte [ ] bytes ) { if ( bytes == null ) { throw new IllegalArgumentException ( "Input bytes must not be null." ) ; } if ( bytes . length >= BASE64_UPPER_BOUND ) { throw new IllegalArgumentException ( "Input bytes length must not exceed " + BASE64_UPPER_BOUND ) ; } // Every three bytes is encoded into four characters. // // Example: // input |0 1 0 1 0 0 1 0|0 1 1 0 1 1 1 1|0 1 1 0 0 0 1 0| // encode grouping |0 1 0 1 0 0|1 0 0 1 1 0|1 1 1 1 0 1|1 0 0 0 1 0| // encoded ascii | U | m | 9 | i | int triples = bytes . length / 3 ; // If the number of input bytes is not a multiple of three, padding characters will be added. if ( bytes . length % 3 != 0 ) { triples += 1 ; } // The encoded string will have four characters for every three bytes. char [ ] encoding = new char [ triples << 2 ] ; for ( int in = 0 , out = 0 ; in < bytes . length ; in += 3 , out += 4 ) { int triple = ( bytes [ in ] & 0xff ) << 16 ; if ( in + 1 < bytes . length ) { triple |= ( ( bytes [ in + 1 ] & 0xff ) << 8 ) ; } if ( in + 2 < bytes . length ) { triple |= ( bytes [ in + 2 ] & 0xff ) ; } encoding [ out ] = BASE64_CHARS . charAt ( ( triple >> 18 ) & 0x3f ) ; encoding [ out + 1 ] = BASE64_CHARS . charAt ( ( triple >> 12 ) & 0x3f ) ; encoding [ out + 2 ] = BASE64_CHARS . charAt ( ( triple >> 6 ) & 0x3f ) ; encoding [ out + 3 ] = BASE64_CHARS . charAt ( triple & 0x3f ) ; } // Add padding characters if needed. for ( int i = encoding . length - ( triples * 3 - bytes . length ) ; i < encoding . length ; i ++ ) { encoding [ i ] = ' ' ; } return String . valueOf ( encoding ) ; } | Base64 encodes a byte array . | 508 | 8 |
149,544 | static String md5 ( String input ) { if ( input == null || input . length ( ) == 0 ) { throw new IllegalArgumentException ( "Input string must not be blank." ) ; } try { MessageDigest algorithm = MessageDigest . getInstance ( "MD5" ) ; algorithm . reset ( ) ; algorithm . update ( input . getBytes ( ) ) ; byte [ ] messageDigest = algorithm . digest ( ) ; StringBuilder hexString = new StringBuilder ( ) ; for ( byte messageByte : messageDigest ) { hexString . append ( Integer . toHexString ( ( messageByte & 0xFF ) | 0x100 ) . substring ( 1 , 3 ) ) ; } return hexString . toString ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } | Create an MD5 hash of a string . | 177 | 9 |
149,545 | static byte [ ] hmacSha1 ( StringBuilder message , String key ) { try { Mac mac = Mac . getInstance ( "HmacSHA1" ) ; mac . init ( new SecretKeySpec ( key . getBytes ( ) , "HmacSHA1" ) ) ; return mac . doFinal ( message . toString ( ) . getBytes ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } | Encrypt a string with HMAC - SHA1 using the specified key . | 97 | 15 |
149,546 | @ SuppressWarnings ( "InsecureCryptoUsage" ) // Only used in known-weak crypto "legacy" mode. static byte [ ] aes128Encrypt ( StringBuilder message , String key ) { try { key = normalizeString ( key , 16 ) ; rightPadString ( message , ' ' , 16 ) ; Cipher cipher = Cipher . getInstance ( "AES/ECB/NoPadding" ) ; cipher . init ( Cipher . ENCRYPT_MODE , new SecretKeySpec ( key . getBytes ( ) , "AES" ) ) ; return cipher . doFinal ( message . toString ( ) . getBytes ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } | Encrypt a string with AES - 128 using the specified key . | 161 | 13 |
149,547 | public static Thumbor create ( String host , String key ) { if ( key == null || key . length ( ) == 0 ) { throw new IllegalArgumentException ( "Key must not be blank." ) ; } return new Thumbor ( host , key ) ; } | Create a new instance for the specified host and encryption key . | 58 | 12 |
149,548 | public ThumborUrlBuilder buildImage ( String image ) { if ( image == null || image . length ( ) == 0 ) { throw new IllegalArgumentException ( "Image must not be blank." ) ; } return new ThumborUrlBuilder ( host , key , image ) ; } | Begin building a url for this host with the specified image . | 61 | 12 |
149,549 | public ThumborUrlBuilder resize ( int width , int height ) { if ( width < 0 && width != ORIGINAL_SIZE ) { throw new IllegalArgumentException ( "Width must be a positive number." ) ; } if ( height < 0 && height != ORIGINAL_SIZE ) { throw new IllegalArgumentException ( "Height must be a positive number." ) ; } if ( width == 0 && height == 0 ) { throw new IllegalArgumentException ( "Both width and height must not be zero." ) ; } hasResize = true ; resizeWidth = width ; resizeHeight = height ; return this ; } | Resize picture to desired size . | 130 | 7 |
149,550 | public ThumborUrlBuilder crop ( int top , int left , int bottom , int right ) { if ( top < 0 ) { throw new IllegalArgumentException ( "Top must be greater or equal to zero." ) ; } if ( left < 0 ) { throw new IllegalArgumentException ( "Left must be greater or equal to zero." ) ; } if ( bottom < 1 || bottom <= top ) { throw new IllegalArgumentException ( "Bottom must be greater than zero and top." ) ; } if ( right < 1 || right <= left ) { throw new IllegalArgumentException ( "Right must be greater than zero and left." ) ; } hasCrop = true ; cropTop = top ; cropLeft = left ; cropBottom = bottom ; cropRight = right ; return this ; } | Crop the image between two points . | 167 | 8 |
149,551 | public ThumborUrlBuilder align ( VerticalAlign valign , HorizontalAlign halign ) { return align ( valign ) . align ( halign ) ; } | Set the horizontal and vertical alignment for the image when image gets cropped by resizing . | 36 | 17 |
149,552 | public ThumborUrlBuilder trim ( TrimPixelColor value , int colorTolerance ) { if ( colorTolerance < 0 || colorTolerance > 442 ) { throw new IllegalArgumentException ( "Color tolerance must be between 0 and 442." ) ; } if ( colorTolerance > 0 && value == null ) { throw new IllegalArgumentException ( "Trim pixel color value must not be null." ) ; } isTrim = true ; trimPixelColor = value ; trimColorTolerance = colorTolerance ; return this ; } | Removing surrounding space in image . Get trim color from specified pixel . | 116 | 14 |
149,553 | StringBuilder assembleConfig ( boolean meta ) { StringBuilder builder = new StringBuilder ( ) ; if ( meta ) { builder . append ( PREFIX_META ) ; } if ( isTrim ) { builder . append ( PART_TRIM ) ; if ( trimPixelColor != null ) { builder . append ( ":" ) . append ( trimPixelColor . value ) ; if ( trimColorTolerance > 0 ) { builder . append ( ":" ) . append ( trimColorTolerance ) ; } } builder . append ( "/" ) ; } if ( hasCrop ) { builder . append ( cropLeft ) . append ( "x" ) . append ( cropTop ) // . append ( ":" ) . append ( cropRight ) . append ( "x" ) . append ( cropBottom ) ; builder . append ( "/" ) ; } if ( hasResize ) { if ( fitInStyle != null ) { builder . append ( fitInStyle . value ) . append ( "/" ) ; } if ( flipHorizontally ) { builder . append ( "-" ) ; } if ( resizeWidth == ORIGINAL_SIZE ) { builder . append ( "orig" ) ; } else { builder . append ( resizeWidth ) ; } builder . append ( "x" ) ; if ( flipVertically ) { builder . append ( "-" ) ; } if ( resizeHeight == ORIGINAL_SIZE ) { builder . append ( "orig" ) ; } else { builder . append ( resizeHeight ) ; } if ( isSmart ) { builder . append ( "/" ) . append ( PART_SMART ) ; } else { if ( cropHorizontalAlign != null ) { builder . append ( "/" ) . append ( cropHorizontalAlign . value ) ; } if ( cropVerticalAlign != null ) { builder . append ( "/" ) . append ( cropVerticalAlign . value ) ; } } builder . append ( "/" ) ; } if ( filters != null ) { builder . append ( PART_FILTERS ) ; for ( String filter : filters ) { builder . append ( ":" ) . append ( filter ) ; } builder . append ( "/" ) ; } builder . append ( isLegacy ? md5 ( image ) : image ) ; return builder ; } | Assemble the configuration section of the URL . | 486 | 9 |
149,554 | public static String rgb ( int r , int g , int b ) { if ( r < - 100 || r > 100 ) { throw new IllegalArgumentException ( "Red value must be between -100 and 100, inclusive." ) ; } if ( g < - 100 || g > 100 ) { throw new IllegalArgumentException ( "Green value must be between -100 and 100, inclusive." ) ; } if ( b < - 100 || b > 100 ) { throw new IllegalArgumentException ( "Blue value must be between -100 and 100, inclusive." ) ; } return FILTER_RGB + "(" + r + "," + g + "," + b + ")" ; } | This filter changes the amount of color in each of the three channels . | 145 | 14 |
149,555 | public static String roundCorner ( int radiusInner , int radiusOuter , int color ) { if ( radiusInner < 1 ) { throw new IllegalArgumentException ( "Radius must be greater than zero." ) ; } if ( radiusOuter < 0 ) { throw new IllegalArgumentException ( "Outer radius must be greater than or equal to zero." ) ; } StringBuilder builder = new StringBuilder ( FILTER_ROUND_CORNER ) . append ( "(" ) . append ( radiusInner ) ; if ( radiusOuter > 0 ) { builder . append ( "|" ) . append ( radiusOuter ) ; } final int r = ( color & 0xFF0000 ) >>> 16 ; final int g = ( color & 0xFF00 ) >>> 8 ; final int b = color & 0xFF ; return builder . append ( "," ) // . append ( r ) . append ( "," ) // . append ( g ) . append ( "," ) // . append ( b ) . append ( ")" ) // . toString ( ) ; } | This filter adds rounded corners to the image using the specified color as the background . | 230 | 16 |
149,556 | public static String fill ( int color ) { final String colorCode = Integer . toHexString ( color & 0xFFFFFF ) ; // Strip alpha return FILTER_FILL + "(" + colorCode + ")" ; } | This filter permit to return an image sized exactly as requested wherever is its ratio by filling with chosen color the missing parts . Usually used with fit - in or adaptive - fit - in | 49 | 36 |
149,557 | public static String format ( ImageFormat format ) { if ( format == null ) { throw new IllegalArgumentException ( "You must specify an image format." ) ; } return FILTER_FORMAT + "(" + format . value + ")" ; } | Specify the output format of the image . | 53 | 9 |
149,558 | public static String frame ( String imageUrl ) { if ( imageUrl == null || imageUrl . length ( ) == 0 ) { throw new IllegalArgumentException ( "Image URL must not be blank." ) ; } return FILTER_FRAME + "(" + imageUrl + ")" ; } | This filter uses a 9 - patch to overlay the image . | 62 | 12 |
149,559 | public static String blur ( int radius , int sigma ) { if ( radius < 1 ) { throw new IllegalArgumentException ( "Radius must be greater than zero." ) ; } if ( radius > 150 ) { throw new IllegalArgumentException ( "Radius must be lower or equal than 150." ) ; } if ( sigma < 0 ) { throw new IllegalArgumentException ( "Sigma must be greater than zero." ) ; } return FILTER_BLUR + "(" + radius + "," + sigma + ")" ; } | This filter adds a blur effect to the image using the specified radius and sigma . | 116 | 17 |
149,560 | public boolean start ( SensorManager sensorManager ) { // Already started? if ( accelerometer != null ) { return true ; } accelerometer = sensorManager . getDefaultSensor ( Sensor . TYPE_ACCELEROMETER ) ; // If this phone has an accelerometer, listen to it. if ( accelerometer != null ) { this . sensorManager = sensorManager ; sensorManager . registerListener ( this , accelerometer , SensorManager . SENSOR_DELAY_FASTEST ) ; } return accelerometer != null ; } | Starts listening for shakes on devices with appropriate hardware . | 112 | 11 |
149,561 | public void stop ( ) { if ( accelerometer != null ) { queue . clear ( ) ; sensorManager . unregisterListener ( this , accelerometer ) ; sensorManager = null ; accelerometer = null ; } } | Stops listening . Safe to call when already stopped . Ignored on devices without appropriate hardware . | 45 | 19 |
149,562 | public ItemRequest < Task > findById ( String task ) { String path = String . format ( "/tasks/%s" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns the complete task record for a single task . | 53 | 10 |
149,563 | public ItemRequest < Task > update ( String task ) { String path = String . format ( "/tasks/%s" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "PUT" ) ; } | A specific existing task can be updated by making a PUT request on the URL for that task . Only the fields provided in the data block will be updated ; any unspecified fields will remain unchanged . | 52 | 39 |
149,564 | public ItemRequest < Task > delete ( String task ) { String path = String . format ( "/tasks/%s" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "DELETE" ) ; } | A specific existing task can be deleted by making a DELETE request on the URL for that task . Deleted tasks go into the trash of the user making the delete request . Tasks can be recovered from the trash within a period of 30 days ; afterward they are completely removed from the system . | 54 | 60 |
149,565 | public CollectionRequest < Task > findByProject ( String projectId ) { String path = String . format ( "/projects/%s/tasks" , projectId ) ; return new CollectionRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns the compact task records for all tasks within the given project ordered by their priority within the project . | 58 | 20 |
149,566 | public CollectionRequest < Task > findByTag ( String tag ) { String path = String . format ( "/tags/%s/tasks" , tag ) ; return new CollectionRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns the compact task records for all tasks with the given tag . | 56 | 13 |
149,567 | public CollectionRequest < Task > getTasksWithTag ( String tag ) { String path = String . format ( "/tags/%s/tasks" , tag ) ; return new CollectionRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns the compact task records for all tasks with the given tag . Tasks can have more than one tag at a time . | 58 | 25 |
149,568 | public ItemRequest < Task > dependencies ( String task ) { String path = String . format ( "/tasks/%s/dependencies" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns the compact representations of all of the dependencies of a task . | 55 | 13 |
149,569 | public ItemRequest < Task > dependents ( String task ) { String path = String . format ( "/tasks/%s/dependents" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns the compact representations of all of the dependents of a task . | 56 | 14 |
149,570 | public ItemRequest < Task > removeDependencies ( String task ) { String path = String . format ( "/tasks/%s/removeDependencies" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Unlinks a set of dependencies from this task . | 60 | 10 |
149,571 | public ItemRequest < Task > removeDependents ( String task ) { String path = String . format ( "/tasks/%s/removeDependents" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Unlinks a set of dependents from this task . | 60 | 11 |
149,572 | public ItemRequest < Task > addFollowers ( String task ) { String path = String . format ( "/tasks/%s/addFollowers" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Adds each of the specified followers to the task if they are not already following . Returns the complete updated record for the affected task . | 58 | 26 |
149,573 | public ItemRequest < Task > removeFollowers ( String task ) { String path = String . format ( "/tasks/%s/removeFollowers" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Removes each of the specified followers from the task if they are following . Returns the complete updated record for the affected task . | 58 | 25 |
149,574 | public CollectionRequest < Task > projects ( String task ) { String path = String . format ( "/tasks/%s/projects" , task ) ; return new CollectionRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns a compact representation of all of the projects the task is in . | 54 | 14 |
149,575 | public ItemRequest < Task > addProject ( String task ) { String path = String . format ( "/tasks/%s/addProject" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Adds the task to the specified project in the optional location specified . If no location arguments are given the task will be added to the end of the project . | 56 | 31 |
149,576 | public ItemRequest < Task > removeProject ( String task ) { String path = String . format ( "/tasks/%s/removeProject" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Removes the task from the specified project . The task will still exist in the system but it will not be in the project anymore . | 56 | 27 |
149,577 | public CollectionRequest < Task > tags ( String task ) { String path = String . format ( "/tasks/%s/tags" , task ) ; return new CollectionRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns a compact representation of all of the tags the task has . | 54 | 13 |
149,578 | public ItemRequest < Task > addTag ( String task ) { String path = String . format ( "/tasks/%s/addTag" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Adds a tag to a task . Returns an empty data block . | 56 | 13 |
149,579 | public ItemRequest < Task > removeTag ( String task ) { String path = String . format ( "/tasks/%s/removeTag" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Removes a tag from the task . Returns an empty data block . | 56 | 14 |
149,580 | public CollectionRequest < Task > subtasks ( String task ) { String path = String . format ( "/tasks/%s/subtasks" , task ) ; return new CollectionRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns a compact representation of all of the subtasks of a task . | 57 | 14 |
149,581 | public ItemRequest < Task > addSubtask ( String task ) { String path = String . format ( "/tasks/%s/subtasks" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; } | Creates a new subtask and adds it to the parent task . Returns the full record for the newly created subtask . | 58 | 25 |
149,582 | public CollectionRequest < Task > stories ( String task ) { String path = String . format ( "/tasks/%s/stories" , task ) ; return new CollectionRequest < Task > ( this , Task . class , path , "GET" ) ; } | Returns a compact representation of all of the stories on the task . | 54 | 13 |
149,583 | public ItemRequest < Tag > createInWorkspace ( String workspace ) { String path = String . format ( "/workspaces/%s/tags" , workspace ) ; return new ItemRequest < Tag > ( this , Tag . class , path , "POST" ) ; } | Creates a new tag in a workspace or organization . | 57 | 11 |
149,584 | public ItemRequest < Tag > findById ( String tag ) { String path = String . format ( "/tags/%s" , tag ) ; return new ItemRequest < Tag > ( this , Tag . class , path , "GET" ) ; } | Returns the complete tag record for a single tag . | 52 | 10 |
149,585 | public ItemRequest < Tag > update ( String tag ) { String path = String . format ( "/tags/%s" , tag ) ; return new ItemRequest < Tag > ( this , Tag . class , path , "PUT" ) ; } | Updates the properties of a tag . Only the fields provided in the data block will be updated ; any unspecified fields will remain unchanged . | 51 | 27 |
149,586 | public ItemRequest < Tag > delete ( String tag ) { String path = String . format ( "/tags/%s" , tag ) ; return new ItemRequest < Tag > ( this , Tag . class , path , "DELETE" ) ; } | A specific existing tag can be deleted by making a DELETE request on the URL for that tag . | 53 | 21 |
149,587 | public CollectionRequest < Tag > findByWorkspace ( String workspace ) { String path = String . format ( "/workspaces/%s/tags" , workspace ) ; return new CollectionRequest < Tag > ( this , Tag . class , path , "GET" ) ; } | Returns the compact tag records for all tags in the workspace . | 57 | 12 |
149,588 | public ItemRequest < Project > createInWorkspace ( String workspace ) { String path = String . format ( "/workspaces/%s/projects" , workspace ) ; return new ItemRequest < Project > ( this , Project . class , path , "POST" ) ; } | If the workspace for your project _is_ an organization you must also supply a team to share the project with . | 57 | 23 |
149,589 | public ItemRequest < Project > createInTeam ( String team ) { String path = String . format ( "/teams/%s/projects" , team ) ; return new ItemRequest < Project > ( this , Project . class , path , "POST" ) ; } | Creates a project shared with the given team . | 56 | 10 |
149,590 | public ItemRequest < Project > findById ( String project ) { String path = String . format ( "/projects/%s" , project ) ; return new ItemRequest < Project > ( this , Project . class , path , "GET" ) ; } | Returns the complete project record for a single project . | 52 | 10 |
149,591 | public ItemRequest < Project > update ( String project ) { String path = String . format ( "/projects/%s" , project ) ; return new ItemRequest < Project > ( this , Project . class , path , "PUT" ) ; } | A specific existing project can be updated by making a PUT request on the URL for that project . Only the fields provided in the data block will be updated ; any unspecified fields will remain unchanged . | 51 | 39 |
149,592 | public ItemRequest < Project > delete ( String project ) { String path = String . format ( "/projects/%s" , project ) ; return new ItemRequest < Project > ( this , Project . class , path , "DELETE" ) ; } | A specific existing project can be deleted by making a DELETE request on the URL for that project . | 53 | 21 |
149,593 | public CollectionRequest < Project > findByWorkspace ( String workspace ) { String path = String . format ( "/workspaces/%s/projects" , workspace ) ; return new CollectionRequest < Project > ( this , Project . class , path , "GET" ) ; } | Returns the compact project records for all projects in the workspace . | 57 | 12 |
149,594 | public CollectionRequest < Project > findByTeam ( String team ) { String path = String . format ( "/teams/%s/projects" , team ) ; return new CollectionRequest < Project > ( this , Project . class , path , "GET" ) ; } | Returns the compact project records for all projects in the team . | 56 | 12 |
149,595 | public CollectionRequest < Project > tasks ( String project ) { String path = String . format ( "/projects/%s/tasks" , project ) ; return new CollectionRequest < Project > ( this , Project . class , path , "GET" ) ; } | Returns the compact task records for all tasks within the given project ordered by their priority within the project . Tasks can exist in more than one project at a time . | 54 | 33 |
149,596 | public ItemRequest < Project > addFollowers ( String project ) { String path = String . format ( "/projects/%s/addFollowers" , project ) ; return new ItemRequest < Project > ( this , Project . class , path , "POST" ) ; } | Adds the specified list of users as followers to the project . Followers are a subset of members therefore if the users are not already members of the project they will also become members as a result of this operation . Returns the updated project record . | 57 | 48 |
149,597 | public ItemRequest < Project > removeFollowers ( String project ) { String path = String . format ( "/projects/%s/removeFollowers" , project ) ; return new ItemRequest < Project > ( this , Project . class , path , "POST" ) ; } | Removes the specified list of users from following the project this will not affect project membership status . Returns the updated project record . | 57 | 25 |
149,598 | public ItemRequest < Project > addMembers ( String project ) { String path = String . format ( "/projects/%s/addMembers" , project ) ; return new ItemRequest < Project > ( this , Project . class , path , "POST" ) ; } | Adds the specified list of users as members of the project . Returns the updated project record . | 55 | 18 |
149,599 | public ItemRequest < Project > removeMembers ( String project ) { String path = String . format ( "/projects/%s/removeMembers" , project ) ; return new ItemRequest < Project > ( this , Project . class , path , "POST" ) ; } | Removes the specified list of members from the project . Returns the updated project record . | 55 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.