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

<title>DiskAwareRunnable (apache-cassandra API)</title>
<meta name="date" content="2015-08-28">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.cassandra.io.util

Class DiskAwareRunnable

java.lang.Object

org.apache.cassandra.utils.WrappedRunnable

org.apache.cassandra.io.util.DiskAwareRunnable

All Implemented Interfaces:

java.lang.Runnable

public abstract class DiskAwareRunnable
extends WrappedRunnable

Constructor Summary

Constructors

Constructor and Description

DiskAwareRunnable()

Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods

Modifier and Type
Method and Description

protected abstract Directories
getDirectories()

Get sstable directories for the CF.

protected Directories.DataDirectory
getWriteDirectory(long writeSize)

Methods inherited from class org.apache.cassandra.utils.WrappedRunnable

run, runMayThrow

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DiskAwareRunnable

public DiskAwareRunnable()

Method Detail

getWriteDirectory

protected Directories.DataDirectory getWriteDirectory(long writeSize)

getDirectories

protected abstract Directories getDirectories()

Get sstable directories for the CF.

Returns:

Directories instance for the CF.

Skip navigation links

Overview

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

Copyright © 2015 The Apache Software Foundation


text:
// Copyright (c) 2011 Sirikata Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE file.

#ifndef SIRIKATA_CORE_TRANSFER_DATA_URI_HPP__
#define SIRIKATA_CORE_TRANSFER_DATA_URI_HPP__

#include <sirikata/core/util/Platform.hpp>
#include <sirikata/core/transfer/URI.hpp>

namespace Sirikata {
namespace Transfer {

/** Data URIs encode data directly instead of referring to an external
 *  resource. Format: data:[<mediatype>][;base64],<data>.
 *
 *  NOTE: We currently only support base64 encoded URIs.
 */
class SIRIKATA_EXPORT DataURI {
public:
    typedef std::map<String, String> ParameterMap;

private:
    String mMediaType;
    ParameterMap mMediaTypeParameters;
    String mData;

    void parse(const String& uri);
public:
    explicit DataURI() {
    }

    /** Construct a data URI from a String. If the URI cannot be parsed (i.e. we
     *  cannot extract a valid scheme), the URI remains empty.
     */
    explicit DataURI(const String& uri);

    /** Construct a data URI from a String. If the URI cannot be parsed (i.e. we
     *  cannot extract a valid scheme), the URI remains empty.
     */
    explicit DataURI(const URI& uri);

    inline const String& mediatype() const {
        return mMediaType;
    }

    inline const ParameterMap& mediatypeParameters() const {
        return mMediaTypeParameters;
    }

    inline const String& data() const {
        return mData;
    }

    String toString() const;

    inline bool operator<(const DataURI &other) const {
        return (mMediaType < other.mMediaType ||
            (mMediaType < other.mMediaType && mData < other.mData));
    }

    inline bool operator==(const DataURI &other) const {
        return (mMediaType == other.mMediaType && mData < other.mData);
    }

    inline bool operator!=(const DataURI &other) const {
        return (mMediaType != other.mMediaType || mData != other.mData);
    }

    bool empty() const {
        return mData.empty();
    }

    operator bool() const {
        return !empty();
    }

    struct Hasher {
        size_t operator() (const DataURI& uri)const {
            return std::tr1::hash<std::string>()(uri.mMediaType);
        }
    };
};

inline std::ostream &operator<<(std::ostream &str, const DataURI &uri) {
    return str << uri.toString();
}

} // namespace Transfer
} // namespace Sirikata

#endif /* SIRIKATA_CORE_TRANSFER_URI_HPP__ */

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * Tax rate collection
 *
 * @category    Mage
 * @package     Mage_Tax
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Tax_Model_Resource_Calculation_Rate_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
    /**
     * Value of fetched from DB of rules per cycle
     */
    const TAX_RULES_CHUNK_SIZE = 1000;

    /**
     * Resource initialization
     */
    protected function _construct()
    {
        $this->_init('tax/calculation_rate');
    }

    /**
     * Join country table to result
     *
     * @return Mage_Tax_Model_Resource_Calculation_Rate_Collection
     */
    public function joinCountryTable()
    {
        $this->_select->join(
            array('country_table' => $this->getTable('directory/country')),
            'main_table.tax_country_id = country_table.country_id',
            array('country_name' => 'iso2_code')
        );

        return $this;
    }

    /**
     * Join Region Table
     *
     * @return Mage_Tax_Model_Resource_Calculation_Rate_Collection
     */
    public function joinRegionTable()
    {
        $this->_select->joinLeft(
            array('region_table' => $this->getTable('directory/country_region')),
            'main_table.tax_region_id = region_table.region_id',
            array('region_name' => 'code')
        );
        return $this;
    }

    /**
     * Join rate title for specified store
     *
     * @param Mage_Core_Model_Store|string|int $store
     * @return Mage_Tax_Model_Resource_Calculation_Rate_Collection
     */
    public function joinTitle($store = null)
    {
        $storeId = (int)Mage::app()->getStore($store)->getId();
        $this->_select->joinLeft(
            array('title_table' => $this->getTable('tax/tax_calculation_rate_title')),
            $this->getConnection()->quoteInto('main_table.tax_calculation_rate_id = title_table.tax_calculation_rate_id'
                . ' AND title_table.store_id = ?', $storeId),
            array('title' => 'value')
        );

        return $this;
    }

    /**
     * Joins store titles for rates
     *
     * @return Mage_Tax_Model_Resource_Calculation_Rate_Collection
     */
    public function joinStoreTitles()
    {
        $storeCollection =  Mage::app()->getStores(true);
        foreach ($storeCollection as $store) {
            $tableAlias    = sprintf('title_table_%s', $store->getId());
            $joinCondition = implode(' AND ', array(
                "main_table.tax_calculation_rate_id = {$tableAlias}.tax_calculation_rate_id",
                $this->getConnection()->quoteInto($tableAlias . '.store_id = ?', $store->getId())
            ));
            $this->_select->joinLeft(
                array($tableAlias => $this->getTable('tax/tax_calculation_rate_title')),
                $joinCondition,
                array($tableAlias => 'value')
            );
        }
        return $this;
    }

    /**
     * Add rate filter
     *
     * @param int $rateId
     * @return Mage_Tax_Model_Resource_Calculation_Rate_Collection
     */
    public function addRateFilter($rateId)
    {
        if (is_int($rateId) && $rateId > 0) {
            return $this->addFieldToFilter('main_table.tax_rate_id', $rateId);
        }

        return $this;
    }

    /**
     * Retrieve option array
     *
     * @return array
     */
    public function toOptionArray()
    {
        return $this->_toOptionArray('tax_calculation_rate_id', 'code');
    }

    /**
     * Retrieve option hash
     *
     * @return array
     */
    public function toOptionHash()
    {
        return $this->_toOptionHash('tax_calculation_rate_id', 'code');
    }

    /**
     * Convert items array to hash for select options
     * unsing fetchItem method
     *
     * @see     _toOptionHashOptimized()
     *
     * @return  array
     */
    public function toOptionHashOptimized()
    {
        return $this->_toOptionHashOptimized('tax_calculation_rate_id', 'code');
    }

    /**
     * Get rates array without memory leak
     *
     * @return array
     */
    public function getOptionRates()
    {
        $size = self::TAX_RULES_CHUNK_SIZE;
        $page = 1;
        $rates = array();
        do {
            $offset = $size * ($page - 1);
            $this->getSelect()->reset();
            $this->getSelect()
                ->from(
                    array('rates' => $this->getMainTable()),
                array('tax_calculation_rate_id', 'code'))
                ->limit($size, $offset);

            $rates = array_merge($rates, $this->toOptionArray());
            $this->clear();
            $page++;
        } while ($this->getSize() > $offset);

        return $rates;
    }
}


text:
package viper.util

import javax.swing.JLabel
import java.awt._
import java.awt.image.BufferedImage

abstract class AlphaCellRenderer extends JLabel {

  val selectionBackground: Color
  var selected: Boolean = false
  private val composite = AlphaComposite.getInstance(AlphaComposite.SRC, 0.5f)

  setOpaque(true)

  override def paintComponent(g: Graphics) {
    super.paintComponent(g)

    if (selected) {
      val image = new BufferedImage(getWidth, getHeight, BufferedImage.TYPE_INT_ARGB)
      val g2 = image.createGraphics()
      g2.setComposite(composite)
      g2.setColor(selectionBackground)
      g2.fillRect(0, 0, getWidth, getHeight)
      g2.dispose()
      g.drawImage(image, 0, 0, null)
    }
  }

  // Optimisations as in DefaultTableCellRenderer

  override def invalidate() { }
  override def validate() { }
  override def revalidate() { }
  override def repaint(tm: Long, x: Int, y: Int, width: Int, height: Int) { }
  override def repaint(r: Rectangle) { }
  override def repaint() { }
  override def firePropertyChange(propertyName: String, oldValue: Int, newValue: Int) { }

}


text:
'use strict';

const config = require('config');

exports.fromEnv = {
  HELLO() {
    return process.env.HELLO;
  }
};

exports.fromConfig = {
  hi() {
    return config.get('hi');
  },

  hello() {
    return config.get('hello');
  }
};


text:
{% from "macros/_form.html" import render_form %}

{% set page_title = 'Sign up' %}

{% extends "layouts/base.html" %}

{% block body %}

Sign up  | Login

{{ render_form(url_for('frontend.signup'), form) }}
{% endblock %}


text:
package org.radarbase.mock.model;

import java.util.List;
import org.apache.avro.Schema;
import org.radarbase.stream.collector.AggregateListCollector;

/**
 * {@code ExpectedValue} represented as {@code Double[]}.
 *
 * {@link ExpectedValue}
 */
public class ExpectedArrayValue extends ExpectedValue<AggregateListCollector> {
    /**
     * Constructor.
     */
    public ExpectedArrayValue(Schema valueSchema, List<String> valueFields) {
        super(valueSchema, valueFields);
    }

    @Override
    protected AggregateListCollector createCollector() {
        return new AggregateListCollector(fieldNames, schema, true);
    }
}


text:
__author__ = 'dimitrovdr'
from HTMLParser import HTMLParser

class WikipediaHTMLTableParser(HTMLParser):
    def __init__(self):
        HTMLParser.__init__(self)
        self.fed = []
        self.fed_text = None
        self.table_counter = 0

    def reset(self):
        self.fed = []
        self.fed_text = None
        self.table_counter = 0
        HTMLParser.reset(self)

    def feed(self, data):
        self.reset()
        HTMLParser.feed(self, data)

    def handle_starttag(self, tag, attrs):
        if tag == 'table':
            attrs_dict = dict(attrs)
            if not self.table_counter:
                self.fed.append('[[[TABLE_BEGIN]]]\n')
                if 'class' in attrs_dict.keys():
                    self.fed.append('[[[TABLE_CLASS_BEGIN]]]')
                    self.fed.append(attrs_dict['class'])
                    self.fed.append('[[[TABLE_CLASS_END]]]\n')
            self.table_counter += 1

    def handle_endtag(self, tag):
        if tag == 'table':
            if self.table_counter:
                self.table_counter -= 1
                if not self.table_counter:
                    self.fed.append('[[[TABLE_END]]]\n')

    def get_data(self):
        if self.fed_text is not None:
            return self.fed_text
        else:
            self.fed_text = ''.join(self.fed)
            return self.fed_text


text:
package consulo.xstylesheet.definition.value.impl;

import java.util.Collections;
import java.util.List;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupElementBuilder;

/**
 * @author VISTALL
 * @since 08.07.13.
 */
public class BaseNumberXStyleSheetValue extends TextBasedXStyleSheetPropertyValuePartParser
{
	private String[] myPrefixes;

	public BaseNumberXStyleSheetValue(@Nonnull String... prefixes)
	{
		myPrefixes = prefixes;
	}

	@Nullable
	@Override
	public Object fromString(@Nonnull String stringValue, String value)
	{
		if(value != null && !stringValue.equals(value))
		{
			return null;
		}

		String prefix = null;
		for(String t : myPrefixes)
		{
			if(stringValue.endsWith(t))
			{
				prefix = t;
				break;
			}
		}

		if(prefix == null && myPrefixes.length > 0)
		{
			return null;
		}
		else if(prefix != null)
		{
			stringValue = stringValue.substring(0, stringValue.length() - prefix.length());
		}

		try
		{
			return Integer.parseInt(stringValue);
		}
		catch(NumberFormatException e)
		{
			//
		}
		return null;
	}

	@Nonnull
	@Override
	public List<LookupElement> getLookupElements(String value)
	{
		LookupElementBuilder builder = LookupElementBuilder.create(value);
		return Collections.<LookupElement>singletonList(builder);
	}
}


text:
from . import equipmentslot, baseequipment

class Armor(baseequipment.Equipment):
    def __init__(self, name, armor_bonus, equipment_slot=equipmentslot.EquipmentSlot.CHEST):
        super().__init__(name, equipment_slot)
        self.armor_bonus = armor_bonus

    def compute_normal_armor_class(self):
        return self.armor_bonus


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace Threax.ModelGen.ModelWriters
{
    class NullValueLabelAttributeBuilder : AttributeBuilderChain
    {
        public NullValueLabelAttributeBuilder(IAttributeBuilder next = null) : base(next)
        {
        }

        public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = "        ")
        {
            var nullValue = prop.NullValueLabel;
            if (!String.IsNullOrEmpty(nullValue))
            {
                sb.AppendLine(GetAttr(nullValue, spaces));
            }
            base.BuildAttributes(sb, name, prop, spaces);
        }

        public static String GetAttr(String nullValue, String spaces)
        {
            return $@"{spaces}[NullValueLabel(""{nullValue}"")]";
        }
    }
}


text:
layout: docs
title: Carousel
description: A slideshow component for cycling through elements—images or slides of text—like a carousel.
group: components
toc: true
---

## How it works

The carousel is a slideshow for cycling through a series of content, built with CSS 3D transforms and a bit of JavaScript. It works with a series of images, text, or custom markup. It also includes support for previous/next controls and indicators.

In browsers where the [Page Visibility API](https://www.w3.org/TR/page-visibility/) is supported, the carousel will avoid sliding when the webpage is not visible to the user (such as when the browser tab is inactive, the browser window is minimized, etc.).

{{< callout info >}}
{{< partial "callout-info-prefersreducedmotion.md" >}}
{{< /callout >}}

Please be aware that nested carousels are not supported, and carousels are generally not compliant with accessibility standards.

## Example

Carousels don't automatically normalize slide dimensions. As such, you may need to use additional utilities or custom styles to appropriately size content. While carousels support previous/next controls and indicators, they're not explicitly required. Add and customize as you see fit.

**The `.active` class needs to be added to one of the slides** otherwise the carousel will not be visible. Also be sure to set a unique `id` on the `.carousel` for optional controls, especially if you're using multiple carousels on a single page. Control and indicator elements must have a `data-bs-target` attribute (or `href` for links) that matches the `id` of the `.carousel` element.

### Slides only

Here's a carousel with slides only. Note the presence of the `.d-block` and `.w-100` on carousel images to prevent browser default image alignment.

{{< example >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}

{{< /example >}}

### With controls

Adding in the previous and next controls. We recommend using `<button>` elements, but you can also use `<a>` elements with `role="button"`.

{{< example >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}

  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev">

    Previous
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next">

    Next
  </button>

{{< /example >}}

### With indicators

You can also add the indicators to the carousel, alongside the controls, too.

{{< example >}}

    <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
    <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
    <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}

  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">

    Previous
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="next">

    Next
  </button>

{{< /example >}}

### With captions

Add captions to your slides easily with the `.carousel-caption` element within any `.carousel-item`. They can be easily hidden on smaller viewports, as shown below, with optional [display utilities]({{< docsref "/utilities/display" >}}). We hide them initially with `.d-none` and bring them back on medium-sized devices with `.d-md-block`.

{{< example >}}

    <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
    <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1" aria-label="Slide 2"></button>
    <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2" aria-label="Slide 3"></button>

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}

First slide label

Some representative placeholder content for the first slide.

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}

Second slide label

Some representative placeholder content for the second slide.

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}

Third slide label

Some representative placeholder content for the third slide.

  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">

    Previous
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">

    Next
  </button>

{{< /example >}}

### Crossfade

Add `.carousel-fade` to your carousel to animate slides with a fade transition instead of a slide. Depending on your carousel content (e.g., text only slides), you may want to add `.bg-body` or some custom CSS to the `.carousel-item`s for proper crossfading.

{{< example >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}

  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="prev">

    Previous
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="next">

    Next
  </button>

{{< /example >}}

### Individual `.carousel-item` interval

Add `data-bs-interval=""` to a `.carousel-item` to change the amount of time to delay between automatically cycling to the next item.

{{< example >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}

  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleInterval" data-bs-slide="prev">

    Previous
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleInterval" data-bs-slide="next">

    Next
  </button>

{{< /example >}}

### Disable touch swiping

Carousels support swiping left/right on touchscreen devices to move between slides. This can be disabled using the `data-bs-touch` attribute. The example below also does not include the `data-bs-ride` attribute so it doesn't autoplay.

{{< example >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}

  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControlsNoTouching" data-bs-slide="prev">

    Previous
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControlsNoTouching" data-bs-slide="next">

    Next
  </button>

{{< /example >}}

## Dark variant

Add `.carousel-dark` to the `.carousel` for darker controls, indicators, and captions. Controls have been inverted from their default white fill with the `filter` CSS property. Captions and controls have additional Sass variables that customize the `color` and `background-color`.

{{< example >}}

    <button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
    <button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="1" aria-label="Slide 2"></button>
    <button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="2" aria-label="Slide 3"></button>

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#aaa" background="#f5f5f5" text="First slide" >}}

First slide label

Some representative placeholder content for the first slide.

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#bbb" background="#eee" text="Second slide" >}}

Second slide label

Some representative placeholder content for the second slide.

      {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#999" background="#e5e5e5" text="Third slide" >}}

Third slide label

Some representative placeholder content for the third slide.

  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleDark" data-bs-slide="prev">

    Previous
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleDark" data-bs-slide="next">

    Next
  </button>

{{< /example >}}

## Custom transition

The transition duration of `.carousel-item` can be changed with the `$carousel-transition-duration` Sass variable before compiling or custom styles if you're using the compiled CSS. If multiple transitions are applied, make sure the transform transition is defined first (eg. `transition: transform 2s ease, opacity .5s ease-out`).

## Sass

### Variables

{{< scss-docs name="carousel-variables" file="scss/_variables.scss" >}}

## Usage

### Via data attributes

Use data attributes to easily control the position of the carousel. `data-bs-slide` accepts the keywords `prev` or `next`, which alters the slide position relative to its current position. Alternatively, use `data-bs-slide-to` to pass a raw slide index to the carousel `data-bs-slide-to="2"`, which shifts the slide position to a particular index beginning with `0`.

The `data-bs-ride="carousel"` attribute is used to mark a carousel as animating starting at page load. If you don't use `data-bs-ride="carousel"` to initialize your carousel, you have to initialize it yourself. **It cannot be used in combination with (redundant and unnecessary) explicit JavaScript initialization of the same carousel.**

### Via JavaScript

Call carousel manually with:

```js
const carousel = new bootstrap.Carousel('#myCarousel')
```

### Options

{{< markdown >}}
{{< partial "js-data-attributes.md" >}}
{{< /markdown >}}

{{< bs-table >}}
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `interval` | number | `5000` | The amount of time to delay between automatically cycling an item. |
| `keyboard` | boolean | `true` | Whether the carousel should react to keyboard events. |
| `pause` | string, boolean | `"hover"` | If set to `"hover"`, pauses the cycling of the carousel on `mouseenter` and resumes the cycling of the carousel on `mouseleave`. If set to `false`, hovering over the carousel won't pause it. On touch-enabled devices, when set to `"hover"`, cycling will pause on `touchend` (once the user finished interacting with the carousel) for two intervals, before automatically resuming. This is in addition to the mouse behavior. |
| `ride` | string, boolean | `false` | If set to `true`, autoplays the carousel after the user manually cycles the first item. If set to `"carousel"`, autoplays the carousel on load. |
| `touch` | boolean | `true` | Whether the carousel should support left/right swipe interactions on touchscreen devices. |
| `wrap` | boolean | `true` | Whether the carousel should cycle continuously or have hard stops. |
{{< /bs-table >}}

### Methods

{{< callout danger >}}
{{< partial "callout-danger-async-methods.md" >}}
{{< /callout >}}

You can create a carousel instance with the carousel constructor, for example, to initialize with additional options and start cycling through items:

```js
const myCarouselElement = document.querySelector('#myCarousel')
const carousel = new bootstrap.Carousel(myCarouselElement, {
  interval: 2000,
  wrap: false
})
```

{{< bs-table >}}
| Method | Description |
| --- | --- |
| `cycle` | Cycles through the carousel items from left to right. |
| `dispose` | Destroys an element's carousel. (Removes stored data on the DOM element) |
| `getInstance` | Static method which allows you to get the carousel instance associated to a DOM element, you can use it like this: `bootstrap.Carousel.getInstance(element)` |
| `getOrCreateInstance` | Static method which returns a carousel instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Carousel.getOrCreateInstance(element)` |
| `next` | Cycles to the next item. **Returns to the caller before the next item has been shown** (e.g., before the `slid.bs.carousel` event occurs). |
| `nextWhenVisible` | Don't cycle carousel to next when the page isn't visible or the carousel or its parent isn't visible. **Returns to the caller before the target item has been shown** |
| `pause` | Stops the carousel from cycling through items. |
| `prev` | Cycles to the previous item. **Returns to the caller before the previous item has been shown** (e.g., before the `slid.bs.carousel` event occurs). |
| `to` | Cycles the carousel to a particular frame (0 based, similar to an array). **Returns to the caller before the target item has been shown** (e.g., before the `slid.bs.carousel` event occurs). |
{{< /bs-table >}}

### Events

Bootstrap's carousel class exposes two events for hooking into carousel functionality. Both events have the following additional properties:

- `direction`: The direction in which the carousel is sliding (either `"left"` or `"right"`).
- `relatedTarget`: The DOM element that is being slid into place as the active item.
- `from`: The index of the current item
- `to`: The index of the next item

All carousel events are fired at the carousel itself (i.e. at the `<div class="carousel">`).

{{< bs-table >}}
| Event type | Description |
| --- | --- |
| `slid.bs.carousel` | Fired when the carousel has completed its slide transition. |
| `slide.bs.carousel` | Fires immediately when the `slide` instance method is invoked. |
{{< /bs-table >}}

```js
const myCarousel = document.getElementById('myCarousel')

myCarousel.addEventListener('slide.bs.carousel', event => {
  // do something...
})
```


text:
package com.magnet.mmx.protocol;

import java.util.List;

import com.google.gson.annotations.SerializedName;

/**
 * Encapsulates the search actions when performing
 * searches on users or topics.
 */
public class SearchAction {
  /**
   * Logical operator among the search attributes.
   */
  public static enum Operator {
    AND,
    OR,
  }

  /**
   * Value matching operation: exact match, wild-card in the prefix, wild-card
   * in the suffix.
   */
  public static enum Match {
    EXACT,
    PREFIX,
    SUFFIX,
  }

  /**
   * @hide
   */
  public static class SingleValue {
    @SerializedName("match")
    private Match mMatch;
    @SerializedName("value")
    private String mValue;

    public SingleValue(String value, Match matchType) {
      mValue = value;
      mMatch = matchType;
    }

    public Match getMatch() {
      return mMatch;
    }

    public String getValue() {
      return mValue;
    }
  }

  /**
   * @hide
   */
  public static class MultiValues {
    @SerializedName("match")
    private Match mMatch;
    @SerializedName("values")
    private List<String> mValues;

    public MultiValues(List<String> values, Match matchType) {
      mValues = values;
      mMatch = matchType;
    }

    public Match getMatch() {
      return mMatch;
    }

    public List<String> getValues() {
      return mValues;
    }
  }
}


text:
<!--L
   Copyright Washington University in St. Louis
   Copyright SemanticBits
   Copyright Persistent Systems
   Copyright Krishagni

   Distributed under the OSI-approved BSD 3-Clause License.
   See http://ncip.github.com/catissue-security-manager/LICENSE.txt for details.
L-->

		        <mapping resource="gov/nih/nci/security/authorization/domainobjects/Privilege.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/authorization/domainobjects/Application.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/authorization/domainobjects/Role.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/dao/hibernate/RolePrivilege.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/dao/hibernate/UserGroup.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/dao/hibernate/ProtectionGroupProtectionElement.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/authorization/domainobjects/Group.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/authorization/domainobjects/User.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/authorization/domainobjects/ProtectionGroup.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/authorization/domainobjects/ProtectionElement.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/authorization/domainobjects/UserGroupRoleProtectionGroup.hbm.xml"/>
        <mapping resource="gov/nih/nci/security/authorization/domainobjects/UserProtectionElement.hbm.xml"/>


text:
<?php

namespace Omnipay\AuthorizeNet\Message;

use Omnipay\Tests\TestCase;

class AIMPurchaseRequestTest extends TestCase
{
    public function setUp()
    {
        $this->request = new AIMPurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
        $this->request->initialize(
            array(
                'clientIp' => '10.0.0.1',
                'amount' => '12.00',
                'customerId' => 'cust-id',
                'card' => $this->getValidCard(),
            )
        );
    }

    public function testGetData()
    {
        $data = $this->request->getData();

        $this->assertSame('AUTH_CAPTURE', $data['x_type']);
        $this->assertSame('10.0.0.1', $data['x_customer_ip']);
        $this->assertSame('cust-id', $data['x_cust_id']);
        $this->assertArrayNotHasKey('x_test_request', $data);
    }
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v10/common/bidding.proto

package com.google.ads.googleads.v10.common;

/**
 *

 * An automated bidding strategy to help get the most conversion value for your
 * campaigns while spending your budget.
 *

 *
 * Protobuf type {@code google.ads.googleads.v10.common.MaximizeConversionValue}
 */
public final class MaximizeConversionValue extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.ads.googleads.v10.common.MaximizeConversionValue)
    MaximizeConversionValueOrBuilder {
private static final long serialVersionUID = 0L;
  // Use MaximizeConversionValue.newBuilder() to construct.
  private MaximizeConversionValue(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private MaximizeConversionValue() {
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new MaximizeConversionValue();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.ads.googleads.v10.common.BiddingProto.internal_static_google_ads_googleads_v10_common_MaximizeConversionValue_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.ads.googleads.v10.common.BiddingProto.internal_static_google_ads_googleads_v10_common_MaximizeConversionValue_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.ads.googleads.v10.common.MaximizeConversionValue.class, com.google.ads.googleads.v10.common.MaximizeConversionValue.Builder.class);
  }

  public static final int TARGET_ROAS_FIELD_NUMBER = 2;
  private double targetRoas_;
  /**
   *

   * The target return on ad spend (ROAS) option. If set, the bid strategy will
   * maximize revenue while averaging the target return on ad spend. If the
   * target ROAS is high, the bid strategy may not be able to spend the full
   * budget. If the target ROAS is not set, the bid strategy will aim to
   * achieve the highest possible ROAS for the budget.
   *

   *
   * double target_roas = 2;
   * @return The targetRoas.
   */
  @java.lang.Override
  public double getTargetRoas() {
    return targetRoas_;
  }

  public static final int CPC_BID_CEILING_MICROS_FIELD_NUMBER = 3;
  private long cpcBidCeilingMicros_;
  /**
   *

   * Maximum bid limit that can be set by the bid strategy.
   * The limit applies to all keywords managed by the strategy.
   * Mutable for portfolio bidding strategies only.
   *

   *
   * int64 cpc_bid_ceiling_micros = 3;
   * @return The cpcBidCeilingMicros.
   */
  @java.lang.Override
  public long getCpcBidCeilingMicros() {
    return cpcBidCeilingMicros_;
  }

  public static final int CPC_BID_FLOOR_MICROS_FIELD_NUMBER = 4;
  private long cpcBidFloorMicros_;
  /**
   *

   * Minimum bid limit that can be set by the bid strategy.
   * The limit applies to all keywords managed by the strategy.
   * Mutable for portfolio bidding strategies only.
   *

   *
   * int64 cpc_bid_floor_micros = 4;
   * @return The cpcBidFloorMicros.
   */
  @java.lang.Override
  public long getCpcBidFloorMicros() {
    return cpcBidFloorMicros_;
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (java.lang.Double.doubleToRawLongBits(targetRoas_) != 0) {
      output.writeDouble(2, targetRoas_);
    }
    if (cpcBidCeilingMicros_ != 0L) {
      output.writeInt64(3, cpcBidCeilingMicros_);
    }
    if (cpcBidFloorMicros_ != 0L) {
      output.writeInt64(4, cpcBidFloorMicros_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (java.lang.Double.doubleToRawLongBits(targetRoas_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(2, targetRoas_);
    }
    if (cpcBidCeilingMicros_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(3, cpcBidCeilingMicros_);
    }
    if (cpcBidFloorMicros_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(4, cpcBidFloorMicros_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.ads.googleads.v10.common.MaximizeConversionValue)) {
      return super.equals(obj);
    }
    com.google.ads.googleads.v10.common.MaximizeConversionValue other = (com.google.ads.googleads.v10.common.MaximizeConversionValue) obj;

    if (java.lang.Double.doubleToLongBits(getTargetRoas())
        != java.lang.Double.doubleToLongBits(
            other.getTargetRoas())) return false;
    if (getCpcBidCeilingMicros()
        != other.getCpcBidCeilingMicros()) return false;
    if (getCpcBidFloorMicros()
        != other.getCpcBidFloorMicros()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + TARGET_ROAS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getTargetRoas()));
    hash = (37 * hash) + CPC_BID_CEILING_MICROS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getCpcBidCeilingMicros());
    hash = (37 * hash) + CPC_BID_FLOOR_MICROS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getCpcBidFloorMicros());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.ads.googleads.v10.common.MaximizeConversionValue parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.ads.googleads.v10.common.MaximizeConversionValue prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *

   * An automated bidding strategy to help get the most conversion value for your
   * campaigns while spending your budget.
   *

   *
   * Protobuf type {@code google.ads.googleads.v10.common.MaximizeConversionValue}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.ads.googleads.v10.common.MaximizeConversionValue)
      com.google.ads.googleads.v10.common.MaximizeConversionValueOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.ads.googleads.v10.common.BiddingProto.internal_static_google_ads_googleads_v10_common_MaximizeConversionValue_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.ads.googleads.v10.common.BiddingProto.internal_static_google_ads_googleads_v10_common_MaximizeConversionValue_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.ads.googleads.v10.common.MaximizeConversionValue.class, com.google.ads.googleads.v10.common.MaximizeConversionValue.Builder.class);
    }

    // Construct using com.google.ads.googleads.v10.common.MaximizeConversionValue.newBuilder()
    private Builder() {

    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);

    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      targetRoas_ = 0D;

      cpcBidCeilingMicros_ = 0L;

      cpcBidFloorMicros_ = 0L;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.ads.googleads.v10.common.BiddingProto.internal_static_google_ads_googleads_v10_common_MaximizeConversionValue_descriptor;
    }

    @java.lang.Override
    public com.google.ads.googleads.v10.common.MaximizeConversionValue getDefaultInstanceForType() {
      return com.google.ads.googleads.v10.common.MaximizeConversionValue.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.ads.googleads.v10.common.MaximizeConversionValue build() {
      com.google.ads.googleads.v10.common.MaximizeConversionValue result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.ads.googleads.v10.common.MaximizeConversionValue buildPartial() {
      com.google.ads.googleads.v10.common.MaximizeConversionValue result = new com.google.ads.googleads.v10.common.MaximizeConversionValue(this);
      result.targetRoas_ = targetRoas_;
      result.cpcBidCeilingMicros_ = cpcBidCeilingMicros_;
      result.cpcBidFloorMicros_ = cpcBidFloorMicros_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.ads.googleads.v10.common.MaximizeConversionValue) {
        return mergeFrom((com.google.ads.googleads.v10.common.MaximizeConversionValue)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.ads.googleads.v10.common.MaximizeConversionValue other) {
      if (other == com.google.ads.googleads.v10.common.MaximizeConversionValue.getDefaultInstance()) return this;
      if (other.getTargetRoas() != 0D) {
        setTargetRoas(other.getTargetRoas());
      }
      if (other.getCpcBidCeilingMicros() != 0L) {
        setCpcBidCeilingMicros(other.getCpcBidCeilingMicros());
      }
      if (other.getCpcBidFloorMicros() != 0L) {
        setCpcBidFloorMicros(other.getCpcBidFloorMicros());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 17: {
              targetRoas_ = input.readDouble();

              break;
            } // case 17
            case 24: {
              cpcBidCeilingMicros_ = input.readInt64();

              break;
            } // case 24
            case 32: {
              cpcBidFloorMicros_ = input.readInt64();

              break;
            } // case 32
            default: {
              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                done = true; // was an endgroup tag
              }
              break;
            } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private double targetRoas_ ;
    /**
     *

     * The target return on ad spend (ROAS) option. If set, the bid strategy will
     * maximize revenue while averaging the target return on ad spend. If the
     * target ROAS is high, the bid strategy may not be able to spend the full
     * budget. If the target ROAS is not set, the bid strategy will aim to
     * achieve the highest possible ROAS for the budget.
     *

     *
     * double target_roas = 2;
     * @return The targetRoas.
     */
    @java.lang.Override
    public double getTargetRoas() {
      return targetRoas_;
    }
    /**
     *

     * The target return on ad spend (ROAS) option. If set, the bid strategy will
     * maximize revenue while averaging the target return on ad spend. If the
     * target ROAS is high, the bid strategy may not be able to spend the full
     * budget. If the target ROAS is not set, the bid strategy will aim to
     * achieve the highest possible ROAS for the budget.
     *

     *
     * double target_roas = 2;
     * @param value The targetRoas to set.
     * @return This builder for chaining.
     */
    public Builder setTargetRoas(double value) {

      targetRoas_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * The target return on ad spend (ROAS) option. If set, the bid strategy will
     * maximize revenue while averaging the target return on ad spend. If the
     * target ROAS is high, the bid strategy may not be able to spend the full
     * budget. If the target ROAS is not set, the bid strategy will aim to
     * achieve the highest possible ROAS for the budget.
     *

     *
     * double target_roas = 2;
     * @return This builder for chaining.
     */
    public Builder clearTargetRoas() {

      targetRoas_ = 0D;
      onChanged();
      return this;
    }

    private long cpcBidCeilingMicros_ ;
    /**
     *

     * Maximum bid limit that can be set by the bid strategy.
     * The limit applies to all keywords managed by the strategy.
     * Mutable for portfolio bidding strategies only.
     *

     *
     * int64 cpc_bid_ceiling_micros = 3;
     * @return The cpcBidCeilingMicros.
     */
    @java.lang.Override
    public long getCpcBidCeilingMicros() {
      return cpcBidCeilingMicros_;
    }
    /**
     *

     * Maximum bid limit that can be set by the bid strategy.
     * The limit applies to all keywords managed by the strategy.
     * Mutable for portfolio bidding strategies only.
     *

     *
     * int64 cpc_bid_ceiling_micros = 3;
     * @param value The cpcBidCeilingMicros to set.
     * @return This builder for chaining.
     */
    public Builder setCpcBidCeilingMicros(long value) {

      cpcBidCeilingMicros_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Maximum bid limit that can be set by the bid strategy.
     * The limit applies to all keywords managed by the strategy.
     * Mutable for portfolio bidding strategies only.
     *

     *
     * int64 cpc_bid_ceiling_micros = 3;
     * @return This builder for chaining.
     */
    public Builder clearCpcBidCeilingMicros() {

      cpcBidCeilingMicros_ = 0L;
      onChanged();
      return this;
    }

    private long cpcBidFloorMicros_ ;
    /**
     *

     * Minimum bid limit that can be set by the bid strategy.
     * The limit applies to all keywords managed by the strategy.
     * Mutable for portfolio bidding strategies only.
     *

     *
     * int64 cpc_bid_floor_micros = 4;
     * @return The cpcBidFloorMicros.
     */
    @java.lang.Override
    public long getCpcBidFloorMicros() {
      return cpcBidFloorMicros_;
    }
    /**
     *

     * Minimum bid limit that can be set by the bid strategy.
     * The limit applies to all keywords managed by the strategy.
     * Mutable for portfolio bidding strategies only.
     *

     *
     * int64 cpc_bid_floor_micros = 4;
     * @param value The cpcBidFloorMicros to set.
     * @return This builder for chaining.
     */
    public Builder setCpcBidFloorMicros(long value) {

      cpcBidFloorMicros_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Minimum bid limit that can be set by the bid strategy.
     * The limit applies to all keywords managed by the strategy.
     * Mutable for portfolio bidding strategies only.
     *

     *
     * int64 cpc_bid_floor_micros = 4;
     * @return This builder for chaining.
     */
    public Builder clearCpcBidFloorMicros() {

      cpcBidFloorMicros_ = 0L;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.ads.googleads.v10.common.MaximizeConversionValue)
  }

  // @@protoc_insertion_point(class_scope:google.ads.googleads.v10.common.MaximizeConversionValue)
  private static final com.google.ads.googleads.v10.common.MaximizeConversionValue DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.ads.googleads.v10.common.MaximizeConversionValue();
  }

  public static com.google.ads.googleads.v10.common.MaximizeConversionValue getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<MaximizeConversionValue>
      PARSER = new com.google.protobuf.AbstractParser<MaximizeConversionValue>() {
    @java.lang.Override
    public MaximizeConversionValue parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      Builder builder = newBuilder();
      try {
        builder.mergeFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(builder.buildPartial());
      } catch (com.google.protobuf.UninitializedMessageException e) {
        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(e)
            .setUnfinishedMessage(builder.buildPartial());
      }
      return builder.buildPartial();
    }
  };

  public static com.google.protobuf.Parser<MaximizeConversionValue> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<MaximizeConversionValue> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.ads.googleads.v10.common.MaximizeConversionValue getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


text:
package kr.ac.kaist.jsaf.clone_refactor.model;

public abstract class AbstractModel {
	protected AbstractModel parent;
	protected IDeltaListener listener = NullDeltaListener.getSoleInstance();

	protected void fireAdd(Object added) {
		listener.add(new DeltaEvent(added));
	}

	protected void fireRemove(Object removed) {
		listener.remove(new DeltaEvent(removed));
	}

	public AbstractModel getParent() {
		return parent;
	}

	/*
	 * The receiver should visit the toVisit object and pass along the argument.
	 */
	public abstract void accept(IModelVisitor visitor, Object passAlongArgument);

	public void addListener(IDeltaListener listener) {
		this.listener = listener;
	}

	public AbstractModel() {
	}

	public void removeListener(IDeltaListener listener) {
		if (this.listener.equals(listener)) {
			this.listener = NullDeltaListener.getSoleInstance();
		}
	}
}


text:
using UnrealBuildTool;

public class CodeBlue : ModuleRules
{
	public CodeBlue(ReadOnlyTargetRules Target):base(Target)
	{
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "AIModule", "GameplayTasks", "DatabaseSQLite" });

		PrivateDependencyModuleNames.AddRange(new string[] { "UMG" });
        // Uncomment if you are using Slate UI
        // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

        // Uncomment if you are using online features
        // PrivateDependencyModuleNames.Add("OnlineSubsystem");

        // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
    }
}


text:
({
    changePage:function(component,domEvent,helper){
        var pageInput = component.find("pager:pageInput").getElement();
        var targetPage = parseInt(pageInput.value, 10);

        if (isNaN(targetPage) || targetPage<1 || targetPage > component.get("v.pageCount")) {
            // Reset currentPage visualization
            pageInput.value=component.get("v.currentPage");
            return;
        }

        helper.changePage(component,targetPage,domEvent);
    }
})


text:
let toggleTheme = (theme) => {
  if (theme == "dark") {
    setTheme("light");
  } else {
    setTheme("dark");
  }
}

let setTheme = (theme) =>  {
  transTheme();
  setHighlight(theme);

  if (theme) {
    document.documentElement.setAttribute("data-theme", theme);
  }
  else {
    document.documentElement.removeAttribute("data-theme");
  }
  localStorage.setItem("theme", theme);

  // Updates the background of medium-zoom overlay.
  if (typeof medium_zoom !== 'undefined') {
    medium_zoom.update({
      background: getComputedStyle(document.documentElement)
          .getPropertyValue('--global-bg-color') + 'ee',  // + 'ee' for trasparency.
    })
  }
};

let setHighlight = (theme) => {
  if (theme == "dark") {
    document.getElementById("highlight_theme_light").media = "none";
    document.getElementById("highlight_theme_dark").media = "";
  } else {
    document.getElementById("highlight_theme_dark").media = "none";
    document.getElementById("highlight_theme_light").media = "";
  }
}

let transTheme = () => {
  document.documentElement.classList.add("transition");
  window.setTimeout(() => {
    document.documentElement.classList.remove("transition");
  }, 500)
}

let initTheme = (theme) => {
  if (theme == null) {
    const userPref = window.matchMedia;
    if (userPref && userPref('(prefers-color-scheme: dark)').matches) {
        theme = 'dark';
    }
  }
  setTheme(theme);
}

initTheme(localStorage.getItem("theme"));


text:
Geolocation utilities.

Dependencies:

- [jQuery](http://jquery.com/download/)

In browser:

```html
<script src="scripts/libs/jquery.js"></script>
<script src="scripts/libs/ds-frontend/scripts/utils/geo.js"></script>
<script>
    ds.utils.geo;
</script>
```

With browserify:

```js
var geo = require('ds-frontend/scripts/utils/geo');
```

- [`#.clientLocation`](#clientlocation)
- [`#.distance`](#distancefromcoords-tocoords)
- [`#.kmToMiles`](#kmtomileskm-decimals)

## `#.clientLocation()`

Get clients location using the html5 API. If native API is not supported it
falls back to geolocation based on ip address.

### Returns

`Promise` (jQuery deffered): If resolved the Promise return a coordinate
consisting of `latitude` and `longitude`.

### Example

```js
ds.utils.geo.clientLocation()
    .done(function(coords) {
        coords; // => {latitude: 56.00, longitude: 45.00}
    })
```

## `#.distance(fromCoords, toCoords)`

Calculate the distance between two geopositions in kilometers.

| Name | Type | Description |
| --- | --- | --- |
| `fromCoords` | object |  |
| - `fromCoords.latitude` | number |  |
| - `fromCoords.longitude` | number |  |
| `toCoords` | object |  |
| - `toCoords.latitude` | number |  |
| - `toCoords.longitude` | number |  |

### Returns

`Number`: The distance in km.

### Example

```js
var from = {
    latitude: 56.00,
    longitude: 10.00
};
var to = {
    latitude: 46.00,
    longitude: 20.00
};
ds.utils.geo.distance(from, to); // => 1310.062581460199
```

## `#.kmToMiles(km, [decimals])`

Calculate the distance between two geopositions in kilometers.

| Name | Type | Description |
| --- | --- | --- |
| `km` | Number, String | A number or a string formatted as a number |
| `decimals` | Number, String | How many decimals should be rounded to. Default to `2` |

### Returns

`String`: The calculated distance

### Example

```js
ds.utils.geo.kmToMiles(10); // => '6.21'
ds.utils.geo.kmToMiles(10, 5); // => '6.21371'
```


text:
Tools for reading and exporting source engine file formats. Also includes a web server to browse files / view maps.

![](http://files.facepunch.com/ziks/2017/March/06/chrome_2017-03-06_23-33-21.jpg)

## Untextured Demos

* [Mirage](https://metapyziks.github.io/SourceUtils/maps/de_mirage/)
* [Cobble](https://metapyziks.github.io/SourceUtils/maps/de_cbble/)
* [Overpass](https://metapyziks.github.io/SourceUtils/maps/de_overpass/)
* [Nuke](https://metapyziks.github.io/SourceUtils/maps/de_nuke/)
* [Inferno](https://metapyziks.github.io/SourceUtils/maps/de_inferno/)


text:
#include "settingsprovider.h"
#include "testtools.h"

namespace MoodBox
{

using namespace Velasquez;

ToolSettingsBar::ToolSettingsBar(QWidget *parent)
	: QWidget(parent), settings(NULL)
{
	TimeMeasure t("ToolSettingsBar");

	setSettingsProvider(new SettingsProvider(this));
}

void ToolSettingsBar::setSettingsProvider(Velasquez::SettingsProvider *settings)
{
	if (this->settings == settings)
		return;

	if (this->settings != NULL)
		disconnect(this->settings, SIGNAL(settingChanged(qint32)), this, SLOT(onSettingChanged(qint32)));

	this->settings = settings;

	if (this->settings != NULL)
		connect(this->settings, SIGNAL(settingChanged(qint32)), this, SLOT(onSettingChanged(qint32)));
}

void ToolSettingsBar::updateSetting(qint32 id)
{
	Q_UNUSED(id)
}

void ToolSettingsBar::onSettingChanged(qint32 id)
{
	updateSetting(id);
}

}


text:
package parser

import "fmt"

type Type struct {
	Name      string
	KeyType   *Type // If map
	ValueType *Type // If map, list, or set
}

type EnumValue struct {
	Name  string
	Value int
}

type Enum struct {
	Name   string
	Values map[string]*EnumValue
}

type Constant struct {
	Name  string
	Type  *Type
	Value interface{}
}

type Field struct {
	ID       int
	Name     string
	Optional bool
	Type     *Type
	Default  interface{}
}

type Struct struct {
	Name   string
	Fields []*Field
}

type Method struct {
	Comment    string
	Name       string
	Oneway     bool
	ReturnType *Type
	Arguments  []*Field
	Exceptions []*Field
}

type Service struct {
	Name    string
	Extends string
	Methods map[string]*Method
}

type Thrift struct {
	Includes   map[string]string // name -> unique identifier (absolute path generally)
	Typedefs   map[string]*Type
	Namespaces map[string]string
	Constants  map[string]*Constant
	Enums      map[string]*Enum
	Structs    map[string]*Struct
	Exceptions map[string]*Struct
	Unions     map[string]*Struct
	Services   map[string]*Service
}

type Identifier string

type KeyValue struct {
	Key, Value interface{}
}

func (t *Type) String() string {
	switch t.Name {
	case "map":
		return fmt.Sprintf("map<%s,%s>", t.KeyType.String(), t.ValueType.String())
	case "list":
		return fmt.Sprintf("list<%s>", t.ValueType.String())
	case "set":
		return fmt.Sprintf("set<%s>", t.ValueType.String())
	}
	return t.Name
}


text:
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM

#define EIGEN_USE_GPU

#include "tensorflow/core/kernels/scatter_functor_gpu.cu.h"

namespace tensorflow {

typedef Eigen::GpuDevice GPUDevice;

#define DEFINE_GPU_SPECS_OP(T, Index, op)                           \
  template struct functor::ScatterFunctor<GPUDevice, T, Index, op>; \
  template struct functor::ScatterScalarFunctor<GPUDevice, T, Index, op>;

#define DEFINE_GPU_SPECS_INDEX(T, Index)                       \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::ASSIGN); \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::ADD);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::SUB);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::MUL);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::DIV);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::MIN);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::MAX);

#define DEFINE_GPU_SPECS(T)         \
  DEFINE_GPU_SPECS_INDEX(T, int32); \
  DEFINE_GPU_SPECS_INDEX(T, int64);

DEFINE_GPU_SPECS(Eigen::half);
DEFINE_GPU_SPECS(float);
DEFINE_GPU_SPECS(double);
DEFINE_GPU_SPECS_OP(bool, int32, scatter_op::UpdateOp::ASSIGN);
DEFINE_GPU_SPECS_OP(bool, int64, scatter_op::UpdateOp::ASSIGN);

#undef DEFINE_GPU_SPECS
#undef DEFINE_GPU_SPECS_INDEX
#undef DEFINE_GPU_SPECS_OP

}  // namespace tensorflow

#endif  // GOOGLE_CUDA || TENSORFLOW_USE_ROCM


text:
EmptyMapIterator.java

1

17

package org.apache.commons.collections4.iterators;

18

19

import org.apache.commons.collections4.MapIterator;

20

import org.apache.commons.collections4.ResettableIterator;

21

22

/**

23

 * Provides an implementation of an empty map iterator.

24

 *

25

 * @since 3.1

26

 * @version $Id: EmptyMapIterator.java 1543955 2013-11-20 21:23:53Z tn $

27

 */

28

public class EmptyMapIterator<K, V> extends AbstractEmptyMapIterator<K, V> implements

29

        MapIterator<K, V>, ResettableIterator<K> {

30

31

    /**

32

     * Singleton instance of the iterator.

33

     * @since 3.1

34

     */

35

    @SuppressWarnings("rawtypes")

36

    public static final MapIterator INSTANCE = new EmptyMapIterator<Object, Object>();

37

38

    /**

39

     * Get a typed instance of the iterator.

40

     * @param <K> the key type

41

     * @param <V> the value type

42

     * @return {@link MapIterator}<K, V>

43

     */

44

    @SuppressWarnings("unchecked")

45

    public static <K, V> MapIterator<K, V> emptyMapIterator() {

46

1

1. emptyMapIterator : mutated return of Object value for org/apache/commons/collections4/iterators/EmptyMapIterator::emptyMapIterator to ( if (x != null) null else throw new RuntimeException ) → KILLED

        return (MapIterator<K, V>) INSTANCE;

47

    }

48

49

    /**

50

     * Constructor.

51

     */

52

    protected EmptyMapIterator() {

53

        super();

54

    }

55

56

}

Mutations

46

1.1
Location : emptyMapIterator
Killed by : org.apache.commons.collections4.set.MapBackedSetTest.testSimpleSerialization(org.apache.commons.collections4.set.MapBackedSetTest) mutated return of Object value for org/apache/commons/collections4/iterators/EmptyMapIterator::emptyMapIterator to ( if (x != null) null else throw new RuntimeException ) → KILLED

Active mutators

INCREMENTS_MUTATOR

CONDITIONALS_BOUNDARY_MUTATOR

RETURN_VALS_MUTATOR

VOID_METHOD_CALL_MUTATOR

INVERT_NEGS_MUTATOR

MATH_MUTATOR

NEGATE_CONDITIONALS_MUTATOR

Tests examined

org.apache.commons.collections4.set.MapBackedSetTest.testSimpleSerialization(org.apache.commons.collections4.set.MapBackedSetTest) (1 ms)

org.apache.commons.collections4.set.MapBackedSetTest.testSerializeDeserializeThenCompare(org.apache.commons.collections4.set.MapBackedSetTest) (3 ms)

Report generated by PIT 0.33


text:
class classeight
{
public static void main()
{
	System.out.println(" class 8");
}
}


text:
package hqt.designpatterns.patterns.command.exampleone;

/**
 * An API that is able to control various different devices
 * and interact with the different device API's without being
 * tightly coupled with them.
 *
 * The Command pattern allows you to decouple the requester of an action
 * from the object that actually performs the action. So, here the requester
 * would be the remote control and the object that performs the action
 * would be an instance of one of your vendor classes (devices).
 *
 * @author Hai
 *
 */
public class RemoteControl {
	private Command[] onCommands;
	private Command[] offCommands;

	public RemoteControl() {
		int size = 4;
		this.onCommands = new Command[size];
		this.offCommands = new Command[size];

		// initialize
		for (int i = 0; i < size; i++) {
			onCommands[i] = new NoCommand();
			offCommands[i] = new NoCommand();
		}
	}

	public void setCommand(int slot, Command onCommand, Command offCommand) {
		this.onCommands[slot] = onCommand;
		this.offCommands[slot] = offCommand;
	}

	public void onButtonWasPushed(int slot) {
		this.onCommands[slot].execute();
	}

	public void offButtonWasPushed(int slot) {
		this.offCommands[slot].execute();
	}

	public String toString() {
		StringBuffer stringBuff = new StringBuffer();
		stringBuff.append("\n------- Remote Control ---------\n");
		for (int i = 0; i < onCommands.length; i++) {
			stringBuff.append("[slot " + i + "]   " + onCommands[i].getClass().getName()
					+ "     " + offCommands[i].getClass().getName() + "\n");
		}

		return stringBuff.toString();
	}

}


text:
var mongoose = require('mongoose');

var db = mongoose.connect('mongodb://localhost/climbing-book');

var Schema = mongoose.Schema;

var Attempt = new Schema({
    difficulty: {type: String, required: true}, //e.g. 5a, 7c, 8a+, etc.
    plus_down: {type: Boolean, default: false}
});

var Climbing = new Schema({
    belay: {type: String, required: true, enum: ['top-roping', 'lead-climbing', 'bouldering'] },
    attempts: [Attempt]
});

var Training = new Schema({
    warm_up: String,
    climbings: [Climbing],
    stretching: Boolean,
    desc: String,
    rate: Number,
    date: {type: Date, required: true},
    exercises: String
});

Training.pre('save', function(next) {
    if(typeof this.climbings === 'undefined' || this.climbings.length === 0) {
        return next(new Error('Climbings are required'));
    }

    next();
});

Training.pre('save', function(next) {

    if(this._id && !this.date) {
        return next(new Error('Date is required'));
    }

    next();
});

module.exports = db.model('training', Training);


text:
package languagesuite;

import javax.swing.*;

// Copyright (c) 2010-2011 Michael Hergenrader
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

/**
 * TODO: panel that provides help and instructions for creating new conjugation sets
 * @author Michael Hergenrader
 */
public class ConjugationEditorHelpPanel extends JPanel {

}


text:
package gw.lang.reflect;

import javax.script.Bindings;
import java.util.Collection;
import java.util.Map;
import java.util.Set;

/**
 */
public class EmptyBindings implements Bindings
{
  private static final Bindings INSTANCE = new EmptyBindings();

  public static Bindings instance() {
    return INSTANCE;
  }

  private EmptyBindings()
  {
  }

  @Override
  public Object put( String name, Object value )
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public void putAll( Map<? extends String, ? extends Object> toMerge )
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public void clear()
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public Set<String> keySet()
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public Collection<Object> values()
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public Set<Entry<String, Object>> entrySet()
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public int size()
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean isEmpty()
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean containsKey( Object key )
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean containsValue( Object value )
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public Object get( Object key )
  {
    throw new UnsupportedOperationException();
  }

  @Override
  public Object remove( Object key )
  {
    throw new UnsupportedOperationException();
  }
}


text:
namespace paddle {
namespace framework {
namespace details {

SendOpHandle::SendOpHandle(const framework::OpDesc &op_desc,
                           const Scope *local_scope,
                           const platform::Place &place)
    : op_(framework::OpRegistry::CreateOp(op_desc)),
      local_scope_(local_scope),
      place_(place) {}

void SendOpHandle::RunImpl() {
  // TODO(wuyi): need further analysis whether wait VarDummyHandle.
  // Wait input done
  for (auto *in : inputs_) {
    auto &p = static_cast<VarHandle *>(in)->place_;
    if (in->DebugString() == "dummy") {  // HACK
      continue;
    }
    if (in->generated_op_) {
      in->generated_op_->RecordWaitEventOnCtx(dev_ctxes_[p]);
    }
  }
  auto &tmp_scope = local_scope_->FindVar(kLocalExecScopeName)->Get<Scope *>();
  // FIXME(wuyi): can not use RunAndRecordEvent here, for it will cause dead
  // lock.
  op_->Run(*tmp_scope, place_);
}

std::string SendOpHandle::Name() const { return "send"; }
}  // namespace details
}  // namespace framework
}  // namespace paddle


text:
<?php

namespace Haven\Bundle\CoreBundle\Entity;

use Haven\Bundle\CoreBundle\Generic\ConcretTranslatable;

/**
 * Description of TranslatableLink
 *
 * @author Stéphan Champagne
 */
class TranslatableLink extends Link {

    private $translatable = null;

    protected function getTranslated($attribut, $language = null) {
        $this->init();
        return $this->translatable->getTranslated($attribut, $language);
    }

    /**
     * This function is called because doctrine never call __construct on an existing entity.
     * So we need it for composition, call init on all fonctions using concrete translatable
     */
    private function init() {
        if (!$this->translatable instanceof ConcretTranslatable) {
            $this->translatable = new ConcretTranslatable($this);
        }
    }

}


text:
package currency.converter.entity.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import currency.converter.entity.CurrencyHistory;

/**
 * CurrencyHistoryRepository with CRUD operations on CurrencyHistory entity
 *
 * @author Ziaul Chowdhury (ziaul.chowdhury@tu-dortmund.de)
 * @since 06.03.2016
 */
public interface CurrencyHistoryRepository extends PagingAndSortingRepository<CurrencyHistory, Long> {

    /**
     * Finds a list of exchange histories based on the given page
     *
     * @param userName User name
     * @param page Contains limit and sorting options
     *
     * @return {@code Page<CurrencyHistory>}
     */
    Page<CurrencyHistory> findByUserName(String userName, Pageable page);
}


text:
/* ==========================================================================
 * Print styles.
 * Inlined to avoid required HTTP connection: h5bp.com/r
 * ========================================================================== */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    /* Black prints faster: h5bp.com/s */
    box-shadow: none !important;
    text-shadow: none !important; }

  a {
    text-decoration: underline; }
    a:visited {
      text-decoration: underline; }
    a[href]:after {
      content: " (" attr(href) ")"; }

  abbr[title]:after {
    content: " (" attr(title) ")"; }

  /* Don't show links for images, or javascript/internal links */
  .ir a:after {
    content: ""; }

  a[href^="javascript:"]:after, a[href^="#"]:after {
    content: ""; }

  pre, blockquote {
    border: 1px solid #999999;
    page-break-inside: avoid; }

  thead {
    display: table-header-group;
    /* h5bp.com/t */ }

  tr {
    page-break-inside: avoid; }

  img {
    page-break-inside: avoid;
    max-width: 100% !important; }

  @page {
    margin: 0.5cm; }

  p, h2, h3 {
    orphans: 3;
    widows: 3; }

  h2, h3 {
    page-break-after: avoid; } }


text:
package fm.liu.timo.config.loader;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import fm.liu.timo.config.model.SystemConfig;
import fm.liu.timo.config.util.ConfigException;
import fm.liu.timo.config.util.ConfigUtil;
import fm.liu.timo.config.util.ParameterMapping;

/**
 * @author Liu Huanting 2015年5月9日
 */
public class SystemConfigLoader {
    private final SystemConfig system;

    public SystemConfigLoader() {
        this.system = new SystemConfig();
        this.load();
    }

    public SystemConfig getSystemConfig() {
        return system;
    }

    private void load() {
        InputStream xml = null;
        try {
            xml = SystemConfigLoader.class.getResourceAsStream("/server.xml");
            Element root = ConfigUtil.getDocument(null, xml).getDocumentElement();
            loadSystem(root);
        } catch (ConfigException e) {
            throw e;
        } catch (Throwable e) {
            throw new ConfigException(e);
        } finally {
            if (xml != null) {
                try {
                    xml.close();
                } catch (IOException e) {}
            }
        }
    }

    private void loadSystem(Element root) throws IllegalAccessException, InvocationTargetException {
        NodeList list = root.getElementsByTagName("system");
        for (int i = 0, n = list.getLength(); i < n; i++) {
            Node node = list.item(i);
            if (node instanceof Element) {
                Map<String, Object> props = ConfigUtil.loadElements((Element) node);
                ParameterMapping.mapping(system, props);
            }
        }
    }
}


text:
package org.newdawn.slick.tests;

import org.newdawn.slick.AngelCodeFont;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.Color;
import org.newdawn.slick.Font;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.opengl.pbuffer.GraphicsFactory;

/**
 * A test for rendering to an image
 *
 * @author kevin
 */
public class ImageGraphicsTest extends BasicGame {
	/** The image loaded and then rendered to */
	private Image preloaded;
	/** The image rendered to */
	private Image target;
	/** The image cut from the screen */
	private Image cut;
	/** The offscreen graphics */
	private Graphics gTarget;
	/** The offscreen graphics */
	private Graphics offscreenPreload;
	/** The image loaded */
	private Image testImage;
	/** The font loaded */
	private Font testFont;
	/** The angle of the rotation */
	private float ang;
	/** The name of the dynamic image technique in use */
	private String using = "none";

	/**
	 * Create a new image rendering test
	 */
	public ImageGraphicsTest() {
		super("Image Graphics Test");
	}

	/**
	 * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
	 */
	public void init(GameContainer container) throws SlickException {
		testImage = new Image("testdata/logo.png");
		preloaded = new Image("testdata/logo.png");
		testFont = new AngelCodeFont("testdata/hiero.fnt","testdata/hiero.png");
		target = new Image(400,300);
		cut = new Image(100,100);
		gTarget = target.getGraphics();
		offscreenPreload = preloaded.getGraphics();

		offscreenPreload.drawString("Drawing over a loaded image", 5, 15);
		offscreenPreload.setLineWidth(5);
		offscreenPreload.setAntiAlias(true);
		offscreenPreload.setColor(Color.blue.brighter());
		offscreenPreload.drawOval(200, 30, 50, 50);
		offscreenPreload.setColor(Color.white);
		offscreenPreload.drawRect(190,20,70,70);
		offscreenPreload.flush();

		if (GraphicsFactory.usingFBO()) {
			using = "FBO (Frame Buffer Objects)";
		} else if (GraphicsFactory.usingPBuffer()) {
			using = "Pbuffer (Pixel Buffers)";
		}

	}

	/**
	 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
	 */
	public void render(GameContainer container, Graphics g) throws SlickException {

		// RENDERING TO AN IMAGE AND THEN DRAWING IT TO THE DISPLAY
		// Draw graphics and text onto our graphics context from the Image target
		gTarget.setBackground(new Color(0,0,0,0));
		gTarget.clear();
		gTarget.rotate(200,160,ang);
		gTarget.setFont(testFont);
		gTarget.fillRect(10, 10, 50, 50);
		gTarget.drawString("HELLO WORLD",10,10);

		gTarget.drawImage(testImage,100,150);
		gTarget.drawImage(testImage,100,50);
		gTarget.drawImage(testImage,50,75);

		// Note we started by clearing the offscreen graphics area and then end
		// by calling flush
		gTarget.flush();

		g.setColor(Color.red);
		g.fillRect(250, 50, 200, 200);
		// The image has been updated using its graphics context, so now draw the image
		// to the screen a few times
		target.draw(300,100);
		target.draw(300,410,200,150);
		target.draw(505,410,100,75);

		// Draw some text on the screen to indicate what we did and put some
		// nice boxes around the three areas
		g.setColor(Color.white);
		g.drawString("Testing On Offscreen Buffer", 300, 80);
		g.setColor(Color.green);
		g.drawRect(300, 100, target.getWidth(), target.getHeight());
		g.drawRect(300, 410, target.getWidth()/2, target.getHeight()/2);
		g.drawRect(505, 410, target.getWidth()/4, target.getHeight()/4);

		// SCREEN COPY EXAMPLE
		// Put some text and simple graphics on the screen to test copying
		// from the screen to a target image
		g.setColor(Color.white);
		g.drawString("Testing Font On Back Buffer", 10, 100);
		g.drawString("Using: "+using, 10, 580);
		g.setColor(Color.red);
		g.fillRect(10,120,200,5);

		// Copy the screen area into a destination image
		int xp = (int) (60 + (Math.sin(ang / 60) * 50));
		g.copyArea(cut,xp,50);

		// Draw the copied image to the screen and put some nice
		// boxes around the source and the destination
		cut.draw(30,250);
		g.setColor(Color.white);
		g.drawRect(30, 250, cut.getWidth(), cut.getHeight());
		g.setColor(Color.gray);
		g.drawRect(xp, 50, cut.getWidth(), cut.getHeight());

		// ALTERING A LOADED IMAGE EXAMPLE
		// Draw the image we loaded in the init method and then modified
		// by drawing some text and simple geometry on it
		preloaded.draw(2,400);
		g.setColor(Color.blue);
		g.drawRect(2,400,preloaded.getWidth(),preloaded.getHeight());
	}

	/**
	 * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int)
	 */
	public void update(GameContainer container, int delta) {
		ang += delta * 0.1f;
	}

	/**
	 * Entry point to our test
	 *
	 * @param argv The arguments to pass into the test
	 */
	public static void main(String[] argv) {
		try {
			AppGameContainer container = new AppGameContainer(new ImageGraphicsTest());
			container.setDisplayMode(800,600,false);
			container.start();
		} catch (SlickException e) {
			e.printStackTrace();
		}
	}
}


text:
<Module>
	<Texture>TorpedoAntimatter_3x7</Texture>
	<SizeX>3</SizeX>
	<SizeY>7</SizeY>

	<ProductionCost>105</ProductionCost>
	<AlloyCost>105</AlloyCost>
	<AdvancedAlloyCost>42</AdvancedAlloyCost>
	<SuperiorAlloyCost>21</SuperiorAlloyCost>
	<CrystalCost>84</CrystalCost>
	<RareCrystalCost>42</RareCrystalCost>
	<ExoticCrystalCost>21</ExoticCrystalCost>

	<Health>3780</Health>
	<Mass>21</Mass>
	<Power>126</Power>
	<Ammo>504</Ammo>
	<RequiredCrew>28</RequiredCrew>

	<Weapon>TorpedoAntimatter4</Weapon>
</Module>


text:
PLEASE NOTE: This document applies to the HEAD of the source tree

If you are using a released version of Kubernetes, you should
refer to the docs that go with that version.

The latest 1.0.x release of this document can be found
[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/coreos/coreos_multinode_cluster.md).

Documentation for other releases can be found at
[releases.k8s.io](http://releases.k8s.io).

--

# CoreOS Multinode Cluster

Use the [master.yaml](cloud-configs/master.yaml) and [node.yaml](cloud-configs/node.yaml) cloud-configs to provision a multi-node Kubernetes cluster.

> **Attention**: This requires at least CoreOS version **[695.0.0][coreos695]**, which includes `etcd2`.

[coreos695]: https://coreos.com/releases/#695.0.0

## Overview

* Provision the master node
* Capture the master node private IP address
* Edit node.yaml
* Provision one or more worker nodes

### AWS

*Attention:* Replace `<ami_image_id>` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/).

#### Provision the Master

```sh
aws ec2 create-security-group --group-name kubernetes --description "Kubernetes Security Group"
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 22 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-name kubernetes --source-security-group-name kubernetes
```

```sh
aws ec2 run-instances \
--image-id <ami_image_id> \
--key-name <keypair> \
--region us-west-2 \
--security-groups kubernetes \
--instance-type m3.medium \
--user-data file://master.yaml
```

#### Capture the private IP address

```sh
aws ec2 describe-instances --instance-id <master-instance-id>
```

#### Edit node.yaml

Edit `node.yaml` and replace all instances of `<master-private-ip>` with the private IP address of the master node.

#### Provision worker nodes

```sh
aws ec2 run-instances \
--count 1 \
--image-id <ami_image_id> \
--key-name <keypair> \
--region us-west-2 \
--security-groups kubernetes \
--instance-type m3.medium \
--user-data file://node.yaml
```

### Google Compute Engine (GCE)

*Attention:* Replace `<gce_image_id>` below for a [suitable version of CoreOS image for Google Compute Engine](https://coreos.com/docs/running-coreos/cloud-providers/google-compute-engine/).

#### Provision the Master

```sh
gcloud compute instances create master \
--image-project coreos-cloud \
--image <gce_image_id> \
--boot-disk-size 200GB \
--machine-type n1-standard-1 \
--zone us-central1-a \
--metadata-from-file user-data=master.yaml
```

#### Capture the private IP address

```sh
gcloud compute instances list
```

#### Edit node.yaml

Edit `node.yaml` and replace all instances of `<master-private-ip>` with the private IP address of the master node.

#### Provision worker nodes

```sh
gcloud compute instances create node1 \
--image-project coreos-cloud \
--image <gce_image_id> \
--boot-disk-size 200GB \
--machine-type n1-standard-1 \
--zone us-central1-a \
--metadata-from-file user-data=node.yaml
```

#### Establish network connectivity

Next, setup an ssh tunnel to the master so you can run kubectl from your local host.
In one terminal, run `gcloud compute ssh master --ssh-flag="-L 8080:127.0.0.1:8080"` and in a second
run `gcloud compute ssh master --ssh-flag="-R 8080:127.0.0.1:8080"`.

### OpenStack

These instructions are for running on the command line.  Most of this you can also do through the Horizon dashboard.
These instructions were tested on the Ice House release on a Metacloud distribution of OpenStack but should be similar if not the same across other versions/distributions of OpenStack.

#### Make sure you can connect with OpenStack

Make sure the environment variables are set for OpenStack such as:

```sh
OS_TENANT_ID
OS_PASSWORD
OS_AUTH_URL
OS_USERNAME
OS_TENANT_NAME
```

Test this works with something like:

```
nova list
```

#### Get a Suitable CoreOS Image

You'll need a [suitable version of CoreOS image for OpenStack] (https://coreos.com/os/docs/latest/booting-on-openstack.html)
Once you download that, upload it to glance.  An example is shown below:

```sh
glance image-create --name CoreOS723 \
--container-format bare --disk-format qcow2 \
--file coreos_production_openstack_image.img \
--is-public True
```

#### Create security group

```sh
nova secgroup-create kubernetes "Kubernetes Security Group"
nova secgroup-add-rule kubernetes tcp 22 22   0.0.0.0/0
nova secgroup-add-rule kubernetes tcp 80 80   0.0.0.0/0
```

#### Provision the Master

```sh
nova boot \
--image <image_name> \
--key-name <my_key> \
--flavor <flavor id> \
--security-group kubernetes \
--user-data files/master.yaml \
kube-master
```

```<image_name>``` is the CoreOS image name.  In our example we can use the image we created in the previous step and put in 'CoreOS723'

```<my_key>``` is the keypair name that you already generated to access the instance.

```<flavor_id>``` is the flavor ID you use to size the instance.  Run ```nova flavor-list``` to get the IDs.  3 on the system this was tested with gives the m1.large size.

The important part is to ensure you have the files/master.yml as this is what will do all the post boot configuration. This path is relevant so we are assuming in this example that you are running the nova command in a directory where there is a subdirectory called files that has the master.yml file in it.  Absolute paths also work.

Next, assign it a public IP address:

```
nova floating-ip-list
```

Get an IP address that's free and run:

```
nova floating-ip-associate kube-master <ip address>
```

where ```<ip address>``` is the IP address that was available from the ```nova floating-ip-list``` command.

#### Provision Worker Nodes

Edit ```node.yaml``` and replace all instances of ```<master-private-ip>``` with the private IP address of the master node.  You can get this by runnning ```nova show kube-master``` assuming you named your instance kube master.  This is not the floating IP address you just assigned it.

```sh
nova boot \
--image <image_name> \
--key-name <my_key> \
--flavor <flavor id> \
--security-group kubernetes \
--user-data files/node.yaml \
minion01
```

This is basically the same as the master nodes but with the node.yaml post-boot script instead of the master.

### VMware Fusion

#### Create the master config-drive

```sh
mkdir -p /tmp/new-drive/openstack/latest/
cp master.yaml /tmp/new-drive/openstack/latest/user_data
hdiutil makehybrid -iso -joliet -joliet-volume-name "config-2" -joliet -o master.iso /tmp/new-drive
```

#### Provision the Master

Boot the [vmware image](https://coreos.com/docs/running-coreos/platforms/vmware) using `master.iso` as a config drive.

#### Capture the master private IP address

#### Edit node.yaml

Edit `node.yaml` and replace all instances of `<master-private-ip>` with the private IP address of the master node.

#### Create the node config-drive

```sh
mkdir -p /tmp/new-drive/openstack/latest/
cp node.yaml /tmp/new-drive/openstack/latest/user_data
hdiutil makehybrid -iso -joliet -joliet-volume-name "config-2" -joliet -o node.iso /tmp/new-drive
```

#### Provision worker nodes

Boot one or more the [vmware image](https://coreos.com/docs/running-coreos/platforms/vmware) using `node.iso` as a config drive.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/coreos/coreos_multinode_cluster.md?pixel)]()


text:
<?php

namespace Discussione\Bundle\UploadBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class MaterialType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('file');
    }

    public function getName()
    {
        return 'discussione_form_material';
    }
}


text:
import {bind, provide} from 'angular2/src/core/di';
import {Options} from './common';

export * from './common';
export {SeleniumWebDriverAdapter} from './src/webdriver/selenium_webdriver_adapter';

var fs = require('fs');

// TODO(tbosch): right now we bind the `writeFile` method
// in benchpres/benchpress.es6. This does not work for Dart,
// find another way...
// Note: Can't do the `require` call in a facade as it can't be loaded into the browser
// for our unit tests via karma.
Options.DEFAULT_PROVIDERS.push(bind(Options.WRITE_FILE).toValue(writeFile));

function writeFile(filename, content): Promise<any> {
  return new Promise(function(resolve, reject) {
    fs.writeFile(filename, content, (error) => {
      if (error) {
        reject(error);
      } else {
        resolve();
      }
    });
  })
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;

namespace PushSharp.Client
{
	public class NoGoogleAccountsOnDeviceRegistrationException : Exception
	{
		public NoGoogleAccountsOnDeviceRegistrationException()
			: base("No Google Accounts are setup on this device!")
		{
		}
	}

	public class C2dmRegistrationError : Exception
	{
		public static string GetErrorDescription(string errorCode)
		{
			string description = string.Empty;

			switch (errorCode.ToUpper().Trim())
			{
				case "SERVICE_NOT_AVAILABLE":
					description = "Registration Server Temporarily Unavailable.  Try again later.";
					break;
				case "ACCOUNT_MISSING":
					description = "No Google Accounts exist on the Device.";
					break;
				case "AUTHENTICATION_FAILED":
					description = "Invalid Password, Authentication Failed";
					break;
				case "TOO_MANY_REGISTRATIONS":
					description = "Too many applications registered with C2DM";
					break;
				case "INVALID_SENDER":
					description = "Google Account sender is not recognized";
					break;
				case "PHONE_REGISTRATION_ERROR":
					description = "Phone does not support C2DM";
					break;
			}

			return description;
		}

		public C2dmRegistrationError(string errorCode, string message)
			: base(message)
		{
			this.ErrorCode = errorCode;
		}

		public string ErrorCode
		{
			get;
			set;
		}
	}
}