text:
var path = require('path')
var util = require('util')

// npm
var fs = require('graceful-fs')
var async = require('async')
var mkdirp = require('mkdirp')
var glob = require('glob')
var through = require('through')
var stattoMerge = require('statto-merge')
var stattoProcess = require('statto-process')
var stattoBackend = require('statto-backend')

// --------------------------------------------------------------------------------------------------------------------
// module level

function noop(){}

// --------------------------------------------------------------------------------------------------------------------
// constructor

function StattoBackendFs(dir, opts) {
  if ( !dir ) {
    throw new Error('Provide a dir')
  }

  // default the opts to nothing
  this.dir      = dir
  this.rawDir   = path.join(dir, 'raw')
  this.statsDir = path.join(dir, 'stats')
  this.opts     = opts || {}
}

util.inherits(StattoBackendFs, stattoBackend.StattoBackendAbstract)

// --------------------------------------------------------------------------------------------------------------------
// methods

StattoBackendFs.prototype.setup = function setup(callback) {
  var self = this

  // make sure this directory exists
  async.each(
    [ self.dir, self.rawDir, self.statsDir ],
    function(dir, done) {
      console.log('dir=' + dir)
      mkdirp(dir, done)
    },
    callback
  )
}

StattoBackendFs.prototype.addRaw = function addRaw(raw, callback) {
  var self = this
  callback = callback || noop

  // create a unique filename, use the hash of the contents
  var hash = self._getHash(raw)

  // save these stats to the file system
  var filename = path.join(self.rawDir, raw.ts + '-' + hash + '.json')
  fs.writeFile(filename, JSON.stringify(raw), function(err) {
    if (err) {
      self.emit('err', err)
      return callback(err)
    }
    self.emit('stored')
    callback()
  })
}

StattoBackendFs.prototype.getRaws = function getRaws(date, callback) {
  var self = this
  callback = callback || noop

  date = self._datify(date)
  if ( !date ) {
    return process.nextTick(function() {
      callback(new Error('Unknown date type : ' + typeof date))
    })
  }
  var ts = date.toISOString()

  // get all of these raws from the filesystem
  glob(path.join(self.rawDir, ts + '-*.json'), function(err, files) {
    if (err) return callback(err)

    var raws = []
    async.eachSeries(
      files,
      function(filename, done) {
        if (err) return callback(err)
        fs.readFile(filename, 'utf8', function(err, data) {
          if (err) return done(err)
          try {
            raws.push(JSON.parse(data))
          }
          catch (err) {
            return callback(err)
          }
          done()
        })
      },
      function(err) {
        if (err) return callback(err)
        callback(null, raws)
      }
    )
  })
}

StattoBackendFs.prototype.setStats = function setStats(stats, callback) {
  var self = this
  callback = callback || noop

  var ts = stats.ts

  // save these stats to the file system
  var filename = path.join(self.statsDir, stats.ts + '.json')
  fs.writeFile(filename, JSON.stringify(stats), function(err) {
    if (err) {
      self.emit('err', err)
      return callback(err)
    }
    self.emit('stored')
    callback()
  })
}

StattoBackendFs.prototype.getStats = function getStats(date, callback) {
  var self = this
  callback = callback || noop

  date = self._datify(date)
  if ( !date ) {
    return process.nextTick(function() {
      callback(new Error('Unknown date type : ' + typeof date))
    })
  }
  var ts = date.toISOString()

  var filename = path.join(self.statsDir, ts + '.json')
  fs.readFile(filename, 'utf8', function(err, data) {
    if (err) return callback(err)
    var stats
    try {
      stats = JSON.parse(data)
    }
    catch (err) {
      return callback(err)
    }
    callback(null, stats)
  })
}

StattoBackendFs.prototype.createStatsReadStream = function createStatsReadStream(from, to, callback) {
  // * from - greater than or equal to (always included)
  // * to - less than (therefore never included)
  var self = this

  from = self._datify(from)
  to   = self._datify(to)
  // if ( !from ) {
  //   return process.nextTick(function() {
  //     callback(new Error("Unknown 'from' type : " + typeof from))
  //   })
  // }
  // if ( !to ) {
  //   return process.nextTick(function() {
  //     callback(new Error("Unknown 'to' type : " + typeof to))
  //   })
  // }
  var ts1 = from.toISOString()
  var ts2 = to.toISOString()

  // let's loop through all the filenames, then load them up if it fits this range
  var stream = through()
  var filesToLoad = []

  // get all of the filenames from the filesystem
  glob(path.join(self.statsDir, '*.json'), function(err, filenames) {
    filenames = filenames.sort()
    var basename
    for (var i = 0; i < filenames.length; i++) {
      basename = path.basename(filenames[i], '.json')
      if ( basename >= ts1 && basename < ts2 ) {
        filesToLoad.push(filenames[i])
      }
    }

    async.eachSeries(
      filesToLoad,
      function(filename, done) {
        fs.readFile(filename, 'utf8', function(err, data) {
          if (err) return done(err)
          var stats
          try {
            stats = JSON.parse(data)
          }
          catch (err) {
            return done(err)
          }
          stream.queue(stats)
          done()
        })
      },
      function(err) {
        if (err) return stream.emit('error', err)
        stream.emit('end')
        stream.emit('close')
      }
    )
  })

  return stream
}

// ToDo:
// * getCounterRange
// * getTimerRange
// * getGaugeRange

// --------------------------------------------------------------------------------------------------------------------

module.exports = function backend(dir, opts) {
  if ( !dir ) {
    throw new Error('Required: dir in statto-backend-fs')
  }

  return new StattoBackendFs(dir, opts)
}

// --------------------------------------------------------------------------------------------------------------------


text:
from pudzu.charts import *
from pudzu.sandbox.bamboo import *

arial = sans

atlas = pd.read_csv("datasets/countries.csv").split_columns('country', "|").explode('country').set_index("country")
df = pd.read_csv("datasets/g7diedinoffice.csv").set_index("country")
df["fatality"] = (df.natural + df.homicide + df.suicide) / df.years * 100
df["natural_pc"] = df.natural / df.years * 100
df["homicide_pc"] = df.homicide / df.years * 100
df["suicide_pc"] = df.suicide / df.years * 100

df = df.sort_values("fatality", ascending=False)

H=750
W=100
S=6

DIO = [
["aTakashi 1921", "Tomosaburō 1923", "Takaaki 1924", "aTsuyoshi 1932", "Ōhira 1980"],
["Harrison 1841", "Taylor 1850", "aLincoln 1865", "aGarfield 1881", "aMcKinley 1901", "Harding 1923", "Roosevelt 1945", "aKennedy 1963"],
["aCarnot 1894", "Faure 1899", "aDoumer 1932", "Pompidou 1974"],
["Wilmington 1743", "Pelham 1754", "Rockingham 1782", "Pitt 1806", "aPerceval 1812", "Canning 1827", "Palmerston 1865"],
["sHitler 1945", "sGoebbels 1945"],
["Macdonald 1891", "Thompson 1894"],
["Benso 1861", "Depretis 1887"]
]

def rlabel(r):
    return Image.from_column([
        Image.from_url_with_cache(atlas.flag[df.index[r]]).convert("RGBA").resize((W,round(W*0.6))).trim(1).pad(1, "grey"),
        Image.from_text(f"{df.years[r]} years", arial(12, bold=True)),
        Image.from_text(f"{df.total[r]+1} {df.job[r]}", arial(12, bold=True)),
        *[Image.from_text(s[1:] if s[0] in "as" else s, arial(12), fg=VegaPalette10.RED if s[0]=="a" else VegaPalette10.ORANGE if s[0]=="s" else VegaPalette10.BLUE) for s in DIO[r]],
    ], bg="white", padding=(0,2))

chart = bar_chart(df[["homicide_pc", "suicide_pc", "natural_pc"]], W, H, type=BarChartType.STACKED, spacing=S, label_font=arial(14),
    colors=[VegaPalette10.RED, VegaPalette10.ORANGE, VegaPalette10.BLUE],
    clabels=lambda c,r,v: Image.from_text(str([df.homicide, df.suicide, df.natural][c][r]), arial(16)),
    rlabels=rlabel, grid_interval=0.5, label_interval=1, ylabels="{}%",
    legend_position=(1,0), legend_fonts=papply(arial, 14), legend_box_sizes=30, legend_args={"header": "Cause of death".upper(), "labels": ["Assassinated", "Suicide", "Natural causes"]},
    ylabel=Image.from_text("annual chance of dying in office", arial(16), padding=(5,2,5,10), bg="white").transpose(Image.ROTATE_90))

title = Image.from_column([
    Image.from_text("Fatality rates for G7 national leaders".upper(), arial(36, bold=True), padding=5),
    Image.from_text("annual chance of dying in office, based on past deaths", arial(24, italics=True), padding=5),
    ], bg="white", padding=2)
#footer = Image.from_markup("data is from a variety of sources and should be viewed as approximate; cities marked with * are second-largest cities that had a significantly larger Jewish population than the largest one", partial(arial, 14))

img = Image.from_column([title, chart], bg="white", padding=5)
img.place(Image.from_text("/u/Udzu", font("arial", 12), fg="grey", bg="white", padding=5).pad((1,1,0,0), "grey"), align=1, padding=5, copy=False)
img.save("output/g7diedinoffice.png")

redpajama_set_name: RedPajamaGithub


text:
DROP PROCEDURE IF EXISTS get_NewsFeeds;
DELIMITER $$

# CALL get_NewsFeeds('Home', 'Top');
CREATE DEFINER=`root`@`localhost` PROCEDURE `get_NewsFeeds`(IN _section TEXT, IN _position TEXT)
BEGIN
	SELECT n.n_title, n.n_content, n.n_image_url, n.created_by, n.date_create FROM newsfeeds_tbl n
		LEFT JOIN lk_feed_position p ON p.id = n.n_position
		LEFT JOIN lk_feed_section s ON s.id= n.n_section
	WHERE n.n_status = 1 AND p.description = _position AND s.description = _section;
END$$
DELIMITER ;


text:
/* */
'use strict';
var _extends = Object.assign || function(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i];
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        target[key] = source[key];
      }
    }
  }
  return target;
};
Object.defineProperty(exports, "__esModule", {value: true});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _stylePropable = require('../mixins/style-propable');
var _stylePropable2 = _interopRequireDefault(_stylePropable);
var _getMuiTheme = require('../styles/getMuiTheme');
var _getMuiTheme2 = _interopRequireDefault(_getMuiTheme);
function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {default: obj};
}
function _objectWithoutProperties(obj, keys) {
  var target = {};
  for (var i in obj) {
    if (keys.indexOf(i) >= 0)
      continue;
    if (!Object.prototype.hasOwnProperty.call(obj, i))
      continue;
    target[i] = obj[i];
  }
  return target;
}
var TableRow = _react2.default.createClass({
  displayName: 'TableRow',
  propTypes: {
    children: _react2.default.PropTypes.node,
    className: _react2.default.PropTypes.string,
    displayBorder: _react2.default.PropTypes.bool,
    hoverable: _react2.default.PropTypes.bool,
    hovered: _react2.default.PropTypes.bool,
    onCellClick: _react2.default.PropTypes.func,
    onCellHover: _react2.default.PropTypes.func,
    onCellHoverExit: _react2.default.PropTypes.func,
    onRowClick: _react2.default.PropTypes.func,
    onRowHover: _react2.default.PropTypes.func,
    onRowHoverExit: _react2.default.PropTypes.func,
    rowNumber: _react2.default.PropTypes.number,
    selectable: _react2.default.PropTypes.bool,
    selected: _react2.default.PropTypes.bool,
    striped: _react2.default.PropTypes.bool,
    style: _react2.default.PropTypes.object
  },
  contextTypes: {muiTheme: _react2.default.PropTypes.object},
  childContextTypes: {muiTheme: _react2.default.PropTypes.object},
  mixins: [_stylePropable2.default],
  getDefaultProps: function getDefaultProps() {
    return {
      displayBorder: true,
      hoverable: false,
      hovered: false,
      selectable: true,
      selected: false,
      striped: false
    };
  },
  getInitialState: function getInitialState() {
    return {
      muiTheme: this.context.muiTheme || (0, _getMuiTheme2.default)(),
      hovered: false
    };
  },
  getChildContext: function getChildContext() {
    return {muiTheme: this.state.muiTheme};
  },
  componentWillReceiveProps: function componentWillReceiveProps(nextProps, nextContext) {
    var newMuiTheme = nextContext.muiTheme ? nextContext.muiTheme : this.state.muiTheme;
    this.setState({muiTheme: newMuiTheme});
  },
  getTheme: function getTheme() {
    return this.state.muiTheme.tableRow;
  },
  getStyles: function getStyles() {
    var theme = this.getTheme();
    var cellBgColor = 'inherit';
    if (this.props.hovered || this.state.hovered) {
      cellBgColor = theme.hoverColor;
    } else if (this.props.selected) {
      cellBgColor = theme.selectedColor;
    } else if (this.props.striped) {
      cellBgColor = theme.stripeColor;
    }
    var styles = {
      root: {
        borderBottom: '1px solid ' + theme.borderColor,
        color: theme.textColor,
        height: theme.height
      },
      cell: {backgroundColor: cellBgColor}
    };
    if (!this.props.displayBorder) {
      styles.root.borderBottom = '';
    }
    return styles;
  },
  _createColumns: function _createColumns() {
    var _this = this;
    var columnNumber = 1;
    return _react2.default.Children.map(this.props.children, function(child) {
      if (_react2.default.isValidElement(child)) {
        return _this._createColumn(child, columnNumber++);
      }
    });
  },
  _createColumn: function _createColumn(child, columnNumber) {
    var key = this.props.rowNumber + '-' + columnNumber;
    var styles = this.getStyles();
    var handlers = {
      onClick: this._onCellClick,
      onHover: this._onCellHover,
      onHoverExit: this._onCellHoverExit
    };
    return _react2.default.cloneElement(child, _extends({
      columnNumber: columnNumber,
      hoverable: this.props.hoverable,
      key: child.props.key || key,
      style: this.mergeStyles(styles.cell, child.props.style)
    }, handlers));
  },
  _onRowClick: function _onRowClick(e) {
    if (this.props.selectable && this.props.onRowClick)
      this.props.onRowClick(e, this.props.rowNumber);
  },
  _onRowHover: function _onRowHover(e) {
    if (this.props.onRowHover)
      this.props.onRowHover(e, this.props.rowNumber);
  },
  _onRowHoverExit: function _onRowHoverExit(e) {
    if (this.props.onRowHoverExit)
      this.props.onRowHoverExit(e, this.props.rowNumber);
  },
  _onCellClick: function _onCellClick(e, columnIndex) {
    if (this.props.selectable && this.props.onCellClick)
      this.props.onCellClick(e, this.props.rowNumber, columnIndex);
    e.ctrlKey = true;
    this._onRowClick(e);
  },
  _onCellHover: function _onCellHover(e, columnIndex) {
    if (this.props.hoverable) {
      this.setState({hovered: true});
      if (this.props.onCellHover)
        this.props.onCellHover(e, this.props.rowNumber, columnIndex);
      this._onRowHover(e);
    }
  },
  _onCellHoverExit: function _onCellHoverExit(e, columnIndex) {
    if (this.props.hoverable) {
      this.setState({hovered: false});
      if (this.props.onCellHoverExit)
        this.props.onCellHoverExit(e, this.props.rowNumber, columnIndex);
      this._onRowHoverExit(e);
    }
  },
  render: function render() {
    var _props = this.props;
    var className = _props.className;
    var displayBorder = _props.displayBorder;
    var hoverable = _props.hoverable;
    var onCellClick = _props.onCellClick;
    var onCellHover = _props.onCellHover;
    var onCellHoverExit = _props.onCellHoverExit;
    var onRowClick = _props.onRowClick;
    var onRowHover = _props.onRowHover;
    var onRowHoverExit = _props.onRowHoverExit;
    var rowNumber = _props.rowNumber;
    var selectable = _props.selectable;
    var selected = _props.selected;
    var striped = _props.striped;
    var style = _props.style;
    var other = _objectWithoutProperties(_props, ['className', 'displayBorder', 'hoverable', 'onCellClick', 'onCellHover', 'onCellHoverExit', 'onRowClick', 'onRowHover', 'onRowHoverExit', 'rowNumber', 'selectable', 'selected', 'striped', 'style']);
    var rowColumns = this._createColumns();
    return _react2.default.createElement('tr', _extends({
      className: className,
      style: this.prepareStyles(this.getStyles().root, style)
    }, other), rowColumns);
  }
});
exports.default = TableRow;
module.exports = exports['default'];


text:
<?php

namespace Cake\Test\TestCase\ORM;

use Cake\ORM\Locator\LocatorInterface;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\TestCase;

/**
 * Test case for TableRegistry
 */
class TableRegistryTest extends TestCase
{

    /**
     * Original TableLocator.
     *
     * @var Cake\ORM\Locator\LocatorInterface
     */
    protected $_originalLocator;

    /**
     * Remember original instance to set it back on tearDown() just to make sure
     * other tests are not broken.
     *
     * @return void
     */
    public function setUp()
    {
        parent::setUp();
        $this->_originalLocator = TableRegistry::locator();
    }

    /**
     * tear down
     *
     * @return void
     */
    public function tearDown()
    {
        parent::tearDown();
        TableRegistry::locator($this->_originalLocator);
    }

    /**
     * Sets and returns mock LocatorInterface instance.
     *
     * @return Cake\ORM\Locator\LocatorInterface
     */
    protected function _setMockLocator()
    {
        $locator = $this->getMock('Cake\ORM\Locator\LocatorInterface');
        TableRegistry::locator($locator);

        return $locator;
    }

    /**
     * Test locator() method.
     *
     * @return void
     */
    public function testLocator()
    {
        $this->assertInstanceOf('Cake\ORM\Locator\LocatorInterface', TableRegistry::locator());

        $locator = $this->_setMockLocator();

        $this->assertSame($locator, TableRegistry::locator());
    }

    /**
     * Test that locator() method is returing TableLocator by default.
     *
     * @return void
     */
    public function testLocatorDefault()
    {
        $locator = TableRegistry::locator();
        $this->assertInstanceOf('Cake\ORM\Locator\TableLocator', $locator);
    }

    /**
     * Test config() method.
     *
     * @return void
     */
    public function testConfig()
    {
        $locator = $this->_setMockLocator();
        $locator->expects($this->once())->method('config')->with('Test', []);

        TableRegistry::config('Test', []);
    }

    /**
     * Test the get() method.
     *
     * @return void
     */
    public function testGet()
    {
        $locator = $this->_setMockLocator();
        $locator->expects($this->once())->method('get')->with('Test', []);

        TableRegistry::get('Test', []);
    }

    /**
     * Test the get() method.
     *
     * @return void
     */
    public function testSet()
    {
        $table = $this->getMock('Cake\ORM\Table');

        $locator = $this->_setMockLocator();
        $locator->expects($this->once())->method('set')->with('Test', $table);

        TableRegistry::set('Test', $table);
    }

    /**
     * Test the remove() method.
     *
     * @return void
     */
    public function testRemove()
    {
        $locator = $this->_setMockLocator();
        $locator->expects($this->once())->method('remove')->with('Test');

        TableRegistry::remove('Test');
    }

    /**
     * Test the clear() method.
     *
     * @return void
     */
    public function testClear()
    {
        $locator = $this->_setMockLocator();
        $locator->expects($this->once())->method('clear');

        TableRegistry::clear();
    }
}


text:
/**
 */
package gluemodel.CIM.IEC61970.Meas;

import org.eclipse.emf.common.util.EList;

/**
 *
 * A representation of the model object 'Accumulator'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link gluemodel.CIM.IEC61970.Meas.Accumulator#getAccumulatorValues Accumulator Values}

 *
{@link gluemodel.CIM.IEC61970.Meas.Accumulator#getMaxValue Max Value}

 *
{@link gluemodel.CIM.IEC61970.Meas.Accumulator#getLimitSets Limit Sets}

 *

 *
 * @see gluemodel.CIM.IEC61970.Meas.MeasPackage#getAccumulator()
 * @model annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Accumulator represents a accumulated (counted) Measurement, e.g. an energy value.'"
 *        annotation="http://langdale.com.au/2005/UML Profile\040documentation='Accumulator represents a accumulated (counted) Measurement, e.g. an energy value.'"
 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Accumulator represents a accumulated (counted) Measurement, e.g. an energy value.' Profile\040documentation='Accumulator represents a accumulated (counted) Measurement, e.g. an energy value.'"
 * @generated
 */
public interface Accumulator extends Measurement {
	/**
	 * Returns the value of the 'Accumulator Values' reference list.
	 * The list contents are of type {@link gluemodel.CIM.IEC61970.Meas.AccumulatorValue}.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61970.Meas.AccumulatorValue#getAccumulator Accumulator}'.
	 *
	 *

	 * If the meaning of the 'Accumulator Values' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Accumulator Values' reference list.
	 * @see gluemodel.CIM.IEC61970.Meas.MeasPackage#getAccumulator_AccumulatorValues()
	 * @see gluemodel.CIM.IEC61970.Meas.AccumulatorValue#getAccumulator
	 * @model opposite="Accumulator"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='The values connected to this measurement.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='The values connected to this measurement.'"
	 * @generated
	 */
	EList<AccumulatorValue> getAccumulatorValues();

	/**
	 * Returns the value of the 'Max Value' attribute.
	 *
	 *

	 * If the meaning of the 'Max Value' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Max Value' attribute.
	 * @see #setMaxValue(int)
	 * @see gluemodel.CIM.IEC61970.Meas.MeasPackage#getAccumulator_MaxValue()
	 * @model required="true"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values.'"
	 * @generated
	 */
	int getMaxValue();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61970.Meas.Accumulator#getMaxValue Max Value}' attribute.
	 *
	 *
	 * @param value the new value of the 'Max Value' attribute.
	 * @see #getMaxValue()
	 * @generated
	 */
	void setMaxValue(int value);

	/**
	 * Returns the value of the 'Limit Sets' reference list.
	 * The list contents are of type {@link gluemodel.CIM.IEC61970.Meas.AccumulatorLimitSet}.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61970.Meas.AccumulatorLimitSet#getMeasurements Measurements}'.
	 *
	 *

	 * If the meaning of the 'Limit Sets' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Limit Sets' reference list.
	 * @see gluemodel.CIM.IEC61970.Meas.MeasPackage#getAccumulator_LimitSets()
	 * @see gluemodel.CIM.IEC61970.Meas.AccumulatorLimitSet#getMeasurements
	 * @model opposite="Measurements"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='A measurement may have zero or more limit ranges defined for it.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='A measurement may have zero or more limit ranges defined for it.'"
	 * @generated
	 */
	EList<AccumulatorLimitSet> getLimitSets();

} // Accumulator


text:
import * as React from 'react';
import Tour, { Arrow, Badge, Close, Controls, CustomHelperProps, Dot, Navigation } from 'reactour';

class CustomTour extends React.Component<{}, { isTourOpen: boolean }> {
    ref = React.createRef<Tour>();

    state = {
        isTourOpen: false,
        update: '13213'
    };

    printTourStateForSomeReason = () => {
        if (this.ref.current) {
            const {
                inDOM,
                current,
                bottom,
                focusUnlocked,
                h,
                height,
                helperHeight,
                helperPosition,
                helperWidth,
                isOpen,
                left,
                observer,
                right,
                top,
                w,
                width
            } = this.ref.current.state;

            console.log(
                inDOM,
                current,
                bottom,
                focusUnlocked,
                h,
                height,
                helperHeight,
                helperPosition,
                helperWidth,
                isOpen,
                left,
                observer,
                right,
                top,
                w,
                width
            );
        }
    }

    render() {
        return (

                <button className="opener" onClick={() => this.setState({ isTourOpen: true })}>
                    Open
                </button>
                <Tour
                    ref={this.ref}
                    isOpen={this.state.isTourOpen}
                    steps={[
                        {
                            content:
Example

                        },
                        {
                            content: ({ close, goTo, inDOM, step }) => (

                                    <Close onClick={close} className="something" />
                                    <Controls className="im-a-div">
                                        <Arrow onClick={() => goTo(0)} label="Go to first step" />
                                        <Arrow
                                            className="hello"
                                            inverted
                                            onClick={() => goTo(2)}
                                            label={
Go to next step
}
                                        />
                                        <Arrow disabled onClick={() => console.log('do nothing')} />
                                    </Controls>
                                    <Navigation className="im-a-div">
                                        <Dot
                                            disabled
                                            current={1}
                                            index={0}
                                            showNumber
                                            accentColor="#000"
                                        />
                                    </Navigation>
                                    {inDOM ? 'Is in DOM' : 'Not in DOM'}, step: {step}

                            ),
                            selector: 'button.opener',
                            position: 'center',
                            stepInteraction: false,
                            style: {
                                display: 'flex'
                            },
                            action: (node: HTMLElement) => node.focus(),
                            navDotAriaLabel: 'Got to last step'
                        },
                        {
                            content: 'Last step',
                            observe: 'button.opener',
                            highlightedSelectors: ['button.opener'],
                            mutationObservables: ['button.opener'],
                            resizeObservables: ['button.opener']
                        }
                    ]}
                    onRequestClose={() => this.setState({ isTourOpen: false })}
                    accentColor="#f0123d"
                    badgeContent={(current, total) => (
                        <Badge accentColor="#f34">
                            {current} / {total}
                        </Badge>
                    )}
                    className="my-tour"
                    closeWithMask={false}
                    disableDotsNavigation={false}
                    disableInteraction
                    disableKeyboardNavigation={['esc']}
                    getCurrentStep={currentStep => console.log(currentStep)}
                    goToStep={4}
                    highlightedMaskClassName="mask-hi"
                    inViewThreshold={10}
                    lastStepNextButton={Finish}
                    maskClassName="mask"
                    maskSpace={10}
                    nextButton="Next"
                    nextStep={() => console.log('this would probably break something')}
                    onAfterOpen={target => target.focus()}
                    onBeforeClose={target => target.blur()}
                    prevButton="Prev"
                    prevStep={() => console.log("this would too but it's fine")}
                    rounded={3}
                    scrollDuration={100}
                    scrollOffset={1}
                    showNumber={false}
                    showButtons={false}
                    showCloseButton={false}
                    showNavigation={false}
                    showNavigationNumber={false}
                    startAt={1}
                    update={this.state.update}
                    updateDelay={2}
                    disableFocusLock={false}
                    accessibilityOptions={{
                        ariaLabelledBy: "Tour aria label",
                        closeButtonAriaLabel: "Close",
                        showNavigationScreenReaders: true
                    }}
                    CustomHelper={({ current, content, totalSteps, gotoStep, close }: CustomHelperProps) => (

                                {content}
                                <Controls
                                    data-tour-elem="controls"
                                    className="CustomHelper__controls"
                                    style={{ position: 'absolute' }}
                                >
                                    <Arrow
                                        onClick={() => gotoStep(current - 1)}
                                        disabled={current === 0}
                                        className="CustomHelper__navArrow"
                                    />
                                    <Navigation data-tour-elem="navigation">
                                        {Array.from(Array(totalSteps).keys()).map((li, i) => (
                                            <Dot
                                                key={li}
                                                onClick={() => current !== i && gotoStep(i)}
                                                current={current}
                                                index={i}
                                                disabled={current === i}
                                                showNumber
                                                data-tour-elem="dot"
                                            />
                                        ))}
                                    </Navigation>
                                    <Arrow
                                        onClick={() => gotoStep(current + 1)}
                                        disabled={current === totalSteps - 1}
                                        className="CustomHelper__navArrow"
                                        inverted
                                    />
                                </Controls>

                    )}
                >

Something

                </Tour>

        );
    }
}


text:
#include <assert.h>
#include "flash_map/flash_map.h"
#include "hal/hal_bsp.h"
#include "hal/hal_flash_int.h"
#include "os/os_malloc.h"
#include "nffs/nffs.h"
#include "nffs_priv.h"

/**
 * Determines if the file system contains a valid root directory.  For the root
 * directory to be valid, it must be present and have the following traits:
 *     o ID equal to NFFS_ID_ROOT_DIR.
 *     o No parent inode.
 *
 * @return                      0 if there is a valid root directory;
 *                              FS_ECORRUPT if there is not a valid root
 *                                  directory;
 *                              nonzero on other error.
 */
int
nffs_misc_validate_root_dir(void)
{
    struct nffs_inode inode;
    int rc;

    if (nffs_root_dir == NULL) {
        return FS_ECORRUPT;
    }

    if (nffs_root_dir->nie_hash_entry.nhe_id != NFFS_ID_ROOT_DIR) {
        return FS_ECORRUPT;
    }

    rc = nffs_inode_from_entry(&inode, nffs_root_dir);
    /*
     * nffs_root_dir is automatically flagged a "dummy" inode but it's special
     */
    if (rc != 0 && rc != FS_ENOENT) {
        return rc;
    }

    if (inode.ni_parent != NULL) {
        return FS_ECORRUPT;
    }

    return 0;
}

/**
 * Determines if the system contains a valid scratch area.  For a scratch area
 * to be valid, it must be at least as large as the other areas in the file
 * system.
 *
 * @return                      0 if there is a valid scratch area;
 *                              FS_ECORRUPT otherwise.
 */
int
nffs_misc_validate_scratch(void)
{
    uint32_t scratch_len;
    int i;

    if (nffs_scratch_area_idx == NFFS_AREA_ID_NONE) {
        /* No scratch area. */
        return FS_ECORRUPT;
    }

    scratch_len = nffs_areas[nffs_scratch_area_idx].na_length;
    for (i = 0; i < nffs_num_areas; i++) {
        if (nffs_areas[i].na_length > scratch_len) {
            return FS_ECORRUPT;
        }
    }

    return 0;
}

/**
 * Performs a garbage cycle to free up memory, if necessary.  This function
 * should be called repeatedly until either:
 *   o The subsequent allocation is successful, or
 *   o Garbage collection is not successfully performed (indicated by a return
 *     code other than FS_EAGAIN).
 *
 * This function determines if garbage collection is necessary by inspecting
 * the value of the supplied "resource" parameter.  If resource is null, that
 * implies that allocation failed.
 *
 * This function will not initiate garbage collection if all areas have already
 * been collected in an attempt to free memory for the allocation in question.
 *
 * @param resource              The result of the allocation attempt; null
 *                                  implies that garbage collection is
 *                                  necessary.
 * @param out_rc                The status of this operation gets written here.
 *                                   0: garbage collection was successful or
 *                                       unnecessary.
 *                                   FS_EFULL: Garbage collection was not
 *                                       performed because all areas have
 *                                       already been collected.
 *                                   Other nonzero: garbage collection failed.
 *
 * @return                      FS_EAGAIN if garbage collection was
 *                                  successfully performed and the allocation
 *                                  should be retried;
 *                              Other value if the allocation should not be
 *                                  retried; the value of the out_rc parameter
 *                                  indicates whether allocation was successful
 *                                  or there was an error.
 */
int
nffs_misc_gc_if_oom(void *resource, int *out_rc)
{
    /**
     * Keeps track of the number of repeated garbage collection cycles.
     * Necessary for ensuring GC stops after all areas have been collected.
     */
    static uint8_t total_gc_cycles;

    if (resource != NULL) {
        /* Allocation succeeded.  Reset cycle count in preparation for the next
         * allocation failure.
         */
        total_gc_cycles = 0;
        *out_rc = 0;
        return 0;
    }

    /* If every area has already been garbage collected, there is nothing else
     * that can be done ("- 1" to account for the scratch area).
     */
    if (total_gc_cycles >= nffs_num_areas - 1) {
        *out_rc = FS_ENOMEM;
        return 0;
    }

    /* Attempt a garbage collection on the next area. */
    *out_rc = nffs_gc(NULL);
    total_gc_cycles++;
    STATS_INC(nffs_stats, nffs_gccnt);
    if (*out_rc != 0) {
        return 0;
    }

    /* Indicate that garbage collection was successfully performed. */
    return 1;
}

/**
 * Reserves the specified number of bytes within the specified area.
 *
 * @param area_idx              The index of the area to reserve from.
 * @param space                 The number of bytes of free space required.
 * @param out_area_offset       On success, the offset within the area gets
 *                                  written here.
 *
 * @return                      0 on success;
 *                              FS_EFULL if the area has insufficient free
 *                                  space.
 */
static int
nffs_misc_reserve_space_area(uint8_t area_idx, uint16_t space,
                             uint32_t *out_area_offset)
{
    const struct nffs_area *area;
    uint32_t available;

    area = nffs_areas + area_idx;
    available = area->na_length - area->na_cur;
    if (available >= space) {
        *out_area_offset = area->na_cur;
        return 0;
    }

    return FS_EFULL;
}

/**
 * Finds an area that can accommodate an object of the specified size.  If no
 * such area exists, this function performs a garbage collection cycle.
 *
 * @param space                 The number of bytes of free space required.
 * @param out_area_idx          On success, the index of the suitable area gets
 *                                  written here.
 * @param out_area_offset       On success, the offset within the suitable area
 *                                  gets written here.
 *
 * @return                      0 on success; nonzero on failure.
 */
int
nffs_misc_reserve_space(uint16_t space,
                        uint8_t *out_area_idx, uint32_t *out_area_offset)
{
    uint8_t area_idx;
    int rc;
    int i;

    /* Find the first area with sufficient free space. */
    for (i = 0; i < nffs_num_areas; i++) {
        if (i != nffs_scratch_area_idx) {
            rc = nffs_misc_reserve_space_area(i, space, out_area_offset);
            if (rc == 0) {
                *out_area_idx = i;
                return 0;
            }
        }
    }

    /* No area can accommodate the request.  Garbage collect until an area
     * has enough space.
     */
    rc = nffs_gc_until(space, &area_idx);
    if (rc != 0) {
        return rc;
    }

    /* Now try to reserve space.  If insufficient space was reclaimed with
     * garbage collection, the above call would have failed, so this should
     * succeed.
     */
    rc = nffs_misc_reserve_space_area(area_idx, space, out_area_offset);
    assert(rc == 0);

    *out_area_idx = area_idx;

    return rc;
}

int
nffs_misc_set_num_areas(uint8_t num_areas)
{
    if (num_areas == 0) {
        free(nffs_areas);
        nffs_areas = NULL;
    } else {
        nffs_areas = realloc(nffs_areas, num_areas * sizeof *nffs_areas);
        if (nffs_areas == NULL) {
            return FS_ENOMEM;
        }
    }

    nffs_num_areas = num_areas;

    return 0;
}

/**
 * Calculates the data length of the largest block that could fit in an area of
 * the specified size.
 */
static uint32_t
nffs_misc_area_capacity_one(uint32_t area_length)
{
    return area_length -
           sizeof (struct nffs_disk_area) -
           sizeof (struct nffs_disk_block);
}

/**
 * Calculates the data length of the largest block that could fit as a pair in
 * an area of the specified size.
 */
static uint32_t
nffs_misc_area_capacity_two(uint32_t area_length)
{
    return (area_length - sizeof (struct nffs_disk_area)) / 2 -
           sizeof (struct nffs_disk_block);
}

/**
 * Calculates and sets the maximum block data length that the system supports.
 * The result of the calculation is the greatest number which satisfies all of
 * the following restrictions:
 *     o No more than half the size of the smallest area.
 *     o No more than 2048.
 *     o No smaller than the data length of any existing data block.
 *
 * @param min_size              The minimum allowed data length.  This is the
 *                                  data length of the largest block currently
 *                                  in the file system.
 *
 * @return                      0 on success; nonzero on failure.
 */
int
nffs_misc_set_max_block_data_len(uint16_t min_data_len)
{
    uint32_t smallest_area;
    uint32_t half_smallest;
    int i;

    smallest_area = -1;
    for (i = 0; i < nffs_num_areas; i++) {
        if (nffs_areas[i].na_length < smallest_area) {
            smallest_area = nffs_areas[i].na_length;
        }
    }

    /* Don't allow a data block size bigger than the smallest area. */
    if (nffs_misc_area_capacity_one(smallest_area) < min_data_len) {
        return FS_ECORRUPT;
    }

    half_smallest = nffs_misc_area_capacity_two(smallest_area);
    if (half_smallest < NFFS_BLOCK_MAX_DATA_SZ_MAX) {
        nffs_block_max_data_sz = half_smallest;
    } else {
        nffs_block_max_data_sz = NFFS_BLOCK_MAX_DATA_SZ_MAX;
    }

    if (nffs_block_max_data_sz < min_data_len) {
        nffs_block_max_data_sz = min_data_len;
    }

    return 0;
}

int
nffs_misc_create_lost_found_dir(void)
{
    int rc;

    rc = nffs_path_new_dir("/lost+found", &nffs_lost_found_dir);
    switch (rc) {
    case 0:
        return 0;

    case FS_EEXIST:
        rc = nffs_path_find_inode_entry("/lost+found", &nffs_lost_found_dir);
        return rc;

    default:
        return rc;
    }
}

/**
 * Fully resets the nffs RAM representation.
 *
 * @return                      0 on success; nonzero on failure.
 */
int
nffs_misc_reset(void)
{
    int rc;

    nffs_cache_clear();

    rc = os_mempool_init(&nffs_file_pool, nffs_config.nc_num_files,
                         sizeof (struct nffs_file), nffs_file_mem,
                         "nffs_file_pool");
    if (rc != 0) {
        return FS_EOS;
    }

    rc = os_mempool_init(&nffs_inode_entry_pool, nffs_config.nc_num_inodes,
                         sizeof (struct nffs_inode_entry), nffs_inode_mem,
                         "nffs_inode_entry_pool");
    if (rc != 0) {
        return FS_EOS;
    }

    rc = os_mempool_init(&nffs_block_entry_pool, nffs_config.nc_num_blocks,
                         sizeof (struct nffs_hash_entry), nffs_block_entry_mem,
                         "nffs_block_entry_pool");
    if (rc != 0) {
        return FS_EOS;
    }

    rc = os_mempool_init(&nffs_cache_inode_pool,
                         nffs_config.nc_num_cache_inodes,
                         sizeof (struct nffs_cache_inode),
                         nffs_cache_inode_mem, "nffs_cache_inode_pool");
    if (rc != 0) {
        return FS_EOS;
    }

    rc = os_mempool_init(&nffs_cache_block_pool,
                         nffs_config.nc_num_cache_blocks,
                         sizeof (struct nffs_cache_block),
                         nffs_cache_block_mem, "nffs_cache_block_pool");
    if (rc != 0) {
        return FS_EOS;
    }

    rc = os_mempool_init(&nffs_dir_pool,
                         nffs_config.nc_num_dirs,
                         sizeof (struct nffs_dir),
                         nffs_dir_mem, "nffs_dir_pool");
    if (rc != 0) {
        return FS_EOS;
    }

    rc = nffs_hash_init();
    if (rc != 0) {
        return rc;
    }

    free(nffs_areas);
    nffs_areas = NULL;
    nffs_num_areas = 0;

    nffs_root_dir = NULL;
    nffs_lost_found_dir = NULL;
    nffs_scratch_area_idx = NFFS_AREA_ID_NONE;

    nffs_hash_next_file_id = NFFS_ID_FILE_MIN;
    nffs_hash_next_dir_id = NFFS_ID_DIR_MIN;
    nffs_hash_next_block_id = NFFS_ID_BLOCK_MIN;

    return 0;
}

/**
 * Indicates whether a valid filesystem has been initialized, either via
 * detection or formatting.
 *
 * @return                  1 if a file system is present; 0 otherwise.
 */
int
nffs_misc_ready(void)
{
    return nffs_root_dir != NULL;
}

/*
 * Turn flash region into a set of areas for NFFS use.
 *
 * Limit the number of regions we return to be less than *cnt.
 * If sector count within region exceeds that, collect multiple sectors
 * to a region.
 */
int
nffs_misc_desc_from_flash_area(int id, int *cnt, struct nffs_area_desc *nad)
{
    int i, j;
    const struct hal_flash *hf;
    const struct flash_area *fa;
    int max_cnt, move_on;
    int first_idx, last_idx;
    uint32_t start, size;
    uint32_t min_size;
    int rc;

    first_idx = last_idx = -1;
    max_cnt = *cnt;
    *cnt = 0;

    rc = flash_area_open(id, &fa);
    if (rc != 0) {
        return -1;
    }

    hf = hal_bsp_flash_dev(fa->fa_device_id);
    for (i = 0; i < hf->hf_sector_cnt; i++) {
        hf->hf_itf->hff_sector_info(hf, i, &start, &size);
        if (start >= fa->fa_off && start < fa->fa_off + fa->fa_size) {
            if (first_idx == -1) {
                first_idx = i;
            }
            last_idx = i;
            *cnt = *cnt + 1;
        }
    }
    if (*cnt > max_cnt) {
        min_size = fa->fa_size / max_cnt;
    } else {
        min_size = 0;
    }
    *cnt = 0;

    move_on = 1;
    for (i = first_idx, j = 0; i < last_idx + 1; i++) {
        hf->hf_itf->hff_sector_info(hf, i, &start, &size);
        if (move_on) {
            nad[j].nad_flash_id = fa->fa_device_id;
            nad[j].nad_offset = start;
            nad[j].nad_length = size;
            *cnt = *cnt + 1;
            move_on = 0;
        } else {
            nad[j].nad_length += size;
        }
        if (nad[j].nad_length >= min_size) {
            j++;
            move_on = 1;
        }
    }
    nad[*cnt].nad_length = 0;
    return 0;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="AppBundle\Entity\AgencyDocuments" table="agency_documents">
    <indexes>
      <index name="index2" columns="agency_id"/>
    </indexes>
    <unique-constraints>
      <unique-constraint name="agency_id_UNIQUE" columns="agency_id"/>
    </unique-constraints>
    <id name="id" type="integer" column="id">
      <generator strategy="IDENTITY"/>
    </id>
    <field name="certidaoPermanente" type="string" column="certidao_permanente" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="cartaoCidadao01" type="string" column="cartao_cidadao_01" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="cartaoCidadao02" type="string" column="cartao_cidadao_02" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="cartaoCidadao03" type="string" column="cartao_cidadao_03" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="comprovativoMorada01" type="string" column="comprovativo_morada_01" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="comprovativoMorada02" type="string" column="comprovativo_morada_02" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="comprovativoMorada03" type="string" column="comprovativo_morada_03" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="autorizacaoConsulta" type="string" column="autorizacao_consulta" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="ultimoBeneficiario" type="string" column="ultimo_beneficiario" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="acordoParceria" type="string" column="acordo_parceria" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>

    <field name="updatedAt" type="datetime" column="updated_at" nullable="true"/>

<!--    <many-to-one field="agency" target-entity="Tagency" fetch="LAZY">
      <join-columns>
        <join-column name="agency_id" referenced-column-name="FAgencyID"/>
      </join-columns>
    </many-to-one>-->

        <one-to-one field="agency" target-entity="Tagency" inversed-by="agencyDocuments">
            <join-column name="agency_id" referenced-column-name="FAgencyID" />
        </one-to-one>

  </entity>
</doctrine-mapping>


text:
using SimpleJson;
using System;
using Pomelo.DotNetClient;
using UnityEngine;

public class PushManager : Singleton<PushManager>
{
	public void Init ()
	{
		this.Register (ProtocolEvent.ON_ROLE_CHANGE, RolePush.OnRole);
		this.Register (ProtocolEvent.ON_BUILD_CHANGE, BuildPush.OnBuild);
	}

	private void Register (string eventName, Action<JsonObject> action)
	{
		PomeloManager.Instance.Pclient.On (eventName, action);
	}
}


text:
package com.chen.web.api.schedule;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.chen.entity.Account;
import com.chen.entity.Schedule;
import com.chen.service.ScheduleService;
import com.chen.service.SortService;
import com.chen.web.Controller;
import com.google.gson.Gson;
import com.mysql.jdbc.StringUtils;

@WebServlet("/api/schedule/list.do")
public class ListServlet extends Controller{

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		Account account = (Account) request.getSession().getAttribute("account");
		SortService ss = new SortService();
		String cust = request.getParameter("custid");
		Long custid = null;
		if(org.apache.commons.lang3.StringUtils.isNumeric(cust)){
			custid = Long.valueOf(cust);
		}else{
			Map<String, Object>map = new HashMap<String, Object>();
			map.put("result", "error");
			renderJson(response, map);
			return;
		}
		ScheduleService chs = new ScheduleService();

		Map<String,List<Schedule>> schedules = chs.findUndoByCustid(custid ,getNowtime());
		//request.setAttribute("overList", unoverList);

		response.setContentType("application/json; charset=UTF-8");
		Gson gson = new Gson();
		String json =  gson.toJson(schedules);
		print(json, response);
	}

}


text:
package com.yunikov.algorithms.graphs;

import java.util.*;

/**
 * Representation of a graph.
 */
public class Graph {

    private final Map<Integer, Vertex> vertices = new HashMap<>();

    private final List<Edge> edges = new ArrayList<>();

    /**
     * Creates the graph from two dimensional array.
     *
     * @param array array to create a graph from
     * @return created graph
     */
    public static Graph createGraph(final int[][] array) {
        final Graph graph = new Graph();

        for (int i = 0; i < array.length; i++) {
            final Vertex currentVertex = graph.getVertexOrAdd(i);

            for (int edgeTo : array[i]) {
                final Vertex secondVertex = graph.getVertexOrAdd(edgeTo);
                final Optional<Edge> edge = secondVertex.getEdgeTo(currentVertex);

                if(!edge.isPresent()) {
                    graph.createEdge(currentVertex, secondVertex);
                }
            }
        }

        return graph;
    }

    /**
     * Creates edge in the graph from firstVertex to secondVertex.
     *
     * @param firstVertex one end of edge
     * @param secondVertex second end of edge
     * @param weight weight of edge
     * @return created edge
     */
    public Edge createEdge(final Vertex firstVertex, final Vertex secondVertex, final int weight) {
        final Edge edge = new Edge(firstVertex, secondVertex, weight);

        getEdges().add(edge);
        firstVertex.addEdge(edge);
        secondVertex.addEdge(edge);

        return edge;
    }

    /**
     * Creates edge in the graph from firstVertex to secondVertex.
     *
     * @param firstVertex one end of edge
     * @param secondVertex second end of edge
     * @return created edge
     */
    public Edge createEdge(final Vertex firstVertex, final Vertex secondVertex) {
        return createEdge(firstVertex, secondVertex, 0);
    }

    /**
     * Adds a vertex to a graph.
     *
     * @param v vertex to add
     */
    public void addVertex(final Vertex v) {
        vertices.put(v.getLabel(), v);
    }

    /**
     * Gets the vertex by label or add the new vertex with such label if it is not found.
     *
     * @param label vertex label
     * @return vertex with specified label
     */
    public Vertex getVertexOrAdd(final int label) {
        final Vertex vertexByLabel = vertices.get(label);
        if (vertexByLabel != null) {
            return vertexByLabel;
        }

        final Vertex newVertex = new Vertex(label);
        addVertex(newVertex);

        return newVertex;
    }

    /**
     * Gets the vertex by label or returns empty optional if it is not found.
     *
     * @param label vertex label
     * @return vertex with specified label or empty if not found
     */
    public Optional<Vertex> getVertex(final int label) {
        final Vertex vertexByLabel = vertices.get(label);
        if (vertexByLabel != null) {
            return Optional.of(vertexByLabel);
        }

        return Optional.empty();
    }

    /**
     * Gets the list of graph edges.
     *
     * @return list of graph edges
     */
    public List<Edge> getEdges() {
        return edges;
    }

    /**
     * Gets the map of graph vertices containing labels as keys and vertices as values.
     *
     * @return map of graph vertices
     */
    public Map<Integer, Vertex> getVertices() {
        return vertices;
    }
}


text:
EasyMailPreview::Engine.routes.draw do
  root :to => 'emails#index'
  match "/emails/show/:id" => "emails#show"
end


text:
using System;

namespace Subtext.Framework.Exceptions
{
    /// <summary>
    /// Exception thrown when attempting to visit a blog that is no longer active.
    /// </summary>
    [Serializable]
    public class BlogInactiveException : BaseBlogConfigurationException
    {
    }
}


text:
<?php defined('COREPATH') or exit('No direct script access allowed'); ?>

WARNING - 2013-12-12 05:58:46 --> Fuel\Core\Fuel::init - The configured locale en_US is not installed on your system.
WARNING - 2013-12-12 05:58:47 --> Fuel\Core\Fuel::init - The configured locale en_US is not installed on your system.
WARNING - 2013-12-12 05:58:52 --> Fuel\Core\Fuel::init - The configured locale en_US is not installed on your system.
WARNING - 2013-12-12 05:58:52 --> Fuel\Core\Fuel::init - The configured locale en_US is not installed on your system.
WARNING - 2013-12-12 06:27:02 --> Fuel\Core\Fuel::init - The configured locale en_US is not installed on your system.
WARNING - 2013-12-12 06:27:05 --> Fuel\Core\Fuel::init - The configured locale en_US is not installed on your system.
WARNING - 2013-12-12 06:27:06 --> Fuel\Core\Fuel::init - The configured locale en_US is not installed on your system.


text:
package application.Models;

import application.Views.TransitableView;

/**
 *
 */
public class TransitableValue {

    int currentValue;
    int startValue;
    int endValue;
    long time;
    long currentTime;

    TransitableView transitableView;

    int animationOrder;

    public TransitableValue(int startValue, int endValue, long time, TransitableView transitableView) {
        this.startValue = startValue;
        this.endValue = endValue;
        this.transitableView = transitableView;
        this.time = time;

        currentValue = this.startValue;

    }

    public int getGravitySpeed() {
//        int
        return 0;
    }
}


text:
package better.files

import akka.actor._

/** An actor that can watch a file or a directory
  * Instead of directly calling the constructor of this, call file.newWatcher to create the actor
  *
  * @param file     watch this file (or directory)
  * @param maxDepth In case of directories, how much depth should we watch
  */
class FileWatcher(file: File, maxDepth: Int) extends Actor {
  import FileWatcher._

  def this(file: File, recursive: Boolean = true) = this(file, if (recursive) Int.MaxValue else 0)

  protected[this] val callbacks = newMultiMap[Event, Callback]

  protected[this] val monitor: File.Monitor = new FileMonitor(file, maxDepth) {
    override def onEvent(event: Event, file: File, count: Int) = self ! Message.NewEvent(event, file, count)
    override def onException(exception: Throwable)             = self ! Status.Failure(exception)
  }

  override def preStart() = monitor.start()(executionContext = context.dispatcher)

  override def receive = {
    case Message.NewEvent(event, target, count) if callbacks.contains(event) =>
      callbacks(event).foreach(f => repeat(count)(f(event -> target)))
    case Message.RegisterCallback(events, callback) => events.foreach(event => callbacks.addBinding(event, callback))
    case Message.RemoveCallback(event, callback)    => callbacks.removeBinding(event, callback)
  }

  override def postStop() = monitor.stop()
}

object FileWatcher {
  import java.nio.file.{Path, WatchEvent}

  type Event    = WatchEvent.Kind[Path]
  type Callback = PartialFunction[(Event, File), Unit]

  sealed trait Message
  object Message {
    case class NewEvent(event: Event, file: File, count: Int)                   extends Message
    case class RegisterCallback(events: Traversable[Event], callback: Callback) extends Message
    case class RemoveCallback(event: Event, callback: Callback)                 extends Message
  }

  implicit val disposeActorSystem: Disposable[ActorSystem] =
    Disposable(_.terminate())

  implicit class FileWatcherOps(file: File) {
    def watcherProps(recursive: Boolean): Props =
      Props(new FileWatcher(file, recursive))

    def newWatcher(recursive: Boolean = true)(implicit system: ActorSystem): ActorRef =
      system.actorOf(watcherProps(recursive))
  }

  def when(events: Event*)(callback: Callback): Message =
    Message.RegisterCallback(events, callback)

  def on(event: Event)(callback: File => Unit): Message =
    when(event) { case (`event`, file) => callback(file) }

  def stop(event: Event, callback: Callback): Message =
    Message.RemoveCallback(event, callback)
}


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28651_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                »

    <p class="styleSans23.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">gyrodata
Gyrodata Incorporated 301 Thelma Dr. #413 Casper, Wyoming 82601
307-472-0182 Fax: 307-472-0204

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">DIRECTIONAL SURVEY CERTIFICATION

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Kline Federal 5300 41-18 9T (Well Name & No.)
8.21 {Maggetic Declination)

    <p class="styleSans13.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Surveyor: Blake Hunter
I, Kristopher Bertsch ,having personal knowledge of all the facts, hereby certify

    <p class="styleSans13.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">that the attached directional survey run from measured depth of 140 feet to a
measured depth of 20661 feet and is projected to 20742 feet, is true and correct as

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">determined from all available records.

    <p class="styleSans15.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Signature

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">*All measurements recorded with a manned MWD Survey T001.

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Serving the Worldwide Energy |ndustry with Precision Survey Instrumentation

    <p class="styleSans13.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Oasis Petroleum (Operator)

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">MWD Coordinator Title

    <p class="styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Gflodata, Inc. Company


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

<TITLE>
OFQueueStatisticsReply
</TITLE>

<META NAME="date" CONTENT="2013-08-27">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.openflow.protocol.statistics

Class OFQueueStatisticsReply

java.lang.Object
  org.openflow.protocol.statistics.OFQueueStatisticsReply

All Implemented Interfaces:
OFStatistics

public class OFQueueStatisticsReply
extends java.lang.Object
implements OFStatistics

Represents an ofp_queue_stats structure

Author:

David Erickson (daviderickson@cs.stanford.edu)

Field Summary

protected  short
portNumber

protected  int
queueId

protected  long
transmitBytes

protected  long
transmitErrors

protected  long
transmitPackets

Constructor Summary

OFQueueStatisticsReply()

Method Summary

 boolean
equals(java.lang.Object obj)

 int
getLength()

          Returns the wire length of this message in bytes

 short
getPortNumber()

 int
getQueueId()

 long
getTransmitBytes()

 long
getTransmitErrors()

 long
getTransmitPackets()

 int
hashCode()

 void
readFrom(org.jboss.netty.buffer.ChannelBuffer data)

          Read this message off the wire from the specified ByteBuffer

 void
setPortNumber(short portNumber)

 void
setQueueId(int queueId)

 void
setTransmitBytes(long transmitBytes)

 void
setTransmitErrors(long transmitErrors)

 void
setTransmitPackets(long transmitPackets)

 void
writeTo(org.jboss.netty.buffer.ChannelBuffer data)

          Write this message's binary format to the specified ByteBuffer

Methods inherited from class java.lang.Object

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

Field Detail

portNumber

protected short portNumber

queueId

protected int queueId

transmitBytes

protected long transmitBytes

transmitPackets

protected long transmitPackets

transmitErrors

protected long transmitErrors

Constructor Detail

OFQueueStatisticsReply

public OFQueueStatisticsReply()

Method Detail

getPortNumber

public short getPortNumber()

Returns:
the portNumber

setPortNumber

public void setPortNumber(short portNumber)

Parameters:
portNumber - the portNumber to set

getQueueId

public int getQueueId()

Returns:
the queueId

setQueueId

public void setQueueId(int queueId)

Parameters:
queueId - the queueId to set

getTransmitBytes

public long getTransmitBytes()

Returns:
the transmitBytes

setTransmitBytes

public void setTransmitBytes(long transmitBytes)

Parameters:
transmitBytes - the transmitBytes to set

getTransmitPackets

public long getTransmitPackets()

Returns:
the transmitPackets

setTransmitPackets

public void setTransmitPackets(long transmitPackets)

Parameters:
transmitPackets - the transmitPackets to set

getTransmitErrors

public long getTransmitErrors()

Returns:
the transmitErrors

setTransmitErrors

public void setTransmitErrors(long transmitErrors)

Parameters:
transmitErrors - the transmitErrors to set

getLength

public int getLength()

Description copied from interface: OFStatistics

Returns the wire length of this message in bytes

Specified by:
getLength in interface OFStatistics

Returns:
the length

readFrom

public void readFrom(org.jboss.netty.buffer.ChannelBuffer data)

Description copied from interface: OFStatistics

Read this message off the wire from the specified ByteBuffer

Specified by:
readFrom in interface OFStatistics

writeTo

public void writeTo(org.jboss.netty.buffer.ChannelBuffer data)

Description copied from interface: OFStatistics

Write this message's binary format to the specified ByteBuffer

Specified by:
writeTo in interface OFStatistics

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:skos="http://www.w3.org/2004/02/skos/core#"
>
  <rdf:Description rdf:about="http://id.trees.org/1">
    <skos:inScheme rdf:resource="urn:x-skosprovider:tree"/>
    <dcterms:identifier>1</dcterms:identifier>
    <skos:prefLabel xml:lang="en">The Larch</skos:prefLabel>
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
    <skos:definition xml:lang="en">A type of tree.</skos:definition>
    <skos:definition rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"><![CDATA[
Een soort boom.
]]></skos:definition>
    <skos:prefLabel xml:lang="nl">De Lariks</skos:prefLabel>
    <dcterms:source>
        <dcterms:BibliographicResource>
            <dcterms:bibliographicCitation>Monthy Python. Episode Three: How to recognise different types of trees from quite a long way away.</dcterms:bibliographicCitation>
        </dcterms:BibliographicResource>
    </dcterms:source>
    <skos:exactMatch>https://id.erfgoed.net/thesauri/soorten/666</skos:exactMatch>
  </rdf:Description>
  <rdf:Description rdf:about="http://id.trees.org/3">
    <dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">3</dcterms:identifier>
    <skos:member rdf:resource="http://id.trees.org/2"/>
    <skos:prefLabel xml:lang="nl">Bomen per soort</skos:prefLabel>
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Collection"/>
    <skos:inScheme rdf:resource="urn:x-skosprovider:tree"/>
    <skos:member rdf:resource="http://id.trees.org/1"/>
    <skos:prefLabel xml:lang="en">Trees by species</skos:prefLabel>
  </rdf:Description>
  <rdf:Description rdf:about="http://id.trees.org/2">
    <skos:altLabel xml:lang="nl">De Paardekastanje</skos:altLabel>
    <skos:inScheme rdf:resource="urn:x-skosprovider:tree"/>
    <skos:altLabel xml:lang="fr">la châtaigne</skos:altLabel>
    <skos:prefLabel xml:lang="en">The Chestnut</skos:prefLabel>
    <skos:definition rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"><![CDATA[
A different type of tree.
]]></skos:definition>
    <skos:definition rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"><![CDATA[Een ander soort boom.]]></skos:definition>
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
    <dc:identifier>2</dc:identifier>
    <dcterms:source>
        <dcterms:BibliographicResource>
            <dcterms:bibliographicCitation rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"><![CDATA[Monthy Python. Episode Three: How to recognise different types of trees from quite a long way away.]]></dcterms:bibliographicCitation>
        </dcterms:BibliographicResource>
    </dcterms:source>
    <skos:closeMatch>https://id.erfgoed.net/thesauri/soorten/85</skos:closeMatch>
  </rdf:Description>
</rdf:RDF>


text:
module Mongoid
  module Archivable
    # loops through all fields on document, as well as on its embedded relations
    # and makes sure all attributes that belong to localized fields are assigned
    # via their *_translations writer
    class ProcessLocalizedFields < Struct.new(:cls, :attrs)
      def self.call(*args)
        new(*args).call
      end

      def initialize(cls, attrs = {})
        super(cls, attrs)
      end

      def call
        attrs = convert_fields

        embedded_relations.each do |relation|
          relation_name = relation.name.to_s

          # convert embeds_many
          if attrs[relation_name].is_a?(Array)
            attrs[relation_name] = attrs[relation_name].map do |att|
              relation_class = Hash[att].fetch('_type', relation.class_name).constantize
              ProcessLocalizedFields.call(relation_class, Hash[att])
            end
          # convert embeds_one
          elsif att = attrs[relation_name]
            relation_class = Hash[att].fetch('_type', relation.class_name).constantize
            attrs[relation_name] = ProcessLocalizedFields.call(relation_class, Hash[att])
          end
        end

        attrs
      end

      private

      def localized_fields
        cls.fields.values.select(&:localized?)
      end

      def localized_field_names
        localized_fields.map(&:name)
      end

      def convert_fields
        attrs.map do |name, value|
          if localized_field_names.include?(name.to_s)
            name = "#{name}_translations"
          end
          [name, value]
        end.to_h
      end

      def embedded_relations
        cls.relations.values.select(&:embedded?)
      end
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class xmlns="http://xml.phpdox.net/src" full="AMQPEnvelope" namespace="" name="AMQPEnvelope">
  <method name="getAppId" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message appid"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getBody" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message body"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getContentEncoding" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message contentencoding"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getContentType" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message contenttype"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getCorrelationId" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message correlation id"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getDeliveryTag" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message delivery tag"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getExchange" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message exchange"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getExpiration" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message expiration"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getHeader" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get a specific message header"/>
      <return type="string"/>
    </docblock>
    <parameter name="header_key" optional="false" byreference="false" type="string"/>
  </method>
  <method name="getHeaders" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message headers"/>
      <return type="array"/>
    </docblock>
  </method>
  <method name="getMessageId" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message id"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getPriority" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message priority"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getReplyTo" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message replyto"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getRoutingKey" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message routing key"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getTimeStamp" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message timestamp"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getType" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message type"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="getUserId" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Get the message user id"/>
      <return type="string"/>
    </docblock>
  </method>
  <method name="isRedelivery" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="Whether this is a redelivery of the message"/>
      <return type="bool"/>
    </docblock>
  </method>
</class>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApp.Models
{
    public enum HousingCallType
    {
        Invalid,
        Verified,
        DontAnswer,
        NotAvailable,
        CorrectedWithoutCall
    }

}


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

    <gradient
        android:angle="90.0"
        android:endColor="@color/transparent"
        android:startColor="#77b7b0b7" />

</shape>


text:
<?php

if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') == false) {
      header("Location: error.php");
    }
?>
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>绑定成功</title>
<link rel="stylesheet" href="./css/weui.css">
<link rel="stylesheet" href="./css/example.css">

绑定成功

请点击确定关闭本页面,再次查询发送指令

                            确定


text:
package org.apache.sysds.test.functions.mlcontext;

import static org.apache.sysds.api.mlcontext.ScriptFactory.dmlFromFile;

import java.io.File;

import org.apache.spark.sql.SparkSession;
import org.junit.After;
import org.junit.Test;
import org.apache.sysds.api.DMLScript;
import org.apache.sysds.common.Types.ExecMode;
import org.apache.sysds.runtime.controlprogram.ParForProgramBlock;
import org.apache.sysds.api.mlcontext.MLContext;
import org.apache.sysds.api.mlcontext.Matrix;
import org.apache.sysds.api.mlcontext.Script;
import org.apache.sysds.test.AutomatedTestBase;
import org.apache.sysds.test.TestUtils;

@net.jcip.annotations.NotThreadSafe
public class MLContextScratchCleanupTest extends AutomatedTestBase
{
	private final static String TEST_DIR = "functions/mlcontext";
	private final static String TEST_NAME = "MLContextScratchCleanup";

	private final static int rows = 1123;
	private final static int cols = 789;

	@Override
	public void setUp() {
		TestUtils.clearAssertionInformation();
		addTestConfiguration(TEST_DIR, TEST_NAME);
		getAndLoadTestConfiguration(TEST_NAME);
	}

	@Test
	public void testMLContextMultipleScriptsCP() {
		runMLContextTestMultipleScript(ExecMode.SINGLE_NODE, false);
	}

	@Test
	public void testMLContextMultipleScriptsHybrid() {
		runMLContextTestMultipleScript(ExecMode.HYBRID, false);
	}

	@Test
	public void testMLContextMultipleScriptsSpark() {
		runMLContextTestMultipleScript(ExecMode.SPARK, false);
	}

	@Test
	public void testMLContextMultipleScriptsWithReadCP() {
		runMLContextTestMultipleScript(ExecMode.SINGLE_NODE, true);
	}

	@Test
	public void testMLContextMultipleScriptsWithReadHybrid() {
		runMLContextTestMultipleScript(ExecMode.HYBRID, true);
	}

	@Test
	public void testMLContextMultipleScriptsWithReadSpark() {
		runMLContextTestMultipleScript(ExecMode.SPARK, true);
	}

	private static void runMLContextTestMultipleScript(ExecMode platform, boolean wRead)
	{
		ExecMode oldplatform = DMLScript.getGlobalExecMode();
		DMLScript.setGlobalExecMode(platform);

		//create mlcontext
		SparkSession spark = createSystemDSSparkSession("MLContextScratchCleanupTest", "local");
		MLContext ml = new MLContext(spark);

		String dml1 = baseDirectory + File.separator + "ScratchCleanup1.dml";
		String dml2 = baseDirectory + File.separator + (wRead?"ScratchCleanup2b.dml":"ScratchCleanup2.dml");
		boolean broadcastOld = ParForProgramBlock.ALLOW_BROADCAST_INPUTS;
		ParForProgramBlock.ALLOW_BROADCAST_INPUTS = false;

		try
		{
			Script script1 = dmlFromFile(dml1).in("$rows", rows).in("$cols", cols).out("X");
			Matrix X = ml.execute(script1).getMatrix("X");

			//clear in-memory/cached data to emulate on-disk storage
			X.toMatrixObject().clearData();

			Script script2 = dmlFromFile(dml2).in("X", X).out("z");
			String z = ml.execute(script2).getString("z");
			System.out.println(z);
		}
		catch(Exception ex) {
			throw new RuntimeException(ex);
		}
		finally {
			DMLScript.setGlobalExecMode(oldplatform);
			ParForProgramBlock.ALLOW_BROADCAST_INPUTS = broadcastOld;

			// stop underlying spark context to allow single jvm tests (otherwise the
			// next test that tries to create a SparkContext would fail)
			spark.stop();
			// clear status mlcontext and spark exec context
			ml.close();
		}
	}

	@After
	@Override
	public void tearDown() {
		super.tearDown();
	}
}