text:
> <%= description %>

## Install

```sh
$ npm install --save <%= _.slugify(moduleName) %>
```

## Usage

```js
var <%= _.camelize(moduleName) %> = require('<%= _.slugify(moduleName) %>');

<%= _.camelize(moduleName) %>()

```

<% if(cli) { %>
## CLI

```sh
$ npm install --global <%= _.slugify(moduleName) %>
```

```sh
$ <%= _.slugify(moduleName) %> --help

  Example
    <%= _.slugify(moduleName) %>

```
<% } %>

## API

#### Option

Type: `String`
Default: `undefined`

Description of the option.

## License

MIT © [<%= name %>](<%= website %>)

[travis-badge]: http://img.shields.io/travis/<%= githubUsername %>/<%= _.slugify(moduleName) %>.svg?style=flat-square
[travis-link]: https://travis-ci.org/<%= githubUsername %>/<%= _.slugify(moduleName) %>

[gemnasium-badge]: http://img.shields.io/gemnasium/<%= githubUsername %>/<%= _.slugify(moduleName) %>.svg?style=flat-square
[gemnasium-link]: https://gemnasium.com/<%= githubUsername %>/<%= _.slugify(moduleName) %>

[coveralls-badge]: http://img.shields.io/coveralls/<%= githubUsername %>/<%= _.slugify(moduleName) %>.svg?style=flat-square
[coveralls-link]: https://coveralls.io/r/<%= githubUsername %>/<%= _.slugify(moduleName) %>


text:
/*
 * Source: http://zetcode.com/gui/gtk2/menusandtoolbars/
 */

const gtk = require('../gtk2.js');

function show_popup(event, menu) {
  const RIGHT_CLICK = 3;
  const ev = gtk.get_current_event();
  if (ev.type === gtk.GDK.BUTTON_PRESS) {
     if (ev.button === RIGHT_CLICK) {
        menu.popup($nullptr, $nullptr, $nullptr, $nullptr,
              ev.button, ev.time);
     }
     return true; // true -> do not propagate the event further
  }
  return false;
}

function main() {
  let win = gtk.GtkWindow();
  win.set_position(gtk.WIN_POS_CENTER);
  win.set_default_size(300, 200);
  win.set_title("Popup menu");

  let ebox = gtk.GtkEventBox();
  win.add(ebox);

  let pmenu = gtk.GtkMenu();

  let hideMi = gtk.GtkMenuItem("Minimize");
  hideMi.show();
  pmenu.append(hideMi);

  let quitMi = gtk.GtkMenuItem("Quit");
  quitMi.show();
  pmenu.append(quitMi);

  hideMi.connect("activate", function(w) {
    w.iconify();
  }, win);

  quitMi.connect("activate", function(w) {
    w.destroy();
  }, win);

  ebox.connect("button-press-event", show_popup, pmenu);

  win.show_all();

  gtk.loop();
}

main();

redpajama_set_name: RedPajamaGithub


text:
package pwr.om.geneticalgorithm.bit;

import java.util.BitSet;

/**
 *
 * @author KonradOliwer
 */
public interface SelectionFunction {
    public void evaluate(BitSet[][] population, int[] populationFitnesFunctionValuse, int[] resultIndexes);
}


text:
require "spec_helper"
require "formatters/aaib_report_indexable_formatter"
require_relative "tribunal_decision_indexable_formatter_spec"

RSpec.describe UtaacDecisionIndexableFormatter do
  let(:sub_category) { [double] }
  let(:document) {
    double(
      :utaac_decision,
      body: double,
      slug: "/slug",
      summary: double,
      title: double,
      updated_at: double,
      minor_update?: false,
      public_updated_at: double,

      hidden_indexable_content: double,
      tribunal_decision_category: double,
      tribunal_decision_decision_date: double,
      tribunal_decision_judges: [double],
      tribunal_decision_sub_category: sub_category,
    )
  }

  subject(:formatter) { UtaacDecisionIndexableFormatter.new(document) }

  let(:document_type) { formatter.type }
  let(:humanized_facet_value) { double }
  include_context "schema with humanized_facet_value available"

  it_behaves_like "a specialist document indexable formatter"
  it_behaves_like "a tribunal decision indexable formatter"

  it "should have a type of utaac_decision" do
    expect(formatter.type).to eq("utaac_decision")
  end

  context "without hidden_indexable_content" do
    it "should have body as its indexable_content" do
      allow(document).to receive(:body).and_return("body text")

      allow(document).to receive(:hidden_indexable_content).and_return(nil)
      expect(formatter.indexable_attributes[:indexable_content]).to eq("body text")
    end
  end

  context "with hidden_indexable_content" do
    it "should have hidden_indexable_content as its indexable_content" do
      allow(document).to receive(:body).and_return("body text")
      allow(document).to receive(:hidden_indexable_content).and_return("hidden indexable content text")

      indexable = formatter.indexable_attributes[:indexable_content]
      expect(indexable).to eq("hidden indexable content text\nbody text")
    end
  end

end


text: typedef boost::mpl::vector<dynamicgraph::sot::FeatureVisualPoint> entities_t;


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace WebTemplate.Models
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;

    public partial class CONTRAST2Entities : DbContext
    {
        public CONTRAST2Entities()
            : base("name=CONTRAST2Entities")
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }

        public virtual DbSet<tb_m_destination> tb_m_destination { get; set; }
        public virtual DbSet<tb_m_divison> tb_m_divison { get; set; }
        public virtual DbSet<tb_m_lt_employee> tb_m_lt_employee { get; set; }
        public virtual DbSet<tb_m_lt_spec_employee> tb_m_lt_spec_employee { get; set; }
        public virtual DbSet<tb_m_overseas_allowance> tb_m_overseas_allowance { get; set; }
        public virtual DbSet<tb_m_rate_flight> tb_m_rate_flight { get; set; }
        public virtual DbSet<tb_m_rate_hotel> tb_m_rate_hotel { get; set; }
        public virtual DbSet<tb_m_rate_visa> tb_m_rate_visa { get; set; }
        public virtual DbSet<tb_m_spec_emp> tb_m_spec_emp { get; set; }
        public virtual DbSet<tb_r_travel_actualcost> tb_r_travel_actualcost { get; set; }
        public virtual DbSet<tb_r_travel_dit> tb_r_travel_dit { get; set; }
        public virtual DbSet<tb_r_travel_execution> tb_r_travel_execution { get; set; }
        public virtual DbSet<tb_r_travel_payment_allowance> tb_r_travel_payment_allowance { get; set; }
        public virtual DbSet<tb_r_travel_payment_verification> tb_r_travel_payment_verification { get; set; }
        public virtual DbSet<tb_r_travel_request> tb_r_travel_request { get; set; }
        public virtual DbSet<tb_r_travel_request_participant> tb_r_travel_request_participant { get; set; }
        public virtual DbSet<tb_r_travel_settlement> tb_r_travel_settlement { get; set; }
        public virtual DbSet<tb_r_travel_spec_employee> tb_r_travel_spec_employee { get; set; }
        public virtual DbSet<tb_m_employee> tb_m_employee { get; set; }
        public virtual DbSet<vw_request_summary> vw_request_summary { get; set; }
    }
}


text:
layout: post
category : solarnetwork
title: "SolarNetwork Development Environment"
tags : [solarnetwork]
---
{% include JB/setup %}

This post improves on an earlier one for [SolarDRAS development on OSX](http://blog.maxieduncan.co.nz/solarnetwork/2017/06/22/dras-developer-setup) and is based on improvements made to the SolarNetwork development environment over the last few months. In addition to improvements made to the vagrant developer VM, a native development environment can now be easily setup on OSX using scripts to automate the majority of the setup.

These steps are already covered quite well by the [solarnetwork-dev README](https://github.com/SolarNetwork/solarnetwork-dev) and the [Developer VM page](https://github.com/SolarNetwork/solarnetwork/wiki/Developer-VM) on the wiki; additionally detailed instructions for manually setting up an [eclipse development environment](https://github.com/SolarNetwork/solarnetwork/wiki/Eclipse-Setup-Guide) are provided. This post covers the steps I personally follow to get a development environment up and running.

## OSX
The following steps allow you to quickly get a development environment up and running natively on OSX.

### Requirements
You'll need to have the following software installed:
* [Eclipse](http://www.eclipse.org/downloads/)
* [PostgreSQL](https://www.postgresql.org/download/macosx/)
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

### Installation steps
* checkout the solarnetwork-dev project:
`git co https://github.com/SolarNetwork/solarnetwork-dev.git`
* go into the bin directory:
`cd solarnetwork-dev/bin`
* and run the ./setup.sh script to configure the eclipse workspace, initialise the DB and checkout the required projects:
`./setup.sh ~/solarnet-workspace`, feel free to replace ~/solarnet-workspace with your own custom location

You can now run Eclipse and point it to use the workspace you provided to the setup script, this is `~/solarnet-workspace` in the example provided. Once Eclipse is running jump down to the Final Steps section to begin development.

## Developer VM
The Developer VM takes longer to install but will work on Windows, Linux or OSX operating systems.

### Requirements:
You'll need to have the following software installed:
* [Vagrant](https://www.vagrantup.com/downloads.html)
* [Vagrant disksize plugin](https://github.com/sprotheroe/vagrant-disksize) - install via `vagrant plugin install vagrant-disksize`
* [Virtual Box](https://www.virtualbox.org/wiki/Downloads)
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - optional, you can just download the project from the GitHub website

### Installation steps
* checkout the solarnetwork-dev project:
`git co https://github.com/SolarNetwork/solarnetwork-dev.git`
* go into the vagrant configuration folder for development:
`cd ~/solarnet-dev/vagrant/solarnet-dev`
* (optional) personally at this stage I like to customise the Vagrant configuration by creating a file in this folder named:  `Vagrantfile.local`
```
cat > Vagrantfile.local <<EOF
desktop_packages='virtualbox-guest-dkms virtualbox-guest-additions-iso lubuntu-desktop chromium-browser'
memory_size=4048
no_of_cpus=2
EOF
```
this snippet uses a more user friendly desktop and increases the resources assigned to the VM from the defaults provided; you can change these settings and others as documented in the [README](https://github.com/SolarNetwork/solarnetwork-dev).
* lastly initialise the Virtual Machine:
`vagrant up`

The initialisation of the VM will take quite a while and you need to wait for the entire process to complete before you try logging into the VM. Once it's finished the login details are provided in a message at the end of the terminal output.

Once you log in you can complete the Final Steps below to begin development. It's likely you'll need to restart to the VM at this point if you want to get the screen resolution to resize automatically, which can be done using: `vagrant reload`.

## Final Steps
For both the native OSX installation and the Developer VM you'll want to run through the following steps so that you can begin development:
* (Optional) install the Spring Tools plugin in Eclipse
* [Eclipse Setup](https://github.com/SolarNetwork/solarnetwork/wiki/Developer-VM#eclipse-setup) - import the Project Set File to set up the eclipse projects and OSGi target
It's important to make sure you've followed the step to launch then stop the SolarNetwork platform at this stage, this is to generate the necessary X.509 certificates and you will encounter issues trying to access the applications if you haven't done this.
* [Create a development SolarNet account](https://github.com/SolarNetwork/solarnetwork/wiki/Developer-VM#create-a-development-solarnet-account)  - create a local account for testing
* [Set up development SolarNode](https://github.com/SolarNetwork/solarnetwork/wiki/Developer-VM#set-up-development-solarnode) - create a local node for testing


text:
#ifndef ZORBA_SAX2_API_H
#define ZORBA_SAX2_API_H

#include <zorba/config.h>
#include <zorba/api_shared_types.h>

namespace zorba{

class SAX2_Attributes;

/** \brief Receive notification of events that result from serializing
 *         a query result as XML.
 *
 * This is an interface that is used to receive notifications resulting
 * from parsing a query result that was serialized as XML.
 *
 * Instances of classes that implement this interface can be registered for
 * a query by calling the XQuery::registerSAXHandler or XQuery::executeSAX
 * function.
 */
class ZORBA_DLL_PUBLIC SAX2_ContentHandler
{
  public:

    /** \brief Destructor
     */
    virtual
    ~SAX2_ContentHandler() {}

    /** \brief Receive notification of the beginning of a document.
     */
    virtual void
    startDocument() = 0;

    /** \brief Receive notification of the end of a document.
     */
    virtual void
    endDocument() = 0;

    /** \brief Receive notification of the beginning of an element.
     *
     * Zorba's serializer will invoke this method at the beginning of every element
     * of the serialized query result; there will be a corresponding endElement()
     * event for every startElement() event (even when the element is empty).
     * All of the element's content will be reported, in order, before the
     * corresponding endElement() event.
     *
     * @param aURI the URI of the associated namespace for this element.
     * @param aLocalname thee local part of the element name.
     * @param aQName the QName of this element.
     * @param aAttrs the attributes attached to the element, if any.
     */
    virtual void
    startElement( const String& aURI, const String& aLocalname,
                  const String& aQName, const SAX2_Attributes& aAttrs ) = 0;

    /** \brief Receive notification of the end of an element.
     *
     * Zorba's serializerwill invoke this method at the end of every element in the serialized
     * query result document;  there will be a corresponding startElement() event for
     * every endElement() event (even when the element is empty).
     *
     * @param aURI the URI of the asscioated namespace for this element
     * @param aLocalname the local part of the element name
     * @param aQName the QName of this element
     */
    virtual void
    endElement( const String& aURI, const String& aLocalname, const String& aQName ) = 0;

    /** \brief Receive notification of character data.
     *
     * The serializer will call this method to report each chunk of character data.
     *
     * @param aText the characters from the serialized result.
     */
    virtual void
    characters( const String& aText ) = 0;

    /** \brief Receive notification of a processing instruction.
     *
     * The serializer will invoke this method once for each processing instruction found.
     *
     * @param aTarget the processing instruction target.
     * @param aData the processing instruction data, or null if none was supplied.
     */
    virtual void
    processingInstruction( const String& aTarget, const String& aData ) = 0;

    /** \brief Receive notification of ignorable whitespace in element content.
     *
     * @param aText the characters from the serialized query result.
     */
    virtual void
    ignorableWhitespace( const String& aText ) = 0;

    /** \brief Receive notification of the start of an namespace prefix mapping.
     *
     * @param aPrefix the namespace prefix used
     * @param aURI the namespace URI used.
     */
    virtual void
    startPrefixMapping( const String& aPrefix, const String& aURI ) = 0;

    /** \brief Receive notification of the end of an namespace prefix mapping.
     *
     * @param aPrefix the namespace prefix used.
     */
    virtual void
    endPrefixMapping( const String& aPrefix ) = 0;

    /** \brief Receive notification of a skipped entity.
     *
     * @param aName the name of the skipped entity.
     */
    virtual void
    skippedEntity( const	String& aName ) = 0;
};

class ZORBA_DLL_PUBLIC SAX2_Attributes
{
  public:
    virtual
    ~SAX2_Attributes() {}

    virtual unsigned int
    getLength() const = 0;

  	virtual const String
    getURI( const unsigned int index) const = 0;

    virtual const String
    getLocalName( const unsigned int index) const = 0;

    virtual const String
    getQName( const unsigned int index) const = 0;

    virtual const String
    getType( const unsigned int index) const = 0;

    virtual const String
    getValue( const unsigned int index) const = 0;

  	virtual int
    getIndex( const String & uri, const String & localPart ) const = 0 ;

  	virtual int
    getIndex(const String & qName ) const = 0 ;

  	virtual const
    String getType(const String & uri, const String & localPart ) const = 0 ;

    virtual const
    String getType( const String & qName ) const = 0;

  	virtual const
    String getValue( const String & uri, const String & localPart ) const = 0 ;

    virtual const
    String getValue( const String & qName ) const = 0;
};

class ZORBA_DLL_PUBLIC SAX2_LexicalHandler
{
  public:
    virtual
    ~SAX2_LexicalHandler () {}

    virtual void
    comment ( const String & chars ) = 0;

    virtual void
    endCDATA () = 0;

    virtual void
    endDTD () = 0;

    virtual void
    endEntity ( const String & name ) = 0;

    virtual void
    startCDATA () = 0;

    virtual void
    startDTD ( const String & name, const String & publicId,
               const String & systemId ) = 0;

    virtual void
    startEntity ( const String & name ) = 0;
};
}
//end namespace zorba
#endif
/* vim:set et sw=2 ts=2: */


text:
yum clean all
### Installing Required Dependencies ###
########################################

yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y python-setuptools
yum install -y python-daemon
yum install -y pystache
yum install -y python-ecdsa
yum install -y python-paramiko
yum install -y python-keyczar
yum install -y python-crypto
yum install -y python-httplib
yum install git -y
yum install wget -y
yum install sshpass -y

#Disable SSH Copy prompt#
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config

## The following code generates SSH Keys and copies it to other hosts ##
ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -b 4096 -N ''
sshpass -p "$4" ssh-copy-id "$3"@"$5"
sshpass -p "$4" ssh-copy-id "$3"@"$6"

#### Install Ansible ########
yum install ansible -y
#############################

wget http://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz
tar xvzf ansible-tower-setup*
cd ansible-tower-setup*

# Relax the min var requirements
sed -i -e "s/10000000000/100000000/" roles/preflight/defaults/main.yml
# Allow sudo with out tty
sed -i -e "s/Defaults    requiretty/Defaults    \!requiretty/" /etc/sudoers

cat <<EOF > inventory

[tower]

localhost ansible_connection=local

[database]
[all:vars]

admin_password="$1"

pg_host=''
pg_port=''

pg_database='awx'
pg_username='awx'
pg_password="$2"

rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password="$2"
rabbitmq_cookie=rabbitmqcookie

# Needs to be true for fqdns and ip addresses
rabbitmq_use_long_name=false

EOF

# Changing hostname of Ansible Tower VM #
hostnamectl set-hostname tower

ANSIBLE_BECOME_METHOD='sudo'
ANSIBLE_BECOME=True

### Install Ansible Tower ###
sudo bash setup.sh

### Disable SELinux ###
setenforce 0
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config

exit 0

exit 0


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book [
<!ENTITY PREFIX "rackconnect">
<!ENTITY PRODUCTNAME "RackConnect">
]>
  <book
    xmlns="http://docbook.org/ns/docbook"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:svg="http://www.w3.org/2000/svg"
    version="5.0"
    xml:id="&PREFIX;-releasenotes"
    status="DRAFT">
  <title>Rackspace &PRODUCTNAME; Release Notes</title>
    <?rax canonical.url.base="http://docs.rackspace.com/rackconnect/api/v3/rackconnect-releasenotes/content"?>
  <info>
    <copyright>
      <year>2013</year>
      <holder>Rackspace US, Inc.</holder>
    </copyright>
    <releaseinfo>API v1.0</releaseinfo>
    <productname>Rackspace &PRODUCTNAME;</productname>

    <abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:html="http://www.w3.org/1999/xhtml">
      <para>This document is intended for software developers interested in developing applications
        using the &PRODUCTNAME; Application Programming Interface (<abbrev>API</abbrev>). </para>
    </abstract>

    <pubdate></pubdate>
    <revhistory>
      <revision>
        <date>2011-03-01</date>
        <revdescription>
          <para>This is the revision history section. The technical
          writer updates this section when major changes are made to
          the doc to indicate what changed. Typically this will
          include links into the body of the document. From this
          element we generate the list in <xref
          linkend="change_history"/> as well as the atom feed for
          the document an <link xlink:href="../atom.xml">atom feed</link> for the document.
          <itemizedlist spacing="compact">
            <listitem>
                <para>Itemized lists are useful constructs for improving the readability of documents.</para>
              </listitem>
              <listitem>
                <para>One way that itemized lists improve readablity
                  is by adding whitespace between the list
                  items.</para>
              </listitem>
              <listitem>
                <para>Dates should be in the format YYYY-MM-DD.
                </para>
              </listitem>
            </itemizedlist></para>
        </revdescription>
      </revision>
      <revision>
        <date>2011-02-02</date>
        <revdescription>
          <para>This release fixed several bugs and, no doubt,
            introduced some new ones. Etiam eros ipsum, tempor ut
            laoreet nec, adipiscing vel eros. Integer sit amet nibh
            iaculis sapien sagittis blandit. Quisque vel lectus felis,
            vel congue lorem. Pellentesque vitae elit id sem faucibus
            ornare. Ut dictum dapibus quam, in scelerisque quam tempus
            sit amet. </para>
        </revdescription>
      </revision>
    </revhistory>
    <legalnotice role="rs-api">
      <annotation>
        <remark>Copyright details are filled in by the build system.</remark>
      </annotation>
    </legalnotice>

      <raxm:metadata xmlns:raxm="http://docs.rackspace.com/api/metadata">
        <raxm:displayname>Release Notes</raxm:displayname>
        <raxm:product version="3">&PREFIX;</raxm:product>
        <raxm:priority>30</raxm:priority>
      </raxm:metadata>
  </info>
  <preface xml:id="preface">
    <title>Preface</title>
    <para>Ipsum lorem lacus suscipit nunc, in consequat tortor turpis
      vel nibh. Nulla eros nulla, iaculis vel laoreet at, consectetur
      vitae massa. Praesent in imperdiet urna. Etiam commodo hendrerit
      tincidunt. Aliquam non tortor lectus, sit amet laoreet tortor.
      Vivamus sit amet tempor lorem. Fusce aliquam, lacus et eleifend
      auctor, augue justo consectetur risus, a congue arcu mi a velit.
      Donec lectus est, egestas eget laoreet a, accumsan ornare erat.
      Suspendisse sed nulla ligula.</para>

      <title>Intended Audience</title>
      <para>This document is intended for technical writers and
        developers who are learning to write DocBook documents. We
        assume you have the following skills:</para>
      <itemizedlist spacing="compact">
        <listitem>
          <para>Basic technical writing concepts</para>
        </listitem>
        <listitem>
          <para>Basic XML </para>
        </listitem>
      </itemizedlist>
      <para>Maecenas euismod, lectus vitae tincidunt sollicitudin, est
        lacus suscipit nunc, in consequat tortor turpis vel nibh.
        Nulla eros nulla, iaculis vel laoreet at, consectetur vitae
        massa. Praesent in imperdiet urna. Etiam commodo hendrerit
        tincidunt. Aliquam non tortor lectus, sit amet laoreet tortor.
        Vivamus sit amet tempor lorem. Fusce aliquam, lacus et
        eleifend auctor, augue justo consectetur risus, a congue arcu
        mi a velit. Donec lectus est, egestas eget laoreet a, accumsan
        ornare erat. Suspendisse sed nulla ligula.</para>
      <para>Maecenas euismod, <link
          xlink:href="http://www.rackspace.com">lectus</link> vitae
        tincidunt sollicitudin, est lacus suscipit nunc, in consequat
        tortor turpis vel nibh. Nulla eros nulla, iaculis vel laoreet
        at, consectetur vitae massa. </para>

      <title>Document Change History</title>
      <para>This section is generated dynamically from the
          <tag>revhistory</tag> element in <tag>book/info</tag>. The
        processing instruction <?rax revhistory?> is
        replaced at build-time with a formatted version of the
          <tag>revhistory</tag> section.</para>
      <para>
        <?rax revhistory?>
      </para>

  </preface>
  <chapter xml:id="Overview">
    <title>Introduction</title>

    <para>This would normally be a good place to introduce the product
      and API, but in this example document we'll look at some
      commonly used constructs. The following an image with a title
      using the <tag>figure</tag> element. The oXygen editor provides
      a convenient way to insert figures with the necessary markup.

        <title>An example of an .svg figure with a title</title>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/example.png"
              contentwidth="6in"/>
          </imageobject>
        </mediaobject>

    </para>
    <para>When creating an image or diagram, use the correct
      application and format for the situation. For images with lines
      and text, you should use this scalable vector graphic format ,
      SVG. SVG and other vector formats store the information as
      points, lines, and fonts. As a result, they are very crisp when
      printed and when scaled down or up. For screen shots and photos,
      vector formats add no real value since they can only store the
      raster image inside the vector as a binary blob. As a result,
      you should use the png format scaled to the appropriate
      size/resolution for your target browsers/screens. <itemizedlist>
        <listitem>
          <para>If you are creating an architectural diagram, seqence
            diagram, flowchart, or something like a drawing with lots
            of lines and text, then the preferred format is .svg.
            Typically these are created with tools like <link
              xlink:href="http://inkscape.org/">Inkscape</link>, Adobe
            Illustrator, <link
              xlink:href="https://www.omnigroup.com/products/omnigraffle/"
              >Omnigraffle</link>, or Visio.</para>
        </listitem>
        <listitem>
          <para>If you are working with screen shots or photos, use
            png and a tool suited for manipulating raster formats.
          </para>
        </listitem>
      </itemizedlist>Note that the for html output formats, the build
      system converts .svg images to .png at build time since not all
      browsers are capable of displaying .svg images. The .svg is used
      directly for pdf output however.

An example of a table with a title

        <col width="36%"/>
        <col width="13%"/>
        <col width="50%"/>

            Type of image
            Preferred format
            Tools

            Architectural diagrams, seqence diagrams, flowcharts,
              or drawings with lots of lines and text

              <para>.svg</para>

              <link xlink:href="http://inkscape.org/">Inkscape</link>,
              Adobe Illustrator, <link
                xlink:href="https://www.omnigroup.com/products/omnigraffle/"
                >Omnigraffle</link>, or Visio.

            A screen shot or picture

              <para>.png</para>

              <para>Any screen capture utility or raster image
                manipulating utility like the GIMP or Photoshop.
              </para>

    </para>
    <para>You can also include tables without titles. These are
        <tag>informaltable</tag>s in DocBook. <important>
        <para>When you insert tables, be sure always to switch to the
          html format instead of the CALS table format. For more
          information on tables see the <link
            xlink:href="http://docs.rackspace.com/writers-guide/content/ch_tables.html"
            >Writer's Guide</link>.</para>
        <para>Also note that this is an example of an admonition.
          DocBook supports the following admonitions: <tag>note</tag>,
            <tag>tip</tag>, <tag>important</tag>, <tag>caution</tag>,
          and <tag>warning</tag>.</para>
      </important>
    </para>

      <title>The xml:id attribute and linking</title>
      <para>You must add the <tag>xml:id</tag> attribute to all
          <tag>book</tag>s, <tag>chapter</tag>s, <tag>section</tag>s,
          <tag>appendix</tag>s, and <tag>preface</tag>s. These ids are
        used for more than one thing:<itemizedlist>
          <listitem>
            <para>The <tag>xml:id</tag> on the <tag>book</tag> element
              must be unique among all other Rackspace documents. This
              ensures that the <link xlink:href="http://disqus.com"
                >Disqus</link> comments are associated with that one
              document. See <link
                xlink:href="https://one.rackspace.com/display/C3/Disqus+project+identifiers"
                >Disqus project identifiers</link> for a list of
                <tag>xml:id</tag>s currently in use.</para>
          </listitem>
          <listitem>
            <para>The <tag>xml:id</tag> on each  <tag>chapter</tag>,
                <tag>section</tag>, <tag>appendix</tag>, and
                <tag>preface</tag> must be unique within the current
              book. These ids are used to generate the filename for
              the html format and also to associate the Disqus thread
              with that page. </para>
          </listitem>
        </itemizedlist></para>
      <para><?rax-fo keep-together?>The <tag>xml:id</tag> attribute is
        also important for linking within the document. You use the
          <tag>xref</tag> element with the <tag>linkend</tag>
        attribute to create a hyperlink from one section to another.
        At build-time, the <tag>xref</tag> is replaced with a
        hyperlink and link text appropriate to the format. For
        example, in html output an xref is just a hyperlink with the
        title of the target as the link text. In pdf output, which is
        intended for printing, the link text includes the page number
        of the target, though in the pdf, the link is also a hot link
        to the target. In the following example, preface
        is the value of the <tag>xml:id</tag> of the target:<programlisting language="xml"><xref linkend="preface"/></programlisting><important>
          <para>Avoid putting the <tag>xml:id</tag> attribute on the
              <tag>title</tag> tag. Instead put it on the element that
            contains the <tag>title</tag>. For example avoid doing
            this:<programlisting language="xml"><section><title xml:id="widgets">Understanding widgets</title>...</section> <!-- AVOID This! --></programlisting>Instead
            do
            this:<programlisting language="xml"><section xml:id="widgets"><title>Understanding widgets</title>...</section> <!-- Much better! --></programlisting></para>
        </important></para>
      <para>We soon hope to support the <tag>olink</tag> tag, which
        will allow you to link to other docs and provide a more
        convenient way to link within a document. </para>
      <para>If you need to link to a url, use the <tag>link</tag> tag
        and the <tag>xlink:href</tag> attribute. For example, the
        paragraph above contains some
        hyperlinks:<programlisting language="xml"><para>The <tag>xml:id</tag> on the <tag>book</tag> element
must be unique among all other Rackspace documents. This
ensures that the <link xlink:href="http://disqus.com"
>Disqus</link> comments are associated with that one
document. See <link
xlink:href="https://one.rackspace.com/display/C3/Disqus+project+identifiers"
>Disqus project identifiers</link> for a list of
<tag>xml:id</tag>s currently in use.</para></programlisting>
      </para>

      <title>Lists</title>
      <para>The DocBook vocabulary supports several kinds of lists.
        These lists can optionally have titles. <tip>
          <para>A common pitfall writers fall into is to create
            several small sections. This is suboptimal because you're
            giving the full weight of a title in the table of contents
            to something that may have a single sentence of content.
            What you probably want in this case is some kind of
            list.</para>
        </tip><itemizedlist>
          <title>Types of list in DocBook</title>
          <para>Notice that this list has a title and an introductary
            paragraph before the first list item. The title and intro
            para are optional.</para>
          <listitem>
            <para><tag>itemizedlist</tag>: A bulleted list. Your hands
              are soaking in one.</para>
          </listitem>
          <listitem>
            <para><tag>orderedlist</tag>: A numbered list. There are
              attributes that let you control the type of numbering
              and the start of the numbering for unusual
              situations.</para>
          </listitem>
          <listitem>
            <para><tag>procedure</tag>: This is a list of steps.
            </para>
          </listitem>
          <listitem>
            <para><tag>variablelist</tag>: This is a list where each
              item includes one or more <quote>terms</quote> followed
              by a block of text describing it. You can control the
              formatting so that it's formatted as blocks or as a
              runin head. I'll include examples later in this
              section.</para>
          </listitem>
          <listitem>
            <para><tag>simplelist</tag>: This is a list without
              bullets.</para>
          </listitem>
        </itemizedlist>The following are examples of
          <tag>variablelist</tag>s. Notice that the
          <quote>term</quote> is in bold. See <link
          xlink:href="http://www.sagehill.net/docbookxsl/Variablelists.html"
          >variablelist options</link> for detailed information on
        formatting variablelists.<variablelist>
          <title>Variablelist with default layout</title>
          <varlistentry>
            <term>itemizedlist</term>
            <listitem>
              <para>A bulleted list. Your hands are soaking in
                one.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>orderedlist</term>
            <listitem>
              <para> A numbered list. There are attributes that let
                you control the type of numbering and the start of the
                numbering for unusual situations.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>procedure</term>
            <listitem>
              <para>This is a list of steps. As with other lists,
                  <tag>procedure</tag>s can have <tag>title</tag>s and
                some content before the first step. One use for
                  <tag>procedure</tag>s is that you can create a list
                of procedures at the front of the book. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>variablelist</term>
            <listitem>
              <para>This is a list where each item includes one or
                more <quote>terms</quote> followed by a block of text
                describing it. You can control the formatting so that
                it's formatted as blocks or as a runin head. I'll
                include examples later in this section.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>simplelist</term>
            <listitem>
              <para>This is a list without bullets.</para>
            </listitem>
          </varlistentry>
        </variablelist><variablelist>
          <title>The same variablelist formatted as blocks</title>
          <?dbfo list-presentation="blocks"?>
          <?dbfo term-width=".75in"?>
          <?dbhtml list-presentation="table"?>
          <?dbhtml term-width="15%"  list-width="85%" ?>
          <varlistentry>
            <term>itemizedlist</term>
            <listitem>
              <para>A bulleted list. Your hands are soaking in
                one.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>orderedlist</term>
            <listitem>
              <para> A numbered list. There are attributes that let
                you control the type of numbering and the start of the
                numbering for unusual situations.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>procedure</term>
            <listitem>
              <para>This is a list of steps. As with other lists,
                  <tag>procedure</tag>s can have <tag>title</tag>s and
                some content before the first step. One use for
                  <tag>procedure</tag>s is that you can create a list
                of procedures at the front of the book. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>variablelist</term>
            <listitem>
              <para>This is a list where each item includes one or
                more <quote>terms</quote> followed by a block of text
                describing it. You can control the formatting so that
                it's formatted as blocks or as a runin head. I'll
                include examples later in this section.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>simplelist</term>
            <listitem>
              <para>This is a list without bullets.</para>
            </listitem>
          </varlistentry>
        </variablelist></para>

  </chapter>
  <chapter xml:id="other-features">
    <title>Conditional text/profiling</title>
    <para>One important feature of the publishing system is the
      ability to flag elements with certain attributes and produce
      different versions of the same document from the same source
      file. There are two scenarios in which you might use conditional text:<itemizedlist>
        <listitem>
          <para>Flagging content as internal, reviewer, or writeronly,
            for
            example:<programlisting><para security="internal">This para will not appear in the customer-facing external
verison of the document. It will appear in blue text in the internal version published on
docs-internal.rackspace.com. </para></programlisting>If
            you instead use <tag>security="reviewer"</tag> the content
            will appear only if you set
              <tag><security>reviewer</security></tag> in your
              <filename>pom.xml</filename> file. </para>
        </listitem>
        <listitem>
          <para>Using a feature-flag to control whether content
            appears:<programlisting><para condition="foo-feature">This will appear only if the parameter profileCondition
contains foo-feature in your pom.xml file.</para></programlisting>In
            your <filename>pom.xml</filename>, you can set
              <tag><profileCondition>foo-feature</profileCondition></tag>.
            Note that you can also use a semi-colon delimeted list:
              <tag><profileCondition>foo-feature;bar-feature</profileCondition></tag>
            to turn on elements with
              <tag>condition="foo-feature"</tag> and
              <tag>condition="bar-feature"</tag>.</para>
        </listitem>
      </itemizedlist></para>
  </chapter>

</book>


text:
package ru.job4j.sortuser;

/**
 * User for task "1. Организовать сортировку User".
 * @author Wladyslaw Lazin (wladislaw.lazin@gmail.com)
 * @version $Id$
 * @since 03.12.17
 */
public class User implements Comparable<User>{
    protected String name;
    protected int age;

    /**
     * Constructor for User.
     * @param name - String.
     * @param age - int.
     */
    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    /**
     * toString.
     * @return - String.
     */
    @Override
    public String toString() {
        return "User{" + "name='" + name + '\'' + ", age=" + age + '}';
    }

    @Override
    public int compareTo(User user) {
        final int res = Integer.compare(this.age, user.age);
        return res != 0 ? res : this.name.compareTo(user.name);
    }
}


text:
def fbcode_builder_spec(builder):
    builder.add_option("google/googletest:git_hash", "release-1.8.1")
    builder.add_option(
        "google/googletest:cmake_defines",
        {
            "BUILD_GTEST": "ON",
            # Avoid problems with MACOSX_RPATH
            "BUILD_SHARED_LIBS": "OFF",
        },
    )
    return {
        "steps": [
            builder.github_project_workdir("google/googletest", "build"),
            builder.cmake_install("google/googletest"),
        ],
    }


text:
require('babel-register')({extensions: ['.jsx', '.js']});
var Promise = require('bluebird');
var _ = require('lodash');

var cookie = require('cookie-parser');
var express = require('express');
var favicon = require('serve-favicon');
var logger = require('morgan');
var robots = require('robots.txt');

var React = require('react');
var ReactDOMServer = require('react-dom/server');

var routes = require('./handlers/router');
var pkg = require('./package.json');

var HtmlDocument = React.createFactory(require('./components/HtmlDocument').default);

var mode = process.env.MODE || 'test';
var port = process.env.PORT || 3000;

var bundle = [pkg.version, pkg.name].join('/');

var resources = (mode === 'local') ? [
  '/node_modules/es5-shim/es5-shim.js',
  '/node_modules/es5-shim/es5-sham.js',
  'http://localhost:8080/webpack-dev-server.js',
  'http://localhost:8080/static_assets/' + bundle + '.js'
] : [
  'es5-shim/' + pkg.devDependencies['es5-shim'] + '/es5-shim.min.js',
  'es5-shim/' + pkg.devDependencies['es5-shim'] + '/es5-sham.min.js',
  'lodash.js/' + pkg.dependencies.lodash + '/lodash.min.js',
  bundle + '.min.js'
].map(function (resource, index, resources) {
  var last = (index === (resources.length - 1));
  var host = (last) ? 'cdn.lihengl.com/blog/' : 'cdnjs.cloudflare.com/ajax/libs/';
  return ('https://' + host + resource);
});

var server = express().disable('x-powered-by').enable('strict routing');

server.render = Promise.promisify(function (pageData, callback) {
  var initialProps = _.assign(pageData, {resources: resources});
  var pageComponent = HtmlDocument(initialProps);
  var renderOutput = ReactDOMServer.renderToStaticMarkup(pageComponent);
  return callback(null, '<!DOCTYPE html>' + renderOutput);
});

server.set('mocking', (mode === 'local'));

['/static_assets', '/node_modules'].forEach(function (folder) {
  if (mode !== 'local') { return; }
  server.use(folder, express.static(__dirname + folder));
  return;
});

server.use(favicon(__dirname + '/favicon.ico'));
server.use(robots(__dirname + '/robots.txt'));
server.use(logger('combined'));
server.use(cookie());

server.use(function (req, res, next) {
  var api = pkg.backend;
  req.apihost = (mode === 'production') ? api.production : api.staging;
  res.locals.props = {height: 900, scroll: 0, timestamp: 0, width: 1440};
  return next();
});

server.use(routes);

server.use(function (err, req, res, next) {
  console.error('State: ' + JSON.stringify(res.locals));
  console.error(err.stack);
  res.status(500).type('text/plain').send(err.message);
  return next;
});

if (mode === 'local') {
  console.info('[%s] running on localhost:%d ...', pkg.name, port);
  server.listen(port);
} else {
  server.listen(port);
}


text:
'''
DESCRIPTION
Mount Callback is a complex example of a PySimpleClient which provides the
complete implementation of a BACI callback class and then retrieves a reference
to one of a Mount components
BACI properties. Once it is has the BACI property, a monitor is created which
is destroyed after ten seconds.

WHAT CAN I GAIN FROM THIS EXAMPLE?
- PySimpleClient usage.
- Accessing (remote) components.
- Manipulating BACI properties.
- Providing your own implementation of callback classes instead of using the Acspy.Common.Callbacks package.
- Creating monitors for BACI properties.

LINKS
- MyMonitor Class Documentation
- Mount IDL Documentation
'''
#------------------------------------------------------------------------------
from Acspy.Clients.SimpleClient import PySimpleClient # Import the acspy.PySimpleClient class
import ACS, ACS__POA                                  # Import the Python CORBA stubs for BACI
from   omniORB.CORBA import TRUE, FALSE
#------------------------------------------------------------------------------
#First a callback implementation class must be defined
class MyMonitor(ACS__POA.CBdouble):
    #------------------------------------------------------------------------------
    '''
    This class defines the method(s) that will be invoked asynchronously by the
    mount device for any monitors we may create.
    '''
    #------------------------------------------------------------------------------
    def __init__ (self, propName = None):
        '''
        If the propertys name is specified, it is printed to STDOUT later on.
        '''
        self.count = 0
        if propName != None:
            self.propName = propName
        else:
            self.propName = "NoName"
    #------------------------------------------------------------------------------
    def __del__(self):
        '''
        Do nothing
        '''
    #------------------------------------------------------------------------------
    def working (self, value, completion, desc):
        '''
        Really this is the method that does all the work and the developer should
        be concerned with.
        Parameters: value = the double we are interested in
                    completion = completion structure
                    desc = callback struct description
        '''
        self.count = self.count + 1
        if self.count <= 5:
            print "Working: ", str(self.propName), " is ", str(value)
    #------------------------------------------------------------------------------
    def done (self, value, completion, desc):
        '''
        Invoked asynchronously when the DO has finished.  Normally this is invoked
        just before a monitor is destroyed.
        Parameters: value = the final value of the double we are interested in
                    completion = completion structure
                    desc = callback struct description
        '''
        print "Done: ", str(self.propName), " is ", str(value)
    #------------------------------------------------------------------------------
    def negotiate (self, time_to_transmit, desc):
        '''
        For simplicitys sake, we always return true.  If you want more detailed,
        information on this method, please see the BACI specs.
        Parameters: See the BACI specs.
        '''
        return TRUE
#------------------------------------------------------------------------------

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

# Do something on a device.
simpleClient.getLogger().logInfo("We can directly manipulate a device once we get it, which is easy!!")

# Get the standard MOUNT1 Mount device
mount = simpleClient.getComponent("MOUNT1")
# Get the actAz property
actAzProperty = mount._get_actAz()

# Create a callback monitor for the actAz Property
cbMon = MyMonitor("actAz")
# Activate the callback monitor
cbMonServant = simpleClient.activateOffShoot(cbMon)
# Create the real monitor registered with MOUNT1
desc = ACS.CBDescIn(0L, 0L, 0L)
actMon = actAzProperty.create_monitor(cbMonServant, desc)

# Tell MOUNT1 that the monitor's working method should be invoked 1 once second
actMon.set_timer_trigger(10000000)
# destroy the monitor after ten seconds
from time import sleep
sleep(10)
actMon.destroy()
sleep(5)

# Release it
simpleClient.releaseComponent("MOUNT1")

simpleClient.disconnect()
print "The end __oOo__"


text:
namespace BudgetAnalyser.Engine.BankAccount
{
    /// <summary>
    ///     Represents a Chequing or transaction bank account. This is used as the main bank account.
    /// </summary>
    /// <seealso cref="BudgetAnalyser.Engine.BankAccount.Account" />
    public class ChequeAccount : Account
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="ChequeAccount" /> class.
        /// </summary>
        /// <param name="name">The name.</param>
        public ChequeAccount(string name)
        {
            Name = name;
        }

        /// <summary>
        ///     Gets the type or classification of the account.
        /// </summary>
        public override AccountType AccountType => AccountType.General;

        /// <summary>
        ///     Gets the path to an image asset.
        /// </summary>
        public override string ImagePath => "ChequeLogoImage";

        // TODO If multiple cheque (or multiple non-savings) accounts are ever allowed, this may need to be more robust.
        /// <summary>
        ///     Gets a value indicating whether this account is an account where salaries are credited into.
        /// </summary>
        /// <value>
        ///     <c>true</c> if this instance is salary account; otherwise, <c>false</c>.
        /// </value>
        public override bool IsSalaryAccount => true;

        internal virtual string[] KeyWords => new[] { "CHEQUE", "CHECK" };

        /// <summary>
        ///     Clones this instance and give the new clone the specified name.
        /// </summary>
        public virtual Account Clone(string name)
        {
            return new ChequeAccount(name);
        }
    }
}


text:
declare module ambiModule {
   export interface i1 { };
   export interface i2 { }
}

var n1: ambiModule.i1;
var n2: ambiModule.i2;

//// [semicolonsInModuleDeclarations.js]
var n1;
var n2;


text:
<?php
/**
 * @package axy\native
 * @author Oleg Grigoriev <go.vasac@gmail.com>
 */

namespace axy\native\tests\arrays\tst;

class TestDictionaryCountable extends TestDictionary implements \Countable
{
    /**
     * {@inheritdoc}
     */
    public function count()
    {
        return count($this->a);
    }
}


text:
package lightning.model

import argonaut.Argonaut.{ OptionDecodeJson, OptionEncodeJson, casecodec2 }
import argonaut.CodecJson
import scalaz.Equal
import scalaz.Equal.equalA

case class Visibility[T](item: T, visible: Boolean)

object Visibility {
  implicit def codec[T: CodecJson]() = casecodec2(Visibility.apply[T], Visibility.unapply[T])("item", "visibility")

  implicit def equal[T: Equal]() = equalA[Visibility[T]]
}


text:
SWARM_ROOT=${SWARM_ROOT:-${BATS_TEST_DIRNAME}/../..}

# Docker image and version to use for integration tests.
DOCKER_IMAGE=${DOCKER_IMAGE:-aluzzardi/docker}
DOCKER_VERSION=${DOCKER_VERSION:-1.5}

# Host on which the manager will listen to (random port between 6000 and 7000).
SWARM_HOST=127.0.0.1:$(( ( RANDOM % 1000 )  + 6000 ))

# Use a random base port (for engines) between 5000 and 6000.
BASE_PORT=$(( ( RANDOM % 1000 )  + 5000 ))

# Join an array with a given separator.
function join() {
	local IFS="$1"
	shift
	echo "$*"
}

# Run the swarm binary.
function swarm() {
	${SWARM_ROOT}/swarm "$@"
}

# Waits until the given docker engine API becomes reachable.
function wait_until_reachable() {
	local attempts=0
	local max_attempts=5
	until docker -H $1 info || [ $attempts -ge $max_attempts ]; do
		echo "Attempt to connect to ${HOSTS[$i]} failed for the $((++attempts)) time" >&2
		sleep 0.5
	done
	[[ $attempts -lt $max_attempts ]]
}

# Start the swarm manager in background.
function start_manager() {
	${SWARM_ROOT}/swarm manage -H $SWARM_HOST "$@" `join , ${HOSTS[@]}` &
	SWARM_PID=$!
	wait_until_reachable $SWARM_HOST
}

# Stops the manager.
function stop_manager() {
	kill $SWARM_PID
}

# Run the docker CLI against swarm.
function docker_swarm() {
	docker -H $SWARM_HOST "$@"
}

# Start N docker engines.
function start_docker() {
	local current=${#DOCKER_CONTAINERS[@]}
	local instances="$1"
	shift
	local i

	# Start the engines.
	for ((i=current; i < (current + instances); i++)); do
		local port=$(($BASE_PORT + $i))
		HOSTS[$i]=127.0.0.1:$port
		DOCKER_CONTAINERS[$i]=$(docker run -d --name node-$i -h node-$i --privileged -p 127.0.0.1:$port:$port -it ${DOCKER_IMAGE}:${DOCKER_VERSION} docker -d -H 0.0.0.0:$port "$@")
	done

	# Wait for the engines to be reachable.
	for ((i=current; i < (current + instances); i++)); do
		wait_until_reachable ${HOSTS[$i]}
	done
}

# Stop all engines.
function stop_docker() {
	for id in ${DOCKER_CONTAINERS[@]}; do
		echo "Stopping $id"
		docker rm -f -v $id > /dev/null;
	done
}


text:
package com.lightcrafts.media.jai.opimage;
import java.awt.image.RenderedImage;
import com.lightcrafts.mediax.jai.BorderExtender;
import com.lightcrafts.mediax.jai.ImageLayout;
import com.lightcrafts.mediax.jai.RasterAccessor;
import java.util.Map;
import com.lightcrafts.mediax.jai.operator.MaxFilterDescriptor;
// import com.lightcrafts.media.jai.test.OpImageTester;

/**
 * An OpImage class to perform max filtering on a source image.
 *
 */
final class MaxFilterXOpImage extends MaxFilterOpImage {

    /**
     * Creates a MaxFilterXOpImage with the given source and
     * maskSize.  The image dimensions are derived from the source
     * image.  The tile grid layout, SampleModel, and ColorModel may
     * optionally be specified by an ImageLayout object.
     *
     * @param source a RenderedImage.
     * @param extender a BorderExtender, or null.
     * @param layout an ImageLayout optionally containing the tile grid layout,
     *        SampleModel, and ColorModel, or null.
     */
    public MaxFilterXOpImage(RenderedImage source,
                             BorderExtender extender,
                             Map config,
                             ImageLayout layout,
                             int maskSize) {
        super(source,
              extender,
              config,
              layout,
              MaxFilterDescriptor.MAX_MASK_PLUS,
              maskSize);
    }

    protected void byteLoop(RasterAccessor src,
                            RasterAccessor dst,
                            int filterSize) {
        int dwidth = dst.getWidth();
        int dheight = dst.getHeight();
        int dnumBands = dst.getNumBands();

        byte dstDataArrays[][] = dst.getByteDataArrays();
        int dstBandOffsets[] = dst.getBandOffsets();
        int dstPixelStride = dst.getPixelStride();
        int dstScanlineStride = dst.getScanlineStride();

        byte srcDataArrays[][] = src.getByteDataArrays();
        int srcBandOffsets[] = src.getBandOffsets();
        int srcPixelStride = src.getPixelStride();
        int srcScanlineStride = src.getScanlineStride();
	int scanPlusPixelStride = srcScanlineStride+srcPixelStride;
	int scanMinusPixelStride = srcScanlineStride-srcPixelStride;
	int topRightOffset = srcPixelStride*(filterSize-1);

        int maxval, val;
        int wp = filterSize;
        int offset = filterSize/2;

        for (int k = 0; k < dnumBands; k++)  {
            byte dstData[] = dstDataArrays[k];
            byte srcData[] = srcDataArrays[k];
            int srcScanlineOffset = srcBandOffsets[k];
            int dstScanlineOffset = dstBandOffsets[k];
            for (int j = 0; j < dheight; j++)  {
                int srcPixelOffset = srcScanlineOffset;
                int dstPixelOffset = dstScanlineOffset;

                for (int i = 0; i < dwidth; i++)  {
                    maxval = Integer.MIN_VALUE;

                    // figure out where the top left of the X starts
                    int imageOffset = srcPixelOffset;
                    for (int u = 0; u < wp; u++)  {
                        val = (int)(srcData[imageOffset]&0xff);
                        imageOffset += scanPlusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    // figure out where the top right of the X starts
                    imageOffset = srcPixelOffset + topRightOffset;

                    for (int v = 0; v < wp; v++)  {
                        val = (int)(srcData[imageOffset]&0xff);
                        imageOffset += scanMinusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    dstData[dstPixelOffset] = (byte)maxval;
                    srcPixelOffset += srcPixelStride;
                    dstPixelOffset += dstPixelStride;
                }
                srcScanlineOffset += srcScanlineStride;
                dstScanlineOffset += dstScanlineStride;
            }
        }
    }

    protected void shortLoop(RasterAccessor src,
                             RasterAccessor dst,
                             int filterSize)  {
        int dwidth = dst.getWidth();
        int dheight = dst.getHeight();
        int dnumBands = dst.getNumBands();

        short dstDataArrays[][] = dst.getShortDataArrays();
        int dstBandOffsets[] = dst.getBandOffsets();
        int dstPixelStride = dst.getPixelStride();
        int dstScanlineStride = dst.getScanlineStride();

        short srcDataArrays[][] = src.getShortDataArrays();
        int srcBandOffsets[] = src.getBandOffsets();
        int srcPixelStride = src.getPixelStride();
        int srcScanlineStride = src.getScanlineStride();
	int scanPlusPixelStride = srcScanlineStride+srcPixelStride;
	int scanMinusPixelStride = srcScanlineStride-srcPixelStride;
	int topRightOffset = srcPixelStride*(filterSize-1);

        int maxval, val;
        int wp = filterSize;
        int offset = filterSize/2;

        for (int k = 0; k < dnumBands; k++)  {
            short dstData[] = dstDataArrays[k];
            short srcData[] = srcDataArrays[k];
            int srcScanlineOffset = srcBandOffsets[k];
            int dstScanlineOffset = dstBandOffsets[k];
            for (int j = 0; j < dheight; j++)  {
                int srcPixelOffset = srcScanlineOffset;
                int dstPixelOffset = dstScanlineOffset;

                for (int i = 0; i < dwidth; i++)  {
                    maxval = Integer.MIN_VALUE;

                    // figure out where the top left of the X starts
                    int imageOffset =
                        srcPixelOffset;
                    for (int u = 0; u < wp; u++)  {
                        val = (int)(srcData[imageOffset]);
                        imageOffset += scanPlusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    // figure out where the top right of the X starts
                    imageOffset = srcPixelOffset + topRightOffset;

                    for (int v = 0; v < wp; v++)  {
                        val = (int)(srcData[imageOffset]);
                        imageOffset += scanMinusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    dstData[dstPixelOffset] = (short)maxval;
                    srcPixelOffset += srcPixelStride;
                    dstPixelOffset += dstPixelStride;
                }
                srcScanlineOffset += srcScanlineStride;
                dstScanlineOffset += dstScanlineStride;
            }
        }
    }

    protected void ushortLoop(RasterAccessor src,
                              RasterAccessor dst,
                              int filterSize)  {
        int dwidth = dst.getWidth();
        int dheight = dst.getHeight();
        int dnumBands = dst.getNumBands();

        short dstDataArrays[][] = dst.getShortDataArrays();
        int dstBandOffsets[] = dst.getBandOffsets();
        int dstPixelStride = dst.getPixelStride();
        int dstScanlineStride = dst.getScanlineStride();

        short srcDataArrays[][] = src.getShortDataArrays();
        int srcBandOffsets[] = src.getBandOffsets();
        int srcPixelStride = src.getPixelStride();
        int srcScanlineStride = src.getScanlineStride();
	int scanPlusPixelStride = srcScanlineStride+srcPixelStride;
	int scanMinusPixelStride = srcScanlineStride-srcPixelStride;
	int topRightOffset = srcPixelStride*(filterSize-1);

        int maxval, val;
        int wp = filterSize;
        int offset = filterSize/2;

        for (int k = 0; k < dnumBands; k++)  {
            short dstData[] = dstDataArrays[k];
            short srcData[] = srcDataArrays[k];
            int srcScanlineOffset = srcBandOffsets[k];
            int dstScanlineOffset = dstBandOffsets[k];
            for (int j = 0; j < dheight; j++)  {
                int srcPixelOffset = srcScanlineOffset;
                int dstPixelOffset = dstScanlineOffset;

                for (int i = 0; i < dwidth; i++)  {
                    maxval = Integer.MIN_VALUE;

                    // figure out where the top left of the X starts
                    int imageOffset =
                        srcPixelOffset;
                    for (int u = 0; u < wp; u++)  {
                        val = (int)(srcData[imageOffset]&0xffff);
                        imageOffset += scanPlusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    // figure out where the top right of the X starts
                    imageOffset = srcPixelOffset + topRightOffset;

                    for (int v = 0; v < wp; v++)  {
                        val = (int)(srcData[imageOffset]&0xffff);
                        imageOffset += scanMinusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    dstData[dstPixelOffset] = (short)maxval;
                    srcPixelOffset += srcPixelStride;
                    dstPixelOffset += dstPixelStride;
                }
                srcScanlineOffset += srcScanlineStride;
                dstScanlineOffset += dstScanlineStride;
            }
        }
    }

    protected void intLoop(RasterAccessor src,
                           RasterAccessor dst,
                           int filterSize)  {
        int dwidth = dst.getWidth();
        int dheight = dst.getHeight();
        int dnumBands = dst.getNumBands();

        int dstDataArrays[][] = dst.getIntDataArrays();
        int dstBandOffsets[] = dst.getBandOffsets();
        int dstPixelStride = dst.getPixelStride();
        int dstScanlineStride = dst.getScanlineStride();

        int srcDataArrays[][] = src.getIntDataArrays();
        int srcBandOffsets[] = src.getBandOffsets();
        int srcPixelStride = src.getPixelStride();
        int srcScanlineStride = src.getScanlineStride();
	int scanPlusPixelStride = srcScanlineStride+srcPixelStride;
	int scanMinusPixelStride = srcScanlineStride-srcPixelStride;
	int topRightOffset = srcPixelStride*(filterSize-1);

        int maxval, val;
        int wp = filterSize;
        int offset = filterSize/2;

        for (int k = 0; k < dnumBands; k++)  {
            int dstData[] = dstDataArrays[k];
            int srcData[] = srcDataArrays[k];
            int srcScanlineOffset = srcBandOffsets[k];
            int dstScanlineOffset = dstBandOffsets[k];
            for (int j = 0; j < dheight; j++)  {
                int srcPixelOffset = srcScanlineOffset;
                int dstPixelOffset = dstScanlineOffset;

                for (int i = 0; i < dwidth; i++)  {
                    maxval = Integer.MIN_VALUE;

                    // figure out where the top left of the X starts
                    int imageOffset =
                        srcPixelOffset;
                    for (int u = 0; u < wp; u++)  {
                        val = srcData[imageOffset];
                        imageOffset += scanPlusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    // figure out where the top right of the X starts
                    imageOffset = srcPixelOffset + topRightOffset;

                    for (int v = 0; v < wp; v++)  {
                        val = srcData[imageOffset];
                        imageOffset += scanMinusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    dstData[dstPixelOffset] = maxval;
                    srcPixelOffset += srcPixelStride;
                    dstPixelOffset += dstPixelStride;
                }
                srcScanlineOffset += srcScanlineStride;
                dstScanlineOffset += dstScanlineStride;
            }
        }
    }

    protected void floatLoop(RasterAccessor src,
                             RasterAccessor dst,
                             int filterSize)  {
        int dwidth = dst.getWidth();
        int dheight = dst.getHeight();
        int dnumBands = dst.getNumBands();

        float dstDataArrays[][] = dst.getFloatDataArrays();
        int dstBandOffsets[] = dst.getBandOffsets();
        int dstPixelStride = dst.getPixelStride();
        int dstScanlineStride = dst.getScanlineStride();

        float srcDataArrays[][] = src.getFloatDataArrays();
        int srcBandOffsets[] = src.getBandOffsets();
        int srcPixelStride = src.getPixelStride();
        int srcScanlineStride = src.getScanlineStride();
	int scanPlusPixelStride = srcScanlineStride+srcPixelStride;
	int scanMinusPixelStride = srcScanlineStride-srcPixelStride;
	int topRightOffset = srcPixelStride*(filterSize-1);

        float maxval, val;
        int wp = filterSize;
        int offset = filterSize/2;

        for (int k = 0; k < dnumBands; k++)  {
            float dstData[] = dstDataArrays[k];
            float srcData[] = srcDataArrays[k];
            int srcScanlineOffset = srcBandOffsets[k];
            int dstScanlineOffset = dstBandOffsets[k];
            for (int j = 0; j < dheight; j++)  {
                int srcPixelOffset = srcScanlineOffset;
                int dstPixelOffset = dstScanlineOffset;

                for (int i = 0; i < dwidth; i++)  {
                    maxval = -Float.MAX_VALUE;

                    // figure out where the top left of the X starts
                    int imageOffset =
                        srcPixelOffset;
                    for (int u = 0; u < wp; u++)  {
                        val = srcData[imageOffset];
                        imageOffset += scanPlusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    // figure out where the top right of the X starts
                    imageOffset = srcPixelOffset + topRightOffset;

                    for (int v = 0; v < wp; v++)  {
                        val = srcData[imageOffset];
                        imageOffset += scanMinusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    dstData[dstPixelOffset] = maxval;
                    srcPixelOffset += srcPixelStride;
                    dstPixelOffset += dstPixelStride;
                }
                srcScanlineOffset += srcScanlineStride;
                dstScanlineOffset += dstScanlineStride;
            }
        }
    }

    protected void doubleLoop(RasterAccessor src,
                              RasterAccessor dst,
                              int filterSize)  {
        int dwidth = dst.getWidth();
        int dheight = dst.getHeight();
        int dnumBands = dst.getNumBands();

        double dstDataArrays[][] = dst.getDoubleDataArrays();
        int dstBandOffsets[] = dst.getBandOffsets();
        int dstPixelStride = dst.getPixelStride();
        int dstScanlineStride = dst.getScanlineStride();

        double srcDataArrays[][] = src.getDoubleDataArrays();
        int srcBandOffsets[] = src.getBandOffsets();
        int srcPixelStride = src.getPixelStride();
        int srcScanlineStride = src.getScanlineStride();
	int scanPlusPixelStride = srcScanlineStride+srcPixelStride;
	int scanMinusPixelStride = srcScanlineStride-srcPixelStride;
	int topRightOffset = srcPixelStride*(filterSize-1);

        double maxval, val;
        int wp = filterSize;
        int offset = filterSize/2;

        for (int k = 0; k < dnumBands; k++)  {
            double dstData[] = dstDataArrays[k];
            double srcData[] = srcDataArrays[k];
            int srcScanlineOffset = srcBandOffsets[k];
            int dstScanlineOffset = dstBandOffsets[k];
            for (int j = 0; j < dheight; j++)  {
                int srcPixelOffset = srcScanlineOffset;
                int dstPixelOffset = dstScanlineOffset;

                for (int i = 0; i < dwidth; i++)  {
                    maxval = -Double.MAX_VALUE;

                    // figure out where the top left of the X starts
                    int imageOffset =
                        srcPixelOffset;
                    for (int u = 0; u < wp; u++)  {
                        val = srcData[imageOffset];
                        imageOffset += scanPlusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    // figure out where the top right of the X starts
                    imageOffset = srcPixelOffset + topRightOffset;

                    for (int v = 0; v < wp; v++)  {
                        val = srcData[imageOffset];
                        imageOffset += scanMinusPixelStride;
			maxval = (val > maxval) ? val : maxval;
                    }

                    dstData[dstPixelOffset] = maxval;
                    srcPixelOffset += srcPixelStride;
                    dstPixelOffset += dstPixelStride;
                }
                srcScanlineOffset += srcScanlineStride;
                dstScanlineOffset += dstScanlineStride;
            }
        }
    }

//     public static OpImage createTestImage(OpImageTester oit) {
//         return new MaxFilterXOpImage(oit.getSource(), null, null,
//                                         new ImageLayout(oit.getSource()),
//                                         3);
//     }
}


text:
package com.google.javascript.jscomp.deps;

import com.google.javascript.jscomp.ErrorManager;

/** GWT compatible no-op replacement for {@code JsFileRegexParser} */
public final class JsFileRegexParser {
  public JsFileRegexParser(ErrorManager errorManager) {}

  public JsFileRegexParser setModuleLoader(ModuleLoader loader) {
    throw new UnsupportedOperationException("JsFileRegexParser.setModuleLoader not implemented");
  }

  public JsFileRegexParser setIncludeGoogBase(boolean include) {
    throw new UnsupportedOperationException("JsFileRegexParser.setIncludeGoogBase not implemented");
  }

  public DependencyInfo parseFile(String filePath, String closureRelativePath,
      String fileContents) {
    throw new UnsupportedOperationException("JsFileRegexParser.parseFile not implemented");
  }

  public static boolean isSupported() {
    return false;
  }
}


text:
package com.carlosdelachica.easyrecycleradapters.recycler_view_manager;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.carlosdelachica.easyrecycleradapters.adapter.EasyRecyclerAdapter;

import java.util.List;

import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.LayoutManager;

import static com.carlosdelachica.easyrecycleradapters.adapter.EasyViewHolder.OnItemClickListener;
import static com.carlosdelachica.easyrecycleradapters.adapter.EasyViewHolder.OnItemLongClickListener;

public class EasyRecyclerViewManager {

    private RecyclerView recyclerView;
    private TextView emptyLoadingListTextView;
    private EasyRecyclerAdapter adapter;
    private LayoutManager layoutManager;
    private Context context;
    private OnItemClickListener itemClickListener;
    private OnItemLongClickListener longClickListener;
    private DividerItemDecoration dividerItemDecoration;
    private String loadingListText;
    private String emptyListText;
    private int loadingTextColor;
    private int emptyListTextColor;
    private boolean clipToPadding;
    private boolean hasFixedSize;
    private View loadingView;
    private View emptyView;

    EasyRecyclerViewManager(Context context,
                            RecyclerView recyclerView,
                            LayoutManager layoutManager,
                            EasyRecyclerAdapter adapter,
                            TextView emptyLoadingListTextView,
                            String emptyListText,
                            int emptyTextColor,
                            String loadingListText,
                            int loadingTextColor,
                            OnItemLongClickListener longClickListener,
                            OnItemClickListener clickListener,
                            DividerItemDecoration dividerDrawableRes,
                            boolean clipToPadding,
                            boolean hasFixedSize,
                            View loadingView,
                            View emptyView) {
        this.context = context;
        this.recyclerView = recyclerView;
        this.layoutManager = layoutManager;
        this.adapter = adapter;
        this.emptyLoadingListTextView = emptyLoadingListTextView;
        this.emptyListText = emptyListText;
        this.emptyListTextColor = emptyTextColor;
        this.loadingListText = loadingListText;
        this.loadingTextColor = loadingTextColor;
        this.longClickListener = longClickListener;
        this.itemClickListener = clickListener;
        this.dividerItemDecoration = dividerDrawableRes;
        this.clipToPadding = clipToPadding;
        this.hasFixedSize = hasFixedSize;
        this.loadingView = loadingView;
        this.emptyView = emptyView;
        initRecyclerView();
    }

    private void initRecyclerView() {
        recyclerView.setClipToPadding(clipToPadding);
        recyclerView.setHasFixedSize(hasFixedSize);
        initAdapter();
        initLayoutManager();
        initItemDecorations();
        initEmptyListTextView();
    }

    private void initAdapter() {
        recyclerView.setAdapter(adapter);
        initListeners();
    }

    private void initListeners() {
        adapter.setOnClickListener(itemClickListener);
        adapter.setOnLongClickListener(longClickListener);
    }

    private void initLayoutManager() {
        recyclerView.setLayoutManager(layoutManager);
    }

    private void initItemDecorations() {
        initDivider();
    }

    private void initDivider() {
        recyclerView.addItemDecoration(dividerItemDecoration);
    }

    private void initEmptyListTextView() {
        updateEmptyListTextView(EmptyLoadingListTextViewState.LOADING);
    }

    public RecyclerView getRecyclerView() {
        return recyclerView;
    }

    public void setRecyclerViewPadding(int left, int top, int right, int bottom) {
        recyclerView.setPadding(left, top, right, bottom);
    }

    public int getCount() {
        return adapter.getItemCount();
    }

    public void add(Object object, int position) {
        adapter.add(object, position);
        updateLoadedListTextView();
    }

    public void add(Object data) {
        adapter.add(data);
        updateLoadedListTextView();
    }

    public void addAll(List<?> data) {
        adapter.addAll(data);
        updateLoadedListTextView();
    }

    public boolean update(Object data, int position) {
        return adapter.update(data, position);
    }

    public void remove(Object data) {
        adapter.remove(data);
        updateLoadedListTextView();
    }

    public void remove(int position) {
        adapter.remove(position);
        updateLoadedListTextView();
    }

    public Object getItem(int position) {
        return adapter.get(position);
    }

    public void onRefresh() {
        updateLoadingListTextView();
        adapter.clear();
    }

    private void updateLoadedListTextView() {
        updateEmptyListTextView(adapter.getItemCount() > 0 ? EmptyLoadingListTextViewState.HIDDEN : EmptyLoadingListTextViewState.EMPTY);
    }

    private void updateLoadingListTextView() {
        updateEmptyListTextView(EmptyLoadingListTextViewState.LOADING);
    }

    private void updateEmptyListTextView(EmptyLoadingListTextViewState state) {
        switch (state) {
            case HIDDEN:
                setAuxLoadingViewVisible(false);
                setAuxEmptyViewVisible(false);
                setAuxTextViewVisible(false);
                break;
            case EMPTY:
                setAuxLoadingViewVisible(false);
                setAuxEmptyViewVisible(true);
                setAuxTextViewVisible(true);
                setAuxTextViewText(emptyListText);
                setAuxTextViewTextColor(emptyListTextColor);
                break;
            case LOADING:
                setAuxLoadingViewVisible(true);
                setAuxEmptyViewVisible(false);
                setAuxTextViewVisible(true);
                setAuxTextViewText(loadingListText);
                setAuxTextViewTextColor(loadingTextColor);
                break;
        }
    }

    private void setAuxLoadingViewVisible(boolean visible) {
        if (loadingView == null) {
            return;
        }
        loadingView.setVisibility(visible ? View.VISIBLE : View.GONE);
    }

    private void setAuxEmptyViewVisible(boolean visible) {
        if (emptyView == null) {
            return;
        }
        emptyView.setVisibility(visible ? View.VISIBLE : View.GONE);
    }

    private void setAuxTextViewText(String text) {
        if (emptyLoadingListTextView == null) {
            return;
        }
        emptyLoadingListTextView.setText(text);
    }

    private void setAuxTextViewTextColor(int color) {
        if (emptyLoadingListTextView == null) {
            return;
        }
        emptyLoadingListTextView.setTextColor(color);
    }

    private void setAuxTextViewVisible(boolean visible) {
        if (emptyLoadingListTextView == null) {
            return;
        }
        emptyLoadingListTextView.setVisibility(visible ? View.VISIBLE : View.GONE);
    }

    public void setLayoutManager(LayoutManager layoutManager) {
        recyclerView.setLayoutManager(layoutManager);
    }

    public void setEmptyLoadingListTextView(TextView emptyLoadingListTextView) {
        this.emptyLoadingListTextView = emptyLoadingListTextView;
    }

    public void setEmptyViewText(String emptyListText) {
        this.emptyListText = emptyListText;
    }

    public void setEmptyListTextColor(int emptyListTextColor) {
        this.emptyListTextColor = emptyListTextColor;
    }

    public void setLoadingListText(String loadingListText) {
        this.loadingListText = loadingListText;
    }

    public void setLoadingTextColor(int loadingTextColor) {
        this.loadingTextColor = loadingTextColor;
    }

    public void setLoadingView(View loadingView) {
        this.loadingView = loadingView;
    }

    public void setEmptyView(View emptyView) {
        this.emptyView = emptyView;
    }

    public static class Builder extends EasyRecyclerViewManagerBuilder {
        public Builder(RecyclerView recyclerView, EasyRecyclerAdapter adapter) {
            super(recyclerView, adapter);
        }
    }

}


text:
namespace blink {

// Indicates how the service worker handled an event.
enum WebServiceWorkerEventResult {
    // The event dispatch completed with no rejections.
    WebServiceWorkerEventResultCompleted = 0,
    // The service worker associated the event with a promise that was rejected
    // (e.g., the promise passed to waitUntil for an install event was rejected).
    WebServiceWorkerEventResultRejected,
    WebServiceWorkerEventResultLast = WebServiceWorkerEventResultRejected
};

} // namespace blink

#endif // WebServiceWorkerEventResult_h