idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
138,200
public static List < File > listFiles ( File dir , FileFilter filter , boolean recursive ) { List < File > list = new ArrayList < File > ( ) ; listFilesInternal ( list , dir , filter , recursive ) ; return list ; }
List files ONLY not include directories .
138,201
@ SuppressWarnings ( "unchecked" ) public < T > T getAttribute ( String name ) { return ( T ) this . webSocketSession . getAttributes ( ) . get ( name ) ; }
Return the value for the attribute of the given name if any .
138,202
public void registerDestructionCallback ( String name , Runnable callback ) { synchronized ( getSessionMutex ( ) ) { if ( isSessionCompleted ( ) ) { throw new IllegalStateException ( "Session id=" + getWebSocketSessionId ( ) + " already completed" ) ; } setAttribute ( DESTRUCTION_CALLBACK_NAME_PREFIX + name , callback ...
Register a callback to execute on destruction of the specified attribute . The callback is executed when the session is closed .
138,203
public Object getSessionMutex ( ) { Object mutex = getAttribute ( SESSION_MUTEX_NAME ) ; if ( mutex == null ) { mutex = this . webSocketSession . getAttributes ( ) ; } return mutex ; }
Expose the object to synchronize on for the underlying session .
138,204
public int peek ( long timeout , TimeUnit unit ) throws InterruptedException , TimeoutException { final int readLocation = this . consumerReadLocation ; blockForReadSpace ( timeout , unit , readLocation ) ; return data [ readLocation ] ; }
Retrieves but does not remove the head of this queue .
138,205
public Object invoke ( WampMessage message , Object ... providedArgs ) throws Exception { Object [ ] args = getMethodArgumentValues ( message , providedArgs ) ; if ( this . logger . isTraceEnabled ( ) ) { this . logger . trace ( "Resolved arguments: " + Arrays . asList ( args ) ) ; } Object returnValue = doInvoke ( arg...
Invoke the method with the given message .
138,206
private Object [ ] getMethodArgumentValues ( WampMessage message , Object ... providedArgs ) throws Exception { MethodParameter [ ] parameters = getMethodParameters ( ) ; Object [ ] args = new Object [ parameters . length ] ; int argIndex = 0 ; for ( int i = 0 ; i < parameters . length ; i ++ ) { MethodParameter parame...
Get the method argument values for the current request .
138,207
protected String getDetailedErrorMessage ( String message ) { StringBuilder sb = new StringBuilder ( message ) . append ( "\n" ) ; sb . append ( "HandlerMethod details: \n" ) ; sb . append ( "Bean [" ) . append ( getBeanType ( ) . getName ( ) ) . append ( "]\n" ) ; sb . append ( "Method [" ) . append ( getBridgedMethod...
Adds HandlerMethod details such as the controller type and method signature to the given error message .
138,208
protected Object doInvoke ( Object ... args ) throws Exception { ReflectionUtils . makeAccessible ( getBridgedMethod ( ) ) ; try { return getBridgedMethod ( ) . invoke ( getBean ( ) , args ) ; } catch ( IllegalArgumentException ex ) { assertTargetBean ( getBridgedMethod ( ) , getBean ( ) , args ) ; throw new IllegalSta...
Invoke the handler method with the given argument values .
138,209
private File [ ] resolveConfigFiles ( File base , Map < String , Object > override ) { if ( override != null ) { String configFilesString = ( String ) override . remove ( "config" ) ; if ( StringUtils . isNotBlank ( configFilesString ) ) { log . info ( "Using config files: {}" , configFilesString ) ; String [ ] strings...
Find all config files .
138,210
public WebSocketTransportRegistration setDecoratorFactories ( WebSocketHandlerDecoratorFactory ... factories ) { if ( factories != null ) { this . decoratorFactories . addAll ( Arrays . asList ( factories ) ) ; } return this ; }
Configure one or more factories to decorate the handler used to process WebSocket messages . This may be useful in some advanced use cases for example to allow Spring Security to forcibly close the WebSocket session when the corresponding HTTP session expires .
138,211
public boolean offer ( float value , long timeout , TimeUnit unit ) throws InterruptedException { final int writeLocation = this . producerWriteLocation ; final int nextWriteLocation = ( writeLocation + 1 == capacity ) ? 0 : writeLocation + 1 ; if ( nextWriteLocation == capacity - 1 ) { final long timeoutAt = System . ...
Inserts the specified element into this queue waiting up to the specified wait time if necessary for space to become available .
138,212
public int size ( ) { int read = readLocation ; int write = writeLocation ; if ( write < read ) write += capacity ; return write - read ; }
This method is not thread safe it therefore only provides and approximation of the size the size will be corrected if nothing was added or removed from the queue at the time it was called
138,213
public static String [ ] removeEmpties ( final String ... values ) { if ( values == null || values . length == 0 ) { return new String [ 0 ] ; } List < String > validValues = new ArrayList < String > ( ) ; for ( String value : values ) { if ( value != null && value . length ( ) > 0 ) { validValues . add ( value ) ; } }...
Create an array with only the non - null and non - empty values
138,214
public static String [ ] getMatchingPaths ( final String [ ] includes , final String [ ] excludes , final String baseDir ) { DirectoryScanner scanner = new DirectoryScanner ( ) ; scanner . setBasedir ( baseDir ) ; if ( includes != null && includes . length > 0 ) { scanner . setIncludes ( includes ) ; } if ( excludes !=...
Get matching paths found in given base directory
138,215
private FileFilter createConfigFilesFilter ( ) { SiteConfig config = site . getConfig ( ) ; boolean useDefaultConfigFiles = config . useDefaultConfigFiles ( ) ; if ( useDefaultConfigFiles ) { log . debug ( "Using default config files." ) ; return SiteConfigImpl . DEFAULT_CONFIG_FILES_FILTER ; } else { final File [ ] co...
Create config files FileFilter .
138,216
public static Vector inverseTransform ( double x , double y , double sx , double sy , double rotation , Vector result ) { double sinnega = Math . sin ( - rotation ) , cosnega = Math . cos ( - rotation ) ; double nx = ( x * cosnega - y * sinnega ) ; double ny = ( x * sinnega + y * cosnega ) ; return result . set ( nx / ...
Inverse transforms a vector as specified storing the result in the vector provided .
138,217
public void start ( ) { setDefaultLogLevel ( ) ; if ( Boolean . getBoolean ( "jlineDisable" ) ) { Scanner scan = new Scanner ( System . in ) ; boolean run = true ; while ( run ) { System . out . print ( _prompt + " (no jline) >" ) ; String nextLine = scan . nextLine ( ) ; run = processInputLine ( nextLine ) ; } scan . ...
Start the application . This will continuously loop until the user exits the application .
138,218
protected FindCommandResult findAndCreateCommand ( String [ ] args ) throws CommandInitException { String commandName = args [ 0 ] ; String [ ] remainingArguments = StringUtils . stripArgs ( args , 1 ) ; Class < ? extends Command < ? extends CLIContext > > commandClass = _commands . get ( commandName ) ; if ( commandCl...
Find and create the command instance .
138,219
private Map < String , Class < ? extends Command < ? extends CLIContext > > > loadCommands ( ) throws CLIInitException { Map < String , Class < ? extends Command < ? extends CLIContext > > > commands = new HashMap < String , Class < ? extends Command < ? extends CLIContext > > > ( ) ; Discoverer discoverer = new Classp...
Load the necessary commands for this application .
138,220
public void setBounds ( IRectangle r ) { setBounds ( r . x ( ) , r . y ( ) , r . width ( ) , r . height ( ) ) ; }
Sets the bounds of this rectangle to those of the supplied rectangle .
138,221
public void add ( int px , int py ) { int x1 = Math . min ( x , px ) ; int x2 = Math . max ( x + width , px ) ; int y1 = Math . min ( y , py ) ; int y2 = Math . max ( y + height , py ) ; setBounds ( x1 , y1 , x2 - x1 , y2 - y1 ) ; }
Expands the bounds of this rectangle to contain the specified point .
138,222
public void add ( IRectangle r ) { int x1 = Math . min ( x , r . x ( ) ) ; int x2 = Math . max ( x + width , r . x ( ) + r . width ( ) ) ; int y1 = Math . min ( y , r . y ( ) ) ; int y2 = Math . max ( y + height , r . y ( ) + r . height ( ) ) ; setBounds ( x1 , y1 , x2 - x1 , y2 - y1 ) ; }
Expands the bounds of this rectangle to contain the supplied rectangle .
138,223
public Vector setAngle ( double angle ) { double l = length ( ) ; return set ( l * Math . cos ( angle ) , l * Math . sin ( angle ) ) ; }
Sets this vector s angle preserving its magnitude .
138,224
public boolean setListenerURL ( String listenerURL ) { String newURL = _substitutor . replace ( listenerURL ) ; boolean changed = false ; if ( ! _urlValidator . isValid ( newURL ) ) { error ( "The Response Listener URL specified is invalid. Continuing with previous value." ) ; } else { if ( ! newURL . equalsIgnoreCase ...
Sets the Listener URL . Checks to see if the URL is valid or it does nothing .
138,225
public void setResponseURL ( String responseURL ) { String newURL = _substitutor . replace ( responseURL ) ; if ( ! _urlValidator . isValid ( newURL ) ) { error ( "The RespondTo URL specified is invalid. Continuing with previous value." ) ; } else { this . _responseURL = newURL ; } }
Sets the respondTo URL for the client probes to use . If the URL is invalid it does nothing .
138,226
public Box set ( IVector3 minExtent , IVector3 maxExtent ) { _minExtent . set ( minExtent ) ; _maxExtent . set ( maxExtent ) ; return this ; }
Sets the box parameters to the values contained in the supplied vectors .
138,227
public Box fromPoints ( IVector3 ... points ) { setToEmpty ( ) ; for ( IVector3 point : points ) { addLocal ( point ) ; } return this ; }
Initializes this box with the extents of an array of points .
138,228
public static int solveQuad ( double [ ] eqn , double [ ] res ) { double a = eqn [ 2 ] ; double b = eqn [ 1 ] ; double c = eqn [ 0 ] ; int rc = 0 ; if ( a == 0f ) { if ( b == 0f ) { return - 1 ; } res [ rc ++ ] = - c / b ; } else { double d = b * b - 4f * a * c ; if ( d < 0f ) { return 0 ; } d = Math . sqrt ( d ) ; res...
Solves quadratic equation
138,229
public static int solveCubic ( double [ ] eqn , double [ ] res ) { double d = eqn [ 3 ] ; if ( d == 0 ) { return solveQuad ( eqn , res ) ; } double a = eqn [ 2 ] / d ; double b = eqn [ 1 ] / d ; double c = eqn [ 0 ] / d ; int rc = 0 ; double Q = ( a * a - 3f * b ) / 9f ; double R = ( 2f * a * a * a - 9f * a * b + 27f *...
Solves cubic equation
138,230
public static int intersectLine ( double x1 , double y1 , double x2 , double y2 , double rx1 , double ry1 , double rx2 , double ry2 ) { if ( ( rx2 < x1 && rx2 < x2 ) || ( rx1 > x1 && rx1 > x2 ) || ( ry1 > y1 && ry1 > y2 ) ) { return 0 ; } if ( ry2 < y1 && ry2 < y2 ) { } else { if ( x1 == x2 ) { return CROSSING ; } doub...
Returns how many times rectangle stripe cross line or the are intersect
138,231
protected static void sortBound ( double [ ] bound , int bc ) { for ( int i = 0 ; i < bc - 4 ; i += 4 ) { int k = i ; for ( int j = i + 4 ; j < bc ; j += 4 ) { if ( bound [ k ] > bound [ j ] ) { k = j ; } } if ( k != i ) { double tmp = bound [ i ] ; bound [ i ] = bound [ k ] ; bound [ k ] = tmp ; tmp = bound [ i + 1 ] ...
Sorts a bound array .
138,232
protected static int crossBound ( double [ ] bound , int bc , double py1 , double py2 ) { if ( bc == 0 ) { return 0 ; } int up = 0 ; int down = 0 ; for ( int i = 2 ; i < bc ; i += 4 ) { if ( bound [ i ] < py1 ) { up ++ ; continue ; } if ( bound [ i ] > py2 ) { down ++ ; continue ; } return CROSSING ; } if ( down == 0 )...
Returns whether bounds intersect a rectangle or not .
138,233
public void setElement ( int row , int col , float value ) { switch ( col ) { case 0 : switch ( row ) { case 0 : m00 = value ; return ; case 1 : m01 = value ; return ; case 2 : m02 = value ; return ; } break ; case 1 : switch ( row ) { case 0 : m10 = value ; return ; case 1 : m11 = value ; return ; case 2 : m12 = value...
Sets the matrix element at the specified row and column .
138,234
public Plane fromPoints ( IVector3 p1 , IVector3 p2 , IVector3 p3 ) { p2 . subtract ( p1 , _v1 ) ; p3 . subtract ( p1 , _v2 ) ; _v1 . cross ( _v2 , _normal ) . normalizeLocal ( ) ; constant = - _normal . dot ( p1 ) ; return this ; }
Sets this plane based on the three points provided .
138,235
public Plane fromPointNormal ( IVector3 pt , IVector3 normal ) { return set ( normal , - normal . dot ( pt ) ) ; }
Sets this plane based on a point on the plane and the plane normal .
138,236
public static String [ ] stripArgs ( String [ ] originalArgs , int stripCount ) { if ( originalArgs . length <= stripCount ) { return new String [ 0 ] ; } String [ ] stripped = new String [ originalArgs . length - stripCount ] ; for ( int i = 0 ; i < stripped . length ; i ++ ) { stripped [ i ] = originalArgs [ i + stri...
Strip the first N items from the array .
138,237
public < U extends T > OngoingMatchingC0 < T , U > when ( MatchesExact < U > o ) { List < Matcher < Object > > matchers = Lists . of ( ArgumentMatchers . eq ( o . t ) ) ; return new OngoingMatchingC0 < > ( this , new DecomposableMatchBuilder0 < > ( matchers , new IdentityFieldExtractor < U > ( ) ) . build ( ) ) ; }
Specifies an exact match and then returns a fluent interface for specifying the action to take if the value matches this case .
138,238
public < U extends T > OngoingMatchingC1 < T , U , U > when ( MatchesAny < U > o ) { List < Matcher < Object > > matchers = Lists . of ( ArgumentMatchers . any ( ) ) ; return new OngoingMatchingC1 < > ( this , new DecomposableMatchBuilder1 < U , U > ( matchers , 0 , new IdentityFieldExtractor < > ( ) ) . build ( ) ) ; ...
Specifies a wildcard match and then returns a fluent interface for specifying the action to take if the value matches this case .
138,239
public void doMatch ( ) { boolean matchFound = false ; for ( ConsumablePattern < T > pattern : patterns ) { if ( pattern . matches ( value ) ) { pattern . consume ( value ) ; matchFound = true ; break ; } } if ( ! matchFound ) { throw new MatchException ( "No match found for " + value ) ; } }
Runs through the possible matches and executes the specified consumer of the first match .
138,240
public FluentMatchingC < T > orElse ( ) { patterns . add ( ConsumablePattern . of ( t -> true , t -> doNothing ( ) ) ) ; return this ; }
Sets a no - op to be run if no match is found .
138,241
public void subscribe ( ) throws URISyntaxException , TransportConfigException { if ( _inShutdown ) return ; URI url = getBaseSubscriptionURI ( ) ; String subscriptionURL = url . toString ( ) + "listener/sns" ; LOGGER . info ( "Subscription URI - " + subscriptionURL ) ; SubscribeRequest subRequest = new SubscribeReque...
Attempt to subscript to the Argo SNS topic .
138,242
@ SuppressWarnings ( "unchecked" ) public static < T > Matcher < T > eq ( T value ) { return ( Matcher < T > ) new Equals ( value ) ; }
Returns an equals matcher for the given value .
138,243
public static URI getLocalBaseURI ( ) { InetAddress localAddr ; String addr ; try { localAddr = InetAddress . getLocalHost ( ) ; addr = localAddr . getHostAddress ( ) ; } catch ( UnknownHostException e ) { LOGGER . warn ( "Issues finding ip address of locahost. Using string 'localhost' for listener address binding" ) ...
Return the local base URI based on the localhost address .
138,244
private String calculateSHA256Hash ( byte [ ] msg , int offset , int len ) { Digest digest = platform . getCrypto ( ) . createDigestSHA256 ( ) ; digest . update ( msg , offset , len ) ; int digestLen = digest . getDigestLength ( ) ; byte [ ] hash = new byte [ 2 * digestLen ] ; digest . getDigest ( hash , digestLen , tr...
Calculate the hash digest of part of a message using the SHA256 algorithm
138,245
public void handleIncomingMessage ( byte [ ] data , int offset , int len ) { synchronized ( messageQueue ) { messageQueue . add ( new IncomingMessage ( data , offset , len ) ) ; } synchronized ( lock ) { lock . notifyAll ( ) ; } }
Handle an incoming ZRTP message . Assumes RTP headers and trailing CRC have been stripped by caller
138,246
public boolean isTrusted ( ) { if ( delayedCacheUpdate || farEndZID == null ) { return false ; } cache . selectEntry ( farEndZID ) ; return cache . getTrust ( ) ; }
Retrieves the current trust status of the connection .
138,247
private void runSession ( ) { if ( ! started ) { logString ( "Thread Starting" ) ; completed = false ; seqNum = getStartSeqNum ( ) ; rtpStack . setNextZrtpSequenceNumber ( getStartSeqNum ( ) ) ; state = ZRTP_STATE_INACTIVE ; initiator = false ; hashMode = HashType . UNDEFINED ; dhMode = KeyAgreementType . DH3K ; sasMod...
Thread run method
138,248
public void setSdpHelloHash ( String version , String helloHash ) { if ( ! version . startsWith ( VERSION_PREFIX ) ) { logWarning ( "Different version number: '" + version + "' Ours: '" + VERSION_PREFIX + "' (" + VERSION + ")" ) ; } sdpHelloHashReceived = helloHash ; }
Hash of the Hello message to be received . This hash is sent by the other end as part of the SDP for further verification .
138,249
public void untrust ( ) { cache . updateEntry ( cacheExpiryTime ( ) , false , newRS , keepRS2 , null ) ; delayedCacheUpdate = true ; }
Notifies the ZRTP protocol that the user has revoked their trust in the connection . SAS verified flags is set to false and shared secrets with the remote end are removed from the cache .
138,250
private boolean verifyHelloMessage ( byte [ ] helloMsg ) { if ( sdpHelloHashReceived != null ) { String hash = calculateSHA256Hash ( helloMsg , 0 , helloMsg . length ) ; boolean hashesMatched = hash . toUpperCase ( ) . equals ( sdpHelloHashReceived . toUpperCase ( ) ) ; if ( platform . getLogger ( ) . isEnabled ( ) ) {...
Verify whether the contents of the Hello message received has not been altered by matching with the SHA256 hash received in SDP exchange .
138,251
public IntersectionType intersectionType ( Box box ) { if ( ! _bounds . intersects ( box ) ) { return IntersectionType . NONE ; } int ccount = 0 ; for ( int ii = 0 ; ii < 6 ; ii ++ ) { int inside = 0 ; Plane plane = _planes [ ii ] ; for ( int jj = 0 ; jj < 8 ; jj ++ ) { if ( plane . distance ( box . vertex ( jj , _vert...
Checks whether the frustum intersects the specified box .
138,252
public Box boundsUnderRotation ( Matrix3 matrix , Box result ) { result . setToEmpty ( ) ; for ( Vector3 vertex : _vertices ) { result . addLocal ( matrix . transform ( vertex , _vertex ) ) ; } return result ; }
Computes the bounds of the frustum under the supplied rotation and places the results in the box provided .
138,253
protected void updateDerivedState ( ) { _planes [ 0 ] . fromPoints ( _vertices [ 0 ] , _vertices [ 1 ] , _vertices [ 2 ] ) ; _planes [ 1 ] . fromPoints ( _vertices [ 5 ] , _vertices [ 4 ] , _vertices [ 7 ] ) ; _planes [ 2 ] . fromPoints ( _vertices [ 1 ] , _vertices [ 5 ] , _vertices [ 6 ] ) ; _planes [ 3 ] . fromPoint...
Sets the planes and bounding box of the frustum based on its vertices .
138,254
public void setArcType ( int type ) { if ( type != OPEN && type != CHORD && type != PIE ) { throw new IllegalArgumentException ( "Invalid Arc type: " + type ) ; } this . type = type ; }
Sets the type of this arc to the specified value .
138,255
public void setArc ( IArc arc ) { setArc ( arc . x ( ) , arc . y ( ) , arc . width ( ) , arc . height ( ) , arc . angleStart ( ) , arc . angleExtent ( ) , arc . arcType ( ) ) ; }
Sets the location size angular extents and closure type of this arc to the same values as the supplied arc .
138,256
public void setAngleStart ( XY point ) { double angle = Math . atan2 ( point . y ( ) - centerY ( ) , point . x ( ) - centerX ( ) ) ; setAngleStart ( normAngle ( - Math . toDegrees ( angle ) ) ) ; }
Sets the starting angle of this arc to the angle defined by the supplied point relative to the center of this arc .
138,257
public static float distance ( float x1 , float y1 , float x2 , float y2 ) { return FloatMath . sqrt ( distanceSq ( x1 , y1 , x2 , y2 ) ) ; }
Returns the Euclidean distance between the specified two points .
138,258
public void setRoundRect ( float x , float y , float width , float height , float arcwidth , float archeight ) { this . x = x ; this . y = y ; this . width = width ; this . height = height ; this . arcwidth = arcwidth ; this . archeight = archeight ; }
Sets the frame and corner dimensions of this rectangle to the specified values .
138,259
public void setRoundRect ( IRoundRectangle rr ) { setRoundRect ( rr . x ( ) , rr . y ( ) , rr . width ( ) , rr . height ( ) , rr . arcWidth ( ) , rr . arcHeight ( ) ) ; }
Sets the frame and corner dimensions of this rectangle to be equal to those of the supplied rectangle .
138,260
public static float pointLineDistSq ( float px , float py , float x1 , float y1 , float x2 , float y2 ) { x2 -= x1 ; y2 -= y1 ; px -= x1 ; py -= y1 ; float s = px * y2 - py * x2 ; return ( s * s ) / ( x2 * x2 + y2 * y2 ) ; }
Returns the square of the distance from the specified point to the specified line .
138,261
public static float pointLineDist ( float px , float py , float x1 , float y1 , float x2 , float y2 ) { return FloatMath . sqrt ( pointLineDistSq ( px , py , x1 , y1 , x2 , y2 ) ) ; }
Returns the distance from the specified point to the specified line .
138,262
public static float pointSegDistSq ( float px , float py , float x1 , float y1 , float x2 , float y2 ) { x2 -= x1 ; y2 -= y1 ; px -= x1 ; py -= y1 ; float dist ; if ( px * x2 + py * y2 <= 0.0 ) { dist = px * px + py * py ; } else { px = x2 - px ; py = y2 - py ; if ( px * x2 + py * y2 <= 0.0 ) { dist = px * px + py * py...
Returns the square of the distance between the specified point and the specified line segment .
138,263
public static float pointSegDist ( float px , float py , float x1 , float y1 , float x2 , float y2 ) { return FloatMath . sqrt ( pointSegDistSq ( px , py , x1 , y1 , x2 , y2 ) ) ; }
Returns the distance between the specified point and the specified line segment .
138,264
public static ZrtpCacheEntry fromString ( String key , String value ) { String data = null ; String number = null ; int sep = value . indexOf ( ',' ) ; if ( sep > 0 ) { data = value . substring ( 0 , sep ) ; number = value . substring ( sep + 1 ) ; } else { data = value ; number = "" ; } byte [ ] buffer = new byte [ da...
Create a Cache Entry from the Zid string and the CSV representation of HEX RAW data and phone number
138,265
public void setLine ( XY p1 , XY p2 ) { setLine ( p1 . x ( ) , p1 . y ( ) , p2 . x ( ) , p2 . y ( ) ) ; }
Sets the start and end of this line to the specified points .
138,266
public void setLine ( float x1 , float y1 , float x2 , float y2 ) { this . x1 = x1 ; this . y1 = y1 ; this . x2 = x2 ; this . y2 = y2 ; }
Sets the start and end point of this line to the specified values .
138,267
public void addAccessPoint ( String label , String ip , String port , String url , String dataType , String data ) { AccessPoint ap = new AccessPoint ( ) ; ap . label = label ; ap . ipAddress = ip ; ap . port = port ; ap . url = url ; ap . dataType = dataType ; ap . data = data ; accessPoints . add ( ap ) ; }
Add a new access point for the service record . This structure exists to help deal with network access issues and not multiple contracts . For example a service could have an access point that is different because of multiple NICs that host is accessible on . It s not to have a service accessible by HTTP and HTTPS - th...
138,268
public Matrix3 set ( double [ ] values ) { return set ( values [ 0 ] , values [ 1 ] , values [ 2 ] , values [ 3 ] , values [ 4 ] , values [ 5 ] , values [ 6 ] , values [ 7 ] , values [ 8 ] ) ; }
Copies the elements of an array .
138,269
public Matrix3 set ( double m00 , double m10 , double m20 , double m01 , double m11 , double m21 , double m02 , double m12 , double m22 ) { this . m00 = m00 ; this . m01 = m01 ; this . m02 = m02 ; this . m10 = m10 ; this . m11 = m11 ; this . m12 = m12 ; this . m20 = m20 ; this . m21 = m21 ; this . m22 = m22 ; return th...
Sets all of the matrix s components at once .
138,270
private String ipAddressFromURL ( String url , String name ) { String ipAddr = null ; if ( _urlValidator . isValid ( url ) ) { WebTarget resolver = ClientBuilder . newClient ( ) . target ( url ) ; try { ipAddr = resolver . request ( ) . get ( String . class ) ; } catch ( Exception e ) { warn ( "URL Cannot Resolve for r...
Resolve the IP address from a URL .
138,271
public RtpPacket protect ( RtpPacket packet ) { if ( txSessEncKey == null ) { log ( "protect() called out of session" ) ; return null ; } if ( packet == null ) { log ( "protect() called with null RTP packet" ) ; return null ; } int seqNum = packet . getSequenceNumber ( ) ; if ( seqNum == 0 ) { rollOverCounter += 0x1000...
Protects an RTP Packet by encrypting payload and adds any additional SRTP trailer information
138,272
public int startNewSession ( ) { if ( txSessEncKey != null ) return SESSION_ERROR_ALREADY_ACTIVE ; if ( ( txMasterSalt == null ) || ( rxMasterSalt == null ) ) return SESSION_ERROR_MASTER_SALT_UDNEFINED ; if ( ( txMasterKey == null ) || ( rxMasterKey == null ) ) return SESSION_ERROR_MASTER_SALT_UDNEFINED ; if ( ! txSess...
Starts a new SRTP Session using the preset master key and salt to generate the session keys
138,273
public static boolean linesIntersect ( double x1 , double y1 , double x2 , double y2 , double x3 , double y3 , double x4 , double y4 ) { x2 -= x1 ; y2 -= y1 ; x3 -= x1 ; y3 -= y1 ; x4 -= x1 ; y4 -= y1 ; double AvB = x2 * y3 - x3 * y2 ; double AvC = x2 * y4 - x4 * y2 ; if ( AvB == 0 && AvC == 0 ) { if ( x2 != 0 ) { retu...
Returns true if the specified two line segments intersect .
138,274
public static boolean lineIntersectsRect ( double x1 , double y1 , double x2 , double y2 , double rx , double ry , double rw , double rh ) { double rr = rx + rw , rb = ry + rh ; return ( rx <= x1 && x1 <= rr && ry <= y1 && y1 <= rb ) || ( rx <= x2 && x2 <= rr && ry <= y2 && y2 <= rb ) || linesIntersect ( rx , ry , rr ,...
Returns true if the specified line segment intersects the specified rectangle .
138,275
public Quaternion set ( IQuaternion other ) { return set ( other . x ( ) , other . y ( ) , other . z ( ) , other . w ( ) ) ; }
Copies the elements of another quaternion .
138,276
public Quaternion fromVectors ( IVector3 from , IVector3 to ) { float angle = from . angle ( to ) ; if ( angle < MathUtil . EPSILON ) { return set ( IDENTITY ) ; } if ( angle <= FloatMath . PI - MathUtil . EPSILON ) { return fromAngleAxis ( angle , from . cross ( to ) . normalizeLocal ( ) ) ; } Vector3 axis = new Vecto...
Sets this quaternion to the rotation of the first normalized vector onto the second .
138,277
public Quaternion fromAnglesXZ ( float x , float z ) { float hx = x * 0.5f , hz = z * 0.5f ; float sx = FloatMath . sin ( hx ) , cx = FloatMath . cos ( hx ) ; float sz = FloatMath . sin ( hz ) , cz = FloatMath . cos ( hz ) ; return set ( cz * sx , sz * sx , sz * cx , cz * cx ) ; }
Sets this quaternion to one that first rotates about x by the specified number of radians then rotates about z by the specified number of radians .
138,278
public Quaternion fromAnglesXY ( float x , float y ) { float hx = x * 0.5f , hy = y * 0.5f ; float sx = FloatMath . sin ( hx ) , cx = FloatMath . cos ( hx ) ; float sy = FloatMath . sin ( hy ) , cy = FloatMath . cos ( hy ) ; return set ( cy * sx , sy * cx , - sy * sx , cy * cx ) ; }
Sets this quaternion to one that first rotates about x by the specified number of radians then rotates about y by the specified number of radians .
138,279
public static float normalizeAnglePositive ( float a ) { while ( a < 0f ) { a += TWO_PI ; } while ( a >= TWO_PI ) { a -= TWO_PI ; } return a ; }
Returns an angle in the range [ 0 2pi ) .
138,280
public ProbeWrapper unmarshal ( String payload ) throws ProbeParseException { Probe xmlProbe = parseProbePayload ( payload ) ; ProbeWrapper probe = new ProbeWrapper ( xmlProbe . getId ( ) ) ; probe . setClientId ( xmlProbe . getClient ( ) ) ; probe . setDESVersion ( xmlProbe . getDESVersion ( ) ) ; probe . setRespondTo...
Create a new ProbeWrapper from the wireline payload .
138,281
public void fizzbuzzConditional ( ) { IntStream . range ( 0 , 101 ) . forEach ( n -> { if ( n % ( 3 * 5 ) == 0 ) { System . out . println ( "FizzBuzz" ) ; } else if ( n % 3 == 0 ) { System . out . println ( "Fizz" ) ; } else if ( n % 5 == 0 ) { System . out . println ( "Buzz" ) ; } else { System . out . println ( n ) ;...
Fizzbuzz benchmark using a conditional .
138,282
public void fizzBuzzPatternMatching ( ) { IntStream . range ( 0 , 101 ) . forEach ( n -> System . out . println ( match ( Tuple2 . of ( n % 3 , n % 5 ) ) . when ( tuple2 ( eq ( 0 ) , eq ( 0 ) ) ) . get ( ( ) -> "FizzBuzz" ) . when ( tuple2 ( eq ( 0 ) , any ( ) ) ) . get ( y -> "Fizz" ) . when ( tuple2 ( any ( ) , eq ( ...
Fizzbuzz benchmark using motif pattern matching .
138,283
public Quaternion set ( double x , double y , double z , double w ) { this . x = x ; this . y = y ; this . z = z ; this . w = w ; return this ; }
Sets all of the elements of the quaternion .
138,284
public Quaternion fromAxes ( IVector3 nx , IVector3 ny , IVector3 nz ) { double nxx = nx . x ( ) , nyy = ny . y ( ) , nzz = nz . z ( ) ; double x2 = ( 1f + nxx - nyy - nzz ) / 4f ; double y2 = ( 1f - nxx + nyy - nzz ) / 4f ; double z2 = ( 1f - nxx - nyy + nzz ) / 4f ; double w2 = ( 1f - x2 - y2 - z2 ) ; return set ( Ma...
Sets this quaternion to one that rotates onto the given unit axes .
138,285
public static Point closestInteriorPoint ( IRectangle r , IPoint p ) { return closestInteriorPoint ( r , p , new Point ( ) ) ; }
Computes and returns the point inside the bounds of the rectangle that s closest to the given point .
138,286
public boolean isRectangular ( ) { return ( _isPolygonal ) && ( _rulesSize <= 5 ) && ( _coordsSize <= 8 ) && ( _coords [ 1 ] == _coords [ 3 ] ) && ( _coords [ 7 ] == _coords [ 5 ] ) && ( _coords [ 0 ] == _coords [ 6 ] ) && ( _coords [ 2 ] == _coords [ 4 ] ) ; }
Returns true if this area is rectangular .
138,287
public void add ( Area area ) { if ( area == null || area . isEmpty ( ) ) { return ; } else if ( isEmpty ( ) ) { copy ( area , this ) ; return ; } if ( isPolygonal ( ) && area . isPolygonal ( ) ) { addPolygon ( area ) ; } else { addCurvePolygon ( area ) ; } if ( areaBoundsSquare ( ) < GeometryUtil . EPSILON ) { reset (...
Adds the supplied area to this area .
138,288
public void intersect ( Area area ) { if ( area == null ) { return ; } else if ( isEmpty ( ) || area . isEmpty ( ) ) { reset ( ) ; return ; } if ( isPolygonal ( ) && area . isPolygonal ( ) ) { intersectPolygon ( area ) ; } else { intersectCurvePolygon ( area ) ; } if ( areaBoundsSquare ( ) < GeometryUtil . EPSILON ) { ...
Intersects the supplied area with this area .
138,289
public void subtract ( Area area ) { if ( area == null || isEmpty ( ) || area . isEmpty ( ) ) { return ; } if ( isPolygonal ( ) && area . isPolygonal ( ) ) { subtractPolygon ( area ) ; } else { subtractCurvePolygon ( area ) ; } if ( areaBoundsSquare ( ) < GeometryUtil . EPSILON ) { reset ( ) ; } }
Subtracts the supplied area from this area .
138,290
public void exclusiveOr ( Area area ) { Area a = clone ( ) ; a . intersect ( area ) ; add ( area ) ; subtract ( a ) ; }
Computes the exclusive or of this area and the supplied area and sets this area to the result .
138,291
private static double [ ] adjustSize ( double [ ] array , int newSize ) { if ( newSize <= array . length ) { return array ; } double [ ] newArray = new double [ 2 * newSize ] ; System . arraycopy ( array , 0 , newArray , 0 , array . length ) ; return newArray ; }
the method check up the array size and necessarily increases it .
138,292
@ Path ( "/ipAddrInfo" ) public String getIPAddrInfo ( ) throws UnknownHostException { Properties clientProps = getPropeSenderProps ( ) ; StringBuffer buf = new StringBuffer ( ) ; InetAddress localhost = null ; NetworkInterface ni = null ; try { localhost = InetAddress . getLocalHost ( ) ; LOGGER . debug ( "Network Int...
Return the ip info of where the web host lives that supports the browser app .
138,293
@ Path ( "/launchProbe" ) @ Produces ( "application/txt" ) public String launchProbe ( ) throws IOException , UnsupportedPayloadType , ProbeSenderException , TransportException { Properties clientProps = getPropeSenderProps ( ) ; String multicastGroupAddr = clientProps . getProperty ( "multicastGroupAddr" , DEFAULT_MUL...
Actually launch a probe .
138,294
@ Path ( "/responses" ) @ Produces ( "application/json" ) public String getResponses ( ) throws UnknownHostException { Properties clientProps = getPropeSenderProps ( ) ; String listenerIPAddress = clientProps . getProperty ( "listenerIPAddress" ) ; String listenerPort = clientProps . getProperty ( "listenerPort" ) ; St...
Returns a list of the responses collected in the listener .
138,295
@ Path ( "/clearCache" ) @ Produces ( "application/json" ) public String clearCache ( ) throws UnknownHostException { Properties clientProps = getPropeSenderProps ( ) ; String listenerIPAddress = clientProps . getProperty ( "listenerIPAddress" ) ; String listenerPort = clientProps . getProperty ( "listenerPort" ) ; Str...
Clears the active response cache .
138,296
public double distance ( Vector3 point ) { double distance = - Float . MAX_VALUE ; for ( Plane plane : _planes ) { distance = Math . max ( distance , plane . distance ( point ) ) ; } return distance ; }
Determines the maximum signed distance of the point from the planes of the frustum . If the distance is less than or equal to zero the point lies inside the frustum .
138,297
public static Class < ? extends Command < ? extends CLIContext > > getCommandClass ( CLIContext context , String commandName ) { return context . getHostApplication ( ) . getCommands ( ) . get ( commandName . toLowerCase ( ) ) ; }
Get a command by name .
138,298
public static < T > DecomposableMatchBuilder0 < List < T > > nil ( ) { List < Matcher < Object > > matchers = Lists . of ( ) ; return new DecomposableMatchBuilder0 < List < T > > ( matchers , new ListConsNilFieldExtractor < > ( ) ) ; }
Matches an empty list .
138,299
public static void print ( ConsoleLevel level , String message ) { if ( level . compareTo ( _level ) <= 0 ) { if ( _printLogLevel ) { level . getStream ( ) . println ( level . name ( ) + ": " + message ) ; } else { level . getStream ( ) . println ( message ) ; } level . getStream ( ) . flush ( ) ; } }
Print the given message at the given level .