guacamole-ext
While not strictly part of the Java API provided by the Guacamole project, guacamole-ext is an API exposed by the Guacamole web application within a separate project such that extensions, specifically authentication providers, can be written to tweak Guacamole to fit well in existing deployments.
Extensions to Guacamole can:
Provide alternative authentication methods and sources of connection/user data.
Provide event listeners that will be notified as Guacamole performs tasks such as authentication and tunnel connection.
Theme or brand Guacamole through additional CSS files and static resources.
Extend Guacamole’s JavaScript code by providing JavaScript that will be loaded automatically.
Add additional display languages, or alter the translation strings of existing languages.
Guacamole extension format
Guacamole extensions are standard Java .jar
files which contain all classes,
library .jar
files, and resources required by the extension, as well as the
Guacamole extension manifest. There is no set structure to an extension except
that:
The
guac-manifest.json
manifest must be in the root of the archive.Any required library
.jar
files that will not be placed withinGUACAMOLE_HOME/lib/
must be in the root of the archive.Java classes and packages for the extension itself (or for unpacked dependencies of the extension) will be read relative to the archive root, as well.
Beyond this, the semantics and locations associated with all other resources within the extension are determined by the extension manifest alone.
Extension manifest
The Guacamole extension manifest is a single JSON file, guac-manifest.json
,
which describes the location of each resource, the type of each resource, and
the version of Guacamole that the extension was built for. The manifest can
contain the following properties:
guacamoleVersion
The version string of the Guacamole release that this extension is written for. This property is required for all extensions. The special version string
"*"
can be used if the extension does not depend on a particular version of Guacamole, but be careful - this will bypass version compatibility checks, and should never be used if the extension does more than basic theming or branding.name
A human-readable name for the extension. This property is required for all extensions. When your extension is successfully loaded, a message acknowledging the successful loading of your extension by name will be logged.
namespace
A unique string which identifies your extension. This property is required for all extensions. This string should be unique enough that it is unlikely to collide with the namespace of any other extension.
If your extension contains static resources, those resources will be served at a path derived from the namespace provided here.
authProviders
An array of the classnames of all
AuthenticationProvider
subclasses provided by this extension.listeners
An array of the classnames of all
Listener
subclasses provided by this extension.js
An array of all JavaScript files within the extension. All paths within this array must be relative paths, and will be interpreted relative to the root of the archive.
JavaScript files declared here will be automatically loaded when the web application loads within the user’s browser.
css
An array of all CSS files within the extension. All paths within this array must be relative paths, and will be interpreted relative to the root of the archive.
CSS files declared here will be automatically applied when the web application loads within the user’s browser.
html
An array of all HTML files within the extension that should be used to update or replace existing HTML within the Guacamole interface. All paths within this array must be relative paths, and will be interpreted relative to the root of the archive.
HTML files declared here will be automatically applied to other HTML within the Guacamole interface when the web application loads within the user’s browser. The manner in which the files are applied is dictated by
<meta ...>
tags within those same files.translations
An array of all translation files within the extension. All paths within this array must be relative paths, and will be interpreted relative to the root of the archive.
Translation files declared here will be automatically added to the available languages. If a translation file provides a language that already exists within Guacamole, its strings will override the strings of the existing translation.
resources
An object where each property name is the name of a web resource file, and each value is the mimetype for that resource. All paths within this object must be relative paths, and will be interpreted relative to the root of the archive.
Web resources declared here will be made available to the application at
app/ext/NAMESPACE/PATH
, whereNAMESPACE
is the value of the namespace property, andPATH
is the declared web resource filename.
The only absolutely required properties are guacamoleVersion
, name
, and
namespace
, as they are used to identify the extension and for compatibility
checks. The most minimal guac-manifest.json
will look something like this:
{
"guacamoleVersion" : "1.5.3",
"name" : "My Extension",
"namespace" : "my-extension"
}
This will allow the extension to load, but does absolutely nothing otherwise.
Lacking the semantic information provided by the other properties, no other
files within the extension will be used. A typical guac-manifest.json
for an
extension providing theming or branding would be more involved:
{
"guacamoleVersion" : "1.5.3",
"name" : "My Extension",
"namespace" : "my-extension",
"css" : [ "theme.css" ],
"html" : [ "loginDisclaimer.html" ],
"resources" : {
"images/logo.png" : "image/png",
"images/cancel.png" : "image/png",
"images/delete.png" : "image/png"
}
}
Updating existing HTML
The existing HTML structure of Guacamole’s interface can be modified by
extensions through special “patch” HTML files declared by the html property in
guac-manifest.json
. These files are HTML fragments and are identical to any
other HTML file except that they contain Guacamole-specific meta tags that
instruct Guacamole to modify its own HTML in a particular way. Each meta tag
takes the following form:
<meta name="NAME" content="SELECTOR">
where SELECTOR
is a CSS selector that matches the elements within the
Guacamole interface that serve as a basis for the modification, and NAME
is
any one of the following defined modifications:
before
Inserts the specified HTML immediately before any element matching the CSS selector.
after
Inserts the specified HTML immediately after any element matching the CSS selector.
replace
Replaces any element matching the CSS selector with the specified HTML.
before-children
Inserts the specified HTML immediately before the first child (if any) of any element matching the CSS selector. If a matching element has no children, the HTML simply becomes the entire contents of the matching element.
after-children
Inserts the specified HTML immediately after the last child (if any) of any element matching the CSS selector. If a matching element has no children, the HTML simply becomes the entire contents of the matching element.
replace-children
Replaces the entire contents of any element matching the CSS selector with the specified HTML.
For example, to add a welcome message and link to some corporate privacy policy (a fairly common need), you would add an HTML file like the following:
<meta name="after" content=".login-ui .login-dialog">

Welcome to our Guacamole server!

Please be sure to read our privacy
policy before continuing.

After the extension is installed and Guacamole is restarted, the “welcome” div
and its contents will automatically be inserted directly below the login dialog
(the only element that would match .login-ui .login-dialog
) as if they were
part of Guacamole’s HTML in the first place.
An example of an extension that modifies style and HTML components for the
purpose of providing custom “branding” of the Guacamole interface can be found
in the doc/guacamole-branding-example
directory of the guacamole-client
source code, which can be found here:
https://github.com/apache/guacamole-client/tree/master/doc/guacamole-branding-example
Accessing the server configuration
The configuration of the Guacamole server is exposed through the Environment
interface, specifically the LocalEnvironment
implementation of this
interface. Through Environment
, you can access all properties declared within
guacamole.properties
, determine the proper hostname/port of guacd, and access
the contents of GUACAMOLE_HOME
.
Custom properties
If your extension requires generic, unstructured configuration parameters,
guacamole.properties
is a reasonable and simple location for them. The
Environment
interface provides direct access to guacamole.properties
and
simple mechanisms for reading and parsing the properties therein. The value of
a property can be retrieved by calling getProperty()
, which will return
null
or a default value for undefined properties, or getRequiredProperty()
,
which will throw an exception for undefined properties.
For convenience, guacamole-ext contains several pre-defined property base classes for common types:
BooleanGuacamoleProperty
The values “true” and “false” are parsed as their corresponding
Boolean
values. Any other value results in a parse error.IntegerGuacamoleProperty
Numeric strings are parsed as
Integer
values. Non-numeric strings will result in a parse error.LongGuacamoleProperty
Numeric strings are parsed as
Long
values. Non-numeric strings will result in a parse error.StringGuacamoleProperty
The property value is returned as an untouched
String
. No parsing is performed, and parse errors cannot occur.FileGuacamoleProperty
The property is interpreted as a filename, and a new
File
pointing to that filename is returned. If the filename is invalid, a parse error will be thrown. Note that the file need not exist or be accessible for the filename to be valid.
To use these types, you must extend the base class, implementing the
getName()
function to identify your property. Typically, you would declare
these properties as static members of some class containing all properties
relevant to your extension:
public class MyProperties {
public static MY_PROPERTY = new IntegerGuacamoleProperty() {
@Override
public String getName() { return "my-property"; }
};
}
Your property can then be retrieved with getProperty()
or
getRequiredProperty()
:
Integer value = environment.getProperty(MyProperties.MY_PROPERTY);
If you need more sophisticated parsing, you can also implement your own
property types by implementing the GuacamoleProperty
interface. The only
functions to implement are getName()
, which returns the name of the property,
and parseValue()
, which parses a given string and returns its value.
Advanced configuration
If you need more structured data than provided by simple properties, you can
place completely arbitrary files in a hierarchy of your choosing anywhere
within GUACAMOLE_HOME
as long as you avoid placing your files in directories
reserved for other purposes as described above.
The Environment
interface exposes the location of GUACAMOLE_HOME
through
the getGuacamoleHome()
function. This function returns a standard Java File
which can then be used to locate other files or directories within
GUACAMOLE_HOME
:
File myConfigFile = new File(environment.getGuacamoleHome(), "my-config.xml");
There is no guarantee that GUACAMOLE_HOME
or your file will exist, and you
should verify this before proceeding further in your extension’s configuration
process, but once this is done you can simply parse your file as you see fit.
Authentication providers
Guacamole’s authentication system is driven by authentication providers, which
are classes which implement the AuthenticationProvider
interface defined by
guacamole-ext. When any page within Guacamole is visited, the following process
occurs:
All currently installed extensions are polled, in lexicographic order of their filenames, by invoking the
getAuthenticatedUser()
function with aCredentials
object constructed with the contents of the HTTP request.The credentials given are abstract. While the
Credentials
object provides convenience access to a traditional username and password, implementations are not required to use usernames and passwords. The entire contents of the HTTP request is at your disposal, including parameters, cookies, and SSL information.If an authentication attempt fails, the extension throws either a
GuacamoleInsufficientCredentialsException
(if more credentials are needed before validity can be determined) orGuacamoleInvalidCredentialsException
(if the credentials are technically sufficient, but are invalid as provided). If all extensions fail to authenticate the user, the contents of the exception thrown by the first extension to fail are used to produce the user login prompt.Note that this means there is no “login screen” in Guacamole per se; the prompt for credentials for unauthenticated users is determined purely based on the needs of the extension as declared within the authentication failure itself.
If an authentication attempt succeeds, the extension returns an instance of
AuthenticatedUser
describing the identity of the user that just authenticated, and no further extensions are polled.If authentication has succeeded, and thus an
AuthenticatedUser
is available, thatAuthenticatedUser
is passed to thegetUserContext()
function of all extensions’ authentication providers. Each extension now has the opportunity to provide access to data for a user, even if that extension did not originally authenticate the user. If noUserContext
is returned for the givenAuthenticatedUser
, then that extension has simply refused to provide data for that user.The Guacamole interface will transparently unify the data from each extension, providing the user with a view of all available connections. If the user has permission to modify or administer any objects associated with an extension, access to the administrative interface will be exposed as well, again with a unified view of all applicable objects.
Important
Because authentication is decoupled from data storage/access, you do not need
to implement full-blown data storage if you only wish to provide an additional
authentication mechanism. You can instead implement only the authentication
portion of an AuthenticationProvider
, and otherwise rely on the storage and
features provided by other extensions, such as the database authentication
extension.
The Guacamole web application includes a basic authentication provider
implementation which parses an XML file to determine which users exist, their
corresponding passwords, and what configurations those users have access to.
This is the part of Guacamole that reads the user-mapping.xml
file. If you
use a custom authentication provider for your authentication, this file will
probably not be required.
The community has implemented authentication providers which access databases,
use LDAP, or even perform no authentication at all, redirecting all users to a
single configuration specified in guacamole.properties
.
A minimal authentication provider is implemented in the tutorials later, and the upstream authentication provider implemented within Guacamole, as well as the authentication providers implemented by the community, are good examples for how authentication can be extended without having to implement a whole new web application.
SimpleAuthenticationProvider
The SimpleAuthenticationProvider
class provides a much simpler means of
implementing authentication when you do not require the ability to add and
remove users and connections. It is an abstract class and requires only one
function implementation: getAuthorizedConfigurations()
.
This function is required to return a Map
of unique IDs to configurations,
where these configurations are all configurations accessible with the provided
credentials. As before, the credentials given are abstract. You are not
required to use usernames and passwords.
The configurations referred to by the function name are instances of
GuacamoleConfiguration
(part of guacamole-common), which is just a wrapper
around a protocol name and set of parameter name/value pairs. The name of the
protocol to use and a set of parameters is the minimum information required for
other parts of the Guacamole API to complete the handshake required by the
Guacamole protocol.
When a class that extends SimpleAuthenticationProvider
is asked for more
advanced operations by the web application, SimpleAuthenticationProvider
simply returns that there is no permission to do so. This effectively disables
all administrative functionality within the web interface.
If you choose to go the simple route, most of the rest of this chapter is
irrelevant. Permissions, security model, and various classes will be discussed
that are all handled for you automatically by SimpleAuthenticationProvider
.
The UserContext
The UserContext
is the root of all data-related operations. It is used to
list, create, modify, or delete users and connections, as well as to query
available permissions. If an extension is going to provide access to data of
any sort, it must do so through the UserContext
.
The Guacamole web application uses permissions queries against the
UserContext
to determine what operations to present, but beware that it is
up to the UserContext
to actually enforce these restrictions. The Guacamole
web application will not enforce restrictions on behalf of the UserContext
.
The UserContext
is the sole means of entry and the sole means of modification
available to a logged-in user. If the UserContext
refuses to perform an
operation (by throwing an exception), the user cannot perform the operation at
all.
Directory
classes
Access to objects beneath the UserContext
is given through Directory
classes. These Directory
classes are similar to Java collections, but they
also embody update and batching semantics. Objects can be retrieved from a
Directory
using its get()
function and added or removed with add()
and
remove()
respectively, but objects already in the set can also be updated by
passing an updated object to its update()
function.
An implementation of a Directory
can rely on these functions to define the
semantics surrounding all operations. The add()
function is called only when
creating new objects, the update()
function is called only when updating an
object previously retrieved with get()
, and remove()
is called only when
removing an existing object by its identifier.
When implementing an AuthenticationProvider
, you must ensure that the
UserContext
will only return Directory
classes that automatically enforce
the permissions associated with all objects and the associated user.
REST resources
Arbitrary REST resources may be exposed by extensions at the
AuthenticationProvider
level, if the resource does not require an associated
authenticated user, or at the UserContext
level, if the resource should be
available to authenticated users only. In both cases, the REST resource is
provided through implementing the getResource()
function, returning an object
which is annotated with JAX-RS annotations (JSR 311).
The resource returned by getResource()
functions as the root resource,
providing access to other resources beneath itself. The root resource for the
AuthenticationProvider
is exposed at PATH/api/ext/IDENTIFIER
, and
the root resource for the UserContext
is exposed at
PATH/api/session/ext/IDENTIFIER
, where PATH
is the path to which
Guacamole has been deployed (typically /guacamole/
) and IDENTIFIER
is the
unique identifier for the AuthenticationProvider
, as returned by
getIdentifier()
.
The behavior of extension REST resources is generally left entirely to the
implementation, with the exception that the “token” request parameter is
reserved for use by Guacamole. This parameter contains the user’s
authentication token when the user is logged in, and must be present on all
requests which require authentication. Though not relevant to REST resources
exposed at the AuthenticationProvider
level, resources exposed at the
UserContext
level inherently require the “token” parameter to be present, as
it is the sole means of locating the user’s session.
Permissions
The permissions system within guacamole-ext is an advisory system. It is the means by which an authentication module describes to the web application what a user is allowed to do. The body of permissions granted to a user describes which objects that user can see and what they can do to those objects, and thus suggests how the Guacamole interface should appear to that user.
Permissions are not the means by which access is restricted; they are purely a means of describing access level. An implementation may internally use the permission objects to define restrictions, but this is not required. It is up to the implementation to enforce its own restrictions by throwing exceptions when an operation is not allowed, and to correctly communicate the abilities of individual users through these permissions.
The permissions available to a user are exposed through the
SystemPermissionSet
and ObjectPermissionSet
classes which are accessible
through the UserContext
. These classes also serve as the means for
manipulating the permissions granted to a user.
System permissions
System permissions describe access to operations that manipulate the system as a whole, rather than specific objects. This includes the creation of new objects, as object creation directly affects the system, and per-object controls cannot exist before the object is actually created.
ADMINISTER
The user is a super-user - the Guacamole equivalent of root. They are allowed to manipulate of system-level permissions and all other objects. This permission implies all others.
CREATE_CONNECTION
The user is allowed to create new connections. If a user has this permission, the management interface will display components related to connection creation.
CREATE_CONNECTION_GROUP
The user is allowed to create new connection groups. If a user has this permission, the management interface will display components related to connection group creation.
CREATE_SHARING_PROFILE
The user is allowed to create new sharing profiles. If a user has this permission, the management interface will display components related to sharing profile creation.
CREATE_USER
The user is allowed to create other users. If a user has this permission, the management interface will display components related to user creation.
Object permissions
Object permissions describe access to operations that affect a particular object. Guacamole currently defines four types of objects which can be associated with permissions: users, connections, connection groups, and sharing profiles. Each object permission associates a single user with an action that may be performed on a single object.
ADMINISTER
The user may grant or revoke permissions involving this object. “Involving”, in this case, refers to either side of the permission association, and includes both the user to whom the permission is granted and the object the permission affects.
DELETE
The user may delete this object. This is distinct from the
ADMINISTER
permission which deals only with permissions. A user with this permission will see the “Delete” button when applicable.READ
The user may see that this object exists and read the properties of that object.
Note that the implementation is not required to divulge the true underlying properties of any object. The parameters of a connection or sharing profile, the type or contents of a connection group, the password of a user, etc. all need not be exposed.
This is particularly important from the perspective of security when it comes to connections, as the parameters of a connection are only truly needed when a connection is being modified, and likely should not be exposed otherwise. The actual connection operation is always performed internally by the authentication provider, and thus does not require client-side knowledge of anything beyond the connection’s existence.
UPDATE
The user may change the properties of this object.
In the case of users, this means the user’s password can be altered. Permissions are not considered properties of a user, nor objects in their own right, but rather associations between a user and an action which may involve another object.
The properties of a connection include its name, protocol, parent connection group, and parameters. The properties of a connection group include its name, type, parent connection group, and children. The properties of a sharing profile include its name, primary connection, and parameters.
Connections
Guacamole connections are organized in a hierarchy made up of connection
groups, which each act as folders organizing the connections themselves. The
hierarchy is accessed through the root-level connection group, exposed by
getRootConnectionGroup()
by the UserContext
. The connections and connection
groups exposed beneath the root connection group must also be accessible
directly through the connection and connection group directories exposed by
getConnectionDirectory()
and getConnectionGroupDirectory()
of the
UserContext
.
When a user attempts to use a connection the connect()
of the associated
Connection
object will be invoked. It is then up to the implementation of
this function to establish the TCP connection to guacd, perform the connection
handshake (most likely via an InetGuacamoleSocket
wrapped within a
ConfiguredGuacamoleSocket
), and then return a GuacamoleTunnel
which
controls access to the established socket.
Extensions may maintain historical record of connection use via
ConnectionRecord
objects, which are exposed both at the Connection
level
and across all connections via the UserContext
. Such record maintenance is
optional, and it is expected that most implementations will simply return empty
lists.
Important
If connection state will not be tracked by the extension, and the parameters
associated with the connection will be known at the time the connection object
is created, the SimpleConnection
implementation of Connection
can be used
to make life easier.
Managing/sharing active connections
After a connection has been established, its underlying GuacamoleTunnel
can
be exposed by a UserContext
through the Directory
returned by
getActiveConnectionDirectory(). The ActiveConnection
objects accessible
through this Directory
are the means by which an administrator may monitor or
forcibly terminate another user’s connection, ultimately resulting in Guacamole
invoking the close()
function of the underlying GuacamoleTunnel
, and also
serve as the basis for screen sharing.
Screen sharing is implemented through the use of SharingProfile
objects,
exposed through yet another Directory
beneath the UserContext
. Each sharing
profile is associated with a single connection that it can be used to share,
referred to as the “primary connection”. If a user has read access to a sharing
profile associated with their current connection, that sharing profile will be
displayed as an option within the share menu of the Guacamole
menu.
The overall sharing process is as follows:
A user, having access to a sharing profile associated with their current active connection, clicks its option within the share menu.
Guacamole locates the
ActiveConnection
and invokes itsgetSharingCredentials()
function with the identifier of the sharing profile. The contents of the returnedUserCredentials
object is used by Guacamole to generate a sharing link which can be given to other users.When another user visits the sharing link, the credentials embedded in the link are passed to the authentication providers associated with each installed extension. It is up to the extension that originally provided those credentials to authenticate the user and provide them with access to the shared connection.
When the user attempts to connect to the shared connection, the extension establishes the connection using the ID of the connection being joined. This is not the connection identifier as dictated by guacamole-ext, but rather the unique ID assigned by guacd as required by the Guacamole protocol. This ID can be retrieved from a
ConfiguredGuacamoleSocket
viagetConnectionID()
, and can be passed through aGuacamoleConfiguration
throughsetConnectionID()
(instead of specifying a protocol, as would be done for a brand new connection).


| Game type | Players Involved | Game Status |
|---|---|---|
| Chess | Bob, Dave | In Progress |
| Draughts | Bob, Tom | Setting up |
| Game type | Players Involved | Game Status |
|---|---|---|
| Chess | Bob, Dave | In Progress |
| Draughts | Bob, Tom | Setting up |
You can use the menu in the navigation bar at top of this page to create a new game or join a game created by someone else if you have the token.


>
Bitcoin
364i4khD1kfQgHjVv3eitsX97TqmHkie5k
Support Us
Scan the QR code or copy the address to support future projects.
364i4khD1kfQgHjVv3eitsX97TqmHkie5k
Scan the QR code or copy the address to support future projects.


{% extends 'users/base.html' %} {% set title = _('Manage watch list') %} {% set classes = 'edit-watches' %} {% set active = 'edit-watches' %} {% set crumbs = [(None, title)] %} {% block breadcrumbs %}{% endblock %} {% block content %}
{% trans %} Below is a list of items that you have watched. Checked items are items you are currently watching and unchecked items are no longer being watched. {% endtrans %}
{% else %}{{ _('You are not currently watching anything.') }}
{% endif %} {% endblock %}


23.1 [washing-clothes-exercise]Read the following text once for understanding, and remember as much of it as you can. There will be a test later.
The procedure is actually quite simple. First you arrange things into different groups. Of course, one pile may be sufficient depending on how much there is to do. If you have to go somewhere else due to lack of facilities that is the next step, otherwise you are pretty well set. It is important not to overdo things. That is, it is better to do too few things at once than too many. In the short run this may not seem important but complications can easily arise. A mistake is expensive as well. At first the whole procedure will seem complicated. Soon, however, it will become just another facet of life. It is difficult to foresee any end to the necessity for this task in the immediate future, but then one can never tell. After the procedure is completed one arranges the material into different groups again. Then they can be put into their appropriate places. Eventually they will be used once more and the whole cycle will have to be repeated. However, this is part of life.
23.2 An HMM grammar is essentially a standard HMM whose state variable is $N$ (nonterminal, with values such as $Det$, $Adjective$, $Noun$ and so on) and whose evidence variable is $W$ (word, with values such as $is$, $duck$, and so on). The HMM model includes a prior ${\textbf{P}}(N_0)$, a transition model ${\textbf{P}}(N_{t+1}|N_t)$, and a sensor model ${\textbf{P}}(W_t|N_t)$. Show that every HMM grammar can be written as a PCFG. [Hint: start by thinking about how the HMM prior can be represented by PCFG rules for the sentence symbol. You may find it helpful to illustrate for the particular HMM with values $A$, $B$ for $N$ and values $x$, $y$ for $W$.]
23.3 Consider the following PCFG for simple verb phrases:
0.1: VP $\rightarrow$ Verb
0.2: VP $\rightarrow$ Copula Adjective
0.5: VP $\rightarrow$ Verb the Noun
0.2: VP $\rightarrow$ VP Adverb
0.5: Verb $\rightarrow$ is
0.5: Verb $\rightarrow$ shoots
0.8: Copula $\rightarrow$ is
0.2: Copula $\rightarrow$ seems
0.5: Adjective $\rightarrow$ unwell
0.5: Adjective $\rightarrow$ well
0.5: Adverb $\rightarrow$ well
0.5: Adverb $\rightarrow$ badly
0.6: Noun $\rightarrow$ duck
0.4: Noun $\rightarrow$ well
Which of the following have a nonzero probability as a VP? (i) shoots the duck well well well(ii) seems the well well(iii) shoots the unwell well badly
What is the probability of generating “is well well”?
What types of ambiguity are exhibited by the phrase in (b)?
Given any PCFG, is it possible to calculate the probability that the PCFG generates a string of exactly 10 words?
23.4 Consider the following simple PCFG for noun phrases:
0.6: NP $\rightarrow$ Det\ AdjString\ Noun
0.4: NP $\rightarrow$ Det\ NounNounCompound
0.5: AdjString $\rightarrow$ Adj\ AdjString
0.5: AdjString $\rightarrow$ $\Lambda$
1.0: NounNounCompound $\rightarrow$ Noun
0.8: Det $\rightarrow$ the
0.2: Det $\rightarrow$ a
0.5: Adj $\rightarrow$ small
0.5: Adj $\rightarrow$ green
0.6: Noun $\rightarrow$ village
0.4: Noun $\rightarrow$ green
where $\Lambda$ denotes the empty string.
What is the longest NP that can be generated by this grammar? (i) three words(ii) four words(iii) infinitely many words
Which of the following have a nonzero probability of being generated as complete NPs? (i) a small green village(ii) a green green green(iii) a small village green
What is the probability of generating “the green green”?
What types of ambiguity are exhibited by the phrase in (c)?
Given any PCFG and any finite word sequence, is it possible to calculate the probability that the sequence was generated by the PCFG?
23.5 Outline the major differences between Java (or any other computer language with which you are familiar) and English, commenting on the “understanding” problem in each case. Think about such things as grammar, syntax, semantics, pragmatics, compositionality, context-dependence, lexical ambiguity, syntactic ambiguity, reference finding (including pronouns), background knowledge, and what it means to “understand” in the first place.
23.6 This exercise concerns grammars for very simple languages.
Write a context-free grammar for the language $a^n b^n$.
Write a context-free grammar for the palindrome language: the set of all strings whose second half is the reverse of the first half.
Write a context-sensitive grammar for the duplicate language: the set of all strings whose second half is the same as the first half.
23.7 Consider the sentence “Someone walked slowly to the supermarket” and a lexicon consisting of the following words:
$Pronoun \rightarrow \textbf{someone} \quad Verb \rightarrow \textbf{walked}$
$Adv \rightarrow \textbf{slowly} \quad Prep \rightarrow \textbf{to}$
$Article \rightarrow \textbf{the} \quad Noun \rightarrow \textbf{supermarket}$
Which of the following three grammars, combined with the lexicon, generates the given sentence? Show the corresponding parse tree(s).
| $\quad\quad\quad\quad (A):\quad\quad\quad\quad$ | $\quad\quad\quad\quad(B):\quad\quad\quad\quad$ | $\quad\quad\quad\quad(C):\quad\quad\quad\quad$ |
|---|---|---|
| $S\rightarrow NP\space VP$ | $S\rightarrow NP\space VP$ | $S\rightarrow NP\space VP$ |
| $NP\rightarrow Pronoun$ | $NP\rightarrow Pronoun$ | $NP\rightarrow Pronoun$ |
| $NP\rightarrow Article\space Noun $ | $NP\rightarrow Noun$ | $NP\rightarrow Article\space NP$ |
| $VP\rightarrow VP\space PP$ | $NP\rightarrow Article\space NP$ | $VP\rightarrow Verb\space Adv$ |
| $VP\rightarrow VP\space Adv\space Adv$ | $VP\rightarrow Verb\space Vmod$ | $Adv\rightarrow Adv\space Adv$ |
| $VP\rightarrow Verb$ | $Vmod\rightarrow Adv\space Vmod$ | $Adv\rightarrow PP$ |
| $PP\rightarrow Prep\space NP$ | $Vmod\rightarrow Adv$ | $PP\rightarrow Prep\space NP$ |
| $NP\rightarrow Noun$ | $Adv\rightarrow PP$ | $NP\rightarrow Noun$ |
| $\quad$ | $PP\rightarrow Prep\space NP$ | $\quad$ |
For each of the preceding three grammars, write down three sentences of English and three sentences of non-English generated by the grammar. Each sentence should be significantly different, should be at least six words long, and should include some new lexical entries (which you should define). Suggest ways to improve each grammar to avoid generating the non-English sentences.
23.8 Collect some examples of time expressions, such as “two o’clock,” “midnight,” and “12:46.” Also think up some examples that are ungrammatical, such as “thirteen o’clock” or “half past two fifteen.” Write a grammar for the time language.
23.9 Some linguists have argued as follows:
Children learning a language hear only positive examples of the language and no negative examples. Therefore, the hypothesis that “every possible sentence is in the language” is consistent with all the observed examples. Moreover, this is the simplest consistent hypothesis. Furthermore, all grammars for languages that are supersets of the true language are also consistent with the observed data. Yet children do induce (more or less) the right grammar. It follows that they begin with very strong innate grammatical constraints that rule out all of these more general hypotheses a priori.
Comment on the weak point(s) in this argument from a statistical learning viewpoint.
23.10 [chomsky-form-exercise] In this exercise you will transform $\large \varepsilon_0$ into Chomsky Normal Form (CNF). There are five steps: (a) Add a new start symbol, (b) Eliminate $\epsilon$ rules, (c) Eliminate multiple words on right-hand sides, (d) Eliminate rules of the form (${\it X}$ ${{\;}}\rightarrow{{\;}}$${\it Y}$), (e) Convert long right-hand sides into binary rules.
The start symbol, $S$, can occur only on the left-hand side in CNF. Replace ${\it S}$ everywhere by a new symbol ${\it S'}$ and add a rule of the form ${\it S}$ ${{\;}}\rightarrow{{\;}}$${\it S'}$.
The empty string, $\epsilon$ cannot appear on the right-hand side in CNF. $\large \varepsilon_0$ does not have any rules with $\epsilon$, so this is not an issue.
A word can appear on the right-hand side in a rule only of the form (${\it X}$ ${{\;}}\rightarrow{{\;}}$word). Replace each rule of the form (${\it X}$ ${{\;}}\rightarrow{{\;}}$…word …) with (${\it X}$ ${{\;}}\rightarrow{{\;}}$…${\it W'}$ …) and (${\it W'}$ ${{\;}}\rightarrow{{\;}}$word), using a new symbol ${\it W'}$.
A rule (${\it X}$ ${{\;}}\rightarrow{{\;}}$${\it Y}$) is not allowed in CNF; it must be (${\it X}$ ${{\;}}\rightarrow{{\;}}$${\it Y}$ ${\it Z}$) or (${\it X}$ ${{\;}}\rightarrow{{\;}}$word). Replace each rule of the form (${\it X}$ ${{\;}}\rightarrow{{\;}}$${\it Y}$) with a set of rules of the form (${\it X}$ ${{\;}}\rightarrow{{\;}}$…), one for each rule (${\it Y}$ ${{\;}}\rightarrow{{\;}}$…), where (…) indicates one or more symbols.
Replace each rule of the form (${\it X}$ ${{\;}}\rightarrow{{\;}}$${\it Y}$ ${\it Z}$ …) with two rules, (${\it X}$ ${{\;}}\rightarrow{{\;}}$${\it Y}$ ${\it Z'}$) and (${\it Z'}$ ${{\;}}\rightarrow{{\;}}$${\it Z}$ …), where ${\it Z'}$ is a new symbol.
Show each step of the process and the final set of rules.
23.11 Consider the following toy grammar:
$S \rightarrow NP\space VP$
$NP \rightarrow Noun$
$NP \rightarrow NP\space and\space NP$
$NP \rightarrow NP\space PP$
$VP \rightarrow Verb$
$VP \rightarrow VP\space and \space VP$
$VP \rightarrow VP\space PP$
$PP \rightarrow Prep\space NP$
$Noun \rightarrow Sally\space; pools\space; streams\space; swims$
$Prep \rightarrow in$
$Verb \rightarrow pools\space; streams\space; swims$
Show all the parse trees in this grammar for the sentence “Sally swims in streams and pools.”
Show all the table entries that would be made by a (non-probabalistic) CYK parser on this sentence.
23.12 [exercise-subj-verb-agree] Using DCG notation, write a grammar for a language that is just like $\large \varepsilon_1$, except that it enforces agreement between the subject and verb of a sentence and thus does not generate ungrammatical sentences such as “I smells the wumpus.”
23.13 Consider the following PCFG:
$S \rightarrow NP \space VP[1.0] $
$NP \rightarrow \textit{Noun}[0.6] \space|\space \textit{Pronoun}[0.4] $
$VP \rightarrow \textit{Verb} \space NP[0.8] \space|\space \textit{Modal}\space \textit{Verb}[0.2]$
$\textit{Noun} \rightarrow \textbf{can}[0.1] \space|\space \textbf{fish}[0.3] \space|\space ...$
$\textit{Pronoun} \rightarrow \textbf{I}[0.4] \space|\space ...$
$\textit{Verb} \rightarrow \textbf{can}[0.01] \space|\space \textbf{fish}[0.1] \space|\space ...$
$\textit{Modal} \rightarrow \textbf{can}[0.3] \space|\space ...$
The sentence “I can fish” has two parse trees with this grammar. Show the two trees, their prior probabilities, and their conditional probabilities, given the sentence.
23.14 An augmented context-free grammar can represent languages that a regular context-free grammar cannot. Show an augmented context-free grammar for the language $a^nb^nc^n$. The allowable values for augmentation variables are 1 and $SUCCESSOR(n)$, where $n$ is a value. The rule for a sentence in this language is $$S(n) {{{{\;}}\rightarrow{{\;}}}}A(n) {{\;}}B(n) {{\;}}C(n) \ .$$ Show the rule(s) for each of ${\it A}$, ${\it B}$, and ${\it C}$.
23.15 Augment the $\large \varepsilon_1$ grammar so that it handles article–noun agreement. That is, make sure that “agents” and “an agent” are ${\it NP}$s, but “agent” and “an agents” are not.
23.16 Consider the following sentence (from The New York Times, July 28, 2008):
Banks struggling to recover from multibillion-dollar loans on real estate are curtailing loans to American businesses, depriving even healthy companies of money for expansion and hiring.
Which of the words in this sentence are lexically ambiguous?
Find two cases of syntactic ambiguity in this sentence (there are more than two.)
Give an instance of metaphor in this sentence.
Can you find semantic ambiguity?
23.17 [washing-clothes2-exercise] Without looking back at Exercise washing-clothes-exercise, answer the following questions:
What are the four steps that are mentioned?
What step is left out?
What is “the material” that is mentioned in the text?
What kind of mistake would be expensive?
Is it better to do too few things or too many? Why?
23.18 Select five sentences and submit them to an online translation service. Translate them from English to another language and back to English. Rate the resulting sentences for grammaticality and preservation of meaning. Repeat the process; does the second round of iteration give worse results or the same results? Does the choice of intermediate language make a difference to the quality of the results? If you know a foreign language, look at the translation of one paragraph into that language. Count and describe the errors made, and conjecture why these errors were made.
23.19 The $D_i$ values for the sentence in Figure mt-alignment-figure sum to 0. Will that be true of every translation pair? Prove it or give a counterexample.
23.20 (Adapted from [@Knight:1999].) Our translation model assumes that, after the phrase translation model selects phrases and the distortion model permutes them, the language model can unscramble the permutation. This exercise investigates how sensible that assumption is. Try to unscramble these proposed lists of phrases into the correct order:
have, programming, a, seen, never, I, language, better
loves, john, mary
is the, communication, exchange of, intentional, information brought, by, about, the production, perception of, and signs, from, drawn, a, of, system, signs, conventional, shared
created, that, we hold these, to be, all men, truths, are, equal, self-evident
Which ones could you do? What type of knowledge did you draw upon? Train a bigram model from a training corpus, and use it to find the highest-probability permutation of some sentences from a test corpus. Report on the accuracy of this model.
23.21 Calculate the most probable path through the HMM in Figure sr-hmm-figure for the output sequence $[C_1,C_2,C_3,C_4,C_4,C_6,C_7]$. Also give its probability.
23.22 We forgot to mention that the text in Exercise washing-clothes-exercise is entitled “Washing Clothes.” Reread the text and answer the questions in Exercise washing-clothes2-exercise. Did you do better this time? Bransford and Johnson [@Bransford+Johnson:1973] used this text in a controlled experiment and found that the title helped significantly. What does this tell you about how language and memory works?


Collab Doc
Home
Groups
Log out
Your Groups
Group A
group description
--see post-->
Recent Posts.
Post
Hey I'm facing this problem......
read more....


Contents:
simple calendar based on the bootstrap calendar from http://bootstrap-calendar.azurewebsites.net/
Django:
settings.py:
INSTALLED_APPS = (
...
'django_bootstrap_calendar',
...
)
urls.py:
urlpatterns = patterns('',
...
(r'^calendar/', include('django_bootstrap_calendar.urls')),
...
)
Load templatetags:
{% load bootstrap_calendar %}
In your template file:
Calendar controls :
{% bootstrap_controls 'optional-css-classes' %}
Calendar:
{% bootstrap_calendar 'optional-css-classes' %}
In your base.html file css section:
{% bootstrap_calendar_css %}
In your base.html file javascript section:
{% bootstrap_calendar_js %}
At the command line:
$ git clone https://github.com/sandlbn/django-bootstrap-calendar.git
$ cd django-bootstrap-calendar
$ python setup.py install
Django:
settings.py:
INSTALLED_APPS = (
...
'django_bootstrap_calendar',
...
)
urls.py:
urlpatterns = patterns('',
...
(r'^calendar/', include('django_bootstrap_calendar.urls')),
...
)
Load templatetags:
{% load bootstrap_calendar %}
In your template file:
Calendar controls :
{% bootstrap_controls 'optional-css-classes' %}
Calendar:
{% bootstrap_calendar 'optional-css-classes' %}
In your base.html file css section:
{% bootstrap_calendar_css %}
In your base.html file javascript section:
{% bootstrap_calendar_js %}
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Report bugs at https://github.com/sandlbn/django_bootstrap_calendar/issues.
If you are reporting a bug, please include:
Look through the GitHub issues for bugs. Anything tagged with “bug” is open to whoever wants to implement it.
Look through the GitHub issues for features. Anything tagged with “feature” is open to whoever wants to implement it.
django-bootstrap-calendar could always use more documentation, whether as part of the official django-bootstrap-calendar docs, in docstrings, or even on the web in blog posts, articles, and such.
The best way to send feedback is to file an issue at https://github.com/sandlbn/django_bootstrap_calendar/issues.
If you are proposing a feature:
Ready to contribute? Here’s how to set up django_bootstrap_calendar for local development.
Fork the django_bootstrap_calendar repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/django_bootstrap_calendar.git
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
$ mkvirtualenv django_bootstrap_calendar
$ cd django_bootstrap_calendar/
$ python setup.py develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
5. When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
$ flake8 django_bootstrap_calendar tests
$ python setup.py test
$ tox
To get flake8 and tox, just pip install them into your virtualenv.
Commit your changes and push your branch to GitHub:
$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
Before you submit a pull request, check that it meets these guidelines:
None yet. Why not be the first?


Depatment of Civil and Environmental Engineering, Block - 6, Indian Institiute of Technology Patna, Bihta
P: (+91)<PHONE_NUMBER>
E<EMAIL_ADDRESS>W: www.iitp.ac.in/ace
F: facebook
L: Linkedin
T: Monday - Friday: 9:00 AM to 5:00 PM


Intro to F5 Automation
Chris Adrian & Jon Calalang
Cloud/DevOps Engineers
Fork me @chrisadrian001 or @jmcalalang
Agenda
Automation and Orchestration Concepts
Imperative Automation via the BIG-IP REST API
Lab Module 1
Declarative Automation via iWorkflow
Lab Module 2
Automation and Orchestration Concepts
Orchestration enables an effective DevOps culture
Building the Appropriate Abstraction
Building the Appropriate Abstraction
Source of Truth(iness)
Source of Truth is defined as a system or object that contains the authoritative representation of a service.
Changes for a service should propagate (push) from the source of truth to sub-ordinate systems.
Out-of-band changes must be handled very carefully (or be totally avoided).
To address real-world challenges I prefer to call this ‘Source-of-Truthiness’:
In an automation tool chain it’s possible to create layers of ‘truth’ as long sub-ordinate systems ‘filter’ the service definition upstream.
What the northbound system doesn’t know won’t hurt it.
Changes should NEVER have to flow from sub-ordinate devices upstream.
iApp strict updates are an example of strict Source-of-Truth enforcement.
iWorkflow service catalog is an example of a Source-of-Truthiness.
Introduction to REST
Based on HTTP and JSON
Uses HTTP verbs (GET, POST, PUT, PATCH, etc.)
Data is sent using the Javascript Object Notation format
{
“attribute1”:”value1”,
“attribute2”:[“array”,”of”,”values”],
“attribute3”: [ { “nested1”:”value1”, “nested2”:”value2” }, {“nested3”:”value3”} ]
}
REST APIs and HTTP Verbs
The following table summarizes the interpretation of HTTP methods for REST APIs.
HTTP methods (verbs) are used to create, read, update, and delete (CRUD) resources.
APIs must use HTTP verbs in a manner described in the table below.
APIs may implement a subset as required.
Response Codes
APIs must make use of HTTP response codes where appropriate.
The following table describes the required success response codes.
REST API Organization
Anatomy of a REST URI
NOTE: Resource names map ‘~’ to ‘/’ (e.g. ~Common~mypool is really /Common/mypool)
How the REST API is Implemented on TMOS
REST API attributes are derived from TMSH schema. (Odata Standard)
Generally, if the attribute/option is available in TMSH it’s available in REST
You can ‘follow’ the API by mapping to tmsh commands in most cases.
list ltm pool pool1 members {<IP_ADDRESS>:80}
GET: https://<IP_ADDRESS>/mgmt/tm/ltm/pool/pool1/members/~Common~<IP_ADDRESS>:80
REST Query Parameters
?$filter='<'partition'>'
Allows an OData search string to filter objects
?$filter eq MyPartition
?$select=attribute1,attribute2
Select specific attributes to return in the response
?expandSubcollections=true
Automatically expand any Sub-Collections in a resource
See REST API guide for more (11.6 and 12.X)
REST Chicken and the Egg
Problem: I want to create something but can’t figure out how REST wants it represented.
https://mgt.bigip/mgmt/TOC
Solution: Create the object via GUI/TMSH and then GET the Resource to see how it’s represented.
E.g.: GET https://mgt.bigip/mgmt/tm/ltm/pool/example
Imperative/Declarative Automation
Imperative Model
Imperative – What we’ve done for years (scripting, iRules, etc.) Imperative methodology implies that you define the flow of an operation implicitly. It also implies that domain-specific knowledge is required to interact with the system.
What domain-specific knowledge is required to make this sandwich?
Declarative Model
Declarative – What we’re evolving to. Declarative methodology implies that you define the desired outcome and depend on underlying mechanisms to deliver that outcome. This methodology tries to reduce or eliminate the need for domain specific knowledge.
Declarative Orchestration/DevOps
RBAC
Imperative Methodology – RBAC is necessary in most environments, however, it should be implemented upstream from BIG-IP (i.e. iWorkflow) and an API aggregator/proxy.
Declarative Methodology – RBAC is not necessarily required if a strict service abstraction model is implemented. The tenant service interface should inherently implement security controls as part of the service definition.
Multi-Tenancy
BIG-IP is Multi-Tenant inherently.
Route-Domains
Partitions
What about route-domain 0?
iWorkflow implements a Provider/Tenant model for multi-tenancy.
All automation code should be multi-tenant aware by nature.
It’s not that hard… always use a partition for object names.
Always use a route domain on all L3 addresses (including 0).
JSON Formatting
JSON is a strictly defined syntax. As a result it is very unforgiving of syntactical errors.
When defining a JSON object the last element in the object should NOT have a comma:
JSON Formatting – When you get stuck
http//jsonlint.com -- Verify Syntax, Pretty Print Ugly JSON Responses
Atom.io - jsonlint & Prettify
Useful Logs
tail –f /var/log/restjavad.0.log | python –m json.tool (BIG-IP & iWorkflow)
/var/log/ltm
/var/log/audit
The Sledge Hammer Approach
The REST API is not complete (not all modules implement REST API endpoints)
TMSH is not complete (ZebOS, loading APM policy from CLI, etc.)
When all else fails, BASH it:
POST to /mgmt/tm/util/bash
JSON:
{
"command":"run”,
"utilCmdArgs":"-c ‘rm –Rf /’”
}
Ex: "utilCmdArgs": "-c ’mkdir -r /var/config/rest/downloads/mydir'"
This is a ABSOLUTE last resort, but useful nonetheless


|
|
Link here
| Toggle [
colors
] Background [
white
|
blue
|
purple
|
flint
] Items [
upload
|
firefox extension
]
Log in
Username
Password
|
Register
Welcome!
|
Log out


--- layout: page status: publish published: true title: Parcels author: display_name: Rick Kelson login: rkelson email<EMAIL_ADDRESS>url: '' author_login: rkelson author_email<EMAIL_ADDRESS>wordpress_id: 2107 wordpress_url: http://gis.utah.gov/?page_id=2107 date: '2011-09-07 16:17:52 -0600' date_gmt: '2011-09-07 16:17:52 -0600' categories: [] tags: - sgid - Data - utah - gis - map - mapping - dataset - download - agrc - layer - shapefile - geodatabase - metadata - shp - gdb - kml - lyr - digital - geographic - information - database - state - statewide ---
Data Type: GIS Data Layer
Steward(s): AGRC
Web Application: Parcel Web Application
Abstract:
This datasets contain GIS mapping data representing parcel boundaries. AGRC has parcel data for all 29 counties. Some counties are more complete than others. In addition to the polygon geometry the attributes PARCEL ID, PARCEL ADDRESS, PARCELS CITY, PARCEL ZIP CODE, OWNERSHIP TYPE, and RECORDER contact are maintained in the parcel dataset when available. Users should be aware the owner type field 'OWN_TYPE' in the parcel polygons is a very generalized ownership type (Federal, Private, State, Tribal). It is populated with the value of the 'OWNER' field where the parcel's centroid intersects the CADASTRE.LandOwnership polygon layer. A parcel web application is available for viewing and downloading the parcel data.
Data Content:
The following data is available for download:
The 2005, HB113 was passed requiring the AGRC Cadastral Surveyor to work with local government to create a parcel database for the State. 63F-1-506.(3) (c) coordinate with county recorders and surveyors to create a statewide parcel layer in the State Geographic Information Database (SGID) containing parcel boundary, parcel identifier, parcel address, owner type, and county recorder contact information. The SGID contains county parcel data from each of the 29 counties in Utah and is updated as new data is provided from the data steward in each county. Parcel polygons contain attributes unique to each parcel such as a unique parcel number (PARCEL_ID), address for the parcel (PARCEL_ADD, PARCEL_CITY, PARCEL_ZIP), a generalized land ownership designation (OWN_TYPE), and the phone number for the county recorders office (RECORDER).
The native spatial reference for this dataset is UTM Zone 12N, NAD83 (0.01 meter coordinate precision).
There are no constraints or warranties with regard to the use of this dataset. Users are encouraged to attribute content to: State of Utah, SGID.
The parcel datasets are maintained by AGRC in partnership with local governments.
Questions can be direction to Rick Kelson<PHONE_NUMBER>) at AGRC.
AGRC has parcel data for all 29 counties. Some counties are more complete than others. This data when possible is updated twice a year with the newest data available from the counties. In addition to the polygon geometry the attributes PARCEL ID, PARCEL ADDRESS, PARCELS CITY, PARCEL ZIP CODE, OWNERSHIP TYPE, and RECORDER contact are maintained in the parcel dataset when available.
Download County Parcel Data:
This data when possible is updated twice a year with the newest data available from the counties. Some counties along the Wasatch Front are updated monthly when possible.
A map of parcel updates can be found here. Be sure to switch the Content tab to Parcel Data.
Recent updates:


ZVC Bootstrap Table has the ability to open a "details" area for each displayed row, and even for a new row to be added. This area can be filled with any Custom component in ZVC.
Row detail area can be used to show row properties, offer custom actions based on row data or, as in this example, to edit the row data.
One of the columns defined in THEADER can act as an "opener" for row's details area. When user selects the icon in that column, table asks to container (using an event) for the path to the component to open and de initial options to pass to that component after creation (on its init event).
This demo uses a Custom Component called PEdCustomer (Panel for Customer Edition) equivalent (and ver similar) to WEdComponent used in Dialog Based Edition. This panel has three buttons: Save, Cancel and Delete. Delete Button is hidden when panel is open to edit a new record. Same way, Customer Id field is disabled when editing an existing record.
Events triggered from Details Component are passed directly to table container controller, adding to extra parameters at the begining of the handler function: row and rowIndex.


TIL: Energy use per transaction for cryptocurrencies vs Visa
For my own calibration, approximate current energy use for a single transaction in various cryptocurrencies, compared with using Visa:
| Currency | Symbol | Energy use per txn(Wh) |
Equivalent |
|---|---|---|---|
| Bitcoin | BTC | 1,000,000 | Hot tub, 150 hours |
| Ethereum | ETH | 62,000 | Nissan Leaf, 1.5 charges |
| Litecoin | LTC | 19,000 | Clothes washer, 8 loads |
| Chia | XCH | 2,000 | Dishwasher, 1 hour |
| Cardano | ADA | 500 | Computer & monitor, 1 hour |
| Dogecoin | DOGE | 120 | Humidifier, 1 hour |
| Ripple | XRP | 79 | Amazon echo telling 2 jokes |
| Visa | 1.5 | LED light bulb for 9 minutes | |
| Nano | NANO | 0.1 | LED light bulb for 30 seconds |
Sources
- I got most crypto energy use from this roundup.
- For Visa, I used the figures from this breakdown, and this one, which agrees.
- For Bitcoin, I took a rounded figure roughly between those quoted on the above two sources (710kWh and 1,123kWh). A single figure precision is probably most appropriate anyhow. Update: The digiconomist article above is updated as the Bitcoin energy use increases over time with proof difficulty, and it's now at almost double the figure I quoted above, at 1,800 kWh/txn.
- For Chia, I did my own hacky calculation. Chia Power estimates 6MW in total is used by the Chia network, at current size of 4EiB. Meanwhile, Chia Explorer shows a hard-to-read graph which I'm eyeballing to get a rough average of 3,000 transactions per hour. 6 Megawatts divided by 3k per hour gives an energy use per transaction of 2kW.
- For Nano, I'm using commonly-cited figures in Reddit posts (yuk), but the math seems to hold up as far as I can see.
- For equivalent household energy uses, I used this and this.
Notable standout here is NANO, which actually has an order of magnitude lower energy use than Visa. There are other low-energy use cryptocurrencies in this bracket, such as IOTA and HBAR. They face some criticism from Bitcoin maximalists that reducing energy use undermines the value proposition, or reduces security. But to my layman's ears, these arguments don't hold water. Certainly communities like NANO seem much more open to honest discussion of NANO's shortfalls than most crypto communities, which is a healthy sign, and it makes me inclined to trust their counter-assertions that NANO's security is really OK.
Something's not quite right here though. The Chia whitepaper estimates 10,000 times better energy efficiency than Bitcoin, by my figures above only show 1,000.
They probably know how to calculate this better than I do. So perhaps my figure for Chia is high? I understand the value per transaction will come down as Chia starts handling more transactions, which seems reasonable. Perhaps the white paper refers to that future hypothetical efficiency?
On the other hand, many of the other cryptocurrencies listed above will become more efficient in the future too (e.g. Bitcoin is in the process of deploying its lightning network, which will reduce per transaction energy use.) So I think it's fair to leave the above figures as they are, as a snapshot of current reality.


Iam najma amin, iwas born in Garissa Northeastern region of Kenya,
i live nairobi kenya
pursuing degree in computer science and currently
learing Coding skills in Moringa
upcoming junior software developer
Interest and H0bbies
reseearch
new technology
reading journals and magazine
watching news adventure


Do not forget to buy milk today.
Note: The mark tag is not supported in Internet Explorer 8 and earlier versions.