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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Essentials: Todo List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>

Essentials
    2.0.0

High-Performance C++ GPU Graph Analytics

Todo List

File array.hxx

extended array support for display, print (std::out and file::out), etc. features. These have proven very useful in the gunrock v1 and prior versions and we would like to continue to support them in the future.

Member gunrock::bfs::problem_t< graph_t, param_type, result_type >::init  () override

not used.

Member gunrock::cuda::properties::sm_max_shared_memory_bytes  (compute_capability_t capability)

Test if this function can be resolved at compile time

Member gunrock::cuda::standard_context_t::_mgpu_context

Find out how to use a shared_ptr<> without printing the GPU debug information. Currently, we are not releasing this pointer, which causes a memory leak. Fix this later.

Member gunrock::experimental::frontier::boolmap_frontier_t< type_t >::is_empty  ()

right now, this relies on an expensive get_number_of_elements() call, we can replace this with a simple transform that checks each position and if any one of the position is active, the frontier is not empty.

Member gunrock::frontier::frontier_t< vertex_t, edge_t, _kind, _view >::print  ()

Add support for printing the frontier in a more readable format.

Add support for printing a specific range of elements.

Member gunrock::frontier::vector_frontier_t< vertex_t, edge_t, _kind >::sequence  (type_t const initial_value, std::size_t const &size, cuda::stream_t stream=0)

Maybe we should accept standard_context_t instead of stream_t.

Member gunrock::geo::enactor_t< problem_t >::loop  (cuda::multi_context_t &context) override

We can possibly do better with a filter operator instead.

Member gunrock::geo::problem_t< graph_t, param_type, result_type >::reset  () override

reset the coordinates and inv_haversine_distance arrays.

Class gunrock::graph::edge_pair_t< edge_t >

: Cannot remember what this is for.

Member gunrock::operators::advance::block_mapped::execute  (graph_t &G, operator_t op, frontier_t &input, frontier_t &output, cuda::standard_context_t &context)

Resize the output (inactive) buffer to the new size. Can be hidden within the frontier struct.

Is there a better place to create block_offsets? This is always a one element array.

Is there a better place to create block_offsets? This is always a one element array.

Member gunrock::operators::advance::thread_mapped::execute  (graph_t &G, operator_t op, frontier_t &input, frontier_t &output, work_tiles_t &segments, cuda::standard_context_t &context)

Can be hidden within the frontier struct.

Member gunrock::sssp::enactor_t< problem_t >::loop  (cuda::multi_context_t &context) override

Confirm we do not need the following for bug https://github.com/gunrock/essentials/issues/9 anymore.

File helpers.hxx

These can be potentially moved under frontier's API.

Generated by

     1.8.13


text:
<?php
/**
 * Class for list page with mode simple
 *
 */
class ChartPage_Master extends ChartPage
{
	/**
	 * Constructor, set initial params
	 *
	 * @param array $params
	 */
	function __construct(&$params)
	{
		// call parent constructor
		parent::__construct($params);
	}

	public function getMasterHeading()
	{
		$this->xt->assign( "masterlist_title", true );
		return $this->xt->fetch_loaded( "masterlist_title" );
	}

	public function preparePage()
	{
		if( !$this->masterRecordData || !count($this->masterRecordData) )
			return;

		$this->xt->assign("chart_block", true);
		$this->assignChartElement();

		$this->xt->assign("pagetitlelabel", $this->getPageTitle( $this->pageType, GoodFieldName($this->tName), $this->masterRecordData ));

		$tKeys = $this->pSet->getTableKeys();
		$keylink = "";

		for($i = 0; $i < count($tKeys); $i ++) {
			$keylink.= "&key".($i + 1)."=".runner_htmlspecialchars(rawurlencode(@$this->masterRecordData[$tKeys[$i]]));
		}

		$fields = $this->pSet->getMasterListFields();
		$fields = array_merge( $fields, $tKeys);
		foreach( $fields as $f )
		{
			$fieldClassStr = $this->fieldClass($f);
			$this->xt->assign( GoodFieldName( $f ) . "_mastervalue", "".$this->showDBValue( $f, $this->masterRecordData, $keylink)."");
			$this->xt->assign( GoodFieldName( $f ) . "_class", $fieldClassStr); // add class for field header as field value
		}

		if( $this->pageLayout )
			$this->xt->assign("pageattrs", 'class="'.$this->pageLayout->style." page-".$this->pageLayout->name.'"');

		if( $this->pageLayout )
			$this->xt->assign("pageattrs", 'class="'.$this->pageLayout->style." page-".$this->pageLayout->name.'"');
		$this->xt->load_template( GetTemplateName($this->shortTableName, "masterchart") );
	}

	public function showMaster( $params )
	{

		if( !$this->masterRecordData || !count($this->masterRecordData) )
			return;

		$this->xt->assign( "masterlist_title", false );
		$this->xt->display_loaded();
	}
}

?>

redpajama_set_name: RedPajamaGithub


text:
namespace media {

DecoderFactory::DecoderFactory() = default;

DecoderFactory::~DecoderFactory() = default;

void DecoderFactory::CreateAudioDecoders(
    scoped_refptr<base::SequencedTaskRunner> task_runner,
    MediaLog* media_log,
    std::vector<std::unique_ptr<AudioDecoder>>* audio_decoders) {}

SupportedVideoDecoderConfigs
DecoderFactory::GetSupportedVideoDecoderConfigsForWebRTC() {
  return {};
}

void DecoderFactory::CreateVideoDecoders(
    scoped_refptr<base::SequencedTaskRunner> task_runner,
    GpuVideoAcceleratorFactories* gpu_factories,
    MediaLog* media_log,
    RequestOverlayInfoCB request_overlay_info_cb,
    const gfx::ColorSpace& target_color_space,
    std::vector<std::unique_ptr<VideoDecoder>>* video_decoders) {}

}  // namespace media


text:
package by.bsu.command.impl;

import by.bsu.command.Command;
import by.bsu.controller.JspPageName;
import by.bsu.exception.service.OrderCarAccServiceException;
import by.bsu.exception.service.OrderServiceException;
import by.bsu.model.Account;
import by.bsu.service.impl.OrderCarAccServiceImpl;
import by.bsu.service.impl.OrderServiceImpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class DeleteOrderCommand implements Command {
    @Override
    public String execute(HttpServletRequest request, HttpServletResponse response) {
        HttpSession session = request.getSession(false);
        String page = null;

        int id = Integer.parseInt(request.getParameter(ORDER_ID_ATTR_NAME));
        try {
            OrderServiceImpl.getInstance().deleteOrder(id);
            Account a = (Account) session.getAttribute(ACCOUNT_ATTR_NAME);
            request.setAttribute(ORDERS_CARS_LIST_ATTR_NAME, OrderCarAccServiceImpl.getInstance().getOrdersAndCarsByAccId(a.getId()));

            page = JspPageName.MY_ACCOUNT;
        } catch (OrderServiceException | OrderCarAccServiceException e) {
            page = JspPageName.ERROR_PAGE;
        }

        return page;
    }
}


text:
"""Module for figure function."""

import os
import numpy as np
import matplotlib.pyplot as plt
import sfg2d
import logging

from .plot import fit_model

def ioff(func):
    """Decorator to make plotting non interactive temporally ."""
    def make_ioff(*args, **kwargs):
        plt.ioff()
        func(*args, **kwargs)
        plt.ion()

    return make_ioff

def save_figs_to_multipage_pdf(figs, fpath):
    """Save a list of figures into a multipage pdf.

    figs: list of figures to save to a multipage pdf.
    fpath: filepath of the pdf to save to.
    """
    from matplotlib.backends.backend_pdf import PdfPages

    if fpath[-4:] != '.pdf':
        fpath += '.pdf'

    with PdfPages(fpath) as pdf:
        for fig in figs:
            pdf.savefig(fig)

    logging.info("Saved figure to: {}".format(os.path.abspath(fpath)))

def multiplot(
        plots=None,
        kwargs_figure=None,
        args_subplot=[111],
        kwargs_subplot=None,
        setters_fig=None,
        setters_axis=None,
        legend=False,
        ticks_right=False,
        title=None,
        kwargs_subplots_adjust=None,
        xticks=None,
        yticks=None,
        tight_layout=False,
):
    if not kwargs_figure:
        kwargs_figure = {}
    if not kwargs_subplot:
        kwargs_subplot = {}
    fig = plt.figure(**kwargs_figure)
    ax = fig.add_subplot(*args_subplot, **kwargs_subplot)
    ax.cla()
    if kwargs_subplots_adjust:
        plt.subplots_adjust(**kwargs_subplots_adjust)
    if title:
        plt.title(title)
    if ticks_right:
        ax.yaxis.tick_right()

    if setters_fig:
        for setter_name, setter_value in setters_fig.items():
            setter_func = getattr(fig, setter_name)
            setter_func(**setter_value)

    for plot_config_raw in plots:
        # name of the plot config is plot function name.
        # Therefore it must be stripped
        plot_func_name = plot_config_raw.get('name')
        if plot_func_name:
            plot_config = plot_config_raw.copy()
            plot_config.pop('name')
        else:
            # This is the legcy mode where each plot_config_raw hat to
            # be a one entry dictionary so that plot_func_name was
            # guranteed to be the first (and onnly) entry name
            logging.warn('Deprecated form of plot_config. Use "name" key to\
            define function name and remove one level of indentation.')
            plot_func_name, plot_config = list(plot_config_raw.items())[0]
        plot_func = getattr(sfg2d.plot, plot_func_name)
        kwargs_plot = plot_config.get('kwargs_plot', {})

        # This becomes spagetty code
        record = plot_config.get('record')
        model = plot_config.get('model')
        if record:
            logging.info('Select y data with: {}'.format( plot_config['kwargs_select_y'] ))
            ydata = record.select(**plot_config['kwargs_select_y'])

            kwargs_select_x = plot_config.get('kwargs_select_x')
            xdata = None
            if kwargs_select_x:
                logging.info('Select x data with: {}'.format( plot_config['kwargs_select_x'] ))
                xdata = record.select(**kwargs_select_x)

            kwargs_select_yerr = plot_config.get('kwargs_select_yerr')
            if kwargs_select_yerr:
               yerr = record.sem(**kwargs_select_yerr)
               kwargs_plot['yerr'] = yerr

            plot_func(xdata, ydata, **kwargs_plot)

        elif model:
            logging.info('Making model bases plot')
            plot_func(model, **kwargs_plot)
        else:
            raise NotImplementedError('Uknown data type for this figure function')

    if setters_axis:
        for setter_name, setter_value in setters_axis.items():
            setter_func = getattr(ax, setter_name)
            if isinstance(setter_value, dict):
                setter_func(**setter_value)
            else:
                setter_func(setter_value)

    if legend:
        if isinstance(legend, dict):
            ax.legend(**legend)
        else:
            ax.legend()

    if xticks:
        plt.xticks(xticks)
    if yticks:
        plt.yticks(yticks)

    if tight_layout:
        fig.tight_layout()
    return fig, ax

def spectrum(
        record,
        kwargs_subplot=None,
        kwargs_select=None,
        x_prop='range',
        x_prop_kw=None,
        save=False,
        title=None,
        fname=None,
        xlim=None,
        ylim=None,
        legend=None,
        **kwargs
):
    """Figure of Static spectrum from a record.

    record: Record to get data from
    save: Boolean, Save figure
    scale: Scale y axis.
    kwargs_select: dict passed to select method
    fig: give figure to plot on
    x_prop_kw: Dict for selection of x propertie
    ydata_prop: Allows to use a certain attribute of the ydata for the plot.

    Returns
      fig and ax.
    """
    if kwargs_subplot:
        fig, ax = plt.subplots(**kwargs_subplot)
        fig.clf()
    else:
        fig = plt.gcf()
        ax = plt.gca()
    # Must be None at first to prevent memory leackage from other calls
    if not x_prop_kw:
        x_prop_kw = {}
    if not kwargs_select:
        kwargs_select = {}

    kwargs_select.setdefault('delay_mean', True)
    kwargs_select.setdefault('frame_med', True)
    kwargs_select.setdefault('prop', 'unpumped')
    ydata = record.select(**kwargs_select)

    # Make sure that the use of roi_pixel doesn't fuck up figure axes
    kwargs_prop = kwargs_select.get('kwargs_prop')
    if kwargs_prop:
        roi_pixel = kwargs_prop.get('roi_pixel')
        if roi_pixel and x_prop in ('pixel', 'wavenumber', 'wavelength'):
            x_prop_kw['roi_pixel'] = roi_pixel

    # Handle xdata
    if x_prop == 'range':
        xdata = range(ydata.shape[-1])
    else:
        xdata = record.select(x_prop, **x_prop_kw)
        roi_pixel = kwargs_select.get('roi_pixel')
        if roi_pixel:
            xdata = xdata[roi_pixel]

    # Call of the plot function
    sfg2d.plot.spectrum(xdata, ydata, **kwargs)

    if not title:
        title = "{}".format(record.lname)
    plt.title(title)
    if xlim:
        plt.xlim(*xlim)
    if ylim:
        plt.ylim(*ylim)
    if legend:
        if isinstance(legend, dict):
            plt.legend(**legend)
        else:
            plt.legend()
    if not fname:
        fname = 'figures/{}_static.pdf'.format(record.name)
    if save:
        logging.info('Saving to: {}'.format(fname))
        plt.savefig(fname)
        logging.info("saved")
    return fig, ax

def figure(
        record,
        select_ydata_kw,
        select_xdata_kw,
        plot_func,
        plot_func_attr,
        subplots_kw=None,
):
    if subplots_kw:
        fig, ax = plt.subplots(**subplots_kw)
    else:
        fig = plt.gcf()
        ax = plt.gca()

    xdata = record.select(**select_xdata_kw)
    ydata = record.select(**select_ydata_kw)

    plot_func = getattr(sfg2d.plot, plot_func)
    plot_func(xdata, ydata, **plot_func_attr)

    return fig, ax

def hot_and_cold(
        record_cold,
        record_hot,
        kwargs_subplot=None,
        kwargs_select_cold=None,
        kwargs_select_hot=None,
        x_prop='wavenumber',
        title=None,
        plot_hot_kw=None,
        plot_cold_kw=None,
        scale=1,
        fname='figures/hot_and_cold.pdf',
        save=False,
        legend=True,
        xlim=None,
        ylim=None,
):
    """Heat figure."""

    if not kwargs_subplot: kwargs_subplot = {}
    if not kwargs_select_cold: kwargs_select_cold = {}
    if not kwargs_select_hot: kwargs_select_hot = {}
    if not plot_hot_kw: plot_hot_kw = {}
    if not plot_cold_kw: plot_cold_kw = {}

    fig, ax = plt.subplots(**kwargs_subplot)
    fig.clf()

    for kwargs_select in (kwargs_select_hot, kwargs_select_cold):
        kwargs_select.setdefault('delay_mean', True)
        kwargs_select.setdefault('frame_med', True)
        kwargs_select.setdefault('prop', 'unpumped')
    cold = record_cold.select(**kwargs_select_cold)
    hot = record_hot.select(**kwargs_select_hot)
    plot_hot_kw.setdefault('label', 'Hot')
    plot_hot_kw.setdefault('color', 'C3')
    plot_cold_kw.setdefault('label', 'Cold')
    plot_cold_kw.setdefault('color', 'C0')
    sfg2d.plot.spectrum(record_hot.select(x_prop), scale*hot, **plot_hot_kw)
    sfg2d.plot.spectrum(record_cold.select(x_prop), scale*cold, **plot_cold_kw)

    if title:
        plt.title(title)
    if xlim:
        plt.xlim(*xlim)
    if ylim:
        plt.ylim(*ylim)
    if save:
        logging.info('Saving to: {}'.format(os.path.abspath(fname)))
        plt.savefig(fname)
        logging.info('DONE')

    if legend:
        plt.legend()
    return fig, ax

def heat_diff(
        record_cold,
        record_hot,
        opt='-',
        kwargs_subplot={},
        kwargs_select_cold={},
        kwargs_select_hot={},
        x_prop='wavenumber',
        title=None,
        plot_kw={},
        scale=1,
        fname='figures/heat_diff.pdf',
        save=False,
        legend=False,
        xlim=None,
        ylim=None,
):

    """Figure with the difference between cold and hot spectrum."""
    fig, ax = plt.subplots(**kwargs_subplot)
    fig.clf()

    for kwargs_select in (kwargs_select_hot, kwargs_select_cold):
        kwargs_select.setdefault('delay_mean', True)
        kwargs_select.setdefault('frame_med', True)
        kwargs_select.setdefault('prop', 'unpumped')
    cold = record_cold.select(**kwargs_select_cold)
    hot = record_hot.select(**kwargs_select_hot)

    if opt is '-':
        diff = hot-cold
    elif opt is '/':
        diff = hot/cold
    sfg2d.plot.spectrum(record_cold.select(x_prop), scale*diff, **plot_kw)

    if title:
        plt.title(title)
    if xlim:
        plt.xlim(*xlim)
    if ylim:
        plt.ylim(*ylim)
    if save:
        logging.info('Saving to: {}'.format( os.path.abspath(fname) ))
        plt.savefig(fname)
        logging.info('DONE')

    if legend:
        plt.legend()
    return fig, ax

def pump_probe(
        record,
        kwargs_subplots={},
        kwargs_data={},
        kwargs_plot={},
        colorbar=True,
        title=None,
        xlim=None,
        ylim=None,
        xlabel='Time in fs',
        ylabel='Frequency in 1/cm',
        fname=None,
        savefig=False,
        close=False,
        skip=False,
):
    """Configurable contour plot.

    A contour plot of a record. By default it uses the relative
    bleach of  the record. At first a median filter of 7 pixels is used.
    Can be changed with: 'kwargs_data=dicht(medfilt_pixel=number)'. Afterwards
    an FFT based double resample filter with 30 Frequencies is used. Can
    be changed with 'kwargs_data=dict(resample_filter=number)'. To change the
    contrast of the plot, change the levels of the contour plot with:
    'kwargs_plot=dict(levels=arange(min, max, stepsize))'.

    **Arguments:**
      - **record**: The record to plot.
    **Keywords:**
      - **kwargs_subplots**: Keywords for subplot creation
      - **kwargs_data**: Keywords for record.contour data selection
      - **kwargs_plot**: Keywords for the contour plot.
      - **colorbar**: Boolean to show colorbar
      - **title**: Title string. By default tries to construct tile from record
      - **xlim**: X axis limit of the plot. Default is None
      - **ylim**: Y Axis limit of the plot. Default is None
      - **xalbel**: X label of the plot.
      - **ylabel**: Y label if the plot.
      - **fname**: File name to save figure with. If none given
           'figures/pump_probe.pdf' is used
      - **savefig**: Boolean to save figure
      - **close**: Boolean to close figure at the end.
      - **skip**: Boolean weather to skip the plot.

    **Returns**
    Figure object.
    """
    if skip:
        logging.info("Skipping...")
        return

    fig, ax = plt.subplots(**kwargs_subplots)
    record.figures[fig.number] = fig

    kwargs_data.setdefault('resample_freqs', 30)
    kwargs_data.setdefault('medfilt_pixel', 7)
    x, y, z = record.contour(
        **kwargs_data
    )

    kwargs_plot.setdefault('extend', 'both')
    plt.contourf(x, y, z, **kwargs_plot)
    if colorbar:
        plt.colorbar()

    if not title:
        try:
            title = "{} Pump @ {}".format(record.lname, record.pump_freq)
        except AttributeError:
            title = ''
    plt.title(title)

    if xlim:
        plt.xlim(xlim)
    if ylim:
        plt.ylim(ylim)
    plt.xlabel(xlabel)
    plt.ylabel(ylabel)

    if not fname:
        fname = 'figures/pump_probe.pdf'

    if savefig:
        logging.info('Saving to: {}'.format( fname ))
        plt.savefig(fname)
        logging.info('DONE')

    if close:
        plt.close(fig)

    return fig

def trace(
        record,
        sl,
        kwargs_data={},
        fit_modekwargs_legend={},
        kwargs_subplots={},
        title=None,
        kwargs_plot={},
        errorbar_kwargs=None,
        xlim=None,
        ylim=None,
        xlabel='Time in fs',
        ylabel='Relative Bleach',
        legend=True,
        fname=None,
        save=False,
        close=False,
):
    """Figure of a trace.

    **Arguments:**
      - **record**: sfg2d.SfgRecord object
      - **sl**: slice that selects the region of interest in wavenumbers.

    **Optional fig_trace_config keywords:**
      - **kwargs_data**: Keywords of data selection. See `sfg2d.SfgRecord.trace`
        for more information.
      - **fit_modekwargs_legend**: Config of `fit_model`, See sfg2d.analyse.fit_model for
        further information.
      - **fig_kwargs**: Keywors of the subplots.
      - **title**: Title of the plot.
      - **errorbar_kwargs**: Keywords of the errorbar plot
      - **xlim**: Xlim of the plot
      - **ylim**: Ylim of the plot
      - **xlabel**: xlabel of the plot
      - **ylabel**: ylabel of the plot
      - **legend**: boolean it show legend. Defaults to true.
      - **fname**: String of filename to save figure at.
      - **save**: Boolean if figure should be saved to fname.

    """
    kwargs_data['roi_wavenumber'] =  sl
    x, y, yerr = record.trace(**kwargs_data)
    y, yerr = y.squeeze(), yerr.squeeze()

    # Indentifier is there for convenience
    _model_identifier = '' # Identifier for default filename if model is used.
    model_name = fit_modekwargs_legend.get('name')
    if model_name:
        _model_identifier = '_{}'.format({
            'FourLevelMolKinM': '4L',
            'SimpleDecay': 'SD'
        }.get(model_name, model_name))

    fig, ax = plt.subplots(**kwargs_subplots)

    if title:
        plt.title(title)

    if errorbar_kwargs:
        errorbar_kwargs.setdefault('marker', 'o')
        errorbar_kwargs.setdefault('label', 'Data')
        errorbar_kwargs.setdefault('linestyle', 'None')
        errorbar_kwargs.setdefault('axes', ax)
        plotline, capline, barline = plt.errorbar(
            x,
            y,
            yerr,
            **errorbar_kwargs
        )
    else:
        kwargs_plot.setdefault('marker', 'o')
        kwargs_plot.setdefault('linestyle', 'None')
        ax.plot(x, y, **kwargs_plot)

    model = None
    if model_name:
        model_key = '{}-{} {}'.format(
                sl.start, sl.stop, model_name
            )
        model = fit_model(x, y, yerr, **fit_modekwargs_legend)
        record.models[model_key] = model

    if xlim:
        plt.xlim(xlim)
    if ylim:
        plt.ylim(ylim)
    plt.xlabel(xlabel)
    plt.ylabel(ylabel)
    if legend:
        plt.legend()

    if not fname:
        fname = 'figures/{}_pump{}_trace{}-{}{}.pdf'.format(
            record.name,
            record.pump_freq,
            sl.start,
            sl.stop,
            _model_identifier
        )

    if save:
        logging.info('Saving to: {}'.format(os.path.abspath(fname)))
        plt.savefig(fname)
        logging.info('DONE')

    if close:
        plt.close(fig)

    return fig

def trace_model(
        model,
        kwargs_subplots=None,
        title=None,
        errorbar_kwargs=None,
        linekwargs_plot=None,
        xlim=None,
        ylim=None,
        xlabel="Time in fs",
        ylabel="Bleach",
        fname=None,
        save=False,
        close=False,
        clf=True,
        ):
    """Figure of a model.

    **Arguments:**
      - **model**: The sfg2d.models.Model object to plot.
      - **config**: A dictionary with configuration parameters of the plot.

    **config**:
      - **fig_kwargs**: Dictionary to configure the figure with.
      - **ax**: Dictionary to configure the axes with
      - **title**: Title string of the figure
      - **error_kwargs**: Dictonary to configure the errorbar plot with.
    """
    if not kwargs_subplots:
        kwargs_subplots = {}
    if not errorbar_kwargs:
        errorbar_kwargs = {}
    if not linekwargs_plot:
        linekwargs_plot = {}
    fig, ax = plt.subplots(**kwargs_subplots)
    if clf:
        fig.clf()

    if title:
        plt.title(title)
    model.figures[fig.number] = fig

    errorbar_kwargs.setdefault('marker', 'o')
    errorbar_kwargs.setdefault('linestyle', 'None')
    plotline, capline, barline = plt.errorbar(
        model.xdata, model.ydata, model.yerr, **errorbar_kwargs
    )

    linekwargs_plot.setdefault('color', plotline.get_color())
    plt.plot(model.xsample, model.yfit_sample, **linekwargs_plot)

    if xlim:
        plt.xlim(xlim)
    if ylim:
        plt.ylim(ylim)
    plt.xlabel(xlabel)
    plt.ylabel(ylabel)

    if not fname:
        fname = 'figures/trace_model.pdf'

    if save:
        logging.info('Saving to: {}'.format( fname ))
        plt.savefig(fname)
        logging.info('DONE')

    if close:
        plt.close()

def models(
        models,
        models_kwargs_plot=[],
        num=None,
        title=None,
        fname=None
):
    """Plot list of given models.

    models: List of Models to plot
    models_kwargs_plot: List of configurations per plot
    """
    fig, ax = plt.subplots(num=num)
    fig.clf()
    for i in range(len(models)):
        model = models[i]
        kwargs_plot = {}
        try:
            kwargs_plot = models_kwargs_plot[i]
        except:
            pass
        sfg2d.plot.model(model, kwargs_plot)
    if title:
        plt.title(title)
    plt.legend()

    if fname:
        logging.info('Saving to: {}'.format(fname))
        plt.savefig(fname)
        logging.info('DONE')

    return fig, ax

def record_models(record, model_names, modekwargs_legend_plot=None):
    """Figure of multiple models from the same record.

    modekwargs_legend_plot: list of dicts. Each entry gets passed to
        `sfg2d.plot.model` as kwargs.
    """
    models = [record.models.get(model_name) for model_name in model_names]
    fig, ax = plt.subplots(
        num='{}_pump{}_traces'.format(record.name, record.pump_freq))
    fig.clf()
    if not modekwargs_legend_plot:
        modekwargs_legend_plot = [{} for model in models]
    for model, model_plot_kwg in zip(models, modekwargs_legend_plot):
        # Catch when model was not created
        if model:
            logging.debug(model_plot_kwg)
            sfg2d.plot.model(model, **model_plot_kwg)
    plt.legend()
    plt.xlabel('Time in fs')
    plt.ylabel('Relative Bleach')
    record.figures[fig.number] = fig

def bleach_slider(
        record,
        kwargs_selects={},
        x_prop='wavenumber',
        kwargs_plot={},
        scale=1,
        fig=None,
        ax=None,
        ylim=None,
        xlim=None,
        kwargs_legend={"loc": "lower left"},
):
    """Bleachplot, with slidable pp_delay index and autoscale.

    **Keywrords:**
      - **record**: The record to plot
      - **kwargs_select**: Select keywords to select data with.
         The default corresponds to:
         `{'prop': 'bleach', 'kwargs_prop':'{'prop':'basesubed'},
          'frame_med': True, 'medfilt_pixel':5}`
      - **scale**: Scaling factor for the data.
      - **fig**: figure
      - **ax**: axes
      - **ylim**: Optional tuple. Set fix ymin and ymax.
      - **xlim**: tuple to set xaxis.
      - **kwargs_legend**: Keywordsfor the plot legend
    """
    from ipywidgets import interact, widgets

    if not fig and not ax:
        fig, ax = plt.subplots()
    else:
        if not fig:
            fig = plt.figure()
        if not ax:
            ax = fig.add_subplot(111)

    axes_lim_buffer = None

    kwargs_select_y = dict(**kwargs_selects)
    kwargs_select_y.setdefault('prop', 'bleach')
    kwargs_select_y.setdefault('kwargs_prop', {'prop': 'basesubed'})
    kwargs_select_y.setdefault('frame_med', True)
    kwargs_select_y.setdefault('medfilt_pixel', 5)

    @interact(
        Autoscale=True,
        index=widgets.IntSlider(
            max=record.number_of_pp_delays-1,
            continuous_update=False
        )
    )
    def my_plot(Autoscale, index):
        global axes_lim_buffer

        ax.clear()
        y = record.select(
            roi_delay=slice(index, index+1),
            **kwargs_select_y,
        )
        sfg2d.plot.spectrum(record.select(x_prop), scale*y, **kwargs_plot)

        if Autoscale:
            axes_lim_buffer = ax.get_xlim(), ax.get_ylim()

        if not isinstance(ylim, type(None)):
            ax.set_ylim(*ylim)
        elif not Autoscale:
            ax.set_ylim(axes_lim_buffer[1])

        if not isinstance(xlim, type(None)):
            ax.set_xlim(*xlim)
        elif not Autoscale:
            ax.set_xlim(axes_lim_buffer[0])

        ax.legend(**kwargs_legend)
        ax.figure.canvas.draw()

    return fig, ax

@ioff
def bleach_pdf(
        record,
        sfile,
        sfolder="./figures/",
        kwargs_selects={},
        kwargs_plot={},
        scale=1,
        xlim=None,
        ylim=None,
        x_prop='wavenumber',
        num_base='bl{}',
        xlabel='Wavenumber/cm$^{-1}$',
        ylabel=None,
        kwargs_legend={"loc": "lower left"},
        title_prefix=None,
        delay_offset=0,
):
    """Multipage pdf for the bleach plot.

    **Arguments**:
      - **record**: Record to plot data of
      - **sfile**: String with filename to save.
    **Keywords**:
      - **sfolder**: String with foldername to save file in.
      - **kwargs_selects**: Dict with keywords for selection of data.
        default corresponds to:
          {'prop': 'bleach', 'kwargs_prop':'{'prop':'basesubed'},
          'frame_med': True, 'medfilt_pixel':5}`
      - **kwargs_plot**: Keywords passed to the `plot_spce` function.
      - **scale**: Scaling factor for the data.
      - **ylim**: Optional tuple. Set fix ymin and ymax.
      - **xlim**: tuple to set xaxis.
      - **x_prop**: Propertie of the x axis
      - **num_base**: String to index the multiple plots with.
      - **xlabel**: String for the xlabel
      - **ylabel**: string for the y label
      - **kwargs_legend**: Keywordsfor the plot legend
      - **title_prefix**: Optinal String to prefix the title with.
           Default is record.metadata['material']
      - **delay_offset**: Offset to add to the delay.
    axes limits are always the same for all subplots.
    """

    kwargs_select_y = dict(**kwargs_selects)
    kwargs_select_y.setdefault('prop', 'bleach')
    # Improves perfromance in the case of relative bleach
    kwargs_select_y.setdefault('kwargs_prop', {'prop': 'basesubed'})
    kwargs_select_y.setdefault('frame_med', True)
    kwargs_select_y.setdefault('medfilt_pixel', 5)
    figs = []
    for index in range(record.number_of_pp_delays):
        fig, ax = plt.subplots(num=num_base.format(index))
        figs.append(fig)

        # Index must be selected after data selection,
        # else zero_time_subtractionn doesnt work
        y = record.select(
            **kwargs_select_y,
        )[slice(index, index+1)]

        x = record.select(prop=x_prop)
        sfg2d.plot.spectrum(x, scale*y, ax=ax, **kwargs_plot)

        if not title_prefix:
            title_prefix = record.metadata.get('material', '')
        ax.set_title("{} @ {} fs".format(
            title_prefix, record.pp_delays[index]+delay_offset)
        )
        ax.set_xlim(xlim)
        if xlabel:
            ax.set_xlabel(xlabel)
        if ylabel:
            ax.set_ylabel(ylabel)

    # Prepare axes limits
    if isinstance(ylim, type(None)):
        ylim = [0, 0]
        for fig in figs:
            axes = fig.get_axes()
            for ax in axes:
                if ax.get_ylim()[0] < ylim[0]:
                    ylim[0] = ax.get_ylim()[0]
                if ax.get_ylim()[1] > ylim[1]:
                    ylim[1] = ax.get_ylim()[1]
    ymin, ymax = ylim

    for fig in figs:
        for ax in fig.get_axes():
            ax.set_ylim(ylim)

    save_figs_to_multipage_pdf(figs, sfolder+sfile)
    for fig in figs:
        plt.close(fig.number)

def spectrum_pump_vs_probe(
        record2d,
        delay,
        roi_pixel=slice(None),
        kwargs_pump_vs_probe={},
        kwargs_contour={},
        colorbar=True,
        diagonal=True,
        num=None,
        title='',
        tight_layout=False,
):
    """Figure of 2dRecprd."""

    fig, ax = plt.subplots(num=num)
    fig.clf()
    plt.title(title)
    kwargs_pump_vs_probe['delay'] = delay
    kwargs_pump_vs_probe['roi_pixel'] = roi_pixel
    x = record2d.pump_freqs
    y = record2d.wavenumbers[roi_pixel]
    z = record2d.pump_vs_probe(**kwargs_pump_vs_probe)
    plt.contourf(x, y, z, **kwargs_contour)
    plt.xlabel('Pump in 1/cm')
    plt.ylabel('Probe in 1/cm')
    if colorbar:
        plt.colorbar()
    if diagonal:
        l_min = np.max([x.min(), y.min()])
        l_max = np.min([x.max(), y.max()])
        plt.plot([l_min, l_max], [l_min, l_max], color='k')
    if tight_layout:
        plt.tight_layout()

    return fig

@ioff
def spectra_pump_vs_probe(
        record2d,
        roi_pump_freqs=slice(None),
        roi_pixel=slice(None),
        kwargs_pump_vs_probe={},
        kwargs_contour={},
        fig_name='',
        title='',
        close=True,
        save=True,
        colorbar=True,
        diagonal=True,
        tight_layout=False,
):
    """Saves pump vs probe spectra."""
    figures = []
    for delay in range(len(record2d.pp_delays)):
        fig, ax = plt.subplots(
            num=fig_name+"_pp_delay{:.0f}".format(record2d.pp_delays[delay])
        )
        figures.append(fig)
        fig.clf()
        plt.title(title + ' {:.0f} fs'.format(record2d.pp_delays[delay]))
        kwargs_pump_vs_probe['delay'] = delay
        kwargs_pump_vs_probe['roi_pixel'] = roi_pixel
        x = record2d.pump_freqs
        y = record2d.wavenumbers[roi_pixel]
        z = record2d.pump_vs_probe(**kwargs_pump_vs_probe)
        plt.contourf(x, y, z, **kwargs_contour)
        plt.xlabel('Pump in 1/cm')
        plt.ylabel('Probe in 1/cm')
        if colorbar:
            plt.colorbar()
        if diagonal:
            l_min = np.max([x.min(), y.min()])
            l_max = np.min([x.max(), y.max()])
            plt.plot([l_min, l_max], [l_min, l_max], color='k')
        if tight_layout:
            plt.tight_layout()

    if save:
        sfg2d.plotting.save_figs_to_multipage_pdf(
            figures,
            'figures/{}_record2d'.format(fig_name)
        )

    if close:
        for fig in figures:
            plt.close(fig)

    return figures

def spectra_static(
        record2d,
        kwargs_subplots={},
        kwargs_data={},
        title=None,
):
    """Static Spectra for measured Pump Frequencies."""
    fig, ax = plt.subplots(**kwargs_subplots)
    fig.clf()
    if title:
        plt.title(title)

    kwargs_data.setdefault('delay', 0)
    xdata = record2d.wavenumbers[kwargs_data.get('roi_pixel', slice(None))]
    ydata = record2d.static(**kwargs_data)
    plt.plot(xdata, ydata)
    plt.legend(['{:.0f} 1/cm'.format(elm) for elm in record2d.pump_freqs])
    plt.xlabel('Wavenumber in 1/cm')
    plt.ylabel('Normalized SFG in a.u.')
    return fig


text:
namespace DogAgilityCompetition.Circe.Protocol.Exceptions;

/// <summary>
/// Represents the error that is thrown when the bytes of a parameter value inside a CIRCE packet could not be parsed.
/// </summary>
public sealed class ParameterValueFormatException : PacketFormatException
{
    /// <summary>
    /// Initializes a new instance of the <see cref="ParameterValueFormatException" /> class.
    /// </summary>
    /// <param name="packet">
    /// The source packet buffer.
    /// </param>
    /// <param name="errorOffset">
    /// The offset in <paramref name="packet" /> where the error was found.
    /// </param>
    /// <param name="message">
    /// The error message text.
    /// </param>
    /// <param name="innerException">
    /// Optional. The exception that caused the current exception.
    /// </param>
    public ParameterValueFormatException(byte[] packet, int errorOffset, string message, Exception? innerException)
        : base(packet, errorOffset, message, innerException)
    {
    }
}


text:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>prueba</title>

	<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
	<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>

	<script>

		//var ws = io.connect('http://127.0.0.1:8080/');
		var ws = io.connect('https://appstreaming.herokuapp.com/');

		var bandera=0;
		window.URL = window.URL || window.webKitURL;

		window.addEventListener('load', init);

		function init(){
			var canvas = document.querySelector('#miCanvas');
			var video = document.querySelector('#miVideo');
			var ctx = canvas.getContext('2d');
			dFrame(ctx, video, canvas);
		}

		function dFrame(ctx,video,canvas){
		 ctx.drawImage(video,0,0);
		 var dataURL = canvas.toDataURL('image/jpeg',0.2);
		 if(bandera!=0) ws.emit('newFrame',dataURL);
		 requestAnimFrame(function(){
			dFrame(ctx,video,canvas);
		 });
		}

		window.requestAnimFrame = (function(callback){
			return window.requestAnimationFrame || window.webKitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback){ window.setTimeout(callback, 1000 / 100); };
		})();

		navigator.getUserMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
	   if (navigator.getUserMedia) {
		  navigator.getUserMedia(
			{video:true,audio:false},
			 function(stream) {
				bandera=1;
				document.querySelector('#miVideo').src = window.URL.createObjectURL(stream);
			 },
			 function(error) { console.log("Ocurrió el siguiente error: " + error); }
		  );
	   }
	   else {
		  alert('Sorry, the browser you are using doesn\'t support getUserMedia');
		}
	</script>
</head>

<style>
 video{display:none}
</style>

<body>

	<video id="miVideo"></video>
	<canvas id="miCanvas" width="800" height="600" ></canvas>

</body>
</html>


text:
module common.services {
    export class NotificationService {

        static $inject = ['toastr'];

        constructor(private toastr: Toastr) { }

        static factory() {
            var factory = (toastr: Toastr) => new NotificationService(toastr);
            factory.$inject = NotificationService.$inject;
            return factory;
        }

        public showSuccess(message, title = '', options?: ToastrOptions) {
            return this.toastr.success(message, title, options);
        }

        public showWarning(message, title = '', options?: ToastrOptions) {
            return this.toastr.warning(message, title, options);
        }

        public showError(message, title = '', options?: ToastrOptions) {
            return this.toastr.error(message, title, options);
        }

        public showInfo(message, title = '', options?: ToastrOptions) {
            return this.toastr.info(message, title, options);
        }

        public clearMessages() {
            this.toastr.clear();
        }
    }
}

(() => {
    angular
        .module('common')
        .service('NotificationService', common.services.NotificationService.factory());
})();


text:
name "sqitch"
default_version "1.3.0"

license "MIT"
license_file "https://raw.githubusercontent.com/theory/sqitch/master/README.md"

dependency "perl"
dependency "cpanminus"

# install a LGPL-licensed version of libintl-perl:
dependency "libintl-perl"

# version_list: url=https://github.com/theory/#{name}/releases/download/v#{version}/ filter=app-sqitch-*.tar.gz

version("1.3.0")  { source sha256: "7d07635ec77a7faf3c50281c76ec833c68702f14470996cb2203a8bc6abc5bf2" }
version("1.2.1")  { source sha256: "020835a13429effd8fda12d5627604ecf99293775918f4f8ba9ccc5ed796e5e7" }
version("1.1.0")  { source sha256: "ee146cd75d6300837e6ca559bb0bde247d42123c96b2c5d4b2800f38d3e3d1ab" }
version("0.9999") { source sha256: "f5bfa80206738ab8a70358a3b0557661c7459e11ec07dece23ecafa1f34372b3" }
version("0.973")  { source sha256: "95fc7f18fff786c5d2579133e2e3ac56779e54bb3a06a1af1117054e9f49ab32" }

if version >= "1.1.0"
  source url: "https://github.com/theory/#{name}/releases/download/v#{version}/app-sqitch-v#{version}.tar.gz"
  relative_path "App-Sqitch-v#{version}"
else
  source url: "https://github.com/theory/#{name}/releases/download/v#{version}/app-sqitch-#{version}.tar.gz"
  relative_path "App-Sqitch-#{version}"
end

# See https://github.com/theory/sqitch for more
build do
  env = with_standard_compiler_flags(with_embedded_path)
  # Lists-MoreUtils-XS does not build on RHEL 5 or SUSE 11 currently.
  # This option is used by the Lists-MoreUtils build configuration to
  # decide whether to use the -XS package or a pure perl
  # implementation.
  env["PERL_MM_OPT"] = "PUREPERL_ONLY=1"
  command "perl Build.PL", env: env
  command "./Build installdeps --cpan_client 'cpanm -v --notest'", env: env
  command "./Build", env: env
  command "./Build install", env: env

  # Here is another licensing fun. Some of the dependencies of sqitch
  # unfortunately have GPL3 and LGPL3 licenses which are requiring us to remove
  # them from our packages after installing sqitch. Here we are uninstalling
  # them without breaking the licensing information collection.
  %w{Test-MockModule}.each do |package_name|
    module_name = package_name.gsub("-", "::")

    # Here we run cpanm --uninstall with a different PERL_CPANM_HOME. The reason
    # for this is to keep the licensing information for sqitch intact. The way
    # license_scout works is to look into PERL_CPANM_HOME/latest-build (by
    # default ~/.cpanm/latest-build) which contains the modules installed during
    # the last install. This directory is a symlink that points to the directory
    # contains the information about the latest build. Without changing
    # PERL_CPANM_HOME we would overwrite the link and will not be able to
    # collect the dependencies installed to our package while doing the actual
    # sqitch install.
    Dir.mktmpdir do |tmpdir|
      command "cpanm --force --uninstall #{module_name}", env: env.merge({
        "PERL_CPANM_HOME" => tmpdir,
      })
    end

    # Here we are removing the problematic package from the original
    # PERL_CPANM_HOME cache directory. This ensures that we do not add
    # licensing information about these components to our package.
    cpanm_root = File.expand_path("~/.cpanm/latest-build")
    delete "#{cpanm_root}/#{package_name}*"
  end

end


text:
<?php

require_once("include/utils/CommonUtils.php");
require_once("include/events/SqlResultIterator.inc");
require_once("include/events/VTWSEntityType.inc");

require_once("VTWorkflowApplication.inc");
require_once("VTTaskManager.inc");
require_once("VTWorkflowManager.inc");
require_once("VTWorkflowUtils.php");
	function vtTaskEdit($adb, $request, $current_language, $app_strings){
		global $theme;
		$util = new VTWorkflowUtils();
		$image_path = "themes/$theme/images/";

		$module = new VTWorkflowApplication('edittask');

		$mod = return_module_language($current_language, $module->name);

		if(!$util->checkAdminAccess()){
			$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
			$util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
			return;
		}

		$smarty = new vtigerCRM_Smarty();
		$tm = new VTTaskManager($adb);
		$smarty->assign('edit',isset($request["task_id"]));
		if(isset($request["task_id"])){
			$task = $tm->retrieveTask($request["task_id"]);
			$taskClass = get_class($task);
			$workflowId=$task->workflowId;
		}else{
			$workflowId = $request["workflow_id"];
			$taskClass = vtlib_purifyForSql($request["task_type"]);
			$task = $tm->createTask($taskClass, $workflowId);
		}

		if($task==null){
			$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_TASK']);
			$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_TASK']);
			return;
		}

		$wm = new VTWorkflowManager($adb);
		$workflow = $wm->retrieve($workflowId);
		if($workflow==null){
			$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NO_WORKFLOW']);
			$util->redirectTo($errorUrl, $mod['LBL_ERROR_NO_WORKFLOW']);
			return;
		}

		$smarty->assign("workflow", $workflow);
		$smarty->assign("returnUrl", vtlib_purify($request["return_url"]));
		$smarty->assign("task", $task);
		$smarty->assign("taskType", $taskClass);
		$smarty->assign("saveType", vtlib_purify($request['save_type']));

		$taskTypeInstance = VTTaskType::getInstanceFromTaskType($taskClass);
		$taskTemplateClass = $tm->retrieveTemplatePath($module->name, $taskTypeInstance);
		$smarty->assign("taskTemplate", $taskTemplateClass);

		$et = VTWSEntityType::usingGlobalCurrentUser($workflow->moduleName);
		$smarty->assign("entityType", $et);
		$smarty->assign('entityName', $workflow->moduleName);
		$smarty->assign("fieldNames", $et->getFieldNames());
		$repeat_date = $task->calendar_repeat_limit_date;
		if(!empty ($repeat_date)){
		    $repeat_date = DateTimeField::convertToUserFormat($repeat_date);
		}
		$smarty->assign('REPEAT_DATE',$repeat_date);
		$dateFields = array();
		$fieldTypes = $et->getFieldTypes();
		$fieldLabels = $et->getFieldLabels();
		foreach($fieldTypes as $name => $type){
			if($type->type=='Date' || $type->type=='DateTime'){
				$dateFields[$name] = $fieldLabels[$name];
			}
		}

		$smarty->assign('dateFields', $dateFields);

		if($task->trigger!=null){
			$trigger = $task->trigger;
			$days = $trigger['days'];
			if ($days < 0){
				$days*=-1;
				$direction = 'before';
			}else{
				$direction = 'after';
			}
			$smarty->assign('trigger', array('days'=>$days, 'direction'=>$direction,
			  'field'=>$trigger['field']));
		}
		$metaVariables = $task->getMetaVariables();

		$date = new DateTimeField(null);
		$time = substr($date->getDisplayTime(), 0, 5);
		$smarty->assign("META_VARIABLES",$metaVariables);
		$smarty->assign("SYSTEM_TIMEZONE",$db_timezone);
		$smarty->assign("USER_TIME",$task->formatTimeForTimePicker($time));
		$smarty->assign("USER_DATE", $date->getDisplayDate());
		$smarty->assign("MOD", array_merge(
			return_module_language($current_language,'Settings'),
			return_module_language($current_language, 'Calendar'),
			return_module_language($current_language, $module->name)));
		$smarty->assign("APP", $app_strings);
		$smarty->assign("dateFormat", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
		$smarty->assign("IMAGE_PATH",$image_path);
		$smarty->assign("THEME", $theme);
		$smarty->assign("MODULE_NAME", $module->label);
		$smarty->assign("PAGE_NAME", $mod['LBL_EDIT_TASK']);
		$smarty->assign("PAGE_TITLE", $mod['LBL_EDIT_TASK_TITLE']);

		$users = $group = array();
		$users = get_user_array();
		$group = get_group_array();
		foreach($group as $id => $name) {
			$users[$id] = $name;
		}
		$smarty->assign('ASSIGNED_TO', $users);
		$smarty->assign("module", $module);
		$smarty->display("{$module->name}/EditTask.tpl");
	}
	vtTaskEdit($adb, $_REQUEST, $current_language, $app_strings);
?>


text:
package com.amazonaws.services.snowball.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Defines the real-time status of a Snowball's data transfer while the device is at AWS. This data is only available
 * while a job has a JobState value of InProgress, for both import and export jobs.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DataTransfer implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The number of bytes transferred between a Snowball and Amazon S3.
     *

     */
    private Long bytesTransferred;
    /**
     *

     * The number of objects transferred between a Snowball and Amazon S3.
     *

     */
    private Long objectsTransferred;
    /**
     *

     * The total bytes of data for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until all
     * the keys that will be transferred have been listed.
     *

     */
    private Long totalBytes;
    /**
     *

     * The total number of objects for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until
     * all the keys that will be transferred have been listed.
     *

     */
    private Long totalObjects;

    /**
     *

     * The number of bytes transferred between a Snowball and Amazon S3.
     *

     *
     * @param bytesTransferred
     *        The number of bytes transferred between a Snowball and Amazon S3.
     */

    public void setBytesTransferred(Long bytesTransferred) {
        this.bytesTransferred = bytesTransferred;
    }

    /**
     *

     * The number of bytes transferred between a Snowball and Amazon S3.
     *

     *
     * @return The number of bytes transferred between a Snowball and Amazon S3.
     */

    public Long getBytesTransferred() {
        return this.bytesTransferred;
    }

    /**
     *

     * The number of bytes transferred between a Snowball and Amazon S3.
     *

     *
     * @param bytesTransferred
     *        The number of bytes transferred between a Snowball and Amazon S3.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DataTransfer withBytesTransferred(Long bytesTransferred) {
        setBytesTransferred(bytesTransferred);
        return this;
    }

    /**
     *

     * The number of objects transferred between a Snowball and Amazon S3.
     *

     *
     * @param objectsTransferred
     *        The number of objects transferred between a Snowball and Amazon S3.
     */

    public void setObjectsTransferred(Long objectsTransferred) {
        this.objectsTransferred = objectsTransferred;
    }

    /**
     *

     * The number of objects transferred between a Snowball and Amazon S3.
     *

     *
     * @return The number of objects transferred between a Snowball and Amazon S3.
     */

    public Long getObjectsTransferred() {
        return this.objectsTransferred;
    }

    /**
     *

     * The number of objects transferred between a Snowball and Amazon S3.
     *

     *
     * @param objectsTransferred
     *        The number of objects transferred between a Snowball and Amazon S3.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DataTransfer withObjectsTransferred(Long objectsTransferred) {
        setObjectsTransferred(objectsTransferred);
        return this;
    }

    /**
     *

     * The total bytes of data for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until all
     * the keys that will be transferred have been listed.
     *

     *
     * @param totalBytes
     *        The total bytes of data for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero)
     *        until all the keys that will be transferred have been listed.
     */

    public void setTotalBytes(Long totalBytes) {
        this.totalBytes = totalBytes;
    }

    /**
     *

     * The total bytes of data for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until all
     * the keys that will be transferred have been listed.
     *

     *
     * @return The total bytes of data for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero)
     *         until all the keys that will be transferred have been listed.
     */

    public Long getTotalBytes() {
        return this.totalBytes;
    }

    /**
     *

     * The total bytes of data for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until all
     * the keys that will be transferred have been listed.
     *

     *
     * @param totalBytes
     *        The total bytes of data for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero)
     *        until all the keys that will be transferred have been listed.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DataTransfer withTotalBytes(Long totalBytes) {
        setTotalBytes(totalBytes);
        return this;
    }

    /**
     *

     * The total number of objects for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until
     * all the keys that will be transferred have been listed.
     *

     *
     * @param totalObjects
     *        The total number of objects for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero)
     *        until all the keys that will be transferred have been listed.
     */

    public void setTotalObjects(Long totalObjects) {
        this.totalObjects = totalObjects;
    }

    /**
     *

     * The total number of objects for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until
     * all the keys that will be transferred have been listed.
     *

     *
     * @return The total number of objects for a transfer between a Snowball and Amazon S3. This value is set to 0
     *         (zero) until all the keys that will be transferred have been listed.
     */

    public Long getTotalObjects() {
        return this.totalObjects;
    }

    /**
     *

     * The total number of objects for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until
     * all the keys that will be transferred have been listed.
     *

     *
     * @param totalObjects
     *        The total number of objects for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero)
     *        until all the keys that will be transferred have been listed.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DataTransfer withTotalObjects(Long totalObjects) {
        setTotalObjects(totalObjects);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getBytesTransferred() != null)
            sb.append("BytesTransferred: ").append(getBytesTransferred()).append(",");
        if (getObjectsTransferred() != null)
            sb.append("ObjectsTransferred: ").append(getObjectsTransferred()).append(",");
        if (getTotalBytes() != null)
            sb.append("TotalBytes: ").append(getTotalBytes()).append(",");
        if (getTotalObjects() != null)
            sb.append("TotalObjects: ").append(getTotalObjects());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof DataTransfer == false)
            return false;
        DataTransfer other = (DataTransfer) obj;
        if (other.getBytesTransferred() == null ^ this.getBytesTransferred() == null)
            return false;
        if (other.getBytesTransferred() != null && other.getBytesTransferred().equals(this.getBytesTransferred()) == false)
            return false;
        if (other.getObjectsTransferred() == null ^ this.getObjectsTransferred() == null)
            return false;
        if (other.getObjectsTransferred() != null && other.getObjectsTransferred().equals(this.getObjectsTransferred()) == false)
            return false;
        if (other.getTotalBytes() == null ^ this.getTotalBytes() == null)
            return false;
        if (other.getTotalBytes() != null && other.getTotalBytes().equals(this.getTotalBytes()) == false)
            return false;
        if (other.getTotalObjects() == null ^ this.getTotalObjects() == null)
            return false;
        if (other.getTotalObjects() != null && other.getTotalObjects().equals(this.getTotalObjects()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getBytesTransferred() == null) ? 0 : getBytesTransferred().hashCode());
        hashCode = prime * hashCode + ((getObjectsTransferred() == null) ? 0 : getObjectsTransferred().hashCode());
        hashCode = prime * hashCode + ((getTotalBytes() == null) ? 0 : getTotalBytes().hashCode());
        hashCode = prime * hashCode + ((getTotalObjects() == null) ? 0 : getTotalObjects().hashCode());
        return hashCode;
    }

    @Override
    public DataTransfer clone() {
        try {
            return (DataTransfer) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.snowball.model.transform.DataTransferMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
class Siege < Formula
  desc "HTTP regression testing and benchmarking utility"
  homepage "https://www.joedog.org/siege-home/"
  url "http://download.joedog.org/siege/siege-4.0.4.tar.gz"
  sha256 "8f7dcf18bd722bb9cc92bc3ea4b59836b4a2f8d8f01d4a94c8d181f56d91ea6f"

  bottle do
    sha256 "a5e4990ab448ec37e9e5e7b392a7bf6aee03313bad6d89c6fda45decd4ddecf4" => :high_sierra
    sha256 "84ad0232db938f558c2ad57b5c61382b136483c3d4f106f6fcea7e647d2b9982" => :sierra
    sha256 "4ffac4100438cc7d6784a64774770ffe219bf330e96890c77eb012bab0f02ba5" => :el_capitan
  end

  depends_on "openssl"

  def install
    # To avoid unnecessary warning due to hardcoded path, create the folder first
    (prefix/"etc").mkdir
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--mandir=#{man}",
                          "--localstatedir=#{var}",
                          "--with-ssl=#{Formula["openssl"].opt_prefix}"
    system "make", "install"
  end

  def caveats; <<-EOS.undent
    macOS has only 16K ports available that won't be released until socket
    TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
    Consider reducing in case of available port bottleneck.

    You can check whether this is a problem with netstat:

        # sysctl net.inet.tcp.msl
        net.inet.tcp.msl: 15000

        # sudo sysctl -w net.inet.tcp.msl=1000
        net.inet.tcp.msl: 15000 -> 1000

    Run siege.config to create the ~/.siegerc config file.
    EOS
  end

  test do
    system "#{bin}/siege", "--concurrent=1", "--reps=1", "https://www.google.com/"
  end
end


text:
// Copyright (c) 2010-2014 SharpDX - SharpDX Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;
using System.Collections;
using System.Collections.Generic;

namespace SharpDX.Toolkit.Collections
{
    /// <summary>
    /// An observable dictionary.
    /// </summary>
    /// <typeparam name="TKey">The dictionary's key type.</typeparam>
    /// <typeparam name="TValue">The dictionary's value type.</typeparam>
    public class ObservableDictionary<TKey, TValue> : IDictionary<TKey, TValue>
    {
        private readonly Dictionary<TKey, TValue> dictionary;

        /// <inheritdoc/>
        public ObservableDictionary()
            : this(0, null)
        {
        }

        /// <inheritdoc/>
        public ObservableDictionary(int capacity)
            : this(capacity, null)
        {
        }

        /// <inheritdoc/>
        public ObservableDictionary(IEqualityComparer<TKey> comparer)
            : this(0, comparer)
        {
        }

        /// <inheritdoc/>
        public ObservableDictionary(IDictionary<TKey, TValue> dictionary)
            : this(dictionary, null)
        {
        }

        /// <inheritdoc/>
        public ObservableDictionary(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer)
            : this(dictionary != null ? dictionary.Count : 0, comparer)
        {
            if (dictionary == null) throw new ArgumentNullException("dictionary");

            foreach (var pair in dictionary)
                Add(pair.Key, pair.Value);
        }

        /// <inheritdoc/>
        public ObservableDictionary(int capacity, IEqualityComparer<TKey> comparer)
        {
            dictionary = new Dictionary<TKey, TValue>(capacity, comparer);
        }

        /// <summary>
        /// Returns the collection of the keys present in dictionary.
        /// </summary>
        public ICollection<TKey> Keys { get { return dictionary.Keys; } }

        /// <summary>
        /// Gets the collection of the values present in dictionary.
        /// </summary>
        public ICollection<TValue> Values { get { return dictionary.Values; } }

        /// <summary>
        /// Gets the cound of items present in dictionary.
        /// </summary>
        public int Count { get { return dictionary.Count; } }

        /// <summary>
        /// Is raised when a new item is added to the dictionary.
        /// </summary>
        public event EventHandler<ObservableDictionaryEventArgs<TKey, TValue>> ItemAdded;

        /// <summary>
        /// Is raised when an item is removed from the dictionary.
        /// </summary>
        public event EventHandler<ObservableDictionaryEventArgs<TKey, TValue>> ItemRemoved;

        /// <summary>
        /// Gets the enumerator of this dictionary.
        /// </summary>
        /// <returns>The enumerator instance of the dictionary.</returns>
        public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
        {
            return dictionary.GetEnumerator();
        }

        /// <summary>
        /// Removes all items from the dictionary.
        /// </summary>
        public void Clear()
        {
            var args = new List<ObservableDictionaryEventArgs<TKey, TValue>>();
            // event should be raised _after_ collection modification
            foreach (var pair in dictionary)
                args.Add(new ObservableDictionaryEventArgs<TKey, TValue>(pair));

            dictionary.Clear();

            foreach (var e in args)
                OnItemRemoved(e);
        }

        /// <summary>
        /// Adds a new value with the specified key to dictionary.
        /// </summary>
        /// <param name="key">The added key.</param>
        /// <param name="value">The added value.</param>
        public void Add(TKey key, TValue value)
        {
            dictionary.Add(key, value);
            OnItemAdded(new ObservableDictionaryEventArgs<TKey, TValue>(key, value));
        }

        /// <summary>
        /// Checks whether the dictionary contains the specified key.
        /// </summary>
        /// <param name="key">The key to check for presence.</param>
        /// <returns>true if the dictionary contains the provided key, false - otherwise.</returns>
        public bool ContainsKey(TKey key)
        {
            return dictionary.ContainsKey(key);
        }

        /// <summary>
        /// Removes the value corresponding to the specified key from dictionary.
        /// </summary>
        /// <param name="key">The key to remove.</param>
        /// <returns>true if the item was removed, false - otherwise.</returns>
        public bool Remove(TKey key)
        {
            TValue value;
            if (!dictionary.TryGetValue(key, out value))
                return false;

            dictionary.Remove(key);
            OnItemRemoved(new ObservableDictionaryEventArgs<TKey, TValue>(key, value));

            return true;
        }

        /// <summary>
        /// Tries to get the value associated with the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="value">Contains the returned value on success.</param>
        /// <returns>true if the value was returned successfuly, false - otherwise.</returns>
        public bool TryGetValue(TKey key, out TValue value)
        {
            return dictionary.TryGetValue(key, out value);
        }

        /// <summary>
        /// Gets or sets a value associated with the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <returns>The associated value.</returns>
        public TValue this[TKey key]
        {
            get { return dictionary[key]; }
            set
            {
                TValue oldValue;
                var isReplace = dictionary.TryGetValue(key, out oldValue);
                dictionary[key] = value;

                if (isReplace)
                    OnItemRemoved(new ObservableDictionaryEventArgs<TKey, TValue>(key, oldValue));

                OnItemAdded(new ObservableDictionaryEventArgs<TKey, TValue>(key, value));
            }
        }

        /// <inheritdoc/>
        bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly { get { return ((ICollection<KeyValuePair<TKey, TValue>>)dictionary).IsReadOnly; } }

        /// <inheritdoc/>
        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        /// <inheritdoc/>
        void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item)
        {
            ((ICollection<KeyValuePair<TKey, TValue>>)dictionary).Add(item);
            OnItemAdded(new ObservableDictionaryEventArgs<TKey, TValue>(item));
        }

        /// <inheritdoc/>
        bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item)
        {
            var removed = ((ICollection<KeyValuePair<TKey, TValue>>)dictionary).Remove(item);
            if (removed)
                OnItemRemoved(new ObservableDictionaryEventArgs<TKey, TValue>(item));

            return removed;
        }

        /// <inheritdoc/>
        bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> item)
        {
            return ((ICollection<KeyValuePair<TKey, TValue>>)dictionary).Contains(item);
        }

        /// <inheritdoc/>
        void ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
        {
            ((ICollection<KeyValuePair<TKey, TValue>>)dictionary).CopyTo(array, arrayIndex);
        }

        /// <inheritdoc/>
        protected virtual void OnItemAdded(ObservableDictionaryEventArgs<TKey, TValue> args)
        {
            var handler = ItemAdded;
            if (handler != null)
                handler(this, args);
        }

        /// <inheritdoc/>
        protected virtual void OnItemRemoved(ObservableDictionaryEventArgs<TKey, TValue> args)
        {
            var handler = ItemRemoved;
            if (handler != null)
                handler(this, args);
        }
    }
}


text:
using NBitcoin;
using NBitcoin.DataEncoders;
using NBitcoin.Protocol;

namespace Stratis.Bitcoin.Features.SmartContracts.PoS
{
    /// <summary>A smart contract proof of stake transaction.</summary>
    public class SmartContractPosTransaction : PosTransaction
    {
        public SmartContractPosTransaction() : base()
        {
        }

        public SmartContractPosTransaction(string hex, ProtocolVersion version = ProtocolVersion.PROTOCOL_VERSION) : this()
        {
            this.FromBytes(Encoders.Hex.DecodeData(hex), version);
        }

        public SmartContractPosTransaction(byte[] bytes) : this()
        {
            this.FromBytes(bytes);
        }
    }
}


text:
package org.aml.typesystem.values;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 *
ObjectImpl class.

 *
 * @author kor
 * @version $Id: $Id
 */
public final class ObjectImpl implements IObject {

	/**
	 *
toRAML.

	 *
	 * @param o a {@link java.lang.Object} object.
	 * @return a {@link java.lang.Object} object.
	 */
	@SuppressWarnings("unchecked")
	public static final Object toRAML(Object o) {
		if (o instanceof Map) {
			o = new ObjectImpl((Map<String, Object>) o);
		} else if (o instanceof List) {
			o = new ArrayImpl((List<?>) o);
		}
		return o;
	}

	protected LinkedHashMap<String, Object> values = new LinkedHashMap<>();

	/**
	 *
Constructor for ObjectImpl.

	 */
	public ObjectImpl() {
	}

	/**
	 *
getMap.

	 *
	 * @return a {@link java.util.Map} object.
	 */
	public Map<String,Object>getMap(){
		return values;
	}

	/**
	 *
Constructor for ObjectImpl.

	 *
	 * @param value a {@link java.util.Map} object.
	 */
	public ObjectImpl(Map<String, Object> value) {
		for (final String s : value.keySet()) {
			this.values.put(s, toRAML(value.get(s)));
		}
	}

	/** {@inheritDoc} */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final ObjectImpl other = (ObjectImpl) obj;
		if (values == null) {
			if (other.values != null) {
				return false;
			}
		} else if (!values.equals(other.values)) {
			return false;
		}
		return true;
	}

	/** {@inheritDoc} */
	@Override
	public Object getProperty(String name) {
		return values.get(name);
	}

	/** {@inheritDoc} */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (values == null ? 0 : values.hashCode());
		return result;
	}

	/** {@inheritDoc} */
	@Override
	public Set<String> keys() {
		return values.keySet();
	}

	/**
	 *
putProperty.

	 *
	 * @param name a {@link java.lang.String} object.
	 * @param value a {@link java.lang.Object} object.
	 */
	public void putProperty(String name, Object value) {
		this.values.put(name, value);
	}

	/**
	 *
remove.

	 *
	 * @param string a {@link java.lang.String} object.
	 */
	public void remove(String string) {
		values.remove(string);
	}

	/** {@inheritDoc} */
	@Override
	public String toString() {
		return values.toString();
	}
}


text:
import * as ajv from 'ajv';
import { Observable } from 'rxjs';
import { BaseException } from '../../exception/exception';
import { JsonObject } from '../interface';
import { JsonVisitor, PromptProvider, SchemaFormat, SchemaRegistry, SchemaValidator, SchemaValidatorError, SmartDefaultProvider } from './interface';
import { JsonSchema } from './schema';
export declare type UriHandler = (uri: string) => Observable<JsonObject> | Promise<JsonObject> | null | undefined;
export declare class SchemaValidationException extends BaseException {
    readonly errors: SchemaValidatorError[];
    constructor(errors?: SchemaValidatorError[], baseMessage?: string);
    static createMessages(errors?: SchemaValidatorError[]): string[];
}
export declare class CoreSchemaRegistry implements SchemaRegistry {
    private _ajv;
    private _uriCache;
    private _uriHandlers;
    private _pre;
    private _post;
    private _currentCompilationSchemaInfo?;
    private _smartDefaultKeyword;
    private _promptProvider?;
    private _sourceMap;
    constructor(formats?: SchemaFormat[]);
    private _fetch;
    /**
     * Add a transformation step before the validation of any Json.
     * @param {JsonVisitor} visitor The visitor to transform every value.
     * @param {JsonVisitor[]} deps A list of other visitors to run before.
     */
    addPreTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
    /**
     * Add a transformation step after the validation of any Json. The JSON will not be validated
     * after the POST, so if transformations are not compatible with the Schema it will not result
     * in an error.
     * @param {JsonVisitor} visitor The visitor to transform every value.
     * @param {JsonVisitor[]} deps A list of other visitors to run before.
     */
    addPostTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
    protected _resolver(ref: string, validate: ajv.ValidateFunction): {
        context?: ajv.ValidateFunction;
        schema?: JsonObject;
    };
    /**
     * Flatten the Schema, resolving and replacing all the refs. Makes it into a synchronous schema
     * that is also easier to traverse. Does not cache the result.
     *
     * @param schema The schema or URI to flatten.
     * @returns An Observable of the flattened schema object.
     */
    flatten(schema: JsonObject): Observable<JsonObject>;
    /**
     * Compile and return a validation function for the Schema.
     *
     * @param schema The schema to validate. If a string, will fetch the schema before compiling it
     * (using schema as a URI).
     * @returns An Observable of the Validation function.
     */
    compile(schema: JsonSchema): Observable<SchemaValidator>;
    addFormat(format: SchemaFormat): void;
    addSmartDefaultProvider<T>(source: string, provider: SmartDefaultProvider<T>): void;
    registerUriHandler(handler: UriHandler): void;
    usePromptProvider(provider: PromptProvider): void;
    private _applyPrompts;
    private static _set;
    private _applySmartDefaults;
}


text:
"""
--- Day 9: All in a Single Night ---

Every year, Santa manages to deliver all of his presents in a single night.

This year, however, he has some new locations to visit; his elves have provided him the distances between every pair of locations. He can start and end at any two (different) locations he wants, but he must visit each location exactly once. What is the shortest distance he can travel to achieve this?

For example, given the following distances:

London to Dublin = 464
London to Belfast = 518
Dublin to Belfast = 141

The possible routes are therefore:

Dublin -> London -> Belfast = 982
London -> Dublin -> Belfast = 605
London -> Belfast -> Dublin = 659
Dublin -> Belfast -> London = 659
Belfast -> Dublin -> London = 605
Belfast -> London -> Dublin = 982

The shortest of these is London -> Dublin -> Belfast = 605, and so the answer is 605 in this example.

What is the distance of the shortest route?

--- Part Two ---

The next year, just to show off, Santa decides to take the route with the longest distance instead.

He can still start and and at any two (different) locations he wants, and he still must visit each location exactly once.

For example, given the distances above, the longest route would be 982 via (for example) Dublin -> London -> Belfast.

What is the distance of the longest route?

"""
import collections
import itertools
import os

def calculate_length(ordering, distances):
    length = 0
    for city, next_city in zip(ordering, ordering[1:]):
        length += distances[city][next_city]
    return length

def santa_tsp(data, comparison=min):
    distances = collections.defaultdict(dict)
    for i in data:
        cities, distance = i.split(' = ')
        distance = int(distance)
        src, dst = cities.split(' to ')
        distances[src][dst] = distance
        distances[dst][src] = distance

    cities = distances.keys()
    target_length = None
    for ordering in itertools.permutations(cities):
        length = calculate_length(ordering, distances)
        if target_length is None:
            target_length = length
        target_length = comparison(target_length, length)

    return target_length

if __name__ == '__main__':
    this_dir = os.path.dirname(__file__)
    with open(os.path.join(this_dir, 'day9.input'), 'r') as f:
        data = f.read()
    data = data.split('\n')
    print("Santa's minimum distance is", santa_tsp(data))
    print("Santa's maximum distance is", santa_tsp(data, comparison=max))


text:
require "spec_helper"

require "active_record"
require "active_model"
require "ruby_enum/active_record"
require "ruby_enum/active_model"

ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Base.send(:include, RubyEnum::ActiveRecord::AttrEnum)
ActiveRecord::Base.send(:include, RubyEnum::ActiveModel::AttrEnum)
ActiveRecord::Schema.define do
  self.verbose = false
  create_table :users, :force => true do |t|
    t.string :name
    t.string :favorite_color
  end
end

class Color
  include RubyEnum

  enum :red
  enum :green
  enum :blue
  enum :black
end

class User < ActiveRecord::Base
  attr_enum :favorite_color, class_name: 'Color'
end

module RubyEnum
  module ActiveRecord

    describe AttrEnum do

      context "when passing an enumeration instance to initializer opts" do
        subject { User.new(favorite_color: Color.green) }

        it { expect(subject.favorite_color).to eq Color.green }
      end

      context "when passing an enumeration instance value to initializer options" do
        subject { User.new(favorite_color: Color.green.value) }

        it { expect(subject.favorite_color).to eq Color.green }
      end

      context "when passing null to initializer options" do
        subject { User.new(favorite_color: nil) }

        it { expect(subject.favorite_color).to be_nil }
      end

      context "given an active record model" do
        subject { User.new }

        it "should set an enumeration attribute to an enumeration value" do
          subject.favorite_color = Color.green
          expect(subject.favorite_color).to eq Color.green
        end

        it "should set an enumeration attribute to nil" do
          subject.favorite_color = Color.green
          subject.favorite_color = nil
          expect(subject.favorite_color).to be_nil
        end

        it "should persist an enumeration attribute" do
          subject.favorite_color = Color.green
          subject.save!
          subject.reload
          expect(subject.favorite_color).to eq Color.green
        end

        it "should not set a non enumeration value to an enumeration attribute" do
          expect do
            subject.favorite_color = "green"
          end.to raise_error(StandardError)
        end
      end
    end
  end
end


text:
<!Doctype html>

  <%- include ../meta.html %>
  <link rel="stylesheet" href="/resource/css/forget.css">

  <%- include ../header.html %>

查看用户

            <input type="text" name="email" data-validate="email" class="ipt ipt-email" disabled autocomplete="off" placeholder="请输入登录邮箱" value="<%=userInfo.username%>">

            <input style="display:none;">

            <input type="text" name="nick" data-validate="nick" class="ipt ipt-nick" placeholder="请输入用户昵称" value="<%=userInfo.nickname%>">

            <input type="text" name="realname" data-validate="nick" class="ipt ipt-nick ipt-realname" placeholder="请输入您的真实姓名" value="<%=userInfo.realname%>">

            <input type="text" name="mobile" data-validate="nick" class="ipt ipt-nick ipt-mobile" placeholder="请输入您的手机号" value="<%=userInfo.mobile%>">

            <input type="text" name="idcard" data-validate="nick" class="ipt ipt-nick ipt-idcard" placeholder="请输入您的身份证号" value="<%=userInfo.idcard%>">

          <input type="hidden" value="<%=userInfo.id%>" name="id" class="ipt-id">

            <input type="text" name="verify" maxlength="4" class="ipt" placeholder="请输入验证码">

            看不清
换一张

              <input type="submit" id="js-forgot-submit" class="btn btn-green link-btn btn-block" value="提交">

资料修改成功!

  <%- include ../footer.html %>


text:
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#include "thrift/compiler/test/fixtures/lean_mean_meta_machine/gen-cpp2/module_data.h"

namespace test_cpp2 { namespace cpp_reflection {

constexpr const std::size_t _enum1EnumDataStorage::size;
constexpr const std::array<enum1, 3> _enum1EnumDataStorage::values;
constexpr const std::array<folly::StringPiece, 3> _enum1EnumDataStorage::names;

}} // test_cpp2::cpp_reflection
namespace apache { namespace thrift {

}} // apache::thrift
namespace test_cpp2 { namespace cpp_reflection {

constexpr const std::size_t _enum2EnumDataStorage::size;
constexpr const std::array<enum2, 3> _enum2EnumDataStorage::values;
constexpr const std::array<folly::StringPiece, 3> _enum2EnumDataStorage::names;

}} // test_cpp2::cpp_reflection
namespace apache { namespace thrift {

}} // apache::thrift
namespace test_cpp2 { namespace cpp_reflection {

constexpr const std::size_t _enum3EnumDataStorage::size;
constexpr const std::array<enum3, 3> _enum3EnumDataStorage::values;
constexpr const std::array<folly::StringPiece, 3> _enum3EnumDataStorage::names;

}} // test_cpp2::cpp_reflection
namespace apache { namespace thrift {

}} // apache::thrift
namespace test_cpp2 { namespace cpp_reflection {

constexpr const std::size_t _enum_with_special_namesEnumDataStorage::size;
constexpr const std::array<enum_with_special_names, 26> _enum_with_special_namesEnumDataStorage::values;
constexpr const std::array<folly::StringPiece, 26> _enum_with_special_namesEnumDataStorage::names;

}} // test_cpp2::cpp_reflection
namespace apache { namespace thrift {

}} // apache::thrift


text:
/*
 * This file was generated - do not edit it directly !!
 * Generated by AuDAO tool, a product of Spolecne s.r.o.
 * For more information please visit http://www.spoledge.com
 */
package database.dao;

import com.spoledge.audao.db.dao.AbstractDao;
import com.spoledge.audao.db.dao.DaoException;

import database.dto.UndersoegelsesType;

/**
 * This is the DAO.
 *
 * @author generated
 */
public interface UndersoegelsesTypeDao extends AbstractDao {

    /**
     * Finds a record identified by its primary key.
     * @return the record found or null
     */
    public UndersoegelsesType findByPrimaryKey( int undersoegelsesTypeId );

    /**
     * Finds records.
     */
    public UndersoegelsesType[] findDynamic( String cond, int offset, int count, Object... params );

    /**
     * Inserts a new record.
     * @return the generated primary key - undersoegelsesTypeId
     */
    public int insert( UndersoegelsesType dto ) throws DaoException;

    /**
     * Updates one record found by primary key.
     * @return true iff the record was really updated (=found and any change was really saved)
     */
    public boolean update( int undersoegelsesTypeId, UndersoegelsesType dto ) throws DaoException;

}


text:
package com.clearfit;

import java.io.*;

import org.apache.batik.transcoder.image.JPEGTranscoder;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;

public class StringToJPEG {

  public static byte[] call(String str) throws Exception {
    byte[] retval = null;

    // Create a JPEG transcoder
    JPEGTranscoder t = new JPEGTranscoder();

    // Set the transcoding hints.
    t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
        new Float(.8));

    // Create the transcoder input.
    InputStream is = new ByteArrayInputStream(str.getBytes());
    TranscoderInput input = new TranscoderInput(is);

    // Create the transcoder output.
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    TranscoderOutput output = new TranscoderOutput(out);

    // Save the image.
    t.transcode(input, output);

    // Flush and close the stream.
    out.flush();
    retval = out.toByteArray();
    out.close();

    return retval;
  }
}


text:
The add method adds an attempt to a certain login/ip combo.

throws `Sentry\SentryException`

##### Example

	try
	{
		// Add an attempt using the email and ip address
		Sentry::attempts('john.doe@example.com', '123.432.2.1')->add();
	}
	catch (Sentry\SentryException $e)
	{
		$error = $e->getMessage();
	}


text:
layout: post
title: Welcome!
---

I'm Nelson Gonçalves, a freelance 3D generalist and educator living in Portugal.
  My work spans a wide range of subjects and styles with a special focus on digital heritage, architecture visualization
  and stylized cartoons. Additionally, I have extensive experience in higher education and training.

I'm really busy these days but I'm also always available to listen to challenging
  freelance jobs and interesting business offers. Drop me a line and a real person will read it :)

Higher education and training

If you're looking for my academic experience and work related to higher education and training,
  please check my ORCID or
  my CienciaVitae profiles.

Contacts

To contact me, you can send an email to **nafergo[AT]gmail[DOT]com** or use the links below. Feel free to contact me for any business inquiries
  or just say hello. Drop me a line and a real person will read it :)


text:
package com.blankj.utilcode.utils;

import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

/**
 *

 *     author: Blankj
 *     blog  : http://blankj.com
 *     time  : 2016/8/2
 *     desc  : 键盘相关工具类
 *

 */
public class KeyboardUtils {

    private KeyboardUtils() {
        throw new UnsupportedOperationException("u can't fuck me...");
    }

    /**
     * 避免输入法面板遮挡
     *
在manifest.xml中activity中设置

     *
android:windowSoftInputMode="stateVisible|adjustResize"

     */

    /**
     * 动态隐藏软键盘
     *
     * @param activity activity
     */
    public static void hideSoftInput(Activity activity) {
        View view = activity.getWindow().peekDecorView();
        if (view != null) {
            InputMethodManager inputmanger = (InputMethodManager) activity
                    .getSystemService(Context.INPUT_METHOD_SERVICE);
            inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0);
        }
    }

    /**
     * 动态隐藏软键盘
     *
     * @param context 上下文
     * @param edit    输入框
     */
    public static void hideSoftInput(Context context, EditText edit) {
        edit.clearFocus();
        InputMethodManager inputmanger = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        inputmanger.hideSoftInputFromWindow(edit.getWindowToken(), 0);
    }

    /**
     * 点击屏幕空白区域隐藏软键盘(方法1)
     *
在onTouch中处理,未获焦点则隐藏

     *
参照以下注释代码

     */
    public static void clickBlankArea2HideSoftInput0() {
        Log.i("tips", "U should copy the following code.");
        /*
        @Override
        public boolean onTouchEvent (MotionEvent event){
            if (null != this.getCurrentFocus()) {
                InputMethodManager mInputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
                return mInputMethodManager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), 0);
            }
            return super.onTouchEvent(event);
        }
        */
    }

    /**
     * 点击屏幕空白区域隐藏软键盘(方法2)
     *
根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘

     *
需重写dispatchTouchEvent

     *
参照以下注释代码

     */
    public static void clickBlankArea2HideSoftInput1() {
        Log.i("tips", "U should copy the following code.");
        /*
        @Override
        public boolean dispatchTouchEvent(MotionEvent ev) {
            if (ev.getAction() == MotionEvent.ACTION_DOWN) {
                View v = getCurrentFocus();
                if (isShouldHideKeyboard(v, ev)) {
                    hideKeyboard(v.getWindowToken());
                }
            }
            return super.dispatchTouchEvent(ev);
        }

        // 根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘
        private boolean isShouldHideKeyboard(View v, MotionEvent event) {
            if (v != null && (v instanceof EditText)) {
                int[] l = {0, 0};
                v.getLocationInWindow(l);
                int left = l[0],
                        top = l[1],
                        bottom = top + v.getHeight(),
                        right = left + v.getWidth();
                return !(event.getX() > left && event.getX() < right
                        && event.getY() > top && event.getY() < bottom);
            }
            return false;
        }

        // 获取InputMethodManager,隐藏软键盘
        private void hideKeyboard(IBinder token) {
            if (token != null) {
                InputMethodManager im = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                im.hideSoftInputFromWindow(token, InputMethodManager.HIDE_NOT_ALWAYS);
            }
        }
        */
    }

    /**
     * 动态显示软键盘
     *
     * @param context 上下文
     * @param edit    输入框
     */
    public static void showSoftInput(Context context, EditText edit) {
        edit.setFocusable(true);
        edit.setFocusableInTouchMode(true);
        edit.requestFocus();
        InputMethodManager inputManager = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        inputManager.showSoftInput(edit, 0);
    }

    /**
     * 切换键盘显示与否状态
     *
     * @param context 上下文
     * @param edit    输入框
     */
    public static void toggleSoftInput(Context context, EditText edit) {
        edit.setFocusable(true);
        edit.setFocusableInTouchMode(true);
        edit.requestFocus();
        InputMethodManager inputManager = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
    }
}


text:
"use strict";
/**
 * User: Vladimir Bulyga <zero@ccxx.cc>
 * Project: docker-ui
 * Date: 29.08.14 23:59
 */
angular.module('dockerUiApp').service('http', [
    '$http', function ($http) {
        var Config = {
            url: '',
            errorHandler: null
        };
        function createUrl(map, params) {
            //noinspection JSLint
            return map.replace(/(\/:[^\/]+)/g, function (a, s) {
                var key = s.substr(2),
                    value;
                if (params.hasOwnProperty(key)) {
                    value = params[key];
                    delete params[key];
                    return '/' + value;
                }
                return '';
            });
        }

        function createParams(map, data) {
            var params = {},
                keys = Object.getOwnPropertyNames(map),
                length = keys.length,
                k,
                key,
                dataKey,
                value;

            for (k = 0; k < length; k += 1) {
                key = keys[k];
                dataKey = map[key];
                value = dataKey;

                if (dataKey[0] === '@') {
                    value = data[dataKey.substr(1)];
                } else if (dataKey[0] === '=') {
                    dataKey = key;
                    value = data[dataKey];
                }

                if (value !== undefined) {
                    params[key] = value;
                }
            }
            return params;
        }

        function createMethod(config) {
            return function (params, data, callback) {
                if (angular.isFunction(params)) {
                    callback = params;
                    params = data = {};
                } else if (angular.isFunction(data)) {
                    callback = data;
                    data = params;
                } else if (!angular.isFunction(callback)) {
                    callback = angular.noop;
                }
/*
                if (!callback) {
                    callback = data;
                    data = params;
                }
                // this is check after checking
                if (!callback) {
                    callback = data;
                    data = params;
                }
                if (!callback) {
                    callback = angular.noop;
                }
*/

                params = params || {};
                var errorHandler = params.hasOwnProperty('errorHandler') ? params.errorHandler : Config.errorHandler,
                    url,
                    options,
                    http;
                delete params.errorHandler;
                url = createUrl(Config.url() + config.url, params);
                params = createParams(angular.copy(config.params || {}), params);
                options = {
                    method: config.method || 'GET',
                    url: url,
                    params: params
                };

                if (config.target) {
                    if (config.target === 'self') {
                        location.href = options.url;
                        return undefined;
                    }
                }

                if (config.method === 'POST' || config.method === 'PUT') {
                    options.data = data;
                }
                if (config.withCredentials) {
                    options.withCredentials = true;
                }
                if (config.responseType) {
                    options.responseType = config.responseType;
                }
                if (config.timeout) {
                    options.timeout = config.timeout;
                }
                if (config.headers) {
                    options.headers = config.headers;
                }
                if (config.transformRequest) {
                    options.transformRequest = config.transformRequest;
                }
                function cb(status) {
                    return function () {
                        var args = [].slice.call(arguments);

                        if (angular.isFunction(errorHandler)) {
                            if (status === 'error') {
                                errorHandler.apply(null, args);
                                return;
                            }
                        } else if (status === 'error') {
                            callback.apply(this, args);
                            return;
                        } else {
                            args.unshift(null);
                        }

                        callback.apply(this, args);
                    };
                }

                http = $http(options);
                if (angular.isFunction(callback)) {
                    http.success(function (response, status) {
                        status = (!status || status > 400) ? 'error' : 'success';
                        if (!response) {
                            response = "Connection refused";
                        }
                        cb(status)(response);
                    }).error(cb('error'));
                }
                return http;
            };
        }

        function createService(methods, service) {
            service = service || {};
            var method;
            for (method in methods) {
                if (methods.hasOwnProperty(method)) {
                    service[method] = createMethod(methods[method]);
                }
            }
            return service;
        }

        function uploadFiles(url, path, files, cb) {
            angular.extend(Config, {
                url: url
            });

            var data = new FormData(),
                metadata = {path: path, files: {}},
                fileIndex,
                file,
                service;

            for (fileIndex = 0; fileIndex < files.length; fileIndex += 1) {
                file = files[fileIndex];
                metadata.files[file.name] = file.size;
            }

            data.append('metadata', JSON.stringify(metadata));

            for (fileIndex = 0; fileIndex < files.length; fileIndex += 1) {
                data.append('uploadInput', files[fileIndex]);
            }

            service = createService({
                uploadFile: {
                    method: 'POST',
                    data: data,
                    transformRequest: angular.identity,
                    headers: {
                        'Content-Type': undefined
                    },
                    params: {}
                }
            });

            service.uploadFile({}, data, cb);
        }

        return {
            createMethod: createMethod,
            config: function (config) {
                angular.extend(Config, config);
            },
            createService: createService,
            uploadFiles: uploadFiles
        };
    }
]);