Basic usage patterns
- Basic steps
- Plugging in the Transformer and XML parser
- Configuring serialization output properties
- Caution: setting output encoding in the stylesheet
- Performing incremental transformations
- Working with embedded stylesheets
- Setting stylesheet parameters
- Serializing output
- Explicitly working with SAX
- Using transformation output as input for another transformation
- Processing and producing DOM trees
- Working with XPath expressions
- Using the Xalan-Java applet wrapper
- Using Xalan-Java in a servlet
- Creating and using extensions
- Multithreading
- Debugger interface
See also: Transform Features.
| Unless otherwise specified, the usage discussed in this section refers to the Xalan-Java Interpretive processor. See Getting Started Using XSLTC for information on using the Xalan-Java Compiling processor. |
Basic steps
- Instantiate a TransformerFactory
- Process the stylesheet and generate a Transformer
- Perform the transformation
The following example illustrates the three basic steps involved in performing a transformation.
// 1. Instantiate a TransformerFactory. javax.xml.transform.TransformerFactory tFactory = javax.xml.transform.TransformerFactory.newInstance(); // 2. Use the TransformerFactory to process the stylesheet Source and // generate a Transformer. javax.xml.transform.Transformer transformer = tFactory.newTransformer (new javax.xml.transform.stream.StreamSource("foo.xsl")); // 3. Use the Transformer to transform an XML Source and send the // output to a Result object. transformer.transform (new javax.xml.transform.stream.StreamSource("foo.xml"), new javax.xml.transform.stream.StreamResult( new java.io.FileOutputStream("foo.out")));
| For a working example of this model at its simplest, see SimpleTransform.java in the java/samples/SimpleTransform subdirectory. |
1. Instantiate a TransformerFactory
TransformerFactory is an abstract class with a static newInstance() method that instantiates the concrete subclass designated by the javax.xml.transform.TransformerFactory system property.
The default setting for this system property is org.apache.xalan.processor.TransformerFactoryImpl.
2. Use the TransformerFactory to process the stylesheet Source and produce a Transformer
The TransformerFactory newTransformer(Source xslSource) method processes the stylesheet Source into a Templates object and returns a Transformer that you can use to perform a transformation (apply the Templates object to an XML Source).
You may provide the stylesheet Source in the form of a stream of XML markup (StreamSource), a DOM Node (DOMSource), or a SAX InputSource (SAXSource). To specify a StreamSource, you may use a system ID or file name (using URI syntax), a java.io.InputStream, or a java.io.Reader. The use of DOMSource and SAXSource are illustrated in subsequent sections.
| If you plan to use the stylesheet Source to transform multiple XML Sources, you should use the TransformerFactory newTemplates(Source xslSource) method to explicitly generate a Templates object. For each transformation, use the Templates object to generate a new Transformer. For the details, see Multithreading. |
3. Use the Transformer to perform a transformation
Use the Transformer transform(Source xmlSource, Result transformResult) method to transform the XML Source and place the transformation output in a Result object.
Just as with the stylesheet, you can supply the XML Source in the form of a StreamSource, DOMSource, or SAXSource. Likewise, the Result may be a StreamResult, DOMResult, or SAXResult.
For each node in the XML source, the Transformer uses the transformation instructions in the Templates object to determine which template to apply: one of the templates in the Templates object, a default template rule as specified in the XSLT spec, or none.
Plugging in a Transformer and XML parser
The Java API for XML Processing interfaces enable you to isolate your application from the internal implementation details of a given Transformer, SAX parser, or DOM parser. For each of these objects, there is an abstract Factory class with a static newInstance() method that instantiates a concrete Factory which wraps the underlying implementation. These newInstance() methods use system property settings to determine which implementation to instantiate.
Xalan-Java is distributed with a system property setting for the Xalan-Java processor. This setting is in xalan.jar
in META-INF/services (see src/META-INF/services).
System property
Setting
javax.xml.transform.TransformerFactory
org.apache.xalan.processor.TransformerFactoryImpl
If you are using Xerces, the XML parser factory settings are as follows:
System property
Setting
javax.xml.parsers.DocumentBuilderFactory
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory
org.apache.xerces.jaxp.SAXParserFactoryImpl
You can change any of these settings as follows (in order of precedence):
- Set the system property from the command line when you launch Java or from within your application.
- Set the system property in jaxp.properties in the JAVA_HOME/lib directory, where JAVA_HOME is the root of the JDK.
- Revise the entry in src/META-INF/services and rebuild
xalan.jar
orxercesImpl.jar
, depending on which entry you have changed.
For example, to use the Crimson XML parser in place of the Xerces XML parser, place Crimson on the class path and set the
javax.xml.parsers.SAXParserFactory
system property to org.apache.crimson.jaxp.SAXParserFactoryImpl
.
For more information about the mechanism used to determine system property values and how you can plug other implementations into your applications, see "Section 3: Plugability Layer" in the Java API for XML Processing at JSR-000063 1.1.
Configuring serialization output properties
Output properties for XML, HTML, and text transformation output are defined in property files in the org.apache.xml.serializer package.
You can override the default value of these properties in your stylesheet by using the attributes of an xsl:output element. You can override the Xalan specific default settings as follows:
- Declare the xalan namespace in your stylesheet element (xmlns:xalan="http://xml.apache.org/xalan").
- Use the namespace prefix you assign (for example, "xalan") to redefine properties of interest in the stylesheet xsl:output element (for example, xalan:indent-amount="5").
The following stylesheet fragment declares the xalan namespace and sets indent-amount to 2:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan"> <xsl:output method="xml" encoding="UTF-8" indent="yes" xalan:indent-amount="2"/>
If you want to change the property settings globally, edit the values in the property files in src/org/apache/xml/serializer,
and use Ant to rebuild serializer.jar
. Be aware that if you change the default value
of a standard property, such as the default encoding value, this may be in conflict with the default value specified by the XSLT 1.0
recommendation.
The properties files define the following properties:
output_xml.properties :
| Property | Default value |
|---|---|
| version | 1.0 |
| encoding | UTF-8 |
| indent | no |
| omit-xml-declaration | no |
| standalone | no |
| media-type | text/xml |
| xalan:indent-amount | 0 |
| xalan:content-handler | org.apache.xml.serializer.ToXMLStream |
| xalan:entities | org/apache/xml/serializer/XMLEntities |
| The xalan:content-handler property specifies the default name of the Java class that implements the org.xml.sax.ContentHandler interface and recieves calls during result tree serialization. If you specify an alternate Java class it must implement the ContentHandler interface. |
You can also create your own XML entity file (mapping characters to
entities) or edit src/org/apache/xml/serializer/XMLEntities.properties and
rebuild serializer.jar . |
output_html.properties :
| Property | Default value |
|---|---|
| version | 4.0 |
| indent | yes |
| media-type | text/html |
| xalan:indent-amount | 0 |
| xalan:content-handler | org.apache.xml.serializer.ToHTMLStream |
| xalan:entities | org/apache/xml/serializer/HTMLEntities |
| xalan:use-url-escaping | yes |
| xalan:omit-meta-tag | no |
| The xalan:content-handler property specifies the default name of the Java class that implements the org.xml.sax.ContentHandler interface and recieves calls during result tree serialization. If you specify an alternate Java class it must implement the ContentHandler interface. |
You can also create your own HTML entity file (mapping characters to entities)
or edit src/org/apache/xml/serializer/HTMLEntities.properties and rebuild serializer.jar . |
output_text.properties :
| Property | Default value |
|---|---|
| media-type | text/plain |
| xalan:content-handler | org.apache.xml.serializer.ToTextStream |
| The xalan:content-handler property specifies the default name of the Java class that implements the org.xml.sax.ContentHandler interface and recieves calls during result tree serialization. If you specify an alternate Java class it must implement the ContentHandler interface. |
Caution: setting output encoding in the stylesheet
When you use the <xsl:output> encoding attribute to set output character encoding, you should not use StreamResult(java.io.Writer) to construct a StreamResult object to hold the transformation result. If you do, the Writer uses its own encoding rather than the encoding specified in the stylesheet.
If you want to use a Writer, you can specify an encoding when you create the Writer (java.io.OutputStreamWriter). Once the Writer exists, you cannot reset the encoding it uses.
Performing incremental transformations
The DTM (Document Table Model) supports incremental transformations, the incremental generation of the transformation result while the source document is still being parsed. For more information, see incremental transformations.
| You can also enable incremental transformations with the command-line utility by including the -INCREMENTAL flag. |
Working with embedded stylesheets
An XML Source may include an xml-stylesheet processing instruction which identifies the stylesheet to be used to process the document. As indicated by the processing instruction href attribute, the stylesheet itself may be embedded in the XML document or located elsewhere.
Suppose you have an XML document (foo.xml) with the following xml-stylesheet processing instruction:
<?xml-stylesheet type="text/xml" href="foo.xsl"?>
The following fragment uses this instruction to locate the stylesheet (foo.xsl in the same directory as foo.xml) and create a Templates object. Note the use of the TransformerFactory getAssociatedStylesheet() in step 2a.
| An XML document may include more than one xml-stylesheet processing instruction, hence the support for working with multiple stylesheets. If more than one stylesheet is returned, the other stylesheets are imported into the first stylesheet. |
// 1. Instantiate the TransformerFactory. javax.xml.transform.TransformerFactory tFactory = javax.xml.transform.TransformerFactory.newInstance(); // 2a. Get the stylesheet from the XML source. String media = null , title = null, charset = null; javax.xml.transform.Source stylesheet = tFactory.getAssociatedStylesheet (new StreamSource("foo.xml"), media, title, charset); // 2b. Process the stylesheet and generate a Transformer. Transformer transformer = tFactory.newTransformer(stylesheet); // 3. Use the Transformer to perform the transformation and send the // the output to a Result object. transformer.transform (new javax.xml.transform.stream.StreamSource("foo.xml"), new StreamResult (new java.io.FileOutputStream("foo.out")));
For a sample that uses this technique, see UseStylesheetPI.
You can also instruct the command-line utility to use stylesheet processing instructions:
- Include the
-in
flag with an XML source that contains a stylesheet processing instruction.
- Do not include the
-xsl
flag.
Serializing output
In some cases, you may want to "transform" a DOM tree into a stream, which the XML community calls serialization. JAXP 1.3 and the Xalan-Java Transformer implementation provide direct support for this operation. Simply use the TransformerFactory newTransformer() method (no arguments) to create a Transformer that you can use to "copy" a DOMSource to a StreamResult. For examples, see Examples.exampleDOM2DOM(), Examples.exampleSerializeNode(), and Examples.exampleAsSerializer() in the trax (JAXP transform) sample.
Setting stylesheet parameters
An XSLT stylesheet may include parameters that are set at run time each time a transformation is performed. To set a stylesheet parameter, use the Transformer setParameter(String name, Object value) method. For a working example, see UseStylesheetParam.java in the samples/UseStylesheetParam subdirectory.
You can also set a parameter with the command-line utility by including the -param
flag. For example:
java org.apache.xalan.xslt.Process -in foo.xml -xsl foo.xsl -param param1 foobar
where param
is the parameter name and foobar
is the parameter value. The parameter namespace is null.
| Xalan-Java 2 processes string parameters. You are no longer required (as you were with Xalan-Java version 1) to enclose strings in single quotes (') as string expressions. |
Explicitly working with SAX
Xalan-Java uses the SAX event model to process stylesheets, to parse XML input documents, and to produce output. For each of these operations, an XMLReader reads input, firing parse events, and a ContentHandler listens to the XMLReader and executes parse event methods.
When you use the basic procedure described above for performing transformations, Xalan-Java takes care of many of the SAX details under the covers. You are free to make these details explicit, which simply means that you can intervene in the procedure to accommodate the precise environment in which your application operates.
Suppose, for example, you are using a custom XMLReader (perhaps for doing more than just parsing static XML documents) to generate Xalan-Java SAX parse events. You might even have a custom reader for producing/processing stylesheets. You can cast the TransformerFactory to a SAXTransformerFactory, which provides access to a TransformerHandler, which you can set as the ContentHandler for this reader.
The following example explicitly sets up the XMLReader and ContentHandlers, and replicates the basic steps described above.
// Instantiate a TransformerFactory. javax.xml.transform.TransformerFactory tFactory = javax.xml.transform.TransformerFactory.newInstance(); // Verify that the TransformerFactory implementation you are using // supports SAX input and output (Xalan-Java does!). if (tFactory.getFeature(javax.xml.transform.sax.SAXSource.FEATURE) && tFactory.getFeature(javax.xml.transform.sax.SAXResult.FEATURE)) { // Cast the TransformerFactory to SAXTransformerFactory. javax.xml.transform.sax.SAXTransformerFactory saxTFactory = ((javax.xml.transform.sax.SAXTransformerFactory) tFactory); // Create a Templates ContentHandler to handle parsing of the // stylesheet. javax.xml.transform.sax.TemplatesHandler templatesHandler = saxTFactory.newTemplatesHandler(); // Create an XMLReader and set its ContentHandler. org.xml.sax.XMLReader reader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader(); reader.setContentHandler(templatesHandler); // Parse the stylesheet. reader.parse("foo.xsl"); // Get the Templates object (generated during the parsing of the stylesheet) // from the TemplatesHandler. javax.xml.transform.Templates templates = templatesHandler.getTemplates(); // Create a Transformer ContentHandler to handle parsing of // the XML Source. javax.xml.transform.sax.TransformerHandler transformerHandler = saxTFactory.newTransformerHandler(templates); // Reset the XMLReader's ContentHandler to the TransformerHandler. reader.setContentHandler(transformerHandler); // Set the ContentHandler to also function as a LexicalHandler, which // can process "lexical" events (such as comments and CDATA). reader.setProperty("http://xml.org/sax/properties/lexical-handler", transformerHandler); // Set up a Serializer to serialize the Result to a file. org.apache.xml.serializer.Serializer serializer = org.apache.xml.serializer.SerializerFactory.getSerializer (org.apache.xml.serializer.OutputPropertiesFactory.getDefaultMethodProperties ("xml")); serializer.setOutputStream(new java.io.FileOutputStream("foo.out")); // The Serializer functions as a SAX ContentHandler. javax.xml.transform.Result result = new javax.xml.transform.sax.SAXResult(serializer.asContentHandler()); transformerHandler.setResult(result); // Parse the XML input document. reader.parse("foo.xml");
| If you want to perform multiple transformations with the same Templates object and a TransformerHandler, you must create a new TransformerHandler for each transformation. The Xalan-Java implementation of TransformerHandler (TransformerHandlerImpl fails to respond to events after the first endDocument event occurs. |
Using transformation output as input for another transformation
You can chain together a series of transformations such that the output of each transformation provides input for the next transformation. Xalan-Java supports two basic strategies for chaining a series of transformations:
- Use the SAXTransformerFactory to process the stylesheet and create a TransformerHandler for each transformation. Then you can set
the first TransformerHandler as the ContentHandler for the XMLReader that parses the input, make the second TransformerHandler the ContentHandler for the output of the first TransformerHandler, and so on. For more detail and an example, see the Pipe sample.
- Use the SAXTransformerFactory to process the stylesheet and create a SAX XMLFilter for each transformation. Set an XMLReader as the parent of the first XMLFilter, the first XMLFilter as the parent of the second XMLFilter, and so on. You launch the series of transformations by instructing the last XMLFilter to parse the XML Source for the first transformation. For more detail and an example, see the UseXMLFilters sample.
Processing and producing DOM trees
In some cases, the input and/or desired output for a transformation may be a DOM tree object. The javax.xml.transform.DOM package provides DOMSource and a DOMResult, either or both of which you can use when you perform a transformation.
In some cases, your application provides input in the form of a DOM tree, which accelerates the transformation process, since the input has in effect already been processed. To produce DOM input from a stream, you can use a DocumentBuilderFactory to produce a DocumentBuilder with which you can parse the XML input into a DOM Document, as illustrated below.
// Instantiate a DocumentBuilderFactory. javax.xml.parsers.DocumentBuilderFactory dfactory = javax.xml.parsers.DocumentBuilderFactory.newInstance(); // Use the DocumentBuilderFactory to provide access to a DocumentBuilder. javax.xml.parsers.DocumentBuilder dBuilder = dfactory.newDocumentBuilder(); // Use the DocumentBuilder to parse the XML input. org.w3c.dom.Document inDoc = dBuilder.parse("foo.xml");
To produce DOM output, simply use a Transformer to transform to a DOMResult object.
// Generate a Transformer. javax.xml.transform.Transformer transformer = tFactory.newTransformer (new javax.xml.transform.stream.StreamSource("foo.xsl")); // Create an empy DOMResult object for the output. javax.xml.transform.dom.DOMResult domResult = new javax.xml.transform.dom.DOMResult(); // Perform the transformation. transformer.transform(new javax.xml.transform.dom.DOMSource(inDoc), domResult); // Now you can get the output Node from the DOMResult. org.w3c.dom.Node node = domResult.getNode();
| Create a new DOMResult object or use DOMResult.setNode() to assign a new container each time you want to perform a transformation and place the output in a DOMResult object. |
The DOM2DOM illustrates both procedures, and serializes the DOMResult to System.out.
Working with XPath expressions
XSLT stylesheets use XPath expressions to select nodes, specify conditions, and generate text for the result tree. XPath provides an API that you can call directly. For example, you may want to evaluate an XPath expression programmatically and do your own processing without a stylesheet.
XPath is an independent entity, with clients other than XSLT processors (such as XPointer). Accordingly, Xalan-Java 2 has packaged XPath as a separate module (org.apache.xpath and its subpackages). The org.apache.xpath.XPathAPI class contains convenience methods that you can use to return single DOM Nodes, NodeIterators, and XObjects. Apart from their own functionality, these methods also provide a path into the lower-level XPath API that you may find useful.
JAXP 1.3 also provides an API for xpath expression evaluation in the javax.xml.xpath package. Users are recommended to use the new JAXP 1.3 XPath API rather than the old Xalan-Java 2 specific XPath API.
For an example that uses the Xalan-Java 2 specific XPathAPI to execute XPath expressions against XML source files, see ApplyXPath. For examples on how to use the new JAXP 1.3 XPath API, see ApplyXPathJAXP and XPathResolver.
Using the Xalan-Java applet wrapper
- Include XSLTProcessorApplet in an HTML client.
- Specify the XML source document and XSL stylesheet.
You can use the DocumentURL and StyleURL PARAM tags or the setdocumentURL() and setStyleURL() methods. If the XML document contains a stylesheet Processing Instruction (PI), you do not need to specify an XSL stylesheet.
- Call the transformToHtml() or getHtmlText() method, which performs the transformation and returns the new document as a String.
| The transformToHTML() method takes arguments for the XML source document and XSL stylesheet. The getHtmlText() method takes no arguments: it uses property or parameter settings, as in the example below. |
For an example, see the AppletXMLtoHTML sample applet. The <applet> tag is in samples/AppletXMLtoHTML/client.html:
<applet name="xslControl" code="org.apache.xalan.client.XSLTProcessorApplet.class" archive="../../xalan.jar,../../build/xalan.jar,../../serializer.jar,../../build/serializer.jar,../../lib/xml-apis.jar,../../lib/xercesImpl.jar" height="0" width"0"> <param name="documentURL" value="xalanApplets.xml"/> <param name="styleURL" value="s1ToHTML.xsl"/> </applet>
When the user clicks the Transform button, the HTML client calls the getHtmlText() method, and puts the returned HTML text in a frame for the user to view.
For samples, see AppletXMLtoHTML.
Problems with Netscape
The JAXP strategy of reading system properties generates SecurityExceptions when you attempt to run Xalan-Java applets in the Netscape Communicator 4.7.
Stuart Connell<EMAIL_ADDRESS>reports that the Xalan-Java applet wrapper does work in Netscape Communicator 6, provided that you avoid calls to the AppletContext showStatus() method. In other words, you can remove the showStatus() calls from org.apache.xalan.client.XSLTProcessorApplet, and run Xalan-Java applets from Netscape Communicator 6. This appears to be a Netscape bug, which hopefully will be fixed soon. For more information, see Bugzilla bug 3231.
Using Xalan-Java in a servlet
You can set up a servlet to use Xalan-Java to respond to requests for XML documents by transforming those documents into HTML and serving them to web browsers. To respond to HTTP GET requests, all you need to do is overwrite the HttpServlet doGet() method with a procedure that instantiates a Transformer and uses it to perform a transformation. As the following example shows, you can generate a ResultStream that a PrintWriter writes to the HttpResponse OutputStream, returning the transformation output to the web browser.
public class SampleXSLTServlet extends javax.servlet.http.HttpServlet { public final static String FS = System.getProperty("file.separator"); // Respond to HTTP GET requests from browsers. public void doGet (javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException { // Set content type for HTML. response.setContentType("text/html; charset=UTF-8"); // Output goes to the response PrintWriter. java.io.PrintWriter out = response.getWriter(); try { javax.xml.transform.TransformerFactory tFactory = javax.xml.transform.TransformerFactory.newInstance(); //get the real path for xml and xsl files. String ctx = getServletContext().getRealPath("") + FS; // Get the XML input document and the stylesheet, both in the servlet // engine document directory. javax.xml.transform.Source xmlSource = new javax.xml.transform.stream.StreamSource (new java.net.URL("file", "", ctx+"foo.xml").openStream()); javax.xml.transform.Source xslSource = new javax.xml.transform.stream.StreamSource (new java.net.URL("file", "", ctx+"foo.xsl").openStream()); // Generate the transformer. javax.xml.transform.Transformer transformer = tFactory.newTransformer(xslSource); // Perform the transformation, sending the output to the response. transformer.transform(xmlSource, new javax.xml.transform.stream.StreamResult(out)); } // If an Exception occurs, return the error to the client. catch (Exception e) { out.write(e.getMessage()); e.printStackTrace(out); } // Close the PrintWriter. out.close(); } }
For a working sample, see SimpleXSLTServlet.
In the preceding example, the URLs for the XML document and XSL stylesheet are hardcoded in the servlet. You can also create a servlet that parses the request URL for input parameters specifying the XML document, XSL stylesheet, and any relevant stylesheet parameters. For samples, see UseStylesheetParamServlet and XSLTServletWithParams. For a more robust and complex sample that also employs a properties file to determine which stylesheet to use depending on the client browser/device, see ApplyXSLT.
Creating and using extensions
For those cases where you want to be able to call procedural code from within a stylesheet, the Xalan-Java Extensions facility supports the creation of extension elements and extension functions. See Extensions and Extensions samples.
Multithreading
A given Templates object may be used repeatedly and even in multiple threads running concurrently for the transformation of XML input, but you should use the Templates object to instantiate a separate Transformer for each transformation you perform. The Templates object is an immutable runtime representation of the structure and content of a stylesheet (which may include and import multiple stylesheet sources). A Transformer, on the other hand, is a lightweight object that tracks state information during the transformation, and should only be used to perform a single transformation.
If you want to perform multiple transformations (sequentially or concurrently) with the same stylesheet instructions, do the following:
- Use the TransformerFactory newTemplates(Source xslSource) method to create a Templates object.
- For each transformation, use the Templates object newTransformer() method to create a Transformer, and use that Transformer's transform(Source xmlSource, Result transformResult) method to perform the transformation.
For an example, see Examples.exampleUseTemplatesObj() in the trax sample.
Debugger Interface
Xalan-Java contains a debugger interface in the org.apache.xalan.xslt.trace package:
-
TraceListener is an interface that debuggers
can implement. Or, like the command-line utility, you can use the PrintTraceListener implementation of that interface.
- You can register a TraceListener with the
TraceManager associated
with the Transformer that will perform a given transformation.
-
TracerEvent is an event that is
passed to the TraceListener.trace() function. It is called before a node is 'executed' in the stylesheet.
-
GenerateEvent is an event that is
passed to the TraceListener.generated() function. It is called after an event occurs to create something in the result
tree.
- SelectionEvent is an event triggered by the selection of a stylesheet node.
-
ExtensionEvent is an event that is
passed to the TraceListener.extension() function. It is called before an extension call is made.
The command-line utility uses the debugger interface when you include one or more of the
following switches: -TT
, -TG
, -TS
, -TTC
.
Example:
import org.apache.xalan.transformer.TransformerImpl; import org.apache.xalan.trace.TraceManager; import org.apache.xalan.trace.PrintTraceListener; ... // Set up a PrintTraceListener object to print to a file. java.io.FileWriter fw = new java.io.FileWriter("events.log"); java.io.PrintWriter pw = new java.io.PrintWriter(fw); PrintTraceListener ptl = new PrintTraceListener(pw); // Print information as each node is 'executed' in the stylesheet. ptl.m_traceElements = true; // Print information after each result-tree generation event. ptl.m_traceGeneration = true; // Print information after each selection event. ptl.m_traceSelection = true; // Print information whenever a template is invoked. ptl.m_traceTemplates = true; // Print information whenever an extension is called. ptl.m_traceExtension = true; // Set up the transformation javax.xml.transform.TransformerFactory tFactory = javax.xml.transform.TransformerFactory.newInstance(); javax.xml.transform.Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource ("foo.xsl")); // Cast the Transformer object to TransformerImpl. if (transformer instanceof TransformerImpl) { TransformerImpl transformerImpl = (TransformerImpl)transformer; // Register the TraceListener with the TraceManager associated // with the TransformerImpl. TraceManager trMgr = transformerImpl.getTraceManager(); trMgr.addTraceListener(ptl); // Perform the transformation --printing information to // the events log during the process. transformer.transform ( new javax.xml.transform.stream.StreamSource("foo.xml"), new javax.xml.transform.stream.StreamResult (new java.io.FileWriter("foo.out")) ); } // Close the PrintWriter and FileWriter. pw.close(); fw.close();
For a sample application that uses this technique, see Trace.


GUARDING TESS A film review by James Berardinelli Copyright 1994 James Berardinelli
Rating (Linear 0 to 10): 5.7
Date Released: 3/11/93 Running Length: 1:35 Rated: PG-13 (Mature themes, language)
Starring: Nicolas Cage, Shirley MacLaine, Austin Pendleton, Richard Griffiths, James Rebhorn, Edward Albert Director: Hugh Wilson Producers: Ned Tanen and Nancy Graham Tanen Screenplay: Hugh Wilson and Peter Torokvei Music: Michael Convertino Released by TriStar Pictures
How many different spins have their been on the "buddy film"? >From THE ODD COUPLE to LETHAL WEAPON, it seems that just about every angle on this subject has been covered. Then along comes a movie like GUARDING TESS that thinks it has a unique twist to this tried-and-true theme. However, an unusual pairing doesn't equate to a noteworthy picture.
Since the death her late husband the President, former First Lady Tess Carlisle (Shirley MacLaine) has been living in a house in Sommersville, Ohio, under the watchful eye of Secret Service agent Doug Chesnick (Nicolas Cage) and his team of six men. Just when Doug thinks his term of duty is over, Tess requests that he return for another three years, and what Tess wants, Tess gets. So, against his will (his alternative is the unemployment line), Doug remains in Sommersville, where his already- brittle relationship with the aging widow turns into an open contest of wills.
DRIVING MISS DAISY did it much better, but there are some shared themes between the 1989 Academy Award winning film and Hugh Wilson's GUARDING TESS. Both are about two mismatched people coming to know and appreciate each other, and eventually realizing how important their relationship is. This, the central theme of every "buddy film," lies at the core of GUARDING TESS. Only the details surrounding it have changed to fit the situation.
The story is not especially original. Mostly predictable, GUARDING TESS is light on surprises, but that's a given for any film that falls even loosely into a formula category. Slow to start with, the movie eventually slips into a flow, but the ending is burdened by a poorly-reasoned and rather silly kidnapping subplot. Don't think too hard during this part, because a lot of what goes on doesn't make much sense.
The comedy is mostly low-key, and much of it works. Coming from writer/director Hugh Wilson, the man behind the original POLICE ACADEMY, it's nice to find a motion picture whose laugh-to-joke ratio is relatively high. GUARDING TESS relies far more on verbal jousting and body language than on slapstick and other ridiculous gags.
Nicolas Cage carries the movie. The energy and audience involvement all come as a result of his engaging performance. Normally know for his manic on-screen antics, it's interesting to see Mr. Cage play a restrained role. The harnessed emotion is always there, just beneath the surface, waiting to break free.
Shirley MacLaine does a reasonable job as Tess, and holds her own in scenes with her co-star, although her magnetism isn't as palpable as his. The rest of the cast, including such familiar names as Austin Pendleton and James Rebhorn, provide fine supporting work.
Ultimately, while GUARDING TESS is a genial comedy that provides a reasonable ninety-five minutes' entertainment, it's sadly lacking in originality. There are a few good jokes, some nice chemistry between the two leads, a little character development, and a little pathos, but it all doesn't add up to very much. The ingredients are there, but the final product wasn't prepared to its best advantage.
- James Berardinelli<EMAIL_ADDRESS>.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


John McGinn on Aston Villa myths he's debunked and the Jack Grealish hobby he doesn't rate
The midfielder is loving proving everyone wrong in the Premier League.
by Scott McDermott, https://www.dailyrecord.co.uk/authors/scott-mcdermott/A rat and a runner – that’s how John McGinn viewed himself when he played in Scotland.
As humble a footballer as you’ll come across, self-deprecation comes naturally to him.
But that’s how he was pigeonholed as a kid at St Mirren and later on at Hibs.
A grafter, an ankle biter, a midfield buzz-bomb who got around the pitch at 100mph.
But watch him now for Aston Villa, playing further forward in Dean Smith’s side and supporting his front players.
Sure, he’s still got the energy and work ethic he’s always had.
But it’s more controlled now, more measured.

Instead, McGinn has learned to pick his moments.
With the likes of Jack Grealish and Douglas Costa beside him in Villa’s engine room, he can afford to.
And he’s reaping the benefits. Not only is he building a reputation as one of the Premier League’s top midfielders, he’s also cemented his place in Steve Clarke’s Scotland line-up.
Now the national boss is also deploying him in an advanced role – which saw him net three against San Marino in October and one against Cyprus yesterday.
McGinn would have laughed if you’d called him a creative, attacking midfielder a few years ago.
But not now. Thanks to Smith’s coaching, quality team-mates and the intensity of England’s top-flight, he has changed his game.
And as McGinn prepares to take on Kazakhstan at Hampden on Tuesday night, the 25-year-old said: “If you thought I could play further forward a few years ago, I’d have laughed.
“I probably got sucked into the idea in Scotland that I was just a rat and a runner.
“But Dean has given me the confidence to get involved higher up the park and I’m enjoying it.
“I’m still learning and I have so much to improve on if I want to play in that position at Premier League level.
“But it’s good that I’m getting games there at my club to hopefully benefit me with Scotland.
“When I played for Hibs, it was probably the most erratic I’ve ever been. But at Villa, you’re not allowed to do that. You have a certain role in the team.
“At Hibs, there were times when I tried to do a lot of things myself.
“I wasn’t as well drilled or coached as I am now. I’ve learned more about the game down here.
“I pick my times not to go and chase opponents. I used to do it too much.
“Now, I just listen to the coaches. The manager has been brilliant for me. He’s told me to trust in myself and show a bit of character.
“I feel I’ve added that to my game now. It’s hard to get a
balance because I don’t want to lose what I’m known for, the energy and bustle.
“I need to be the same type of player – but fine tune it. Down south, you see players getting older with so much coaching and they’re scared to do things.
“I’m not keen to be overly coached and I still want to separate myself from other players in the league because I definitely feel I can offer something different.
“Don’t ask about my shooting, though. I shoot a lot more now and get pelters off the lads for it.
“But I need to get my fantasy football points up.”
McGinn’s humour is just one of the reasons why he’s now one of the most popular figures in the Aston Villa dressing room.
A blossoming friendship with Villa skipper and England hopeful Grealish is testament to that.
His impact should be proof that Scotland can boast talented players but McGinn admits that it’s still a battle convincing some people.
He said: “Their criticism of Scottish football doesn’t hurt me. It gives me motivation
to prove them wrong every weekend.
 But we know we
have the ability in the squad to change that.
“English people’s view of the Scottish game is something I don’t think we’ll ever change.
“But Celtic and Rangers’ results against the likes of Lazio and Porto in Europe helps me an awful lot when I go to training on a Friday morning.
“Jack is someone I’ve hit it off with. We have similar interests. Not sunbeds, though – he’s the good looking one.
“But we both love our football so we stay at the training ground to do a bit extra or watch games when they’re on.
“He’s just a good guy. I get on with most of the boys but he’s of a similar age so I cut about with Jack a lot.”
One of those poor Scotland results McGinn talks about was the 3-0 humiliation in Kazakhstan that kicked off our dismal Euro 2020 campaign.
That defeat all but ended our hopes of qualifying via the conventional route – and signalled the end of Alex McLeish’s second reign as gaffer.
For McGinn, it was his worst night in a dark blue shirt – and it’s why he’s determined to put it right in midweek.
He said: “That night was probably the lowest point in my Scotland career.
“It was such an important game but the Scotland team went down without a whimper.
“It still hurts and is a massive reason why we can’t qualify from the group. It couldn’t have gone any worse.
“This game gives us an opportunity to put it right.
“All the Scottish fans want to see are players giving everything.
“We’ve not given them enough to smile about and that’s what we want to change.”


This is an example with angular-ngrx-material-starter + graphql apollo client
git clone https://github.com/anthowm/graphqlpetapi-frontend.git
npm install
npm run start


To facilitate the comparison between different approaches and systems, the workshop was preceded by an open challenge in question answering on DBpedia 3.6 and MusicBrainz.
qald-1-challenge.pdf (last updated: March 28, 2011)
DBpedia:
MusicBrainz (RDF export):
Training questions:
Test questions without annotations:
Test questions with annotations:


Legendary British rockers Iron Maiden announce Dubai date for world tour
DUBAI: Egyptian actor Haitham Ahmed Zaki, son of the late acting legend Ahmed Zaki, died at the age of 35 in Cairo on Thursday.
Police reports said Haitham’s fiancee tried to call him several times without response, according to local media. He was later found dead.
Ahmed Zaki died of cancer. (AFP)
Haitham started his acting career in 2006 when he debuted in the movie “Halim,” a biopic about the Egyptian singer Abdel Halim Hafez.
Production started in 2005 with his father Ahmed co-starring as the lead actor, but Haitham later filled in for Ahmed after he passed away on March 27, 2005, prior to the film’s completion.
Haitham’s mother Hala Fouad, who was an actress, also died at the age of 35, of cancer.
Footage of a Pepsi commercial from 2015 that had been edited to show Haitham 's father in the advertising has been circulated by Arab social media accounts.


“Ayoniso manasikārā,
kāmarāgena aṭṭitā;
Ahosiṁ uddhatā pubbe,
citte avasavattinī.
Due to improper attention,
I was racked by desire for pleasures of the senses.
I was restless in the past,
lacking control over my mind.
Pariyuṭṭhitā klesehi,
subhasaññānuvattinī;
Samaṁ cittassa na labhiṁ,
rāgacittavasānugā.
Overcome by corruptions,
pursuing perceptions of the beautiful,
I gained no peace of mind.
Under the sway of lustful thoughts,
Kisā paṇḍu vivaṇṇā ca,
satta vassāni cārihaṁ;
Nāhaṁ divā vā rattiṁ vā,
sukhaṁ vindiṁ sudukkhitā.
thin, pale, and wan,
for seven years I wandered,
full of pain,
finding no happiness by day or night.
Tato rajjuṁ gahetvāna,
pāvisiṁ vanamantaraṁ;
Varaṁ me idha ubbandhaṁ,
yañca hīnaṁ punācare.
Taking a rope
I entered deep into the forest, thinking:
“It’s better that I hang myself
than I return to a lesser life.”
Daḷhapāsaṁ karitvāna,
rukkhasākhāya bandhiya;
Pakkhipiṁ pāsaṁ gīvāyaṁ,
atha cittaṁ vimucci me”ti.
I made a strong noose
and tied it to the branch of a tree.
Casting it round my neck,
my mind was freed.
… Sīhā therī ….


Computes scores from Q-sort data, using criteria sorts and derived scales from subsets of items. The 'qsort' package includes descriptions and scoring procedures for four different Q-sets commonly used in developmental psychology research: Attachment Q-set (version 3.0) (Waters, 1995, <doi:10.1111/j.1540-5834.1995.tb00214.x>); California Child Q-set (Block and Block, 1969, <doi:10.1037/0012-16<IP_ADDRESS>8>); Maternal Behaviour Q-set (version 3.1) (Pederson et al., 1999, <https://ir.lib.uwo.ca/cgi/viewcontent.cgi?article=1000&context=psychologypub>); Preschool Q-set (Baumrind, 1968 revised by Wanda Bronson, <doi:10.1111/j.1540-5834.1995.tb00214.x>).
| Version: | 0.2.3 |
| Depends: | R (≥ 2.10) |
| Imports: | cowplot, ggplot2, gridExtra, purrr, stats |
| Suggests: | devtools, knitr, roxygen2, rmarkdown |
| Published: | 2018-10-26 |
| Author: | David N Sousa [aut, cre], João R Daniel [aut] |
| Maintainer: | David N Sousa <davidnsousa at gmail.com> |
| License: | GPL-3 |
| NeedsCompilation: | no |
| Materials: | README NEWS |
| CRAN checks: | qsort results |
| Reference manual: | qsort.pdf |
| Vignettes: |
qsort R package: A Tool for Scoring Q-sort Data |
| Package source: | qsort_0.2.3.tar.gz |
| Windows binaries: | r-devel: qsort_0.2.3.zip, r-release: qsort_0.2.3.zip, r-oldrel: qsort_0.2.3.zip |
| OS X binaries: | r-release: qsort_0.2.3.tgz, r-oldrel: qsort_0.2.3.tgz |
| Old sources: | qsort archive |
Please use the canonical form https://CRAN.R-project.org/package=qsort to link to this page.


Find Github Repositories!
Find out information about a person's public repositories on Github.
Username
Find!
Public Repositories


focus-trap demo
In the demos below, you'll be able to tell that a focus trap is active because it will turn pink. You should also be able to tell because it will trap your focus!
When a trap is active, you can deactivate it by pushing its deactivate button or, if the demo allows, pressing the Escape key.
Before you try the demos, if you're using macOS, make sure you have enabled keyboard navigation in order to use the Tab key to move focus between all controls.
In Ventura (v13), you'll find this under System Settings > Keyboard
.
Prior to Ventura, it may have been under System Settings > General
.
FireFox and Safari, for example, respect this setting and without it enabled, you won't get a good experience. Chrome appears to ignore it (at least in v109). While focus-trap will still trap all the right nodes, the browser/OS will not let you access all tabbable nodes on the page, nor in any traps you activate, while using the Tab key.
animated dialog
This focus trap will fade in when activated and fade out when deactivated. Once the trap has been activated
(i.e. onPostActivate
), a "trap activated" message appears next to the Activate button.
Note that the fade animation needs to be written yourself, it is not built into the library.
Trap activated
animated trigger
The activation button for this focus trap will fade out when the trap activates and fade in when the trap deactivates.
If the returnFocus
option is true
, the activation button will receive focus after the trap deactivates.
If the returnFocus
option is false
, the Deactivate button will retain focus after deactivation because that is the last element that was clicked prior to deactivation.
Once the trap has been deactivated (i.e. onPostDeactivate
), a "trap deactivated" message appears next to the "returnFocus" option.
Note that the fade animation needs to be written yourself, it is not built into the library.
Trap deactivated
configurable escape behavior
This focus trap leverages the escapeDeactivates
option as a function
rather than a boolean. By default, pressing ESC will deactivate the trap, but while the trap
is active, you can check or uncheck the option, and the ESC key will behave accordingly.
Since the escapeDeactivates
option received the related KeyboardEvent
,
it could be used to programmatically decide if the ESC key should allow the trap to be
deactivated, perhaps based on the node that's currently focused, or some other condition.
initial element, no escape
If initialFocus
is a selector or DOM node, focus will jump to that specified element when the trap activates.
If initialFocus
is false
(or a function that returns false
), no element will be given focus when the trap activates.
initialFocus
is set to the first tabbable element by default.
Also, in this demo the Escape key does not deactivate the focus trap. You must click the button.
initially focused container
When this focus trap activates, initial focus is on the containing element (which has tabindex="-1"
and is therefore not tabbable).
When you tab through the trap, focus does not return to the containing element.
Also, clicking on an outside element automatically deactivates this trap.
hidden treasures
Focusable nodes are initially hidden and then revealed within the trap.
Use Escape to exit.
sibling traps
Sibling focus traps. When the second trap is deactivated, focus returns to the first trap.
tricky initial focus
In this focus trap, the single focusable button is hidden (the ones you see at first have tabindex="-1"
).
If you activate the trap in this state, the fallbackFocus
option is used to focus the container.
If, however, you first make the focusable button visible by clicking "show focusable button", that button will receive focus when you activate the trap.
input activation
Any change to the input content triggers automatic activation of the focus trap, without changing selection within the input.
delay
focus-trap ensure that the placement of focus within the trap is slightly delayed, so the focused element does not capture the event that originated the activation of the focus trap. For example, the same Enter keystroke won't open and close this trap.
No delay
focus-trap ensure that the placement of focus within the trap is not delayed, so the focused element captures the event that originated the activation of the focus trap.
radio group
A default focus trap that contains a radio group. You should be able to change the radio group with the arrow keys, but Tab should only focus the active radio. (Notice that you need a checked radio in the group for things to work as expected.)
iframe
This focus trap contains an iframe. You should be able to tab into and out of the iframe. But you need to have a focusable element before and after the iframe for things to work as expected.
working inside an iframe
This focus trap can be executed inside an iframe. You should be able to trap the focus inside. You need to have provided the iframe document to the focus-trap before for things to work as expected.
⚠ As it executes inside the iframe, it cannot prevent clicks on links in the parent document. This is the same drawback as you might experience when putting a focus-trap inside a Shadow DOM.
inside an open shadow dom
This focus trap is instantiated inside an open Shadow DOM. Some users of this library use Web Components to create things like modal dialogs, which means focus needs to be trapped inside the Shadow DOM instance.
When the mouse is clicked on an element inside an open Shadow DOM,
the target node in event.target
is always the shadow host (the node to
which the shadow is attached). Fortunately, event.composedPath()
, a
modern API on the event object, allows focus-trap to determine the actual node that
was clicked inside the shadow.
⚠ focus-trap is unable to work with closed Shadow DOMs because
event.composedPath()
can't see inside it. In this case, both this
modern API and event.target
point to the shadow host as the actual
element that was clicked, and focus-trap will always determine that the click was
outside the trap (and either prevent it, or always deactivate the trap when the
clickOutsideDeactivates
option is true).
⚠ See the warning about selector string options when putting a focus trap inside an open Shadow DOM.
with shadow dom
This focus trap contains tabbable elements that are inside
open and closed Shadow DOMs. It configures tabbable
to look for Shadow DOM
elements and provides a reference to the closed Shadow when requested.
allowOutsideClick option
This focus trap can be closed also by clicking a button outside of the trap that is able to control the trap (which is the "activate trap" button in this example). ESC is disabled for this trap.
NOTE: This is different from the clickOutsideDeactivates where merely clicking outside the trap would cause it to be deactivated. In this example, the outside click must take place on the "activate/deactivate trap" button, whose click event handler will programmatically deactivate the trap.
clickOutsideDeactivates option
This focus trap can be closed simply by clicking anywhere outside, and the click outside will also go through and do what it was intentionally dispatched to do (like toggling the checkbox). ESC is disabled for this trap.
The returnFocusOnDeactivate
option controls whether focus should be returned to the last-focused element when the trap was activated (the "activate trap" button in this demo) or not:
- If this option is
true
(the default behavior), even if you click on a focusable node outside the trap (like the checkbox), while the click will go through to toggle the checkbox, it will not be focused once the trap is fully deactivated. Focus will return to the "activate trap" button. - If
false
, then it doesn't matter what you click on (focusable or not), focus will go away from the trap to where you clicked, or to nowhere if you clicked on something not focusable (like the page/document or a heading). So if you click on the checkbox, it will remain focused once the trap is fully deactivated.
setReturnFocus option
With setReturnFocus it is possible to overwrite the returnFocusElement.
setReturnFocus as function
As the function is executed in the process of deactivation, it allows you to dynamically specify which element should be focused after deactivation.
Once the trap is activated, you can still click on one of the 3 deactivate buttons below in order to deactivate the trap.
multiple elements
You can pass multiple elements, and the focus will be kept within those element boundaries (darker color). Clicking outside deactivates.
multiple elements with delete
Pass multiple elements. Update the tabbable nodes in any of those elements on the fly, ensuring there's always at least one container with at least one tabbable node in it at all times.
multiple elements with delete ALL
Pass multiple elements. With the fallbackFocus option configured to the "deactivate trap" button, remove ALL nodes in all trap containers to have the focus fall back to the "deactivate" button on the next tab key press.
Container 1
Container 2
Not in trap (fallback; clicks allowed)
multiple traps with multiple elements
You can have multiple traps with multiple elements. Each trap's elements are in a darker color when their associated trap is active. Clicking outside on the activate and deactivate trap buttons is allowed.
Negative tabindex
This trap has an element with a negative tabindex in the middle, which means that element is focusable but not tabbable. Use the mouse to set focus to it. Once it has focus, you can still use the tab key to go forward or backward in the normal tab order.
Negative tabindex last
This trap has an element with a negative tabindex and it's the last element, which means that element is focusable but not tabbable. Use the mouse to set focus to it. Once it has focus, you can still use the tab key to go forward or backward in the normal tab order.
Positive tabindex
This trap has 3 buttons which have a positive (greater than 0) tabindex attribute. Per tab order rules, they should get focused first (in 1-2-3 order tabbing forward), then all tabbable nodes without a tabindex attribute (the 3 links, "tabindex 0" and "tabindex ?") should get focused in document position order. The same should happen in reverse when shift+tabbing.
❗ Positive tabindex support is limited to single-container traps. It
is also not 100% accurate to browser behavior in one edge case, which is when tabbing
from a negative tabindex node (focusable, not tabbable). In this case,
browsers will set focus to the next tabbable node in document position order,
regardless of tabindex
value (zero or positive). Focus-trap, however, will
set focus to the next tabbable node in DOM order. Most of the time, the
result will be the same, but there may be slight differences.
⚠ Using positive tab indexes is not recommended, primarily for accessibility reasons.
⚠ Tabbing from the last positive tabindex node leading to a zero/default tabindex node
will cause a momentary focus escape which focus-trap will identify and rectify
to keep tab order working as expected. This momentary escape, however, means some node outside
the trap will get focused before focus-trap is able to pull focus back into the trap. If that
node is out of view, this may cause the window to scroll to it, not to mention the
focus
event this outside node will unavoidably receive.
With open web component
This trap contains an element which is defined in an open web component (i.e. a web component with an open Shadow DOM).
Global trap stack
Use window to have access to trap stack. This allows to have more than one focus-trap library version in the same page.
Customized keyboard navigation
This trap uses the isKeyForward()
and isKeyBackward()
options to enable the use of the j
(backward) and k
(forward)
keys to navigate the trapped elements using the keyboard.
💬 The tab
key still works, but not completely, as it's no longer managed by
the trap. To make full use of these options, the tab
key should be
suppressed entirely or handled differently. You might use these options in a dropdown
list where you're moving focus between items using the arrow keys while reserving the
tab
key for moving beyond the dropdown itself.
works with inert elements
This trap contains an inert button. Browsers that support this new HTML attribute will render it completely non-interactive, and focus-trap will ignore it too.
⚠ Check the
browser compatibility
for the browser you're using right now before trying this demo. It will not work properly
if your browser doesn't support the inert
attribute.
Keeps focus when removing DOM elements
If the currently focused elemented is removed from the DOM, the
focus can move to the document body
.
focus-trap ensures that focus remains within the trap.


|
Nome
arrow_drop_up
arrow_drop_down
|
Endereço
arrow_drop_up
arrow_drop_down
|
|
|---|---|---|
|
{{hub.name}}
|
{{hub.address}}
|
|


Fair Scheduler
Purpose
This document describes the Fair Scheduler, a pluggable MapReduce scheduler that provides a way to share large clusters.
Introduction
Fair scheduling is a method of assigning resources to jobs such that all jobs get, on average, an equal share of resources over time. When there is a single job running, that job uses the entire cluster. When other jobs are submitted, tasks slots that free up are assigned to the new jobs, so that each job gets roughly the same amount of CPU time. Unlike the default Hadoop scheduler, which forms a queue of jobs, this lets short jobs finish in reasonable time while not starving long jobs. It is also an easy way to share a cluster between multiple of users. Fair sharing can also work with job priorities - the priorities are used as weights to determine the fraction of total compute time that each job gets.
The fair scheduler organizes jobs into pools, and divides resources fairly between these pools. By default, there is a separate pool for each user, so that each user gets an equal share of the cluster. It is also possible to set a job's pool based on the user's Unix group or any jobconf property. Within each pool, jobs can be scheduled using either fair sharing or first-in-first-out (FIFO) scheduling.
In addition to providing fair sharing, the Fair Scheduler allows assigning guaranteed minimum shares to pools, which is useful for ensuring that certain users, groups or production applications always get sufficient resources. When a pool contains jobs, it gets at least its minimum share, but when the pool does not need its full guaranteed share, the excess is split between other pools.
If a pool's minimum share is not met for some period of time, the scheduler optionally supports preemption of jobs in other pools. The pool will be allowed to kill tasks from other pools to make room to run. Preemption can be used to guarantee that "production" jobs are not starved while also allowing the Hadoop cluster to also be used for experimental and research jobs. In addition, a pool can also be allowed to preempt tasks if it is below half of its fair share for a configurable timeout (generally set larger than the minimum share preemption timeout). When choosing tasks to kill, the fair scheduler picks the most-recently-launched tasks from over-allocated jobs, to minimize wasted computation. Preemption does not cause the preempted jobs to fail, because Hadoop jobs tolerate losing tasks; it only makes them take longer to finish.
The Fair Scheduler can limit the number of concurrent running jobs per user and per pool. This can be useful when a user must submit hundreds of jobs at once, or for ensuring that intermediate data does not fill up disk space on a cluster when too many concurrent jobs are running. Setting job limits causes jobs submitted beyond the limit to wait until some of the user/pool's earlier jobs finish. Jobs to run from each user/pool are chosen in order of priority and then submit time.
Finally, the Fair Scheduler can limit the number of concurrent running tasks per pool. This can be useful when jobs have a dependency on an external service like a database or web service that could be overloaded if too many map or reduce tasks are run at once.
Installation
To run the fair scheduler in your Hadoop installation, you need to put it on the CLASSPATH. The easiest way is to copy the hadoop-*-fairscheduler.jar from HADOOP_HOME/build/contrib/fairscheduler to HADOOP_HOME/lib. Alternatively you can modify HADOOP_CLASSPATH to include this jar, in HADOOP_CONF_DIR/hadoop-env.sh
You will also need to set the following property in the Hadoop config file HADOOP_CONF_DIR/mapred-site.xml to have Hadoop use the fair scheduler:
<property> <name>mapred.jobtracker.taskScheduler</name> <value>org.apache.hadoop.mapred.FairScheduler</value> </property>
Once you restart the cluster, you can check that the fair scheduler is running by going to http://<jobtracker URL>/scheduler on the JobTracker's web UI. A "job scheduler administration" page should be visible there. This page is described in the Administration section.
If you wish to compile the fair scheduler from source, run ant package in your HADOOP_HOME directory. This will build build/contrib/fair-scheduler/hadoop-*-fairscheduler.jar.
Configuration
The Fair Scheduler contains configuration in two places -- algorithm parameters are set in HADOOP_CONF_DIR/mapred-site.xml, while a separate XML file called the allocation file, located by default in HADOOP_CONF_DIR/fair-scheduler.xml, is used to configure pools, minimum shares, running job limits and preemption timeouts. The allocation file is reloaded periodically at runtime, allowing you to change pool settings without restarting your Hadoop cluster.
For a minimal installation, to just get equal sharing between users, you will not need to edit the allocation file.
Scheduler Parameters in mapred-site.xml
The following parameters can be set in mapred-site.xml to affect the behavior of the fair scheduler:
Basic Parameters
| Name | Description |
|---|---|
| mapred.fairscheduler.preemption | Boolean property for enabling preemption. Default: false. |
| mapred.fairscheduler.pool | Specify the pool that a job belongs in. If this is specified then mapred.fairscheduler.poolnameproperty is ignored. |
| mapred.fairscheduler.poolnameproperty | Specify which jobconf property is used to determine the pool that a job belongs in. String, default: user.name (i.e. one pool for each user). Another useful value is mapred.job.queue.name to use MapReduce's "queue" system for access control lists (see below). mapred.fairscheduler.poolnameproperty is used only for jobs in which mapred.fairscheduler.pool is not explicitly set. |
| mapred.fairscheduler.allocation.file | Can be used to have the scheduler use a different allocation file than the default one (HADOOP_CONF_DIR/fair-scheduler.xml). Must be an absolute path to the allocation file. |
Advanced Parameters
| Name | Description |
|---|---|
| mapred.fairscheduler.sizebasedweight | Take into account job sizes in calculating their weights for fair sharing. By default, weights are only based on job priorities. Setting this flag to true will make them based on the size of the job (number of tasks needed) as well,though not linearly (the weight will be proportional to the log of the number of tasks needed). This lets larger jobs get larger fair shares while still providing enough of a share to small jobs to let them finish fast. Boolean value, default: false. |
| mapred.fairscheduler.preemption.only.log |
This flag will cause the scheduler to run through the preemption
calculations but simply log when it wishes to preempt a task,
without actually preempting the task.
Boolean property, default: false.
This property can be useful for
doing a "dry run" of preemption before enabling it to make sure
that you have not set timeouts too aggressively.
You will see preemption log messages in your JobTracker's output
log (HADOOP_LOG_DIR/hadoop-jobtracker-*.log).
The messages look as follows: Should preempt 2 tasks for job_20090101337_0001: tasksDueToMinShare = 2, tasksDueToFairShare = 0 |
| mapred.fairscheduler.update.interval | Interval at which to update fair share calculations. The default of 500ms works well for clusters with fewer than 500 nodes, but larger values reduce load on the JobTracker for larger clusters. Integer value in milliseconds, default: 500. |
| mapred.fairscheduler.preemption.interval | Interval at which to check for tasks to preempt. The default of 15s works well for timeouts on the order of minutes. It is not recommended to set timeouts much smaller than this amount, but you can use this value to make preemption computations run more often if you do set such timeouts. A value of less than 5s will probably be too small, however, as it becomes less than the inter-heartbeat interval. Integer value in milliseconds, default: 15000. |
| mapred.fairscheduler.weightadjuster |
An extension point that lets you specify a class to adjust the
weights of running jobs. This class should implement the
WeightAdjuster interface. There is currently one example
implementation - NewJobWeightBooster, which increases the
weight of jobs for the first 5 minutes of their lifetime to let
short jobs finish faster. To use it, set the weightadjuster
property to the full class name,
org.apache.hadoop.mapred.NewJobWeightBooster.
NewJobWeightBooster itself provides two parameters for setting the
duration and boost factor.
|
| mapred.fairscheduler.loadmanager | An extension point that lets you specify a class that determines how many maps and reduces can run on a given TaskTracker. This class should implement the LoadManager interface. By default the task caps in the Hadoop config file are used, but this option could be used to make the load based on available memory and CPU utilization for example. |
| mapred.fairscheduler.taskselector | An extension point that lets you specify a class that determines which task from within a job to launch on a given tracker. This can be used to change either the locality policy (e.g. keep some jobs within a particular rack) or the speculative execution algorithm (select when to launch speculative tasks). The default implementation uses Hadoop's default algorithms from JobInProgress. |
Allocation File (fair-scheduler.xml)
The allocation file configures minimum shares, running job limits, weights and preemption timeouts for each pool. Only users/pools whose values differ from the defaults need to be explicitly configured in this file. The allocation file is located in HADOOP_HOME/conf/fair-scheduler.xml. It can contain the following types of elements:
-
pool elements, which configure each pool.
These may contain the following sub-elements:
- minMaps and minReduces, to set the pool's minimum share of task slots.
- maxMaps and maxReduces, to set the pool's maximum concurrent task slots.
- schedulingMode, the pool's internal scheduling mode, which can be fair for fair sharing or fifo for first-in-first-out.
- maxRunningJobs, to limit the number of jobs from the pool to run at once (defaults to infinite).
- weight, to share the cluster non-proportionally with other pools. For example, a pool with weight 2.0 will get a 2x higher share than other pools. The default weight is 1.0.
- minSharePreemptionTimeout, the number of seconds the pool will wait before killing other pools' tasks if it is below its minimum share (defaults to infinite).
- user elements, which may contain a maxRunningJobs element to limit jobs. Note that by default, there is a pool for each user, so per-user limits are not necessary.
- poolMaxJobsDefault, which sets the default running job limit for any pools whose limit is not specified.
- userMaxJobsDefault, which sets the default running job limit for any users whose limit is not specified.
- defaultMinSharePreemptionTimeout, which sets the default minimum share preemption timeout for any pools where it is not specified.
- fairSharePreemptionTimeout, which sets the preemption timeout used when jobs are below half their fair share.
- defaultPoolSchedulingMode, which sets the default scheduling mode (fair or fifo) for pools whose mode is not specified.
Pool and user elements only required if you are setting non-default values for the pool/user. That is, you do not need to declare all users and all pools in your config file before running the fair scheduler. If a user or pool is not listed in the config file, the default values for limits, preemption timeouts, etc will be used.
An example allocation file is given below :
<?xml version="1.0"?> <allocations> <pool name="sample_pool"> <minMaps>5</minMaps> <minReduces>5</minReduces> <maxMaps>25</maxMaps> <maxReduces>25</maxReduces> <minSharePreemptionTimeout>300</minSharePreemptionTimeout> </pool> <user name="sample_user"> <maxRunningJobs>6</maxRunningJobs> </user> <userMaxJobsDefault>3</userMaxJobsDefault> <fairSharePreemptionTimeout>600</fairSharePreemptionTimeout> </allocations>
This example creates a pool sample_pool with a guarantee of 5 map slots and 5 reduce slots. The pool also has a minimum share preemption timeout of 300 seconds (5 minutes), meaning that if it does not get its guaranteed share within this time, it is allowed to kill tasks from other pools to achieve its share. The pool has a cap of 25 map and 25 reduce slots, which means that once 25 tasks are running, no more will be scheduled even if the pool's fair share is higher. The example also limits the number of running jobs per user to 3, except for sample_user, who can run 6 jobs concurrently. Finally, the example sets a fair share preemption timeout of 600 seconds (10 minutes). If a job is below half its fair share for 10 minutes, it will be allowed to kill tasks from other jobs to achieve its share. Note that the preemption settings require preemption to be enabled in mapred-site.xml as described earlier.
Any pool not defined in the allocation file will have no guaranteed capacity and no preemption timeout. Also, any pool or user with no max running jobs set in the file will be allowed to run an unlimited number of jobs.
Access Control Lists (ACLs)
The fair scheduler can be used in tandem with the "queue" based access control system in MapReduce to restrict which pools each user can access. To do this, first enable ACLs and set up some queues as described in the MapReduce usage guide, then set the fair scheduler to use one pool per queue by adding the following property in HADOOP_CONF_DIR/mapred-site.xml:
<property> <name>mapred.fairscheduler.poolnameproperty</name> <value>mapred.job.queue.name</value> </property>
You can then set the minimum share, weight, and internal scheduling mode for each pool as described earlier. In addition, make sure that users submit jobs to the right queue by setting the mapred.job.queue.name property in their jobs.
Administration
The fair scheduler provides support for administration at runtime through two mechanisms:
- It is possible to modify minimum shares, limits, weights, preemption timeouts and pool scheduling modes at runtime by editing the allocation file. The scheduler will reload this file 10-15 seconds after it sees that it was modified.
- Current jobs, pools, and fair shares can be examined through the JobTracker's web interface, at http://<JobTracker URL>/scheduler. On this interface, it is also possible to modify jobs' priorities or move jobs from one pool to another and see the effects on the fair shares (this requires JavaScript).
The following fields can be seen for each job on the web interface:
- Submitted - Date and time job was submitted.
- JobID, User, Name - Job identifiers as on the standard web UI.
- Pool - Current pool of job. Select another value to move job to another pool.
- Priority - Current priority. Select another value to change the job's priority
- Maps/Reduces Finished: Number of tasks finished / total tasks.
- Maps/Reduces Running: Tasks currently running.
- Map/Reduce Fair Share: The average number of task slots that this job should have at any given time according to fair sharing. The actual number of tasks will go up and down depending on how much compute time the job has had, but on average it will get its fair share amount.
In addition, it is possible to view an "advanced" version of the web UI by going to http://<JobTracker URL>/scheduler?advanced. This view shows two more columns:
- Maps/Reduce Weight: Weight of the job in the fair sharing calculations. This depends on priority and potentially also on job size and job age if the sizebasedweight and NewJobWeightBooster are enabled.
Metrics
The fair scheduler can export metrics using the Hadoop metrics interface. This can be enabled by adding an entry to hadoop-metrics.properties to enable the fairscheduler metrics context. For example, to simply retain the metrics in memory so they may be viewed in the /metrics servlet:
fairscheduler.class=org.apache.hadoop.metrics.spi.NoEmitMetricsContext
Metrics are generated for each pool and job, and contain the same information that is visible on the /scheduler web page.


We are a team of innovators, designers, and problem-solvers looking to change the way people browse for gifts. We enjoy Codewars algorithms, providing out-of-the-box solutions to problems we didn't know we had, and long walks on the beach.
Recent UCLA grad with industry experience in big data and market research. Passionate and highly motived, Izzy loves solving critical problems and working with others to achieve a common goal. When he's not programming, you can catch him at a concert or playing pickup basketball in Santa Monica.
Operations management specialist with a passion for the outdoors, efficiency, and ice cream. Donovan uses a combination of empathy, discipline, and humor to guide teams to success.
Digital marketer with 14+ years of experience domestically and internationally. Never happy with the status quo Mike is always looking for his next challenge. A proud advocate of California Proposition 64 he is currently busy coding at Coding Bootcamp at UCLA.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DraggableManager
An interface which defines a manager whose responsibility is to enable
dragging for Component
's of a Container
which registers itself as the "draggable container"
| Field Summary | |
|---|---|
static byte |
STATE_DRAGGING
the component is being dragged |
static byte |
STATE_STILL
the component is not being dragged |
static byte |
STATE_UNKNOWN
the state of the component is unknown |
| Method Summary | |
|---|---|
boolean |
dragging()
Called while the Component is being dragged |
Container |
getDraggableContainer()
Returns the Container which has been registered as the "draggable container" |
DragPolicy |
getDragPolicy()
Returns the DragPolicy for which this manager obides by |
byte |
getState(Draggable draggableComponent)
Returns the state of the given Draggable component |
void |
registerDraggableContainer(Container draggableContainer)
Registers the given Container with this manager to enable the
container's Draggable components to be draggable |
void |
setDragPolicy(DragPolicy dragPolicy)
Set the policy for which components are eligible for dragging |
void |
setNullifyLayout(boolean nullifyLayout)
Sets whether the "draggable container" layout manager should be set to null once a component is dragged, or not. |
boolean |
shouldNullifyLayout()
Returns the "nullify layout" value |
boolean |
startDrag(Component componentToDrag)
Called before a Component is actually dragged |
boolean |
stopDrag()
Called when a Component has stopped being dragged |
void |
unregisterDraggableContainer(Container draggableContainer)
Un-Registers the given Container from this manager which stops
this manager from managing the container |
| Methods inherited from interface java.awt.event.ContainerListener |
|---|
componentAdded, componentRemoved |
| Field Detail |
|---|
static final byte STATE_UNKNOWN
static final byte STATE_STILL
static final byte STATE_DRAGGING
| Method Detail |
|---|
Container getDraggableContainer()
Container
which has been registered as the "draggable container"
Container
which was registered as the "draggable container"
or null
if no Container
is registeredboolean startDrag(Component componentToDrag)
Component
is actually dragged
componentToDrag
- the component which was chosen to be dragged
true
if the "drag" can continue, false
otherwiseboolean dragging()
Component
is being dragged
true
if the dragging can continue,
false
otherwiseboolean stopDrag()
Component
has stopped being dragged
true
if no errors occurred when the drag completed,
false
otherwisevoid registerDraggableContainer(Container draggableContainer)
Container
with this manager to enable the
container's Draggable
components to be draggable
draggableContainer
- the Container
whose Draggable
components should be able to be draggedvoid unregisterDraggableContainer(Container draggableContainer)
Container
from this manager which stops
this manager from managing the container
draggableContainer
- the Container
to unregisterbyte getState(Draggable draggableComponent)
Draggable
component
draggableComponent
- the Draggable
whose state
is of interest
draggableComponent
as defined in this
interfaceSTATE_DRAGGING
,
STATE_STILL
,
STATE_UNKNOWN
void setDragPolicy(DragPolicy dragPolicy)
dragPolicy
- the policy to setgetDragPolicy()
,
DragPolicy
DragPolicy getDragPolicy()
DragPolicy
for which this manager obides by
DragPolicy
for this managersetDragPolicy(DragPolicy)
,
DragPolicy
boolean shouldNullifyLayout()
true
to nullify the layout manager of the "draggable
container", false
otherwisevoid setNullifyLayout(boolean nullifyLayout)
null
once a component is dragged, or not.
null
, the components
may lose their "dragged" position if the container is resized.
true
nullifyLayout
- true
to nullify the layout manager,
false
otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


## Web Literacy and #CritLib
5/5/15
_What is my responsibility when it comes to technology? Why is web literacy important? How does my knowledge of technology and technology issues affect my role? How do I use my role to leverage change that is positive to the people I serve? How do I talk about my values and ideas with those resistant to them?_
I am an academic librarian. I'm relatively new to the profession- meaning that although I've worked in libraries for the past 9 years, I have only been a _Librarian_ since August. As a paraprofessional, I was not privy to the kind of decision-making that drives the way a library serves its patrons. Some day, I may write a long post about the difference between library worker and librarian, but suffice it to say that there _is_ a very real difference in the power of my current role compared to my former roles. And the more I think about my role, the more I challenge myself to be sure that I am making the most of it.
Over the past few months, I have been helping to define [web literacy](https://mozilla.github.io/webmaker-whitepaper/ "Mozilla Webmaker Whitepaper on Web Literacy"), a concept coined by the [Mozilla Webmaker community](https://wiki.mozilla.org/Webmaker/WebLiteracyMap "Webmaker Web Literacy Wiki") which boils down to _the ability to read, write and participate on the web_. This is an important project because currenty there is a lack of emphasis in Information Literacy and pedagogy on teaching about the web and the internet. Undoubtedly, many people aren't able to explain the difference between the web and the internet, but the implications are huge when it comes to discussing privacy & encryption, access to information, and many other issues at the fore of politics today. Implications brought about and reinforced by capitalism, government control, and social ineqities.
There are numerous global initiatives to change the way that communication on the web is carried out. We have covert, quasi-legal government operations to [undermine security](http://en.wikipedia.org/wiki/PRISM_%28surveillance_program%29 "Wikipedia entry on PRISM (surveillance program)"). We have [proposed legislation](http://arstechnica.com/tech-policy/2015/04/30/irate-congressman-gives-cops-easy-rule-just-follow-the-damn-constitution/ "Ars Technica - Irate Congressman gives cops easy rule: 'just follow the damn Constitution'") to do the same. We also have proposed legislation to allow coporations who own the infrastructure to [dictate what information can pass to which customers](https://www.eff.org/issues/net-neutrality "EFF statement on net neutrality"). We are living at the brink of [dystopia](http://www.dystopiatracker.com/E "Dystopia Tracker").
I don't expect all librarians to get as excited about this as me.  But as librarians, we have some responsibilities to our communities. I think this quote does a good job of summing it up:
> "The core ethics and values of the information disciplines and professions require that we steward, validate, protect, and also liberate the cultural and documentary record; that we insure that documentation is transparent and accountable; and that we provide equitable and ready access to information for all."
>From: the [Statement from Information Studies Academics and Professionals on Documentary Evidence and Social Justice](http://criticallis.com/"").
However, this leaves out one very imporatant aspect of information literacy- the ability to be an active _participant_ in _contributing_ to the documentation. It is not enough for us to preserve and make information available- we need to ensure that the _use_ of that information is open to all. To use information in the 21st century includes being able to synthesize that information and create new ideas.
As the web becomes increasingly at the center of the storing and sharing of this documentation, we need to be sure that people not only have access to information, but that they have the ability to contribute to that information. The web is not static. It is not a one-way communication tool. The revolutionary aspect of the web is that it allows for collaboration and participation. From posting on social media to creating websites, people create and share information in ways that was not possible before the web.
The implications of this collaborative community are far-reaching and affect many areas of our lives. It puts power into the hands of the many. It allows anyone with the infrastructure and skills to question and challenge the traditional role of the 'expert' and 'authority.' Photos, videos and microblogs have helped bring the concept of #BlackLivesMatter to the fore of the national conversations. People can now easily share information that debunks corporate news and government press releases. The web allows more voices to be heard. But it isn't automatic- people still need the technology and the know-how.
But how can librarians work toward this goal?
### The #CritLib lens
\#CritLib is a set of Twitter meetings arranged around issues that beg for critical evaluations and perspectives:
>"Recognizing that we all work under regimes of white supremacy, capitalism, and a range of structural inequalities, how can our work as librarians intervene in and disrupt those systems?"
>[#CritLib chats cheat sheet](https://docs.google.com/document/d/1wntzuezo-QVhl7pgf3HJQ2iIUgUrs8E61hU1gdAbSSc/edit "#critlib Google Doc")
Past topics include: educational technology & neoliberalism, [anti-oppressive facilitation strategies](https://storify.com/oksveta/critlib-4-21-2015 "4/21/15 #critlib Storify"), and critical pedagogy. The recommended readings are thought-provoking and the discussions bring out a variety of perspectives and stories. It's not so much a place to go for crucial information and action steps as it is a place to share and be heard. Libraries are constantly changing and are being disrupted. It's useful to think about how we can guide those changes to be disruptions for dismantling the status quo. My experience with these chats is largely my inspiration for writing about the topic of web literacy for this post.
### Open Web Fluency & Leadership
Recently a new Mozilla Webmaker community group ([Open Web Fluency?](http://www.zythepsary.com/techie/open-fluency/ "Zythepsary post about the Open Fluency community calls")) has arisen that is focused on the leadership roles of those of us who participate in teaching web literacy (hence fluency). But there is also a focus on the [open web](http://en.wikipedia.org/wiki/Open_Web "Wikipedia entry for Open Web") and in providing learners with empowerment and independence. Active learning also is at the fore of web literacy (more on that later).
### Active Learning & the Web
>"There is only one subject-matter for education, and that is life in all of its manifestations."
>[-Alfred North Whitehead](http://en.wikipedia.org/wiki/Alfred_North_Whitehead "Wikipedia entry for Alfred North Whitehead")
The idea that people learn best when new information is coupled with active hands-on work isn't a new one. The idea that applying what has been learned to practical applications and real-life situations isn't any newer. In the context of the web, there is no better way to learn than to throw students at a project and let them explore independently and determine for themselves what areas to pursue. This is precisely what the Mozilla Webmaker clubs and Hive communities [seek to do](https://blog.webmaker.org/learning-through-making-the-best-kind-of-education?ref=050415_Claw&utm_campaign=050415_Claw&utm_source=twitter.com&utm_medium=referral "Learning Through Making: The Best Kind of Education").
Active learning is built into the web. Anyone can learn HTML, CSS & JavaScript (the primary languages that make up the web) with any computer bought off the shelf. All that is needed is a text editor and a browser. [Free online courses](https://github.com/sometimesmotion/webliteracytools "Tools to Learn & Teach the Web Github page") allow people to learn coding from almost any device connected to the web. Many services have free smartphone apps, such as Coursera, Codecademy and Khan Academy. The barrier to entry is very low, but a computer of some type is still required.
As a librarian, you don't need to know the content, you simply need to provide a space and guidance for people to learn on their own. Host a [Maker Party](https://party.webmaker.org/resources "Webmaker Maker Party Resources Page"), [Hour of Code](https://hourofcode.com/us "Hour of Code homepage"), or [Cryptoparty](https://www.cryptoparty.in/ "Cryptoparty homepage").  Engage your patrons and partners- do you know anyone who wants to share their passion about the web?
### Infrastructure
A big part of being able to contribute to the web is having access to the web. We all already know that libraries are one of the only places where people can get this access for free. Work to keep it that way. Filters and firewalls censor your patrons' voices and bar them from the conversations. The homeless guy who keeps looking at porn is no more of a reason for blocking internet access than a joyriding teen is a reason for barricading off certain streets. Yes, it's a difficult problem, but there are other solutions.
What is your library's presence on the web? Do you have a mobile-friendly webpage? Is the catalog mobile-friendly? More people have access to the web through smartphones than desktop computers or laptops. Blacks and Hispanics are [3 times more dependent](http://www.pewresearch.org/fact-tank/2015/04/30/racial-and-ethnic-differences-in-how-people-use-mobile-technology/ "Pew Research Center - Racial and ethnic differences in how people use mobile technology") on their smartphones for internet access than whites. Blacks and Hispanics also use their phones for accessing educational content more often. Is your library's web presence making it more difficult or easier for people to access information?
Building an app? Make it useful on all devices and to all users. Making the decision to create iPhone-centered projects are deciding to create projects that are closed to certain users, whereas responsive [mobile-first design](http://www.lukew.com/ff/entry.asp?933 "Luke Wroblewski's blog post about Mobile Design") provides equitable access across devices. Restricting wireless access with [passwords](https://openwireless.org/ "Openwireless.org homepage") is one more barrier, but checking out [wireless hotspots](http://hotspot.nypl.org/ "NYPL Library Hotspot program page") opens access to entire groups of people _outside the library_. Our programs and policies directly impact our communities' access to the web and ability to participate on the web.
### Further Reading (more or less related):
[Tools to Learn & Teach the Web](https://github.com/sometimesmotion/webliteracytools "Github Repo - add comments to the issues for suggestions")
The Webmaker group is still coming up with a name (Open Fluency was the beta version), but we are looking for more participants to help us define the skills and competencies needed to teach web literacy- join us! You can view past community call [agendas/minutes](https://teach.etherpad.mozilla.org/openfluency "Etherpad for Open Fluency community calls") or one of many [explanatory blog posts](http://www.zythepsary.com/ "Zythepsary Blog") by [Laura Hilliger](https://about.me/laurahilliger "Laura Hilliger's About.me page").
[#CritLib (Techifesto || Tech Manifesto)](https://docs.google.com/document/d/1Ch7w-q0NdIf9M9tbyTZpsrOozUlilZAzOarlpAm8hzo/edit)
[Webmaker post about active learning and Web literacy](https://blog.webmaker.org/learning-through-making-the-best-kind-of-education?ref=050415_Claw&utm_campaign=050415_Claw&utm_source=twitter.com&utm_medium=referral "Learning Through Making: The Best Kind of Education")
[Pew poll - Racial and ethnic differences in how people use mobile technology](http://www.pewresearch.org/fact-tank/2015/04/30/racial-and-ethnic-differences-in-how-people-use-mobile-technology/ "Pew Research Center - Racial and ethnic differences in how people use mobile technology")
[Boing Boing article about Brooke Gladstone's _Influencing Machine_](http://boingboing.net/2011/07/07/post-13.html "")
[Open Wireless Movement](https://openwireless.org/ "Openwireless.org homepage")


Cobweb
💸 A P2P lending platform on Ethereum blockchain.
Loading...
#id
money
from
to
Create Bill
Take Money
Back Money
Heal Money


{% extends 'enrolment/wizard.html' %} {% load static from static %} {% block step_title %}What type of business do you represent?{% endblock %}


Button
Buttons in Metro 4 docs
\l
\t\l
\t Example button\l
\i
]]>
button\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
]]>
button
]]>
button\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
]]>
button\n
\n
\n
\n
\n
\n
\n
]]>
button\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
]]>
button
]]>
\n
]]>
button
]]>
\l
\t\l
\t\l
\t\tYes, share and connect\l
\t\tUse this option for home or work\l
\t\l
\l\n
\l\n
]]>
\l
\t\l
\tShare it\l
\l\n
\l\n
\l\n
]]>
\l
\tRocket\l
\t\l
\l\n
\l\n
\l\n
\l\n
\l\n
]]>
]]>
\l
\t\l
\t\l
\t\t \l
\t\t \l
\t\t \l
\t\t \l
\t
\l
]]>


A cluster of Geiger calibrated hits referenced by handles.
More...
#include <falaise/snemo/datamodels/tracker_cluster.h>
A cluster of Geiger calibrated hits referenced by handles.
Handle on tracker cluster.
| snemo::datamodel::tracker_cluster::tracker_cluster |
( |
| ) |
|
| virtual snemo::datamodel::tracker_cluster::~tracker_cluster |
( |
| ) |
|
|
virtual |
| void snemo::datamodel::tracker_cluster::clear |
( |
| ) |
|
Reset/invalidate the contents of the tracker cluster.
| static const std::string& snemo::datamodel::tracker_cluster::delayed_cluster_flag |
( |
| ) |
|
|
static |
Flag for a auxiliary property.
| int snemo::datamodel::tracker_cluster::get_cluster_id |
( |
| ) |
const |
Return a non mutable reference on the calibrated tracker hit given its index.
Return a non mutable reference on the container of handles on calibrated tracker hits.
| unsigned int snemo::datamodel::tracker_cluster::get_number_of_hits |
( |
| ) |
const |
Return the number of hits in the cluster.
Return a mutable reference on the container of handles on calibrated tracker hits.
| bool snemo::datamodel::tracker_cluster::has_cluster_id |
( |
| ) |
const |
Check if there is a valid cluster ID.
| void snemo::datamodel::tracker_cluster::invalidate_cluster_id |
( |
| ) |
|
Invalidate the cluster ID.
| bool snemo::datamodel::tracker_cluster::is_delayed |
( |
| ) |
const |
Check if the cluster is associated to delayed hits.
| bool snemo::datamodel::tracker_cluster::is_prompt |
( |
| ) |
const |
Check if the cluster is associated to prompt hits.
| void snemo::datamodel::tracker_cluster::make_delayed |
( |
| ) |
|
Mark the cluster as associated to delayed hits.
| void snemo::datamodel::tracker_cluster::make_prompt |
( |
| ) |
|
Mark the cluster as associated to prompt hits.
| void snemo::datamodel::tracker_cluster::reset |
( |
| ) |
|
Reset/invalidate the tracker cluster(see clear)
| void snemo::datamodel::tracker_cluster::set_cluster_id |
( |
int32_t |
| ) |
|
| virtual void snemo::datamodel::tracker_cluster::tree_dump |
( |
std::ostream & |
out_ = std::clog , |
|
|
const std::string & |
title_ = "" , |
|
|
const std::string & |
indent_ = "" , |
|
|
bool |
inherit_ = false |
|
) |
| const |
|
virtual |
The documentation for this class was generated from the following file:


How to start building websites
There are many tools available that allow you to rapidly build websites. However, these tools do a great job of leaving the creator in the dark about what they're actually changing, and what is happening with the system. To learn how these work, and website development in general, we'll start by creating a small HTML/CSS website from scratch.
Tools
Only two tools are necessary to start working with HTML & CSS. A text editor and a browser.
- Text Editor - Where you'll write your code. You can you the default one that comes with your computer (Notepad on Windows, TextEdit on Mac). However, there are free text editors that are a bit better, and perform syntax highlighting so we can see what we're writing better. Some suggestions are below.
- Notepad++ - Windows
- Sublime Text - All platforms
- Atom - All platforms
- Browser - Where you'll launch your local website and check your progress. I would recommend using Google Chrome or Mozilla Firefox for development, but it's proper procedure to test website on all modern browsers (Chrome, Firefox, Safari, Edge, IE, & Opera).
After you've got a text editor and browser installed and ready to use, you're ready to start diving into some coding.


{#- Shortest and fastest shim for ie-old html5 elements, add only the elements you need, or replace this with Modernizr -#}


{% extends 'layouts/layout.html' %} {% block pageTitle %} Check your email {% endblock %} {% block content %}
NHS login is secure and can be used repeatedly to access lots of different health and social care services.
You can now access the NHS App with your NHS login. To access other services, we may ask you to prove who you are first.


Help them find you when they filter." %}


{% extends "templates/access-control-base.html" %} {% block main-content %}
Documentation for {{ app-title }} is split out into the following sections:


Application Function Key Assignment
Use this dialog to define the key combination that will be assigned to the application function described in the dialog. Any key combination not already in use by the application can be used. The dialog displays a warning when a reserved key combination is pressed.
Assign Press the assign button to close the dialog and assign the key combination to the application function.
Cancel Press the Cancel button to close the dialog without changing the key combination


?L.
M.
UNDERWOOD
&
F.
8.
EARLE,
COLLEOTORS
Cenchrus
brownii
Roem.
&
Schult.
Luis
Catasčs
Guerra
2006
MARCH,
1903
˘JLe^c>L-
THE
NEW
YORK
BOTANICAL
GARDEN
PLANTS
OF
SANTIAGO,
CUBA
01530194
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


All Classes
-
Class Description BlankNodeLink Same asSubjectLink
but the text of the hyperlink is not the same as the filter for readability purposesCallCounter Small profiling functions to count the number of times a function has been calledCallCounterCollection Collection of CallCounter with static methods to call from anywhere in codeCluster ClusterComparator CollectionsModel A representation of an RDF Graph using severalHashMap
to accelerate accessesElementUtils Several static methods to do various things with JenaElement
FieldTyper Simulating entries in the TextField was easier than programming another method to dop the same thingImplementationCommandLines ImplementationExample LazyJoin Simple Object to encapsulate every useful attributes for the Lazy Joins algorithm recursionMatchTreeNode See the article for the exact mathematical definitions of the attributes and behavior of the algorithm https://hal.archives-ouvertes.fr/hal-01945454/document Ch.6MatchTreeRoot The root node of a match-treeModelLoad Runnable for back thread loading the Model, to avoid unresponsive interface during the loadingNeighborsController Main controllerNeighborsImplementation Static methods for a basic implementationNeighborsInterface ObservablePartition Partition with some observable properties for the interfacePartition Class for the first algorithm described in the articlePartitionException Exception to be raised in the Partition AlgorithmPartitionRun Runnable for back thread running the Partition AlgorithmSearchHistoryElement Small item encapsulating everything needed for a search history Used by the "Previous" ButtonSingletonStopwatchCollection Stopwatch SubjectLink A hyperlink using the filter textfield to navigate to the nodeTableUtils Several static methods to do various things with JenaTable
TimeOut Runnable to set an AtomicBoolean to true after a certain amount of time To be tested by anytime algorithms to know if they should stop runningVisualBNode VisualCandidate Pane visualizing a potential nodes to be partitioned Able to display details about the node for navigationVisualCluster TitledPane Tailored to a ClusterVisualClusterComparator VisualGraphNode Visualization for the details of a nodeVisualPrefixes TitledPane Summarizing the PrefixMapping


I also worked as a grader for Ordinary Differential Equations course (MATH 220), taught by Professor Van Vleck from the department of Mathematics at University of Kansas. Interestingly enough, one of my responsibilities was also typing up all the weekly homework solutions so that they can be used as "oracles", i.e. "source of truth" when grading students’ submissions.
This was quite an experience, because it has been a while since my intro ODE class. In a way, it felt like taking another courseload, as I had to type everything in LaTeX. Solutions are available both in the web form (rendered by KaTeX) and in PDF form (rendered with LaTeX). This might be a good source to catch up on your ODEs!


Data Exchange Layer (DXL) Java SDK
The DXL Java SDK contains the following directories:
- doc
- Documentation for the DXL Java SDK
- lib
- DXL Java libraries
- sample
- Samples that demonstrate use of the DXL Java SDK
Click here to view the documentation which includes installation instructions, Java DXL API details, and samples.