new Connection()
Hypervisor Connection
- Source:
- See:
-
Methods
(static) open(name) → {Connection}
This function should be called first to get a connection to the
Hypervisor and xen store
If name
is null or undefined, if the
LIBVIRT_DEFAULT_URI
environment variable is set, then it
will be used. Otherwise if the client configuration file has the
"uri_default" parameter set, then it will be used. Finally probing will
be done to determine a suitable default driver to activate. This
involves trying each hypervisor in turn until one successfully opens.
If connecting to an unprivileged hypervisor driver which requires the
libvirtd daemon to be active, it will automatically be launched if not
already running. This can be prevented by setting the environment
variable
LIBVIRT_AUTOSTART=0
URIs are documented at http://libvirt.org/uri.html
Connection#close() should be used to release the resources
after the connection is no longer needed.
Parameters:
| Name |
Type |
Description |
name |
String
|
URI of the hypervisor, optional |
- Source:
Throws:
Error
Returns:
a hypervisor connection
-
Type
-
Connection
(static) openAuth(name, auth, flags) → {Connection}
This function should be called first to get a connection to the
Hypervisor. If necessary, authentication will be performed fetching
credentials via the callback
See Connection#open() for notes about environment variables
which can have an effect on opening drivers and freeing the connection
resources
URIs are documented at http://libvirt.org/uri.html
Parameters:
| Name |
Type |
Description |
name |
String
|
URI of the hypervisor, optional |
auth |
ConnectionAuth
|
authenticate callback parameters |
flags |
Number
|
bitwise-OR of virConnectFlags |
- Source:
- See:
-
- VIR_CONNECT_RO
- VIR_CONNECT_NO_ALIASES
Throws:
Error
Returns:
the hypervisor connection
-
Type
-
Connection
(static) openReadOnly(name) → {Connection}
This function should be called first to get a restricted connection to
the library functionalities. The set of APIs usable are then restricted
on the available methods to control the domains.
See Connection#open() for notes about environment variables
which can have an effect on opening drivers and freeing the connection
resources
URIs are documented at http://libvirt.org/uri.html
Parameters:
| Name |
Type |
Description |
name |
String
|
URI of the hypervisor, optional |
- Source:
Throws:
Error
Returns:
the hypervisor connection
-
Type
-
Connection
addEventListener(event, listener)
Registers a callback to be invoked when the connection event occurred
Parameters:
| Name |
Type |
Description |
event |
String
|
the name of event |
listener |
function
|
the callback function |
- Source:
allocNodePages(allocations, startCell, cellCount, flags)
Sometimes, when trying to start a new domain, it may be necessary to
reserve some huge pages in the system pool which can be then allocated
by the domain. This API serves that purpose.
Parameters:
| Name |
Type |
Description |
allocations |
Array
|
An array of PageAllocation |
startCell |
Number
|
index of first cell to allocate pages on |
cellCount |
Number
|
number of consecutive cells to allocate pages on |
flags |
Number
|
extra flags; binary-OR of virNodeAllocPagesFlags |
- Source:
Throws:
Error
Returns:
the number of nodes successfully adjusted
baselineCPU(xmlCPUs, flags) → {String}
Computes the most feature-rich CPU which is compatible with all given host CPUs.
Parameters:
| Name |
Type |
Description |
xmlCPUs |
Array
|
array of XML descriptions of host CPUs |
flags |
Number
|
bitwise-OR of virConnectBaselineCPUFlags |
- Source:
- See:
-
- VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES
- VIR_CONNECT_BASELINE_CPU_MIGRATABLE
Returns:
XML description of the computed CPU (caller frees) or
{@code undefined} on error.
-
Type
-
String
changeInterfaceBegin()
Creates a restore point
- Source:
Throws:
Error
changeInterfaceCommit()
Commits the changes made to interfaces
- Source:
Throws:
Error
changeInterfaceRollback()
Cancels changes made to interfaces settings by restoring previous state
- Source:
Throws:
Error
close() → {Number}
This function closes the connection to the Hypervisor.
- Source:
Returns:
a positive number if at least 1 reference remains on
success. The returned value should not be assumed to be the total
reference count. A return of 0 implies no references remain and the
connection is closed and memory has been freed.
-
Type
-
Number
compareCPU(xmlDesc, flags) → {Number}
Compares the given CPU description with the host CPU
Parameters:
| Name |
Type |
Description |
xmlDesc |
String
|
XML describing the CPU to compare with host CPU |
flags |
Number
|
bitwise-OR of virConnectCompareCPUFlags |
- Source:
- See:
-
- VIR_CPU_COMPARE_ERROR
- VIR_CPU_COMPARE_INCOMPATIBLE
- VIR_CPU_COMPARE_IDENTICAL
- VIR_CPU_COMPARE_SUPERSET
- VIR_CPU_COMPARE_LAST
Returns:
comparison result
-
Type
-
Number
createDomainXML(xml, flags) → {Domain}
Launch a new guest domain, based on an XML description
Parameters:
| Name |
Type |
Description |
xml |
String
|
string containing an XML description of the domain |
flags |
Number
|
bitwise-OR of supported virDomainCreateFlags |
- Source:
Throws:
Error
Returns:
-
Type
-
Domain
createDomainXMLWithFiles(xml, files, flags) → {Domain}
Launch a new guest domain, based on an XML description
Parameters:
| Name |
Type |
Description |
xml |
String
|
string containing an XML description of the domain |
files |
Array
|
list of file descriptors |
flags |
Number
|
bitwise-OR of supported virDomainCreateFlags |
- Source:
Throws:
Error
Returns:
-
Type
-
Domain
defineDomainXML(xml) → {Domain}
Define a domain, but does not start it. This definition is persistent,
until explicitly undefined with Domain#undefine()
Parameters:
| Name |
Type |
Description |
xml |
String
|
the XML description for the domain, preferably in UTF-8 |
- Source:
Throws:
Error
Returns:
-
Type
-
Domain
defineDomainXMLFlags(xml, flags) → {Domain}
Define a domain, but does not start it. This definition is persistent,
until explicitly undefined with Domain#undefine()
Parameters:
| Name |
Type |
Description |
xml |
String
|
the XML description for the domain, preferably in UTF-8 |
flags |
Number
|
bitwise OR of the virDomainDefineFlags constants |
- Source:
Throws:
Error
Returns:
-
Type
-
Domain
defineInterfaceXML(xml) → {Interface}
Define an inactive persistent physical host interface or modify an existing
persistent one from the XML description
Parameters:
| Name |
Type |
Description |
xml |
String
|
|
- Source:
Throws:
Error
Returns:
-
Type
-
Interface
getCapabilities() → {String}
Get the capabilities of the hypervisor / driver.
- Source:
Returns:
a XML string defining the capabilities.
-
Type
-
String
getCPUModelNames(arch, models, flags) → {Number}
Get the list of supported CPU models for a specific architecture.
Parameters:
| Name |
Type |
Description |
arch |
String
|
architecture |
models |
Array
|
the CPU models supported for the specified architecture |
flags |
Number
|
extra flags; not used yet, so callers should always pass 0 |
- Source:
Returns:
-1 on error, number of elements in models on success
-
Type
-
Number
getHostname(conn) → {String}
This returns a system hostname on which the hypervisor is running
(based on the result of the gethostname system call, but possibly
expanded to a fully-qualified domain name via getaddrinfo). If we are
connected to a remote system, then this returns the hostname of the
remote system.
Parameters:
| Name |
Type |
Description |
conn |
Connection
|
hypervisor connection |
- Source:
Throws:
Error
Returns:
the hostname which must be freed by the caller
-
Type
-
String
getLibVersion(conn) → {Number}
Returns the version of libvirt used by the daemon running on the host
Parameters:
| Name |
Type |
Description |
conn |
Connection
|
hypervisor connection |
- Source:
Throws:
Error
Returns:
libvirt library version used on the connection
-
Type
-
Number
getMaxVcpus(type) → {Number}
Provides the maximum number of virtual CPUs supported for a guest VM of
a specific type. The 'type' parameter here corresponds to the 'type'
attribute in the element of the XML
Parameters:
| Name |
Type |
Description |
type |
String
|
value of the 'type' attribute in the element |
- Source:
Throws:
Error
Returns:
the maximum of virtual CPU
-
Type
-
Number
getNodeCellsFreeMemory(startCell)
Returns the free memory in one or more NUMA cells
Parameters:
| Name |
Type |
Description |
startCell |
Number
|
index of first cell |
- Source:
Throws:
Error
Returns:
the free memory
getNodeCPUMap() → {Array}
Get CPU map of host node CPUs
- Source:
Throws:
Error
Returns:
CPUs present on the host node
-
Type
-
Array
getNodeCPUStats(cpuNum) → {Object}
This function provides individual cpu statistics of the node. If you
want to get total cpu statistics of the node, you must specify
VIR_NODE_CPU_STATS_ALL_CPUS to cpuNum
.
Parameters:
| Name |
Type |
Description |
cpuNum |
Number
|
number of node cpu |
- Source:
Throws:
Error
Returns:
-
Type
-
Object
getNodeFreeMemory()
Returns the free memory available on the Node
- Source:
Throws:
Error
Returns:
the available free memory in bytes
getNodeFreePages(pages, startCell, cellCount) → {PageAllocation}
Queries the host system on free pages of specified size
Parameters:
| Name |
Type |
Description |
pages |
Array
|
page sizes to query |
startCell |
Number
|
index of first cell |
cellCount |
Number
|
maximum number of cells |
- Source:
Throws:
Error
Returns:
the free pages
-
Type
-
PageAllocation
getNodeInfo() → {NodeInfo}
Extract hardware information about the node.
- Source:
Throws:
Error
Returns:
-
Type
-
NodeInfo
getNodeMemoryParameters() → {Array}
Get all node memory parameters (parameters unsupported by OS will be
omitted)
- Source:
Throws:
Error
Returns:
-
Type
-
Array
getNodeMemoryStats(cellNum) → {Object}
Returns the memory stats of the node
Parameters:
| Name |
Type |
Description |
cellNum |
Number
|
number of node cell |
- Source:
Throws:
Error
Returns:
-
Type
-
Object
getNodeSecurityModel() → {Object}
Returns the security model of a hypervisor
- Source:
Throws:
Error
Returns:
-
Type
-
Object
getNumberOfDefinedDomains() → {Number}
Returns he number of defined but inactive domains
- Source:
Throws:
Error
Returns:
-
Type
-
Number
getNumberOfDefinedInterfaces() → {Number}
Returns the number of defined (inactive) interfaces on the physical host
- Source:
Throws:
Error
Returns:
-
Type
-
Number
getNumberOfDomains() → {Number}
Returns the number of active domains
- Source:
Throws:
Error
Returns:
-
Type
-
Number
getSysinfo(flags) → {String}
This returns the XML description of the sysinfo details for the host on
which the hypervisor is running, in the same format as the
element of a domain XML. This information is generally available only
for hypervisors running with root privileges.
Parameters:
| Name |
Type |
Description |
flags |
Number
|
|
- Source:
Throws:
Error
Returns:
the XML string
-
Type
-
String
getType() → {String}
Get the name of the Hypervisor driver used. This is merely the driver
name; for example, both KVM and QEMU guests are serviced by the driver
for the qemu:// URI, so a return of "QEMU" does not indicate whether
KVM acceleration is present. For more details about the hypervisor, use
virConnectGetCapabilities
- Source:
Throws:
Error
Returns:
the name of the Hypervisor driver used
-
Type
-
String
getURI() → {String}
This returns the URI (name) of the hypervisor connection. Normally this
is the same as or similar to the string passed to the
Connection#open() / {@link virConnectOpenReadOnly} call, but the
driver may make the URI canonical. If name is null
was
passed to Connection#open(), then the driver will return a non-NULL
URI which can be used to connect to the same hypervisor later.
- Source:
Throws:
Error
Returns:
the URI string
-
Type
-
String
getVersion() → {Number}
Get the version level of the Hypervisor running. This may work only with
hypervisor call, i.e. with privileged access to the hypervisor, not with
a Read-Only connection.
- Source:
Throws:
Error
Returns:
the version of the running hypervisor
-
Type
-
Number
isAlive() → {Boolean}
Determine if the connection to the hypervisor is still alive
- Source:
Returns:
true if alive, false if dead
-
Type
-
Boolean
isEncrypted() → {Boolean}
Determine if the connection to the hypervisor is encrypted
- Source:
Returns:
true if encrypted, false if not encrypted
-
Type
-
Boolean
isSecure() → {Boolean}
Determine if the connection to the hypervisor is secure
- Source:
Returns:
true if secure, false if not secure
-
Type
-
Boolean
listAllDomains(flags) → {Array}
Returns a possibly-filtered list of all domains
Parameters:
| Name |
Type |
Description |
flags |
Number
|
|
- Source:
Throws:
Error
Returns:
-
Type
-
Array
listAllInterfaces(flags) → {Array}
Returns the list of interfaces
Parameters:
| Name |
Type |
Description |
flags |
|
bitwise-OR of virConnectListAllInterfacesFlags |
- Source:
Throws:
Error
Returns:
-
Type
-
Array
listDefinedDomains() → {Array}
Returns the defined but inactive domains
- Source:
Throws:
Error
Returns:
-
Type
-
Array
listDefinedInterfaces() → {Array}
Returns the list of defined (inactive) physical host interfaces
- Source:
Throws:
Error
Returns:
-
Type
-
Array
listDomains() → {Array}
Returns the list of active domains
- Source:
Throws:
Error
Returns:
-
Type
-
Array
listInterfaces() → {Array}
Returns the name of interfaces
- Source:
Throws:
Error
Returns:
-
Type
-
Array
lookupDomainById(id) → {Domain}
Try to find a domain based on the hypervisor ID number Note that this won't
work for inactive domains which have an ID of -1, in that case a lookup
based on the Name or UUId need to be done instead.
Parameters:
| Name |
Type |
Description |
id |
Number
|
the domain ID number |
- Source:
Throws:
Error
Returns:
-
Type
-
Domain
lookupDomainByName(name) → {Domain}
Try to lookup a domain on the given hypervisor based on its name.
Parameters:
| Name |
Type |
Description |
name |
String
|
the domain name |
- Source:
Throws:
Error
Returns:
-
Type
-
Domain
lookupDomainByUUID(uuid) → {Domain}
Try to lookup a domain on the given hypervisor based on its UUID.
Parameters:
| Name |
Type |
Description |
uuid |
String
|
the UUID string for the domain |
- Source:
Throws:
Error
Returns:
-
Type
-
Domain
lookupInterfaceByMACString(mac) → {Interface}
Try to lookup an interface on the given hypervisor based on its MAC.
Parameters:
| Name |
Type |
Description |
mac |
String
|
the MAC for the interface (null-terminated ASCII format) |
- Source:
Throws:
Error
Returns:
-
Type
-
Interface
lookupInterfaceByName(name) → {Interface}
Try to lookup an interface on the given hypervisor based on its name.
Parameters:
| Name |
Type |
Description |
name |
String
|
name for the interface |
- Source:
Throws:
Error
Returns:
-
Type
-
Interface
ref()
Increment the reference count on the connection. For each additional
call to this method, there shall be a corresponding call to
Connection#close() to release the reference count, once the caller
no longer needs the reference to this object.
This method is typically useful for applications where multiple
threads are using a connection, and it is required that the connection
remain open until all threads have finished using it. ie, each new
thread using a connection would increment the reference count.
- Source:
Throws:
Error
removeEventListener(event, listener)
Unregisters the callback previously set with the
Connection#addEventListener()
Parameters:
| Name |
Type |
Description |
event |
String
|
the name of event |
listener |
function
|
the callback function |
- Source:
setKeepAlive(interval, count) → {Boolean}
Start sending keepalive messages after interval
seconds of
inactivity and consider the connection to be broken when no response is
received after count
keepalive messages sent in a row. In
other words, sending count + 1
keepalive message results in
closing the connection. When interval
is <= 0, no keepalive
messages will be sent. When count
is 0, the connection will
be automatically closed after interval
seconds of
inactivity without sending any keepalive messages.
Parameters:
| Name |
Type |
Description |
interval |
Number
|
number of seconds of inactivity before a keepalive message is sent |
count |
Number
|
number of messages that can be sent in a row |
- Source:
Throws:
Error
Returns:
true on success, false when remote party doesn't
support keepalive messages
-
Type
-
Boolean
setNodeMemoryParameters(params)
Change all or a subset of the node memory tunables
Parameters:
| Name |
Type |
Description |
params |
Array
|
scheduler parameter objects |
- Source:
Throws:
Error
suspendNodeForDuration(target, duration)
Attempt to suspend the node (host machine) for the given duration of time
in the specified state (Suspend-to-RAM, Suspend-to-Disk or Hybrid-Suspend).
Schedule the node's Real-Time-Clock interrupt to resume the node after the
duration is complete
Parameters:
| Name |
Type |
Description |
target |
Number
|
the state to which the host must be suspended to |
duration |
Number
|
the time duration in seconds for which the host has to be suspended |
- Source:
Throws:
Error


{{ saveError }}
The following credential pair keys conflict in the listed credentials:
Please ensure credential pair keys are unique, then try again.
{{ getServiceByRevision(diffRevision).enabled }}
{{ getServiceByRevision(currentRevision).enabled }}
This is the only revision of this service. You'll need to edit the service to make any changes.
This is the current revision of this service. The above diff is between the current revision and the previous revision.


2019
I became the youngest most follwed instergramer in sri lanka and won also won national championship.
A national team player u16 level in Sri Lanka
Playing karate and football curently play in acfc ack and redstar sc.
I'm a national team player who started sport career in karate at superfight karate dojo and then started football at acfc. after that in 2018 I was called up to play with the national squad .Currently i'm playing for acfc,ack and redstar sc.
I started my football career as a center back in sounders fc and then i started to play for my school team(ACFC) then i became a foward player and now im the no 09 striker in the acfc and redstar team
I stared my karate career at superfight karate dojo in Kiribathgoda Sri lanka then after wining many trophies there i started to playing with my school team(ACK) where i started a another karate style called "shoto kahan"
I became the youngest most follwed instergramer in sri lanka and won also won national championship.
i started football and karate and this is the year which i was called up to play with the national squad.
I started chess,archery,swiming,jymnastic and i won all island 3rd place in chess .
In grade 3 i was qualified to the annual sport meet of ananda college this was my first entrance to the sport career.
I went to Ananda college for my studies. there i found frinds and this is my first steps to became a footabaler
2004/10/15 I was born in kelaniya sr lanka. This is the start of the journy
To see more photos
football player & karate player
professional athletet from sri lankan national sporting comiitie
contact using click here to send a private mail click here to contact +94 788594912
203/4/a koholwila road
Gonawala,kelaniya
Colomco,Sri Lanka


Lightning Fast String Lookups With Tries
Live Demo
A trie is a search tree that is typically used to store string keys and facilitates fast lookup of values and partial matching. Tries can be used to store things besides words of course, like IP addresses in routers or numbers in algorithms, but for this tutorial, we’ll keep it simple and just use words.
For example, I have a large list of words. How many of those words match the prefix “ca+”, where + is any number of further letters? Or, say I want to match words that have letters existing in fixed positions but could have any letter in other positions. For instance, l*****s should match ‘letters’ and ‘ladders’ but not ‘levitations’.
You can think of a trie as an additional constraint added to a hash table. Unlike trees, the value of nodes is encoded directly into the tree structure itself rather than stored within the node’s properties. The position of a letter in a word is given by its distance away from the root. The second letter is at level 2, the third level at level 3, etc.
To store a tree with the words HALL, HALOES, HALO, HELL, and AIR, it’d look like this:
*
/ \
H A
/ \ \
A E I
/ \ \
L L R
/ \ \
L O L
\
E
\
S
You might be asking yourself: how do I even go about accessing these words (or possibly: how on earth is this structure advantageous)?
Well, consider that you’re looking for the word HALO. You break the word you’re searching for into individual letters. Then you search the Trie using each letter as a key. Tree['H']
brings you to
A
/
L
/ \
L O
\
E
\
S
and this Tree['A']
brings you to
L
/ \
L O
\
E
\
S
and this Tree['L']
brings you to
O
\
E
\
S
then this Tree['O']
brings you to
E
\
S
And we’re done.
(Not!) We actually ran into an edge case for storing data in tries: since multiple pieces of data (words) can be stored along the same path through the tree, how do we delineate individual words?
We can do this pretty easily: all we have to do is add a marker to the end of a word when we insert it to signify that it marks the “END” of a given word.
Then when we search through the tree, we’ll keep iterating through the characters, using each one as a key to move farther down the tree. If a key does not exist at a given level, the word is not in the tree, so we return false.
If we exhaust characters in the word we’re searching for and are still at a valid node, we check for the “END” marker. If it’s present, the word exists in the tree. If it’s not, the word doesn’t exist, even though its letters do.
*
/ \
H A
/ \ \
A E I
/ \ \
L L R^
/ \ \
L^ O^ L^
\
E
\
S^
Here’s the original diagram again, where an up-caret (^
) signifies a word ending.
Note that this algorithm makes adding words to the tree whose paths already exist quite simple. Looking at the current tree, we could add the words “HE”, “AI” and “HA” simply by adding three end properties to existing nodes.
Let’s go ahead and code up insert, search, and delete.
Basic Implementation
var Trie = function () {
this.nodes = {};
this.length = 1;
};
Trie.prototype.getLength = function () {
return this.length;
};
Our Trie is a simple object with nodes and a length. Each node object is in fact just a simple dictionary: it doesn’t need to be any more complicated than this.
Insert
To insert a word into the trie, we split it into individual characters and then convert them all to upper case. If we didn’t do this, we’d double the number of possible keys in the tree if our insertions could be in mixed case, as well as increase the number of possible ways the same letters could be stored by a factor of word.length!
. Consider:
CAT
vs Cat cAt caT CAt cAT CAT
I like cats, but that’s just ridiculous.
Trie.prototype.insert = function (word) {
let node = this.nodes;
word = word.split("").map((e) => e.toUpperCase());
let idx = 0;
let newWord = false;
while (idx < word.length) {
if (node[word[idx]]) {
node = node[word[idx]];
} else {
// inserting a new word
newWord = true;
node[word[idx]] = {};
node = node[word[idx]];
}
if (idx === word.length - 1) {
node.end = true;
}
idx++;
}
if (newWord) {
this.length++;
}
};
We set the current node equal to the trie root and then check to see if the first letter of the word exists as a key. If it does, we set the current node equal to this next node. If it doesn’t, we create a node, and then we set the current node equal to the next node.
A new node is just an empty JS object {}
as our nodes are just dictionaries. We don’t need anything fancy here. We also have a flag that we set to true when we create a new node so that we can increment the length of the trie accordingly.
We continue this process for every letter in the word, including the last.
When we get to the last letter in the word (index of word.length-1), we set the end
property on the node to true to signify the word we’re inserting ends here.
Insertion is pretty simple.
Search and Delete
Delete and search have linked functionality, so let’s discuss them at the same time.
You might think that deletion is simply deleting the end
property from a given node. That works as a form of “lazy deletion”. What makes it lazy? By toggling the end flag, we are potentially leaving extra letters in the tree that no longer belong to any word.
Consider our original tree.

What about deleting ‘HALOES’? Here’s how we’re going to work through it. When we search for a node, if that node doesn’t exist in the tree, we return false. No big deal.
If the node does exist though, we’ll return information further up the tree. We can safely delete nodes from the tree at the end of the word until we reach either:
- A branch point
- The end of a previous word
Branch points are nodes with more than one key that are not located at the end of the word we are deleting.
A branch point is a node that has more than one key. The end of a previous word is also a node that has more than one key (we add an end
key to the node). So we can consider both of these cases to be branch points.
If there are no branch points on the path to a word, we can delete the entire word without consequence. AIR for instance. Otherwise, we can delete all letters up to but not including the last encountered branch point. HALOES, for instance: delete O, E, S.
*
/ \
H A
/ \ \
A E I
/ \ \
L L R^
/ \
L^ L^
Haloes was deleted.
We need a search function that will return:
- Whether or not a word exists in the trie
- If so, it should return:
- the node at which the most recently-encountered branch occurred, as well as the next letter in the word after this branch
- the node at which the word ends
Trie.prototype.search = function (word) {
word = word.split("").map((e) => e.toUpperCase());
let node = this.nodes;
let lastEnd = null;
for (var i = 0; i < word.length; i++) {
if (!node[word[i]]) {
return false;
} else {
node = node[word[i]];
if (Object.keys(node).length > 1 && i !== word.length - 1) {
lastEnd = { node: node, key: word[i + 1] };
}
}
}
return node.end ? { result: node, lastEnd: lastEnd } : false;
};
Trie.prototype.find = function (word) {
return this.search(word) ? true : false;
};
We convert the query to uppercase, since that’s how we store our keys. Then we ensure that keys exist for every node in the tree. If the tree is missing a node, we return false, since the word doesn’t exist. Otherwise, we move on to the next node.
Note this line: if (Object.keys(node).length>1 && i!==word.length-1)
This block executes to record the last end
or branch encountered as we walk down the tree.
We make sure that we haven’t already reached the end of the node before assigning lastEnd
(otherwise, lastEnd
will always just equal node
).
When storing this last node, I include not only a reference to the node, but also the key from which to delete. It’s the letter one past the point at which the node branches.
We return both the result and the lastEnd
if the word is found. We ensure that when we’ve reached the final character, its end
flag is set to true.
Finally, I wrapped the search
function in a find
method that we can publicly expose: a find that returns true/false is a little less messy than a search that returns an object that other methods use internally.
Now for the delete function.
Trie.prototype.delete = function (word) {
let findWord = this.search(word);
if (!findWord) {
return false;
} // 1
if (findWord.result.end) {
delete findWord.result.end;
} // 2
if (findWord.lastEnd) {
// 3
const key = findWord.lastEnd.key;
delete findWord.lastEnd.node[key];
}
this.length--;
return true;
};
There are three cases when we try to delete a node.
- It doesn’t exist. Do nothing.
- It exists, and it is the last element in a path. Delete the
end
property. - It exists, and it is not the last element in the path. We need to delete the end property as well as all other elements up to the end that will no longer be used.
These cases correspond to the three if statements above. Note the need to store the deletion key here. This saves us the work of having to store pointers between nodes so that we can traverse backwards through the tree to identify parents.
Printing out words in the trie
In order to print words in the trie, we’ll use a recursive method that implements pre-order depth-first traversal. We covered different tree traversal methods in a previous tutorial on binary search trees.
First we’ll define a getNode
helper function. It works a little like search
, but all it’s going to do is return a given node in the tree.
Trie.prototype.getNode = function (word) {
word = word.split("").map((e) => e.toUpperCase());
let node = this.nodes;
for (var i = 0; i < word.length; i++) {
if (!node[word[i]]) {
return false;
} else {
node = node[word[i]];
}
}
return node;
};
Now let’s write a function to print out all the words in the trie.
For each node, we get all the keys at that node. Then we iterate over all these keys. If one of the keys equals an endpoint, we push the word we’re currently building into the completed words list.
Otherwise, we put the partial word plus the current letter (word+keys[i]
) back into recursePrint
and move to the next node node[keys[i]]
.
Trie.prototype.printWords = function () {
let wordList = [];
let word = "";
recursePrint(this.nodes, word, wordList);
function recursePrint(node, word, list) {
let keys = Object.keys(node);
for (var i = 0; i < keys.length; i++) {
if (keys[i] === "end") {
list.push(word);
} else {
recursePrint(node[keys[i]], word + keys[i], list);
}
}
}
return wordList;
};
Find
We can use our printWords
method as a basis for writing two more specific find methods.
By wildcard
The first will find words that have wildcards in them. For instance, calling the function with tr**
would return both “tree” and “tree”.
Let’s think about what we’re doing here. It’s similar to a search, except at each level, we narrow our search space by the constraints given by the word that we’re looking to match.
Let’s go back to the example tree.
*
/ \
H A
/ \ \
A E I
/ \ \
L - T^ L R^
/ \ \
L^ O L^
\
E
\
S^
If we search for HA**, we’ll get HALL, HALT, and HALO.
We want to restrict the keys at the first level to H, and exclude A. We want to restrict the keys at the second level to A and exclude E. Then on the third level, we want to include all possible keys: L. On the fourth level, we want to include all possible keys: L, T, and O.
Thinking about this in terms of a function:
Trie.prototype.wildcardFind = function (query) {
query = query
.replace(/[^a-z*]/gi, "")
.split("")
.map((e) => e.toUpperCase());
let wordList = [];
let word = "";
recursePrint(this.nodes, word, wordList);
function recursePrint(node, word, list) {
let idx = word.length;
if (word.length > query.length) {
return false;
} else {
if (Object.keys(node).includes("end")
&& word.length === query.length) {
list.push(word);
}
let keys = query[idx] == "*" ? Object.keys(node) : [query[idx]];
for (var i = 0; i < keys.length; i++) {
recursePrint(node[keys[i]], word + keys[i], list);
}
}
}
return wordList;
};
It looks much like printWords
. The only big differences are:
- We sanitize the user input, stripping out invalid (non-alphanumeric) keys.
- If the word we’re assembling is larger than the search term, we return false (matches must be the same number of characters).
- If the word we’re assembling matches the search term length and the node has an
end
flag set, we accept the word. - We set the keys at each level dynamically based on the length of the word that we are assembling. For each call to
recursePrint
, we setidx
equal toword.length
. This value grows by one with each level we descend down the trie. This value also corresponds directly to the key we wish to choose at that level.
- If the search term has an asterisk (wildcard) at that level, we iterate over all keys at that level (
Object.keys(node)
). - If it has a character at the level, we only iterate over the single key corresponding to that character.
You can think of this as a depth-first traversal that visits a desired subset of nodes based on a filtering of the keys.
By prefix
Searching by prefix is very similar to searching by wildcards. The only difference is that we already have part of the word in hand, so there’s no need to start at the root node of the tree (this.nodes
) like we did in wildcardFind.
Instead, we use getNode
to obtain the prefix root and begin traversing from there.
Trie.prototype.prefixFind = function (prefix, desiredLength = null) {
let wordList = [];
prefix = prefix.replace(/[^a-z]/gi, "").toUpperCase();
recursePrint(this.getNode(prefix), prefix, wordList);
function recursePrint(node, word, list) {
let idx = word.length;
if (desiredLength && word.length > desiredLength) {
return false;
} else {
let keys = null;
if (Object.keys(node).includes("end")) {
if (!desiredLength) {
list.push(word);
} else if (word.length === desiredLength) {
list.push(word);
}
}
keys = idx < prefix.length ? [prefix[idx]] : Object.keys(node);
for (var i = 0; i < keys.length; i++) {
recursePrint(node[keys[i]], word + keys[i], list);
}
}
}
return wordList;
};
One key difference is that we allow the user to specify whether or not there is a desired word length, which is off by default.
We use this desiredLength
as an optional check on the words we build up, quitting early if the word exceeds or does not meet the desiredLength
.
Consider how you might modify this function slightly for autocomplete
: maybe you want to suggest words that are 2 or 3 characters longer than the current word entered, so desiredLength
could be set dynamically. This would also require some nuance: at a certain point, you’d want to stop increasing desiredLength
, since you’ll overshoot the suggestions and display zero results, even when the user has typed in a suggested value.
Fun exercises:
- Implement dynamic
desiredLength
for more responsive autocomplete - Implement wildcards in
prefixFind
so that, for example,prefixFind('*')
returns everything in the trie, andprefixFind('*',4)
returns all 4-letter words in the tree.
Using the Trie + CodePen Demo
We instantiate a tree object with let T = new Trie();
and insert words with T.insert('word')
. There’s not much to it! The best way to see it in action is with the CodePen demo up top, where we put a ton of words in the trie and then use prefixFind
to perform typeahead lookup in real-time. I added a few calls to Performance.now()
(Docs)
so you can see how snappy our trie functions.
Wrapping Up
Congratulations! You’ve gotten an introduction to another simple data structure, the trie.
There are many variations of tries. We can encode the data we store in a trie more compactly, as well as store nodes that are only used by single elements to make the tree shorter. We’ll discuss more later, but for now, consider our original tree:
*
/ \
H A
/ \ \
A E I
/ \ \
L L R
/ \ \
L O L
\
E
\
S
What if we consolidated non-shared nodes like this:
*
/ \
H A
/ \ \
AL ELL IR
/ \
L OES
4 levels tall instead of 7!
How would insertion and deletion change? (Hint: splitNodeKeys
and joinNodeKeys
). How would we perform lookup? How would we decide what lengths of keys to allow per level, and would we do this dynamically or fix the size? To be continued.


Team Players
Susan Smith
Manager
ID: 1
Email:
<EMAIL_ADDRESS>Office number: 82019
Charlie Jones
Engineer
ID: 2
Email:
<EMAIL_ADDRESS>GitHub:
Bob Thomas
Allan Braun
Intern
ID: 3
Email:
<EMAIL_ADDRESS>School: Polytechnic


{% load staticfiles %} {% include "header.html" %}
Your information is important and necessary for making transactions. We encourage you to update it as soon as possible.
Email:
{{extended_user.user.email}}
ZipCode:
{{extended_user.zipcode}}
Bio:
{{extended_user.bio}}


String
literal (for example, "UTF-8"
) can be replaced with
the predefined StandardCharsets.UTF_8
code.
The code after the fix may work faster, because the charset lookup becomes unnecessary.
Also, catching UnsupportedEncodingException
may become unnecessary as well. In this case,
the catch block will be removed automatically.
Example:
try {
byte[] bytes = "str".getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
}
After quick-fix is applied:
byte[] bytes = "str".getBytes(StandardCharsets.UTF_8);
The inspection is available in Java 7 and later.
New in 2018.2


wire
crypt
plain
parse
kdf
This should be a diagram! If you don't see it you need Javascript enabled
Message details
Click the arrow labels!
Intentionally left blank


Markovtsev Vadim
Web Programming @ MIPT, 2015-2016
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
sudo apt-get install git
brew install git
git init
to initialize an empty repogit clone
to fetch an existing oneExamples:
git init .
git clone git@github.com:vmarkovtsev/mipt_web_2015.git mipt
Internal files are stored inside .git
directory in the repo's root
git status
- show what's going ongit log
- show what happened before on the current branchgit reflog
- show the last N repository statesgit add [-p]
- adds untracked and modified files to staging areagit add
- mark conflict as resolvedgit diff
- show the difference between HEAD and modified (but not staged!)git diff --staged
- show the difference between HEAD and stagedgit reset [-p]
- remove the file from staging to modified or untrackedgit checkout -f
- restore deleted file, revert changesgit rm
- removes the file from Git and from the file systemgit rm --cached
- removes the file from Git but leaves it in the file systemgit mv
- move filegit commit [-m]
- make the commit from stagedgit commit --amend
- meld staged into the previous commit (HEAD)git rebase -i HEAD^^^
- change last 3 commits sequentiallygit remote -v
- view external repositoriesgit remote add
- add external repositorygit remote rm
- remove external repositorygit fetch
- synchronize remote branches with local mirrorsgit pull --rebase
- take off local commits, apply remote's and finally return localgit pull
- merge local branch with remote counterpartgit push <remote name> <branch name>
- update remote branchgit branch
- set new branch to point to HEAD, but do not switch to itgit checkout -b
- set new branch to point to HEAD, and switch to itgit checkout
- switch to existing branchgit branch -d/-D
- delete branch (local)git push <remote name> :<name>
- delete branch (remote)git merge [--squash]
- merge with other branchgit rebase
- rebase against other branchgit cherry-pick
- take commit(s), duplicating historygit mergetool
- resolve conflictsgit stash
- take the snapshot of modified and staged, then do git reset --hard
git stash pop
- recover the modified and stagedgit stash list
- view LIFOgit tag
- mark HEAD with a labelgit pull --tags
- fetch tags, toogit push --tags
- push with tagsgit format-patch <commit>
- create patch files from
each commit after <commit>git diff
git apply
- apply patchgit submodule add <where> <path>
- register new submodulegit submodule update --init [--recursive]
- pulls all submodules
and detaches HEADs of eachgit fsck
- check internal integritygit gc
- garbage collect objects


All Classes
BinarySearchTree
BinarySearchTreeWithRotate
BinaryTree
BinaryTree.Node
BTree
BTree.Node
Main
RedBlackTree
RedBlackTree.RedBlackNode
SearchTree
SkipList
SkipList.SLNode


Are we currently connected?
Are we currently disconnected?
The ID of the socket; matches the server ID and is set when we're connected, and cleared when we're disconnected
The Manager that's controller this socket
The namespace that this socket is for
Disconnects the socket manually
This Socket
Sets the compress flag.
If true
, compresses the sending data
this Socket
An override of the base emit. If the event is one of: connect connect_error connect_timeout connecting disconnect error reconnect reconnect_attempt reconnect_failed reconnect_error reconnecting ping pong then the event is emitted normally. Otherwise, if we're connected, the event is sent. Otherwise, it's buffered.
If the last argument is a function, then it will be called as an 'ack' when the response is received. The parameter(s) of the ack will be whatever data is returned from the event
The event that we're emitting
Optional arguments to send with the event
This Socket
Returns if we have listeners for a particular event
The event that we want to check if we've listeners for
True if we have listeners for this event, false otherwise
Returns all the callbacks for a particular event
The event that we're looking for the callbacks of
An array of callback Functions, or an empty array if we don't have any
Removes a listener for a particular type of event. This will either remove a specific listener, or all listeners for this type of event
The event that we want to remove the listener of
The function to remove, or null if we want to remove all functions
This Emitter
Adds a listener for a particular event. Calling multiple times will add multiple listeners
The event that we're listening for
The function to call when we get the event. Parameters depend on the event in question
This Emitter
Adds a listener for a particular event that will be invoked a single time before being automatically removed
The event that we're listening for
The function to call when we get the event. Parameters depend on the event in question
This Emitter
Opens our socket so that it connects. If the 'autoConnect' option for io is true (default), then this is called automatically when the Socket is created
Removes all event listeners on this object
This Emitter
Sends a 'message' event
Any optional arguments that we want to send
This Socket
Generated using TypeDoc
The Socket that we use to connect to a Namespace on the server


Welcome to the WRFx controller website, an experimental system built to initiate fire simulations using the wrfxpy system. The wrfxpy system in turn relies on WRF-SFIRE to perform the numerical simulation itself. The results of the simulation will appear on the integrated visualization system wrfxweb.
|
Cluster
|
{{ cluster.hostname }} |
Nodes |
{{ cluster.nodes }} |
Cores per node |
{{ cluster.ppn }} |
Free nodes |
{{ cluster.free_nodes }} |


"use strict";
"use strict";
calculateStockValue.js 1.0.0
https://github.com/matt3501/CurrentStockValues
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Includes for the project
const https = require("https");
const fs = require("fs");
Attempt to be internationalizable, however would need a better mechanism to set dynamically based on use context.
const Language = require("./language.en.resources");
Array.prototype.sum = function (prop) {
let total = 0;
for (let i = 0, _len = this.length; i < _len; i++) {
total += this[i][prop];
}
return total;
}
Holds values associated to one entry in a portfolio. Can be used either to hold stock information or as a total.
Stock usage declaration:
new PortfolioDisplayItem("STOK", 77);
Total usage declaration:
new PortfolioDisplayItem("Total", null, "$10,000");
class PortfolioDisplayItem {
Create an item to be displayed in a portfolio. quantity (for stocks) and currentValue (for totals) alternate as null depending on their use
constructor(ticker, quantity, currentValue) {
this.ticker = ticker;
this.quantity = quantity == null ? null : quantity;
this.currentPrice = null;
this.high = null;
this.low = null;
this.currentValue = currentValue == null ? null : currentValue;
}
Get the objects needed for display returned.
get displayObjects() {
const obj = {};
obj[Language.ticker] = this.ticker;
obj[Language.quantity] = this.quantity;
obj[Language.currentPrice] = PortfolioDisplayItem.toPrettyMoney(this.currentPrice);
obj[Language.high] = PortfolioDisplayItem.toPrettyMoney(this.high);
obj[Language.low] = PortfolioDisplayItem.toPrettyMoney(this.low);
obj[Language.currentValue] = PortfolioDisplayItem.toPrettyMoney(this.currentValue);
return obj;
}
Convert a string containing two formatted USD with en-US comma/dot rules
static toPrettyMoney(value) {
if (!value)
return value;
else
return new Intl.NumberFormat("en-US",
{ style: "currency", currency: "USD" }
).format(value);
}
}
Class for holding a collection of stocks and/or totals of stocks
class Portfolio {
constructor(stocks) {
this.stocks = stocks;
let currentTotal = stocks.sum("currentValue");
stocks.push(new PortfolioDisplayItem("Total", null, currentTotal));
}
Returns all members of the portfolio (stocks and totals)
get displayItems() {
return this.stocks;
}
}
These are some static values for accessing the API.
const API_URL = "financialmodelingprep.com";
const HISTORICAL_STOCK_START_DATE = "2019-01-01";
const TODAY = new Date().toISOString().slice(0, 10);
const stockOutputCsvPath = "testStockOutput.csv";
Class for interfacing to a remote stock API hosted here: https://financialmodelingprep.com
class StockApiConsumer {
Places an API request to retrieve the current price. This is a live value and will update often when the markets are open.
static requestCurrentPriceForTicker(ticker) {
return new Promise(resolve => {
resolve(this.placeApiRequest("/api/v3/stock/real-time-price/" + ticker));
});
}
Places an API request to retrieve previous values from HISTORICAL_STOCK_START_DATE until TODAY.
This return value updates daily at the end of each market close.
static requestHistoricalDailyPriceForTicker(ticker) {
return new Promise(resolve => {
resolve(this.placeApiRequest("/api/v3/historical-price-full/" + ticker
+ "?from=" + HISTORICAL_STOCK_START_DATE + "&to=" + TODAY));
});
}
Reusable API method that takes any path. More paths can be found at https://financialmodelingprep.com
static placeApiRequest(path) {
return new Promise(resolve => {
let options = {
host: API_URL,
port: 443,
path: path,
method: "GET"
};
let chunks = "";
https.request(options, function (res) {
res.setEncoding("utf8");
res.on("data", function (chunk) {
chunks += chunk;
});
Funny story, turns out you need to wait until the end for large responses.
res.on("end",
function () {
const result = JSON.parse(chunks);
resolve(result);
});
}).end();
});
}
}
This is used for performing business logic on retrieved stock information.
class StockController {
Pretty standard constructor, where stocksToRetrieve is type PortfolioDisplayItem
constructor(stocksToRetrieve) {
this.stocksToRetrieve = stocksToRetrieve;
}
Intended to have outputDataToCSV
called right after with the provided
callback
calculateStockValue(callback) {
const self = this;
const promises = self.stocksToRetrieve.map((stock) => {
return self.initializeStockProperties(stock, self);
});
Promise.all(promises).then(function () { callback(self); });
}
The calls to StockApiConsumer
are static, just have to wait for them
to return before performing the calculations for stock attributes.
async initializeStockProperties(stock, self) {
const currentPrice = await StockApiConsumer.requestCurrentPriceForTicker(stock.ticker);
const historicalResult = await StockApiConsumer.requestHistoricalDailyPriceForTicker(stock.ticker);
stock.currentPrice = currentPrice.price;
stock.currentValue = stock.currentPrice * stock.quantity;
stock.historicalData = historicalResult;
self.findMinAndMaxFromHistoricalData(stock);
}
Bases its entire calculation on the stock.historicalData.historical
property, so make sure it’s set before calling.
findMinAndMaxFromHistoricalData(stock) {
let lowest = Number.POSITIVE_INFINITY;
let highest = Number.NEGATIVE_INFINITY;
let tmp;
const historicalData = stock.historicalData.historical;
for (let i = historicalData.length - 1; i >= 0; i--) {
tmp = historicalData[i];
if (tmp.low < lowest) lowest = tmp.low;
if (tmp.high > highest) highest = tmp.high;
}
stock.high = highest;
stock.low = lowest;
}
Package the data to CSV format and write to a local file at path:
stockOutputCsvPath
for now.
outputDataToCSV(self) {
let portfolio = new Portfolio(self.stocksToRetrieve);
let displayArray = [];
portfolio.displayItems.forEach((item) => {
displayArray.push(item.displayObjects);
});
let csv = CsvUtils.jsonArrayToCsv(displayArray);
CsvUtils.writeToFile(stockOutputCsvPath, csv);
}
}
Utility class created to form and write CSV data
class CsvUtils {
Takes an array[]
of json and uses the first item to determine columns.
Then for each item in the array, the values are concatenated, and if a
comma exists in any key, the value is escaped with surrounding quotes.
static jsonArrayToCsv(jsonObjects) {
let csvRows = [];
if (!Array.isArray(jsonObjects) || !jsonObjects.length) {
return "";
}
let tokenHeaders = Object.keys(jsonObjects[0]).join(",");
csvRows.push(tokenHeaders);
jsonObjects.forEach(function (singleRow) {
for (let [key, value] of Object.entries(singleRow)) {
if (value !== null && value) {
if ((value + "").indexOf(",") > -1)
singleRow[key] = "\"" + value + "\"";
}
}
csvRows.push(Object.values(singleRow).join(","));
});
let csv = `${csvRows.join('\r\n').replace(/,/g, ',')}`;
return csv;
}
Using fs
, writes the string locally to the path provided.
static writeToFile(fileName, csv) {
fs.writeFile(fileName, csv, "utf8", function (err) {
if (err) {
console.log("Unable to write file.");
} else {
console.log("File is saved.");
}
});
}
}
Self executing entry point, arguments processed here or defaults are used (or nothing happens if through ‘require’).
(function () {
Make sure someone is intending to run this via
node calculateStockValues.js
and not through a require
statement.
if (require.main === module) {
console.log('called directly');
let myArgs = process.argv.slice(2);
let stocksToRetrieve = [];
Create some default arguments if none are provided.
if (myArgs === undefined || myArgs.length === 0) {
stocksToRetrieve = [
new PortfolioDisplayItem("AMZN", 42),
new PortfolioDisplayItem("MSFT", 1337),
new PortfolioDisplayItem("TWTR", 69105)
];
Else make sure the arguments come in pairs
} else if (myArgs.length % 2 === 0) {
for (let i = 0; i < myArgs.length; i += 2) {
stocksToRetrieve.push(new PortfolioDisplayItem(myArgs[i], myArgs[i + 1]));
}
}
if (stocksToRetrieve.length > 0) {
let controller = new StockController(stocksToRetrieve);
controller.calculateStockValue(controller.outputDataToCSV);
}
} else {
Else the module was included with a require
statement.
console.log('required as a module');
}
})();
Make these modules publicly accessible.
module.exports = {
PortfolioDisplayItem: PortfolioDisplayItem,
Portfolio: Portfolio,
StockApiConsumer: StockApiConsumer,
StockController: StockController,
CsvUtils: CsvUtils
}


Benchmark Comparison
Indexed Text: "Gulliver's Travels" (Swift Jonathan 1726)
Test rules: 1. no cache allowed, 2. no async allowed, 3. should return at least 7 matches for the query "gulliver", 4. result should be ordered by relevance


👋 Hi there!
I’m Thomas. I am a Software Developer.
I like to write tutorials about things I am learning about and demo a few of the fun projects I’ve been building. I mostly work on infrastructure.
Lately I have been enjoying Go, but I am also well-versed in JavaScript and Python.
This entire site is open-source. If you find bugs or want to contribute, please submit a Pull Request!


A | |
| alt [Useri.Key] | alt is true whenever an alt key is down.
|
| animate_board [Render.Make] | animate_board t move board is the image of the animation at time
t of the move move that yielded board .
|
| any_down [Useri.Key] | any_down occurs whenever a key goes down.
|
| any_holds [Useri.Key] | any_holds is true whenever any key is down.
|
| any_up [Useri.Key] | any_up occurs whenever a key goes up.
|
| average_finger_width [Useri.Human] | average_finger_width is 11. mm, the average adult finger width.
|
B | |
| backend [Useri.App] | backend is Useri 's current backend.
|
| backend_scheme [Useri.App] | backend_scheme is the Useri 's current backend's scheme.
|
| board_size [G2048] | board_size board is the number of columns and rows in the board.
|
C | |
| clipboard [Useri.Text] | clipboard is the clipboard's textual content (if any).
|
| count [Useri.Time] | count ~until is a signal that counts time starting from 0.
until the next occurence of until .
|
| counter [Useri.Time] | counter () is a counter counting time from call time on.
|
| counter_value [Useri.Time] | counter_value c is the current counter value in seconds.
|
| cpu_count [Useri.App] | cpu_count is the number of CPU available.
|
| create [Useri.Surface] | create hidpi pos size kind anchor mode () is a surface specification
with:
hidpi , if true (default) tries to get a high-dpi surface., pos , a hint to position the surface by using pos as
the position of the top-left corner of the surface in its
backend dependent display container. The coordinates of the
top-left corner of the display container is (0,0) and
coordinate increase in from top to bottom and left to
right., size , the size of the surface in logical pixels. Consult
the individual backend documentation for the default value., kind is the kind of surface., handle is a backend dependent surface handle. In certain
backends allows to interface Useri with pre-existing surfaces., mode is the the surface mode.
|
| create_board [G2048] | create_board () is a new board.
|
| ctrl [Useri.Key] | ctrl is true whenever a ctrl key is down.
|
D | |
| default [Useri.Surface.Gl] | default is the default OpenGL surface specification.
|
| did [Useri.Touch] | did t is a device identifier for the touch.
|
| down [Useri.Key] | down id occurs whenever the key id goes down.
|
| dpos [Useri.Touch] | dpos t occurs when the touch moves with the current touch position
minus the previous one.
|
| dpos [Useri.Mouse] | dpos occurs on mouse moves with current mouse position minus
the previous position.
|
E | |
| ease_in_out [Anim] | ease_in_out ~a t is the value of an ease in and out curve at
time t .
|
| editing [Useri.Text] | editing may occur with (text, cpos, sel_len) before Useri.Text.input
whenever text is being composited for example if multiple key
strokes are needed in order to input a character.
|
| elapsed [Useri.Time] | elapsed () is the number of seconds elapsed since the
beginning of the program.
|
| empty [G2048] | empty is an empty square.
|
| env [Useri.App] | env var ~default parse lookups var in the environment, parses
it with parse and returns the result.
|
| event_target [Useri_jsoo.Key] | source () is the event target used for keyboard events.
|
F | |
| feel [Useri.Human] | feel () is a signal that varies according to user latency
constants:
[user_feel () ]t = `Interacting if
t < User.interrupted ., [user_feel () ]t = `Interrupted if
t < User.left ., [user_feel () ]t = `Left if t >= User.left .
|
| file [Useri.Drop] | file occurs whenever a file is dropped on the application.
|
| fold_board [G2048] | fold_board f acc board folds f over all the squares of board with
the zero-based positions and starting with acc .
|
| fold_listlisti [Utils] | |
G | |
| game_move [G2048.Make] | game_move move board is the board resulting from shifting board
in direction move and inserts a new square if the board is not full.
|
H | |
| handle [Useri.Surface] | handle () is the application's surface backend dependent handle.
|
| holds [Useri.Key] | holds id is true whenever the key id is down.
|
I | |
| id [Useri.Touch] | id t is a unique identifier for the touch
(FIXME across device identifiers ?)
|
| image_of_board [Render.Make] | image_of_board board is an image from board .
|
| init [Useri.App] | init name surface initialises an application named name (default
derived from the executable name) with surface surface (defaults
to a default Useri.Surface.create .)
|
| input [Useri.Text] | input occurs whenever text is input by the user and
the signal given to Useri.Text.set_input_enabled is true .
|
| insert_square [G2048.Solution] | insert_square square board is board with square inserted
in an empty spot or None if there was no such spot.
|
| interrupted [Useri.Human] | interrupted is 1. s, the time span after which the user will
feel interrupted and feedback from the system is needed.
|
| is_board_winning [G2048.Solution] | is_board_winning board is true iff the board is a winning board.
|
| is_complete_row [G2048.Solution] |
A row is complete if
* it contains no empty squares and
* a shift leaves it unchanged
|
| is_game_over [G2048.Solution] | is_game_over board is true iff there are no valid moves.
|
| is_square_2048 [G2048.Solution] |
Whether a square is occupied by a tile with the value 2048.
|
K | |
| key_capture [Useri_jsoo.Key] | key_capture () is the function that determines whether key
events related to a key are captured by Useri (i.e prevent
default action and stop propagation).
|
L | |
| launch_context [Useri.App] | launch_context is the mechanism that started the program.
|
| left [Useri.Human] | left is 10. s, the time span after which the user will
switch to another task and feedback indicating when the system
expects to respond is needed.
|
| left [Useri.Mouse] | left is true whenever the left mouse button is down.
|
| left_down [Useri.Mouse] | left_down has an occurence whenever the left mouse button goes down.
|
| left_up [Useri.Mouse] | left_up has an occurence whenever the left mouse button goes up.
|
| listlist_dims [Utils] | |
M | |
| meta [Useri.Key] | meta is true whenever a meta key is down.
|
| middle [Useri.Mouse] | middle is true whenever the middle mouse button is down.
|
| middle_down [Useri.Mouse] | middle_down has an occurence whenever the middle mouse button goes
down.
|
| middle_up [Useri.Mouse] | middle_up has an occurence whenever the middle mouse button goes
up.
|
| mode [Useri.Surface] | mode is the application's surface mode.
|
| mode_flip [Useri.Surface] | mode_flip e is an event which occur whenever e does
with the opposite mode of Useri.Surface.mode 's value.
|
N | |
| noticed [Useri.Human] | noticed is 0.1 s, the time span after which the user will
notice a delay and feel that the system is not reacting
instantaneously.
|
O | |
| of_js [Useri_jsoo.Surface.Handle] | |
| over [Useri.Touch] | over t occurs once whenever the touch ends either because
the pressure stops (`Up ) or because the touch is canceled (`Cancel ,
for example if the touch is captured by something else).
|
P | |
| path [Useri.Drop.File] | path f is f 's file system path.
|
| platform [Useri.App] | platform is the name of the platform you are running on.
|
| pos [Useri.Touch] | pos t is the current touch position of t .
|
| pos [Useri.Mouse] | pos is the current mouse position.
|
| pos [Useri.Surface] | pos is the position of the top-left corner of the surface
in the surface's backend dependent display container.
|
| pp_backend [Useri.App] | pp_backend ppf b prints an unspecified representation of
c on ppf .
|
| pp_backend_scheme [Useri.App] | pp_backend_scheme ppf bs prints and unspecified representation of
bs on ppf .
|
| pp_cpu_count [Useri.App] | pp_cpu_count ppf c prints an unspecified representation of c
on ppf .
|
| pp_id [Useri.Key] | pp_id ppf id prints an unspecified representation of id on
ppf .
|
| pp_launch_context [Useri.App] | pp_launch_context ppf c prints an unspecified representation of
c on ppf .
|
| pp_mode [Useri.Surface] | pp_mode ppf m prints an unspecified representation of m on ppf .
|
| pp_ms [Useri.Time] | pp_ms ppf s prints s seconds in milliseconds.
|
| pp_mus [Useri.Time] | pp_mus ppf s prints s seconds in microseconds.
|
| pp_s [Useri.Time] | pp_s ppf s prints s seconds in seconds.
|
| prefs_path [Useri.App] | TODO this should used the app name automatically.
|
| prepare [Useri.Drop.File] | prepare f k prepares files f for reading, calling k f r whenever
f is ready to be read from (e.g.
|
| pressure [Useri.Touch] | pressure t is the pressure normalized from 0. to 1. (if
available).
|
Q | |
| quit [Useri.App] | quit occurs whenever the user requested to quit.
|
R | |
| raster_size [Useri.Surface] | raster_size is the application's surface underlying raster
size.
|
| refresh [Useri.Surface] | refresh occurs whenever the surface needs to be redrawn with
the number of seconds since its last occurence or, for the
first occurence, the number of seconds since the application
start.
|
| refresh_hz [Useri.Surface] | refresh_hz is the maximal hinted frequency in hertz for Useri.Surface.refresh
occurences.
|
| release [Useri.App] | release sinks () does the following:
Makes the Useri.App.stop event occur., If sinks is true (default), calls Useri.App.release_sinks ., Reclaims other resources
|
| release_sinks [Useri.App] |
Stops and release sink references.
|
| replace_at [Utils] | |
| replace_one [Utils] | replace_one f l replace the first element e in l such that
f e is not None .
|
| request_refresh [Useri.Surface] | request_refresh () has the effect of making Useri.Surface.refresh
occur some time after it was called.
|
| request_sync_props [Useri_jsoo.Surface] | request_sync_props () asks to make sure that the application's
surface Useri.Surface.pos , Useri.Surface.raster_size and
Useri.Surface.size properties are in sync with the surface's
element bounding box some time after it was called (can be
called in a React step).
|
| right [Useri.Mouse] | right is true whenever the right mouse button is down.
|
| right_down [Useri.Mouse] | right_down has an occurence whenever the right mouse button goes
down.
|
| right_up [Useri.Mouse] | right_up has an occurence whenever the right mouse button goes up.
|
| run [Useri.App] | run until depends on the backend scheme:
`Sync invokes Useri.App.run_step repeatedly and blocks until
the first occurence of until (defaults to Useri.App.quit ).
After Useri.App.run returned it can be called again., `Async returns immediately, until is irrelevant.
|
| run [Test.Make] | |
| run_step [Useri.App] | run_step () gather as much user input as possible and returns
the maximal timespan after which Useri.App.run_step should be called again.
|
S | |
| set_backend_logger [Useri.App] | set_backend_logger log sets log to be called by backends
whenever non-fatal internal warnings and errors are generated.
|
| set_clipboard_setter [Useri.Text] | set_clipboard_setter setter on occurences of setter sets the
clipboard's textual content.
|
| set_event_target [Useri_jsoo.Key] | set_event_target target sets the event target to target.
|
| set_input_enabled [Useri.Text] | set_input_enabled enabled uses the signal enabled to determine
whether Useri.Text.input and Useri.Text.editing events are enabled.
|
| set_key_capture [Useri_jsoo.Key] | set_capture_key capture sets the function returned
by Useri_jsoo.Key.key_capture .
|
| set_mode_setter [Useri.Surface] | set_mode_setter me uses occurences of me to set, if possible,
the current surface's application mode and the value of Useri.Surface.mode .
|
| set_refresh_hz [Useri.Surface] | set_refresh_hz sets the value of Useri.Surface.refresh_hz .
|
| set_refresher [Useri.Surface] | set_refresher r uses sets r to be used to generate
an occurence of Useri.Surface.refresh some time after each occurence of r .
|
| shift [Useri.Key] | shift is true whenever a shift key is down.
|
| shift_board [G2048.Solution] | shift_board move board is the board resulting from shifting
board in direction move .
|
| shift_left_helper [G2048.Solution] |
Shift a row to the left according to the rules of the game, and
append `empties`.
|
| sink_event [Useri.App] | sink_event e keeps a reference on e until the app exit s.
|
| sink_signal [Useri.App] | sink_signal s keeps a reference on s until the app exit s.
|
| size [Useri.Surface] | size is the application's surface logical size.
|
| size_mm [Useri_jsoo.Surface] | size_mm is the application's surface size in millimeters.
|
| square_provenances [G2048.Solution] | square_provenances s are the tile provenances on a square.
|
| square_value [G2048] | square_value t is t 's value (if any).
|
| start [Useri.App] | |
| start [Useri.Touch] | start occurs whenever touches do.
|
| start_pos [Useri.Touch] | start_pos t is the initial touch position of t .
|
| steady_refresh [Useri.Surface] | steady_refresh until makes Useri.Surface.refresh occur at the hinted
frequency of Useri.Surface.refresh_hz hertz until until occurs.
|
| stop [Useri.App] | stop occurs when Useri.App.release starts.
|
| string_of_square [G2048] | string_of_square t is t as a string.
|
T | |
| t1024 [G2048] | t1024 is a square with value 1024.
|
| t128 [G2048] | t128 is a square with value 128.
|
| t16 [G2048] | t16 is a square with value 16.
|
| t2 [G2048] | t2 is a square with value 2.
|
| t2048 [G2048] | t2048 is a square with value 2048.
|
| t256 [G2048] | t256 is a square with value 256.
|
| t32 [G2048] | t32 is a square with value 32.
|
| t4 [G2048] | t4 is a square with value 4.
|
| t512 [G2048] | t512 is a square with value 512.
|
| t64 [G2048] | t64 is a square with value 64.
|
| t8 [G2048] | t8 is a square with value 8.
|
| test_add [Test] | |
| test_add_to_full [Test] | |
| test_game_over [Test] | |
| test_insert [Test] | |
| test_insert_last_square [Test] | |
| test_insert_row_completely_empty [Test] | |
| test_insert_row_full [Test] | |
| test_insert_row_partially_empty [Test] | |
| test_is_board_winning [Test] |
Winning boards
|
| test_is_board_winning_more [Test] | |
| test_shift_board_fixpoint [Test] | |
| test_shift_coalesce [Test] | |
| test_shift_empty [Test] | |
| test_shift_empty_squares [Test] | |
| test_shifts [Test] | |
| tick [Useri.Time] | tick span is an event that occurs once in span seconds with
the value span - span' where span' is the actual delay
performed by the system.
|
| to_js [Useri_jsoo.Surface.Handle] | |
| to_js [Useri_jsoo.Drop.File] | to_js f returns the underlying JavaScript file object.
|
| touch_target_pad [Useri.Human] | touch_target_pad is 2. mm, the minimum padding size in
millimeters between two touch targets.
|
| touch_target_size [Useri.Human] | touch_target_size is 9. mm, the recommended touch target size in
millimiters.
|
| touch_target_size_min [Useri.Human] | touch_size_min is 7. mm, the minimal touch target size in
millimeters.
|
| transpose [Utils] |
Transpose a matrix.
|
| tri [Anim] | tri t is a triangle (tent) curve at time t .
|
U | |
| uchar [Useri.Key] | uchar c is a key identifier from c .
|
| unit [Useri.Time] | unit ~span is a signal that linearly increases from 0. to 1.
during span seconds.
|
| up [Useri.Key] | up id occurs whenever the key id goes up.
|
| update [Useri.Surface] | update () updates the rendering surface.
|


{{define "content"}}
We have sent a one time login link to your email inbox. Simply click on the link to login.


| Package | Description |
|---|---|
| com.tailf.navu |
NAVU (Navigation Utilities) is an API which provides increased
accessibility to the ConfD/NCS populated data model tree:
NAVU-Tree.
|
| com.tailf.navu.traversal |
Utility package for traversing the NAVU tree using NAVU API.
|
| Modifier and Type | Class and Description |
|---|---|
class |
NoSuchNavuCaseException |
class |
NoSuchNavuChoiceException |
class |
NoSuchNavuNodeException |
| Modifier and Type | Method and Description |
|---|---|
NavuAction |
NavuContainer.action(Integer key)
Returns a subordinate reference to action according to
the given hash value
key . |
NavuAction |
NavuContainer.action(String key)
Returns a subordinate reference to action according to
the given string
key . |
ConfXMLParam[] |
NavuAction.call()
Issues an action with empty parameters
|
ConfXMLParam[] |
NavuAction.call(ConfXMLParam[] params)
Issues an action call with given parameters
|
ConfXMLParam[] |
NavuAction.call(String xml)
Issues an action call with given parameter
|
Collection<NavuNode> |
NavuNode.children()
Return the children of this NavuNode.
|
Collection<NavuNode> |
NavuList.children()
Returns elements contained by the list node.
|
Collection<NavuNode> |
AbstractNavuNode.children() |
Collection<NavuNode> |
NoSuchNavuNodeException.children() |
Collection<NavuNode> |
NavuAction.children()
Return the children of this node.
|
Collection<NavuNode> |
NavuContainer.children()
Returns a collection of child nodes
contained by the container.
|
NavuChoice |
NavuContainer.choice(String name) |
NavuContainer |
NavuNode.container(Integer key)
Returns a subordinate reference to a container according to
the given hash value.
|
NavuContainer |
AbstractNavuNode.container(Integer key) |
NavuContainer |
NavuAction.container(Integer key) |
NavuContainer |
NavuContainer.container(Integer key)
Returns a subordinate reference to a container according to
the given hash value.
|
NavuContainer |
NavuNode.container(String key)
Returns a subordinate reference to NavuNode according to
the given string
key . |
NavuContainer |
AbstractNavuNode.container(String key) |
NavuContainer |
NavuAction.container(String key) |
NavuContainer |
NavuContainer.container(String key)
Returns a subordinate reference to container according to
the given string
key . |
NavuContainer |
NavuNode.container(String prefix,
String key)
Returns a subordinate reference to container according to
the given
key and prefix . |
NavuContainer |
AbstractNavuNode.container(String prefix,
String key) |
NavuContainer |
NavuAction.container(String prefix,
String key) |
NavuContainer |
NavuContainer.container(String prefix,
String key)
Returns a subordinate reference to container according to
the given
key and prefix . |
boolean |
NavuList.containsNode(ConfKey key)
Returns true if and only if this
NavuList
contains a NavuListEntry where
NavuListEntry.getKey() equals the specified
key. |
boolean |
NavuContainer.containsNode(NavuNode node)
Checks if the given node is contained in the schema in this container.
|
boolean |
NavuList.containsNode(String keyStr)
Returns true if this NavuList contains a mapping
for the specified string representation of a key.
|
boolean |
NavuContainer.containsNode(String nodeName)
Checks if there is a child node in the schema with given name.
|
boolean |
NavuList.containsNode(String[] keyArr)
Returns true if this NavuList contains a mapping
for the specified string representation of a key.
|
void |
NavuLeaf.create()
Create an empty leaf node.
|
NavuContainer |
NavuContainer.create()
Creates an optional container.
|
NavuContainer |
NavuList.create(ConfKey key)
Creates list element.
|
NavuContainer |
NavuList.create(ConfObject key)
Creates list element.
|
NavuContainer |
NavuList.create(String keyStr)
Creates list element.
|
NavuContainer |
NavuList.create(String[] keyArr)
Creates list element.
|
NavuLeaf |
NavuLeaf.delete()
Deletes a leaf.
|
NavuContainer |
NavuListEntry.delete()
Deletes this entry from the NavuList it contains
returns this NavuListEntry as NavuContainer.
|
NavuContainer |
NavuContainer.delete()
Deletes an optional container.
|
void |
NavuList.delete(ConfKey key)
Deletes an element from the list.
|
void |
NavuList.delete(String keyStr)
Deletes an element from the list.
|
void |
NavuList.delete(String[] keyArr)
Deletes an element from the list.
|
void |
NavuList.deleteAll()
Deletes all element from the list.
|
List<NavuNode> |
NavuLeaf.deref()
Derefs a leafref and returns the referenced objects
|
NavuContainer |
NavuList.elem(ConfKey key)
Returns a list element according to the given key.
|
NavuContainer |
NavuList.elem(String keyStr)
Returns a list element according to the given key.
|
NavuContainer |
NavuList.elem(String[] keyArr)
Returns a list element according to the given array of keys.
|
Collection<NavuContainer> |
NavuList.elements()
Returns a shallow copy of elements contained by the list node.
|
List<ConfXMLParam> |
NavuNode.encodeXML()
Encoding the sub-tree including the current
NavuNode
as the topmost NavuNode to a ConfXMLParam array. |
List<ConfXMLParam> |
NavuList.encodeXML() |
List<ConfXMLParam> |
NavuLeaf.encodeXML() |
List<ConfXMLParam> |
NavuAction.encodeXML() |
List<ConfXMLParam> |
NavuContainer.encodeXML() |
Set<Map.Entry<ConfKey,NavuContainer>> |
NavuList.entrySet()
Returns a set of entries with element key and element.
|
Set<Map.Entry<String,NavuNode>> |
NavuContainer.entrySet()
Returns a set of value-pairs.
|
boolean |
NavuNode.exists() |
boolean |
NavuList.exists()
Tests for the existence of the List node in the instance tree.
|
boolean |
NavuLeaf.exists()
Tests for the existence of the leaf node.
|
boolean |
NavuAction.exists() |
boolean |
NavuContainer.exists()
Verifies the existence of container.
|
boolean |
NavuContext.exists(NavuNodeInfo node,
String fmt,
Object[] arguments) |
Map<ConfKey,NavuChange> |
NavuContainer.findChanges(Integer[] criteria)
Analyzes what changes has been done within this
transaction.
|
NavuNode |
NavuContainer.get(String nodeName)
Returns a subordinate node with the name
nodeName . |
List<NavuNode> |
NavuNode.getChanges()
Return the descendant
NavuNode 's
(including this element) that has been affected by
changes to the MAAPI transaction. |
List<NavuNode> |
AbstractNavuNode.getChanges()
Return the descendant
NavuNode 's
(including this element) that has been affected by
changes to the MAAPI transaction. |
List<NavuNode> |
NavuAction.getChanges() |
List<NavuNode> |
NavuNode.getChanges(boolean emitSubtree)
Return the descendant
NavuNode including this
NavuNode that has been affected by the
current MAAPI transaction. |
List<NavuNode> |
AbstractNavuNode.getChanges(boolean emitSubTree) |
List<NavuNode> |
NavuAction.getChanges(boolean emitSubtree) |
List<NavuNode> |
NavuNode.getChanges(boolean emitSubtree,
DiffIterateOperFlag... forOps)
Return the descendant
NavuNode including this
NavuNode that has been affected by the
current MAAPI transaction. |
List<NavuNode> |
AbstractNavuNode.getChanges(boolean emitSubTree,
DiffIterateOperFlag... forOps) |
List<NavuNode> |
NavuAction.getChanges(boolean emitSubtree,
DiffIterateOperFlag... forOps) |
String |
NavuNode.getKeyPath()
Returns the absolute keypath of this node.
|
String |
NavuAction.getKeyPath() |
NavuNode |
NavuNode.getNavuNode(ConfPath path)
Retrive a NavuNode based on the given absolute or relative
path.
|
NavuNode |
AbstractNavuNode.getNavuNode(ConfPath path)
Retrieve a NavuNode based on the given absolute or relative
path.
|
NavuNode |
NavuAction.getNavuNode(ConfPath path) |
List<NavuChoice> |
NavuContainer.getSelectCaseAsNavuChoice(String choice)
Returns a collection of the "toplevel" choice elements of
the a current selected case.
|
List<NavuNode> |
NavuContainer.getSelectCaseAsNavuNode(String choice)
Returns a collection of the "toplevel" node elements of
the a current selected case.
|
MaapiSchemas.CSCase |
NavuContainer.getSelectedCase(String choice)
Returns the selected cases of a given choice.
|
int |
NavuContainer.getUserSession()
Get the current Maapi user session if this container context uses
Maapi.
|
ConfXMLParam[] |
NavuNode.getValues(ConfXMLParam[] param)
Read an arbitrary set of sub-elements from this
NavuNode . |
ConfXMLParam[] |
AbstractNavuNode.getValues(ConfXMLParam[] params) |
ConfXMLParam[] |
NavuAction.getValues(ConfXMLParam[] param)
Invokes or call an action defined in the data model (see
tailf_yang_extensions(5) ). |
ConfXMLParam[] |
NavuNode.getValues(String xml)
Read an arbitrary set of sub-elements from this
NavuNode . |
ConfXMLParam[] |
AbstractNavuNode.getValues(String xml) |
ConfXMLParam[] |
NavuLeaf.getValues(String xml) |
ConfXMLParam[] |
NavuAction.getValues(String xml)
Invokes or call an action defined in the data model (see
tailf_yang_extensions(5) ). |
ConfXMLParam[] |
NavuList.getXml(String xml)
Read an arbitrary set of sub-elements of a container element.
|
ConfXMLParam[] |
AbstractNavuNode.getXml(String xml)
Read an arbitrary set of sub-elements of a container element.
|
NavuContainer |
NavuList.insert(ConfKey key,
boolean createBackpointer)
Inserts an element into a list using Maapi.insert().
|
boolean |
NavuList.isEmpty()
Checks if there are any elements in the list.
|
boolean |
NavuContainer.isEmpty()
Checks if the container has any members.
|
Set<ConfKey> |
NavuList.keySet()
Returns a set of keys.
|
Set<String> |
NavuContainer.keySet()
Returns a set of nodeNames.
|
NavuLeaf |
NavuNode.leaf(Integer key)
Returns a subordinate reference to a leaf node according to
the given hash value
key . |
NavuLeaf |
AbstractNavuNode.leaf(Integer key) |
NavuLeaf |
NavuAction.leaf(Integer key) |
NavuLeaf |
NavuContainer.leaf(Integer key)
Returns a subordinate reference to a leaf node according to
the given hash value
key . |
NavuLeaf |
NavuNode.leaf(String key)
Returns a subordinate reference to a NavuNode according to
the given string
key . |
NavuLeaf |
AbstractNavuNode.leaf(String key) |
NavuLeaf |
NavuAction.leaf(String leaf) |
NavuLeaf |
NavuContainer.leaf(String key)
Returns a subordinate reference to a leaf node according to
the given string
key . |
NavuLeaf |
NavuNode.leaf(String prefix,
String key)
Returns a subordinate reference to leaf according to
the given
key and prefix . |
NavuLeaf |
AbstractNavuNode.leaf(String prefix,
String key) |
NavuLeaf |
NavuAction.leaf(String prefix,
String leaf) |
NavuLeaf |
NavuContainer.leaf(String prefix,
String key)
Returns a subordinate reference to leaf according to
the given
key and prefix . |
NavuList |
NavuNode.list(Integer key)
Returns a subordinate reference to list according to
the given hash value
key . |
NavuList |
AbstractNavuNode.list(Integer key) |
NavuList |
NavuAction.list(Integer key) |
NavuList |
NavuContainer.list(Integer key)
Returns a subordinate reference to list according to
the given hash value
key . |
NavuList |
NavuNode.list(String key)
Returns a subordinate reference to NavuNode according to
the given string
key . |
NavuList |
AbstractNavuNode.list(String key) |
NavuList |
NavuAction.list(String key) |
NavuList |
NavuContainer.list(String key)
Returns a subordinate reference to list according to
the given string
key . |
NavuList |
NavuNode.list(String prefix,
String key)
Returns a subordinate reference to list according to
the given
key and prefix . |
NavuList |
AbstractNavuNode.list(String prefix,
String key) |
NavuList |
NavuAction.list(String prefix,
String key) |
NavuList |
NavuContainer.list(String prefix,
String key)
Returns a subordinate reference to list according to
the given
key and prefix . |
void |
NavuList.move(ConfKey key,
NavuList.WhereTo whereTo,
ConfKey to)
Move a list element to a new position in the list.
|
void |
NavuList.move(String keyStr,
NavuList.WhereTo whereTo,
String toStr)
Move a list element to a new position in the list.
|
PreparedXMLStatement |
NavuList.prepareXMLCall(String xml)
A Prepared xml set() that accepts parameterized values "?"
instead of a string representation of the value
when on invocation the value is not known.
|
PreparedXMLStatement |
AbstractNavuNode.prepareXMLCall(String xml)
A Prepared xml set() that accepts parameterized values "?"
instead of a string representation of the value
when on invocation the value is not known.
|
NavuCdbSubscriber |
NavuCdbSubscriber.register(NavuCdbDiffIterate cb,
ConfPath path)
Register a user provided callback with a specified path.
|
NavuCdbSubscriber |
NavuCdbConfigSubscriber.register(NavuCdbDiffIterate cb,
ConfPath path)
Registers a subscription item onto
the
NavuCdbConfigSubscriber
with a given user provided callback that will be invoked on
Cdb notifications. |
NavuCdbSubscriber |
NavuCdbOperSubscriber.register(NavuCdbDiffIterate cb,
ConfPath path)
Registers a subscription item onto the this
NavuCdbOperSubscriber
with a given user provided callback that will be invoked on
Cdb notifications. |
NavuCdbSubscriber |
NavuCdbSubscriber.register(NavuCdbDiffIterate cb,
ConfPath path,
EnumSet<DiffIterateFlags> diffIterFlags)
Register a user provided callback with a specified path with additional
iteration flags.
|
NavuCdbSubscriber |
NavuCdbConfigSubscriber.register(NavuCdbDiffIterate cb,
ConfPath path,
EnumSet<DiffIterateFlags> flags)
Registers a subscription item onto the
NavuCdbConfigSubscriber
with a given user provided callback that will be invoked on
Cdb notifications. |
NavuCdbSubscriber |
NavuCdbOperSubscriber.register(NavuCdbDiffIterate cb,
ConfPath path,
EnumSet<DiffIterateFlags> flags)
Registers a subscription item onto the this
NavuCdbOperSubscriber
with a given user provided callback that will be invoked on
Cdb notifications. |
NavuCdbSubscriber |
NavuCdbSubscriber.register(NavuCdbDiffIterate cb,
NavuNode node)
Register a user provided callback with a specified NavuNode.
|
NavuCdbSubscriber |
NavuCdbConfigSubscriber.register(NavuCdbDiffIterate cb,
NavuNode node)
Registers a subscription item onto the
NavuCdbConfigSubscriber
with a given user provided callback that will be invoked on
Cdb notifications. |
NavuCdbSubscriber |
NavuCdbOperSubscriber.register(NavuCdbDiffIterate cb,
NavuNode node)
Registers a subscription item onto the this
NavuCdbOperSubscriber
with a given user provided callback that will be invoked on
Cdb notifications. |
NavuCdbSubscriber |
NavuCdbSubscriber.register(NavuCdbDiffIterate cb,
NavuNode node,
EnumSet<DiffIterateFlags> diffIterFlags)
Register a user provided callback with a specified NavuNode with
additional iteration flags.
|
NavuCdbSubscriber |
NavuCdbConfigSubscriber.register(NavuCdbDiffIterate cb,
NavuNode node,
EnumSet<DiffIterateFlags> flags)
Registers a subscription item onto the
NavuCdbConfigSubscriber
with a given user provided callback that will be invoked on
Cdb notifications. |
NavuCdbSubscriber |
NavuCdbOperSubscriber.register(NavuCdbDiffIterate cb,
NavuNode node,
EnumSet<DiffIterateFlags> flags)
Registers a subscription item onto the this
NavuCdbOperSubscriber
with a given user provided callback that will be invoked on
Cdb notifications. |
void |
NavuLeaf.safeCreate()
Create an empty leaf node, silently succeeding
if the leaf already exists
|
NavuContainer |
NavuContainer.safeCreate()
Creates an optional container.
|
NavuContainer |
NavuList.safeCreate(ConfKey key)
The variant of
create that succeeds even if the
object already exists |
NavuContainer |
NavuList.safeCreate(ConfObject key)
The variant of
create that succeeds even if the
object already exists. |
NavuContainer |
NavuList.safeCreate(String keyStr)
The variant of
create that succeeds even if the
object already exists. |
NavuContainer |
NavuList.safeCreate(String[] keyArr)
The variant of
create that succeeds even if the
object already exists. |
Collection<NavuNode> |
NavuNode.select(ConfObject[] query) |
Collection<NavuNode> |
NavuList.select(ConfObject[] kp) |
Collection<NavuNode> |
NavuAction.select(ConfObject[] query) |
Collection<NavuNode> |
NavuContainer.select(ConfObject[] kp) |
Collection<NavuNode> |
NavuNode.select(List<String> query) |
Collection<NavuNode> |
NavuList.select(List<String> path) |
Collection<NavuNode> |
NavuLeaf.select(List<String> path) |
Collection<NavuNode> |
NavuAction.select(List<String> query)
Not supported returns only an empty Collection
|
Collection<NavuNode> |
NavuContainer.select(List<String> path) |
Collection<NavuNode> |
NavuNode.select(String query) |
Collection<NavuNode> |
NavuList.select(String path) |
Collection<NavuNode> |
NavuLeaf.select(String path) |
Collection<NavuNode> |
NavuAction.select(String query)
Not supported returns only an empty Collection
|
Collection<NavuNode> |
NavuContainer.select(String path) |
void |
PreparedXMLStatement.set()
When all the parameterized values has been filled
this method is intended to be invoked for a
final set operation with the given values.
|
void |
NavuLeaf.set(ConfValue val)
Sets the value of the leaf node.
|
void |
PreparedXMLStatement.set(NavuContext context)
When all the parameterized values has been filled
this method is intended to be invoked for a
final set operation with the given values.
|
void |
PreparedXMLStatement.set(NavuNode node) |
void |
NavuList.set(String xml)
Set arbitrary sub-elements of a container element.
|
void |
NavuLeaf.set(String val)
Sets the value and tries to perform an update.
|
void |
NavuContainer.set(String xml)
Set arbitrary sub-elements of a container element.
|
NavuNode |
NavuNode.setChange(List<ConfObject> kp,
DiffIterateOperFlag op,
ConfValue oldValue,
Maapi maapi,
int readOnlyTID)
Internal, subject to change without notice.
Sets the change type on a node.
|
NavuNode |
NavuList.setChange(List<ConfObject> path,
DiffIterateOperFlag op,
ConfValue oldValue,
Maapi maapi,
int readOnlyTID) |
NavuNode |
NavuLeaf.setChange(List<ConfObject> kp,
DiffIterateOperFlag op,
ConfValue oldValue,
Maapi maapi,
int readOnlyTID) |
NavuNode |
NavuAction.setChange(List<ConfObject> kp,
DiffIterateOperFlag op,
ConfValue oldValue,
Maapi maapi,
int readOnlyTID)
Sets the change type on a node.
|
NavuNode |
NavuContainer.setChange(List<ConfObject> path,
DiffIterateOperFlag op,
ConfValue oldValue,
Maapi maapi,
int readOnlyTID) |
NavuContainer |
NavuContainer.setOperationalDataCase(String choiceStr,
String caseStr)
Deprecated.
Use the method
NavuContainer.setOperDataCase(String , String) |
void |
NavuContainer.setOperDataCase(String choiceStr,
String caseStr)
Set a case with the name
caseStr for a choice
choiceStr for Cdb when writing operational data. |
void |
AbstractNavuNode.setValues(ConfXMLParam[] params)
Set arbitrary sub-elements of a container or list entry.
|
void |
AbstractNavuNode.setValues(String xml)
Set arbitrary sub-elements of a container element.
|
void |
NavuLeaf.setValues(String xml)
This method is almost identical to
NavuLeaf.set(String) with the
exception that the value should be wrapped inside XML tag. |
void |
NavuLeaf.sharedCreate()
Create an empty leaf node, silently succeeding
if the leaf already exists and also maintain the
FASTMAP reference counter on the leaf.
|
NavuContainer |
NavuContainer.sharedCreate()
Creates an optional container.
|
NavuContainer |
NavuList.sharedCreate(ConfKey key)
The variant of
create that succeeds even if the
object already exists, and also maintains a reference counter
on the object. |
NavuContainer |
NavuList.sharedCreate(ConfObject key)
The variant of
create that succeeds even if the
object already exists, and also maintains a reference counter
on the object. |
NavuContainer |
NavuList.sharedCreate(String keyStr)
The variant of
create that succeeds even if the
object already exists, and also maintains a reference counter
on the object. |
NavuContainer |
NavuList.sharedCreate(String[] keyArr)
The variant of
create that succeeds even if the
object already exists, and also maintains a reference counter
on the object. |
void |
NavuLeaf.sharedSet(ConfValue val)
Sets the value of a leaf node with FastMap support, creating
backpointers and reference counter similar to sharedCreate()
All FastMap code shall (in principle) allways use this method instead
of set()
|
int |
NavuList.size()
Returns the number of list elements contained by the list node.
|
int |
NavuContainer.size()
Returns the number of nodes contained by the container.
|
ConfKey |
NavuLeaf.toKey()
Convert the leaf value to a ConfKey.
|
ConfValue |
NavuLeaf.value()
Returns the effective value on the first call,
or cached value in the subsequent calls
of this leaf.
|
String |
NavuLeaf.valueAsString()
Returns the Schema aware string representation of a leaf.
|
List<NavuNode> |
AbstractNavuNode.xPathSelect(String query)
Evaluates the XPath Path expression query returns
resulting node set as list of NavuNode's.
|
List<NavuNode> |
NavuAction.xPathSelect(String xPath) |
void |
AbstractNavuNode.xPathSelectIterate(String query,
NavuNodeSetIterate iterate)
Iterate through a NodeSet based on a supplied XPath query.
|
| Modifier and Type | Method and Description |
|---|---|
static NavuTreeTraversal |
NavuTreeTraversal.createInstance(NavuContext ctx,
NavuTraversalMean travmeth)
Factory method to retrieve an instance of this class.
|
void |
TraversalFilter.currentNode(NavuNode node) |
Set<String> |
NavuTreeTraversal.traverse()
Start the traversal process.
|
Set<String> |
NavuTraversalMean.traverse(NavuNode root,
List<TraversalFilter> filter) |
Set<String> |
NavuTraversalBfsMean.traverse(NavuNode root,
List<TraversalFilter> filters) |
Set<String> |
NavuTraversalDfsMean.traverse(NavuNode root,
List<TraversalFilter> filters) |


Ficus religiosa or sacred fig is a species of fig native to the
Indian
MISC
subcontinent[2] and
Indochina[3
PER
] that belongs to
Moraceae
PER
, the fig or mulberry family. It is also known as the bodhi tree,[4] pippala tree, peepul tree,[2] peepal tree or ashwattha tree (in
India
LOC
and
Nepal).[5
LOC
] The sacred fig is considered to have a religious significance in three major religions that originated on the
Indian
MISC
subcontinent,
Buddhism
PER
,
Hinduism
PER
and
Jainism
LOC
. It is the type of tree that
Gautama Buddha
PER
is believed to have attained enlightenment under, and
Hindu
MISC
and
Jain
PER
ascetics also consider the tree to be sacred and often meditate under them.
Ficus
PER
religiosa is a large dry season-deciduous or semi-evergreen tree up to 30 metres (98 ft) tall and with a trunk diameter of up to 3 metres (9.8 ft). The leaves are cordate in shape with a distinctive extended drip tip; they are 10–17 centimetres (3.9–6.7 in) long and 8–12 centimetres (3.1–4.7 in) broad, with a 6–10 centimetres (2.4–3.9 in) petiole. The fruits are small figs 1–1.5 centimetres (0.39–0.59 in) in diameter, green ripening to purple.F. religiosa is a tree having a very long lifespan, with an average life ranging between 900–1,500 years. At some of its native habitats, it has been reportedly found living for over 3,000 years.[6] Some trees have been reported to be more than 2,000 years old, like the
Jaya Sri Maha Bodhi
ORG
, a peepul tree in the ancient city of
Anuradhapura
LOC
in
Sri Lanka
LOC
which is estimated to be more than 2,250 years old and is regarded as the "
Oldest
MISC
historical tree in the world with religious importance"