idx
int64
0
34.9k
question
stringlengths
12
26.4k
target
stringlengths
15
2.15k
34,200
public Week ( int week , Year year ) { if ( ( week < FIRST_WEEK_IN_YEAR ) && ( week > LAST_WEEK_IN_YEAR ) ) { throw new IllegalArgumentException ( "The 'week' argument must be in the range 1 - 53." ) ; } this . week = ( byte ) week ; this . year = ( short ) year . getYear ( ) ; peg ( Calendar . getInstance ( ) ) ; }
Takes a DataCategory structure and builds a list of maps, one value (id) is the dataCategoryId value and the other is an indented string suitable for use in a drop-down pick list.
34,201
public boolean hasChannels ( ) { return mTunerChannels . size ( ) > 0 ; }
Returns a clone of this object with the same selection. This method does not duplicate selection listeners and property listeners.
34,202
public void testConstructorSignBytesPositive3 ( ) { byte aBytes [ ] = { - 12 , 56 , 100 } ; int aSign = 1 ; byte rBytes [ ] = { 0 , - 12 , 56 , 100 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = aNumber . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( "incorrect sign" , 1 , aNumber . signum ( ) ) ; }
Untransform a value from the log axis
34,203
private List < ArgType > consumeExtendsTypesList ( ) { List < ArgType > types = Collections . emptyList ( ) ; boolean next ; do { ArgType argType = consumeType ( ) ; if ( ! argType . equals ( ArgType . OBJECT ) ) { if ( types . isEmpty ( ) ) { types = new LinkedList < ArgType > ( ) ; } types . add ( argType ) ; } next = lookAhead ( ':' ) ; if ( next ) { consume ( ':' ) ; } } while ( next ) ; return types ; }
Put request parameters in request object as attributes.
34,204
public static final double nextDouble ( double value ) { if ( value == Double . POSITIVE_INFINITY ) { return value ; } long bits ; if ( value == 0 ) { bits = 0 ; } else { bits = Double . doubleToLongBits ( value ) ; } return Double . longBitsToDouble ( value < 0 ? bits - 1 : bits + 1 ) ; }
Initializes the configuration framework using the provided parent class loader and install and instance paths.
34,205
private int calculateLayoutWidth ( int widthSize , int mode ) { initResourcesIfNecessary ( ) ; int width = widthSize ; int maxLength = getMaxTextLength ( ) ; if ( maxLength > 0 ) { float textWidth = FloatMath . ceil ( Layout . getDesiredWidth ( "0" , itemsPaint ) ) ; itemsWidth = ( int ) ( maxLength * textWidth ) ; } else { itemsWidth = 0 ; } itemsWidth += ADDITIONAL_ITEMS_SPACE ; labelWidth = 0 ; if ( label != null && label . length ( ) > 0 ) { labelWidth = ( int ) FloatMath . ceil ( Layout . getDesiredWidth ( label , valuePaint ) ) ; } boolean recalculate = false ; if ( mode == MeasureSpec . EXACTLY ) { width = widthSize ; recalculate = true ; } else { width = itemsWidth + labelWidth + 2 * PADDING ; if ( labelWidth > 0 ) { width += LABEL_OFFSET ; } width = Math . max ( width , getSuggestedMinimumWidth ( ) ) ; if ( mode == MeasureSpec . AT_MOST && widthSize < width ) { width = widthSize ; recalculate = true ; } } if ( recalculate ) { int pureWidth = width - LABEL_OFFSET - 2 * PADDING ; if ( pureWidth <= 0 ) { itemsWidth = labelWidth = 0 ; } if ( labelWidth > 0 ) { double newWidthItems = ( double ) itemsWidth * pureWidth / ( itemsWidth + labelWidth ) ; itemsWidth = ( int ) newWidthItems ; labelWidth = pureWidth - itemsWidth ; } else { itemsWidth = pureWidth + LABEL_OFFSET ; } } if ( itemsWidth > 0 ) { createLayouts ( itemsWidth , labelWidth ) ; } return width ; }
Write the constant to the output stream
34,206
private void alignLabels ( ) { final int height = m_selectorLabel . getPreferredSize ( ) . height ; int width = m_selectorLabel . getPreferredSize ( ) . width ; if ( m_editor != null ) { final int labelWidth = m_editor . getLabelWidth ( ) ; if ( width < labelWidth ) { width = labelWidth ; } else { m_editor . setLabelWidth ( width ) ; } } final Dimension dimension = new Dimension ( width , height ) ; m_selectorLabel . setPreferredSize ( dimension ) ; m_selectorLabel . setSize ( dimension ) ; }
Should a navigation bar appear at the bottom of the screen in the current device configuration? A navigation bar may appear on the right side of the screen in certain configurations.
34,207
public void addVetoableChangeListener ( VetoableChangeListener listener ) { if ( m_changeSupport == null ) m_changeSupport = new VetoableChangeSupport ( this ) ; if ( listener != null ) m_changeSupport . addVetoableChangeListener ( listener ) ; }
Searches in this string for the index of the specified string. The search for the string starts at the specified offset and moves towards the beginning of this string.
34,208
public PlainSaslAuthenticatorFactory ( final Vertx vertx ) { this . vertx = Objects . requireNonNull ( vertx ) ; }
Writes the characters from the specified string to the target.
34,209
public int interpolateOutOfBoundsScroll ( RecyclerView recyclerView , int viewSize , int viewSizeOutOfBounds , int totalSize , long msSinceStartScroll ) { final int maxScroll = getMaxDragScroll ( recyclerView ) ; final int absOutOfBounds = Math . abs ( viewSizeOutOfBounds ) ; final int direction = ( int ) Math . signum ( viewSizeOutOfBounds ) ; float outOfBoundsRatio = Math . min ( 1f , 1f * absOutOfBounds / viewSize ) ; final int cappedScroll = ( int ) ( direction * maxScroll * sDragViewScrollCapInterpolator . getInterpolation ( outOfBoundsRatio ) ) ; final float timeRatio ; if ( msSinceStartScroll > DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS ) { timeRatio = 1f ; } else { timeRatio = ( float ) msSinceStartScroll / DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS ; } final int value = ( int ) ( cappedScroll * sDragScrollInterpolator . getInterpolation ( timeRatio ) ) ; if ( value == 0 ) { return viewSizeOutOfBounds > 0 ? 1 : - 1 ; } return value ; }
This method was generated by MyBatis Generator. This method corresponds to the database table attachment
34,210
protected void handleParseConversionException ( Exception e ) throws SAXException { if ( e instanceof RuntimeException ) throw ( RuntimeException ) e ; ParseConversionEvent pce = new ParseConversionEventImpl ( ValidationEvent . ERROR , e . getMessage ( ) , new ValidationEventLocatorImpl ( context . getLocator ( ) ) , e ) ; context . handleEvent ( pce , true ) ; }
Kill all loads. This conservatively handles method calls where we don't really know what fields might be assigned.
34,211
@ Override protected void doGet ( SlingHttpServletRequest request , SlingHttpServletResponse response ) throws ServletException , IOException { final PrintWriter writer = response . getWriter ( ) ; response . setCharacterEncoding ( CharEncoding . UTF_8 ) ; response . setContentType ( "application/json" ) ; List < JcrPackage > packages = packageService . getPackageList ( request ) ; try { JSONArray jsonArray = new JSONArray ( ) ; for ( JcrPackage jcrPackage : packages ) { final JSONObject json = getJsonFromJcrPackage ( jcrPackage ) ; jsonArray . put ( json ) ; } response . setStatus ( SlingHttpServletResponse . SC_OK ) ; writer . write ( jsonArray . toString ( ) ) ; } catch ( JSONException | RepositoryException e ) { LOGGER . error ( "Could not write JSON" , e ) ; response . setStatus ( SlingHttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; } }
Creates a new protobuf handler.
34,212
@ Override public synchronized void maybeStartTrackingJob ( JobStatus job ) { if ( job . hasTimingDelayConstraint ( ) || job . hasDeadlineConstraint ( ) ) { maybeStopTrackingJob ( job ) ; ListIterator < JobStatus > it = mTrackedJobs . listIterator ( mTrackedJobs . size ( ) ) ; while ( it . hasPrevious ( ) ) { JobStatus ts = it . previous ( ) ; if ( ts . getLatestRunTimeElapsed ( ) < job . getLatestRunTimeElapsed ( ) ) { break ; } } it . add ( job ) ; maybeUpdateAlarms ( job . hasTimingDelayConstraint ( ) ? job . getEarliestRunTime ( ) : Long . MAX_VALUE , job . hasDeadlineConstraint ( ) ? job . getLatestRunTimeElapsed ( ) : Long . MAX_VALUE ) ; } }
Remove project filename from the recently-used project list.
34,213
private int modifyAllContacts ( Iterator < String > contactsIter ) { int totalContactsModified = 0 ; while ( contactsIter . hasNext ( ) ) totalContactsModified += modifyContact ( contactsIter . next ( ) , contactsIter . next ( ) ) ; return totalContactsModified ; }
Formats a Span of text in the text view. This method was added as a convenience method so the user doesn't have to use EnumSet for one item.
34,214
private static char [ ] zzUnpackCMap ( String packed ) { char [ ] map = new char [ 0x10000 ] ; int i = 0 ; int j = 0 ; while ( i < 150 ) { int count = packed . charAt ( i ++ ) ; char value = packed . charAt ( i ++ ) ; do map [ j ++ ] = value ; while ( -- count > 0 ) ; } return map ; }
Closes this output stream and releases any system resources associated with the stream.
34,215
private long readChangesetId ( ) { String changesetIdAttribute ; changesetIdAttribute = reader . getAttributeValue ( null , ATTRIBUTE_NAME_CHANGESET_ID ) ; if ( changesetIdAttribute != null ) { return Long . parseLong ( changesetIdAttribute ) ; } else { return 0 ; } }
Check whether a path is a child of specified directory.
34,216
public void deleteAttributes ( int [ ] columnIndices ) { int i ; Arrays . sort ( columnIndices ) ; addUndoPoint ( ) ; m_IgnoreChanges = true ; for ( i = columnIndices . length - 1 ; i >= 0 ; i -- ) { deleteAttributeAt ( columnIndices [ i ] , false ) ; } m_IgnoreChanges = false ; notifyListener ( new TableModelEvent ( this , TableModelEvent . HEADER_ROW ) ) ; }
Print the string as the next value on the line. The value will be escaped or encapsulated as needed if checkForEscape==true
34,217
public static _Fields findByThriftId ( int fieldId ) { switch ( fieldId ) { case 1 : return ID ; case 2 : return PROPERTY ; default : return null ; } }
Sorts the specified range in the array in ascending numerical order.
34,218
public Local newLocal ( String name , Type t ) { return new JimpleLocal ( name . intern ( ) , t ) ; }
Do rotation (plate rotation, not model rotation)
34,219
public void createResourceTicketAsync ( String tenantId , ResourceTicketCreateSpec resourceTicketCreateSpec , final FutureCallback < Task > responseCallback ) throws IOException { String path = String . format ( "%s/%s/resource-tickets" , getBasePath ( ) , tenantId ) ; createObjectAsync ( path , serializeObjectAsJson ( resourceTicketCreateSpec ) , responseCallback ) ; }
Copies the given InputStream to the given OutputStream.
34,220
public void testDoubleValueNeg ( ) { String a = "-123809648392384754573567356745735.63567890295784902768787678287E+21" ; BigDecimal aNumber = new BigDecimal ( a ) ; double result = - 1.2380964839238476E53 ; assertEquals ( "incorrect value" , result , aNumber . doubleValue ( ) , 0 ) ; }
Creates a new external folder with the given project, parent and the external resource that the new instance wraps.
34,221
private static String normalize ( String p ) { if ( p == null ) return "" ; if ( p . endsWith ( "/" ) && p . length ( ) > 1 ) return p . substring ( 0 , p . length ( ) - 1 ) ; return p ; }
Check if a point is within the provided holes.
34,222
public static boolean copyTree ( String sourceDir , String targetRoot ) { boolean result ; try { File source = new File ( sourceDir ) ; File root = new File ( targetRoot ) ; if ( source . exists ( ) == false || source . isDirectory ( ) == false ) { log . error ( "Source path dosn't exsist (\"" + source . getCanonicalPath ( ) + "\"). Can't copy files." ) ; return false ; } if ( root . exists ( ) == false ) { log . error ( "Destination path dosn't exsist (\"" + root . getCanonicalPath ( ) + "\")." ) ; log . info ( "Creating destination directory." ) ; if ( ! root . mkdirs ( ) ) { log . equals ( "Creating destination directory faild!" ) ; return false ; } } String targetRootName = Paths . checkPathEnding ( root . getCanonicalPath ( ) ) ; ArrayList < File > fileNames = listAllFiles ( source , true ) ; result = true ; File target ; for ( File f : fileNames ) { String fullName = f . getCanonicalPath ( ) ; int pos = fullName . indexOf ( sourceDir ) ; String subName = null ; if ( sourceDir . endsWith ( "/" ) ) subName = fullName . substring ( pos + sourceDir . length ( ) ) ; else subName = fullName . substring ( pos + sourceDir . length ( ) + 1 ) ; String targetName = targetRootName + subName ; target = new File ( targetName ) ; if ( f . isDirectory ( ) ) { if ( target . exists ( ) == false ) { boolean st = target . mkdir ( ) ; if ( st == false ) result = false ; } continue ; } boolean st = fileCopy ( f , target ) ; if ( st == false ) result = false ; } } catch ( Exception e ) { e . printStackTrace ( ) ; result = false ; } return result ; }
Acquires credentials for a specified service using initial credential. When the service has a different realm from the initial credential, we do cross-realm authentication - first, we use the current credential to get a cross-realm credential from the local KDC, then use that cross-realm credential to request service credential from the foreigh KDC.
34,223
protected void appendCharType ( StringBuilder sb , FieldType fieldType , int fieldWidth ) { sb . append ( "CHAR" ) ; }
Sets the request timeout.
34,224
private void addToken ( Token token ) { tokens . add ( token ) ; }
Internal function used in the implementation of print_info
34,225
private synchronized void addBuffer ( String line ) { if ( buffer != null ) { buffer . add ( line ) ; } }
Parses an integer, with range-checking.
34,226
@ VisibleForTesting protected String createPrefixesInformation ( ) { StringBuilder prefixBuilder = new StringBuilder ( ) ; for ( String pre : prefixes . keySet ( ) ) { prefixBuilder . append ( "@prefix " ) ; prefixBuilder . append ( pre ) ; prefixBuilder . append ( ": <" ) ; prefixBuilder . append ( prefixes . get ( pre ) ) ; prefixBuilder . append ( "> .\n" ) ; } return prefixBuilder . toString ( ) ; }
Accepts a new socket.
34,227
public static Map < String , Object > dayStartCapacityAvailable ( GenericValue techDataCalendarWeek , int dayStart ) { Map < String , Object > result = FastMap . newInstance ( ) ; int moveDay = 0 ; Double capacity = null ; Time startTime = null ; while ( capacity == null || capacity . doubleValue ( ) == 0 ) { switch ( dayStart ) { case Calendar . MONDAY : capacity = techDataCalendarWeek . getDouble ( "mondayCapacity" ) ; startTime = techDataCalendarWeek . getTime ( "mondayStartTime" ) ; break ; case Calendar . TUESDAY : capacity = techDataCalendarWeek . getDouble ( "tuesdayCapacity" ) ; startTime = techDataCalendarWeek . getTime ( "tuesdayStartTime" ) ; break ; case Calendar . WEDNESDAY : capacity = techDataCalendarWeek . getDouble ( "wednesdayCapacity" ) ; startTime = techDataCalendarWeek . getTime ( "wednesdayStartTime" ) ; break ; case Calendar . THURSDAY : capacity = techDataCalendarWeek . getDouble ( "thursdayCapacity" ) ; startTime = techDataCalendarWeek . getTime ( "thursdayStartTime" ) ; break ; case Calendar . FRIDAY : capacity = techDataCalendarWeek . getDouble ( "fridayCapacity" ) ; startTime = techDataCalendarWeek . getTime ( "fridayStartTime" ) ; break ; case Calendar . SATURDAY : capacity = techDataCalendarWeek . getDouble ( "saturdayCapacity" ) ; startTime = techDataCalendarWeek . getTime ( "saturdayStartTime" ) ; break ; case Calendar . SUNDAY : capacity = techDataCalendarWeek . getDouble ( "sundayCapacity" ) ; startTime = techDataCalendarWeek . getTime ( "sundayStartTime" ) ; break ; } if ( capacity == null || capacity . doubleValue ( ) == 0 ) { moveDay += 1 ; dayStart = ( dayStart == 7 ) ? 1 : dayStart + 1 ; } } result . put ( "capacity" , capacity ) ; result . put ( "startTime" , startTime ) ; result . put ( "moveDay" , Integer . valueOf ( moveDay ) ) ; return result ; }
Notify it when a new turn happens.
34,228
public static byte [ ] decode ( String encoded ) { if ( encoded == null ) { return null ; } char [ ] base64Data = encoded . toCharArray ( ) ; int len = removeWhiteSpace ( base64Data ) ; if ( len % FOURBYTE != 0 ) { return null ; } int numberQuadruple = ( len / FOURBYTE ) ; if ( numberQuadruple == 0 ) { return new byte [ 0 ] ; } byte decodedData [ ] = null ; byte b1 = 0 , b2 = 0 , b3 = 0 , b4 = 0 ; char d1 = 0 , d2 = 0 , d3 = 0 , d4 = 0 ; int i = 0 ; int encodedIndex = 0 ; int dataIndex = 0 ; decodedData = new byte [ ( numberQuadruple ) * 3 ] ; for ( ; i < numberQuadruple - 1 ; i ++ ) { if ( ! isData ( ( d1 = base64Data [ dataIndex ++ ] ) ) || ! isData ( ( d2 = base64Data [ dataIndex ++ ] ) ) || ! isData ( ( d3 = base64Data [ dataIndex ++ ] ) ) || ! isData ( ( d4 = base64Data [ dataIndex ++ ] ) ) ) { return null ; } b1 = base64Alphabet [ d1 ] ; b2 = base64Alphabet [ d2 ] ; b3 = base64Alphabet [ d3 ] ; b4 = base64Alphabet [ d4 ] ; decodedData [ encodedIndex ++ ] = ( byte ) ( b1 << 2 | b2 > > 4 ) ; decodedData [ encodedIndex ++ ] = ( byte ) ( ( ( b2 & 0xf ) << 4 ) | ( ( b3 > > 2 ) & 0xf ) ) ; decodedData [ encodedIndex ++ ] = ( byte ) ( b3 << 6 | b4 ) ; } if ( ! isData ( ( d1 = base64Data [ dataIndex ++ ] ) ) || ! isData ( ( d2 = base64Data [ dataIndex ++ ] ) ) ) { return null ; } b1 = base64Alphabet [ d1 ] ; b2 = base64Alphabet [ d2 ] ; d3 = base64Data [ dataIndex ++ ] ; d4 = base64Data [ dataIndex ++ ] ; if ( ! isData ( ( d3 ) ) || ! isData ( ( d4 ) ) ) { if ( isPad ( d3 ) && isPad ( d4 ) ) { if ( ( b2 & 0xf ) != 0 ) { return null ; } byte [ ] tmp = new byte [ i * 3 + 1 ] ; System . arraycopy ( decodedData , 0 , tmp , 0 , i * 3 ) ; tmp [ encodedIndex ] = ( byte ) ( b1 << 2 | b2 > > 4 ) ; return tmp ; } else if ( ! isPad ( d3 ) && isPad ( d4 ) ) { b3 = base64Alphabet [ d3 ] ; if ( ( b3 & 0x3 ) != 0 ) { return null ; } byte [ ] tmp = new byte [ i * 3 + 2 ] ; System . arraycopy ( decodedData , 0 , tmp , 0 , i * 3 ) ; tmp [ encodedIndex ++ ] = ( byte ) ( b1 << 2 | b2 > > 4 ) ; tmp [ encodedIndex ] = ( byte ) ( ( ( b2 & 0xf ) << 4 ) | ( ( b3 > > 2 ) & 0xf ) ) ; return tmp ; } else { return null ; } } else { b3 = base64Alphabet [ d3 ] ; b4 = base64Alphabet [ d4 ] ; decodedData [ encodedIndex ++ ] = ( byte ) ( b1 << 2 | b2 > > 4 ) ; decodedData [ encodedIndex ++ ] = ( byte ) ( ( ( b2 & 0xf ) << 4 ) | ( ( b3 > > 2 ) & 0xf ) ) ; decodedData [ encodedIndex ++ ] = ( byte ) ( b3 << 6 | b4 ) ; } return decodedData ; }
Alternate decode interface that takes a String containing the encoded buffer and returns a byte array containing the data.
34,229
private static void sbrQmfAnalysis ( FFT mdct , float in [ ] , float x [ ] , float z [ ] , float W [ ] [ ] [ ] [ ] , int bufIdx ) { System . arraycopy ( x , 1024 , x , 0 , 320 - 32 ) ; System . arraycopy ( in , 0 , x , 288 , 1024 ) ; int xOffset = 0 ; for ( int i = 0 ; i < 32 ; i ++ ) { FloatDSP . vectorFmulReverse ( z , 0 , AacSbrData . sbr_qmf_window_ds , 0 , x , xOffset , 320 ) ; SBRDSP . sum64x5 ( z , 0 ) ; SBRDSP . qmfPreShuffle ( z , 0 ) ; mdct . imdctHalf ( z , 0 , z , 64 ) ; SBRDSP . qmfPostShuffle ( W [ bufIdx ] [ i ] , z , 0 ) ; xOffset += 32 ; } }
Generates the _jspDestroy() method which is responsible for calling the release() method on every tag handler in any of the tag handler pools.
34,230
public String composeOtpAttribute ( OTPUserRecord otpUserRecord ) throws PwmUnrecoverableException { String value = "" ; if ( otpUserRecord != null ) { final Configuration config = pwmApplication . getConfig ( ) ; final OTPStorageFormat format = config . readSettingAsEnum ( PwmSetting . OTP_SECRET_STORAGEFORMAT , OTPStorageFormat . class ) ; switch ( format ) { case PWM : value = JsonUtil . serialize ( otpUserRecord ) ; break ; case OTPURL : value = OTPUrlUtil . composeOtpUrl ( otpUserRecord ) ; break ; case BASE32SECRET : value = otpUserRecord . getSecret ( ) ; break ; case PAM : value = OTPPamUtil . composePamData ( otpUserRecord ) ; break ; default : String errorStr = String . format ( "Unsupported storage format: " , format . toString ( ) ) ; ErrorInformation error = new ErrorInformation ( PwmError . ERROR_INVALID_CONFIG , errorStr ) ; throw new PwmUnrecoverableException ( error ) ; } } return value ; }
Check to see that all of the partitions are from the same table.
34,231
public void print ( String message ) { String [ ] lines = message . split ( "\n" ) ; for ( String line : lines ) { view . print ( line ) ; } view . scrollBottom ( ) ; PartPresenter activePart = partStack . getActivePart ( ) ; if ( activePart == null || ! activePart . equals ( this ) ) { isUnread = true ; } }
Run a manageprofile command.
34,232
public NodeSetDTM ( NodeList nodeList , XPathContext xctxt ) { super ( ) ; m_manager = xctxt . getDTMManager ( ) ; int n = nodeList . getLength ( ) ; for ( int i = 0 ; i < n ; i ++ ) { Node node = nodeList . item ( i ) ; int handle = xctxt . getDTMHandleFromNode ( node ) ; addNode ( handle ) ; } }
Brings up the page dialog.
34,233
private boolean isPending ( BlockMirror mirror ) { return ! isInactive ( mirror ) && isNullOrEmpty ( mirror . getSynchronizedInstance ( ) ) ; }
Creates an IdsQuery using the specified type, IDs and routing per id.
34,234
void constructNode ( String nodeName , String prefix , String nodeNamespace , TransformerImpl transformer ) throws TransformerException { if ( null != nodeName && nodeName . length ( ) > 0 ) { SerializationHandler rhandler = transformer . getSerializationHandler ( ) ; String val = transformer . transformToString ( this ) ; try { String localName = QName . getLocalPart ( nodeName ) ; if ( prefix != null && prefix . length ( ) > 0 ) { rhandler . addAttribute ( nodeNamespace , localName , nodeName , "CDATA" , val , true ) ; } else { rhandler . addAttribute ( "" , localName , nodeName , "CDATA" , val , true ) ; } } catch ( SAXException e ) { } } }
Get a list of user requests
34,235
public synchronized void addTextListener ( TextListener cl ) { m_textListeners . addElement ( cl ) ; }
Pre-generate enough keys to reach the lookahead size. You can call this if you need to explicitly invoke the lookahead procedure, but it's normally unnecessary as it will be done automatically when needed.
34,236
public static < T > T min ( Collection < ? extends T > collection , Comparator < ? super T > comparator ) { if ( comparator == null ) { @ SuppressWarnings ( "unchecked" ) T result = ( T ) min ( ( Collection < Comparable > ) collection ) ; return result ; } Iterator < ? extends T > it = collection . iterator ( ) ; T min = it . next ( ) ; while ( it . hasNext ( ) ) { T next = it . next ( ) ; if ( comparator . compare ( min , next ) > 0 ) { min = next ; } } return min ; }
Decode the Base64-encoded data in input and return the data in a new byte array. <p>The padding '=' characters at the end are considered optional, but if any are present, there must be the correct number of them.
34,237
@ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { QueryCommand cmd = QueryCommand . UNKNOWN ; String param = request . getParameter ( "param" ) ; String value = request . getParameter ( "value" ) ; PrintWriter out = response . getWriter ( ) ; String cmdStr = request . getParameter ( "cmd" ) ; if ( cmdStr != null ) { cmd = QueryCommand . valueOf ( cmdStr ) ; } HttpSession session ; switch ( cmd ) { case SET : session = request . getSession ( ) ; session . setAttribute ( param , value ) ; break ; case GET : session = request . getSession ( ) ; String val = ( String ) session . getAttribute ( param ) ; if ( val != null ) { out . write ( val ) ; } break ; case INVALIDATE : session = request . getSession ( ) ; session . invalidate ( ) ; break ; case CALLBACK : Callback c = ( Callback ) context . getAttribute ( "callback" ) ; c . call ( request , response ) ; break ; } }
Report download progress through the database if necessary.
34,238
public TelnetTerminalServer ( int port ) throws IOException { this ( ServerSocketFactory . getDefault ( ) , port ) ; }
Checks if the item is available in the cache.
34,239
protected boolean launchAssignToClusters ( Instances insts , int [ ] clusterAssignments ) throws Exception { int numPerTask = insts . numInstances ( ) / m_executionSlots ; List < Future < Boolean > > results = new ArrayList < Future < Boolean > > ( ) ; for ( int i = 0 ; i < m_executionSlots ; i ++ ) { int start = i * numPerTask ; int end = start + numPerTask ; if ( i == m_executionSlots - 1 ) { end = insts . numInstances ( ) ; } Future < Boolean > futureKM = m_executorPool . submit ( new KMeansClusterTask ( insts , start , end , clusterAssignments ) ) ; results . add ( futureKM ) ; } boolean converged = true ; for ( Future < Boolean > f : results ) { if ( ! f . get ( ) ) { converged = false ; } } return converged ; }
Initiates a learning process.
34,240
public static double [ ] convexHull ( double [ ] pts , int len , float [ ] angles , int [ ] idx , int [ ] stack ) { int plen = len / 2 - 1 ; if ( len < 6 ) { throw new IllegalArgumentException ( "Input must have at least 3 points" ) ; } if ( angles . length < plen || idx . length < plen || stack . length < len / 2 ) { throw new IllegalArgumentException ( "Pre-allocated data structure too small" ) ; } int i0 = 0 ; for ( int i = 2 ; i < len ; i += 2 ) { if ( pts [ i + 1 ] < pts [ i0 + 1 ] ) { i0 = i ; } else if ( pts [ i + 1 ] == pts [ i0 + 1 ] ) { i0 = ( pts [ i ] < pts [ i0 ] ? i : i0 ) ; } } for ( int i = 0 , j = 0 ; i < len ; i += 2 ) { if ( i == i0 ) continue ; angles [ j ] = ( float ) Math . atan2 ( pts [ i + 1 ] - pts [ i0 + 1 ] , pts [ i ] - pts [ i0 ] ) ; idx [ j ++ ] = i ; } ArrayLib . sort ( angles , idx , plen ) ; float angle = angles [ 0 ] ; int ti = 0 , tj = idx [ 0 ] ; for ( int i = 1 ; i < plen ; i ++ ) { int j = idx [ i ] ; if ( angle == angles [ i ] ) { double x1 = pts [ tj ] - pts [ i0 ] ; double y1 = pts [ tj + 1 ] - pts [ i0 + 1 ] ; double x2 = pts [ j ] - pts [ i0 ] ; double y2 = pts [ j + 1 ] - pts [ i0 + 1 ] ; double d1 = x1 * x1 + y1 * y1 ; double d2 = x2 * x2 + y2 * y2 ; if ( d1 >= d2 ) { idx [ i ] = - 1 ; } else { idx [ ti ] = - 1 ; angle = angles [ i ] ; ti = i ; tj = j ; } } else { angle = angles [ i ] ; ti = i ; tj = j ; } } int sp = 0 ; stack [ sp ++ ] = i0 ; int j = 0 ; for ( int k = 0 ; k < 2 ; j ++ ) { if ( idx [ j ] != - 1 ) { stack [ sp ++ ] = idx [ j ] ; k ++ ; } } for ( ; j < plen ; j ++ ) { if ( idx [ j ] == - 1 ) continue ; while ( isNonLeft ( i0 , stack [ sp - 2 ] , stack [ sp - 1 ] , idx [ j ] , pts ) ) { sp -- ; } stack [ sp ++ ] = idx [ j ] ; } double [ ] hull = new double [ 2 * sp ] ; for ( int i = 0 ; i < sp ; i ++ ) { hull [ 2 * i ] = pts [ stack [ i ] ] ; hull [ 2 * i + 1 ] = pts [ stack [ i ] + 1 ] ; } return hull ; }
Method for BeanContextChild interface.
34,241
ListBasedTokenStream ( List < AttributeSource > tokens ) { this . tokens = tokens ; tokenIterator = tokens . iterator ( ) ; }
Unregister SSO client for this token.
34,242
private int measureShort ( int measureSpec ) { int result ; int specMode = MeasureSpec . getMode ( measureSpec ) ; int specSize = MeasureSpec . getSize ( measureSpec ) ; if ( specMode == MeasureSpec . EXACTLY ) { result = specSize ; } else { result = ( int ) ( 2 * mRadius + getPaddingTop ( ) + getPaddingBottom ( ) + 1 ) ; if ( specMode == MeasureSpec . AT_MOST ) { result = Math . min ( result , specSize ) ; } } return result ; }
Main orchestration method that will compare two Raml models together and identify discrepancies between the implementation and contract
34,243
public static byte [ ] gzip ( String input ) { FastByteArrayOutputStream baos = new FastByteArrayOutputStream ( ) ; PGZIPOutputStream gzos = null ; try { gzos = new PGZIPOutputStream ( baos ) ; gzos . write ( input . getBytes ( "UTF-8" ) ) ; } catch ( IOException e ) { MainUtil . handleError ( e ) ; } finally { if ( gzos != null ) try { gzos . close ( ) ; } catch ( IOException ignore ) { } } return baos . toByteArray ( ) ; }
Validate the syntax port.
34,244
private String makeGetterMethodName ( Field field ) { String getterMethodPrefix ; String fieldName = field . getName ( ) ; if ( isPrimitiveBooleanType ( field ) ) { if ( fieldName . matches ( "^is[A-Z]{1}.*$" ) ) { fieldName = fieldName . substring ( 2 ) ; } getterMethodPrefix = "is" ; } else { getterMethodPrefix = "get" ; } if ( fieldName . matches ( "^[a-z]{1}[A-Z]{1}.*" ) ) { return getterMethodPrefix + fieldName ; } else { return getterMethodPrefix + BaseUtility . capitalize ( fieldName ) ; } }
Returns true for a smallmem configuration
34,245
public static void calculatePendingGroupDiffs ( MitroRequestContext context , Collection < ? extends PendingGroup > pendingGroupsList , DBGroup org , Map < String , DBGroup > existingGroups , Map < String , GroupDiff > diffs , Map < String , MemberList > pendingGroupMap , String scope ) throws MitroServletException , SQLException { assert scope != null || pendingGroupsList . isEmpty ( ) ; for ( PendingGroup pg : pendingGroupsList ) { AddPendingGroupRequest . MemberList ml = gson . fromJson ( pg . memberListJson , AddPendingGroupRequest . MemberList . class ) ; assert ( null != ml ) : "you cannot have a null MemberList" ; for ( String user : ml . memberList ) { assert Util . isEmailAddress ( user ) : "invalid email: '" + user + "'" ; } pendingGroupMap . put ( pg . groupName , ml ) ; } for ( DBGroup g : org . getAllOrgGroups ( context . manager ) ) { if ( scope != null && scope . equals ( g . getScope ( ) ) ) { existingGroups . put ( g . getName ( ) , g ) ; } } Set < String > allGroupNames = Sets . union ( pendingGroupMap . keySet ( ) , existingGroups . keySet ( ) ) ; for ( String groupName : allGroupNames ) { diffGroupPair ( context , diffs , groupName , existingGroups . get ( groupName ) , pendingGroupMap . get ( groupName ) ) ; } }
Creates a new MFCC object. 40 mel-filters are place in the range from 20 to 16000 Hz.
34,246
public synchronized void flush ( ) throws IOException { checkNotClosed ( ) ; trimToSize ( ) ; journalWriter . flush ( ) ; }
Update the rows to show the relation directions for the supplied edge matcher.
34,247
public void close ( ) throws IOException { if ( ! closed ) { try { if ( ! eof ) { exhaustInputStream ( this ) ; } } finally { eof = true ; closed = true ; } } }
Creates a native entity parser.
34,248
public static byte [ ] decode ( String str , int flags ) { return decode ( str . getBytes ( ) , flags ) ; }
Create a new predicate returning true when the input String starts with the given pattern.
34,249
public float computeDistanceTo ( float x , float y ) { final RectF bounds = getClickTargetBounds ( ) ; float dx = Math . max ( bounds . left - x , x - bounds . right ) ; float dy = Math . max ( bounds . top - y , y - bounds . bottom ) ; return Math . max ( 0.0f , Math . max ( dx , dy ) ) ; }
Helper method to map an unsupported XML encoding to a similar encoding. <p/> Currently limited to processing windows-1252 encoding.
34,250
public void add ( Collection < RuleGrounding > alternatives ) { boolean foundSuccess = false ; for ( RuleGrounding g : alternatives ) { if ( ! g . isFailed ( ) ) { add ( g ) ; foundSuccess = true ; } } if ( ! foundSuccess ) { groundings . clear ( ) ; } }
Load profiles from specified directory. This method must be called once before language detection.
34,251
public static List < PythonInstallationDirectory > whereArePythonInterpreters ( ) { final List < PythonInstallationDirectory > paths = new ArrayList < > ( ) ; for ( final SuiteExecutor interpreter : EnumSet . allOf ( SuiteExecutor . class ) ) { paths . addAll ( whereIsPythonInterpreter ( interpreter ) ) ; } return paths ; }
Returns the next available reference from the queue, removing it in the process. Waits for a reference to become available or the given timeout period to elapse, whichever happens first.
34,252
private void findSessionId ( byte [ ] b , int off , int len ) { String sessionStart = new String ( b , off , len ) ; int traceStartIdx = sessionStart . indexOf ( START_TEXT ) ; int sessionIdStart = - 1 ; int sessionIdEnd = - 1 ; if ( traceStartIdx >= 0 ) { sessionIdStart = traceStartIdx + START_TEXT . length ( ) ; if ( sessionIdStart < sessionStart . length ( ) ) { sessionIdEnd = sessionStart . indexOf ( ' ' , sessionIdStart ) ; } } if ( sessionIdStart >= 0 && sessionIdEnd > sessionIdStart && sessionIdEnd < sessionStart . length ( ) ) { try { int sessionId = Integer . parseInt ( sessionStart . substring ( sessionIdStart , sessionIdEnd ) ) ; traceSessions . put ( sessionName , sessionId ) ; } catch ( NumberFormatException ex ) { } } }
Test the serialization from JSON to Java Objects
34,253
public static String binDecode ( final String value ) { return decode ( value , 16 , 2 ) ; }
Draw a chat bubble.
34,254
private void initialize ( Class < OpsType > opsType ) throws InstantiationException , IllegalAccessException { mOpsInstance = opsType . newInstance ( ) ; mRetainedFragmentManager . put ( opsType . getSimpleName ( ) , mOpsInstance ) ; mOpsInstance . onConfiguration ( this , true ) ; }
The current event requires no waiting
34,255
private static void startCMR ( ) { initLogger ( ) ; long startTime = System . nanoTime ( ) ; LOGGER . info ( "Central Measurement Repository is starting up!" ) ; LOGGER . info ( "==============================================" ) ; startRepository ( ) ; LOGGER . info ( "CMR started in " + Converter . nanoToMilliseconds ( System . nanoTime ( ) - startTime ) + " ms" ) ; }
Stores char value into byte array assuming that value should be stored in little-endian byte order and native byte order is big-endian. Alignment aware.
34,256
public void addPerson ( Id person ) { if ( rule . getsSeatOnEnter ( person , vehicle , sittingPersons . size ( ) , standingPersons . size ( ) ) ) { addSitting ( person ) ; } else { addStanding ( person ) ; } }
Should perform the logic using the received packet.
34,257
@ SuppressWarnings ( "unchecked" ) public static < R > R readField ( Object object , String fieldName ) throws NoSuchFieldException { return readAvailableField ( ( Class < Object > ) object . getClass ( ) , object , fieldName ) ; }
This method should be invoked after data changes. It defines new ranges for the data control object and invokes the update method of data control.
34,258
public void stop ( ) { try { discoverySchedulingSelector . close ( ) ; _dataCollectionExecutorService . shutdown ( ) ; _dataCollectionExecutorService . awaitTermination ( 120 , TimeUnit . SECONDS ) ; } catch ( Exception e ) { _logger . error ( "TimeOut occured after waiting Client Threads to finish" ) ; } }
Returns the index of the smallest value in an array that is greater than (or optionally equal to) a specified key. <p> The search is performed using a binary search algorithm, and so the array must be sorted.
34,259
private HttpHandler secureHandler ( final HttpHandler toWrap , SecurityRealm securityRealm ) { HttpHandler handler = toWrap ; handler = new AuthenticationCallHandler ( handler ) ; handler = new AuthenticationConstraintHandler ( handler ) ; RealmIdentityManager idm = new RealmIdentityManager ( securityRealm ) ; Set < AuthMechanism > mechanisms = securityRealm . getSupportedAuthenticationMechanisms ( ) ; List < AuthenticationMechanism > undertowMechanisms = new ArrayList < AuthenticationMechanism > ( mechanisms . size ( ) ) ; undertowMechanisms . add ( wrap ( new CachedAuthenticatedSessionMechanism ( ) , null ) ) ; for ( AuthMechanism current : mechanisms ) { switch ( current ) { case DIGEST : List < DigestAlgorithm > digestAlgorithms = Collections . singletonList ( DigestAlgorithm . MD5 ) ; List < DigestQop > digestQops = Collections . singletonList ( DigestQop . AUTH ) ; undertowMechanisms . add ( wrap ( new DigestAuthenticationMechanism ( digestAlgorithms , digestQops , securityRealm . getName ( ) , "Monitor" , new SimpleNonceManager ( ) ) , current ) ) ; break ; case PLAIN : undertowMechanisms . add ( wrap ( new BasicAuthenticationMechanism ( securityRealm . getName ( ) ) , current ) ) ; break ; case LOCAL : break ; } } handler = new AuthenticationMechanismsHandler ( handler , undertowMechanisms ) ; handler = new SecurityInitialHandler ( AuthenticationMode . PRO_ACTIVE , idm , handler ) ; handler = new PredicateHandler ( null , handler , toWrap ) ; return handler ; }
try delete the temp version files
34,260
public String format ( ) { String result = message ; for ( Object object : objects ) { String s = result . replaceFirst ( "%%" , Matcher . quoteReplacement ( stringify ( object ) ) ) ; if ( result . equals ( s ) ) { throw new IllegalStateException ( "Too many parameters" ) ; } result = s ; } if ( result . contains ( "%%" ) ) { throw new IllegalStateException ( "Not enough parameters" ) ; } return result ; }
Positions the given input stream to the entry that has a specified tag. Tag will be consumed.
34,261
@ Override public double variance ( double totalWeight , double totalPositiveWeight , Hypothesis hypo ) { double fp = hypo . getCoveredWeight ( ) - hypo . getPositiveWeight ( ) ; double tn = totalWeight - totalPositiveWeight - fp ; double correctPredictions = hypo . getPositiveWeight ( ) + tn ; double mean = correctPredictions / totalWeight ; double innerTerm = correctPredictions * Math . pow ( 1.0d - mean , 2 ) + ( totalWeight - correctPredictions ) * Math . pow ( 0.0d - mean , 2 ) ; return Math . sqrt ( innerTerm ) / totalWeight ; }
Renders the beginning boundary comment string.
34,262
public TimmyTable addTimmyTable ( String filename , int recordSize ) throws SyncFailedException , IOException { if ( isOpen ) throw new IllegalStateException ( "table can't be added after database is open" ) ; TimmyTable tt = new TimmyTable ( filename , recordSize , this ) ; tables . add ( tt ) ; return tt ; }
Note that this method has nothing to do with Thread.strart. It merely enqueues this Runnable in the Executor's queue.
34,263
public void test_restartSafe_oneWrite ( ) { IAtomicStore store = ( IAtomicStore ) getStore ( ) ; try { assertTrue ( store . isStable ( ) ) ; final Random r = new Random ( ) ; final int len = 100 ; final byte [ ] expected = new byte [ len ] ; r . nextBytes ( expected ) ; final ByteBuffer tmp = ByteBuffer . wrap ( expected ) ; final long addr1 = store . write ( tmp ) ; assertEquals ( len , tmp . position ( ) ) ; assertEquals ( tmp . position ( ) , tmp . limit ( ) ) ; ByteBuffer actual = store . read ( addr1 ) ; assertEquals ( expected , actual ) ; assertEquals ( 0 , actual . position ( ) ) ; assertEquals ( expected . length , actual . limit ( ) ) ; store . commit ( ) ; store = ( IAtomicStore ) reopenStore ( store ) ; assertTrue ( store . isStable ( ) ) ; actual = store . read ( addr1 ) ; assertEquals ( expected , actual ) ; } finally { store . destroy ( ) ; } }
Returns true if no option is set.
34,264
public void addLineEndCap ( Coordinate p0 , Coordinate p1 ) { LineSegment seg = new LineSegment ( p0 , p1 ) ; LineSegment offsetL = new LineSegment ( ) ; computeOffsetSegment ( seg , Position . LEFT , distance , offsetL ) ; LineSegment offsetR = new LineSegment ( ) ; computeOffsetSegment ( seg , Position . RIGHT , distance , offsetR ) ; double dx = p1 . x - p0 . x ; double dy = p1 . y - p0 . y ; double angle = Math . atan2 ( dy , dx ) ; switch ( bufParams . getEndCapStyle ( ) ) { case BufferParameters . CAP_ROUND : segList . addPt ( offsetL . p1 ) ; addFillet ( p1 , angle + Math . PI / 2 , angle - Math . PI / 2 , CGAlgorithms . CLOCKWISE , distance ) ; segList . addPt ( offsetR . p1 ) ; break ; case BufferParameters . CAP_FLAT : segList . addPt ( offsetL . p1 ) ; segList . addPt ( offsetR . p1 ) ; break ; case BufferParameters . CAP_SQUARE : Coordinate squareCapSideOffset = new Coordinate ( ) ; squareCapSideOffset . x = Math . abs ( distance ) * Math . cos ( angle ) ; squareCapSideOffset . y = Math . abs ( distance ) * Math . sin ( angle ) ; Coordinate squareCapLOffset = new Coordinate ( offsetL . p1 . x + squareCapSideOffset . x , offsetL . p1 . y + squareCapSideOffset . y ) ; Coordinate squareCapROffset = new Coordinate ( offsetR . p1 . x + squareCapSideOffset . x , offsetR . p1 . y + squareCapSideOffset . y ) ; segList . addPt ( squareCapLOffset ) ; segList . addPt ( squareCapROffset ) ; break ; } }
Modifies the node identifier in the Bayesian Network
34,265
public void removeAttributes ( String name , GoogleBaseAttributeType type ) { Iterator < GoogleBaseAttribute > iter = attributes . iterator ( ) ; while ( iter . hasNext ( ) ) { GoogleBaseAttribute attribute = iter . next ( ) ; if ( hasNameAndType ( attribute , name , type ) ) { iter . remove ( ) ; } } }
Caches a set of state images derived from a base image. This is useful for caching a set of images for a single component. For example this code: <br> FileLoader.cacheImgStates("TreeGrid/opener.png","closed,opening,opened"); <p/> Will cause the following images to be cached: <p/> /isomorphic/skins/[skin]/images/TreeGrid/opener_closed.png /isomorphic/skins/[skin]/images/TreeGrid/opener_opening.png /isomorphic/skins/[skin]/images/TreeGrid/opener_opened.png
34,266
protected void append ( String s ) { BufferedWriter writer ; if ( m_LogFile == null ) return ; try { writer = new BufferedWriter ( new FileWriter ( m_LogFile , true ) ) ; writer . write ( s ) ; writer . flush ( ) ; writer . close ( ) ; } catch ( Exception e ) { } }
Close the current contour. If the current point is not equal to the first point of the contour, a line segment is automatically added.
34,267
public static < W > List < W > toList ( final WordIndexer < W > wordIndexer , final int [ ] intNgram , final int startPos , final int endPos ) { final List < W > l = new ArrayList < W > ( endPos - startPos ) ; for ( int i = startPos ; i < endPos ; ++ i ) { l . add ( wordIndexer . getWord ( intNgram [ i ] ) ) ; } return l ; }
Build an array of elements. <p> Arrays are filled with field.getZero()
34,268
private void addScrollGapPath ( int x , int y , int w , int h , boolean isAtLeft ) { final double hHalf = h / 2.0 ; final double wFull = isAtLeft ? w : 0 ; final double wHalfOff = isAtLeft ? w - hHalf : hHalf ; path . quadTo ( x + wHalfOff , y + h , x + wHalfOff , y + hHalf ) ; path . quadTo ( x + wHalfOff , y , x + wFull , y ) ; }
If the object has already been written, just write its ref.
34,269
private void escapedStringLiteral ( char quot , boolean isRaw ) { int oldPos = isRaw ? pos - 2 : pos - 1 ; boolean inTripleQuote = skipTripleQuote ( quot ) ; StringBuilder literal = new StringBuilder ( ) ; while ( pos < buffer . length ) { char c = buffer [ pos ] ; pos ++ ; switch ( c ) { case '\n' : if ( inTripleQuote ) { literal . append ( c ) ; break ; } else { error ( "unterminated string literal at eol" , oldPos , pos ) ; addToken ( TokenKind . STRING , oldPos , pos - 1 , literal . toString ( ) ) ; newline ( ) ; return ; } case '\\' : if ( pos == buffer . length ) { error ( "unterminated string literal at eof" , oldPos , pos ) ; addToken ( TokenKind . STRING , oldPos , pos - 1 , literal . toString ( ) ) ; return ; } if ( isRaw ) { literal . append ( '\\' ) ; literal . append ( buffer [ pos ] ) ; pos ++ ; break ; } c = buffer [ pos ] ; pos ++ ; switch ( c ) { case '\n' : break ; case 'n' : literal . append ( '\n' ) ; break ; case 'r' : literal . append ( '\r' ) ; break ; case 't' : literal . append ( '\t' ) ; break ; case '\\' : literal . append ( '\\' ) ; break ; case '\'' : literal . append ( '\'' ) ; break ; case '"' : literal . append ( '"' ) ; break ; case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : { int octal = c - '0' ; if ( pos < buffer . length ) { c = buffer [ pos ] ; if ( c >= '0' && c <= '7' ) { pos ++ ; octal = ( octal << 3 ) | ( c - '0' ) ; if ( pos < buffer . length ) { c = buffer [ pos ] ; if ( c >= '0' && c <= '7' ) { pos ++ ; octal = ( octal << 3 ) | ( c - '0' ) ; } } } } literal . append ( ( char ) ( octal & 0xff ) ) ; break ; } case 'a' : case 'b' : case 'f' : case 'N' : case 'u' : case 'U' : case 'v' : case 'x' : error ( "escape sequence not implemented: \\" + c , oldPos , pos ) ; break ; default : literal . append ( '\\' ) ; literal . append ( c ) ; break ; } break ; case '\'' : case '"' : if ( c != quot || ( inTripleQuote && ! skipTripleQuote ( quot ) ) ) { literal . append ( c ) ; } else { addToken ( TokenKind . STRING , oldPos , pos , literal . toString ( ) ) ; return ; } break ; default : literal . append ( c ) ; break ; } } error ( "unterminated string literal at eof" , oldPos , pos ) ; addToken ( TokenKind . STRING , oldPos , pos , literal . toString ( ) ) ; }
iterator ordering is FIFO
34,270
public Diagnostic withUser ( User user ) { this . user = user ; return this ; }
Writes the specified document to a file.
34,271
public boolean isSingleValue ( ) { return ( values . size ( ) == 1 ) ; }
This method creates an entry for the named snapshot for the specified collection in Zookeeper.
34,272
public Set < String > addUserInput ( Map < String , Double > userInput ) { String var = ( ! settings . invertedRole ) ? settings . userInput : settings . systemOutput ; CategoricalTable . Builder builder = new CategoricalTable . Builder ( var ) ; for ( String input : userInput . keySet ( ) ) { builder . addRow ( input , userInput . get ( input ) ) ; } return addContent ( builder . build ( ) ) ; }
Public Method to create an Transmit packet (SerialMessage)
34,273
private void sendToServlet ( final LocalClientInfo info ) { BUGS_QUEUE . execute ( new ServletSender ( info ) ) ; }
Accept a data set
34,274
public CharSeq replaceFirst ( String regex , String replacement ) { return CharSeq . of ( str . replaceFirst ( regex , replacement ) ) ; }
Devuelve el entero resultado, de pasar a decimal, el binario generado poniendo las posiciones de los bits (empezando desde el 0) a 1 (bitsActivos) Ej. generarMarcasBis(new int[]{1,3}) genera 10 generarMarcasBis(new int[]{3,2}) genera 12
34,275
public static < E , L extends List < E > > L filter ( L list , Predicate < E > predicate ) { for ( Iterator < ? extends E > iter = list . iterator ( ) ; iter . hasNext ( ) ; ) { E obj = iter . next ( ) ; if ( predicate . test ( obj ) ) { iter . remove ( ) ; } } return list ; }
Split the values separated by null character
34,276
private void updateNotification ( String content ) { String ticker = String . format ( getString ( R . string . media_notif_ticker ) , getString ( R . string . app_name ) ) ; Intent showDetailsIntent = new Intent ( this , FileDisplayActivity . class ) ; showDetailsIntent . putExtra ( FileActivity . EXTRA_FILE , mFile ) ; showDetailsIntent . putExtra ( FileActivity . EXTRA_ACCOUNT , mAccount ) ; showDetailsIntent . setFlags ( Intent . FLAG_ACTIVITY_CLEAR_TOP ) ; mNotificationBuilder . setContentIntent ( PendingIntent . getActivity ( getApplicationContext ( ) , ( int ) System . currentTimeMillis ( ) , showDetailsIntent , PendingIntent . FLAG_UPDATE_CURRENT ) ) ; mNotificationBuilder . setWhen ( System . currentTimeMillis ( ) ) ; mNotificationBuilder . setTicker ( ticker ) ; mNotificationBuilder . setContentTitle ( ticker ) ; mNotificationBuilder . setContentText ( content ) ; mNotificationManager . notify ( R . string . media_notif_ticker , mNotificationBuilder . build ( ) ) ; }
long file getter in memory
34,277
private E unlinkLast ( ) { Node < E > l = last ; if ( l == null ) return null ; Node < E > p = l . prev ; E item = l . item ; l . item = null ; l . prev = l ; last = p ; if ( p == null ) first = null ; else p . next = null ; -- count ; notFull . signal ( ) ; return item ; }
Paints the specified component. This implementation does nothing.
34,278
public ProcessInfo dbProcess ( ProcessInfo processInfo , String procedureName ) { ProcessUtil . startDatabaseProcedure ( processInfo , procedureName , null ) ; return processInfo ; }
Given a replication Request, figure out if it is successful. Else add diagnostic info
34,279
public void caretUpdate ( CaretEvent e ) { timer . restart ( ) ; }
Creates the tree that shows the available tags.
34,280
public static String toLegacyText ( BaseComponent ... components ) { StringBuilder builder = new StringBuilder ( ) ; for ( BaseComponent msg : components ) { builder . append ( msg . toLegacyText ( ) ) ; } return builder . toString ( ) ; }
Generates SAX events for the given Comment
34,281
private boolean readHtml5Root ( ) { if ( _reader . eof ( ) ) { return false ; } char curr = _reader . read ( ) ; if ( curr == '/' ) { _buffer . append ( curr ) ; return true ; } else { _reader . goBack ( ) ; readEnd ( ReadEndState . InvalidUrl ) ; } return false ; }
Apply cone of influence reduction to constraints with respect to the last constraint in the list
34,282
public void checkTargetSolos ( ) { new BackCheck ( tgt . getPath ( ) , src . getPath ( ) ) ; }
Informs this executor to stop processing and returns any results collected thus far. This method is thread-safe.
34,283
private void drawHorizontalScale ( final boolean top , final int scale , final int pixelperscale , final int offset , final Long colorNaming , final Long colorScale , final String name ) { final int y = ( top ) ? this . topborder : this . height - this . bottomborder ; int x = this . leftborder ; int s = offset ; while ( x < this . width - this . rightborder ) { if ( ( colorScale != null ) && ( x > this . leftborder ) && ( x < ( this . width - this . rightborder ) ) ) { setColor ( colorScale ) ; line ( x , this . topborder , x , this . height - this . bottomborder , 100 ) ; } setColor ( colorNaming ) ; line ( x , y - 3 , x , y + 3 , 100 ) ; PrintTool . print ( this , x , ( top ) ? y - 3 : y + 9 , 0 , Integer . toString ( s ) , - 1 , false , 80 ) ; x += pixelperscale ; s += scale ; } setColor ( colorNaming ) ; PrintTool . print ( this , this . width - this . rightborder , ( top ) ? y - 9 : y + 15 , 0 , name , 1 , false , 80 ) ; line ( this . leftborder - 4 , y , this . width - this . rightborder + 4 , y , 100 ) ; }
Used to check whether there is a specialized handler for a given intent.
34,284
public static Matrix constructWithCopy ( double [ ] [ ] A ) { int m = A . length ; int n = A [ 0 ] . length ; Matrix X = new Matrix ( m , n ) ; double [ ] [ ] C = X . getArray ( ) ; for ( int i = 0 ; i < m ; i ++ ) { if ( A [ i ] . length != n ) { throw new IllegalArgumentException ( "All rows must have the same length." ) ; } for ( int j = 0 ; j < n ; j ++ ) { C [ i ] [ j ] = A [ i ] [ j ] ; } } return X ; }
Tests if the next characters on the queue match the sequence. Case insensitive.
34,285
public default MatchResult partialmatch ( String str ) { List < MatchResult > results = find ( str , 1 ) ; if ( results . isEmpty ( ) ) { return new MatchResult ( false ) ; } else { return results . get ( 0 ) ; } }
Find an index that matches one of the filter parameters passed. The parameter type and index type match up if the property name and filter operator are the same for the index and the filter parameter. For instance, for a filter parameter of "count EQUALS 10", the index against property "count" with operator type EQUALS will be returned, if present. NOTE: The caller is expected to obtain locks, if necessary, on the collections passed in. NOTE: Doesn't match non-property based index - thus boolean expressions don't get found and are always entered as a new index
34,286
public static String fileNameClean ( String s ) { char [ ] chars = s . toCharArray ( ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( ( c >= 'A' && c <= 'Z' ) || ( c >= 'a' && c <= 'z' ) || ( c >= '0' && c <= '9' ) || ( c == '_' ) ) { sb . append ( c ) ; } else { if ( c == ' ' || c == '-' ) { sb . append ( '_' ) ; } else { sb . append ( "x" + ( int ) c + "x" ) ; } } } return sb . toString ( ) ; }
If i rp is no longer the i'th panel of this, returns silently. Otherwise adds line to rp under the given group. Updates the count on the tab in this and restarts the spinning lime.
34,287
public boolean isBeingAttacked ( ) { return ! attackers . isEmpty ( ) ; }
Closes this stream. Any buffered data is flushed. This implementation closes the target stream.
34,288
static void appendVmErgoMessage ( boolean isServerClass , String vm ) { outBuf = outBuf . append ( getLocalizedMessage ( "java.launcher.ergo.message1" , vm ) ) ; outBuf = ( isServerClass ) ? outBuf . append ( ",\n" + getLocalizedMessage ( "java.launcher.ergo.message2" ) + "\n\n" ) : outBuf . append ( ".\n\n" ) ; }
Converts a Date object to a string representation in UTC
34,289
public void removeAllNumericValueChangedListeners ( ) { while ( ! mNumericListeners . isEmpty ( ) ) { mNumericListeners . remove ( 0 ) ; } }
start the sensor detector
34,290
public KeyInfo toDTO ( ) { return new KeyInfo ( available , usage , friendlyName , id , publicKey , Collections . unmodifiableList ( getCertsAsDTOs ( ) ) , Collections . unmodifiableList ( getCertRequestsAsDTOs ( ) ) ) ; }
Add connection to queue of connections to be accepted.
34,291
private static void cleanDirectoryOnExit ( File directory ) throws IOException { if ( ! directory . exists ( ) ) { String message = directory + " does not exist" ; throw new IllegalArgumentException ( message ) ; } if ( ! directory . isDirectory ( ) ) { String message = directory + " is not a directory" ; throw new IllegalArgumentException ( message ) ; } File [ ] files = directory . listFiles ( ) ; if ( files == null ) { throw new IOException ( "Failed to list contents of " + directory ) ; } IOException exception = null ; for ( File file : files ) { try { forceDeleteOnExit ( file ) ; } catch ( IOException ioe ) { exception = ioe ; } } if ( null != exception ) { throw exception ; } }
Rotates the subtree so that its root's right child is the new root.
34,292
public void registerSensor ( Sensor s , int i ) { if ( ( i < 0 ) || ( i >= mNumInputBits ) ) { log . error ( "Unexpected sensor ordinal in registerSensor: " + Integer . toString ( i + 1 ) ) ; return ; } if ( sensorArray [ i ] == null ) { sensorArray [ i ] = s ; if ( lastUsedSensor < i ) { lastUsedSensor = i ; } sensorLastSetting [ i ] = Sensor . UNKNOWN ; sensorTempSetting [ i ] = Sensor . UNKNOWN ; sensorORedSetting [ i ] = false ; } else { log . warn ( "multiple registration of same sensor: KS" + Integer . toString ( i + 1 ) ) ; } }
Match the value to the regular expression pattern. The pattern given can contain a file name like search, e.g. '*service*', which will be converted to a valid regular expression, e.g. '.*?service.*'.
34,293
private boolean isMediaTypeMatch ( MediaType mediaType , MediaType rangePattern ) { String WILDCARD = "*" ; String rangePatternType = rangePattern . getType ( ) ; String rangePatternSubtype = rangePattern . getSubtype ( ) ; return ( rangePatternType . equals ( WILDCARD ) || rangePatternType . equals ( mediaType . getType ( ) ) ) && ( rangePatternSubtype . equals ( WILDCARD ) || rangePatternSubtype . equals ( mediaType . getSubtype ( ) ) ) ; }
Adds a StackChangedListener for stack-changed events
34,294
public void removeAttribute ( int index ) { if ( index >= 0 && index < length ) { if ( index < length - 1 ) { System . arraycopy ( data , ( index + 1 ) * 5 , data , index * 5 , ( length - index - 1 ) * 5 ) ; } index = ( length - 1 ) * 5 ; data [ index ++ ] = null ; data [ index ++ ] = null ; data [ index ++ ] = null ; data [ index ++ ] = null ; data [ index ] = null ; length -- ; } else { badIndex ( index ) ; } }
Adds docstring to function. Provide doc with out of comment blocks.
34,295
@ Override public String graph ( ) throws Exception { StringBuffer text = new StringBuffer ( ) ; assignIDs ( - 1 ) ; text . append ( "digraph J48Tree {\n" ) ; if ( m_isLeaf ) { text . append ( "N" + m_id + " [label=\"" + Utils . backQuoteChars ( m_localModel . dumpLabel ( 0 , m_train ) ) + "\" " + "shape=box style=filled " ) ; if ( m_train != null && m_train . numInstances ( ) > 0 ) { text . append ( "data =\n" + m_train + "\n" ) ; text . append ( ",\n" ) ; } text . append ( "]\n" ) ; } else { text . append ( "N" + m_id + " [label=\"" + Utils . backQuoteChars ( m_localModel . leftSide ( m_train ) ) + "\" " ) ; if ( m_train != null && m_train . numInstances ( ) > 0 ) { text . append ( "data =\n" + m_train + "\n" ) ; text . append ( ",\n" ) ; } text . append ( "]\n" ) ; graphTree ( text ) ; } return text . toString ( ) + "}\n" ; }
Returns whether or not the specified data flavor is supported for this object.
34,296
public static String escape ( String string ) { char c ; String s = string . trim ( ) ; int length = s . length ( ) ; StringBuilder sb = new StringBuilder ( length ) ; for ( int i = 0 ; i < length ; i += 1 ) { c = s . charAt ( i ) ; if ( c < ' ' || c == '+' || c == '%' || c == '=' || c == ';' ) { sb . append ( '%' ) ; sb . append ( Character . forDigit ( ( char ) ( ( c > > > 4 ) & 0x0f ) , 16 ) ) ; sb . append ( Character . forDigit ( ( char ) ( c & 0x0f ) , 16 ) ) ; } else { sb . append ( c ) ; } } return sb . toString ( ) ; }
Helper method to format the Date returned by the OpenWeatherMap call.
34,297
public static int prefixLength ( String s1 , String s2 ) { int len = 0 ; int max = Math . min ( s1 . length ( ) , s2 . length ( ) ) ; for ( int i = 0 ; i < max && s1 . charAt ( i ) == s2 . charAt ( i ) ; ++ i ) ++ len ; return len ; }
Use this method if you are going to execute SUT code from a privileged thread (ie if you don't want to do it on a new thread)
34,298
public static Vector padLeft ( Collection strings ) { Vector v = new Vector ( ) ; int length = maxLength ( strings ) ; for ( Iterator i = strings . iterator ( ) ; i . hasNext ( ) ; ) { String string = ( String ) i . next ( ) ; v . add ( padLeft ( string , length ) ) ; } return v ; }
Notify data source loaded.
34,299
private void handleArgumentField ( int begin , int end , int argIndex , FieldPosition position , List < FieldContainer > fields ) { if ( fields != null ) { fields . add ( new FieldContainer ( begin , end , Field . ARGUMENT , Integer . valueOf ( argIndex ) ) ) ; } else { if ( position != null && position . getFieldAttribute ( ) == Field . ARGUMENT && position . getEndIndex ( ) == 0 ) { position . setBeginIndex ( begin ) ; position . setEndIndex ( end ) ; } } }
Unsigned comparison belowThan for two numbers.