Iterates over strongly connected components in a graph. The graph is represented by node and each_child.
node is the first node. each_child should have call
method which takes a node argument and yields for each child node.
Return value is unspecified.
TSort.each_strongly_connected_component_from is a class method and it doesn’t need a class to represent a graph which includes TSort
.
graph = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} each_child = lambda {|n, &b| graph[n].each(&b) } TSort.each_strongly_connected_component_from(1, each_child) {|scc| p scc } #=> [4] # [2, 3] # [1]
Like Enumerable#drop
, but chains operation to be lazy-evaluated.
Allocates a C struct with the types
provided.
When the instance is garbage collected, the C function func
is called.
Allocates a C union the types
provided.
When the instance is garbage collected, the C function func
is called.
Fiddle::Pointer.malloc(size, freefunc = nil) => fiddle pointer instance
Allocate size
bytes of memory and associate it with an optional freefunc
that will be called when the pointer is garbage collected.
freefunc
must be an address pointing to a function or an instance of Fiddle::Function
Wakes up all threads waiting for this lock.
Performs a Miller-Rabin probabilistic primality test with checks iterations. If checks is not specified, a number of iterations is used that yields a false positive rate of at most 2^-80 for random input.
checks - integer
Enter error recovering mode. This method does not call on_error
.
Leave error recovering mode.
Returns the broadcast address of ifaddr. nil is returned if the flags doesn’t have IFF_BROADCAST.
Logs a message
at the error (syslog warning) log level, or logs the message returned from the block.
Same as IO
.
Same as IO
.
Returns the number of native file system blocks allocated for this file, or nil
if the operating system doesn’t support this feature.
File.stat("testfile").blocks #=> 2
Returns true
if stat is a zero-length file; false
otherwise.
File.stat("testfile").zero? #=> false
Returns true
if stat is a socket, false
if it isn’t or if the operating system doesn’t support this feature.
File.stat("testfile").socket? #=> false
Returns true
if the file is a block device, false
if it isn’t or if the operating system doesn’t support this feature.
File.stat("testfile").blockdev? #=> false File.stat("/dev/hda1").blockdev? #=> true
Does this dependency require a prerelease?
A set of tasks to prepare the file in order to parse it