text:
<?php

require_once(dirname(__FILE__).'/../../bootstrap/unit.php');

$t = new lime_test(35, new lime_output_color());

$html = <<<EOF

Test page

Title 1

header

multi-classes

myfoo

myfoo bis

works great

First

Second with a link

First

Third with a another link

Title 2

element 1

element 2

element 3

element 4

test 1

test 2

test 3

test 4

footer

EOF;

$dom = new DomDocument('1.0', 'utf-8');
$dom->validateOnParse = true;
$dom->loadHTML($html);

// ->getTexts()
$t->diag('->getTexts()');

$c = new sfDomCssSelector($dom);

$t->diag('basic selectors');
$t->is($c->getTexts('h1'), array('Test page'), '->getTexts() takes a CSS selector as its first argument');
$t->is($c->getTexts('h2'), array('Title 1', 'Title 2'), '->getTexts() returns an array of matching texts');
$t->is($c->getTexts('#footer'), array('footer'), '->getTexts() supports searching html elements by id');
$t->is($c->getTexts('div#footer'), array('footer'), '->getTexts() supports searching html elements by id for a tag name');

$t->is($c->getTexts('.header'), array('header'), '->getTexts() supports searching html elements by class name');
$t->is($c->getTexts('p.header'), array('header'), '->getTexts() supports searching html elements by class name for a tag name');
$t->is($c->getTexts('div.header'), array(), '->getTexts() supports searching html elements by class name for a tag name');

$t->is($c->getTexts('.foo'), array('multi-classes'), '->getTexts() supports searching html elements by class name for multi-class elements');
$t->is($c->getTexts('.bar'), array('multi-classes'), '->getTexts() supports searching html elements by class name for multi-class elements');
$t->is($c->getTexts('.foobar'), array('multi-classes'), '->getTexts() supports searching html elements by class name for multi-class elements');

$t->is($c->getTexts('ul#mylist ul li'), array('element 3', 'element 4'), '->getTexts() supports searching html elements by several selectors');

$t->is($c->getTexts('#nonexistant'), array(), '->getTexts() returns an empty array if the id does not exist');

$t->diag('attribute selectors');
$t->is($c->getTexts('ul#list li a[href]'), array('link'), '->getTexts() supports checking attribute existence');
$t->is($c->getTexts('ul#list li a[class~="foo1"]'), array('link'), '->getTexts() supports checking attribute word matching');
$t->is($c->getTexts('ul#list li a[class~="bar1"]'), array('link'), '->getTexts() supports checking attribute word matching');
$t->is($c->getTexts('ul#list li a[class~="foobar1"]'), array('link'), '->getTexts() supports checking attribute word matching');
$t->is($c->getTexts('ul#list li a[class^="foo1"]'), array('link'), '->getTexts() supports checking attribute starting with');
$t->is($c->getTexts('ul#list li a[class$="foobar1"]'), array('link'), '->getTexts() supports checking attribute ending with');
$t->is($c->getTexts('ul#list li a[class*="oba"]'), array('link'), '->getTexts() supports checking attribute with *');
$t->is($c->getTexts('ul#list li a[href="http://www.google.com/"]'), array('link'), '->getTexts() supports checking attribute word matching');
$t->is($c->getTexts('ul#anotherlist li a[class|="bar1"]'), array('another link'), '->getTexts() supports checking attribute starting with value followed by optional hyphen');

$t->is($c->getTexts('ul#list li a[class*="oba"][class*="ba"]'), array('link'), '->getTexts() supports chaining attribute selectors');
$t->is($c->getTexts('p[class="myfoo"][id="mybar"]'), array('myfoo bis'), '->getTexts() supports chaining attribute selectors');

$t->is($c->getTexts('p[onclick*="a . and a #"]'), array('works great'), '->getTexts() support . # and spaces in attribute selectors');

$t->diag('combinators');
$t->is($c->getTexts('body  h1'), array('Test page'), '->getTexts() takes a CSS selectors separated by one or more spaces');
$t->is($c->getTexts('div#combinators > ul  >   li'), array('test 1', 'test 2'), '->getTexts() support > combinator');
$t->is($c->getTexts('div#combinators>ul>li'), array('test 1', 'test 2'), '->getTexts() support > combinator with optional surrounding spaces');
$t->is($c->getTexts('div#combinators ul  +   li'), array('test 1', 'test 3'), '->getTexts() support + combinator');
$t->is($c->getTexts('div#combinators ul+li'), array('test 1', 'test 3'), '->getTexts() support + combinator with optional surrounding spaces');

$t->is($c->getTexts('h1, h2'), array('Test page', 'Title 1', 'Title 2'), '->getTexts() takes a multiple CSS selectors separated by a ,');
$t->is($c->getTexts('h1,h2'), array('Test page', 'Title 1', 'Title 2'), '->getTexts() takes a multiple CSS selectors separated by a ,');
$t->is($c->getTexts('h1  ,   h2'), array('Test page', 'Title 1', 'Title 2'), '->getTexts() takes a multiple CSS selectors separated by a ,');
$t->is($c->getTexts('h1, h1,h1'), array('Test page'), '->getTexts() returns nodes only once for multiple selectors');
$t->is($c->getTexts('h1,h2,h1'), array('Test page', 'Title 1', 'Title 2'), '->getTexts() returns nodes only once for multiple selectors');

$t->is($c->getTexts('p[onclick*="a . and a #"], div#combinators > ul + li'), array('works great', 'test 1'), '->getTexts() mega example!');


text:
@class CPStatusLabel, CPSearchFieldTextView, CPResult;

@interface CPSearchField : NSSearchField
@property (nonatomic, strong)	CPStatusLabel *placeholderTextField;
@property (copy,nonatomic) NSString *label; // The 'token field' on the left

- (BOOL)spaceKeyDown;
- (void)reset;
- (BOOL)cmdBackspaceKeyDown;
- (void)pasteString:(NSString *)str;
@end

redpajama_set_name: RedPajamaGithub


text:
package com.sharksharding.util;

import java.io.File;

/**
 * 从配置中心获取配置信息后生成的临时文件管理
 *
 * @author gaoxianglong
 *
 * @version 1.3.7
 */
public class TmpManager {
	private static String tmpdir;

	/**
	 * 删除临时文件
	 *
	 * @author gaoxianglong
	 *
	 * @param path
	 *            tem目录
	 *
	 * @return boolean 删除结果
	 */
	public static boolean deleteTmp(String path) {
		boolean result = false;
		if (FileExist.exists(path))
			result = new File(path).delete();
		return result;
	}

	/**
	 * 生成tmp文件全限定名
	 *
	 * @author gaoxianglong
	 *
	 * @return String tmp文件全限定名
	 */
	public static String createTmp() {
		tmpdir = System.getProperty("java.io.tmpdir") + File.separator + "shark-" + System.currentTimeMillis() + ".xml";
		if (FileExist.exists(tmpdir))
			createTmp();
		return tmpdir;
	}
}


text:
package org.apache.flink.graph.test.operations;

import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.graph.Edge;
import org.apache.flink.graph.Graph;
import org.apache.flink.graph.Vertex;
import org.apache.flink.graph.test.TestGraphUtils;
import org.apache.flink.test.util.MultipleProgramsTestBase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

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

@RunWith(Parameterized.class)
public class GraphMutationsITCase extends MultipleProgramsTestBase {

	public GraphMutationsITCase(TestExecutionMode mode){
		super(mode);
	}

	private String expectedResult;

	@Test
	public void testAddVertex() throws Exception {
		/*
		 * Test addVertex() -- simple case
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		graph = graph.addVertex(new Vertex<>(6L, 6L));

		DataSet<Vertex<Long, Long>> data = graph.getVertices();
		List<Vertex<Long, Long>> result = data.collect();

		expectedResult = "1,1\n" +
				"2,2\n" +
				"3,3\n" +
				"4,4\n" +
				"5,5\n" +
				"6,6\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testAddVertices() throws Exception {
		/*
		 * Test addVertices() -- simple case
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		List<Vertex<Long, Long>> vertices = new ArrayList<>();
		// the first vertex has a duplicate ID from a vertex in the graph and
		// should not be added to the new graph
		vertices.add(new Vertex<>(5L, 0L));
		vertices.add(new Vertex<>(6L, 6L));
		vertices.add(new Vertex<>(7L, 7L));

		graph = graph.addVertices(vertices);

		DataSet<Vertex<Long, Long>> data = graph.getVertices();
		List<Vertex<Long, Long>> result= data.collect();

		expectedResult = "1,1\n" +
				"2,2\n" +
				"3,3\n" +
				"4,4\n" +
				"5,5\n" +
				"6,6\n" +
				"7,7\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testAddVertexExisting() throws Exception {
		/*
		 * Test addVertex() -- add an existing vertex
		 */
		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		graph = graph.addVertex(new Vertex<>(1L, 1L));

		DataSet<Vertex<Long, Long>> data = graph.getVertices();
		List<Vertex<Long, Long>> result= data.collect();

		expectedResult = "1,1\n" +
				"2,2\n" +
				"3,3\n" +
				"4,4\n" +
				"5,5\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testAddVerticesBothExisting() throws Exception {
		/*
		 * Test addVertices() -- add two existing vertices
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		List<Vertex<Long, Long>> vertices = new ArrayList<>();
		vertices.add(new Vertex<>(1L, 1L));
		vertices.add(new Vertex<>(3L, 3L));

		graph = graph.addVertices(vertices);

		DataSet<Vertex<Long, Long>> data = graph.getVertices();
		List<Vertex<Long, Long>> result= data.collect();

		expectedResult = "1,1\n" +
				"2,2\n" +
				"3,3\n" +
				"4,4\n" +
				"5,5\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testAddVerticesOneExisting() throws Exception {
		/*
		 * Test addVertices() -- add an existing vertex
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		List<Vertex<Long, Long>> vertices = new ArrayList<>();
		vertices.add(new Vertex<>(1L, 1L));
		vertices.add(new Vertex<>(6L, 6L));

		graph = graph.addVertices(vertices);

		DataSet<Vertex<Long, Long>> data = graph.getVertices();
		List<Vertex<Long, Long>> result= data.collect();

		expectedResult = "1,1\n" +
				"2,2\n" +
				"3,3\n" +
				"4,4\n" +
				"5,5\n" +
				"6,6\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveVertex() throws Exception {
		/*
		 * Test removeVertex() -- simple case
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		graph = graph.removeVertex(new Vertex<>(5L, 5L));

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveVertices() throws Exception {
		/*
		 * Test removeVertices() -- simple case
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();
		verticesToBeRemoved.add(new Vertex<>(1L, 1L));
		verticesToBeRemoved.add(new Vertex<>(2L, 2L));

		graph = graph.removeVertices(verticesToBeRemoved);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveInvalidVertex() throws Exception {
		/*
		 * Test removeVertex() -- remove an invalid vertex
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		graph = graph.removeVertex(new Vertex<>(6L, 6L));

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n" +
				"5,1,51\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveOneValidOneInvalidVertex() throws Exception {
		/*
		 * Test removeVertices() -- remove one invalid vertex and a valid one
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();
		verticesToBeRemoved.add(new Vertex<>(1L, 1L));
		verticesToBeRemoved.add(new Vertex<>(7L, 7L));

		graph = graph.removeVertices(verticesToBeRemoved);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveBothInvalidVertices() throws Exception {
		/*
		 * Test removeVertices() -- remove two invalid vertices
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();
		verticesToBeRemoved.add(new Vertex<>(6L, 6L));
		verticesToBeRemoved.add(new Vertex<>(7L, 7L));

		graph = graph.removeVertices(verticesToBeRemoved);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n" +
				"5,1,51\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveBothInvalidVerticesVertexResult() throws Exception {
		/*
		 * Test removeVertices() -- remove two invalid vertices and verify the data set of vertices
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();
		verticesToBeRemoved.add(new Vertex<>(6L, 6L));
		verticesToBeRemoved.add(new Vertex<>(7L, 7L));

		graph = graph.removeVertices(verticesToBeRemoved);

		DataSet<Vertex<Long, Long>> data = graph.getVertices();
		List<Vertex<Long, Long>> result= data.collect();

		expectedResult = "1,1\n" +
				"2,2\n" +
				"3,3\n" +
				"4,4\n" +
				"5,5\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testAddEdge() throws Exception {
		/*
		 * Test addEdge() -- simple case
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		graph = graph.addEdge(new Vertex<>(6L, 6L), new Vertex<>(1L, 1L), 61L);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n" +
				"5,1,51\n" +
				"6,1,61\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testAddEdges() throws Exception {
		/*
		 * Test addEdges() -- simple case
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		List<Edge<Long, Long>> edgesToBeAdded = new ArrayList<>();
		edgesToBeAdded.add(new Edge<>(2L, 4L, 24L));
		edgesToBeAdded.add(new Edge<>(4L, 1L, 41L));

		graph = graph.addEdges(edgesToBeAdded);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"2,4,24\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,1,41\n" +
				"4,5,45\n" +
				"5,1,51\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testAddEdgesInvalidVertices() throws Exception {
		/*
		 * Test addEdges() -- the source and target vertices do not exist in the graph
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		List<Edge<Long, Long>> edgesToBeAdded = new ArrayList<>();
		edgesToBeAdded.add(new Edge<>(6L, 1L, 61L));
		edgesToBeAdded.add(new Edge<>(7L, 1L, 71L));

		graph = graph.addEdges(edgesToBeAdded);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n" +
				"5,1,51\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testAddExistingEdge() throws Exception {
		/*
		 * Test addEdge() -- add already existing edge
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L),
				12L);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n" +
				"5,1,51\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveEdge() throws Exception {
		/*
		 * Test removeEdge() -- simple case
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);

		// duplicate edge should be preserved in output
		graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);

		graph = graph.removeEdge(new Edge<>(5L, 1L, 51L));

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveEdges() throws Exception {
		/*
		 * Test removeEdges() -- simple case
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();
		edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));
		edgesToBeRemoved.add(new Edge<>(2L, 3L, 23L));

		// duplicate edge should be preserved in output
		graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);

		graph = graph.removeEdges(edgesToBeRemoved);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,2,12\n" +
				"1,3,13\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveSameEdgeTwice() throws Exception {
		/*
		 * Test removeEdges() -- try to remove the same edge twice
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();
		edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));
		edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));

		graph = graph.removeEdges(edgesToBeRemoved);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveInvalidEdge() throws Exception {
		/*
		 * Test removeEdge() -- invalid edge
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		graph = graph.removeEdge(new Edge<>(6L, 1L, 61L));

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n" +
				"5,1,51\n";

		compareResultAsTuples(result, expectedResult);
	}

	@Test
	public void testRemoveOneValidOneInvalidEdge() throws Exception {
		/*
		 * Test removeEdges() -- one edge is valid, the other is invalid
		 */

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
				TestGraphUtils.getLongLongEdgeData(env), env);
		List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();
		edgesToBeRemoved.add(new Edge<>(1L, 1L, 51L));
		edgesToBeRemoved.add(new Edge<>(6L, 1L, 61L));

		graph = graph.removeEdges(edgesToBeRemoved);

		DataSet<Edge<Long, Long>> data = graph.getEdges();
		List<Edge<Long, Long>> result= data.collect();

		expectedResult = "1,2,12\n" +
				"1,3,13\n" +
				"2,3,23\n" +
				"3,4,34\n" +
				"3,5,35\n" +
				"4,5,45\n" +
				"5,1,51\n";

		compareResultAsTuples(result, expectedResult);
	}
}


text:
{{define "content"}}

{{template "breadcrumbs" .}}

{{.Package}}

        {{if ne .Version .InstanceID}}

          Version
          {{.Version}}

        {{end}}

          Instance ID
          {{.InstanceID}}

          Download

              {{template "download-icon" .}}

          {{.HashAlgo}}
          {{.HexDigest}}

          Uploaded by
          {{.Uploader}}

          Age
          {{.Age}}

  {{if .Metadata}}

Attached metadata

      {{range $md := .Metadata}}

        {{.Age}}

          {{.Key}}

        {{if .IsEmpty}}
        no value
        {{else if .IsInlineText}}
        {{.InlineTextValue}}
        {{else}}
        {{.Size}}, {{.ContentType}}
        {{end}}

      {{end}}

  {{end}}

      {{template "tags-table" .Tags}}

      {{template "refs-table" .Refs}}

Metadata

        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>

                  Key

                  Fingerprint

                  Size

                  Content type

                  Attached by

                  Age

              Can't display binary or large data

Copied!

        <button type="button" class="btn btn-secondary" id="md-button-copy">Copy value to clipboard</button>
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>

{{end}}


text:
package org.apache.mesos.chronos.scheduler.jobs

import java.util.Collections
import java.util.concurrent.{ConcurrentHashMap, Future}
import java.util.logging.Logger

import com.codahale.metrics.{Gauge, MetricRegistry}
import com.google.common.util.concurrent.ListeningScheduledExecutorService
import com.google.inject.Inject
import org.apache.mesos.Protos.{TaskID, TaskStatus}
import org.apache.mesos.chronos.scheduler.config.SchedulerConfiguration
import org.apache.mesos.chronos.scheduler.graph.JobGraph
import org.apache.mesos.chronos.scheduler.mesos.{
  MesosDriverFactory,
  MesosOfferReviver
}
import org.apache.mesos.chronos.scheduler.state.PersistenceStore

import scala.collection.convert.decorateAsScala._
import scala.collection.{mutable, _}

/**
  * Helps manage task state and the queue which is a buffer where tasks are held until offers come in via chronos.
  *
  * @author Florian Leibert (flo@leibert.de)
  */
class TaskManager @Inject()(
    val listeningExecutor: ListeningScheduledExecutorService,
    val persistenceStore: PersistenceStore,
    val jobGraph: JobGraph,
    val mesosDriver: MesosDriverFactory,
    val jobsObserver: JobsObserver.Observer,
    val registry: MetricRegistry,
    val config: SchedulerConfiguration,
    val mesosOfferReviver: MesosOfferReviver) {

  val log = Logger.getLogger(getClass.getName)

  /* index values into queues */
  val HIGH_PRIORITY = 0
  val NORMAL_PRIORITY = 1

  /* Maintain a queue for high priority and normal priority jobs. (Just like boarding for airlines...
   * we have no guarantees of forward progress. But jobs in the high priority line always go first.) */
  val queues = Array[java.util.concurrent.LinkedBlockingQueue[String]](
    new java.util.concurrent.LinkedBlockingQueue[String], // high priority
    new java.util.concurrent.LinkedBlockingQueue[String])
  val queuedJobs =
    Collections
      .newSetFromMap(new ConcurrentHashMap[String, java.lang.Boolean]())
      .asScala
  // normal
  val names = Array[String]("High priority", "Normal priority")
  val taskMapping: concurrent.Map[String,
                                  mutable.ListBuffer[(String, Future[_])]] =
    new ConcurrentHashMap[String, mutable.ListBuffer[(String, Future[_])]]().asScala
  val queueGauge = registry.register(
    MetricRegistry.name(classOf[TaskManager], "queueSize"),
    new Gauge[Long] {
      def getValue = queues(NORMAL_PRIORITY).size
    })
  val highQueueGauge = registry.register(
    MetricRegistry.name(classOf[TaskManager], "highQueueSize"),
    new Gauge[Long] {
      def getValue = queues(HIGH_PRIORITY).size
    })
  private val runningTasks = new mutable.HashMap[String, List[ChronosTask]]

  def getRunningTaskCount(jobName: String): Int = {
    runningTasks.getOrElse(jobName, List()).size
  }

  def jobIsRunning(jobName: String): Boolean = {
    runningTasks.contains(jobName)
  }

  def getAllTaskStatus: List[TaskStatus] = {
    runningTasks.flatMap(tasks => tasks._2).flatMap(l => l.taskStatus).toList
  }

  def addTask(jobName: String, slaveId: String, taskId: String) {
    val newTask = new ChronosTask(slaveId, taskId)
    if (runningTasks.contains(jobName)) {
      val tasks = runningTasks(jobName) ++ List(newTask)
      runningTasks(jobName) = tasks
    } else {
      runningTasks(jobName) = List(newTask)
    }
  }

  def removeTask(taskId: String) {
    try {
      val (jobName, _, _, _) = TaskUtils.parseTaskId(taskId)
      if (runningTasks.contains(jobName)) {
        val remainingTasks =
          runningTasks(jobName).filter(task => task.taskId != taskId)
        runningTasks(jobName) = remainingTasks
        if (runningTasks(jobName).isEmpty) {
          runningTasks.remove(jobName)
        }
      }
    } catch {
      case _: scala.MatchError =>
        log.warning(s"Can't remove unknown task $taskId")
    }
  }

  def updateRunningTask(taskStatus: TaskStatus): Unit = {
    val taskId = taskStatus.getTaskId.getValue
    val slaveId = taskStatus.getSlaveId.getValue
    val (jobName, _, _, _) = TaskUtils.parseTaskId(taskId)
    if (runningTasks.contains(jobName)) {
      val tasks = runningTasks(jobName)
      runningTasks(jobName) = tasks.map(task => {
        if (task.taskId == taskId) {
          new ChronosTask(slaveId, taskId, Some(taskStatus))
        } else {
          task
        }
      })
    } else {
      log.warning(s"Received status update for untracked jobName=$jobName")
      runningTasks(jobName) = List(
        new ChronosTask(slaveId, taskId, Some(taskStatus)))
    }
  }

  def removeTasksForSlave(slaveId: String): Unit = {
    // Remove any running jobs from this slave
    val jobs = runningTasks.map {
      case (jobName, tasks) =>
        val remaining = tasks.filter { task =>
          slaveId == task.slaveId
        }
        (jobName, remaining)
    }
    jobs.foreach {
      case (jobName, tasks) =>
        if (tasks.isEmpty) {
          runningTasks.remove(jobName)
        } else {
          runningTasks(jobName) = tasks
        }
    }
  }

  /**
    * Returns the first task in the job queue
    *
    * @return a 2-tuple consisting of taskId (String) and job (BaseJob).
    */
  def getTaskFromQueue: Option[(String, BaseJob)] = {
    getTaskHelper(HIGH_PRIORITY).orElse(getTaskHelper(NORMAL_PRIORITY))
  }

  private def getTaskHelper(num: Integer) = {
    val queue = queues(num)
    val name = names(num)
    val taskId = queue.poll()
    if (taskId == null) {
      log.fine(s"$name queue empty")
      None
    } else {
      removedFromQueue(taskId)
      log.info(s"$name queue contains task: $taskId")
      val jobOption =
        jobGraph.getJobForName(TaskUtils.getJobNameForTaskId(taskId))

      //If the job was deleted after the taskId was added to the queue, the task could be empty.
      if (jobOption.isEmpty) {
        None
      } else if (jobOption.get.disabled) {
        jobsObserver.apply(JobExpired(jobOption.get, taskId))
        None
      } else {
        Some(taskId, jobOption.get)
      }
    }
  }

  /**
    * Removes a future-task mapping thus signaling that a task has been added to the local queue awaiting execution from
    * chronos.
    *
    * @param task ScheduledTask to remove
    */
  def removeTaskFutureMapping(task: ScheduledTask) {
    log.info("Removing task mapping")
    taskMapping.get(task.job.name) match {
      case Some(i) =>
        taskMapping += (task.job.name -> i.filter({ x =>
          x._1 != task.taskId
        }))
      case _ =>
    }
  }

  /**
    * Cancels all tasks that are delay scheduled with the underlying executor.
    */
  def flush() {
    taskMapping
      .clone()
      .values
      .foreach(
        _.foreach {
          case (taskId, futureTask) =>
            log.info("Cancelling task '%s'".format(taskId))
            futureTask.cancel(true)
        }
      )
    taskMapping.clear()
    queues.foreach(_.clear())
  }

  def queueContains(taskId: String): Boolean = {
    val jobName = TaskUtils.getJobNameForTaskId(taskId)
    queuedJobs.contains(jobName)
  }

  def setAsQueued(taskId: String): Unit = {
    val jobName = TaskUtils.getJobNameForTaskId(taskId)
    queuedJobs += jobName
  }

  def removedFromQueue(taskId: String): Unit = {
    val jobName = TaskUtils.getJobNameForTaskId(taskId)
    queuedJobs -= jobName
  }

  def enqueue(taskId: String, highPriority: Boolean) {
    // Check if it's already enqueued
    if (queueContains(taskId)) {
      log.fine(
        s"Task '$taskId' asked to be queued, but it was already enqueued")
      return
    }
    /* Don't want to change previous logging if we don't have to... */
    log.fine(
      s"Adding task '$taskId' to ${if (highPriority) "high priority" else ""} queue")
    val _priority = if (highPriority) HIGH_PRIORITY else NORMAL_PRIORITY
    setAsQueued(taskId)
    queues(_priority).add(taskId)

    val jobName = TaskUtils.getJobNameForTaskId(taskId)
    val jobOption = jobGraph.lookupVertex(jobName)
    if (jobOption.isEmpty) {
      log.warning("JobSchedule '%s' no longer registered.".format(jobName))
    } else {
      val (_, _, attempt, _) = TaskUtils.parseTaskId(taskId)
      val job = jobOption.get
      jobsObserver.apply(JobQueued(job, taskId, attempt))
    }

    if (config.reviveOffersForNewJobs()) {
      mesosOfferReviver.reviveOffers()
    }
  }

  def cancelMesosTasks(job: BaseJob) {
    if (runningTasks.contains(job.name)) {
      runningTasks(job.name).foreach({ task =>
        log.warning(s"Killing taskId=${task.taskId})")
        mesosDriver.get.killTask(
          TaskID.newBuilder().setValue(task.taskId).build())
      })
    }
  }

  class ChronosTask(val slaveId: String,
                    val taskId: String,
                    var taskStatus: Option[TaskStatus] = None) {
    override def toString: String = {
      s"slaveId=$slaveId, taskStatus=${taskStatus.getOrElse("none").toString}"
    }
  }

}


text:
require 'wsdl/info'
require 'soap/mapping'
require 'soap/mapping/type_map'
require 'xsd/codegen/gensupport'

module WSDL
module SOAP

# requires @defined_const, @simpletypes, @name_creator
module ClassDefCreatorSupport
  include XSD::CodeGen::GenSupport

  def mapped_class_name(qname, modulepath)
    @name_creator.assign_name(qname, modulepath)
  end

  def mapped_class_basename(qname, modulepath)
    classname = @name_creator.assign_name(qname, modulepath)
    classname.sub(/\A.*:/, '')
  end

  def basetype_mapped_class(name)
    ::SOAP::TypeMap[name]
  end

  def dump_method_signature(name, operation, element_definitions)
    methodname = safemethodname(name)
    input = operation.input
    output = operation.output
    fault = operation.fault
    signature = "#{methodname}#{dump_inputparam(input)}"
    str = <<__EOD__
# SYNOPSIS
#   #{methodname}#{dump_inputparam(input)}
#
# ARGS
#{dump_inout_type(input, element_definitions).chomp}
#
# RETURNS
#{dump_inout_type(output, element_definitions).chomp}
#
__EOD__
    unless fault.empty?
      str += <<__EOD__
# RAISES
#{dump_fault_type(fault, element_definitions)}
#
__EOD__
    end
    str
  end

  def dq(ele)
    ele.dump
  end

  def ndq(ele)
    ele.nil? ? 'nil' : dq(ele)
  end

  def sym(ele)
    ':' + ele.id2name
  end

  def nsym(ele)
    ele.nil? ? 'nil' : sym(ele)
  end

  def dqname(qname)
    if @defined_const.key?(qname.namespace)
      qname.dump(@defined_const[qname.namespace])
    else
      qname.dump
    end
  end

  def assign_const(value, prefix = '')
    return if value.nil? or @defined_const.key?(value)
    name = value.scan(/[^:\/]+\/?\z/)[0] || 'C'
    tag = prefix + safeconstname(name)
    if @defined_const.value?(tag)
      idx = 0
      while true
        tag = prefix + safeconstname(name + "_#{idx}")
        break unless @defined_const.value?(tag)
        idx += 1
        raise RuntimeError.new("too much similar names") if idx > 100
      end
    end
    @defined_const[value] = tag
  end

  def create_type_name(modulepath, element)
    if element.type == XSD::AnyTypeName
      # nil means anyType.
      nil
    elsif simpletype = @simpletypes[element.type]
      if simpletype.restriction and simpletype.restriction.enumeration?
        mapped_class_name(element.type, modulepath)
      else
        nil
      end
    elsif klass = element_basetype(element)
      klass.name
    elsif element.type
      mapped_class_name(element.type, modulepath)
    elsif element.ref
      mapped_class_name(element.ref, modulepath)
    elsif element.anonymous_type?
      # inner class
      mapped_class_name(element.name, modulepath)
    else
      nil
    end
  end

private

  def dump_inout_type(param, element_definitions)
    if param
      message = param.find_message
      params = ""
      message.parts.each do |part|
        name = safevarname(part.name)
        if part.type
          typename = safeconstname(part.type.name)
          qname = part.type
          params << add_at("#   #{name}", "#{typename} - #{qname}\n", 20)
        elsif part.element
          ele = element_definitions[part.element]
          if ele.type
            typename = safeconstname(ele.type.name)
            qname = ele.type
          else
            typename = safeconstname(ele.name.name)
            qname = ele.name
          end
          params << add_at("#   #{name}", "#{typename} - #{qname}\n", 20)
        end
      end
      unless params.empty?
        return params
      end
    end
    "#   N/A\n"
  end

  def dump_inputparam(input)
    message = input.find_message
    params = ""
    message.parts.each do |part|
      params << ", " unless params.empty?
      params << safevarname(part.name)
    end
    if params.empty?
      ""
    else
      "(#{ params })"
    end
  end

  def add_at(base, str, pos)
    if base.size >= pos
      base + ' ' + str
    else
      base + ' ' * (pos - base.size) + str
    end
  end

  def dump_fault_type(fault, element_definitions)
    fault.collect { |ele|
      dump_inout_type(ele, element_definitions).chomp
    }.join("\n")
  end

  def element_basetype(ele)
    if klass = basetype_class(ele.type)
      klass
    elsif ele.local_simpletype
      basetype_class(ele.local_simpletype.base)
    else
      nil
    end
  end

  def attribute_basetype(attr)
    if klass = basetype_class(attr.type)
      klass
    elsif attr.local_simpletype
      basetype_class(attr.local_simpletype.base)
    else
      nil
    end
  end

  def basetype_class(type)
    return nil if type.nil?
    if simpletype = @simpletypes[type]
      basetype_mapped_class(simpletype.base)
    else
      basetype_mapped_class(type)
    end
  end

  def name_element(element)
    return element.name if element.name
    return element.ref if element.ref
    raise RuntimeError.new("cannot define name of #{element}")
  end

  def name_attribute(attribute)
    return attribute.name if attribute.name
    return attribute.ref if attribute.ref
    raise RuntimeError.new("cannot define name of #{attribute}")
  end

  # TODO: run MethodDefCreator just once in 1.6.X.
  # MethodDefCreator should return parsed struct, not a String.
  def collect_assigned_method(wsdl, porttypename, modulepath = nil)
    name_creator = WSDL::SOAP::ClassNameCreator.new
    methoddefcreator =
      WSDL::SOAP::MethodDefCreator.new(wsdl, name_creator, modulepath, {})
    methoddefcreator.dump(porttypename)
    methoddefcreator.assigned_method
  end
end

end
end


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

using System.Management.Automation;
using Microsoft.Azure.Commands.DataLakeStore.Models;
using Microsoft.Azure.Management.DataLake.Store.Models;

namespace Microsoft.Azure.Commands.DataLakeStore
{
    [Cmdlet(VerbsDiagnostic.Test, "AzureRmDataLakeStoreItem"), OutputType(typeof (bool))]
    public class TestAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase
    {
        [Parameter(ValueFromPipelineByPropertyName = true, Position = 0, Mandatory = true,
            HelpMessage = "The DataLakeStore account to execute the filesystem operation in")]
        [ValidateNotNullOrEmpty]
        [Alias("AccountName")]
        public string Account { get; set; }

        [Parameter(ValueFromPipelineByPropertyName = true, Position = 1, Mandatory = true,
            HelpMessage = "The path in the specified Data Lake account to test for the existence of the file. " +
                          "In the format '/folder/file.txt', " +
                          "where the first '/' after the DNS indicates the root of the file system.")]
        [ValidateNotNull]
        public DataLakeStorePathInstance Path { get; set; }

        [Parameter(ValueFromPipelineByPropertyName = true, Position = 2, Mandatory = false,
            HelpMessage = "Indicates the type of path expected when testing. Valid values are Any, File or Folder.")]
        public DataLakeStoreEnums.PathType PathType { get; set; }

        public override void ExecuteCmdlet()
        {
            FileType fileType;
            if (DataLakeStoreFileSystemClient.TestFileOrFolderExistence(Path.TransformedPath, Account, out fileType))
            {
                if (PathType == DataLakeStoreEnums.PathType.Any)
                {
                    WriteObject(true);
                }
                else if (PathType == DataLakeStoreEnums.PathType.File && fileType == FileType.File)
                {
                    WriteObject(true);
                }
                else if (PathType == DataLakeStoreEnums.PathType.Folder && fileType == FileType.Directory)
                {
                    WriteObject(true);
                }
                else
                {
                    WriteObject(false);
                }
            }
            else
            {
                WriteObject(false);
            }
        }
    }
}


text:
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "${SCRIPT_DIR}/env.sh"

set -e -x

cd $SCRIPT_DIR

## Clone paraview github repository
git clone https://gitlab.kitware.com/paraview/paraview-superbuild.git superbuild
cd superbuild
git fetch origin
git submodule update --init --recursive
git checkout $PV_SUPERBUILD_VERSION
git submodule update --init --recursive

# Currently we only have an OpenMP patch for v5.9.0 and for all others we do not
# apply a patch.
if [ "${PV_SUPERBUILD_VERSION}" = "v5.9.0" ]; then
  git apply "$SCRIPT_DIR/paraview-superbuild-openmp.${PV_SUPERBUILD_VERSION}.patch"
fi

cd ..

git clone $PV_GIT_REPO src
cd src
git fetch origin
git checkout $PV_VERSION
git submodule update --init --recursive


text:
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

import { Book } from '../models/book';

@Component({
  selector: 'tr-book-details',
  templateUrl: './book-details.component.html',
  styleUrls: ['./book-details.component.sass']
})
export class BookDetailsComponent implements OnInit {
  book: Book;

  constructor(
    private route: ActivatedRoute) { }

  ngOnInit() {
    this.book = this.route.snapshot.data.book;
    // this.book$ = this.route.data.map(data => data.book);
  }
}


text:
"""Erlang port protocol."""

__author__ = "Dmitry Vasiliev <dima@hlabs.org>"
__version__ = "1.0"

from erlport.erlterms import Atom, List, ImproperList


text:
requirejs.config({
  'baseUrl': '/demoapp',
  'paths': {
    'app': 'js/app',
    'jquery': 'js/lib/jquery-latest',
    'underscore': 'js/lib/underscore-min',
    'backbone': 'js/lib/backbone-min',
    'handlebars': 'js/lib/handlebars-v1.3.0',
	'hbs': 'js/lib/require-handlebars-plugin/hbs',
  },
  'hbs': { // optional
      helpers: true,            // default: true
      i18n: false,              // default: false
      templateExtension: 'html', // default: 'hbs'
      partialsUrl: ''           // default: ''
  },
  'shim': {
	    'underscore': {
	      'exports': '_'
	    },
	    'backbone': {
	      'deps': ['jquery', 'underscore'],
	      'exports': 'Backbone'
	    },
	    'handlebars': {
	      'exports': 'Handlebars'
	    }
	  }
});

require(['backbone', 'app/app'], function(Backbone, Application) {

	window.app = Application;

	$(function(){
		Backbone.history.start();
		Application.navigate('', { trigger: true });
		//app.navigate('menu-items/samosa', { trigger: true });
	});
});


text:
package org.jtrim2.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * Contains static helper methods for shutting down an application.
 *
 *
Thread safety

 * Unless otherwise noted, methods of this class are safe to use by multiple
 * threads concurrently.
 *
 *
Synchronization transparency

 * Unless otherwise noted, methods of this class are not
 * synchronization transparent.
 */
public final class ShutdownHelper {
    private static void trySleep(int ms) {
        try {
            Thread.sleep(ms);
        } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
        }
    }

    private static void startShutdownTask(Runnable task, int status,
            boolean daemon) {
        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkExit(status);
        }

        // Starting a new thread can be important if
        // task waits for an event occuring in the current thread.
        Thread exitTask = new Thread(task, "System shutdown task.");
        if (exitTask.isDaemon() != daemon) {
            exitTask.setDaemon(daemon);
        }
        exitTask.start();
    }

    /**
     * {@link Runtime#halt(int) Halts} the JVM if it does not shutdown after a
     * given timeout. This method may require certain permission from the
     * currently present security manager.
     *

     * This method will start a new daemon thread and will attempt to
     * invoke the {@code Runtime.halt} method on this daemon thread. Notice,
     * that a daemon thread is started which does not prevent the JVM to
     * shutdown. Also, this method will return immediately regardless of the
     * timeout argument.
     *

     * This method is intended to be used as a last resort shutting down if
     * the JVM fails to shutdown when the application believes it should (most
     * likely because of remaining non-daemon threads).
     *
     * @param status the {@code int} value to be passed to the
     *   {@code Runtime.halt} method. This value can be anything which is
     *   allowed by the currently present security manager.
     * @param msToWait the milliseconds to wait before actually calling the
     *   {@code Runtime.halt} method. This argument must be greater than or
     *   equal to zero.
     *
     * @throws IllegalArgumentException thrown if the specified timeout value
     *   is lower than zero
     * @throws SecurityException thrown if there is a security manager present
     *   and its {@link SecurityManager#checkExit(int) checkExit} method does
     *   not allow to terminate with the given status
     *
     * @see #exitLater(int, int)
     * @see #exitLater(Runnable, int, int)
     */
    public static void haltLater(final int status, final int msToWait) {
        ExceptionHelper.checkArgumentInRange(msToWait,
                0, Integer.MAX_VALUE, "msToWait");

        if (msToWait == 0) {
            Runtime.getRuntime().halt(status);
        }

        startShutdownTask(() -> {
            try {
                trySleep(msToWait);
            } finally {
                Runtime.getRuntime().halt(status);
            }
        }, status, true);
    }

    /**
     * {@link System#exit(int) Exits} the JVM if it does not shutdown after a
     * given timeout. This method may require certain permission from the
     * currently present security manager.
     *

     * This method will start a new daemon thread and will attempt to
     * invoke the {@code System.exit} method on this daemon thread. Notice,
     * that a daemon thread is started which does not prevent the JVM to
     * shutdown. Also, this method will return immediately regardless of the
     * timeout argument.
     *

     * This method is intended to be used as a last resort shutting down if
     * the JVM fails to shutdown when the application believes it should (most
     * likely because of remaining non-daemon threads).
     *
     * @param status the {@code int} value to be passed to the
     *   {@code System.exit} method. This value can be anything which is
     *   allowed by the currently present security manager.
     * @param msToWait the milliseconds to wait before actually calling the
     *   {@code System.exit} method. This argument must be greater than or
     *   equal to zero.
     *
     * @throws IllegalArgumentException thrown if the specified timeout value
     *   is lower than zero
     * @throws SecurityException thrown if there is a security manager present
     *   and its {@link SecurityManager#checkExit(int) checkExit} method does
     *   not allow to terminate with the given status
     *
     * @see #exitLater(Runnable, int, int)
     * @see #haltLater(int, int)
     */
    public static void exitLater(final int status, final int msToWait) {
        ExceptionHelper.checkArgumentInRange(msToWait,
                0, Integer.MAX_VALUE, "msToWait");

        if (msToWait == 0) {
            System.exit(status);
        }

        startShutdownTask(() -> {
            try {
                trySleep(msToWait);
            } finally {
                System.exit(status);
            }
        }, status, true);
    }

    /**
     * {@link System#exit(int) Exits} the JVM if it does not shutdown after a
     * given timeout and executes a given task before shutting down. This method
     * may require certain permission from the currently present security
     * manager.
     *

     * The method will start a new non-daemon thread and will execute the task
     * on this thread. After this task completes, it will start a new daemon
     * thread and after the given timeout, it will attempt to invoke the
     * {@code System.exit} method on this daemon thread. Notice, that a daemon
     * thread is started which does not prevent the JVM to shutdown. Also, this
     * method will return immediately regardless of the timeout argument.
     *

     * This method is intended to be used as a last resort shutting down if
     * the JVM fails to shutdown when the application believes it should (most
     * likely because of remaining non-daemon threads).
     *
     * @param exitTask the task to be executed before shutting down the JVM.
     *   This argument can be {@code null}, in which case no task will be
     *   executed.
     * @param status the {@code int} value to be passed to the
     *   {@code System.exit} method. This value can be anything which is
     *   allowed by the currently present security manager.
     * @param msToWait the milliseconds to wait before actually calling the
     *   {@code System.exit} method. This argument must be greater than or
     *   equal to zero.
     *
     * @throws IllegalArgumentException thrown if the specified timeout value
     *   is lower than zero
     * @throws SecurityException thrown if there is a security manager present
     *   and its {@link SecurityManager#checkExit(int) checkExit} method does
     *   not allow to terminate with the given status
     *
     * @see #exitLater(int, int)
     * @see #haltLater(int, int)
     */
    public static void exitLater(final Runnable exitTask, final int status,
            final int msToWait) {
        ExceptionHelper.checkArgumentInRange(msToWait,
                0, Integer.MAX_VALUE, "msToWait");

        startShutdownTask(() -> {
            try {
                if (exitTask != null) {
                    exitTask.run();
                }
            } finally {
                exitLater(status, msToWait);
            }
        }, status, false);
    }

    /**
     * Immediately starts a non-daemon thread, executes the specified task
     * on it and {@link System#exit(int) terminates} the JVM.
     *
     * @param exitTask the task to be executed before shutting down the JVM.
     *   This argument can be {@code null}, in which case no task will be
     *   executed.
     * @param status the {@code int} value to be passed to the
     *   {@code System.exit} method. This value can be anything which is
     *   allowed by the currently present security manager.
     *
     * @throws SecurityException thrown if there is a security manager present
     *   and its {@link SecurityManager#checkExit(int) checkExit} method does
     *   not allow to terminate with the given status
     */
    public static void exit(final Runnable exitTask, final int status) {
        startShutdownTask(() -> {
            try {
                if (exitTask != null) {
                    exitTask.run();
                }
            } finally {
                System.exit(status);
            }
        }, status, false);
    }

    /**
     * Invokes the {@link ExecutorService#shutdown() shutdown} method of the
     * specified executors.
     *
     * @param executors the array of executors whose {@code shutdown} method is
     *   to be called. This argument cannot be {@code null} and cannot contain
     *   {@code null} elements.
     *
     * @throws NullPointerException thrown if the specified array is
     *   {@code null} or contains {@code null} elements
     */
    public static void shutdownExecutors(ExecutorService... executors) {
        ExceptionHelper.checkNotNullElements(executors, "executors");

        for (ExecutorService executor: executors) {
            executor.shutdown();
        }
    }

    /**
     * Invokes the {@link ExecutorService#shutdownNow() shutdownNow} method of
     * the specified executors and returns all the tasks returned by these
     * {@code shutdownNow} methods in a single list.
     *
     * @param executors the array of executors whose {@code shutdownNow} method
     *   is to be called. This argument cannot be {@code null} and cannot
     *   contain {@code null} elements.
     * @return the list of tasks returned by the {@code shutdownNow} methods
     *   of the specified executors. This list is the concatenation of the task
     *   lists returned by the {@code shutdownNow} methods. This method
     *   never returns {@code null}.
     *
     * @throws NullPointerException thrown if the specified array is
     *   {@code null} or contains {@code null} elements
     */
    public static List<Runnable> shutdownNowExecutors(
            ExecutorService... executors) {
        ExceptionHelper.checkNotNullElements(executors, "executors");

        List<Runnable> result = new ArrayList<>();

        for (ExecutorService executor: executors) {
            result.addAll(executor.shutdownNow());
        }

        return result;
    }

    /**
     * Waits until all the specified executors terminate or the current thread
     * gets interrupted. In case the current thread gets interrupted, this
     * method returns immediately and keeps the interrupted status of the
     * thread.
     *
     * @param executors the executors to wait to be terminated. This argument
     *   cannot be {@code null} and cannot contain {@code null} elements.
     *
     * @throws NullPointerException thrown if the specified executor array is
     *   {@code null} or one of the executors is {@code null}
     *
     * @see #awaitTerminateExecutors(ExecutorService[])
     */
    public static void awaitTerminateExecutorsSilently(
            ExecutorService... executors) {

        try {
            awaitTerminateExecutors(executors);
        } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
        }
    }

    /**
     * Waits until all the specified executors terminate or the given timeout
     * elapses or the current thread gets interrupted. In case the current
     * thread gets interrupted, this method returns immediately and keeps the
     * interrupted status of the thread.
     *
     * @param timeout the maximum time to wait for the executors to terminate
     *   in the given time unit. This argument must be greater than or equal to
     *   zero.
     * @param timeunit the time unit of the timeout argument. This argument
     *   cannot be {@code null}.
     * @param executors the executors to wait to be terminated. This argument
     *   cannot be {@code null} and cannot contain {@code null} elements.
     * @return {@code true} if the specified executors have terminated,
     *   {@code false} if the timeout expired or the current got interrupted
     *   before the executors terminated
     *
     * @throws IllegalArgumentException thrown if the specified timeout value
     *   is lower than zero
     * @throws NullPointerException thrown if the {@code timeunit} argument or
     *   the specified executor array or one of the executors is {@code null}
     *
     * @see #awaitTerminateExecutors(long, TimeUnit, ExecutorService[])
     */
    public static boolean awaitTerminateExecutorsSilently(
            long timeout, TimeUnit timeunit, ExecutorService... executors) {

        boolean result = false;
        try {
            result = awaitTerminateExecutors(timeout, timeunit, executors);
        } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
        }
        return result;
    }

    /**
     * Waits until all the specified executors terminate or the current thread
     * gets interrupted. In case the current thread gets interrupted, this
     * method will throw an {@link InterruptedException} and clear the
     * interrupted status of the thread.
     *
     * @param executors the executors to wait to be terminated. This argument
     *   cannot be {@code null} and cannot contain {@code null} elements.
     *
     * @throws InterruptedException thrown if the current thread was interrupted
     *   before all the specified executor has terminated
     * @throws NullPointerException thrown if the specified executor array is
     *   {@code null} or one of the executors is {@code null}
     *
     * @see #awaitTerminateExecutorsSilently(ExecutorService[])
     */
    public static void awaitTerminateExecutors(ExecutorService... executors)
            throws InterruptedException {
        ExceptionHelper.checkNotNullElements(executors, "executors");

        for (ExecutorService executor: executors) {
            if (!executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS)) {
                // After waiting about 300 years we should interrupt ourselves
                // and not wait another century.
                throw new InterruptedException();
            }
        }
    }

    /**
     * Waits until all the specified executors terminate or the given timeout
     * elapses or the current thread gets interrupted. In case the current
     * thread gets interrupted, this method will throw an
     * {@link InterruptedException} and clear the interrupted status of the
     * thread.
     *
     * @param timeout the maximum time to wait for the executors to terminate
     *   in the given time unit. This argument must be greater than or equal to
     *   zero.
     * @param timeunit the time unit of the timeout argument. This argument
     *   cannot be {@code null}.
     * @param executors the executors to wait to be terminated. This argument
     *   cannot be {@code null} and cannot contain {@code null} elements.
     * @return {@code true} if the specified executors have terminated before
     *   the given timeout expired, {@code false} otherwise
     *
     * @throws InterruptedException thrown if the current thread was interrupted
     *   before all the specified executor has terminated or the given timeout
     *   expired
     * @throws IllegalArgumentException thrown if the specified timeout value
     *   is lower than zero
     * @throws NullPointerException thrown if the {@code timeunit} argument or
     *   the specified executor array or one of the executors is {@code null}
     *
     * @see #awaitTerminateExecutorsSilently(long, TimeUnit, ExecutorService[])
     */
    public static boolean awaitTerminateExecutors(
            long timeout,
            TimeUnit timeunit,
            ExecutorService... executors) throws InterruptedException {

        ExceptionHelper.checkArgumentInRange(timeout,
                0, Long.MAX_VALUE, "timeout");
        Objects.requireNonNull(timeunit, "timeunit");
        ExceptionHelper.checkNotNullElements(executors, "executors");

        final long startTime = System.nanoTime();
        final long toWait = timeunit.toNanos(timeout);

        for (ExecutorService executor: executors) {
            long thisWait = toWait - (System.nanoTime() - startTime);
            if (thisWait <= 0) {
                break;
            }

            executor.awaitTermination(thisWait, TimeUnit.NANOSECONDS);
        }

        for (ExecutorService executor: executors) {
            if (!executor.isTerminated()) {
                return false;
            }
        }
        return true;
    }

    private ShutdownHelper() {
        throw new AssertionError();
    }
}


text:
#include "gl/SkGLContext.h"

#include <X11/Xlib.h>
#include <GL/glx.h>
#include <GL/glu.h>

namespace {

/* Note: Skia requires glx 1.3 or newer */

/* This struct is taken from a mesa demo.  Please update as required */
static const struct { int major, minor; } gl_versions[] = {
   {1, 0},
   {1, 1},
   {1, 2},
   {1, 3},
   {1, 4},
   {1, 5},
   {2, 0},
   {2, 1},
   {3, 0},
   {3, 1},
   {3, 2},
   {3, 3},
   {4, 0},
   {4, 1},
   {4, 2},
   {4, 3},
   {4, 4},
   {0, 0} /* end of list */
};
#define NUM_GL_VERSIONS SK_ARRAY_COUNT(gl_versions)

static bool ctxErrorOccurred = false;
static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) {
    ctxErrorOccurred = true;
    return 0;
}

class GLXGLContext : public SkGLContext {
public:
    GLXGLContext(GrGLStandard forcedGpuAPI);
    ~GLXGLContext() override;

private:
    void destroyGLContext();

    void onPlatformMakeCurrent() const override;
    void onPlatformSwapBuffers() const override;
    GrGLFuncPtr onPlatformGetProcAddress(const char*) const override;

    GLXContext fContext;
    Display* fDisplay;
    Pixmap fPixmap;
    GLXPixmap fGlxPixmap;
};

GLXGLContext::GLXGLContext(GrGLStandard forcedGpuAPI)
    : fContext(NULL)
    , fDisplay(NULL)
    , fPixmap(0)
    , fGlxPixmap(0) {

    fDisplay = XOpenDisplay(0);

    if (!fDisplay) {
        SkDebugf("Failed to open X display.\n");
        this->destroyGLContext();
        return;
    }

    // Get a matching FB config
    static int visual_attribs[] = {
        GLX_X_RENDERABLE    , True,
        GLX_DRAWABLE_TYPE   , GLX_PIXMAP_BIT,
        None
    };

    int glx_major, glx_minor;

    // FBConfigs were added in GLX version 1.3.
    if (!glXQueryVersion(fDisplay, &glx_major, &glx_minor) ||
            ((glx_major == 1) && (glx_minor < 3)) || (glx_major < 1)) {
        SkDebugf("GLX version 1.3 or higher required.\n");
        this->destroyGLContext();
        return;
    }

    //SkDebugf("Getting matching framebuffer configs.\n");
    int fbcount;
    GLXFBConfig *fbc = glXChooseFBConfig(fDisplay, DefaultScreen(fDisplay),
                                          visual_attribs, &fbcount);
    if (!fbc) {
        SkDebugf("Failed to retrieve a framebuffer config.\n");
        this->destroyGLContext();
        return;
    }
    //SkDebugf("Found %d matching FB configs.\n", fbcount);

    // Pick the FB config/visual with the most samples per pixel
    //SkDebugf("Getting XVisualInfos.\n");
    int best_fbc = -1, best_num_samp = -1;

    int i;
    for (i = 0; i < fbcount; ++i) {
        XVisualInfo *vi = glXGetVisualFromFBConfig(fDisplay, fbc[i]);
        if (vi) {
            int samp_buf, samples;
            glXGetFBConfigAttrib(fDisplay, fbc[i], GLX_SAMPLE_BUFFERS, &samp_buf);
            glXGetFBConfigAttrib(fDisplay, fbc[i], GLX_SAMPLES, &samples);

            //SkDebugf("  Matching fbconfig %d, visual ID 0x%2x: SAMPLE_BUFFERS = %d,"
            //       " SAMPLES = %d\n",
            //        i, (unsigned int)vi->visualid, samp_buf, samples);

            if (best_fbc < 0 || (samp_buf && samples > best_num_samp))
                best_fbc = i, best_num_samp = samples;
        }
        XFree(vi);
    }

    GLXFBConfig bestFbc = fbc[best_fbc];

    // Be sure to free the FBConfig list allocated by glXChooseFBConfig()
    XFree(fbc);

    // Get a visual
    XVisualInfo *vi = glXGetVisualFromFBConfig(fDisplay, bestFbc);
    //SkDebugf("Chosen visual ID = 0x%x\n", (unsigned int)vi->visualid);

    fPixmap = XCreatePixmap(fDisplay, RootWindow(fDisplay, vi->screen), 10, 10, vi->depth);

    if (!fPixmap) {
        SkDebugf("Failed to create pixmap.\n");
        this->destroyGLContext();
        return;
    }

    fGlxPixmap = glXCreateGLXPixmap(fDisplay, vi, fPixmap);

    // Done with the visual info data
    XFree(vi);

    // Create the context

    // Install an X error handler so the application won't exit if GL 3.0
    // context allocation fails.
    //
    // Note this error handler is global.
    // All display connections in all threads of a process use the same
    // error handler, so be sure to guard against other threads issuing
    // X commands while this code is running.
    ctxErrorOccurred = false;
    int (*oldHandler)(Display*, XErrorEvent*) =
        XSetErrorHandler(&ctxErrorHandler);

    // Get the default screen's GLX extension list
    const char *glxExts = glXQueryExtensionsString(
        fDisplay, DefaultScreen(fDisplay)
    );

    // Check for the GLX_ARB_create_context extension string and the function.
    // If either is not present, use GLX 1.3 context creation method.
    if (!gluCheckExtension(reinterpret_cast<const GLubyte*>("GLX_ARB_create_context"),
                           reinterpret_cast<const GLubyte*>(glxExts))) {
        if (kGLES_GrGLStandard != forcedGpuAPI) {
            fContext = glXCreateNewContext(fDisplay, bestFbc, GLX_RGBA_TYPE, 0, True);
        }
    } else {
        //SkDebugf("Creating context.\n");
        PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB =
            (PFNGLXCREATECONTEXTATTRIBSARBPROC) glXGetProcAddressARB((GrGLubyte*)"glXCreateContextAttribsARB");

        if (kGLES_GrGLStandard == forcedGpuAPI) {
            if (gluCheckExtension(
                    reinterpret_cast<const GLubyte*>("GLX_EXT_create_context_es2_profile"),
                    reinterpret_cast<const GLubyte*>(glxExts))) {
                static const int context_attribs_gles[] = {
                    GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
                    GLX_CONTEXT_MINOR_VERSION_ARB, 0,
                    GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
                    None
                };
                fContext = glXCreateContextAttribsARB(fDisplay, bestFbc, 0, True,
                                                      context_attribs_gles);
            }
        } else {
            // Well, unfortunately GLX will not just give us the highest context so instead we have
            // to do this nastiness
            for (i = NUM_GL_VERSIONS - 2; i > 0 ; i--) {
                /* don't bother below GL 3.0 */
                if (gl_versions[i].major == 3 && gl_versions[i].minor == 0) {
                    break;
                }
                // On Nvidia GPUs, to use Nv Path rendering we need a compatibility profile for the
                // time being.
                // TODO when Nvidia implements NVPR on Core profiles, we should start requesting
                // core here
                static const int context_attribs_gl[] = {
                      GLX_CONTEXT_MAJOR_VERSION_ARB, gl_versions[i].major,
                      GLX_CONTEXT_MINOR_VERSION_ARB, gl_versions[i].minor,
                      GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
                      None
                };
                fContext =
                        glXCreateContextAttribsARB(fDisplay, bestFbc, 0, True, context_attribs_gl);

                // Sync to ensure any errors generated are processed.
                XSync(fDisplay, False);

                if (!ctxErrorOccurred && fContext) {
                    break;
                }
                // try again
                ctxErrorOccurred = false;
            }

            // Couldn't create GL 3.0 context.
            // Fall back to old-style 2.x context.
            // When a context version below 3.0 is requested,
            // implementations will return the newest context version
            // compatible with OpenGL versions less than version 3.0.
            if (ctxErrorOccurred || !fContext) {
                static const int context_attribs_gl_fallback[] = {
                    GLX_CONTEXT_MAJOR_VERSION_ARB, 1,
                    GLX_CONTEXT_MINOR_VERSION_ARB, 0,
                    None
                };

                ctxErrorOccurred = false;

                fContext = glXCreateContextAttribsARB(fDisplay, bestFbc, 0, True,
                                                      context_attribs_gl_fallback);
            }
        }
    }

    // Sync to ensure any errors generated are processed.
    XSync(fDisplay, False);

    // Restore the original error handler
    XSetErrorHandler(oldHandler);

    if (ctxErrorOccurred || !fContext) {
        SkDebugf("Failed to create an OpenGL context.\n");
        this->destroyGLContext();
        return;
    }

    // Verify that context is a direct context
    if (!glXIsDirect(fDisplay, fContext)) {
        //SkDebugf("Indirect GLX rendering context obtained.\n");
    } else {
        //SkDebugf("Direct GLX rendering context obtained.\n");
    }

    //SkDebugf("Making context current.\n");
    if (!glXMakeCurrent(fDisplay, fGlxPixmap, fContext)) {
      SkDebugf("Could not set the context.\n");
        this->destroyGLContext();
        return;
    }

    SkAutoTUnref<const GrGLInterface> gl(GrGLCreateNativeInterface());
    if (NULL == gl.get()) {
        SkDebugf("Failed to create gl interface");
        this->destroyGLContext();
        return;
    }

    if (!gl->validate()) {
        SkDebugf("Failed to validate gl interface");
        this->destroyGLContext();
        return;
    }

    this->init(gl.detach());
}

GLXGLContext::~GLXGLContext() {
    this->teardown();
    this->destroyGLContext();
}

void GLXGLContext::destroyGLContext() {
    if (fDisplay) {
        glXMakeCurrent(fDisplay, 0, 0);

        if (fContext) {
            glXDestroyContext(fDisplay, fContext);
            fContext = NULL;
        }

        if (fGlxPixmap) {
            glXDestroyGLXPixmap(fDisplay, fGlxPixmap);
            fGlxPixmap = 0;
        }

        if (fPixmap) {
            XFreePixmap(fDisplay, fPixmap);
            fPixmap = 0;
        }

        XCloseDisplay(fDisplay);
        fDisplay = NULL;
    }
}

void GLXGLContext::onPlatformMakeCurrent() const {
    if (!glXMakeCurrent(fDisplay, fGlxPixmap, fContext)) {
        SkDebugf("Could not set the context.\n");
    }
}

void GLXGLContext::onPlatformSwapBuffers() const {
    glXSwapBuffers(fDisplay, fGlxPixmap);
}

GrGLFuncPtr GLXGLContext::onPlatformGetProcAddress(const char* procName) const {
    return glXGetProcAddress(reinterpret_cast<const GLubyte*>(procName));
}

} // anonymous namespace

SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
    GLXGLContext* ctx = SkNEW_ARGS(GLXGLContext, (forcedGpuAPI));
    if (!ctx->isValid()) {
        SkDELETE(ctx);
        return NULL;
    }
    return ctx;
}


text:
package com.vmware.vim25;

/**
 * @author Steve Jin (http://www.doublecloud.org)
 * @version 5.1
 */

@SuppressWarnings("all")
public class HttpNfcLeaseManifestEntry extends DynamicData {
    public String key;
    public String sha1;
    public long size;
    public boolean disk;
    public Long capacity;
    public Long populatedSize;

    public String getKey() {
        return this.key;
    }

    public String getSha1() {
        return this.sha1;
    }

    public long getSize() {
        return this.size;
    }

    public boolean isDisk() {
        return this.disk;
    }

    public Long getCapacity() {
        return this.capacity;
    }

    public Long getPopulatedSize() {
        return this.populatedSize;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public void setSha1(String sha1) {
        this.sha1 = sha1;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public void setDisk(boolean disk) {
        this.disk = disk;
    }

    public void setCapacity(Long capacity) {
        this.capacity = capacity;
    }

    public void setPopulatedSize(Long populatedSize) {
        this.populatedSize = populatedSize;
    }
}


text:
ACCEPTED

#### According to
IRMNG Homonym List

#### Published in
NATO ASI (Adv Sci Inst) Ser Ser C Math Phys Sci 327: 803.

#### Original name
null

### Remarks
null


text:
package water.fvec;

import water.*;
import water.rapids.ast.AstPrimitive;
import water.rapids.ast.AstRoot;
import water.rapids.Env;
import water.rapids.ast.params.AstNum;

/**
 * This wrapper pushes a transform down into each chunk so that
 * transformations will happen on-the-fly. When wrapped and there
 * are Op instances to be applied, the atd call will supersede the
 * usual chunk-at retrieval with a "special" atd call.
 *
 * Overhead added per element fetch per chunk is another virtual call
 * per Op per element (per Chunk). As has been noted (see e.g. RollupStats),
 * virtual calls are expensive, but the memory savings are substantial.
 *
 * AutoML can freely transform columns without ramification.
 *
 * Each wrapped Vec will track its own transformations, which makes it easy
 * when generating a POJO.
 *
 * A TransformWrappedVec is actually a function of one or more Vec instances.
 *
 * This class exists here so that Chunk and NewChunk don't need to become fully public
 * (since java has no friends). Other packages (not just core H2O) depend on this class!
 *
 *
 * @author spencer
 */
public class TransformWrappedVec extends WrappedVec {

  private final Key<Vec>[] _masterVecKeys;
  private volatile transient Vec[] _masterVecs;
  private final TransformFactory<?> _tf;

  public TransformWrappedVec(Key<Vec> key, int rowLayout, TransformFactory<?> fact, Key<Vec>[] masterVecKeys) {
    super(key, rowLayout, null);
    _tf = fact;
    _masterVecKeys = masterVecKeys;
    DKV.put(this);
  }

  @SuppressWarnings("unchecked")
  public TransformWrappedVec(Vec v, AstPrimitive fun) {
    this(v.group().addVec(), v._rowLayout, fun, new Key[]{v._key});
  }

  @SuppressWarnings("unchecked")
  public TransformWrappedVec(Vec[] vecs, TransformFactory<?> fact) {
    this(vecs[0].group().addVec(), vecs[0]._rowLayout, fact, keys(vecs));
  }

  @SuppressWarnings("unchecked")
  private static Key<Vec>[] keys(Vec[] vecs) {
    Key[] keys = new Key[vecs.length];
    for (int i = 0; i < vecs.length; i++)
      keys[i] = vecs[i]._key;
    return keys;
  }

  public TransformWrappedVec(Key<Vec> key, int rowLayout, AstPrimitive fun, Key<Vec>[] masterVecKeys) {
    this(key, rowLayout, new AstTransformFactory(fun), masterVecKeys);
  }

  public Vec makeVec() {
    Vec v  = new MRTask() {
      @Override public void map(Chunk c, NewChunk nc) {
        c.extractRows(nc, 0,c._len);
      }
    }.doAll(Vec.T_NUM,this).outputFrame().anyVec();
    remove();
    return v;
  }

  @Override public Chunk chunkForChunkIdx(int cidx) {
    Vec[] masterVecs = _masterVecs;
    if (masterVecs == null) {
      masterVecs = new Vec[_masterVecKeys.length];
      for (int i = 0; i < masterVecs.length; i++) {
        DKV.prefetch(_masterVecKeys[i]);
      }
      for (int i = 0; i < masterVecs.length; i++) {
        masterVecs[i] = _masterVecKeys[i].get();
      }
      _masterVecs = masterVecs; // publish fetched Vecs
    }
    assert _masterVecs != null;
    Chunk[] cs = new Chunk[_masterVecs.length];
    for (int i = 0; i < cs.length; i++) {
      assert _masterVecs[i] != null;
      cs[i] = _masterVecs[i].chunkForChunkIdx(cidx);
      assert cs[i] != null;
    }
    return new TransformWrappedChunk(_tf, this, cs);
  }

  @Override public Vec doCopy() {
    Vec v = new TransformWrappedVec(group().addVec(), _rowLayout, _tf, _masterVecKeys);
    v.setDomain(domain()==null?null:domain().clone());
    return v;
  }

  public static class TransformWrappedChunk extends Chunk {

    public final transient Chunk _c[];
    public final transient Transform _t;
    public final TransformFactory<?> _fact;

    TransformWrappedChunk(TransformFactory<?> fact, Vec transformWrappedVec, Chunk... c) {
      // set all the chunk fields
      _c = c; set_len(_c[0]._len);
      _start = _c[0]._start; _vec = transformWrappedVec; _cidx = _c[0]._cidx;
      _fact = fact;
      _t = fact != null ? fact.create(c.length) : null;
    }

    @Override
    public ChunkVisitor processRows(ChunkVisitor nc, int from, int to) {
      throw H2O.unimpl();
    }

    @Override
    public ChunkVisitor processRows(ChunkVisitor nc, int... rows) {
      throw H2O.unimpl();
    }

    // applies the function to a row of doubles
    @Override public double atd_impl(int idx) {
      if( null==_fact ) return _c[0].atd(idx);  // simple wrapping of 1 vec
      _t.reset();
      for(int i = 0; i < _c.length; i++)
        _t.setInput(i, _c[i].atd(idx));
      return _t.apply();   // Make the call per-row
    }

    @Override public long at8_impl(int idx) { throw H2O.unimpl(); }
    @Override public boolean isNA_impl(int idx) { return Double.isNaN(atd_impl(idx)); }  // ouch, not quick! runs thru atd_impl
    // Returns true if the masterVec is missing, false otherwise
    @Override public boolean set_impl(int idx, long l)   { return false; }
    @Override public boolean set_impl(int idx, double d) { return false; }
    @Override public boolean set_impl(int idx, float f)  { return false; }
    @Override public boolean setNA_impl(int idx)         { return false; }

    @Override protected final void initFromBytes () { throw water.H2O.fail(); }

    public Chunk deepCopy() {
      return extractRows(new NewChunk(this),0,_len).compress();
    }
  }

  public interface Transform {
    void reset();
    void setInput(int i, double value);
    double apply();
  }

  public abstract static class Function1DTransform implements Transform {
    private double _value;
    @Override
    public void reset() {
      // noop
    }

    @Override
    public void setInput(int i, double value) {
      assert i == 0;
      _value = value;
    }

    @Override
    public double apply() {
      return apply(_value);
    }

    protected abstract double apply(double x);
  }

  public interface TransformFactory<T extends Freezable> extends Freezable<T> {
    Transform create(int n_inputs);
  }

  private static class AstTransformFactory extends Iced<AstTransformFactory> implements TransformFactory<AstTransformFactory> {
    private final AstPrimitive _fun;

    AstTransformFactory(AstPrimitive fun) {
      _fun = fun;
    }

    public AstTransformFactory() {
      this(null);
    }

    @Override
    public Transform create(int n_inputs) {
      return new AstTransform(_fun, n_inputs);
    }
  }

  private static class AstTransform implements Transform {
    private final AstPrimitive _fun;
    private final AstRoot[] _asts;
    private final Env _env;

    AstTransform(AstPrimitive fun, int n) {
      _fun = fun;
      _asts = new AstRoot[1 + n];
      _asts[0] = _fun;
      for (int i = 1; i < _asts.length; i++)
        _asts[i] = new AstNum(0);
      _env = new Env(null);
    }

    @Override
    public void setInput(int i, double value) {
      ((AstNum) _asts[i + 1]).setNum(value);
    }
    @Override
    public double apply() {
      return _fun.apply(_env,_env.stk(),_asts).getNum();
    }

    @Override
    public void reset() {
      // no need to do anything
    }
  }

}


text:
package com.siyeh.ipp.exceptions.splitTry;

import java.io.*;

public class Simple {
  void foo(File file1, File file2) throws IOException {
      tr<caret>y (FileInputStream in = new FileInputStream(file1); FileOutputStream out = new FileOutputStream(file2)) {

      }
  }
}


text:
<?php

declare(strict_types=1);

namespace Cortex\Foundation\Console\Commands;

use Illuminate\Support\Str;
use Illuminate\Console\ConfirmableTrait;
use Cortex\Foundation\Traits\ConsoleMakeModuleCommand;
use Illuminate\Foundation\Console\ListenerMakeCommand as BaseListenerMakeCommand;

class ListenerMakeCommand extends BaseListenerMakeCommand
{
    use ConfirmableTrait;
    use ConsoleMakeModuleCommand;

    /**
     * Build the class with the given name.
     *
     * @param string $name
     *
     * @return string
     */
    protected function buildClass($name): string
    {
        $event = $this->option('event');

        if (! Str::startsWith($event, [
            $this->rootNamespace(),
            'Illuminate',
            '\\',
        ])) {
            $event = $this->rootNamespace().'Events\\'.$event;
        }

        $stub = str_replace(
            'DummyEvent',
            class_basename($event),
            $this->defaultBuildClass($name)
        );

        return str_replace(
            'DummyFullEvent',
            $event,
            $stub
        );
    }

    /**
     * Build the class with the given name.
     *
     * @param string $name
     *
     * @return string
     */
    protected function defaultBuildClass($name): string
    {
        $stub = $this->files->get($this->getStub());

        return $this->replaceNamespace($stub, $name)->replaceClass($stub, $name);
    }
}


text:
  <button type="button" class="btn btn-xs btn-danger" @click="deleteAllResources()" v-if="resources.length">

    Flush all
  </button>

Requests and responses

      method
      <partial name="sortableIcon"></partial>

      url
      <partial name="sortableIcon"></partial>

      status code
      <partial name="sortableIcon"></partial>

      last modified
      <partial name="sortableIcon"></partial>

      sleep
      <partial name="sortableIcon"></partial>

      disabled

      actions

    {{resource.request.method}}

        {{resource.request.uri}}

          {{resource._id}}

      <status-code :value="resource.response.statusCode"></status-code>

    {{resource.lastModified | moment}}
    {{resource.sleep}}

      <input type="checkbox" v-model="resource.disabled" @change="toggleResource(resource)" />

      <button type="button" class="btn btn-xs btn-danger" @click="deleteResource(resource)">

      </button>