text:
<?php

namespace Drupal\KernelTests\Core\Database;

/**
 * Tests the Select query builder.
 *
 * @group Database
 */
class SelectSubqueryTest extends DatabaseTestBase {

  /**
   * Tests that we can use a subquery in a FROM clause.
   */
  public function testFromSubquerySelect() {
    // Create a subquery, which is just a normal query object.
    $subquery = db_select('test_task', 'tt');
    $subquery->addField('tt', 'pid', 'pid');
    $subquery->addField('tt', 'task', 'task');
    $subquery->condition('priority', 1);

    for ($i = 0; $i < 2; $i++) {
      // Create another query that joins against the virtual table resulting
      // from the subquery.
      $select = db_select($subquery, 'tt2');
      $select->join('test', 't', 't.id=tt2.pid');
      $select->addField('t', 'name');
      if ($i) {
        // Use a different number of conditions here to confuse the subquery
        // placeholder counter, testing https://www.drupal.org/node/1112854.
        $select->condition('name', 'John');
      }
      $select->condition('task', 'code');

      // The resulting query should be equivalent to:
      // SELECT t.name
      // FROM (SELECT tt.pid AS pid, tt.task AS task FROM test_task tt WHERE priority=1) tt
      //   INNER JOIN test t ON t.id=tt.pid
      // WHERE tt.task = 'code'
      $people = $select->execute()->fetchCol();

      $this->assertCount(1, $people, 'Returned the correct number of rows.');
    }
  }

  /**
   * Tests that we can use a subquery in a FROM clause with a LIMIT.
   */
  public function testFromSubquerySelectWithLimit() {
    // Create a subquery, which is just a normal query object.
    $subquery = db_select('test_task', 'tt');
    $subquery->addField('tt', 'pid', 'pid');
    $subquery->addField('tt', 'task', 'task');
    $subquery->orderBy('priority', 'DESC');
    $subquery->range(0, 1);

    // Create another query that joins against the virtual table resulting
    // from the subquery.
    $select = db_select($subquery, 'tt2');
    $select->join('test', 't', 't.id=tt2.pid');
    $select->addField('t', 'name');

    // The resulting query should be equivalent to:
    // SELECT t.name
    // FROM (SELECT tt.pid AS pid, tt.task AS task FROM test_task tt ORDER BY priority DESC LIMIT 1 OFFSET 0) tt
    //   INNER JOIN test t ON t.id=tt.pid
    $people = $select->execute()->fetchCol();

    $this->assertCount(1, $people, 'Returned the correct number of rows.');
  }

  /**
   * Tests that we can use a subquery with an IN operator in a WHERE clause.
   */
  public function testConditionSubquerySelect() {
    // Create a subquery, which is just a normal query object.
    $subquery = db_select('test_task', 'tt');
    $subquery->addField('tt', 'pid', 'pid');
    $subquery->condition('tt.priority', 1);

    // Create another query that joins against the virtual table resulting
    // from the subquery.
    $select = db_select('test_task', 'tt2');
    $select->addField('tt2', 'task');
    $select->condition('tt2.pid', $subquery, 'IN');

    // The resulting query should be equivalent to:
    // SELECT tt2.name
    // FROM test tt2
    // WHERE tt2.pid IN (SELECT tt.pid AS pid FROM test_task tt WHERE tt.priority=1)
    $people = $select->execute()->fetchCol();
    $this->assertCount(5, $people, 'Returned the correct number of rows.');
  }

  /**
   * Test that we can use a subquery with a relational operator in a WHERE clause.
   */
  public function testConditionSubquerySelect2() {
    // Create a subquery, which is just a normal query object.
    $subquery = db_select('test', 't2');
    $subquery->addExpression('AVG(t2.age)');

    // Create another query that adds a clause using the subquery.
    $select = db_select('test', 't');
    $select->addField('t', 'name');
    $select->condition('t.age', $subquery, '<');

    // The resulting query should be equivalent to:
    // SELECT t.name
    // FROM test t
    // WHERE t.age < (SELECT AVG(t2.age) FROM test t2)
    $people = $select->execute()->fetchCol();
    $this->assertEquals(['John', 'Paul'], $people, 'Returned Paul and John.', 0.0, 10, TRUE);
  }

  /**
   * Test that we can use 2 subqueries with a relational operator in a WHERE clause.
   */
  public function testConditionSubquerySelect3() {
    // Create subquery 1, which is just a normal query object.
    $subquery1 = db_select('test_task', 'tt');
    $subquery1->addExpression('AVG(tt.priority)');
    $subquery1->where('tt.pid = t.id');

    // Create subquery 2, which is just a normal query object.
    $subquery2 = db_select('test_task', 'tt2');
    $subquery2->addExpression('AVG(tt2.priority)');

    // Create another query that adds a clause using the subqueries.
    $select = db_select('test', 't');
    $select->addField('t', 'name');
    $select->condition($subquery1, $subquery2, '>');

    // The resulting query should be equivalent to:
    // SELECT t.name
    // FROM test t
    // WHERE (SELECT AVG(tt.priority) FROM test_task tt WHERE tt.pid = t.id) > (SELECT AVG(tt2.priority) FROM test_task tt2)
    $people = $select->execute()->fetchCol();
    $this->assertEquals(['John'], $people, 'Returned John.', 0.0, 10, TRUE);
  }

  /**
   * Test that we can use multiple subqueries.
   *
   * This test uses a subquery at the left hand side and multiple subqueries at
   * the right hand side. The test query may not be that logical but that's due
   * to the limited amount of data and tables. 'Valid' use cases do exist :)
   */
  public function testConditionSubquerySelect4() {
    // Create subquery 1, which is just a normal query object.
    $subquery1 = db_select('test_task', 'tt');
    $subquery1->addExpression('AVG(tt.priority)');
    $subquery1->where('tt.pid = t.id');

    // Create subquery 2, which is just a normal query object.
    $subquery2 = db_select('test_task', 'tt2');
    $subquery2->addExpression('MIN(tt2.priority)');
    $subquery2->where('tt2.pid <> t.id');

    // Create subquery 3, which is just a normal query object.
    $subquery3 = db_select('test_task', 'tt3');
    $subquery3->addExpression('AVG(tt3.priority)');
    $subquery3->where('tt3.pid <> t.id');

    // Create another query that adds a clause using the subqueries.
    $select = db_select('test', 't');
    $select->addField('t', 'name');
    $select->condition($subquery1, [$subquery2, $subquery3], 'BETWEEN');

    // The resulting query should be equivalent to:
    // SELECT t.name AS name
    // FROM {test} t
    // WHERE (SELECT AVG(tt.priority) AS expression FROM {test_task} tt WHERE (tt.pid = t.id))
    //   BETWEEN (SELECT MIN(tt2.priority) AS expression FROM {test_task} tt2 WHERE (tt2.pid <> t.id))
    //       AND (SELECT AVG(tt3.priority) AS expression FROM {test_task} tt3 WHERE (tt3.pid <> t.id));
    $people = $select->execute()->fetchCol();
    $this->assertEquals(['George', 'Paul'], $people, 'Returned George and Paul.', 0.0, 10, TRUE);
  }

  /**
   * Tests that we can use a subquery in a JOIN clause.
   */
  public function testJoinSubquerySelect() {
    // Create a subquery, which is just a normal query object.
    $subquery = db_select('test_task', 'tt');
    $subquery->addField('tt', 'pid', 'pid');
    $subquery->condition('priority', 1);

    // Create another query that joins against the virtual table resulting
    // from the subquery.
    $select = db_select('test', 't');
    $select->join($subquery, 'tt', 't.id=tt.pid');
    $select->addField('t', 'name');

    // The resulting query should be equivalent to:
    // SELECT t.name
    // FROM test t
    //   INNER JOIN (SELECT tt.pid AS pid FROM test_task tt WHERE priority=1) tt ON t.id=tt.pid
    $people = $select->execute()->fetchCol();

    $this->assertCount(2, $people, 'Returned the correct number of rows.');
  }

  /**
   * Tests EXISTS subquery conditionals on SELECT statements.
   *
   * We essentially select all rows from the {test} table that have matching
   * rows in the {test_people} table based on the shared name column.
   */
  public function testExistsSubquerySelect() {
    // Put George into {test_people}.
    db_insert('test_people')
      ->fields([
        'name' => 'George',
        'age' => 27,
        'job' => 'Singer',
      ])
      ->execute();
    // Base query to {test}.
    $query = db_select('test', 't')
      ->fields('t', ['name']);
    // Subquery to {test_people}.
    $subquery = db_select('test_people', 'tp')
      ->fields('tp', ['name'])
      ->where('tp.name = t.name');
    $query->exists($subquery);
    $result = $query->execute();

    // Ensure that we got the right record.
    $record = $result->fetch();
    $this->assertEquals('George', $record->name, 'Fetched name is correct using EXISTS query.');
  }

  /**
   * Tests NOT EXISTS subquery conditionals on SELECT statements.
   *
   * We essentially select all rows from the {test} table that don't have
   * matching rows in the {test_people} table based on the shared name column.
   */
  public function testNotExistsSubquerySelect() {
    // Put George into {test_people}.
    db_insert('test_people')
      ->fields([
        'name' => 'George',
        'age' => 27,
        'job' => 'Singer',
      ])
      ->execute();

    // Base query to {test}.
    $query = db_select('test', 't')
      ->fields('t', ['name']);
    // Subquery to {test_people}.
    $subquery = db_select('test_people', 'tp')
      ->fields('tp', ['name'])
      ->where('tp.name = t.name');
    $query->notExists($subquery);

    // Ensure that we got the right number of records.
    $people = $query->execute()->fetchCol();
    $this->assertCount(3, $people, 'NOT EXISTS query returned the correct results.');
  }

}


text:
#include "Dlg_Physics.h"

//#include <qwt_plot.h>
#include <qwt_plot_curve.h>
//#include <qwt_plot_directpainter.h>
//#include <qwt_plot_layout.h>

//TEMP
//#include "VXS_Voxel.h"

Dlg_Physics::Dlg_Physics(QVX_Sim* pSimIn, QWidget *parent)
	: QWidget(parent)
{
	pSim = pSimIn;
	ui.setupUi(this);

	//these should be in the order of the stop condition enum
	ui.StopSelectCombo->addItem("None");
	ui.StopSelectCombo->addItem("Time Steps");
	ui.StopSelectCombo->addItem("Simulation Time");
	ui.StopSelectCombo->addItem("Temperature cycles");
	ui.StopSelectCombo->addItem("Constant Energy");
	ui.StopSelectCombo->addItem("Kinetic Floor");
	ui.StopSelectCombo->addItem("Motion Floor");

	//these should match the order of the PlotType enum
	ui.VariableCombo->addItem("Displacement");
//	ui.VariableCombo->addItem("Force");
	ui.VariableCombo->addItem("Kinetic Energy");
	ui.VariableCombo->addItem("Potential Energy");
	ui.VariableCombo->addItem("Total Energy");

	//these should match the order of the PlotDir enum
	ui.DirectionCombo->addItem("Maximum");
	ui.DirectionCombo->addItem("X Direction");
	ui.DirectionCombo->addItem("Y Direction");
	ui.DirectionCombo->addItem("Z Direction");

	//enforce type-ins
	const QValidator* DEval = new QDoubleValidator(this);
	ui.dtEdit->setValidator(DEval);

	CurPlotType = PL_DISP;
	CurPlotDir = MAXDIR;

	connect(ui.PauseButton, SIGNAL(clicked()), this, SLOT(ClickedPause()));
	connect(ui.ResetButton, SIGNAL(clicked()), this, SLOT(ClickedReset()));
	connect(ui.RecordButton, SIGNAL(clicked(bool)), this, SLOT(ClickedRecord(bool)));

	connect(ui.UseEquilibriumCheck, SIGNAL(clicked(bool)), this, SLOT(UseEquilibriumCheckChanged(bool)));
	connect(ui.StopSelectCombo, SIGNAL(activated(int)), this, SLOT(StopSelectChanged(int)));
	connect(ui.StopValueEdit, SIGNAL(editingFinished()), this, SLOT(StopValueEditChanged()));

	connect(ui.dtSlider, SIGNAL(valueChanged(int)), this, SLOT(dtSliderChanged(int)));
	connect(ui.dtEdit, SIGNAL(editingFinished()), this, SLOT(dtEditChanged()));
	connect(ui.BondDampSlider, SIGNAL(valueChanged(int)), this, SLOT(BondDampSliderChanged(int)));
	connect(ui.BondDampEdit, SIGNAL(editingFinished()), this, SLOT(BondDampEditChanged()));
	connect(ui.GNDDampSlider, SIGNAL(valueChanged(int)), this, SLOT(GNDDampSliderChanged(int)));
	connect(ui.GNDDampEdit, SIGNAL(editingFinished()), this, SLOT(GNDDampEditChanged()));
	connect(ui.ColDampSlider, SIGNAL(valueChanged(int)), this, SLOT(ColDampSliderChanged(int)));
	connect(ui.ColDampEdit, SIGNAL(editingFinished()), this, SLOT(ColDampEditChanged()));
	connect(ui.MaxVelLimitSlider, SIGNAL(valueChanged(int)), this, SLOT(MaxVelLimitSliderChanged(int)));
	connect(ui.UseSelfColCheck, SIGNAL(clicked(bool)), this, SLOT(UseSelfColCheckChanged(bool)));
	connect(ui.UseMaxVelLimitCheck, SIGNAL(clicked(bool)), this, SLOT(UseMaxVelLimitCheckChanged(bool)));

	connect(ui.UseTempCheck, SIGNAL(clicked(bool)), this, SLOT(UseTempCheckChanged(bool)));
	connect(ui.TempSlider, SIGNAL(valueChanged(int)), this, SLOT(TempSliderChanged(int)));
	connect(ui.TempEdit, SIGNAL(editingFinished()), this, SLOT(TempEditChanged()));
	connect(ui.Temp2Slider, SIGNAL(valueChanged(int)), this, SLOT(Temp2SliderChanged(int)));
	connect(ui.Temp2Edit, SIGNAL(editingFinished()), this, SLOT(Temp2EditChanged()));
	connect(ui.VaryTempCheck, SIGNAL(clicked(bool)), this, SLOT(VaryTempCheckChanged(bool)));
	connect(ui.TempPerSlider, SIGNAL(valueChanged(int)), this, SLOT(TempPerSliderChanged(int)));
	connect(ui.TempPerEdit, SIGNAL(editingFinished()), this, SLOT(TempPerEditChanged()));
	//connect(ui.TempPerEdit, SIGNAL(textChanged(QString)), this, SLOT(TempPerEditTextChanged(QString)));
	connect(ui.UseGravCheck, SIGNAL(clicked(bool)), this, SLOT(UseGravCheckChanged(bool)));
	connect(ui.GravSlider, SIGNAL(valueChanged(int)), this, SLOT(GravSliderChanged(int)));
	connect(ui.GravEdit, SIGNAL(editingFinished()), this, SLOT(GravEditChanged()));

	connect(ui.UseFloorCheck, SIGNAL(clicked(bool)), this, SLOT(UseFloorCheckChanged(bool)));

	connect(ui.DispDisableRadio, SIGNAL(clicked(bool)), this, SLOT(DisplayDisableChanged(bool)));
	connect(ui.DispVoxelsRadio, SIGNAL(clicked(bool)), this, SLOT(DisplayVoxChanged(bool)));
	connect(ui.DispConnRadio, SIGNAL(clicked(bool)), this, SLOT(DisplayConChanged(bool)));

	connect(ui.ViewDiscreteRadio, SIGNAL(clicked(bool)), this, SLOT(VoxDiscreteChanged(bool)));
	connect(ui.ViewDeformedRadio, SIGNAL(clicked(bool)), this, SLOT(VoxDeformedChanged(bool)));
	connect(ui.ViewSmoothRadio, SIGNAL(clicked(bool)), this, SLOT(VoxSmoothChanged(bool)));
//	connect(ui.BondsCheck, SIGNAL(clicked(bool)), this, SLOT(BondsCheckChanged(bool)));
	connect(ui.ForcesCheck, SIGNAL(clicked(bool)), this, SLOT(ForcesCheckChanged(bool)));
	connect(ui.LocalCoordCheck, SIGNAL(clicked(bool)), this, SLOT(LCsCheckChanged(bool)));

	connect(ui.TypeRadio, SIGNAL(clicked(bool)), this, SLOT(CTypeChanged(bool)));
	connect(ui.KineticERadio, SIGNAL(clicked(bool)), this, SLOT(CKinEChanged(bool)));
	connect(ui.DisplacementRadio, SIGNAL(clicked(bool)), this, SLOT(CDispChanged(bool)));
	connect(ui.StateRadio, SIGNAL(clicked(bool)), this, SLOT(CStateChanged(bool)));
	connect(ui.StrainERadio, SIGNAL(clicked(bool)), this, SLOT(CStrainEChanged(bool)));
	connect(ui.StrainRadio, SIGNAL(clicked(bool)), this, SLOT(CStrainChanged(bool)));
	connect(ui.StressRadio, SIGNAL(clicked(bool)), this, SLOT(CStressChanged(bool)));

	connect(ui.CoMCheck, SIGNAL(clicked(bool)), this, SLOT(CmMCheckChanged(bool)));
//	connect(ui.BbCheck, SIGNAL(clicked(bool)), this, SLOT(BbCheckChanged(bool)));

	connect(ui.VariableCombo, SIGNAL(activated(int)), this, SLOT(VarComboChanged(int)));
	connect(ui.DirectionCombo, SIGNAL(activated(int)), this, SLOT(DirComboChanged(int)));
	connect(ui.LogEachCheck, SIGNAL(clicked(bool)), this, SLOT(LogEachCheckChanged(bool)));
	connect(ui.SaveDataButton, SIGNAL(clicked()), this, SLOT(ClickedSaveData()));

	//set up plot for real-time display...
//	d_directPainter = new QwtPlotDirectPainter(ui.DataPlot);
	d_data = NULL;
	d_curve = NULL;

	ui.DataPlot->setAxisMaxMinor(QwtPlot::xBottom, 1);
	ui.DataPlot->setAxisMaxMinor(QwtPlot::yLeft, 1);
//	ui.DataPlot->setAutoReplot(false);
	/*

	d_curve = new QwtPlotCurve("MyData");

	double x[3] = {0};
	double y[3] = {0};
	x[1] = 1;
	x[2] = 2;
	y[1] = 1;

	d_curve->attach(ui.DataPlot);
	d_curve->setSamples(x, y, 3);
	ui.DataPlot->setAxisMaxMinor(QwtPlot::xBottom, 1);
	ui.DataPlot->setAxisMaxMinor(QwtPlot::yLeft, 1);
	//ui.DataPlot->setMargin(0);
	//ui.DataPlot->plotLayout()->setMargin(0);
	//ui.DataPlot->plotLayout()->setSpacing(0);
*/

//	ui.DataPlot->
	PlotUpdateTimer = new QTimer(this);
	connect(PlotUpdateTimer, SIGNAL(timeout()), this, SLOT(UpdatePlot()));

	PlotUpdateRate = 33;
	PlotUpdateTimer->start(PlotUpdateRate); //just run continuously...

	TimestepMag = 1.0;

	UpdateUI();

}

Dlg_Physics::~Dlg_Physics()
{
	PlotUpdateTimer->stop();
}

void Dlg_Physics::UpdateUI(void)
{
	CVX_Environment* ptEnv = pSim->pEnv; //pointer to current environment object
	bool EqMode = pSim->IsEquilibriumEnabled();
//	TimestepMag = pSim->dt/pSim->DtFrac;

	//Sim
	if (!pSim->Paused && pSim->Running) SetStatusButtonText(true);
	else SetStatusButtonText(false);
	ui.RecordButton->setChecked(pSim->Recording);

	ui.UseEquilibriumCheck->setChecked(pSim->IsEquilibriumEnabled());
	StopCondition CurStopCond = pSim->GetStopConditionType();
	ui.StopSelectCombo->setCurrentIndex(CurStopCond);
	ui.StopValueEdit->setEnabled(CurStopCond != SC_NONE);
	ui.StopValueEdit->setText(QString::number(pSim->GetStopConditionValue()));
	switch (CurStopCond){
	case SC_NONE: ui.StopValueLabel->setText(""); break;
	case SC_MAX_TIME_STEPS: ui.StopValueLabel->setText("#"); break;
	case SC_MAX_SIM_TIME: ui.StopValueLabel->setText("Sec"); break;
	case SC_TEMP_CYCLES: ui.StopValueLabel->setText("#"); break;
	case SC_CONST_MAXENERGY: ui.StopValueLabel->setText("Avg mJ/Vox/500 ts"); break;
	case SC_MIN_KE: ui.StopValueLabel->setText("Avg mJ/Vox/500 ts"); break;
	case SC_MIN_MAXMOVE: ui.StopValueLabel->setText("Max mm/timestep"); break;
	}

	ui.dtSlider->setRange(0, 1000);
	ui.dtSlider->setValue(qRound(pSim->DtFrac*500));
	ui.dtEdit->setText(QString::number(pSim->DtFrac, 'g', 3));

	ui.BondDampSlider->setEnabled(!EqMode);
	ui.BondDampEdit->setEnabled(!EqMode);
	ui.BondDampSlider->setRange(0, 100);
	ui.BondDampSlider->setValue(qRound(pSim->GetBondDampZ()*50));
	ui.BondDampEdit->setText(QString::number(pSim->GetBondDampZ(), 'g', 3));

	//from .00001 to .1
	ui.GNDDampSlider->setEnabled(!EqMode);
	ui.GNDDampEdit->setEnabled(!EqMode);
	ui.GNDDampSlider->setRange(0, 100);
	if (pSim->GetSlowDampZ() == 0) ui.GNDDampSlider->setValue(0);
	else ui.GNDDampSlider->setValue(qRound((log10(pSim->GetSlowDampZ())+5)*25.0));
	ui.GNDDampEdit->setText(QString::number(pSim->GetSlowDampZ(), 'g', 3));

	ui.UseSelfColCheck->setChecked(pSim->IsSelfColEnabled());
	ui.ColDampSlider->setEnabled(pSim->IsSelfColEnabled());
	ui.ColDampSlider->setRange(0, 100);
	ui.ColDampSlider->setValue(qRound(pSim->GetCollisionDampZ()*50));
	ui.ColDampEdit->setText(QString::number(pSim->GetCollisionDampZ(), 'g', 3));

	ui.UseMaxVelLimitCheck->setEnabled(!EqMode);
	ui.MaxVelLimitSlider->setEnabled(!EqMode);
	ui.UseMaxVelLimitCheck->setChecked(pSim->IsMaxVelLimitEnabled());
	ui.MaxVelLimitSlider->setEnabled(pSim->IsMaxVelLimitEnabled());
	ui.MaxVelLimitSlider->setRange(0, 100);
	ui.MaxVelLimitSlider->setValue(qRound(pSim->GetMaxVoxVelLimit()*400));

	//Env
	ui.UseTempCheck->setChecked(ptEnv->IsTempEnabled());
	ui.TempSlider->setRange(0, 50); //+/- 25 degrees from TempBase
	ui.TempSlider->setValue(qRound(25 + ptEnv->GetTempAmplitude()));
	ui.TempEdit->setText(QString::number(ptEnv->GetTempBase() + ptEnv->GetTempAmplitude(), 'g', 3));
	ui.Temp2Slider->setRange(0, 50); //+/- 25 degrees from TempBase
	ui.Temp2Slider->setValue(qRound(25 + ptEnv->GetTemp2Amplitude()));
	ui.Temp2Edit->setText(QString::number(ptEnv->GetTempBase() + ptEnv->GetTemp2Amplitude(), 'g', 3));

	ui.VaryTempCheck->setChecked(ptEnv->IsTempVaryEnabled());
	ui.TempPerSlider->setRange(0, 10000);
	ui.TempPerSlider->setValue(qRound(ptEnv->GetTempPeriod()/pSim->OptimalDt)); //slider range of 0-10,000 timesteps
	ui.TempPerEdit->setText(QString::number(ptEnv->GetTempPeriod(), 'g', 3));

	ui.UseGravCheck->setChecked(ptEnv->IsGravityEnabled());
	ui.GravSlider->setRange(0, 10000);
	ui.GravSlider->setValue(qRound(-ptEnv->GetGravityAccel()/0.00981)); //1e-5 takes care for float -> int rounding...
	ui.GravEdit->setText(QString::number(ptEnv->GetGravityAccel(), 'g', 3));

	ui.UseFloorCheck->setChecked(ptEnv->IsFloorEnabled());

//	ui.SurfMeshCheck->setEnabled(false);
//	if (pSim->SurfMesh.DefMesh.Exists()) ui.SurfMeshCheck->setEnabled(true);

	//View
	bool ViewEnabled = true;
	switch (pSim->GetCurViewMode()){
		case RVM_NONE: ui.DispDisableRadio->setChecked(true); ViewEnabled = false; break;
		case RVM_VOXELS: ui.DispVoxelsRadio->setChecked(true); break;
		case RVM_BONDS: ui.DispConnRadio->setChecked(true); break;
	}
	ui.ViewOptionsGroup->setEnabled(ViewEnabled);
	ui.ColorGroup->setEnabled(ViewEnabled);
	ui.CoMCheck->setEnabled(ViewEnabled);
//	ui.BbCheck->setEnabled(ViewEnabled);

	switch (pSim->GetCurViewVox()){
		case RVV_DISCRETE: ui.ViewDiscreteRadio->setChecked(true); break;
		case RVV_DEFORMED: ui.ViewDeformedRadio->setChecked(true); break;
		case RVV_SMOOTH: ui.ViewSmoothRadio->setChecked(true); break;

	}
	ui.ForcesCheck->setChecked(pSim->ViewForce);
	ui.LocalCoordCheck->setChecked(pSim->ViewAngles);

	switch (pSim->GetCurViewCol()){
		case RVC_TYPE: ui.TypeRadio->setChecked(true); break;
		case RVC_KINETIC_EN: ui.KineticERadio->setChecked(true); break;
		case RVC_DISP: ui.DisplacementRadio->setChecked(true); break;
		case RVC_STATE: ui.StateRadio->setChecked(true); break;
		case RVC_STRAIN_EN: ui.StrainERadio->setChecked(true); break;
		case RVC_STRAIN: ui.StrainRadio->setChecked(true); break;
		case RVC_STRESS: ui.StressRadio->setChecked(true); break;
	}

	ui.CoMCheck->setChecked(pSim->LockCoMToCenter);
//	ui.BbCheck->setChecked(pSim->HideBoundingBox);

	ui.VariableCombo->setCurrentIndex(CurPlotType);
	ui.DirectionCombo->setCurrentIndex(CurPlotDir);

}

void Dlg_Physics::ApplyVoxSelection(int NewSel)
{
	DeletePlotPoints();
	pSim->CurXSel = NewSel; //TMP!!! don't make cpoies of selection, or it will get out of sync
}

void Dlg_Physics::ValidPlot(void)
{
	if ( d_data == NULL ) d_data = new CurveData;

	if ( d_curve == NULL ){
		d_curve = new QwtPlotCurve("Total");
		//d_curve->setStyle(QwtPlotCurve::NoCurve);
		//const QColor &c = Qt::white;
		//d_curve->setSymbol(new QwtSymbol(QwtSymbol::XCross, QBrush(c), QPen(c), QSize(5, 5)) );
		d_curve->attach(ui.DataPlot);
	}
}

void Dlg_Physics::AddPlotPoint(double Time)
{
//	if (ui.DataPlot->isVisible()){ //only add points if the plot is visible
		ValidPlot();

		//big ugly list here....
			switch (CurPlotType){
			case PL_DISP:
				if (pSim->CurXSel == -1){ //if a voxel is not selected:
					switch (CurPlotDir){
					case MAXDIR: d_data->append(Time, pSim->SS.NormObjDisp); break;
					case XDIR: d_data->append(Time, pSim->SS.TotalObjDisp.x); break;
					case YDIR: d_data->append(Time, pSim->SS.TotalObjDisp.y); break;
					case ZDIR: d_data->append(Time, pSim->SS.TotalObjDisp.z); break;
					}
				}
				else {
					int ThisVox = pSim->CurXSel==-1?0:pSim->CurXSel; //solves weird threading issue
					CVXS_Voxel& CurVox = pSim->VoxArray[pSim->XtoSIndexMap[ThisVox]];
					switch (CurPlotDir){
					case MAXDIR: d_data->append(Time, 0); break; //NOT USED
					case XDIR: d_data->append(Time, CurVox.GetCurPos().x-CurVox.GetOrigPos().x); break;
					case YDIR: d_data->append(Time, CurVox.GetCurPos().y-CurVox.GetOrigPos().y); break;
					case ZDIR: d_data->append(Time, CurVox.GetCurPos().z-CurVox.GetOrigPos().z); break;
					}
				}
				break;
			case PL_KINETIC:
				d_data->append(Time, pSim->SS.TotalObjKineticE);
				break;
			case PL_STRAINE:
				d_data->append(Time, pSim->SS.TotalObjStrainE);
				break;
			case PL_TOTALENERGY:
				d_data->append(Time, pSim->SS.TotalObjKineticE + pSim->SS.TotalObjStrainE);
				break;
			}

		//}
		//else { //single voxel selected
		//
		//	switch (CurPlotType){
		//	case PL_DISP:
		//		switch (CurPlotDir){
		//		case MAXDIR: d_data->append(Time, 0); break; //NOT USED
		//		case XDIR: d_data->append(Time, CurVox.GetCurPos().x-CurVox.GetOrigPos().x); break;
		//		case YDIR: d_data->append(Time, CurVox.GetCurPos().y-CurVox.GetOrigPos().y); break;
		//		case ZDIR: d_data->append(Time, CurVox.GetCurPos().z-CurVox.GetOrigPos().z); break;
		//		}
		//		break;
		//	case PL_KINETIC:
		//		d_data->append(Time, CurVox.GetCurKineticE());
		//		break;
		//	case PL_STRAINE:
		//		d_data->append(Time, CurVox.GetCurPotentialE());
		//		break;
		//	case PL_TOTALENERGY:
		//		d_data->append(Time, CurVox.GetCurKineticE() + CurVox.GetCurPotentialE());
		//		break;
		//	}
		//}

//	}
}

void Dlg_Physics::UpdatePlot(void)
{
	if (ui.DataPlot->isVisible()){ //only add points if the plot is visible
		ValidPlot();
		const double* pX = d_data->x();
		const double* pY = d_data->y();
		if (pX == NULL || pY == NULL) return; //allows us to drop gracefully

		double dTStep = pSim->ApproxMSperLog;
		if (dTStep == 0) dTStep = 1;
		d_data->SetMaxToShow(5000/dTStep); //5000.0/30.0);//5 second window..., update every 30ms
		d_curve->setRawSamples(pX, pY, d_data->count());
		double AxisStart = *pX;
		double AxisEnd = *(pX + d_data->count()-1);
		ui.DataPlot->setAxisScale(QwtPlot::xBottom, AxisStart, AxisEnd, (AxisEnd-AxisStart)/2.0);

		ui.DataPlot->replot();
	}
}

void Dlg_Physics::DeletePlotPoints(void)
{
    delete d_curve;
    d_curve = NULL;

    delete d_data;
    d_data = NULL;

	ui.DataPlot->replot();
}

void Dlg_Physics::ClickedReset(void)
{
	pSim->ResetSim();
	DeletePlotPoints();
//	pSim->ReqGLUpdate();
	UpdateUI();
}

void Dlg_Physics::ClickedRecord(bool State)
{
	if (State) pSim->BeginRecording();
	else pSim->EndRecording();

	UpdateUI();
}

void Dlg_Physics::ClickedSaveData(void)
{
	if(d_data) d_data->OutputData();
}

void CurveData::OutputData()
{
	QFile data(QFileDialog::getSaveFileName(NULL, "Save trace data", "", "Text files (*.txt)"));
	if (data.open(QFile::WriteOnly | QFile::Truncate)) {
		QTextStream out(&data);
		for (int i=0; i<d_count; i++) {
			out << d_x[i] << "\t" << d_y[i] << "\n";
		}
	}
	data.close();
}

redpajama_set_name: RedPajamaGithub


text:
set -e
# CMake is required for installing dependencies.
sudo yum install -y cmake

# Set appropriate library path env variables
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.profile
echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.profile
echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH' >> ~/.profile
echo '. ~/.profile' >> ~/.bashrc
source ~/.profile

# Install gcc-4.8/make and other development tools on Amazon Linux
# Reference: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/compile-software.html
# Install Python, Numpy, Scipy and set up tools.
sudo yum groupinstall -y "Development Tools"
sudo yum install -y python27 python27-setuptools python27-tools python-pip graphviz
sudo yum install -y python27-numpy python27-scipy python27-nose python27-matplotlib

# Install OpenBLAS at /usr/local/openblas
git clone https://github.com/xianyi/OpenBLAS
cd OpenBLAS
make FC=gfortran -j $(($(nproc) + 1))
sudo make PREFIX=/usr/local install
cd ..

# Install OpenCV at /usr/local/opencv
git clone https://github.com/opencv/opencv
cd opencv
mkdir -p build
cd build
cmake -D BUILD_opencv_gpu=OFF -D WITH_EIGEN=ON -D WITH_TBB=ON -D WITH_CUDA=OFF -D WITH_1394=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo make PREFIX=/usr/local install

# Export env variables for pkg config
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

# Install MXNet Core without CUDA
MXNET_HOME="$HOME/mxnet/"
cd "$MXNET_HOME"
cp make/config.mk .
echo "USE_CUDA=0" >>config.mk
echo "USE_CUDNN=0" >>config.mk
echo "USE_BLAS=openblas" >>config.mk
echo "ADD_CFLAGS += -I/usr/include/openblas" >>config.mk
echo "ADD_LDFLAGS += -lopencv_core -lopencv_imgproc -lopencv_imgcodecs" >>config.mk
sudo make -j$(nproc)

# Install MXNet Python package
cd python
sudo python setup.py install

# Add MXNet path to ~/.bashrc file
echo "export PYTHONPATH=$MXNET_HOME/python:$PYTHONPATH" >> ~/.bashrc
source ~/.bashrc

# Install graphviz for visualizing network graph and jupyter notebook to run tutorials and examples
sudo pip install graphviz
sudo pip install jupyter

echo "Done! MXNet for Python installation is complete. Go ahead and explore MXNet with Python :-)"


text:
/*

  Project:       1Sheeld Library
  File:          LEDShield.h

  Version:       1.0

  Compiler:      Arduino avr-gcc 4.3.2

  Author:        Integreight

  Date:          2014.5

*/

#ifndef LedShield_h
#define LedShield_h

#include "ShieldParent.h"

//Output Functions ID's
#define LED_SET_HIGH  0x01

//Parameters
#define LED_SET_LOW   0x00
#define LED_SET_VALUE 0x01

class LedShield : public ShieldParent
{
public:
  //Constructor
  LedShield():ShieldParent(LED_ID){};
	//Setters
	void setLow();
	void setHigh();

private:
	void setValue(byte );
};

//Extern Object
extern LedShield LED;
#endif


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>FindLua — CMake 3.8.1 Documentation</title>

    <link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="FindMatlab" href="FindMatlab.html" />
    <link rel="prev" title="FindLua51" href="FindLua51.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.8.1 Documentation »

cmake-modules(7) »

FindLua¶

Locate Lua library This module defines

LUA_FOUND          - if false, do not try to link to Lua
LUA_LIBRARIES      - both lua and lualib
LUA_INCLUDE_DIR    - where to find lua.h
LUA_VERSION_STRING - the version of Lua found
LUA_VERSION_MAJOR  - the major version of Lua
LUA_VERSION_MINOR  - the minor version of Lua
LUA_VERSION_PATCH  - the patch version of Lua

Note that the expected include convention is

#include "lua.h"

and not

#include <lua/lua.h>

This is because, the lua location is not standardized and may exist in
locations other than lua/

Previous topic

FindLua51

Next topic

FindMatlab

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.8.1 Documentation »

cmake-modules(7) »

        © Copyright 2000-2017 Kitware, Inc. and Contributors.
      Created using Sphinx 1.5.2.


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">

    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/listFooter"
        android:layout_alignParentTop="true"
        android:transcriptMode="alwaysScroll" />

    <LinearLayout
        android:id="@+id/listFooter"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal">

        <EditText
            android:id="@+id/messageInput"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:inputType="textShortMessage"
            android:lines="1"
            android:singleLine="true" />

        <ImageButton
            android:id="@+id/sendButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@android:drawable/ic_menu_send" />
    </LinearLayout>

</LinearLayout>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN">

        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="../includes/main.css" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
        <title>Apache CloudStack | The Power Behind Your Cloud</title>

						Apache CloudStack 4.15.0.0 Root Admin API Reference

configureOutOfBandManagement

Configures a host's out-of-band management interface

Request parameters

                                            Parameter Name	Description	Required

                                            address	the host management interface IP address	true

                                            driver	the host management interface driver, for example: ipmitool	true

                                            hostid	the ID of the host	true

                                            password	the host management interface password	true

                                            port	the host management interface port	true

                                            username	the host management interface user	true

Response Tags

                                            Response Name	Description

                                            action	the out-of-band management action (if issued)

                                            address	the out-of-band management interface address

                                            description	the operation result description

                                            driver	the out-of-band management driver for the host

                                            enabled	true if out-of-band management is enabled for the host

                                            hostid	the ID of the host

                                            password	the out-of-band management interface password

                                            port	the out-of-band management interface port

                                            powerstate	the out-of-band management interface powerState of the host

                                            status	the operation result

                                            username	the out-of-band management interface username

                            Copyright © 2015 The Apache Software Foundation, Licensed under the
                   Apache License, Version 2.0.

                                            Apache, CloudStack, Apache CloudStack, the Apache CloudStack logo, the CloudMonkey logo  and the Apache feather logo are trademarks of The Apache Software Foundation.


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package me.aatma.languagetologic.graph.pattern;

import me.aatma.languagetologic.graph.nodes.KBNLNodeCloud;
import me.aatma.languagetologic.graph.nodes.KBNLStateNodeCloud;
import edu.stanford.nlp.ling.IndexedWord;
import edu.stanford.nlp.trees.GrammaticalRelation;
import java.util.ArrayList;
import java.util.List;
import me.aatma.library.sapi.Relation;
import me.aatma.library.sapi.jenasclient.vocabulary.RDF_S;

/**
 *
 * @author vijay
 */
public class KBNLPatternStateNsubj extends KBNLPatternImpl {

  public static List<Relation> check (KBNLNodeCloud from, IndexedWord i, GrammaticalRelation r) {
    List<Relation> semEdgePossibilities = new ArrayList<Relation>();
    if (from instanceof KBNLStateNodeCloud &&
            (r.toString().equals("agent") // Passive voice
            || r.toString().equals("nsubj") // Active voice - Unverified; Could be "agent"
            )){
      // TODO: Check if the Constants.isa() replace is of correct argument signature
      // (type inst class)
      semEdgePossibilities.add(RDF_S.type);
      return semEdgePossibilities;
    } else {
      return null;
    }
  }

  @Override
  public boolean check() {
    return false;
  }

  @Override
  public List<Relation> edgePossibilities() {
    return null;
  }
}


text:
.class public Lcom/android/settings/deviceinfo/StorageVolumePreference;
.super Landroid/support/v7/preference/Preference;
.source "StorageVolumePreference.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/settings/deviceinfo/StorageVolumePreference$1;
    }
.end annotation

# instance fields
.field private final TAG:Ljava/lang/String;

.field private mColor:I

.field private mContext:Landroid/content/Context;

.field private mLowStorage:Z

.field private final mStorageManager:Landroid/os/storage/StorageManager;

.field private final mUnmountListener:Landroid/view/View$OnClickListener;

.field private mUsedPercent:I

.field private final mVolume:Landroid/os/storage/VolumeInfo;

# direct methods
.method static synthetic -get0(Lcom/android/settings/deviceinfo/StorageVolumePreference;)Landroid/os/storage/VolumeInfo;
    .locals 1

    iget-object v0, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mVolume:Landroid/os/storage/VolumeInfo;

    return-object v0
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/os/storage/VolumeInfo;IJ)V
    .locals 14

    invoke-direct {p0, p1}, Landroid/support/v7/preference/Preference;-><init>(Landroid/content/Context;)V

    const-string/jumbo v9, "StorageVolumePreference"

    iput-object v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->TAG:Ljava/lang/String;

    const/4 v9, -0x1

    iput v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mUsedPercent:I

    const/4 v9, 0x0

    iput-boolean v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mLowStorage:Z

    new-instance v9, Lcom/android/settings/deviceinfo/StorageVolumePreference$1;

    invoke-direct {v9, p0}, Lcom/android/settings/deviceinfo/StorageVolumePreference$1;-><init>(Lcom/android/settings/deviceinfo/StorageVolumePreference;)V

    iput-object v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mUnmountListener:Landroid/view/View$OnClickListener;

    iput-object p1, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mContext:Landroid/content/Context;

    const-class v9, Landroid/os/storage/StorageManager;

    invoke-virtual {p1, v9}, Landroid/content/Context;->getSystemService(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Landroid/os/storage/StorageManager;

    iput-object v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mStorageManager:Landroid/os/storage/StorageManager;

    move-object/from16 v0, p2

    iput-object v0, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mVolume:Landroid/os/storage/VolumeInfo;

    move/from16 v0, p3

    iput v0, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mColor:I

    const v9, 0x7f0d02e8

    invoke-virtual {p0, v9}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->setLayoutResource(I)V

    invoke-virtual/range {p2 .. p2}, Landroid/os/storage/VolumeInfo;->getId()Ljava/lang/String;

    move-result-object v9

    invoke-virtual {p0, v9}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->setKey(Ljava/lang/String;)V

    iget-object v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mStorageManager:Landroid/os/storage/StorageManager;

    move-object/from16 v0, p2

    invoke-virtual {v9, v0}, Landroid/os/storage/StorageManager;->getBestVolumeDescription(Landroid/os/storage/VolumeInfo;)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {p0, v9}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->setTitle(Ljava/lang/CharSequence;)V

    const-string/jumbo v9, "private"

    invoke-virtual/range {p2 .. p2}, Landroid/os/storage/VolumeInfo;->getId()Ljava/lang/String;

    move-result-object v12

    invoke-virtual {v9, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v9

    if-eqz v9, :cond_4

    const v9, 0x7f0805f0

    invoke-virtual {p1, v9}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    :goto_0
    invoke-virtual/range {p2 .. p2}, Landroid/os/storage/VolumeInfo;->isMountedReadable()Z

    move-result v9

    if-eqz v9, :cond_5

    invoke-virtual/range {p2 .. p2}, Landroid/os/storage/VolumeInfo;->getPath()Ljava/io/File;

    move-result-object v6

    invoke-static/range {p2 .. p2}, Lcom/samsung/android/settings/deviceinfo/StorageUtils;->getAvailableSize(Landroid/os/storage/VolumeInfo;)J

    move-result-wide v4

    invoke-virtual {v6}, Ljava/io/File;->getTotalSpace()J

    move-result-wide p4

    const-string/jumbo v9, "private"

    invoke-virtual/range {p2 .. p2}, Landroid/os/storage/VolumeInfo;->getId()Ljava/lang/String;

    move-result-object v12

    invoke-virtual {v9, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v9

    if-eqz v9, :cond_0

    invoke-static/range {p2 .. p2}, Lcom/samsung/android/settings/deviceinfo/StorageUtils;->getTotalSize(Landroid/os/storage/VolumeInfo;)J

    move-result-wide p4

    :cond_0
    sub-long v10, p4, v4

    invoke-static {p1, v10, v11}, Lcom/samsung/android/settings/deviceinfo/SecFormatter;->formatFileSize(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v8

    move-wide/from16 v0, p4

    invoke-static {p1, v0, v1}, Lcom/samsung/android/settings/deviceinfo/SecFormatter;->formatFileSize(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v7

    const/4 v9, 0x2

    new-array v9, v9, [Ljava/lang/Object;

    const/4 v12, 0x0

    aput-object v8, v9, v12

    const/4 v12, 0x1

    aput-object v7, v9, v12

    const v12, 0x7f121a75

    invoke-virtual {p1, v12, v9}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {p0, v9}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->setSummary(Ljava/lang/CharSequence;)V

    const-wide/16 v12, 0x0

    cmp-long v9, p4, v12

    if-lez v9, :cond_1

    const-wide/16 v12, 0x64

    mul-long/2addr v12, v10

    div-long v12, v12, p4

    long-to-int v9, v12

    iput v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mUsedPercent:I

    :cond_1
    iget-object v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mStorageManager:Landroid/os/storage/StorageManager;

    invoke-virtual {v9, v6}, Landroid/os/storage/StorageManager;->getStorageLowBytes(Ljava/io/File;)J

    move-result-wide v12

    cmp-long v9, v4, v12

    if-gez v9, :cond_2

    const v9, 0x1010543

    invoke-static {p1, v9}, Lcom/android/settingslib/Utils;->getColorAttr(Landroid/content/Context;I)I

    move-result v9

    iput v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mColor:I

    const v9, 0x7f0805f2

    invoke-virtual {p1, v9}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    const/4 v9, 0x1

    iput-boolean v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mLowStorage:Z

    :cond_2
    :goto_1
    invoke-virtual {v3}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;

    iget v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mColor:I

    invoke-virtual {v3, v9}, Landroid/graphics/drawable/Drawable;->setTint(I)V

    invoke-virtual {p0, v3}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->setIcon(Landroid/graphics/drawable/Drawable;)V

    invoke-virtual/range {p2 .. p2}, Landroid/os/storage/VolumeInfo;->getType()I

    move-result v9

    if-nez v9, :cond_3

    invoke-virtual/range {p2 .. p2}, Landroid/os/storage/VolumeInfo;->isMountedReadable()Z

    move-result v9

    if-eqz v9, :cond_3

    const v9, 0x7f0d022e

    invoke-virtual {p0, v9}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->setWidgetLayoutResource(I)V

    :cond_3
    return-void

    :cond_4
    const v9, 0x7f0805f1

    invoke-virtual {p1, v9}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    goto/16 :goto_0

    :cond_5
    :try_start_0
    invoke-virtual/range {p2 .. p2}, Landroid/os/storage/VolumeInfo;->getStateDescription()I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->setSummary(I)V
    :try_end_0
    .catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_2
    const/4 v9, -0x1

    iput v9, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mUsedPercent:I

    goto :goto_1

    :catch_0
    move-exception v2

    const-string/jumbo v9, "StorageVolumePreference"

    const-string/jumbo v12, "volume state description is not found"

    invoke-static {v9, v12}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_2
.end method

# virtual methods
.method public onBindViewHolder(Landroid/support/v7/preference/PreferenceViewHolder;)V
    .locals 5

    const/4 v4, 0x0

    const v2, 0x7f0a0907

    invoke-virtual {p1, v2}, Landroid/support/v7/preference/PreferenceViewHolder;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    if-eqz v1, :cond_0

    iget-object v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mContext:Landroid/content/Context;

    const v3, 0x1010036

    invoke-static {v2, v3}, Lcom/android/settingslib/Utils;->getColorAttr(Landroid/content/Context;I)I

    move-result v2

    invoke-static {v2}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setImageTintList(Landroid/content/res/ColorStateList;)V

    iget-object v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mUnmountListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    :cond_0
    const v2, 0x102000d

    invoke-virtual {p1, v2}, Landroid/support/v7/preference/PreferenceViewHolder;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ProgressBar;

    iget-object v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mVolume:Landroid/os/storage/VolumeInfo;

    invoke-virtual {v2}, Landroid/os/storage/VolumeInfo;->getType()I

    move-result v2

    const/4 v3, 0x1

    if-ne v2, v3, :cond_3

    iget v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mUsedPercent:I

    const/4 v3, -0x1

    if-eq v2, v3, :cond_3

    invoke-virtual {v0, v4}, Landroid/widget/ProgressBar;->setVisibility(I)V

    iget v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mUsedPercent:I

    invoke-virtual {v0, v2}, Landroid/widget/ProgressBar;->setProgress(I)V

    invoke-virtual {p0}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->getContext()Landroid/content/Context;

    move-result-object v2

    const v3, 0x7f06014b

    invoke-virtual {v2, v3}, Landroid/content/Context;->getColor(I)I

    move-result v2

    invoke-static {v2}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/ProgressBar;->setProgressTintList(Landroid/content/res/ColorStateList;)V

    iget-boolean v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mLowStorage:Z

    if-eqz v2, :cond_1

    invoke-virtual {p0}, Lcom/android/settings/deviceinfo/StorageVolumePreference;->getContext()Landroid/content/Context;

    move-result-object v2

    const v3, 0x7f060261

    invoke-virtual {v2, v3}, Landroid/content/Context;->getColor(I)I

    move-result v2

    invoke-static {v2}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/ProgressBar;->setProgressTintList(Landroid/content/res/ColorStateList;)V

    :cond_1
    :goto_0
    iget-object v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mVolume:Landroid/os/storage/VolumeInfo;

    invoke-virtual {v2}, Landroid/os/storage/VolumeInfo;->getType()I

    move-result v2

    if-nez v2, :cond_2

    iget-object v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mVolume:Landroid/os/storage/VolumeInfo;

    invoke-virtual {v2}, Landroid/os/storage/VolumeInfo;->isMountedReadable()Z

    move-result v2

    if-eqz v2, :cond_2

    iget-object v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v2

    const-string/jumbo v3, "com.sec.feature.hovering_ui"

    invoke-virtual {v2, v3}, Landroid/content/pm/PackageManager;->hasSystemFeature(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    if-eqz v1, :cond_2

    iget-object v2, p0, Lcom/android/settings/deviceinfo/StorageVolumePreference;->mContext:Landroid/content/Context;

    const v3, 0x7f121a57

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setContentDescription(Ljava/lang/CharSequence;)V

    new-instance v2, Lcom/android/settings/deviceinfo/StorageVolumePreference$2;

    invoke-direct {v2, p0}, Lcom/android/settings/deviceinfo/StorageVolumePreference$2;-><init>(Lcom/android/settings/deviceinfo/StorageVolumePreference;)V

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setOnHoverListener(Landroid/view/View$OnHoverListener;)V

    :cond_2
    invoke-super {p0, p1}, Landroid/support/v7/preference/Preference;->onBindViewHolder(Landroid/support/v7/preference/PreferenceViewHolder;)V

    return-void

    :cond_3
    const/16 v2, 0x8

    invoke-virtual {v0, v2}, Landroid/widget/ProgressBar;->setVisibility(I)V

    goto :goto_0
.end method


text:
/*******************************************************************************
 * The following bugs are referred to in this style sheet
 * 1.) Bug 419482 - Cascading policy in CSS
 * 2.) Bug 430052 - Imported rules cannot be overridden
 *******************************************************************************/

/* @import url("platform:/plugin/hydrograph.ui.theme/css/e4-dark.css"); Bug 430052 */
@import url("platform:/plugin/hydrograph.ui.theme/css/dark/e4-dark_basestyle.css");
@import url("platform:/plugin/hydrograph.ui.theme/css/dark/e4-dark_globalstyle.css"); /* Remove this to have ONLY the main IDE shell dark */
@import url("platform:/plugin/hydrograph.ui.theme/css/dark/e4-dark_partstyle.css");

.MTrimmedWindow.topLevel {
    margin-top: 3px;
    margin-bottom: 3px;
    margin-left: 3px;
    margin-right: 3px;
}

.MPartStack, .MPart {
    font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT';
}

.MPartStack {
    swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
    swt-selected-tab-fill: '#org-eclipse-ui-workbench-INACTIVE_TAB_BG_START' '#org-eclipse-ui-workbench-INACTIVE_TAB_BG_END' 100%; /* title background for selected tab */
    swt-unselected-tabs-color: '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%; /* title background for unselected tab */
    swt-outer-keyline-color: '#org-eclipse-ui-workbench-INACTIVE_TAB_OUTER_KEYLINE_COLOR'; /* border color for whole tabs container */
    swt-inner-keyline-color: '#org-eclipse-ui-workbench-INACTIVE_TAB_INNER_KEYLINE_COLOR';
    swt-tab-outline: '#org-eclipse-ui-workbench-INACTIVE_TAB_OUTLINE_COLOR'; /* border color for selected tab */
    padding: 0px 2px 2px;
    swt-shadow-visible: false;
    swt-mru-visible: true;
    swt-corner-radius: 16px;
}

.MPartStack.active {
    swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END' 100%; /* title background for selected tab */
    swt-unselected-tabs-color: '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%; /* title background for unselected tab */
    swt-outer-keyline-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_OUTER_KEYLINE_COLOR'; /* border color for whole tabs container */
    swt-inner-keyline-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_INNER_KEYLINE_COLOR';
    swt-tab-outline: '#org-eclipse-ui-workbench-ACTIVE_TAB_OUTLINE_COLOR'; /* border color for selected tab */
}

.MPartStack.active.noFocus {
    swt-selected-tabs-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%;
}

.MPartStack.empty {
    swt-unselected-tabs-color: '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START' #4F5456 #4F5456 99% 100%; /* title background for unselected tab */
    swt-tab-outline: #535354; /* border color for selected tab */
    swt-outer-keyline-color: #515658; /* border color for whole tabs container */
}

.MPart.busy {
    font-style: italic;
}

.MPart.highlighted {
    font-weight: bold;
}

CTabItem,
CTabItem CLabel {
    background-color: '#org-eclipse-ui-workbench-INACTIVE_TAB_BG_END'; /* HACK for background of CTabFolder inner Toolbars */
    color: '#org-eclipse-ui-workbench-INACTIVE_TAB_UNSELECTED_TEXT_COLOR';
}
CTabItem:selected,
CTabItem:selected CLabel {
    color: '#org-eclipse-ui-workbench-INACTIVE_TAB_SELECTED_TEXT_COLOR';
}

.MPartStack.active > CTabItem,
.MPartStack.active > CTabItem CLabel {
    background-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END'; /* HACK for background of CTabFolder inner Toolbars */
    color: '#org-eclipse-ui-workbench-ACTIVE_TAB_UNSELECTED_TEXT_COLOR';
}
.MPartStack.active > CTabItem:selected,
.MPartStack.active > CTabItem:selected CLabel {
    color: '#org-eclipse-ui-workbench-ACTIVE_TAB_SELECTED_TEXT_COLOR';
}

.MPartStack.active.noFocus > CTabItem:selected {
    color: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR';
}

CTabItem.busy {
    color: #888888;
}

#PerspectiveSwitcher {
    eclipse-perspective-keyline-color: #AAB0BF #AAB0BF;
}

.MToolControl.TrimStack {
    /*frame-image:  url(./gtkTSFrame.png);*/
    handle-image:  url(./dragHandle.png);
    frame-cuts: 5px 1px 5px 16px;
}

.MToolBar.Draggable {
    handle-image:  url(./dragHandle.png);
}

.MToolControl.Draggable {
    handle-image:  url(./dragHandle.png);
}

.DragFeedback {
    background-color: COLOR-WIDGET-NORMAL-SHADOW;
}

.ModifiedDragFeedback {
    background-color: #4176AF;
}

.MTrimmedWindow {
    background-color: #515658;
}

.MTrimBar {
    background-color: #515658;
}

CTabFolder.MArea .MPartStack,CTabFolder.MArea .MPartStack.active {
    swt-shadow-visible: false;
}

CTabFolder Tree, CTabFolder Canvas {
    background-color: #2F2F2F;
    color: #CCC;
}
.MPartStack.active Tree,
.MPartStack.active CTabFolder Canvas {
    background-color: #262626;
    color: #CCC;
}

.MPartStack.active Table {
    background-color: #2F2F2F;
    color: #CCC;
}

.View {
    background-color: #313538;
    color: #F5F5F5;
}

/* ###################### Top Toolbar ########################## */

#org-eclipse-ui-main-toolbar, #PerspectiveSwitcher {
    eclipse-perspective-keyline-color: #585858;
    background-color: #515658 #515658 100%;
    handle-image: none;
    color: #EBE8E4;
}

/* #################### Bottom Status Bar ######################## */

#org-eclipse-ui-StatusLine,
#org-eclipse-ui-ProgressBar,
#org-eclipse-ui-ProgressBar Canvas {
    color: #CCCCCC;
}
#org-eclipse-ui-StatusLine CLabel {
    color: #BDBAB7;
}

StatusLine, ImageBasedFrame{
    color: #BDBAB7;
}

/* ###################### Global Styles ########################## */

TabFolder,
/* the following are required due to Bug 419482: */
TabFolder > Composite > TabFolder,
TabFolder > Composite > * > TabFolder,
DocCommentOwnerComposite > Group > TabFolder,
TabFolder > Composite > ScrolledComposite > TabFolder,
Shell > Composite > Composite > TabFolder,
Composite > Composite > Composite > Group > TabFolder,
Shell > Composite > Composite > Composite > TabFolder,
ScrolledComposite > Composite > Composite > Composite > TabFolder,
Shell > Composite > Composite > Composite > Composite > Composite > TabFolder,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > TabFolder,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > TabFolder {
    /* background-color is not applied to the whole button,
       but text color is changed, so it appear light on light */
    background-color: #515658;
    color: #222;
}

Button,
/* the following are required due to Bug 419482: */
Composite > Button,
TabFolder > Composite > Button,
TabFolder > Composite > * > Button,
DocCommentOwnerComposite > Group > Button,
TabFolder > Composite > ScrolledComposite > Button,
Shell > Composite > Composite > Button,
Composite > Composite > Composite > Group > Button,
Shell > Composite > Composite > Composite > Button,
ScrolledComposite > Composite > Composite > Composite > Button,
Shell > Composite > Composite > Composite > Composite > Composite > Button,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Button,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Button,
Form > LayoutComposite > LayoutComposite > Button,
.MPart Button,
.MPartStack.active .MPart Button,
.MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Button,
.MPartStack.active .MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Button {
    /* background-color is not applied to the whole button,
       but text color is changed, so it appear light on light */
    background-color: #515658;
    color: #222;
}
Button[style~='SWT.CHECK'],
/* the following are required due to Bug 419482: */
Composite > Button[style~='SWT.CHECK'],
TabFolder > Composite > Button[style~='SWT.CHECK'],
TabFolder > Composite > * > Button[style~='SWT.CHECK'],
DocCommentOwnerComposite > Group > Button[style~='SWT.CHECK'],
TabFolder > Composite > ScrolledComposite > Button[style~='SWT.CHECK'],
Shell > Composite > Composite > Button[style~='SWT.CHECK'],
Composite > Composite > Composite > Group > Button[style~='SWT.CHECK'],
Shell > Composite > Composite > Composite > Button[style~='SWT.CHECK'],
ScrolledComposite > Composite > Composite > Composite > Button[style~='SWT.CHECK'],
Shell > Composite > Composite > Composite > Composite > Composite > Button[style~='SWT.CHECK'],
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Button[style~='SWT.CHECK'],
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Button[style~='SWT.CHECK'],
Form > LayoutComposite > LayoutComposite > Button[style~='SWT.CHECK'],
.MPart Button[style~='SWT.CHECK'],
.MPartStack.active .MPart Button[style~='SWT.CHECK'],
.MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Button[style~='SWT.CHECK'],
.MPartStack.active .MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Button[style~='SWT.CHECK'] {
    /* currently, Button object isn't consistent (eg. also a checkbox is seen as Button) */
    /* so, css rules applied to Button have to be overridden for non-Button matches */
    color: #ddd;
}
Button[style~='SWT.RADIO'],
/* the following are required due to Bug 419482: */
Composite > Button[style~='SWT.RADIO'],
TabFolder > Composite > Button[style~='SWT.RADIO'],
TabFolder > Composite > * > Button[style~='SWT.RADIO'],
DocCommentOwnerComposite > Group > Button[style~='SWT.RADIO'],
TabFolder > Composite > ScrolledComposite > Button[style~='SWT.RADIO'],
Shell > Composite > Composite > Button[style~='SWT.RADIO'],
Composite > Composite > Composite > Group > Button[style~='SWT.RADIO'],
Shell > Composite > Composite > Composite > Button[style~='SWT.RADIO'],
ScrolledComposite > Composite > Composite > Composite > Button[style~='SWT.RADIO'],
Shell > Composite > Composite > Composite > Composite > Composite > Button[style~='SWT.RADIO'],
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Button[style~='SWT.RADIO'],
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Button[style~='SWT.RADIO'],
Form > LayoutComposite > LayoutComposite > Button[style~='SWT.RADIO'],
.MPart Button[style~='SWT.RADIO'],
.MPartStack.active .MPart Button[style~='SWT.RADIO'],
.MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Button[style~='SWT.RADIO'],
.MPartStack.active .MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Button[style~='SWT.RADIO'] {
    /* currently, Button object isn't consistent (eg. also a checkbox is seen as Button) */
    /* so, css rules applied to Button have to be overridden for non-Button matches */
    color: #ddd;
}

Combo,
/* the following are required due to Bug 419482: */
Composite > Combo,
TabFolder > Composite > Combo,
TabFolder > Composite > * > Combo,
DocCommentOwnerComposite > Group > Combo,
TabFolder > Composite > ScrolledComposite > Combo,
Shell > Composite > Composite > Combo,
Composite > Composite > Composite > Group > Combo,
Shell > Composite > Composite > Composite > Combo,
ScrolledComposite > Composite > Composite > Composite > Combo,
Shell > Composite > Composite > Composite > Composite > Composite > Combo,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Combo,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Combo,
Form > LayoutComposite > LayoutComposite > Combo,
.MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Combo {
    background-color: #949DA5;
    color: #222;  /* background of drop-drown list is hard-coded to white */
}
Combo:selected,
/* the following are required due to Bug 419482: */
Composite > Combo:selected,
TabFolder > Composite > Combo:selected,
TabFolder > Composite > * > Combo:selected,
DocCommentOwnerComposite > Group > Combo:selected,
TabFolder > Composite > ScrolledComposite > Combo:selected,
Shell > Composite > Composite > Combo:selected,
Composite > Composite > Composite > Group > Combo:selected,
Shell > Composite > Composite > Composite > Combo:selected,
ScrolledComposite > Composite > Composite > Composite > Combo:selected,
Shell > Composite > Composite > Composite > Composite > Composite > Combo:selected,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Combo:selected,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Combo:selected,
Form > LayoutComposite > LayoutComposite > Combo:selected,
.MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Combo:selected {
    background-color: #41464A;
    color: #FFF;
}

Text[style~='SWT.SEARCH'],
/* the following are required due to Bug 419482: */
Composite > Text[style~='SWT.SEARCH'],
TabFolder > Composite > Text[style~='SWT.SEARCH'],
TabFolder > Composite > * > Text[style~='SWT.SEARCH'],
DocCommentOwnerComposite > Group > Text[style~='SWT.SEARCH'],
TabFolder > Composite > ScrolledComposite > Text[style~='SWT.SEARCH'],
Shell > Composite > Composite > Text[style~='SWT.SEARCH'],
Composite > Composite > Composite > Group > Text[style~='SWT.SEARCH'],
Shell > Composite > Composite > Composite > Text[style~='SWT.SEARCH'],
ScrolledComposite > Composite > Composite > Composite > Text[style~='SWT.SEARCH'],
Shell > Composite > Composite > Composite > Composite > Composite > Text[style~='SWT.SEARCH'],
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Text[style~='SWT.SEARCH'],
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Text[style~='SWT.SEARCH'],
#org-eclipse-pde-runtime-LogView Text[style~='SWT.SEARCH'],
Form > LayoutComposite > LayoutComposite > Text[style~='SWT.SEARCH'],
.MPart LayoutComposite > * > LayoutComposite > Section > LayoutComposite > Text[style~='SWT.SEARCH'] {
    /* search boxes */
    background-color: #949da5; /* background-color is hard-coded */
    color: #333;
}

Composite StyledText{
	background-color: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START'	;
    color: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START';

}


text:
module.exports = function(grunt) {

  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    // secrets.json is ignored in git because it contains sensitive data
    // See the README for configuration settings
    secrets: grunt.file.readJSON('secrets.json'),

    // Re-usable filesystem paths (these shouldn't be modified)
    paths: {
      src:        'src',
      src_img:    'src/img',
      dist:       'dist',
      dist_img:   'dist/img',
      dist_css:   'dist/css',
      preview:    'preview'
    },

    // Takes your SCSS files and compiles them to CSS
    sass: {
      dist: {
        options: {
          style: 'expanded'
        },
        files: {
          '<%= paths.dist_css %>/main.css': '<%= paths.src %>/styles/style.scss'
        }
      },

      // This task compiles Sass for the browser-baed preview UI.
      // You should not need to edit it.
      preview: {
        options: {
          style: 'compressed'
        },
        files: {
          '<%= paths.preview %>/css/preview.css': '<%= paths.preview %>/scss/preview.scss'
        }
      }
    },

    // Assembles your email content with HTML layout
    assemble: {
      options: {
        layoutdir: '<%= paths.src %>/layouts',
        partials: ['<%= paths.src %>/partials/**/*.hbs'],
        helpers: ['<%= paths.src %>/helpers/**/*.js'],
        data: ['<%= paths.src %>/data/*.{json,yml}'],
        flatten: true
      },
      pages: {
        src: ['<%= paths.src %>/emails/' + grunt.option('template') + '.hbs'],
        dest: '<%= paths.dist %>/'
      }
    },

    // Replace compiled template images sources from ../src/html to ../dist/html
    replace: {
      src_images: {
        options: {
          usePrefix: false,
          patterns: [
            {
              match: /(<img[^>]+[\"'])(\.\.\/src\/img\/)/gi,  // Matches <img * src="../src/img or <img * src='../src/img'
              replacement: '$1../<%= paths.dist_img %>/'
            },
            {
              match: /(url\(*[^)])(\.\.\/src\/img\/)/gi,  // Matches url('../src/img') or url(../src/img) and even url("../src/img")
              replacement: '$1../<%= paths.dist_img %>/'
            }
          ]
        },
        files: [{
          expand: true,
          flatten: true,
          src: ['<%= paths.dist %>/*.html'],
          dest: '<%= paths.dist %>'
        }]
      }
    },

    // Inlines your CSS
    juice: {
      your_target: {
        options: {
          preserveMediaQueries: true,
          applyAttributesTableElements: true,
          applyWidthAttributes: true,
          preserveImportant: true
        },
        files: [{
          expand: true,
          src: ['<%= paths.dist %>/*.html'],
          dest: ''
        }]
      },
    },

    // Optimize images
    imagemin: {
      dynamic: {
        options: {
          optimizationLevel: 3,
          svgoPlugins: [{ removeViewBox: false }]
        },
        files: [{
          expand: true,
          cwd: '<%= paths.src_img %>',
          src: ['**/*.{png,jpg,gif}'],
          dest: '<%= paths.dist_img %>'
        }]
      }
    },

    concurrent: {
      watch: {
        tasks: [
          'watch',
          'shell:sass',
          'open'
        ],
        options: {
          logConcurrentOutput: true,
          limit: 4
        }
      }
    },

    // Watches for changes to CSS or email templates then runs grunt tasks
    watch: {
      options: {
        livereload: true
      },
      emails: {
        files: ['<%= paths.src %>/emails/' + grunt.option('template') + '.hbs','<%= paths.src %>/layouts/*', '<%= paths.src %>/data/*'],
        tasks: ['assemble']
      },
      css: {
        files: ['<%= paths.dist_css %>/main.css']
      }
    },

    shell: {
      sass: {
        command: 'sass --watch --compass --sourcemap ' + '<%= paths.src %>/styles/style.scss:<%= paths.dist_css %>/main.css'
      }
    },

    // Use Mailgun option if you want to email the design to your inbox or to something like Litmus
    // grunt send --template=transaction.html
    mailgun: {
      mailer: {
        options: {
          key: '<%= secrets.mailgun.api_key %>', // See README for secrets.json or replace this with your own key
          sender: '<%= secrets.mailgun.sender %>', // See README for secrets.json or replace this with your preferred sender
          recipient: '<%= secrets.mailgun.recipient %>', // See README for secrets.json or replace this with your preferred recipient
          subject: 'This is a test email'
        },
        src: ['<%= paths.dist %>/'+grunt.option('template')]
      }
    },

    // Send your email template to Litmus for testing
    // grunt litmus --template=transaction.html
    litmus: {
      test: {
        src: ['<%= paths.dist %>/'+grunt.option('template')],
        options: {
          username: '<%= secrets.litmus.username %>', // See README for secrets.json or replace this with your username
          password: '<%= secrets.litmus.password %>', // See README for secrets.json or replace this with your password
          url: 'https://<%= secrets.litmus.company %>.litmus.com', // See README for secrets.json or replace this with your company url
          clients: ['android4', 'aolonline', 'androidgmailapp', 'aolonline', 'ffaolonline',
          'chromeaolonline', 'appmail6', 'iphone6', 'ipadmini', 'ipad', 'chromegmailnew',
          'iphone6plus', 'notes85', 'ol2002', 'ol2003', 'ol2007', 'ol2010', 'ol2011',
          'ol2013', 'outlookcom', 'chromeoutlookcom', 'chromeyahoo', 'windowsphone8'] // https://#{company}.litmus.com/emails/clients.xml
        }
      }
    },

    /**************************************************************************************************************
      START: Browser-based preview tasks.
      You should not need to edit anything between this and the end block.
    ***************************************************************************************************************/

    // Autoprefixer for css
    autoprefixer: {
      preview: {
        options: {
          browsers: ['last 6 versions', 'ie 9']
        },
        src: 'preview/css/preview.css'
      }
    },

    // Express server for browser previews
    express: {
      server: {
        options: {
          port: 4000,
          hostname: '127.0.0.1',
          bases: ['<%= paths.dist %>', '<%= paths.preview %>', '<%= paths.src %>'],
          server: './server.js',
          livereload: true
        }
      }
    },

    // Open browser preview
    open: {
      preview: {
        path: 'http://localhost:4000'
      }
    }

    /**************************************************************************************************************
      END: Browser-based preview tasks.
      You should not need to edit anything between this and the start block.
    ***************************************************************************************************************/

  });

  // Load assemble
  grunt.loadNpmTasks('assemble');
  grunt.loadNpmTasks('grunt-concurrent');

  // Load all Grunt tasks
  // https://github.com/sindresorhus/load-grunt-tasks
  require('load-grunt-tasks')(grunt);

  // Where we tell Grunt what to do when we type "grunt" into the terminal.
  grunt.registerTask('default', ['sass:dist','assemble','juice','imagemin','replace:src_images']);

  // Use grunt send if you want to actually send the email to your inbox
  grunt.registerTask('send', ['mailgun']);

  // Launch the express server and start watching
  // NOTE: The server will not stay running if the grunt watch task is not active
  grunt.registerTask('serve', ['default', 'sass:preview', 'autoprefixer:preview', 'express', 'open', 'watch']);

  grunt.registerTask('test', ['express', 'concurrent']);

};


text:
<!DOCTYPE html>
<html>
    {% include head.html %}
    <body id="page-top" class="index">
    {% include nav.html %}
    {% include header.html %}
    {% include documents.html %}
    {% include about.html %}
    {% include contact.html %}
    {% include footer.html %}
    {% include js_home.html %}
    </body>
</html>