text:
var assert = require('assert');
var approx = require('../../../tools/approx');
var math = require('../../../index');
var Node = math.expression.node.Node;
var ConstantNode = math.expression.node.ConstantNode;
var SymbolNode = math.expression.node.SymbolNode;
var RangeNode = math.expression.node.RangeNode;
var AssignmentNode = math.expression.node.AssignmentNode;
var OperatorNode = math.expression.node.OperatorNode;
var BlockNode = math.expression.node.BlockNode;
var ResultSet = math.type.ResultSet;

describe('BlockNode', function() {

  it ('should create a BlockNode', function () {
    var n = new BlockNode([]);
    assert(n instanceof BlockNode);
    assert(n instanceof Node);
    assert.equal(n.type, 'BlockNode');
  });

  it ('should have isBlockNode', function () {
    var node = new BlockNode([]);
    assert(node.isBlockNode);
  });

  it ('should throw an error when calling without new operator', function () {
    assert.throws(function () {BlockNode()}, SyntaxError);
  });

  it ('should throw an error when adding invalid blocks', function () {
    assert.throws(function () {new BlockNode()}, /Array expected/);
    assert.throws(function () {new BlockNode([2])}, /Property "node" must be a Node/);
    assert.throws(function () {new BlockNode([{node: 2, visible:true}])}, /Property "node" must be a Node/);
    assert.throws(function () {new BlockNode([{node: new Node(), visible: 2}])}, /Property "visible" must be a boolean/);
  });

  it ('should compile and evaluate a BlockNode', function () {
    var n = new BlockNode([
      {
        node: new ConstantNode(5),
        visible: true
      },
      {
        node: new AssignmentNode('foo', new ConstantNode(3)),
        visible: false
      },
      {
        node: new SymbolNode('foo'),
        visible: true
      }
    ]);

    var scope = {};
    assert.deepEqual(n.compile().eval(scope), new ResultSet([5, 3]));
    assert.deepEqual(scope, {foo: 3});
  });

  it ('expressions should be visible by default', function () {
    var n = new BlockNode([
      {node: new ConstantNode(5)}
    ]);

    assert.deepEqual(n.compile().eval(), new ResultSet([5]));
  });

  it ('should filter a BlockNode', function () {
    var a = new ConstantNode(5);
    var b2 = new ConstantNode(3);
    var b = new AssignmentNode('foo', b2);
    var c = new SymbolNode('foo');
    var d = new BlockNode([
      {node: a, visible: true},
      {node: b, visible: false},
      {node: c, visible: true}
    ]);

    assert.deepEqual(d.filter(function (node) {return node instanceof BlockNode}),     [d]);
    assert.deepEqual(d.filter(function (node) {return node instanceof SymbolNode}),    [c]);
    assert.deepEqual(d.filter(function (node) {return node instanceof RangeNode}),     []);
    assert.deepEqual(d.filter(function (node) {return node instanceof ConstantNode}),  [a, b2]);
    assert.deepEqual(d.filter(function (node) {return node instanceof ConstantNode && node.value == '3'}),  [b2]);
  });

  it ('should run forEach on a BlockNode', function () {
    // [x, 2]
    var x = new SymbolNode('x');
    var two = new ConstantNode(2);
    var c = new OperatorNode('+', 'add', [two, x]);
    var a = new BlockNode([
      {node: x},
      {node: c}
    ]);

    var nodes = [];
    var paths = [];
    a.forEach(function (node, path, parent) {
      nodes.push(node);
      paths.push(path);
      assert.strictEqual(parent, a);
    });

    assert.equal(nodes.length, 2);
    assert.strictEqual(nodes[0], x);
    assert.strictEqual(nodes[1], c);
    assert.deepEqual(paths, ['blocks[0].node', 'blocks[1].node']);
  });

  it ('should map a BlockNode', function () {
    // [x, 2]
    var x = new SymbolNode('x');
    var two = new ConstantNode(2);
    var c = new OperatorNode('+', 'add', [two, x]);
    var a = new BlockNode([
      {node: x},
      {node: c}
    ]);

    var nodes = [];
    var paths = [];
    var d = new ConstantNode(3);
    var e = a.map(function (node, path, parent) {
      nodes.push(node);
      paths.push(path);
      assert.strictEqual(parent, a);
      return node instanceof SymbolNode && node.name == 'x' ? d : node;
    });

    assert.equal(nodes.length, 2);
    assert.strictEqual(nodes[0], x);
    assert.strictEqual(nodes[1], c);
    assert.deepEqual(paths, ['blocks[0].node', 'blocks[1].node']);

    assert.notStrictEqual(e, a);
    assert.strictEqual(e.blocks[0].node,  d);
    assert.strictEqual(e.blocks[1].node,  c);

    // should not touch nested nodes
    assert.strictEqual(e.blocks[1].node.args[0], two);
    assert.strictEqual(e.blocks[1].node.args[1], x);
  });

  it ('should throw an error when the map callback does not return a node', function () {
    var x = new SymbolNode('x');
    var two = new ConstantNode(2);
    var c = new OperatorNode('+', 'add', [two, x]);
    var a = new BlockNode([
      {node: x},
      {node: c}
    ]);

    assert.throws(function () {
      a.map(function () {});
    }, /Callback function must return a Node/)
  });

  it ('should transform a BlockNodes parameters', function () {
    // [x, 2]
    var b = new SymbolNode('x');
    var c = new ConstantNode(2);
    var a = new BlockNode([
      {node: b},
      {node: c}
    ]);

    var d = new ConstantNode(3);
    var e = a.transform(function (node) {
      return node instanceof SymbolNode && node.name == 'x' ? d : node;
    });

    assert.notStrictEqual(e, a);
    assert.deepEqual(e.blocks[0].node,  d);
    assert.deepEqual(e.blocks[1].node,  c);
  });

  it ('should transform a BlockNode itself', function () {
    // [x, 2]
    var a = new BlockNode([]);

    var d = new ConstantNode(3);
    var e = a.transform(function (node) {
      return node instanceof BlockNode ? d : node;
    });

    assert.notStrictEqual(e, a);
    assert.deepEqual(e, d);
  });

  it ('should traverse a BlockNode', function () {
    var a = new ConstantNode(1);
    var b = new ConstantNode(2);
    var c = new BlockNode([
      {node: a, visible: true},
      {node: b, visible: true}
    ]);

    var count = 0;
    c.traverse(function (node, index, parent) {
      count++;

      switch(count) {
        case 1:
          assert.strictEqual(node, c);
          assert.strictEqual(index, null);
          assert.strictEqual(parent, null);
          break;

        case 2:
          assert.strictEqual(node, a);
          assert.strictEqual(index, 'blocks[0].node');
          assert.strictEqual(parent, c);
          break;

        case 3:
          assert.strictEqual(node, b);
          assert.strictEqual(index, 'blocks[1].node');
          assert.strictEqual(parent, c);
          break;
      }
    });

    assert.equal(count, 3);
  });

  it ('should clone a BlockNode', function () {
    // [x, 2]
    var b = new SymbolNode('x');
    var c = new ConstantNode(2);
    var a = new BlockNode([
      {node: b},
      {node: c}
    ]);

    var d = a.clone();
    assert(d instanceof BlockNode);
    assert.deepEqual(a, d);
    assert.notStrictEqual(a, d);
    assert.notStrictEqual(a.blocks, d.blocks);
    assert.notStrictEqual(a.blocks[0], d.blocks[0]);
    assert.notStrictEqual(a.blocks[1], d.blocks[1]);
    assert.strictEqual(a.blocks[0].node, d.blocks[0].node);
    assert.strictEqual(a.blocks[1].node, d.blocks[1].node);
  });

  it ('should stringify a BlockNode', function () {
    var n = new BlockNode([
      {node: new ConstantNode(5), visible:true},
      {node: new AssignmentNode('foo', new ConstantNode(3)), visible:false},
      {node: new SymbolNode('foo'), visible:true}
    ]);

    assert.equal(n.toString(), '5\nfoo = 3;\nfoo');
  });

  it ('should stringify a BlockNode with custom toString', function () {
    //Also checks if the custom functions get passed on to the children
    var customFunction = function (node, options) {
      if (node.type === 'BlockNode') {
        var string = '';
        node.blocks.forEach(function (block) {
          string += block.node.toString(options) + '; ';
        });

        return string;
      }
      else if (node.type === 'ConstantNode') {
        return 'const(' + node.value + ', ' + node.valueType + ')'
      }
    };

    var a = new ConstantNode(1);
    var b = new ConstantNode(2);

    var n = new BlockNode([{node: a}, {node: b}]);

    assert.equal(n.toString({handler: customFunction}), 'const(1, number); const(2, number); ');
  });

  it ('should LaTeX a BlockNode', function () {
    var n = new BlockNode([
      {node: new ConstantNode(5), visible:true},
      {node: new AssignmentNode('foo', new ConstantNode(3)), visible:false},
      {node: new SymbolNode('foo'), visible:true}
    ]);

    assert.equal(n.toTex(), '5\\;\\;\nfoo:=3;\\;\\;\n foo');
  });

  it ('should LaTeX a BlockNode with custom toTex', function () {
    //Also checks if the custom functions get passed on to the children
    var customFunction = function (node, options) {
      if (node.type === 'BlockNode') {
        var latex = '';
        node.blocks.forEach(function (block) {
          latex += block.node.toTex(options) + '; ';
        });

        return latex;
      }
      else if (node.type === 'ConstantNode') {
        return 'const\\left(' + node.value + ', ' + node.valueType + '\\right)'
      }
    };

    var a = new ConstantNode(1);
    var b = new ConstantNode(2);

    var n = new BlockNode([{node: a}, {node: b}]);

    assert.equal(n.toTex({handler: customFunction}), 'const\\left(1, number\\right); const\\left(2, number\\right); ');
  });

});


text:
package May2021Leetcode;

import java.util.HashMap;

public class _0091DecodeWays {

	public static void main(String[] args) {
		System.out.println(numDecodings("12"));
		System.out.println(numDecodings("226"));
		System.out.println(numDecodings("0"));
		System.out.println(numDecodings("1"));
		System.out.println(numDecodings("2101"));
		System.out.println(numDecodings("123123"));
	}

	public static int numDecodings(String s) {
		if (s == null || s.length() == 0)
			return 0;
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		dfs(0, s, map);
		return map.get(s);
	}

	public static int dfs(int index, String s, HashMap<String, Integer> map) {
		if (index == s.length())
			return 1;

		String subString = s.substring(index);

		if (map.containsKey(subString)) {
			return map.get(subString);
		}

		char c = s.charAt(index);
		if (c == '0') {
			map.put(subString, 0);
			return 0;
		}

		int count = 0;
		count += dfs(index + 1, s, map);

		if (index + 1 < s.length()) {
			String str = c + "" + s.charAt(index + 1);
			int val = Integer.parseInt(str);
			if (val >= 10 && val <= 26) {
				count += dfs(index + 2, s, map);
			}
		}

		map.put(subString, count);
		return count;
	}
}

redpajama_set_name: RedPajamaGithub


text:
/* @flow */

import React, { PropTypes } from 'react';

import {
  Animated,
  Platform,
  StyleSheet,
  View,
} from 'react-native';

import HeaderTitle from './HeaderTitle';
import HeaderBackButton from './HeaderBackButton';
import HeaderStyleInterpolator from './HeaderStyleInterpolator';
import NavigationPropTypes from '../PropTypes';
import addNavigationHelpers from '../addNavigationHelpers';

import type {
  NavigationScene,
  NavigationRouter,
  NavigationAction,
  NavigationScreenProp,
  NavigationSceneRendererProps,
  NavigationStyleInterpolator,
  LayoutEvent,
  Style,
} from '../TypeDefinition';

export type HeaderMode = 'float' | 'screen' | 'none';

type SubViewProps = NavigationSceneRendererProps & {
  onNavigateBack?: () => void,
};

type Navigation = NavigationScreenProp<*, NavigationAction>;

type SubViewRenderer = (subViewProps: SubViewProps) => ?React.Element<any>;

export type HeaderProps = NavigationSceneRendererProps & {
  mode: HeaderMode,
  onNavigateBack?: () => void,
  renderLeftComponent: SubViewRenderer,
  renderRightComponent: SubViewRenderer,
  renderTitleComponent: SubViewRenderer,
  tintColor?: string,
  router: NavigationRouter,
};

type SubViewName = 'left' | 'title' | 'right';

type HeaderState = {
  widths: {
    [key: string]: number,
  },
};

const APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 56;
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : 0;
const TITLE_OFFSET = Platform.OS === 'ios' ? 70 : 40;

class Header extends React.PureComponent<void, HeaderProps, HeaderState> {

  static HEIGHT = APPBAR_HEIGHT + STATUSBAR_HEIGHT;
  static Title = HeaderTitle;
  static BackButton = HeaderBackButton;

  // propTypes for people who don't use Flow
  static propTypes = {
    ...NavigationPropTypes.SceneRendererProps,
    onNavigateBack: PropTypes.func,
    renderLeftComponent: PropTypes.func,
    renderRightComponent: PropTypes.func,
    renderTitleComponent: PropTypes.func,
    router: PropTypes.object,
    style: PropTypes.any,
  };

  props: HeaderProps;

  state = {
    widths: {},
  };

  _getHeaderTitle(navigation: Navigation): ?string {
    const header = this.props.router.getScreenConfig(navigation, 'header');
    let title;
    if (header && header.title) {
      title = header.title;
    } else {
      title = this.props.router.getScreenConfig(navigation, 'title');
    }
    return typeof title === 'string' ? title : undefined;
  }

  _getBackButtonTitle(navigation: Navigation): ?string {
    const header = this.props.router.getScreenConfig(navigation, 'header') || {};
    if (header.backTitle === null) {
      return undefined;
    }
    return header.backTitle || this._getHeaderTitle(navigation);
  }

  _getHeaderTintColor(navigation: Navigation): ?string {
    const header = this.props.router.getScreenConfig(navigation, 'header');
    if (header && header.tintColor) {
      return header.tintColor;
    }
    return undefined;
  }

  _getHeaderTitleStyle(navigation: Navigation): Style {
    const header = this.props.router.getScreenConfig(navigation, 'header');
    if (header && header.titleStyle) {
      return header.titleStyle;
    }
    return undefined;
  }

  _renderTitleComponent = (props: SubViewProps) => {
    const titleStyle = this._getHeaderTitleStyle(props.navigation);
    const color = this._getHeaderTintColor(props.navigation);
    const title = this._getHeaderTitle(props.navigation);

    // On iOS, width of left/right components depends on the calculated
    // size of the title.
    const onLayoutIOS = Platform.OS === 'ios'
      ? (e: LayoutEvent) => {
        this.setState({
          widths: {
            ...this.state.widths,
            [props.key]: e.nativeEvent.layout.width,
          },
        });
      }
      : undefined;

    return (
      <HeaderTitle
        onLayout={onLayoutIOS}
        style={[color ? { color } : null, titleStyle]}
      >
        {title}
      </HeaderTitle>
    );
  };

  _renderLeftComponent = (props: SubViewProps) => {
    if (props.scene.index === 0 || !props.onNavigateBack) {
      return null;
    }
    const tintColor = this._getHeaderTintColor(props.navigation);
    const previousNavigation = addNavigationHelpers({
      ...props.navigation,
      state: props.scenes[props.scene.index - 1].route,
    });
    const backButtonTitle = this._getBackButtonTitle(previousNavigation);
    const width = this.state.widths[props.key]
      ? (props.layout.initWidth - this.state.widths[props.key]) / 2
      : undefined;
    return (
      <HeaderBackButton
        onPress={props.onNavigateBack}
        tintColor={tintColor}
        title={backButtonTitle}
        width={width}
      />
    );
  };

  _renderRightComponent = () => null;

  _renderLeft(props: NavigationSceneRendererProps): ?React.Element<*> {
    return this._renderSubView(
      props,
      'left',
      this.props.renderLeftComponent,
      this._renderLeftComponent,
      HeaderStyleInterpolator.forLeft,
    );
  }

  _renderTitle(props: NavigationSceneRendererProps, options: *): ?React.Element<*> {
    const style = {};

    if (Platform.OS === 'android') {
      if (!options.hasLeftComponent) {
        style.left = 0;
      }
      if (!options.hasRightComponent) {
        style.right = 0;
      }
    }

    return this._renderSubView(
      { ...props, style },
      'title',
      this.props.renderTitleComponent,
      this._renderTitleComponent,
      HeaderStyleInterpolator.forCenter,
    );
  }

  _renderRight(props: NavigationSceneRendererProps): ?React.Element<*> {
    return this._renderSubView(
      props,
      'right',
      this.props.renderRightComponent,
      this._renderRightComponent,
      HeaderStyleInterpolator.forRight,
    );
  }

  _renderSubView(
    props: NavigationSceneRendererProps,
    name: SubViewName,
    renderer: SubViewRenderer,
    defaultRenderer: SubViewRenderer,
    styleInterpolator: NavigationStyleInterpolator,
  ): ?React.Element<*> {
    const {
      scene,
      navigationState,
    } = props;
    const {
      index,
      isStale,
      key,
    } = scene;

    const offset = navigationState.index - index;

    if (Math.abs(offset) > 2) {
      // Scene is far away from the active scene. Hides it to avoid unnecessary
      // rendering.
      return null;
    }

    const subViewProps = {
      ...props,
      onNavigateBack: this.props.onNavigateBack,
    };

    let subView = renderer(subViewProps);
    if (subView === undefined) {
      subView = defaultRenderer(subViewProps);
    }

    if (subView === null) {
      return null;
    }

    const pointerEvents = offset !== 0 || isStale ? 'none' : 'box-none';

    return (
      <Animated.View
        pointerEvents={pointerEvents}
        key={`${name}_${key}`}
        style={[
          styles.item,
          styles[name],
          props.style,
          styleInterpolator(props),
        ]}
      >
        {subView}
      </Animated.View>
    );
  }

  _renderHeader(props: NavigationSceneRendererProps): React.Element<*> {
    const left = this._renderLeft(props);
    const right = this._renderRight(props);
    const title = this._renderTitle(props, {
      hasLeftComponent: !!left,
      hasRightComponent: !!right,
    });

    return (
      <View
        style={[StyleSheet.absoluteFill, styles.header]}
        key={`scene_${props.scene.key}`}
      >
        {title}
        {left}
        {right}
      </View>
    );
  }

  render() {
    let appBar;

    if (this.props.mode === 'float') {
      const scenesProps: Array<NavigationSceneRendererProps> = this.props.scenes
        .map((scene: NavigationScene, index: number) => ({
          ...NavigationPropTypes.extractSceneRendererProps(this.props),
          scene,
          index,
          navigation: addNavigationHelpers({
            ...this.props.navigation,
            state: scene.route,
          }),
        }));

      appBar = scenesProps.map(this._renderHeader, this);
    } else {
      appBar = this._renderHeader({
        ...NavigationPropTypes.extractSceneRendererProps(this.props),
        position: new Animated.Value(this.props.scene.index),
        progress: new Animated.Value(0),
      });
    }

    // eslint-disable-next-line no-unused-vars
    const { scenes, scene, style, position, progress, ...rest } = this.props;

    return (
      <Animated.View {...rest} style={[styles.container, style]}>
        <View style={styles.appBar}>
          {appBar}
        </View>
      </Animated.View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    paddingTop: STATUSBAR_HEIGHT,
    backgroundColor: Platform.OS === 'ios' ? '#EFEFF2' : '#FFF',
    height: STATUSBAR_HEIGHT + APPBAR_HEIGHT,
    shadowColor: 'black',
    shadowOpacity: 0.1,
    shadowRadius: StyleSheet.hairlineWidth,
    shadowOffset: {
      height: StyleSheet.hairlineWidth,
    },
    elevation: 4,
  },
  appBar: {
    flex: 1,
  },
  header: {
    flexDirection: 'row',
  },
  item: {
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'transparent',
  },
  title: {
    bottom: 0,
    left: TITLE_OFFSET,
    right: TITLE_OFFSET,
    top: 0,
    position: 'absolute',
    alignItems: Platform.OS === 'android'
      ? 'flex-start'
      : 'center',
  },
  left: {
    left: 0,
    bottom: 0,
    top: 0,
    position: 'absolute',
  },
  right: {
    right: 0,
    bottom: 0,
    top: 0,
    position: 'absolute',
  },
});

export default Header;


text:
class ScheduleSimulator
{
public:
  ScheduleSimulator( std::fstream* file,
                     ScheduleType schedule_type,
                     TIME_QUANTA time_quanta = MILLISECOND );
  virtual ~ScheduleSimulator();

  void                      run();
  std::string               print_results();

private:
  ProcessArrivalSimulator   proccess_arrival_simulator;
  ScheduleStrategy*         scheduler;
  ScheduleFactory*          schedule_factory;
  VirtualCPU                cpu;
  ScheduleMonitor           monitor;

  void                      execute_burst();
};

#endif


text:
#ifndef __SRL_SystemLog__
#define __SRL_SystemLog__

#include "srl/log/Logger.h"

namespace SRL
{
	namespace Log
	{
		/**
		 *  Creates a Log that uses the Operating System logging facilities
		 * @author Ian Starnes
		 * @short Uses the current system logging facilities like syslog
		 */
		class SRL_API SysLog : public LoggerOutput
		{
			public:
				/** Constructor */
				SysLog(const String& name, const Logger::Priority& loglevel=Logger::INFO);
				/** Add output to type to Logger */
				static void Create(const String& name,
							const Logger::Priority& loglevel=Logger::INFO);
				/** main log method */
				virtual void log(const Logger::Priority& priority,
						const String& name,  const String& message);

			protected:
				/** Destructor */
				virtual ~SysLog() throw();
				String _syslog_name;
				System::Mutex _syslog_mutex;

		};
	}
}

#endif


text:
package gov.nasa.worldwindx.examples.util;

import gov.nasa.worldwind.*;
import gov.nasa.worldwind.avlist.*;
import gov.nasa.worldwind.event.*;
import gov.nasa.worldwindx.examples.ApplicationTemplate;
import gov.nasa.worldwind.layers.*;
import gov.nasa.worldwind.util.*;

/**
 * Controls display of tool tips on picked objects. Any shape implementing {@link AVList} can participate. Shapes
 * provide tool tip text in their AVList for either or both of hover and rollover events. The keys associated with the
 * text are specified to the constructor.
 *
 * @author tag
 * @version $Id: ToolTipController.java 1171 2013-02-11 21:45:02Z dcollins $
 */
public class ToolTipController implements SelectListener, Disposable
{
    protected WorldWindow wwd;
    protected String hoverKey = AVKey.HOVER_TEXT;
    protected String rolloverKey = AVKey.ROLLOVER_TEXT;
    protected Object lastRolloverObject;
    protected Object lastHoverObject;
    protected AnnotationLayer layer;
    protected ToolTipAnnotation annotation;

    /**
     * Create a controller for a specified {@link WorldWindow} that displays tool tips on hover and/or rollover.
     *
     * @param wwd         the World Window to monitor.
     * @param rolloverKey the key to use when looking up tool tip text from the shape's AVList when a rollover event
     *                    occurs. May be null, in which case a tool tip is not displayed for rollover events.
     * @param hoverKey    the key to use when looking up tool tip text from the shape's AVList when a hover event
     *                    occurs. May be null, in which case a tool tip is not displayed for hover events.
     */
    public ToolTipController(WorldWindow wwd, String rolloverKey, String hoverKey)
    {
        this.wwd = wwd;
        this.hoverKey = hoverKey;
        this.rolloverKey = rolloverKey;

        this.wwd.addSelectListener(this);
    }

    /**
     * Create a controller for a specified {@link WorldWindow} that displays "DISPLAY_NAME" on rollover.
     *
     * @param wwd         the World Window to monitor.
     */
    public ToolTipController(WorldWindow wwd)
    {
        this.wwd = wwd;
        this.rolloverKey = AVKey.DISPLAY_NAME;

        this.wwd.addSelectListener(this);
    }

    public void dispose()
    {
        this.wwd.removeSelectListener(this);
    }

    protected String getHoverText(SelectEvent event)
    {
        return event.getTopObject() != null && event.getTopObject() instanceof AVList ?
            ((AVList) event.getTopObject()).getStringValue(this.hoverKey) : null;
    }

    protected String getRolloverText(SelectEvent event)
    {
        return event.getTopObject() != null && event.getTopObject() instanceof AVList ?
            ((AVList) event.getTopObject()).getStringValue(this.rolloverKey) : null;
    }

    public void selected(SelectEvent event)
    {
        try
        {
            if (event.isRollover() && this.rolloverKey != null)
                this.handleRollover(event);
            else if (event.isHover() && this.hoverKey != null)
                this.handleHover(event);
        }
        catch (Exception e)
        {
            // Wrap the handler in a try/catch to keep exceptions from bubbling up
            Logging.logger().warning(e.getMessage() != null ? e.getMessage() : e.toString());
        }
    }

    protected void handleRollover(SelectEvent event)
    {
        if (this.lastRolloverObject != null)
        {
            if (this.lastRolloverObject == event.getTopObject() && !WWUtil.isEmpty(getRolloverText(event)))
                return;

            this.hideToolTip();
            this.lastRolloverObject = null;
            this.wwd.redraw();
        }

        if (getRolloverText(event) != null)
        {
            this.lastRolloverObject = event.getTopObject();
            this.showToolTip(event, getRolloverText(event).replace("\\n", "\n"));
            this.wwd.redraw();
        }
    }

    protected void handleHover(SelectEvent event)
    {
        if (this.lastHoverObject != null)
        {
            if (this.lastHoverObject == event.getTopObject())
                return;

            this.hideToolTip();
            this.lastHoverObject = null;
            this.wwd.redraw();
        }

        if (getHoverText(event) != null)
        {
            this.lastHoverObject = event.getTopObject();
            this.showToolTip(event, getHoverText(event).replace("\\n", "\n"));
            this.wwd.redraw();
        }
    }

    protected void showToolTip(SelectEvent event, String text)
    {
        if (annotation != null)
        {
            annotation.setText(text);
            annotation.setScreenPoint(event.getPickPoint());
        }
        else
        {
            annotation = new ToolTipAnnotation(text);
        }

        if (layer == null)
        {
            layer = new AnnotationLayer();
            layer.setPickEnabled(false);
        }

        layer.removeAllAnnotations();
        layer.addAnnotation(annotation);
        this.addLayer(layer);
    }

    protected void hideToolTip()
    {
        if (this.layer != null)
        {
            this.layer.removeAllAnnotations();
            this.removeLayer(this.layer);
            this.layer.dispose();
            this.layer = null;
        }

        if (this.annotation != null)
        {
            this.annotation.dispose();
            this.annotation = null;
        }
    }

    protected void addLayer(Layer layer)
    {
        if (!this.wwd.getModel().getLayers().contains(layer))
            ApplicationTemplate.insertBeforeCompass(this.wwd, layer);
    }

    protected void removeLayer(Layer layer)
    {
        this.wwd.getModel().getLayers().remove(layer);
    }
}


text:
title: MySqlBulkLoader.FieldTerminator property
---

# MySqlBulkLoader.FieldTerminator property

(Optional) The string fields are terminated with.

```csharp
public string FieldTerminator { get; set; }
```

## See Also

* class [MySqlBulkLoader](../../MySqlBulkLoaderType/)
* namespace [MySqlConnector](../../MySqlBulkLoaderType/)
* assembly [MySqlConnector](../../../MySqlConnectorAssembly/)

<!-- DO NOT EDIT: generated by xmldocmd for MySqlConnector.dll -->


text:
package org.apache.camel.component.seda;

import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.util.ServiceHelper;

/**
 *
 */
public class SedaConsumerSuspendResumeTest extends ContextTestSupport {

    public void testSuspendResume() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:bar");
        mock.expectedMessageCount(1);

        template.sendBody("seda:foo", "A");

        mock.assertIsSatisfied();

        assertEquals("Started", context.getRouteStatus("foo").name());
        assertEquals("Started", context.getRouteStatus("bar").name());

        // suspend bar consumer (not the route)
        SedaConsumer consumer = (SedaConsumer) context.getRoute("bar").getConsumer();

        ServiceHelper.suspendService(consumer);
        assertEquals("Suspended", consumer.getStatus().name());

        // send a message to the route but the consumer is suspended
        // so it should not route it
        resetMocks();
        mock.expectedMessageCount(0);

        // wait a bit to ensure consumer is suspended, as it could be in a poll mode where
        // it would poll and route (there is a little slack (up till 1 sec) before suspension is empowered)
        Thread.sleep(2000);

        template.sendBody("seda:foo", "B");
        // wait 2 sec to ensure seda consumer thread would have tried to poll otherwise
        mock.assertIsSatisfied(2000);

        // resume consumer
        resetMocks();
        mock.expectedMessageCount(1);

        // resume bar consumer (not the route)
        ServiceHelper.resumeService(consumer);
        assertEquals("Started", consumer.getStatus().name());

        // the message should be routed now
        mock.assertIsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("seda:foo").routeId("foo").to("seda:bar");

                from("seda:bar").routeId("bar").to("mock:bar");
            }
        };
    }
}


text:
package com.hauldata.dbpa.file.book;

import java.io.IOException;
import java.util.ArrayList;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

import com.hauldata.dbpa.file.SourceHeaders;
import com.hauldata.util.tokenizer.EndOfLine;

public class XlSourceSheet extends XlSheet {

	private Sheet sheet;
	private int rowIndex;
	private Row row;

	public XlSourceSheet(String typeName, Book owner, String name) {
		super(typeName, owner, name);

		sheet = null;
		rowIndex = 0;
		row = null;
	}

	@Override
	public void open() throws IOException {

		getSheet();

		// The following is duplicated in DsvFile.open() and should probably be moved to common code.

		SourceHeaders headers = getSourceHeaders();
		if (headers.exist()) {
			if (headers.mustValidate()) {

				int columnIndex = 1;
				for (String caption : headers.getCaptions()) {
					Object value = readColumn(columnIndex++);
					String captionFound = (value == null) ? "" : value.toString();
					if (!captionFound.equals(caption)) {
						throw new RuntimeException("Expected column header '" + caption + "', found '" + captionFound + "'");
					}
				}

				if (readColumn(columnIndex) != EndOfLine.value) {
					throw new RuntimeException("Sheet has more column headers than specified");
				}
			}
			else {
				ArrayList<String> captions = new ArrayList<String>();

				int columnIndex = 1;
				for (Object value = null; (value = readColumn(columnIndex)) != EndOfLine.value; ++columnIndex) {
					captions.add((value == null) ? "" : value.toString());
				}

				if (captions.size() == 0) {
					throw new RuntimeException("Sheet was specified with column headers but header row is blank");
				}

				headers.setCaptions(captions);
			}
		}
	}

	private void getSheet() {
		Workbook book = ((XlSourceBook)owner).getBook();
		if (!getName().isEmpty()) {
			sheet = book.getSheet(getName());
			if (sheet == null ) {
				throw new RuntimeException("Sheet does not exist: " + getName());
			}
		}
		else {
			if (book.getNumberOfSheets() != 1) {
				throw new RuntimeException("Workbook does not have exactly one sheet and a sheet name was not provided");
			}
			sheet = book.getSheetAt(0);
		}
	}

	/**
	 * Prepare to read from a XLSX sheet that has already been opened with open().
	 */
	@Override
	public void load() throws IOException {
		// No action is needed.
	}

	@Override
	public Object readColumn(int columnIndex) throws IOException {

		try {
			if (columnIndex == 1) {
				row = sheet.getRow(rowIndex++);
			}

			if ((row == null) || (row.getLastCellNum() < columnIndex)) {
				// There is no cell at this column index or after.

				if (headers.getColumnCount() == 0) {
					int inferredColumnCount = Math.max(headers.getRequiredColumnCount(), columnIndex - 1);
					if (0 < inferredColumnCount) {
						headers.setColumnCount(inferredColumnCount);
					}
					else {
						throw new RuntimeException("First row is empty and numbers of columns is not established; cannot read");
					}
				}

				if (columnIndex <= headers.getColumnCount()) {
					return null;
				}
				else {
					return EndOfLine.value;
				}
			}
			else {
				// There are non-empty cells in the row at least up to this one.

				Object value = fromXLSX(row.getCell(columnIndex - 1));

				if (headers.getColumnCount() == 0) {
					return value;
				}
				else if (columnIndex <= headers.getColumnCount() || rowIndex == 1) {
					return value;
				}
				else {
					return EndOfLine.value;
				}
			}
		}
		catch (Exception ex) {
			throw new RuntimeException("At row " + Integer.toString(rowIndex) + ": " + ex.getMessage(), ex);
		}
	}

	private Object fromXLSX(Cell cell) {
		if (cell == null) {
			return null;
		}

		switch (cell.getCellType()) {
		case Cell.CELL_TYPE_BLANK:
			return null;
		case Cell.CELL_TYPE_BOOLEAN:
			return cell.getBooleanCellValue();
		case Cell.CELL_TYPE_NUMERIC:
			double numericValue = cell.getNumericCellValue();
			return DateUtil.isCellDateFormatted(cell) ? DateUtil.getJavaDate(numericValue) : (Double)numericValue;
		case Cell.CELL_TYPE_STRING:
		default:
			return cell.getStringCellValue();
		}
	}

	@Override
	public boolean hasRow() {
		return rowIndex <= sheet.getLastRowNum();
	}

	@Override
	public void close() {
		// TODO Auto-generated method stub
	}

	// Never called.
	@Override public void create() throws IOException {}
	@Override public void append() throws IOException {}
	@Override public void writeColumn(int columnIndex, Object object) {}
	@Override public void flush() {}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hypocrea lycogalae Kalchbr. & Cooke

### Remarks
null


text:
"""
================
Sakoe-Chiba band
================

This example explains how to set the `window_size` parameter of the Sakoe-Chiba
band when computing the Dynamic Time Warping (DTW) with
``method == "sakoechiba"``. The Sakoe-Chiba region is defined through a
`window_size` parameter which determines the largest temporal shift allowed
from the diagonal in the direction of the longest time series. It is
implemented in :func:`pyts.metrics.sakoe_chiba_band`. The window size can
be either set relatively to the length of the longest time series as a ratio
between 0 and 1, or manually if an integer is given.

This example visualizes the Sakoe-Chiba band in different scenarios:
  * the degenerate case: ``window_size = 0``,
  * a relative size: ``window_size = 0.4``, and
  * an absolute size: ``window_size = 4``.

The last two cases are equivalent since ``0.4 * 10 = 4``.
"""

# Author: Hicham Janati <hicham.janati@inria.fr>
#         Johann Faouzi <johann.faouzi@gmail.com>
# License: BSD-3-Clause

import numpy as np
import matplotlib.pyplot as plt

from pyts.metrics import sakoe_chiba_band
from pyts.metrics.dtw import _check_sakoe_chiba_params

# #####################################################################
# We write a function to visualize the sakoe-chiba band for different
# time series lengths.

def plot_sakoe_chiba(n_timestamps_1, n_timestamps_2, window_size=0.5, ax=None):
    """Plot the Sakoe-Chiba band."""
    region = sakoe_chiba_band(n_timestamps_1, n_timestamps_2, window_size)
    scale, horizontal_shift, vertical_shift = \
        _check_sakoe_chiba_params(n_timestamps_1, n_timestamps_2, window_size)
    mask = np.zeros((n_timestamps_2, n_timestamps_1))
    for i, (j, k) in enumerate(region.T):
        mask[j:k, i] = 1.

    plt.imshow(mask, origin='lower', cmap='Wistia', vmin=0, vmax=1)

    sz = max(n_timestamps_1, n_timestamps_2)
    x = np.arange(-1, sz + 1)
    lower_bound = scale * (x - horizontal_shift) - vertical_shift
    upper_bound = scale * (x + horizontal_shift) + vertical_shift
    plt.plot(x, lower_bound, 'b', lw=2)
    plt.plot(x, upper_bound, 'g', lw=2)
    diag = (n_timestamps_2 - 1) / (n_timestamps_1 - 1) * np.arange(-1, sz + 1)
    plt.plot(x, diag, 'black', lw=1)

    for i in range(n_timestamps_1):
        for j in range(n_timestamps_2):
            plt.plot(i, j, 'o', color='green', ms=1)

    ax.set_xticks(np.arange(-.5, n_timestamps_1, 1), minor=True)
    ax.set_yticks(np.arange(-.5, n_timestamps_2, 1), minor=True)
    plt.grid(which='minor', color='b', linestyle='--', linewidth=1)
    plt.xticks(np.arange(0, n_timestamps_1, 2))
    plt.yticks(np.arange(0, n_timestamps_2, 2))
    plt.xlim((-0.5, n_timestamps_1 - 0.5))
    plt.ylim((-0.5, n_timestamps_2 - 0.5))

window_sizes = [0, 0.4, 4]

rc = {"font.size": 14, "axes.titlesize": 10,
      "xtick.labelsize": 8, "ytick.labelsize": 8}
plt.rcParams.update(rc)

lengths = [(10, 10), (10, 5), (5, 10)]
y_coordinates = [0.915, 0.60, 0.35]

plt.figure(figsize=(10, 8))

for i, ((n1, n2), y) in enumerate(zip(lengths, y_coordinates)):
    for j, window_size in enumerate(window_sizes):
        ax = plt.subplot(3, 3, i * 3 + j + 1)
        plot_sakoe_chiba(n1, n2, window_size, ax)
        plt.title('window_size = {}'.format(window_size))
        if j == 1:
            plt.figtext(0.5, y, 'sakoe_chiba_band({}, {})'.format(n1, n2),
                        ha='center')
plt.subplots_adjust(hspace=0.4)
plt.show()


text:
package cassandra.proxies.microflows;

import java.util.HashMap;
import java.util.Map;
import com.mendix.core.Core;
import com.mendix.core.CoreException;
import com.mendix.systemwideinterfaces.MendixRuntimeException;
import com.mendix.systemwideinterfaces.core.IContext;

public class Microflows
{
	// These are the microflows for the Cassandra module
	public static void iVK_CreateNewQuery_TEST(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			Core.execute(context, "Cassandra.IVK_CreateNewQuery_TEST", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void iVK_ExecuteQuery(IContext context, cassandra.proxies.Query _query)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("Query", _query == null ? null : _query.getMendixObject());
			Core.execute(context, "Cassandra.IVK_ExecuteQuery", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
}


text:
<component name="CopyrightManager">
  <settings default="Fatboy Industrial" />
</component>


text:
This sample demonstrates how to use a loader file in conjunction with a UserCustomAction to embed JavaScript in a SharePoint site. This pattern minimizes the need to update the deployed custom action.

*Notice*: This sample uses [PnP Core Nuget package](https://github.com/OfficeDev/PnP-sites-core) for the needed API operations in the embedder program.

### Applies to ###
-  Office 365 Multi Tenant (MT)
-  Office 365 Dedicated (D)
-  SharePoint 2013 on-premises

### Prerequisites ###
None

### Solution ###
Solution | Author(s)
---------|----------
Core.JavaScript | Patrick Rodgers (**Microsoft**)

### Version history ###
Version  | Date | Comments
---------| -----| --------
1.0  | November 28th 2015 | Initial release

### Disclaimer ###
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

----------

## Embedder Console Application ##

To ease testing it can be helpful to use a console application to embed the UserCustomAction in the target site. In practice this would likely be done during provisioning of the site/web. The small block of script that is embedded allows for all updates to occur outside of SharePoint, easing the burden on administrators and developers. This console application provides an example of a broadly reusable development tool.

## Embedded JavaScript ##

The JavaScript block code is kept to a minimum and makes use of the built-in SharePoint script on demand functionality. This example makes use of the public Microsoft hosted CDN for [jQuery](http://jquery.com) - but could be updated to use any other source. There are two examples, the first works for non-MDS enabled sites, and the second for MDS enabled sites. When unsure you can always use the second.

### Non-MDS Version ###

```JavaScript
(function (loaderFile, nocache) {
    var url = loaderFile + ((nocache) ? '?' + encodeURIComponent((new Date()).getTime()) : '');
    SP.SOD.registerSod('pnp-jquery.js', 'https://localhost:44324/js/jquery.js');
    SP.SOD.registerSod('pnp-loader.js', url);
    SP.SOD.registerSodDep('pnp-loader.js', 'pnp-jquery.js');
    SP.SOD.executeFunc('pnp-loader.js', null, function () { });
})('https://localhost:44324/pnp-loader.js', true);
```

### MDS Version ###
```JavaScript
ExecuteOrDelayUntilBodyLoaded(function () {
    var url = 'https://localhost:44324/js/pnp-loaderMDS.js?' + encodeURIComponent((new Date()).getTime());
    SP.SOD.registerSod('pnp-jquery.js', 'https://localhost:44324/js/jquery.js');
    SP.SOD.registerSod('pnp-loader.js', url);
    SP.SOD.registerSodDep('pnp-loader.js', 'pnp-jquery.js');
    SP.SOD.executeFunc('pnp-loader.js', null, function () {
        if (typeof pnpLoadFiles === 'undefined') {
            RegisterModuleInit('https://localhost:44324/js/pnp-loaderMDS.js', pnpLoadFiles);
        } else {
            pnpLoadFiles();
        }
    });
});
```

In the above code we are using an anonymous function embedded in the page to first load jQuery and then load our remote loader file. Additional required files can also be loaded here, such as [Bootstrap](http://getbootstrap.com) or [Knockout](http://knockoutjs.com/). These would then be available on every page - but it may be desirable to load them in the loader.js file in case the version or references need to change. It is recommended, where possible, to host the jQuery.js file references above at a generic location with a non-versioned name (such as jQuery.js). This allows for the file to be updated while avoiding the need to update the UserCustomActions.

## pnp-loader.js ##

The [pnp-loader.js](Core.JavaScript.CDN/js/pnp-loader.js) file is the engine used to load any other required client files. This model provides a single location to update those files required by an application. Two versions are provided as examples, one that does not cache the files, for development and testing, and a [second](Core.JavaScript.CDN/js/pnp-loader-cached.js) that does cache the loaded client files for production/UAT scenarios. In production the loader file can also be minimized to reduce download times.

## pnp-loaderMDS.js ##

The [pnp-loaderMDS.js](Core.JavaScript.CDN/js/pnp-loaderMDS.js) file is the engine used to load any other required client files when using the MDS version of the embedded loader script. This model provides a single location to update those files required by an application. Two versions are provided as examples, one that does not cache the files, for development and testing, and a [second](Core.JavaScript.CDN/js/pnp-loaderMDS-cached.js) that does cache the loaded client files for production/UAT scenarios. In production the loader file can also be minimized to reduce download times.


text:
.class Lcom/sec/android/app/camera/CropImage$6;
.super Ljava/lang/Object;
.source "CropImage.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/sec/android/app/camera/CropImage;->saveOutput(Landroid/graphics/Bitmap;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/sec/android/app/camera/CropImage;

.field final synthetic val$b:Landroid/graphics/Bitmap;

# direct methods
.method constructor <init>(Lcom/sec/android/app/camera/CropImage;Landroid/graphics/Bitmap;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 539
    iput-object p1, p0, Lcom/sec/android/app/camera/CropImage$6;->this$0:Lcom/sec/android/app/camera/CropImage;

    iput-object p2, p0, Lcom/sec/android/app/camera/CropImage$6;->val$b:Landroid/graphics/Bitmap;

    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 1

    .prologue
    .line 541
    iget-object v0, p0, Lcom/sec/android/app/camera/CropImage$6;->this$0:Lcom/sec/android/app/camera/CropImage;

    #getter for: Lcom/sec/android/app/camera/CropImage;->mImageView:Lcom/sec/android/app/camera/CropImageView;
    invoke-static {v0}, Lcom/sec/android/app/camera/CropImage;->access$300(Lcom/sec/android/app/camera/CropImage;)Lcom/sec/android/app/camera/CropImageView;

    move-result-object v0

    invoke-virtual {v0}, Lcom/sec/android/app/camera/CropImageView;->clear()V

    .line 542
    iget-object v0, p0, Lcom/sec/android/app/camera/CropImage$6;->val$b:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 543
    return-void
.end method


text:
/**
 * KeyPerformanceIndicatorStatisticsTest.java
 *
 * Project: projecth
 *
 * @author mobileman
 * @date 14.2.2011
 * @version 1.0
 *
 * (c) 2010 MobileMan GmbH
 */

package com.mobileman.projecth.domain.dto.patient.kpi;

import static org.junit.Assert.*;

import java.math.BigDecimal;
import java.util.Date;

import org.junit.Test;

/**
 * @author mobileman
 *
 */
public class KeyPerformanceIndicatorStatisticsTest {

	/**
	 * @throws Exception
	 */
	@Test
	public void keyPerformanceIndicatorStatistics() throws Exception {
		KeyPerformanceIndicatorStatistics obj = new KeyPerformanceIndicatorStatistics(null, new Date(), null);
		assertEquals(new BigDecimal("0.0"), obj.getValue());
	}
}


text:
title: Telerik.Web.UI.Spell.HtmlElementTextSource
page_title: Client-side API Reference
description: Client-side API Reference
slug: Telerik.Web.UI.Spell.HtmlElementTextSource
---

# Telerik.Web.UI.Spell.HtmlElementTextSource : Sys.UI.Control

## Inheritance Hierarchy

* Sys.UI.Control
* *[Telerik.Web.UI.Spell.HtmlElementTextSource]({%slug Telerik.Web.UI.Spell.HtmlElementTextSource%})*

## Methods

###  get_element

Gets the HTML element of the TextSource object.

#### Parameters

#### Returns

`Element` The HTML element of the TextSource object.

###  get_text

Gets the text of the (Telerik.Web.UI.Spell.HtmlElementTextSource) TextSource object.

#### Parameters

#### Returns

`String` The text of the TextSource object.

###  set_text

Sets a text to the (Telerik.Web.UI.Spell.HtmlElementTextSource) TextSource object.

#### Parameters

##### text `String`

The text to be set.

#### Returns

`None`


text:
using System;
using System.Collections.Generic;
using Treefrog.Framework.Model;

namespace Treefrog.Plugins.Object.Commands
{
    public class ObjectOrderCommand : ObjectLayerCommand
    {
        private class ObjectRecord
        {
            public ObjectInstance Instance;
            public int PrevIndex;
            public int NewIndex;
        }

        private ObjectLayer _objectSource;

        private List<ObjectRecord> _objects;
        private List<ObjectInstance> _toFront;
        private List<ObjectInstance> _toBack;

        public ObjectOrderCommand (ObjectLayer source)
        {
            _objectSource = source;

            _objects = new List<ObjectRecord>();
            _toFront = new List<ObjectInstance>();
            _toBack = new List<ObjectInstance>();
        }

        public void QueueMoveForward (ObjectInstance inst)
        {
            ClearFromLists(inst);

            int index = _objectSource.ObjectIndex(inst);
            _objects.Add(new ObjectRecord() {
                Instance = inst,
                PrevIndex = index,
                NewIndex = Math.Min(index + 1, _objectSource.ObjectCount - 1),
            });
        }

        public void QueueMoveBackward (ObjectInstance inst)
        {
            ClearFromLists(inst);

            int index = _objectSource.ObjectIndex(inst);
            _objects.Add(new ObjectRecord() {
                Instance = inst,
                PrevIndex = index,
                NewIndex = Math.Max(index - 1, 0),
            });
        }

        public void QueueMoveFront (ObjectInstance inst)
        {
            ClearFromLists(inst);
            _toFront.Add(inst);
        }

        public void QueueMoveBack (ObjectInstance inst)
        {
            ClearFromLists(inst);
            _toBack.Add(inst);
        }

        public override void Execute ()
        {
            // Queue objects sent to back
            Dictionary<int, ObjectInstance> backMap = new Dictionary<int, ObjectInstance>();
            foreach (ObjectInstance inst in _toBack)
                backMap.Add(_objectSource.ObjectIndex(inst), inst);

            List<int> backKeys = new List<int>(backMap.Keys);
            backKeys.Sort();

            foreach (ObjectRecord record in _objects)
                record.NewIndex += backKeys.Count;

            for (int i = 0; i < backKeys.Count; i++) {
                _objects.Add(new ObjectRecord() {
                    Instance = backMap[backKeys[i]],
                    PrevIndex = backKeys[i],
                    NewIndex = i,
                });
            }

            // Sort objects moved relatively
            _objects.Sort((u, v) => {
                return u.PrevIndex.CompareTo(v.PrevIndex);
            });

            // Queue objects sent to front
            Dictionary<int, ObjectInstance> frontMap = new Dictionary<int, ObjectInstance>();
            foreach (ObjectInstance inst in _toFront)
                frontMap.Add(_objectSource.ObjectIndex(inst), inst);

            List<int> frontKeys = new List<int>(frontMap.Keys);
            frontKeys.Sort();

            for (int i = 0; i < frontKeys.Count; i++) {
                _objects.Add(new ObjectRecord() {
                    Instance = frontMap[frontKeys[i]],
                    PrevIndex = frontKeys[i],
                    NewIndex = _objectSource.ObjectCount - 1,
                });
            }

            // Execute command
            foreach (ObjectRecord record in _objects)
                _objectSource.MoveToIndex(record.Instance, record.NewIndex);
        }

        public override void Undo ()
        {
            foreach (ObjectRecord record in _objects)
                _objectSource.MoveToIndex(record.Instance, record.PrevIndex);
        }

        public override void Redo ()
        {
            foreach (ObjectRecord record in _objects)
                _objectSource.MoveToIndex(record.Instance, record.NewIndex);
        }

        private void ClearFromLists (ObjectInstance inst)
        {
            _objects.RemoveAll(v => v.Instance == inst);
            _toFront.Remove(inst);
            _toBack.Remove(inst);
        }
    }
}


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Authentication Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines are used during authentication for various
    | messages that we need to display to the user. You are free to modify
    | these language lines according to your application's requirements.
    |
    */

    'failed' => 'Эти учетные данные не соответствуют нашим данным.',
    'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',

];