text:
<!--
###############################################################################
#
# file:     README.md
#
# Purpose:  holds basic information about termsaver application,
#           in markdown format for GitHub.
#
# Note:     This file is part of Termsaver application, and should not be used
#           or executed separately.
#
###############################################################################
#
# Copyright 2012 Termsaver
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
###############################################################################
-->

LOOKING FOR MAINTAINERS! - Ping me if you are up to the task :blush:
=========

TermSaver
=========

*A simple text-based screensaver for terminal windows.*

![termsaver](https://github.com/brunobraga/termsaver/raw/master/extras/termsaver-main_medium.jpeg)

Background
----------

The motivation behind this project is basically pure boredom (laughs).
Seriously, it may look like nonsense to have a screensaver look-alike program
running on a terminal window. Nonetheless, sometimes, we still want to see some
kind of movement, or action on the screen... which invigorates one's state of
mind and helps concentration back to the black screen (well, some people like
it white, meh!).

If you are:

  * looking for some extra display on your main terminal window, to keep the
    screen busy while you are up to something else; or
  * looking for some distractions that may entertain you after too many hours
    in front of the terminal; or
  * with plenty of screen space (so long 80x25 default terminal window! long
    live 1920px...), and use many terminals on screen; or
  * just wanting to pretend you are busy with something (this is terrible)

then, TermSaver is the **right** application for you.

Requirements
------------

  * Linux, or Mac (or Windows too, but you are on your own)
  * Python 3.x (Python 2.x was deprecated since 08-2020)

Installation
------------

#### Apt (Advanced Packaging Tool)

For Ubuntu (12.10+) distro, you can use:

        sudo apt-get install termsaver

#### Pip (Pip Installs Packages, for Python Package Index)

For those using others, and still want to do it the easy way, I recommend:

        sudo pip install termsaver

#### From the Source

For the brave (laughs), you can compile/install from the source:

1. Download the Source
[here](http://pypi.python.org/pypi/termsaver/)
2. Unpack it

        tar -zxvf termsaver-{version}.tar.gz

3. Install it

        sudo python setup.py install

#### PPA (Personal Package Archive)

If you can't wait for Debian/Ubuntu releases, you can get the latest packages from:

        sudo add-apt-repository ppa:bruno-braga/termsaver
        sudo apt-get update
        sudo apt-get install termsaver

Features
--------

The TermSaver is a very simple application, built with the idea to allow more
screensavers to be added to its core. Developers, please read the section below.

The current published screensavers are:

#### Ascii Art Farts

This is a screensaver that displays ascii art from asciiartfarts.com
RSS feed in an animation format.

#### Clock

This is a screensaver that displays a digital clock using ascii letters.

#### Img2Ascii

This is a screensaver that displays images using ascii letters.

#### Jokes For All

This is a screensaver that displays recent jokes from <http://jokes4all.net>
website, from its hourly updated [RSS](http://en.wikipedia.org/wiki/RSS) feed.

#### Matrix

This is a screensaver that displays falling (rising) Japanese characters
simulating the screen from the movie
[The Matrix](http://en.wikipedia.org/wiki/The_Matrix).

#### Programmer

This is a screensaver that displays source code from a specified path in
visual animation. If the [pygments](https://pygments.org/) package is installed, this screensaver
will apply syntax highlighting based on the file type.

#### Quotes For All

This is a screensaver that displays recent quotes from <http://quotes4all.net>
website, from its hourly updated [RSS](http://en.wikipedia.org/wiki/RSS) feed.

#### Random Text

This is a screensaver that displays a text (your name, or whatever) on a
 randomized position of the screen, changing position every N seconds.

#### Request for Comments

This is a screensaver that fetches documents from RFC (Request for Comments)
in visual animation, which are documents elaborated by the  Internet
Engineering Task Force, available at <http://tools.ietf.org/rfc/>. This
screensaver randomizes documents to display, from a list of latest valid
documents. See more information about this in
[Wikipedia](http://en.wikipedia.org/wiki/Request_for_Comments).

#### RSS Feeds

This is a screensaver that displays any
[RSS](http://en.wikipedia.org/wiki/RSS) feed you want to show in your
terminal, with customizable settings and format.

#### URL Fetcher

This is a screensaver that displays content from a specified
[URL](http://en.wikipedia.org/wiki/Uniform_resource_locator) directly
on screen, in visual animation.

#### Star Wars Asciimation

This is a screensaver that displays the Star Wars Asciimation from
<http://asciimation.co.nz>.

#### Sysmon

(For Linux/Mac systems only) Displays the CPU/Memory usage over time in a graphic
alike screensaver.

 - - -

**Disclaimer Note**: termsaver holds no responsibility for the contents offered
by third-parties, nor it has controls to filter them. Use it at your own risk.

Developers
----------

A more detailed guideline for developers willing to jump in and create
screensavers for termsaver is here: <https://github.com/brunobraga/termsaver/wiki/Developers>

Roadmap
-------

There is no current roadmap defined, besides improvement tickets created in
[Issues](https://github.com/brunobraga/termsaver/issues) tab in GitHub.
Refer also to <http://github.com/brunobraga/termsaver/wiki/Brainstorming> for
some insights of stuff we are thinking about.

Contribute
----------

### Translation

The internationalization of this application follows same standards of most
applications out there, by using *gettext* and MO/PO files.

The translation is still being finished up, and when it is ready for
contributor calls, we will post detailed information about the procedure.

### Screensavers (plugin)

As of v0.2, full plugin support is available, find an example here:

https://github.com/brunobraga/termsaver-figlet

### Submit a bug

If you find any errors in this application, you are more than welcome to
participate. You can:

* report the bug: <https://github.com/brunobraga/termsaver/issues>

* Fork this project: <https://github.com/brunobraga/termsaver/fork>

Uninstall
----------

### Using Apt (Advanced Packaging Tool) or PPA (Personal Package Archive)

        sudo apt-get remove termsaver

### Using Pip (Pip Install Packages, for Python Package Index)

        sudo pip uninstall termsaver

### Manual Uninstall

Just remove manually the following files:

        # For Linux boxes
        rm -rvf /usr/local/bin/termsaver

        # change your python version/location here
        rm -rvf /usr/local/lib/python3.x/dist-packages/termsaver*

        rm -rvf /usr/local/share/man/man1/termsaver.1
        find /usr/local/share/locale/ -name "termsaver.mo" -exec rm -rfv {} \;

If the actuall location differ from the above, it might be worth it to just
run the find command and look for them yourself (should not be hard):

        find /usr/ -name "*termsaver*"


text:
'use strict';

var _								= require('lodash'),
util								= require('util'),
SVGSpriteBase						= require('./base'),
SVGSprite							= require('../sprite');

/**
 * CSS sprite
 *
 * @param {SVGSpriter} spriter		SVG spriter
 * @param {Object} config			Configuration
 * @param {Object} data				Base data
 * @param {String} key				Mode key
 */
function SVGSpriteCss(spriter, config, data, key) {
	SVGSpriteBase.apply(this, [spriter, config, data, key]);
}

/**
 * Prototype
 *
 * @type {Object}
 */
SVGSpriteCss.prototype = _.create(SVGSpriteBase.prototype, {
	constructor						: SVGSpriteCss,
	mode							: SVGSpriteBase.prototype.MODE_CSS,
	tmpl							: 'css',

	LAYOUT_VERTICAL					: 'vertical',
	LAYOUT_HORIZONTAL				: 'horizontal',
	LAYOUT_DIAGONAL					: 'diagonal',
	LAYOUT_PACKED					: 'packed'
});

/**
 * Initialization (non-CSS modes)
 *
 * @return {void}
 */
SVGSpriteCss.prototype._init = function() {

	// Prepare the dimension suffix
	if (this.config.dimensions && (this.config.dimensions !== true)) {
		this.config.dimensions		= /%s/g.test((this.config.dimensions || '').split('%%').join('')) ? util.format(this.config.dimensions, this.config.prefix) : (this.config.prefix + this.config.dimensions);
	}

	// Determine the mixin mode and name
	switch(typeof this.config.mixin) {

		// String: Use the given string as mixin name
		case 'string':
			this.config.mixin		= this.config.mixin.trim().length ? this.config.mixin.trim() : null;
			break;

		// Boolean: Use the common CSS class name (if any)
		case 'boolean':
			this.config.mixin		= !!this.config.common ? this.config.common : null;
			break;

		// Default: Don't use mixin
		default:
			this.config.mixin		= null;
			break;
	}

	// Refine the base data
	this.data						= _.assign(this.data, {
		hasCommon					: !!this.config.common,
		common						: this.config.common,
		commonName					: this.config.common || 'svg-common',
		hasMixin					: !!this.config.mixin,
		mixinName					: this.config.mixin,
		includeDimensions			: !!this.config.dimensions,
		spriteWidth					: 0,
		spriteHeight				: 0
	});

	// Determine if this sprite accepts displaced shape copies
	this._displaceable				= ([this.LAYOUT_VERTICAL, this.LAYOUT_HORIZONTAL].indexOf(this.config.layout) >= 0);
};

/**
 * Layout the sprite
 *
 * @param {Array} files				Files
 * @param {Function} cb				Callback
 * @return {void}
 */
SVGSpriteCss.prototype.layout = function(files, cb) {

	// Layout the sprite
	var config						= this._layout();

	// Build the sprite SVG file
	files.sprite					= this._buildSVG(config.xmlDeclaration || '', config.doctypeDeclaration || '');
	this._spriter.verbose('Created «%s» SVG sprite file («%s» mode)', this.key, this.mode);

	// Build the configured CSS resources
	this._buildCSSResources(files, function(error) {

		// In case of errors: Break
		if (error) {
			cb(error);

		// Else: Build the HTML example
		} else {
			this._buildHTMLExample(files, cb);
		}
	}.bind(this));
};

/**
 * Layout the sprite (internal)
 *
 * @return {Object}					Sprite configuration
 */
SVGSpriteCss.prototype._layout = function() {

	// Build a map of shape IDs that need to get a ':regular' pseudo class in CSS
	var pseudoShapeMap				= {};
	this._spriter._shapes.forEach(function(shape) {
		pseudoShapeMap[shape.base]	= pseudoShapeMap[shape.base] || !!shape.state;
	}, this._spriter);

	// Layout the sprite
	this[(this.config.layout === this.LAYOUT_PACKED) ? '_layoutBinPacked' : '_layoutSimple'](pseudoShapeMap);

	// Refine the shape data
	var xmlDeclaration				= null,
	doctypeDeclaration				= null,
	positionMap						= {};
	this.data.shapes.forEach(function(shape, index) {

		// Skip non-master shapes for all but orthogonal layouts
		if (this._displaceable || !shape.master) {
			xmlDeclaration			= xmlDeclaration || this._spriter._shapes[index].xmlDeclaration;
			doctypeDeclaration		= doctypeDeclaration || this._spriter._shapes[index].doctypeDeclaration;
			var x, y;

			// For vertical layouts: Set the horizontal alignment
			if (this.config.layout === this.LAYOUT_VERTICAL) {
				x					= this._spriter._shapes[index].align * 100;
				shape.position.absolute.x		= this._spriter._shapes[index]._round(- x * (this.data.spriteWidth - shape.width.outer) / 100);

			// Else: Determine the relative horizontal position
			} else {
				x					= shape.position.absolute.x ? (100 * Math.abs(shape.position.absolute.x) / (this.data.spriteWidth - shape.width.outer)) : 0;
			}

			// For horizontal layouts: Set the vertical alignment
			if (this.config.layout === this.LAYOUT_HORIZONTAL) {
				y					= this._spriter._shapes[index].align * 100;
				shape.position.absolute.y		= this._spriter._shapes[index]._round(- y * (this.data.spriteHeight - shape.height.outer) / 100);

			// Else: Determine the relative vertical position
			} else {
				y					= shape.position.absolute.y ? (100 * Math.abs(shape.position.absolute.y) / (this.data.spriteHeight - shape.height.outer)) : 0;
			}

			// Set the relative position
			shape.position.relative	= {
				x					: x,
				y					: y,
				xy					: this._addUnit(x, '%') + ' ' + this._addUnit(y, '%')
			};

			if (!shape.master) {
				positionMap[this._spriter._shapes[index].id]	= _.pick(shape.position.absolute, ['x', 'y']);
			}

			// Rework zero-valued positions
			var svg					= shape.svg.split('>');

			// Replace zero-valued x-positions
			var svgX				= svg[0].split(' x="0"');
			if (svgX.length > 1) {
				x					= shape.master ? (shape.position.absolute.x - positionMap[shape.master].x) : shape.position.absolute.x;
				svg[0]				= svgX.join(x ? (' x="' + (-x) + '"') : '');
			}

			// Replace zero-valued y-positions
			var svgY				= svg[0].split(' y="0"');
			if (svgY.length > 1) {
				y					= shape.master ? (shape.position.absolute.y - positionMap[shape.master].y) : shape.position.absolute.y;
				svg[0]				= svgY.join(y ? (' y="' + (-y) + '"') : '');
			}

			shape.svg				= svg.join('>');
		}

	}, this);

	// Remove all non-master shapes for non-displaceable sprites
	if (!this._displaceable) {
		this.data.shapes				= _.reject(this.data.shapes, function(shape){ return !!shape.master; });
	}

	return {
		xmlDeclaration				: xmlDeclaration,
		doctypeDeclaration			: doctypeDeclaration
	};
};

/**
 * Layout a simple CSS sprite
 *
 * @param {Object} pseudoShapeMap	Pseudo shape map
 * @return {SVGSpriteCss}			Self reference
 */
SVGSpriteCss.prototype._layoutSimple = function(pseudoShapeMap) {
	this._spriter._shapes.forEach(function(shape, index){
		if (this._displaceable || !shape.master) {
			this._addShapeToSimpleCssSprite(shape, pseudoShapeMap[shape.base], index, !index + (index === this._spriter._shapes.length - 1) * 2);
		}
	}, this);
	return this;
};

/**
 * Add a single shape to the simple CSS sprite
 *
 * @param {SVGShape} shape			Shape
 * @param {Boolean} needsRegular	Needs a :regular pseudo class in CSS
 * @param {Number} index			Index
 * @param {Number} position			Position bits
 */
SVGSpriteCss.prototype._addShapeToSimpleCssSprite = function(shape, needsRegular, index, position) {
	var dimensions					= shape.getDimensions(),
		rootAttributes				= {id: shape.id},
		positionX					= 0,
		positionY					= 0;

	switch (this.config.layout) {

		// Horizontal sprite arrangement
		case this.LAYOUT_HORIZONTAL:
			rootAttributes.y		= 0;
			rootAttributes.x		= this.data.spriteWidth;
			positionX				= -this.data.spriteWidth;

			this.data.spriteWidth	= Math.ceil(this.data.spriteWidth + dimensions.width);
			this.data.spriteHeight	= Math.max(this.data.spriteHeight, dimensions.height);
			break;

		// Diagonal sprite arrangement
		case this.LAYOUT_DIAGONAL:
			rootAttributes.x		= this.data.spriteWidth;
			rootAttributes.y		= this.data.spriteHeight;
			positionX				= -this.data.spriteWidth;
			positionY				= -this.data.spriteHeight;

			this.data.spriteWidth	= Math.ceil(this.data.spriteWidth + dimensions.width);
			this.data.spriteHeight	= Math.ceil(this.data.spriteHeight + dimensions.height);
			break;

		// Vertical sprite arrangement (default)
		default:
			rootAttributes.x		= 0;
			rootAttributes.y		= this.data.spriteHeight;
			positionY				= -this.data.spriteHeight;

			this.data.spriteWidth	= Math.max(this.data.spriteWidth, dimensions.width);
			this.data.spriteHeight	= Math.ceil(this.data.spriteHeight + dimensions.height);
	}

	this._addShapeToCSSSprite(shape, needsRegular, index, position, this._refineRootAttributes(shape, index, rootAttributes), positionX, positionY);
};

/**
 * Layout a binpacked CSS sprite
 *
 * @see http://codeincomplete.com/posts/2011/5/7/bin_packing/
 * @param {Object} pseudoShapeMap	Pseudo shape map
 * @return {SVGSpriteCss}			Self reference
 */
SVGSpriteCss.prototype._layoutBinPacked = function(pseudoShapeMap) {
	var SVGSpriteCssPacker			= require('./css/packer'),
	packer							= new SVGSpriteCssPacker(this._spriter._shapes),
	positions						= packer.fit();

	// Run through all shapes and add them to the sprite
	this._spriter._shapes.forEach(function(shape, index){

		// Skip non-master shapes
		if (!shape.master) {
			var dimensions			= shape.getDimensions(),
			position				= positions[index],
			rootAttributes			= {id: shape.id, x: position.x, y: position.y};

			this.data.spriteWidth	= Math.max(this.data.spriteWidth, Math.ceil(position.x + dimensions.width));
			this.data.spriteHeight	= Math.max(this.data.spriteHeight, Math.ceil(position.y + dimensions.height));

			this._addShapeToCSSSprite(shape, pseudoShapeMap[shape.base], index, !index + (index === this._spriter._shapes.length - 1) * 2, this._refineRootAttributes(shape, index, rootAttributes), -position.x, -position.y);
		}
	}, this);

	return this;
};

/**
 * Refine the root attributes set on each nested shape
 *
 * @param {SVGShape} shape			Shape
 * @param {Number} index			Index
 * @param {Object} rootAttributes	Root element attributes
 * @return {Object}					Refined root element attributes
 */
SVGSpriteCss.prototype._refineRootAttributes = function(shape, index, rootAttributes) {
	return rootAttributes;
};

/**
 * Add a single shape to a CSS sprite
 *
 * @param {SVGShape} shape			Shape
 * @param {Boolean} needsRegular	Needs a :regular pseudo class in CSS
 * @param {Number} index			Index
 * @param {Number} position			Position bits
 * @param {Number} rootAttributes	Root element attributes
 * @param {Number} positionX		Horizontal position within the sprite
 * @param {Number} positionY		Vertical position within the sprite
 */
SVGSpriteCss.prototype._addShapeToCSSSprite = function(shape, needsRegular, index, position, rootAttributes, positionX, positionY) {

	// Prepare the selectors
	var selector					= {
		shape						: (needsRegular || shape.state) ? [{
			expression				: util.format(this.config.prefix, shape.base + (shape.state ? (':' + shape.state) : '')),
			raw						: util.format(this.config.prefix, shape.base + (shape.state ? (':' + shape.state) : '')),
			first					: true,
			last					: false
		}, {
			expression				: util.format(this.config.prefix, shape.base + '\\:' + (shape.state || 'regular')),
			raw						: util.format(this.config.prefix, shape.base + ':' + (shape.state || 'regular')),
			first					: false,
			last					: true
		}] : [{
			expression				: util.format(this.config.prefix, shape.base),
			raw						: util.format(this.config.prefix, shape.base),
			first					: true,
			last					: true
		}]
	};

	// Prepare the dimension properties
	if (this.config.dimensions !== true) {
		selector.dimensions			= shape.state ? [{
			expression				: util.format(this.config.dimensions, shape.base) + ':' + shape.state,
			raw						: util.format(this.config.dimensions, shape.base) + ':' + shape.state,
			first					: true,
			last					: false
		}, {
			expression				: util.format(this.config.dimensions, shape.base + '\\:' + shape.state),
			raw						: util.format(this.config.dimensions, shape.base + ':' + shape.state),
			first					: false,
			last					: true
		}] : [{
			expression				: util.format(this.config.dimensions, shape.base),
			raw						: util.format(this.config.dimensions, shape.base),
			first					: true,
			last					: true
		}];
	}

	// Register the SVG parameters
	_.assign(this.data.shapes[index], {
		first						: !!(position & 1),
		last						: !!(position & 2),
		position					: {
			absolute				: {
				x					: positionX,
				y					: positionY,
				xy					: this._addUnit(positionX, 'px') + ' ' + this._addUnit(positionY, 'px')
			}
		},
		selector					: selector,
		dimensions					: {
			inline					: (this.config.dimensions === true),
			extra					: !!(_.isString(this.config.dimensions) && this.config.dimensions.length)
		}
	});

	// Create the SVG getter/setter
	Object.defineProperty(this.data.shapes[index], '_svg', {
	    enumerable					: false,
	    writable					: true
	});
	this.data.shapes[index].__defineGetter__('svg', function() {
		return this._svg || shape.getSVG(true, function(shapeDOM) {
			for (var r in rootAttributes) {
				shapeDOM.setAttribute(r, rootAttributes[r]);
			}
		});
	});
	this.data.shapes[index].__defineSetter__('svg', function(svg) {
		this._svg					= svg;
	});
};

/**
 * Build the CSS sprite
 *
 * @param {String} xmlDeclaration			XML declaration
 * @param {String} doctypeDeclaration		Doctype declaration
 * @return {File}							SVG sprite file
 */
SVGSpriteCss.prototype._buildSVG = function(xmlDeclaration, doctypeDeclaration) {
	var rootAttributes				= _.extend(
		{},
		this.config.svg.rootAttributes,
		this.config.svg.dimensionAttributes ? {
			width					: this.data.spriteWidth,
			height					: this.data.spriteHeight
		} : {},
		{
			viewBox					: '0 0 ' + this.data.spriteWidth + ' ' + this.data.spriteHeight
		}
	),
	svg								= new SVGSprite(this.declaration(this.config.svg.xmlDeclaration, xmlDeclaration), this.declaration(this.config.svg.doctypeDeclaration, doctypeDeclaration), rootAttributes, true, this.config.svg.transform);
	svg.add(_.pluck(this.data.shapes, 'svg'));

	return svg.toFile(this._spriter.config.dest, this._addCacheBusting(svg));
};

/**
 * Module export
 */
module.exports = SVGSpriteCss;

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;

namespace _360Courier.Extensions
{
    [Obsolete]
    public static class DebuggingConsole
    {
#if DEBUG
        [DllImport("kernel32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        static extern bool AllocConsole();
#endif

        [Conditional("DEBUG")]
        public static void Exit()
        {
            Console.ForegroundColor = ConsoleColor.Magenta;
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey(true);
            Environment.Exit(0);
        }

        [Conditional("DEBUG")]
        public static void Open()
        {
#if DEBUG
            AllocConsole();
#endif

            Console.WriteLine(
@"
DEBUG MODE:
============");
            var args = Environment.GetCommandLineArgs();
            Display(ConsoleColor.Gray, "Args : {0}", args.Length);
            for (int index = 0; index < args.Length; index++)
            {
                var arg = args[index];
                Display(ConsoleColor.Gray, "{0:D2}:[{1}]", index, arg);
            }
        }

        [Conditional("DEBUG")]
        public static void PressSpaceToContinue()
        {
            Console.ForegroundColor = ConsoleColor.Magenta;
            var top = Console.CursorTop;
            var left = Console.CursorLeft;
            Console.WriteLine("Press space to continue");
            var keyInfo = Console.ReadKey(true);
            if (keyInfo.Key != ConsoleKey.Spacebar)
            {
                Console.ForegroundColor = ConsoleColor.Gray;
                Exit();
            }
            Console.CursorTop = top;
            Console.CursorLeft = left;
            Console.WriteLine("                        ");
            Console.CursorTop = top;
            Console.CursorLeft = left;
        }

        [Conditional("DEBUG")]
        public static void PressAnyKeyToContinue()
        {
            Console.ForegroundColor = ConsoleColor.Magenta;
            Console.WriteLine("Press any key to continue");
            Console.ReadKey(true);
        }

        [Conditional("DEBUG")]
        public static void ReportAction(string actionName, Action action, bool showProgress=true, string prefix = null, bool abortOnFailure = true)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("{0}Begin: ", prefix);
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("{0} ", actionName);

            Console.ForegroundColor = ConsoleColor.Gray;
            var task = Task.Factory.StartNew(action);
            if (showProgress)
            {
                Console.Write("...");
                while (!task.IsCompleted)
                {
                    Console.Write(".");
                    Thread.Sleep(100);
                }
            }
            else
            {
                Console.WriteLine();
                task.Wait();
            }
            bool isOk = task.Exception == null;
            if (!showProgress)
            {
                Console.ForegroundColor = ConsoleColor.DarkGray;
                Console.Write("{0}End  : ", prefix);
                Console.ForegroundColor = ConsoleColor.White;
                Console.Write("{0} ", actionName);
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.Write("...");
            }
            Console.ForegroundColor = isOk ? ConsoleColor.Green : ConsoleColor.Red;
            Console.WriteLine(isOk ? " Done" : " Failed");
            if (isOk == false && abortOnFailure == true) Exit();
        }

        private static readonly object SyncRoot = new object();

        [Conditional("DEBUG")]
        public static void ReportAction(string action, bool isOk, bool abortOnFailure = true)
        {
            lock (SyncRoot)
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.Write("{0} ... ", action);
                Console.ForegroundColor = isOk ? ConsoleColor.Green : ConsoleColor.Red;
                Console.WriteLine(isOk ? " Done" : " Failed");
                if (isOk == false && abortOnFailure == true) Exit();
            }
        }

#if DEBUG
        public static string ReadVariable(string variableName, string hint=null)
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.Write(variableName);
            if (!string.IsNullOrWhiteSpace(hint))
            {
                Console.ForegroundColor = ConsoleColor.DarkCyan;
                Console.Write(" [{0}] ", hint);
            }
            Console.ForegroundColor = ConsoleColor.Green;
            return Console.ReadLine();
        }
#endif

        [Conditional("DEBUG")]
        public static void SetForeground(this ConsoleColor color)
        {
            Console.ForegroundColor = color;
        }

        [Conditional("DEBUG")]
        public static void Display(Exception exception)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Error: {0}-{1}", DateTime.Now.ToShortDateString(), DateTime.Now.ToLongTimeString());
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine(exception.ToString());
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.WriteLine("=====================================================");
        }

        [Conditional("DEBUG")]
        public static void Display(ConsoleColor color, string format, params object[] objects)
        {
            Console.ForegroundColor = color;
            Console.WriteLine(format, objects);
        }

        private static int colorNdx = 0;
        [Conditional("DEBUG")]
        public static void Display(ConsoleColor[] colors, Action action)
        {
            var foregroundColor = Console.ForegroundColor;
            Console.ForegroundColor = colors[colorNdx++];
            if (colorNdx >= colors.Length) colorNdx = 0;
            if (action!=null)
            {
                action.Invoke();
            }
            Console.ForegroundColor = foregroundColor;
        }
    }
}


text:
import { NgModule, ModuleWithProviders } from '@angular/core';
import { FormsModule } from '@angular/forms';
import {OAuthService} from "angular2-oauth2/oauth-service";
import {LoginComponent} from "../home/login/login.component";
import {CommonModule} from "@angular/common";
import {AuthGuard} from "../flug/flug-buchen/auth.guard";
import {OrtValidatorDirective} from "./validators/ort.validator.directive";
import {OrtPipe} from "./pipes/ort.pipe";
import {DateComponent} from "./date/date.component";
import {OrtAsyncValidatorDirective} from "./validators/ort.async.validator.directive";
import {AuthService} from "./auth/auth.service";

@NgModule({
    imports: [
        CommonModule,
        FormsModule
    ],
    declarations: [
        OrtValidatorDirective,
        OrtAsyncValidatorDirective,
        DateComponent,
        OrtPipe
    ],
    exports: [
        OrtValidatorDirective,
        OrtAsyncValidatorDirective,
        DateComponent,
        OrtPipe
    ],
    providers: []
})
export class SharedModule {

    static forRoot(): ModuleWithProviders {
        return {
            ngModule: SharedModule,
            providers: [AuthService, AuthGuard]
        }
    }

}


text:
package org.apache.drill.exec.rpc;

public class ChannelClosedException extends RpcException{
  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ChannelClosedException.class);

  public ChannelClosedException() {
    super();
  }

  public ChannelClosedException(String message, Throwable cause) {
    super(message, cause);
  }

  public ChannelClosedException(String message) {
    super(message);
  }

  public ChannelClosedException(Throwable cause) {
    super(cause);
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:state_pressed="true"
        android:state_enabled="true"
        android:color="#aaff0088">
    </item>

    <item
        android:state_pressed="false"
        android:state_enabled="true"
        android:color="#ffff0088">
    </item>

    <item
        android:state_pressed="false"
        android:state_enabled="false"
        android:color="#59ff0088">
    </item>

    <item
        android:state_pressed="true"
        android:state_enabled="false"
        android:color="#59ff0088">
    </item>
</selector>


text:
T1A08-Events-Name

 Basic Javascript Events by ______

Note: Tap the capital "A" to see the object move!

Instructions

Pass: Add to this page several links to websites that have information about javascript events.
Good: Add something on this page that activates for every possible javascript event.
Note: identify if events only work on touch screen computers.

Move me

<input type=button value="up" onclick="{
   document.all.myOut.style.top = parseInt(document.all.myOut.style.top)-20+'px'
}">

<input type=button value="left" onclick="{
   document.all.myOut.style.left = parseInt(document.all.myOut.style.left)-20+'px'
}">

 Copy me!

At the bottom of every page make sure you include the following button:

<input type=button value="Back" style="font-size:25px" onclick="{window.history.back()}">


text:
namespace sharesheet {

ShareActionCache::ShareActionCache(Profile* profile) {
  // ShareActions will be initialised here by calling AddShareAction.
#if BUILDFLAG(IS_CHROMEOS_ASH)
  if (NearbySharingServiceFactory::IsNearbyShareSupportedForBrowserContext(
          profile)) {
    AddShareAction(std::make_unique<NearbyShareAction>(profile));
  }
  AddShareAction(std::make_unique<ash::sharesheet::DriveShareAction>());
  AddShareAction(
      std::make_unique<ash::sharesheet::CopyToClipboardShareAction>(profile));
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
}

ShareActionCache::~ShareActionCache() = default;

const std::vector<std::unique_ptr<ShareAction>>&
ShareActionCache::GetShareActions() {
  return share_actions_;
}

ShareAction* ShareActionCache::GetActionFromName(
    const std::u16string& action_name) {
  auto iter = share_actions_.begin();
  while (iter != share_actions_.end()) {
    if ((*iter)->GetActionName() == action_name) {
      return iter->get();
    } else {
      iter++;
    }
  }
  return nullptr;
}

const gfx::VectorIcon* ShareActionCache::GetVectorIconFromName(
    const std::u16string& display_name) {
  ShareAction* share_action = GetActionFromName(display_name);
  if (share_action == nullptr) {
    return nullptr;
  }
  return &share_action->GetActionIcon();
}

bool ShareActionCache::HasVisibleActions(const apps::IntentPtr& intent,
                                         bool contains_google_document) {
  for (auto& action : share_actions_) {
    if (action->ShouldShowAction(intent, contains_google_document)) {
      return true;
    }
  }
  return false;
}

void ShareActionCache::AddShareActionForTesting() {
  AddShareAction(std::make_unique<ExampleAction>());
}

void ShareActionCache::AddShareAction(std::unique_ptr<ShareAction> action) {
  share_actions_.push_back(std::move(action));
}

}  // namespace sharesheet


text:
package v2

import (
	"fmt"
	"testing"

	"github.com/gophercloud/gophercloud"
	"github.com/gophercloud/gophercloud/acceptance/tools"
	"github.com/gophercloud/gophercloud/openstack/workflow/v2/executions"
	"github.com/gophercloud/gophercloud/openstack/workflow/v2/workflows"
	th "github.com/gophercloud/gophercloud/testhelper"
)

// CreateExecution creates an execution for the given workflow.
func CreateExecution(t *testing.T, client *gophercloud.ServiceClient, workflow *workflows.Workflow) (*executions.Execution, error) {
	executionDescription := tools.RandomString("execution_", 5)

	t.Logf("Attempting to create execution: %s", executionDescription)
	createOpts := executions.CreateOpts{
		ID:                executionDescription,
		WorkflowID:        workflow.ID,
		WorkflowNamespace: workflow.Namespace,
		Description:       executionDescription,
		Input: map[string]interface{}{
			"msg": "Hello World!",
		},
	}
	execution, err := executions.Create(client, createOpts).Extract()
	if err != nil {
		return execution, err
	}

	t.Logf("Execution created: %s", executionDescription)

	th.AssertEquals(t, execution.Description, executionDescription)

	t.Logf("Wait for execution status SUCCESS: %s", executionDescription)
	th.AssertNoErr(t, tools.WaitFor(func() (bool, error) {
		latest, err := executions.Get(client, execution.ID).Extract()
		if err != nil {
			return false, err
		}

		if latest.State == "SUCCESS" {
			execution = latest
			return true, nil
		}

		if latest.State == "ERROR" {
			return false, fmt.Errorf("Execution in ERROR state")
		}

		return false, nil
	}))
	t.Logf("Execution success: %s", executionDescription)

	return execution, nil
}

// DeleteExecution deletes an execution.
func DeleteExecution(t *testing.T, client *gophercloud.ServiceClient, execution *executions.Execution) {
	err := executions.Delete(client, execution.ID).ExtractErr()
	if err != nil {
		t.Fatalf("Unable to delete executions %s: %v", execution.Description, err)
	}
	t.Logf("Deleted executions: %s", execution.Description)
}

// ListExecutions lists the executions.
func ListExecutions(t *testing.T, client *gophercloud.ServiceClient, opts executions.ListOptsBuilder) ([]executions.Execution, error) {
	allPages, err := executions.List(client, opts).AllPages()
	if err != nil {
		t.Fatalf("Unable to list executions: %v", err)
	}

	executionsList, err := executions.ExtractExecutions(allPages)
	if err != nil {
		t.Fatalf("Unable to extract executions: %v", err)
	}

	t.Logf("Executions list find, length: %d", len(executionsList))
	return executionsList, err
}


text:
using System.Collections.Generic;
using System.Linq;
using Hangfire.MemoryStorage.Database;
using Hangfire.MemoryStorage.Dto;
using Hangfire.MemoryStorage.Entities;

namespace Hangfire.MemoryStorage.Utilities
{
    public static class QueueApi
    {
        public static IEnumerable<string> GetEnqueuedJobIds(Data data, string queue, int from, int perPage, bool fetched)
        {
            var jobs = data.GetEnumeration<JobDto>();
            var queues = data.GetEnumeration<JobQueueDto>();

            var ids = (from q in queues
                join j in jobs on q.JobId equals j.Id
                where q.Queue == queue && fetched == q.FetchedAt.HasValue
                select j.Id).Skip(from).Take(perPage).ToList();

            return ids;
        }

        public static EnqueuedAndFetchedCountDto GetEnqueuedAndFetchedCount(IEnumerable<JobQueueDto> allQueues,
            string queue)
        {
            var jobQueues = allQueues.Where(q => q.Queue == queue).Select(a => a.FetchedAt).ToList();
            var fetchedCount = jobQueues.Count(q => q.HasValue);

            return new EnqueuedAndFetchedCountDto
            {
                EnqueuedCount = jobQueues.Count() - fetchedCount,
                FetchedCount = fetchedCount
            };
        }
    }
}


text:
package org.ws4d.df.api.network;

/**
 * Network status
 *
 * @author Elmar Zeeb
 *
 */
public enum NetworkState {
	INITIALIZED, STARTED, RESETTED, TERMINATED
}


text:
layout: doc
title: Service Discovery
redirect_to:
- https://dcos.io/
---

Service discovery allows network communication between services. It is an essential configuration step when you wish to run an application distributed across a data center.

This document outlines a common approach to service discovery for web services running on Mesosphere's [Marathon](https://github.com/mesosphere/marathon). While this approach focuses on one specific example application, it can be extended to most stateless services running on Marathon. This applies to services running using containerizers that Mesos ships with (cgroups, Docker) or external containerizers.

## Overview

This approach to service discovery for Marathon applications makes use of the popular [HAProxy](http://www.haproxy.org/) TCP/HTTP load balancer along with an assistant script that uses [Marathon's REST API](https://mesosphere.github.io/marathon/docs/rest-api.html) to periodically re-generate an HAProxy configuration file.

Mesos agent nodes are configured to provide a range of ports as a resource (the default range is 31,000 - 32,000). When a new instance of a task is started by Marathon on a Mesos agent node, it binds to one or more arbitrary ports within this range.

  Note the distinction between the actual port that the application binds to and the port that is configured for the application in Marathon. The configured port in Marathon (commonly known as the application port) is merely a way of namespacing applications run by Marathon and is not directly bound to. It is intended to be used by a secondary load balancer or proxy system, such as HAProxy. For example, this prevents a user from configuring two services on the same cluster that they eventually intend to both run on port 80.

Service discovery, as described in this tutorial, allows Marathon applications to assume they can communicate with other Marathon applications on their configured Marathon application port. For example, a Ruby on Rails application running on port 80 can assume that it can reach a backend Java application running on port 8080 by simply connecting to `localhost:8080`.

HAProxy will then route the request to a host and port where an instance of the service is actually running. If it is unable to connect to that host and port, it will cycle through to the next configured instance of that service.

   Note:  Any services not run using Marathon (for example, a database server) should be connected to / addressed in the normal fashion.

The approach described in the following sections employs marathon-lb. Marathon-lb is a Dockerized application that includes both HAProxy and an application that uses Marathon's REST API to regenerate the HAProxy configuration. It supports advanced functionality like SSL offloading, sticky connections and VHost based load balancing, allowing you to specify virtual hosts for your Marathon applications.

Marathon-lb connects to Marathon to retrieve the current hostnames, the actually bound ports of the running application instances and the configured application ports. Typically this is run at a 60 second schedule, using `cron`. HAProxy does not need to be restarted; the script checks if there is a diff between the new config and the active config and will signal HAProxy to reload its config if necessary. See the [marathon-lb repository](https://github.com/mesosphere/marathon-lb) for more information or check out the [tutorial on the Mesosphere blog](https://mesosphere.com/blog/2015/12/04/dcos-marathon-lb/).

## Prerequisites

* A cluster running Mesos 0.20.1+ and Marathon 0.7.3+

* DNS service that offers healthchecks (e.g., [Amazon Route 53](http://aws.amazon.com/route53/))

## Deployment

See the [marathon-lb repository[(https://github.com/mesosphere/marathon-lb) for deployment options.

Once you have deployed the application, a cron job will run every minute and update the HAproxy configuration within the marathon-lb container at `/etc/haproxy/haproxy.cfg`. If this changes, HAProxy will reload its configuration.

### DNS Configuration for Incoming External Traffic

At the very front of your cluster you will need a load balancing and availability solution for incoming traffic. One simple way of doing this is with Amazon's [Route53](http://aws.amazon.com/route53/) service along with [Cloudwatch](http://aws.amazon.com/cloudwatch/) health checks. The specific steps to do this for a typical web service are:

1. Configure static IPs and publicly expose either port 80 or 443 (as required) on the set of hosts that you want to use for external load balancing. (This could be any set of hosts that you are happy to route traffic through as long as it has HAProxy installed and configured as in the previous section.)

2. Create a Route53 Health Check for each of the servers. Each health check entry should be configured with the public facing IP address of the server, the desired protocol (HTTP or HTTPS) and port (80 or 443).

3. Create a Route53 A record for each server instance, e.g. `public.example.com` => `10.0.0.10`, with a TTL of 60 seconds.

4. For each A record configure a routing policy of `weighted`, with a weight of 10, a unique `Set ID` name, enable Health Checks, and associate each record with the matching Health Check.

5. For this DNS record, Route53 will now route traffic to healthy instances. The HAProxy on each instance will route the traffic to the correct node running the configured service within the cluster.

## Marathon Example Definitions

Below are some example Marathon application definitions for typical services run on a cluster.
To use these, [Docker](https://www.docker.com/) will need to be installed on each agent node.

These address containers that use *host* based networking. Using *bridge* networking requires some extra work to allow services inside the container to resolve the proxy (see [building your own bridge](https://docs.docker.com/articles/networking/#building-your-own-bridge) for how this might be accomplished).

### Web server with host-based networking and health checks
The configuration below is for a typical web server that operates on both port 80 and port 443. Replace the dummy `container.docker.image` value with a valid Docker hub image for your web server.

```json
{
  "id": "/webapp",
  "env": {
    "DATABASE_HOST": "1.2.3.4",
    "DATABASE_PASSWORD": "",
    "MODE": "PRODUCTION",
    "APP_HTTP_PORT": "$PORT0",
    "APP_HTTPS_PORT": "$PORT1"
  },
  "instances": 3,
  "cpus": 0.5,
  "mem": 1024,
  "ports": [
    80,
    443
  ],
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "dockerrepo/webapp:d985f15e30c1ac186125e041e7b0ad3d876208ba"
    }
  },
  "healthChecks": [
    {
      "path": "/",
      "protocol": "HTTP",
      "portIndex": 0,
      "gracePeriodSeconds": 300,
      "intervalSeconds": 10,
      "timeoutSeconds": 20,
      "maxConsecutiveFailures": 3
    }
  ]
}
```

### Web service with host-based networking and health checks
The configuration below is for a typical web service that operates on port 8081. Again, replace the dummy `container.docker.image` value with a valid Docker hub image for your web service.

```json
{
  "id": "/serviceapp",
  "instances": 3,
  "cpus": 0.5,
  "mem": 1024,
  "disk": 0,
  "ports": [
    8081
  ],
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "dockerrepo/serviceapp:2e53c51ede0c451bdb82302986bb6a6951d1aff7"
    }
  },
  "healthChecks": [
    {
      "path": "/ping",
      "protocol": "HTTP",
      "portIndex": 0,
      "gracePeriodSeconds": 60,
      "intervalSeconds": 10,
      "timeoutSeconds": 20,
      "maxConsecutiveFailures": 3
    }
  ]
}
```

## Scaling & Fault-tolerance

### What happens if a node is added to the cluster?

As long as marathon-lb is configured and a Mesos agent process is running, the node will join the cluster and function the same way as other nodes. As and when Marathon starts application instances on it, HAProxy will update to route traffic to it.

### What happens if the number of instances of my application are increased in Marathon?

Marathon will deploy the new instances to cluster nodes as and where there is spare capacity. The next time the HAProxy configuration is updated, the new instances will be available for traffic to route to.

### What happens if an instance goes down?

If an application instance fails, it will be removed as a routable destination the next time the HAProxy configuration is refreshed.

## Limitations & Caveats

As with any service discovery solution, there are some specific nuances to the behavior provided by this approach. These are listed below:

* HAProxy timeouts may need to be customized in marathon-lb, depending on the application.

* The generated HAProxy config is best suited to stateless services since there is no guarantee you will be routed to the same application instance each time. More advanced configuration can be gained by customizing the script.

* Each Marathon app running on the cluster must have a dedicated application port which is used for service discovery. To run separate instances of a Marathon application on the same Mesos cluster, you will need a unique port for each application instance.

* For incoming traffic, it is possible for 1-3 minutes of service interruption if one of the load balancing hosts fail. The factors which contribute to this time are:

    * Cloudwatch Request Interval (default: 30 seconds)

    * Cloudwatch Failure Threshold (default: 3)

    * Route53 A record TTL (suggested: 60 seconds)

* For traffic between internal services, it is possible for small windows of service interruption within the cluster if a task or host fails. The factors which contribute to this time are:

    * The Marathon application's [health-check configuration](https://mesosphere.github.io/marathon/docs/health-checks.html):

        * gracePeriodSeconds (default: 15 seconds)

        * intervalSeconds (default: 10 seconds)

        * maxConsecutiveFailures (default: 3)

        * timeoutSeconds (default: 20 seconds)

    * marathon-lb cron interval (default: 60 seconds)

* The Dockerized application must bind to the dynamic ports provided by Marathon using the environment variables $PORT0, $PORT1, … See the (Marathon ports documentation)[https://mesosphere.github.io/marathon/docs/ports.html] for more information.

## Alternative Approaches

* ### Qubit
    [Qubit](http://qubitproducts.com/) provides Bamboo, a "web daemon that automatically configures HAProxy for web services deployed on Apache Mesos and Marathon". See the [Bamboo GitHub repository](https://github.com/QubitProducts/bamboo) for more.

* ### Mesos-DNS
    [Mesos-DNS](https://mesosphere.github.io/mesos-dns/) allows applications and services running on Mesos to find each other through the domain name system (DNS).


text:
# How good is the air you breathe?

### Air quality is complex. Let's start simple.

When we start getting into more scientific areas like air quality or water quality, things start getting more difficult. Issues of sensor quality, sensitivity and just what exactly is being measured become front-and-center issues you have to deal with. Often, the first question you have to deal with is this: Is there a sensor that will even tell me what I want to know? For water quality, many of the issues you'd want to track require chemical tests done in a lab to work. With air quality, there's mulitple measures that combine.

One of the easiest is particulates. How much dust and stuff is in the air?

## Arduino

**STEP 1**

Gather your materials. You will need your Arduino, the Grove Dust Sensor, and three jumper wires: red and black for power, yellow for data.

**STEP 2**

Wiring is relatively simple. There's only three wires, and the wiring harness that comes with the Dust Sensor makes it pretty clear what is what.

* Connect a red jumper wire from the red pin on the connector on the wiring harness to the 5V pin on the Arduino.
* Connect a black jumper wire from the black wire on the wiring harness to a GND pin on the Arduino.
* Connect a yellow jumper from the yellow wire on the wiring harness to Digital Pin 8 (D8) on the Arduino.

![arduino-air-1](../images/arduino-air-1.jpg)

![arduino-air-2](../images/arduino-air-2.jpg)

**STEP 3**

Seeed Studios provides an [in-depth walkthrough of the Grove Dust Sensor on their wiki](http://wiki.seeed.cc/Grove-Dust_Sensor/). You can get more info there. Here's the code they provide to make it work. Put it into a blank Arduino sketch, verify it and upload it.

```
/*
Grove - Dust Sensor Demo v1.0
 Interface to Shinyei Model PPD42NS Particle Sensor
 Program by Christopher Nafis
 Written April 2012

 http://www.seeedstudio.com/depot/grove-dust-sensor-p-1050.html
 http://www.sca-shinyei.com/pdf/PPD42NS.pdf

 JST Pin 1 (Black Wire)  => Arduino GND
 JST Pin 3 (Red wire)    => Arduino 5VDC
 JST Pin 4 (Yellow wire) => Arduino Digital Pin 8
 */

int pin = 8;
unsigned long duration;
unsigned long starttime;
unsigned long sampletime_ms = 30000; // sample 30s
unsigned long lowpulseoccupancy = 0;
float ratio = 0;
float concentration = 0;

void setup() {
  Serial.begin(9600);
  pinMode(8,INPUT);
  starttime = millis(); // get the current time;
}

void loop() {
  duration = pulseIn(pin, LOW);
  lowpulseoccupancy = lowpulseoccupancy+duration;

  if ((millis()-starttime) >= sampletime_ms) // if the sample time == 30s
  {
    ratio = lowpulseoccupancy/(sampletime_ms*10.0);  // Integer percentage 0 => 100
    concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve
    Serial.print("concentration = ");
    Serial.print(concentration);
    Serial.println(" pcs/0.01cf");
    Serial.println("\n");
    lowpulseoccupancy = 0;
    starttime = millis();
  }
}

```

**STEP 4**

Pull up the serial monitor and you'll see, every 30 seconds, a new reading comes in. You'll note that the most common reading is .62 pcs/0.01cf -- that's essentially zero. If you blow into it, you'll get some big numbers. And if you leave it run for a while, you'll get some spiky numbers, depending on your environment. My workshop in my house, where I made this tutorial, isn't exactly the cleanest place in the house, so it can be dusty.

![arduino-air-3](../images/arduino-air-3.png)

### Why did this work?

If you look at the code, most of it is defining a series of variables that will get overwritten in the loop. The setup is pretty plain -- the only thing you won't see in every other tutorial on Arduino stuff is the getting of the time in milliseconds.

In the loop, the most important part is the concentration -- that's the part that has physical meaning. The variable is a formula based on the sensor's capabilities and the curve of the graph representing those capabilities. So the formula calculates how much dust is in the room based on the sensor's value (which is represented by `ratio` in the formula) and a set of constants.


text:
<?php

namespace Google\Service\CloudSearch;

class AffectedMembership extends \Google\Model
{
  protected $affectedMemberType = MemberId::class;
  protected $affectedMemberDataType = '';
  /**
   * @var string
   */
  public $priorMembershipRole;
  /**
   * @var string
   */
  public $priorMembershipState;
  /**
   * @var string
   */
  public $targetMembershipRole;

  /**
   * @param MemberId
   */
  public function setAffectedMember(MemberId $affectedMember)
  {
    $this->affectedMember = $affectedMember;
  }
  /**
   * @return MemberId
   */
  public function getAffectedMember()
  {
    return $this->affectedMember;
  }
  /**
   * @param string
   */
  public function setPriorMembershipRole($priorMembershipRole)
  {
    $this->priorMembershipRole = $priorMembershipRole;
  }
  /**
   * @return string
   */
  public function getPriorMembershipRole()
  {
    return $this->priorMembershipRole;
  }
  /**
   * @param string
   */
  public function setPriorMembershipState($priorMembershipState)
  {
    $this->priorMembershipState = $priorMembershipState;
  }
  /**
   * @return string
   */
  public function getPriorMembershipState()
  {
    return $this->priorMembershipState;
  }
  /**
   * @param string
   */
  public function setTargetMembershipRole($targetMembershipRole)
  {
    $this->targetMembershipRole = $targetMembershipRole;
  }
  /**
   * @return string
   */
  public function getTargetMembershipRole()
  {
    return $this->targetMembershipRole;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AffectedMembership::class, 'Google_Service_CloudSearch_AffectedMembership');


text:
package com.deepoove.poi.tl.render;

import java.util.List;

import com.deepoove.poi.expression.Name;
import com.deepoove.poi.tl.example.SegmentData;

public class StoryDataV2 {

    @Name("story_name")
    private String storyName;
    @Name("story_author")
    private String storyAuthor;
    private List<SegmentData> sections;
    @Name("story_source")
    private String storySource;
    private String summary;

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public List<SegmentData> getSections() {
        return sections;
    }

    public void setSections(List<SegmentData> sections) {
        this.sections = sections;
    }

    public String getStoryName() {
        return storyName;
    }

    public void setStoryName(String storyName) {
        this.storyName = storyName;
    }

    public String getStoryAuthor() {
        return storyAuthor;
    }

    public void setStoryAuthor(String storyAuthor) {
        this.storyAuthor = storyAuthor;
    }

    public String getStorySource() {
        return storySource;
    }

    public void setStorySource(String storySource) {
        this.storySource = storySource;
    }

}


text:
package org.spongepowered.api.item.inventory;

import org.spongepowered.api.util.generator.dummy.DummyObjectProvider;

/**
 * An enumeration of {@link InventoryArchetype}s.
 */
public class InventoryArchetypes {

    // Base Archetypes

    /**
     * A single Inventory Slot.
     */
    public static final InventoryArchetype SLOT = DummyObjectProvider.createFor(InventoryArchetype.class, "SLOT");

    /**
     * A row of Slots. 9 Slots by default.
     */
    public static final InventoryArchetype MENU_ROW = DummyObjectProvider.createFor(InventoryArchetype.class, "MENU_ROW");

    /**
     * A grid of Slots.
     */
    public static final InventoryArchetype MENU_GRID = DummyObjectProvider.createFor(InventoryArchetype.class, "MENU_GRID");

    /**
     * A column of Slots.
     */
    public static final InventoryArchetype MENU_COLUMN = DummyObjectProvider.createFor(InventoryArchetype.class, "MENU_COLUMN");

    /**
     * A Slot acting like a button.
     */
    public static final InventoryArchetype MENU_BUTTON = DummyObjectProvider.createFor(InventoryArchetype.class, "MENU_BUTTON");

    /**
     * A Slot acting like an icon.
     */
    public static final InventoryArchetype MENU_ICON = DummyObjectProvider.createFor(InventoryArchetype.class, "MENU_ICON");

    /**
     * A Slot that can toggle between two icon states.
     */
    public static final InventoryArchetype MENU_CHECKBOX = DummyObjectProvider.createFor(InventoryArchetype.class, "MENU_CHECKBOX");

    /**
     * An icon Slot that can count up and down.
     */
    public static final InventoryArchetype MENU_SPINNER = DummyObjectProvider.createFor(InventoryArchetype.class, "MENU_SPINNER");

    /**
     * A Players personal crafting area. Output with 2x2 Grid
     */
    public static final InventoryArchetype CRAFTING = DummyObjectProvider.createFor(InventoryArchetype.class, "CRAFTING");

    // Vanilla Archetypes

    // Grid-based

    /**
     * A Chest. By default 9x3.
     */
    public static final InventoryArchetype CHEST = DummyObjectProvider.createFor(InventoryArchetype.class, "CHEST");

    /**
     * A DoubleChest. By default 9x6.
     */
    public static final InventoryArchetype DOUBLE_CHEST = DummyObjectProvider.createFor(InventoryArchetype.class, "DOUBLE_CHEST");

    /**
     * A Hopper. 5x1
     */
    public static final InventoryArchetype HOPPER = DummyObjectProvider.createFor(InventoryArchetype.class, "HOPPER");

    /**
     * A Dispenser or Dropper. 3x3
     */
    public static final InventoryArchetype DISPENSER = DummyObjectProvider.createFor(InventoryArchetype.class, "DISPENSER");

    /**
     * A Workbench. 3x3
     */
    public static final InventoryArchetype WORKBENCH = DummyObjectProvider.createFor(InventoryArchetype.class, "WORKBENCH");

    // Slot-based

    /**
     * A Furnace. 3 Slots
     */
    public static final InventoryArchetype FURNACE = DummyObjectProvider.createFor(InventoryArchetype.class, "FURNACE");

    /**
     * A EnchantingTable. 2 Slots
     */
    public static final InventoryArchetype ENCHANTING_TABLE = DummyObjectProvider.createFor(InventoryArchetype.class, "ENCHANTING_TABLE");

    /**
     * A Anvil. 3 Slots
     */
    public static final InventoryArchetype ANVIL = DummyObjectProvider.createFor(InventoryArchetype.class, "ANVIL");

    /**
     * A BrewingStand. 4 Slots.
     *
     *
5 Slots in Minecraft 1.9

     */
    public static final InventoryArchetype BREWING_STAND = DummyObjectProvider.createFor(InventoryArchetype.class, "BREWING_STAND");

    /**
     * A Beacon. 1 Slot
     */
    public static final InventoryArchetype BEACON = DummyObjectProvider.createFor(InventoryArchetype.class, "BEACON");

    // Entity

    /**
     * A RideableHorse, Donkey or Mule 2 Slots.
     */
    public static final InventoryArchetype HORSE = DummyObjectProvider.createFor(InventoryArchetype.class, "HORSE");

    /**
     * A Villager. 3 Slots
     */
    public static final InventoryArchetype VILLAGER = DummyObjectProvider.createFor(InventoryArchetype.class, "VILLAGER");

    /**
     * A Donkey or Mule with Chest. 2 Slots and 5x3 Chest
     * Needs a horse as carrier to show to player in Vanilla.
     */
    public static final InventoryArchetype HORSE_WITH_CHEST = DummyObjectProvider.createFor(InventoryArchetype.class, "HORSE_WITH_CHEST");

    // Player

    /**
     * A Player. Includes 9x3 main inventory, 9x1 Hotbar, 4 Armorslots and 2x2
     * Crafting area.
     *
     *
Cannot be opened by the server in Vanilla.

     */
    public static final InventoryArchetype PLAYER = DummyObjectProvider.createFor(InventoryArchetype.class, "PLAYER");

    public static final InventoryArchetype UNKNOWN = DummyObjectProvider.createFor(InventoryArchetype.class, "UNKNOWN");

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Indian Botanical Reporter 1(2): 102 (1982)

#### Original name
Halosarpheia ratnagiriensis S.D. Patil & Borse, 1982

### Remarks
null


text:
package org.lwjgl.util.generator;

import com.sun.mirror.apt.*;
import com.sun.mirror.declaration.*;
import com.sun.mirror.type.*;
import com.sun.mirror.util.*;

import java.io.*;
import java.lang.annotation.Annotation;
import java.nio.channels.FileChannel;
import java.util.*;

import java.nio.*;

/**
 *
 * Generator visitor for the generator tool
 *
 * @author elias_naur <elias_naur@users.sourceforge.net>
 * @version $Revision: 3430 $
 * $Id: GeneratorVisitor.java 3430 2010-10-04 17:04:46Z spasi $
 */
public class GeneratorVisitor extends SimpleDeclarationVisitor {
	private final AnnotationProcessorEnvironment env;
	private final TypeMap type_map;
	private final boolean generate_error_checks;
	private final boolean context_specific;
	private final long generatorLM;

	public GeneratorVisitor(AnnotationProcessorEnvironment env, TypeMap type_map, boolean generate_error_checks, boolean context_specific, long generatorLM) {
		this.env = env;
		this.type_map = type_map;
		this.generate_error_checks = generate_error_checks;
		this.context_specific = context_specific;
		this.generatorLM = generatorLM;
	}

	private void validateMethod(MethodDeclaration method) {
		if (method.isVarArgs())
			throw new RuntimeException("Method " + method.getSimpleName() + " is variadic");
		Collection<Modifier> modifiers = method.getModifiers();
		if (!modifiers.contains(Modifier.PUBLIC))
			throw new RuntimeException("Method " + method.getSimpleName() + " is not public");
		if (method.getThrownTypes().size() > 0)
			throw new RuntimeException("Method " + method.getSimpleName() + " throws checked exceptions");
		validateParameters(method);
		StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
		if (strip_annotation != null && method.getAnnotation(Alternate.class) == null) {
			String postfix_param_name = strip_annotation.value();
			ParameterDeclaration postfix_param = Utils.findParameter(method, postfix_param_name);
			if (Utils.isParameterMultiTyped(postfix_param))
				throw new RuntimeException("Postfix parameter can't be the same as a multityped parameter in method " + method);
			if (Utils.getNIOBufferType(postfix_param.getType()) == null)
				throw new RuntimeException("Postfix parameter type must be a nio Buffer");
		}
		if (Utils.getResultParameter(method) != null && !method.getReturnType().equals(env.getTypeUtils().getVoidType()))
			throw new RuntimeException(method + " return type is not void but a parameter is annotated with Result");
		if (method.getAnnotation(CachedResult.class) != null) {
			if (Utils.getNIOBufferType(Utils.getMethodReturnType(method)) == null)
				throw new RuntimeException(method + " return type is not a Buffer, but is annotated with CachedResult");
			if (method.getAnnotation(AutoSize.class) == null)
				throw new RuntimeException(method + " is annotated with CachedResult but misses an AutoSize annotation");
		}
		validateTypes(method, method.getAnnotationMirrors(), method.getReturnType());
	}

	private void validateType(MethodDeclaration method, Class<?extends Annotation> annotation_type, Class type) {
		Class[] valid_types = type_map.getValidAnnotationTypes(type);
		for ( Class valid_type : valid_types )
			if ( valid_type.equals(annotation_type) )
				return;
		throw new RuntimeException(type + " is annotated with invalid native type " + annotation_type +
				" in method " + method);
	}

	private void validateTypes(MethodDeclaration method, Collection<AnnotationMirror> annotations, TypeMirror type_mirror) {
		for (AnnotationMirror annotation : annotations) {
			NativeType native_type_annotation = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
			if (native_type_annotation != null) {
				Class<? extends Annotation> annotation_type = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
				Class type = Utils.getJavaType(type_mirror);
				if (Buffer.class.equals(type))
					continue;
				validateType(method, annotation_type, type);
			}
		}
	}

	private void validateParameters(MethodDeclaration method) {
		for (ParameterDeclaration param : method.getParameters()) {
			validateTypes(method, param.getAnnotationMirrors(), param.getType());
			Class<?> param_type = Utils.getJavaType(param.getType());
			if (Utils.getNIOBufferType(param.getType()) != null && param_type != CharSequence.class && param_type != CharSequence[].class) {
				Check parameter_check_annotation = param.getAnnotation(Check.class);
				NullTerminated null_terminated_annotation = param.getAnnotation(NullTerminated.class);
				if (parameter_check_annotation == null && null_terminated_annotation == null) {
					boolean found_auto_size_param = false;
					for (ParameterDeclaration inner_param : method.getParameters()) {
						AutoSize auto_size_annotation = inner_param.getAnnotation(AutoSize.class);
						if (auto_size_annotation != null &&
								auto_size_annotation.value().equals(param.getSimpleName())) {
							found_auto_size_param = true;
							break;
						}
					}
					if (!found_auto_size_param
							&& param.getAnnotation(Result.class) == null
					        && param.getAnnotation(Constant.class) == null
							&& !Utils.isReturnParameter(method, param)
						)
						throw new RuntimeException(param + " has no Check, Result nor Constant annotation, is not the return parameter and no other parameter has" +
													" an @AutoSize annotation on it in method " + method);
				}
				if (param.getAnnotation(CachedReference.class) != null && param.getAnnotation(Result.class) != null)
					throw new RuntimeException(param + " can't be annotated with both CachedReference and Result");
				if (param.getAnnotation(BufferObject.class) != null && param.getAnnotation(Result.class) != null)
					throw new RuntimeException(param + " can't be annotated with both BufferObject and Result");
				//if (param.getAnnotation(Constant.class) != null)
					//throw new RuntimeException("Buffer parameter " + param + " cannot be Constant");
			} else {
				if (param.getAnnotation(BufferObject.class) != null)
					throw new RuntimeException(param + " type is not a buffer, but annotated as a BufferObject");
				if (param.getAnnotation(CachedReference.class) != null)
					throw new RuntimeException(param + " type is not a buffer, but annotated as a CachedReference");
			}
		}
	}

	private static void generateMethodsNativePointers(PrintWriter writer, Collection<? extends MethodDeclaration> methods) {
		for (MethodDeclaration method : methods) {
			if ( method.getAnnotation(Alternate.class) == null )
				generateMethodNativePointers(writer, method);
		}
	}

	private static void generateMethodNativePointers(PrintWriter writer, MethodDeclaration method) {
		if ( method.getAnnotation(Extern.class) == null )
			writer.print("static ");
		writer.println(Utils.getTypedefName(method) + " " + method.getSimpleName() + ";");
	}

	private void generateJavaSource(InterfaceDeclaration d, PrintWriter java_writer) throws IOException {
		java_writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
		java_writer.println();
		java_writer.println("package " + d.getPackage().getQualifiedName() + ";");
		java_writer.println();
		java_writer.println("import org.lwjgl.*;");
		java_writer.println("import java.nio.*;");
		Imports imports = d.getAnnotation(Imports.class);
		if ( imports != null ) {
			for ( String i : imports.value() )
				java_writer.println("import " + i + ";");
		}
		java_writer.println();
		Utils.printDocComment(java_writer, d);
		if ( d.getAnnotation(Private.class) == null )
			java_writer.print("public ");
		boolean is_final = Utils.isFinal(d);
		if (is_final)
			java_writer.write("final ");
		java_writer.print("class " + Utils.getSimpleClassName(d));
		Collection<InterfaceType> super_interfaces = d.getSuperinterfaces();
		if (super_interfaces.size() > 1)
			throw new RuntimeException(d + " extends more than one interface");
		if (super_interfaces.size() == 1) {
			InterfaceDeclaration super_interface = super_interfaces.iterator().next().getDeclaration();
			java_writer.print(" extends " + Utils.getSimpleClassName(super_interface));
		}
		java_writer.println(" {");
		FieldsGenerator.generateFields(java_writer, d.getFields());
		java_writer.println();
		if (is_final) {
			// Write private constructor to avoid instantiation
			java_writer.println("\tprivate " + Utils.getSimpleClassName(d) + "() {}");
		}
		if (d.getMethods().size() > 0 && !context_specific) {
			java_writer.println();
			java_writer.println("\tstatic native void " + Utils.STUB_INITIALIZER_NAME + "() throws LWJGLException;");
		}
		JavaMethodsGenerator.generateMethodsJava(env, type_map, java_writer, d, generate_error_checks, context_specific);
		java_writer.println("}");
		java_writer.close();
		String qualified_interface_name = Utils.getQualifiedClassName(d);
		env.getMessager().printNotice("Generated class " + qualified_interface_name);
	}

	private void generateNativeSource(InterfaceDeclaration d) throws IOException {
		String qualified_interface_name = Utils.getQualifiedClassName(d);
		String qualified_native_name = Utils.getNativeQualifiedName(qualified_interface_name)+ ".c";
		PrintWriter native_writer = env.getFiler().createTextFile(Filer.Location.CLASS_TREE, "", new File(qualified_native_name), "UTF-8");
		native_writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
		native_writer.println();
		native_writer.println("#include <jni.h>");
		type_map.printNativeIncludes(native_writer);
		native_writer.println();
		TypedefsGenerator.generateNativeTypedefs(type_map, native_writer, d.getMethods());
		native_writer.println();
		if (!context_specific) {
			generateMethodsNativePointers(native_writer, d.getMethods());
			native_writer.println();
		}
		NativeMethodStubsGenerator.generateNativeMethodStubs(env, type_map, native_writer, d, generate_error_checks, context_specific);
		if (!context_specific) {
			native_writer.print("JNIEXPORT void JNICALL " + Utils.getQualifiedNativeMethodName(qualified_interface_name, Utils.STUB_INITIALIZER_NAME));
			native_writer.println("(JNIEnv *env, jclass clazz) {");
			native_writer.println("\tJavaMethodAndExtFunction functions[] = {");
			RegisterStubsGenerator.generateMethodsNativeStubBind(native_writer, d, generate_error_checks, context_specific);
			native_writer.println("\t};");
			native_writer.println("\tint num_functions = NUMFUNCTIONS(functions);");
			native_writer.print("\t");
			native_writer.print(type_map.getRegisterNativesFunctionName());
			native_writer.println("(env, clazz, num_functions, functions);");
			native_writer.println("}");
		}
		native_writer.close();
		env.getMessager().printNotice("Generated C source " + qualified_interface_name);
	}

	public void visitInterfaceDeclaration(InterfaceDeclaration d) {
		final File input = d.getPosition().file();
		final File outputJava = new File(env.getOptions().get("-s") + '/' + d.getPackage().getQualifiedName().replace('.', '/'), Utils.getSimpleClassName(d) + ".java");

		PrintWriter java_writer = null;

		try {
			final Collection<? extends MethodDeclaration> methods = d.getMethods();
			if ( methods.size() == 0 && d.getFields().size() == 0 )
				return;

			// Skip this class if the output exists and the input has not been modified.
			if ( outputJava.exists() && Math.max(input.lastModified(), generatorLM) < outputJava.lastModified() )
				return;

			for ( final MethodDeclaration method : methods )
				validateMethod(method);
			java_writer = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, d.getPackage().getQualifiedName(), new File(Utils.getSimpleClassName(d) + ".java"), null);
			generateJavaSource(d, java_writer);

			if ( methods.size() > 0 ) {
				boolean hasNative = false;
				for ( final MethodDeclaration method : methods ) {
					Alternate alt_annotation = method.getAnnotation(Alternate.class);
					if ( (alt_annotation == null || alt_annotation.nativeAlt()) && method.getAnnotation(Reuse.class) == null ) {
						hasNative = true;
						break;
					}
				}
				if ( !hasNative )
					return;

				final String outputPath = env.getOptions().get("-d") + '/' + Utils.getNativeQualifiedName(Utils.getQualifiedClassName(d));
				final File outputNative = new File(outputPath + ".c");
				final File outputBackup = new File(outputPath + "_backup.c");

				// If the native file exists, rename.
				final ByteBuffer nativeBefore;
				if ( outputNative.exists() ) {
					nativeBefore = readFile(outputNative);
					outputNative.renameTo(outputBackup);
				} else
					nativeBefore = null;

				try {
					generateNativeSource(d);

					// If the native file did exist, compare with the new file. If they're the same,
					// reset the last modified time to avoid ridiculous C compilation times.
					if ( nativeBefore != null && outputNative.length() == nativeBefore.capacity() ) {
						final ByteBuffer nativeAfter = readFile(outputNative);
						boolean same = true;
						for ( int i = nativeBefore.position(); i < nativeBefore.limit(); i++ ) {
							if ( nativeBefore.get(i) != nativeAfter.get(i) ) {
								same = false;
								break;
							}
						}

						if ( same ) {
							outputNative.delete();
							outputBackup.renameTo(outputNative);
						}
					}
				} finally {
					if ( outputBackup.exists() )
						outputBackup.delete();
				}
			}
		} catch (Exception e) {
			// If anything goes wrong mid-gen, delete output to allow regen next time we run.
			if ( java_writer != null ) java_writer.close();
			if ( outputJava.exists() ) outputJava.delete();

			throw new RuntimeException(e);
		}
	}

	private static ByteBuffer readFile(final File file) throws IOException {
		final FileChannel channel = new FileInputStream(file).getChannel();

		final long bytesTotal = channel.size();
		final ByteBuffer buffer = ByteBuffer.allocateDirect((int)bytesTotal);

		long bytesRead = 0;
		do {
			bytesRead += channel.read(buffer);
		} while ( bytesRead < bytesTotal );
		buffer.flip();

		channel.close();

		return buffer;
	}

}


text:
CodersNote=This is an options node for the License.

Org.Name.Full=American Arbitration Association

Org.Name.Short=AAA

Seat.City,State=Wilmington, Delaware

AlternativeLitigation.Seat.City,State=Wilmington, Delaware


text:
<title>Ig/Tcr Segment Genes</title>

Annotation of Ig/Tcr Segment Genes

Ensembl Ig Segment genes are annotations of the Immunoglobulin and
T-cell receptor genes present in germ-line genomic DNA. During B-cell
and T-cell maturation, these genes are rearranged and brought together
by V-D-J recombination to form functional Immunoglobulin and T-cell
receptor genes.

The protein and nucleotide databases contain many sequences of mature
Immunoglobulin/T-cell receptor genes. Inferring gene structures by
aligning these to the genome using the standard
Ensembl genebuild pipeline gives
unsatisfactory results, for two main reasons:

The non-coding DNA that separates pairs of gene segments brought
together by V-D-J recombination  is not an intron, and the gene
boundaries display different sequence signals to splice sites.
Spliced alignment programs such as
GeneWise therefore
require retuning in order to predict the gene structure correctly.

Some genes comprise multiple exons. Delineating a "spliced" alignment
of a mature Immunoglobulin/T-cell receptor sequence to the genome into
its constituent segments is therefore not straightforward.

For this reason, Immunoglobulin/T-cell receptor gene segments have
been annotated differently to other Ensembl genes. Ensembl makes use
of the
IMGT database, which
provides annotation of individual gene segments on reference
sequences. Ensembl extracts individual gene sequences and aligns them
to the genome using the
Exonerate
alignment tool.

To reflect their role in the V-D-J recombination process, segments are
annotated as belonging to one of four classes: V segment, D segment, J
segment and C segment.  At present, Ensembl Ig gene annotations are
only available for human and mouse.

References

Lefranc M.-P., Giudicelli V., Kaas Q., Duprat
E., Jabado-Michaloud J., Scaviner D., Ginestoux C., Clément O.,
Chaume D. and Lefranc G.
  IMGT, the international
ImMunoGeneTics information system.

Nucl. Acids Res. 2005 33:D593-D597

Slater G.S. and Birney E.

Automated generation of heuristics for biological sequence
comparison.

BMC Bioinformatics 2005 6:31

doi:10.1186/1471-2105-6-31

Ewan Birney, Michele Clamp and Richard
Durbin

GeneWise and Genomewise

Genome Research 2004 14(5):988-995.
doi:10.1101/gr.1865504


text:
package com.arangodb.model;

/**
 * @author Mark Vollmary
 * @author Michele Rastelli
 * @see API
 * Documentation
 */
public class DocumentExistsOptions {

    private String ifNoneMatch;
    private String ifMatch;
    private boolean catchException;
    private String streamTransactionId;

    public DocumentExistsOptions() {
        super();
        catchException = true;
    }

    public String getIfNoneMatch() {
        return ifNoneMatch;
    }

    /**
     * @param ifNoneMatch document revision must not contain If-None-Match
     * @return options
     */
    public DocumentExistsOptions ifNoneMatch(final String ifNoneMatch) {
        this.ifNoneMatch = ifNoneMatch;
        return this;
    }

    public String getIfMatch() {
        return ifMatch;
    }

    /**
     * @param ifMatch document revision must contain If-Match
     * @return options
     */
    public DocumentExistsOptions ifMatch(final String ifMatch) {
        this.ifMatch = ifMatch;
        return this;
    }

    /**
     * @deprecated for removal
     */
    @Deprecated
    public boolean isCatchException() {
        return catchException;
    }

    /**
     * @param catchException whether or not catch possible thrown exceptions
     * @return options
     * @deprecated for removal
     */
    @Deprecated
    public DocumentExistsOptions catchException(final boolean catchException) {
        this.catchException = catchException;
        return this;
    }

    public String getStreamTransactionId() {
        return streamTransactionId;
    }

    /**
     * @param streamTransactionId If set, the operation will be executed within the transaction.
     * @return options
     * @since ArangoDB 3.5.0
     */
    public DocumentExistsOptions streamTransactionId(final String streamTransactionId) {
        this.streamTransactionId = streamTransactionId;
        return this;
    }

}


text:
#pragma once
#include <aws/s3/S3_EXPORTS.h>
#include <aws/s3/S3Request.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/s3/model/RequestPayer.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <utility>

namespace Aws
{
namespace Http
{
    class URI;
} //namespace Http
namespace S3
{
namespace Model
{

  /**
   */
  class AWS_S3_API AbortMultipartUploadRequest : public S3Request
  {
  public:
    AbortMultipartUploadRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "AbortMultipartUpload"; }

    Aws::String SerializePayload() const override;

    void AddQueryStringParameters(Aws::Http::URI& uri) const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The bucket name to which the upload was taking place.

When using this
     * API with an access point, you must direct requests to the access point hostname.
     * The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     * When using this operation with an access point through the AWS SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about
     * access point ARNs, see Using
     * Access Points in the Amazon Simple Storage Service Developer
     * Guide.

When using this API with Amazon S3 on Outposts, you must
     * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname
     * takes the form
     * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com.
     * When using this operation using S3 on Outposts through the AWS SDKs, you provide
     * the Outposts bucket ARN in place of the bucket name. For more information about
     * S3 on Outposts ARNs, see Using
     * S3 on Outposts in the Amazon Simple Storage Service Developer
     * Guide.

     */
    inline const Aws::String& GetBucket() const{ return m_bucket; }

    /**
     *
The bucket name to which the upload was taking place.

When using this
     * API with an access point, you must direct requests to the access point hostname.
     * The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     * When using this operation with an access point through the AWS SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about
     * access point ARNs, see Using
     * Access Points in the Amazon Simple Storage Service Developer
     * Guide.

When using this API with Amazon S3 on Outposts, you must
     * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname
     * takes the form
     * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com.
     * When using this operation using S3 on Outposts through the AWS SDKs, you provide
     * the Outposts bucket ARN in place of the bucket name. For more information about
     * S3 on Outposts ARNs, see Using
     * S3 on Outposts in the Amazon Simple Storage Service Developer
     * Guide.

     */
    inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; }

    /**
     *
The bucket name to which the upload was taking place.

When using this
     * API with an access point, you must direct requests to the access point hostname.
     * The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     * When using this operation with an access point through the AWS SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about
     * access point ARNs, see Using
     * Access Points in the Amazon Simple Storage Service Developer
     * Guide.

When using this API with Amazon S3 on Outposts, you must
     * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname
     * takes the form
     * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com.
     * When using this operation using S3 on Outposts through the AWS SDKs, you provide
     * the Outposts bucket ARN in place of the bucket name. For more information about
     * S3 on Outposts ARNs, see Using
     * S3 on Outposts in the Amazon Simple Storage Service Developer
     * Guide.

     */
    inline void SetBucket(const Aws::String& value) { m_bucketHasBeenSet = true; m_bucket = value; }

    /**
     *
The bucket name to which the upload was taking place.

When using this
     * API with an access point, you must direct requests to the access point hostname.
     * The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     * When using this operation with an access point through the AWS SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about
     * access point ARNs, see Using
     * Access Points in the Amazon Simple Storage Service Developer
     * Guide.

When using this API with Amazon S3 on Outposts, you must
     * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname
     * takes the form
     * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com.
     * When using this operation using S3 on Outposts through the AWS SDKs, you provide
     * the Outposts bucket ARN in place of the bucket name. For more information about
     * S3 on Outposts ARNs, see Using
     * S3 on Outposts in the Amazon Simple Storage Service Developer
     * Guide.

     */
    inline void SetBucket(Aws::String&& value) { m_bucketHasBeenSet = true; m_bucket = std::move(value); }

    /**
     *
The bucket name to which the upload was taking place.

When using this
     * API with an access point, you must direct requests to the access point hostname.
     * The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     * When using this operation with an access point through the AWS SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about
     * access point ARNs, see Using
     * Access Points in the Amazon Simple Storage Service Developer
     * Guide.

When using this API with Amazon S3 on Outposts, you must
     * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname
     * takes the form
     * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com.
     * When using this operation using S3 on Outposts through the AWS SDKs, you provide
     * the Outposts bucket ARN in place of the bucket name. For more information about
     * S3 on Outposts ARNs, see Using
     * S3 on Outposts in the Amazon Simple Storage Service Developer
     * Guide.

     */
    inline void SetBucket(const char* value) { m_bucketHasBeenSet = true; m_bucket.assign(value); }

    /**
     *
The bucket name to which the upload was taking place.

When using this
     * API with an access point, you must direct requests to the access point hostname.
     * The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     * When using this operation with an access point through the AWS SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about
     * access point ARNs, see Using
     * Access Points in the Amazon Simple Storage Service Developer
     * Guide.

When using this API with Amazon S3 on Outposts, you must
     * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname
     * takes the form
     * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com.
     * When using this operation using S3 on Outposts through the AWS SDKs, you provide
     * the Outposts bucket ARN in place of the bucket name. For more information about
     * S3 on Outposts ARNs, see Using
     * S3 on Outposts in the Amazon Simple Storage Service Developer
     * Guide.

     */
    inline AbortMultipartUploadRequest& WithBucket(const Aws::String& value) { SetBucket(value); return *this;}

    /**
     *
The bucket name to which the upload was taking place.

When using this
     * API with an access point, you must direct requests to the access point hostname.
     * The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     * When using this operation with an access point through the AWS SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about
     * access point ARNs, see Using
     * Access Points in the Amazon Simple Storage Service Developer
     * Guide.

When using this API with Amazon S3 on Outposts, you must
     * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname
     * takes the form
     * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com.
     * When using this operation using S3 on Outposts through the AWS SDKs, you provide
     * the Outposts bucket ARN in place of the bucket name. For more information about
     * S3 on Outposts ARNs, see Using
     * S3 on Outposts in the Amazon Simple Storage Service Developer
     * Guide.

     */
    inline AbortMultipartUploadRequest& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;}

    /**
     *
The bucket name to which the upload was taking place.

When using this
     * API with an access point, you must direct requests to the access point hostname.
     * The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     * When using this operation with an access point through the AWS SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about
     * access point ARNs, see Using
     * Access Points in the Amazon Simple Storage Service Developer
     * Guide.

When using this API with Amazon S3 on Outposts, you must
     * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname
     * takes the form
     * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com.
     * When using this operation using S3 on Outposts through the AWS SDKs, you provide
     * the Outposts bucket ARN in place of the bucket name. For more information about
     * S3 on Outposts ARNs, see Using
     * S3 on Outposts in the Amazon Simple Storage Service Developer
     * Guide.

     */
    inline AbortMultipartUploadRequest& WithBucket(const char* value) { SetBucket(value); return *this;}

    /**
     *
Key of the object for which the multipart upload was initiated.

     */
    inline const Aws::String& GetKey() const{ return m_key; }

    /**
     *
Key of the object for which the multipart upload was initiated.

     */
    inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; }

    /**
     *
Key of the object for which the multipart upload was initiated.

     */
    inline void SetKey(const Aws::String& value) { m_keyHasBeenSet = true; m_key = value; }

    /**
     *
Key of the object for which the multipart upload was initiated.

     */
    inline void SetKey(Aws::String&& value) { m_keyHasBeenSet = true; m_key = std::move(value); }

    /**
     *
Key of the object for which the multipart upload was initiated.

     */
    inline void SetKey(const char* value) { m_keyHasBeenSet = true; m_key.assign(value); }

    /**
     *
Key of the object for which the multipart upload was initiated.

     */
    inline AbortMultipartUploadRequest& WithKey(const Aws::String& value) { SetKey(value); return *this;}

    /**
     *
Key of the object for which the multipart upload was initiated.

     */
    inline AbortMultipartUploadRequest& WithKey(Aws::String&& value) { SetKey(std::move(value)); return *this;}

    /**
     *
Key of the object for which the multipart upload was initiated.

     */
    inline AbortMultipartUploadRequest& WithKey(const char* value) { SetKey(value); return *this;}

    /**
     *
Upload ID that identifies the multipart upload.

     */
    inline const Aws::String& GetUploadId() const{ return m_uploadId; }

    /**
     *
Upload ID that identifies the multipart upload.

     */
    inline bool UploadIdHasBeenSet() const { return m_uploadIdHasBeenSet; }

    /**
     *
Upload ID that identifies the multipart upload.

     */
    inline void SetUploadId(const Aws::String& value) { m_uploadIdHasBeenSet = true; m_uploadId = value; }

    /**
     *
Upload ID that identifies the multipart upload.

     */
    inline void SetUploadId(Aws::String&& value) { m_uploadIdHasBeenSet = true; m_uploadId = std::move(value); }

    /**
     *
Upload ID that identifies the multipart upload.

     */
    inline void SetUploadId(const char* value) { m_uploadIdHasBeenSet = true; m_uploadId.assign(value); }

    /**
     *
Upload ID that identifies the multipart upload.

     */
    inline AbortMultipartUploadRequest& WithUploadId(const Aws::String& value) { SetUploadId(value); return *this;}

    /**
     *
Upload ID that identifies the multipart upload.

     */
    inline AbortMultipartUploadRequest& WithUploadId(Aws::String&& value) { SetUploadId(std::move(value)); return *this;}

    /**
     *
Upload ID that identifies the multipart upload.

     */
    inline AbortMultipartUploadRequest& WithUploadId(const char* value) { SetUploadId(value); return *this;}

    inline const RequestPayer& GetRequestPayer() const{ return m_requestPayer; }

    inline bool RequestPayerHasBeenSet() const { return m_requestPayerHasBeenSet; }

    inline void SetRequestPayer(const RequestPayer& value) { m_requestPayerHasBeenSet = true; m_requestPayer = value; }

    inline void SetRequestPayer(RequestPayer&& value) { m_requestPayerHasBeenSet = true; m_requestPayer = std::move(value); }

    inline AbortMultipartUploadRequest& WithRequestPayer(const RequestPayer& value) { SetRequestPayer(value); return *this;}

    inline AbortMultipartUploadRequest& WithRequestPayer(RequestPayer&& value) { SetRequestPayer(std::move(value)); return *this;}

    /**
     *
The account id of the expected bucket owner. If the bucket is owned by a
     * different account, the request will fail with an HTTP 403 (Access
     * Denied) error.

     */
    inline const Aws::String& GetExpectedBucketOwner() const{ return m_expectedBucketOwner; }

    /**
     *
The account id of the expected bucket owner. If the bucket is owned by a
     * different account, the request will fail with an HTTP 403 (Access
     * Denied) error.

     */
    inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; }

    /**
     *
The account id of the expected bucket owner. If the bucket is owned by a
     * different account, the request will fail with an HTTP 403 (Access
     * Denied) error.

     */
    inline void SetExpectedBucketOwner(const Aws::String& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = value; }

    /**
     *
The account id of the expected bucket owner. If the bucket is owned by a
     * different account, the request will fail with an HTTP 403 (Access
     * Denied) error.

     */
    inline void SetExpectedBucketOwner(Aws::String&& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = std::move(value); }

    /**
     *
The account id of the expected bucket owner. If the bucket is owned by a
     * different account, the request will fail with an HTTP 403 (Access
     * Denied) error.

     */
    inline void SetExpectedBucketOwner(const char* value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner.assign(value); }

    /**
     *
The account id of the expected bucket owner. If the bucket is owned by a
     * different account, the request will fail with an HTTP 403 (Access
     * Denied) error.

     */
    inline AbortMultipartUploadRequest& WithExpectedBucketOwner(const Aws::String& value) { SetExpectedBucketOwner(value); return *this;}

    /**
     *
The account id of the expected bucket owner. If the bucket is owned by a
     * different account, the request will fail with an HTTP 403 (Access
     * Denied) error.

     */
    inline AbortMultipartUploadRequest& WithExpectedBucketOwner(Aws::String&& value) { SetExpectedBucketOwner(std::move(value)); return *this;}

    /**
     *
The account id of the expected bucket owner. If the bucket is owned by a
     * different account, the request will fail with an HTTP 403 (Access
     * Denied) error.

     */
    inline AbortMultipartUploadRequest& WithExpectedBucketOwner(const char* value) { SetExpectedBucketOwner(value); return *this;}

    inline const Aws::Map<Aws::String, Aws::String>& GetCustomizedAccessLogTag() const{ return m_customizedAccessLogTag; }

    inline bool CustomizedAccessLogTagHasBeenSet() const { return m_customizedAccessLogTagHasBeenSet; }

    inline void SetCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = value; }

    inline void SetCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = std::move(value); }

    inline AbortMultipartUploadRequest& WithCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { SetCustomizedAccessLogTag(value); return *this;}

    inline AbortMultipartUploadRequest& WithCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { SetCustomizedAccessLogTag(std::move(value)); return *this;}

    inline AbortMultipartUploadRequest& AddCustomizedAccessLogTag(const Aws::String& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }

    inline AbortMultipartUploadRequest& AddCustomizedAccessLogTag(Aws::String&& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }

    inline AbortMultipartUploadRequest& AddCustomizedAccessLogTag(const Aws::String& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }

    inline AbortMultipartUploadRequest& AddCustomizedAccessLogTag(Aws::String&& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), std::move(value)); return *this; }

    inline AbortMultipartUploadRequest& AddCustomizedAccessLogTag(const char* key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }

    inline AbortMultipartUploadRequest& AddCustomizedAccessLogTag(Aws::String&& key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }

    inline AbortMultipartUploadRequest& AddCustomizedAccessLogTag(const char* key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }

  private:

    Aws::String m_bucket;
    bool m_bucketHasBeenSet;

    Aws::String m_key;
    bool m_keyHasBeenSet;

    Aws::String m_uploadId;
    bool m_uploadIdHasBeenSet;

    RequestPayer m_requestPayer;
    bool m_requestPayerHasBeenSet;

    Aws::String m_expectedBucketOwner;
    bool m_expectedBucketOwnerHasBeenSet;

    Aws::Map<Aws::String, Aws::String> m_customizedAccessLogTag;
    bool m_customizedAccessLogTagHasBeenSet;
  };

} // namespace Model
} // namespace S3
} // namespace Aws