text:
// @flow
/* global SETTINGS */
import React from "react"
import sinon from "sinon"
import { mount } from "enzyme"
import { assert } from "chai"
import configureTestStore from "redux-asserts"
import { Provider } from "react-redux"

import * as api from "../lib/api"
import ErrorPage from "./ErrorPage"
import { actions } from "../actions"
import rootReducer from "../reducers"
import { makeCollection } from "../factories/collection"

describe("ErrorPage", () => {
  let sandbox, store, collections, listenForActions

  beforeEach(() => {
    sandbox = sinon.createSandbox()
    store = configureTestStore(rootReducer)
    listenForActions = store.createListenForActions()
    collections = [makeCollection(), makeCollection(), makeCollection()]

    sandbox
      .stub(api, "getCollections")
      .returns(Promise.resolve({ results: collections }))
  })

  afterEach(() => {
    sandbox.restore()
  })

  const renderPage = async (props = {}) => {
    let wrapper

    await listenForActions(
      [
        actions.collectionsList.get.requestType,
        actions.collectionsList.get.successType
      ],
      () => {
        wrapper = mount(
          <Provider store={store}>
            <ErrorPage {...props} />
          </Provider>
        )
      }
    )
    if (!wrapper) throw new Error("Never will happen, make flow happy")
    return wrapper
  }

  // eslint-disable-next-line no-unused-vars
  for (const [status, title, message] of [
    [
      403,
      "You do not have permission to view this video",
      "Please contact course faculty or staff and ask them to add you as a student or listener on stellar.mit.edu"
    ],
    [
      404,
      "Page not found",
      "This is a 404 error. This is not the page you were looking for. If you are looking for a video or collection, it is no longer available for viewing."
    ],
    [
      500,
      "Oops! Something went wrong...",
      "This is a 500 error. Something went wrong with the software." +
        " If this continues to happen please Contact Support."
    ]
  ]) {
    it(`renders an error for status=${status}`, async () => {
      SETTINGS.status_code = status
      const wrapper = await renderPage()
      assert.equal(
        wrapper
          .find(".error-page .title")
          .text()
          .trim(),
        title
      )
      assert.equal(
        wrapper
          .find(".error-page .message")
          .text()
          .trim(),
        message
      )
    })
  }
})

redpajama_set_name: RedPajamaGithub


text:
package s3

import (
	"github.com/aws/aws-sdk-go/private/waiter"
)

// WaitUntilBucketExists uses the Amazon S3 API operation
// HeadBucket to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// be returned.
func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error {
	waiterCfg := waiter.Config{
		Operation:   "HeadBucket",
		Delay:       5,
		MaxAttempts: 20,
		Acceptors: []waiter.WaitAcceptor{
			{
				State:    "success",
				Matcher:  "status",
				Argument: "",
				Expected: 200,
			},
			{
				State:    "success",
				Matcher:  "status",
				Argument: "",
				Expected: 301,
			},
			{
				State:    "success",
				Matcher:  "status",
				Argument: "",
				Expected: 403,
			},
			{
				State:    "retry",
				Matcher:  "status",
				Argument: "",
				Expected: 404,
			},
		},
	}

	w := waiter.Waiter{
		Client: c,
		Input:  input,
		Config: waiterCfg,
	}
	return w.Wait()
}

// WaitUntilBucketNotExists uses the Amazon S3 API operation
// HeadBucket to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// be returned.
func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error {
	waiterCfg := waiter.Config{
		Operation:   "HeadBucket",
		Delay:       5,
		MaxAttempts: 20,
		Acceptors: []waiter.WaitAcceptor{
			{
				State:    "success",
				Matcher:  "status",
				Argument: "",
				Expected: 404,
			},
		},
	}

	w := waiter.Waiter{
		Client: c,
		Input:  input,
		Config: waiterCfg,
	}
	return w.Wait()
}

// WaitUntilObjectExists uses the Amazon S3 API operation
// HeadObject to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// be returned.
func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error {
	waiterCfg := waiter.Config{
		Operation:   "HeadObject",
		Delay:       5,
		MaxAttempts: 20,
		Acceptors: []waiter.WaitAcceptor{
			{
				State:    "success",
				Matcher:  "status",
				Argument: "",
				Expected: 200,
			},
			{
				State:    "retry",
				Matcher:  "status",
				Argument: "",
				Expected: 404,
			},
		},
	}

	w := waiter.Waiter{
		Client: c,
		Input:  input,
		Config: waiterCfg,
	}
	return w.Wait()
}

// WaitUntilObjectNotExists uses the Amazon S3 API operation
// HeadObject to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// be returned.
func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error {
	waiterCfg := waiter.Config{
		Operation:   "HeadObject",
		Delay:       5,
		MaxAttempts: 20,
		Acceptors: []waiter.WaitAcceptor{
			{
				State:    "success",
				Matcher:  "status",
				Argument: "",
				Expected: 404,
			},
		},
	}

	w := waiter.Waiter{
		Client: c,
		Input:  input,
		Config: waiterCfg,
	}
	return w.Wait()
}


text:
class Mapper0: public Mapper
{
public:
    Mapper0(CartMemory mem) : Mapper(mem) { };
    uint8_t readPrg(uint16_t addr);
    uint8_t readChr(uint16_t addr);
    void writeChr(uint16_t addr, uint8_t value);
};

#endif


text:
package org.apache.jena.sdb.test.update;

import junit.framework.JUnit4TestAdapter;
import org.apache.jena.sdb.Store ;
import org.apache.jena.sdb.test.StoreCreator ;

public class TestStoreUpdatePgSQLHash extends TestStoreUpdateBase {

	public static junit.framework.Test suite() {
	    return new JUnit4TestAdapter(TestStoreUpdatePgSQLHash.class);
	}

	@Override
	Store getStore() {
		return StoreCreator.getHashPgSQL();
	}

}


text:
This project provides a Node.js package that makes it easy to manage Microsoft Azure Network Resources.
- **Node.js version: 4.x.x or higher**
- **API version: 2016-09-01**

## Features

- Manage virtual network
- Manage subnet
- Manage network security group
- Manage network security rule
- Manage load balancer
- Manage network interface
- Manage publicIPAddress
- Manage application gateway
- Manage connections
- Manage express route
- Manage local network gateway

## How to Install

```bash
npm install azure-arm-network
```

## How to use

### Authentication, client creation and listing vnets in a resource group as an example

 ```javascript
 var msRestAzure = require('ms-rest-azure');
 var NetworkManagementClient = require('azure-arm-network');

 // Interactive Login
 // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful,
 // the user will get a DeviceTokenCredentials object.
 msRestAzure.interactiveLogin(function(err, credentials) {
  var client = new NetworkManagementClient(credentials, 'your-subscription-id');
  client.virtualNetworks.list(resourceGroupName, function(err, result, request, response) {
    if (err) console.log(err);
    console.log(result);
  });
 });
 ```

 ## Related projects

- [Microsoft Azure SDK for Node.js - All-up](https://github.com/WindowsAzure/azure-sdk-for-node)


text:
<?php
defined('BASEPATH') OR exit('No se puede acceder al archivo directamente.');

class Compras_model extends CI_Model
{
	//status de la compra
	protected $compraCotizacion = 1;
	protected $compraCotizacionCerrada = 2;
	protected $compraCotizacionCancelada = 3;
	protected $compraOC = 4;
	protected $compraOCcancelada = 5;
	protected $compraFactura = 6;
	protected $compraFacturaCancelada = 7;

	//tipo kardex
	protected $kardexTipoEntrada = 1;
	protected $kardexTipoSalida = 2;

	//documento kardex
	protected $kardexDocumentoVenta = 1;
	protected $kardexDocumentoAjuste = 2;
	protected $kardexDocumentoCompra = 3;

	function __construct()
	{
		parent::__construct();
	}

	function actualizaPartidaCompra($partidaID,$campos)
	{
		$this->db->trans_begin();

			//actualizamos la partida de venta
			$this->db->where("partida_compra_id",$partidaID);
			$this->db->update("t_partida_compra",$campos);

			$this->db->select("
				partida_compra_id AS partidaID,
				SUM(partida_compra_precio * partida_compra_cantidad) AS compraSubtotal,
				SUM((partida_compra_precio * partida_compra_cantidad) * (partida_compra_iva /100)) AS iva,
				SUM( (partida_compra_precio  * partida_compra_cantidad)) AS importe
			");
			$this->db->where("partida_compra_id",$partidaID);
			$partida = $this->db->get("t_partida_compra");

		if ($this->db->trans_status() === FALSE) {

			$this->db->trans_rollback();

			return false;

		}else{

			$this->db->trans_commit();

			return $partida->row();

		}
	}

	function actualizarTotalesCompra($compraID)
	{
		$this->db->trans_begin();

			$this->db->select("
				SUM(partida_compra_precio * partida_compra_cantidad) AS compraSubtotal,
				SUM((partida_compra_precio * partida_compra_cantidad) * (partida_compra_iva /100)) AS compraIVA,
				SUM( (partida_compra_precio  * partida_compra_cantidad) * ((partida_compra_iva /100) +1)) AS compraTotal
			");
			$this->db->where("compra_id",$compraID);
			$query = $this->db->get("t_partida_compra");

			$totales = $query->row();

			$campos = array(
					"compra_subtotal"	=>	$totales->compraSubtotal,
					"compra_iva"			=>	$totales->compraIVA,
					"compra_total"		=>	$totales->compraTotal
				);
			$this->db->where("compra_id", $compraID);
			$this->db->update("t_compra",$campos);

		if ($this->db->trans_status() === FALSE) {

			$this->db->trans_rollback();

			return false;

		}else{

			$this->db->trans_commit();

			return $totales;

		}
	}

	function cambiaStatusCompra($compraID,$status,$usuarioID,$datosFactura)
	{
		$this->db->trans_begin();

			//si el status es generar la orden de compra, insertamos el registro de OC y actualizamos la compra con el oc_id
			if ($status == $this->compraOC) {

				$this->db->set("usuario_id",$usuarioID);
				$this->db->set("oc_fecha","NOW()",FALSE);
				$this->db->insert("t_oc");

				$ocID = $this->db->insert_id();

				$campos["oc_id"] = $ocID;
			//cuando se aplique la factura se ingresan los productos de la oc al inventario
			}elseif ($status == $this->compraFactura) {

				$campos["compra_factura"] = $datosFactura["factura"];
				$campos["compra_factura_fecha"] = $datosFactura["facturaFecha"];

				//realizamos la operacion en existencias
				$paramWhere = array("pcom.compra_id"	=>	$compraID);
				$this->db->select("pcom.partida_compra_cantidad partidaCantidad, com.almacen_id AS almacenID, pcom.producto_id AS productoID, ptip.producto_tipo_nombre AS productoTipo");
				$this->db->join("t_compra com","com.compra_id = pcom.compra_id");
				$this->db->join("t_producto prod","prod.producto_id = pcom.producto_id");
				$this->db->join("t_producto_tipo ptip","ptip.producto_tipo_id = prod.producto_tipo_id");
				$query = $this->db->get_where("t_partida_compra pcom",$paramWhere);

				//resultado
				$partidas = $query->result();

				//iteramos todas las partidas y realizamos el update a la existencia
				foreach ($partidas as $key => $partida) {

					//si el producto es un servicio, no se realiza el ajuste de inventario
					if ($partida->productoTipo == "PRODUCTO") {

						$this->db->query("UPDATE t_existencia SET existencia_cantidad = existencia_cantidad + $partida->partidaCantidad WHERE producto_id = $partida->productoID AND almacen_id = $partida->almacenID");

						//insertamos en kardex
						$this->almacen_model->insertaKardex($partida->productoID,$partida->almacenID,$usuarioID,$partida->partidaCantidad,$this->kardexTipoEntrada,$this->kardexDocumentoCompra,$compraID);

					}

				}

				//insertamos la cxp
				$camposCXP = array(
					"usuario_id"	=>	$usuarioID,
					"compra_id"		=>	$compraID,
					"cxp_subtotal"	=>	$datosFactura["subtotal"],
					"cxp_iva"		=>	$datosFactura["iva"],
					"cxp_total"		=>	$datosFactura["total"],
					"sucursal_id"	=>	$datosFactura["sucursal_id"]
				);
				$this->cobranza_model->insertaCXP($camposCXP);

			}elseif ($status == $this->compraFacturaCancelada) {

				//realizamos la operacion en existencias
				$paramWhere = array("pcom.compra_id"	=>	$compraID);
				$this->db->select("pcom.partida_compra_cantidad partidaCantidad, com.almacen_id AS almacenID, pcom.producto_id AS productoID, ptip.producto_tipo_nombre AS productoTipo");
				$this->db->join("t_compra com","com.compra_id = pcom.compra_id");
				$this->db->join("t_producto prod","prod.producto_id = pcom.producto_id");
				$this->db->join("t_producto_tipo ptip","ptip.producto_tipo_id = prod.producto_tipo_id");
				$query = $this->db->get_where("t_partida_compra pcom",$paramWhere);

				//resultado
				$partidas = $query->result();

				//iteramos todas las partidas y realizamos el update a la existencia
				foreach ($partidas as $key => $partida) {

					//si el producto es un servicio, no se realiza el ajuste de inventario
					if ($partida->productoTipo == "PRODUCTO") {

						$this->db->query("UPDATE t_existencia SET existencia_cantidad = existencia_cantidad - $partida->partidaCantidad WHERE producto_id = $partida->productoID AND almacen_id = $partida->almacenID");

						//insertamos en kardex
						$this->almacen_model->insertaKardex($partida->productoID,$partida->almacenID,$usuarioID,$partida->partidaCantidad,$this->kardexTipoSalida,$this->kardexDocumentoCompra,$compraID);

					}

				}

			}

			//actualizamos la compra
			$campos["compra_status_id"]	= $status;
			$this->db->where("compra_id",$compraID);
			$this->db->update("t_compra",$campos);

		if ($this->db->trans_status() === FALSE) {

			$this->db->trans_rollback();

			return false;

		}else{

			$this->db->trans_commit();

			return true;

		}
	}

	function eliminaPartida($partidaID)
	{
		$this->db->trans_begin();

			$this->db->where("partida_compra_id",$partidaID);
			$this->db->delete("t_partida_compra");

		if ($this->db->trans_status() === FALSE) {

			$this->db->trans_rollback();

			return false;

		}else{

			$this->db->trans_commit();

			return true;

		}
	}

	function getCompras()
	{
		$this->db->select("
			com.compra_id AS compraID,
			com.compra_fecha AS compraFecha,
			com.compra_pdf AS compraPDF,
			com.compra_xml AS compraXML,
			emp.empresa_nombre_comercial AS compraEmpresa,
			stcom.compra_status_nombre AS compraStatus,
			com.oc_id AS ocID,
			com.compra_factura AS compraFactura,
			com.compra_total AS compraTotal,
			prov.proveedor_razon AS proveedor,
			stcom.compra_status_color AS compraStatusColor,
			suc.sucursal_nombre AS compraSucursal
		");
		$this->db->join("t_sucursal suc","com.sucursal_id = suc.sucursal_id","left");
		$this->db->join("t_empresa emp","emp.empresa_id = suc.empresa_id","left");
		$this->db->join("t_proveedor prov","prov.proveedor_id = com.proveedor_id","left");
		$this->db->join("t_compra_status stcom","stcom.compra_status_id = com.compra_status_id");
		$compras = $this->db->get("t_compra com");

		if ($compras->num_rows() > 0) {

			return $compras->result();

		}else{

			return false;

		}
	}

	function getInfoCompra($compraID)
	{
		$this->db->select("
			emp.empresa_id AS empresaID,
			emp.empresa_razon AS empresa,
			emp.empresa_rfc AS empresaRFC,
			emp.empresa_direccion AS empresaDireccion,
			emp.empresa_num_externo AS empresaNumExt,
			emp.empresa_num_interno AS empresaNumInt,
			emp.empresa_colonia AS empresaColonia,
			emp.empresa_cp AS empresaCp,
			emp.empresa_ciudad AS empresaCiudad,
			emp.empresa_estado AS empresaEstado,
			pro.proveedor_razon AS proveedorRazon,
			com.compra_id AS compraID,
			emp.empresa_id AS empresaID,
			emp.empresa_razon AS compraEmpresa,
			pro.proveedor_razon AS proveedor,
			com.compra_fecha AS compraFecha,
			com.compra_subtotal AS compraSubtotal,
			com.compra_iva AS compraIVA,
			com.compra_total AS compraTotal,
			com.compra_factura AS compraFactura,
			com.compra_pdf AS compraPDF,
			com.compra_xml AS compraXML,
			DATE(com.compra_factura_fecha) AS compraFacturaFecha,
			us.usuario_user AS compraUsuario,
			stcom.compra_status_nombre AS compraStatusNombre,
			com.sucursal_id AS sucursalID,
			suc.sucursal_nombre AS sucursal,
			com.almacen_id AS almacenID,
			alm.almacen_nombre AS almacenNombre,
			com.oc_id AS ocID,
			usoc.usuario_user AS ocUsuario,
			oc.oc_fecha AS ocFecha,
			NOW() AS fechaActual,
			cxpst.cxp_status_nombre AS cxpStatusNombre
		");
		$this->db->join("t_sucursal suc", "suc.sucursal_id = com.sucursal_id","left");
		$this->db->join("t_empresa emp", "emp.empresa_id = suc.empresa_id","left");
		$this->db->join("t_almacen alm","alm.almacen_id = com.almacen_id","left");
		$this->db->join("t_proveedor pro", "pro.proveedor_id = com.proveedor_id","left");
		$this->db->join("t_usuario us","com.usuario_id = us.usuario_id");
		$this->db->join("t_compra_status stcom", "stcom.compra_status_id = com.compra_status_id");
		$this->db->join("t_oc oc","oc.oc_id = com.oc_id","left");
		$this->db->join("t_cxp cxp","cxp.compra_id = com.compra_id","left");
		$this->db->join("t_cxp_status cxpst","cxpst.cxp_status_id = cxp.cxp_status_id","left");
		$this->db->join("t_usuario usoc","usoc.usuario_id = oc.usuario_id","left");
		$paramWhere = array("com.compra_id" => $compraID);
		$compras = $this->db->get_where("t_compra com",$paramWhere);

		if ($compras->num_rows() > 0) {

			return $compras->row();

		}else{

			return false;

		}
	}

	function getPartidas($compraID)
	{
		//establecemos la condicion where
		$paramWhere = array("compra_id" => $compraID);
		//establecemos el select
		$this->db->select("
			pro.producto_codigob AS codigob,
			pcm.partida_compra_descripcion AS descripcion,
			pcm.partida_compra_cantidad AS cantidad,
			pcm.partida_compra_precio AS precio,
			pcm.partida_compra_id AS partidaID,
			( pcm.partida_compra_precio * pcm.partida_compra_cantidad ) AS importe,
			(pcm.partida_compra_cantidad * pcm.partida_compra_precio) * (pcm.partida_compra_iva / 100) AS iva,
			pcm.producto_id AS productoID
		");
		//realizamos los join necesarios
		$this->db->join("t_producto pro","pro.producto_id = pcm.producto_id");
		//realizamos el get
		$partidas = $this->db->get_where("t_partida_compra pcm",$paramWhere);

		if ($partidas->num_rows() > 0) {

			return $partidas->result();

		}else{

			return false;

		}
	}

	function insertaPartida($productoID,$compraID,$usuarioID)
	{
		// == traemos los datos del productos insertado == //
		$paramWhere = array("producto_id" => $productoID);
		$producto = $this->db->get_where("t_producto",$paramWhere);
		// =============================================== //
		if ($producto->num_rows() > 0) {

			$infoProducto = $producto->row();

			//iniciamos transaccion
			$this->db->trans_begin();

				$camposInsertar = array(
						"producto_id" 			=>	$productoID,
						"partida_compra_descripcion"	=>	$infoProducto->producto_descripcion,
						"partida_compra_precio"			=>	$infoProducto->producto_ppublico,
						"partida_compra_iva"			=>	$infoProducto->producto_iva,
						"usuario_id"			=>	$usuarioID,
						"compra_id"				=>	$compraID
					);
				$this->db->set("partida_compra_fecha","NOW()", FALSE);
				$this->db->insert("t_partida_compra",$camposInsertar);
				//tomamos el id de la partida insertada
				$partidaID = $this->db->insert_id();

				//traemos la informacion de la partida para mostrarla al usuario
				$paramWhere = array("pcm.partida_compra_id" => $partidaID);
				$this->db->select("
					pro.producto_codigob AS codigo,
					pcm.partida_compra_descripcion AS descripcion,
					pcm.partida_compra_id AS partidaID,
					pcm.partida_compra_cantidad AS cantidad,
					pcm.partida_compra_precio AS precio,
					(pcm.partida_compra_cantidad * pcm.partida_compra_precio) * (pcm.partida_compra_iva / 100) AS iva,
					(pcm.partida_compra_precio * pcm.partida_compra_cantidad) AS importe
				");
				$this->db->join("t_producto pro","pro.producto_id = pcm.producto_id");
				$partida_compra = $this->db->get_where("t_partida_compra pcm",$paramWhere);

			//si alguna consulta fallo, se realiza rollback y se retorna false
			if ($this->db->trans_status() === FALSE) {

				$this->db->trans_rollback();

				return false;

			}else{
			//terminamos la transaccion y realizamos los cambios en bd retornamos la informacion de la partida_compra insertada
				$this->db->trans_commit();

				return $partida_compra->row();

			}

		}else{

			return false;

		}
	}

	function nuevaCompra($usuarioID)
	{
		$this->db->set("usuario_id",$usuarioID);
		$this->db->set("compra_fecha","NOW()",FALSE);
		$this->db->insert("t_compra");

		$compraID = $this->db->insert_id();

		return $compraID;
	}

	function validarCotizacion($compraID)
	{
		$paramWhere = "compra_id = $compraID AND sucursal_id IS NOT NULL AND proveedor_id IS NOT NULL AND compra_total IS NOT NULL AND almacen_id IS NOT NULL";
		$validar = $this->db->get_where("t_compra",$paramWhere);

		if ($validar->num_rows() > 0) {

			return true;

		}else{

			return false;

		}
	}

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycopath. Mycol. appl. 34: 267 (1968)

#### Original name
Phaeoisariopsis inornata S.C. Jong & E.F. Morris

### Remarks
null


text:
from flask.ext.wtf import Form
from wtforms import TextAreaField
from wtforms.validators import DataRequired, Required
from wtformsparsleyjs import StringField

class AddSshKeyForm(Form):
    label = StringField('Label', validators=[DataRequired(), Required()])
    key = TextAreaField('Public Key', validators=[DataRequired()])
    notes = TextAreaField('Notes')


text:
using PdfSharp.Pdf.IO;

namespace PdfSharp.Pdf
{
    /// <summary>
    /// Represents a indirect reference that is not in the cross reference table.
    /// </summary>
    public sealed class PdfNull : PdfItem
    {
        // Reference: 3.2.8  Null Object / Page 63

        PdfNull()
        { }

        /// <summary>
        /// Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
        /// </returns>
        public override string ToString()
        {
            return "null";
        }

        internal override void WriteObject(PdfWriter writer)
        {
            // Implementet because it must be overridden.
            writer.WriteRaw(" null ");
        }

        /// <summary>
        /// The only instance of this class.
        /// </summary>
        public static readonly PdfNull Value = new PdfNull();
    }
}


text:
package org.yuanheng.cookcc.codegen.xml;

import java.io.PrintWriter;

import org.yuanheng.cookcc.doc.*;

/**
 * @author Heng Yuan
 * @version $Id$
 */
class XmlLexerOutput
{
	private void printShortcut (ShortcutDoc shortcut, PrintWriter p)
	{
		p.println ("\t\t<shortcut name=\"" + shortcut.getName () + "\">" + Utils.translate (shortcut.getPattern ()) + "</shortcut>");
	}

	private void printRule (RuleDoc rule, PrintWriter p)
	{
		p.println ("\t\t\t<rule>");
		for (PatternDoc pattern : rule.getPatterns ())
		{
			p.print ("\t\t\t\t<pattern");
			if (pattern.isBOL ())
				p.print (" bol=\"true\"");
			if (pattern.isNocase ())
				p.print (" nocase=\"true\"");
			p.println (">" + Utils.translate (pattern.getPattern ()) + "</pattern>");
		}
		p.println ("\t\t\t\t<action>" + Utils.translate (rule.getAction ()) + "</action>");
		p.println ("\t\t\t</rule>");
	}

	private void printLexerState (LexerStateDoc doc, PrintWriter p)
	{
		p.println ("\t\t<state name=\"" + doc.getName () + "\">");
		RuleDoc[] patterns = doc.getRules ();
		for (int i = 0; i < patterns.length; ++i)
		{
			printRule (patterns[i], p);
		}

		p.println ("\t\t</state>");
	}

	public void printLexer (LexerDoc lexer, PrintWriter p)
	{
		if (lexer == null)
			return;
		p.println ("\t<lexer>");

		ShortcutDoc[] shortcuts = lexer.getShortcuts ();
		for (int i = 0; i < shortcuts.length; ++i)
			printShortcut (shortcuts[i], p);

		LexerStateDoc[] stateDocs = lexer.getLexerStates ();
		for (int i = 0; i < stateDocs.length; ++i)
			printLexerState (stateDocs[i], p);

		p.println ("\t</lexer>");
	}
}


text:
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" deploy.proj
pause


text:
<?php

namespace phpbb\cron\task\core;

/**
* Tidy search cron task.
*
* Will only run when the currently selected search backend supports tidying.
*/
class tidy_search extends \phpbb\cron\task\base
{
	protected $phpbb_root_path;
	protected $php_ext;
	protected $auth;
	protected $config;
	protected $db;
	protected $user;

	/**
	* Constructor.
	*
	* @param string $phpbb_root_path The root path
	* @param string $php_ext The PHP file extension
	* @param \phpbb\auth\auth $auth The auth
	* @param \phpbb\config\config $config The config
	* @param \phpbb\db\driver\driver_interface $db The db connection
	* @param \phpbb\user $user The user
	*/
	public function __construct($phpbb_root_path, $php_ext, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user)
	{
		$this->phpbb_root_path = $phpbb_root_path;
		$this->php_ext = $php_ext;
		$this->auth = $auth;
		$this->config = $config;
		$this->db = $db;
		$this->user = $user;
	}

	/**
	* Runs this cron task.
	*
	* @return null
	*/
	public function run()
	{
		$search_type = $this->config['search_type'];

		// We do some additional checks in the module to ensure it can actually be utilised
		$error = false;
		$search = new $search_type($error, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user);

		if (!$error)
		{
			$search->tidy();
		}
	}

	/**
	* Returns whether this cron task can run, given current board configuration.
	*
	* Search cron task is runnable in all normal use. It may not be
	* runnable if the search backend implementation selected in board
	* configuration does not exist.
	*
	* @return bool
	*/
	public function is_runnable()
	{
		return class_exists($this->config['search_type']);
	}

	/**
	* Returns whether this cron task should run now, because enough time
	* has passed since it was last run.
	*
	* The interval between search tidying is specified in board
	* configuration.
	*
	* @return bool
	*/
	public function should_run()
	{
		return $this->config['search_last_gc'] < time() - $this->config['search_gc'];
	}
}


text:
--
-- extension Google Login SQL schema update. Add index on user_id
--
ALTER TABLE /*$wgDBprefix*/user_google_user ADD INDEX (user_id);


text:
  Saint-Eulien est
       un village
       localisé dans le département de Marne en Champagne-Ardenne. On dénombrait 398 habitants en 2008.

Le nombre d'habitations, à Saint-Eulien, se décomposait en 2011 en 25 appartements et 153 maisons soit
 un marché plutôt équilibré.

Si vous pensez demenager à Saint-Eulien, vous pourrez aisément trouver une maison à vendre.

À coté de Saint-Eulien sont situées les villes de
Perthes localisée à 5 km, 555 habitants,
Hallignicourt à 4 km, 287 habitants,
Vouillers située à 3 km, 184 habitants,
Ambrières à 6 km, 236 habitants,
Trois-Fontaines-l'Abbaye localisée à 6 km, 232 habitants,
Villiers-en-Lieu située à 2 km, 1 581 habitants,
 entre autres. De plus, Saint-Eulien est située à seulement sept km de Saint-Dizier.

La commune compte quelques  équipements sportifs, elle dispose, entre autres, de un terrain de sport.


text:
package com.alipay.pojo.account.query;

import java.io.Serializable;
import java.util.List;

import com.quigley.moose.mapping.provider.annotation.XML;
import com.quigley.moose.mapping.provider.annotation.XMLList;

@XML(name = "request")
public class Request implements Serializable {

	private static final long serialVersionUID = -8834519983979193783L;

	@XMLList(name = "param")
	private List<Param> paramList;

	public List<Param> getParamList() {
		return this.paramList;
	}

	public void setParamList(List<Param> paramList) {
		this.paramList = paramList;
	}

	@Override
	public String toString() {
		return "Request [paramList=" + this.paramList + "]";
	}

}


text:
class Server < BaseTest
  TITLE = "Image tests"

  def run
    self.title = TITLE
    run_tests [
      "server list",
      "server list openstack",
      "server list ec2"
    ]
  end
end


text:
function makeIterator(array) {
    var index = 0;

    return {
       next: function() {
           return index < array.length ?
               {value: array[index++], done: false} :
               {done: true};
       }
    };
};

var it = makeIterator([1,2,3,4,5]);
var element;
while( element = it.next().value){
	console.log(`${element}`);
}
// console.log(it.next().value);
// console.log(it.next().value);
// console.log(it.next().done);


text:
BOOT_DEV="ANDROID_BOOT_PARTITION"

if [ ! -e "$BOOT_DEV" ]; then
    echo "BOOT_DEV \"$BOOT_DEV\" does not exist!"
    return 1
fi

/tmp/scripts/kernel_inject --inject="$BOOT_DEV" --kernel="/tmp/scripts/kernel"
return $?


text:
include_recipe 'tomcat::stop'
include_recipe 'tomcat::start'


text:
require 'json'

# This recipe controls logstash-forwarder/lumberjack installation and configuration.
# It works on both Linux and OS X, so please be aware of any OS specific definitions.
# There are many already here, so they're inside if blocks.

# Figure out which servers we need to know about
lj_network = []
lj_network << node.default[:lumberjack][:default_servers]

# All the following stuff needs to happen on Linux, namely CentOS
if node[:platform] != 'mac_os_x'
  lumberjack_version = "0.4.7-1"

  yum_package "lumberjack" do
    action :install
    version lumberjack_version
    flush_cache [:before]
    allow_downgrade true
    notifies :restart, "service[lumberjack]", :delayed
  end

  file "/opt/lumberjack/bin/lumberjack" do
    mode 00755
  end

  case node[:platform_version]
  when /^6/
    lumberjack_init_script = "/etc/init/lumberjack.conf"
    lumberjack_init_src = "lumberjack.init.erb"
    service "lumberjack" do
      action [ :nothing ]
      provider lumberjack_provider = Chef::Provider::Service::Upstart
    end
  when /^7/
    lumberjack_init_script = "/etc/systemd/system/lumberjack.service"
    lumberjack_init_src = "lumberjack.service.erb"
    service "lumberjack" do
      action [ :nothing ]
    end
  end

  file "/etc/init.d/lumberjack" do
    action :delete
  end

  template "#{lumberjack_init_script}" do
    source "#{lumberjack_init_src}"
    owner 'root'
    group 'root'
    mode 00444
    notifies :restart, "service[lumberjack]", :delayed
  end
end # End Linux/CentOS stuff

# Here are the differences between OS X and Linux.
if node[:platform] == 'mac_os_x'
  # On OS X, Lumberjack is formerly known as logstash-forwader
  program_name = 'logstash-forwarder'
  service 'com.elasticsearch.logstash-forwarder' do
    action [ :enable ]
  end
  config_file_owner = "root"
  config_file_group = "staff"

  # On OS X, we can't "restart" services, so we just kill them and launchd
  # brings them back, yay. This is called by the logstash config being changed.
  execute "reload_logstash_forwarder" do
    command "/usr/bin/pkill logstash-forwarder"
    action :nothing
  end

  # Since logstash-forwarder doesn't support multiple desitnations like
  # lumberjack does (yet), and we only send to corpelk, just set the array to that.
  lj_network = node[:lumberjack][:corpelk]

else
  # Logstash-forwarder is still known as lumberjack on Linux, for now.
  program_name = 'lumberjack'
  config_file_owner = "root"
  config_file_group = "root"
end

template "/etc/#{program_name}.conf" do
  source 'lumberjack.conf.erb'
  owner config_file_owner
  group config_file_group
  mode 00444
  variables({
    :network_json => JSON.pretty_generate(lj_network),
    :files_json => JSON.pretty_generate(node[:lumberjack_files])
  })
  case node[:platform]
  when "centos", "redhat"
    notifies :restart, "service[lumberjack]", :delayed
  when "mac_os_x"
    notifies :run, resources(:execute => "reload_logstash_forwarder"), :delayed
  end
end

service "lumberjack" do
  action :start
end


text:
package io.atomix.core.transaction.impl;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import io.atomix.core.set.AsyncDistributedSet;
import io.atomix.core.set.impl.SetUpdate;
import io.atomix.core.transaction.TransactionId;
import io.atomix.core.transaction.TransactionLog;
import io.atomix.primitive.protocol.ProxyProtocol;

import java.util.Map;
import java.util.concurrent.CompletableFuture;

/**
 * Repeatable reads transactional set.
 */
public class RepeatableReadsTransactionalSet<E> extends TransactionalSetParticipant<E> {
  private final Map<E, CompletableFuture<Boolean>> cache = Maps.newConcurrentMap();
  private final Map<E, SetUpdate<E>> updates = Maps.newConcurrentMap();

  public RepeatableReadsTransactionalSet(TransactionId transactionId, AsyncDistributedSet<E> set) {
    super(transactionId, set);
  }

  @Override
  public ProxyProtocol protocol() {
    return (ProxyProtocol) set.protocol();
  }

  private CompletableFuture<Boolean> read(E element) {
    return cache.computeIfAbsent(element, set::contains);
  }

  @Override
  public CompletableFuture<Boolean> add(E e) {
    SetUpdate<E> update = updates.get(e);
    if (update != null) {
      switch (update.type()) {
        case ADD:
          return CompletableFuture.completedFuture(false);
        case REMOVE:
        case NOT_CONTAINS:
          updates.put(e, new SetUpdate<>(SetUpdate.Type.ADD, e));
          return CompletableFuture.completedFuture(true);
        case CONTAINS:
          return CompletableFuture.completedFuture(false);
        default:
          throw new AssertionError();
      }
    } else {
      return read(e)
          .thenApply(exists -> {
            if (exists) {
              updates.put(e, new SetUpdate<>(SetUpdate.Type.CONTAINS, e));
              return false;
            } else {
              updates.put(e, new SetUpdate<>(SetUpdate.Type.ADD, e));
              return true;
            }
          });
    }
  }

  @Override
  public CompletableFuture<Boolean> remove(E e) {
    SetUpdate<E> update = updates.get(e);
    if (update != null) {
      switch (update.type()) {
        case ADD:
          updates.put(e, new SetUpdate<>(SetUpdate.Type.NOT_CONTAINS, e));
          return CompletableFuture.completedFuture(true);
        case REMOVE:
        case NOT_CONTAINS:
          return CompletableFuture.completedFuture(false);
        case CONTAINS:
          updates.put(e, new SetUpdate<>(SetUpdate.Type.REMOVE, e));
          return CompletableFuture.completedFuture(true);
        default:
          throw new AssertionError();
      }
    } else {
      return read(e)
          .thenApply(exists -> {
            if (exists) {
              updates.put(e, new SetUpdate<>(SetUpdate.Type.REMOVE, e));
              return true;
            } else {
              updates.put(e, new SetUpdate<>(SetUpdate.Type.NOT_CONTAINS, e));
              return false;
            }
          });
    }
  }

  @Override
  public CompletableFuture<Boolean> contains(E e) {
    SetUpdate<E> update = updates.get(e);
    if (update != null) {
      switch (update.type()) {
        case ADD:
        case CONTAINS:
          return CompletableFuture.completedFuture(true);
        case REMOVE:
        case NOT_CONTAINS:
          return CompletableFuture.completedFuture(false);
        default:
          throw new AssertionError();
      }
    }
    return read(e);
  }

  @Override
  public TransactionLog<SetUpdate<E>> log() {
    return new TransactionLog<>(transactionId, 0, Lists.newArrayList(updates.values()));
  }
}


text:
package com.amazonaws.services.backupgateway.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS
 *      API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateHypervisorRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
     *

     */
    private String host;
    /**
     *

     * The Amazon Resource Name (ARN) of the hypervisor to update.
     *

     */
    private String hypervisorArn;
    /**
     *

     * The updated name for the hypervisor
     *

     */
    private String name;
    /**
     *

     * The updated password for the hypervisor.
     *

     */
    private String password;
    /**
     *

     * The updated username for the hypervisor.
     *

     */
    private String username;

    /**
     *

     * The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
     *

     *
     * @param host
     *        The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name
     *        (FQDN).
     */

    public void setHost(String host) {
        this.host = host;
    }

    /**
     *

     * The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
     *

     *
     * @return The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name
     *         (FQDN).
     */

    public String getHost() {
        return this.host;
    }

    /**
     *

     * The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
     *

     *
     * @param host
     *        The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name
     *        (FQDN).
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateHypervisorRequest withHost(String host) {
        setHost(host);
        return this;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the hypervisor to update.
     *

     *
     * @param hypervisorArn
     *        The Amazon Resource Name (ARN) of the hypervisor to update.
     */

    public void setHypervisorArn(String hypervisorArn) {
        this.hypervisorArn = hypervisorArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the hypervisor to update.
     *

     *
     * @return The Amazon Resource Name (ARN) of the hypervisor to update.
     */

    public String getHypervisorArn() {
        return this.hypervisorArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the hypervisor to update.
     *

     *
     * @param hypervisorArn
     *        The Amazon Resource Name (ARN) of the hypervisor to update.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateHypervisorRequest withHypervisorArn(String hypervisorArn) {
        setHypervisorArn(hypervisorArn);
        return this;
    }

    /**
     *

     * The updated name for the hypervisor
     *

     *
     * @param name
     *        The updated name for the hypervisor
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * The updated name for the hypervisor
     *

     *
     * @return The updated name for the hypervisor
     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * The updated name for the hypervisor
     *

     *
     * @param name
     *        The updated name for the hypervisor
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateHypervisorRequest withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * The updated password for the hypervisor.
     *

     *
     * @param password
     *        The updated password for the hypervisor.
     */

    public void setPassword(String password) {
        this.password = password;
    }

    /**
     *

     * The updated password for the hypervisor.
     *

     *
     * @return The updated password for the hypervisor.
     */

    public String getPassword() {
        return this.password;
    }

    /**
     *

     * The updated password for the hypervisor.
     *

     *
     * @param password
     *        The updated password for the hypervisor.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateHypervisorRequest withPassword(String password) {
        setPassword(password);
        return this;
    }

    /**
     *

     * The updated username for the hypervisor.
     *

     *
     * @param username
     *        The updated username for the hypervisor.
     */

    public void setUsername(String username) {
        this.username = username;
    }

    /**
     *

     * The updated username for the hypervisor.
     *

     *
     * @return The updated username for the hypervisor.
     */

    public String getUsername() {
        return this.username;
    }

    /**
     *

     * The updated username for the hypervisor.
     *

     *
     * @param username
     *        The updated username for the hypervisor.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateHypervisorRequest withUsername(String username) {
        setUsername(username);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getHost() != null)
            sb.append("Host: ").append(getHost()).append(",");
        if (getHypervisorArn() != null)
            sb.append("HypervisorArn: ").append(getHypervisorArn()).append(",");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getPassword() != null)
            sb.append("Password: ").append("***Sensitive Data Redacted***").append(",");
        if (getUsername() != null)
            sb.append("Username: ").append("***Sensitive Data Redacted***");
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof UpdateHypervisorRequest == false)
            return false;
        UpdateHypervisorRequest other = (UpdateHypervisorRequest) obj;
        if (other.getHost() == null ^ this.getHost() == null)
            return false;
        if (other.getHost() != null && other.getHost().equals(this.getHost()) == false)
            return false;
        if (other.getHypervisorArn() == null ^ this.getHypervisorArn() == null)
            return false;
        if (other.getHypervisorArn() != null && other.getHypervisorArn().equals(this.getHypervisorArn()) == false)
            return false;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getPassword() == null ^ this.getPassword() == null)
            return false;
        if (other.getPassword() != null && other.getPassword().equals(this.getPassword()) == false)
            return false;
        if (other.getUsername() == null ^ this.getUsername() == null)
            return false;
        if (other.getUsername() != null && other.getUsername().equals(this.getUsername()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getHost() == null) ? 0 : getHost().hashCode());
        hashCode = prime * hashCode + ((getHypervisorArn() == null) ? 0 : getHypervisorArn().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getPassword() == null) ? 0 : getPassword().hashCode());
        hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode());
        return hashCode;
    }

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

}


text:
package iso20022

// General information about the corporate action event.
type CorporateActionGeneralInformation90 struct {

	// Reference assigned by the account servicer to unambiguously identify a corporate action event.
	CorporateActionEventIdentification *Max35Text `xml:"CorpActnEvtId"`

	// Official and unique reference assigned by the official central body/entity within each market at the beginning of a corporate action event.
	OfficialCorporateActionEventIdentification *Max35Text `xml:"OffclCorpActnEvtId,omitempty"`

	// Type of corporate action event.
	EventType *CorporateActionEventType32Choice `xml:"EvtTp"`

	// Identification of the security concerned by the corporate action.
	FinancialInstrumentIdentification *SecurityIdentification19 `xml:"FinInstrmId,omitempty"`
}

func (c *CorporateActionGeneralInformation90) SetCorporateActionEventIdentification(value string) {
	c.CorporateActionEventIdentification = (*Max35Text)(&value)
}

func (c *CorporateActionGeneralInformation90) SetOfficialCorporateActionEventIdentification(value string) {
	c.OfficialCorporateActionEventIdentification = (*Max35Text)(&value)
}

func (c *CorporateActionGeneralInformation90) AddEventType() *CorporateActionEventType32Choice {
	c.EventType = new(CorporateActionEventType32Choice)
	return c.EventType
}

func (c *CorporateActionGeneralInformation90) AddFinancialInstrumentIdentification() *SecurityIdentification19 {
	c.FinancialInstrumentIdentification = new(SecurityIdentification19)
	return c.FinancialInstrumentIdentification
}


text:
package com.joybean.yogg.statemachine.action;

import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author joybean
 */
@Component
public class ResendAction extends ClickSendButtonAction {

    @Override
    protected List<String> getXPath() {
        return config.getPageElementLocators().getConfirmButtonXpaths();
    }
}


text:
namespace muduo
{

template<typename T>
class BoundedBlockingQueue : boost::noncopyable
{
 public:
  explicit BoundedBlockingQueue(int maxSize)
    : mutex_(),
      notEmpty_(mutex_),
      notFull_(mutex_),
      queue_(maxSize)
  {
  }

  void put(const T& x)
  {
    MutexLockGuard lock(mutex_);
    while (queue_.full())
    {
      notFull_.wait();
    }
    assert(!queue_.full());
    queue_.push_back(x);
    notEmpty_.notify(); // TODO: move outside of lock
  }

  T take()
  {
    MutexLockGuard lock(mutex_);
    while (queue_.empty())
    {
      notEmpty_.wait();
    }
    assert(!queue_.empty());
    T front(queue_.front());
    queue_.pop_front();
    notFull_.notify(); // TODO: move outside of lock
    return front;
  }

  bool empty() const
  {
    MutexLockGuard lock(mutex_);
    return queue_.empty();
  }

  bool full() const
  {
    MutexLockGuard lock(mutex_);
    return queue_.full();
  }

  size_t size() const
  {
    MutexLockGuard lock(mutex_);
    return queue_.size();
  }

  size_t capacity() const
  {
    MutexLockGuard lock(mutex_);
    return queue_.capacity();
  }

 private:
  mutable MutexLock          mutex_;
  Condition                  notEmpty_;
  Condition                  notFull_;
  boost::circular_buffer<T>  queue_;
};

}

#endif  // MUDUO_BASE_BOUNDEDBLOCKINGQUEUE_H


text:
package com.after_sunrise.commons.spring.editor;

import static org.junit.Assert.assertEquals;

import java.util.Properties;

import org.junit.Before;
import org.junit.Test;

/**
 * @author takanori.takase
 */
public class PropertiesEditorTest {

	private PropertiesEditor target;

	@Before
	public void setUp() throws Exception {
		target = new PropertiesEditor();
	}

	@Test
	public void testSetAsText() {

		target.setAsText("test.properties");

		Properties p = (Properties) target.getValue();

		assertEquals("bar", p.getProperty("foo"));

	}

	@Test(expected = IllegalArgumentException.class)
	public void testSetAsText_Invalid() {

		target.setAsText("foo.bar");

	}

}


text:
import { Component, Inject, OnInit } from '@angular/core';
import { Bookmark } from '../../../core/model/bookmark';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { UserData } from '../../../core/model/user-data';
import { Observable } from 'rxjs';

@Component({
  selector: 'app-delete-bookmark-dialog',
  templateUrl: './delete-bookmark-dialog.component.html',
  styleUrls: ['./delete-bookmark-dialog.component.scss']
})
export class DeleteBookmarkDialogComponent implements OnInit {

  bookmark: Bookmark;
  userData$: Observable<UserData>;

  constructor(
    private dialogRef: MatDialogRef<DeleteBookmarkDialogComponent>,
    @Inject(MAT_DIALOG_DATA) data
  ) {
    this.bookmark = data.bookmark;
    this.userData$ = data.userData;
  }

  ngOnInit() {
  }

  delete() {
    this.dialogRef.close('DELETE_CONFIRMED');
  }

  close() {
    this.dialogRef.close('DELETE_CANCELED');
  }

}


text:
sudo apt-get install --only-upgrade apt=1.3.3 -y
sudo apt-get install --only-upgrade libapt-pkg5.0=1.3.3 -y
sudo apt-get install --only-upgrade libapt-inst2.0=1.3.3 -y
sudo apt-get install --only-upgrade apt-doc=1.3.3 -y
sudo apt-get install --only-upgrade libapt-pkg-dev=1.3.3 -y
sudo apt-get install --only-upgrade libapt-pkg-doc=1.3.3 -y
sudo apt-get install --only-upgrade apt-utils=1.3.3 -y
sudo apt-get install --only-upgrade apt-transport-https=1.3.3 -y


text:
package com.hu.creation.abstractFactory;

public class IntelMainboard implements Mainboard {

	/**
     * CPU插槽的孔数
     */
    private int cpuHoles = 0;
    /**
     * 构造方法,传入CPU插槽的孔数
     * @param cpuHoles
     */
    public IntelMainboard(int cpuHoles){
        this.cpuHoles = cpuHoles;
    }
    @Override
    public void installCPU() {
        // TODO Auto-generated method stub
        System.out.println("Intel主板的CPU插槽孔数是:" + cpuHoles);
    }

}


text:
package se.ejp.traci.gui;

import java.util.ArrayList;
import java.util.List;

import se.ejp.traci.main.Result;
import se.ejp.traci.model.Color;

public class MultiDrawArea extends AbstractDrawArea
{
    private final List<DrawArea> areas;

    public MultiDrawArea(final int width, final int height)
    {
        super(width, height);
        this.areas = new ArrayList<DrawArea>();
    }

    public void add(final DrawArea area)
    {
        assert width() == area.width();
        assert height() == area.height();
        areas.add(area);
    }

    @Override
    public void draw(final long x, final long y, final Color color)
    {
        final int size = areas.size();

        for (int i = 0; i < size; ++i)
        {
            areas.get(i).draw(x, y, color);
        }
    }

    @Override
    public Result start()
    {
        for (final DrawArea area : areas)
        {
            final Result result = area.start();

            if (result != Result.SUCCESS)
            {
                return result;
            }
        }

        return Result.SUCCESS;
    }

    @Override
    public Result finish()
    {
        for (final DrawArea area : areas)
        {
            final Result result = area.finish();

            if (result != Result.SUCCESS)
            {
                return result;
            }
        }

        return Result.SUCCESS;
    }
}


text:
'use strict';
const shortid = require('shortid');
const Joi = require('joi');

exports.register = (server, options, next) => {
  const mongoose = server.methods.mongoose();
  var quoteSchema = new mongoose.Schema({
    quote: String,
    background: String,
    author: String,
    creatorInfo: Object,
    creatorUA: String,
    created: { type: Date, default: Date.now },
    updated: { type: Date, default: Date.now },
    _id: {
      type: String,
      'default': shortid.generate,
      unique: true
    }
  });
  const db = server.methods.mongooseDb();
  const Quote = db.model('Quote', quoteSchema);
  server.route({
    method: 'GET',
    path: '/create',
    config: {
      handler: (request, reply) => {
        reply.view('quote/create', {});
      }
    }
  });

  // TODO: Turn this into a permaredirect 30whatever
  server.route({
    method: 'GET',
    path: '/quote/{id}',
    config: {
      handler: (request, reply) => {
        Quote.findOne({_id: request.params.id}).then(foundQuote => {
          let baseTextSize = 50;
          let modifier = Math.ceil(foundQuote.quote.length / 50);
          baseTextSize -= modifier;
          reply.view('quote/view', {
            quote: foundQuote.quote,
            background: foundQuote.background,
            author: foundQuote.author,
            textSize1: baseTextSize,
            textSize2: Math.max(baseTextSize * 0.6, 20),
            textSize3: Math.max(baseTextSize * 0.4, 20)
          });
        }, err => {
          server.log(['error'], err);
          reply.view('errors/404', {message: 'Quote Not Found'});
        });
      }
    }
  });

  server.route({
    method: 'GET',
    path: '/q/{id}',
    config: {
      handler: (request, reply) => {
        Quote.findOne({_id: request.params.id}).then(foundQuote => {
          let baseTextSize = 50;
          let modifier = Math.ceil(foundQuote.quote.length / 50);
          baseTextSize -= modifier;
          reply.view('quote/view', {
            quote: foundQuote.quote,
            background: foundQuote.background,
            author: foundQuote.author,
            textSize1: baseTextSize,
            textSize2: Math.max(baseTextSize * 0.6, 20),
            textSize3: Math.max(baseTextSize * 0.4, 20)
          });
        }, err => {
          server.log(['error'], err);
          reply.view('errors/404', {message: 'Quote Not Found'});
        });
      }
    }
  });

  server.route({
    method: 'POST',
    path: '/create',
    config: {
      validate: {
        payload: {
          quote: Joi.string().min(3).max(1000),
          author: Joi.string().min(3).max(100),
          background: Joi.string().uri({
            scheme: [
              'http',
              'https'
            ]
          })
        }
      },
      handler: (request, reply) => {
        let newQuote = new Quote({
          quote: request.payload.quote,
          background: request.payload.background,
          author: request.payload.author,
          creatorInfo: request.connection.info,
          creatorUA: request.headers['user-agent']
        });

        let saveQuery = newQuote.save();

        saveQuery.then(savedQuote => {
          reply.redirect(`/q/${savedQuote._id}`);
        }, err => {
          server.log(['error'], err);
          reply.view('quote/create', {error: 'Unable to save to database. Please report issue to https://github.com/asilluron/quote-linker/issues'});
        });
      }
    }
  });

  return next();
};

exports.register.attributes = {
  name: 'web/quote'
};


text:
/*
1) Select the family members that are older than 25 and have an even id and show their Last Name and First Names in this exact order
*/
SELECT LastName, FirstName FROM `hw3`.`family` WHERE Age>25 AND id%2=0;

/*
2) Select all the games in the database and shows them in descrescent order by their price
*/
SELECT * FROM `hw3`.`games` WHERE 1 ORDER BY price DESC;

/*
3) Select the mangas that have at least 100 chapters and shows them ordering by the oldest release of the first chapter
*/
SELECT * FROM `hw3`.`manga` WHERE lastChapter >= 100 ORDER BY firstChapterYear ASC;


text:
"""
Remote syslog client.

Works by sending UDP messages to a remote syslog server. The remote server
must be configured to accept logs from the network.

License: PUBLIC DOMAIN
Author: Christian Stigen Larsen
https://csl.name/post/python-syslog-client/

For more information, see RFC 3164.
"""

import socket

class Facility:
  "Syslog facilities"
  KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, \
  LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP = range(12)

  LOCAL0, LOCAL1, LOCAL2, LOCAL3, \
  LOCAL4, LOCAL5, LOCAL6, LOCAL7 = range(16, 24)

class Level:
  "Syslog levels"
  EMERG, ALERT, CRIT, ERR, \
  WARNING, NOTICE, INFO, DEBUG = range(8)

class Syslog:
  """A syslog client that logs to a remote server.

  Example:
  >>> log = Syslog(host="foobar.example")
  >>> log.send("hello", Level.WARNING)
  """
  def __init__(self,
               host="localhost",
               port=514,
               facility=Facility.DAEMON):
    self.host = host
    self.port = port
    self.facility = facility
    self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

  def send(self, message, level):
    "Send a syslog message to remote host using UDP."
    data = "<%d>%s" % (level + self.facility*8, message)
    self.socket.sendto(data, (self.host, self.port))

  def warn(self, message):
    "Send a syslog warning message."
    self.send(message, Level.WARNING)

  def notice(self, message):
    "Send a syslog notice message."
    self.send(message, Level.NOTICE)

  def error(self, message):
    "Send a syslog error message."
    self.send(message, Level.ERR)


text:
using namespace sc2;

int main(int argc, char* argv[]) {
    Coordinator coordinator;
    coordinator.LoadSettings(argc, argv);

    Bot bot;
    coordinator.SetParticipants({
        CreateParticipant(Race::Terran, &bot),
        CreateComputer(Race::Zerg)
    });

    coordinator.LaunchStarcraft();
    coordinator.StartGame("Test/damageTest.SC2Map");

    while (coordinator.Update()) {
    }

    return 0;
}


text:
#ifndef PG_FOREIGN_SERVER_H
#define PG_FOREIGN_SERVER_H

#include "catalog/genbki.h"

/* ----------------
 *		pg_foreign_server definition.  cpp turns this into
 *		typedef struct FormData_pg_foreign_server
 * ----------------
 */
#define ForeignServerRelationId 1417

CATALOG(pg_foreign_server,1417)
{
	NameData	srvname;		/* foreign server name */
	Oid			srvowner;		/* server owner */
	Oid			srvfdw;			/* server FDW */

#ifdef CATALOG_VARLEN			/* variable-length fields start here */
	text		srvtype;
	text		srvversion;
	aclitem		srvacl[1];		/* access permissions */
	text		srvoptions[1];	/* FDW-specific options */
#endif
} FormData_pg_foreign_server;

/* ----------------
 *		Form_pg_foreign_server corresponds to a pointer to a tuple with
 *		the format of pg_foreign_server relation.
 * ----------------
 */
typedef FormData_pg_foreign_server *Form_pg_foreign_server;

/* ----------------
 *		compiler constants for pg_foreign_server
 * ----------------
 */

#define Natts_pg_foreign_server					7
#define Anum_pg_foreign_server_srvname			1
#define Anum_pg_foreign_server_srvowner			2
#define Anum_pg_foreign_server_srvfdw			3
#define Anum_pg_foreign_server_srvtype			4
#define Anum_pg_foreign_server_srvversion		5
#define Anum_pg_foreign_server_srvacl			6
#define Anum_pg_foreign_server_srvoptions		7

DATA(insert OID = 5105 ( pg_exttable_server	PGUID	5104	_null_ _null_ _null_ _null_ ));
DESCR("special foreign server to mark external tables");
#define PG_EXTTABLE_SERVER_OID 5105
#define PG_EXTTABLE_SERVER_NAME "pg_exttable_server"

#endif   /* PG_FOREIGN_SERVER_H */


text:
package com.atlassian.plugin.metadata;

import com.atlassian.plugin.ModuleDescriptor;
import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.descriptors.CannotDisable;
import net.jcip.annotations.Immutable;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * A default implementation that uses the {@link com.atlassian.plugin.metadata.ClasspathFilePluginMetadata}
 * plugin metadata implementation to resolve the application provided plugin metadata.
 *
 * @since 2.6
 */
@Immutable
public final class DefaultPluginMetadataManager implements PluginMetadataManager
{
    private final PluginMetadata metadata;

    /**
     * Production ctor. Loads from the class path.
     */
    public DefaultPluginMetadataManager()
    {
        this(new ClasspathFilePluginMetadata());
    }

    /**
     * Test ctor.
     */
    DefaultPluginMetadataManager(final PluginMetadata metadata)
    {
        this.metadata = checkNotNull(metadata, "metadata");
    }

    /**
     *
A plugin is determined to be non-user if
     * {@link com.atlassian.plugin.Plugin#isBundledPlugin()} is true or if the
     * host application has indicated to the plugins system that a plugin was
     * provided by it.

     *
     *
NOTE: If a user has upgraded a bundled plugin then the
     * decision of whether it is user installed plugin is determined by if the
     * application has indicated to the plugins system that a plugin was
     * provided or not.

     */
    public boolean isUserInstalled(final Plugin plugin)
    {
        checkNotNull(plugin, "plugin");
        // It is user installed if it has not been marked as provided by the
        // application and it was not bundled.
        return !plugin.isBundledPlugin() && !metadata.applicationProvided(plugin);
    }

    /**
     * A plugin is determined to be "system" if
     * {@link #isUserInstalled(com.atlassian.plugin.Plugin)} is false.
     */
    public boolean isSystemProvided(Plugin plugin)
    {
        return !isUserInstalled(plugin);
    }

    /**
     * A plugin is determined to be optional if the host application has not
     * indicated to the plugins system that it is required or if any of its
     * modules have been flagged as not optional.
     */
    public boolean isOptional(final Plugin plugin)
    {
        checkNotNull(plugin, "plugin");
        // If the application has marked the plugin as required then we know we
        // are required
        if (!optionalAccordingToHostApplication(plugin))
        {
            return false;
        }

        // We need to check if any of the plugins modules are not optional
        for (final ModuleDescriptor<?> moduleDescriptor : plugin.getModuleDescriptors())
        {
            if (!optionalAccordingToHostApplication(moduleDescriptor))
            {
                return false;
            }
        }
        return true;
    }

    /**
     * A module is determined to be optional if the host application has not
     * indicated to the plugins system that it is required. If the call to
     * {@code isOptional} with the module descriptor's plugin is {@code false},
     * then this method will also return {@code false}. Also if the module
     * descriptor is annotated with
     * {@link com.atlassian.plugin.descriptors.CannotDisable} then it can not be
     * optional.
     */
    public boolean isOptional(final ModuleDescriptor<?> moduleDescriptor)
    {
        checkNotNull(moduleDescriptor, "moduleDescriptor");
        // It is not optional if the host application has marked it as required
        if (!optionalAccordingToHostApplication(moduleDescriptor))
        {
            return false;
        }

        // A module can not be optional if it is marked
        // by the CannotDisable annotation
        if (!optionalAccordingToModuleDescriptorType(moduleDescriptor))
        {
            return false;
        }

        // A module can only be optional if its parent plugin is not declared by
        // the host application as required
        return optionalAccordingToHostApplication(moduleDescriptor.getPlugin());
    }

    private boolean optionalAccordingToHostApplication(final Plugin plugin)
    {
        return !metadata.required(plugin);
    }

    private boolean optionalAccordingToHostApplication(final ModuleDescriptor<?> moduleDescriptor)
    {
        return !metadata.required(moduleDescriptor);
    }

    private boolean optionalAccordingToModuleDescriptorType(final ModuleDescriptor<?> moduleDescriptor)
    {
        return !moduleDescriptor.getClass().isAnnotationPresent(CannotDisable.class);
    }
}


text:
using System;
using System.Collections.Generic;
using Crystalbyte.Spectre.UI;

namespace Crystalbyte.Spectre.Tests.Mono {
    class WinformsBootstrapper : Bootstrapper {
        protected override void ConfigureSettings(ApplicationSettings settings) {
            base.ConfigureSettings(settings);
            //settings.IsSingleProcess = true;
            //settings.ProductVersion = "1.0.0.0";
            //settings.UserAgent = "Spectre";
            //settings.CacheDirectory = "CacheDir";
            //settings.ResourceDirectory = "ResourceDir";
            //settings.BrowserSubprocessPath = "mono.exe";
        }
        protected override IEnumerable<Viewport> CreateViewports() {
            yield return new Viewport(new MainWindow {
                StartupUri = new Uri("http://www.google.com")
            }, new BrowserDelegate());
        }
    }
}


text:
var _ = require('lodash')
var mouse = require('../geometry/mouse.js')
var transform = require('transformist')

module.exports = function (container) {
  var width = container.clientWidth
  var height = container.clientHeight
  var style

  var label = document.createElement('div')
  style = label.style
  style.right = width * 0.4
  style.top = height * 0.075
  style.width = width * 0.2
  style.height = width * 0.05
  style.textAlign = 'right'
  style.marginRight = -width * 0.2
  style.position = 'absolute'
  container.appendChild(label)

  var edge = document.createElement('div')
  style = edge.style
  style.right = 0
  style.top = 0
  style.width = width * 0.2
  style.height = width * 0.05
  style.paddingBottom = width * 0.005
  style.position = 'absolute'
  style.borderLeft = 'solid rgb(150,150,150) ' + width * 0.011 * 1.6 + 'px'
  style.borderBottom = 'solid rgb(150,150,150) ' + width * 0.011 + 'px'
  style.transform = 'skew(45deg)'
  style.msTransform = 'skew(45deg)'
  style.webkitTransform = 'skew(45deg)'
  label.appendChild(edge)

  function drawIcon () {
    var icon = document.createElement('canvas')
    icon.setAttribute('width', width * 0.05)
    icon.setAttribute('height', width * 0.05)
    icon.className = 'life-icon'
    label.appendChild(icon)
    var character = mouse({
      scale: width * 0.015,
      stroke: 'rgb(150,150,150)',
      fill: 'rgb(75,75,75)',
      thickness: width * 0.006
    })
    var camera = {transform: transform(), game: {width: width * 0.05, height: width * 0.05}}
    character.draw(icon.getContext('2d'), camera, {order: 'bottom'})
  }

  function update (state) {
    var existing = document.getElementsByClassName('life-icon')
    while (existing[0]) {
      existing[0].remove()
    }
    _.range(state.current).forEach(function (i) {
      drawIcon()
    })
  }

  function hide () {
    label.style.opacity = 0
  }

  function show () {
    label.style.opacity = 1
  }

  return {
    update: update,
    hide: hide,
    show: show
  }
}


text:
<beans:beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:batch="http://www.springframework.org/schema/batch" xmlns:util="http://www.springframework.org/schema/util"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:import="http://www.springframework.org/schema//import"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
		http://www.springframework.org/schema/batch
		http://www.springframework.org/schema/batch/spring-batch-2.2.xsd
		http://www.springframework.org/schema/util
		http://www.springframework.org/schema/util/spring-util-4.1.xsd
		http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
		">

	<beans:bean id="runMeTask"
		class="jp.co.acroquest.endosnipe.web.explorer.service.ReportScheduleService" />

	<!-- Spring Quartz -->
	<beans:bean name="runMeJob"
		class="org.springframework.scheduling.quartz.JobDetailFactoryBean">

		<beans:property name="jobClass"
			value="jp.co.acroquest.endosnipe.web.explorer.service.ReportTimerTask" />

		<beans:property name="jobDataAsMap">
			<util:map>
				<beans:entry key="runMeTask" value-ref="runMeTask" />
			</util:map>
		</beans:property>

		<beans:property name="durability" value="true" />
		<beans:property name="requestsRecovery" value="false" />

	</beans:bean>

	<!-- Cron Trigger, run every 5 seconds -->
	<beans:bean id="cronTrigger"
		class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">

		<beans:property name="jobDetail" ref="runMeJob" />
		<beans:property name="cronExpression" value="0/5 * * * * ?" />

	</beans:bean>

	<beans:bean
		class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<beans:property name="applicationContextSchedulerContextKey">
			<beans:value>applicationContext</beans:value>
		</beans:property>
		<beans:property name="jobDetails">
			<util:list>
				<beans:ref bean="runMeJob" />
			</util:list>
		</beans:property>

		<beans:property name="triggers">
			<util:list>
				<beans:ref bean="cronTrigger" />
			</util:list>
		</beans:property>

	</beans:bean>
</beans:beans>


text:
namespace views {
class Widget;
}

namespace ash {

namespace wm {
class WmLayoutManager;
}

namespace mus {

class MusLayoutManagerAdapter;
class WmRootWindowControllerMus;
class WmWindowMusTestApi;

// WmWindow implementation for mus.
//
// WmWindowMus is tied to the life of the underlying ui::Window (it is stored
// as an owned property).
class WmWindowMus : public WmWindow, public ui::WindowObserver {
 public:
  // Indicates the source of the widget creation.
  enum class WidgetCreationType {
    // The widget was created internally, and not at the request of a client.
    // For example, overview mode creates a number of widgets. These widgets are
    // created with a type of INTERNAL.
    INTERNAL,

    // The widget was created for a client. In other words there is a client
    // embedded in the ui::Window. For example, when Chrome creates a new
    // browser window the window manager is asked to create the ui::Window.
    // The window manager creates a ui::Window and a views::Widget to show the
    // non-client frame decorations. In this case the creation type is
    // FOR_CLIENT.
    FOR_CLIENT,
  };

  explicit WmWindowMus(ui::Window* window);
  // NOTE: this class is owned by the corresponding window. You shouldn't delete
  // TODO(sky): friend deleter and make private.
  ~WmWindowMus() override;

  // Returns a WmWindow for an ui::Window, creating if necessary.
  static WmWindowMus* Get(ui::Window* window) {
    return const_cast<WmWindowMus*>(Get(const_cast<const ui::Window*>(window)));
  }
  static const WmWindowMus* Get(const ui::Window* window);

  static WmWindowMus* Get(views::Widget* widget);

  static ui::Window* GetMusWindow(WmWindow* wm_window) {
    return const_cast<ui::Window*>(
        GetMusWindow(const_cast<const WmWindow*>(wm_window)));
  }
  static const ui::Window* GetMusWindow(const WmWindow* wm_window);

  static std::vector<WmWindow*> FromMusWindows(
      const std::vector<ui::Window*>& mus_windows);

  void set_wm_window_type(ui::wm::WindowType type) {
    wm_window_type_ = type;
    is_wm_window_type_set_ = true;
  }

  // Sets the widget associated with the window. The widget is used to query
  // state, such as min/max size. The widget is not owned by the WmWindowMus.
  void set_widget(views::Widget* widget, WidgetCreationType type) {
    widget_ = widget;
    widget_creation_type_ = type;
  }

  ui::Window* mus_window() { return window_; }
  const ui::Window* mus_window() const { return window_; }

  WmRootWindowControllerMus* GetRootWindowControllerMus() {
    return const_cast<WmRootWindowControllerMus*>(
        const_cast<const WmWindowMus*>(this)->GetRootWindowControllerMus());
  }
  const WmRootWindowControllerMus* GetRootWindowControllerMus() const;

  static WmWindowMus* AsWmWindowMus(WmWindow* window) {
    return static_cast<WmWindowMus*>(window);
  }
  static const WmWindowMus* AsWmWindowMus(const WmWindow* window) {
    return static_cast<const WmWindowMus*>(window);
  }

  wm::WindowState* GetWindowState() { return WmWindow::GetWindowState(); }

  // See description of |children_use_extended_hit_region_|.
  bool ShouldUseExtendedHitRegion() const;

  // Returns true if this window is considered a shell window container.
  bool IsContainer() const;

  // WmWindow:
  void Destroy() override;
  const WmWindow* GetRootWindow() const override;
  WmRootWindowController* GetRootWindowController() override;
  WmShell* GetShell() const override;
  void SetName(const char* name) override;
  std::string GetName() const override;
  void SetTitle(const base::string16& title) override;
  base::string16 GetTitle() const override;
  void SetShellWindowId(int id) override;
  int GetShellWindowId() const override;
  WmWindow* GetChildByShellWindowId(int id) override;
  ui::wm::WindowType GetType() const override;
  int GetAppType() const override;
  void SetAppType(int app_type) const override;
  bool IsBubble() override;
  ui::Layer* GetLayer() override;
  bool GetLayerTargetVisibility() override;
  bool GetLayerVisible() override;
  display::Display GetDisplayNearestWindow() override;
  bool HasNonClientArea() override;
  int GetNonClientComponent(const gfx::Point& location) override;
  gfx::Point ConvertPointToTarget(const WmWindow* target,
                                  const gfx::Point& point) const override;
  gfx::Point ConvertPointToScreen(const gfx::Point& point) const override;
  gfx::Point ConvertPointFromScreen(const gfx::Point& point) const override;
  gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const override;
  gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const override;
  gfx::Size GetMinimumSize() const override;
  gfx::Size GetMaximumSize() const override;
  bool GetTargetVisibility() const override;
  bool IsVisible() const override;
  void SetOpacity(float opacity) override;
  float GetTargetOpacity() const override;
  gfx::Rect GetMinimizeAnimationTargetBoundsInScreen() const override;
  void SetTransform(const gfx::Transform& transform) override;
  gfx::Transform GetTargetTransform() const override;
  bool IsSystemModal() const override;
  bool GetBoolProperty(WmWindowProperty key) override;
  SkColor GetColorProperty(WmWindowProperty key) override;
  void SetColorProperty(WmWindowProperty key, SkColor value) override;
  int GetIntProperty(WmWindowProperty key) override;
  void SetIntProperty(WmWindowProperty key, int value) override;
  const wm::WindowState* GetWindowState() const override;
  WmWindow* GetToplevelWindow() override;
  WmWindow* GetToplevelWindowForFocus() override;
  void SetParentUsingContext(WmWindow* context,
                             const gfx::Rect& screen_bounds) override;
  void AddChild(WmWindow* window) override;
  void RemoveChild(WmWindow* child) override;
  const WmWindow* GetParent() const override;
  const WmWindow* GetTransientParent() const override;
  std::vector<WmWindow*> GetTransientChildren() override;
  void SetLayoutManager(
      std::unique_ptr<WmLayoutManager> layout_manager) override;
  WmLayoutManager* GetLayoutManager() override;
  void SetVisibilityChangesAnimated() override;
  void SetVisibilityAnimationType(int type) override;
  void SetVisibilityAnimationDuration(base::TimeDelta delta) override;
  void SetVisibilityAnimationTransition(
      ::wm::WindowVisibilityAnimationTransition transition) override;
  void Animate(::wm::WindowAnimationType type) override;
  void StopAnimatingProperty(
      ui::LayerAnimationElement::AnimatableProperty property) override;
  void SetChildWindowVisibilityChangesAnimated() override;
  void SetMasksToBounds(bool value) override;
  void SetBounds(const gfx::Rect& bounds) override;
  void SetBoundsWithTransitionDelay(const gfx::Rect& bounds,
                                    base::TimeDelta delta) override;
  void SetBoundsDirect(const gfx::Rect& bounds) override;
  void SetBoundsDirectAnimated(const gfx::Rect& bounds) override;
  void SetBoundsDirectCrossFade(const gfx::Rect& bounds) override;
  void SetBoundsInScreen(const gfx::Rect& bounds_in_screen,
                         const display::Display& dst_display) override;
  gfx::Rect GetBoundsInScreen() const override;
  const gfx::Rect& GetBounds() const override;
  gfx::Rect GetTargetBounds() override;
  void ClearRestoreBounds() override;
  void SetRestoreBoundsInScreen(const gfx::Rect& bounds) override;
  gfx::Rect GetRestoreBoundsInScreen() const override;
  bool Contains(const WmWindow* other) const override;
  void SetShowState(ui::WindowShowState show_state) override;
  ui::WindowShowState GetShowState() const override;
  void SetRestoreShowState(ui::WindowShowState show_state) override;
  void SetRestoreOverrides(const gfx::Rect& bounds_override,
                           ui::WindowShowState window_state_override) override;
  void SetLockedToRoot(bool value) override;
  bool IsLockedToRoot() const override;
  void SetCapture() override;
  bool HasCapture() override;
  void ReleaseCapture() override;
  bool HasRestoreBounds() const override;
  void SetPinned(bool trusted) override;
  void SetAlwaysOnTop(bool value) override;
  bool IsAlwaysOnTop() const override;
  void Hide() override;
  void Show() override;
  views::Widget* GetInternalWidget() override;
  void CloseWidget() override;
  void SetFocused() override;
  bool IsFocused() const override;
  bool IsActive() const override;
  void Activate() override;
  void Deactivate() override;
  void SetFullscreen() override;
  void Maximize() override;
  void Minimize() override;
  void Unminimize() override;
  void SetExcludedFromMru(bool) override;
  bool CanMaximize() const override;
  bool CanMinimize() const override;
  bool CanResize() const override;
  bool CanActivate() const override;
  void StackChildAtTop(WmWindow* child) override;
  void StackChildAtBottom(WmWindow* child) override;
  void StackChildAbove(WmWindow* child, WmWindow* target) override;
  void StackChildBelow(WmWindow* child, WmWindow* target) override;
  std::vector<WmWindow*> GetChildren() override;
  void ShowResizeShadow(int component) override;
  void HideResizeShadow() override;
  void InstallResizeHandleWindowTargeter(
      ImmersiveFullscreenController* immersive_fullscreen_controller) override;
  void SetBoundsInScreenBehaviorForChildren(
      BoundsInScreenBehavior behavior) override;
  void SetSnapsChildrenToPhysicalPixelBoundary() override;
  void SnapToPixelBoundaryIfNecessary() override;
  void SetChildrenUseExtendedHitRegion() override;
  std::unique_ptr<views::View> CreateViewWithRecreatedLayers() override;
  void AddObserver(WmWindowObserver* observer) override;
  void RemoveObserver(WmWindowObserver* observer) override;
  bool HasObserver(const WmWindowObserver* observer) const override;
  void AddTransientWindowObserver(WmTransientWindowObserver* observer) override;
  void RemoveTransientWindowObserver(
      WmTransientWindowObserver* observer) override;
  void AddLimitedPreTargetHandler(ui::EventHandler* handler) override;
  void RemoveLimitedPreTargetHandler(ui::EventHandler* handler) override;

 private:
  friend class WmWindowMusTestApi;

  // ui::WindowObserver:
  void OnTreeChanging(const TreeChangeParams& params) override;
  void OnTreeChanged(const TreeChangeParams& params) override;
  void OnWindowReordered(ui::Window* window,
                         ui::Window* relative_window,
                         ui::mojom::OrderDirection direction) override;
  void OnWindowSharedPropertyChanged(
      ui::Window* window,
      const std::string& name,
      const std::vector<uint8_t>* old_data,
      const std::vector<uint8_t>* new_data) override;
  void OnWindowBoundsChanged(ui::Window* window,
                             const gfx::Rect& old_bounds,
                             const gfx::Rect& new_bounds) override;
  void OnWindowDestroying(ui::Window* window) override;
  void OnWindowDestroyed(ui::Window* window) override;
  void OnWindowVisibilityChanging(ui::Window* window, bool visible) override;
  void OnWindowVisibilityChanged(ui::Window* window, bool visible) override;
  void OnTransientChildAdded(ui::Window* window,
                             ui::Window* transient) override;
  void OnTransientChildRemoved(ui::Window* window,
                               ui::Window* transient) override;

  ui::Window* window_;

  // The shell window id of this window. Shell window ids are defined in
  // ash/public/cpp/shell_window_ids.h.
  int shell_window_id_ = kShellWindowId_Invalid;

  std::unique_ptr<wm::WindowState> window_state_;

  views::Widget* widget_ = nullptr;

  WidgetCreationType widget_creation_type_ = WidgetCreationType::INTERNAL;

  base::ObserverList<WmWindowObserver> observers_;

  std::unique_ptr<MusLayoutManagerAdapter> layout_manager_adapter_;

  ui::WindowShowState restore_show_state_ = ui::SHOW_STATE_DEFAULT;

  bool snap_children_to_pixel_boundary_ = false;

  // If true child windows should get a slightly larger hit region to make
  // resizing easier.
  bool children_use_extended_hit_region_ = false;

  base::ObserverList<WmTransientWindowObserver, true> transient_observers_;

  // If true the minimum size is 0x0, default is minimum size comes from widget.
  bool use_empty_minimum_size_for_testing_ = false;

  ui::wm::WindowType wm_window_type_ = ui::wm::WINDOW_TYPE_UNKNOWN;
  // Set to true if set_window_type() is called.
  bool is_wm_window_type_set_ = false;

  BoundsInScreenBehavior child_bounds_in_screen_behavior_ =
      BoundsInScreenBehavior::USE_LOCAL_COORDINATES;

  bool locked_to_root_ = false;

  DISALLOW_COPY_AND_ASSIGN(WmWindowMus);
};

}  // namespace mus
}  // namespace ash

#endif  // ASH_MUS_BRIDGE_WM_WINDOW_MUS_H_


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.contentwarehouse.v1.model;

/**
 * Protocol message for data related to good travel sites. This data is stored as signals data in
 * docjoins.
 *
 *
 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 contentwarehouse 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 QualityTravelGoodSitesData extends com.google.api.client.json.GenericJson {

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<QualityTravelGoodSitesDataI18n> i18n;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean isAggr;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean isAttractionOfficial;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean isEntity;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean isHotelOfficial;

  /**
   * Factor that determines how local anchor credit is scaled before being added to global anchors.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Float normalizationFactor;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<QualityTravelGoodSitesDataSignal> signal;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String site;

  /**
   * Site quality score, which determines the site type.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Float totalScore;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String type;

  /**
   * @return value or {@code null} for none
   */
  public java.util.List<QualityTravelGoodSitesDataI18n> getI18n() {
    return i18n;
  }

  /**
   * @param i18n i18n or {@code null} for none
   */
  public QualityTravelGoodSitesData setI18n(java.util.List<QualityTravelGoodSitesDataI18n> i18n) {
    this.i18n = i18n;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getIsAggr() {
    return isAggr;
  }

  /**
   * @param isAggr isAggr or {@code null} for none
   */
  public QualityTravelGoodSitesData setIsAggr(java.lang.Boolean isAggr) {
    this.isAggr = isAggr;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getIsAttractionOfficial() {
    return isAttractionOfficial;
  }

  /**
   * @param isAttractionOfficial isAttractionOfficial or {@code null} for none
   */
  public QualityTravelGoodSitesData setIsAttractionOfficial(java.lang.Boolean isAttractionOfficial) {
    this.isAttractionOfficial = isAttractionOfficial;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getIsEntity() {
    return isEntity;
  }

  /**
   * @param isEntity isEntity or {@code null} for none
   */
  public QualityTravelGoodSitesData setIsEntity(java.lang.Boolean isEntity) {
    this.isEntity = isEntity;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getIsHotelOfficial() {
    return isHotelOfficial;
  }

  /**
   * @param isHotelOfficial isHotelOfficial or {@code null} for none
   */
  public QualityTravelGoodSitesData setIsHotelOfficial(java.lang.Boolean isHotelOfficial) {
    this.isHotelOfficial = isHotelOfficial;
    return this;
  }

  /**
   * Factor that determines how local anchor credit is scaled before being added to global anchors.
   * @return value or {@code null} for none
   */
  public java.lang.Float getNormalizationFactor() {
    return normalizationFactor;
  }

  /**
   * Factor that determines how local anchor credit is scaled before being added to global anchors.
   * @param normalizationFactor normalizationFactor or {@code null} for none
   */
  public QualityTravelGoodSitesData setNormalizationFactor(java.lang.Float normalizationFactor) {
    this.normalizationFactor = normalizationFactor;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.util.List<QualityTravelGoodSitesDataSignal> getSignal() {
    return signal;
  }

  /**
   * @param signal signal or {@code null} for none
   */
  public QualityTravelGoodSitesData setSignal(java.util.List<QualityTravelGoodSitesDataSignal> signal) {
    this.signal = signal;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getSite() {
    return site;
  }

  /**
   * @param site site or {@code null} for none
   */
  public QualityTravelGoodSitesData setSite(java.lang.String site) {
    this.site = site;
    return this;
  }

  /**
   * Site quality score, which determines the site type.
   * @return value or {@code null} for none
   */
  public java.lang.Float getTotalScore() {
    return totalScore;
  }

  /**
   * Site quality score, which determines the site type.
   * @param totalScore totalScore or {@code null} for none
   */
  public QualityTravelGoodSitesData setTotalScore(java.lang.Float totalScore) {
    this.totalScore = totalScore;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getType() {
    return type;
  }

  /**
   * @param type type or {@code null} for none
   */
  public QualityTravelGoodSitesData setType(java.lang.String type) {
    this.type = type;
    return this;
  }

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

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

}