text:
#include "twoDModel/engine/view/twoDModelWidget.h"
#include "ui_twoDModelWidget.h"

#include <QtCore/qmath.h>
#include <QtWidgets/QMessageBox>

#include <qrkernel/settingsManager.h>
#include <qrkernel/exception/exception.h>
#include <qrutils/outFile.h>
#include <qrutils/xmlUtils.h>
#include <qrutils/qRealFileDialog.h>
#include <qrgui/controller/controllerInterface.h>
#include <qrgui/plugins/toolPluginInterface/usedInterfaces/errorReporterInterface.h>

#include <kitBase/devicesConfigurationWidget.h>
#include <kitBase/robotModel/robotParts/motor.h>

#include "parts/actionsBox.h"
#include "parts/colorItemPopup.h"
#include "parts/imageItemPopup.h"
#include "parts/robotItemPopup.h"
#include "parts/speedPopup.h"

#include "scene/twoDModelScene.h"
#include "scene/robotItem.h"

#include "src/engine/items/wallItem.h"
#include "src/engine/items/curveItem.h"
#include "src/engine/items/rectangleItem.h"
#include "src/engine/items/ellipseItem.h"
#include "src/engine/items/stylusItem.h"
#include "src/engine/items/imageItem.h"
#include "src/engine/commands/changePropertyCommand.h"

#include "twoDModel/engine/model/constants.h"
#include "twoDModel/engine/model/model.h"

#include "nullTwoDModelDisplayWidget.h"

using namespace twoDModel;
using namespace view;
using namespace model;
using namespace qReal;
using namespace utils;
using namespace graphicsUtils;
using namespace kitBase;
using namespace kitBase::robotModel;
using namespace robotParts;

const QList<int> speedFactors = { 2, 3, 4, 5, 6, 8, 10, 15, 20 };
const int defaultSpeedFactorIndex = 3;

TwoDModelWidget::TwoDModelWidget(Model &model, QWidget *parent)
	: QWidget(parent)
	, mUi(new Ui::TwoDModelWidget)
	, mActions(new ActionsBox)
	, mModel(model)
	, mDisplay(new twoDModel::engine::NullTwoDModelDisplayWidget())
	, mNullDisplay(new twoDModel::engine::NullTwoDModelDisplayWidget())
	, mCurrentSpeed(defaultSpeedFactorIndex)
	, mNoneCursorType(noDrag)
	, mCursorType(noDrag)
{
	setWindowIcon(QIcon(":/icons/2d-model.svg"));

	initWidget();
	initPalette();

	connectUiButtons();

	mUi->detailsTab->setPhysicsSettings(mUi->physicsFrame);
	mUi->realisticPhysicsCheckBox->setChecked(mModel.settings().realisticPhysics());
	mUi->enableSensorNoiseCheckBox->setChecked(mModel.settings().realisticSensors());
	mUi->enableMotorNoiseCheckBox->setChecked(mModel.settings().realisticMotors());
	changePhysicsSettings();

	connect(mScene, &TwoDModelScene::selectionChanged, this, &TwoDModelWidget::onSelectionChange);
	connect(mScene, &TwoDModelScene::mousePressed, this, &TwoDModelWidget::refreshCursor);
	connect(mScene, &TwoDModelScene::mouseReleased, this, &TwoDModelWidget::refreshCursor);
	connect(mScene, &TwoDModelScene::mouseReleased, this, [this](){ saveToRepo(); });
	connect(mScene, &TwoDModelScene::robotPressed, mUi->palette, &Palette::unselect);
	connect(mScene, &TwoDModelScene::robotListChanged, this, &TwoDModelWidget::onRobotListChange);

	connect(&mModel.worldModel(), &WorldModel::backgroundChanged, mScene, &TwoDModelScene::setBackground);
	connect(&mModel.timeline(), &Timeline::started, [this]() {
		if (mRobotPositionReadOnly) {
			returnToStartMarker();
		}
	});
	connect(&mModel.timeline(), &Timeline::started, [this]() { bringToFront(); mUi->timelineBox->setValue(0); });
	connect(&mModel.timeline(), &Timeline::tick, this, &TwoDModelWidget::incrementTimelineCounter);
	connect(&mModel.timeline(), &Timeline::started, this, &TwoDModelWidget::setRunStopButtonsVisibility);
	connect(&mModel.timeline(), &Timeline::stopped, this, &TwoDModelWidget::setRunStopButtonsVisibility);
	connect(&mModel.timeline(), &Timeline::speedFactorChanged, [=](int value) {
		const QPoint downCoords = mUi->speedDownButton->mapTo(this, mUi->speedDownButton->rect().bottomRight());
		const QPoint upCoords = mUi->speedUpButton->mapTo(this, mUi->speedUpButton->rect().bottomLeft());
		const QPoint coords((downCoords.x() + upCoords.x() - mSpeedPopup->width()) / 2, downCoords.y() + 10);
		mSpeedPopup->move(coords);
		// Setting value in percents
		mSpeedPopup->setSpeed(100 / speedFactors[defaultSpeedFactorIndex] * value);
	});
	setRunStopButtonsVisibility();

	mUi->palette->unselect();

	setFocus();

	mModel.timeline().setSpeedFactor(speedFactors[defaultSpeedFactorIndex]);
	checkSpeedButtons();
	mUi->timelineBox->setSingleStep(Timeline::timeInterval * 0.001);

	mUi->horizontalRuler->setScene(mUi->graphicsView);
	mUi->verticalRuler->setScene(mUi->graphicsView);
	mUi->horizontalRuler->setPixelsInCm(pixelsInCm);
	mUi->verticalRuler->setPixelsInCm(pixelsInCm);

	/// @todo: make some values editable
	mUi->detailsTab->setParamsSettings(mUi->physicsParamsFrame);
	mUi->wheelDiamInCm->setValue(robotWheelDiameterInCm);
	mUi->wheelDiamInCm->setButtonSymbols(QAbstractSpinBox::NoButtons);
	mUi->robotHeightInCm->setValue(robotHeight / pixelsInCm); // Not sure if correct
	mUi->robotHeightInCm->setButtonSymbols(QAbstractSpinBox::NoButtons);
	mUi->robotWidthInCm->setValue(robotWidth / pixelsInCm);
	mUi->robotWidthInCm->setButtonSymbols(QAbstractSpinBox::NoButtons);
	mUi->robotMassInGr->setValue(robotMass);
	mUi->robotMassInGr->setButtonSymbols(QAbstractSpinBox::NoButtons);
}

TwoDModelWidget::~TwoDModelWidget()
{
	mSelectedRobotItem = nullptr;
	delete mScene;
	delete mDisplay;
	delete mUi;
}

void TwoDModelWidget::initWidget()
{
	setWindowFlags(windowFlags() | Qt::WindowMinMaxButtonsHint);

	mUi->setupUi(this);

	mScene = new TwoDModelScene(mModel, mUi->graphicsView);
	connectDevicesConfigurationProvider(mScene);
	mScene->addActions(mActions->sceneContextMenuActions());
	mUi->graphicsView->setScene(mScene);
	mUi->graphicsView->setAlignment(Qt::AlignLeft | Qt::AlignTop);
	move(0, 0);

	QPen defaultPen(Qt::black);
	defaultPen.setWidth(defaultPenWidth);
	// Popups will listen to scene events, appear, disappear and free itself.
	mColorFieldItemPopup = new ColorItemPopup(defaultPen, *mScene, this);
	mImageItemPopup = new ImageItemPopup(*mScene, this);
	mRobotItemPopup = new RobotItemPopup(*mScene, this);
	mSpeedPopup = new SpeedPopup(this);

	mScene->setPenBrushItems(defaultPen, Qt::NoBrush);
	connect(mColorFieldItemPopup, &ColorItemPopup::userPenChanged, [=](const QPen &pen) {
		mScene->setPenBrushItems(pen, QBrush(pen.color(), Qt::NoBrush));
	});
	connect(mColorFieldItemPopup, &ColorItemPopup::propertyChanged, this, &TwoDModelWidget::saveToRepo);

	connect(mImageItemPopup, &ImageItemPopup::somethingChanged, this, &TwoDModelWidget::saveToRepo);

	connect(mSpeedPopup, &SpeedPopup::resetToDefault, this, [=]() {
		mCurrentSpeed = defaultSpeedFactorIndex;
		mModel.timeline().setSpeedFactor(speedFactors[defaultSpeedFactorIndex]);
	});

	mDisplay->setMinimumSize(displaySize);
	mDisplay->setMaximumSize(displaySize);
	mUi->detailsTab->setDisplay(mDisplay);

	auto toggleRulers = [=]() {
		const bool gridVisible = SettingsManager::value("2dShowGrid").toBool();
		mUi->horizontalRuler->setVisible(gridVisible);
		mUi->verticalRuler->setVisible(gridVisible);
	};
	toggleRulers();

	connect(mUi->gridParametersBox, SIGNAL(parametersChanged()), mScene, SLOT(update()));
	connect(mUi->gridParametersBox, &GridParameters::parametersChanged, toggleRulers);
	connect(mUi->gridParametersBox, SIGNAL(parametersChanged()), mUi->horizontalRuler, SLOT(update()));
	connect(mUi->gridParametersBox, SIGNAL(parametersChanged()), mUi->verticalRuler, SLOT(update()));
	connect(mScene, SIGNAL(sceneRectChanged(QRectF)), mUi->horizontalRuler, SLOT(update()));
	connect(mScene, SIGNAL(sceneRectChanged(QRectF)), mUi->verticalRuler, SLOT(update()));
	connect(mScene, &AbstractScene::focused, this, [=]() { onFocusIn(); });
	connect(mScene->mainView(), SIGNAL(zoomChanged()), mUi->horizontalRuler, SLOT(update()));
	connect(mScene->mainView(), SIGNAL(zoomChanged()), mUi->verticalRuler, SLOT(update()));
	connect(mScene->mainView(), SIGNAL(contentsRectChanged()), mUi->horizontalRuler, SLOT(update()));
	connect(mScene->mainView(), SIGNAL(contentsRectChanged()), mUi->verticalRuler, SLOT(update()));
}

void TwoDModelWidget::initPalette()
{
	QAction * const wallTool = items::WallItem::wallTool();
	QAction * const lineTool = items::LineItem::lineTool();
	QAction * const bezierTool = items::CurveItem::curveTool();
	QAction * const rectangleTool = items::RectangleItem::rectangleTool();
	QAction * const ellipseTool = items::EllipseItem::ellipseTool();
	QAction * const stylusTool = items::StylusItem::stylusTool();
	QAction * const imageTool = items::ImageItem::imageTool();

	mUi->palette->registerTool(wallTool);
	mUi->palette->registerTool(lineTool);
	mUi->palette->registerTool(bezierTool);
	mUi->palette->registerTool(rectangleTool);
	mUi->palette->registerTool(ellipseTool);
	mUi->palette->registerTool(stylusTool);
	mUi->palette->registerTool(imageTool);

	connect(wallTool, &QAction::triggered, mScene, &TwoDModelScene::addWall);
	connect(lineTool, &QAction::triggered, mScene, &TwoDModelScene::addLine);
	connect(bezierTool, &QAction::triggered, mScene, &TwoDModelScene::addBezier);
	connect(rectangleTool, &QAction::triggered, mScene, &TwoDModelScene::addRectangle);
	connect(ellipseTool, &QAction::triggered, mScene, &TwoDModelScene::addEllipse);
	connect(stylusTool, &QAction::triggered, mScene, &TwoDModelScene::addStylus);
	connect(imageTool, &QAction::triggered, mScene, &TwoDModelScene::addImage);
	connect(&mUi->palette->cursorAction(), &QAction::triggered, mScene, &TwoDModelScene::setNoneStatus);

	connect(wallTool, &QAction::triggered, [this](){ setCursorTypeForDrawing(drawWall); });
	connect(lineTool, &QAction::triggered, [this](){ setCursorTypeForDrawing(drawLine); });
	connect(ellipseTool, &QAction::triggered, [this](){ setCursorTypeForDrawing(drawEllipse); });
	connect(stylusTool, &QAction::triggered, [this](){ setCursorTypeForDrawing(drawStylus); });
	connect(&mUi->palette->cursorAction(), &QAction::triggered, [this](){ setCursorTypeForDrawing(mNoneCursorType); });
}

void TwoDModelWidget::initDetailsTab()
{
}

void TwoDModelWidget::connectUiButtons()
{
	connect(mUi->realisticPhysicsCheckBox, &QAbstractButton::toggled, this, &TwoDModelWidget::changePhysicsSettings);
	connect(mUi->enableMotorNoiseCheckBox, &QAbstractButton::toggled, this, &TwoDModelWidget::changePhysicsSettings);
	connect(mUi->enableSensorNoiseCheckBox, &QAbstractButton::toggled, this, &TwoDModelWidget::changePhysicsSettings);

	connect(&mActions->deleteAllAction(), &QAction::triggered, [this](){
		QMessageBox confirmation;
		confirmation.setWindowTitle(tr("Warning"));
		confirmation.setText(tr("Do you really want to clear scene?"));
		confirmation.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
		confirmation.setButtonText(QMessageBox::Yes, tr("Yes"));
		confirmation.setButtonText(QMessageBox::Cancel, tr("Cancel"));
		if (QMessageBox::Yes == confirmation.exec()) {
			mScene->clearScene(false, Reason::userAction);
		}
	});

	connect(&mActions->clearFloorAction(), &QAction::triggered, &mModel.worldModel(), &WorldModel::clearRobotTrace);
	connect(&mModel.worldModel(), &WorldModel::robotTraceAppearedOrDisappeared
			, &mActions->clearFloorAction(), &QAction::setEnabled, Qt::QueuedConnection);

	connect(&mActions->saveModelAction(), &QAction::triggered, this, &TwoDModelWidget::saveWorldModel);
	connect(&mActions->loadModelAction(), &QAction::triggered, this, &TwoDModelWidget::loadWorldModel);
	connect(&mActions->setBackgroundAction(), &QAction::triggered, this, &TwoDModelWidget::setBackground);

	connect(mUi->speedUpButton, &QAbstractButton::clicked, this, &TwoDModelWidget::speedUp);
	connect(mUi->speedDownButton, &QAbstractButton::clicked, this, &TwoDModelWidget::speedDown);

	connect(mRobotItemPopup, &RobotItemPopup::followingChanged, this, &TwoDModelWidget::enableRobotFollowing);
	connect(&mActions->scrollHandModeAction(), &QAction::triggered
			, this, &TwoDModelWidget::onHandCursorActionTriggered);
	connect(&mActions->multiSelectionModeAction(), &QAction::triggered
			, this, &TwoDModelWidget::onMultiselectionCursorActionTriggered);

	connect(mRobotItemPopup, &RobotItemPopup::restoreRobotPositionClicked, this, &TwoDModelWidget::returnToStartMarker);
	connect(mUi->initialStateButton, &QAbstractButton::clicked, this, &TwoDModelWidget::returnToStartMarker);
	connect(mUi->toggleDetailsButton, &QAbstractButton::clicked, this, &TwoDModelWidget::toggleDetailsVisibility);

	connect(mUi->trainingModeButton, &QAbstractButton::toggled, this, &TwoDModelWidget::trainingModeChanged);
	mUi->trainingModeButton->setChecked(false);

	initRunStopButtons();
}

void TwoDModelWidget::setPortsGroupBoxAndWheelComboBoxes()
{
	mCurrentConfigurer = new DevicesConfigurationWidget(mUi->portsFrame, true, true);
	mCurrentConfigurer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
	mCurrentConfigurer->loadRobotModels({ &mSelectedRobotItem->robotModel().info() });
	mCurrentConfigurer->selectRobotModel(mSelectedRobotItem->robotModel().info());
	mUi->portsFrame->layout()->addWidget(mCurrentConfigurer);
	mCurrentConfigurer->connectDevicesConfigurationProvider(&mSelectedRobotItem->robotModel().configuration());
	connectDevicesConfigurationProvider(&mSelectedRobotItem->robotModel().configuration());

	auto connectWheelComboBox = [this](QComboBox * const comboBox, RobotModel::WheelEnum wheel) {
				connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
						, [this, wheel, comboBox](int index) {
								mSelectedRobotItem->robotModel().setMotorPortOnWheel(wheel
										, comboBox->itemData(index).value<PortInfo>());
						});
		};

	connectWheelComboBox(mUi->leftWheelComboBox, RobotModel::left);
	connectWheelComboBox(mUi->rightWheelComboBox, RobotModel::right);

	mUi->detailsTab->setDevicesConfigurer(mUi->portsFrame);
	mUi->detailsTab->setMotorsConfigurer(mUi->motorsFrame);
}

void TwoDModelWidget::unsetPortsGroupBoxAndWheelComboBoxes()
{
	if (mCurrentConfigurer) {
		mUi->portsFrame->layout()->removeWidget(mCurrentConfigurer);
		mCurrentConfigurer->disconnectDevicesConfigurationProvider();

		if (mSelectedRobotItem) {
			mSelectedRobotItem->robotModel().configuration().disconnectDevicesConfigurationProvider();
		}

		delete mCurrentConfigurer;
	}
}

void TwoDModelWidget::returnToStartMarker()
{
	mModel.worldModel().clearRobotTrace();
	for (RobotModel * const model : mModel.robotModels()) {
		mScene->robot(*model)->returnToStartPosition();
	}
}

void TwoDModelWidget::trainingModeChanged(bool enabled)
{
	mUi->trainingModeButton->setToolTip(enabled
			? tr("Training mode: solution will not be checked")
			: tr("Checking mode: solution will be checked, errors will be reported"));
	mModel.setConstraintsEnabled(!enabled);
}

void TwoDModelWidget::keyPressEvent(QKeyEvent *event)
{
	QWidget::keyPressEvent(event);
	if (event->key() == Qt::Key_F5) {
		mUi->runButton->animateClick();
	} else if (event->key() == Qt::Key_Escape) {
		mUi->stopButton->animateClick();
	}
}

void TwoDModelWidget::close()
{
	setVisible(false);
}

void TwoDModelWidget::changeEvent(QEvent *e)
{
	QWidget::changeEvent(e);
	switch (e->type()) {
	case QEvent::LanguageChange:
		mUi->retranslateUi(this);
		break;
	default:
		break;
	}
}

void TwoDModelWidget::showEvent(QShowEvent *e)
{
	e->accept();
	QWidget::showEvent(e);
	if (mFirstShow) {
		mFirstShow = false;
		onFirstShow();
	}
}

void TwoDModelWidget::onFirstShow()
{
	enableRobotFollowing(SettingsManager::value("2dFollowingRobot").toBool());
	setCursorType(static_cast<CursorType>(SettingsManager::value("2dCursorType").toInt()));
	setDetailsVisibility(SettingsManager::value("2d_detailsVisible").toBool());
}

void TwoDModelWidget::centerOnRobot()
{
	if (mSelectedRobotItem && mFollowRobot && mSelectedRobotItem->robotModel().onTheGround()) {
		mScene->centerOnRobot(mSelectedRobotItem);
	}
}

void TwoDModelWidget::setCursorTypeForDrawing(CursorType type)
{
	mCursorType = type;
	mUi->graphicsView->setCursor(cursorTypeToCursor(mCursorType));
}

void TwoDModelWidget::saveWorldModel()
{
	// Saves world and robot models simultaneously, for now.
	QString saveFileName = QRealFileDialog::getSaveFileName("Save2DModelWidget", this
			, tr("Saving world and robot model"), ".", tr("2D model saves (*.xml)"));
	if (saveFileName.isEmpty()) {
		return;
	}

	if (!saveFileName.toLower().endsWith(".xml")) {
		saveFileName += ".xml";
	}

	const QDomDocument save = generateXml();

	utils::OutFile saveFile(saveFileName);
	saveFile() << "<?xml version='1.0' encoding='utf-8'?>\n";
	saveFile() << save.toString(4);
}

void TwoDModelWidget::loadWorldModel()
{
	// Loads world and robot models simultaneously.
	const QString loadFileName = QRealFileDialog::getOpenFileName("Open2DModelWidget", this
			, tr("Loading world and robot model"), ".", tr("2D model saves (*.xml)"));
	if (loadFileName.isEmpty()) {
		return;
	}

	QString errorMessage;
	int errorLine = 0;
	int errorColumn = 0;
	const QDomDocument save = utils::xmlUtils::loadDocument(loadFileName, &errorMessage, &errorLine, &errorColumn);
	if (!errorMessage.isEmpty()) {
		mModel.errorReporter()->addError(QString("%1:%2: %3")
				.arg(QString::number(errorLine), QString::number(errorColumn), errorMessage));
	}

	loadXml(save);
}

void TwoDModelWidget::setBackground()
{
	// Loads world and robot models simultaneously.
	const QString loadFileName = QRealFileDialog::getOpenFileName("2DSelectBackground", this
			, tr("Select background image"), "./fields", tr("Graphics (*.*)"));
	if (loadFileName.isEmpty()) {
		return;
	}

	const Image image(loadFileName, false);
	const QSize size = image.preferedSize();
	mModel.worldModel().setBackground(image, QRect(QPoint(-size.width()/2, -size.height()/2), size));
}

bool TwoDModelWidget::isColorItem(AbstractItem * const item) const
{
	return dynamic_cast<items::ColorFieldItem *>(item)
			&& !dynamic_cast<items::WallItem *>(item);
}

QList<AbstractItem *> TwoDModelWidget::selectedColorItems() const
{
	QList<AbstractItem *> resList;
	for (QGraphicsItem * const graphicsItem : mScene->selectedItems()) {
		AbstractItem *item = dynamic_cast<AbstractItem*>(graphicsItem);
		if (item && (isColorItem(item) || dynamic_cast<RobotItem *>(item))) {
			resList << item;
		}
	}

	return resList;
}

void TwoDModelWidget::onSelectionChange()
{
	if (mScene->oneRobot()) {
		return;
	}

	const QList<QGraphicsItem *> listSelectedItems = mScene->selectedItems();
	RobotItem *robotItem = nullptr;
	bool oneRobotItem = false;

	for (QGraphicsItem *item : listSelectedItems) {
		if (dynamic_cast<RobotItem *>(item)) {
			robotItem = dynamic_cast<RobotItem *>(item);
			if (oneRobotItem) {
				if (mSelectedRobotItem) {
					unsetSelectedRobotItem();
				}

				return;
			}
			oneRobotItem = true;
		}
	}

	if (oneRobotItem
			&& mSelectedRobotItem
			&& robotItem->robotModel().info().robotId() == mSelectedRobotItem->robotModel().info().robotId())
	{
		return;
	}

	if (mSelectedRobotItem) {
		unsetSelectedRobotItem();
	}

	if (oneRobotItem) {
		if (robotItem->robotModel().info().name() == "NullTwoDRobotModel") {
			return;
		}

		setSelectedRobotItem(robotItem);
	}
}

void TwoDModelWidget::speedUp()
{
	if (mCurrentSpeed < speedFactors.count() - 1) {
		mModel.timeline().setSpeedFactor(speedFactors[++mCurrentSpeed]);
		checkSpeedButtons();
	}
}

void TwoDModelWidget::speedDown()
{
	if (mCurrentSpeed > 0) {
		mModel.timeline().setSpeedFactor(speedFactors[--mCurrentSpeed]);
		checkSpeedButtons();
	}
}

void TwoDModelWidget::checkSpeedButtons()
{
	mUi->speedUpButton->setEnabled(mCurrentSpeed < speedFactors.count() - 1);
	mUi->speedDownButton->setEnabled(mCurrentSpeed > 0);
}

TwoDModelScene *TwoDModelWidget::scene()
{
	return mScene;
}

engine::TwoDModelDisplayWidget *TwoDModelWidget::display()
{
	return mDisplay;
}

void TwoDModelWidget::setSensorVisible(const kitBase::robotModel::PortInfo &port, bool isVisible)
{
	RobotModel *robotModel = mModel.robotModels()[0];

	if (mScene->robot(*robotModel)->sensors()[port]) {
		mScene->robot(*robotModel)->sensors()[port]->setVisible(isVisible);
	}
}

void TwoDModelWidget::closeEvent(QCloseEvent *event)
{
	Q_UNUSED(event)
	emit widgetClosed();
}

void TwoDModelWidget::focusInEvent(QFocusEvent *event)
{
	QWidget::focusInEvent(event);
	onFocusIn();
}

SensorItem *TwoDModelWidget::sensorItem(const kitBase::robotModel::PortInfo &port)
{
	return mScene->robot(*mModel.robotModels()[0])->sensors().value(port);
}

void TwoDModelWidget::saveToRepo()
{
	emit mModel.modelChanged(generateXml());
}

QDomDocument TwoDModelWidget::generateXml() const
{
	return mModel.serialize();
}

void TwoDModelWidget::loadXml(const QDomDocument &worldModel)
{
	if (mController) {
		// Clearing 2D model undo stack...
		mController->moduleClosed(editorId());
		mController->moduleOpened(editorId());
	}

	mScene->clearScene(true, Reason::loading);
	mModel.deserialize(worldModel);
	updateWheelComboBoxes();
	mUi->trainingModeButton->setVisible(mModel.hasConstraints());
}

Model &TwoDModelWidget::model() const
{
	return mModel;
}

void TwoDModelWidget::setController(ControllerInterface &controller)
{
	mController = &controller;
	mScene->setController(controller);

	auto setItemsProperty = [=](const QStringList &items, const QString &property, const QVariant &value) {
		if (mController) {
			mController->execute(new commands::ChangePropertyCommand(*mScene, mModel, items, property, value));
		}
	};

	connect(mRobotItemPopup, &graphicsUtils::ItemPopup::propertyChanged, this, setItemsProperty);
	connect(mColorFieldItemPopup, &graphicsUtils::ItemPopup::propertyChanged, this, setItemsProperty);
	connect(mImageItemPopup, &graphicsUtils::ItemPopup::propertyChanged, this, setItemsProperty);
}

void TwoDModelWidget::setInteractivityFlags(ReadOnlyFlags flags)
{
	const bool worldReadOnly = (flags & ReadOnly::World) != 0;

	mUi->palette->setVisible(!worldReadOnly);
	mActions->setWorldModelActionsVisible(!worldReadOnly);
	mColorFieldItemPopup->setEnabled(!worldReadOnly);

	const auto hasSpacer = [this]() {
		for (int i = 0; i < mUi->sceneHeaderWidget->layout()->count(); ++i) {
			if (mUi->sceneHeaderWidget->layout()->itemAt(i) == mUi->horizontalSpacer) {
				return true;
			}
		}

		return false;
	};

	mUi->gridParametersBox->setVisible(!worldReadOnly);
	if (!worldReadOnly && hasSpacer()) {
		mUi->sceneHeaderWidget->layout()->removeItem(mUi->horizontalSpacer);
	} else if (worldReadOnly && !hasSpacer()){
		static_cast<QHBoxLayout *>(mUi->sceneHeaderWidget->layout())->insertItem(1, mUi->horizontalSpacer);
	}

	const bool sensorsReadOnly = flags.testFlag(ReadOnly::Sensors);
	const bool robotConfigurationReadOnly = flags.testFlag(ReadOnly::RobotSetup);

	mUi->detailsTab->setDevicesSectionsVisible(!sensorsReadOnly);
	mUi->detailsTab->setMotorsSectionsVisible(!robotConfigurationReadOnly);

	mCurrentConfigurer->setEnabled(!sensorsReadOnly);
	mUi->leftWheelComboBox->setEnabled(!robotConfigurationReadOnly);
	mUi->rightWheelComboBox->setEnabled(!robotConfigurationReadOnly);

	const bool simulationSettingsReadOnly = flags.testFlag(ReadOnly::SimulationSettings);

	mUi->detailsTab->setPhysicsSectionsVisible(!simulationSettingsReadOnly);

	mSensorsReadOnly = sensorsReadOnly;
	mRobotPositionReadOnly = flags.testFlag(ReadOnly::RobotPosition);

	mScene->setInteractivityFlags(flags);
}

void TwoDModelWidget::setCompactMode(bool enabled)
{
	mCompactMode = enabled;
	setRunStopButtonsVisibility();
	mActions->setSaveLoadActionsShortcutsEnabled(!mCompactMode);
}

QString TwoDModelWidget::editorId() const
{
	return "TrikStudio.2DModel.Editor";
}

bool TwoDModelWidget::supportsZooming() const
{
	return true;
}

void TwoDModelWidget::configure(QAction &zoomIn, QAction &zoomOut, QAction &undo, QAction &redo
		, QAction &copy, QAction &paste, QAction &cut)
{
	EditorInterface::configure(zoomIn, zoomOut, undo, redo, copy, paste, cut);
	addActions({ mZoomInAction, mZoomOutAction, mUndoAction, mRedoAction, mCopyAction, mPasteAction, mCutAction });
}

void TwoDModelWidget::zoomIn()
{
	mScene->mainView()->zoomIn();
}

void TwoDModelWidget::zoomOut()
{
	mScene->mainView()->zoomOut();
}

void TwoDModelWidget::enableRobotFollowing(bool on)
{
	mFollowRobot = on;
	SettingsManager::setValue("2dFollowingRobot", on);
}

void TwoDModelWidget::setCursorType(CursorType cursor)
{
	mNoneCursorType = cursor;
	mCursorType = mNoneCursorType;
	SettingsManager::setValue("2dCursorType", cursor);
	mUi->graphicsView->setDragMode(cursorTypeToDragType(cursor));
	mUi->graphicsView->setCursor(cursorTypeToCursor(cursor));
	syncCursorButtons();
}

void TwoDModelWidget::changePhysicsSettings()
{
	SettingsManager::setValue("2DModelRealisticPhysics", mUi->realisticPhysicsCheckBox->isChecked());
	SettingsManager::setValue("enableNoiseOfSensors", mUi->enableSensorNoiseCheckBox->isChecked());
	SettingsManager::setValue("enableNoiseOfMotors", mUi->enableMotorNoiseCheckBox->isChecked());

	mModel.settings().rereadNoiseSettings();
}

void TwoDModelWidget::toggleDetailsVisibility()
{
	setDetailsVisibility(!mDetailsAreVisible);
}

void TwoDModelWidget::setDetailsVisibility(bool visible)
{
	mDetailsAreVisible = visible;
	mUi->detailsContainer->setVisible(visible);
	const QString direction = visible ? "right" : "left";
	mUi->toggleDetailsButton->setIcon(QIcon(QString(":/icons/2d_%1.png").arg(direction)));
	mUi->toggleDetailsButton->setFlat(visible);
	mUi->toggleDetailsButton->setToolTip(visible ? tr("Hide details") : tr("Show details"));
	SettingsManager::setValue("2d_detailsVisible", visible);
}

void TwoDModelWidget::setRunStopButtonsVisibility()
{
	mUi->runButton->setVisible(!mCompactMode && !mModel.timeline().isStarted());
	mUi->stopButton->setVisible(!mCompactMode && mModel.timeline().isStarted());
}

QGraphicsView::DragMode TwoDModelWidget::cursorTypeToDragType(CursorType type) const
{
	switch(type) {
	case noDrag:
	case drawEllipse:
	case drawLine:
	case drawStylus:
	case drawWall:
		return QGraphicsView::NoDrag;
	case hand:
		return QGraphicsView::ScrollHandDrag;
	case multiselection:
		return QGraphicsView::RubberBandDrag;
	default:
		return QGraphicsView::ScrollHandDrag;
	}
}

QCursor TwoDModelWidget::cursorTypeToCursor(CursorType type) const
{
	switch(type) {
	case noDrag:
		return QCursor(Qt::ArrowCursor);
	case hand:
		return QCursor(Qt::OpenHandCursor);
	case multiselection:
		return QCursor(Qt::ArrowCursor);
	case drawLine:
		return QCursor(QPixmap(":/icons/2d_drawLineCursor.png"), 0, 0);
	case drawWall:
		return QCursor(QPixmap(":/icons/2d_drawWallCursor.png"), 0, 0);
	case drawEllipse:
		return QCursor(QPixmap(":/icons/2d_drawEllipseCursor.png"), 0, 0);
	case drawStylus:
		return QCursor(QPixmap(":/icons/2d_drawStylusCursor.png"), 0, 0);
	default:
		return Qt::ArrowCursor;
	}
}

void TwoDModelWidget::refreshCursor()
{
	mUi->graphicsView->setDragMode(cursorTypeToDragType(mCursorType));
	mUi->graphicsView->setCursor(cursorTypeToCursor(mCursorType));
}

void TwoDModelWidget::onHandCursorActionTriggered()
{
	setCursorType(hand);
	mUi->palette->unselect();
}

void TwoDModelWidget::onMultiselectionCursorActionTriggered()
{
	setCursorType(multiselection);
	mUi->palette->unselect();
}

void TwoDModelWidget::syncCursorButtons()
{
	switch(mNoneCursorType) {
	case hand:
		mActions->scrollHandModeAction().setChecked(true);
		break;
	case multiselection:
		mActions->multiSelectionModeAction().setChecked(true);
		break;
	default:
		break;
	}
}

void TwoDModelWidget::onDeviceConfigurationChanged(const QString &robotModel
		, const PortInfo &port, const DeviceInfo &device, Reason reason)
{
	Q_UNUSED(port)
	Q_UNUSED(device)
	Q_UNUSED(reason)

	/// @todo Convert configuration between models or something?
	if (mSelectedRobotItem && robotModel == mSelectedRobotItem->robotModel().info().robotId()) {
		updateWheelComboBoxes();
	}
}

void TwoDModelWidget::bringToFront()
{
	if (isHidden()) {
		show();
	}

	if (!isActiveWindow()) {
		activateWindow();
	}
}

void TwoDModelWidget::initRunStopButtons()
{
	connect(mUi->runButton, &QPushButton::clicked, this, &TwoDModelWidget::runButtonPressed);
	connect(mUi->stopButton, &QPushButton::clicked, this, &TwoDModelWidget::stopButtonPressed);
}

bool TwoDModelWidget::setSelectedPort(QComboBox * const comboBox, const PortInfo &port)
{
	for (int i = 0; i < comboBox->count(); ++i) {
		if (comboBox->itemData(i).value<PortInfo>() == port) {
			comboBox->setCurrentIndex(i);
			return true;
		}
	}

	return false;
}

void TwoDModelWidget::updateWheelComboBoxes()
{
	if (!mSelectedRobotItem) {
		mUi->leftWheelComboBox->hide();
		mUi->rightWheelComboBox->hide();
		return;
	}

	const PortInfo leftWheelOldPort = mUi->leftWheelComboBox->currentData().value<PortInfo>();
	const PortInfo rightWheelOldPort = mUi->rightWheelComboBox->currentData().value<PortInfo>();

	mUi->leftWheelComboBox->clear();
	mUi->rightWheelComboBox->clear();

	/// @todo More general way of specifying uninitialized values, or someone actually will name some port as "None".
	mUi->leftWheelComboBox->addItem(tr("No wheel"), QVariant::fromValue(PortInfo("None", output)));
	mUi->rightWheelComboBox->addItem(tr("No wheel"), QVariant::fromValue(PortInfo("None", output)));

	for (const PortInfo &port : mSelectedRobotItem->robotModel().info().availablePorts()) {
		for (const DeviceInfo &device : mSelectedRobotItem->robotModel().info().allowedDevices(port)) {
			if (device.isA<Motor>()) {
				const QString item = tr("%1 (port %2)").arg(device.friendlyName(), port.userFriendlyName());
				mUi->leftWheelComboBox->addItem(item, QVariant::fromValue(port));
				mUi->rightWheelComboBox->addItem(item, QVariant::fromValue(port));
			}
		}
	}

	if (!setSelectedPort(mUi->leftWheelComboBox, leftWheelOldPort)) {
		if (!setSelectedPort(mUi->leftWheelComboBox
				, mSelectedRobotItem->robotModel().info().defaultLeftWheelPort())) {
			qWarning() << "Incorrect defaultLeftWheelPort set in configurer:"
					<< mSelectedRobotItem->robotModel().info().defaultLeftWheelPort().toString();

			if (mUi->leftWheelComboBox->count() > 1) {
				mUi->leftWheelComboBox->setCurrentIndex(1);
			}
		}
	}

	if (!setSelectedPort(mUi->rightWheelComboBox, rightWheelOldPort)) {
		if (!setSelectedPort(mUi->rightWheelComboBox
				, mSelectedRobotItem->robotModel().info().defaultRightWheelPort())) {

			qWarning() << "Incorrect defaultRightWheelPort set in configurer:"
					<< mSelectedRobotItem->robotModel().info().defaultRightWheelPort().toString();

			if (mUi->rightWheelComboBox->count() > 2) {
				mUi->rightWheelComboBox->setCurrentIndex(2);
			} else if (mUi->rightWheelComboBox->count() > 1) {
				mUi->rightWheelComboBox->setCurrentIndex(1);
			}
		}
	}
}

void TwoDModelWidget::onRobotListChange(RobotItem *robotItem)
{
	if (mScene->oneRobot()) {
		setSelectedRobotItem(mScene->robot(*mModel.robotModels()[0]));
	} else {
		if (mSelectedRobotItem) {
			unsetSelectedRobotItem();
		}
	}

	if (robotItem) {
		connect(&robotItem->robotModel().configuration(), &SensorsConfiguration::deviceAdded
				, [this, robotItem](const PortInfo &port) { mScene->reinitSensor(robotItem, port); });

		auto checkAndSaveToRepo = [this](const PortInfo &port, bool isLoaded) {
			Q_UNUSED(port);
			if (!isLoaded) {
				saveToRepo();
			}
		};

		connect(&robotItem->robotModel().configuration(), &SensorsConfiguration::deviceAdded, checkAndSaveToRepo);
		connect(&robotItem->robotModel().configuration(), &SensorsConfiguration::deviceRemoved, checkAndSaveToRepo);

		connect(&robotItem->robotModel(), &RobotModel::wheelOnPortChanged
				, [=](RobotModel::WheelEnum wheel, const PortInfo &port)
		{
			if (port.isValid()) {
				setSelectedPort(wheel == RobotModel::WheelEnum::left
						? mUi->leftWheelComboBox : mUi->rightWheelComboBox, port);
			}
		});
	}
}

void TwoDModelWidget::setSelectedRobotItem(RobotItem *robotItem)
{
	mSelectedRobotItem = robotItem;

	connect(&mSelectedRobotItem->robotModel(), &RobotModel::robotRided, this, &TwoDModelWidget::centerOnRobot);
	connect(&mSelectedRobotItem->robotModel(), &RobotModel::positionChanged, this, &TwoDModelWidget::centerOnRobot);

	setPortsGroupBoxAndWheelComboBoxes();
	updateWheelComboBoxes();

	mUi->detailsTab->setDisplay(nullptr);
	mDisplay = mSelectedRobotItem->robotModel().info().displayWidget();
	mDisplay->setParent(this);
	mDisplay->setMinimumSize(displaySize);
	mDisplay->setMaximumSize(displaySize);
	mUi->detailsTab->setDisplay(mDisplay);

	mUi->leftWheelComboBox->show();
	mUi->rightWheelComboBox->show();
}

void TwoDModelWidget::unsetSelectedRobotItem()
{
	if (mSelectedRobotItem) {
		unsetPortsGroupBoxAndWheelComboBoxes();
		disconnect(&mSelectedRobotItem->robotModel(), &RobotModel::robotRided, this
				, &TwoDModelWidget::centerOnRobot);
		disconnect(&mSelectedRobotItem->robotModel(), &RobotModel::positionChanged, this
				, &TwoDModelWidget::centerOnRobot);

		mSelectedRobotItem = nullptr;
	}

	mUi->detailsTab->setDisplay(nullptr);
	mDisplay = mNullDisplay;
	mUi->detailsTab->setDisplay(mDisplay);
}

void TwoDModelWidget::incrementTimelineCounter()
{
	mUi->timelineBox->stepBy(1);
}


You know you?re in for a day of purrfection when your accessory and companion are ascolorful and playful as our Sweet Thyme Sassy Pet Sak with its adorable plush kitten! Apaisley-esque pattern with a bright floral theme decorates the fabric of this vibranthandbag. Sturdy canvas in an attractive shade of teal forms the handles while an ivorycolored pompom fringe runs around the bottom of the purse. Inside a charming felinefriend is looking forward to an exciting make believe adventure or perhaps even a trip tothe mall. Ultra luxurious plush materials make this cuddly cat stuffed animal irresistiblysoft. When you accessorize with Douglas fashion, your impeccable taste and flair for funwill be the talk of the town!


text:
Tag Archives: Television
Game of Thrones: Season Seven, Episode 2 – "Stormborn"
Aegon the Conqueror, Aidan Gillen, Alfie Allen, Anton Lesser, Arya Stark, Balerion the Black Dread, Ben Hawkey, Carice van Houten, Cersei Lannister, Conleth Hill, Daenerys Targaryen, Diana Rigg, Dragonstone, Ellaria Sand, Emilia Clarke, Essie Davis, Euron Greyjoy, Game of Thrones, Gemma Whelan, Grey Worm, HBO, Hot Pie, Iain Glen, Indira Varma, Iwan Rheon, Jack Gleeson, Jacob Anderson, Jaime Lannister, James Cosmo, Jim Broadbent, Joer Mormont, Joffrey Baratheon, John Bradley, Jon Snow, Jorah Mormont, King's Landing, Kit Harington, Lady Crane, Lena Headey, Littlefinger, Maisie Williams, Melisandre, Missandei, Nathalie Emmanuel, Ned Stark, Nikolaj Coster-Waldau, Nymeria, Oberyn Martell, Olenna Tyrell, Pedro Pascal, Peter Dinklage, Pilou Asbaek, Qyburn, Raleigh Ritchie, Ramsay Bolton, Samwell Tarly, Sansa Stark, Sean Bean, Sky Atlantic, Sophie Turner, Stormborn, Television, The Sand Snakes, Theon Greyjoy, TV, TV Review, Tyrion Lannister, Varys, Winterfell, Yara Greyjoy
via alluremedia.com.au
"Stormborn" picked up where the season premiere left off; at Dragonstone. The weather had taken a turn for the worse as a storm raged all around, which was fitting given the title of the episode. Tyrion (Peter Dinklage) immediately brought up the fact that Daenerys (Emilia Clarke) was born at Dragonstone on a night like this, and from here we segued into a discussion about whether or not Varys (Conleth Hill) could be trusted given his past discretions.
Varys' speech about how he serves the realm above all else harkened back to the kind of conversations he would have with Ned (Sean Bean) in season one. I liked the fact that the writers let Varys come across as honest and noble here despite the fact that he's done horrible things, because at the end of the day that's exactly what "Game of Thrones" is about. The characters are supposed to be morally grey and the more entertaining ones are able to talk themselves out of difficult spots, so this scene really worked for me. These kinds of interactions are what make the show great and the fact that they're coming thick and fast excites me.
However, the next scene didn't work quite as well. In this scene Melisandre (Carice van Houten) arrived at Dragonstone with an offer of loyalty to Daenerys. She said that Dany was the prince who was promised and this led to a conversation about her past which included some incredibly transparent exposition. Missandei (Nathalie Emmanuel) explained that the translation of 'the prince who was promised' was flawed because this person could be either male or female, thus adding weight to what Melisandre was saying and boosting Dany's ego.
This scene was similar to the first one except not as good, and in my view it was the low point of the episode. Nevertheless, I'm happy that Melisandre is back because I think Carice van Houten is awesome and for me the character is one of the most intriguing people left on the show; it's just a shame that in this episode she was used as a plot device. She was there simply to facilitate a storyline in which Jon Snow (Kit Harington) would come to Dragonstone and ask for dragonglass – which is fine – but forced dialogue and unnatural behaviour made it feel ridiculously cheap.
I found it very disappointing that on a show as smart as "Thrones" we had characters vouching for people that they hadn't seen for years, because although it's true that Tyrion and Jon Snow grew to like one another in season one I doubt that one would champion the other without a hint of caution.
This kind of disregard for pragmatism happened twice in "Stormborn" as Sansa (Sophie Turner) surprisingly spoke highly of Tyrion when in conversation with Jon. Again she's right in what she's saying, and having been with both Joffrey (Jack Gleeson) and Ramsay (Iwan Rheon) she probably would think fondly of Tyrion, but this kind of support coming from such a hardened character didn't feel real. It felt like another scene designed to move the plot forward rather than enhance the characters involved in it, thus coming across as contrived and manipulative.
via slashgear.com
Thankfully the next scene was much more entertaining as Cersei (Lena Headey) tried to use Dany's arrival in Westeros to her own advantage. The fun thing about this scene was that although Cersei was exaggerating the truth she wasn't entirely wrong; the things that she was saying made sense because although Dany has a right to the Iron Throne she aims to conquer rather than liberate. She would've wanted to be queen regardless of whether or not Cersei was a monster, so it's fair to question whether or not her mission is righteous at all.
A later scene involving Cersei in this episode was also pretty good as Qyburn (Anton Lesser) took her to see the skull of Balerion the Black Dread, the dragon ridden by Aegon the Conqueror during the War of Conquest. Ever since the series began people have wondered how anyone could fight back against a fully-grown dragon, so the fact that the show is addressing this head on gives me hope that what transpires won't feel like a foregone conclusion. Moreover, the fact that the writers have bothered to introduce an equaliser, (in the form of a ballista), leads me to think that at least one of the dragons could be killed during Daenerys' siege on King's Landing.
I'm also happy to say that Sam's (John Bradley) scenes in this episode were far better than his scenes in the premiere. He still felt like a plot device but at least this week he achieved something tangible!
After formally meeting Jorah (Iain Glen) and discovering that he was a Mormont Sam felt a sense of duty towards him, (given that Joer Mormont (James Cosmo) was Lord Commander of the Night's Watch during Sam's time at The Wall), deciding to try to cure him of his greyscale against the advice of Archmaester Ebrose (Jim Broadbent). This was a brilliant scene because it showed that when you want to live on a show like "Game of Thrones" you really have to suffer. Jorah wasn't getting a free pass here – he didn't get to drink a potion or have his disease healed by magic – he had his affliction scraped off piece by piece with puss pouring from his wounds. It was a gritty moment which did a lot for both characters, making them seem stronger than they did before the episode started.
Back in Dragonstone Daenerys and Tyrion explained their strategy for taking King's Landing in detail, with an emphasis on causing as little collateral damage as possible. Personally, I was pleased that the narrative took this route because although it was obvious that it wouldn't work out, (given the fact that this was only the second episode of the penultimate season), it made sense when considering how Daenerys' character has been built in the past. She's someone who will get her hands dirty when the time is right, but for the most part she wants to help the helpless and promotes freedom. Killing civilians isn't her style and the fact that this was taken into account made her feel like a hero rather than just another character.
This was another scene which offered a lot of fan service as characters like Daenerys and Olenna Tyrell (Diana Rigg) interacted for the first time and we even got to see Tyrion and Ellaria (Indira Varma) discuss Oberyn's (Pedro Pascal) death. Seeing these characters come together as allies is genuinely satisfying after such a long time, and even though this scene wasn't perfect it was hard not to feel excited for the future of the series when watching it.
Still, I didn't appreciate Olenna's attempt to turn Dany against Tyrion. This storyline could've been interesting at one point in time, perhaps when Dany and Tyrion first met, but right now it doesn't feel believable. A degree of trust has been built between the two at this point and frankly I have no interest whatsoever in seeing them disagree. We don't have enough time for this kind of side plot so late in the game and it doesn't feel necessary when Jon and Sansa have already teased the fact that their relationship may become fractured by the end of the season. Perhaps the point of Olenna's advice was to make Jon's visit to Dragonstone less simple given that it will be Tyrion who tries to support him while he's there, but for me this scene felt superfluous and wasted valuable time.
via photoyvolution.com
Next there was a scene which I'm still unsure about; the Missandei/Grey Worm (Raleigh Ritchie) sex scene. To me this relationship has always felt like filler on a show which is hurtling towards a bloody conclusion, so although it was executed well I can't say that I enjoyed it. The problem for me is that this moment only serves a purpose if the relationship ends in tragedy, so the fact that it was included makes me think that either Missandei or Grey Worm will die at some point during this season.
Prior to this scene it was clear that the pair had feelings for one another so we didn't need to see them have sex on screen, and if anything the fact that they weren't having sex made their relationship more special. In my opinion, seeing them have sex didn't enhance their relationship or their characters individually, and the inclusion of this scene felt like yet more fan service in an episode which was already full of it.
After the Jorah scene which I already mentioned the episode turned its attention to Arya (Maisie Williams) in the North. Again this was a scene which I didn't really care for but for different reasons. In this episode Arya had two reunions; one with Hot Pie (Ben Hawkey) and one with Nymeria. During the first of these reunions Arya sat and ate with Hot Pie whilst he apologised for thinking that she was a boy when he first met her. This was okay because it reminded the audience that Arya has changed monumentally since the series began; something which was worth mentioning given that she's currently on her way home.
My issue with this scene was that, similarly to the Melisandre scene, it was included for expository purposes. Hot Pie told Arya that the Boltons no longer had Winterfell and that it was under the control of Jon Snow, thus leading Arya to change course and make her way back to her family's ancestral home. This was a necessary piece of information for Arya to discover and I understand why the writers chose to hide it in this scene, but surely they could've found a more discreet way of putting the information across? It was a scene which should've been sweet and heart-warming but instead it felt forced. I know that Arya isn't the girl that she was when the pair were friends so it makes sense that she should be a little cold, but having her treat Hot Pie like a stranger whilst he spat out exposition really wasn't the way to make this scene work.
It feels like the writers are trying to re-humanise Arya after crippling her character over the last couple of seasons, but the problem is that she wasn't actually de-humanised! Arya's arc has made the audience believe that she's a killer but it hasn't made us believe that she'd treat good people badly. Her interactions with characters like Lady Crane (Essie Davis) last season and even the soldiers in the previous episode made her seem like a friendly, warm, gentle person, so it doesn't feel earned when she treats people like Hot Pie with such a palpable level of indifference.
Her scene with Nymeria was much better, although the fact that the direwolf was shown on the teaser for the episode somewhat ruined the reveal. This scene was more emotional than I anticipated and again it served to show how much Arya has changed since the series began. Nymeria acted as a physical representation of Arya's childhood leaving her behind, and although the audience has watched this happen over a prolonged period of time it was still powerful to see the character realise it for herself. Maisie Williams' acting was perfect as she portrayed what Arya was feeling through her facial expressions without needing to cry or over-emote, and it was refreshing to see a scene play out which didn't feel like it had to happen for the plot to progress.
Elsewhere in the North, Jon decided that he would indeed travel to Dragonstone for an audience with Daenerys. Again it was interesting to see how the people of Westeros felt about Daenerys and her inevitable attack on King's Landing, with many of them sharing Cersei's view on the situation. This was a scene which had to happen and it was obvious that Jon would leave Sansa in charge during his absence, but I was surprised that Littlefinger (Aidan Gillen) was so forthright in voicing his intentions to Jon. The fact that he was arrogant enough to enter the crypts of Winterfell and tell Jon that he was in love with Sansa was baffling but also very entertaining, and it's about time that Littlefinger showed his true colours again. Part of me wanted Jon to strangle him to death right then and there, but it's probably better that he be allowed to linger in Winterfell with Sansa for the foreseeable future.
The fact that Jon is going to be gone for a couple of episodes leaves Sansa vulnerable, and I'm looking forward to seeing Littlefinger try to isolate her from her allies as much as possible. However, all signs point towards a Stark reunion at Winterfell in which the lone wolf will die whilst the pack survives.
Finally, "Stormborn" ended with a brilliant sequence which undoubtedly elevated the rest of the episode. After last week it was clear that Euron (Pilou Asbæk) was going to disrupt Daenerys' plans somehow, especially given that those plans relied heavily on travel by sea, but I didn't expect him to be quite as aggressive as he ended up being. I think we all knew that he was going to make a nuisance of himself and perhaps kidnap one of Daenerys' allies, but I personally didn't expect him to deliver as much damage as he did.
Euron brutally murdered two of the Sand Snakes, captured Ellaria and Yara (Gemma Whelan), mentally scarred Theon (Alfie Allen), and set Daenerys' fleet ablaze. The show is positioning him as a real threat this season and I appreciate that because we need someone to hate now that Ramsay is dead. Cersei could be that person but she's a schemer and she doesn't get her hands dirty as often as characters like Ramsay did, so it makes sense that someone crazy like Euron should take centre stage.
This sequence was intense, brutal, and beautifully shot; it made an impression and left me wanting more, so although there were parts of the episode that I didn't enjoy my overall feeling towards it was positive when the credits rolled. The fact that Theon basically reverted back into Reek made the scene all the more impactful and generated intrigue as to what will happen next with the character, and I'm also fascinated as to how Daenerys will react when she finds out what happened.
On the whole I did have a good time watching this episode and this final sequence enhanced my opinion of it greatly. There were parts of it that I didn't like and for me there was too much exposition, but the best scenes of the episode were also the longest and the most memorable. There's too much going on at the moment on the show and this makes it feel disjointed, but I'm excited to see where the story goes from here and I expect the standard to steadily improve each week.
Game of Thrones: Season Six Finale – "The Winds of Winter"
Aidan Gillen, Alfie Allen, Arya Stark, Braavos, Bran Stark, Carice van Houten, Cersei Lannister, Daario Naharis, Daenerys Targaryen, Dean-Charles Chapman, Dorne, Emilia Clarke, Game of Thrones, Gemma Whelan, George RR Martin, GoT, Gwendoline Christie, Isaac Hempstead-Wright, Iwan Rheon, Jaime Lannister, Jaqen H'ghar, Jon Snow, Jonathan Pryce, King's Landing, Kit Harington, Lena Headey, Littlefinger, Loras Tyrell, Maisie Williams, Margaery Tyrell, Meereen, Melisandre, Michiel Huisman, Natalie Dormer, Nikolaj Coster-Waldau, Olenna Tyrell, Peter Dinklage, Ramsay Bolton, Sansa Stark, Sophie Turner, Television, The High Sparrow, The Night's Watch, The Wall, The Winds of Winter, Theon Greyjoy, Tommen Baratheon, TV, Tyrion Lannister, Westeros, White Walkers, Winterfell, Yara Greyjoy
via blackfilm.com
"The Winds of Winter" was a satisfying way to end a decent season of "Game of Thrones". The opening sequence was excellent, as a foreboding orchestral score played behind one of the most spectacular scenes of the show so far, and storylines were left in exciting places. Cersei (Lena Headey) is now Queen of the Seven Kingdoms, Arya (Maisie Williams) is back to killing the people on her list, Jon (Kit Harington) is King of the North, and Bran's (Isaac Hempstead-Wright) visions are confirming decade-old fan theories. All in all the show is in a pretty good place, but that doesn't mean that the season finale or indeed the season as a whole was perfect.
Over the course of season six a couple of notable story threads were disregarded, probably for the sake of streamlining the plot given that next season and the season after are going to be shorter than this one. One such plot point was the identity of The Harpy, which was brought up in episode one but subsequently ignored in future episodes. I doubt that this being kept a secret would've bothered many fans of the series, but it was a frustrating aspect of the Meereen storyline from my perspective because the Sons of the Harpy had been such a menacing presence in season five. During a conversation between Tyrion (Peter Dinklage) and Varys (Conleth Hill) it was suggested that the identity of The Harpy would be revealed, and from my perspective this was exciting because it could've been somebody that we already knew acting as a kind of double agent. It's a shame then that the Sons of the Harpy were largely cut out of season six, and that the identity of their leader was disregarded as Daenerys (Emilia Clarke) and her forces set sail for Westeros in "The Winds of Winter".
Another aspect of the Meereen storyline which was pushed aside this year was the involvement of Kinvara (Ania Bukstein) and the Red Priests, who largely acted as a propaganda machine. When it was announced that there was going to be a new Red Woman on the show, and that this Red Woman would be entangled in Daenerys' storyline, I was intrigued – I thought that this new player could influence Daenerys and take her to the peak of villainy, bringing a level of depth to the character that has (in my opinion) never truly been achieved. Moreover, when Kinvara was introduced into the story in episode five I felt that the actress brought something to the table and that the dynamic she established with Varys had potential. Sadly this was ignored, and instead what we saw in Meereen was predominantly comedic filler involving Tyrion, Grey Worm (Jacob Anderson), and Missandei (Nathalie Emmanuel).
Now, the fact that these two plot threads were swept under the carpet this year isn't a damning indictment of the season as a whole, after all, we could still see these ideas explored in season seven (although given the limited time we have left on the show it's extremely unlikely). The issue is that it feels as though there was an intention at one point to explore these characters further, and it seems as though the reason that this didn't happen was that events were streamlined. I know this is something that I've brought up many times, but I think it's an important issue given that the pacing of season six has been its most noticeable problem.
One of the biggest criticisms I've seen levelled at this season was the way that The Siege of Riverrun was handled, and it seems to me that this was a direct result of the showrunners trying to cram far too much into a short space of time. They wanted to have characters go from A to B, do C, and then return to A in the space of a couple of episodes, when they should've spent a whole season just travelling from A to B! I understand that from a logistical standpoint this might've been necessary because Daniel Weiss and David Benioff want to wrap up the show after season eight, but it seems slightly strange to me that the show went from spending two seasons on The War of the Five Kings to spending one episode on The Kingsmoot, two on The Siege of Riverrun, two on The Siege of Meereen, three on Jon's death and subsequent resurrection, and one on the Battle of the Bastards.
Still, these issues don't ruin season six for me; I enjoyed it for the most part. Certain episodes fell flat, but I thought that the season finale was good and the episode which preceded it was excellent. I was much happier with the way that this year's finale paid off storylines than I was with how last year's handled similar problems, and I was glad that the showrunners didn't try to end season six with another cliffhanger.
Nevertheless, I wouldn't say that "The Winds of Winter" as an episode was perfect, in fact, it was far from it. It's refreshing for me to watch the show with my dad because he hasn't been particularly enamoured by the season as a whole, so when I get carried away with the good parts of an episode he'll say something about a part that didn't really work and I then have to actually assess what I've seen objectively. It's easy to get carried away in the moment when you're watching a show like "Game of Thrones" because it's been on for so long and we're all invested in the characters and their stories, but when you take a step back to think about how certain storylines have progressed you realise that parts didn't really make sense.
One such moment in the season finale was when Grand Maester Pycelle (Julian Glover) was led into Qyburn's (Anton Lesser) lair by one of Varys' little birds. This moment was satisfying because Pycelle has been a traitorous piece of work since the series began and he definitely deserved his comeuppance. However, it didn't make complete sense that he was led into a trap to be stabbed to death when he was probably heading for the Sept of Balor anyway. Pycelle liked to feel important and this season he has turned against Cersei, so it seems obvious to me that he would have attended her trial and if necessary given testimony against her. He wouldn't have missed it, so chances are that he would've got caught up in the explosion that killed Margaery (Natalie Dormer) and The High Sparrow (Jonathan Pryce). So, with that in mind why did Cersei have him lured into one trap in place of another?
The easy answer to this question is that Cersei wanted him to suffer; she knew that he disliked Qyburn because of his experimentation so she wanted him to be the last person that Pycelle spoke to before his death. This is a reasonable explanation given what we know about Cersei and what she did to Septa Unella (Hannah Waddingham) in this episode, but we all know that Qyburn likes to experiment on the living, so it would make more sense to have Pycelle tortured as a guinea pig if the point was to make him suffer.
Another way to get around this issue would be to say that Qyburn had taken a disliking to Pycelle because of how the latter had ridiculed him for his gruesome practices, and in an act of revenge he had Pycelle brought to him so that he could watch him die. This could be believable because Cersei wouldn't have to know how Pycelle died – she'd just think that he died in the explosion with the rest of her victims. However, if this was the case then you'd think that Qyburn would've liked to experiment on Pycelle, given what I've already said, and as a theory it doesn't really fit with the fact that Qyburn said that he felt 'no ill will' towards Pycelle prior to his death. If he'd truly wanted revenge then you'd think that he would've taken the time to gloat.
This is all theoretical of course, but my point is that 1) the way that aspects of this episode were handled left something to be desired, and 2) that the material should've been handled with more care. Maybe the missing pieces will be filled in by George R. R. Martin when he releases "The Winds of Winter" in the future, presuming that the story will progress in the same way that it has on the show, but for now I'm left feeling slightly underwhelmed by aspects of this episode which weren't fully believable.
Other issues I had with the episode include: 1) Margaery's death; 2) Varys' ability to teleport (which is again the result of streamlining as I've previously mentioned); and 3) having to watch Sam's (John Bradley) escapades at The Citadel. None of these issues are particularly important in the grand scheme of things, because we all knew that Margaery would die eventually given that she was desperate to be Queen, and Sam obviously has a part to play in the wider story so he needed some screen time. However, I thought it was quite disappointing that Margaery died in such a nasty and frankly uninteresting way. She's been such a great character and I've always felt that she had something to offer, but now when I watch the series back she'll just feel like a pawn in someone else's game.
As I've said, Sam had to appear in this episode given that he'll probably make a crucial discovery in the future relating to either Jon Snow's birth or the White Walkers, but that doesn't make the scenes he was in any more enjoyable to watch. I have to say that personally I don't think John Bradley is a very good actor, and tonally his scenes are so separate from what's going on elsewhere. His scenes here felt like something out of "Monty Python", and they didn't feel like they belonged in the season finale, especially as they followed scenes which were on the whole quite bleak.
Still, having complained quite a lot in this review I should say that the issues I've brought up were on the whole understandable, and there were a number of great moments to offset the problems. Tommen's (Dean-Charles Chapman) death scene was brilliant, both in the way it was shot and in the way it was performed, and it gave a forgettable character a truly memorable end. The reveal of Jon Snow's parentage at The Tower of Joy was handled reasonably well, and I liked how the baby's face gave way to Kit Harington's so that the characters didn't have to verbally explain what was going on. Finally, and perhaps most importantly, Daenerys finally feels relevant again as she has set sail to King's Landing. Her interaction with Tyrion in this episode was heart-warming, and it was great to see her ditch Daario (Michiel Huisman) who frankly should never have been introduced into the story in the first place. With Ellaria Sand (Indira Varma) and Olenna Tyrell (Diana Rigg) on her side following the finale, as well as Yara (Gemma Whelan) and Theon (Alfie Allen), Dany is in a very powerful and exciting position.
Overall, I felt that "The Winds of Winter" was a good episode, verging on great, but it lacked in certain areas. I know that some of my criticisms could be classed as knit-picking, but to me the little issues are the most frustrating because they're easily avoidable. Moreover, I like to focus on the negative aspects of whatever I'm reviewing, not because I want to criticise, but because anyone can say 'that was good'. It's easy to express your enthusiasm for something because you can just throw adjectives at it and use positive language, but to actually assess something and try to articulate issues takes real thought. The mere fact that I watch "Game of Thrones" on a weekly basis and write roughly 2,000-3,000 words on each episode should be enough for anyone reading this to realise that I like it, so I don't feel the need to waste time saying that in a review. With that in mind, I felt that season six as a whole was much better than season five, and despite my bugbears I did enjoy it; however, for me it pales in comparison to seasons one, two, three, and four.
"The Winds of Winter" – 8/10
Season Six – 7.5/10
Game of Thrones: Season Six, Episode 9 – "Battle of the Bastards"
Aidan Gillen, Alfie Allen, Art Parkinson, Arya Stark, Battle of the Bastards, Breaking Bad, Carice van Houten, Cersei Lannister, Charles Dance, Daenerys Targaryen, Davos Seaworth, Emilia Clarke, Euron Greyjoy, Game of Thrones, Gemma Whelan, George RR Martin, GoT, Grey Worm, Gwendoline Christie, Ian Whyte, Iwan Rheon, Jack Gleeson, Jacob Anderson, Jaime Lannister, Joffrey Baratheon, Jon Snow, King's Landing, Kit Harington, Kristofer Hivju, Lena Headey, Liam Cunningham, Littlefinger, Maisie Williams, Meereen, Melisandre, Nikolaj Coster-Waldau, Peter Dinklage, Pilou Asbaek, Ramsay Bolton, Rickon Stark, Sansa Stark, Sophie Turner, Television, The Knights of the Vale, The Night's Watch, The Rains of Castamere, The Wall, Theon Greyjoy, Tormund Giantsbane, TV, Tyrion Lannister, Tywin Lannister, Vince Gilligan, Winterfell, Wun Wun, Yara Greyjoy
"Battle of the Bastards" was an exceedingly accomplished episode of television. The battle itself was beautifully shot, the music was excellent, and the episode ended in triumph as Ramsay Bolton (Iwan Rheon) met his grizzly end.
The episode began in Meereen, as Daenerys (Emilia Clarke) dealt with the Masters and their siege of the city. This sequence was good and demonstrated the influence that Tyrion (Peter Dinklage) has on Dany, as he was able to quickly turn her thoughts away from fire and blood and into diplomacy. However, this diplomacy didn't come cheap, as Daenerys had two of the Masters killed for breaking the deal that they made with Tyrion.
These scenes showed that Daenerys is a fair and just ruler, but that she will still take what is hers if her enemies decide to fight her. As a sequence it fit with the character as established in earlier seasons, but also took into account the fact that many men have tried to oppress her in the past. She's a conqueror, a ruler, and the mother of dragons, and at this point the show has set things up in a way that makes her taking over Westeros a very realistic possibility.
The only issue I had with the first extended sequence in this episode occurred when Grey Worm (Jacob Anderson) sliced the Masters' throats, because whilst this was a cool shot it didn't really make a lot of sense. When somebody gets their throat cut it isn't a knock-out blow or an instant kill – you die slowly because of suffocation and blood loss. As such, having the Masters fall to the floor immediately felt cheap and silly, especially on a show which is supposed to thrive on its honest depiction of death and violence. It isn't a massive issue, but it's one that annoyed me at the time.
Another less eventful scene took place in Meereen in "Battle of the Bastards", one which showcased that the writers on "Game of Thrones" have become tired of trying to depict travel in an intelligent way. I have to say that the fact that Theon (Alfie Allen) and Yara (Gemma Whelan) made it to Meereen so quickly felt ridiculous to me, especially because so much of the early character development on "Game of Thrones" took place during extended periods of travel. Think of Jaime (Nikolaj Coster-Waldau) and Brienne (Gwendoline Christie) as they journeyed back to King's Landing, and Tyrion as he made his way to The Wall – these trips spanned whole seasons and were incredibly significant in the context of the show.
Still, the scene that took place because of this laziness was engaging and well-written, as Dany, Yara, Theon, and Tyrion spoke about their rough childhoods and bad fathers (which was quite fitting given that the episode aired on Father's Day). The acting in this scene was great as Emilia Clarke reminded us all that Daenerys can be sweet and loveable when she wants to be, and we were forced to remember the way that these characters were when the series began. Tyrion was cocky with a chip on his shoulder, Theon was a sex pest with an attitude problem, and Yara was the favourite child of a vicious ruler. They've all been humbled along the way, particularly Theon and Tyrion, which was very clear because of how this scene was written even though it wasn't explicit.
via wpaperhd.com
What came out of the scene was even more interesting, as we now know that Daenerys is going to side with Yara against Euron (Pilou Asbæk). This was expected because Daenerys has had enough of arrogant men who think they can control her, but it was still nice to watch her make the right choice and do so humbly. What this means for future episodes is unclear because Euron is nowhere to be seen, but it's pretty obvious that Daenerys will use the Iron Fleet and the remaining Masters' ships to sail to Westeros in next week's episode. I'm hoping that in that episode Euron will appear and get killed off – mostly because I can't take him very seriously if he's up against someone as powerful as Daenerys – but it seems more likely that there will be some sort of battle at sea in season seven between Euron's forces and Dany's forces. This would make sense because that's where Euron is the biggest threat and can seem most powerful, and also because the writers will want to build the story in King's Landing before Daenerys arrives. Stalling her travel with an extended battle against Euron would achieve that goal, and would also establish him as a real villain.
In the north the pieces moved quickly to facilitate the battle, as Jon (Kit Harington) and Sansa (Sophie Turner) met Ramsay to discuss the possibility of a truce. Ramsay asked Jon to hand Sansa over in return for peace, and Jon offered Ramsay the chance to settle the issue in one-on-one combat – both offers were declined. This scene acted as fuel for the fire, as the audience were reminded just how nasty Ramsay can be (given that he hasn't been around recently) and Jon was able to get a measure of his enemy before the battle. It was a well-acted scene which was written quite well, and it ramped up the tension.
Following this scene, Jon, Davos (Liam Cunningham), Tormund (Kristofer Hivju), and Sansa sat around the war table to discuss tactics. It was decided that the best course of action would be to force Ramsay's forces to charge first, and the men in the room seemed pretty pleased with their decision. However, Sansa wasn't so taken and she explained to Jon that Ramsay is the one who sets the traps, and that he doesn't fall for tricks. This was a clear sign of things to come, and I felt that from that moment it was pretty obvious what was going to happen at the start of the battle. Something had to occur to scupper Jon's plans and force him to make the first move, and with Sansa clearly sceptical that they would ever see Rickon (Art Parkinson) alive again, his fate was all but sealed.
As such, I wasn't particularly surprised to see the youngest of the Stark children die at the start of the battle, although I felt that the way it happened was a bit idiotic. It acted as a catalyst to get Jon invested, as if killing the man that raped his sister wasn't motivation enough, but apart from that it didn't really serve much of a purpose from my perspective. Of course, the point was to force Jon to charge first and thus scupper his battle plans, but surely there were better ways to do this? If Ramsay had tied Rickon up and left him in the middle of the battlefield then it would've probably ended in the same outcome, so why did Ramsay leave so much up to chance? Ramsay opened up the possibility of Rickon surviving the battle even though he was a trueborn male heir to Winterfell, which to me didn't really make sense. I don't care if he's a world class archer – Rickon could've got away, especially if he'd decided to zigzag or just run backwards. If he'd done the latter from that distance then he'd have known which way to move to get out of the way because Ramsay was a long way away and arrows don't actually move that fast through the air.
via geeknation.com
Nevertheless, I loved the battle itself. The fact that Jon survived so many close calls demonstrated that to live through such an event you have to rely more on luck than judgement, and I think that was probably the point. The grim reality of battle was there for all to see, especially when Jon almost suffocated under a sea of fleeing feet.
The scene in which the camera turned to reveal that Jon was being charged upon by thousands of men, shot in slow motion with what I think was a gentler version of the Rains of Castamere playing, was unbelievably good for television. At that moment I truly believed that Jon was going to die again – even though that outcome seemed impossible to me before the episode started – and I think that I might've actually got goosebumps. I really respect when writers and directors are inventive with scenes, especially in television, and this one exceeded my expectations. It was cinematic, startling, and utterly compelling.
The only problem with the battle was that the end result was never truly in doubt, and neither was the arrival of the Knights of the Vale. This isn't a huge issue because sometimes television has to sacrifice surprise for a coherent story, but I would like "Game of Thrones" to subvert my expectations every now and again. When the series began it was shocking people left, right, and centre, so it's slightly disappointing that nowadays the story is becoming predictable.
After the battle finished, Jon, Tormund, and Wun Wun (Ian Whyte) chased a clearly rattled Ramsay to the gates of Winterfell. I loved the way that Wun Wun knocked the door down and fell to his knees, but his actual death left me feeling slightly frustrated because Ramsay firing an arrow into his eye didn't make a whole lot of sense. I know that this moment was there to tell the audience one more time that Ramsay is a nasty piece of work, but when push comes to shove you have to accept that he killed the wrong person. Jon was there to kill – the leader of the enemy's forces – yet Ramsay killed an already dying giant. I'm not saying that killing Jon would've made any difference to the outcome of the battle, but someone as sadistic and twisted as Ramsay would've definitely killed Jon over Wun Wun even if only to hurt Sansa.
Having said that, I'm glad that Ramsay didn't kill Jon, because we all love the character and it wouldn't have achieved anything. Plus, Ramsay's killing Wun Wun set up one of the most satisfying beat downs in television history, as Jon showed Ramsay that real men don't need arrows or hounds to hurt their enemies. I thought this was a great moment, and one which showed just how much Sansa means to Jon, but I'm glad that he didn't kill Ramsay himself because the final moment when Sansa performed her first kill was exactly what was necessary for the story.
Sansa has been making the transition from lost child to hardened leader for a long time now, and it's about time that she did something to highlight that the change has finally happened. This was that moment, and it was significant that although she had Ramsay eaten alive by his own hounds, she didn't stay to watch. She walked away and smiled, the sound of her dying husband's screams in her ears, and she was a winner for the first time in her life.
via heyuguys.com
I have to say that personally I'm going to miss Ramsay – Iwan Rheon did a great job of making the character truly detestable, and he's been a huge player in "Game of Thrones". I know that a lot of people think that the character has become too all powerful; after all, up until now he has killed everyone in his way. However, from my perspective every good television show needs a great villain, and sometimes to make that happen you have to make the villain seem unstoppable. Ramsay wasn't layered or complex, he was just vicious, and that's something that always gives an audience a reason to tune in. When Joffrey (Jack Gleeson) died it left a hole, and the same happened when Tywin (Charles Dance) died, so I hope someone steps up to take the mantle.
Overall, I thought that this episode was fantastic. It wasn't perfect, but it was about as good as an episode of television can get without the involvement of Vince Gilligan ("Breaking Bad"). I would've liked the logical gaps in the episode to have been polished out, but as a whole the battle was spectacular, the music was great, the choreography was wonderful, and the performances were brilliant.

redpajama_set_name: RedPajamaCommonCrawl


Everything in this world is responding to human attention.
My practice illustrates emotional and psychological mental states. These can be described, or discussed through image, form and color. They do not need to seek descriptive words or explanations. The figure has the capacity to present internal struggles. I often depict a solitary figure with a sense of power and perseverance in a foreboding, apocalyptic landscape.
For me, what matters most is to represent the importance of light and dark in ourselves as humans. The absolute critical point is that our freedom to be sick becomes our teacher.
Haley Josephs (b. 1987, Seattle WA) is a Brooklyn based painter.
She received her BFA in Painting & Drawing from Tyler School of Art at Temple University in 2011 and her MFA in Painting & Printmaking from Yale University in 2014. She has exhibited locally and internationally. Her next solo show will open this Fall at 315 Gallery in Brookyln, NY.


A write-up around cells human body.
With clay, you are going to be able to have a better comprehension of how weight is distributed since you're working together with 3-D materials. Thick and thin myofilaments have various compositions. Anatomy describes the structure and precise location of the various elements of an organism to supply a framework for understanding.
The material covered is easy enough, but there's a hugebody of facts you have to learn. Moreover, these sciences are split up into many dedicated branches. It is the study of this bodily patterns of this Earth.
The modular format provides you with the capacity to pay attention to one key concept at a second. A comprehension of human form is essential for artists so that you can go to town utilizing the figure. An artist is normally only concerned with drawing subjectively (which is the reason why this will be our very first lesson), particularly when there is a question of fabricating style.
Browse to home page to see a lot more diagrams.


The U.S.'s top diplomat responsible for Central Asia just finished a trip to Uzbekistan, amid increasing speculation that the two countries are seeking to upgrade their relationship, in particular their military cooperation.
Robert Blake, the U.S. Assistant Secretary of State for South and Central Asia, visited Tashkent from August 15-18. His visit came after an eventful summer: in June, Uzbekistan suspended its membership in the Russia-led Collective Security Treaty Organization. Many observers interpreted the move as motivated by Uzbekistan's intention to allow the U.S. to set up some sort of military base in the country. The CSTO requires members to get permission from other members before allowing foreign military bases; i.e., Russia gets a veto. Leaving the CSTO could free Uzbekistan up to allow a U.S. base. But then, earlier this month, Uzbekistan's parliament passed a new law forbidding foreign military bases.
With respect to Uzbekistan, I do not think there will be any lethal weapons of any kind that will be offered. I think most of the kind of things that will be on offer will be military vehicles, Humvees, those kind of things. It is in our interests to provide those kinds of equipment. Uzbekistan has been a strong supporter of the NDN. That has in turn raised their profile with international terrorist organizations, who may want to target Uzbekistan in retribution. So, it is very much in our interest to help Uzbekistan defend itself against such attacks.
We are certainly prepared to think about how we can do that. I myself have been engaged over the last year in the U.S. Congress to get a waiver so that we can provide non-lethal military assistance to Uzbekistan, even though they have not met a lot of the human rights conditions that would allow for more regular military assistance. That waiver has been approved. We are providing non-lethal military assistance now and will continue to do so, and the EDA process will be one way that we could help.
Anyway, the Kazakh newspaper report might be seen in terms of Kazakhstan's rivarly with Uzbekistan; the Kazakhstan government has barely disguised its jealousy as the U.S. gets closer to Uzbekistan. That perception certainly wasn't helped by Blake's unexplained* decision to cut short his time in Kazakhstan, canceling an event to present the U.S.'s New Silk Road strategy in Almaty, doing it in Tashkent instead.
They also exchanged views on the situation in Afghanistan and in Central Asia in terms of ensuring security and stability, and also discussed some other problems concerning the two countries.
The bulk ot the Uzbek report focused on the U.S. business delegation that went along with Blake. Of course it's not surprising that the Uzbekistan government would want to frame its cooperation with the U.S. in terms of economic benefits rather than the war effort in Afghanistan; it's hard to imagine what benefit the average Uzbek would see in his country's participation in that conflict.
Blake would probably be interested in hearing Uzbek officials, President Karimov first of all, explain the motive or logic from withdrawing from the CSTO again, Pannier said.
Uzbekistan already did so in 1999, and then it returned back.
"And the big question is what this new policy means for the base the Germans use at Termez and the Navoi airport the U.S. uses to refuel as well as the Northern Distribution Network into Afghanistan," he added.
The timing of the consultations, Uzbekistan's decision to pull-out of the CSTO, and the ban on military bases as part of the national security strategy bill suggests that Tashkent may be bargaining to get the most out of the talks with Washington, which relies heavily on Tashkent's role in the NDN.


text:
Game thread: Michigan State beats Nebraska, 88-72
7 p.m., ESPNU, 760 AM; Spartans go for sweep of Cornhuskers
Game thread: Michigan State beats Nebraska, 88-72 7 p.m., ESPNU, 760 AM; Spartans go for sweep of Cornhuskers Check out this story on Freep.com: http://on.freep.com/2ma5ITG
Marlowe Alter, Detroit Free Press Published 12:06 a.m. ET Feb. 23, 2017 | Updated 8:18 a.m. ET Feb. 24, 2017
Michigan State's Tum Tum Nairn Jr. tries to extract the ball from Nebraska's Glynn Watson Jr. during the first half in Lincoln, Neb., Thursday, Feb. 2, 2017.(Photo: Nati Harnik, AP)
Michigan State Spartans (16-11, 8-6 Big Ten) vs. Nebraska Cornhuskers (12-14, 6-8)
When: 7 p.m.
Where: Breslin Center, East Lansing.
TV: ESPNU
Radio: WJR-AM (760). (List of Spartans radio affiliates)
Line: Spartans by 6.
Game notes: This is a huge game for Michigan State, which is teetering on the bubble with four games to play in the regular season. The Spartans defeated the Cornhuskers, 72-61 on the road Feb. 2. Miles Bridges was one of five Spartans to score in double-figures with 16 points. MSU will play its first game without senior guard Eron Harris (knee injury). Nebraska has won two straight, defeating Penn State and Ohio State. Senior guard Tai Webster averages 17.7 points per game for the Cornhuskers.
Tom Izzo wants Michigan State focusing only on Nebraska, not NCAA bid
On mobile? Tap here for live updates.


Maria Garcia Esquivel died on July 24, 2017, in Los Banos, where she had lived for 11 months. She was 88. She was born and raised in Olmito, Texas. In 1968 Mrs. Esquivel moved to Watsonville where she lived until she went to live with her daughter in Los Banos. Mrs. Esquivel worked for Watsonville Canning Co. for over 25 years and made many friends there. She enjoyed her garden full of many beautiful flowers, especially her roses. She loved being with family, especially her grandchildren. Her church was very important to her and she attended regularly, and you could often find her sitting and listening to her favorite Christian music. Mrs. Esquivel is survived by her three daughters, Blanca (Robert) Esquivel, Diana Esquivel (Tony) Rubalcava, and Elva Esquivel; 15 grandchildren; 31 great-grandchildren; 2 great-great grandchildren; her daughter-in-law, Yolanda Esquivel, and sister-in-law, Andrea Garcia; and many nieces and nephews. She is preceded in death by her husband, Osbaldo Esquivel, Sr., and 2 sons, Osbaldo, Jr. and Oscar Esquivel. Graveside services will be held Friday, August 4, 2017, 1:00 p.m., at Valley Public Cemetery, 2445 E. Lake Avenue, Watsonville. Mehl's Colonial Chapel has been entrusted the arrangements.


text:
Q: importing app css in Django I not sure how to include css to my html. I have an app in my project that has it's own template folder. I want to get the sample.css into my html.
Something in the lines of <link rel="stylesheet" type="text/css" href="{%  %}">
Not really sure what to put in between {%  %}
structure:
/proj
   /app
      /templates
         sample.css
         sample.html

Here is my template_dirs:
TEMPLATE_DIRS = (
    os.path.join(BASE_DIR,'templates'),
    os.path.join(BASE_DIR,'home/templates'),
    os.path.join(BASE_DIR,'gallery/templates'),
    os.path.join(BASE_DIR,'contact/templates'),
    os.path.join(BASE_DIR,'aboutme/templates'),
)

If any other info is required. Please let me know!
updated struture
/proj
   /app
      /static
         /css
            sample.css
      /templates
         sample.html

A: css files, as well as js files and images, are considered static files.
The usual approach is to use django.contrib.staticfiles built-in django app to manage static files.
If you set up the app correctly this is how your link would look like:
<link rel="stylesheet" type="text/css" href="{% static 'sample.css' %}">

A: as @alecxe mentions, have them in a folder named static and include these in your settings file.
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

redpajama_set_name: RedPajamaStackExchange


text:
Vanilla Sky је књига српске модне блогерке Зоране Јовановић, познате под псеудонимом Zorannah, која је рођена 1990. године у Београду, где је и завршила школу за дизајн. Модна је блогерка од 2011. године, а данас се сматра једним од најзначајнијих стилских саветника. Објавила је четири књиге Life & Style, Life journal, Golden sky и Vanilla sky у издаваштву Вулкана из Београда 2016. године.

О књизи

Књига Vanilla Sky прати живот манекенке Лане која свакодневно путује због посла, живи на Дедињу, богатство које има се приписује њеним родитељима тако да се свакодневно доказује како себи тако и другима. Њен свет се мења када упозна Марка, првог дечка који је не препознаје из медија и није импресиониран њеним богатством. Уз њега Лана искушава непознато, али њен живот испуњен плановима и очекивањима им представља изазове.

Референце

Спољашње везе

 Књига Vanilla Sky

Књиге 2016.
Српска књижевност

redpajama_set_name: RedPajamaWikipedia


John joined RBG in 1975 after graduating from college and has been with the firm throughout his entire professional career. He currently serves as managing partner and is head of the firm's Financial Institutions practice. His whole career has been spent working primarily with community banks and other financial institutions, providing audit, tax, and advisory services. He has helped several clients recover significant tax dollars from prior years by identifying errors in prior year returns. In another instance he helped a client achieve permanent tax savings through analysis of a transaction and suggesting the proper tax treatment.
A hard working professional, John's teammates describe him as intense. Growing up, his parents taught him the value of hard work and that things worth having are worth working for. He followed in the footsteps of his father, also a CPA, when he chose to pursue a career in the accounting field. Having watched how hard his father worked, John developed a sense that being a CPA was an honest profession that rewarded those who applied themselves. His commitment and hard work certainly paid off—John earned the highest grade in the state of Tennessee on the May 1975 CPA exam! And he didn't stop there! John went on to earn the CPA designation in Mississippi, Arkansas, and Missouri!
John is committed to serving within his professional community. He is a member of the American Institute of Certified Public Accountants (AICPA) and the Tennessee Society of CPAs (TSCPA). As a member of the TSCPA, he chairs the Personnel Committee, is a member of Council, and previously served as the chair of the organization's Board of Directors. John also spent time serving as the chair of the Memphis Chapter of the TSCPA and the chair of the Board of Directors of Allinial Global, an association of independent accounting firms.
Born and raised in Memphis, John currently resides in Germantown with his wife of over four decades, Judy. Together they have four grown children and six grandchildren. Outside of the office, John enjoys devoting his time to family, almost all sports, food and wine, and travel.


I first met Jessica and Brad for their engagement session in Peoria. Their wedding day that once seemed so far away was upon us. As with their engagement session, Jessica and Brad were both relaxed and intent on having a good time (which I heartily endorse as being the goal for any wedding). Below is a sneak peek of Jessica and Brad's Coyote Creek Golf Club Wedding in Bartonsville, IL.


text:
Tag Archives: les binks
Features, PiercingMetal Says
K.K. Downing Introduces New Band "K.K.'s Priest" To The World
February 18, 2020 Ken Pierce Leave a comment
Former Judas Priest guitarist K.K. Downing has been in the news recently with appearances at some festivals and jamming out with the likes of former Manowar's Ross The Boss and just last month when the news about his signing to Explorer1 Music was announced. If you missed that alert just click HERE because it will be good to know as Mr. Downing introduces his brand-new band to the general public.
K.K Downing, founding member of Judas Priest, today announces the name of his new band KK's PRIEST. This all new band features some very familiar faces. With Downing on guitar, KK's PRIEST features ex-Judas Priest members Tim "Ripper" Owens on vocals, who fronted the band for eight years and recorded two studio albums, Jugulator, featuring the GRAMMY® nominted track "Bullet Train," and Demolition, plus two live albums, and Les Binks who was the drummer on the studio albums Stained Class and Killing Machine and the live album Unleashed in the East. They are joined by Tony Newton (Voodoo Six) on bass, and A.J. Mills (Hostile) on guitar. With the line-up complete, KK's PRIEST is hard at work in the studio creating the band's debut album which will be released globally by Explorer1 Music Group as a part of the partnership with K.K Downing signed early 2020. More details to come.
KK's PRIEST is represented exclusively by Andy Gould for Explorer1, with Jim Morewood handling the band's global bookings outside the U.S. for the K2 Agency. Extensive touring and festival dates are already being planned with KK's PRIEST taking to stages around the world to celebrate the 50th Anniversary of Judas Priest and K.K Downing's career as a founding member. The band will deliver everything that fans would expect of Downing and his ability to deliver up everything that is Priest including newly written metal masterpieces.
Continue reading K.K. Downing Introduces New Band "K.K.'s Priest" To The World →
a.j. millsannouncementsexplorer1 musick.k. downingk.k.'s priestkenneth downing jr.les binkstim "ripper" owenstim owenstony newton
The Judas Priest Name Generator Makes Your Name A Real "Painkiller"
March 12, 2018 Ken Pierce Leave a comment
Before I begin this little bit of fun I have to tell you or remind you about if you are among those who might have forgotten this notion about me; I am a big fan of the legendary Judas Priest. So I always tell people that I have three favorite bands and they are KISS, Van Halen and Judas Priest and before you think the third spot is a slight it's an even "2" for me as KISS always seems to be the top tier. Both Halen and Priest are the same level IMHO and that's what makes this installment into the content library of PiercingMetal.com so much fun. Do you remember a couple of years ago when we posted about that Metallica Name Generator? Whichever your answer was doesn't matter since I will link to that later on in the post. In honor of the bands brand-new album "Firepower" there is now a Name Generator to get your own letters or maybe even your bands name in the same font as Judas Priest. As expected I ran this for the PiercingMetal site and think that I like that one even more than I do the one for Metallica. Take a look down below.
Continue reading The Judas Priest Name Generator Makes Your Name A Real "Painkiller" →
dave hollandglenn tiptonian hilljudas priestk.k. downingles binksname generatorsrob halfordscott travisthe metal god
PiercingMetal Visits The Judas Priest Pop-Up Shop @ Sony Square NYC
March 11, 2018 Ken Pierce 1 Comment
This past Friday, March 9th – The Legendary Judas Priest released their 18th album with "Firepower". In honor of the Metal Magnus Opus, the fine folks at Sony Square NYC have set up a small gallery of photographs, memorabilia and stage attire. Since I had to be in the city for the Michael Schenker Fest performance at Irving Plaza, I paid a visit to the store to see the gallery and shoot some photos and video for those too far away to get here themselves. The photos video were shot with the Samsung point and shoot while the Facebook Live and Instagram stuff were done with my new Galaxy Note 8. Let's take a look at the video first shall we?
Pretty cool right? Now let's share the photos of the exhibit on their own to allow for better appreciation of the mighty band. That first thing we saw was an interactive screen and it would do what you did. I tried to make it give the METAL HORNS and you can see me trying to type notes down in the left hand corner.
Continue reading PiercingMetal Visits The Judas Priest Pop-Up Shop @ Sony Square NYC →
dave hollandfirepowerglenn tiptonian hilljudas priestjudas priest pop-up shopk.k. downingles binkspop-up shopsrob halfordscott travissony square nycthe metal god
Music, Reviews
"The Complete Albums Collection" by Judas Priest
January 6, 2012 Ken Pierce Leave a comment
Artist: Judas Priest
Title: "The Complete Albums Collection"
Label: Columbia/Epic/Legacy Records
If you are truly a card carrying Heavy Metal fan then you most likely not only hold the name of the band Judas Priest in high regard but you also probably have at least four to five of their albums in your collection if not more. On the other hand should you call yourself a Metal fan and you DO NOT own any Judas Priest albums I will need to see your paperwork and am afraid that I will have to prohibit you from citing this genre as being among your interests. The boxed set "Complete Albums Collection" by Judas Priest is one of those items meant for the absolute diehard and features remastered editions of the bands works. Oh wait a second. Technically that is not true as none of the albums featuring Tim "Ripper" Owens are offered up here and instead we get what is called the legendary lineup of Halford, Downing, Tipton and Hill. Over the years the band had a number of drummers before locking the talented Scott Travis into place with 1991's "Painkiller". As this release is a massive one and features seventeen of their albums I decided to offer up a quick viewpoint about each CD and say what it meant to me as a fan of the band for the time I had been into them. One of the most immediate exciting points about this release was the inclusion of the group's first two releases of "Rocka-Rolla" and "Sad Wings Of Destiny" which had never before been available as sanctioned albums by the band and their label of many decades.
Rocka-Rolla (1974): While it's great to have "Rocka-Rolla" in remastered form at long last, I will admit that if this was my own first go at Priest that I might not have been originally sold on them. Of course it was released in 1974 and has more of a Heavy Rock vibe with some essence of trippy Psychedelics. Yes there were some stand out tunes but the bands best material was ahead of them.
Sad Wings Of Destiny (1976): Now this was more like it and I think was many fans first foray into the bands magnificence. I was still nowhere near my first meeting with the Priest but I would be here soon enough. Classics on this album like "Victim Of Changes", "Tyrant" and "Genocide" are still very important songs to the bands set list. With "Sad Wings" Judas Priest had arrived.
Continue reading "The Complete Albums Collection" by Judas Priest →
alan moorealbum reviewsangel of retributionbritish steelcolumbia recordsdave hollanddefenders of the faithepic legacyglenn tiptonhell bent for leatherian hilljohn hinchjudas priestk.k. downingkilling machineles binksnostradamuspainkillerpoint of entrypriest liveram it downrob halfordrocka rollasad wings of destinyscott travisscreaming for vengeancesimon phillipssin after sinstained classthe complete albums collectionthe metal godtouch of evilturbounleashed in the east
"The Chosen Few" by Judas Priest
November 13, 2011 Ken Pierce Leave a comment
Title: "The Chosen Few"
Label: Sony Legacy
After forty plus years of putting some incredible Heavy Metal music in the faces of their fans, the guys in Judas Priest have embarked on their "Epitaph" tour and plan for the most part to call it a career. It's not the same news that the Scorpions gave as far as a full on band retirement, but the Priest said that no more worldwide extended touring will happen and that fans can still expect some new recordings when the inspiration comes to them. That news brings us to the very latest release by Judas Priest which is entitled "The Chosen Few" and well, how do I best describe this to you…….
Continue reading "The Chosen Few" by Judas Priest →
album reviewsdave hollandglenn tiptongreatest hits compilationsian hilljudas priestk.k. downingles binksrob halfordscott travissony legacythe chosen few


International delegation conference packages may be cancelled and a refund requested, if submitted in writing on or before Thursday, 5 January 2017. All confirmed cancellations will only be eligible for the registration and hotel nights portion of your delegate package less the amount of two nights hotel. All workshop, lunches, and networking activities are non-refundable. Registrations and cancellations received after 5 January 2017 are not refundable. You cannot reinstate a registration after you cancel it. Your refund will take up to 30 days to process. No purchase orders are accepted. All refunds will be issued back to the original payment type. Please submit all refund requests to Ela Staniuk at estaniuk@himss.org.
Confirmations are auto generated and sent to the email address listed during the registration process. If you did not receive your confirmation, please contact CompuSystems at himss@compusystems.com.
Registrants unable to attend may send a substitute. Substitutions must be made in writing to himss@compusystems.com.
HIMSS reserves the right to cancel or reschedule programs and to close registration when programs are sold out. For these reasons, registrants are advised against purchasing non-refundable airline tickets. Should HIMSS17 be cancelled, your registration fee will not be refunded but will automatically be applied to the next HIMSS Annual Conference & Exhibition.
I agree not to copy or permit to be copied, in any form or format, without the express written permission of HIMSS, any of the contents of the HIMSS17 attendee roster. I also agree not to use the roster contents for any commercial, marketing, promotional, or political purposes. No solicitation is permitted by anyone except by exhibitors within the confinement of their booth.
I understand that I am prohibited from recording any educational session content unless I have obtained written permission in advance from HIMSS.
By registering for the conference, you are providing permission to receive emails, mailings and faxes related to HIMSS. If you wish to opt out of receiving any of these materials you may do so during the online registration process or by emailing annualconference@himss.org.
For security reasons, badge swapping is not permitted. Anyone found wearing a badge that does not match his/her identification will be evicted from the conference without a refund. In addition, the badge/name will be cancelled.