text:
package org.apache.flink.python.api.streaming.data;

import org.apache.flink.api.common.functions.AbstractRichFunction;
import org.apache.flink.configuration.ConfigConstants;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.python.api.PythonOptions;
import org.apache.flink.python.api.streaming.util.SerializationUtils.IntSerializer;
import org.apache.flink.python.api.streaming.util.SerializationUtils.StringSerializer;
import org.apache.flink.python.api.streaming.util.StreamPrinter;
import org.apache.flink.util.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicReference;

import static org.apache.flink.python.api.PythonPlanBinder.FLINK_PYTHON_DC_ID;
import static org.apache.flink.python.api.PythonPlanBinder.FLINK_PYTHON_PLAN_NAME;
import static org.apache.flink.python.api.PythonPlanBinder.PLANBINDER_CONFIG_BCVAR_COUNT;
import static org.apache.flink.python.api.PythonPlanBinder.PLANBINDER_CONFIG_BCVAR_NAME_PREFIX;
import static org.apache.flink.python.api.PythonPlanBinder.PLAN_ARGUMENTS_KEY;

/**
 * This streamer is used by functions to send/receive data to/from an external python process.
 */
public class PythonStreamer<S extends PythonSender, OUT> implements Serializable {
	protected static final Logger LOG = LoggerFactory.getLogger(PythonStreamer.class);
	private static final long serialVersionUID = -2342256613658373170L;

	protected static final int SIGNAL_BUFFER_REQUEST = 0;
	protected static final int SIGNAL_BUFFER_REQUEST_G0 = -3;
	protected static final int SIGNAL_BUFFER_REQUEST_G1 = -4;
	protected static final int SIGNAL_FINISHED = -1;
	protected static final int SIGNAL_ERROR = -2;
	protected static final byte SIGNAL_LAST = 32;

	private final Configuration config;
	private final int envID;
	private final int setID;

	private transient Process process;
	private transient Thread shutdownThread;
	protected transient ServerSocket server;
	protected transient Socket socket;
	protected transient DataInputStream in;
	protected transient DataOutputStream out;
	protected int port;

	protected S sender;
	protected PythonReceiver<OUT> receiver;

	protected AtomicReference<String> msg = new AtomicReference<>();

	protected final AbstractRichFunction function;

	protected transient Thread outPrinter;
	protected transient Thread errorPrinter;

	public PythonStreamer(AbstractRichFunction function, Configuration config, int envID, int setID, boolean usesByteArray, S sender) {
		this.config = config;
		this.envID = envID;
		this.setID = setID;
		this.receiver = new PythonReceiver<>(config, usesByteArray);
		this.function = function;
		this.sender = sender;
	}

	/**
	 * Starts the python script.
	 *
	 * @throws IOException
	 */
	public void open() throws IOException {
		server = new ServerSocket(0);
		server.setSoTimeout(50);
		startPython();
	}

	private void startPython() throws IOException {
		String tmpDir = config.getString(PythonOptions.DATA_TMP_DIR);
		if (tmpDir == null) {
			tmpDir = System.getProperty("java.io.tmpdir");
		}
		File outputFile = new File(tmpDir, envID + "_" + setID + this.function.getRuntimeContext().getIndexOfThisSubtask() + "_output");
		File inputFile = new File(tmpDir, envID + "_" + setID + this.function.getRuntimeContext().getIndexOfThisSubtask() + "_input)");

		sender.open(inputFile);
		receiver.open(outputFile);

		String path = function.getRuntimeContext().getDistributedCache().getFile(FLINK_PYTHON_DC_ID).getAbsolutePath();

		String planPath = path + FLINK_PYTHON_PLAN_NAME;

		String pythonBinaryPath = config.getString(PythonOptions.PYTHON_BINARY_PATH);

		process = Runtime.getRuntime().exec(new String[] {pythonBinaryPath, "-O", "-B", planPath, config.getString(PLAN_ARGUMENTS_KEY, "")});
		outPrinter = new Thread(new StreamPrinter(process.getInputStream()));
		outPrinter.start();
		errorPrinter = new Thread(new StreamPrinter(process.getErrorStream(), msg));
		errorPrinter.start();

		shutdownThread = new Thread() {
			@Override
			public void run() {
				try {
					destroyProcess(process);
				} catch (IOException ioException) {
					LOG.warn("Could not destroy python process.", ioException);
				}
			}
		};

		Runtime.getRuntime().addShutdownHook(shutdownThread);

		OutputStream processOutput = process.getOutputStream();
		processOutput.write("operator\n".getBytes(ConfigConstants.DEFAULT_CHARSET));
		processOutput.write((envID + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
		processOutput.write((setID + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
		processOutput.write(("" + server.getLocalPort() + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
		processOutput.write((this.function.getRuntimeContext().getIndexOfThisSubtask() + "\n")
			.getBytes(ConfigConstants.DEFAULT_CHARSET));
		processOutput.write(((config.getLong(PythonOptions.MMAP_FILE_SIZE) << 10) + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
		processOutput.write((inputFile + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
		processOutput.write((outputFile + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
		processOutput.flush();

		while (true) {
			try {
				socket = server.accept();
				break;
			} catch (SocketTimeoutException ignored) {
				checkPythonProcessHealth();
			}
		}
		in = new DataInputStream(socket.getInputStream());
		out = new DataOutputStream(socket.getOutputStream());
	}

	private void checkPythonProcessHealth() {
		try {
			int value = process.exitValue();
			try {
				outPrinter.join();
			} catch (InterruptedException ignored) {
				outPrinter.interrupt();
				Thread.interrupted();
			}
			try {
				errorPrinter.join();
			} catch (InterruptedException ignored) {
				errorPrinter.interrupt();
				Thread.interrupted();
			}
			if (value != 0) {
				throw new RuntimeException("Plan file caused an error. Check log-files for details." + msg.get());
			} else {
				throw new RuntimeException("Plan file exited prematurely without an error." + msg.get());
			}
		} catch (IllegalThreadStateException ignored) {//Process still running
		}
	}

	/**
	 * Closes this streamer.
	 *
	 * @throws IOException
	 */
	public void close() throws IOException {
		Throwable throwable = null;

		try {
			socket.close();
			sender.close();
			receiver.close();
		} catch (Throwable t) {
			throwable = t;
		}

		try {
			destroyProcess(process);
		} catch (Throwable t) {
			throwable = ExceptionUtils.firstOrSuppressed(t, throwable);
		}

		if (shutdownThread != null) {
			Runtime.getRuntime().removeShutdownHook(shutdownThread);
		}

		ExceptionUtils.tryRethrowIOException(throwable);
	}

	public static void destroyProcess(Process process) throws IOException {
		try {
			process.exitValue();
		} catch (IllegalThreadStateException ignored) { //process still active
			if (process.getClass().getName().equals("java.lang.UNIXProcess")) {
				int pid;
				try {
					Field f = process.getClass().getDeclaredField("pid");
					f.setAccessible(true);
					pid = f.getInt(process);
				} catch (Throwable ignore) {
					process.destroy();
					return;
				}
				String[] args = new String[]{"kill", "-9", String.valueOf(pid)};
				Runtime.getRuntime().exec(args);
			} else {
				process.destroy();
			}
		}
	}

	protected void sendWriteNotification(int size, boolean hasNext) throws IOException {
		out.writeInt(size);
		out.writeByte(hasNext ? 0 : SIGNAL_LAST);
		out.flush();
	}

	protected void sendReadConfirmation() throws IOException {
		out.writeByte(1);
		out.flush();
	}

	/**
	 * Sends all broadcast-variables encoded in the configuration to the external process.
	 *
	 * @param config configuration object containing broadcast-variable count and names
	 * @throws IOException
	 */
	public final void sendBroadCastVariables(Configuration config) throws IOException {
		try {
			int broadcastCount = config.getInteger(PLANBINDER_CONFIG_BCVAR_COUNT, 0);

			String[] names = new String[broadcastCount];

			for (int x = 0; x < names.length; x++) {
				names[x] = config.getString(PLANBINDER_CONFIG_BCVAR_NAME_PREFIX + x, null);
			}

			out.write(new IntSerializer().serializeWithoutTypeInfo(broadcastCount));

			StringSerializer stringSerializer = new StringSerializer();
			for (String name : names) {
				Iterator<byte[]> bcv = function.getRuntimeContext().<byte[]>getBroadcastVariable(name).iterator();

				out.write(stringSerializer.serializeWithoutTypeInfo(name));

				while (bcv.hasNext()) {
					out.writeByte(1);
					out.write(bcv.next());
				}
				out.writeByte(0);
			}
		} catch (SocketTimeoutException ignored) {
			throw new RuntimeException("External process for task " + function.getRuntimeContext().getTaskName() + " stopped responding." + msg);
		}
	}
}


text:
package com.ikaimen.pattern.MediatorPattern.demo1;

import com.ikaimen.pattern.MediatorPattern.demo1.AbstractColleague;
import com.ikaimen.pattern.MediatorPattern.demo1.AbstractMediator;

/**
 * Created by ChenTao on 2017/7/26.
 * 库存管理类
 */
public class Stock extends AbstractColleague {

    public Stock(AbstractMediator mediator) {
        super(mediator);
    }

    //刚开始有100台电脑
    private static  int  COMPUTER_NUMBER = 100;

    //库存增加
    public void increase(int number){

        COMPUTER_NUMBER = COMPUTER_NUMBER+number;
        System.out.println("库存数量为:"+COMPUTER_NUMBER);

    }

    //库存降低

    public void decrease(int number){

        COMPUTER_NUMBER = COMPUTER_NUMBER - number;
        System.out.println("库存数量为:"+COMPUTER_NUMBER);
    }

    //获得库存数量
    public int getStockNumber(){

        return COMPUTER_NUMBER;
    }

    //库存压力大了,就要通知采购人员不要采购,销售人员要尽快销售

    public void clearStock(){

        System.out.println("清理库存数量为:"+COMPUTER_NUMBER);

        super.mediator.execute("stock.clear");

    }
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef _MYSQL_LIB_LOADER_H_
#define _MYSQL_LIB_LOADER_H_

#include "binding_config.h"

#ifdef _WIN32
#include <windows.h>
#elif defined(HAVE_DLFCN_H)
# include <dlfcn.h>
#else
# error This should never happen - if this header is included, one of macros above supposed to be defined.
#endif

#include <boost/noncopyable.hpp>
#include <map>

namespace sql
{
namespace mysql
{
namespace util
{

#ifdef _WIN32
typedef HMODULE ModuleHandle;
typedef FARPROC SymbolHandle;
#else
typedef void *  ModuleHandle;
typedef void *  SymbolHandle;
#endif

/* possibly C_LibraryLoader would be better name */

class LibraryLoader : public boost::noncopyable
{
private:
	typedef std::map< std::string, SymbolHandle > ProcCache;

	ProcCache		functions;
	ModuleHandle	loadedLibHandle;

	LibraryLoader() {}

protected:

	LibraryLoader(const std::string & path2libFile);
	LibraryLoader(const std::string & dir2look, const std::string & libFileName);

	~LibraryLoader();

	SymbolHandle GetProcAddr(const std::string & name);
};

} /* namespace util */
} /* namespace mysql */
} /* namespace sql */
#endif

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: noet sw=4 ts=4 fdm=marker
 * vim<600: noet sw=4 ts=4
 */


text:
package com.google.code.kaptcha.impl;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Random;

import com.google.code.filters.RippleFilter;
import com.google.code.filters.ShadowFilter;
import com.google.code.filters.TransformFilter;
import com.google.code.kaptcha.GimpyEngine;
import com.google.code.kaptcha.NoiseProducer;
import com.google.code.kaptcha.util.Configurable;

/**
 * {@link ShadowGimpy} adds shadow to the text on the image and two noises.
 */
public class ShadowGimpy extends Configurable implements GimpyEngine
{
	/**
	 * Applies distortion by adding shadow to the text and also two noises.
	 *
	 * @param baseImage the base image
	 * @return the distorted image
	 */
	public BufferedImage getDistortedImage(BufferedImage baseImage)
	{
		NoiseProducer noiseProducer = getConfig().getNoiseImpl();
		BufferedImage distortedImage = new BufferedImage(baseImage.getWidth(),
				baseImage.getHeight(), BufferedImage.TYPE_INT_ARGB);

		Graphics2D graph = (Graphics2D) distortedImage.getGraphics();

		ShadowFilter shadowFilter = new ShadowFilter();
		shadowFilter.setRadius(10);
		shadowFilter.setDistance(5);
		shadowFilter.setOpacity(1);

		Random rand = new Random();

		RippleFilter rippleFilter = new RippleFilter();
		rippleFilter.setWaveType(RippleFilter.SINE);
		rippleFilter.setXAmplitude(7.6f);
		rippleFilter.setYAmplitude(rand.nextFloat() + 1.0f);
		rippleFilter.setXWavelength(rand.nextInt(7) + 8);
		rippleFilter.setYWavelength(rand.nextInt(3) + 2);
		rippleFilter.setEdgeAction(TransformFilter.BILINEAR);

		BufferedImage effectImage = rippleFilter.filter(baseImage, null);
		effectImage = shadowFilter.filter(effectImage, null);

		graph.drawImage(effectImage, 0, 0, null, null);
		graph.dispose();

		// draw lines over the image and/or text
		noiseProducer.makeNoise(distortedImage, .1f, .1f, .25f, .25f);
		noiseProducer.makeNoise(distortedImage, .1f, .25f, .5f, .9f);

		return distortedImage;
	}
}


text:
var assert = require("assert");
var mocha  = require("../grunt-suite");

var Components = require("../../../components/components");
var ScriptsComponent = require("../../../components/types/scripts");

gruntSuite("Main grunt task", "targets/main", function() {
  setup(function() {
    var components = new Components();
    this.setComponents(components);

    var scripts = { demo: "demo" };
    components.add(new ScriptsComponent({
      grunt: this.grunt,
      name:  "a",
      path:  "a/b/c",
      "clear-path": "a",
      scripts: scripts,
      targets: { test: { tasks: "demo" } }
    }));
    components.add(new ScriptsComponent({
      grunt: this.grunt,
      name:  "b",
      path:  "a/b/c",
      "clear-path": "b",
      scripts: scripts,
      targets: { test: {
        deps: ["a"],
        tasks: "demo"
      } }
    }));
  });

  test("dependencies are schedules too", function() {
    this.grunt.testTask("test");
    this.grunt.task.assertTaskQueue([
      "hooks:pre-compile:test", "shell:test.a.demo", "shell:test.b.demo"
    ]);
  });

  test("target is processed", function() {
    this.grunt.testTask("test", "a");
    this.grunt.task.assertTaskQueue([
      "hooks:pre-compile:test", "shell:test.a.demo"
    ]);
  });
});


text:
<!DOCTYPE html>

    <meta charset="UTF-8">

    <title>Solicitudes</title>
    <meta name="viewport" content="width=device-width">
    <link rel='stylesheet prefetch' href='../css/Report/pikaday.css'>
    <link rel="stylesheet" href="../css/Report/jquery.mobile-1.0.min.css" />

    <link rel="stylesheet" href="../css/Report/normalizeBanner.css">
    <link rel="stylesheet" href="../css/Report/StyleBanner.css">
    <link rel="stylesheet" href="../css/Report/normalize2.css">
    <link rel="stylesheet" href="../css/Report/style2.css">

        <link rel="stylesheet" href="../css/normalizeButton.css">
    <link rel='stylesheet prefetch' href='http://fonts.googleapis.com/css?family=Montserrat'>
    <link rel="stylesheet" href="../css/styleButton.css">

Inicio

Solicitudes

Salir

Solicitudes

        <form>

        </form>

Seleccionar

Elemento

Estado

<input type="checkbox" ng-model="checked" ng-change="check(elem._id,elem.nombre,checked)"/>

{{ elem.nombre }}

{{ elem.estado }}

  <button class="colins-submit">
    <svg width="196" height="70"
         viewPort="0 0 196 70" version="1.1"
         xmlns="http://www.w3.org/2000/svg">

      <rect class="btn-shape btn-bg"
            x="3" y="3"
            width="190" height="64"
            rx="32" ry="32"
            fill="#ffffff"
            fill-opacity="1"
            stroke="#ccc" stroke-width="4"
            />
      <rect class="btn-shape btn-color"
            x="3" y="3"
            width="190" height="64"
            rx="32" ry="32"
            fill="#ffffff"
            fill-opacity="0"
            stroke="rgb(16,50,73)" stroke-width="4"
            />
      <text class="checkNode" x="96" y="40"
            font-family="Montserrat"
            font-size="22"
            fill-opacity="1"
            text-anchor="middle"
            fill="rgb(255,255,255)" >
        ✔
      </text>
      <text class="textNode" x="96" y="40"
            transform="scale(1)"
            font-family="Montserrat"
            font-size="16"
            fill-opacity="1"
            text-anchor="middle"
            fill="rgb(16,50,73)" >
        Guardar
      </text>
    </svg>
  </button>


text:
if (typeof(CalendarFactory) === "undefined") {
    var CalendarFactory = require("../../lib/CalendarFactory.js");
}

if (typeof(ilib) === "undefined") {
    var ilib = require("../../lib/ilib.js");
}

module.exports.testcalendar = {
    setUp: function(callback) {
        ilib.clearCache();
        callback();
    },

    testCalendarFactoryDefault: function(test) {
        test.expect(1);
        var cal = CalendarFactory();
        test.ok(typeof(cal) !== "undefined");
        test.done();
    },

    testCalendarFactoryDefaultRightType: function(test) {
        test.expect(2);
        var cal = CalendarFactory();
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "gregorian");
        test.done();
    },

    testCalendarFactorySpecific: function(test) {
        test.expect(2);
        var cal = CalendarFactory({type: "julian"});
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "julian");
        test.done();
    },

    testCalendarFactoryUnknown: function(test) {
        test.expect(1);
        var cal = CalendarFactory({type: "asdf"});
        test.ok(typeof(cal) === "undefined");
        test.done();
    },

    testCalendarFactoryDefaultForLocale: function(test) {
        test.expect(2);
        var cal = CalendarFactory({locale: "ar-AE"});
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "gregorian");
        test.done();
    },

    testCalendarFactoryDefaultForLocale_KH: function(test) {
        test.expect(2);
        var cal = CalendarFactory({locale: "km-KH"});
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "gregorian");
        test.done();
    },

    testCalendarFactoryDefaultForLocale_AZ: function(test) {
        test.expect(2);
        var cal = CalendarFactory({locale: "az-Latn-AZ"});
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "gregorian");
        test.done();
    },

    testCalendarFactoryDefaultForLocale_LK: function(test) {
        test.expect(2);
        var cal = CalendarFactory({locale: "si-LK"});
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "gregorian");
        test.done();
    },

    testCalendarFactoryDefaultForLocale_KE: function(test) {
        test.expect(2);
        var cal = CalendarFactory({locale: "sw-Latn-KE"});
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "gregorian");
        test.done();
    },

    testCalendarFactoryDefaultForLocaleOther: function(test) {
        test.expect(2);
        var cal = CalendarFactory({locale: "th-TH"});
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "thaisolar");
        test.done();
    },

    testCalendarFactoryOverrideLocale: function(test) {
        test.expect(2);
        var cal = CalendarFactory({locale: "ar-AE", type: "gregorian"});
        test.ok(typeof(cal) !== "undefined");

        test.equal(cal.getType(), "gregorian");
        test.done();
    },

    testGetCalendars: function(test) {
        test.expect(1);
        var expected = [
            "julian",
            "gregorian",
            "islamic",
            "hebrew",
            "thaisolar",
            "persian-algo",
            "persian",
            "han",
            "ethiopic",
            "coptic"
        ];

        test.equalIgnoringOrder(CalendarFactory.getCalendars(), expected);
        test.done();
    }

};


text:
<?xml version="1.0" encoding="utf-8"?>
<project>
  <triggers class="vector">
    <com.dabsquared.gitlabjenkins.GitLabPushTrigger>
      <triggerOpenMergeRequestOnPush>true</triggerOpenMergeRequestOnPush>
      <branchFilterType>All</branchFilterType>
      <spec/>
      <triggerOnPush>true</triggerOnPush>
      <triggerOnMergeRequest>true</triggerOnMergeRequest>
      <triggerOnNoteRequest>true</triggerOnNoteRequest>
      <noteRegex>Jenkins please retry a build</noteRegex>
      <ciSkip>true</ciSkip>
      <skipWorkInProgressMergeRequest>true</skipWorkInProgressMergeRequest>
      <setBuildDescription>true</setBuildDescription>
      <addNoteOnMergeRequest>true</addNoteOnMergeRequest>
      <addVoteOnMergeRequest>true</addVoteOnMergeRequest>
      <acceptMergeRequestOnSuccess>false</acceptMergeRequestOnSuccess>
      <addCiMessage>false</addCiMessage>
      <allowAllBranches>false</allowAllBranches>
      <targetBranchRegex/>
      <includeBranchesSpec>master</includeBranchesSpec>
      <excludeBranchesSpec>feature</excludeBranchesSpec>
    </com.dabsquared.gitlabjenkins.GitLabPushTrigger>
  </triggers>
</project>


text:
Like most Hadoop libraries, Pakour supports testing jobs by running jobs in
local mode.  Unlike most libraries, local access to dseqs and dsinks makes
input-construction and result-checking nearly as straightforward as testing
non-MapReduce code.

## Input/Output

Parkour allows seamless testing of job results exactly as a regular program
would consume job results.  Parkour does provide a small number of test-support
functions primarily designed to simplify construction of test _inputs_.

### with-dseq

The `parkour.io.dsink` namespace `with-dseq` function writes a Clojure
collection to a dsink, using the same backing Hadoop `OutputFormat` the dsink
configures an actual Hadoop job to use.  The function then yields the associated
dseq, which may be used as input for a job or job graph.

```clj
(deftest test-word-count-local
  (let [inpath (doto (fs/path "tmp/word-count-input") fs/path-delete)
        outpath (doto (fs/path "tmp/word-count-output") fs/path-delete)
        dseq (dsink/with-dseq (text/dsink inpath)
               (->> ["apple banana banana" "carrot apple" "apple"]
                    (mr/sink-as :keys)))
        dsink (seqf/dsink [Text LongWritable] outpath)
        [result] (word-count (conf/ig) dseq dsink)]
    (is (= {"apple" 3, "banana" 2, "carrot" 1}
           (->> result w/unwrap (into {}))))))
```

### mem/dseq

The `parkour.io.mem` namespace `dseq` function generates dseqs which use a
memory-backed Hadoop `InputFormat` to produce tuples from arbitrary in-memory
Clojure collections.  This circumvents normal Hadoop serialization, but can
simplify testing of jobs normally consuming from more esoteric and/or non-HDFS
input formats.

```clj
(deftest test-word-count-mem
  (let [outpath (doto (fs/path "tmp/word-count-output") fs/path-delete)
        dseq (mem/dseq [[nil "apple banana banana"]
                        [nil "carrot apple"]
                        [nil "apple"]])
        dsink (seqf/dsink [Text LongWritable] outpath)
        [result] (word-count (conf/ig) dseq dsink)]
    (is (= {"apple" 3, "banana" 2, "carrot" 1}
           (->> result w/unwrap (into {}))))))
```

## Partitioners

Hadoop local mode only allows a single reducer, which prevents any job custom
partitioners from even running.  Although not ideal, any custom partitioners
should be unit-tested directly, independently of job execution.  Fortunately,
Parkour partitioners are just functions, and relatively easy to so-test.


text:
<?php

namespace Magento\Framework\DomDocument;

/**
 * DOM document factory
 */
class Factory
{
    /**
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $_objectManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     */
    public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager)
    {
        $this->_objectManager = $objectManager;
    }

    /**
     * Create empty DOM document instance.
     *
     * @return \DOMDocument
     */
    public function createDomDocument()
    {
        return $this->_objectManager->create('DOMDocument', []);
    }
}


text:
package hardware::kvm::avocent::acs::6000::snmp::mode::hardware;

use base qw(centreon::plugins::templates::hardware);

use strict;
use warnings;

sub set_system {
    my ($self, %options) = @_;

    $self->{regexp_threshold_overload_check_section_option} = '^(psu)$';

    $self->{cb_hook2} = 'snmp_execute';

    $self->{thresholds} = {
        psu => [
            ['statePowerOn', 'OK'],
            ['statePowerOff', 'CRITICAL'],
            ['powerNotInstalled', 'OK'],
        ],
    };

    $self->{components_path} = 'hardware::kvm::avocent::acs::6000::snmp::mode::components';
    $self->{components_module} = ['psu'];
}

sub snmp_execute {
    my ($self, %options) = @_;

    $self->{snmp} = $options{snmp};
    $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
}

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
    bless $self, $class;

    $options{options}->add_options(arguments =>
                                {
                                });

    return $self;
}

1;

__END__

=head1 MODE

Check hardware.

=over 8

=item B<--component>

Which component to check (Default: '.*').
Can be: 'psu'.

=item B<--filter>

Exclude some parts (comma seperated list) (Example: --filter=psu)
Can also exclude specific instance: --filter=psu,1

=item B<--absent-problem>

Return an error if an entity is not 'present' (default is skipping) (comma seperated list)
Can be specific or global: --absent-problem=psu

=item B<--no-component>

Return an error if no compenents are checked.
If total (with skipped) is 0. (Default: 'critical' returns).

=item B<--threshold-overload>

Set to overload default threshold values (syntax: section,[instance,]status,regexp)
It used before default thresholds (order stays).
Example: --threshold-overload='psu,CRITICAL,^(?!(statePowerOn)$)'

=back

=cut


text:
FOUNDATION_EXPORT double BSPatchVersionNumber;
FOUNDATION_EXPORT const unsigned char BSPatchVersionString[];


text:
package org.apache.ignite.internal.processors.cache;

import javax.management.ObjectName;
import org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicyFactory;
import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
import org.apache.ignite.cache.eviction.lru.LruEvictionPolicyFactory;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.util.IgniteUtils;
import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;

/**
 * Tests for the eviction policy JMX beans registered by the kernal.
 */
public class GridEvictionPolicyMBeansTest extends GridCommonAbstractTest {
    /** Create test and auto-start the grid */
    public GridEvictionPolicyMBeansTest() {
        super(true);
    }

    /** {@inheritDoc} */
    @Override protected void beforeTestsStarted() throws Exception {
        MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.EVICTION);

        super.beforeTestsStarted();
    }

    /**
     * {@inheritDoc}
     *
     * This implementation  adds eviction policies.
     */
    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

        FifoEvictionPolicyFactory<String, String> plc = new FifoEvictionPolicyFactory<>();

        plc.setMaxSize(100);
        plc.setBatchSize(10);
        plc.setMaxMemorySize(20);

        CacheConfiguration cache1 = defaultCacheConfiguration();

        cache1.setName("cache1");
        cache1.setOnheapCacheEnabled(true);
        cache1.setEvictionPolicyFactory(plc);

        NearCacheConfiguration ncf = new NearCacheConfiguration<>();

        ncf.setNearEvictionPolicyFactory(new LruEvictionPolicyFactory<>(40, 10, 500));

        CacheConfiguration cache2 = defaultCacheConfiguration();

        cache2.setName("cache2");
        cache2.setOnheapCacheEnabled(true);

        LruEvictionPolicy lep = new LruEvictionPolicy();

        lep.setBatchSize(10);
        lep.setMaxMemorySize(125);
        lep.setMaxSize(30);
        cache2.setEvictionPolicy(lep);

        ncf = new NearCacheConfiguration<>();
        lep = new LruEvictionPolicy();

        lep.setBatchSize(10);
        lep.setMaxMemorySize(500);
        lep.setMaxSize(40);
        ncf.setNearEvictionPolicy(lep);

        if (!MvccFeatureChecker.forcedMvcc() || MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.NEAR_CACHE)) {
            cache1.setNearConfiguration(ncf);
            cache2.setNearConfiguration(ncf);
        }

        cfg.setCacheConfiguration(cache1, cache2);

        return cfg;
    }

    /** Check that eviction bean is available */
    @Test
    public void testEvictionPolicyBeans() throws Exception {
        checkBean("cache1", "org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy", "MaxSize", 100);
        checkBean("cache1", "org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy", "BatchSize", 10);
        checkBean("cache1", "org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy", "MaxMemorySize", 20L);

        if (!MvccFeatureChecker.forcedMvcc() || MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.NEAR_CACHE)) {
            checkBean("cache1-near", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "MaxSize", 40);
            checkBean("cache1-near", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "BatchSize", 10);
            checkBean("cache1-near", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "MaxMemorySize", 500L);
        }

        checkBean("cache2", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "MaxSize", 30);
        checkBean("cache2", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "BatchSize", 10);
        checkBean("cache2", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "MaxMemorySize", 125L);

        if (!MvccFeatureChecker.forcedMvcc() || MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.NEAR_CACHE)) {
            checkBean("cache2-near", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "MaxSize", 40);
            checkBean("cache2-near", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "BatchSize", 10);
            checkBean("cache2-near", "org.apache.ignite.cache.eviction.lru.LruEvictionPolicy", "MaxMemorySize", 500L);
        }
    }

    /** Checks that a bean with the specified group and name is available and has the expected attribute */
    private void checkBean(String grp, String name, String attributeName, Object expAttributeVal) throws Exception {
        ObjectName mBeanName = IgniteUtils.makeMBeanName(grid().name(), grp, name);
        Object attributeVal = grid().configuration().getMBeanServer().getAttribute(mBeanName, attributeName);

        assertEquals(expAttributeVal, attributeVal);
    }
}


text:
package May2021GoogLeetcode;

public class _0853SmallestSubtreeWithAllTheDeepestNodes {
	public static void main(String[] args) {
	}

	static public class TreeNode {
		int val;
		TreeNode left;
		TreeNode right;

		TreeNode() {
		}

		TreeNode(int val) {
			this.val = val;
		}

		TreeNode(int val, TreeNode left, TreeNode right) {
			this.val = val;
			this.left = left;
			this.right = right;
		}
	}

	public static TreeNode subtreeWithAllDeepest(TreeNode root) {

	}
}


text:
var request = require('request')
, querystring = require('querystring')
, config = require('../config.js')
, package = require('./package.js')

module.exports = search

function search(params, cb) {

  if (!params.q) {
    return cb(null, { hits: { total : 0 }})
  }

  var page = parseInt(params.page || '0', 10);

  var qs =
    { from : page*config.elasticsearch.pageSize
    , size : config.elasticsearch.pageSize
    , pretty: false
    }

  var url = config.elasticsearch.url + '/package/_search?' + querystring.stringify(qs)

  var payload =
    { fields : ['name', 'keywords','description','author', 'version']
    , query :
        { multi_match :
          { query : params.q
          , fields : ['name^4', 'keywords', 'description', 'readme']
          }
        }
    , sort : ['_score']
    }

  request.get({
    url : url,
    json: payload
  }, function(e, r, o) {
    if (r && r.error)
      e = new Error(r.error)

    if (e)
      return cb(e)

    o.q = params.q
    o.page = page
    o.pageSize = config.elasticsearch.pageSize

    // make sure that an exact match gets the top hit
    var name = params.q.trim()

    if (o && o.error) {
      var er = new Error('Search Error: ' + o.error)
      er.code = o.status || 500
      return cb(er, o)
    }

    if (r.statusCode !== 200 || !o) {
      var er = new Error('Search failed:' + JSON.stringify(o, null, 2))
      er.code = r.statusCode
      if (er.code === 200)
        er.code = 500
      return cb(er, o)
    }

    if (!o.hits ||
        !o.hits.hits ||
        !o.hits.hits.length ||
        o.hits.hits[0]._id === name && page === 0)
      return cb(e, o)

    o.hits.hits = o.hits.hits.filter(function(n) {
      return n._id !== name
    })
    if (page !== 0) {
      cb(null, o)
    } else {
      package(name, function(er, data) {
        if (er ||
            data.name !== name ||
            !data.versions ||
            !data['dist-tags'])
          return cb(null, o)

        if (!data.keywords || !Array.isArray(data.keywords)) {
          if (typeof data.keywords === 'string')
            data.keywords = data.keywords.split(/[,\s]+/)
          else
            data.keywords = []
        }
        o.hits.hits.unshift({
          _index: 'npm',
          _type: 'package',
          _id: name,
          _score: 9999,
          fields: {
            author: data.maintainers[0].name,
            keywords: data.keywords,
            description: data.description,
            version: data['dist-tags'].latest,
            name: name
          }
        })
        cb(null, o)
      })
    }
  });
}


text:
package com.alibaba.fastjson.support.retrofit;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;

import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

/**
 * @author ligboy, wenshao
 * @author Victor.Zxy
 */
public class Retrofit2ConverterFactory extends Converter.Factory {

    private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=UTF-8");

    private FastJsonConfig fastJsonConfig;

    @Deprecated
    private static final Feature[] EMPTY_SERIALIZER_FEATURES = new Feature[0];
    @Deprecated
    private ParserConfig parserConfig = ParserConfig.getGlobalInstance();
    @Deprecated
    private int featureValues = JSON.DEFAULT_PARSER_FEATURE;
    @Deprecated
    private Feature[] features;
    @Deprecated
    private SerializeConfig serializeConfig;
    @Deprecated
    private SerializerFeature[] serializerFeatures;

    public Retrofit2ConverterFactory() {
        this.fastJsonConfig = new FastJsonConfig();
    }

    public Retrofit2ConverterFactory(FastJsonConfig fastJsonConfig) {
        this.fastJsonConfig = fastJsonConfig;
    }

    public static Retrofit2ConverterFactory create() {
        return create(new FastJsonConfig());
    }

    public static Retrofit2ConverterFactory create(FastJsonConfig fastJsonConfig) {
        if (fastJsonConfig == null) throw new NullPointerException("fastJsonConfig == null");
        return new Retrofit2ConverterFactory(fastJsonConfig);
    }

    @Override
    public Converter<ResponseBody, Object> responseBodyConverter(Type type, //
                                                                 Annotation[] annotations, //
                                                                 Retrofit retrofit) {
        return new ResponseBodyConverter<Object>(type);
    }

    @Override
    public Converter<Object, RequestBody> requestBodyConverter(Type type, //
                                                               Annotation[] parameterAnnotations, //
                                                               Annotation[] methodAnnotations, //
                                                               Retrofit retrofit) {
        return new RequestBodyConverter<Object>();
    }

    public FastJsonConfig getFastJsonConfig() {
        return fastJsonConfig;
    }

    public Retrofit2ConverterFactory setFastJsonConfig(FastJsonConfig fastJsonConfig) {
        this.fastJsonConfig = fastJsonConfig;
        return this;
    }

    /**
     * Gets parser config.
     *
     * @return the parser config
     * @see FastJsonConfig#getParserConfig()
     * @deprecated
     */
    @Deprecated
    public ParserConfig getParserConfig() {
        return fastJsonConfig.getParserConfig();
    }

    /**
     * Sets parser config.
     *
     * @param config the config
     * @return the parser config
     * @see FastJsonConfig#setParserConfig(ParserConfig)
     * @deprecated
     */
    @Deprecated
    public Retrofit2ConverterFactory setParserConfig(ParserConfig config) {
        fastJsonConfig.setParserConfig(config);
        return this;
    }

    /**
     * Gets parser feature values.
     *
     * @return the parser feature values
     * @see JSON#DEFAULT_PARSER_FEATURE
     * @deprecated
     */
    @Deprecated
    public int getParserFeatureValues() {
        return JSON.DEFAULT_PARSER_FEATURE;
    }

    /**
     * Sets parser feature values.
     *
     * @param featureValues the feature values
     * @return the parser feature values
     * @see JSON#DEFAULT_PARSER_FEATURE
     * @deprecated
     */
    @Deprecated
    public Retrofit2ConverterFactory setParserFeatureValues(int featureValues) {
        return this;
    }

    /**
     * Get parser features feature [].
     *
     * @return the feature []
     * @see FastJsonConfig#getFeatures()
     * @deprecated
     */
    @Deprecated
    public Feature[] getParserFeatures() {
        return fastJsonConfig.getFeatures();
    }

    /**
     * Sets parser features.
     *
     * @param features the features
     * @return the parser features
     * @see FastJsonConfig#setFeatures(Feature...)
     * @deprecated
     */
    @Deprecated
    public Retrofit2ConverterFactory setParserFeatures(Feature[] features) {
        fastJsonConfig.setFeatures(features);
        return this;
    }

    /**
     * Gets serialize config.
     *
     * @return the serialize config
     * @see FastJsonConfig#getSerializeConfig()
     * @deprecated
     */
    @Deprecated
    public SerializeConfig getSerializeConfig() {
        return fastJsonConfig.getSerializeConfig();
    }

    /**
     * Sets serialize config.
     *
     * @param serializeConfig the serialize config
     * @return the serialize config
     * @see FastJsonConfig#setSerializeConfig(SerializeConfig)
     * @deprecated
     */
    @Deprecated
    public Retrofit2ConverterFactory setSerializeConfig(SerializeConfig serializeConfig) {
        fastJsonConfig.setSerializeConfig(serializeConfig);
        return this;
    }

    /**
     * Get serializer features serializer feature [].
     *
     * @return the serializer feature []
     * @see FastJsonConfig#getSerializerFeatures()
     * @deprecated
     */
    @Deprecated
    public SerializerFeature[] getSerializerFeatures() {
        return fastJsonConfig.getSerializerFeatures();
    }

    /**
     * Sets serializer features.
     *
     * @param features the features
     * @return the serializer features
     * @see FastJsonConfig#setSerializerFeatures(SerializerFeature...)
     * @deprecated
     */
    @Deprecated
    public Retrofit2ConverterFactory setSerializerFeatures(SerializerFeature[] features) {
        fastJsonConfig.setSerializerFeatures(features);
        return this;
    }

    final class ResponseBodyConverter<T> implements Converter<ResponseBody, T> {
        private Type type;

        ResponseBodyConverter(Type type) {
            this.type = type;
        }

        public T convert(ResponseBody value) throws IOException {
            try {
                return JSON.parseObject(value.bytes()
                        , fastJsonConfig.getCharset()
                        , type
                        , fastJsonConfig.getParserConfig()
                        , fastJsonConfig.getParseProcess()
                        , JSON.DEFAULT_PARSER_FEATURE
                        , fastJsonConfig.getFeatures()
                );
            } catch (Exception e) {
                throw new IOException("JSON parse error: " + e.getMessage(), e);
            } finally {
                value.close();
            }
        }
    }

    final class RequestBodyConverter<T> implements Converter<T, RequestBody> {
        RequestBodyConverter() {
        }

        public RequestBody convert(T value) throws IOException {
            try {
                byte[] content = JSON.toJSONBytesWithFastJsonConfig(fastJsonConfig.getCharset()
                        , value
                        , fastJsonConfig.getSerializeConfig()
                        , fastJsonConfig.getSerializeFilters()
                        , fastJsonConfig.getDateFormat()
                        , JSON.DEFAULT_GENERATE_FEATURE
                        , fastJsonConfig.getSerializerFeatures()
                );
                return RequestBody.create(MEDIA_TYPE, content);
            } catch (Exception e) {
                throw new IOException("Could not write JSON: " + e.getMessage(), e);
            }
        }
    }
}


text:
module Messenger
  class Message < ActiveRecord::Base
    def self.draft
      where sent_at: nil
    end

    def self.sent
      where.not(sent_at: nil)
    end

    def self.unread
      joins(:receipts)
        .merge(Receipt.unread)
    end
  end
end


text:
export {
  upx2px
}
  from 'uni-core/service/api/base/upx2px'

export * from 'uni-platform/view/api'

export {
  getSystemInfoSync
}
  from '../../src/platforms/h5/service/api/device/get-system-info'

export function canIUse (schema) {
  if (schema === 'css.var') {
    return window.CSS && window.CSS.supports && window.CSS.supports('--a:0')
  }
  return true
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.analytics.synapse.artifacts.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The Amazon S3 settings needed for the interim Amazon S3 when copying from Amazon Redshift with unload. With this,
 * data from Amazon Redshift source will be unloaded into S3 first and then copied into the targeted sink from the
 * interim S3.
 */
@Fluent
public final class RedshiftUnloadSettings {
    /*
     * The name of the Amazon S3 linked service which will be used for the unload operation when copying from the
     * Amazon Redshift source.
     */
    @JsonProperty(value = "s3LinkedServiceName", required = true)
    private LinkedServiceReference s3LinkedServiceName;

    /*
     * The bucket of the interim Amazon S3 which will be used to store the unloaded data from Amazon Redshift source.
     * The bucket must be in the same region as the Amazon Redshift source. Type: string (or Expression with resultType
     * string).
     */
    @JsonProperty(value = "bucketName", required = true)
    private Object bucketName;

    /**
     * Get the s3LinkedServiceName property: The name of the Amazon S3 linked service which will be used for the unload
     * operation when copying from the Amazon Redshift source.
     *
     * @return the s3LinkedServiceName value.
     */
    public LinkedServiceReference getS3LinkedServiceName() {
        return this.s3LinkedServiceName;
    }

    /**
     * Set the s3LinkedServiceName property: The name of the Amazon S3 linked service which will be used for the unload
     * operation when copying from the Amazon Redshift source.
     *
     * @param s3LinkedServiceName the s3LinkedServiceName value to set.
     * @return the RedshiftUnloadSettings object itself.
     */
    public RedshiftUnloadSettings setS3LinkedServiceName(LinkedServiceReference s3LinkedServiceName) {
        this.s3LinkedServiceName = s3LinkedServiceName;
        return this;
    }

    /**
     * Get the bucketName property: The bucket of the interim Amazon S3 which will be used to store the unloaded data
     * from Amazon Redshift source. The bucket must be in the same region as the Amazon Redshift source. Type: string
     * (or Expression with resultType string).
     *
     * @return the bucketName value.
     */
    public Object getBucketName() {
        return this.bucketName;
    }

    /**
     * Set the bucketName property: The bucket of the interim Amazon S3 which will be used to store the unloaded data
     * from Amazon Redshift source. The bucket must be in the same region as the Amazon Redshift source. Type: string
     * (or Expression with resultType string).
     *
     * @param bucketName the bucketName value to set.
     * @return the RedshiftUnloadSettings object itself.
     */
    public RedshiftUnloadSettings setBucketName(Object bucketName) {
        this.bucketName = bucketName;
        return this;
    }
}


text:
[![NuGet](https://img.shields.io/nuget/v/OpenTelemetry.Extensions.Hosting.svg)](https://www.nuget.org/packages/OpenTelemetry.Extensions.Hosting)
[![NuGet](https://img.shields.io/nuget/dt/OpenTelemetry.Extensions.Hosting.svg)](https://www.nuget.org/packages/OpenTelemetry.Extensions.Hosting)

## Installation

```shell
dotnet add package --prerelease OpenTelemetry.Extensions.Hosting
```

## Overview

The OpenTelemetry.Extensions.Hosting package provides extension methods for
automatically starting (and stopping) OpenTelemetry tracing (`TracerProvider`)
and metrics (`MeterProvider`) in [ASP.NET
 Core](https://learn.microsoft.com/aspnet/core/fundamentals/host/web-host) and
 [.NET Generic](https://learn.microsoft.com/dotnet/core/extensions/generic-host)
 hosts. These are completely optional extensions meant to simplify the
 management of the OpenTelemetry SDK lifecycle.

## Extension method reference

**Note:** The below extension methods target
`Microsoft.Extensions.DependencyInjection.IServiceCollection`.

**Note:** The below extension methods should be called by application host code
only. Library authors see: [Registration extension method guidance for library
authors](../../docs/trace/extending-the-sdk/README.md#registration-extension-method-guidance-for-library-authors).

**Note:** Multiple calls to the below extensions will **NOT** result in multiple
providers. To establish multiple providers use the
`Sdk.CreateTracerProviderBuilder()` and/or `Sdk.CreateMeterProviderBuilder()`
methods. See [TracerProvider
configuration](../../docs/trace/customizing-the-sdk/README.md#tracerprovider-configuration)
and [Building a
MeterProvider](../../docs/metrics/customizing-the-sdk/README.md#building-a-meterprovider)
for more details.

* `AddOpenTelemetryTracing`: Configure OpenTelemetry and register an
  [IHostedService](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihostedservice)
  to automatically start tracing services in the supplied
  [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection).

* `AddOpenTelemetryMetrics`: Configure OpenTelemetry and register an
  [IHostedService](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihostedservice)
  to automatically start metric services in the supplied
  [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection).

## Usage

The following example shows how to register OpenTelemetry tracing & metrics in
an ASP.NET Core host using the OpenTelemetry.Extensions.Hosting extensions.

```csharp
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;

var appBuilder = WebApplication.CreateBuilder(args);

appBuilder.Services.AddOpenTelemetryTracing(
    builder => builder.AddConsoleExporter());

appBuilder.Services.AddOpenTelemetryMetrics(
    builder => builder.AddConsoleExporter());

var app = appBuilder.Build();

app.Run();
```

## References

* [OpenTelemetry Project](https://opentelemetry.io/)


text:
brew update 2> /dev/null

# Upgrade any already-installed formulae
brew upgrade 2> /dev/null

## Install GNU core utilities (those that come with OS X are outdated)

# Don't forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.
brew install coreutils 2> /dev/null

# Install some other useful utilities like `sponge`
brew install moreutils 2> /dev/null

# Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed
brew install findutils 2> /dev/null

# Install GNU `sed`, overwriting the built-in `sed`
brew install gnu-sed --default-names 2> /dev/null

# Install Bash 4
# Note: don't forget to add `/usr/local/bin/bash` to `/etc/shells` before running `chsh`.
brew install bash 2> /dev/null
brew install bash-completion 2> /dev/null

# Install wget with IRI support
brew install wget --enable-iri 2> /dev/null

# Install more recent versions of some OS X tools
brew install vim --override-system-vi 2> /dev/null
brew install homebrew/dupes/grep 2> /dev/null
brew install homebrew/dupes/screen 2> /dev/null

# Install other useful binaries
brew install git 2> /dev/null
brew install tree 2> /dev/null
brew install docker 2> /dev/null

# Install development platforms
brew install node 2> /dev/null
brew install npm 2> /dev/null
brew install python 2> /dev/null
brew install python3 2> /dev/null
brew install ruby 2> /dev/null

## Remove outdated versions from the cellar
brew cleanup


text:
package com.aspose.cloud.words;

public class SplitResult {
	private java.util.ArrayList<Page> pages;
	private SourceDocument  sourceDocument;
    public SourceDocument getSourceDocument(){return sourceDocument;}
	public final java.util.ArrayList<Page> getPages()
	{
		return pages;
	}

}


text:
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
using System.Linq;

using CSCore;
using CSCore.Codecs.WAV;
using CSCore.CoreAudioAPI;
using CSCore.SoundIn;
using CSCore.Streams;
using CSCore.Win32;

namespace PurpleElectron {
	public class ProcessContext : ApplicationContext {

		private NotifyIcon trayIcon;
		private MenuItem captureItem;

		/*private int currentFile = 0;

		// System audio
		private WasapiLoopbackCapture render_loopback;
		private WaveWriter render_fileA;
		private WaveWriter render_fileB;
		private FileStream render_streamA;
		private FileStream render_streamB;

		// Microphone audio
		private WasapiCapture capture_loopback;
		private SoundInSource capture_source;
		private SingleBlockNotificationStream capture_notifyStream;
		private IWaveSource capture_finalSource;
		private WaveWriter capture_fileA;
		private WaveWriter capture_fileB;
		private FileStream capture_streamA;
		private FileStream capture_streamB;

		private System.Timers.Timer fileTimer;
		private Stopwatch appTime = new Stopwatch();

		private bool canWrite = true;*/

		private ConfigEditor editor;

		public ProcessContext() {
			Debug.WriteLine("Registering devices");
			Config.RegisterChannelType("Device Capture", ChannelType.DeviceCapture, typeof(DeviceCaptureChannel));
			Debug.WriteLine("Loading config");
			Config.LoadConfig();

			Debug.WriteLine("Initializing context resources");

			editor = new ConfigEditor {
				Visible = false
			};

			Debug.WriteLine("Setting up context events");
			editor.SetupEvents(this);

			trayIcon = new NotifyIcon {
				Icon = Properties.Resources.AppIcon,
				ContextMenu = new ContextMenu(new MenuItem[] {
					new MenuItem("Restart Capture", RestartCapture),
					new MenuItem("-"),
					new MenuItem("Change Settings", ShowConfigEditor),
					new MenuItem("-"),
					new MenuItem("Exit", Exit)
				}),
				Visible = true
			};

			trayIcon.BalloonTipClicked += TrayIcon_BalloonTipClicked;

			Debug.WriteLine("Starting base channel capture");
			foreach (var channel in Config.ActiveChannels) {
				channel.channel.StartCapture();
			}
		}

		private void TrayIcon_BalloonTipClicked(object sender, EventArgs e) {
			Process.Start(Config.SavePath.FullName);
		}

		private void ShowConfigEditor(object sender, EventArgs e) {
			editor.Show();
		}

		/// <summary>
		/// Sends a save signal to all enabled channels
		/// </summary>
		public void SaveData() {
			foreach (var channel in Config.ActiveChannels) {
				channel.channel.SaveData();
			}
		}

		public new void Dispose() {

			trayIcon.Visible = false;
			trayIcon.Dispose();

			captureItem.Dispose();

			Dispose(true);

			GC.SuppressFinalize(this);
		}

		private void Exit(object sender, EventArgs e) {
			//Dispose();

			trayIcon.Visible = false;
			trayIcon.Dispose();

			Application.Exit();
			Process.GetCurrentProcess().Kill();
		}

		private void RestartCapture(object sender, EventArgs e) {
			foreach (var channel in Config.ActiveChannels) {
				channel.channel.StopCapture();
				channel.channel.StartCapture();
			}
		}
	}
}


text:
{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %}

{% block content %}

{% trans "Sign Up Closed" %}

{% trans "We are sorry, but the sign up is currently closed." %}

{% endblock %}


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

namespace _02.ChatClient.Data
{
    public class User
    {
        public string Name { get; set; }
    }
}


text:
using System.Web.Http;

namespace DNTLive
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Web API 配置和服务
            config.Formatters.Clear();
            config.Formatters.Add(new System.Net.Http.Formatting.JsonMediaTypeFormatter());

            // Web API 路由
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }
}


text:
package org.apache.gobblin.config.common.impl;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.google.common.base.Optional;
import com.google.common.collect.Sets;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;

import edu.umd.cs.findbugs.annotations.SuppressWarnings;

import org.apache.gobblin.config.store.api.ConfigKeyPath;
import org.apache.gobblin.config.store.api.ConfigStore;
import org.apache.gobblin.config.store.api.ConfigStoreWithBatchFetches;
import org.apache.gobblin.config.store.api.ConfigStoreWithResolution;

/**
 * ConfigStoreBackedValueInspector always query the underline {@link ConfigStore} to get the freshest
 * {@link com.typesafe.config.Config}
 * @author mitu
 *
 */
public class ConfigStoreBackedValueInspector implements ConfigStoreValueInspector {

  private final ConfigStore cs;
  private final String version;
  private final ConfigStoreTopologyInspector topology;

  /**
   * @param cs       - internal {@link ConfigStore} to retrieve configuration
   * @param version  - version of the {@link ConfigStore}
   * @param topology - corresponding {@link ConfigStoreTopologyInspector} for the input {@link ConfigStore}
   */
  public ConfigStoreBackedValueInspector(ConfigStore cs, String version, ConfigStoreTopologyInspector topology) {
    this.cs = cs;
    this.version = version;
    this.topology = topology;
  }

  public ConfigStore getConfigStore() {
    return this.cs;
  }

  public String getVersion() {
    return this.version;
  }

  /**
   * {@inheritDoc}.
   *
   *

   *   This implementation simply delegate the functionality to the internal {@link ConfigStore}/version
   *

   */
  @Override
  public Config getOwnConfig(ConfigKeyPath configKey) {
    return this.cs.getOwnConfig(configKey, this.version);
  }

  /**
   * {@inheritDoc}.
   *
   *

   *   This implementation simply delegate the functionality to the internal {@link ConfigStore}/version
   *   if the internal {@link ConfigStore} is {@link ConfigStoreWithBatchFetches}, otherwise, will call
   *   configuration store for each config key path and put the result into {@link Map}
   *

   */
  @Override
  public Map<ConfigKeyPath, Config> getOwnConfigs(Collection<ConfigKeyPath> configKeys) {
    if (this.cs instanceof ConfigStoreWithBatchFetches) {
      ConfigStoreWithBatchFetches batchStore = (ConfigStoreWithBatchFetches) this.cs;
      return batchStore.getOwnConfigs(configKeys, this.version);
    }

    Map<ConfigKeyPath, Config> result = new HashMap<>();
    for (ConfigKeyPath configKey : configKeys) {
      result.put(configKey, this.cs.getOwnConfig(configKey, this.version));
    }

    return result;
  }

  @SuppressWarnings
  private Config getResolvedConfigRecursive(ConfigKeyPath configKey, Set<String> alreadyLoadedPaths) {
    return getResolvedConfigRecursive(configKey, alreadyLoadedPaths, Optional.<Config>absent());
  }

  private Config getResolvedConfigRecursive(ConfigKeyPath configKey, Set<String> alreadyLoadedPaths,
      Optional<Config> runtimeConfig) {

    if (this.cs instanceof ConfigStoreWithResolution) {
      return ((ConfigStoreWithResolution) this.cs).getResolvedConfig(configKey, this.version);
    }

    if (!alreadyLoadedPaths.add(configKey.getAbsolutePathString())) {
      return ConfigFactory.empty();
    }

    Config initialConfig = this.getOwnConfig(configKey);
    if (configKey.isRootPath()) {
      return initialConfig;
    }

    List<ConfigKeyPath> ownImports = this.topology.getOwnImports(configKey, runtimeConfig);
    // merge with other configs from imports
    if (ownImports != null) {
      for (ConfigKeyPath p : ownImports) {
        initialConfig =
            initialConfig.withFallback(this.getResolvedConfigRecursive(p, alreadyLoadedPaths, runtimeConfig));
      }
    }

    // merge with configs from parent for Non root
    initialConfig = initialConfig
        .withFallback(this.getResolvedConfigRecursive(configKey.getParent(), alreadyLoadedPaths, runtimeConfig));

    return initialConfig;
  }

  /**
   * {@inheritDoc}.
   *
   *

   *   This implementation simply delegate the functionality to the internal {@link ConfigStore}/version if
   *   the internal {@link ConfigStore} is {@link ConfigStoreWithResolution}, otherwise based on {@link ConfigStoreTopologyInspector}
   *
   *   1. find out all the imports recursively
   *   2. resolved the config on the fly
   *

   */
  public Config getResolvedConfig(ConfigKeyPath configKey, Optional<Config> runtimeConfig) {
    return getResolvedConfigRecursive(configKey, Sets.<String>newHashSet(), runtimeConfig)
        .withFallback(ConfigFactory.defaultOverrides()).withFallback(ConfigFactory.systemEnvironment()).resolve();
  }

  @Override
  public Config getResolvedConfig(ConfigKeyPath configKey) {
    return getResolvedConfig(configKey, Optional.<Config>absent());
  }

  /**
   * {@inheritDoc}.
   *
   *

   *   This implementation simply delegate the functionality to the internal {@link ConfigStore}/version
   *   if the internal {@link ConfigStore} is {@link ConfigStoreWithBatchFetches}, otherwise, will call
   *   configuration store for each config key path and put the result into {@link Map}
   *

   */
  @Override
  public Map<ConfigKeyPath, Config> getResolvedConfigs(Collection<ConfigKeyPath> configKeys) {
    if (this.cs instanceof ConfigStoreWithBatchFetches) {
      ConfigStoreWithBatchFetches batchStore = (ConfigStoreWithBatchFetches) this.cs;
      return batchStore.getResolvedConfigs(configKeys, this.version);
    }

    Map<ConfigKeyPath, Config> result = new HashMap<>();
    for (ConfigKeyPath configKey : configKeys) {
      result.put(configKey, this.getResolvedConfig(configKey));
    }

    return result;
  }

}


text:
var express = require('express');
var app = express();
var port = 5454;

var mongoose = require('mongoose');
var passport = require('passport');
const session = require('express-session');
const MongoStore = require('connect-mongo/es5')(session);

mongoose.connect('mongodb://localhost/game');

var favicon = require('serve-favicon');
var morgan = require('morgan');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var methodOverride = require('method-override');

app.use(morgan('dev'));
app.use(cookieParser());
app.use(bodyParser.urlencoded({'extended':'true'}));
app.use(bodyParser.json());
app.use(methodOverride('X-HTTP-Method-Override'));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));

app.use(session({
	secret: 'ihaveanamazingcountry',
	resave: false,
	saveUninitialized: true,
	cookie: { maxAge: (365 * 24 * 60 * 60 * 1000) },
	rolling: true,
	store: new MongoStore({url: "mongodb://localhost/game"})
}));
app.use(passport.initialize());
app.use(passport.session());
app.set('view cache', true);

app.use(favicon(__dirname + '/client/public/img/favicon.png'));

require('./server/passport.js')(app, passport);
require('./server/user.js')(app, passport);
require('./routes.js')(app);

app.listen(port);
console.log('Server is running on port '+port);


text:
'use strict';

function focusOrCreateTab(url) {
  chrome.windows.getAll({'populate': true}, function (windows) {
    var existingTab;
    for (var i in windows) {
      if (windows.hasOwnProperty(i)) {
        var tabs = windows[i].tabs;
        for (var j in tabs) {
          if (tabs.hasOwnProperty(j)) {
            var tab = tabs[j];
            if (tab.url === url) {
              existingTab = tab;
              break;
            }
          }
        }
      }
    }
    if (existingTab) {
      chrome.tabs.update(existingTab.id, {'selected': true});
    } else {
      chrome.tabs.create({'url': url, 'selected': true});
    }
  });
}

chrome.browserAction.onClicked.addListener(function () {
  var url = chrome.extension.getURL('search.html');
  focusOrCreateTab(url);
});


text:
import * as React from "react";
import Mobile from "./Mobile";
import TechStackItem from "./TechStackItem";

interface IProjectComponentProps extends React.Props<any> {
  project: any;
}

// export default class Project extends Component {
export default class Project extends React.Component<IProjectComponentProps> {
  constructor(props, context) {
    super(props, context);
  }

  render() {
    const { project } = this.props;
    console.log(project);
    const techStackItems = project.tech_stack.map((tech, index) => {
      return <TechStackItem key={index} tech={tech}/>;
    });

    return (

            { project.gfycat ?

 :  }
             { project.mobile_image !== '' ? <Mobile image={project.mobile_image}/> : null }

{project.title}

            {project.github_url !== '' ? 'Github' : null}

{project.date}

Background

{project.background}

Role

{project.role}

Tech Stack

{techStackItems}

    );
  }
}

// Project.propTypes = {
//   project: PropTypes.object.isRequired
// };


text:
/* alec-svelte/LayeredView.svelte generated by Svelte v3.31.0 */
import {
	SvelteComponent,
	check_outros,
	create_component,
	destroy_component,
	detach,
	empty,
	group_outros,
	init,
	insert,
	mount_component,
	outro_and_destroy_block,
	safe_not_equal,
	transition_in,
	transition_out,
	update_keyed_each
} from "svelte/internal";

import LayeredViewComponent from "./LayeredViewComponent.svelte";
import { ViewLayer } from "./";

function get_each_context(ctx, list, i) {
	const child_ctx = ctx.slice();
	child_ctx[1] = list[i];
	return child_ctx;
}

// (23:0) {#each layers as layer (layer.get(ViewLayer).id)}
function create_each_block(key_1, ctx) {
	let first;
	let layeredviewcomponent;
	let current;

	layeredviewcomponent = new LayeredViewComponent({
			props: {
				props: /*layer*/ ctx[1].get(ViewLayer).props,
				component: /*layer*/ ctx[1].get(ViewLayer).component,
				entity: /*layer*/ ctx[1]
			}
		});

	return {
		key: key_1,
		first: null,
		c() {
			first = empty();
			create_component(layeredviewcomponent.$$.fragment);
			this.first = first;
		},
		m(target, anchor) {
			insert(target, first, anchor);
			mount_component(layeredviewcomponent, target, anchor);
			current = true;
		},
		p(ctx, dirty) {
			const layeredviewcomponent_changes = {};
			if (dirty & /*layers*/ 1) layeredviewcomponent_changes.props = /*layer*/ ctx[1].get(ViewLayer).props;
			if (dirty & /*layers*/ 1) layeredviewcomponent_changes.component = /*layer*/ ctx[1].get(ViewLayer).component;
			if (dirty & /*layers*/ 1) layeredviewcomponent_changes.entity = /*layer*/ ctx[1];
			layeredviewcomponent.$set(layeredviewcomponent_changes);
		},
		i(local) {
			if (current) return;
			transition_in(layeredviewcomponent.$$.fragment, local);
			current = true;
		},
		o(local) {
			transition_out(layeredviewcomponent.$$.fragment, local);
			current = false;
		},
		d(detaching) {
			if (detaching) detach(first);
			destroy_component(layeredviewcomponent, detaching);
		}
	};
}

function create_fragment(ctx) {
	let each_blocks = [];
	let each_1_lookup = new Map();
	let each_1_anchor;
	let current;
	let each_value = /*layers*/ ctx[0];
	const get_key = ctx => /*layer*/ ctx[1].get(ViewLayer).id;

	for (let i = 0; i < each_value.length; i += 1) {
		let child_ctx = get_each_context(ctx, each_value, i);
		let key = get_key(child_ctx);
		each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
	}

	return {
		c() {
			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].c();
			}

			each_1_anchor = empty();
		},
		m(target, anchor) {
			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].m(target, anchor);
			}

			insert(target, each_1_anchor, anchor);
			current = true;
		},
		p(ctx, [dirty]) {
			if (dirty & /*layers, ViewLayer*/ 1) {
				const each_value = /*layers*/ ctx[0];
				group_outros();
				each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, outro_and_destroy_block, create_each_block, each_1_anchor, get_each_context);
				check_outros();
			}
		},
		i(local) {
			if (current) return;

			for (let i = 0; i < each_value.length; i += 1) {
				transition_in(each_blocks[i]);
			}

			current = true;
		},
		o(local) {
			for (let i = 0; i < each_blocks.length; i += 1) {
				transition_out(each_blocks[i]);
			}

			current = false;
		},
		d(detaching) {
			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].d(detaching);
			}

			if (detaching) detach(each_1_anchor);
		}
	};
}

function instance($$self, $$props, $$invalidate) {
	let { layers = [] } = $$props;

	$$self.$$set = $$props => {
		if ("layers" in $$props) $$invalidate(0, layers = $$props.layers);
	};

	$$self.$$.update = () => {
		if ($$self.$$.dirty & /*layers*/ 1) {
			$: {
				const set = new Set();

				layers.forEach(e => {
					const id = e.get(ViewLayer).id;
					if (!id) throw new Error(`Must specify an ID for ViewLayer ${e.name} ${e.get(ViewLayer).component.name}`);
					if (set.has(id)) throw new Error(`You already added the view layer with ID ${id}`);
					set.add(id);
				});
			}
		}
	};

	return [layers];
}

class LayeredView extends SvelteComponent {
	constructor(options) {
		super();
		init(this, options, instance, create_fragment, safe_not_equal, { layers: 0 });
	}
}

export default LayeredView;


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

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <title>Starting Access Mode</title>
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="1265.21">

Starting Access Mode

Alternatively, you can choose to put a buffer in Access mode. From an Access buffer, you can send components to the Access interpreter; DIScover shows the interpreter in an opposite buffer.

Related Topics

To put a buffer in Access mode


text:
title:  Niczego nie dodacie i niczego nie ujmiecie
date:  31/10/2021
---

`Przeczytaj Pwt 4,1-2. Jakie szczególne ostrzeżenie dał Pan Izraelitom w sprawie Jego ustaw i praw? Dlaczego przestrzegł ich przed tym? (Zob. także Pwt 13,1).`

Pan powiedział im, by byli posłuszni Jego ustawom i prawom oraz by nic do nich nie dodawali ani nic z nich nie ujmowali. Dlaczego to powiedział? Kto po tym wszystkim chciałby zmienić prawo Boże?

Oczywiście, znamy odpowiedź na to pytanie.

"Szatan jest wytrwały i niestrudzony w swoich wysiłkach, by kontynuować dzieło, jakie rozpoczął w niebie, by zmienić prawo Boże. Udało mu się sprawić, że świat uwierzył w teorię, jaką przedstawił w niebie przed swoim upadkiem, że prawo Boże jest wadliwe i potrzebuje korekty. Duża część rzekomo chrześcijańskich Kościołów swoją postawą, jeśli nie swoimi słowami, pokazuje, że przyjęła ten sam błąd"20.

Gdy myślimy o historii starożytnego Izraela, dostrzegamy to, że pod wieloma względami Izraelici popadali w problemy, bo nie tylko lekceważyli pewne przepisy prawa, co w praktyce oznaczało ujmowanie czegoś z nich, ale także dodawali do nich praktyki niewymienione w prawie, a prowadzące ostatecznie do jego przekraczania.

`Przeczytaj Mt 15,1-9. W jakim sensie wersety te są przykładem zasady, którą Mojżesz wskazał Izraelitom, choć w innym kontekście historycznym?`

Gdy Hebrajczycy wreszcie objęli w posiadanie obiecaną im ziemię, często lekceważyli wyraźne boskie ostrzeżenia, na przykład przed bałwochwalstwem. Wskutek tego naśladowali pogańskie praktyki, czasami nawet udając, że w ten sposób oddają cześć Jahwe. Natomiast w czasach Jezusa Żydzi dodali do swojej religii całe mnóstwo przepisów nagromadzonych w ramach religijnej tradycji. Wiele z tych przepisów, jak powiedział sam Jezus, było przeciwnych przykazaniom Bożym.

Tak czy inaczej, przez dodawanie czy ujmowanie prawo zostało zmienione, a naród izraelski poniósł tego skutki.

`W jakim sensie musimy zachować ostrożność w sprawie niedodawania niczego do tego, co Bóg nam nakazuje, oraz nieodejmowania niczego od tego?`


text:
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// The crate store - a central repo for information collected about external
// crates and libraries

use core::prelude::*;

use metadata::cstore;
use metadata::decoder;

use core::hashmap::linear::LinearMap;
use core::vec;
use std;
use syntax::ast;
use syntax::parse::token::ident_interner;

// A map from external crate numbers (as decoded from some crate file) to
// local crate numbers (as generated during this session). Each external
// crate may refer to types in other external crates, and each has their
// own crate numbers.
pub type cnum_map = @mut LinearMap<ast::crate_num, ast::crate_num>;

pub struct crate_metadata {
    name: @~str,
    data: @~[u8],
    cnum_map: cnum_map,
    cnum: ast::crate_num
}

pub struct CStore {
    priv metas: LinearMap <ast::crate_num, @crate_metadata>,
    priv extern_mod_crate_map: extern_mod_crate_map,
    priv used_crate_files: ~[Path],
    priv used_libraries: ~[~str],
    priv used_link_args: ~[~str],
    intr: @ident_interner
}

// Map from node_id's of local extern mod statements to crate numbers
type extern_mod_crate_map = LinearMap<ast::node_id, ast::crate_num>;

pub fn mk_cstore(intr: @ident_interner) -> CStore {
    return CStore {
        metas: LinearMap::new(),
        extern_mod_crate_map: LinearMap::new(),
        used_crate_files: ~[],
        used_libraries: ~[],
        used_link_args: ~[],
        intr: intr
    };
}

pub fn get_crate_data(cstore: &CStore, cnum: ast::crate_num)
                   -> @crate_metadata {
    return *cstore.metas.get(&cnum);
}

pub fn get_crate_hash(cstore: &CStore, cnum: ast::crate_num) -> @~str {
    let cdata = get_crate_data(cstore, cnum);
    decoder::get_crate_hash(cdata.data)
}

pub fn get_crate_vers(cstore: &CStore, cnum: ast::crate_num) -> @~str {
    let cdata = get_crate_data(cstore, cnum);
    decoder::get_crate_vers(cdata.data)
}

pub fn set_crate_data(cstore: &mut CStore,
                      cnum: ast::crate_num,
                      data: @crate_metadata) {
    cstore.metas.insert(cnum, data);
}

pub fn have_crate_data(cstore: &CStore, cnum: ast::crate_num) -> bool {
    cstore.metas.contains_key(&cnum)
}

pub fn iter_crate_data(cstore: &CStore,
                       i: &fn(ast::crate_num, @crate_metadata)) {
    for cstore.metas.each |&(&k, &v)| {
        i(k, v);
    }
}

pub fn add_used_crate_file(cstore: &mut CStore, lib: &Path) {
    if !vec::contains(cstore.used_crate_files, lib) {
        cstore.used_crate_files.push(copy *lib);
    }
}

pub fn get_used_crate_files(cstore: &CStore) -> ~[Path] {
    return /*bad*/copy cstore.used_crate_files;
}

pub fn add_used_library(cstore: &mut CStore, lib: @~str) -> bool {
    assert!(*lib != ~"");

    if cstore.used_libraries.contains(&*lib) { return false; }
    cstore.used_libraries.push(/*bad*/ copy *lib);
    true
}

pub fn get_used_libraries(cstore: &CStore) -> ~[~str] {
    /*bad*/copy cstore.used_libraries
}

pub fn add_used_link_args(cstore: &mut CStore, args: &str) {
    for args.each_split_char(' ') |s| {
        cstore.used_link_args.push(s.to_owned());
    }
}

pub fn get_used_link_args(cstore: &CStore) -> ~[~str] {
    /*bad*/copy cstore.used_link_args
}

pub fn add_extern_mod_stmt_cnum(cstore: &mut CStore,
                                emod_id: ast::node_id,
                                cnum: ast::crate_num) {
    cstore.extern_mod_crate_map.insert(emod_id, cnum);
}

pub fn find_extern_mod_stmt_cnum(cstore: &CStore,
                                 emod_id: ast::node_id)
                       -> Option<ast::crate_num> {
    cstore.extern_mod_crate_map.find(&emod_id).map_consume(|x| *x)
}

// returns hashes of crates directly used by this crate. Hashes are sorted by
// (crate name, crate version, crate hash) in lexicographic order (not semver)
pub fn get_dep_hashes(cstore: &CStore) -> ~[~str] {
    struct crate_hash { name: @~str, vers: @~str, hash: @~str }
    let mut result = ~[];

    for cstore.extern_mod_crate_map.each_value |&cnum| {
        let cdata = cstore::get_crate_data(cstore, cnum);
        let hash = decoder::get_crate_hash(cdata.data);
        let vers = decoder::get_crate_vers(cdata.data);
        debug!("Add hash[%s]: %s %s", *cdata.name, *vers, *hash);
        result.push(crate_hash {
            name: cdata.name,
            vers: vers,
            hash: hash
        });
    }

    let sorted = do std::sort::merge_sort(result) |a, b| {
        (a.name, a.vers, a.hash) <= (b.name, b.vers, b.hash)
    };

    debug!("sorted:");
    for sorted.each |x| {
        debug!("  hash[%s]: %s", *x.name, *x.hash);
    }

    sorted.map(|ch| /*bad*/copy *ch.hash)
}

// Local Variables:
// mode: rust
// fill-column: 78;
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// End:


text:
package vagrant

import (
	"os"
	"path/filepath"
	"strings"

	"github.com/docker/infrakit/pkg/discovery"
	"github.com/docker/infrakit/pkg/launch/inproc"
	logutil "github.com/docker/infrakit/pkg/log"
	"github.com/docker/infrakit/pkg/plugin"
	vagrant "github.com/docker/infrakit/pkg/provider/vagrant/plugin/instance"
	"github.com/docker/infrakit/pkg/run"
	"github.com/docker/infrakit/pkg/run/local"
	"github.com/docker/infrakit/pkg/template"
	"github.com/docker/infrakit/pkg/types"
)

const (
	// Kind is the canonical name of the plugin for starting up, etc.
	Kind = "vagrant"

	// EnvNamespaceTags is the env to set for namespace tags. It's k=v,...
	EnvNamespaceTags = "INFRAKIT_VAGRANT_NAMESPACE_TAGS"

	// EnvDir is the env for setting the vagrant directory
	EnvDir = "INFRAKIT_VAGRANT_DIR"

	// EnvTemplateURL is the env for setting the vagrant file template url
	EnvTemplateURL = "INFRAKIT_VAGRANT_TEMPLATE_URL"
)

var (
	log = logutil.New("module", "run/v0/vagrant")
)

func init() {
	inproc.Register(Kind, Run, DefaultOptions)
}

// Options capture the options for starting up the plugin.
type Options struct {
	// Namespace is a set of kv pairs for tags that namespaces the resource instances
	// TODO - this is currently implemented in AWS and other cloud providers but not
	// in vagrant
	Namespace map[string]string

	// Dir is the directory where vagrant files are kept
	Dir string

	// TemplateURL is the URL for the vagrant template
	TemplateURL string
}

func defaultNamespace() map[string]string {
	t := map[string]string{}
	list := local.Getenv(EnvNamespaceTags, "")
	for _, v := range strings.Split(list, ",") {
		p := strings.Split(v, "=")
		if len(p) == 2 {
			t[p[0]] = p[1]
		}
	}
	return t
}

func defaultDir() string {
	dir, err := os.Getwd()
	if err != nil {
		panic(err)
	}
	return dir
}

// DefaultOptions return an Options with default values filled in.
var DefaultOptions = Options{
	Namespace:   defaultNamespace(),
	Dir:         local.Getenv(EnvDir, ""),
	TemplateURL: local.Getenv(EnvTemplateURL, ""),
}

// Run runs the plugin, blocking the current thread.  Error is returned immediately
// if the plugin cannot be started.
func Run(plugins func() discovery.Plugins, name plugin.Name,
	config *types.Any) (transport plugin.Transport, impls map[run.PluginCode]interface{}, onStop func(), err error) {

	options := DefaultOptions
	err = config.Decode(&options)
	if err != nil {
		return
	}

	opts := template.Options{}
	var templ *template.Template
	if options.TemplateURL == "" {
		t, e := template.NewTemplate("str://"+vagrant.VagrantFile, opts)
		if e != nil {
			err = e
			return
		}
		templ = t
	} else {

		// For compatiblity with old code, append a file:// if the
		// value is just a path
		if strings.Index(options.TemplateURL, "://") == -1 {

			p, e := filepath.Abs(options.TemplateURL)
			if e != nil {
				err = e
				return
			}
			options.TemplateURL = "file://localhost" + p
		}

		t, e := template.NewTemplate(options.TemplateURL, opts)
		if e != nil {
			err = e
			return
		}
		templ = t
	}

	transport.Name = name
	impls = map[run.PluginCode]interface{}{
		run.Instance: vagrant.NewVagrantPlugin(options.Dir, templ),
	}
	return
}


text:
==============================
wemo
==============================

.. image:: https://badge.fury.io/py/wemo.png
    :target: http://badge.fury.io/py/wemo

.. image:: https://travis-ci.org/iancmcc/wemo.png?branch=develop
        :target: https://travis-ci.org/iancmcc/wemo

.. image:: https://pypip.in/d/wemo/badge.png
        :target: https://crate.io/packages/wemo?version=latest

Open source control for Belkin WeMo devices

* Free software: BSD license
* Documentation: http://wemo.rtfd.org.

Features
--------

* Supports WeMo Switch, Light Switch, Insight Switch and Motion
* Command-line tool to discover and control devices in your environment
* REST API to obtain information and perform actions on devices
* Simple responsive Web app provides device control on mobile
* Python API to interact with device at a low level


text:
/* $FreeBSD: src/sys/rpc/rpcclnt.h,v 1.1 2003/11/14 20:54:10 alfred Exp $ */
/*	$OpenBSD: nfsmount.h,v 1.11 2002/03/14 01:27:13 millert Exp $	*/
/*	$NetBSD: nfsmount.h,v 1.10 1996/02/18 11:54:03 fvdl Exp $	*/

/*
 * copyright (c) 2003
 * the regents of the university of michigan
 * all rights reserved
 *
 * permission is granted to use, copy, create derivative works and redistribute
 * this software and such derivative works for any purpose, so long as the name
 * of the university of michigan is not used in any advertising or publicity
 * pertaining to the use or distribution of this software without specific,
 * written prior authorization.  if the above copyright notice or any other
 * identification of the university of michigan is included in any copy of any
 * portion of this software, then the disclaimer below must also be included.
 *
 * this software is provided as is, without representation from the university
 * of michigan as to its fitness for any purpose, and without warranty by the
 * university of michigan of any kind, either express or implied, including
 * without limitation the implied warranties of merchantability and fitness for
 * a particular purpose. the regents of the university of michigan shall not be
 * liable for any damages, including special, indirect, incidental, or
 * consequential damages, with respect to any claim arising out of or in
 * connection with the use of the software, even if it has been or is hereafter
 * advised of the possibility of such damages.
 */

/*
 * Copyright (c) 1989, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Rick Macklem at The University of Guelph.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)nfsmount.h	8.3 (Berkeley) 3/30/95
 */

#ifndef _RPCCLNT_H_
#define _RPCCLNT_H_

#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/lock.h>
#include <sys/mutex.h>

#ifdef __OpenBSD__
	#define RPC_EXEC_CTX struct proc *
#else
	#define RPC_EXEC_CTX struct thread *
#endif

#ifdef RPCCLNT_DEBUG
#define RPCDEBUG(args...) do{	\
	if(rpcdebugon != 0){	\
		printf("%s(): ", __FUNCTION__);\
		printf(args);	\
		printf("\n");	\
	}}while(0)
#else
#define RPCDEBUG(args...)
#endif

/* from nfs/nfs.h */
#define RPC_TICKINTVL     5

/* from nfs/nfsproto.h */
#define RPC_MAXDATA     32768
#define RPC_MAXPKTHDR   404
#define RPC_MAXPACKET   (RPC_MAXPKTHDR + RPC_MAXDATA)

#define RPCX_UNSIGNED   4

/* defines for rpcclnt's rc_flags
   XXX these flags came from the NFSMNT_* flags in OpenBSD's sys/mount.h */
#define RPCCLNT_SOFT            0x001 /* soft mount (hard is details) */
#define RPCCLNT_INT             0x002 /* allow interrupts on hard mounts */
#define RPCCLNT_NOCONN          0x004 /* dont connect the socket (udp) */
#define RPCCLNT_DUMBTIMR        0x010

#define RPCCLNT_SNDLOCK         0x100
#define RPCCLNT_WANTSND         0x200
#define RPCCLNT_RCVLOCK         0x400
#define RPCCLNT_WANTRCV         0x800

/* Flag values for r_flags */
#define R_TIMING        0x01            /* timing request (in mntp) */
#define R_SENT          0x02            /* request has been sent */
#define R_SOFTTERM      0x04            /* soft mnt, too many retries */
#define R_INTR          0x08            /* intr mnt, signal pending */
#define R_SOCKERR       0x10            /* Fatal error on socket */
#define R_TPRINTFMSG    0x20            /* Did a tprintf msg. */
#define R_MUSTRESEND    0x40            /* Must resend request */
#define R_GETONEREP     0x80            /* Probe for one reply only */

#define RPC_HZ          (hz / rpcclnt_ticks) /* Ticks/sec */
#define RPC_TIMEO       (1 * RPC_HZ)    /* Default timeout = 1 second */

#define RPC_MAXREXMIT   100             /* Stop counting after this many */

#define RPCIGNORE_SOERROR(s, e) \
                ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
                ((s) & PR_CONNREQUIRED) == 0)

#define RPCINT_SIGMASK  (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \
                         sigmask(SIGHUP)|sigmask(SIGQUIT))

#define RPCMADV(m, s)   (m)->m_data += (s)

#define RPCAUTH_ROOTCREDS NULL

#define RPCCLNTINT_SIGMASK(set)             \
  (SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) || \
	 SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) || \
	 SIGISMEMBER(set, SIGQUIT))

#define fxdr_unsigned(t, v) ((t)ntohl((int32_t)(v)))
#define txdr_unsigned(v)  (htonl((int32_t)(v)))

/* global rpcstats
 * XXX should be per rpcclnt */
struct rpcstats {
	int	rpcretries;
	int rpcrequests;
	int rpctimeouts;
	int rpcunexpected;
	int rpcinvalid;
};

struct rpc_program {
	u_int32_t prog_id;
	u_int32_t prog_version;
	char * prog_name;
};

struct rpc_auth {
	unsigned int auth_type;
};

struct rpctask {
	TAILQ_ENTRY(rpctask) r_chain;
	struct mbuf     *r_mreq;
	struct mbuf     *r_mrep;
	struct mbuf     *r_md;
	caddr_t         r_dpos;

	struct rpcclnt  *r_rpcclnt;

	u_int32_t       r_xid;
	int             r_flags;        /* flags on request, see below */
	int             r_retry;        /* max retransmission count */
	int             r_rexmit;       /* current retrans count */
	int             r_timer;        /* tick counter on reply */
	int             r_procnum;      /* NFS procedure number */
	int             r_rtt;          /* RTT for rpc */
	RPC_EXEC_CTX    r_td;
};

struct rpc_reply {
	struct {
		u_int32_t type;
		u_int32_t status;

		/* used only when reply == RPC_MSGDENIED and
		 * status == RPC_AUTHERR */
		u_int32_t autherr;

		/* rpc mismatch info if reply == RPC_MSGDENIED and
	 	* status == RPC_MISMATCH */
		struct {
			u_int32_t low;
			u_int32_t high;
		} mismatch_info;
	} stat;

	/* head of the mbuf chain */
	struct mbuf * mrep;

	/* mbuf and position of the verification opaque data
	 * note that this is only valid when stat.reply == RPC_MSGACCEPTED */
	u_int32_t verf_type;
	u_int32_t verf_size;
	struct mbuf * verf_md;
	caddr_t verf_dpos;

	/* mbuf and postion of the result of the rpc request */
	struct mbuf * result_md;
	caddr_t result_dpos;
};

/*
 * RPC Client connection context.
 * One allocated on every NFS mount.
 * Holds RPC specific information for mount.
 */
/* XXX: please note that all pointer type variables are just set (not copied),
 *      so it is up to the user to free these values */
struct	rpcclnt {
	int	rc_flag;		/* For RPCCLNT_* flags  */

	int	rc_wsize;		/* Max size of the request data */
	int	rc_rsize;		/* Max size of the response data */
	struct	sockaddr *rc_name;
	struct	socket *rc_so;		/* Rpc socket */
	int	rc_sotype;		/* Type of socket */
	int	rc_soproto;		/* and protocol */
	int	rc_soflags;		/* pr_flags for socket protocol */

	int	rc_timeo;		/* Init timer for NFSMNT_DUMBTIMR */
	int	rc_retry;		/* Max retries */
	int	rc_srtt[4];		/* Timers for rpcs */
	int	rc_sdrtt[4];
	int	rc_sent;		/* Request send count */
	int	rc_cwnd;		/* Request send window */
	int	rc_timeouts;		/* Request timeouts */

/* XXX: this is not being set!!!! */
	int	rc_deadthresh;		/* Threshold of timeouts-->dead server*/

	/* authentication: */
	/* currently can be RPCAUTH_NULL, RPCAUTH_KERBV4, RPCAUTH_UNIX */
	/* should be kept in XDR form */
	int	rc_authtype;		/* Authenticator type */

#if 0
	/* RPCAUTH_KERB4 */
	int	rc_authlen;		/* and length */
	char	*rc_authstr;		/* Authenticator string */
	int	rc_verflen;
	char	*rc_verfstr;		/* and the verifier */
#endif

	/* RPCAUTH_UNIX*/
	struct rpc_auth * rc_auth;	/* authentication */

#if 0
	/* stored in XDR form (network byte order) */
	unsigned int rc_progid;		/* program id */
	unsigned int rc_progvers;	/* program version */

	/* name of server for log messages */
	const char *rc_servername;	/* for printing error messages */
#else
	struct rpc_program * rc_prog;
#endif

	/* XXX: this should be removed */
	int rc_proctlen;		/* if == 0 then rc_proct == NULL */
	int * rc_proct;
};

#ifdef __OpenBSD__
extern struct pool rpcreply_pool;
extern struct pool rpcclnt_pool;
#else
/* MALLOC_DECLARE(M_RPC); */
#endif
extern int rpcdebugon;

#ifdef __OpenBSD__
#define rpcclnt_get(X)	\
	do {	\
	(X) = pool_get(&rpcclnt_pool, PR_WAITOK);	\
	bzero((X), sizeof(struct rpcclnt));	\
	}while(0)

#define rpcclnt_put(X)	\
	do {	\
	if ((X) != NULL){	\
		pool_put(&rpcclnt_pool, (X));	\
	}}while(0)

#else /* !__OpenBSD__ */

/* usage count for module (un)loading */
extern unsigned int rpcclnt_usage;
extern struct mtx rpcclnt_usage_mutex;

void rpcclnt_create(struct rpcclnt ** rpc);
void rpcclnt_destroy(struct rpcclnt * rpc);

#define rpcclnt_get(X) rpcclnt_create(&(X))
#define rpcclnt_put(X) rpcclnt_destroy(X)

#ifdef RPCCLNT_TEST
struct rpcclnt_test_args {
	int nothing;
};
int rpcclnt_test(struct thread *, struct rpcclnt_test_args *);

#define RPC_RETURN(X) do { RPCDEBUG("returning %d", X); return X; }while(0)
#endif /* RPCCLNT_TEST */

#endif /* !__OpenBSD__ */

void rpcclnt_init(void);
void rpcclnt_uninit(void);
#if 0
int rpcclnt_setup(struct rpcclnt *, int, struct sockaddr *, int, int, int, int, const char *, int, int);
#endif

int rpcclnt_setup(struct rpcclnt *, struct rpc_program *, struct sockaddr *, int, int, struct rpc_auth *, int, int, int);

int rpcclnt_connect(struct rpcclnt *, RPC_EXEC_CTX td);
int rpcclnt_reconnect(struct rpctask *, RPC_EXEC_CTX td);
void rpcclnt_disconnect(struct rpcclnt *);
void rpcclnt_safedisconnect(struct rpcclnt *);

void rpcclnt_setauth(struct rpcclnt *, u_int32_t,  u_int32_t, char *, u_int32_t, char *, struct ucred *);
int rpcclnt_request(struct rpcclnt *, struct mbuf *, int, RPC_EXEC_CTX, struct ucred *, struct rpc_reply *);
int rpcclnt_err(struct rpc_reply *);

int rpcclnt_cancelreqs(struct rpcclnt *);
int rpcclnt_sigintr(struct rpcclnt *, struct rpctask *, RPC_EXEC_CTX);

#endif /* _RPCCLNT_H_ */


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="robots" content="follow, index">
	<meta name="url" content="https://wilsonjunior.dev/confirmation"/>

	<meta name="description" content="Desenvolvedor Java com experiência em criação de sites, blogs e sistemas em geral.">
	<meta name="author" content="Wilson Junior">
	<title>Wilson Junior</title>

	<link href="/assets/css/confirmation.css" rel="stylesheet" />
	<link href="https://wilsonjunior.dev/confirmation" rel="canonical" />

Obrigado por entrar em contato

Retornando ao site em 5 segundos.

				Voltar


text:
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():

    return dict(initial_formation="template5", path_list=[
        [TestAction.create_mini_vm, "vm1", 'data_volume=false', 'cpu=random', 'memory=random', 'network=random', 'provisiong=thick'],
        [TestAction.change_vm_ha, "vm1"],
        [TestAction.create_vm_backup, "vm1", "backup1"],
        [TestAction.create_mini_vm, "vm2", 'data_volume=false', 'cpu=random', 'memory=random', 'network=random',
         'provisiong=thick'],
        [TestAction.create_volume, "volume1", "=scsi,thick"],
        [TestAction.resize_data_volume, "volume1", 5 * 1024 * 1024],
        [TestAction.create_volume, "volume2", "flag=scsi,thick", "size=random"],
        [TestAction.create_mini_vm, "vm3", 'data_volume=false', 'cpu=random', 'memory=random', 'network=random',
         'provisiong=thick'],
        [TestAction.delete_volume, "volume1"],
        [TestAction.recover_volume, "volume1"],
        [TestAction.add_image, "image1", 'root', "http://172.20.1.28/mirror/diskimages/centos_vdbench.qcow2"],
        [TestAction.attach_volume, "vm1", "volume1"],
        [TestAction.create_volume_backup, "volume1", "backup1"],
        [TestAction.change_vm_ha, "vm1"],
        [TestAction.stop_vm, "vm1"],
        [TestAction.use_volume_backup, "backup1"],
        [TestAction.start_vm, "vm1"],
        [TestAction.change_vm_ha, "vm1"],
        [TestAction.delete_image, "image1"],
        [TestAction.expunge_image, "image1"],
        [TestAction.create_volume_backup, "volume1","backup2"],
        [TestAction.change_vm_ha, "vm1"],
        [TestAction.resize_volume, "vm1", 5 * 1024 * 1024],
        [TestAction.resize_volume, "vm2", 5 * 1024 * 1024],
        [TestAction.resize_volume, "vm3", 5 * 1024 * 1024],
        [TestAction.attach_volume, "vm2", "volume2"],
        [TestAction.create_volume, "volume3", "flag=scsi,thick"],
        [TestAction.create_mini_vm, "vm4", 'data_volume=false', 'cpu=random', 'memory=random', 'network=random', 'provisiong=thick'],
        [TestAction.add_image, "image2", 'root', "http://172.20.1.28/mirror/diskimages/centos_vdbench.qcow2"],
        [TestAction.delete_volume, "volume2"],
        [TestAction.expunge_volume, "volume2"],
        [TestAction.change_vm_ha, "vm1"],
        [TestAction.change_vm_ha, "vm2"],
        [TestAction.change_vm_ha, "vm3"],
        [TestAction.change_vm_ha, "vm4"],
        [TestAction.create_vm_backup, "vm1", "backup3"],
        [TestAction.create_vm_backup, "vm2", "backup4"],
        [TestAction.create_vm_backup, "vm3", "backup5"],
        [TestAction.create_vm_backup, "vm4", "backup6"],
        [TestAction.create_image_from_volume, "vm1", "vm1-iamge1"],
        [TestAction.create_image_from_volume, "vm2", "vm2-iamge1"],
        [TestAction.create_image_from_volume, "vm3", "vm3-iamge1"],
        [TestAction.create_image_from_volume, "vm4", "vm4-iamge1"],
        [TestAction.delete_image, "vm1-image1"],
        [TestAction.recover_image, "vm1-image1"],
        [TestAction.change_vm_ha, "vm1"],
        [TestAction.change_vm_ha, "vm2"],
        [TestAction.change_vm_ha, "vm3"],
        [TestAction.change_vm_ha, "vm4"],
        [TestAction.stop_vm, "vm1"],
        [TestAction.stop_vm, "vm2"],
        [TestAction.stop_vm, "vm3"],
        [TestAction.stop_vm, "vm4"],
        [TestAction.use_vm_backup, "backup3"],
        [TestAction.use_vm_backup, "backup4"],
        [TestAction.use_vm_backup, "backup5"],
        [TestAction.use_vm_backup, "backup6"],
        [TestAction.start_vm, "vm1"],
        [TestAction.start_vm, "vm2"],
        [TestAction.start_vm, "vm3"],
        [TestAction.start_vm, "vm4"],
        [TestAction.change_vm_ha, "vm1"],
        [TestAction.change_vm_ha, "vm2"],
        [TestAction.change_vm_ha, "vm3"],
        [TestAction.change_vm_ha, "vm4"],
        [TestAction.add_image, "image3", 'root', "http://172.20.1.28/mirror/diskimages/centos_vdbench.qcow2"],
        [TestAction.create_volume, "volume4", "=scsi,thick"],
        [TestAction.attach_volume, "vm4", "volume4"]])


text:
/*
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
 *    PrintableComponent.java
 *    Copyright (C) 2005-2012 University of Waikato, Hamilton, New Zealand
 *
 */

package weka.gui.visualize;

import java.util.Hashtable;

/**
 * This interface is for all JComponent classes that provide the ability to
 * print itself to a file.
 *
 * @see PrintableComponent
 * @see PrintablePanel
 * @author FracPete (fracpete at waikato dot ac dot nz)
 * @version $Revision: 10222 $
 */
public interface PrintableHandler {
  /**
   * returns a Hashtable with the current available JComponentWriters in the
   * save dialog. the key of the Hashtable is the description of the writer.
   *
   * @return all currently available JComponentWriters
   * @see JComponentWriter#getDescription()
   */
  public Hashtable<String, JComponentWriter> getWriters();

  /**
   * returns the JComponentWriter associated with the given name, is
   * null if not found
   *
   * @return the writer associated with the given name
   * @see JComponentWriter#getDescription()
   */
  public JComponentWriter getWriter(String name);

  /**
   * sets the title for the save dialog
   */
  public void setSaveDialogTitle(String title);

  /**
   * returns the title for the save dialog
   */
  public String getSaveDialogTitle();

  /**
   * sets the scale factor
   *
   * @param x the scale factor for the x-axis
   * @param y the scale factor for the y-axis
   */
  public void setScale(double x, double y);

  /**
   * returns the scale factor for the x-axis
   */
  public double getXScale();

  /**
   * returns the scale factor for the y-axis
   */
  public double getYScale();

  /**
   * displays a save dialog for saving the component to a file.
   */
  public void saveComponent();
}