text:
package de.javaakademie.streamup.client.fx;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ResourceBundle;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

import javafx.application.HostServices;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.scene.media.MediaView;
import javafx.stage.DirectoryChooser;
import javafx.stage.Stage;

/**
 * UI-Controller.
 *
 * @author Guido.Oelmann
 */
public class MainController implements Initializable {

	private static final String DEFAULT_SERVER_ADDRESS = "http://localhost:8080/streamup/rest/video/";

	@FXML
	private ListView<Path> chunkList;
	@FXML
	private Button chunkSelectButton;
	@FXML
	private ImageView arrowImageView;
	@FXML
	private TextField serverField;
	@FXML
	private Button testConnectionButton;
	@FXML
	private MediaView mediaView;
	@FXML
	private Button sendButton;
	@FXML
	private CheckBox loopCheckBox;
	@FXML
	private Label statusLabel;
	@FXML
	private AnchorPane contentView;

	private StreamUpService streamUpService = new StreamUpService();

	boolean sendStream = false;

	@Override
	public void initialize(URL location, ResourceBundle resources) {
		chunkSelectButton.setOnAction(e -> selectChunkFolder());
		testConnectionButton.setOnAction(e -> testConnection());
		sendButton.setOnAction(e -> sendStream());
		loopCheckBox.setOnAction(e -> toggleLoop());

		serverField.setText(DEFAULT_SERVER_ADDRESS);

		String resourcePath = getClass().getResource("/").toExternalForm();
		Image image = new Image(resourcePath + "arrow.png");
		arrowImageView.setImage(image);
		VBox.setVgrow(arrowImageView, Priority.ALWAYS);
		mediaView.setStyle("-fx-background-color: black");
		statusLabel.setText("");
		Platform.runLater(() -> chunkSelectButton.requestFocus());

	}

	private void selectChunkFolder() {
		Stage stage = (Stage) contentView.getScene().getWindow();
		DirectoryChooser directoryChooser = new DirectoryChooser();
		File selectedDirectory = directoryChooser.showDialog(stage);
		if (selectedDirectory != null) {
			// chunkList.getItems().addAll(selectedDirectory.listFiles());
			chunkList.getItems().clear();
			Path dir = selectedDirectory.toPath();
			int depth = 1;
			try {
				Files.find(dir, depth, (path, attributes) -> correctSuffix(path)).forEach(chunkList.getItems()::add);
			} catch (IOException e) {
				Alert alert = new Alert(AlertType.ERROR);
				alert.setTitle("Error");
				alert.setHeaderText(null);
				alert.setContentText("Error while reading the files.");
				alert.showAndWait();
			}
		}
	}

	private boolean correctSuffix(Path path) {
		String filename = path.getFileName().toString().toLowerCase();
		if (filename.endsWith("mp4") || filename.endsWith("m4s")) {
			return true;
		} else {
			return false;
		}
	}

	private void testConnection() {
		String server = serverField.getText().trim();
		if (streamUpService.testConnection(server)) {
			Alert alert = new Alert(AlertType.INFORMATION);
			alert.setTitle("Successful");
			alert.setHeaderText(null);
			alert.setContentText("Connection tested successful.");
			alert.showAndWait();
		} else {
			Alert alert = new Alert(AlertType.ERROR);
			alert.setTitle("Error");
			alert.setHeaderText(null);
			alert.setContentText("Connecting to server failed.");
			alert.showAndWait();
		}
	}

	private void sendStream() {
		// server address set?
		String server = serverField.getText().trim();
		if (server.length() == 0) {
			Alert alert = new Alert(AlertType.INFORMATION);
			alert.setTitle("Information");
			alert.setHeaderText(null);
			alert.setContentText("Server address missing.");
			alert.showAndWait();
		} else if (!streamUpService.testConnection(server)) {
			Alert alert = new Alert(AlertType.ERROR);
			alert.setTitle("Error");
			alert.setHeaderText(null);
			alert.setContentText("Connecting to server failed.");
			alert.showAndWait();
		} else if (chunkList.getItems().size() > 0) {
			if (sendStream) {
				// cancel stream sending
				sendStream = false;
				sendButton.getStyleClass().remove("stopButton");
				sendButton.setText("Send Stream");
			} else {
				// start sending and set cancel button
				sendStream = true;
				sendButton.setText("Stop Sending");
				sendButton.getStyleClass().add("stopButton");

				CompletableFuture<Void> future = CompletableFuture.supplyAsync(taskCreatePost);
				future.thenAcceptAsync(dbl -> Platform.runLater(() -> resetSendButton()));
			}
		}
	}

	private void resetSendButton() {
		sendButton.getStyleClass().remove("stopButton");
		sendButton.setText("Send Stream");
	}

	public Supplier<Void> taskCreatePost = () -> {
		boolean endReached = false;
		int totalChunks = chunkList.getItems().size();
		int index = 0;
		while (sendStream && !endReached) {
			try {
				System.out.println("send chunk: " + chunkList.getItems().get(index));
				streamUpService.sendChunk(serverField.getText(), chunkList.getItems().get(index));
				index++;
				if (index == totalChunks) {
					if (loopCheckBox.isSelected() && sendStream) {
						// restart stream
						index = 0;
					} else {
						sendStream = false;
					}
				}
				TimeUnit.MILLISECONDS.sleep(4);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		return null;
	};

	/**
	 * TODO: Video-Loop not implemented yet!
	 */
	private void toggleLoop() {
		if (loopCheckBox.isSelected()) {
			System.out.println("select");
		} else {
			System.out.println("deselect");
		}
	}

	@FXML
	private void handleAbout() {
		FlowPane fp = new FlowPane();
	    Label lbl = new Label("Guido Oelmann - ");
		Hyperlink link = new Hyperlink();
		link.setText("http://JavaAkademie.de");
		link.setOnAction(new EventHandler<ActionEvent>() {
			@Override
			public void handle(ActionEvent e) {
				Stage stage = (Stage) contentView.getScene().getWindow();
				HostServices hostServices = (HostServices)stage.getProperties().get("hostServices");
				hostServices.showDocument(link.getText());
			}
		});
	    fp.getChildren().addAll( lbl, link);

		Alert alert = new Alert(AlertType.INFORMATION);
		alert.setTitle("About");
		alert.setHeaderText("Test Client for the StreamUp plattform!");
		alert.getDialogPane().contentProperty().set(fp);
		alert.showAndWait();
	}

	@FXML
	private void handleExit() {
		System.exit(0);
	}
}


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

<title>SquareMatrix2D (Newton Raphson)</title>
<meta name="date" content="2015-11-25">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

de.linearbits.newtonraphson

Class SquareMatrix2D

java.lang.Object

de.linearbits.newtonraphson.SquareMatrix2D

public class SquareMatrix2D
extends java.lang.Object

This class implements a square matrix in RxR

Field Summary

Fields

Modifier and Type
Field and Description

double
x1

(x1 x2), (y1 y2)

double
x2

(x1 x2), (y1 y2)

double
y1

(x1 x2), (y1 y2)

double
y2

(x1 x2), (y1 y2)

Constructor Summary

Constructors

Constructor and Description

SquareMatrix2D()

Creates a new instance

SquareMatrix2D(double x1,
              double x2,
              double y1,
              double y2)

Creates a new instance

Method Summary

Methods

Modifier and Type
Method and Description

double
det()

Returns the determinant

void
inverse()

Computes the inverse matrix

java.lang.String
toString()

Returns a string representation

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

x1

public double x1

(x1 x2), (y1 y2)

x2

public double x2

(x1 x2), (y1 y2)

y1

public double y1

(x1 x2), (y1 y2)

y2

public double y2

(x1 x2), (y1 y2)

Constructor Detail

SquareMatrix2D

public SquareMatrix2D()

Creates a new instance

SquareMatrix2D

public SquareMatrix2D(double x1,
              double x2,
              double y1,
              double y2)

Creates a new instance

Parameters:

x1 -

x2 -

y1 -

y2 -

Method Detail

det

public double det()

Returns the determinant

Returns:

inverse

public void inverse()

Computes the inverse matrix

toString

public java.lang.String toString()

Returns a string representation

Overrides:

toString in class java.lang.Object

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace TrixonSystems.PTemplater.WebApplication
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            TrixonSystems.PTemplater.PTemplater.Initialize(typeof(MvcApplication));
        }
    }
}


text:
<?php

/**
 * GxHtml extends CHtml and provides additional features.
 *
 * @author Rodrigo Coelho <rodrigo@giix.org>
 */
class GxHtml extends CHtml
{

    /**
     * Renders a checkbox list for a model attribute.
     * #MethodTracker
     * This method is based on {@link CHtml::activeCheckBoxList}, from version 1.1.7 (r3135). Changes:
     *

     *
Added support to HAS_MANY and MANY_MANY relations.

     *

     * Note: Since Yii 1.1.7, $htmlOptions has an option named 'uncheckValue'.
     * If you set it to different values than the default value (''), you will
     * need to change the generated code accordingly or use
     * GxController::getRelatedData with the appropriate 'uncheckValue'.
     * If you set it to null, you will have to handle it manually.
     *
     * @see CHtml::activeCheckBoxList
     *
     * @param CModel $model       The data model.
     * @param string $attribute   The attribute.
     * @param array  $data        Value-label pairs used to generate the check box list.
     * @param array  $htmlOptions Addtional HTML options.
     *
     * @return string The generated check box list.
     */
    public static function activeCheckBoxList($model, $attribute, $data, $htmlOptions = array())
    {

        self::resolveNameID($model, $attribute, $htmlOptions);
        $selection = self::selectData(
            self::resolveValue($model, $attribute)
        ); // #Change: Added support to HAS_MANY and MANY_MANY relations.
        if ($model->hasErrors($attribute)) {
            self::addErrorCss($htmlOptions);
        }
        $name = $htmlOptions['name'];
        unset($htmlOptions['name']);

        if (array_key_exists('uncheckValue', $htmlOptions)) {
            $uncheck = $htmlOptions['uncheckValue'];
            unset($htmlOptions['uncheckValue']);
        } else {
            $uncheck = '';
        }

        $hiddenOptions = isset($htmlOptions['id']) ? array('id' => self::ID_PREFIX . $htmlOptions['id']) : array('id' => false);
        $hidden        = $uncheck !== null ? self::hiddenField($name, $uncheck, $hiddenOptions) : '';

        return $hidden . self::checkBoxList($name, $selection, $data, $htmlOptions);
    }

    /**
     * Generates the data suitable for list-based HTML elements.
     * #MethodTracker (complex changes)
     * This method is based on {@link CHtml::listData}, from version 1.1.7 (r3135). Changes:
     *

     *
This method supports {@link GxActiveRecord::representingColumn} and {@link GxActiveRecord::toString}.

     *
This method supports tables with composite primary keys.

     *

     *
     * @see CHtml::listData
     *
     * @param array  $models     A list of model objects. This parameter
     *                           can also be an array of associative arrays (e.g. results of {@link CDbCommand::queryAll}).
     * @param string $valueField The attribute name for list option values.
     *                           Optional. If not specified, the primary key (or keys) will be used.
     * @param string $textField  The attribute name for list option texts.
     *                           Optional. If not specified, the {@link GxActiveRecord::__toString} method will be used.
     * @param string $groupField The attribute name for list option group names. If empty, no group will be generated.
     *
     * @return array The list data that can be used in {@link dropDownList}, {@link listBox}, etc.
     */
    public static function listDataEx($models, $valueField = null, $textField = null, $groupField = '')
    {

        $listData = array();
        if ($groupField === '') {
            foreach ($models as $model) {
                // If $valueField is null, use the primary key.
                if ($valueField === null) {
                    $value = GxActiveRecord::extractPkValue($model, true);
                } else {
                    $value = self::valueEx($model, $valueField);
                }
                $text             = self::valueEx($model, $textField);
                $listData[$value] = $text;
            }
        } else {
            foreach ($models as $model) {
                // If $valueField is null, use the primary key.
                if ($valueField === null) {
                    $value = GxActiveRecord::extractPkValue($model, true);
                } else {
                    $value = self::valueEx($model, $valueField);
                }
                $group                    = self::valueEx($model, $groupField);
                $text                     = self::valueEx($model, $textField);
                $listData[$group][$value] = $text;
            }
        }
        return $listData;
    }

    /**
     * Generates the select data suitable for list-based HTML elements.
     * The select data has the attribute or related data as returned
     * by {@link CHtml::resolveValue}.
     * If the select data comes from a MANY_MANY or a HAS_MANY related
     * attribute (is a model or an array of models), it is transformed
     * to a string or an array of strings with the selected primary keys.
     *
     * @param mixed $value The value of the attribute as returned by
     *                     {@link CHtml::resolveValue}.
     *
     * @return mixed The select data.
     */
    public static function selectData($value)
    {

        // If $value is a model or an array of models, turn it into
        // a string or an array of strings with the pk values.
        if ((is_object($value) && is_subclass_of($value, 'GxActiveRecord')) ||
            (is_array($value) && !empty($value) && is_object($value[0]) && is_subclass_of($value[0], 'GxActiveRecord'))
        ) {
            return GxActiveRecord::extractPkValue($value, true);
        } else {
            return $value;
        }
    }

    /**
     * Evaluates the value of the specified attribute for the given model.
     * #MethodTracker
     * This method improves {@link CHtml::value}, from version 1.1.7 (r3135). Changes:
     *

     *
This method supports {@link GxActiveRecord::representingColumn} and {@link GxActiveRecord::toString}.

     *

     *
     * @see CHtml::value
     *
     * @param mixed  $model        The model. This can be either an object or an array.
     * @param string $attribute    The attribute name (use dot to concatenate multiple attributes).
     *                             Optional. If not specified, the {@link GxActiveRecord::__toString} method will be used.
     *                             In this case, the fist parameter ($model) can not be an array, it must be an instance of GxActiveRecord.
     * @param mixed  $defaultValue The default value to return when the attribute does not exist.
     *
     * @return mixed The attribute value.
     */
    public static function valueEx($model, $attribute = null, $defaultValue = null)
    {

        if ($attribute === null) {
            if (is_object($model) && is_subclass_of($model, 'GxActiveRecord')) {
                return $model->__toString();
            } else {
                return $defaultValue;
            }
        } else {
            return parent::value($model, $attribute, $defaultValue);
        }
    }

    /**
     * Encodes special characters into HTML entities.
     * #MethodTracker
     * This method improves {@link CHtml::encode}, from version 1.1.7 (r3135). Changes:
     *

     *
This method supports encoding strings in arrays and selective encoding of keys and/or values.

     *

     *
     * @see CHtml::encode
     *
     * @param string|array $data         Data to be encoded.
     * @param boolean      $encodeKeys   Whether to encode array keys.
     * @param boolean      $encodeValues Whether to encode array values.
     * @param boolean      $recursive    Whether to encode data in nested arrays.
     *
     * @return string|array The encoded data.
     * @throws InvalidArgumentException If the argument "data" type is not string or array.
     */
    public static function encodeEx($data, $encodeKeys = false, $encodeValues = false, $recursive = true)
    {

        if (is_array($data)) {
            $encodedArray = array();
            foreach ($data as $key => $value) {
                $encodedKey = ($encodeKeys && is_string($key)) ? parent::encode($key) : $key;
                if (is_array($value)) {
                    if ($recursive) {
                        $encodedValue = self::encodeEx($value, $encodeKeys, $encodeValues, $recursive);
                    } else {
                        $encodedValue = $value;
                    }
                } else {
                    $encodedValue = ($encodeValues && is_string($value)) ? parent::encode($value) : $value;
                }
                $encodedArray[$encodedKey] = $encodedValue;
            }
            return $encodedArray;
        } else {
            if (is_string($data)) {
                return parent::encode($data);
            } else {
                throw new InvalidArgumentException(Yii::t(
                    'giix',
                    'The argument "data" must be of type string or array.'
                ));
            }
        }
    }

}


text:
from utils import singleton
import elasticsearch
import logging

logger = logging.getLogger(__name__)

@singleton
class ES(object):
    def __init__(self):
        self.connections = {}

    def add_connection(self, connection_string, name='default'):
        self.connections[name] = ElasticClient(connection_string)

    def get_connection(self, name='default'):
        """
        :param name: str
        :return: elasticsearch.Elasticsearch
        """
        return self.connections[name]

class ElasticClient(elasticsearch.Elasticsearch):
    def __init__(self, *args, **kwargs):
        super(ElasticClient, self).__init__(*args, **kwargs)


text:
<?php

namespace Opulence\Framework\Tests\Configuration;

use Opulence\Framework\Configuration\Config;

/**
 * Tests the config reader
 */
class ConfigTest extends \PHPUnit\Framework\TestCase
{
    /**
     * Tests getting a non-existent value
     */
    public function testGettingNonExistentValue()
    {
        $this->assertNull(Config::get('foo', 'bar'));
        $this->assertEquals('baz', Config::get('foo', 'bar', 'baz'));
        $this->assertFalse(Config::has('foo', 'bar'));
    }

    /**
     * Tests setting many settings by category
     */
    public function testSettingCategory()
    {
        Config::setCategory('foo', ['bar' => 'baz']);
        $this->assertEquals('baz', Config::get('foo', 'bar'));
        $this->assertTrue(Config::has('foo', 'bar'));
        Config::setCategory('foo', ['dave' => 'young']);
        $this->assertEquals('young', Config::get('foo', 'dave'));
        $this->assertTrue(Config::has('foo', 'dave'));
    }

    /**
     * Tests setting a single setting
     */
    public function testSettingSingleSetting()
    {
        Config::set('foo', 'bar', 'baz');
        $this->assertEquals('baz', Config::get('foo', 'bar'));
        $this->assertTrue(Config::has('foo', 'bar'));
        Config::set('foo', 'bar', 'blah');
        $this->assertEquals('blah', Config::get('foo', 'bar'));
        $this->assertTrue(Config::has('foo', 'bar'));
    }
}


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

<title>CommandLine.IExceptionHandler2 (picocli 4.7.0 API)</title>
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

picocli

Interface CommandLine.IExceptionHandler2<R>

Type Parameters:

R - the return type of this handler

All Known Implementing Classes:

CommandLine.DefaultExceptionHandler

Enclosing class:

CommandLine

Deprecated.

see CommandLine.execute(String...), CommandLine.IParameterExceptionHandler and CommandLine.IExecutionExceptionHandler

@Deprecated
public static interface CommandLine.IExceptionHandler2<R>

Classes implementing this interface know how to handle ParameterExceptions (usually from invalid user input)
 and ExecutionExceptions that occurred while executing the Runnable or Callable command.

 Implementations of this interface can be passed to the
 CommandLine::parseWithHandlers method.

 This interface replaces the CommandLine.IParseResultHandler interface.

Since:

3.0

See Also:

CommandLine.DefaultExceptionHandler

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods

Modifier and Type
Method and Description

R
handleExecutionException(CommandLine.ExecutionException ex,
                        CommandLine.ParseResult parseResult)

Deprecated.

Handles a ExecutionException that occurred while executing the Runnable or
 Callable command and optionally returns a list of results.

R
handleParseException(CommandLine.ParameterException ex,
                    String[] args)

Deprecated.

Handles a ParameterException that occurred while parsing the command
 line arguments and optionally returns a list of results.

Method Detail

handleParseException

R handleParseException(CommandLine.ParameterException ex,
                       String[] args)

Deprecated.

Handles a ParameterException that occurred while parsing the command
 line arguments and optionally returns a list of results.

Parameters:

ex - the ParameterException describing the problem that occurred while parsing the command line arguments,
           and the CommandLine representing the command or subcommand whose input was invalid

args - the command line arguments that could not be parsed

Returns:

an object resulting from handling the exception

handleExecutionException

R handleExecutionException(CommandLine.ExecutionException ex,
                           CommandLine.ParseResult parseResult)

Deprecated.

Handles a ExecutionException that occurred while executing the Runnable or
 Callable command and optionally returns a list of results.

Parameters:

ex - the ExecutionException describing the problem that occurred while executing the Runnable or
          Callable command, and the CommandLine representing the command or subcommand that was being executed

parseResult - the result of parsing the command line arguments

Returns:

an object resulting from handling the exception

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
import React from 'react';
import ReactDOM from 'react-dom';
import GoogleMapAddBird from './addBird';
var root = document.getElementById('add_bird');
ReactDOM.render(
    <GoogleMapAddBird {...(root.dataset)}/>,
    root
);


text:
package org.kxml2.io;

import junit.framework.TestCase;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.StringWriter;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xmlpull.v1.XmlSerializer;

import static tests.support.Support_Xml.*;

public class KXmlSerializerTest extends TestCase {
    private static final String NAMESPACE = null;

    private static boolean isValidXmlCodePoint(int c) {
        // http://www.w3.org/TR/REC-xml/#charsets
        return (c >= 0x20 && c <= 0xd7ff) || (c == 0x9) || (c == 0xa) || (c == 0xd) ||
                (c >= 0xe000 && c <= 0xfffd) || (c >= 0x10000 && c <= 0x10ffff);
    }

    private static XmlSerializer newSerializer() throws IOException {
        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
        XmlSerializer serializer = new KXmlSerializer();
        serializer.setOutput(bytesOut, "UTF-8");
        serializer.startDocument("UTF-8", null);
        return serializer;
    }

    public void testInvalidCharactersInText() throws IOException {
        XmlSerializer serializer = newSerializer();
        serializer.startTag(NAMESPACE, "root");
        for (int ch = 0; ch <= 0xffff; ++ch) {
            final String s = Character.toString((char) ch);
            if (isValidXmlCodePoint(ch)) {
                serializer.text("a" + s + "b");
            } else {
                try {
                    serializer.text("a" + s + "b");
                    fail(s);
                } catch (IllegalArgumentException expected) {
                }
            }
        }
        serializer.endTag(NAMESPACE, "root");
    }

    public void testInvalidCharactersInAttributeValues() throws IOException {
        XmlSerializer serializer = newSerializer();
        serializer.startTag(NAMESPACE, "root");
        for (int ch = 0; ch <= 0xffff; ++ch) {
            final String s = Character.toString((char) ch);
            if (isValidXmlCodePoint(ch)) {
                serializer.attribute(NAMESPACE, "a", "a" + s + "b");
            } else {
                try {
                    serializer.attribute(NAMESPACE, "a", "a" + s + "b");
                    fail(s);
                } catch (IllegalArgumentException expected) {
                }
            }
        }
        serializer.endTag(NAMESPACE, "root");
    }

    public void testInvalidCharactersInCdataSections() throws IOException {
        XmlSerializer serializer = newSerializer();
        serializer.startTag(NAMESPACE, "root");
        for (int ch = 0; ch <= 0xffff; ++ch) {
            final String s = Character.toString((char) ch);
            if (isValidXmlCodePoint(ch)) {
                serializer.cdsect("a" + s + "b");
            } else {
                try {
                    serializer.cdsect("a" + s + "b");
                    fail(s);
                } catch (IllegalArgumentException expected) {
                }
            }
        }
        serializer.endTag(NAMESPACE, "root");
    }

    public void testCdataWithTerminatorInside() throws Exception {
        StringWriter writer = new StringWriter();
        XmlSerializer serializer = new KXmlSerializer();
        serializer.setOutput(writer);
        serializer.startDocument("UTF-8", null);
        serializer.startTag(NAMESPACE, "p");
        serializer.cdsect("a]]>b");
        serializer.endTag(NAMESPACE, "p");
        serializer.endDocument();
        // Adjacent CDATA sections aren't merged, so let's stick them together ourselves...
        Document doc = domOf(writer.toString());
        NodeList children = doc.getFirstChild().getChildNodes();
        String text = "";
        for (int i = 0; i < children.getLength(); ++i) {
            text += children.item(i).getNodeValue();
        }
        assertEquals("a]]>b", text);
    }
}


text:
<?php

    // set some variables to use below
	if(get_input("type") == "sent"){

        // send back to the users sentbox
        $url = $vars['url'] . "mod/messages/sent.php";

        //this is used on the delete link so we know which type of message it is
        $type = "sent";

    } else {

        //send back to the users inbox
        $url = $vars['url'] . "pg/messages/" . $vars['user']->username;

        //this is used on the delete link so we know which type of message it is
        $type = "inbox";

    }

	// fix for RE: RE: RE: that builds on replies
	$reply_title = $vars['entity']->title;
	if (strncmp($reply_title, "RE:", 3) != 0) {
		$reply_title = "RE: " . $reply_title;
	}

    if (isloggedin())
    if (isset($vars['entity'])) {
    	if ($vars['entity']->toID == $vars['user']->guid
    		|| $vars['entity']->owner_guid == $vars['user']->guid) {

?>

<a href="<?php echo $url; ?>">« <?php echo elgg_echo('messages:back'); ?>

            <?php
                // we need a different user icon and name depending on whether the user is reading the message
                // from their inbox or sentbox. If it is the inbox, then the icon and name will be the person who sent
                // the message. If it is the sentbox, the icon and name will be the user the message was sent to
                if($type == "sent"){
                    //get an instance of the user who the message has been sent to so we can access the name and icon
                    $user_object = get_entity($vars['entity']->toId);
                    //get the icon
                    echo " " . elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny'));
                    //get the name
                    echo "

".elgg_echo('messages:to').": " . $user_object->name . "
";
                }else{
                    //get the icon
                    echo " " . elgg_view("profile/icon",array('entity' => get_entity($vars['entity']->fromId), 'size' => 'tiny'));
                    //get the name
                    echo "

".elgg_echo('messages:from').": " . get_entity($vars['entity']->fromId)->name . "
";
                }
            ?>

            <?php echo friendly_time($vars['entity']->time_created); ?>

        <?php
		    //if the message is a reply, display the message the reply was for
		    //I need to figure out how to get the description out using -> (anyone?)
		    if($main_message = $vars['entity']->getEntitiesFromRelationship("reply")){

    		    if($type == "sent"){
        		    echo "

".elgg_echo('messages:original').":

";
    		    }else{
    		        echo "

".elgg_echo('messages:yours').":

";
		        }

    		    echo $main_message[0][description] . "

";

    	    }
    	?>

<?php echo $vars['entity']->title; ?>

<?php echo elgg_view('output/longtext',array('value' => $vars['entity']->description)); ?>

<?php if($type != "sent")echo "".elgg_echo('messages:answer')."   "; ?> <?php echo elgg_view("output/confirmlink", array(
																'href' => $vars['url'] . "action/messages/delete?message_id=" . $vars['entity']->getGUID() . "&type={$type}&submit=" . elgg_echo('delete'),
																'text' => elgg_echo('delete'),
																'confirm' => elgg_echo('deleteconfirm'),
															)); ?>

			<form action="<?php echo $vars['url']; ?>action/messages/send" method="post" name="messageForm">

<?php echo elgg_echo("messages:title"); ?>:
<input type='text' name='title' class="input-text" value='<?php echo $reply_title; ?>' />

<?php echo elgg_echo("messages:message"); ?>:

				<?php

				    echo elgg_view("input/longtext", array(
									"internalname" => "message",
									"value" => '',
													));

		        ?>

	        			<?php

	            				//pass across the guid of the message being replied to
    	        				echo "<input type='hidden' name='reply' value='" . $vars['entity']->getGUID() . "' />";
    	        				//pass along the owner of the message being replied to
    	        				echo "<input type='hidden' name='send_to' value='" . $vars['entity']->fromId . "' />";

	        			?>
	        			<input type="submit" class="submit_button" value="<?php echo elgg_echo("messages:fly"); ?>" />

			</form>

<?php
    		}
    }
?>


text:
<html>
<head>
<!-- Trello Power-Up Library -->
<script src="https://trello.com/power-ups/power-up.min.js"></script>
<link rel="stylesheet" href="https://trello.com/power-ups/power-up.css"/>
<script>
var t = TrelloPowerUp.iframe();
var myAuth = function() {
  t.authorize(function(secret) {
      console.log(secret);
      return './auth-window.html?secret=' + secret;
  })
  .then(function(token){
    return t.set('organization', 'private', 'token', token)
    .catch(t.NotHandled, function(){
      return t.set('board', 'private', 'token', token)
    })
  })
  .then(function(result) {
  	// This won't work until the secrets match
  	console.log('got back:', result);
  	t.closePopup();
  }, function(error) {
  	console.log("Promise rejected with ", error);
  	t.closePopup();
  });
};
</script>

</head>
<body>
<button onclick="myAuth();">Authenticate</button>
</body>
</html>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.security.models.ExpandControlsEnum;

/** Samples for SecureScoreControls ListBySecureScore. */
public final class SecureScoreControlsListBySecureScoreSamples {
    /*
     * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json
     */
    /**
     * Sample code: Get security controls and their current score for the specified initiative with the expand
     * parameter.
     *
     * @param manager Entry point to SecurityManager.
     */
    public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter(
        com.azure.resourcemanager.security.SecurityManager manager) {
        manager.secureScoreControls().listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, Context.NONE);
    }

    /*
     * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForName_builtin_example.json
     */
    /**
     * Sample code: Get security controls and their current score for the specified initiative.
     *
     * @param manager Entry point to SecurityManager.
     */
    public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative(
        com.azure.resourcemanager.security.SecurityManager manager) {
        manager.secureScoreControls().listBySecureScore("ascScore", null, Context.NONE);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file generated by Sakai App Builder -AZ -->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee  http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
	version="2.5">

<!-- web-app xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
	version="2.4" -->
	<display-name>sakai-signup</display-name>
	<description>Sakai Sign-up</description>

	<context-param>
		<param-name>com.sun.faces.validateXml</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<param-name>com.sun.faces.verifyObjects</param-name>
		<param-value>false</param-value>
	</context-param>

	<listener>
		<listener-class>
			org.sakaiproject.util.ToolListener
		</listener-class>
	</listener>

	<!-- Tool Servlet -->
	<servlet>
		<!-- servlet name must match tool.id in tools xml file -->
		<servlet-name>sakai.signup</servlet-name>
		<servlet-class>
			org.sakaiproject.signup.tool.SignupServlet
		</servlet-class>
		<init-param>
			<param-name>default</param-name>
			<param-value>signupMeetings</param-value>
		</init-param>
		<init-param>
			<param-name>path</param-name>
			<param-value>/signup</param-value>
		</init-param>
		<init-param>
			<param-name>default.last.view</param-name>
			<param-value>true</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<filter>
		<filter-name>org.sakaiproject.util.RequestFilter</filter-name>
		<filter-class>org.sakaiproject.util.RequestFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>org.sakaiproject.util.RequestFilter</filter-name>
		<servlet-name>sakai.signup</servlet-name>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>

<!-- Sakai request filter -->
	<filter>
		<filter-name>sakai.request</filter-name>
		<filter-class>org.sakaiproject.util.RequestFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>sakai.request</filter-name>
		<servlet-name>FacesServlet</servlet-name>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>

	<!-- Faces Servlet -->
	<servlet>
		<servlet-name>FacesServlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>2</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>FacesServlet</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>

	<!-- Support for MyFaces component resources. -->
	<filter>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<filter-class>
			org.apache.myfaces.webapp.filter.ExtensionsFilter
		</filter-class>
		<init-param>
			<param-name>uploadMaxFileSize</param-name>
			<param-value>10m</param-value>
		</init-param>
		<init-param>
			<param-name>uploadThresholdSize</param-name>
			<param-value>100k</param-value>
		</init-param>
	</filter>

	<filter-mapping>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
	</filter-mapping>

	<!-- Sakai listeners -->

	<listener>
		<listener-class>
			org.sakaiproject.util.SakaiContextLoaderListener
		</listener-class>
	</listener>

</web-app>


text:
using System;
using System.Text;
using Task_1._Class_Chef_in_CS.Contracts;
using Task_1._Class_Chef_in_CS.Enums;
using Task_1._Class_Chef_in_CS.Models;

public class Chef : IChef
{
    public void Peel(Vegetable vegetable)
    {
        Console.WriteLine("The " + vegetable.Type.ToString().ToLower() + " is now cut.");
    }

    public void Cut(Vegetable vegetable)
    {
        Console.WriteLine("The " + vegetable.Type.ToString().ToLower() + " is now peeled.");
    }

    public Vegetable GetVegetable(VegetableType type)
    {
        switch (type)
        {
            case VegetableType.Carrot:
                return new Carrot();
            case VegetableType.Potato:
                return new Potato();
            default:
                throw new InvalidOperationException("Unknown vegetable type.");
        }
    }

    public Bowl GetBowl()
    {
        var bowl = new Bowl();
        return bowl;
    }

    public void Cook()
    {
        Vegetable potato = GetVegetable(VegetableType.Potato);
        Peel(potato);
        Cut(potato);

        Vegetable carrot = GetVegetable(VegetableType.Carrot);
        Peel(carrot);
        Cut(carrot);

        Bowl bowl = GetBowl();
        bowl.Add(carrot);
        bowl.Add(potato);

        var sb = new StringBuilder();
        sb.Append("Bowl with ");
        foreach (var vegetable in bowl.Vegetables)
        {
            sb.Append($"{vegetable.Type.ToString().ToLower()} + ");
        }

        sb.Remove(sb.Length - 3, 3);
        sb.Append(" is now prepared!");
        Console.WriteLine(sb.ToString());
    }
}


text:
<!DOCTYPE html>

	<title>Johnny and Leroy: The Art of Michelle Lee</title>
	<link type="text/css" rel="stylesheet" href="stylesheet.css" />

Johnny and Leroy

			The Art of Michelle Lumbert

Portfolio About Contact

J & L

Illustrated Artwork

1 / 11

2 / 11

3 / 11

4 / 11

5 / 11

6 / 11

7 / 11

8 / 11

9 / 11

10 / 11

11 / 11

			❮
			❯

Michelle Lumbert &#8226 michelle@johnnyandleroy.com &#8226 +44 7392 110984


text:
<?php

    // Load the TGM init if it exists
    if ( file_exists( dirname( __FILE__ ) . '/tgm/tgm-init.php' ) ) {
        require_once dirname( __FILE__ ) . '/tgm/tgm-init.php';
    }

    // Load the embedded Redux Framework
    if ( file_exists( dirname( __FILE__ ).'/redux-framework/framework.php' ) ) {
        require_once dirname(__FILE__).'/redux-framework/framework.php';
    }

    // Load the theme/plugin options
    if ( file_exists( dirname( __FILE__ ) . '/options-init.php' ) ) {
        require_once dirname( __FILE__ ) . '/options-init.php';
    }

    // Load Redux extensions
    if ( file_exists( dirname( __FILE__ ) . '/redux-extensions/extensions-init.php' ) ) {
        require_once dirname( __FILE__ ) . '/redux-extensions/extensions-init.php';
    }


text:
namespace mini::io {

enum class file_access : DWORD
{
  read            = GENERIC_READ,
  write           = GENERIC_WRITE,
  read_write      = GENERIC_READ | GENERIC_WRITE,
};

enum class file_mode : DWORD
{
  append,
  create          = CREATE_ALWAYS,
  create_new      = CREATE_NEW,
  open            = OPEN_EXISTING,
  open_or_create  = OPEN_ALWAYS,
  truncate        = TRUNCATE_EXISTING,
};

enum class file_share : DWORD
{
  none            = 0,
  dispose         = FILE_SHARE_DELETE,
  read            = FILE_SHARE_READ,
  read_write      = FILE_SHARE_READ | FILE_SHARE_WRITE,
  write           = FILE_SHARE_WRITE,
};

enum class file_options : DWORD
{
  none            = 0,
  delete_on_close = FILE_FLAG_DELETE_ON_CLOSE,
  random_access   = FILE_FLAG_RANDOM_ACCESS,
  sequential_scan = FILE_FLAG_SEQUENTIAL_SCAN,
  write_through   = FILE_FLAG_WRITE_THROUGH,
};

class file_stream
  : public stream
{
  public:
    file_stream(
      void
      )
      : _file_handle(INVALID_HANDLE_VALUE)
      , _access((file_access)0)
      , _mode((file_mode)0)
      , _share((file_share)0)
      , _options((file_options)0)
    {

    }

    file_stream(
      const string_ref path,
      file_access access = file_access::read_write,
      file_mode mode = file_mode::open_or_create,
      file_share share = file_share::read,
      file_options options = file_options::none
      )
    {
      open(path,
        access,
        mode,
        share,
        options);
    }

    ~file_stream(
      void
      )
    {
      close();
    }

    void
    open(
      const string_ref path,
      file_access access = file_access::read_write,
      file_mode mode = file_mode::open_or_create,
      file_share share = file_share::none,
      file_options options = file_options::none
      )
    {
      _path    = path;
      _access  = access;
      _mode    = mode;
      _share   = share;
      _options = options;

      DWORD real_mode = (DWORD)_mode;

      //
      // do not create new file when we're accessing
      // it only for read.
      //
      if (_access == file_access::read &&
          _mode   == file_mode::open_or_create)
      {
        _mode = file_mode::open;
        real_mode = (DWORD)_mode;
      }

      //
      // append is realy just open_or_create + seek at the end
      //
      if (_mode == file_mode::append)
      {
        real_mode = (DWORD)file_mode::open_or_create;
      }

      _file_handle = CreateFile(
        path.get_buffer(),
        (DWORD)_access,
        (DWORD)_share,
        NULL,
        (DWORD)real_mode,
        (DWORD)_options,
        NULL);

      if (_mode == file_mode::append)
      {
        seek(0, stream::end);
      }
    }

    void
    close(
      void
      ) override
    {
      if (_file_handle != INVALID_HANDLE_VALUE)
      {
        //         _access  = (file_access)0;
        //         _mode    = (file_mode)0;
        //         _share   = (file_share)0;
        //         _options = (file_options)0;

        CloseHandle(_file_handle);

        _file_handle = INVALID_HANDLE_VALUE;
      }
    }

    bool
    can_read(
      void
      ) const override
    {
      return ((DWORD)_access & (DWORD)file_access::read) != 0;
    }

    bool
    can_write(
      void
      ) const override
    {
      return ((DWORD)_access & (DWORD)file_access::write) != 0;
    }

    bool
    can_seek(
      void
      ) const override
    {
      return true;
    }

    size_type
    seek(
      intptr_t offset,
      seek_origin origin = seek_origin::current
      ) override
    {
      DWORD move_method = origin == seek_origin::begin
         ? FILE_BEGIN   : origin == seek_origin::current
         ? FILE_CURRENT : origin == seek_origin::end
         ? FILE_END     : FILE_CURRENT;

      return SetFilePointer(_file_handle,
        (DWORD)offset,
        NULL,
        move_method);
    }

    void
    flush(
      void
      ) override
    {
      FlushFileBuffers(_file_handle);
    }

    size_type
    get_size(
      void
      ) const override
    {
      return GetFileSize(
        _file_handle,
        NULL);
    }

    size_type
    get_position(
      void
      ) const override
    {
      return const_cast<file_stream*>(this)->seek(0, seek_origin::current);
    }

    bool
    is_open(
      void
      ) const
    {
      return _file_handle != INVALID_HANDLE_VALUE;
    }

  private:
    size_type
    read_impl(
      void* buffer,
      size_type size
      ) override
    {
      DWORD bytes_read;
      ReadFile(
        _file_handle,
        buffer,
        (DWORD)size,
        &bytes_read,
        NULL);

      return bytes_read;
    }

    size_type
    write_impl(
      const void* buffer,
      size_type size
      ) override
    {
      DWORD bytes_written;
      WriteFile(_file_handle,
        buffer,
        (DWORD)size,
        &bytes_written,
        NULL);

      return bytes_written;
    }

    HANDLE _file_handle;
    string _path;
    file_access _access;
    file_mode _mode;
    file_share _share;
    file_options _options;
};

}


text:
<!DOCTYPE html>

  <link rel="stylesheet" type="text/css" href="popup.css">

      Error

        <input type="checkbox" id="autoupload">

          Upload & file bug automatically after capture

        Captured

          trace.json.gz
          (0.0 MB)

          Upload & file a bug

      The titles and URLs of your open tabs and extensions are included in this
      report and will be visible to Chrome developers after you upload it.


text:
package nextmethod.web.razor.editor;

import java.util.EnumSet;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import javax.annotation.Nonnull;

import com.google.common.collect.Sets;
import nextmethod.base.Delegates;
import nextmethod.base.Strings;
import nextmethod.web.razor.PartialParseResult;
import nextmethod.web.razor.parser.ParserHelpers;
import nextmethod.web.razor.parser.syntaxtree.AcceptedCharacters;
import nextmethod.web.razor.parser.syntaxtree.Span;
import nextmethod.web.razor.text.StringReaderDelegate;
import nextmethod.web.razor.text.TextChange;
import nextmethod.web.razor.text.TextExtensions;
import nextmethod.web.razor.tokenizer.symbols.ISymbol;

import static nextmethod.base.TypeHelpers.typeAs;

public class ImplicitExpressionEditorHandler extends SpanEditHandler {

    public Set<String> keywords;
    public boolean acceptTrailingDot;

    public ImplicitExpressionEditorHandler(final Delegates.IFunc1<String, Iterable<ISymbol>> tokenizer,
                                           final Set<String> keywords, final boolean acceptTrailingDot
                                          ) {
        super(tokenizer);
        initialize(keywords, acceptTrailingDot);
    }

    private void initialize(final Set<String> keywords, final boolean acceptTrailingDot) {
        this.keywords = Sets.newHashSet(keywords);
        this.acceptTrailingDot = acceptTrailingDot;
    }

    @Override
    protected EnumSet<PartialParseResult> canAcceptChange(@Nonnull final Span target,
                                                          @Nonnull final TextChange normalizedChange
                                                         ) {
        if (getAcceptedCharacters() == AcceptedCharacters.Any) {
            return PartialParseResult.setOf(PartialParseResult.Rejected);
        }
        if (isAcceptableReplace(target, normalizedChange)) {
            return handleReplacement(target, normalizedChange);
        }
        final int changeRelativePosition = normalizedChange.getOldPosition() - target.getStart().getAbsoluteIndex();

        // Get the edit context
        Optional<Character> lastChar = Optional.empty();
        if (changeRelativePosition > 0 && target.getContent().length() > 0) {
            lastChar = Optional.of(target.getContent().charAt(changeRelativePosition - 1));
        }

        // Don't support 0->1 length edits
        if (!lastChar.isPresent()) {
            return PartialParseResult.setOf(PartialParseResult.Rejected);
        }

        // Only support insertions at the end of the span
        if (isAcceptableInsertion(target, normalizedChange)) {
            return handleInsertion(target, lastChar.get(), normalizedChange);
        }
        if (isAcceptableDeletion(target, normalizedChange)) {
            return handleDeletion(target, lastChar.get(), normalizedChange);
        }
        return PartialParseResult.setOf(PartialParseResult.Rejected);
    }

    private static boolean isAcceptableReplace(final Span target, final TextChange change) {
        return isEndReplace(target, change) || (change.isReplace() && remainingIsWhitespace(target, change));
    }

    private static boolean isAcceptableDeletion(final Span target, final TextChange change) {
        return isEndDeletion(target, change) || (change.isDelete() && remainingIsWhitespace(target, change));
    }

    private static boolean isAcceptableInsertion(final Span target, final TextChange change) {
        return isEndInsertion(target, change) || (change.isInsert() && remainingIsWhitespace(target, change));
    }

    private static boolean remainingIsWhitespace(final Span target, final TextChange change) {
        int offset = (change.getOldPosition() - target.getStart().getAbsoluteIndex()) + change.getOldLength();
        return ParserHelpers.isNullOrWhitespace(target.getContent().substring(offset));
    }

    private EnumSet<PartialParseResult> handleReplacement(final Span target, final TextChange change) {
        final String oldText = getOldText(target, change);

        EnumSet<PartialParseResult> result = EnumSet.of(PartialParseResult.Rejected);
        if (endsWithDot(oldText) && endsWithDot(change.getNewText())) {
            result = EnumSet.of(PartialParseResult.Accepted);
            if (!acceptTrailingDot) {
                result.add(PartialParseResult.Provisional);
            }
        }

        return result;
    }

    private EnumSet<PartialParseResult> handleDeletion(final Span target, final char previousChar,
                                                       final TextChange change
                                                      ) {
        // What's left after deleting
        if (previousChar == '.') {
            return tryAcceptChange(
                                      target, change,
                                      EnumSet.of(PartialParseResult.Accepted, PartialParseResult.Provisional)
                                  );
        }
        else if (ParserHelpers.isIdentifierPart(previousChar)) {
            return tryAcceptChange(target, change);
        }
        else {
            return EnumSet.of(PartialParseResult.Rejected);
        }
    }

    private EnumSet<PartialParseResult> handleInsertion(final Span target, final char previousChar,
                                                        final TextChange change
                                                       ) {
        // What are we inserting after
        if (previousChar == '.') {
            return handleInsertionAfterDot(target, change);
        }
        else if (ParserHelpers.isIdentifierPart(previousChar) || previousChar == ')' || previousChar == ']') {
            return handleInsertionAfterIdPart(target, change);
        }
        else {
            return EnumSet.of(PartialParseResult.Rejected);
        }
    }

    private EnumSet<PartialParseResult> handleInsertionAfterIdPart(final Span target, final TextChange change) {
        // If the insertion is full identifier part, accept it
        if (ParserHelpers.isIdentifier(change.getNewText(), false)) {
            return tryAcceptChange(target, change);
        }
        else if (endsWithDot(change.getNewText())) {
            // Accept it, possibly provisional
            EnumSet<PartialParseResult> result = EnumSet.of(PartialParseResult.Accepted);
            if (!acceptTrailingDot) {
                result.add(PartialParseResult.Provisional);
            }
            return tryAcceptChange(target, change, result);
        }
        else {
            return EnumSet.of(PartialParseResult.Rejected);
        }
    }

    private EnumSet<PartialParseResult> handleInsertionAfterDot(final Span target, final TextChange change) {
        // If the insertion is a full identifier, accept it
        if (ParserHelpers.isIdentifier(change.getNewText())) {
            return tryAcceptChange(target, change);
        }
        return EnumSet.of(PartialParseResult.Rejected);
    }

    private static boolean endsWithDot(final String content) {
        return (content.length() == 1 && content.charAt(0) == '.')
               || (content.charAt(content.length() - 1) == '.' && isAllIdentifierPart(content));
    }

    private static boolean isAllIdentifierPart(final String content) {
        return Strings.toCharStream(content).limit(content.length() - 1).allMatch(ParserHelpers::isIdentifierPart);
    }

    private EnumSet<PartialParseResult> tryAcceptChange(final Span target, final TextChange change) {
        return tryAcceptChange(target, change, null);
    }

    private EnumSet<PartialParseResult> tryAcceptChange(final Span target, final TextChange change,
                                                        EnumSet<PartialParseResult> acceptResult
                                                       ) {
        if (acceptResult == null) {
            acceptResult = EnumSet.of(PartialParseResult.Accepted);
        }
        final String content = change.applyChange(target);
        if (startsWithKeyword(content)) {
            return EnumSet.of(PartialParseResult.Rejected, PartialParseResult.SpanContextChanged);
        }
        return acceptResult;
    }

    private boolean startsWithKeyword(final String newContent) {
        try (final StringReaderDelegate reader = new StringReaderDelegate(newContent)) {
            return keywords.contains(TextExtensions.readWhile(reader, ParserHelpers::isIdentifierPart));
        }
    }

    @SuppressWarnings("UnusedDeclaration")
    public boolean isAcceptTrailingDot() {
        return acceptTrailingDot;
    }

    @SuppressWarnings("UnusedDeclaration")
    public Set<String> getKeywords() {
        return keywords;
    }

    @Override
    public String toString() {
        return String.format(
                                "%s;ImplicitExpression[%s];K%d",
                                super.toString(),
                                acceptTrailingDot
                                ? "ATD"
                                : "RTD",
                                keywords.size()
                            );
    }

    @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
    @Override
    public boolean equals(final Object o) {
        final ImplicitExpressionEditorHandler other = typeAs(o, ImplicitExpressionEditorHandler.class);
        return other != null
               && super.equals(other)
               && keywords.equals(other.keywords)
               && acceptTrailingDot == other.acceptTrailingDot;
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                               super.hashCode(),
                               acceptTrailingDot,
                               keywords
                           );
    }
}


text:
require 'spec_helper'

describe "task 1:" do
  it 'list all system facts (2 methods)' do
    file('/root/.bash_history').content.should match /puppet\s+facts/
    file('/root/.bash_history').content.should match /facter/
  end
end

describe "task 2:" do
  it 'list just "ipaddress" fact' do
    file('/root/.bash_history').content.should match /facter.+ipaddress/
  end
end

describe "task 3:" do
  it 'debug getting facts' do
    file('/root/.bash_history').content.should match /puppet\s+facts\s+--debug/
  end
end

describe "task 4:" do
  it 'list hiera "puppet_enterprise::profile::puppetdb::listen_address" key (2 methods)' do
    file('/root/.bash_history').content.should match /puppet\s+lookup\s+puppet_enterprise::profile::puppetdb::listen_address/
    file('/root/.bash_history').content.should match /hiera\s+puppet_enterprise::profile::puppetdb::listen_address/
  end
end

describe "task 5:" do
  it 'debug hiera "puppet_enterprise::profile::puppetdb::listen_address" lookup' do
    file('/root/.bash_history').content.should match /puppet\s+lookup\s+--debug/
  end
end

describe "task 6:" do
  it 'inline edit root user and change his GECOS field' do
    file('/root/.bash_history').content.should match /puppet\s+resource\s+user\s+root\s+(-e|--edit)/
    file('/etc/passwd').content.should_not match /^root:x:0:0:root:/
  end
end

describe "task 7:" do
  it 'list all /etc/hosts entries as puppet resources' do
    file('/root/.bash_history').content.should match /puppet\s+resource\s+host/
  end
end

describe "task 8:" do
  it 'generate certificate for "foo.acme.com"' do
    file('/root/.bash_history').content.should match /puppet\s+cert\s+generate/
    file('/etc/puppetlabs/puppet/ssl/certs/foo.acme.com.pem').should be_file
  end
end

describe "task 9:" do
  it 'list all certificates known to your CA' do
    file('/root/.bash_history').content.should match /puppet\s+cert\s+list\s+--all/
  end
end

describe "task 10:" do
  it 'try to find easter egg in "puppet help" ;)' do
    file('/root/.bash_history').content.should match /puppet\s+(\150\145\154\160\s*){5}/
  end
end


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

        <title>CruiseControl.NET : Alienbrain Source Control Block</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">

                            CruiseControl.NET : Alienbrain Source Control Block

					    This page last changed on Jan 07, 2010 by csut017.

Alienbrain Source Control Block

Source control integration for the Alienbrain source control product.

Version

Available from version 1.0

Examples

Minimalist example

<sourcecontrol type="alienbrain">
  <server>MyServer</server>
  <database>MyDatabase</database>
  <username>Username</username>
  <password>Password</password>
  <project>ab://myprojectpath</project>
</sourcecontrol>

Full example

<sourcecontrol type="alienbrain">
  <server>MyServer</server>
  <database>MyDatabase</database>
  <username>Username</username>
  <password>Password</password>
  <project>ab://myprojectpath</project>
  <executable>c:\alienbrain\ab.exe</executable>
  <workingDirectory>d:\code</workingDirectory>
  <branch>Root Branch/Branch1</branch>
  <autoGetSource>true</autoGetSource>
  <labelOnSuccess>true</labelOnSuccess>
  <timeout units="minutes">10</timeout>
</sourcecontrol>

Configuration Elements

 Element
 Description
 Type
 Required
 Default
 Version

 type
 The type of source control block.
 String - must be alienbrain
 Yes
 n/a
 1.0

 autoGetSource
 Specifies whether the current version of the source should be retrieved from Alienbrain.
 Boolean
 No
 true
 1.0

 branch
 The path of the branch specification. to enumarate the name of the branches, use the ab enumbranch command line.
If this is not set, then the root branch will be used.
 String
 No
 None
 1.0

 database
 Alienbrain project database name. The list of valid project databases are listed in the File, Connect to project database, Step 2, list box.
 String
 Yes
 n/a
 1.0

 dynamicValues
 The dynamic values to use for the source control block.
 Dynamic Values array
 No
 None
 1.5

 executable
 The executable to use.
If not set, then the executable location will come from the registry.
 String
 No
 None
 1.0

 issueUrlBuilder
 Converts the comment (or parts from it) into an url pointing to the issue for this build. See IssueUrlBuilder for more details.
 IssueUrlBuilder
 No
 None
 1.4

 labelOnSuccess
 Specifies whether or not the repository should be labelled after a successful build.
 Boolean
 No
 false
 1.0

 password
 The password of the user you want to use to connect to the server project database.
 PrivateString
 Yes
 n/a
 1.0

 project
 This is the path of to monitor the file changes. Use alienbrain://Code or ab://Code project path format.
 String
 Yes
 n/a
 1.0

 server
 Alienbrain server hostname or ip adress. The list of valid server name and ip adresses are listed in the File, Connect to project database, Step 1, list box.
 String
 Yes
 n/a
 1.0

 timeout
 Sets the timeout period for the source control operation. See Timeout Configuration for details.
 Timeout Configuration
 No
 10 minutes
 1.0

 username
 The name of the user you want to use to connect to the server project database.
 String
 Yes
 n/a
 1.0

 workingDirectory
 The path where the get latest will update the files.
 String
 No
 Project Working Directory
 1.0

Notes

Contributions

Alienbrain support added by Francis Tremblay.

<colgroup><col width='24'><col></colgroup>
	Automatically Generated

Documentation generated on Thursday, 7 Jan 2010 at 6:06:05 AM

			    Document generated by Confluence on Jan 30, 2010 19:06


text:
package com.iaguilarmartin.commandspicker.model;

import java.io.Serializable;
import java.util.ArrayList;

public class Ticket implements Serializable {
    private int mTableNumber;
    private ArrayList<TicketRow> mRows;
    private double mTotal;

    public Ticket(int tableNumber) {
        mTableNumber = tableNumber;
        mRows = new ArrayList<>();
        mTotal = 0;
    }

    public void addCourse(Course course) {
        int index = -1;

        for (int i = 0; i < mRows.size(); i++) {
            if (mRows.get(i).getCourseId().equalsIgnoreCase(course.getId())) {
                index = i;
                break;
            }
        }

        if (index == -1) {
            TicketRow ticketRow = new TicketRow(1, course.getId(), course.getName(), course.getPrice());
            mRows.add(ticketRow);
        } else {
            TicketRow ticketRow = mRows.get(index);
            int quantity = ticketRow.getQuantity();
            quantity++;

            ticketRow.setQuantity(quantity);
            ticketRow.setTotal(quantity * course.getPrice());
        }
    }

    public int getTableNumber() {
        return mTableNumber;
    }

    public void setTableNumber(int tableNumber) {
        mTableNumber = tableNumber;
    }

    public ArrayList<TicketRow> getRows() {
        return mRows;
    }

    public double getTotal() {
        return mTotal;
    }

    public void setTotal(double total) {
        mTotal = total;
    }

    public class TicketRow implements Serializable {
        private int mQuantity;
        private String mCourseId;
        private String mCourseName;
        private double mTotal;

        public TicketRow(int quantity, String courseId, String courseName, double total) {
            mQuantity = quantity;
            mCourseId = courseId;
            mCourseName = courseName;
            mTotal = total;
        }

        public int getQuantity() {
            return mQuantity;
        }

        public void setQuantity(int quantity) {
            mQuantity = quantity;
        }

        public String getCourseName() {
            return mCourseName;
        }

        public void setCourseName(String courseName) {
            mCourseName = courseName;
        }

        public double getTotal() {
            return mTotal;
        }

        public void setTotal(double total) {
            mTotal = total;
        }

        public String getCourseId() {
            return mCourseId;
        }

        public void setCourseId(String courseId) {
            mCourseId = courseId;
        }

        @Override
        public String toString() {
            return String.format("%d x %s", mQuantity, mCourseName);
        }
    }
}


text:
// Xively Node-RED node file

module.exports = function(RED) {
    "use strict";

    var when = require("when");

    var nodeUtil = require("../../xively/habanero/nodeUtil");
    var getJwt = require("../../xively/habanero/auth").getJwtForCredentialsId;

    var timeseries = require("../../xively/services/timeseries");

    var operators = {
        'eq': function(a, b) { return a == b; },
        'neq': function(a, b) { return a != b; },
        'lt': function(a, b) { return a < b; },
        'lte': function(a, b) { return a <= b; },
        'gt': function(a, b) { return a > b; },
        'gte': function(a, b) { return a >= b; },
        'btwn': function(a, b, c) { return a >= b && a <= c; },
        'cont': function(a, b) { return (a + "").indexOf(b) != -1; },
        'regex': function(a, b, c, d) { return (a + "").match(new RegExp(b,d?'i':'')); },
        'true': function(a) { return a === true; },
        'false': function(a) { return a === false; },
        'null': function(a) { return (typeof a == "undefined" || a === null); },
        'nnull': function(a) { return (typeof a != "undefined" && a !== null); },
        'else': function(a) { return a === true; }
    };

    function XivelyDeviceRuleNode (config) {
        RED.nodes.createNode(this,config);

        this.xively_creds = config.xively_creds;
        this.rules = config.rules || [];
        this.device_template = config.device_template;
        this.repeat_count = config.repeat_count;
        this.repeat_units = config.repeat_units;
        this.matchall = config.matchall || true;
        this.matchall = (this.matchall === "false") ? false : true;

        var credentials = RED.nodes.getCredentials(this.xively_creds);

        var node = this;
        var context = node.context();
        node.previousValues = new Array(node.rules.length);

        // define node scoped functions

        function onMqttMessage(msg){
            if(!isWithinRepeatCycle(msg)){
                evaluateRules(msg);
            }
        }

        function onMqttConnect(){
            try{
                // go get devices and subscribe
                nodeUtil.getDevicesForTemplateId(
                    node.xively_creds,
                    node.device_template,
                    deviceSubscribe
                );
            }catch(err){
                RED.log.error("Error setting up XivelyDeviceRuleNode: " + err);
            };
        }

        function onEvaluationSuccess(msg){
            node.send(msg);
            var contextKey = 'last_sent_at_'+msg.device.id;
            var now = new Date();
            context.set(contextKey, now);
        }

        function isWithinRepeatCycle(msg){
            var now = new Date();
            var contextKey = 'last_sent_at_'+msg.device.id;
            var last_sent_at = context.get(contextKey);
            if(typeof last_sent_at != "undefined"){
                last_sent_at = new Date(last_sent_at);
            }

            if(last_sent_at instanceof Date){
                var nextCyleBegins = new Date(last_sent_at.getTime() + node.repeatCycleMillis);
                if(now < nextCyleBegins){
                    return true;
                }
            }
            return false;
        }

        function deviceSubscribe(device){
            device.channels.forEach(function(channelType){
                if(channelType.channelTemplateId == node.device_channel){
                    node.mqttClient.subscribe(channelType.channel, function(err, granted){
                        if(!err){
                            RED.log.debug("subscribed to: "+channelType.channel);
                        }else{
                            RED.log.error("error subscribing: "+err);
                        }
                    });
                }
            });
        }

        function findValueInTsData(tsData, category, categoryType, resolve, reject){
            for (var i=0; i<tsData.length; i+=1) {
                var dotIndex = category.indexOf('.');
                var grabFirst = false;
                if(dotIndex === -1){
                    if(category === "value"){
                        grabFirst = true;
                    }
                }else{
                    // assume category like 'temp.value';
                    category = category.substring(0, dotIndex);
                }

                if(grabFirst || tsData[i].category == category){
                    if(categoryType == "num"){
                        return resolve(tsData[i].numericValue);
                    }else{
                        return resolve(tsData[i].stringValue);
                    }
                }
            }
            return reject("Unable to find channel '"+rule.iv+"' value in ts data");
        }

        function getRuleInputValue(node, rule, iter, msg, tsCache){
            var prop;
            return when.promise(function(resolve, reject) {
                if(rule.it == 'channel'){
                    if(iter==0 || node.rules[0].iv === rule.iv){
                        if(rule.sv == "value"){
                            var cKeys = Object.keys(msg.payload);
                            if(cKeys.length > 1){
                                RED.log.warn("Input set to value, but channel has multiple values.");
                            }
                            // grab first value
                            prop = msg.payload[cKeys[0]].value;
                            return resolve(prop);
                        }else{
                            try{
                                prop = RED.util.evaluateNodeProperty('payload.'+rule.sv,'msg',node,msg);
                                return resolve(prop);
                            }catch(err){
                                return reject("Unable to evaluate input value for rule: "+err);
                            }
                        }
                    }else{
                        var otherTopic = 'xi/blue/v1/'+msg.account.id+'/d/'+msg.device.id+'/'+rule.ivn;
                        if(!tsCache.hasOwnProperty(otherTopic)){
                            getJwt(node.xively_creds).then(function(jwtConfig){
                                timeseries.getLatestActivity(jwtConfig.jwt, otherTopic)
                                .then(function(tsResults){
                                    if(!tsResults.hasOwnProperty('result')){
                                        return reject("Timeseries request failure: "+JSON.stringify(tsResults));
                                    }
                                    // cache results
                                    tsCache[otherTopic] = tsResults.result;
                                    findValueInTsData(tsCache[otherTopic], rule.sv, rule.vt, resolve, reject);
                                });
                            });
                        }else{
                            findValueInTsData(tsCache[otherTopic], rule.sv, rule.vt, resolve, reject);
                        }
                    }
                }else{
                    prop = RED.util.evaluateNodeProperty(node.property,node.propertyType,node,msg);
                    return resolve(prop);
                }
            });
        }

        function evaluateRules(msg){
            var tsCache = {};
            var i = 0;
            var loopRules = function(){
                var rule = node.rules[i];
                getRuleInputValue(node, rule, i, msg, tsCache).then(function(prop){
                    var v1,v2;
                    if (rule.vt === 'prev') {
                        v1 = node.previousValues[i];
                    } else {
                        v1 = RED.util.evaluateNodeProperty(rule.v,rule.vt,node,msg);
                    }
                    v2 = rule.v2;
                    if (rule.v2t === 'prev') {
                        v2 = node.previousValues[i];
                    } else if (typeof v2 !== 'undefined') {
                        v2 = RED.util.evaluateNodeProperty(rule.v2,rule.v2t,node,msg);
                    }
                    node.previousValues[i] = prop;
                    if (rule.t == "else") { prop = elseflag; elseflag = true; }
                    if (operators[rule.t](prop,v1,v2,rule.case)) {
                        // Rule passed
                        i++;
                        if(node.matchall == true && i<node.rules.length){
                            // `ALL` query with additional rules, continue iteration
                            loopRules();
                        }else{
                            // passed rule(s) / we are complete
                            onEvaluationSuccess(msg);
                        }
                    } else {
                        // rule failed
                        if(!node.matchall){
                            // `OR` query, continue interation
                            i++;
                            if(i < node.rules.length) {
                                loopRules();
                            }
                        }else{
                            // `ALL` query, stop iteration
                        }
                    }
                }).catch(function(err){
                    node.warn(err);
                });
            }
            loopRules();
        }

        //calculate repeat cycle
        switch(this.repeat_units){
            case "s":
                node.repeatCycleMillis = node.repeat_count*1000;
                break;
            case "m":
                node.repeatCycleMillis = node.repeat_count*60*1000;
                break;
            case "h":
                node.repeatCycleMillis = node.repeat_count*60*60*1000;
                break;
            case "d":
                node.repeatCycleMillis = node.repeat_count*24*60*60*1000;
                break;
        }

        // parse proper types from rules
        for (var i=0; i<this.rules.length; i+=1) {
            var rule = this.rules[i];

            if(i==0){
                if(rule.it !== 'channel'){
                    // without this we are not listening to anything
                    throw "First rule must have a channel input";
                }
                node.device_channel = rule.iv;
            }

            if (!rule.vt) {
                rule.vt = 'str';
            }
            if (rule.vt === 'str' || rule.vt === 'num') {
                if (!isNaN(Number(rule.v))) {
                    rule.v = Number(rule.v);
                }
            }

            if (typeof rule.v2 !== 'undefined') {
                if (!rule.v2t) {
                    rule.v2t = 'str';
                }
                if (rule.v2t === 'str' || rule.v2t === 'num') {
                    if (!isNaN(Number(rule.v2))) {
                        rule.v2 = Number(rule.v2);
                    }
                }
            }
        }

        //setup mqttClient
        node.mqttClient = nodeUtil.setupMqttClient(credentials,{
            onMessage: onMqttMessage,
            onConnect: onMqttConnect
        });

        node.on("close", function() {
            // Called when the node is shutdown
            if(node.mqttClient){
                node.mqttClient.end(true);
            }
        });
    }

    RED.nodes.registerType("xively-device-rule", XivelyDeviceRuleNode);

}


text:
/*!
 * Peyman Salehi <slh.peyman@gmail.com>
 * GitHub & Twitter : @peymanslh
 */
/* normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
/* Document
   ========================================================================== */
/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in
 *    IE on Windows Phone and in iOS.
 */
html {
  line-height: 1.15;
  /* 1 */
  -ms-text-size-adjust: 100%;
  /* 2 */
  -webkit-text-size-adjust: 100%;
  /* 2 */ }

/* Sections
   ========================================================================== */
/**
 * Remove the margin in all browsers (opinionated).
 */
body {
  margin: 0; }

/**
 * Add the correct display in IE 9-.
 */
article,
aside,
footer,
header,
nav,
section {
  display: block; }

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */
h1 {
  font-size: 2em;
  margin: 0.67em 0; }

/* Grouping content
   ========================================================================== */
/**
 * Add the correct display in IE 9-.
 * 1. Add the correct display in IE.
 */
figcaption,
figure,
main {
  /* 1 */
  display: block; }

/**
 * Add the correct margin in IE 8.
 */
figure {
  margin: 1em 40px; }

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */
hr {
  box-sizing: content-box;
  /* 1 */
  height: 0;
  /* 1 */
  overflow: visible;
  /* 2 */ }

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */
pre {
  font-family: monospace, monospace;
  /* 1 */
  font-size: 1em;
  /* 2 */ }

/* Text-level semantics
   ========================================================================== */
/**
 * 1. Remove the gray background on active links in IE 10.
 * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
 */
a {
  background-color: transparent;
  /* 1 */
  -webkit-text-decoration-skip: objects;
  /* 2 */ }

/**
 * 1. Remove the bottom border in Chrome 57- and Firefox 39-.
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */
abbr[title] {
  border-bottom: none;
  /* 1 */
  text-decoration: underline;
  /* 2 */
  text-decoration: underline dotted;
  /* 2 */ }

/**
 * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
 */
b,
strong {
  font-weight: inherit; }

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */
b,
strong {
  font-weight: bolder; }

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */
code,
kbd,
samp {
  font-family: monospace, monospace;
  /* 1 */
  font-size: 1em;
  /* 2 */ }

/**
 * Add the correct font style in Android 4.3-.
 */
dfn {
  font-style: italic; }

/**
 * Add the correct background and color in IE 9-.
 */
mark {
  background-color: #ff0;
  color: #000; }

/**
 * Add the correct font size in all browsers.
 */
small {
  font-size: 80%; }

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline; }

sub {
  bottom: -0.25em; }

sup {
  top: -0.5em; }

/* Embedded content
   ========================================================================== */
/**
 * Add the correct display in IE 9-.
 */
audio,
video {
  display: inline-block; }

/**
 * Add the correct display in iOS 4-7.
 */
audio:not([controls]) {
  display: none;
  height: 0; }

/**
 * Remove the border on images inside links in IE 10-.
 */
img {
  border-style: none; }

/**
 * Hide the overflow in IE.
 */
svg:not(:root) {
  overflow: hidden; }

/* Forms
   ========================================================================== */
/**
 * 1. Change the font styles in all browsers (opinionated).
 * 2. Remove the margin in Firefox and Safari.
 */
button,
input,
optgroup,
select,
textarea {
  font-family: sans-serif;
  /* 1 */
  font-size: 100%;
  /* 1 */
  line-height: 1.15;
  /* 1 */
  margin: 0;
  /* 2 */ }

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */
button,
input {
  /* 1 */
  overflow: visible; }

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */
button,
select {
  /* 1 */
  text-transform: none; }

/**
 * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
 *    controls in Android 4.
 * 2. Correct the inability to style clickable types in iOS and Safari.
 */
button,
html [type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  /* 2 */ }

/**
 * Remove the inner border and padding in Firefox.
 */
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0; }

/**
 * Restore the focus styles unset by the previous rule.
 */
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText; }

/**
 * Correct the padding in Firefox.
 */
fieldset {
  padding: 0.35em 0.75em 0.625em; }

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */
legend {
  box-sizing: border-box;
  /* 1 */
  color: inherit;
  /* 2 */
  display: table;
  /* 1 */
  max-width: 100%;
  /* 1 */
  padding: 0;
  /* 3 */
  white-space: normal;
  /* 1 */ }

/**
 * 1. Add the correct display in IE 9-.
 * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */
progress {
  display: inline-block;
  /* 1 */
  vertical-align: baseline;
  /* 2 */ }

/**
 * Remove the default vertical scrollbar in IE.
 */
textarea {
  overflow: auto; }

/**
 * 1. Add the correct box sizing in IE 10-.
 * 2. Remove the padding in IE 10-.
 */
[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  /* 1 */
  padding: 0;
  /* 2 */ }

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto; }

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */
[type="search"] {
  -webkit-appearance: textfield;
  /* 1 */
  outline-offset: -2px;
  /* 2 */ }

/**
 * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
 */
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none; }

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */
::-webkit-file-upload-button {
  -webkit-appearance: button;
  /* 1 */
  font: inherit;
  /* 2 */ }

/* Interactive
   ========================================================================== */
/*
 * Add the correct display in IE 9-.
 * 1. Add the correct display in Edge, IE, and Firefox.
 */
details,
menu {
  display: block; }

/*
 * Add the correct display in all browsers.
 */
summary {
  display: list-item; }

/* Scripting
   ========================================================================== */
/**
 * Add the correct display in IE 9-.
 */
canvas {
  display: inline-block; }

/**
 * Add the correct display in IE.
 */
template {
  display: none; }

/* Hidden
   ========================================================================== */
/**
 * Add the correct display in IE 10-.
 */
[hidden] {
  display: none; }

@font-face {
  font-family: Vazir;
  src: url("fonts/Vazir.woff") format("woff");
  font-weight: normal; }
@font-face {
  font-family: Vazir;
  src: url("fonts/Vazir-Bold.woff") format("woff");
  font-weight: bold; }
@font-face {
  font-family: Vazir;
  src: url("fonts/Vazir-Thin.woff") format("woff");
  font-weight: 200; }
@font-face {
  font-family: 'SpaceMono';
  src: url("fonts/space-mono-regular.woff2") format("woff");
  font-weight: 400; }
* {
  box-sizing: border-box; }

::selection {
  background-color: #3B495A;
  color: #FBFBFC; }

::-moz-selection {
  background-color: #3B495A;
  color: #FBFBFC; }

body {
  font-family: Vazir, Tahoma, Arial;
  background-color: #FBFBFC;
  direction: rtl; }

a {
  text-decoration: none; }
  a:hover {
    text-decoration: underline; }

/* Blog responsive Container */
.container {
  display: block;
  width: 45rem;
  margin: 0 auto;
  max-width: 100%; }

@media (max-width: 47rem) {
  .container {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px; } }
/* Blog header */
.main-header {
  margin-top: 30px;
  margin-bottom: 50px; }
  .main-header .logo {
    margin-top: 0;
    font-size: 1.3rem;
    display: inline-block;
    background-color: #3B495A;
    color: #FBFBFC;
    padding: 0.4rem 0.9rem; }
  .main-header nav ul {
    list-style: none;
    padding-right: 0;
    margin: 0 auto; }
    .main-header nav ul li {
      display: inline-block; }
      .main-header nav ul li a {
        display: block;
        padding: 3px 10px;
        color: #3B495A;
        text-decoration: none;
        font-size: 0.9rem; }
        .main-header nav ul li a:hover {
          text-decoration: underline; }
  .main-header nav ul li:first-child a {
    padding-right: 0; }

/* Blog footer */
.main-footer {
  font-size: 0.75rem;
  color: #889CB6;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 20px 10px;
  margin: 40px auto 10px auto; }
  .main-footer a {
    color: #889CB6; }

/* Blog Dark border */
.borders div {
  position: fixed;
  background-color: #3B495A; }

@media (max-width: 47rem) {
  .borders div {
    display: none; } }
.borders .top {
  top: 0;
  right: 0;
  left: 0;
  bottom: auto;
  height: 10px; }

.borders .right {
  top: 0;
  right: 0;
  left: auto;
  bottom: 0;
  width: 10px; }

.borders .bottom {
  top: auto;
  right: 0;
  left: 0;
  bottom: 0;
  height: 10px; }

.borders .left {
  top: 0;
  right: auto;
  left: 0;
  bottom: 0;
  width: 10px; }

/* Blog Home page posts list */
.posts h3 {
  margin-bottom: 0; }
.posts ul {
  padding-right: 0;
  list-style: none; }
  .posts ul li {
    display: block;
    margin: 10px auto;
    font-size: 1rem; }
    .posts ul li span {
      color: #889CB6;
      width: 6rem;
      display: inline-block; }
    .posts ul li a {
      display: inline-block;
      color: #3B495A; }

/* Blog 404 page */
.page404 {
  text-align: center;
  color: #3B495A; }

/* Tags page */
.tag-cloud a {
  color: #889CB6;
  text-decoration: none; }
  .tag-cloud a:hover {
    text-decoration: underline; }

/* Blog post and page detail */
.page-detail .page-title {
  font-size: 1.8rem; }
.page-detail .page-info {
  color: #889CB6;
  font-size: 0.85rem; }
.page-detail .page-content {
  font-size: 1rem;
  font-weight: 200;
  line-height: 1.8;
  color: #3B495A; }
  .page-detail .page-content a {
    color: #3B495A;
    text-decoration: underline; }
  .page-detail .page-content img {
    display: block;
    margin: 5px auto;
    height: auto;
    max-width: 100%; }
  .page-detail .page-content blockquote {
    color: #8195ad; }
  .page-detail .page-content hr {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    width: 200px;
    display: block;
    color: #889CB6;
    font-size: 1.7rem;
    border: none;
    box-sizing: border-box;
    position: relative;
    margin: 20px auto; }
    .page-detail .page-content hr:before {
      position: absolute;
      top: -24px;
      right: 86px;
      content: '\2e2d';
      background-color: #FBFBFC;
      padding: 0 3px; }

.page-tags {
  margin-top: 40px;
  display: block; }
  .page-tags span {
    color: #3B495A;
    margin-left: 5px; }
  .page-tags a {
    color: #889CB6;
    vertical-align: middle; }

.next-prev-post {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  margin: 50px auto 100px auto; }
  .next-prev-post a {
    color: #889CB6;
    font-size: 0.85rem; }
    .next-prev-post a span {
      font-size: 1.3rem; }

.highlight {
  margin: 10px auto;
  padding: 2px 14px; }

code, pre {
  font-family: 'SpaceMono', Tahoma, Arial;
  font-size: 0.85rem;
  direction: ltr;
  text-align: left;
  line-height: 1.3; }

/**
 * Syntax highlighting styles
 */
.highlight {
  background: #f6f8fa; }

.highlighter-rouge .highlight {
  background: #eef; }

.highlight .c {
  color: #998;
  font-style: italic; }

.highlight .err {
  color: #a61717;
  background-color: #e3d2d2; }

.highlight .k {
  font-weight: bold; }

.highlight .o {
  font-weight: bold; }

.highlight .cm {
  color: #998;
  font-style: italic; }

.highlight .cp {
  color: #999;
  font-weight: bold; }

.highlight .c1 {
  color: #998;
  font-style: italic; }

.highlight .cs {
  color: #999;
  font-weight: bold;
  font-style: italic; }

.highlight .gd {
  color: #000;
  background-color: #fdd; }

.highlight .gd .x {
  color: #000;
  background-color: #faa; }

.highlight .ge {
  font-style: italic; }

.highlight .gr {
  color: #a00; }

.highlight .gh {
  color: #999; }

.highlight .gi {
  color: #000;
  background-color: #dfd; }

.highlight .gi .x {
  color: #000;
  background-color: #afa; }

.highlight .go {
  color: #888; }

.highlight .gp {
  color: #555; }

.highlight .gs {
  font-weight: bold; }

.highlight .gu {
  color: #aaa; }

.highlight .gt {
  color: #a00; }

.highlight .kc {
  font-weight: bold; }

.highlight .kd {
  font-weight: bold; }

.highlight .kp {
  font-weight: bold; }

.highlight .kr {
  font-weight: bold; }

.highlight .kt {
  color: #458;
  font-weight: bold; }

.highlight .m {
  color: #099; }

.highlight .s {
  color: #d14; }

.highlight .na {
  color: #008080; }

.highlight .nb {
  color: #0086B3; }

.highlight .nc {
  color: #458;
  font-weight: bold; }

.highlight .no {
  color: #008080; }

.highlight .ni {
  color: #800080; }

.highlight .ne {
  color: #900;
  font-weight: bold; }

.highlight .nf {
  color: #900;
  font-weight: bold; }

.highlight .nn {
  color: #555; }

.highlight .nt {
  color: #000080; }

.highlight .nv {
  color: #008080; }

.highlight .ow {
  font-weight: bold; }

.highlight .w {
  color: #bbb; }

.highlight .mf {
  color: #099; }

.highlight .mh {
  color: #099; }

.highlight .mi {
  color: #099; }

.highlight .mo {
  color: #099; }

.highlight .sb {
  color: #d14; }

.highlight .sc {
  color: #d14; }

.highlight .sd {
  color: #d14; }

.highlight .s2 {
  color: #d14; }

.highlight .se {
  color: #d14; }

.highlight .sh {
  color: #d14; }

.highlight .si {
  color: #d14; }

.highlight .sx {
  color: #d14; }

.highlight .sr {
  color: #009926; }

.highlight .s1 {
  color: #d14; }

.highlight .ss {
  color: #990073; }

.highlight .bp {
  color: #999; }

.highlight .vc {
  color: #008080; }

.highlight .vg {
  color: #008080; }

.highlight .vi {
  color: #008080; }

.highlight .il {
  color: #099; }


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androiddeviceprovisioning.v1.model;

/**
 * Tracks the status of a long-running operation to asynchronously update a batch of reseller
 * metadata attached to devices. To learn more, read [Long‑running batch operations](/zero-
 * touch/guides/how-it-works#operations).
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Android Device Provisioning Partner API. For a
 * detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class DevicesLongRunningOperationMetadata extends com.google.api.client.json.GenericJson {

  /**
   * The number of metadata updates in the operation. This might be different from the number of
   * updates in the request if the API can't parse some of the updates.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer devicesCount;

  /**
   * The processing status of the operation.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String processingStatus;

  /**
   * The processing progress of the operation. Measured as a number from 0 to 100. A value of 10O
   * doesnt always mean the operation completed—check for the inclusion of a `done` field.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer progress;

  /**
   * The number of metadata updates in the operation. This might be different from the number of
   * updates in the request if the API can't parse some of the updates.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getDevicesCount() {
    return devicesCount;
  }

  /**
   * The number of metadata updates in the operation. This might be different from the number of
   * updates in the request if the API can't parse some of the updates.
   * @param devicesCount devicesCount or {@code null} for none
   */
  public DevicesLongRunningOperationMetadata setDevicesCount(java.lang.Integer devicesCount) {
    this.devicesCount = devicesCount;
    return this;
  }

  /**
   * The processing status of the operation.
   * @return value or {@code null} for none
   */
  public java.lang.String getProcessingStatus() {
    return processingStatus;
  }

  /**
   * The processing status of the operation.
   * @param processingStatus processingStatus or {@code null} for none
   */
  public DevicesLongRunningOperationMetadata setProcessingStatus(java.lang.String processingStatus) {
    this.processingStatus = processingStatus;
    return this;
  }

  /**
   * The processing progress of the operation. Measured as a number from 0 to 100. A value of 10O
   * doesnt always mean the operation completed—check for the inclusion of a `done` field.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getProgress() {
    return progress;
  }

  /**
   * The processing progress of the operation. Measured as a number from 0 to 100. A value of 10O
   * doesnt always mean the operation completed—check for the inclusion of a `done` field.
   * @param progress progress or {@code null} for none
   */
  public DevicesLongRunningOperationMetadata setProgress(java.lang.Integer progress) {
    this.progress = progress;
    return this;
  }

  @Override
  public DevicesLongRunningOperationMetadata set(String fieldName, Object value) {
    return (DevicesLongRunningOperationMetadata) super.set(fieldName, value);
  }

  @Override
  public DevicesLongRunningOperationMetadata clone() {
    return (DevicesLongRunningOperationMetadata) super.clone();
  }

}