text:
'''
Directly manage the Salt fileserver plugins
'''
from __future__ import absolute_import

# Import Salt libs
import salt.utils
import salt.fileserver

def envs(backend=None, sources=False, outputter=None):
    '''
    Return the available fileserver environments. If no backend is provided,
    then the environments for all configured backends will be returned.

    backend
        Narrow fileserver backends to a subset of the enabled ones.

        .. versionchanged:: 2015.5.0
            If all passed backends start with a minus sign (``-``), then these
            backends will be excluded from the enabled backends. However, if
            there is a mix of backends with and without a minus sign (ex:
            ``backend=-roots,git``) then the ones starting with a minus
            sign will be disregarded.

            Additionally, fileserver backends can now be passed as a
            comma-separated list. In earlier versions, they needed to be passed
            as a python list (ex: ``backend="['roots', 'git']"``)

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.envs
        salt-run fileserver.envs backend=roots,git
        salt-run fileserver.envs git
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    output = fileserver.envs(back=backend, sources=sources)

    if outputter:
        salt.utils.warn_until(
            'Boron',
            'The \'outputter\' argument to the fileserver.envs runner has '
            'been deprecated. Please specify an outputter using --out. '
            'See the output of \'salt-run -h\' for more information.'
        )
        return {'outputter': outputter, 'data': output}
    else:
        return output

def file_list(saltenv='base', backend=None, outputter=None):
    '''
    Return a list of files from the salt fileserver

    saltenv : base
        The salt fileserver environment to be listed

    backend
        Narrow fileserver backends to a subset of the enabled ones. If all
        passed backends start with a minus sign (``-``), then these backends
        will be excluded from the enabled backends. However, if there is a mix
        of backends with and without a minus sign (ex:
        ``backend=-roots,git``) then the ones starting with a minus sign will
        be disregarded.

        .. versionadded:: 2015.5.0

    CLI Examples:

    .. code-block:: bash

        salt-run fileserver.file_list
        salt-run fileserver.file_list saltenv=prod
        salt-run fileserver.file_list saltenv=dev backend=git
        salt-run fileserver.file_list base hg,roots
        salt-run fileserver.file_list -git
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv, 'fsbackend': backend}
    output = fileserver.file_list(load=load)

    if outputter:
        salt.utils.warn_until(
            'Boron',
            'The \'outputter\' argument to the fileserver.file_list runner '
            'has been deprecated. Please specify an outputter using --out. '
            'See the output of \'salt-run -h\' for more information.'
        )
        return {'outputter': outputter, 'data': output}
    else:
        return output

def symlink_list(saltenv='base', backend=None, outputter=None):
    '''
    Return a list of symlinked files and dirs

    saltenv : base
        The salt fileserver environment to be listed

    backend
        Narrow fileserver backends to a subset of the enabled ones. If all
        passed backends start with a minus sign (``-``), then these backends
        will be excluded from the enabled backends. However, if there is a mix
        of backends with and without a minus sign (ex:
        ``backend=-roots,git``) then the ones starting with a minus sign will
        be disregarded.

        .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.symlink_list
        salt-run fileserver.symlink_list saltenv=prod
        salt-run fileserver.symlink_list saltenv=dev backend=git
        salt-run fileserver.symlink_list base hg,roots
        salt-run fileserver.symlink_list -git
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv, 'fsbackend': backend}
    output = fileserver.symlink_list(load=load)

    if outputter:
        salt.utils.warn_until(
            'Boron',
            'The \'outputter\' argument to the fileserver.symlink_list '
            'runner has been deprecated. Please specify an outputter using '
            '--out. See the output of \'salt-run -h\' for more information.'
        )
        return {'outputter': outputter, 'data': output}
    else:
        return output

def dir_list(saltenv='base', backend=None, outputter=None):
    '''
    Return a list of directories in the given environment

    saltenv : base
        The salt fileserver environment to be listed

    backend
        Narrow fileserver backends to a subset of the enabled ones. If all
        passed backends start with a minus sign (``-``), then these backends
        will be excluded from the enabled backends. However, if there is a mix
        of backends with and without a minus sign (ex:
        ``backend=-roots,git``) then the ones starting with a minus sign will
        be disregarded.

        .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.dir_list
        salt-run fileserver.dir_list saltenv=prod
        salt-run fileserver.dir_list saltenv=dev backend=git
        salt-run fileserver.dir_list base hg,roots
        salt-run fileserver.dir_list -git
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv, 'fsbackend': backend}
    output = fileserver.dir_list(load=load)

    if outputter:
        salt.utils.warn_until(
            'Boron',
            'The \'outputter\' argument to the fileserver.dir_list runner '
            'has been deprecated. Please specify an outputter using --out. '
            'See the output of \'salt-run -h\' for more information.'
        )
        return {'outputter': outputter, 'data': output}
    else:
        return output

def empty_dir_list(saltenv='base', backend=None, outputter=None):
    '''
    .. versionadded:: 2015.5.0

    Return a list of empty directories in the given environment

    saltenv : base
        The salt fileserver environment to be listed

    backend
        Narrow fileserver backends to a subset of the enabled ones. If all
        passed backends start with a minus sign (``-``), then these backends
        will be excluded from the enabled backends. However, if there is a mix
        of backends with and without a minus sign (ex:
        ``backend=-roots,git``) then the ones starting with a minus sign will
        be disregarded.

        .. note::

            Some backends (such as :mod:`git <salt.fileserver.gitfs>` and
            :mod:`hg <salt.fileserver.hgfs>`) do not support empty directories.
            So, passing ``backend=git`` or ``backend=hg`` will result in an
            empty list being returned.

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.empty_dir_list
        salt-run fileserver.empty_dir_list saltenv=prod
        salt-run fileserver.empty_dir_list backend=roots
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv, 'fsbackend': backend}
    output = fileserver.file_list_emptydirs(load=load)

    if outputter:
        salt.utils.warn_until(
            'Boron',
            'The \'outputter\' argument to the fileserver.empty_dir_list '
            'runner has been deprecated. Please specify an outputter using '
            '--out. See the output of \'salt-run -h\' for more information.'
        )
        return {'outputter': outputter, 'data': output}
    else:
        return output

def update(backend=None):
    '''
    Update the fileserver cache. If no backend is provided, then the cache for
    all configured backends will be updated.

    backend
        Narrow fileserver backends to a subset of the enabled ones.

        .. versionchanged:: 2015.5.0
            If all passed backends start with a minus sign (``-``), then these
            backends will be excluded from the enabled backends. However, if
            there is a mix of backends with and without a minus sign (ex:
            ``backend=-roots,git``) then the ones starting with a minus
            sign will be disregarded.

            Additionally, fileserver backends can now be passed as a
            comma-separated list. In earlier versions, they needed to be passed
            as a python list (ex: ``backend="['roots', 'git']"``)

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.update
        salt-run fileserver.update backend=roots,git
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    fileserver.update(back=backend)
    return True

def clear_cache(backend=None):
    '''
    .. versionadded:: 2015.5.0

    Clear the fileserver cache from VCS fileserver backends (:mod:`git
    <salt.fileserver.gitfs>`, :mod:`hg <salt.fileserver.hgfs>`, :mod:`svn
    <salt.fileserver.svnfs>`). Executing this runner with no arguments will
    clear the cache for all enabled VCS fileserver backends, but this
    can be narrowed using the ``backend`` argument.

    backend
        Only clear the update lock for the specified backend(s). If all passed
        backends start with a minus sign (``-``), then these backends will be
        excluded from the enabled backends. However, if there is a mix of
        backends with and without a minus sign (ex: ``backend=-roots,git``)
        then the ones starting with a minus sign will be disregarded.

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.clear_cache
        salt-run fileserver.clear_cache backend=git,hg
        salt-run fileserver.clear_cache hg
        salt-run fileserver.clear_cache -roots
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    cleared, errors = fileserver.clear_cache(back=backend)
    ret = {}
    if cleared:
        ret['cleared'] = cleared
    if errors:
        ret['errors'] = errors
    if not ret:
        return 'No cache was cleared'
    return ret

def clear_lock(backend=None, remote=None):
    '''
    .. versionadded:: 2015.5.0

    Clear the fileserver update lock from VCS fileserver backends (:mod:`git
    <salt.fileserver.gitfs>`, :mod:`hg <salt.fileserver.hgfs>`, :mod:`svn
    <salt.fileserver.svnfs>`). This should only need to be done if a fileserver
    update was interrupted and a remote is not updating (generating a warning
    in the Master's log file). Executing this runner with no arguments will
    remove all update locks from all enabled VCS fileserver backends, but this
    can be narrowed by using the following arguments:

    backend
        Only clear the update lock for the specified backend(s).

    remote
        If specified, then any remotes which contain the passed string will
        have their lock cleared. For example, a ``remote`` value of **github**
        will remove the lock from all github.com remotes.

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.clear_lock
        salt-run fileserver.clear_lock backend=git,hg
        salt-run fileserver.clear_lock backend=git remote=github
        salt-run fileserver.clear_lock remote=bitbucket
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    cleared, errors = fileserver.clear_lock(back=backend, remote=remote)
    ret = {}
    if cleared:
        ret['cleared'] = cleared
    if errors:
        ret['errors'] = errors
    if not ret:
        return 'No locks were removed'
    return ret

def lock(backend=None, remote=None):
    '''
    .. versionadded:: 2015.5.0

    Set a fileserver update lock for VCS fileserver backends (:mod:`git
    <salt.fileserver.gitfs>`, :mod:`hg <salt.fileserver.hgfs>`, :mod:`svn
    <salt.fileserver.svnfs>`).

    .. note::

        This will only operate on enabled backends (those configured in
        :conf_master:`fileserver_backend`).

    backend
        Only set the update lock for the specified backend(s).

    remote
        If not None, then any remotes which contain the passed string will have
        their lock cleared. For example, a ``remote`` value of ``*github.com*``
        will remove the lock from all github.com remotes.

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.lock
        salt-run fileserver.lock backend=git,hg
        salt-run fileserver.lock backend=git remote='*github.com*'
        salt-run fileserver.lock remote=bitbucket
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    locked, errors = fileserver.lock(back=backend, remote=remote)
    ret = {}
    if locked:
        ret['locked'] = locked
    if errors:
        ret['errors'] = errors
    if not ret:
        return 'No locks were set'
    return ret


text:
namespace chrono {

/// @addtogroup chrono_functions
/// @{

/// A rotation q=f(s) provided from a rotation sample, continuously updated by the user,
/// behaving as a ZOH (zero order hold) of FOH (first order).
/// You must keep the setpoint q updated via multiple
/// calls to SetSetpoint(), for example calling SetSetpoint()
/// at each timestep in the simulation loop.
/// It is assumed that one will later evaluate Get_q(), Get_w_loc() etc. in close vicinity of the setpoint (setpoint history is not saved),
/// preferably ecactly at the same s, but in vicinity of s there will be extrapolation (after last s) and interpolation (before last s) according to:
/// If in ZOH mode: rotation q will persist indefinitely until next call, angular velocity and angular acceleration will be zero.
/// If in FOH mode: rotation q will interpolate linearly from the previous value, angular velocity will be constant, angular acceleration will be zero.
/// Default: uses FOH mode. Use SetMode() to change it.

class ChApi ChFunctionRotation_setpoint : public ChFunctionRotation {

  public:
	ChFunctionRotation_setpoint();
	ChFunctionRotation_setpoint(const ChFunctionRotation_setpoint& other);
	virtual ~ChFunctionRotation_setpoint();

    /// "Virtual" copy constructor.
    virtual ChFunctionRotation_setpoint* Clone() const override { return new ChFunctionRotation_setpoint(*this); }

	/// Type of setpoint interpolation/extrapolation - zero order hold, first order hold, etc.
	enum eChSetpointMode {
		ZOH,	///< Zero  Order Hold: q constant,  w = a = 0                 in neighbour of setpoint s
		FOH,    ///< First Order Hold: q linear,    w constant, a = 0         in neighbour of setpoint s
		//SOH,	///< First Order Hold: q parabolic, w linear,   a  constant   in neighbour of setpoint s
		OVERRIDE ///< p, w, a are set via SetSetpointAndDerivatives() and will be considered constant in Get_q(s) regardless of s until next SetSetpointAndDerivatives()
	};

	/// @cond
    CH_ENUM_MAPPER_BEGIN(eChSetpointMode);
    CH_ENUM_VAL(ZOH);
    CH_ENUM_VAL(FOH);
	//CH_ENUM_VAL(SOH);
    CH_ENUM_VAL(OVERRIDE);
    CH_ENUM_MAPPER_END(eChSetpointMode);
	/// @endcond

	/// Sets the extrapolation/interpolation mode
	void SetMode(eChSetpointMode mmode) {
		mode = mmode;
	}
	/// Gets the extrapolation/interpolation mode
	eChSetpointMode GetMode() {
		return mode;
	}

	/// Use this to go back to s=0 (the SetSetpoint() function works only if called at increasing s values)
	void Reset(double ms = 0);

	/// Set the rotation setpoint, and compute its derivatives (angular speed, angular acceleration) automatically
    /// by backward differentiation (only if s is called at increasing small steps, most often s is time).
	/// Note: each time must be called with increasing s so that internally it add sthe 'new' setpoint and scrolls
	/// the previous samples for computing extrapolation/interpolation, but if called multiple times with exactly the
	/// same s value, the buffer of past samples is not scrolled: it just recompute setpoint and
	/// derivatives according to the 'updated' setpoint.
	/// If in ZOH mode: rotation q will persist indefinitely until next call, angular velocity and angular acceleration will be zero.
	/// If in FOH mode: rotation q will interpolate linearly from the previous value, angular velocity will be constant, angular acceleration will be zero.
    virtual void SetSetpoint(ChQuaternion<> q_setpoint, double s);

    /// Set the setpoint, and also its derivatives (angular velocity, angular acceleration). Moreover, changes the mode to eChSetpointMode::OVERRIDE, so
    /// all values will persist indefinitely until next call, that is multiple calls to Get_q(s) Get_w_loc() etc. will give same
	/// results (non interpolated) regardless of s.
    virtual void SetSetpointAndDerivatives(ChQuaternion<> q_setpoint, ChVector<> w_loc_setpoint, ChVector<> a_loc_setpoint) {
		mode = eChSetpointMode::OVERRIDE;
        Q = q_setpoint;
        W = w_loc_setpoint;
        A = a_loc_setpoint;
    }

	/// Return the q value of the function, at s, as q=f(s).
    virtual ChQuaternion<> Get_q(double s) const override;

    /// Return the derivative of the rotation function, at s, expressed as angular velocity w in local frame.
	virtual ChVector<> Get_w_loc(double s) const override;

    /// Return the derivative of the rotation function, at s, expressed as angular acceleration in local frame.
	virtual ChVector<> Get_a_loc(double s) const override;

    /// Method to allow serialization of transient data to archives
    virtual void ArchiveOUT(ChArchiveOut& marchive) override;

    /// Method to allow de-serialization of transient data from archives.
    virtual void ArchiveIN(ChArchiveIn& marchive) override;

private:
	eChSetpointMode mode;
	double	   S;
	ChQuaternion<> Q;
    ChVector<>     W;
    ChVector<>     A;
	double	       last_S;
	ChQuaternion<> last_Q;
    ChVector<>     last_W;
};

/// @} chrono_functions

CH_CLASS_VERSION(ChFunctionRotation_setpoint, 0)

}  // end namespace chrono

#endif

redpajama_set_name: RedPajamaGithub


text:
package org.ovirt.mobile.movirt.ui.dashboard.maps;

import org.ovirt.mobile.movirt.model.enums.DataCenterStatus;

import java.util.Arrays;
import java.util.Collections;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;

public enum DcStatusMap {
    // dashboard position depends on the order
    WARNING(DataCenterStatus.UNINITIALIZED, DataCenterStatus.MAINTENANCE, DataCenterStatus.CONTEND),
    UP(DataCenterStatus.UP),
    DOWN(DataCenterStatus.NOT_OPERATIONAL, DataCenterStatus.PROBLEMATIC);

    private final List<DataCenterStatus> values;
    private static Map<DataCenterStatus, DcStatusMap> map = new EnumMap<>(DataCenterStatus.class);

    static {
        for (DcStatusMap item : DcStatusMap.values()) {
            for (DataCenterStatus status : item.getValues()) {
                map.put(status, item);
            }
        }
    }

    DcStatusMap(DataCenterStatus... values) {
        this.values = Collections.unmodifiableList(Arrays.asList(values));
    }

    public List<DataCenterStatus> getValues() {
        return values;
    }

    public static DashboardPosition getDashboardPosition(DataCenterStatus status) {
        DcStatusMap result = map.get(status);
        return result == null ? DashboardPosition.UNKNOWN : DashboardPosition.fromValue(result.ordinal());
    }
}


text:
package io.intercom.api;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ConversationMessage extends TypedData {

    @SuppressWarnings("FieldCanBeLocal")
    @JsonProperty("type")
    private final String type = "conversation_message";

    @JsonProperty
    private String id;

    @JsonProperty
    private String subject;

    @JsonProperty
    private String body;

    @JsonProperty
    private Author author;

    @JsonProperty
    private String url;

    @JsonProperty("delivered_as")
    private String deliveredAs;

    @JsonProperty("attachments")
    private List<Attachment> attachments;

    public ConversationMessage() {
    }

    public String getType() {
        return type;
    }

    public String getId() {
        return id;
    }

    public String getSubject() {
        return subject;
    }

    public String getBody() {
        return body;
    }

    public Author getAuthor() {
        return author;
    }

    public String getUrl() {
        return url;
    }

    public String getDeliveredAs() {
        return deliveredAs;
    }

    public List<Attachment> getAttachments() {
        return attachments;
    }

    @Override
    public int hashCode() {
        int result = subject != null ? subject.hashCode() : 0;
        result = 31 * result + (body != null ? body.hashCode() : 0);
        result = 31 * result + (author != null ? author.hashCode() : 0);
        result = 31 * result + (deliveredAs != null ? deliveredAs.hashCode() : 0);
        result = 31 * result + (id != null ? id.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (attachments != null ? attachments.hashCode() : 0);

        return result;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ConversationMessage that = (ConversationMessage) o;

        if (author != null ? !author.equals(that.author) : that.author != null) return false;
        if (body != null ? !body.equals(that.body) : that.body != null) return false;
        //noinspection RedundantIfStatement
        if (subject != null ? !subject.equals(that.subject) : that.subject != null) return false;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (url != null ? !url.equals(that.url) : that.url != null) return false;
        if (deliveredAs != null ? !deliveredAs.equals(that.deliveredAs) : that.deliveredAs != null) return false;
        if (attachments != null ? !attachments.equals(that.attachments) : that.attachments != null) return false;

        return true;
    }

    @Override
    public String toString() {
        return "ConversationMessage{" +
            "type='" + type + '\'' +
            ", id='" + id + '\'' +
            ", subject='" + subject + '\'' +
            ", body='" + body + '\'' +
            ", author=" + author +
            ", url=" + url +
            ", deliveredAs=" + deliveredAs +
            ", attachments=" + attachments +
            "} " + super.toString();
    }
}


text:
Landslide
=========

---

Landslide
---------

.notes: plop

Generates a slideshow using the slides that power
[the html5-slides presentation](http://apirocks.com/html5/html5.html).

A `python` with the `jinja2`, `markdown`, and `pygments` modules is required.

Markdown Formatting Instructions
--------------------------------

- Separate your slides with a horizontal rule (--- in markdown)
- Your first slide (title slide) should not have a heading, only `<p>`s
- Your other slides should have a heading that renders to an h1 element
- To highlight blocks of code, put !{{lang}} as the first indented line
- See the included slides.md for an example

Rendering Instructions
----------------------

- Put your markdown content in a file called `slides.md`
- Run `python render.py`
- Enjoy 你生成的 `presentation.html`

---

Slide #2
========

.fx: foo bar

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean magna tellus,
fermentum nec venenatis nec, dapibus id metus. Phasellus nulla massa, consequat
nec tempor et, elementum viverra est. Duis sed nisl in eros adipiscing tempor.

Section #1
----------

Integer in dignissim ipsum. Integer pretium nulla at elit facilisis eu feugiat
velit consectetur.

Section #2
----------

Donec risus tortor, dictum sollicitudin ornare eu, egestas at purus. Cras
consequat lacus vitae lectus faucibus et molestie nisl gravida. Donec tempor,
tortor in varius vestibulum, mi odio laoreet magna, in hendrerit nibh neque eu
eros.

Unicode Characters Work
-----------------------

© é

---

Middle Title Slide
==================

---

Slide #3
========

**Hello Gentlemen**

- Mega Man 2
- Mega Man 3
- Spelunky
- Dungeon Crawl Stone Soup
- Etrian Odyssey

*Are you prepared to see beyond the veil of reason?* - DeceasedCrab

- Black Cascade
- Two Hunters
- Diadem of 12 Stars

---

Slide #4
========

First code block:

    !python
    while True:
        print "Everything's gonna be allright"

Second code block:

    !php
    <?php exec('python render.py --help'); ?>

Third code block:

    !xml
    <?xml version="1.0" encoding="UTF-8"?>
    <painting>
      <img src="madonna.jpg" alt='Foligno Madonna, by Raphael'/>
      <caption>This is Raphael's "Foligno" Madonna, painted in
        <date>1511</date>–<date>1512</date>.
      </caption>
    </painting>

---

Slide #5
========

Another code block:

    !java
    if (markdown && isEasy()) {
        return true;
    }

---

Slide #6
========

An image:

![monkey](monkey.jpg)

---

Slide #7
========

Landslide can generate QR codes:

.qr: 450|http://github.com/adamzap/landslide

---

This is a slide with no heading. It works too.

---

Slide #9
========

This slide has presenter notes.

Press `p` to open a new window for the presenter with its notes.

# Presenter Notes

Hello from presenter notes


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>H-Index</title>
<meta name="date" content="2017-01-29">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I L M P R S T U

H

handleAddCategory(CategoryAddedEvent) - Method in class com.rssaggregator.desktop.AddFeedScene

Event after the api returns the result of the addCategory request.

handleAddFeed(FeedAddedEvent) - Method in class com.rssaggregator.desktop.AddFeedScene

Event after the api returns the result of the addFeed request.

handleCategoryItemsPaneClicked(Category) - Method in class com.rssaggregator.desktop.view.MainViewController

Handles when user clicks on a category pane.

handleChannelItemsPaneClicked(Channel) - Method in class com.rssaggregator.desktop.view.MainViewController

Handles click on a channel.

handleDeleteFeed(FeedDeletedEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after the api returns the result of the deleteFeed request.

handleFetchAllItems(FetchAllItemsEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after the api returns the result of the fetchAllItems request.

handleFetchCategories(FetchCategoriesEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after the api returns the result of the fetchCategories request.

handleFetchItemsByCategory(FetchItemsByCategoryEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after the api returns the result of the fetchItemsByCategory
 request.

handleFetchItemsByChannel(FetchItemsByChannelEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after the api returns the result of the fetchItemsByChannel
 request.

handleFetchStarredItems(FetchStarredItemsEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after the api returns the result of the fetchStarItems request.

handleLogIn(LogInEvent) - Method in class com.rssaggregator.desktop.ConnectionScene

Event after the api returns the result of the login request.

handleLogOut(LogOutEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after log out.

handleReadState(ItemUpdatedEvent) - Method in class com.rssaggregator.desktop.ArticleDetailsScene

Event after the api returns the result of the signUp request.

handleRefreshCategories(RefreshCategoriesEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after refreshing categories.

handleSignUp(SignUpEvent) - Method in class com.rssaggregator.desktop.SignUpScene

Event after the api returns the result of the signUp request.

handleUpdateReadStateByChannel(ItemsByChannelUpdatedEvent) - Method in class com.rssaggregator.desktop.MainViewScene

Event after the api returns the result of the UpdateReadStateByChannel
 request.

A B C D E F G H I L M P R S T U

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
<!--
@license
Copyright (c) 2017 Vaadin Ltd.
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
-->

<link rel="import" href="vaadin-grid-templatizer.html">

<script>
  window.Vaadin = window.Vaadin || {};
  Vaadin.Grid = Vaadin.Grid || {};

  /**
   * @polymerMixin
   */
  Vaadin.Grid.RowDetailsMixin = superClass => class RowDetailsMixin extends superClass {
    static get properties() {
      return {
        /**
        * An array containing references to items with open row details.
        */
        detailsOpenedItems: {
          type: Array,
          value: function() {
            return [];
          }
        },

        _rowDetailsTemplate: Object,

        _detailsCells: {
          type: Array,
        }
      };
    }

    static get observers() {
      return [
        '_detailsOpenedItemsChanged(detailsOpenedItems.*, dataProvider, _rowDetailsTemplate, _physicalCountVal)'
      ];
    }

    ready() {
      super.ready();
      this._rowDetailsTemplate = this.querySelector('template.row-details');
      if (this._rowDetailsTemplate) {
        var templatizer = new Vaadin.Grid.Templatizer();
        templatizer._grid = this;
        templatizer.dataHost = this.dataHost;
        templatizer.template = this._rowDetailsTemplate;
        this._rowDetailsTemplate.templatizer = templatizer;
      }
    }

    _detailsOpenedItemsChanged(changeRecord, dataProvider, rowDetailsTemplate, physicalCount) {
      if (dataProvider === undefined || !rowDetailsTemplate) {
        return;
      }

      if (changeRecord.path === 'detailsOpenedItems.length') {
        // Let's avoid duplicate work of both ".splices" and ".length" updates.
        return;
      }

      this._flushItemsDebouncer();

      if (this._lastDetailsOpenedItems && physicalCount) {
        this._physicalItems.forEach(this._toggleDetailsCell, this);
        this._render();
      }

      this._lastDetailsOpenedItems = this.detailsOpenedItems;
    }

    _configureDetailsCell(cell) {
      cell.setAttribute('part', 'cell details-cell');
      // Freeze the details cell, so that it does not scroll horizontally
      // with the normal cells. This way it looks less weird.
      cell.setAttribute('frozen', '');
    }

    _toggleDetailsCell(row, item) {
      const cell = row.querySelector('[part~="details-cell"]');
      const detailsHidden = !this._isDetailsOpened(item);
      if (cell && cell.hidden !== detailsHidden) {
        cell.hidden = detailsHidden;
        if (detailsHidden) {
          row.style.removeProperty('padding-bottom');
        } else {
          if (!cell._instance) {
            // Stamp the template
            cell._instance = this._rowDetailsTemplate.templatizer.createInstance();
            cell._content.innerHTML = '';
            cell._content.appendChild(cell._instance.root);
            this._updateItem(row, item);
          }

          row.style.setProperty('padding-bottom', `${cell.offsetHeight}px`);
        }
      }
    }

    _updateDetailsCellHeights() {
      Array.from(this.$.items.querySelectorAll('[part~="details-cell"]:not([hidden])')).forEach(cell => {
        cell.parentElement.style.setProperty('padding-bottom', `${cell.offsetHeight}px`);
      });
    }

    _isDetailsOpened(item) {
      return this.detailsOpenedItems && this.detailsOpenedItems.indexOf(item) !== -1;
    }

    /**
     * Open the details row of a given item.
     */
    openItemDetails(item) {
      if (!this._isDetailsOpened(item)) {
        this.push('detailsOpenedItems', item);
      }
    }

    /**
     * Close the details row of a given item.
     */
    closeItemDetails(item) {
      if (this._isDetailsOpened(item)) {
        this.splice('detailsOpenedItems', this.detailsOpenedItems.indexOf(item), 1);
      }
    }

    _detailsOpenedInstanceChangedCallback(instance, value) {
      if (super._detailsOpenedInstanceChangedCallback) {
        super._detailsOpenedInstanceChangedCallback(instance, value);
      }
      if (value) {
        this.openItemDetails(instance.item);
      } else {
        this.closeItemDetails(instance.item);
      }
    }
  };
</script>


text:
import {Component} from '@angular/core';
import {NavController, IonicPage} from 'ionic-angular';
import {AuthService} from '../../providers/auth-service/auth-service';
import {GitHubService} from '../../providers/git-hub-service/git-hub-service';

@IonicPage()
@Component({
    selector: 'page-home',
    templateUrl: 'home.html',
    providers: [GitHubService]
})
export class HomePage {
    username = '';
    email = '';
    public foundRepos: Array<any> = [];
    public gituser;
    public userFound: boolean = true;

    constructor(private nav: NavController, private auth: AuthService,
                private github: GitHubService) {
        let info = this.auth.getUserInfo();
        this.username = info['name'];
        this.email = info['email'];
    }

    public logout() {
        this.auth.logout().subscribe(succ => {
            this.nav.setRoot('LoginPage')
        });
    }

    getRepos() {
        this.github.getRepos(this.gituser).subscribe(
            data => {
                this.foundRepos = data.json();
                this.userFound = true;
            },
            err => {
                this.userFound = false;
                console.error(err);
            },
            () => console.log('getRepos completed')
        );
    }
}


text:
package com.github.nikdon.telepooz.model.inline

import com.github.nikdon.telepooz.model.ParseMode

/** This object represents the content of a message to be sent as a result of an inline query. */
sealed trait InputMessageContent

/**
  * Represents the content of a text message to be sent as the result of an inline query.
  *
  * @param message_text             Text of the message to be sent, 1-4096 characters
  * @param parse_mode               Send Markdown or HTML, if you want Telegram apps to show bold, italic,
  *                                 fixed-width text or inline URLs in your bot's message.
  * @param disable_web_page_preview Disables link previews for links in the sent message
  */
case class InputTextMessageContent(message_text: String,
                                   parse_mode: Option[ParseMode] = None,
                                   disable_web_page_preview: Option[Boolean] = None) extends InputMessageContent

/**
  * Represents the content of a location message to be sent as the result of an inline query.
  *
  * @param latitude   Latitude of the location in degrees
  * @param longitude  Longitude of the location in degrees
  */
case class InputLocationMessageContent(latitude: Double, longitude: Double) extends InputMessageContent

/**
  * Represents the content of a venue message to be sent as the result of an inline query.
  *
  * @param latitude       Latitude of the venue in degrees
  * @param longitude      Longitude of the venue in degrees
  * @param title          Name of the venue
  * @param address        Address of the venue
  * @param foursquare_id  Foursquare identifier of the venue, if known
  */
case class InputVenueMessageContent(latitude: Double,
                                    longitude: Double,
                                    title: String,
                                    address: String,
                                    foursquare_id: Option[String]) extends InputMessageContent

/**
  * Represents the content of a contact message to be sent as the result of an inline query.
  *
  * @param phone_number Contact's phone number
  * @param first_name   Contact's first name
  * @param last_name    Contact's last name
  */
case class InputContactMessageContent(phone_number: String,
                                      first_name: String,
                                      last_name: Option[String] = None) extends InputMessageContent


text:
layout: page
title: "Dylan James Abrahamsen"
comments: true
description: "blanks"
keywords: "Dylan James Abrahamsen,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Engineering and Applied Science

**Classes taught**: COEN 1350, COEN 1360

#### COEN 1350: Calculus 1 Work Group

**Terms taught**: Spring 2016

**Instructor rating**: 4.75

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 0.0

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 1.36

**Standard deviation in workload** (raw): 0.0

#### COEN 1360: Calculus 2 Work Group

**Terms taught**: Fall 2016

**Instructor rating**: 5.22

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 0.0

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 1.44

**Standard deviation in workload** (raw): 0.0


text:
package structural

import "fmt"

// Component describes the behavior that needs to be exercised uniformly
// across all primitive and composite objects.
type Component interface {
	Traverse()
}

// Leaf describes a primitive leaf object in the hierarchy.
type Leaf struct {
	value int
}

// NewLeaf creates a new leaf.
func NewLeaf(value int) *Leaf {
	return &Leaf{value}
}

// Traverse prints the value of the leaf.
func (l *Leaf) Traverse() {
	fmt.Printf("%v  ", l.value)
}

// Composite describes a composite of components.
type Composite struct {
	children []Component
}

// NewComposite creates a new composite.
func NewComposite() *Composite {
	return &Composite{make([]Component, 0)}
}

// Add adds a new component to the composite.
func (c *Composite) Add(component Component) {
	c.children = append(c.children, component)
}

// Traverse traverses the composites children.
func (c *Composite) Traverse() {
	for i := 0; i < len(c.children); i++ {
		c.children[i].Traverse()
	}
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

namespace Microsoft.R.Core.AST.DataTypes {
    /// <summary>
    /// R 'mode' which is a data type. For example, string
    /// is a one-element vector of 'character' mode. Number
    /// is a single element vector of 'numerical' mode.
    /// Note that this enumeration does not list all possible
    /// runtime type, only those used by IDE and evluation engine.
    /// </summary>
    public enum RMode {
        Null,

        /// <summary>
        /// String
        /// </summary>
        Character,

        /// <summary>
        /// Integer or double
        /// </summary>
        Numeric,

        /// <summary>
        /// Boolean
        /// </summary>
        Logical,

        /// <summary>
        /// Complex number
        /// </summary>
        Complex,

        /// <summary>
        /// General list type
        /// </summary>
        List,

        /// <summary>
        /// Function type object
        /// </summary>
        Function
    }
}


text:
using NakedFunctions;
using System.Linq;

namespace SchoolRecords.Model
{
    public class Subject_MenuFunctions
    {
        //TODO

        //public Subject CreateNewSubject()
        //{
        //    return Container.NewTransientInstance<Subject>();
        //}

        //public IQueryable<Subject> AllSubjects()
        //{
        //    return Container.Instances<Subject>();
        //}

        //public IQueryable<Subject> FindSubjectByName(string name)
        //{
        //    return AllSubjects().Where(c => c.Name.ToUpper().Contains(name.ToUpper()));
        //}
    }
}


text:
import sys

inputFilePath = sys.argv[1]
granulation = int(sys.argv[2])

lineCount = 0

inputFile = open(inputFilePath, 'r')

for l in inputFile:
	lineCount += 1
inputFile.close()

testFiles = [open("test/test"+str(i)+".txt", 'w') for i in range(granulation)]
trainFiles = [open("train/train"+str(i)+".txt", 'w') for i in range(granulation)]

inputFile = open(inputFilePath, 'r')
counter = 0
for line in inputFile:
	fileNum = (counter * granulation) / lineCount
	testFiles[fileNum].write(line)
	for i in range(granulation):
		if i <> fileNum:
			trainFiles[i].write(line)

	counter += 1
inputFile.close()

for f in testFiles:
	f.close()
for f in trainFiles:
	f.close()


text:
<?php

namespace Lunr\Gravity\Filesystem\Tests;

use Lunr\Gravity\Filesystem\PhysicalFilesystemAccessObject;

/**
 * This class contains tests for creating a directory.
 *
 * @covers Lunr\Gravity\Filesystem\PhysicalFilesystemAccessObject
 */
class PhysicalFilesystemAccessObjectMkdirTest extends PhysicalFilesystemAccessObjectTest
{

    /**
     * Test that mkdir() returns FALSE when access mode is a string.
     *
     * @covers Lunr\Gravity\Filesystem\PhysicalFilesystemAccessObject::mkdir
     */
    public function testMkdirReturnsFalseWhenAccessModeIsString()
    {
        $directory = TEST_STATICS . '/Gravity/test_directory';

        $this->logger->expects($this->once())
                     ->method('warning')
                     ->with($this->EqualTo('String representation of access mode is not supported. Please, try using an integer.'));

        $this->assertFalse($this->class->mkdir($directory, '0777'));
    }

    /**
     * Test that mkdir() returns FALSE when access mode is invalid.
     *
     * @param mixed $mode Invalid mode value
     *
     * @dataProvider invalidDirModeValues
     * @covers       Lunr\Gravity\Filesystem\PhysicalFilesystemAccessObject::mkdir
     */
    public function testMkdirReturnsFalseWhenAccessModeIsInvalid($mode)
    {
        $directory = TEST_STATICS . '/Gravity/test_directory';

        $this->logger->expects($this->once())
                     ->method('warning')
                     ->with($this->EqualTo('Access mode value ' . $mode . ' is invalid.'));

        $this->assertFalse($this->class->mkdir($directory, $mode));
    }

    /**
     * Test that mkdir() returns FALSE when fails to create a directory.
     *
     * @covers Lunr\Gravity\Filesystem\PhysicalFilesystemAccessObject::mkdir
     */
    public function testMkdirWhenFailsToCreateADirectory()
    {
        $directory = TEST_STATICS . '/Gravity/test_directory';

        $this->mock_function('mkdir', 'return FALSE;');

        $this->logger->expects($this->once())
                     ->method('warning')
                     ->with($this->EqualTo('Failed to create directory: ' . $directory));

        $this->assertFalse($this->class->mkdir($directory));

        $this->unmock_function('mkdir');
    }

    /**
     * Test that mkdir() returns TRUE when creates a directory.
     *
     * @param integer $mode Valid mode value
     *
     * @dataProvider validDirModeValues
     * @covers       Lunr\Gravity\Filesystem\PhysicalFilesystemAccessObject::mkdir
     */
    public function testMkdirWhenCreatesADirectory($mode)
    {
        $directory = TEST_STATICS . '/Gravity/test_directory';

        $this->assertTrue($this->class->mkdir($directory, $mode));
        $this->assertFileExists($directory);

        rmdir($directory);
    }

    /**
     * Test that mkdir() returns TRUE when creates more than one nested directories.
     *
     * @covers Lunr\Gravity\Filesystem\PhysicalFilesystemAccessObject::mkdir
     */
    public function testMkdirWhenCreatesADirectoryRecursively()
    {
        $directory = TEST_STATICS . '/Gravity/test_directory/nested_dir';

        $this->assertTrue($this->class->mkdir($directory, 0777, TRUE));
        $this->assertFileExists($directory);

        rmdir($directory);
        rmdir(TEST_STATICS . '/Gravity/test_directory');
    }

}

?>


text:
README
Phonebook

AUTHORS

Sean Holstrom

INSTALL

Install Ruby
Install bundle
Download the repository
Run bundle
Run ruby app.rb
COPYING / LICENSE

GNU GPL v2.0

BUGS

This is broken. I will redo it this weekend.
Report via pull request and/or comments.


text:
var assert = require('assert');
var ga = require('./analytics');
var constants = require('../lib/constants');

var browserCaps;
var TIMEOUT = 1000;

var opts = {
  definitions: [
    {
      name: 'Width',
      dimensionIndex: 1,
      items: [
        {name: 'sm', media: 'all'},
        {name: 'md', media: '(min-width: 480px)'},
        {name: 'lg', media: '(min-width: 640px)'}
      ]
    },
    {
      name: 'Height',
      dimensionIndex: 2,
      items: [
        {name: 'sm', media: 'all'},
        {name: 'md', media: '(min-height: 480px)'},
        {name: 'lg', media: '(min-height: 640px)'}
      ]
    }
  ]
};

describe('mediaQueryTracker', function() {

  before(function() {
    browserCaps = browser.session().value;

    // Loads the autotrack file since no custom HTML is needed.
    browser.url('/test/autotrack.html');
  });

  beforeEach(function() {
    browser
        .setViewportSize({width: 800, height: 600}, false)
        .execute(ga.run, 'create', 'UA-XXXXX-Y', 'auto')
        .execute(ga.trackHitData);
  });

  afterEach(function () {
    browser
        .execute(ga.clearHitData)
        .execute(ga.run, 'mediaQueryTracker:remove')
        .execute(ga.run, 'remove');
  });

  it('should set initial data via custom dimensions', function() {

    if (notSupportedInBrowser()) return;

    browser
        .execute(ga.run, 'require', 'mediaQueryTracker', opts)
        .waitUntil(ga.trackerDataMatches([
          ['dimension1', 'lg'],
          ['dimension2', 'md']
        ]));
  });

  it('should send events when the matched media changes', function() {

    if (notSupportedInBrowser()) return;

    browser
        .execute(ga.run, 'require', 'mediaQueryTracker', opts)
        .setViewportSize({width: 400, height: 400}, false)
        .waitUntil(ga.trackerDataMatches([
          ['dimension1', 'sm'],
          ['dimension2', 'sm']
        ]));

    browser
        .waitUntil(ga.hitDataMatches([
          ['[0].eventCategory', 'Width'],
          ['[0].eventAction', 'change'],
          ['[0].eventLabel', 'lg => sm'],
          ['[1].eventCategory', 'Height'],
          ['[1].eventAction', 'change'],
          ['[1].eventLabel', 'md => sm']
        ]));
  });

  it('should wait for the timeout to set or send changes', function() {

    if (notSupportedInBrowser()) return;

   browser
        .execute(ga.run, 'require', 'mediaQueryTracker', opts)
        .setViewportSize({width: 400, height: 400}, false);

    var timeoutStart = Date.now();
    browser.waitUntil(ga.trackerDataMatches([
      ['dimension1', 'sm'],
      ['dimension2', 'sm']
    ]));
    browser.waitUntil(ga.hitDataMatches([
      ['length', 2]
    ]));
    var timeoutDuration = Date.now() - timeoutStart;

    assert(timeoutDuration >= TIMEOUT);
  });

  it('should support customizing the timeout period', function() {

    if (notSupportedInBrowser()) return;

    browser
        .execute(ga.run, 'require', 'mediaQueryTracker',
            Object.assign({}, opts, {changeTimeout: 0}))
        .setViewportSize({width: 400, height: 400}, false);

    var shortTimeoutStart = Date.now();
    browser.waitUntil(ga.trackerDataMatches([
      ['dimension1', 'sm'],
      ['dimension2', 'sm']
    ]));
    browser.waitUntil(ga.hitDataMatches([
      ['length', 2]
    ]));
    var shortTimeoutDuration = Date.now() - shortTimeoutStart;

    browser
        .execute(ga.clearHitData)
        .execute(ga.run, 'mediaQueryTracker:remove')
        .execute(ga.run, 'remove')
        .execute(ga.run, 'create', 'UA-XXXXX-Y', 'auto')
        .execute(ga.trackHitData)
        .setViewportSize({width: 800, height: 600}, false)
        .execute(ga.run, 'require', 'mediaQueryTracker', opts)
        .setViewportSize({width: 400, height: 400}, false);

    var longTimeoutStart = Date.now();
    browser.waitUntil(ga.trackerDataMatches([
      ['dimension1', 'sm'],
      ['dimension2', 'sm']
    ]));
    browser.waitUntil(ga.hitDataMatches([
      ['length', 2]
    ]));
    var longTimeoutDuration = Date.now() - longTimeoutStart;

    // The long timeout should, in theory, be 1000ms longer, but we compare
    // to 500 just to be safe and avoid flakiness.
    assert(longTimeoutDuration - shortTimeoutDuration > (TIMEOUT/2));
  });

  it('should support customizing the change template', function() {

    if (notSupportedInBrowser()) return;

    browser
        .execute(requireMediaQueryTracker_changeTemplate)
        .setViewportSize({width: 400, height: 400}, false)
        .waitUntil(ga.hitDataMatches([
          ['[0].eventLabel', 'lg:sm'],
          ['[1].eventLabel', 'md:sm']
        ]));
  });

  it('should support customizing any field via the fieldsObj', function() {

    if (notSupportedInBrowser()) return;

    browser
        .execute(ga.run, 'require', 'mediaQueryTracker',
            Object.assign({}, opts, {
              changeTimeout: 0,
              fieldsObj: {
                nonInteraction: true
              }
            }))
        .setViewportSize({width: 400, height: 400}, false)
        .waitUntil(ga.hitDataMatches([
          ['[0].eventCategory', 'Width'],
          ['[0].eventAction', 'change'],
          ['[0].eventLabel', 'lg => sm'],
          ['[0].nonInteraction', true],
          ['[1].eventCategory', 'Height'],
          ['[1].eventAction', 'change'],
          ['[1].eventLabel', 'md => sm'],
          ['[1].nonInteraction', true]
        ]));
  });

  it('should support specifying a hit filter', function() {

    if (notSupportedInBrowser()) return;

    browser
        .execute(requireMediaQueryTracker_hitFilter)
        .setViewportSize({width: 400, height: 400}, false)
        .waitUntil(ga.hitDataMatches([
          ['[0].eventCategory', 'Height'],
          ['[0].eventAction', 'change'],
          ['[0].eventLabel', 'md => sm'],
          ['[0].nonInteraction', true]
        ]));
  });

  it('includes usage params with all hits', function() {

    var hitData = browser
        .execute(ga.run, 'require', 'mediaQueryTracker')
        .execute(ga.run, 'send', 'pageview')
        .execute(ga.getHitData)
        .value;

    assert.equal(hitData.length, 1);
    assert.equal(hitData[0].devId, constants.DEV_ID);
    assert.equal(hitData[0][constants.VERSION_PARAM], constants.VERSION);

    // '8' = '000001000' in hex
    assert.equal(hitData[0][constants.USAGE_PARAM], '8');
  });

});

/**
 * @return {boolean} True if the current browser doesn't support all features
 *    required for these tests.
 */
function notSupportedInBrowser() {
  // TODO(philipwalton): Some capabilities aren't implemented, so we can't test
  // against Edge right now. Wait for build 10532 to support setViewportSize
  // https://dev.windows.com/en-us/microsoft-edge/platform/status/webdriver/details/

  // IE9 doesn't support matchMedia, so it's not tested.
  return browserCaps.browserName == 'MicrosoftEdge' ||
      (browserCaps.browserName == 'internet explorer' &&
          browserCaps.version == '9');
}

/**
 * Since function objects can't be passed via parameters from server to
 * client, this one-off function must be used to set the value for
 * `changeTemplate`.
 */
function requireMediaQueryTracker_changeTemplate() {
  ga('require', 'mediaQueryTracker', {
    definitions: [
      {
        name: 'Width',
        dimensionIndex: 1,
        items: [
          {name: 'sm', media: 'all'},
          {name: 'md', media: '(min-width: 480px)'},
          {name: 'lg', media: '(min-width: 640px)'}
        ]
      },
      {
        name: 'Height',
        dimensionIndex: 2,
        items: [
          {name: 'sm', media: 'all'},
          {name: 'md', media: '(min-height: 480px)'},
          {name: 'lg', media: '(min-height: 640px)'}
        ]
      }
    ],
    changeTemplate: function(oldValue, newValue) {
      return oldValue + ':' + newValue;
    }
  });
}

/**
 * Since function objects can't be passed via parameters from server to
 * client, this one-off function must be used to set the value for
 * `hitFilter`.
 */
function requireMediaQueryTracker_hitFilter() {
  ga('require', 'mediaQueryTracker', {
    definitions: [
      {
        name: 'Width',
        dimensionIndex: 1,
        items: [
          {name: 'sm', media: 'all'},
          {name: 'md', media: '(min-width: 480px)'},
          {name: 'lg', media: '(min-width: 640px)'}
        ]
      },
      {
        name: 'Height',
        dimensionIndex: 2,
        items: [
          {name: 'sm', media: 'all'},
          {name: 'md', media: '(min-height: 480px)'},
          {name: 'lg', media: '(min-height: 640px)'}
        ]
      }
    ],
    hitFilter: function(model) {
      var category = model.get('eventCategory');
      if (category == 'Width') {
        throw 'Exclude width changes';
      }
      else {
        model.set('nonInteraction', true);
      }
    }
  });
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" href="docgen-resources/docgen.css" type="text/css">
  <meta name="generator" content="FreeMarker Docgen (DocBook 5)">
  <title>
    FreeMarker Manual - Reserved names in FTL
  </title>

        You are here:
          FreeMarker Manual
            >
          Template Language Reference
            >
          Reserved names in FTL

Bookmarks:
Alpha. index, Expressions, ?builtins, #directives, .spec_vars, FAQ, Glossary, API, Home

Next page: Deprecated FTL constructs

Previous page

Parent page

Contents

Chapter 4   Reserved names in FTL

The following names cannot be used for top-level variables without
      square-bracket syntax (as <tt style="color: #A03D10">.vars["in"]</tt>), since they
      are keywords in FTL:

          <tt style="color: #A03D10">true</tt>: boolean value ``true''

          <tt style="color: #A03D10">false</tt>: boolean value ``false''

          <tt style="color: #A03D10">gt</tt>: comparison operator ``greater
          than''

          <tt style="color: #A03D10">gte</tt>: comparison operator ``greater than or
          equivalent''

          <tt style="color: #A03D10">lt</tt>: comparison operator ``less
          than''

          <tt style="color: #A03D10">lte</tt>: comparison operator ``less than or
          equivalent''

          <tt style="color: #A03D10">as</tt>: used by a few directives

          <tt style="color: #A03D10">in</tt>: used by a few directives

          <tt style="color: #A03D10">using</tt>: used by a few directives

Next page: Deprecated FTL constructs

Previous page

Parent page

Contents

        You are here:
          FreeMarker Manual
            >
          Template Language Reference
            >
          Reserved names in FTL

            FreeMarker Manual -- For FreeMarker 2.3.22

          HTML generated: 2015-02-28 21:34:03 GMT


text:
Predefined Fixtures
===================

.. py:currentmodule:: conftest

.. autofunction:: test_dir

.. autofunction:: default_condor


text:
jQuery(function($){
if(!$('.a11yc')[0])
{
	return;
}
//set grobal
	window.a11yc_env = {
		$a11yc_content : $('.a11yc').eq(0),
		fixed_height : 0,
		scroll_top_position : 0,
		$footer : $('#a11yc_submit')[0] ? $('#a11yc_submit') : $(),
		fixed_footer_top : $('#a11yc_submit')[0] ? $('#a11yc_submit').offset().top : 0 ,
		menu_height : 0,
		pagemenu_height : 0,
		pagemenu_top : 0,
		current_position : 0,
		scrollable_element : '',
		$menu : $('#wpadminbar')[0] ? $('#wpadminbar') : $('#a11yc_menu_wrapper'),
		$pagemenu : $('#a11yc_menu_principles')[0] ? $('#a11yc_menu_principles') : $(),
		$current_level : $('[data-a11yc-target_level]').data('a11ycTarget_level'), //有無を調べてから?
		$additional_criterions: $(),
		is_hide_passed_item : $('.a11yc_hide_passed_item')[0] ? true : false,
		is_wp : $('.wp-admin')[0] ? true : false
	}

	//scrollable element
	a11yc_env.scrollable_element = (function(){
		var $html = $('html'),
		    top = $html.scrollTop(),
		    $el = $('
').height(10000).prependTo('body'),
		    rs = false;
		$html.scrollTop(10000);
		rs = !!$html.scrollTop();
		rs = rs ? 'html' : 'body';
		$html.scrollTop(top);
		$el.remove();
		return rs;
	}());

	// set addisional criterions
	if($('#a11yc_checks')[0]){
		var additional_arr = $('#a11yc_checks').data('a11ycAdditional_criterions');
		a11yc_env.$additional_criterions = $(additional_arr.map(function(el){ return '#a11yc_c_'+el }).join(','));
	}

	//get contents height
	$.fn.a11yc_get_height = function(arr){
		// height : menu (toolbar)
		if(!arr || $.inArray('mh', arr))
		{
			a11yc_env.menu_height = a11yc_env.$menu.outerHeight();
		}
		// top : menu_principles
		if(!arr || $.inArray('pt', arr))
		{
			a11yc_env.pagemenu_top = a11yc_env.$pagemenu[0] ? a11yc_env.$pagemenu.offset().top - a11yc_env.menu_height : 0;
		}
		// height : menu_principles
		if(!arr || $.inArray('pmh', arr))
		{
			a11yc_env.pagemenu_height = $('#a11yc_menu_principles')[0] ? $('#a11yc_menu_principles').outerHeight() : 0;
		}
		// height : a11yc_header
		if(!arr || $.inArray('hh', arr))
		{
			a11yc_env.header_height = $('#a11yc_header')[0] ? $('#a11yc_header').outerHeight(true) : 0;
		}
		// top of fixed footer
		if(( !arr || $.inArray('ff', arr)) && a11yc_env.fixed_footer_top !==0 )
		{
			a11yc_env.fixed_footer_top = a11yc_env.$footer.offset().top;
		}
	}
	$.fn.a11yc_get_height();
});

/*
 *  common functions
 */

/*=== display when javascript is active === */
jQuery(function($){
	$('.a11yc_hide_if_no_js').removeClass('a11yc_hide_if_no_js').addClass('a11yc_show_if_js');
	$('.a11yc_hide_if_no_js').find(':disabled').prop("disabled", false);
});

/* === title_tooltip === */
// replace title attr to aria-label.when element is link, screen reader speach out inner skip str.
jQuery(function($){
	if( typeof a11yc_env === "undefined" ) return;

	a11yc_tooltip();
	function a11yc_tooltip(){
//	console.log('function:'+'a11yc_tooltip');
		var $a11yc_tooltip = $(),
				title_str = '',
				position = 0,
				top = 0,
				left = 0,
				right = 0;

		$a11yc_tooltip = $('').hide().appendTo('body');

		$('.a11yc').on({
			'mouseenter focus': function(e){
				if(!$(this).is('a, span, :input, strong')) return;
				setTimeout(function($obj){
					title_str = $obj.attr('title');
					position = $obj.offset();
					$a11yc_tooltip.text(title_str).stop(true, true).show();
					$obj.data('a11ycTitle', title_str).attr('ariaLabel', title_str).removeAttr('title');

					//position
					$a11yc_tooltip.css('top', position.top-5-$a11yc_tooltip.outerHeight()+'px');
					$a11yc_tooltip.css('left', position.left-$a11yc_tooltip.outerWidth()/2+'px');
					top = position.top-5-$a11yc_tooltip.outerHeight();
					top = top-$(window).scrollTop()<0 ? position.top+$obj.outerHeight()+5 : top;
					left = $a11yc_tooltip.offset().left;
					left = left < 0 ? 0 : left;
					right = $(window).outerWidth()-left-$a11yc_tooltip.outerWidth();
					left = right < 0 ? left + right : left;

					$a11yc_tooltip.css({'top': top+'px', 'left': left+'px'});
				}
				, 0, $(this));
			},
			'mouseleave blur': function(e){
				$a11yc_tooltip.fadeOut('10', function(){
					$(this).css({'top': '-1em', 'left': '.5em'});
				});
				$(this).attr('title',$(this).data('a11ycTitle')).removeAttr('ariaLabel');
			}
		},'[title], [ariaLabel]');
	}
});

/* ===  adjust focus position === */
jQuery(function($){
	if( typeof a11yc_env === "undefined" ) return;
	$('.a11yc').on('focus', 'a, :input', function(e){
		e.stopPropagation();
		setTimeout(function(){
			var $t = $(e.target);
			if(!$t[0] || $t.closest($('#a11yc_menu, #a11yc_header, #a11yc_submit'))[0]) return;
			var scroll = $(window).scrollTop();
			var h_position = scroll+a11yc_env.header_height;
			var t_position = $t.offset().top;
			if(h_position > t_position) //hidden in fixed header
			{
				$(a11yc_env.scrollable_element).scrollTop(t_position-a11yc_env.header_height);
			}
			else if($t.closest('#a11yc_header')[0]) //hidden in fixed menu
			{
				var $t_parent = $t.closest('#a11yc_validation_list, .a11yc_source');
//				if(!$t_parent[0])
//				{
//				}
			}
			else //if(  )//hidden in fixed footer
			{
//					var f_position = a11yc_env.fixed_footer_top;
			}
		},100);
	});

	$.fn.a11yc_adjust_position = function($obj){
	if(!$obj) return;
//		console.time('fn.a11yc_adjust_position');
		var diff = a11yc_env.current_position - $obj.offset().top;
		$(a11yc_env.scrollable_element).scrollTop($(window).scrollTop()-diff);
//		console.timeEnd('fn.a11yc_adjust_position');
	}
});

/* === smooth scroll === */
// links on the same page
// prepare
jQuery(function($){
	if( typeof a11yc_env === "undefined" ) return;
	$(document).on('click', 'a[href^=#]', function(e){
		var href = $(this).attr("href"),
				$t = $(href);
		// return if target is in header
		if($t.closest($('#a11yc_menu, #a11yc_header'))[0] || href === '#') return;
		e.preventDefault();

		// add tabindex -1
		if( !$t.is(':input') && !$t.is('a') && !$t.attr('tabindex')) $t.attr('tabindex', '-1');
		a11yc_smooth_scroll(href);
	});
});
function a11yc_smooth_scroll(href) {
	jQuery(function($){
		if(!$('.a11yc')[0]) return;
		//If already scrolling, stop scroll and start from that position
		console.log(a11yc_env.header_height);

		$(a11yc_env.scrollable_element).stop();
		var $t = $(href),
			t_position = $t[0] ? $t.offset().top : false,
			position = 0;
		if(t_position === false ) return;

		//move
		position = t_position - ( a11yc_env.header_height + a11yc_env.menu_height );
		$.when($(a11yc_env.scrollable_element).animate({scrollTop: position},500))
			.done($t.focus());
		return false; //
	});
}

/* === confirm === */
jQuery(function($){
	$('[data-a11yc-confirm]').on('click', function(e){
		if(!window.confirm($(this).data('a11ycConfirm')))
		{
			e.preventDefault();
			return false;
		}
	});
});

/*  === confirm for changes === */
jQuery(function($){
	var a11yc_change_flg = false;
	$('.a11yc_form_confirm').on('change',function(e){
		a11yc_change_flg = true;
	}).on('submit',function(){
		a11yc_change_flg = false;
	});
	$(window).bind("beforeunload", function(e) {
		if( a11yc_change_flg )
		{
			e.preventDefault();
			return false;
		}
	});
});

/* === check all === */
jQuery(function($){
// check all
	$('.a11yc_check_all, .a11yc_table thead input:checkbox').on('click', function(){
		var $trigger = $(this), $target = $(), index, prop;
		if( $trigger.attr('dataA11ycTargetClass') )
		{
			$target = $('.'+$trigger.attr('dataA11ycTargetClass'));
		}
		else
		{ // thead内の場合は、あえてclassを与えなくてもtbody内の対応するセルのinputを取得する
			index = $trigger.closest('tr').children().index($trigger.closest('th, td'));
			$trigger.attr('dataA11ycTargetClass', 'a11yc_check_all_target_'+index);
			$trigger.closest('table').find('tbody tr').each(function(){
				$(this).children().eq(index).find('input:checkbox').addClass('a11yc_check_all_target_'+index);
				$target = $target.add($(this).children().eq(index).find('input:checkbox'));
			});
		}
		if( !$target[0] )
		{
			return;
		}
		prop = $trigger.prop('checked');
		$target.prop('checked', prop);
	});
});

/* === narrow level === */
jQuery(function($){
	if( typeof a11yc_env === "undefined" ) return;
	// load
	$('.a11yc_narrow_level').each(function(){
		a11yc_narrow_level( $(this).find('.current'), $($(this).data('a11ycNarrowTarget')));
	});
/*
	// click
	$(document).on('click', '.a11yc_narrow_level a', function(e){
		e.stopPropagation();
		if( $(this).closest('details')[0]  &&  $(this).closest('details').prop('open') === false )
		{
			 $(this).closest('details').prop('open', true);
		}
		a11yc_narrow_level($(this), $($(this).parent().data('a11ycNarrowTarget')), e);
		return false;
	});
*/
	function a11yc_narrow_level($target, $narrow_target, e){
		if(!$target) return;
		var $checks = $narrow_target.find('.a11yc_level_a,.a11yc_level_aa,.a11yc_level_aaa');
		// no e (page loading) or in disclosure , stop propagation
		if(e && $target.closest('.a11yc_disclosure.show')[0]) e.stopPropagation();
		var level_arr = $target.data('narrowLevel') ? $target.data('narrowLevel') : [];
		var $levels = $(level_arr.map(function(el){ return '.a11yc_leve'+el }).join(','));

		$checks.addClass('a11yc_dn');
		$levels.add(a11yc_env.$additional_criterions).removeClass('a11yc_dn');

		//validation_list only //これ、処理の分け方を考えたほうがよさそう
		if( $narrow_target[0] && $narrow_target[0].id==='a11yc_validation_list')
		{
			a11yc_validation_code_display(level_arr);
		}
		$target.parent().find('a').removeClass('current');
		$target.addClass('current');
	}
});

/* === add link anchor etc in validation error === */
jQuery(function($){
	$.fn.a11yc_format_validation_error = function(){
		var $error_wrapper = $('#a11yc_validation_list');
		if ($error_wrapper[0])
		{
			var $error_lists = $error_wrapper.find('dt');
			var $error_elms = $error_wrapper.find('.a11yc_validation_error_str');
			var $error_anchors = $('#a11yc_validation_code').find('.a11yc_source span');
			var $error_places = $();
			var $validation_code = $('#a11yc_validation_code');

			// click validate_link
			$(document).on('click', '.a11yc_validate_link a', function(e){
				var $t = $($(e.currentTarget).attr('href'));
				e.stopPropagation();
				e.preventDefault();
				// open disclosure
				if( ! $validation_code.prop('open'))
				{
					$validation_code.prop('open');
					$(e.currentTarget).click();
				}
				else
				{
					a11yc_smooth_scroll($t);
					$t.focus();
				}
				return false;
			});
		}
	}
});

/* ===  replace links in "source code"  === */
function a11yc_validation_code_display(level_arr){
jQuery(function($){
	var $code = $('#a11yc_validation_code_raw'),
			$levels = $code.find(level_arr.map(function(el){ return '.a11yc_leve'+el }).join(',')),
			$objs = $code.find('.a11yc_validation_code_error, strong, a');
	$objs.addClass('a11yc_dn').attr('role', 'presentation');
	$levels.removeClass('a11yc_dn').removeAttr('role');
});
}

/*
 * for checklist
 */
jQuery(function($){
	if(!$('#a11yc_checks')[0]) return;

	/* === assist === */
	//チェック関連の挙動
	if($('.a11yc_table_check')[0])
	{
	}

	// resize
	$(window).on('resize', function(){
		$.fn.a11yc_get_height();
		//本当はresizeの際にpaddingも変化させないといけない
		//	a11yc_fixed_header();
	});
});

/* === bulk === */
jQuery(function($){
	if( typeof a11yc_env === "undefined" ) return;
	if(!$('.a11yc')[0]) return;

	// a11yc_update_done
	$('#a11yc_update_done').parent().addClass('a11yc_hide');
	$('#a11yc_update_all').on('change', function(){
		if($(this).val() > 1)
		{
			$('#a11yc_update_done').parent().removeClass('a11yc_hide').attr('aria-hidden', false);
		}
		else
		{
			$('#a11yc_update_done').parent().addClass('a11yc_hide').attr('aria-hidden', true);
		}
	});

	// bulk integrate
	if( $('.a11yc_section_criterion').length == 1 )
	{
		 $('.a11yc_section_criterion').find('details').prop('open', true);
	}

});

/* === choose related techniques === */
jQuery(function($){
	$(document).ready(function(){
		var $criterion = $('#a11yc_criterion'),
				criterion_val = $criterion.val() == '' ? 0 : $criterion.val(),
				$default_situations = $criterion.find('option'),
				$imprements = $('.a11yc_implement_item'),
				checks = [];
		function a11yc_criterion_implements()
		{
			criterion_val = $criterion.val();
			if( criterion_val == 0 )
			{
				$imprements.show();
			}
			else
			{
				$imprements.each(function(){
					if ($.inArray(criterion_val, $(this).data('criterions')) == -1 )
					{
						$(this).hide();
					}
					else
					{

						$(this).show();
					}
				});
			}
		}

		function a11yc_criterion_implements_situation()
		{
			return false;
			checks = $imprements.find(':checked').parent().map(function(){
				return $(this).data('criterions');
			}).get()
			$default_situations.each(function(index){
				if( index == 0 )
				{
					return;
				}
				else if($.inArray( $(this).val(), checks ) == -1 )
				{
					$(document).find('#a11yc_criterion option').eq(index).remove();
				}
			});
			if( ! $(document).find('#a11yc_criterion option')[0] )
			{
				$criterion.append($default_situations).val('');
			}

//			console.log('a11yc_criterion_implements_situation');
//			criterion_val = $criterion.find('option:selected').data('criterion');
//			criterion_val = criterion_val == '' ? 0 : criterion_val;
//			a11yc_criterion_implements();
//			$criterion.val(criterion_val).trigger('change');
		}

		if (location.search.indexOf('criterion') == -1)
		{
			a11yc_criterion_implements();
		}

		$criterion.on('change', a11yc_criterion_implements);
		$imprements.on('change', a11yc_criterion_implements_situation);

	});
});

/* === pages === */
// auto scroll for pages
var a11yc_load_url;
function a11yc_auto_scroll(){
	a11yc_load_url = setInterval(function(){
		window.scrollTo(0,document.body.scrollHeight);
	}, 100);
}
function a11yc_stop_scroll(){
	window.scrollTo(0,document.body.scrollHeight);
	clearInterval(a11yc_load_url);
}

/* === issue === */
jQuery(function($){
	var $triggers = $('#a11yc_issue [name^=criterions]');
	var $targets  = $('#a11yc_issue [name^=techs]').parent();
	var $checked = $('#a11yc_issue').find(' [name^=criterions]:checked');
	var $show = $();

	$triggers.on('change', narrow_issue_implement_item);
	setTimeout(narrow_issue_implement_item,0);

	function narrow_issue_implement_item(e){
	$checked = $('#a11yc_issue').find(' [name^=criterions]:checked');
	$show = $();
	$checked.each(function(){
		var val = $(this).val();
			$targets.each(function(){
				if( $(this).data('criterions').indexOf(val) != -1 )
				{
					$show = $show.add(this);
				}
		});
	});
	$targets.not($show).hide();
	$show.show();
	};
});
/* === get validation error_message === */
/*
jQuery(function($){
	if(!$('.a11yc')[0] || $('#a11yc_post')[0] ) return;
	if(!a11yc_env.is_wp && $('#a11yc_validator_results')[0]){
		$.ajax({
			type: 'POST',
			url: $('#a11yc_validator_results').data('a11ycAjaxUrl'),
			dataType: 'html',
			data: {
				url: $('#a11yc_validator_results').data('a11ycUrl'),
				link_check: $('#a11yc_validator_results').data('a11ycLinkCheck')
			},
			beforeSend: function() {
				$('#a11yc_validator_results').addClass('a11yc_loading');
			},
			success: function(data) {
				$('#a11yc_validator_results').removeClass('a11yc_loading').append(data);
//				$.fn.a11yc_disclosure();
				$.fn.a11yc_format_validation_error();
				//$.fn.a11yc_set_validation_code_txt();
			},
			error:function() {
				$('#a11yc_validator_results').removeClass('a11yc_loading').text('failed');
			}
		});
	}
});
*/


text:
package org.apache.beam.sdk.extensions.smb;

import com.google.auto.service.AutoService;
import java.util.Collections;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.PipelineOptionsRegistrar;

@AutoService(PipelineOptionsRegistrar.class)
public class SortedBucketOptionsRegistrar implements PipelineOptionsRegistrar {
  @Override
  public Iterable<Class<? extends PipelineOptions>> getPipelineOptions() {
    return Collections.singleton(SortedBucketOptions.class);
  }
}


text:
package org.apache.jackrabbit.oak.plugins.document;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import javax.annotation.Nonnull;

import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;

import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.commons.junit.LogDumper;
import org.apache.jackrabbit.oak.commons.junit.LogLevelModifier;
import org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore;
import org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore;
import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
import org.apache.jackrabbit.oak.spi.commit.Observer;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;

import static java.util.Collections.synchronizedList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class JournalTest extends AbstractJournalTest {

    private MemoryDocumentStore ds;
    private MemoryBlobStore bs;

    @Rule
    public TestRule logDumper = new LogDumper();

    @Rule
    public TestRule logLevelModifier = new LogLevelModifier()
                                            .addAppenderFilter("file", "warn")
                                            .setLoggerLevel("org.apache.jackrabbit.oak", "trace");

    class DiffingObserver implements Observer, Runnable, NodeStateDiff {

        final List<DocumentNodeState> incomingRootStates1 = Lists.newArrayList();
        final List<DocumentNodeState> diffedRootStates1 = Lists.newArrayList();

        DocumentNodeState oldRoot = null;

        DiffingObserver(boolean startInBackground) {
            if (startInBackground) {
                // start the diffing in the background - so as to not
                // interfere with the contentChanged call
                Thread th = new Thread(this);
                th.setDaemon(true);
                th.start();
            }
        }

        public void clear() {
            synchronized(incomingRootStates1) {
                incomingRootStates1.clear();
                diffedRootStates1.clear();
            }
        }

        @Override
        public void contentChanged(@Nonnull NodeState root,@Nonnull CommitInfo info) {
            synchronized(incomingRootStates1) {
                incomingRootStates1.add((DocumentNodeState) root);
                incomingRootStates1.notifyAll();
            }
        }

        public void processAll() {
            while(processOne()) {
                // continue
            }
        }

        public boolean processOne() {
            DocumentNodeState newRoot;
            synchronized(incomingRootStates1) {
                if (incomingRootStates1.size()==0) {
                    return false;
                }
                newRoot = incomingRootStates1.remove(0);
            }
            if (oldRoot!=null) {
                newRoot.compareAgainstBaseState(oldRoot, this);
            }
            oldRoot = newRoot;
            synchronized(incomingRootStates1) {
                diffedRootStates1.add(newRoot);
            }
            return true;
        }

        @Override
        public void run() {
            while(true) {
                DocumentNodeState newRoot;
                synchronized(incomingRootStates1) {
                    while(incomingRootStates1.size()==0) {
                        try {
                            incomingRootStates1.wait();
                        } catch (InterruptedException e) {
                            // ignore
                        }
                    }
                    newRoot = incomingRootStates1.remove(0);
                }
                if (oldRoot!=null) {
                    newRoot.compareAgainstBaseState(oldRoot, this);
                }
                oldRoot = newRoot;
                synchronized(incomingRootStates1) {
                    diffedRootStates1.add(newRoot);
                }
            }
        }

        @Override
        public boolean propertyAdded(PropertyState after) {
            return true;
        }

        @Override
        public boolean propertyChanged(PropertyState before, PropertyState after) {
            return true;
        }

        @Override
        public boolean propertyDeleted(PropertyState before) {
            return true;
        }

        @Override
        public boolean childNodeAdded(String name, NodeState after) {
            return true;
        }

        @Override
        public boolean childNodeChanged(String name, NodeState before,
                NodeState after) {
            return true;
        }

        @Override
        public boolean childNodeDeleted(String name, NodeState before) {
            return true;
        }

        public int getTotal() {
            synchronized(incomingRootStates1) {
                return incomingRootStates1.size() + diffedRootStates1.size();
            }
        }

    }

    @Test
    public void cleanupTest() throws Exception {
        DocumentMK mk1 = createMK(0 /* clusterId: 0 => uses clusterNodes collection */, 0);
        DocumentNodeStore ns1 = mk1.getNodeStore();
        // make sure we're visible and marked as active
        ns1.renewClusterIdLease();
        JournalGarbageCollector gc = new JournalGarbageCollector(ns1);
        // first clean up
        Thread.sleep(100); // OAK-2979 : wait 100ms before doing the cleanup
        gc.gc(1, TimeUnit.MILLISECONDS);
        Thread.sleep(100); // sleep just quickly
        assertEquals(0, gc.gc(1, TimeUnit.DAYS));
        assertEquals(0, gc.gc(6, TimeUnit.HOURS));
        assertEquals(0, gc.gc(1, TimeUnit.HOURS));
        assertEquals(0, gc.gc(10, TimeUnit.MINUTES));
        assertEquals(0, gc.gc(1, TimeUnit.MINUTES));
        assertEquals(0, gc.gc(1, TimeUnit.SECONDS));
        assertEquals(0, gc.gc(1, TimeUnit.MILLISECONDS));

        // create some entries that can be deleted thereupon
        mk1.commit("/", "+\"regular1\": {}", null, null);
        mk1.commit("/", "+\"regular2\": {}", null, null);
        mk1.commit("/", "+\"regular3\": {}", null, null);
        mk1.commit("/regular2", "+\"regular4\": {}", null, null);
        Thread.sleep(100); // sleep 100millis
        assertEquals(0, gc.gc(5, TimeUnit.SECONDS));
        assertEquals(0, gc.gc(1, TimeUnit.MILLISECONDS));
        ns1.runBackgroundOperations();
        mk1.commit("/", "+\"regular5\": {}", null, null);
        ns1.runBackgroundOperations();
        mk1.commit("/", "+\"regular6\": {}", null, null);
        ns1.runBackgroundOperations();
        Thread.sleep(100); // sleep 100millis
        assertEquals(0, gc.gc(5, TimeUnit.SECONDS));
        assertEquals(3, gc.gc(1, TimeUnit.MILLISECONDS));
    }

    @Test
    public void journalTest() throws Exception {
        DocumentMK mk1 = createMK(1, 0);
        DocumentNodeStore ns1 = mk1.getNodeStore();
        CountingDocumentStore countingDocStore1 = builder.actualStore;
        CountingTieredDiffCache countingDiffCache1 = builder.actualDiffCache;

        DocumentMK mk2 = createMK(2, 0);
        DocumentNodeStore ns2 = mk2.getNodeStore();
        CountingDocumentStore countingDocStore2 = builder.actualStore;
        CountingTieredDiffCache countingDiffCache2 = builder.actualDiffCache;

        final DiffingObserver observer = new DiffingObserver(false);
        ns1.addObserver(observer);

        ns1.runBackgroundOperations();
        ns2.runBackgroundOperations();
        observer.processAll(); // to make sure we have an 'oldRoot'
        observer.clear();
        countingDocStore1.resetCounters();
        countingDocStore2.resetCounters();
        // countingDocStore1.printStacks = true;
        countingDiffCache1.resetLoadCounter();
        countingDiffCache2.resetLoadCounter();

        mk2.commit("/", "+\"regular1\": {}", null, null);
        mk2.commit("/", "+\"regular2\": {}", null, null);
        mk2.commit("/", "+\"regular3\": {}", null, null);
        mk2.commit("/regular2", "+\"regular4\": {}", null, null);
        // flush to journal
        ns2.runBackgroundOperations();

        // nothing notified yet
        assertEquals(0, observer.getTotal());
        assertEquals(0, countingDocStore1.getNumFindCalls(Collection.NODES));
        assertEquals(0, countingDocStore1.getNumQueryCalls(Collection.NODES));
        assertEquals(0, countingDocStore1.getNumRemoveCalls(Collection.NODES));
        assertEquals(0, countingDocStore1.getNumCreateOrUpdateCalls(Collection.NODES));
        assertEquals(0, countingDiffCache1.getLoadCount());

        // let node 1 read those changes
        // System.err.println("run background ops");
        ns1.runBackgroundOperations();
        mk2.commit("/", "+\"regular5\": {}", null, null);
        ns2.runBackgroundOperations();
        ns1.runBackgroundOperations();
        // and let the observer process everything
        observer.processAll();
        countingDocStore1.printStacks = false;

        // now expect 1 entry in rootStates
        assertEquals(2, observer.getTotal());
        assertEquals(0, countingDiffCache1.getLoadCount());
        assertEquals(0, countingDocStore1.getNumRemoveCalls(Collection.NODES));
        assertEquals(0, countingDocStore1.getNumCreateOrUpdateCalls(Collection.NODES));
        assertEquals(0, countingDocStore1.getNumQueryCalls(Collection.NODES));
//        assertEquals(0, countingDocStore1.getNumFindCalls(Collection.NODES));
    }

    @Test
    public void externalBranchChange() throws Exception {
        DocumentMK mk1 = createMK(1, 0);
        DocumentNodeStore ns1 = mk1.getNodeStore();
        DocumentMK mk2 = createMK(2, 0);
        DocumentNodeStore ns2 = mk2.getNodeStore();

        ns1.runBackgroundOperations();
        ns2.runBackgroundOperations();

        mk1.commit("/", "+\"regular1\": {}", null, null);
        // flush to journal
        ns1.runBackgroundOperations();
        mk1.commit("/regular1", "+\"regular1child\": {}", null, null);
        // flush to journal
        ns1.runBackgroundOperations();
        mk1.commit("/", "+\"regular2\": {}", null, null);
        // flush to journal
        ns1.runBackgroundOperations();
        mk1.commit("/", "+\"regular3\": {}", null, null);
        // flush to journal
        ns1.runBackgroundOperations();
        mk1.commit("/", "+\"regular4\": {}", null, null);
        // flush to journal
        ns1.runBackgroundOperations();
        mk1.commit("/", "+\"regular5\": {}", null, null);
        // flush to journal
        ns1.runBackgroundOperations();
        String b1 = mk1.branch(null);
        b1 = mk1.commit("/", "+\"branchVisible\": {}", b1, null);
        mk1.merge(b1, null);

        // to flush the branch commit either dispose of mk1
        // or run the background operations explicitly
        // (as that will propagate the lastRev to the root)
        ns1.runBackgroundOperations();
        ns2.runBackgroundOperations();

        String nodes = mk2.getNodes("/", null, 0, 0, 100, null);
        assertEquals("{\"branchVisible\":{},\"regular1\":{},\"regular2\":{},\"regular3\":{},\"regular4\":{},\"regular5\":{},\":childNodeCount\":6}", nodes);
    }

    /** Inspired by LastRevRecoveryTest.testRecover() - simplified and extended with journal related asserts **/
    @Test
    public void lastRevRecoveryJournalTest() throws Exception {
        doLastRevRecoveryJournalTest(false);
    }

    /** Inspired by LastRevRecoveryTest.testRecover() - simplified and extended with journal related asserts **/
    @Test
    public void lastRevRecoveryJournalTestWithConcurrency() throws Exception {
        doLastRevRecoveryJournalTest(true);
    }

    private void doLastRevRecoveryJournalTest(boolean testConcurrency) throws Exception {
        DocumentMK mk1 = createMK(1, 0);
        DocumentNodeStore ds1 = mk1.getNodeStore();
        int c1Id = ds1.getClusterId();
        DocumentMK mk2 = createMK(2, 0);
        DocumentNodeStore ds2 = mk2.getNodeStore();
        final int c2Id = ds2.getClusterId();

        // should have none yet
        assertEquals(0, countJournalEntries(ds1, 10));
        assertEquals(0, countJournalEntries(ds2, 10));

        //1. Create base structure /x/y
        NodeBuilder b1 = ds1.getRoot().builder();
        b1.child("x").child("y");
        ds1.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
        ds1.runBackgroundOperations();

        //lastRev are persisted directly for new nodes. In case of
        // updates they are persisted via background jobs

        //1.2 Get last rev populated for root node for ds2
        ds2.runBackgroundOperations();
        NodeBuilder b2 = ds2.getRoot().builder();
        b2.child("x").setProperty("f1","b1");
        ds2.merge(b2, EmptyHook.INSTANCE, CommitInfo.EMPTY);
        ds2.runBackgroundOperations();

        //2. Add a new node /x/y/z
        b2 = ds2.getRoot().builder();
        b2.child("x").child("y").child("z").setProperty("foo", "bar");
        ds2.merge(b2, EmptyHook.INSTANCE, CommitInfo.EMPTY);

        //Refresh DS1
        ds1.runBackgroundOperations();

        final NodeDocument z1 = getDocument(ds1, "/x/y/z");
        NodeDocument y1 = getDocument(ds1, "/x/y");
        final NodeDocument x1 = getDocument(ds1, "/x");

        Revision zlastRev2 = z1.getLastRev().get(c2Id);
        // /x/y/z is a new node and does not have a _lastRev
        assertNull(zlastRev2);
        Revision head2 = ds2.getHeadRevision().getRevision(ds2.getClusterId());

        //lastRev should not be updated for C #2
        assertNull(y1.getLastRev().get(c2Id));

        final LastRevRecoveryAgent recovery = new LastRevRecoveryAgent(ds1);

        // now 1 also has
        final String change1 = "{\"x\":{\"y\":{}}}";
        assertJournalEntries(ds1, change1);
        final String change2 = "{\"x\":{}}";
        assertJournalEntries(ds2, change2);

        String change2b = "{\"x\":{\"y\":{\"z\":{}}}}";

        if (!testConcurrency) {
            //Do not pass y1 but still y1 should be updated
            recovery.recover(Iterators.forArray(x1,z1), c2Id);

            //Post recovery the lastRev should be updated for /x/y and /x
            assertEquals(head2, getDocument(ds1, "/x/y").getLastRev().get(c2Id));
            assertEquals(head2, getDocument(ds1, "/x").getLastRev().get(c2Id));
            assertEquals(head2, getDocument(ds1, "/").getLastRev().get(c2Id));

            // now 1 is unchanged, but 2 was recovered now, so has one more:
            assertJournalEntries(ds1, change1); // unchanged
            assertJournalEntries(ds2, change2, change2b);

            // just some no-ops:
            recovery.recover(c2Id);
            recovery.recover(Iterators.<NodeDocument>emptyIterator(), c2Id);
            assertJournalEntries(ds1, change1); // unchanged
            assertJournalEntries(ds2, change2, change2b);

        } else {

            // do some concurrency testing as well to check if
            final int NUM_THREADS = 200;
            final CountDownLatch ready = new CountDownLatch(NUM_THREADS);
            final CountDownLatch start = new CountDownLatch(1);
            final CountDownLatch end = new CountDownLatch(NUM_THREADS);
            final List<Exception> exceptions = synchronizedList(new ArrayList<Exception>());
            for (int i = 0; i < NUM_THREADS; i++) {
                Thread th = new Thread(new Runnable() {

                    @Override
                    public void run() {
                        try {
                            ready.countDown();
                            start.await();
                            recovery.recover(Iterators.forArray(x1,z1), c2Id);
                        } catch (Exception e) {
                            exceptions.add(e);
                        } finally {
                            end.countDown();
                        }
                    }

                });
                th.start();
            }
            ready.await(5, TimeUnit.SECONDS);
            start.countDown();
            assertTrue(end.await(20, TimeUnit.SECONDS));
            assertJournalEntries(ds1, change1); // unchanged
            assertJournalEntries(ds2, change2, change2b);
            for (Exception ex : exceptions) {
                throw ex;
            }
        }
    }

    // OAK-3433
    @Test
    public void journalEntryKey() throws Exception {
        DocumentNodeStore ns1 = createMK(1, 0).getNodeStore();
        DocumentNodeStore ns2 = createMK(2, 0).getNodeStore();

        NodeBuilder b1 = ns1.getRoot().builder();
        b1.child("foo");
        ns1.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
        ns1.runBackgroundOperations();

        NodeBuilder b2 = ns2.getRoot().builder();
        b2.child("bar");
        ns2.merge(b2, EmptyHook.INSTANCE, CommitInfo.EMPTY);
        Revision h2 = ns2.getHeadRevision().getRevision(ns2.getClusterId());
        assertNotNull(h2);

        ns2.runBackgroundReadOperations();

        ns2.runBackgroundOperations();

        String id = JournalEntry.asId(h2);
        assertTrue("Background update did not create a journal entry with id " + id,
                ns1.getDocumentStore().find(Collection.JOURNAL, id) != null);
    }

    private DocumentMK createMK(int clusterId, int asyncDelay) {
        if (ds == null) {
            ds = new MemoryDocumentStore();
        }
        if (bs == null) {
            bs = new MemoryBlobStore();
        }
        return createMK(clusterId, asyncDelay, ds, bs);
    }
}


text:
// Provides default renderer for the sap.m.FeedListItem
sap.ui.define(['jquery.sap.global', './ListItemBaseRenderer', 'sap/ui/core/Renderer'],
	function(jQuery, ListItemBaseRenderer, Renderer) {
	"use strict";

	/**
	 * FeedListItem renderer.
	 * @namespace
	 */
	var FeedListItemRenderer = Renderer.extend(ListItemBaseRenderer);

	/**
	 * Make sure that parent li is displayed as a horizontal webkit-box.
	 *
	 * @param {sap.ui.core.RenderManager}
	 *          rm the RenderManager that can be used for writing to the Render-Output-Buffer
	 * @param {sap.ui.core.Control}
	 *          oFeedListItem an object representation of the feed list item that should be rendered
	 */
	FeedListItemRenderer.renderLIAttributes = function(rm, oFeedListItem) {
		rm.addClass("sapMFeedListItemTitleDiv");
		if (oFeedListItem._showSeparators === sap.m.ListSeparators.None) {
			rm.addClass("sapMFeedListShowSeparatorsNone");
		} else {
			rm.addClass("sapMFeedListShowSeparatorsAll");
		}

	};

	/**
	 * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
	 *
	 * @param {sap.ui.core.RenderManager}
	 *          rm the RenderManager that can be used for writing to the Render-Output-Buffer
	 * @param {sap.ui.core.Control}
	 *          oFeedListItem an object representation of the feed list item that should be rendered
	 */
	FeedListItemRenderer.renderLIContent = function(rm, oFeedListItem) {
		// convenience variable
		var sMyId = oFeedListItem.getId(), bIsPhone = sap.ui.Device.system.phone;

		rm.write('
');

		// icon
		if (!!oFeedListItem.getShowIcon()) {
			this._writeImageControl(rm, oFeedListItem, sMyId);
		}

		// text (starting with sender)

		if (bIsPhone) {
			rm.write('
');
			if (!!oFeedListItem.getSender()) {
				rm.write('
');
				rm.renderControl(oFeedListItem._getLinkSender(false));
				rm.write('
');
			}
			if (!!oFeedListItem.getTimestamp()) {
				// write date
				rm.write('
');
				rm.writeEscaped(oFeedListItem.getTimestamp());
				rm.write('
');
			}

			rm.write('
');
			rm.write('
');
			rm.write('');
			if (!!oFeedListItem._checkTextIsExpandable()) {
				this._writeCollapsedText(rm, oFeedListItem, sMyId);
			} else {
				rm.writeEscaped(oFeedListItem.getText(), true);
			}
			rm.write('');
			rm.write('
');
			if (!!oFeedListItem.getInfo()) {
				// info
				rm.write('
');
				if (!!oFeedListItem.getInfo()) {
					rm.write('');
					rm.writeEscaped(oFeedListItem.getInfo());
					rm.write('');
				}
			}
		} else {
			rm.write('
');
			rm.write('
');
			if (!!oFeedListItem.getSender()) {
				rm.write('');
				rm.renderControl(oFeedListItem._getLinkSender(true));
				rm.write(' ');
				rm.write('');
			}
			rm.write('');
			if (!!oFeedListItem._checkTextIsExpandable()) {
				this._writeCollapsedText(rm, oFeedListItem, sMyId);
			} else {
				rm.writeEscaped(oFeedListItem.getText(), true);
			}
			rm.write('');
			if (!!oFeedListItem.getInfo() || !!oFeedListItem.getTimestamp()) {
				// info and date
				rm.write('
');
				if (!sap.ui.getCore().getConfiguration().getRTL()) {
					if (!!oFeedListItem.getInfo()) {
						this._writeInfo(rm, oFeedListItem, sMyId);
						// Write Interpunct separator if necessary (with spaces before and after)
						if (!!oFeedListItem.getTimestamp()) {
							rm.write("&#160&#160&#x00B7&#160&#160");
						}
					}
					if (!!oFeedListItem.getTimestamp()) {
						this._writeTimestamp(rm, oFeedListItem, sMyId);
					}
				} else {
					if (!!oFeedListItem.getTimestamp()) {
						this._writeTimestamp(rm, oFeedListItem, sMyId);
					}
					if (!!oFeedListItem.getInfo()) {
						// Write Interpunct separator if necessary (with spaces before and after)
						if (!!oFeedListItem.getTimestamp()) {
							rm.write("&#160&#160&#x00B7&#160&#160");
						}
						this._writeInfo(rm, oFeedListItem, sMyId);
					}

				}

			}
			rm.write('
');
			rm.write('
');
		}
		rm.write('
');
	};

	FeedListItemRenderer._writeImageControl = function(rm, oFeedListItem, sMyId) {
		rm.write('
');

		if (!!oFeedListItem.getIconActive()) {
			rm.write('');
		}
		rm.renderControl(oFeedListItem._getImageControl());
		if (!!oFeedListItem.getIconActive()) {
			rm.write('');
		}
		rm.write('
');
	};

	FeedListItemRenderer._writeCollapsedText = function(rm, oFeedListItem, sMyId) {
		rm.writeEscaped(oFeedListItem._getCollapsedText(), true);
		rm.write('');
		rm.write('');
		rm.write("&#32&#46&#46&#46&#32"); // space + three dots + space
		rm.write('');
		var oLinkExpandCollapse = oFeedListItem._getLinkExpandCollapse();
		oLinkExpandCollapse.addStyleClass("sapMFeedListItemLinkExpandCollapse");
		rm.renderControl(oLinkExpandCollapse);
	};

	FeedListItemRenderer._writeTimestamp = function(rm, oFeedListItem, sMyId) {
		rm.write('');
		rm.writeEscaped(oFeedListItem.getTimestamp());
		rm.write('');
	};

	FeedListItemRenderer._writeInfo = function(rm, oFeedListItem, sMyId) {
		rm.write('');
		rm.writeEscaped(oFeedListItem.getInfo());
		rm.write('');
	};

	return FeedListItemRenderer;

}, /* bExport= */ true);