text:
package testing;

import java.util.List;
import java.util.Map;
import org.openqa.selenium.support.CacheLookup;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.WebDriverWait;

/**
 * Este es el addon que comentamos ayer en clase.
 * Creo que les va a servir de ayuda para ahorrar trabajo y para poder entender más de qué se trata el patrón de diseño.
 * https://chrome.google.com/webstore/detail/selenium-page-object-gene/epgmnmcjdhapiojbohkkemlfkegmbebb
 */
public class Desafio4 {
    private Map<String, String> data;
    private WebDriver driver;
    private int timeout = 15;

    @FindBy(css = "#slideshow0 ol.flex-control-nav.flex-control-paging li:nth-of-type(1) a.flex-active")
    @CacheLookup
    private WebElement t11;

    @FindBy(css = "#slideshow0 ol.flex-control-nav.flex-control-paging li:nth-of-type(2) a")
    @CacheLookup
    private WebElement t12;

    @FindBy(css = "#carousel0 ol.flex-control-nav.flex-control-paging li:nth-of-type(1) a")
    @CacheLookup
    private WebElement t21;

    @FindBy(css = "#carousel0 ol.flex-control-nav.flex-control-paging li:nth-of-type(2) a.flex-active")
    @CacheLookup
    private WebElement t22;

    @FindBy(css = "#carousel0 ol.flex-control-nav.flex-control-paging li:nth-of-type(3) a")
    @CacheLookup
    private WebElement t3;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=information/information&information_id=4']")
    @CacheLookup
    private WebElement aboutUs;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(1) div.product-thumb.transition div:nth-of-type(3) button:nth-of-type(1)")
    @CacheLookup
    private WebElement addToCart1;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(2) div.product-thumb.transition div:nth-of-type(3) button:nth-of-type(1)")
    @CacheLookup
    private WebElement addToCart2;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(3) div.product-thumb.transition div:nth-of-type(3) button:nth-of-type(1)")
    @CacheLookup
    private WebElement addToCart3;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(4) div.product-thumb.transition div:nth-of-type(3) button:nth-of-type(1)")
    @CacheLookup
    private WebElement addToCart4;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=affiliate/account']")
    @CacheLookup
    private WebElement affiliates;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(3) div.product-thumb.transition div:nth-of-type(1) a")
    @CacheLookup
    private WebElement appleCinema301;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(3) div.product-thumb.transition div:nth-of-type(2) h4 a")
    @CacheLookup
    private WebElement appleCinema302;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/manufacturer']")
    @CacheLookup
    private WebElement brands;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=33']")
    @CacheLookup
    private WebElement cameras;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(4) div.product-thumb.transition div:nth-of-type(1) a")
    @CacheLookup
    private WebElement canonEos5d1;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(4) div.product-thumb.transition div:nth-of-type(2) h4 a")
    @CacheLookup
    private WebElement canonEos5d2;

    @FindBy(css = "a[title='Checkout']")
    @CacheLookup
    private WebElement checkout;

    @FindBy(css = "#menu div:nth-of-type(2) ul.nav.navbar-nav li:nth-of-type(3) a.dropdown-toggle")
    @CacheLookup
    private WebElement components;

    @FindBy(css = ".common-home footer div.container div.row div:nth-of-type(2) ul.list-unstyled li:nth-of-type(1) a")
    @CacheLookup
    private WebElement contactUs;

    @FindBy(css = "button.btn.btn-link.dropdown-toggle")
    @CacheLookup
    private WebElement currency;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=information/information&information_id=6']")
    @CacheLookup
    private WebElement deliveryInformation;

    @FindBy(css = "#menu div:nth-of-type(2) ul.nav.navbar-nav li:nth-of-type(1) a.dropdown-toggle")
    @CacheLookup
    private WebElement desktops;

    @FindBy(name = "EUR")
    @CacheLookup
    private WebElement euro;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=account/voucher']")
    @CacheLookup
    private WebElement giftVouchers;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(2) div.product-thumb.transition div:nth-of-type(1) a")
    @CacheLookup
    private WebElement iphone1;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(2) div.product-thumb.transition div:nth-of-type(2) h4 a")
    @CacheLookup
    private WebElement iphone2;

    @FindBy(css = "a[href='index.php?route=product/product&path=57&product_id=49']")
    @CacheLookup
    private WebElement iphone6;

    @FindBy(css = "button.btn.btn-inverse.btn-block.btn-lg.dropdown-toggle")
    @CacheLookup
    private WebElement items0000;

    @FindBy(css = "#menu div:nth-of-type(2) ul.nav.navbar-nav li:nth-of-type(2) a.dropdown-toggle")
    @CacheLookup
    private WebElement laptopsNotebooks;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=account/login']")
    @CacheLookup
    private WebElement login;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=20_27']")
    @CacheLookup
    private WebElement mac1;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(1) div.product-thumb.transition div:nth-of-type(1) a")
    @CacheLookup
    private WebElement macbook1;

    @FindBy(css = "#content div:nth-of-type(2) div:nth-of-type(1) div.product-thumb.transition div:nth-of-type(2) h4 a")
    @CacheLookup
    private WebElement macbook2;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=18_46']")
    @CacheLookup
    private WebElement macs0;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=25_29']")
    @CacheLookup
    private WebElement miceAndTrackballs0;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=25_28']")
    @CacheLookup
    private WebElement monitors2;

    @FindBy(css = "#menu div:nth-of-type(2) ul.nav.navbar-nav li:nth-of-type(8) a.dropdown-toggle")
    @CacheLookup
    private WebElement mp3Players;

    @FindBy(css = "a[title='My Account']")
    @CacheLookup
    private WebElement myAccount1;

    @FindBy(css = ".common-home footer div.container div.row div:nth-of-type(4) ul.list-unstyled li:nth-of-type(1) a")
    @CacheLookup
    private WebElement myAccount2;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=account/newsletter']")
    @CacheLookup
    private WebElement newsletter;

    @FindBy(css = "#slideshow0 ul.flex-direction-nav li:nth-of-type(2) a.flex-next")
    @CacheLookup
    private WebElement next1;

    @FindBy(css = "#carousel0 ul.flex-direction-nav li:nth-of-type(2) a.flex-next")
    @CacheLookup
    private WebElement next2;

    @FindBy(css = "a[href='http://www.opencart.com']")
    @CacheLookup
    private WebElement opencart;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=account/order']")
    @CacheLookup
    private WebElement orderHistory;

    private final String pageLoadedText = "Powered by an Intel Core 2 Duo processor at speeds up to 2";

    private final String pageUrl = "/index.php?route=common/home";

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=20_26']")
    @CacheLookup
    private WebElement pc0;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=24']")
    @CacheLookup
    private WebElement phonesPdas;

    @FindBy(name = "GBP")
    @CacheLookup
    private WebElement poundSterling;

    @FindBy(css = "#slideshow0 ul.flex-direction-nav li:nth-of-type(1) a.flex-prev")
    @CacheLookup
    private WebElement previous1;

    @FindBy(css = "#carousel0 ul.flex-direction-nav li:nth-of-type(1) a.flex-prev")
    @CacheLookup
    private WebElement previous2;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=25_30']")
    @CacheLookup
    private WebElement printers0;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=information/information&information_id=3']")
    @CacheLookup
    private WebElement privacyPolicy;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=account/register']")
    @CacheLookup
    private WebElement register;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=account/return/add']")
    @CacheLookup
    private WebElement returns;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=25_31']")
    @CacheLookup
    private WebElement scanners0;

    @FindBy(css = "#menu div:nth-of-type(2) ul.nav.navbar-nav li:nth-of-type(3) div.dropdown-menu a.see-all")
    @CacheLookup
    private WebElement seeAllComponents;

    @FindBy(css = "#menu div:nth-of-type(2) ul.nav.navbar-nav li:nth-of-type(1) div.dropdown-menu a.see-all")
    @CacheLookup
    private WebElement seeAllDesktops;

    @FindBy(css = "#menu div:nth-of-type(2) ul.nav.navbar-nav li:nth-of-type(2) div.dropdown-menu a.see-all")
    @CacheLookup
    private WebElement seeAllLaptopsNotebooks;

    @FindBy(css = "#menu div:nth-of-type(2) ul.nav.navbar-nav li:nth-of-type(8) div.dropdown-menu a.see-all")
    @CacheLookup
    private WebElement seeAllMp3Players;

    @FindBy(css = "a[title='Shopping Cart']")
    @CacheLookup
    private WebElement shoppingCart;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=information/sitemap']")
    @CacheLookup
    private WebElement siteMap;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=17']")
    @CacheLookup
    private WebElement software;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/special']")
    @CacheLookup
    private WebElement specials;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=57']")
    @CacheLookup
    private WebElement tablets;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=information/information&information_id=5']")
    @CacheLookup
    private WebElement termsConditions;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_43']")
    @CacheLookup
    private WebElement test110;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_44']")
    @CacheLookup
    private WebElement test120;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_47']")
    @CacheLookup
    private WebElement test150;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_48']")
    @CacheLookup
    private WebElement test160;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_49']")
    @CacheLookup
    private WebElement test170;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_50']")
    @CacheLookup
    private WebElement test180;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_51']")
    @CacheLookup
    private WebElement test190;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_52']")
    @CacheLookup
    private WebElement test200;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_53']")
    @CacheLookup
    private WebElement test210;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_54']")
    @CacheLookup
    private WebElement test220;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_55']")
    @CacheLookup
    private WebElement test230;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_56']")
    @CacheLookup
    private WebElement test240;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_38']")
    @CacheLookup
    private WebElement test40;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_37']")
    @CacheLookup
    private WebElement test50;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_39']")
    @CacheLookup
    private WebElement test60;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_40']")
    @CacheLookup
    private WebElement test70;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_41']")
    @CacheLookup
    private WebElement test80;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=34_42']")
    @CacheLookup
    private WebElement test90;

    @FindBy(name = "USD")
    @CacheLookup
    private WebElement usDollar;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=25_32']")
    @CacheLookup
    private WebElement webCameras0;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=product/category&path=18_45']")
    @CacheLookup
    private WebElement windows0;

    @FindBy(css = ".common-home footer div.container div.row div:nth-of-type(4) ul.list-unstyled li:nth-of-type(3) a")
    @CacheLookup
    private WebElement wishList;

    @FindBy(id = "wishlist-total")
    @CacheLookup
    private WebElement wishList0;

    @FindBy(name = "search")
    @CacheLookup
    private WebElement yourShoppingCartIsEmpty;

    @FindBy(css = "a[href='http://demo.opencart.com/index.php?route=common/home']")
    @CacheLookup
    private WebElement yourStore;

    public Desafio4() {
    }

    public Desafio4(WebDriver driver) {
        this();
        this.driver = driver;
    }

    public Desafio4(WebDriver driver, Map<String, String> data) {
        this(driver);
        this.data = data;
    }

    public Desafio4(WebDriver driver, Map<String, String> data, int timeout) {
        this(driver, data);
        this.timeout = timeout;
    }

    /**
     * Click on 1 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 click1Link1() {
        t11.click();
        return this;
    }

    /**
     * Click on 2 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 click1Link2() {
        t12.click();
        return this;
    }

    /**
     * Click on 1 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 click2Link1() {
        t21.click();
        return this;
    }

    /**
     * Click on 2 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 click2Link2() {
        t22.click();
        return this;
    }

    /**
     * Click on About Us Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickAboutUsLink() {
        aboutUs.click();
        return this;
    }

    /**
     * Click on Add To Cart Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickAddToCart1Button() {
        addToCart1.click();
        return this;
    }

    /**
     * Click on Add To Cart Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickAddToCart2Button() {
        addToCart2.click();
        return this;
    }

    /**
     * Click on Add To Cart Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickAddToCart3Button() {
        addToCart3.click();
        return this;
    }

    /**
     * Click on Add To Cart Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickAddToCart4Button() {
        addToCart4.click();
        return this;
    }

    /**
     * Click on Affiliates Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickAffiliatesLink() {
        affiliates.click();
        return this;
    }

    /**
     * Click on Apple Cinema 30 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickAppleCinema301Link() {
        appleCinema301.click();
        return this;
    }

    /**
     * Click on Apple Cinema 30 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickAppleCinema302Link() {
        appleCinema302.click();
        return this;
    }

    /**
     * Click on Brands Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickBrandsLink() {
        brands.click();
        return this;
    }

    /**
     * Click on Cameras Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickCamerasLink() {
        cameras.click();
        return this;
    }

    /**
     * Click on Canon Eos 5d Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickCanonEos5d1Link() {
        canonEos5d1.click();
        return this;
    }

    /**
     * Click on Canon Eos 5d Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickCanonEos5d2Link() {
        canonEos5d2.click();
        return this;
    }

    /**
     * Click on Checkout Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickCheckoutLink() {
        checkout.click();
        return this;
    }

    /**
     * Click on Components Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickComponentsLink() {
        components.click();
        return this;
    }

    /**
     * Click on Contact Us Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickContactUsLink() {
        contactUs.click();
        return this;
    }

    /**
     * Click on Currency Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickCurrencyButton() {
        currency.click();
        return this;
    }

    /**
     * Click on Delivery Information Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickDeliveryInformationLink() {
        deliveryInformation.click();
        return this;
    }

    /**
     * Click on Desktops Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickDesktopsLink() {
        desktops.click();
        return this;
    }

    /**
     * Click on Euro Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickEuroButton() {
        euro.click();
        return this;
    }

    /**
     * Click on Gift Vouchers Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickGiftVouchersLink() {
        giftVouchers.click();
        return this;
    }

    /**
     * Click on Iphone Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickIphone1Link() {
        iphone1.click();
        return this;
    }

    /**
     * Click on Iphone Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickIphone2Link() {
        iphone2.click();
        return this;
    }

    /**
     * Click on Iphone 6 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickIphone6Link() {
        iphone6.click();
        return this;
    }

    /**
     * Click on 0 Items 0.00 Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickItems000Button0() {
        items0000.click();
        return this;
    }

    /**
     * Click on Laptops Notebooks Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickLaptopsNotebooksLink() {
        laptopsNotebooks.click();
        return this;
    }

    /**
     * Click on 3 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickLink3() {
        t3.click();
        return this;
    }

    /**
     * Click on Login Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickLoginLink() {
        login.click();
        return this;
    }

    /**
     * Click on Mac 1 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMac1Link() {
        mac1.click();
        return this;
    }

    /**
     * Click on Macbook Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMacbook1Link() {
        macbook1.click();
        return this;
    }

    /**
     * Click on Macbook Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMacbook2Link() {
        macbook2.click();
        return this;
    }

    /**
     * Click on Macs 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMacs0Link() {
        macs0.click();
        return this;
    }

    /**
     * Click on Mice And Trackballs 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMiceAndTrackballs0Link() {
        miceAndTrackballs0.click();
        return this;
    }

    /**
     * Click on Monitors 2 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMonitors2Link() {
        monitors2.click();
        return this;
    }

    /**
     * Click on Mp3 Players Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMp3PlayersLink() {
        mp3Players.click();
        return this;
    }

    /**
     * Click on My Account Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMyAccount1Link() {
        myAccount1.click();
        return this;
    }

    /**
     * Click on My Account Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickMyAccount2Link() {
        myAccount2.click();
        return this;
    }

    /**
     * Click on Newsletter Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickNewsletterLink() {
        newsletter.click();
        return this;
    }

    /**
     * Click on Next Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickNext1Link() {
        next1.click();
        return this;
    }

    /**
     * Click on Next Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickNext2Link() {
        next2.click();
        return this;
    }

    /**
     * Click on Opencart Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickOpencartLink() {
        opencart.click();
        return this;
    }

    /**
     * Click on Order History Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickOrderHistoryLink() {
        orderHistory.click();
        return this;
    }

    /**
     * Click on Pc 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickPc0Link() {
        pc0.click();
        return this;
    }

    /**
     * Click on Phones Pdas Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickPhonesPdasLink() {
        phonesPdas.click();
        return this;
    }

    /**
     * Click on Pound Sterling Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickPoundSterlingButton() {
        poundSterling.click();
        return this;
    }

    /**
     * Click on Previous Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickPrevious1Link() {
        previous1.click();
        return this;
    }

    /**
     * Click on Previous Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickPrevious2Link() {
        previous2.click();
        return this;
    }

    /**
     * Click on Printers 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickPrinters0Link() {
        printers0.click();
        return this;
    }

    /**
     * Click on Privacy Policy Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickPrivacyPolicyLink() {
        privacyPolicy.click();
        return this;
    }

    /**
     * Click on Register Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickRegisterLink() {
        register.click();
        return this;
    }

    /**
     * Click on Returns Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickReturnsLink() {
        returns.click();
        return this;
    }

    /**
     * Click on Scanners 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickScanners0Link() {
        scanners0.click();
        return this;
    }

    /**
     * Click on See All Components Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickSeeAllComponentsLink() {
        seeAllComponents.click();
        return this;
    }

    /**
     * Click on See All Desktops Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickSeeAllDesktopsLink() {
        seeAllDesktops.click();
        return this;
    }

    /**
     * Click on See All Laptops Notebooks Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickSeeAllLaptopsNotebooksLink() {
        seeAllLaptopsNotebooks.click();
        return this;
    }

    /**
     * Click on See All Mp3 Players Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickSeeAllMp3PlayersLink() {
        seeAllMp3Players.click();
        return this;
    }

    /**
     * Click on Shopping Cart Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickShoppingCartLink() {
        shoppingCart.click();
        return this;
    }

    /**
     * Click on Site Map Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickSiteMapLink() {
        siteMap.click();
        return this;
    }

    /**
     * Click on Software Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickSoftwareLink() {
        software.click();
        return this;
    }

    /**
     * Click on Specials Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickSpecialsLink() {
        specials.click();
        return this;
    }

    /**
     * Click on Tablets Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTabletsLink() {
        tablets.click();
        return this;
    }

    /**
     * Click on Terms Conditions Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTermsConditionsLink() {
        termsConditions.click();
        return this;
    }

    /**
     * Click on Test 11 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest110Link() {
        test110.click();
        return this;
    }

    /**
     * Click on Test 12 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest120Link() {
        test120.click();
        return this;
    }

    /**
     * Click on Test 15 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest150Link() {
        test150.click();
        return this;
    }

    /**
     * Click on Test 16 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest160Link() {
        test160.click();
        return this;
    }

    /**
     * Click on Test 17 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest170Link() {
        test170.click();
        return this;
    }

    /**
     * Click on Test 18 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest180Link() {
        test180.click();
        return this;
    }

    /**
     * Click on Test 19 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest190Link() {
        test190.click();
        return this;
    }

    /**
     * Click on Test 20 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest200Link() {
        test200.click();
        return this;
    }

    /**
     * Click on Test 21 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest210Link() {
        test210.click();
        return this;
    }

    /**
     * Click on Test 22 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest220Link() {
        test220.click();
        return this;
    }

    /**
     * Click on Test 23 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest230Link() {
        test230.click();
        return this;
    }

    /**
     * Click on Test 24 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest240Link() {
        test240.click();
        return this;
    }

    /**
     * Click on Test 4 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest40Link() {
        test40.click();
        return this;
    }

    /**
     * Click on Test 5 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest50Link() {
        test50.click();
        return this;
    }

    /**
     * Click on Test 6 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest60Link() {
        test60.click();
        return this;
    }

    /**
     * Click on Test 7 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest70Link() {
        test70.click();
        return this;
    }

    /**
     * Click on Test 8 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest80Link() {
        test80.click();
        return this;
    }

    /**
     * Click on Test 9 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickTest90Link() {
        test90.click();
        return this;
    }

    /**
     * Click on Us Dollar Button.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickUsDollarButton() {
        usDollar.click();
        return this;
    }

    /**
     * Click on Web Cameras 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickWebCameras0Link() {
        webCameras0.click();
        return this;
    }

    /**
     * Click on Windows 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickWindows0Link() {
        windows0.click();
        return this;
    }

    /**
     * Click on Wish List 0 Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickWishList0Link() {
        wishList0.click();
        return this;
    }

    /**
     * Click on Wish List Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickWishListLink() {
        wishList.click();
        return this;
    }

    /**
     * Click on Your Store Link.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 clickYourStoreLink() {
        yourStore.click();
        return this;
    }

    /**
     * Fill every fields in the page.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 fill() {
        setYourShoppingCartIsEmptyTextField();
        return this;
    }

    /**
     * Fill every fields in the page and submit it to target page.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 fillAndSubmit() {
        fill();
        return submit();
    }

    /**
     * Set default value to Your Shopping Cart Is Empty Text field.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 setYourShoppingCartIsEmptyTextField() {
        return setYourShoppingCartIsEmptyTextField(data.get("YOUR_SHOPPING_CART_IS_EMPTY"));
    }

    /**
     * Set value to Your Shopping Cart Is Empty Text field.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 setYourShoppingCartIsEmptyTextField(String yourShoppingCartIsEmptyValue) {
        yourShoppingCartIsEmpty.sendKeys(yourShoppingCartIsEmptyValue);
        return this;
    }

    /**
     * Submit the form to target page.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 submit() {
        clickCurrencyButton();
        return this;
    }

    /**
     * Verify that the page loaded completely.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 verifyPageLoaded() {
        (new WebDriverWait(driver, timeout)).until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
                return d.getPageSource().contains(pageLoadedText);
            }
        });
        return this;
    }

    /**
     * Verify that current page URL matches the expected URL.
     *
     * @return the Desafio4 class instance.
     */
    public Desafio4 verifyPageUrl() {
        (new WebDriverWait(driver, timeout)).until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
                return d.getCurrentUrl().contains(pageUrl);
            }
        });
        return this;
    }
}


text:
import re

from modgrammar import Terminal, GrammarClass, OPTIONAL, WORD
from modgrammar import util

__all__ = [
    "QuotedString", "Integer", "PositiveInteger", "RE",
]

def RE(regexp, **kwargs):
    cdict = util.make_classdict(REGrammar, (), kwargs, regexp=regexp)
    return GrammarClass("<RE>", (REGrammar,), cdict)

_recaret_re = re.compile(r"(^|[^[])\^")

class REGrammar(Terminal):
    regexp = None

    @classmethod
    def __class_init__(cls, attrs):
        if isinstance(cls.regexp, str):
            cls.regexp = re.compile(cls.regexp, re.MULTILINE)
        if cls.regexp and _recaret_re.search(cls.regexp.pattern):
            cls.boltest = True
        else:
            cls.boltest = False
        if "grammar_name" not in attrs:
            if cls.regexp is not None:
                cls.grammar_name = "RE({0!r})".format(cls.regexp.pattern)
            else:
                cls.grammar_name = None

    @classmethod
    def grammar_parse(cls, text, index, sessiondata):
        while True:
            string = text.string
            if index == 0 and cls.boltest and not text.bol:
                # This will make sure that a "^" in the pattern can't match on the
                # beginning of the text.
                string = " " + string
                index = 1
            m = cls.regexp.match(string, index)
            if not m:
                break
            end = m.end()
            if end < len(string) or text.eof:
                yield (end - index, cls(string[index:end]))
                break
            else:
                # We need more text before we can be sure we"re at the end.
                text = yield (None, None)
        yield util.error_result(index, cls)

    @classmethod
    def grammar_ebnf_lhs(cls, opts):
        return (util.ebnf_specialseq(cls, opts), ())

    @classmethod
    def grammar_ebnf_rhs(cls, opts):
        return None

class QuotedString(Terminal):
    grammar_desc = "quoted string"
    quote_char = "'"
    newline_ok = False

    @classmethod
    def __class_init__(cls, attrs):
        if cls.newline_ok:
            regexp = r"([^" + cls.quote_char + r"\\]+|\\.)*"
        else:
            regexp = r"([^" + cls.quote_char + r"\n\\]+|\\.)*"
        cls.grammar = util.regularize((cls.quote_char, RE(regexp), cls.quote_char))
        cls.grammar_min = len(cls.grammar)
        cls.grammar_max = len(cls.grammar)

    def elem_init(self, sessiondata):
        contents = self.elements[1].string
        self.value = re.sub(r"\\(.)", r"\1", contents)

    def __repr__(self):
        return "{0.__class__.__name__}<{0.string}>".format(self)

class Integer(Terminal):
    grammar = (OPTIONAL('-'), WORD('0-9'))

    def elem_init(self, sessiondata):
        self.value = int(self.string)

class PositiveInteger(Integer):
    grammar = (WORD('0-9'))

redpajama_set_name: RedPajamaGithub


text:
module RuboCop
  module Cop
    module Cask
      # Common functionality for checking url stanzas.
      module OnUrlStanza
        extend Forwardable
        include CaskHelp

        def on_cask(cask_block)
          @cask_block = cask_block

          toplevel_stanzas.select(&:url?).each do |stanza|
            on_url_stanza(stanza)
          end
        end

        private

        attr_reader :cask_block

        def_delegators :cask_block,
                       :toplevel_stanzas
      end
    end
  end
end


text:
package org.openflow.protocol.meter;

import java.nio.ByteBuffer;

import org.openflow.util.U8;
import org.openflow.util.U16;

/**
 * Corresponds to the struct struct ofp_meter_band_dscp_remark OpenFlow structure
 *
 * @author Srini Seetharaman (srini.seetharaman@gmail.com)
 */
public class OFMeterBandDSCPRemark extends OFMeterBand {
    public static int MINIMUM_LENGTH = 16;

    protected byte precedenceLevel;

    /**
     *
     */
    public OFMeterBandDSCPRemark() {
        super();
        this.type = OFMeterBandType.DSCP_REMARK;
        this.length = U16.t(MINIMUM_LENGTH);
    }

    /**
     * @return the precedenceLevel
     */
    public byte getPrecedenceLevel() {
        return precedenceLevel;
    }

    /**
     * @param precedenceLevel the precedenceLevel to set
     */
    public OFMeterBandDSCPRemark setPrecedenceLevel(byte precedenceLevel) {
        this.precedenceLevel = precedenceLevel;
        return this;
    }

    @Override
    public void readFrom(ByteBuffer data) {
        super.readFrom(data);
        this.precedenceLevel = data.get();
        data.getInt(); // pad
        data.getShort(); // pad
    }

    @Override
    public void writeTo(ByteBuffer data) {
        super.writeTo(data);
        data.put(this.precedenceLevel);
        data.putInt(0); // pad
        data.putShort((byte) 0); // pad
    }

    @Override
    public int hashCode() {
        final int prime = 3259;
        int result = super.hashCode();
        result = prime * result + precedenceLevel;
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!super.equals(obj))
            return false;
        if (!(obj instanceof OFMeterBandDSCPRemark))
            return false;
        OFMeterBandDSCPRemark other = (OFMeterBandDSCPRemark) obj;
        if (precedenceLevel != other.precedenceLevel)
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "OFMeterBandDSCPRemark [type=" + type + ", length=" + length + ", rate=" + rate +
            ",burstSize=" + burstSize + ", precedenceLevel=" + U8.f(precedenceLevel) + "]";
    }
}


text:
layout: default_full_body
---
{%- assign news_path_pattern = "_news/" | append: page.team -%}
{%- assign news = site.news | where_exp: 'item', 'item.path contains news_path_pattern' -%}
{%- assign news = news | concat: site.data[page.team].news | sort: 'date' | reverse -%}
{%- assign fancy_announcements = news | where: 'fancy', true | unshift: site.data[page.team].data.team_home_fancy_announcement -%}

        {% include _content/team_home_slider.html announcements=fancy_announcements %}

        Coming soon...


text:
/***** includes *****/
#include "lfds700_ringbuffer_internal.h"

/***** private prototypes *****/
static void lfds700_ringbuffer_internal_validate( struct lfds700_ringbuffer_state *rs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_queue_validity, enum lfds700_misc_validity *lfds700_freelist_validity );

/****************************************************************************/
void lfds700_ringbuffer_query( struct lfds700_ringbuffer_state *rs, enum lfds700_ringbuffer_query query_type, void *query_input, void *query_output )
{
  LFDS700_PAL_ASSERT( rs != NULL );
  // TRD : query_type can be any value in its range

  LFDS700_MISC_BARRIER_LOAD;

  switch( query_type )
  {
    case LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_GET_COUNT:
      LFDS700_PAL_ASSERT( query_input == NULL );
      LFDS700_PAL_ASSERT( query_output != NULL );

      lfds700_queue_query( &rs->qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_GET_COUNT, NULL, query_output );
    break;

    case LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_VALIDATE:
      // TRD : query_input can be NULL
      LFDS700_PAL_ASSERT( query_output != NULL );

      lfds700_ringbuffer_internal_validate( rs, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output, ((enum lfds700_misc_validity *) query_output)+1 );
    break;
  }

  return;
}

/****************************************************************************/
static void lfds700_ringbuffer_internal_validate( struct lfds700_ringbuffer_state *rs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_queue_validity, enum lfds700_misc_validity *lfds700_freelist_validity )
{
  LFDS700_PAL_ASSERT( rs != NULL );
  // TRD : vi can be NULL
  LFDS700_PAL_ASSERT( lfds700_queue_validity != NULL );
  LFDS700_PAL_ASSERT( lfds700_freelist_validity != NULL );

  if( vi == NULL )
  {
    lfds700_queue_query( &rs->qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, NULL, lfds700_queue_validity );
    lfds700_freelist_query( &rs->fs, LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE, NULL, lfds700_freelist_validity );
  }

  if( vi != NULL )
  {
    struct lfds700_misc_validation_info
      freelist_vi,
      queue_vi;

    queue_vi.min_elements = 0;
    freelist_vi.min_elements = 0;
    queue_vi.max_elements = vi->max_elements;
    freelist_vi.max_elements = vi->max_elements;

    lfds700_queue_query( &rs->qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, &queue_vi, lfds700_queue_validity );
    lfds700_freelist_query( &rs->fs, LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE, &freelist_vi, lfds700_freelist_validity );
  }

  return;
}


text:
/**
 * A login represents an organization or a user
 */
export interface Login {
  name: string;
  avatarUrl: string;
}


text:
package br.com.fip.gati.revistaonline.domain.repositorio;

import java.util.List;

import br.com.fip.gati.revistaonline.domain.model.Artigo;
import br.com.fip.gati.revistaonline.domain.model.AvaliacaoArtigo;
import br.com.fip.gati.revistaonline.domain.model.Avaliador;

public interface AvaliacaoRepositorio extends Repositorio<AvaliacaoArtigo> {

	public AvaliacaoArtigo getAvaliacao(Avaliador avaliador);
	public List<AvaliacaoArtigo> getAvaliacoesPendente(Avaliador avaliador);
	public AvaliacaoArtigo getAvaliacaoPorAutor(Artigo artigo);
	public List<AvaliacaoArtigo> getAvaliacoesConcluidas(Avaliador avaliador);
}


text:
Package.describe({
  name: 'vulcan:errors',
  summary: 'Vulcan error tracking package',
  version: '1.16.9',
  git: 'https://github.com/VulcanJS/Vulcan.git',
});

Package.onUse(function(api) {
  api.use(['vulcan:core@=1.16.9']);

  api.mainModule('lib/server/main.js', 'server');
  api.mainModule('lib/client/main.js', 'client');
});


text:
GENERATED_FILES = \
	d3.geo.projection.js \
	d3.geo.projection.min.js \
	bower.json

all: $(GENERATED_FILES)

.PHONY: clean all test

test:
	npm test

d3.geo.projection.js: $(shell node_modules/.bin/smash --ignore-missing --list src/index.js) package.json
	rm -f $@
	node_modules/.bin/smash src/index.js | node_modules/.bin/uglifyjs - -b indent-level=2 -o $@
	chmod a-w $@

d3.geo.projection.min.js: d3.geo.projection.js
	rm -f $@
	node_modules/.bin/uglifyjs $< -c -m -o $@

bower.json: bin/bower package.json
	rm -f $@
	bin/bower > $@
	chmod a-w $@

clean:
	rm -f -- $(GENERATED_FILES)


text:
/**
* @author Vera Y. Petrashkova
* @version $Revision$
*/

package javax.crypto;

import java.security.Key;
import java.security.InvalidKeyException;
import java.security.InvalidAlgorithmParameterException;
import java.security.spec.AlgorithmParameterSpec;
import java.nio.ByteBuffer;

/**
 * @com.intel.drl.spec_ref
 *
 */

public abstract class MacSpi {
    /**
     * @com.intel.drl.spec_ref
     *
     */
    public MacSpi() {
    }

    /**
     * @com.intel.drl.spec_ref
     *
     */
    protected abstract int engineGetMacLength();

    /**
     * @com.intel.drl.spec_ref
     *
     */
    protected abstract void engineInit(Key key, AlgorithmParameterSpec params)
            throws InvalidKeyException, InvalidAlgorithmParameterException;

    /**
     * @com.intel.drl.spec_ref
     *
     */
    protected abstract void engineUpdate(byte input);

    /**
     * @com.intel.drl.spec_ref
     *
     */
    protected abstract void engineUpdate(byte[] input, int offset, int len);

    /**
     * @com.intel.drl.spec_ref
     *
     */
    protected void engineUpdate(ByteBuffer input) {
        if (!input.hasRemaining()) {
            return;
        }
        byte[] bInput;
        if (input.hasArray()) {
            bInput = input.array();
            int offset = input.arrayOffset();
            int position = input.position();
            int limit = input.limit();
            engineUpdate(bInput, offset + position, limit - position);
            input.position(limit);
        } else {
            bInput = new byte[input.limit() - input.position()];
            input.get(bInput);
            engineUpdate(bInput, 0, bInput.length);
        }
    }

    /**
     * @com.intel.drl.spec_ref
     *
     */
    protected abstract byte[] engineDoFinal();

    /**
     * @com.intel.drl.spec_ref
     *
     */
    protected abstract void engineReset();

    /**
     * @com.intel.drl.spec_ref
     *
     */
    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}


text:
<!DOCTYPE html>

    <meta name="project_path" value="/java/docs/reference/_project.yaml">
    <meta name="book_path" value="/java/docs/reference/cloud.google.com/java/latest/_book.yaml">

    {% verbatim %}

Interface CreateCustomClassRequestOrBuilder (2.0.0)

public interface CreateCustomClassRequestOrBuilder extends MessageOrBuilder

Implements

    MessageOrBuilder

Methods

getCustomClass()

public abstract CustomClass getCustomClass()

 Required. The custom class to create.

 .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED];

  Returns

        Type
        Description

        CustomClass

The customClass.

getCustomClassId()

public abstract String getCustomClassId()

 Required. The ID to use for the custom class, which will become the final
 component of the custom class' resource name.
 This value should be 4-63 characters, and valid characters
 are /a-z-/.

 string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED];

  Returns

        Type
        Description

        String

The customClassId.

getCustomClassIdBytes()

public abstract ByteString getCustomClassIdBytes()

 Required. The ID to use for the custom class, which will become the final
 component of the custom class' resource name.
 This value should be 4-63 characters, and valid characters
 are /a-z-/.

 string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED];

  Returns

        Type
        Description

        ByteString

The bytes for customClassId.

getCustomClassOrBuilder()

public abstract CustomClassOrBuilder getCustomClassOrBuilder()

 Required. The custom class to create.

 .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED];

  Returns

        Type
        Description

        CustomClassOrBuilder

getParent()

public abstract String getParent()

 Required. The parent resource where this custom class will be created.
 Format:
 {api_version}/projects/{project}/locations/{location}/customClasses

 string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

  Returns

        Type
        Description

        String

The parent.

getParentBytes()

public abstract ByteString getParentBytes()

 Required. The parent resource where this custom class will be created.
 Format:
 {api_version}/projects/{project}/locations/{location}/customClasses

 string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

  Returns

        Type
        Description

        ByteString

The bytes for parent.

hasCustomClass()

public abstract boolean hasCustomClass()

 Required. The custom class to create.

 .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED];

  Returns

        Type
        Description

        boolean

Whether the customClass field is set.

    {% endverbatim %}


text:
Messages can be set with an optional *time to live* when sending them.

Apache ActiveMQ Artemis will not deliver a message to a consumer after it's
time to live has been exceeded. If the message hasn't been delivered by the
time that time to live is reached the server can discard it.

Apache ActiveMQ Artemis's addresses can be assigned an expiry address so that,
when messages are expired, they are removed from the queue and sent to the
expiry address. Many different queues can be bound to an expiry address.  These
*expired* messages can later be consumed for further inspection.

## Core API

Using Apache ActiveMQ Artemis Core API, you can set an expiration time directly
on the message:

```java
// message will expire in 5000ms from now
message.setExpiration(System.currentTimeMillis() + 5000);
```

JMS MessageProducer allows to set a TimeToLive for the messages it sent:

```java
// messages sent by this producer will be retained for 5s (5000ms) before expiration
producer.setTimeToLive(5000);
```

Expired messages which are consumed from an expiry address have the following
properties:

- `_AMQ_ORIG_ADDRESS`

  a String property containing the *original address* of the expired
  message

- `_AMQ_ORIG_QUEUE`

  a String property containing the *original queue* of the expired
  message

- `_AMQ_ACTUAL_EXPIRY`

  a Long property containing the *actual expiration time* of the
  expired message

## Configuring Expiry Delay

Default Expiry delay can be configured in the address-setting configuration:

```xml
<!-- expired messages in exampleQueue will be sent to the expiry address expiryQueue -->
<address-setting match="exampleQueue">
   <expiry-delay>10</expiry-delay>
</address-setting>
```

`expiry-delay` defines the expiration time in milliseconds that will be used for messages
which are using the default expiration time (i.e. 0).

For example, if `expiry-delay` is set to "10" and a message which is using the default
expiration time (i.e.10) arrives then its expiration time of "0" will be changed to "10."
However, if a message which is using an expiration time of "20" arrives then its expiration
time will remain unchanged. Setting `expiry-delay` to "-1" will disable this feature.

The default is "-1".

## Configuring Expiry Addresses

Expiry address are defined in the address-setting configuration:

```xml
<!-- expired messages in exampleQueue will be sent to the expiry address expiryQueue -->
<address-setting match="exampleQueue">
   <expiry-address>expiryQueue</expiry-address>
</address-setting>
```

If messages are expired and no expiry address is specified, messages are simply
removed from the queue and dropped. Address [wildcards](wildcard-syntax.md) can
be used to configure expiry address for a set of addresses.

## Configuring The Expiry Reaper Thread

A reaper thread will periodically inspect the queues to check if messages have
expired.

The reaper thread can be configured with the following properties in
`broker.xml`

- `message-expiry-scan-period`

  How often the queues will be scanned to detect expired messages (in
  milliseconds, default is 30000ms, set to `-1` to disable the reaper thread)

- `message-expiry-thread-priority`

  The reaper thread priority (it must be between 1 and 10, 10 being the highest
  priority, default is 3)

## Example

See the [Message Expiration Example](examples.md#message-expiration) which
shows how message expiry is configured and used with JMS.


text:
dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require File.join(dir, 'active_request')

class Post < ActiveRequest::Base

  def self.model_name
    "post"
  end

  attr_accessor :id, :title, :body

  belongs_to :blog

end


text:
ARG BASE_IMAGE=latest
FROM chialab/php:${BASE_IMAGE}
LABEL maintainer="dev@chialab.io"

# Install XHProf.
RUN install-php-extensions xhprof


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gov.hhs.fha.nhinc.presentationservices.helpers;

import java.util.List;
import java.util.Map;

/**
 *
 * @author jharby
 */
public class ParameterValidator {

    private Map<String, Object> fieldMap;

    public ParameterValidator(Map fieldMap) {
        this.fieldMap = fieldMap;
    }

    public String validateMissingOrEmpty() {
        if (fieldMap.isEmpty()) {
            return "No fields in map to validate";
        }
        StringBuilder failures = new StringBuilder();
        for (String name : fieldMap.keySet()) {
            if (fieldMap.get(name) == null) {
                failures.append(name + " ");
                continue;
            }
            if (fieldMap.get(name) instanceof java.lang.String) {
                String value = (String) fieldMap.get(name);
                if (value.isEmpty()) {
                    failures.append(name + " ");
                }
            }
            else if(fieldMap.get(name) instanceof java.util.List) {
                List value = (List) fieldMap.get(name);
                if (value == null) {
                    failures.append(name + " ");
                }
            }
        }
        return failures.toString();
    }
}


text:
<?php

namespace Trinity\AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * AccountBanned
 *
 * @ORM\Table(name="account_banned")
 * @ORM\Entity
 */
class AccountBanned
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     */
    private $id;

    /**
     * @var integer
     *
     * @ORM\Column(name="bandate", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     */
    private $bandate;

    /**
     * @var integer
     *
     * @ORM\Column(name="unbandate", type="integer", nullable=false)
     */
    private $unbandate;

    /**
     * @var string
     *
     * @ORM\Column(name="bannedby", type="string", length=50, nullable=false)
     */
    private $bannedby;

    /**
     * @var string
     *
     * @ORM\Column(name="banreason", type="string", length=255, nullable=false)
     */
    private $banreason;

    /**
     * @var boolean
     *
     * @ORM\Column(name="active", type="boolean", nullable=false)
     */
    private $active;

    /**
     * Set id
     *
     * @param integer $id
     * @return AccountBanned
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set bandate
     *
     * @param integer $bandate
     * @return AccountBanned
     */
    public function setBandate($bandate)
    {
        $this->bandate = $bandate;

        return $this;
    }

    /**
     * Get bandate
     *
     * @return integer
     */
    public function getBandate()
    {
        return $this->bandate;
    }

    /**
     * Set unbandate
     *
     * @param integer $unbandate
     * @return AccountBanned
     */
    public function setUnbandate($unbandate)
    {
        $this->unbandate = $unbandate;

        return $this;
    }

    /**
     * Get unbandate
     *
     * @return integer
     */
    public function getUnbandate()
    {
        return $this->unbandate;
    }

    /**
     * Set bannedby
     *
     * @param string $bannedby
     * @return AccountBanned
     */
    public function setBannedby($bannedby)
    {
        $this->bannedby = $bannedby;

        return $this;
    }

    /**
     * Get bannedby
     *
     * @return string
     */
    public function getBannedby()
    {
        return $this->bannedby;
    }

    /**
     * Set banreason
     *
     * @param string $banreason
     * @return AccountBanned
     */
    public function setBanreason($banreason)
    {
        $this->banreason = $banreason;

        return $this;
    }

    /**
     * Get banreason
     *
     * @return string
     */
    public function getBanreason()
    {
        return $this->banreason;
    }

    /**
     * Set active
     *
     * @param boolean $active
     * @return AccountBanned
     */
    public function setActive($active)
    {
        $this->active = $active;

        return $this;
    }

    /**
     * Get active
     *
     * @return boolean
     */
    public function getActive()
    {
        return $this->active;
    }
}


text:
  background-image: url(../../images/cat-icons.png);
}

.ballot .step-category .icon .img {
  background-image: url(../../images/cat-icons.png);
  background-position-x: -65px;
  content: "";
  display: block;
  height: 40px;
  margin-top: -20px;
  position: absolute;
  top: 50%;
  width: 40px;
}

.ac-custom input[type="checkbox"] {
  left: 15px;
  position: absolute;
}


text:
package io.github.codecademyminecraftmods.atlantismod.thedeep;

import io.github.codecademyminecraftmods.atlantismod.AtlantisMod;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.IChunkProvider;

public class WorldProviderTheDeep extends WorldProvider {

	@Override
	public String getDimensionName() {
		return "The Deep";
	}

	public void registerWorldChunkManager() {
		this.worldChunkMgr = new WorldChunkManagerHell(AtlantisMod.darkOcean, 0.0F);
		this.dimensionId = AtlantisMod.dimensionDeepID;
	}

	public IChunkProvider createChunkGenerator() {
		return new ChunkProviderTheDeep(this.worldObj, this.worldObj.getSeed(), false);
	}

}


text:
Description / Rationale
===================

This is a new CassandraState implementation built on the CQL java driver.  For Cassandra, CQL has better support for lightweight transacations, batching, and collections.  Also, CQL will likely get more attention than the legacy Thrift interface.  For these reasons, we decided to create a C* state implementation built on CQL.

Storm-Cassandra-Cql provides three different state implementations:
* CassandraCqlState : Simply maps tuples to statements with batching capabilities.
* CassandraCqlMapState : Provides an IBackingMap implementation for use with keys/values and aggregations in Storm.
* CassandraCqlIncrementalState : Leverages conditional updates to perform dimensional aggregations on data incrementally. (each batch constitutes an increment)

Design
===================
An application/topology provides implementations of the mapper interfaces.
For example, the [CqlRowMapper](https://github.com/hmsonline/storm-cassandra-cql/blob/master/src/main/java/com/hmsonline/trident/cql/mappers/CqlRowMapper.java) provides a bidirectional mapping from Keys and Values to statements that can be used to upsert and retrieve data.

The mappers are used to translate between Storm constructs and CQL constructs.  Storm uses the state factories to create state objects.  Updaters then use the mappers to update the state objects.  State is then committed on a per batch basis.

Getting Started
===================
You can use the examples to get started.  For the example, you'll want to run a local cassandra instance with the example schema found in
[schema.cql](https://github.com/hmsonline/storm-cassandra-cql/blob/master/src/test/resources/schema.cql).

You can do this using cqlsh:

```
cat storm-cassandra-cql/src/test/resources/create_keyspace.cql | cqlsh
cat storm-cassandra-cql/src/test/resources/schema.cql | cqlsh
```

## SimpleUpdateTopology (CassandraCqlState)

The SimpleUpdateTopology simply emits integers (0-99) and writes those to Cassandra with the current timestamp % 10.  The values are written to the table: mytable.

This is persistence from the topology:
```java
   inputStream.partitionPersist(new CassandraCqlStateFactory(ConsistencyLevel.ONE), new Fields("test"), new CassandraCqlStateUpdater(mapper));
```

During a partition persist, Storm repeatedly calls `updateState()` on the CassandraCqlStateUpdater to update a state object for the batch.  The updater uses the mapper to convert the tuple into a CQL statement, and caches the CQL statement in a CassandraCqlState object.  When the batch is complete, Storm calls commit on the state object, which then executes all of the CQL statements as a batch.

See:
* [CassandraCqlStateUpdater.updateState](https://github.com/hmsonline/storm-cassandra-cql/blob/master/src/main/java/com/hmsonline/trident/cql/CassandraCqlStateUpdater.java#L37-L41)
* [CassandraCqlState.commit](https://github.com/hmsonline/storm-cassandra-cql/blob/master/src/main/java/com/hmsonline/trident/cql/CassandraCqlState.java#L39-L56)

The SimpleUpdateMapper looks like this:

```java
public class SimpleUpdateMapper implements CqlRowMapper<Object, Object>, Serializable {
    public Statement map(TridentTuple tuple) {
        long t = System.currentTimeMillis() % 10;
        Update statement = update("mykeyspace", "mytable");
        statement.with(set("col1", tuple.getString(0))).where(eq("t", t));
        return statement;
    }
```

As you can see, it maps tuples to update statements.

When you run the `main()` method in the SimpleUpdateTopology, you should get results in mytable that look like this:

```
 t | col1
---+------
 5 |   97
 1 |   99
 8 |   99
 0 |   99
 2 |   99
 4 |   99
 7 |   99
 6 |   99
 9 |   99
 3 |   99
```

## WordCountTopology (CassandraCqlMapState)
The WordCountTopology is slightly more complex in that it uses the CassandraCqlMapState.  The map state assumes you are reading/writing keys and values.
The topology emits words from two different sources, and then totals the words by source and persists the count to Cassandra.

The CassandraCqlMapState object implements the IBackingMap interface in Storm.
See:
[Blog on the use of IBackingMap](https://svendvanderveken.wordpress.com/2013/07/30/scalable-real-time-state-update-with-storm/)

Have a look at the [WordCountTopology](https://github.com/hmsonline/storm-cassandra-cql/blob/master/src/test/java/com/hmsonline/trident/cql/example/wordcount/WordCountTopology.java).

It uses a FixedBatchSpout that emits sentences over and over again:

```java
   FixedBatchSpout spout1 = new FixedBatchSpout(new Fields("sentence"), 3,
      new Values("the cow jumped over the moon"),
      new Values("the man went to the store and bought some candy"),
      new Values("four score and seven years ago"),
      new Values("how many apples can you eat"));
   spout1.setCycle(true);
```

Then, it splits and groups those words:

```java
TridentState wordCounts =
                topology.newStream("spout1", spout1)
                        .each(new Fields("sentence"), new Split(), new Fields("word"))
                        .groupBy(new Fields("word"))
                        .persistentAggregate(CassandraCqlMapState.nonTransactional(new WordCountMapper()),
                                new IntegerCount(), new Fields("count"))
                        .parallelismHint(6);
```

Instead of a partitionPersist like the other topology, this topology aggregates first, using the persistentAggregate method.  This performs an aggregation, storing the results in the CassandraCqlMapState, on which Storm eventually calls multiPut/multiGet to store/read values.

See:
[CassandraCqlMapState.multiPut/Get](https://github.com/hmsonline/storm-cassandra-cql/blob/master/src/main/java/com/hmsonline/trident/cql/CassandraCqlMapState.java#L122-L187)

In this case, the mapper maps keys and values to CQL statements:

```java
    @Override
    public Statement map(List<String> keys, Number value) {
        Insert statement = QueryBuilder.insertInto(KEYSPACE_NAME, TABLE_NAME);
        statement.value(WORD_KEY_NAME, keys.get(0));
        statement.value(SOURCE_KEY_NAME, keys.get(1));
        statement.value(VALUE_NAME, value);
        return statement;
    }

    @Override
    public Statement retrieve(List<String> keys) {
        // Retrieve all the columns associated with the keys
        Select statement = QueryBuilder.select().column(SOURCE_KEY_NAME)
                .column(WORD_KEY_NAME).column(VALUE_NAME)
                .from(KEYSPACE_NAME, TABLE_NAME);
        statement.where(QueryBuilder.eq(SOURCE_KEY_NAME, keys.get(0)));
        statement.where(QueryBuilder.eq(WORD_KEY_NAME, keys.get(1)));
        return statement;
    }
```

When you run this example, you will find the following counts in Cassandra:

```
cqlsh> select * from mykeyspace.wordcounttable;

 source | word   | count
--------+--------+-------
 spout2 |      a |    73
 spout2 |    ago |    74
 spout2 |    and |    74
 spout2 | apples |    69
...
 spout1 |   some |    74
 spout1 |  store |    74
 spout1 |    the |   296
 spout1 |     to |    74
 spout1 |   went |    74
```

## SalesTopology (CassandraCqlIncrementalState)
The SalesTopology demonstrates the use of Cassandra for incremental data aggregation.  The emitter/spout simulates sales of products across states.  It emits three fields: state, product and price.  The state object incorporates an aggregator, and aggregates values as tuples are processed.  It then flushes the aggregate values to Cassandra, by first reading the current value, incorporating the new value, and then writing the new value using a conditional update.

Here is the topolgy:

```java
   Stream inputStream = topology.newStream("sales", spout);
   SalesMapper mapper = new SalesMapper();
   inputStream.partitionPersist(
      new CassandraCqlIncrementalStateFactory<String, Number>(new Sum(), mapper),
      new Fields("price", "state", "product"),
      new CassandraCqlIncrementalStateUpdater<String, Number>());
```

Notice that the constructor for the state factory takes an aggregation, along with the mapper.  As the updater processes the tuples, the aggregator is used to maintain aggregate values based on the keys. The updater users a standard mapper.  For this example, the mapper is as follows:

```java
    @Override
    public Statement read(String key) {
        Select statement = select().column(VALUE_NAME).from(KEYSPACE_NAME, TABLE_NAME);
        statement.where(eq(KEY_NAME, key));
        return statement;
    }

    @Override
    public Statement update(String key, Number value, PersistedState<Number> state, long txid, int partition) {
        Update update = QueryBuilder.update(KEYSPACE_NAME, TABLE_NAME);
        update.with(set(VALUE_NAME, value)).where(eq(KEY_NAME, key));
        if (state.getValue() != null) {
            update.onlyIf(eq(VALUE_NAME, state.getValue()));
        }
        return update;
    }

    @Override
    public SalesState currentState(String key, List<Row> rows) {
        if (rows.size() == 0) {
            return new SalesState(null, null);
        } else {
            return new SalesState(rows.get(0).getInt(VALUE_NAME), "");
        }
    }

    @Override
    public String getKey(TridentTuple tuple) {
        String state = tuple.getString(1);
        return state;
    }

    @Override
    public Number getValue(TridentTuple tuple) {
        return tuple.getInteger(0);
    }
```

Notice the update statement includes a condition.  Also notice that the mapper provides a way to retrieve the relevant key and value from the tuple.  These methods are used by the updater to get the key and value to incorporate into the aggregation.

Configuration
===================
You will likely need to configure various properties of the CQL client/cluster.  To do that, you use the MapConfiguredCqlClientFactory.  Populate a map with the configuration parameters.  Storm then passes that configuration along to the StateFactory, which uses that configuration to construct the client factory.  You can set things like read timeouts, etc.

For an example, take a look at:
[MapConfiguredCqlClientFactory](https://github.com/hmsonline/storm-cassandra-cql/blob/master/src/test/java/com/hmsonline/trident/cql/MapConfiguredCqlClientFactoryTest.java#L16-L24)