text:
var fireImage = new Image();

var lavaImage = new Image();
var lavaPattern = null;

var sandImage = new Image();
var sandPattern = null;

var debug = false;

function Game() {
	this.volume = localStorage["game-volume"];

	this.ctx = document.getElementById("canvas").getContext("2d");
	this.gameWidth = 700;
	this.gameHeight = 700;
	this.ws = null;
	this.container = null;
	this.serverLocation = window.location.hostname + ':8081';
	this.music = null;
	this.currentWaveNumber = null;

	this.playerId = null;
	this.playerLevel = 1;
	this.playerSprite = null;
	this.spriteList = [];
	this.mouseX = 0;
	this.mouseY = 0;

	initParticleSystem(document.getElementById("canvas"));

	if (debug) {
		this.debugMessageLength = 0;
		this.debugMessageInitTime = 0;
	}

	var tmpGame = this;

	this.music = this.playMusic("theme-menu.mp3");

	fireImage.src = "images/map-assets/fire.png";
	lavaImage.onload = function() {
		lavaPattern = tmpGame.ctx.createPattern(this, 'repeat');
	}
	lavaImage.src = "images/map-assets/lava.png";
	sandImage.onload = function() {
		sandImage = tmpGame.ctx.createPattern(this, 'repeat');
	}
	sandImage.src = "images/map-assets/sand.png";

	document.getElementById("canvas").onclick = function (e) {
		game.click(e.pageX - document.getElementById("canvas").offsetLeft,
				   e.pageY - document.getElementById("canvas").offsetTop) ;
	}

	document.getElementById("canvas").onmousemove = function (e) {
		game.mouseX = e.pageX - document.getElementById("canvas").offsetLeft;
		game.mouseY = e.pageY - document.getElementById("canvas").offsetTop;
	}

	document.oncontextmenu = function (e) {
		e.preventDefault();
	}

	document.getElementById("canvas").oncontextmenu = function (e) {
		e.preventDefault();

		if (game.ws != null) {
			game.rightClick(e.pageX - document.getElementById("canvas").offsetLeft,
				   		  	e.pageY - document.getElementById("canvas").offsetTop);
		}
	}

	document.onkeyup = function (e) {
		if (game.ws != null) {
			game.actionKey(e.which);
		}
	}
}

Game.prototype.playSound = function(path) {
	this.soundId++;

	var audio = document.createElement("audio");
	audio.setAttribute("autoplay","autoplay");
	audio.src ='sound/' + path;
	audio.volume = this.volume;
	document.body.appendChild(audio);

	audio.addEventListener('ended', function () {
		document.body.removeChild(audio);
	});

	return audio;
};

Game.prototype.updateVolume = function(level) {
	if (game.music != null) {
		game.music.volume = level;
	}

	game.volume = level;
}

Game.prototype.playMusic = function(path) {
	this.soundId++;

	var audio = document.createElement("audio");
	audio.setAttribute("autoplay","autoplay");
	audio.src ='music/' + path;
	audio.volume = this.volume;
	document.body.appendChild(audio);

	audio.addEventListener('ended', function () {
		document.body.removeChild(audio);
	});

	return audio;
};

Game.prototype.connect = function(username, playerType) {
	this.ws = new WebSocket('ws://' + this.serverLocation);
	this.playerId = null;

	this.ws.onopen = function(){
		game.send( {
			type 		: "INIT",
			username 	: username,
			playerType 	: playerType
		});
	}

	this.ws.onmessage = function(e){
		if (debug) {
			game.debugMessageLength += e.data.length;
		}

		var serverMessage = JSON.parse(e.data);

		if (serverMessage.type == "SET_PLAYER_ID") {
			game.playerId = serverMessage.id;

			game.gameActionBar = new GameActionBar();
			game.gameDataBar = new GameDataBar();

			$(".gui").animate({
				opacity:1
			}, 1000);

			createExplosion(game.gameWidth/2, 120, 30, "#000000", '#000000');
		}
		else if (serverMessage.type == "GAME_STATE_UPDATE") {
			if (game.music != null) {
				game.music.pause();
				game.music.remove();
				game.music = null;
			}
			game.level = new (window[serverMessage.level.name])();
			game.level.commonInit();
			game.level.initLandscape();
			game.maxWaveNumber = serverMessage.maxWaveNumber;
			game.currentWaveNumber = serverMessage.waveNumber;
			game.showMessage("Wave " + serverMessage.waveNumber, "white");

			for (var i = 0; i < serverMessage.level.spriteList.length; i++) {
				var sprite = new (window[serverMessage.level.spriteList[i].type])();
				sprite.copy(serverMessage.level.spriteList[i]);
				sprite.loadUI();
				game.level.spriteList.push(sprite);

				if (sprite.data.id == game.playerId) {
					game.playerSprite = sprite;
				}
			}

			if (game.level.getMusic() != null) {
				game.music = game.playMusic(game.level.getMusic());
			}
		}
		else if (serverMessage.type == "UPDATE_SPRITE_PATH") {
			for (var i = 0; i < game.level.spriteList.length; i++) {
				if (game.level.spriteList[i].data.id == serverMessage.fromSpriteId) {
					var firstPoint = serverMessage.path.shift();

					game.level.spriteList[i].data.path = serverMessage.path;
					game.level.spriteList[i].data.destX = firstPoint.x;
					game.level.spriteList[i].data.destY = firstPoint.y;
					break;
				}
			}
		}
		else if (serverMessage.type == "SPRITE_STATE_UPDATE") {
			var found = false;

			for (var i = 0; i < game.level.spriteList.length; i++) {
				if (game.level.spriteList[i].data.id == serverMessage.sprite.data.id) {
					var spriteUI = game.level.spriteList[i].spriteUI;
					game.level.spriteList[i].copy(serverMessage.sprite);
					game.level.spriteList[i].loadUI();
					game.level.spriteList[i].spriteUI = spriteUI;
					found = true;
					break;
				}
			}

			if (!found) {
				var sprite = new (window[serverMessage.sprite.type])();
				sprite.copy(serverMessage.sprite);
				sprite.loadUI();
				game.level.spriteList.push(sprite);
			}

			if (game.playerSprite.data.level > game.playerLevel) {
				game.playerLevel = game.playerSprite.data.level;
				game.showMessage("! LEVEL UP !", "green");
				createExplosion(game.gameWidth/2, 120, 20, "#00ff00", '#aaaaaa');
			}
			else if (game.playerSprite.data.life == 0 && game.playerAlive) {
				game.showMessage("! YOU DIED !", "red");
				createExplosion(game.gameWidth/2, 120, 20, "#ff0000", '#aaaaaa');
			}

			game.playerAlive = game.playerSprite.data.life > 0;
		}
		else if (serverMessage.type == "HIT") {
			for (var i = 0; i < game.level.spriteList.length; i++) {
				if (game.level.spriteList[i].data.id == serverMessage.fromSpriteId) {
					var previousLife = game.level.spriteList[i].data.life;
					game.level.spriteList[i].data.life = serverMessage.data;

					if (game.level.spriteList[i].data.isPlayer) {
						createBloodSpill(game.level.spriteList[i].data.x, game.level.spriteList[i].data.y);
					}

					if (serverMessage.data <= 0) {
						if (game.level.spriteList[i].getDeathSound() != null) {
							game.playSound(game.level.spriteList[i].getDeathSound());
						}

						game.level.spriteList.splice(i, 1);
					}
					else if (previousLife < serverMessage.data) {
						if (game.level.spriteList[i].getHitSound() != null) {
							game.playSound(game.level.spriteList[i].getHitSound());
						}
					}

					break;
				}
			}
		}
		else if (serverMessage.type == "HEAL") {
			for (var i = 0; i < game.level.spriteList.length; i++) {
				if (game.level.spriteList[i].data.id == serverMessage.fromSpriteId) {
					game.level.spriteList[i].data.life = serverMessage.data;

					break;
				}
			}
		}
		else if (serverMessage.type == "SERVER_INCOMING_MSG") {
			game.showSubMessage(serverMessage.message, serverMessage.color);
		}
	}

	this.ws.onclose = function(){
		game.errorMessage = "SERVER WILL NOT ACCEPT NEW CONNECTIONS, SORRY!";
	}

	this.ws.onerror = function(error){
		game.errorMessage = 'Error detected: ' + error;
	}
}

Game.prototype.showMessage = function(message, color) {
	game.messageToShow = message;
	game.messageColor = color;
	game.messageInitTime = (new Date()).getTime();
};

Game.prototype.showSubMessage = function(message, color) {
	game.subMessageToShow = message;
	game.subMessageColor = color;
	game.subMessageInitTime = (new Date()).getTime();
};

Game.prototype.send = function(data) {
	if (this.level == null || this.playerSprite.isAlive()) {
		this.ws.send(JSON.stringify(data));
	}
}

Game.prototype.click = function(x, y) {
	if (this.playerId != null) {
		for (var i = 0; i < this.level.spriteList.length; i++) {
			var distance = Math.sqrt(Math.pow(x - this.level.spriteList[i].data.x, 2) + Math.pow(y - this.level.spriteList[i].data.y, 2));

			if (distance < this.level.spriteList[i].data.minDistance) {
				this.target = this.level.spriteList[i];
				break;
			}
		};
	}
}

Game.prototype.actionKey = function(code) {
	if (this.playerId != null) {
		var key = null;
		if (code == 49) key = 1;
		else if (code == 50) key = 2;
		else if (code == 51) key = 3;
		else if (code == 52) key = 4;
		else if (code == 53) key = 5;
		else if (code == 54) key = 6;
		else if (code == 55) key = 7;
		else if (code == 56) key = 8;
		else if (code == 57) key = 9;

		if (key != null && this.playerSprite != null && this.playerSprite.data.actions.length >= key) {

			if (this.playerSprite.data.actions[key - 1].isReady()) {
				this.send({
					type : "ACTION_CLICK",
					key : key,
					mouseX : game.mouseX,
					mouseY : game.mouseY,
					toSpriteId : this.target == null ? null : this.target.data.id
				});
			}
		}
	}
}

Game.prototype.actionIconClick = function(idx) {
	this.send({
		type : "ACTION_ICON_CLICKED",
		idx : idx
	});
}

Game.prototype.statIconClick = function(statType) {
	this.send({
		type : "STAT_ICON_CLICKED",
		statType : statType
	});
}

Game.prototype.rightClick = function(x, y) {
	if (this.playerId != null && this.playerSprite != null) {

		for (var i = 0; i < this.level.spriteList.length; i++) {
			var distance = Math.sqrt(Math.pow(x - this.level.spriteList[i].data.x, 2) + Math.pow(y - this.level.spriteList[i].data.y, 2));

			if (distance < this.level.spriteList[i].data.minDistance/1.5) {
				this.target = this.level.spriteList[i];
				break;
			}
		};

		this.send({
			type : "MOVE_TO",
			currX : this.playerSprite.data.x,
			currY : this.playerSprite.data.y,
			destX : x,
			destY : y
		});
	}
}

Game.prototype.tick = function(delta) {
	if (delta == null || delta < 0) {
		delta = 1;
	}

	if (debug && this.level != null) {
		this.debugMessageInitTime += delta;

		if (this.debugMessageInitTime >= 5000) {
			console.log("Messages Length recieved from socket : " + this.debugMessageLength);
			this.debugMessageInitTime = 0;
			this.debugMessageLength = 0;
		}
	}

	this.ctx.fillStyle = "black";
	this.ctx.fillRect(0, 0, this.gameWidth, this.gameHeight);

	if (this.level != null) {
		this.level.draw(this.ctx);
	}

	if (this.level != null) {
		for (var i = 0; i < this.level.spriteList.length; i++) {
			this.level.spriteList[i].tick(delta);

			this.level.spriteList[i].draw(this.ctx);
		}

		for (var i = 0; i < this.level.spriteList.length; i++) {
			this.level.spriteList[i].drawLifeManaBars(this.ctx, this.playerId == this.level.spriteList[i].data.id);
		}

		if (this.messageInitTime != null) {
			var sinceTime = (new Date()).getTime() - this.messageInitTime;

			if (sinceTime < 5000) {
				var percent = 1.0 - sinceTime/5000.0;
				this.ctx.save();
				this.ctx.fillStyle = this.messageColor;
				this.ctx.globalAlpha = percent;
	      		this.ctx.textAlign = 'center';
				this.ctx.font = "60px Arial";
				this.ctx.fillText(game.messageToShow, 350, 100);
				this.ctx.textAlign = 'left';
				this.ctx.restore();
			}
		}

		if (this.subMessageInitTime != null) {
			var sinceTime = (new Date()).getTime() - this.subMessageInitTime;

			if (sinceTime < 3000) {
				var percent = 1.0 - sinceTime/3000.0;
				this.ctx.save();
				this.ctx.fillStyle = this.subMessageColor;
				this.ctx.globalAlpha = percent;
		  		this.ctx.textAlign = 'center';
				this.ctx.font = "30px Arial";
				this.ctx.fillText(game.subMessageToShow, 350, 350);
				this.ctx.textAlign = 'left';
				this.ctx.restore();
			}
		}
	}

	if (this.gameActionBar != null) {
		this.gameActionBar.tick(delta);
	}

	if (this.gameDataBar != null) {
		this.gameDataBar.tick(delta);
	}

	proton.update();

	if (game.errorMessage != null) {
		this.ctx.textAlign = 'center';
		this.ctx.fillStyle = "white";
		this.ctx.font = "12px Arial";
		this.ctx.fillText(game.errorMessage, 350, 300);
		this.ctx.textAlign = 'left';
	}

	if (this.currentWaveNumber != null && this.maxWaveNumber != null) {
		this.ctx.font = "13px Arial";
		this.ctx.fillStyle = "white";
		this.ctx.fillText("Wave #" + this.currentWaveNumber + " (max survived waves = " + this.maxWaveNumber + ")", 10, 680);
	}

}


text:
<?php

namespace Viteloge\CoreBundle\Entity {

    use Doctrine\ORM\Mapping as ORM;
    use Symfony\Component\Validator\Constraints as Assert;
    use Viteloge\CoreBundle\Entity\Base;

    class Messagerie extends Base{

        /**
         * @var integer
         *
         * @ORM\Column(name="id", type="integer")
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        protected $id;

        /**
         * @Assert\Regex(
         *     pattern="/\d/",
         *     match=true,
         *     message="viteloge.assert.phone"
         * )
         * @ORM\Column(name="phone",type="string",length=15, nullable=true)
         */
        protected $phone;

        /**
         * @return Contacts
         */
        protected function updateCreatedAt() {
            $this->date->setDate($this->getYear(), $this->getMonth(), $this->getDay());
            return $this;
        }

        /**
         *
         */
        public function getPhone() {
            return $this->phone;
        }

        /**
         *
         */
        public function setPhone($phone) {
            $this->phone = $phone;
            return $this;
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
package org.sirotin.example.offloader;

import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.Test;

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

import static org.junit.jupiter.api.Assertions.assertEquals;

public class GZipCompressionTest {

    @Test
    public void testRepeatingString_100_100K() {
        testRepeatingStringCompression(100, 100);
    }

    @Test
    public void testRepeatingString_100_400K() {
        testRepeatingStringCompression(100, 400);
    }

    @Test
    public void testRepeatingString_1000_100K() {
        testRepeatingStringCompression(1000, 100);
    }

    @Test
    public void testRepeatingString_1000_400K() {
        testRepeatingStringCompression(1000, 400);
    }

    private void testRepeatingStringCompression(final int itemsInDictionary, final int KB) {
        final List<String> dictionary = new ArrayList<>();
        for(int i = 0; i < itemsInDictionary; ++i) {
            dictionary.add(RandomStringUtils.randomAlphanumeric(16));
        }

        final StringBuilder sb = new StringBuilder(KB * 1024);
        final Random rand = new Random();
        for (int i = 0; i < KB * 1024 / 16; ++i) {
            sb.append(dictionary.get(rand.nextInt(itemsInDictionary)));
        }

        final String data = sb.toString();
        System.out.printf("Data set is build with %d items in dictionary%n", itemsInDictionary);
        compressDecompress(data);
    }

    @Test
    public void testRandomStringCompression_100K() {
        testRandomStringCompression(100);
    }
    @Test
    public void testRandomStringCompression_400K() {
        testRandomStringCompression(400);
    }

    private void testRandomStringCompression(final int KB) {
        final String data = RandomStringUtils.randomAlphanumeric(KB * 1024);
        compressDecompress(data);
    }

    private void compressDecompress(final String data) {
        final String compressed = GZIPCompression.compress(data);
        System.out.printf("Data size: %d : Compressed size: %d%n", data.length(), compressed.length());

        final String decompressed = GZIPCompression.decompress(compressed);
        assertEquals(data, decompressed);
    }
}


text:
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.enterprise.gsafeed;

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

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "meta"
})
@XmlRootElement(name = "metadata")
public class Metadata {

  @XmlAttribute(name = "overwrite-acls")
  protected Boolean overwriteAcls;
  protected List<Meta> meta;

  /**
   * Gets the value of the overwriteAcls property.
   *
   * @return possible object is {@link Boolean}
   */
  public Boolean getOverwriteAcls() {
    return overwriteAcls;
  }

  /**
   * Sets the value of the overwriteAcls property.
   *
   * @param value allowed object is {@link Boolean} or null
   * @return this object
   */
  public Metadata setOverwriteAcls(Boolean value) {
    this.overwriteAcls = value;
    return this;
  }

  /**
   * Gets the value of the meta property.
   *
   *

   * This accessor method returns a reference to the live list,
   * not a snapshot. Therefore any modification you make to the
   * returned list will be present inside the JAXB object.
   * This is why there is not a set method for the meta property.
   *
   *

   * For example, to add a new item, do as follows:
   *

   *    getMeta().add(newItem);
   *

   *
   *
   *

   * Objects of the following type(s) are allowed in the list
   * {@link Meta}
   *
   * @return the Meta objects
   */
  public List<Meta> getMeta() {
    if (meta == null) {
      meta = new ArrayList<Meta>();
    }
    return this.meta;
  }
}


text:
@charset "utf-8";
/* CSS Document */

body,html{background-color:#24190d;}
#header #primary {background:#594b32 url(../../img/theme/primary-bg.png)}
#footer{background-color:#17130b;}

a{color:#b0985a;}
a:hover{color:#4f903b}

input[type=submit],
a.button{background:#b0985a;}

input[type=submit]:hover,
.button:hover {background:#4f903b;}

/* Reset */
a.lightbtn{background:#ddd; color:#333;}
a.darkbtn{background:#333; color:#eee;}


text:
package org.elasticsearch.index.query;

import org.apache.lucene.search.Query;
import org.apache.lucene.search.spans.SpanBoostQuery;
import org.apache.lucene.search.spans.SpanNearQuery;
import org.apache.lucene.search.spans.SpanQuery;
import org.apache.lucene.search.spans.SpanTermQuery;
import org.elasticsearch.test.AbstractQueryTestCase;

import java.io.IOException;
import java.util.Iterator;

import static org.elasticsearch.index.query.SpanNearQueryBuilder.SpanGapQueryBuilder;
import static org.hamcrest.CoreMatchers.either;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;

/*
 * SpanGapQueryBuilder, unlike other QBs, is not used to build a Query. Therefore, it is not suited
 * to test pattern of AbstractQueryTestCase. Since it is only used in SpanNearQueryBuilder, its test cases
 * are same as those of later with SpanGapQueryBuilder included as clauses.
 */

public class SpanGapQueryBuilderTests extends AbstractQueryTestCase<SpanNearQueryBuilder> {
    @Override
    protected SpanNearQueryBuilder doCreateTestQueryBuilder() {
        SpanTermQueryBuilder[] spanTermQueries = new SpanTermQueryBuilderTests().createSpanTermQueryBuilders(randomIntBetween(1, 6));
        SpanNearQueryBuilder queryBuilder = new SpanNearQueryBuilder(spanTermQueries[0], randomIntBetween(-10, 10));
        for (int i = 1; i < spanTermQueries.length; i++) {
            SpanTermQueryBuilder termQB = spanTermQueries[i];
            queryBuilder.addClause(termQB);
            if (i % 2 == 1) {
                SpanGapQueryBuilder gapQB = new SpanGapQueryBuilder(termQB.fieldName(), randomIntBetween(1,2));
                queryBuilder.addClause(gapQB);
            }
        }
        queryBuilder.inOrder(true);
        return queryBuilder;
    }

    @Override
    protected void doAssertLuceneQuery(SpanNearQueryBuilder queryBuilder, Query query, SearchExecutionContext context) throws IOException {
        assertThat(query, either(instanceOf(SpanNearQuery.class))
            .or(instanceOf(SpanTermQuery.class))
            .or(instanceOf(SpanBoostQuery.class))
            .or(instanceOf(MatchAllQueryBuilder.class)));
        if (query instanceof SpanNearQuery) {
            SpanNearQuery spanNearQuery = (SpanNearQuery) query;
            assertThat(spanNearQuery.getSlop(), equalTo(queryBuilder.slop()));
            assertThat(spanNearQuery.isInOrder(), equalTo(queryBuilder.inOrder()));
            assertThat(spanNearQuery.getClauses().length, equalTo(queryBuilder.clauses().size()));
            Iterator<SpanQueryBuilder> spanQueryBuilderIterator = queryBuilder.clauses().iterator();
            for (SpanQuery spanQuery : spanNearQuery.getClauses()) {
                SpanQueryBuilder spanQB = spanQueryBuilderIterator.next();
                if (spanQB instanceof SpanGapQueryBuilder) continue;
                assertThat(spanQuery, equalTo(spanQB.toQuery(context)));
            }
        } else if (query instanceof SpanTermQuery || query instanceof SpanBoostQuery) {
            assertThat(queryBuilder.clauses().size(), equalTo(1));
            assertThat(query, equalTo(queryBuilder.clauses().get(0).toQuery(context)));
        }
    }

    public void testIllegalArguments() {
            IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new SpanGapQueryBuilder(null, 1));
            assertEquals("[span_gap] field name is null or empty", e.getMessage());
    }

    public void testFromJson() throws IOException {
        String json =
                "{\n" +
                "  \"span_near\" : {\n" +
                "    \"clauses\" : [ {\n" +
                "      \"span_term\" : {\n" +
                "        \"field\" : {\n" +
                "          \"value\" : \"value1\",\n" +
                "          \"boost\" : 1.0\n" +
                "        }\n" +
                "      }\n" +
                "    }, {\n" +
                "      \"span_gap\" : {\n" +
                "        \"field\" : 2" +
                "      }\n" +
                "    }, {\n" +
                "      \"span_term\" : {\n" +
                "        \"field\" : {\n" +
                "          \"value\" : \"value3\",\n" +
                "          \"boost\" : 1.0\n" +
                "        }\n" +
                "      }\n" +
                "    } ],\n" +
                "    \"slop\" : 12,\n" +
                "    \"in_order\" : false,\n" +
                "    \"boost\" : 1.0\n" +
                "  }\n" +
                "}";

        SpanNearQueryBuilder parsed = (SpanNearQueryBuilder) parseQuery(json);
        checkGeneratedJson(json, parsed);

        assertEquals(json, 3, parsed.clauses().size());
        assertEquals(json, 12, parsed.slop());
        assertEquals(json, false, parsed.inOrder());
    }
}


text:
<!DOCTYPE HTML>

		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>SPArtistBrowse Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<meta name="viewport" content="width=550" />
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.1 (build 840)" />

CocoaLibSpotify

				Spotify AB

SPArtistBrowse Class Reference

					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents">Table of Contents</button>

					<select id="jumpTo">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<option value="properties">Properties</option>

	<option value="//api/name/albums">    albums</option>

	<option value="//api/name/artist">    artist</option>

	<option value="//api/name/biography">    biography</option>

	<option value="//api/name/firstPortrait">    firstPortrait</option>

	<option value="//api/name/loadError">    loadError</option>

	<option value="//api/name/loaded">    loaded</option>

	<option value="//api/name/portraits">    portraits</option>

	<option value="//api/name/relatedArtists">    relatedArtists</option>

	<option value="//api/name/session">    session</option>

	<option value="//api/name/topTracks">    topTracks</option>

	<option value="//api/name/tracks">    tracks</option>

	<option value="class_methods">Class Methods</option>

	<option value="//api/name/browseArtist:inSession:type:">    + browseArtist:inSession:type:</option>

	<option value="//api/name/browseArtistAtURL:inSession:type:callback:">    + browseArtistAtURL:inSession:type:callback:</option>

	<option value="instance_methods">Instance Methods</option>

	<option value="//api/name/initWithArtist:inSession:type:">    - initWithArtist:inSession:type:</option>

</select>

Overview

Tasks

Creating and Initializing Artist Browses

Properties

Metadata

Properties

albums

artist

biography

firstPortrait

loadError

loaded

portraits

relatedArtists

session

topTracks

tracks

Class Methods

browseArtist:inSession:type:

browseArtistAtURL:inSession:type:callback:

Instance Methods

initWithArtist:inSession:type:

Index

Hierarchy

SPArtistBrowse Class Reference

	Inherits from
	NSObject

	Conforms to
	SPAsyncLoading

	Declared in
	SPArtistBrowse.h
SPArtistBrowse.m

Overview

Represents an “artist browse” of an artist on the Spotify service.

An “artist browse” fetches detailed information about an artist from the Spotify
service, including a biography, portrait images, related artists and a list of
their tracks and albums.

Artist or album browses are required for certain SPTrack metadata to be available –
see the SPTrack documentation for details.

Tasks

Creating and Initializing Artist Browses

		+ browseArtist:inSession:type:

Creates an SPArtistBrowse from the given SPArtist.

		+ browseArtistAtURL:inSession:type:callback:

Creates an SPArtistBrowse from the given artist URL.

		– initWithArtist:inSession:type:

Initializes a new SPArtistBrowse from the given SPArtist.

Properties

		  loaded

Returns YES if the artist metadata has finished loading.

	property

		  loadError

Returns the error that occurred during loading, or nil if no error occurred.

	property

		  session

Returns the session the artist’s metadata is loaded in.

	property

Metadata

		  albums

Returns a list of albums by this artist, or nil if the metadata isn’t loaded yet.

	property

		  artist

Returns the browse operation’s artist.

	property

		  biography

Returns the artist’s biography, or nil if the metadata isn’t loaded yet.

	property

		  firstPortrait

Returns the first artist portrait image, or nil if the metadata isn’t loaded yet or there are no images.

	property

		  portraits

Returns the artist’s portrait images, or nil if the metadata isn’t loaded yet.

	property

		  relatedArtists

Returns a list of related artists for this artist, or nil if the metadata isn’t loaded yet.

	property

		  tracks

Returns a list of tracks by this artist, or nil if the metadata isn’t loaded yet.
@deprecated

	property

		  topTracks

Returns a list of “top hit” tracks by this artist, or nil if the metadata isn’t loaded yet.

	property

Properties

albums

Returns a list of albums by this artist, or nil if the metadata isn’t loaded yet.

@property (nonatomic, readonly, strong) NSArray *albums

Declared In

		SPArtistBrowse.h

artist

Returns the browse operation’s artist.

@property (nonatomic, readonly, strong) SPArtist *artist

Declared In

		SPArtistBrowse.h

biography

Returns the artist’s biography, or nil if the metadata isn’t loaded yet.

@property (nonatomic, readonly, copy) NSString *biography

Declared In

		SPArtistBrowse.h

firstPortrait

Returns the first artist portrait image, or nil if the metadata isn’t loaded yet or there are no images.

@property (nonatomic, readonly, strong) SPImage *firstPortrait

Declared In

		SPArtistBrowse.h

loadError

Returns the error that occurred during loading, or nil if no error occurred.

@property (nonatomic, readonly, copy) NSError *loadError

Declared In

		SPArtistBrowse.h

loaded

Returns YES if the artist metadata has finished loading.

@property (nonatomic, readonly, getter=isLoaded) BOOL loaded

Declared In

		SPArtistBrowse.h

portraits

Returns the artist’s portrait images, or nil if the metadata isn’t loaded yet.

@property (nonatomic, readonly, strong) NSArray *portraits

Declared In

		SPArtistBrowse.h

relatedArtists

Returns a list of related artists for this artist, or nil if the metadata isn’t loaded yet.

@property (nonatomic, readonly, strong) NSArray *relatedArtists

Declared In

		SPArtistBrowse.h

session

Returns the session the artist’s metadata is loaded in.

@property (nonatomic, readonly, strong) SPSession *session

Declared In

		SPArtistBrowse.h

topTracks

Returns a list of “top hit” tracks by this artist, or nil if the metadata isn’t loaded yet.

@property (nonatomic, readonly, strong) NSArray *topTracks

Declared In

		SPArtistBrowse.h

tracks

Returns a list of tracks by this artist, or nil if the metadata isn’t loaded yet.
@deprecated

@property (nonatomic, readonly, strong) NSArray *tracks

Discussion

Warning: This property is deprecated.

Declared In

		SPArtistBrowse.h

Class Methods

browseArtist:inSession:type:

Creates an SPArtistBrowse from the given SPArtist.

+ (SPArtistBrowse *)browseArtist:(SPArtist *)anArtist inSession:(SPSession *)aSession type:(sp_artistbrowse_type)browseMode

Parameters

anArtist

The SPArtist to make an SPArtistBrowse for.

aSession

The SPSession the browse should exist in.

browseMode

The type of artist browse to perform.

Return Value

Returns the created SPArtistBrowse object.

Discussion

This convenience method is simply returns a new, autoreleased SPArtistBrowse
object. No caching is performed.

Warning: It is strongly recommended that you don’t use SP_ARTISTBROWSE_FULL
as the browse type, as this will download metadata for every single album and track from the given
artist, which is both a lengthy and memory-intensive operation. Please use
SP_ARTISTBROWSE_NO_TRACKS (which downloads artist information, their albums and top tracks) or
SP_ARTISTBROWSE_NO_ALBUMS (which only downloads artist information and top tracks) instead.

Warning: If you pass in an invalid artist URL (i.e., any URL not
starting spotify:artist:, this method will return nil.

Declared In

		SPArtistBrowse.h

browseArtistAtURL:inSession:type:callback:

Creates an SPArtistBrowse from the given artist URL.

+ (void)browseArtistAtURL:(NSURL *)artistURL inSession:(SPSession *)aSession type:(sp_artistbrowse_type)browseMode callback:(void ( ^ ) ( SPArtistBrowse *artistBrowse ))block

Parameters

artistURL

The artist URL to make an SPArtistBrowse for.

aSession

The SPSession the browse should exist in.

browseMode

The type of artist browse to perform.

block

The block to be called with the created SPArtistBrowse object.

Discussion

This convenience method is simply returns a new, autoreleased SPArtistBrowse
object. No caching is performed.

Warning: It is strongly recommended that you don’t use SP_ARTISTBROWSE_FULL
as the browse type, as this will download metadata for every single album and track from the given
artist, which is both a lengthy and memory-intensive operation. Please use
SP_ARTISTBROWSE_NO_TRACKS (which downloads artist information, their albums and top tracks) or
SP_ARTISTBROWSE_NO_ALBUMS (which only downloads artist information and top tracks) instead.

Warning: If you pass in an invalid artist URL (i.e., any URL not
starting spotify:artist:, this method will return nil.

Declared In

		SPArtistBrowse.h

Instance Methods

initWithArtist:inSession:type:

Initializes a new SPArtistBrowse from the given SPArtist.

- (id)initWithArtist:(SPArtist *)anArtist inSession:(SPSession *)aSession type:(sp_artistbrowse_type)browseMode

Parameters

anArtist

The SPArtist to make an SPArtistBrowse for.

aSession

The SPSession the browse should exist in.

browseMode

The type of artist browse to perform.

Return Value

Returns the created SPArtistBrowse object.

Discussion

Warning: It is strongly recommended that you don’t use SP_ARTISTBROWSE_FULL
as the browse type, as this will download metadata for every single album and track from the given
artist, which is both a lengthy and memory-intensive operation. Please use
SP_ARTISTBROWSE_NO_TRACKS (which downloads artist information, their albums and top tracks) or
SP_ARTISTBROWSE_NO_ALBUMS (which only downloads artist information and top tracks) instead.

Warning: If you pass in an invalid artist URL (i.e., any URL not
starting spotify:artist:, this method will return nil.

Declared In

		SPArtistBrowse.h

Index

Hierarchy

© 2013 Spotify AB. All rights reserved. (Last updated: 2013-08-12)

						Generated by appledoc 2.1 (build 840).


text:
class Object
  # call-seq: unit_tests(options={}, &block)
  #
  # Used to define a block of unit tests.
  #
  #    unit_tests do
  #      test "verify something" do
  #        ...
  #      end
  #    end
  #
  # Configuration Options:
  #   * allow - Allows you to specify the methods that are allowed despite being disallowed.
  #     See Test::Unit::TestCase.disallow_helpers! or Test::Unit::TestCase.disallow_setup! for more info
  def unit_tests(options={}, &block)
    do_tests("Units", options, &block)
  end

  # call-seq: functional_tests(options={}, &block)
  #
  # Used to define a block of functional tests.
  #
  #    functional_tests do
  #      test "verify something" do
  #        ...
  #      end
  #    end
  #
  # Configuration Options:
  #   * allow - Allows you to specify the methods that are allowed despite being disallowed.
  #     See Test::Unit::TestCase.disallow_helpers! or Test::Unit::TestCase.disallow_setup! for more info
  def functional_tests(options={}, &block)
    do_tests("Functionals", options, &block)
  end

  protected
  def do_tests(type, options, &block) #:nodoc:
    options[:allow] = options[:allow].arrayize
    full_path_file_name = eval "__FILE__", block.binding
    if full_path_file_name == "(eval)" # jruby 1.0.2 compatibility
      full_path_file_name = caller[1].gsub(/\.rb:\d+.*$/, "")
    end
    test_name = File.basename(full_path_file_name, ".rb")
    test_class = eval "module #{type}; class #{test_name.to_class_name} < Test::Unit::TestCase; self; end; end"
    test_class.class_eval &block
    check_for_setup(test_class, options)
    check_for_helpers(test_class, options)
  end

  def check_for_setup(test_class, options) #:nodoc:
    if test_class.instance_methods(false).include?("setup") && Test::Unit::TestCase.disallow_setup? &&
       !options[:allow].include?(:setup)
      raise Dust::DefinitionError.new("setup is not allowed on class #{test_class.name}")
    end
  end

  def check_for_helpers(test_class, options) #:nodoc:
    test_class.instance_methods(false).each do |method_name|
      if method_name !~ /^test_/ && Test::Unit::TestCase.disallow_helpers? && !options[:allow].include?(method_name.to_sym)
        p method_name.to_sym
        raise Dust::DefinitionError.new("helper methods are not allowed on class #{test_class.name}")
      end
    end
  end
end


text:
#include "config.h"
#include "InsertIntoTextNodeCommand.h"

#include "Document.h"
#include "ExceptionCodePlaceholder.h"
#include "Frame.h"
#include "RenderText.h"
#include "Settings.h"
#include "Text.h"
#if PLATFORM(IOS)
#include "RenderText.h"
#endif

namespace WebCore {

InsertIntoTextNodeCommand::InsertIntoTextNodeCommand(RefPtr<Text>&& node, unsigned offset, const String& text, EditAction editingAction)
    : SimpleEditCommand(node->document(), editingAction)
    , m_node(node)
    , m_offset(offset)
    , m_text(text)
{
    ASSERT(m_node);
    ASSERT(m_offset <= m_node->length());
    ASSERT(!m_text.isEmpty());
}

void InsertIntoTextNodeCommand::doApply()
{
    bool passwordEchoEnabled = frame().settings().passwordEchoEnabled();
    if (passwordEchoEnabled)
        document().updateLayoutIgnorePendingStylesheets();

    if (!m_node->hasEditableStyle())
        return;

    if (passwordEchoEnabled) {
        if (RenderText* renderText = m_node->renderer())
            renderText->momentarilyRevealLastTypedCharacter(m_offset + m_text.length());
    }

    m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION);
}

#if PLATFORM(IOS)
void InsertIntoTextNodeCommand::doReapply()
{
    ExceptionCode ec;
    m_node->insertData(m_offset, m_text, ec);
}
#endif

void InsertIntoTextNodeCommand::doUnapply()
{
    if (!m_node->hasEditableStyle())
        return;

    m_node->deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION);
}

#ifndef NDEBUG
void InsertIntoTextNodeCommand::getNodesInCommand(HashSet<Node*>& nodes)
{
    addNodeAndDescendants(m_node.get(), nodes);
}
#endif

} // namespace WebCore


text:
@implementation NSNumber (Addition)

- (NSString *)stringValueWithDecimalDigits:(NSInteger)digits
{
    NSNumberFormatter *formatter = [NSNumberFormatter new];
    NSString *format = @"";
    if (digits > 0)
    {
        for (NSInteger i = 0; i < digits; i++)
        {
            format = [format stringByAppendingString:@"0"];
        }
        format = [NSString stringWithFormat:@"0.%@;",format];
    }
    else
    {
        format = @"0;";
    }
    [formatter setPositiveFormat:format];
    return [formatter stringFromNumber:self];
}

@end


text:
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
        "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker"><module name="FileTabCharacter"><property name="severity" value="error"/>
<property name="eachLine" value="true"/>
</module>
<module name="TreeWalker"><module name="RedundantImport"/>
<module name="AvoidStarImport"><property name="allowClassImports" value="false"/>
<property name="allowStaticMemberImports" value="false"/>
</module>
<module name="CustomImportOrder"><property name="customImportOrderRules" value="STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STATIC"/>
<property name="specialImportsRegExp" value="^javax\."/>
<property name="standardPackageRegExp" value="^java\."/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
</module>
<module name="UnusedImports"/>
<module name="NeedBraces"><property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
</module>
<module name="EqualsHashCode"/>
</module>
<module name="RegexpHeader"><property name="header" value=".*"/>
<property name="fileExtensions" value="java"/>
</module>
</module>


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

namespace Chaow.Expressions
{
    public sealed class ExpressionComparer : ExpressionCompareVisitor, IEqualityComparer<Expression>
    {
        //public static field
        public static readonly ExpressionComparer Default = new ExpressionComparer();

        //public methods
        public bool Equals(Expression x, Expression y)
        {
            return Visit(x, y);
        }

        public int GetHashCode(Expression obj)
        {
            return obj.NodeType.GetHashCode() ^ obj.Type.GetHashCode();
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace SpaceShooter
{
    public class MoveableGameObject
    {
        private Vector3 _position;
        private Vector3 _direction;
        private Vector3 _up;

        private float _yaw;
        private float _pitch;
        private float _roll;

        private Quaternion _rotation;
        private float _velocity;
        private float _scale;

        private List<BoundingSphere> _boundingSpheres;
        private Game _game;

        private Matrix _world;

        // MovableGameObject is a nice base for all 3D objects in the game having most variables and functionality needed to position an object in 3D space
        public MoveableGameObject(Game game)
        {
            _game = game;

            _position = Vector3.Zero;
            _direction = Vector3.Zero;

            _yaw = 0f;
            _pitch = 0f;
            _roll = 0f;

            _rotation = Quaternion.Identity;
            _boundingSpheres = new List<BoundingSphere>();

            _velocity = 0f;
            _world = Matrix.Identity;
            _scale = 2f;
        }

        public virtual void Update()
        {
            Quaternion addedRotation = Quaternion.CreateFromYawPitchRoll(_yaw, _pitch, _roll);
            _rotation *= addedRotation;

            _direction = Vector3.Transform(Vector3.Forward, _rotation);
            _up = Vector3.Transform(Vector3.Up, _rotation);
            _position += _direction * _velocity;
            _world = Matrix.CreateScale(_scale) * Matrix.CreateFromQuaternion(_rotation) * Matrix.CreateTranslation(_position);
        }

        public Vector3 Position
        {
            get { return _position; }
            set { _position = value; }
        }

        public Vector3 Direction
        {
            get { return _direction; }
            set { _direction = value; }
        }
        public Vector3 Up
        {
            get { return _up; }
            set { _up = value; }
        }
        public float Scale
        {
            get { return _scale; }
            set { _scale = value; }
        }
        public float Velocity
        {
            get { return _velocity; }
            set { _velocity = value; }
        }
        public float Yaw
        {
            get { return _yaw; }
            set { _yaw = value; }
        }
        public float Pitch
        {
            get { return _pitch; }
            set { _pitch = value; }
        }
        public float Roll
        {
            get { return _roll; }
            set { _roll = value; }
        }

        public Matrix World
        {
            get { return _world; }
            set { _world = value; }
        }
        public Quaternion Rotation
        {
            get { return _rotation; }
            set { _rotation = value; }
        }

        public Game Game
        {
            get { return _game; }
            set { _game = value; }
        }
    }
}


text:
require "suture/comparator"
require "suture/value/result"

module Suture::Util
  class ComparesResultsTest < UnitTest
    def setup
      super
      @subject = ComparesResults.new(Suture::Comparator.new)
    end

    def test_results_match
      expected = Suture::Value::Result.returned(5)
      actual = Suture::Value::Result.returned(5)

      result = @subject.compare(expected, actual)

      assert_equal true, result
    end

    def test_results_do_not_match
      expected = Suture::Value::Result.returned(5)
      actual = Suture::Value::Result.returned("5")

      result = @subject.compare(expected, actual)

      assert_equal false, result
    end

    def test_return_plus_error
      expected = Suture::Value::Result.errored(StandardError.new("hi"))
      actual = Suture::Value::Result.returned(StandardError.new("hi"))

      result = @subject.compare(expected, actual)

      assert_equal false, result
    end

    class SubZeroDivisionError < ZeroDivisionError
    end
    def test_error_same_class_and_message
      expected = Suture::Value::Result.errored(ZeroDivisionError.new("hi"))
      actual = Suture::Value::Result.errored(SubZeroDivisionError.new("hi"))

      result = @subject.compare(expected, actual)

      assert_equal true, result
    end

    def test_error_different_class
      expected = Suture::Value::Result.errored(ZeroDivisionError.new("hi"))
      actual = Suture::Value::Result.errored(StandardError.new("hi"))

      result = @subject.compare(expected, actual)

      assert_equal false, result
    end

    def test_error_different_message
      expected = Suture::Value::Result.errored(StandardError.new("hi"))
      actual = Suture::Value::Result.errored(StandardError.new("bye"))

      result = @subject.compare(expected, actual)

      assert_equal false, result
    end
  end
end


text:
namespace blink {

class Document;
class RangeInFlatTree;

// An AnnotationSelector is an abstract interface that's used by an annotation
// to specify what part of a Document it should be attached to. For example, a
// text-based selector may be configured to attach an annotation to the first
// instance of the text string "the quick brown dog" in the page. A CSS-based
// selector may be configured to attach an annotation to the third child of the
// <p> element with id 'foo'.
//
// Annotation-related data will typically be stored by the client so selectors
// must be able to serialize and deserialize themselves. To instantiate a
// selector from serialized form, use the static Deserialize factory method.
//
// Selectors are scoped to a single Document, meaning that they will not search
// the content of any subframes in the document. However, the search is
// performed on a "flat" DOM tree, meaning it will descend through shadow tree
// boundaries so content inside ShadowDOM is searchable.
class CORE_EXPORT AnnotationSelector
    : public GarbageCollected<AnnotationSelector> {
 public:
  enum SearchType {
    // Will synchronously search the document, the callback is invoked before
    // FindRange returns.
    kSynchronous,

    // Asynchronously searches the document, FindRange may return before the
    // callback is invoked.
    kAsynchronous
  };

  // Tests can inject a function that will be called in place of Deserialize so
  // that they can generate a selector implementation of their choosing.
  using GeneratorFunc =
      base::RepeatingCallback<AnnotationSelector*(const String&)>;
  static void SetGeneratorForTesting(GeneratorFunc generator);
  static void UnsetGeneratorForTesting();

  // Factory method used to instantiate a selector of the correct type from
  // serialized form.
  static AnnotationSelector* Deserialize(const String& serialized);

  virtual ~AnnotationSelector() = default;

  virtual void Trace(Visitor* visitor) const {}

  // Serializes the selector to a form that can be stored and deserialized
  // using the Deserialize factory method.
  virtual String Serialize() const = 0;

  // Applies the selector to find a Range in the given `document`. The found
  // range is returned by invoking `finished_cb`, if no content matching the
  // selector was found in the document, the `finished_cb` is invoked with
  // nullptr.
  //
  // The search can be performed either synchronously or asynchronously. If
  // synchronously, the `finished_cb` is guaranteed to be invoked before
  // FindRange returns.
  using FinishedCallback = base::OnceCallback<void(const RangeInFlatTree*)>;
  virtual void FindRange(Document& document,
                         SearchType type,
                         FinishedCallback finished_cb) = 0;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_ANNOTATION_ANNOTATION_SELECTOR_H_


text:
"""Summary reporting"""

import sys

from coverage.exceptions import ConfigError, NoDataError
from coverage.misc import human_sorted_items
from coverage.report import get_analysis_to_report
from coverage.results import Numbers

class SummaryReporter:
    """A reporter for writing the summary report."""

    def __init__(self, coverage):
        self.coverage = coverage
        self.config = self.coverage.config
        self.branches = coverage.get_data().has_arcs()
        self.outfile = None
        self.output_format = self.config.format or "text"
        if self.output_format not in {"text", "markdown", "total"}:
            raise ConfigError(f"Unknown report format choice: {self.output_format!r}")
        self.fr_analysis = []
        self.skipped_count = 0
        self.empty_count = 0
        self.total = Numbers(precision=self.config.precision)

    def write(self, line):
        """Write a line to the output, adding a newline."""
        self.outfile.write(line.rstrip())
        self.outfile.write("\n")

    def write_items(self, items):
        """Write a list of strings, joined together."""
        self.write("".join(items))

    def _report_text(self, header, lines_values, total_line, end_lines):
        """Internal method that prints report data in text format.

        `header` is a list with captions.
        `lines_values` is list of lists of sortable values.
        `total_line` is a list with values of the total line.
        `end_lines` is a list of ending lines with information about skipped files.

        """
        # Prepare the formatting strings, header, and column sorting.
        max_name = max([len(line[0]) for line in lines_values] + [5]) + 1
        max_n = max(len(total_line[header.index("Cover")]) + 2, len(" Cover")) + 1
        max_n = max([max_n] + [len(line[header.index("Cover")]) + 2 for line in lines_values])
        formats = dict(
            Name="{:{name_len}}",
            Stmts="{:>7}",
            Miss="{:>7}",
            Branch="{:>7}",
            BrPart="{:>7}",
            Cover="{:>{n}}",
            Missing="{:>10}",
        )
        header_items = [
            formats[item].format(item, name_len=max_name, n=max_n)
            for item in header
        ]
        header_str = "".join(header_items)
        rule = "-" * len(header_str)

        # Write the header
        self.write(header_str)
        self.write(rule)

        formats.update(dict(Cover="{:>{n}}%"), Missing="   {:9}")
        for values in lines_values:
            # build string with line values
            line_items = [
                formats[item].format(str(value),
                name_len=max_name, n=max_n-1) for item, value in zip(header, values)
            ]
            self.write_items(line_items)

        # Write a TOTAL line
        if lines_values:
            self.write(rule)

        line_items = [
            formats[item].format(str(value),
            name_len=max_name, n=max_n-1) for item, value in zip(header, total_line)
        ]
        self.write_items(line_items)

        for end_line in end_lines:
            self.write(end_line)

    def _report_markdown(self, header, lines_values, total_line, end_lines):
        """Internal method that prints report data in markdown format.

        `header` is a list with captions.
        `lines_values` is a sorted list of lists containing coverage information.
        `total_line` is a list with values of the total line.
        `end_lines` is a list of ending lines with information about skipped files.

        """
        # Prepare the formatting strings, header, and column sorting.
        max_name = max((len(line[0].replace("_", "\\_")) for line in lines_values), default=0)
        max_name = max(max_name, len("**TOTAL**")) + 1
        formats = dict(
            Name="| {:{name_len}}|",
            Stmts="{:>9} |",
            Miss="{:>9} |",
            Branch="{:>9} |",
            BrPart="{:>9} |",
            Cover="{:>{n}} |",
            Missing="{:>10} |",
        )
        max_n = max(len(total_line[header.index("Cover")]) + 6, len(" Cover "))
        header_items = [formats[item].format(item, name_len=max_name, n=max_n) for item in header]
        header_str = "".join(header_items)
        rule_str = "|" + " ".join(["- |".rjust(len(header_items[0])-1, '-')] +
            ["-: |".rjust(len(item)-1, '-') for item in header_items[1:]]
        )

        # Write the header
        self.write(header_str)
        self.write(rule_str)

        for values in lines_values:
            # build string with line values
            formats.update(dict(Cover="{:>{n}}% |"))
            line_items = [
                formats[item].format(str(value).replace("_", "\\_"), name_len=max_name, n=max_n-1)
                for item, value in zip(header, values)
            ]
            self.write_items(line_items)

        # Write the TOTAL line
        formats.update(dict(Name="|{:>{name_len}} |", Cover="{:>{n}} |"))
        total_line_items = []
        for item, value in zip(header, total_line):
            if value == "":
                insert = value
            elif item == "Cover":
                insert = f" **{value}%**"
            else:
                insert = f" **{value}**"
            total_line_items += formats[item].format(insert, name_len=max_name, n=max_n)
        self.write_items(total_line_items)
        for end_line in end_lines:
            self.write(end_line)

    def report(self, morfs, outfile=None):
        """Writes a report summarizing coverage statistics per module.

        `outfile` is a text-mode file object to write the summary to.

        """
        self.outfile = outfile or sys.stdout

        self.coverage.get_data().set_query_contexts(self.config.report_contexts)
        for fr, analysis in get_analysis_to_report(self.coverage, morfs):
            self.report_one_file(fr, analysis)

        if not self.total.n_files and not self.skipped_count:
            raise NoDataError("No data to report.")

        if self.output_format == "total":
            self.write(self.total.pc_covered_str)
        else:
            self.tabular_report()

        return self.total.pc_covered

    def tabular_report(self):
        """Writes tabular report formats."""
        # Prepare the header line and column sorting.
        header = ["Name", "Stmts", "Miss"]
        if self.branches:
            header += ["Branch", "BrPart"]
        header += ["Cover"]
        if self.config.show_missing:
            header += ["Missing"]

        column_order = dict(name=0, stmts=1, miss=2, cover=-1)
        if self.branches:
            column_order.update(dict(branch=3, brpart=4))

        # `lines_values` is list of lists of sortable values.
        lines_values = []

        for (fr, analysis) in self.fr_analysis:
            nums = analysis.numbers

            args = [fr.relative_filename(), nums.n_statements, nums.n_missing]
            if self.branches:
                args += [nums.n_branches, nums.n_partial_branches]
            args += [nums.pc_covered_str]
            if self.config.show_missing:
                args += [analysis.missing_formatted(branches=True)]
            args += [nums.pc_covered]
            lines_values.append(args)

        # Line sorting.
        sort_option = (self.config.sort or "name").lower()
        reverse = False
        if sort_option[0] == '-':
            reverse = True
            sort_option = sort_option[1:]
        elif sort_option[0] == '+':
            sort_option = sort_option[1:]
        sort_idx = column_order.get(sort_option)
        if sort_idx is None:
            raise ConfigError(f"Invalid sorting option: {self.config.sort!r}")
        if sort_option == "name":
            lines_values = human_sorted_items(lines_values, reverse=reverse)
        else:
            lines_values.sort(key=lambda line: (line[sort_idx], line[0]), reverse=reverse)

        # Calculate total if we had at least one file.
        total_line = ["TOTAL", self.total.n_statements, self.total.n_missing]
        if self.branches:
            total_line += [self.total.n_branches, self.total.n_partial_branches]
        total_line += [self.total.pc_covered_str]
        if self.config.show_missing:
            total_line += [""]

        # Create other final lines.
        end_lines = []
        if self.config.skip_covered and self.skipped_count:
            file_suffix = 's' if self.skipped_count>1 else ''
            end_lines.append(
                f"\n{self.skipped_count} file{file_suffix} skipped due to complete coverage."
            )
        if self.config.skip_empty and self.empty_count:
            file_suffix = 's' if self.empty_count > 1 else ''
            end_lines.append(f"\n{self.empty_count} empty file{file_suffix} skipped.")

        if self.output_format == "markdown":
            formatter = self._report_markdown
        else:
            formatter = self._report_text
        formatter(header, lines_values, total_line, end_lines)

    def report_one_file(self, fr, analysis):
        """Report on just one file, the callback from report()."""
        nums = analysis.numbers
        self.total += nums

        no_missing_lines = (nums.n_missing == 0)
        no_missing_branches = (nums.n_partial_branches == 0)
        if self.config.skip_covered and no_missing_lines and no_missing_branches:
            # Don't report on 100% files.
            self.skipped_count += 1
        elif self.config.skip_empty and nums.n_statements == 0:
            # Don't report on empty files.
            self.empty_count += 1
        else:
            self.fr_analysis.append((fr, analysis))


text:
export class RestDto<T> {
    data: T;
    success: boolean;
    message: string;
}


text:
<?php
/**
 * @namespace
 */
namespace Vein\Core\Crud\Helper\Filter\Field\Volt;

use Vein\Core\Crud\Grid\Filter\Field;

/**
 * Class grid filter field message helper
 *
 * @category   Vein\Core
 * @package    Crud
 * @subpackage Helper
 */
class Message extends \Vein\Core\Crud\Helper
{
	/**
	 * Generates a widget to show a html grid filter
	 *
	 * @param \Vein\Core\Crud\Grid\Filter\Field $filter
     *
     * @return string
	 */
	static public function _(Field $field)
	{
        $code = '';
        if ($field instanceof Field\Submit) {
            return $code;
        }

        $code = '
						{% for message in form.getFieldByKey(\''.$field->getKey().'\').getElement().getMessages() %}
						{{ message }}
						{% endfor %}';

		return $code;
	}
}


text:
layout: post
date: 2015-10-12
title: "Watters-Encore Encore Dress Elm style 4843e Sleeveless Short/Mini Aline/Princess"
category: Watters-Encore
tags: [Watters-Encore,Encore,Aline/Princess ,V-neck,Short/Mini,Sleeveless]
---
### Watters-Encore Encore Dress Elm style 4843e
Just **$259.99**
###   Sleeveless Short/Mini Aline/Princess

BRANDS	Encore

Silhouette	Aline/Princess

Neckline	V-neck

Hemline/Train	Short/Mini

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/encore/14446-watters-dress-elm-style-4843e.html](https://www.readybrides.com/en/encore/14446-watters-dress-elm-style-4843e.html)


text:
/* eslint-disable import/no-unresolved, import/default */

import importDialogTemplate from './import-dialog.tpl.html';
import entityAliasesTemplate from '../entity/alias/entity-aliases.tpl.html';

/* eslint-enable import/no-unresolved, import/default */

/* eslint-disable no-undef, angular/window-service, angular/document-service */

/*@ngInject*/
export default function ImportExport($log, $translate, $q, $mdDialog, $document, itembuffer, utils, types, dashboardUtils,
                                     entityService, dashboardService, pluginService, ruleService, widgetService, toast) {

    var service = {
        exportDashboard: exportDashboard,
        importDashboard: importDashboard,
        exportWidget: exportWidget,
        importWidget: importWidget,
        exportPlugin: exportPlugin,
        importPlugin: importPlugin,
        exportRule: exportRule,
        importRule: importRule,
        exportWidgetType: exportWidgetType,
        importWidgetType: importWidgetType,
        exportWidgetsBundle: exportWidgetsBundle,
        importWidgetsBundle: importWidgetsBundle
    }

    return service;

    // Widgets bundle functions

    function exportWidgetsBundle(widgetsBundleId) {
        widgetService.getWidgetsBundle(widgetsBundleId).then(
            function success(widgetsBundle) {
                var bundleAlias = widgetsBundle.alias;
                var isSystem = widgetsBundle.tenantId.id === types.id.nullUid;
                widgetService.getBundleWidgetTypes(bundleAlias, isSystem).then(
                    function success (widgetTypes) {
                        prepareExport(widgetsBundle);
                        var widgetsBundleItem = {
                           widgetsBundle:  prepareExport(widgetsBundle),
                           widgetTypes: []
                        };
                        for (var t in widgetTypes) {
                            var widgetType = widgetTypes[t];
                            if (angular.isDefined(widgetType.bundleAlias)) {
                                delete widgetType.bundleAlias;
                            }
                            widgetsBundleItem.widgetTypes.push(prepareExport(widgetType));
                        }
                        var name = widgetsBundle.title;
                        name = name.toLowerCase().replace(/\W/g,"_");
                        exportToPc(widgetsBundleItem, name + '.json');
                    },
                    function fail (rejection) {
                        var message = rejection;
                        if (!message) {
                            message = $translate.instant('error.unknown-error');
                        }
                        toast.showError($translate.instant('widgets-bundle.export-failed-error', {error: message}));
                    }
                );
            },
            function fail(rejection) {
                var message = rejection;
                if (!message) {
                    message = $translate.instant('error.unknown-error');
                }
                toast.showError($translate.instant('widgets-bundle.export-failed-error', {error: message}));
            }
        );
    }

    function importNextWidgetType(widgetTypes, bundleAlias, index, deferred) {
        if (!widgetTypes || widgetTypes.length <= index) {
            deferred.resolve();
        } else {
            var widgetType = widgetTypes[index];
            widgetType.bundleAlias = bundleAlias;
            widgetService.saveImportedWidgetType(widgetType).then(
                function success() {
                    index++;
                    importNextWidgetType(widgetTypes, bundleAlias, index, deferred);
                },
                function fail() {
                    deferred.reject();
                }
            );

        }
    }

    function importWidgetsBundle($event) {
        var deferred = $q.defer();
        openImportDialog($event, 'widgets-bundle.import', 'widgets-bundle.widgets-bundle-file').then(
            function success(widgetsBundleItem) {
                if (!validateImportedWidgetsBundle(widgetsBundleItem)) {
                    toast.showError($translate.instant('widgets-bundle.invalid-widgets-bundle-file-error'));
                    deferred.reject();
                } else {
                    var widgetsBundle = widgetsBundleItem.widgetsBundle;
                    widgetService.saveWidgetsBundle(widgetsBundle).then(
                        function success(savedWidgetsBundle) {
                            var bundleAlias = savedWidgetsBundle.alias;
                            var widgetTypes = widgetsBundleItem.widgetTypes;
                            importNextWidgetType(widgetTypes, bundleAlias, 0, deferred);
                        },
                        function fail() {
                            deferred.reject();
                        }
                    );
                }
            },
            function fail() {
                deferred.reject();
            }
        );
        return deferred.promise;
    }

    function validateImportedWidgetsBundle(widgetsBundleItem) {
        if (angular.isUndefined(widgetsBundleItem.widgetsBundle)) {
            return false;
        }
        if (angular.isUndefined(widgetsBundleItem.widgetTypes)) {
            return false;
        }
        var widgetsBundle = widgetsBundleItem.widgetsBundle;
        if (angular.isUndefined(widgetsBundle.title)) {
            return false;
        }
        var widgetTypes = widgetsBundleItem.widgetTypes;
        for (var t in widgetTypes) {
            var widgetType = widgetTypes[t];
            if (!validateImportedWidgetType(widgetType)) {
                return false;
            }
        }

        return true;
    }

    // Widget type functions

    function exportWidgetType(widgetTypeId) {
        widgetService.getWidgetTypeById(widgetTypeId).then(
            function success(widgetType) {
                if (angular.isDefined(widgetType.bundleAlias)) {
                    delete widgetType.bundleAlias;
                }
                var name = widgetType.name;
                name = name.toLowerCase().replace(/\W/g,"_");
                exportToPc(prepareExport(widgetType), name + '.json');
            },
            function fail(rejection) {
                var message = rejection;
                if (!message) {
                    message = $translate.instant('error.unknown-error');
                }
                toast.showError($translate.instant('widget-type.export-failed-error', {error: message}));
            }
        );
    }

    function importWidgetType($event, bundleAlias) {
        var deferred = $q.defer();
        openImportDialog($event, 'widget-type.import', 'widget-type.widget-type-file').then(
            function success(widgetType) {
                if (!validateImportedWidgetType(widgetType)) {
                    toast.showError($translate.instant('widget-type.invalid-widget-type-file-error'));
                    deferred.reject();
                } else {
                    widgetType.bundleAlias = bundleAlias;
                    widgetService.saveImportedWidgetType(widgetType).then(
                        function success() {
                            deferred.resolve();
                        },
                        function fail() {
                            deferred.reject();
                        }
                    );
                }
            },
            function fail() {
                deferred.reject();
            }
        );
        return deferred.promise;
    }

    function validateImportedWidgetType(widgetType) {
        if (angular.isUndefined(widgetType.name)
            || angular.isUndefined(widgetType.descriptor))
        {
            return false;
        }
        return true;
    }

    // Rule functions

    function exportRule(ruleId) {
        ruleService.getRule(ruleId).then(
            function success(rule) {
                var name = rule.name;
                name = name.toLowerCase().replace(/\W/g,"_");
                exportToPc(prepareExport(rule), name + '.json');
            },
            function fail(rejection) {
                var message = rejection;
                if (!message) {
                    message = $translate.instant('error.unknown-error');
                }
                toast.showError($translate.instant('rule.export-failed-error', {error: message}));
            }
        );
    }

    function importRule($event) {
        var deferred = $q.defer();
        openImportDialog($event, 'rule.import', 'rule.rule-file').then(
            function success(rule) {
                if (!validateImportedRule(rule)) {
                    toast.showError($translate.instant('rule.invalid-rule-file-error'));
                    deferred.reject();
                } else {
                    rule.state = 'SUSPENDED';
                    ruleService.saveRule(rule).then(
                        function success() {
                            deferred.resolve();
                        },
                        function fail() {
                            deferred.reject();
                        }
                    );
                }
            },
            function fail() {
                deferred.reject();
            }
        );
        return deferred.promise;
    }

    function validateImportedRule(rule) {
        if (angular.isUndefined(rule.name)
            || angular.isUndefined(rule.pluginToken)
            || angular.isUndefined(rule.filters)
            || angular.isUndefined(rule.action))
        {
            return false;
        }
        return true;
    }

    // Plugin functions

    function exportPlugin(pluginId) {
        pluginService.getPlugin(pluginId).then(
            function success(plugin) {
                if (!plugin.configuration || plugin.configuration === null) {
                    plugin.configuration = {};
                }
                var name = plugin.name;
                name = name.toLowerCase().replace(/\W/g,"_");
                exportToPc(prepareExport(plugin), name + '.json');
            },
            function fail(rejection) {
                var message = rejection;
                if (!message) {
                    message = $translate.instant('error.unknown-error');
                }
                toast.showError($translate.instant('plugin.export-failed-error', {error: message}));
            }
        );
    }

    function importPlugin($event) {
        var deferred = $q.defer();
        openImportDialog($event, 'plugin.import', 'plugin.plugin-file').then(
            function success(plugin) {
                if (!validateImportedPlugin(plugin)) {
                    toast.showError($translate.instant('plugin.invalid-plugin-file-error'));
                    deferred.reject();
                } else {
                    plugin.state = 'SUSPENDED';
                    pluginService.savePlugin(plugin).then(
                        function success() {
                            deferred.resolve();
                        },
                        function fail() {
                            deferred.reject();
                        }
                    );
                }
            },
            function fail() {
                deferred.reject();
            }
        );
        return deferred.promise;
    }

    function validateImportedPlugin(plugin) {
        if (angular.isUndefined(plugin.name)
            || angular.isUndefined(plugin.clazz)
            || angular.isUndefined(plugin.apiToken)
            || angular.isUndefined(plugin.configuration))
        {
            return false;
        }
        return true;
    }

    // Widget functions

    function exportWidget(dashboard, sourceState, sourceLayout, widget) {
        var widgetItem = itembuffer.prepareWidgetItem(dashboard, sourceState, sourceLayout, widget);
        var name = widgetItem.widget.config.title;
        name = name.toLowerCase().replace(/\W/g,"_");
        exportToPc(prepareExport(widgetItem), name + '.json');
    }

    function prepareAliasesInfo(aliasesInfo) {
        var datasourceAliases = aliasesInfo.datasourceAliases;
        var targetDeviceAliases = aliasesInfo.targetDeviceAliases;
        var datasourceIndex;
        if (datasourceAliases || targetDeviceAliases) {
            if (datasourceAliases) {
                for (datasourceIndex in datasourceAliases) {
                    datasourceAliases[datasourceIndex] = prepareEntityAlias(datasourceAliases[datasourceIndex]);
                }
            }
            if (targetDeviceAliases) {
                for (datasourceIndex in targetDeviceAliases) {
                    targetDeviceAliases[datasourceIndex] = prepareEntityAlias(targetDeviceAliases[datasourceIndex]);
                }
            }
        }
        return aliasesInfo;
    }

    function prepareEntityAlias(aliasInfo) {
        var alias;
        var filter;
        if (aliasInfo.deviceId) {
            alias = aliasInfo.aliasName;
            filter = {
                type: types.aliasFilterType.entityList.value,
                entityType: types.entityType.device,
                entityList: [aliasInfo.deviceId],
                resolveMultiple: false
            };
        } else if (aliasInfo.deviceFilter) {
            alias = aliasInfo.aliasName;
            filter = {
                type: aliasInfo.deviceFilter.useFilter ? types.aliasFilterType.entityName.value : types.aliasFilterType.entityList.value,
                entityType: types.entityType.device,
                resolveMultiple: false
            }
            if (filter.type == types.aliasFilterType.entityList.value) {
                filter.entityList = aliasInfo.deviceFilter.deviceList
            } else {
                filter.entityNameFilter = aliasInfo.deviceFilter.deviceNameFilter;
            }
        } else if (aliasInfo.entityFilter) {
            alias = aliasInfo.aliasName;
            filter = {
                type: aliasInfo.entityFilter.useFilter ? types.aliasFilterType.entityName.value : types.aliasFilterType.entityList.value,
                entityType: aliasInfo.entityType,
                resolveMultiple: false
            }
            if (filter.type == types.aliasFilterType.entityList.value) {
                filter.entityList = aliasInfo.entityFilter.entityList;
            } else {
                filter.entityNameFilter = aliasInfo.entityFilter.entityNameFilter;
            }
        } else {
            alias = aliasInfo.alias;
            filter = aliasInfo.filter;
        }
        return {
            alias: alias,
            filter: filter
        };
    }

    function importWidget($event, dashboard, targetState, targetLayoutFunction, onAliasesUpdateFunction) {
        var deferred = $q.defer();
        openImportDialog($event, 'dashboard.import-widget', 'dashboard.widget-file').then(
            function success(widgetItem) {
                if (!validateImportedWidget(widgetItem)) {
                    toast.showError($translate.instant('dashboard.invalid-widget-file-error'));
                    deferred.reject();
                } else {
                    var widget = widgetItem.widget;
                    widget = dashboardUtils.validateAndUpdateWidget(widget);
                    var aliasesInfo = prepareAliasesInfo(widgetItem.aliasesInfo);
                    var originalColumns = widgetItem.originalColumns;
                    var originalSize = widgetItem.originalSize;

                    var datasourceAliases = aliasesInfo.datasourceAliases;
                    var targetDeviceAliases = aliasesInfo.targetDeviceAliases;
                    if (datasourceAliases || targetDeviceAliases) {
                        var entityAliases = {};
                        var datasourceAliasesMap = {};
                        var targetDeviceAliasesMap = {};
                        var aliasId;
                        var datasourceIndex;
                        if (datasourceAliases) {
                            for (datasourceIndex in datasourceAliases) {
                                aliasId = utils.guid();
                                datasourceAliasesMap[aliasId] = datasourceIndex;
                                entityAliases[aliasId] = datasourceAliases[datasourceIndex];
                                entityAliases[aliasId].id = aliasId;
                            }
                        }
                        if (targetDeviceAliases) {
                            for (datasourceIndex in targetDeviceAliases) {
                                aliasId = utils.guid();
                                targetDeviceAliasesMap[aliasId] = datasourceIndex;
                                entityAliases[aliasId] = targetDeviceAliases[datasourceIndex];
                                entityAliases[aliasId].id = aliasId;
                            }
                        }

                        var aliasIds = Object.keys(entityAliases);
                        if (aliasIds.length > 0) {
                            processEntityAliases(entityAliases, aliasIds).then(
                                function(missingEntityAliases) {
                                    if (Object.keys(missingEntityAliases).length > 0) {
                                        editMissingAliases($event, [ widget ],
                                              true, 'dashboard.widget-import-missing-aliases-title', missingEntityAliases).then(
                                            function success(updatedEntityAliases) {
                                                for (var aliasId in updatedEntityAliases) {
                                                    var entityAlias = updatedEntityAliases[aliasId];
                                                    var datasourceIndex;
                                                    if (datasourceAliasesMap[aliasId]) {
                                                        datasourceIndex = datasourceAliasesMap[aliasId];
                                                        datasourceAliases[datasourceIndex] = entityAlias;
                                                    } else if (targetDeviceAliasesMap[aliasId]) {
                                                        datasourceIndex = targetDeviceAliasesMap[aliasId];
                                                        targetDeviceAliases[datasourceIndex] = entityAlias;
                                                    }
                                                }
                                                addImportedWidget(dashboard, targetState, targetLayoutFunction, $event, widget,
                                                    aliasesInfo, onAliasesUpdateFunction, originalColumns, originalSize, deferred);
                                            },
                                            function fail() {
                                                deferred.reject();
                                            }
                                        );
                                    } else {
                                        addImportedWidget(dashboard, targetState, targetLayoutFunction, $event, widget,
                                            aliasesInfo, onAliasesUpdateFunction, originalColumns, originalSize, deferred);
                                    }
                                }
                            );
                        } else {
                            addImportedWidget(dashboard, targetState, targetLayoutFunction, $event, widget,
                                aliasesInfo, onAliasesUpdateFunction, originalColumns, originalSize, deferred);
                        }
                    } else {
                        addImportedWidget(dashboard, targetState, targetLayoutFunction, $event, widget,
                            aliasesInfo, onAliasesUpdateFunction, originalColumns, originalSize, deferred);
                    }
                }
            },
            function fail() {
                deferred.reject();
            }
        );
        return deferred.promise;
    }

    function validateImportedWidget(widgetItem) {
        if (angular.isUndefined(widgetItem.widget)
            || angular.isUndefined(widgetItem.aliasesInfo)
            || angular.isUndefined(widgetItem.originalColumns)) {
            return false;
        }
        var widget = widgetItem.widget;
        if (angular.isUndefined(widget.isSystemType) ||
            angular.isUndefined(widget.bundleAlias) ||
            angular.isUndefined(widget.typeAlias) ||
            angular.isUndefined(widget.type)) {
            return false;
        }
        return true;
    }

    function addImportedWidget(dashboard, targetState, targetLayoutFunction, event, widget,
                               aliasesInfo, onAliasesUpdateFunction, originalColumns, originalSize, deferred) {
        targetLayoutFunction(event).then(
            function success(targetLayout) {
                itembuffer.addWidgetToDashboard(dashboard, targetState, targetLayout, widget,
                    aliasesInfo, onAliasesUpdateFunction, originalColumns, originalSize, -1, -1).then(
                        function() {
                            deferred.resolve(
                                {
                                    widget: widget,
                                    layoutId: targetLayout
                                }
                            );
                        }
                );
            },
            function fail() {
                deferred.reject();
            }
        );
    }

    // Dashboard functions

    function exportDashboard(dashboardId) {
        dashboardService.getDashboard(dashboardId).then(
            function success(dashboard) {
                var name = dashboard.title;
                name = name.toLowerCase().replace(/\W/g,"_");
                exportToPc(prepareExport(dashboard), name + '.json');
            },
            function fail(rejection) {
                var message = rejection;
                if (!message) {
                    message = $translate.instant('error.unknown-error');
                }
                toast.showError($translate.instant('dashboard.export-failed-error', {error: message}));
            }
        );
    }

    function importDashboard($event) {
        var deferred = $q.defer();
        openImportDialog($event, 'dashboard.import', 'dashboard.dashboard-file').then(
            function success(dashboard) {
                if (!validateImportedDashboard(dashboard)) {
                    toast.showError($translate.instant('dashboard.invalid-dashboard-file-error'));
                    deferred.reject();
                } else {
                    dashboard = dashboardUtils.validateAndUpdateDashboard(dashboard);
                    var entityAliases = dashboard.configuration.entityAliases;
                    if (entityAliases) {
                        var aliasIds = Object.keys( entityAliases );
                        if (aliasIds.length > 0) {
                            processEntityAliases(entityAliases, aliasIds).then(
                                function(missingEntityAliases) {
                                    if (Object.keys( missingEntityAliases ).length > 0) {
                                        editMissingAliases($event, dashboard.configuration.widgets,
                                                false, 'dashboard.dashboard-import-missing-aliases-title', missingEntityAliases).then(
                                            function success(updatedEntityAliases) {
                                                for (var aliasId in updatedEntityAliases) {
                                                    entityAliases[aliasId] = updatedEntityAliases[aliasId];
                                                }
                                                saveImportedDashboard(dashboard, deferred);
                                            },
                                            function fail() {
                                                deferred.reject();
                                            }
                                        );
                                    } else {
                                        saveImportedDashboard(dashboard, deferred);
                                    }
                                }
                            )
                        } else {
                            saveImportedDashboard(dashboard, deferred);
                        }
                    } else {
                        saveImportedDashboard(dashboard, deferred);
                    }
                }
            },
            function fail() {
                deferred.reject();
            }
        );
        return deferred.promise;
    }

    function saveImportedDashboard(dashboard, deferred) {
        dashboardService.saveDashboard(dashboard).then(
            function success() {
                deferred.resolve();
            },
            function fail() {
                deferred.reject();
            }
        )
    }

    function validateImportedDashboard(dashboard) {
        if (angular.isUndefined(dashboard.title) || angular.isUndefined(dashboard.configuration)) {
            return false;
        }
        return true;
    }

    function processEntityAliases(entityAliases, aliasIds) {
        var deferred = $q.defer();
        var missingEntityAliases = {};
        var index = -1;
        checkNextEntityAliasOrComplete(index, aliasIds, entityAliases, missingEntityAliases, deferred);
        return deferred.promise;
    }

    function checkNextEntityAliasOrComplete(index, aliasIds, entityAliases, missingEntityAliases, deferred) {
        index++;
        if (index == aliasIds.length) {
            deferred.resolve(missingEntityAliases);
        } else {
            checkEntityAlias(index, aliasIds, entityAliases, missingEntityAliases, deferred);
        }
    }

    function checkEntityAlias(index, aliasIds, entityAliases, missingEntityAliases, deferred) {
        var aliasId = aliasIds[index];
        var entityAlias = entityAliases[aliasId];
        entityService.checkEntityAlias(entityAlias).then(
            function(result) {
                if (result) {
                    checkNextEntityAliasOrComplete(index, aliasIds, entityAliases, missingEntityAliases, deferred);
                } else {
                    var missingEntityAlias = angular.copy(entityAlias);
                    missingEntityAlias.filter = null;
                    missingEntityAliases[aliasId] = missingEntityAlias;
                    checkNextEntityAliasOrComplete(index, aliasIds, entityAliases, missingEntityAliases, deferred);
                }
            }
        );
    }

    function editMissingAliases($event, widgets, isSingleWidget, customTitle, missingEntityAliases) {
        var deferred = $q.defer();
        $mdDialog.show({
            controller: 'EntityAliasesController',
            controllerAs: 'vm',
            templateUrl: entityAliasesTemplate,
            locals: {
                config: {
                    entityAliases: missingEntityAliases,
                    widgets: widgets,
                    isSingleWidget: isSingleWidget,
                    customTitle: customTitle,
                    disableAdd: true
                }
            },
            parent: angular.element($document[0].body),
            skipHide: true,
            fullscreen: true,
            targetEvent: $event
        }).then(function (updatedEntityAliases) {
            deferred.resolve(updatedEntityAliases);
        }, function () {
            deferred.reject();
        });
        return deferred.promise;
    }

    // Common functions

    function prepareExport(data) {
        var exportedData = angular.copy(data);
        if (angular.isDefined(exportedData.id)) {
            delete exportedData.id;
        }
        if (angular.isDefined(exportedData.createdTime)) {
            delete exportedData.createdTime;
        }
        if (angular.isDefined(exportedData.tenantId)) {
            delete exportedData.tenantId;
        }
        if (angular.isDefined(exportedData.customerId)) {
            delete exportedData.customerId;
        }
        return exportedData;
    }

    function exportToPc(data, filename) {
        if (!data) {
            $log.error('No data');
            return;
        }

        if (!filename) {
            filename = 'download.json';
        }

        if (angular.isObject(data)) {
            data = angular.toJson(data, 2);
        }

        var blob = new Blob([data], {type: 'text/json'});

        // FOR IE:

        if (window.navigator && window.navigator.msSaveOrOpenBlob) {
            window.navigator.msSaveOrOpenBlob(blob, filename);
        }
        else{
            var e = document.createEvent('MouseEvents'),
                a = document.createElement('a');

            a.download = filename;
            a.href = window.URL.createObjectURL(blob);
            a.dataset.downloadurl = ['text/json', a.download, a.href].join(':');
            e.initEvent('click', true, false, window,
                0, 0, 0, 0, 0, false, false, false, false, 0, null);
            a.dispatchEvent(e);
        }
    }

    function openImportDialog($event, importTitle, importFileLabel) {
        var deferred = $q.defer();
        $mdDialog.show({
            controller: 'ImportDialogController',
            controllerAs: 'vm',
            templateUrl: importDialogTemplate,
            locals: {
                importTitle: importTitle,
                importFileLabel: importFileLabel
            },
            parent: angular.element($document[0].body),
            skipHide: true,
            fullscreen: true,
            targetEvent: $event
        }).then(function (importData) {
            deferred.resolve(importData);
        }, function () {
            deferred.reject();
        });
        return deferred.promise;
    }

}

/* eslint-enable no-undef, angular/window-service, angular/document-service */


text:
from oslo_utils import importutils

from neutron.tests import base

_AGENT_PACKAGE = 'neutron.plugins.ml2.drivers.openvswitch.agent'
_AGENT_NAME = _AGENT_PACKAGE + '.ovs_neutron_agent'
_DVR_AGENT_NAME = ('neutron.plugins.ml2.drivers.openvswitch.agent.'
                   'ovs_dvr_neutron_agent')

class OVSAgentConfigTestBase(base.BaseTestCase):
    def setUp(self):
        super(OVSAgentConfigTestBase, self).setUp()
        self.mod_agent = importutils.import_module(_AGENT_NAME)
        self.mod_dvr_agent = importutils.import_module(_DVR_AGENT_NAME)

class OVSAgentTestBase(OVSAgentConfigTestBase):
    def setUp(self):
        super(OVSAgentTestBase, self).setUp()
        self.br_int_cls = importutils.import_class(self._BR_INT_CLASS)
        self.br_phys_cls = importutils.import_class(self._BR_PHYS_CLASS)
        self.br_tun_cls = importutils.import_class(self._BR_TUN_CLASS)

    def _bridge_classes(self):
        return {
            'br_int': self.br_int_cls,
            'br_phys': self.br_phys_cls,
            'br_tun': self.br_tun_cls,
        }

class OVSOFCtlTestBase(OVSAgentTestBase):
    _DRIVER_PACKAGE = _AGENT_PACKAGE + '.openflow.ovs_ofctl'
    _BR_INT_CLASS = _DRIVER_PACKAGE + '.br_int.OVSIntegrationBridge'
    _BR_TUN_CLASS = _DRIVER_PACKAGE + '.br_tun.OVSTunnelBridge'
    _BR_PHYS_CLASS = _DRIVER_PACKAGE + '.br_phys.OVSPhysicalBridge'


text:
layout: post
title: Wax That Ass Good
titleinfo: pornvd
desc: Watch Wax That Ass Good. Pornhub is the ultimate xxx porn and sex site.
---

Wax That Ass Good

Watch Wax That Ass Good. Pornhub is the ultimate xxx porn and sex site.


text:
package org.lwjgl.opengl;

/**
 * Native bindings to the AMD_blend_minmax_factor extension.
 *
 *
The EXT_blend_minmax extension extended the GL's blending functionality to allow the blending equation to be specified by the application. That
 * extension introduced the MIN_EXT and MAX_EXT blend equations, which caused the result of the blend equation to become the minimum or maximum of the
 * source color and destination color, respectively.

 *
 *
The MIN_EXT and MAX_EXT blend equations, however, do not include the source or destination blend factors in the arguments to the min and max functions.
 * This extension provides two new blend equations that produce the minimum or maximum of the products of the source color and source factor, and the
 * destination color and destination factor.

 */
public final class AMDBlendMinmaxFactor {

	/**
	 * Accepted by the {@code mode} parameter of BlendEquation and BlendEquationi, and by the {@code modeRGB} and {@code modeAlpha} parameters of
	 * BlendEquationSeparate and BlendEquationSeparatei.
	 */
	public static final int
		GL_FACTOR_MIN_AMD = 0x901C,
		GL_FACTOR_MAX_AMD = 0x901D;

	private AMDBlendMinmaxFactor() {}

}