Returns strongly connected components as an array of arrays of nodes. The array is sorted from children to parents. Each elements of the array represents a strongly connected component.
The graph is represented by each_node and each_child. each_node should have call
method which yields for each node in the graph. each_child should have call
method which takes a node argument and yields for each child node.
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]} each_node = lambda {|&b| g.each_key(&b) } each_child = lambda {|n, &b| g[n].each(&b) } p TSort.strongly_connected_components(each_node, each_child) #=> [[4], [2], [3], [1]] g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} each_node = lambda {|&b| g.each_key(&b) } each_child = lambda {|n, &b| g[n].each(&b) } p TSort.strongly_connected_components(each_node, each_child) #=> [[4], [2, 3], [1]]
ptr.to_str => string ptr.to_str(len) => string
Returns the pointer contents as a string.
When called with no arguments, this method will return the contents with the length of this pointer’s size
.
When called with len
, a string of len
bytes will be returned.
See to_s
Called when the YAML
stream ends
Returns true if the stream is finished.
Returns the eigenvector matrix V
Returns the block diagonal eigenvalue matrix D
Maximum number of times to retry an idempotent request in case of Net::ReadTimeout
, IOError
, EOFError
, Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE, OpenSSL::SSL::SSLError
, Timeout::Error
. Should be a non-negative integer number. Zero means no retries. The default value is 1.
Sends a POST request to the path
.
Returns the response as a Net::HTTPResponse
object.
When called with a block, the block is passed an HTTPResponse
object. The body of that response will not have been read yet; the block can process it using HTTPResponse#read_body
, if desired.
Returns the response.
This method never raises Net::* exceptions.
# example response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...') p response.status puts response.body # body is already read in this case # using block http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response| p response.status p response['content-type'] response.read_body do |str| # read body now print str end }
Returns the full path for an HTTP
request, as required by Net::HTTP::Get
.
If the URI
contains a query, the full path is URI#path + ‘?’ + URI#query. Otherwise, the path is simply URI#path.
Example:
uri = URI::HTTP.build(path: '/foo/bar', query: 'test=true') uri.request_uri # => "/foo/bar?test=true"
Override to display the default values of the command options. (similar to arguments
, but displays the default values).
For example:
def defaults_str --no-gems-first --no-all end
Verifies entry
in a .gem file.
returns an integer in (-infty, 0] a number closer to 0 means the dependency is less constraining
dependencies w/ 0 or 1 possibilities (ignoring version requirements) are given very negative values, so they always sort first, before dependencies that are unconstrained
Return the list of all array-oriented instance variables.
Return the list of all instance variables.
Is name
a required attribute?
Required specification attributes
True if this gem has the same attributes as other
.
Private setter for attributes val
.