text:
class TTool;
class ToolOptionToolBar;
class TPropertyGroup;
class TPaletteHandle;
class TFrameHandle;
class TObjectHandle;
class TXsheetHandle;
class ToolHandle;
class SelectionScaleField;
class SelectionRotationField;
class SelectionMoveField;
class ToolOptionSlider;
class ToolOptionIntSlider;
class ThickChangeField;
class ToolOptionCombo;
class ToolOptionCheckbox;
class PegbarChannelField;
class ToolOptionPairSlider;
class ToolOptionControl;
class ToolOptionPopupButton;
class TXshLevelHandle;
class NoScaleField;
class PegbarCenterField;
class RGBLabel;
class MeasuredValueField;
class PaletteController;
class ClickableLabel;

class QLabel;
class QPushButton;
class QPropertyAnimation;
class QFrame;
class QHBoxLayout;
class QComboBox;
class QStackedWidget;

//=============================================================================

// Preprocessor definitions

#define TOOL_OPTIONS_LEFT_MARGIN 5

//=============================================================================

//***********************************************************************************************
//    ToolOptionToolBar  declaration
//***********************************************************************************************

class ToolOptionToolBar final : public QToolBar {
public:
  ToolOptionToolBar(QWidget *parent = 0);

  void addSpacing(int width);
};

//***********************************************************************************************
//    ToolOptionsBox  declaration
//***********************************************************************************************

class ToolOptionsBox : public QFrame {
  Q_OBJECT

protected:
  QMap<std::string, ToolOptionControl *>
      m_controls;  //!< property name -> ToolOptionControl
  QMap<std::string, QLabel *> m_labels;

  QHBoxLayout *m_layout;

public:
  ToolOptionsBox(QWidget *parent);
  ~ToolOptionsBox();

  virtual void
  updateStatus();  //!< Invokes updateStatus() on all registered controls
  virtual void onStageObjectChange() {}

  QHBoxLayout *hLayout() { return m_layout; }
  void addControl(ToolOptionControl *control);

  ToolOptionControl *control(const std::string &controlName) const;

  QLabel *addLabel(QString name);
  void addLabel(std::string propName, QLabel *label);
  void addSeparator();
};

//***********************************************************************************************
//    ToolOptionControlBuilder  declaration
//***********************************************************************************************

class ToolOptionControlBuilder final : public TProperty::Visitor {
  ToolOptionsBox *m_panel;
  TTool *m_tool;
  TPaletteHandle *m_pltHandle;
  ToolHandle *m_toolHandle;

  int m_singleValueWidgetType;
  int m_enumWidgetType;

public:
  ToolOptionControlBuilder(ToolOptionsBox *panel, TTool *tool,
                           TPaletteHandle *pltHandle,
                           ToolHandle *toolHandle = 0);

  enum SingleValueWidgetType { SLIDER = 0, FIELD };
  void setSingleValueWidgetType(int type) { m_singleValueWidgetType = type; }

  enum EnumWidgetType { COMBOBOX = 0, POPUPBUTTON };
  void setEnumWidgetType(int type) { m_enumWidgetType = type; }

private:
  QHBoxLayout *hLayout() { return m_panel->hLayout(); }
  QLabel *addLabel(TProperty *p);

  void visit(TDoubleProperty *p);
  void visit(TDoublePairProperty *p);
  void visit(TIntPairProperty *p);
  void visit(TIntProperty *p);
  void visit(TBoolProperty *p);
  void visit(TStringProperty *p);
  void visit(TEnumProperty *p);
  void visit(TStyleIndexProperty *p);
  void visit(TPointerProperty *p);
};

//***********************************************************************************************
//    GenericToolOptionsBox  declaration
//***********************************************************************************************

class GenericToolOptionsBox : public ToolOptionsBox {
public:
  GenericToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
                        int propertyGroupIdx = 0, ToolHandle *toolHandle = 0);
};

//=============================================================================
//
// ArrowToolOptionsBox
//
//=============================================================================

class ArrowToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  TPropertyGroup *m_pg;
  bool m_splined;
  TTool *m_tool;
  TFrameHandle *m_frameHandle;
  TObjectHandle *m_objHandle;
  TXsheetHandle *m_xshHandle;

  QStackedWidget *m_mainStackedWidget;

  // General
  ToolOptionCombo *m_chooseActiveAxisCombo;
  ToolOptionCombo *m_pickCombo;
  // enable to choose the target pegbar from the combobox
  QComboBox *m_currentStageObjectCombo;

  // Position
  PegbarChannelField *m_motionPathPosField;
  PegbarChannelField *m_ewPosField;
  PegbarChannelField *m_nsPosField;
  PegbarChannelField *m_zField;
  NoScaleField *m_noScaleZField;
  ClickableLabel *m_motionPathPosLabel;
  ClickableLabel *m_ewPosLabel;
  ClickableLabel *m_nsPosLabel;
  ClickableLabel *m_zLabel;

  ToolOptionCheckbox *m_lockEWPosCheckbox;
  ToolOptionCheckbox *m_lockNSPosCheckbox;

  // SO = Stacked Order
  ClickableLabel *m_soLabel;
  PegbarChannelField *m_soField;

  // Rotation
  ClickableLabel *m_rotationLabel;
  PegbarChannelField *m_rotationField;

  // Scale
  ClickableLabel *m_globalScaleLabel;
  ClickableLabel *m_scaleHLabel;
  ClickableLabel *m_scaleVLabel;
  PegbarChannelField *m_globalScaleField;
  PegbarChannelField *m_scaleHField;
  PegbarChannelField *m_scaleVField;
  ToolOptionCheckbox *m_lockScaleHCheckbox;
  ToolOptionCheckbox *m_lockScaleVCheckbox;
  ToolOptionCombo *m_maintainCombo;

  // Shear
  ClickableLabel *m_shearHLabel;
  ClickableLabel *m_shearVLabel;
  PegbarChannelField *m_shearHField;
  PegbarChannelField *m_shearVField;
  ToolOptionCheckbox *m_lockShearHCheckbox;
  ToolOptionCheckbox *m_lockShearVCheckbox;

  // Center Position
  ClickableLabel *m_ewCenterLabel;
  ClickableLabel *m_nsCenterLabel;
  PegbarCenterField *m_ewCenterField;
  PegbarCenterField *m_nsCenterField;
  ToolOptionCheckbox *m_lockEWCenterCheckbox;
  ToolOptionCheckbox *m_lockNSCenterCheckbox;

  ToolOptionCheckbox *m_globalKey;

public:
  ArrowToolOptionsBox(QWidget *parent, TTool *tool, TPropertyGroup *pg,
                      TFrameHandle *frameHandle, TObjectHandle *objHandle,
                      TXsheetHandle *xshHandle, ToolHandle *toolHandle);

  void updateStatus();
  void onStageObjectChange();

protected:
  void showEvent(QShowEvent *);
  void hideEvent(QShowEvent *);

  void setSplined(bool on);
  bool isCurrentObjectSplined() const;

protected slots:
  void onFrameSwitched() { updateStatus(); }
  // update the object list in combobox
  void updateStageObjectComboItems();
  // syncronize the current item in the combobox to the selected stage object
  void syncCurrentStageObjectComboItem();
  // change the current stage object when user changes it via combobox by hand
  void onCurrentStageObjectComboActivated(int index);
};

//=============================================================================
//
// SelectionToolOptionsBox
//
//=============================================================================

class IconViewField final : public QWidget {
  Q_OBJECT

public:
  enum IconType {
    Icon_ScalePeg = 0,
    Icon_Rotation,
    Icon_Position,
    Icon_Thickness,
    Icon_Amount
  };

private:
  IconType m_iconType;

protected:
  QPixmap m_pm[Icon_Amount];
  Q_PROPERTY(
      QPixmap ScalePegPixmap READ getScalePegPixmap WRITE setScalePegPixmap);
  Q_PROPERTY(
      QPixmap RotationPixmap READ getRotationPixmap WRITE setRotationPixmap);
  Q_PROPERTY(
      QPixmap PositionPixmap READ getPositionPixmap WRITE setPositionPixmap);
  Q_PROPERTY(
      QPixmap ThicknessPixmap READ getThicknessPixmap WRITE setThicknessPixmap);

public:
  IconViewField(QWidget *parent = 0, IconType iconType = Icon_ScalePeg);

  QPixmap getScalePegPixmap() const { return m_pm[Icon_ScalePeg]; }
  void setScalePegPixmap(const QPixmap &pixmap) {
    m_pm[Icon_ScalePeg] = pixmap;
  }
  QPixmap getRotationPixmap() const { return m_pm[Icon_Rotation]; }
  void setRotationPixmap(const QPixmap &pixmap) {
    m_pm[Icon_Rotation] = pixmap;
  }
  QPixmap getPositionPixmap() const { return m_pm[Icon_Position]; }
  void setPositionPixmap(const QPixmap &pixmap) {
    m_pm[Icon_Position] = pixmap;
  }
  QPixmap getThicknessPixmap() const { return m_pm[Icon_Thickness]; }
  void setThicknessPixmap(const QPixmap &pixmap) {
    m_pm[Icon_Thickness] = pixmap;
  }

protected:
  void paintEvent(QPaintEvent *e);
  // these are used for dragging on the icon to
  // change the value of the field
  void mousePressEvent(QMouseEvent *) override;
  void mouseMoveEvent(QMouseEvent *) override;
  void mouseReleaseEvent(QMouseEvent *) override;

signals:
  void onMousePress(QMouseEvent *event);
  void onMouseMove(QMouseEvent *event);
  void onMouseRelease(QMouseEvent *event);
};

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

class SelectionToolOptionsBox final : public ToolOptionsBox,
                                      public TProperty::Listener {
  Q_OBJECT

  TTool *m_tool;

  ToolOptionCheckbox *m_setSaveboxCheckbox;
  bool m_isVectorSelction;
  QLabel *m_scaleXLabel;
  SelectionScaleField *m_scaleXField;
  QLabel *m_scaleYLabel;
  SelectionScaleField *m_scaleYField;
  DVGui::CheckBox *m_scaleLink;
  SelectionRotationField *m_rotationField;
  QLabel *m_moveXLabel;
  SelectionMoveField *m_moveXField;
  QLabel *m_moveYLabel;
  SelectionMoveField *m_moveYField;
  ThickChangeField *m_thickChangeField;

  ToolOptionPopupButton *m_capStyle;
  ToolOptionPopupButton *m_joinStyle;
  ToolOptionIntSlider *m_miterField;

public:
  SelectionToolOptionsBox(QWidget *parent, TTool *tool,
                          TPaletteHandle *pltHandle, ToolHandle *toolHandle);

  void updateStatus();
  void onPropertyChanged();

protected slots:
  // addToUndo is only set to false when dragging with the mouse
  // to set the value.  It is set to true on mouse release.
  void onScaleXValueChanged(bool addToUndo = true);
  void onScaleYValueChanged(bool addToUndo = true);
  void onSetSaveboxCheckboxChanged(bool);
};

//=============================================================================
//
// GeometricToolOptionsBox
//
//=============================================================================

class GeometricToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  int m_targetType;

  QLabel *m_poligonSideLabel, *m_hardnessLabel;
  ToolOptionSlider *m_hardnessField;
  ToolOptionIntSlider *m_poligonSideField;
  ToolOptionCombo *m_shapeField;
  ToolOptionCheckbox *m_pencilMode;
  ToolOptionIntSlider *m_miterField;
  ToolOptionCheckbox *m_snapCheckbox;
  ToolOptionCombo *m_snapSensitivityCombo;
  TTool *m_tool;

public:
  GeometricToolOptionsBox(QWidget *parent, TTool *tool,
                          TPaletteHandle *pltHandle, ToolHandle *toolHandle);

  void updateStatus();

protected slots:
  void onShapeValueChanged();
  void onPencilModeToggled(bool);
  void onJoinStyleChanged(int);
};

//=============================================================================
//
// TypeToolOptionsBox
//
//=============================================================================

class TypeToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  TTool *m_tool;

public:
  TypeToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
                     ToolHandle *toolHandle);

  void updateStatus();

protected slots:
  void onFieldChanged();
};

//=============================================================================
//
// PaintbrushToolOptionsBox
//
//=============================================================================

class PaintbrushToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  ToolOptionCombo *m_colorMode;
  ToolOptionCheckbox *m_selectiveMode;

public:
  PaintbrushToolOptionsBox(QWidget *parent, TTool *tool,
                           TPaletteHandle *pltHandle, ToolHandle *toolHandle);

  void updateStatus();

protected slots:
  void onColorModeChanged();
};

//=============================================================================
//
// FillToolOptionsBox
//
//=============================================================================

class FillToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  int m_targetType;
  QLabel *m_fillDepthLabel;
  ToolOptionCombo *m_colorMode, *m_toolType;
  ToolOptionCheckbox *m_selectiveMode, *m_segmentMode, *m_onionMode,
      *m_multiFrameMode, *m_autopaintMode;
  ToolOptionPairSlider *m_fillDepthField;

public:
  FillToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
                     ToolHandle *toolHandle);

  void updateStatus();

protected slots:
  void onColorModeChanged();
  void onToolTypeChanged();
  void onOnionModeToggled(bool);
  void onMultiFrameModeToggled(bool);
};

//=============================================================================
//
// BrushToolOptionsBox
//
//=============================================================================

class BrushToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  TTool *m_tool;

  ToolOptionCheckbox *m_pencilMode;
  QLabel *m_hardnessLabel;
  ToolOptionSlider *m_hardnessField;
  ToolOptionPopupButton *m_joinStyleCombo;
  ToolOptionIntSlider *m_miterField;
  ToolOptionCombo *m_presetCombo;
  ToolOptionCheckbox *m_snapCheckbox;
  ToolOptionCombo *m_snapSensitivityCombo;
  QPushButton *m_addPresetButton;
  QPushButton *m_removePresetButton;

private:
  class PresetNamePopup;
  PresetNamePopup *m_presetNamePopup;
  void filterControls();

public:
  BrushToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
                      ToolHandle *toolHandle);

  void updateStatus();

protected slots:

  void onPencilModeToggled(bool);
  void onAddPreset();
  void onRemovePreset();
};

//=============================================================================
//
// EraserToolOptionsBox
//
//=============================================================================

class EraserToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  ToolOptionCheckbox *m_pencilMode, *m_invertMode, *m_multiFrameMode;
  ToolOptionCombo *m_toolType, *m_colorMode;
  QLabel *m_hardnessLabel;
  ToolOptionSlider *m_hardnessField;

public:
  EraserToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
                       ToolHandle *toolHandle);

  void updateStatus();

protected slots:
  void onPencilModeToggled(bool);
  void onToolTypeChanged();
  void onColorModeChanged();
};

//=============================================================================
//
// RulerToolOptionsBox
//
//=============================================================================

class RulerToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  MeasuredValueField *m_Xfld;
  MeasuredValueField *m_Yfld;
  MeasuredValueField *m_Wfld;
  MeasuredValueField *m_Hfld;
  MeasuredValueField *m_Afld;
  MeasuredValueField *m_Lfld;

  QLabel *m_XpixelFld;
  QLabel *m_YpixelFld;
  QLabel *m_WpixelFld;
  QLabel *m_HpixelFld;

  TTool *m_tool;

public:
  RulerToolOptionsBox(QWidget *parent, TTool *tool);

  void updateValues(bool isRasterLevelEditing, double X, double Y, double W,
                    double H, double A, double L, int Xpix = 0, int Ypix = 0,
                    int Wpix = 0, int Hpix = 0);

  void resetValues();
};

//=============================================================================
//
// TapeToolOptionsBox
//
//=============================================================================

class TapeToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT

  ToolOptionCheckbox *m_smoothMode, *m_joinStrokesMode;
  ToolOptionCombo *m_toolMode, *m_typeMode;
  QLabel *m_autocloseLabel;
  ToolOptionSlider *m_autocloseField;

public:
  TapeToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
                     ToolHandle *toolHandle);

  void updateStatus();

protected slots:
  void onToolTypeChanged();
  void onToolModeChanged();
  void onJoinStrokesModeChanged();
};

//=============================================================================
//
// RGBPickerToolOptionsBox
//
//=============================================================================

class RGBPickerToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT
  ToolOptionCheckbox *m_realTimePickMode;
  // label with background color
  RGBLabel *m_currentRGBLabel;

public:
  RGBPickerToolOptionsBox(QWidget *parent, TTool *tool,
                          TPaletteHandle *pltHandle, ToolHandle *toolHandle,
                          PaletteController *paletteController);
  void updateStatus();
protected slots:
  void updateRealTimePickLabel(const QColor &);
};

//=============================================================================
//
// StylePickerToolOptionsBox
//
//=============================================================================

class StylePickerToolOptionsBox final : public ToolOptionsBox {
  Q_OBJECT
  ToolOptionCheckbox *m_realTimePickMode;

  QLabel *m_currentStyleLabel;

public:
  StylePickerToolOptionsBox(QWidget *parent, TTool *tool,
                            TPaletteHandle *pltHandle, ToolHandle *toolHandle,
                            PaletteController *paletteController);
  void updateStatus();
protected slots:
  void updateRealTimePickLabel(const int, const int, const int);
};

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

class DVAPI ToolOptions final : public QFrame {
  Q_OBJECT

  int m_width, m_height;
  std::map<TTool *, ToolOptionsBox *> m_panels;
  QWidget *m_panel;

public:
  ToolOptions();
  ~ToolOptions();

  QWidget *getPanel() const { return m_panel; }

protected:
  void showEvent(QShowEvent *);
  void hideEvent(QShowEvent *);

public slots:

  void onToolSwitched();
  void onToolChanged();
  void onStageObjectChange();

signals:
  // used in ComboViewer to handle Tab focus
  void newPanelCreated();

  //  void toolOptionChange();
};

#endif  // PANE_H


text:
var GameStream = require('../');
var now = require('../misc/now.js');
var ConsoleLogger = require('../debug/ConsoleLogger.js');

var timeLogs = [];

var state = {
	count: 0
};

function updateState() {
	state.count++;
	timeLogs[state.count] = now();
	stream1.updateNow({count: state.count});
}

var logger = new ConsoleLogger({
	getDelay: function(data, time) {
		if (data.update) {
			return now() - timeLogs[data.update.count];
		}
	},
	logFull: true
});

var stream1 = new GameStream();

var stream2 = new GameStream({
	lag: 10
});
stream1.pipe(stream2);

var stream3 = new GameStream({
	lag: 1000
});
stream2.pipe(stream3);
stream3.on('data', logger.log.bind(logger));

setInterval(updateState, 1000);

redpajama_set_name: RedPajamaGithub


text:
html.div("Simple text in a DIV"),
html.div("Other div"),


text:
from collections import defaultdict

from matplotlib import pyplot as plt
import matplotlib.markers as mmarkers
import matplotlib.cm as cm
import matplotlib.colors as mcolors
import pandas as pd
import numpy as np

from cycler import cycler

def _determine_col_name(agg_shelf, shelf):
    if 'bin' in agg_shelf and agg_shelf.bin:
        agg_coll = '{}_{}_bin'.format(agg_shelf.name, shelf)
    else:
        agg_coll = agg_shelf.name

    return agg_coll

def _vl_line(ax, encoding, data, rc):
    x_name = _determine_col_name(encoding.x, 'x')
    y_name = _determine_col_name(encoding.y, 'y')
    df = data

    if 'color' in encoding:
        data_itr = _do_color(encoding.color, data, rc)
    else:
        data_itr = [(data, {'color': 'k'})]

    rets = []
    for df, sty in data_itr:
        if 'aggregate' in encoding.x:
            _agg_cols = [c for c in rc.agg_cols if c != x_name]
            df = _do_aggregate(encoding.x, df, _agg_cols)

        if 'aggregate' in encoding.y:
            _agg_cols = [c for c in rc.agg_cols if c != y_name]
            df = _do_aggregate(encoding.y, df, _agg_cols)

        sty_dict = {}
        sty_dict.update(rc.pl_kw)
        sty_dict.update(sty)

        ln, = ax.plot(x_name, y_name, data=df, **sty_dict)
        rets.append(ln)
    return rets

def _vl_area(ax, encoding, data, rc):
    ln, = _vl_line(ax, encoding, data, rc)
    x_data = ln.get_xdata()
    y_data = ln.get_ydata()
    c = ln.get_color()
    area = ax.fill_between(x_data, y_data, color=c)
    return ln, area

def _vl_point(ax, encoding, data, rc):
    pl_kw = rc.pl_kw
    agg_cols = rc.agg_cols
    pl_kw.setdefault('linestyle', 'none')
    if 'shape' in encoding:
        data_itr = _do_shape(encoding.shape, data, rc)
    else:
        data_itr = [(data, {'marker': 'o', 'fillstyle': 'none'})]

    if 'color' in encoding:
        data_itr = _do_color_itr(encoding.color, data_itr, rc)

    lns = []
    for df, sty in data_itr:
        x_name = _determine_col_name(encoding.x, 'x')
        y_name = _determine_col_name(encoding.y, 'y')

        if 'aggregate' in encoding.x:
            _agg_cols = [c for c in agg_cols if c != x_name]
            df = _do_aggregate(encoding.x, df, _agg_cols)

        if 'aggregate' in encoding.y:
            _agg_cols = [c for c in agg_cols if c != y_name]
            df = _do_aggregate(encoding.y, df, _agg_cols)

        sty_dict = {}
        sty_dict.update(pl_kw)
        sty_dict.update(sty)

        ln = ax.plot(x_name, y_name,  data=df, **sty_dict)
        lns.extend(ln)

    return lns

def _vl_bar(ax, encoding, data, rc):
    return ax.bar(encoding.x.name, encoding.y.name, data=data, **rc.pl_kw)

def _do_shape(shape, data, rc):
    """Sort out how to do shape

    Given an encoding + a possibly reduced DataFrame, return
    an iterator of (gb_key, DataFrame), style kwarg
    """
    filled = shape.filled
    if filled:
        shape_dict = rc.filledshape
    else:
        shape_dict = rc.allshape
    shape_col = _determine_col_name(shape, 'shape')

    if shape.type == 'Q':
        dig_data, bin_edges = _digitize_col(shape, data)
        data['{}_shape_bin'.format(shape.name)] = dig_data

    if 'aggregate' in shape:
        _agg_cols = [c for c in rc.agg_cols if c != shape_col]
        data = _do_aggregate(shape, data, _agg_cols)

    fill_sty = {'fillstyle': 'full' if filled else 'none'}
    if filled:
        fill_sty['markeredgewidth'] = 0

    gb = data.groupby(shape_col)

    for df in gb:
        sty = shape_dict[df[0]]
        sty.update(fill_sty)

        yield df[1], sty

def _do_color_itr(color, data_itr, rc):

    for df, sty in data_itr:
        for ret in _do_color(color, df, rc):
            _df, _sty = ret
            out = {}
            out.update(sty)
            out.update(_sty)
            yield _df, out

def _do_color(color, data, rc):

    color_col = _determine_col_name(color, 'color')

    if 'aggregate' in color:
        _agg_cols = [c for c in rc.agg_cols if c != color_col]
        df = _do_aggregate(color, data, _agg_cols)

    gb = data.groupby(color_col)
    sty = {}
    for df in gb:
        c = rc.cmap(rc.norm(df[0]))
        sty['color'] = c
        yield df[1], sty

def _do_aggregate(shelf, data, by_keys):

    agg_method = shelf.aggregate
    binned = data.groupby(by_keys)
    agg_func_name = _AGG_MAP[agg_method]

    data = getattr(binned, agg_func_name)().reset_index()
    return data

def _do_binning(vls, data, bin_key, plot_kwargs):
    encoding = vls.encoding
    shelf = getattr(encoding, bin_key)
    dig, bin_edges = _digitize_col(shelf, data)
    data['{}_{}_bin'.format(shelf.name, bin_key)] = dig
    if vls.marktype == 'bar':
        plot_kwargs['width'] = np.mean(np.diff(bin_edges)) * .9
        plot_kwargs['align'] = 'center'

    return data

def _digitize_col(bin_encoding, data):
    x_name = bin_encoding.name
    d_min, d_max = data[x_name].min(), data[x_name].max()
    bin_count = bin_encoding.bin
    if isinstance(bin_count, bool):
        bin_count = 3
    bin_count = int(bin_count.maxbins)
    # add one to bin count as we are generating edges here
    bin_edges = np.linspace(d_min, d_max, bin_count + 1, endpoint=True)
    centers = (bin_edges[1:] + bin_edges[:-1]) / 2
    dig = np.digitize(data[x_name], bin_edges, right=True) - 1
    valid_mask = (-1 < dig) * (dig < len(centers))
    ret = np.zeros_like(dig, dtype='float')
    ret[valid_mask] = centers[dig[valid_mask]]
    ret[~valid_mask] = np.nan

    return ret, bin_edges

class _RenderContext(object):
    def __init__(self, agg_cols):
        filled_shapes = mmarkers.MarkerStyle.filled_markers

        all_shapes = filled_shapes + ('x',  '4', '3', '+', '2', '1')

        cyl = cycler('marker', filled_shapes)
        finite_cy_iter = iter(cyl)
        self.filledshape = defaultdict(lambda: next(finite_cy_iter))

        cyl = cycler('marker', all_shapes)
        finite_cy_iter = iter(cyl)
        self.allshape = defaultdict(lambda: next(finite_cy_iter))
        self.pl_kw = {}
        self.agg_cols = agg_cols

        self.norm = None
        self.cmap = None

def render(vls, data=None):
    """Render a vega-lite spec using matplotlib

    Parameters
    ----------
    vls : dict
        A dictionary complying with the vega-lite spec

    Returns
    -------
    fig : Figure
        The figure created

    ax_list : list
        The list of axes created

    arts : dict
        Dictionary keyed on Axes of the artists created
    """
    plot_kwargs = {}
    encoding = vls.encoding
    if data is None:
        data = vls.data
    data = pd.DataFrame(data)
    shelves = ('row', 'col', 'shape', 'size', 'color', 'y', 'x')
    # TODO these seem to be missing from the api.py
    # 'detail', 'text')
    used_cols = list(set(getattr(encoding, k).name
                         for k in shelves if k in encoding))
    data = data[used_cols]

    x_binned = 'bin' in encoding.x and encoding.x.bin
    y_binned = 'bin' in encoding.y and encoding.y.bin
    if x_binned and y_binned:
        raise NotImplementedError("Double binning not done yet")
    agg_cols = []
    for sh in shelves:
        if sh not in encoding:
            continue
        shelf = getattr(encoding, sh)
        if 'bin' in shelf and shelf.bin:
            data = _do_binning(vls, data, sh, plot_kwargs)
        agg_cols.append(_determine_col_name(shelf, sh))
    data = data.dropna()

    agg_cols = list(set(agg_cols))

    rc = _RenderContext(agg_cols)
    rc.pl_kw.update(plot_kwargs)

    if 'color' in encoding:
        # TODO do their color loop up right
        rc.cmap = cm.get_cmap('viridis')
        # TODO get the scale from 'type'
        # TODO deal with raw-domain stuff
        if encoding.color.type == 'Q':
            _cname = _determine_col_name(encoding.color, 'color')
            cmin, cmax = data[_cname].min(), data[_cname].max()
            rc.norm = mcolors.Normalize(cmin, cmax)

    plot_func = _MARK_DISPATCHER[vls.marktype]

    has_row = 'row' in encoding
    has_col = 'col' in encoding

    ax_map = {}
    ax_list = None

    if has_col and has_row:
        # sort out the names with respect to binning
        col_name = _determine_col_name(encoding.col, 'col')
        row_name = _determine_col_name(encoding.row, 'row')
        if 'aggregate' in encoding.row:
            _agg_cols = [c for c in agg_cols if c != row_name]
            data = _do_aggregate(encoding.row, data, _agg_cols)

        if 'aggregate' in encoding.col:
            _agg_cols = [c for c in agg_cols if c != col_name]
            data = _do_aggregate(encoding.col, data,  _agg_cols)

        row_labels = data[row_name].unique()
        col_labels = data[col_name].unique()
        grid_keys = [(_['row'], _['col'])
                     for _ in (cycler('row', row_labels) *
                               cycler('col', col_labels))]
        col_num, row_num = len(col_labels), len(row_labels)
        facet_iter = data.groupby([row_name, col_name])
    elif has_col:
        col_name = _determine_col_name(encoding.col, 'col')

        if 'aggregate' in encoding.col:
            _agg_cols = [c for c in agg_cols if c != col_name]
            data = _do_aggregate(encoding.col, data, _agg_cols)

        col_labels = data[col_name].unique()
        col_num, row_num = len(col_labels), 1
        grid_keys = list(col_labels)
        facet_iter = data.groupby(col_name)
    elif has_row:
        row_name = _determine_col_name(encoding.row, 'row')
        if 'aggregate' in encoding.row:
            _agg_cols = [c for c in agg_cols if c != row_name]
            data = _do_aggregate(encoding.row, data, _agg_cols)

        row_labels = data[row_name].unique()
        col_num, row_num = 1, len(row_labels)
        grid_keys = list(row_labels)
        facet_iter = data.groupby(row_name)
    else:
        grid_keys = [None, ]
        col_num, row_num = 1, 1

        def _inner():
            yield None, data
        facet_iter = _inner()

    fig, ax_list = plt.subplots(row_num, col_num,
                                sharex=True, sharey=True,
                                squeeze=False)
    for k, ax in zip(grid_keys, ax_list.ravel()):
        ax_map[k] = ax
        ax.set_prop_cycle(cycler('color', 'k'))
        if 'x' in encoding and ax.rowNum == row_num - 1:
            ax.set_xlabel(encoding.x.name)
        if 'y' in encoding and ax.colNum == 0:
            ax.set_ylabel(encoding.y.name)

    rets = {}
    for k, df in facet_iter:
        ax = ax_map[k]
        _r = plot_func(ax, encoding, df, rc)
        rets[k] = _r
        if k:
            ax.set_title(repr(k))

    return rets, ax_map

_MARK_DISPATCHER = {'area': _vl_area,      # fill below line
                    'bar': _vl_bar,        # bar
                    'circle': None,        # ??
                    'line': _vl_line,      # line
                    'point': _vl_point,    # scatter
                    'square': None,        # ??
                    'text': None,          # ??
                    'tick': None}          # ??

_AGG_MAP = {"avg": 'mean',
            "sum": 'sum',
            "min": 'min',
            "max": 'max',
            "count": 'count'}


text:
from shared.config import TRYJOBVERIFIER
from stats.analyzer import (
  AnalyzerGroup,
  CountAnalyzer,
  ListAnalyzer,
)

counted_actions = (
  ('error', 'Number of tryjob verifier runs errored.'),
  ('fail', 'Number of tryjob verifier runs failed.'),
  ('pass', 'Number of tryjob verifier runs passed.'),
  ('retry', 'Number of tryjob verifier runs retried.'),
  ('skip', 'Number of tryjob verifier runs skipped.'),
  ('start', 'Number of tryjob verifier runs started.'),
  ('timeout', 'Number of tryjob verifier runs that timed out.'),
)

tryjobverifier_terminator_actions = (
  'verifier_pass',
  'verifier_fail',
  'verifier_retry',
  'verifier_timeout',
)

class TryjobverifierAnalyzer(AnalyzerGroup):  # pragma: no cover
  def __init__(self):
    super(TryjobverifierAnalyzer, self).__init__(
      TryjobverifierActionCountGroup,
      TryjobverifierFirstRunDurations,
      TryjobverifierRetryDurations,
      TryjobverifierTotalDurations,
    )

class TryjobverifierActionCount(CountAnalyzer):  # pragma: no cover
  def __init__(self, action, description):
    super(TryjobverifierActionCount, self).__init__()
    self.action = action
    self.description = description

  def new_attempts(self, project, reference, all_attempts, interval_attempts):
    self.tally[reference] += count_actions(
        interval_attempts, 'verifier_' + self.action)

  def _get_name(self):
    return 'tryjobverifier-%s-count' % self.action

class TryjobverifierActionCountGroup(AnalyzerGroup):  # pragma: no cover
  def __init__(self):
    self.analyzers = []
    for action, description in counted_actions:
      self.analyzers.append(TryjobverifierActionCount(action, description))

class TryjobverifierFirstRunDurations(ListAnalyzer):  # pragma: no cover
  description = 'Time spent on each tryjob verifier first run.'
  unit = 'seconds'
  def new_attempts(self, project, reference, all_attempts, interval_attempts):
    for attempt in interval_attempts:
      start_timestamp = None
      end_timestamp = None
      for record in attempt:
        if record.fields.get('verifier') != TRYJOBVERIFIER:
          continue
        if record.fields.get('action') == 'verifier_start':
          start_timestamp = record.timestamp
        if record.fields.get('action') in tryjobverifier_terminator_actions:
          end_timestamp = record.timestamp
          break
      if start_timestamp and end_timestamp:
        duration = (end_timestamp - start_timestamp).total_seconds()
        self.points.append((duration, reference))

class TryjobverifierRetryDurations(ListAnalyzer):  # pragma: no cover
  description = 'Time spent on each tryjob verifier retry.'
  unit = 'seconds'
  def new_attempts(self, project, reference, all_attempts, interval_attempts):
    for attempt in interval_attempts:
      start_timestamp = None
      end_timestamp = None
      for record in attempt:
        if record.fields.get('verifier') != TRYJOBVERIFIER:
          continue
        if not start_timestamp:
          if record.fields.get('action') == 'verifier_retry':
            start_timestamp = record.timestamp
        elif record.fields.get('action') in tryjobverifier_terminator_actions:
          end_timestamp = record.timestamp
          duration = (end_timestamp - start_timestamp).total_seconds()
          self.points.append((duration, reference))
          if record.fields.get('action') == 'verifier_retry':
            start_timestamp = end_timestamp
          else:
            start_timestamp = None

class TryjobverifierTotalDurations(ListAnalyzer):  # pragma: no cover
  description = 'Total time spent per CQ attempt on tryjob verifier runs.'
  unit = 'seconds'
  def new_attempts(self, project, reference, all_attempts, interval_attempts):
    for attempt in interval_attempts:
      start_timestamp = None
      end_timestamp = None
      for record in attempt:
        if record.fields.get('verifier') != TRYJOBVERIFIER:
          continue
        if not start_timestamp:
          start_timestamp = record.timestamp
        end_timestamp = record.timestamp
      if start_timestamp:
        duration = (end_timestamp - start_timestamp).total_seconds()
        self.points.append((duration, reference))

def count_actions(attempts, action):  # pragma: no cover
  count = 0
  for attempt in attempts:
    for record in attempt:
      if (record.fields.get('verifier') == TRYJOBVERIFIER and
          record.fields.get('action') == action):
        count += 1
  return count


text:
using System.Windows.Interop;

namespace Positron.UI.WinFormsInterop
{
    /// <summary>
    /// Provides extensions to <see cref="IPositronUi"/>.
    /// </summary>
    public static class WindowHandlerExtensions
    {
        /// <summary>
        /// Create a new <see cref="PositronWindow"/> with a WinForms window as this parent.
        /// </summary>
        /// <param name="windowHandler"><see cref="IPositronUi"/> used to create the window.</param>
        /// <param name="owner">WinForms owner.</param>
        /// <param name="targetUrl">Initial URL to display on load.</param>
        /// <returns>New <see cref="PositronWindow"/>, ready to receive a ShowDialog call.</returns>
        public static PositronWindow CreateWindowFromWinForms(this IPositronUi windowHandler,
            System.Windows.Forms.IWin32Window owner, string targetUrl)
        {
            var window = windowHandler.CreateWindow(null, targetUrl);

            if (owner != null)
            {
                new WindowInteropHelper(window).Owner = owner.Handle;
            }

            return window;
        }
    }
}


text:
<?php get_header();
get_template_part('breadcrums'); ?>

		<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
		<?php get_template_part('post','content');
		get_template_part('author','intro');
		endwhile;
		else :
		get_template_part('nocontent');
		endif;
		weblizar_navigation_posts();
		comments_template( '', true ); ?>

	<?php get_sidebar(); ?>

<?php get_footer(); ?>


text:
import copy
import json
from typing import List

from dateutil import tz
from google.appengine.ext import testbed
from pyre_extensions import none_throws

from backend.common.consts.alliance_color import AllianceColor
from backend.common.helpers.match_helper import MatchHelper
from backend.common.helpers.match_time_prediction_helper import (
    MatchTimePredictionHelper,
)
from backend.common.models.match import Match

def _mark_match_unplayed(match: Match) -> None:
    alliances = match.alliances
    alliances[AllianceColor.RED]["score"] = -1
    alliances[AllianceColor.BLUE]["score"] = -1
    match.alliances_json = json.dumps(alliances)
    match._alliances = None
    match.predicted_time = None
    match.actual_time = None

def _mark_match_played(
    test_matches: List[Match], original_matches: List[Match], i: int
) -> None:
    test_matches[i].alliances_json = original_matches[i].alliances_json
    test_matches[i]._alliances = None
    test_matches[i].actual_time = original_matches[i].actual_time

def test_predict_times(
    test_data_importer, taskqueue_stub: testbed.taskqueue_stub.TaskQueueServiceStub
) -> None:
    original_matches = test_data_importer.parse_match_list(
        __file__, "data/2019nyny_matches.json"
    )
    original_matches = MatchHelper.play_order_sorted_matches(original_matches)
    matches = copy.deepcopy(original_matches)

    # First, mark all matches except the first as unplayed
    [_mark_match_unplayed(m) for m in matches[1:]]

    timezone = none_throws(tz.gettz("America/New_York"))
    for i in range(1, len(matches)):
        played = matches[:i]
        unplayed = matches[i:]
        MatchTimePredictionHelper.predict_future_matches(
            "2019nyny", played, unplayed, timezone, False
        )

        _mark_match_played(matches, original_matches, i)


text:
from django import http
from django.template import loader
from django.template import RequestContext
from django.template import TemplateDoesNotExist
from django.views.decorators.csrf import requires_csrf_token

@requires_csrf_token
def server_error(request, template_name='500.html'):
    """
    500 error handler.

    Templates: :template:`500.html`
    """
    try:
        template = loader.get_template(template_name)
    except TemplateDoesNotExist:
        return http.HttpResponseServerError('
Server Error (500)
',
                                            content_type='text/html')
    return http.HttpResponseServerError(
        template.render(RequestContext(request)))

@requires_csrf_token
def bad_request(request, template_name='400.html'):
    """
    400 error handler.

    Templates: :template:`400.html`
    """
    try:
        template = loader.get_template(template_name)
    except TemplateDoesNotExist:
        return http.HttpResponseBadRequest('
Bad Request (400)
',
                                           content_type='text/html')
    return http.HttpResponseBadRequest(
        template.render(RequestContext(request)))


text:
// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.TeamFoundation.Migration.Toolkit;

namespace Microsoft.TeamFoundation.Migration.ClearQuestAdapter.MigrationItem
{
    public class ClearQuestAttachmentItemSerializer : IMigrationItemSerializer
    {
        private GenericSerializer<ClearQuestAttachmentItem> m_serializer = new GenericSerializer<ClearQuestAttachmentItem>();
        #region IMigrationItemSerializer Members

        public IMigrationItem LoadItem(string itemBlob, ChangeGroupManager manager)
        {
            if (manager == null)
            {
                throw new ArgumentNullException("manager");
            }

            if (string.IsNullOrEmpty(itemBlob))
            {
                throw new ArgumentNullException("itemBlob");
            }

            return m_serializer.DeserializeItem(itemBlob) as IMigrationItem;
        }

        public string SerializeItem(IMigrationItem item)
        {
            return m_serializer.SerializeItem(item);
        }

        #endregion
    }
}


text:
package org.apache.pulsar.websocket;

import java.io.IOException;
import java.nio.ByteBuffer;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.websocket.api.WebSocketAdapter;
import org.eclipse.jetty.websocket.api.WebSocketPingPongListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PingPongHandler extends WebSocketAdapter implements WebSocketPingPongListener {

    private static final Logger log = LoggerFactory.getLogger(PingPongHandler.class);

    @Override
    public void onWebSocketPing(ByteBuffer payload) {
        try {
            if (log.isDebugEnabled()) {
                log.debug("PING: {}", BufferUtil.toDetailString(payload));
            }
            getRemote().sendPong(payload);
        } catch (IOException e) {
            log.warn("Failed to send pong: {}", e.getMessage());
        }
    }

    @Override
    public void onWebSocketPong(ByteBuffer payload) {

    }

}


text:
package br.edu.ufabc.sd.Controller;

import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;

public class BankServer {

	private static final String BANCO_BRANCO_URL = "rmi://localhost/bancoBranco";
	private static final String BANCO_AZUL_URL = "rmi://localhost/bancoAzul";

	private static final String CENTRAL_BANK_URL = "rmi://localhost/bancoCentral";

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		try {
			LocateRegistry.createRegistry(1097);

			BankServerService serviceBancoBranco = new BankServerServiceImpl("bancoBranco/", CENTRAL_BANK_URL);
			BankServerService serviceBancoAzul = new BankServerServiceImpl("bancoAzul/", CENTRAL_BANK_URL);

			Naming.rebind(BANCO_BRANCO_URL, serviceBancoBranco);
			Naming.rebind(BANCO_AZUL_URL, serviceBancoAzul);
			System.out.println("Servidor expondo serviços em: " + BANCO_BRANCO_URL +
					" e " + BANCO_AZUL_URL);

		} catch (Exception e) {

			e.printStackTrace();
		}

	}

}


text:
from reporter.core import Schedule
from reporter.core import SqlReport
from reporter.uhl_reports.civicrm import get_case_link
from reporter.uhl_reports.i2b2.patient_mapping_tests import (
    PatientMappingDuplicatesReport,
    PatientMappingMultiplesIdsReport,
)
from reporter.uhl_reports.i2b2.patient_summary_tests import (
    PatientSummaryDuplicatesReport,
    PatientSummaryMissingData,
    PatientSummaryMissingParticipants,
    PatientSummaryMissingDataWhen,
)
from reporter.uhl_reports.i2b2.valid_enrolment_tests import (
    ValidEnrolmentsStudyIdDuplicates,
    ValidEnrolmentsContactMultipleRecruitments,
    RecruitedWithoutFullConsent,
    PatientSummaryMissingRecruited,
)
from reporter.emailing import (
    RECIPIENT_FAST_ADMIN as RECIPIENT_ADMIN,
    RECIPIENT_IT_DWH,
)

I2B2_DB = "i2b2_app03_fast_Data"

class FastPatientMappingDuplicatesReport(
        PatientMappingDuplicatesReport):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            schedule=Schedule.never,
        )

class FastPatientMappingMultiplesIdsReport(
        PatientMappingMultiplesIdsReport):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            schedule=Schedule.never,
        )

class FastPatientSummaryDuplicatesReport(
        PatientSummaryDuplicatesReport):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            schedule=Schedule.never,
        )

class FastPatientSummaryMissingData(
        PatientSummaryMissingData):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            fields=[
                'NhsNumber',
                'StudyNumber',
                'CiviCrmId',
                'consent_date',
            ],
            schedule=Schedule.never,
        )

class FastPatientSummaryGenderMissingData(
    PatientSummaryMissingDataWhen):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            fields=['gender'],
            indicator_field='consent_ext_dta_coll',
            indicator_value='1',
            schedule=Schedule.never,
        )

class FastPatientSummaryMissingParticipants(
        PatientSummaryMissingParticipants):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            schedule=Schedule.never,
        )

class FastValidEnrolmentsStudyIdDuplicates(
        ValidEnrolmentsStudyIdDuplicates):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            recipients=[RECIPIENT_ADMIN],
            schedule=Schedule.never,
        )

class FastValidEnrolmentsContactMultipleRecruitments(
        ValidEnrolmentsContactMultipleRecruitments):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            recipients=[RECIPIENT_ADMIN],
            schedule=Schedule.never,
        )

class FastRecruitedWithoutFullConsent(
        RecruitedWithoutFullConsent):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            recipients=[RECIPIENT_ADMIN],
            schedule=Schedule.never,
        )

class FastPatientSummaryMissingRecruited(
        PatientSummaryMissingRecruited):
    def __init__(self):
        super().__init__(
            database=I2B2_DB,
            recipients=[RECIPIENT_ADMIN],
            schedule=Schedule.never,
        )


text:
An example project demonstrating how to write and run JavaScript unit tests.
Built using the following tools:

- [Mocha](http://mochajs.org/) for unit test structuring
- [Chai](http://chaijs.com/) for assertions
- [mocha-phantomjs](http://metaskills.net/mocha-phantomjs/) for supporting test
  execution from the command line (using [PhantomJS](http://phantomjs.org/) for
  headless browser execution)

## Running the Tests

After downloading the source and installing the dependencies with `npm
install`, the tests can be run in either of two ways:

- Opening the `test/index.html` file in a web browser
- Running `npm test` from a terminal

## License

Copyright (c) 2014 Mike Pennisi
Licensed under the MIT Expat license.


text:
package com.all.login.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class Login implements Comparable<Login> {
	private static final long serialVersionUID = 1L;

	@Id
	private String email;

	private long date;

	public Login(String email) {
		this.email = email;
		date = new Date().getTime();
	}

	public Login() {
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public long getDate() {
		return date;
	}

	public void setDate(long date) {
		this.date = date;
	}

	@Override
	public String toString() {
		return email;
	}

	@Override
	public int compareTo(Login that) {
		return Long.valueOf(that.date).compareTo(Long.valueOf(this.date));
	}

	public void refreshDate() {
		date = new Date().getTime();
	}

}


text:
namespace chromemedia {
namespace codec {
namespace {

using ::testing::Each;
using ::testing::Optional;
using ::testing::SizeIs;

static constexpr int kTestSampleRate = 16000;
static constexpr int kTestNumFeatures = 160;
static constexpr int kTestWindowLengthSamples = 640;
static constexpr int kTestHopLengthSamples = 320;

TEST(ComfortNoiseGeneratorTest, NumSamplesRequestedOutOfBounds) {
  auto comfort_noise_generator =
      ComfortNoiseGenerator::Create(kTestSampleRate, kTestHopLengthSamples,
                                    kTestWindowLengthSamples, kTestNumFeatures);

  std::vector<float> features(kTestNumFeatures, 0.0);
  comfort_noise_generator->AddFeatures(features);
  EXPECT_EQ(comfort_noise_generator->GenerateSamples(kTestHopLengthSamples + 1),
            std::nullopt);
  EXPECT_EQ(comfort_noise_generator->GenerateSamples(-1), std::nullopt);
  // Confirm that a request for 0 samples returns an empty vector.
  EXPECT_THAT(comfort_noise_generator->GenerateSamples(0), Optional(SizeIs(0)));
}

TEST(ComfortNoiseGeneratorTest, SamplesGeneratedOnlyWithCorrectNumFeatures) {
  auto comfort_noise_generator =
      ComfortNoiseGenerator::Create(kTestSampleRate, kTestHopLengthSamples,
                                    kTestWindowLengthSamples, kTestNumFeatures);

  const int kNumRequestedSamples = kTestHopLengthSamples;

  std::vector<float> features;
  comfort_noise_generator->AddFeatures(features);
  EXPECT_EQ(comfort_noise_generator->GenerateSamples(kNumRequestedSamples),
            std::nullopt);

  features.assign(kTestNumFeatures - 1, 1.0);
  comfort_noise_generator->AddFeatures(features);
  EXPECT_EQ(comfort_noise_generator->GenerateSamples(kNumRequestedSamples),
            std::nullopt);

  features.assign(kTestNumFeatures + 1, 1.0);
  comfort_noise_generator->AddFeatures(features);
  EXPECT_EQ(comfort_noise_generator->GenerateSamples(kNumRequestedSamples),
            std::nullopt);

  features.assign(kTestNumFeatures, 1.0);
  comfort_noise_generator->AddFeatures(features);
  EXPECT_NE(comfort_noise_generator->GenerateSamples(kNumRequestedSamples),
            std::nullopt);
}

TEST(ComfortNoiseGeneratorTest, BasicUseCaseSucceeds) {
  auto comfort_noise_generator =
      ComfortNoiseGenerator::Create(kTestSampleRate, kTestHopLengthSamples,
                                    kTestWindowLengthSamples, kTestNumFeatures);

  const int kNumRequestedSamples = kTestHopLengthSamples;

  // If features have no energy neither will the output samples.
  std::vector<float> features(kTestNumFeatures, 0.0);
  ASSERT_TRUE(comfort_noise_generator->AddFeatures(features));
  auto generated_samples =
      comfort_noise_generator->GenerateSamples(kNumRequestedSamples);
  ASSERT_TRUE(generated_samples.has_value());
  EXPECT_THAT(generated_samples.value(), Each(0.0));
}

TEST(ComfortNoiseGeneratorTest, GeneratedNoiseHasSimilarFeatures) {
  // Since log-mel-spectrogram extractors are stateful, it is necessary to
  // create separate ones for input and output.
  auto input_extractor = LogMelSpectrogramExtractorImpl::Create(
      kTestSampleRate, kTestHopLengthSamples, kTestWindowLengthSamples,
      kTestNumFeatures);
  auto output_extractor = LogMelSpectrogramExtractorImpl::Create(
      kTestSampleRate, kTestHopLengthSamples, kTestWindowLengthSamples,
      kTestNumFeatures);
  auto noise_generator =
      ComfortNoiseGenerator::Create(kTestSampleRate, kTestHopLengthSamples,
                                    kTestWindowLengthSamples, kTestNumFeatures);

  std::mt19937 gen(1);
  std::uniform_int_distribution<int16_t> prob(-10000, 10000);
  std::vector<int16_t> input_samples(kTestHopLengthSamples);
  for (int i = 0; i < kTestHopLengthSamples; ++i) {
    input_samples.at(i) = prob(gen);
  }

  std::vector<float> last_input_features;
  std::vector<float> last_output_features;
  const int kNumTimesToCall = 10;
  for (int i = 0; i < kNumTimesToCall; ++i) {
    auto input_features = input_extractor->Extract(input_samples);
    ASSERT_TRUE(input_features.has_value());
    last_input_features = input_features.value();
    noise_generator->AddFeatures(last_input_features);
    auto output_samples =
        noise_generator->GenerateSamples(kTestHopLengthSamples);
    ASSERT_TRUE(output_samples.has_value());
    auto output_features = output_extractor->Extract(output_samples.value());
    ASSERT_TRUE(output_features.has_value());
    last_output_features = output_features.value();
  }
  auto spectral_distance =
      LogSpectralDistance(last_input_features, last_output_features);
  ASSERT_TRUE(spectral_distance.has_value());
  EXPECT_LT(spectral_distance.value(), 0.7f);
}

}  // namespace
}  // namespace codec
}  // namespace chromemedia


text: FirstName LastName - email@email.com


text:
package adf.launcher.connect;

import adf.agent.office.OfficePolice;
import adf.component.control.ControlPolice;
import adf.component.AbstractLoader;
import adf.launcher.ConfigKey;
import rescuecore2.components.ComponentConnectionException;
import rescuecore2.components.ComponentLauncher;
import rescuecore2.config.Config;
import rescuecore2.connection.ConnectionException;

public class ConnectorPoliceOffice implements Connector
{

	@Override
	public void connect(ComponentLauncher launcher, Config config, AbstractLoader loader)
	{
		int count = config.getIntValue(ConfigKey.KEY_POLICE_OFFICE_COUNT, 0);
		int connected = 0;

		if (count == 0)
		{
			return;
		}
		if (loader.getControlPolice() == null) {
			System.out.println("[ERROR ] Cannot Load PoliceOffice Control !!");
			return;
		}

		try {
			for (int i = 0; i != count; ++i) {
				ControlPolice controlPolice = loader.getControlPolice();
				boolean isPrecompute = config.getBooleanValue(ConfigKey.KEY_PRECOMPUTE, false);
				launcher.connect(new OfficePolice(controlPolice, isPrecompute));
				//System.out.println(name);
				connected++;
			}
		}
		catch (ComponentConnectionException | InterruptedException | ConnectionException e)
		{
			//e.printStackTrace();
			//System.out.println("[ERROR ] Cannot Load PoliceOffice Control !!");
		}
		System.out.println("[FINISH] Connect PoliceOffice (success:" + connected + ")");
	}
}


text:
/**
 * Created by Isham on 4/4/2017.
 */
import React,{Component} from 'react';
import {withRouter} from 'react-router';
import {connect} from 'react-redux'
import jwtDecode from 'jwt-decode'
import Drawer from 'material-ui/Drawer';
import {Link} from 'react-router';
import {cyan100,cyan500} from 'material-ui/styles/colors';
import EmployerIcon from 'material-ui/svg-icons/action/account-balance';
import PostIcon from 'material-ui/svg-icons/action/work';
import ApplicationIcon from 'material-ui/svg-icons/action/note-add';
import JobSeekerIcon from 'material-ui/svg-icons/action/assignment-ind';
import PasswordIcon from 'material-ui/svg-icons/action/lock';
import IconButton from 'material-ui/IconButton';
import * as actionTypes from '../constants/actionTypes';
import ChangePassword from '../components/ChangePassword';
import FlatButton from 'material-ui/FlatButton';
import Dialog from 'material-ui/Dialog';

import Apply from 'material-ui/svg-icons/action/note-add';

class AdminPanal extends Component{
    constructor(props){
        super(props);
        this.state={
            openChangePassword:false
        }
    }
    handleChangePassword(formData){
        this.props.dispatch({
            type:actionTypes.USER_CHANGE_PASSWORD_REQUESTED,
            payload:{
                formData:formData,
                token:this.props.state.user.token
            }
        });
    }
    handleOpenPassword(){
        this.setState({
            openChangePassword:true
        });
    }
    handleClosePassword(){
        this.setState({
            openChangePassword:false
        });
        this.props.dispatch({type:actionTypes.USER_CHANGE_PASSWORD_CLOSED});
    }
    loadPage(){
        try{
            const roles=(jwtDecode(this.props.state.user.token)).roles;
            console.log(roles);
            if(roles.indexOf("ROLE_SUPER_ADMIN")== -1) this.props.router.replace("/logout");
        }catch (e){
            this.props.router.replace("/logout");
        }

    }

    render(){
        this.loadPage();
        const passwordActions = [
            <FlatButton
                label="Close"
                primary={true}
                onTouchTap={this.handleClosePassword.bind(this)}
            />
        ];

        return(

                <Drawer open={true} openSecondary={true} width={"84px"} >

                            <Link to="/admin" >
                                <IconButton tooltip="Applications" tooltipPosition="bottom-right" iconStyle={{width:"40px",height:"40px"}} style={{marginTop:"55px",width:"80px",height:"80px"}}>
                                    <ApplicationIcon color={cyan500} hoverColor={cyan100} />
                                </IconButton>
                            </Link>
                            <Link to="/admin/posts">
                                <IconButton tooltip="Posts"  tooltipPosition="bottom-right" iconStyle={{width:"40px",height:"40px"}} style={{marginTop:"10px",width:"80px",height:"80px"}}>
                                    <PostIcon color={cyan500} hoverColor={cyan100}/>
                                </IconButton>
                            </Link>
                            <Link to="/admin/employers">
                                <IconButton tooltip="Employers" tooltipPosition="bottom-right" iconStyle={{width:"40px",height:"40px"}} style={{marginTop:"10px",width:"80px",height:"80px"}}>
                                    <EmployerIcon color={cyan500} hoverColor={cyan100}  />
                                </IconButton>
                            </Link>
                            <Link to="/admin/jobseekers">
                                <IconButton tooltip="JobSeekers" tooltipPosition="bottom-right" iconStyle={{width:"40px",height:"40px"}} style={{marginTop:"10px",width:"80px",height:"80px"}}>
                                    <JobSeekerIcon color={cyan500} hoverColor={cyan100} />
                                </IconButton>
                            </Link>
                            <IconButton onTouchTap={this.handleOpenPassword.bind(this)} tooltip="Change Password" tooltipPosition="bottom-center" iconStyle={{width:"40px",height:"40px"}} style={{marginTop:"10px",width:"80px",height:"80px"}}>
                                <PasswordIcon color={cyan500} hoverColor={cyan100} />
                            </IconButton>

                </Drawer>

                    {this.props.children}

                <Dialog
                    title="Change Password"
                    actions={passwordActions}
                    modal={false}
                    open={this.state.openChangePassword}
                    onRequestClose={this.handleClosePassword.bind(this)}
                    autoScrollBodyContent={true}
                >
                    <ChangePassword
                        onSubmit={this.handleChangePassword.bind(this)}
                        passwordError={this.props.state.user.wrongPassword}
                        succeeded = {this.props.state.user.passwordChangeSucceeded}
                    />
                </Dialog>

        );
    }
}
const mapStateToProps=(state)=> {
    return({
        state:state
    }
    );
};
AdminPanal=withRouter(AdminPanal);
export default connect(mapStateToProps)(AdminPanal);


text:
#ifndef KLSCOLLISIONCHECKER_H_
#define KLSCOLLISIONCHECKER_H_

#include <map>
#include <vector>
#include <set>
using namespace std;

#include "klsBBox.h"

enum klsCollisionObjectType {
	COLL_GATE = 0,
	COLL_GATE_HOTSPOT,
	COLL_GATE_CLICKABLE,

	COLL_WIRE,
	COLL_WIRE_SEG,

	// PLACE OBJECT TYPES THAT ARE ALWAYS CHECKED AFTER THIS POINT
	COLL_SELBOX,
	COLL_VIEWPORT,

	COLL_MOUSEBOX,

	COLL_NONE
};

class klsCollisionObject;
class klsCollisionChecker;

// An arbitrary-ordered group of collision objects:
typedef set< klsCollisionObject* > CollisionGroup;

class klsCollisionObject {
friend class klsCollisionChecker;
public:

	// All collision objects must set their type by default:
	klsCollisionObject( klsCollisionObjectType theType ) {
		setType( theType );
		cData.bboxChanged = true; // The object is new, so mark it as having changed!
	};

	~klsCollisionObject() {
		deleteSubObjects();
		deleteCollisionObject();
	}

	// Get and set the bounding box for this collision object:
	// Always use setBBox() in order to flag the object as changed whenever it's
	// bounding box is changed!
	klsBBox getBBox( void ) const { return cData.bbox; };

	void resetBBox( void ) { cData.bbox.reset(); setBBoxChanged(); };

	void setBBox( klsBBox newBBox ) {
		cData.bbox = newBBox;
		makeValidBBox(); // Make sure that the new bbox contains its children!
		// Also can set a flag here that marks this object
		// as "changed" for the collision system to make sure to update it.
		setBBoxChanged();
	};

	// Make sure that the bbox surrounds its sub bboxes:
	// NOTE: It does not reset the bbox first. It just expands the box if needed.
	void makeValidBBox( void ) {
		CollisionGroup::iterator theObj = cData.subObjs.begin();
		while( theObj != cData.subObjs.end() ) {
			cData.bbox.addBBox( (*theObj)->getBBox() );
			theObj++;
		}

		// NOTE: This can't use setBBox, because setBBox calls it. Therefore,
		// it must also set the "changed" flag, just in case it is called from
		// outside of setBBox.
		setBBoxChanged();
	};

	// Return this object's sub objects as a set:
	CollisionGroup getSubObjects( void ) {
		return cData.subObjs;
	};

	// Overlap checking methods:

	// Check this object's bbox against another obj's, but don't
	// update the "overlaps" data structure:
	bool overlaps( klsCollisionObject* objB ) {
		return this->getBBox().overlaps( objB->getBBox() );
	};

	// Check this object's subobjects against another obj's bbox:
	// (Returns a list of subobjects of this object involved in any collisions.)
	CollisionGroup checkSubsToObj( klsCollisionObject* objB, bool resetOverlaps = true );

	// Check the subs of this object against the subs of another object:
	// (Returns a list of subobjects of this object involved in any collisions.)
	CollisionGroup checkSubsToSubs( klsCollisionObject* objB, bool resetOverlaps = true );

	// Return the overlaps of this object:
	CollisionGroup getOverlaps( void ) { return cData.overlaps; };

	// Mutators included for convenience:
	klsCollisionObjectType getType( void ) { return cData.objType; };
private: // Only accessed by constructor:
	void setType( klsCollisionObjectType newType ) { cData.objType = newType; };

protected:
	void insertSubObject( klsCollisionObject* klsc );
	void deleteSubObjects();
	void deleteCollisionObject();

private:
	// Functions only to be used by klsCollisionChecker or the object itself:
	// Flag the bbox as having changed:
	void setBBoxChanged( void ) {
		cData.bboxChanged = true;
	}

	// Flag the bbox as having been updated to reflect the change:
	void setBBoxUpdated( void ) {
		cData.bboxChanged = false;
	}

	// Return the "changed" status of the bbox:
	bool bboxHasChanged( void ) {
		return cData.bboxChanged;
	}

	// Reset the overlaps list for this object:
	void clearOverlaps( void ) { cData.overlaps.clear(); };

	// Reset the overlaps list for this object:
	void clearSubsOverlaps( void ) {
		CollisionGroup::iterator sub = cData.subObjs.begin();
		while( sub != cData.subObjs.end() ) {
			(*sub)->clearOverlaps();
			sub++;
		}
	};

	// Add an overlap to this collision object:
	void addOverlap( klsCollisionObject* newOverlap ) { cData.overlaps.insert( newOverlap ); };

	// Remove an overlap from this collision object:
	void removeOverlap( klsCollisionObject* oldOverlap ) { cData.overlaps.erase( oldOverlap ); };

	// Verify all current overlaps, and remove those that aren't overlapping anymore:
	// It returns those overlaps that needed to be removed:
	CollisionGroup verifyOverlaps( void ) {
		CollisionGroup badOverlaps; // The overlaps that will need removed.
		CollisionGroup::iterator thisOver = cData.overlaps.begin();
		while( thisOver != cData.overlaps.end() ) {
			// If the bounding boxes of the collision objects overlap,
			// then we have a collision:
			if( this->overlaps(*thisOver) ) {
				// This one's good, so keep checking.
			} else {
				// We've got a changed collision, so remember to remove it later:
				badOverlaps.insert( *thisOver );
			}
			thisOver++;
		}

		// Remove all the bad overlaps from the objects:
		thisOver = badOverlaps.begin();
		while( thisOver != badOverlaps.end() ) {
			this->removeOverlap( *thisOver );
			(*thisOver)->removeOverlap( this );
			thisOver++;
		}

		return badOverlaps;
	};

private:
	// Data for the collision object:
	struct {
		klsBBox bbox; // The object's world-space bounding box.

		klsCollisionObjectType objType; // The object's class type

		CollisionGroup subObjs; // Sub objects of this collision object.

		// A flag to tell if the bounding box of the object has changed:
		bool bboxChanged;

		// Temporary data:
		// (This is filled out by a call to the collision checker.)
		CollisionGroup overlaps; // Other objects that overlap this one.
	} cData;
};

class klsCollisionChecker {
public:
	klsCollisionChecker() {
	};

	~klsCollisionChecker() {
	};

	// Check the overlaps of all of the collision objects stored in this checker,
	// and update their status:
	void update( void );

	// Check a specific overlap group against another:
	// (NOTE: These groups cannot have a same collision object in both. Their
	// intersection must be the null set.)
	// If resetOverlaps is true, then it resets the overlaps of all the gates before
	// adding new collisions. Otherwise, it will simply add them to the current group.
	// (Returns a list of all objects involved in any collisions.)
	static CollisionGroup checkGroupCollisions( CollisionGroup groupA, CollisionGroup groupB, bool resetOverlaps = true );

	// List maintaining:
	// (NOTE: klsCollisionChecker maintains a LIST of POINTERS to the objects,
	// but it is not responsible for maintaining or deleting the objects, even
	// if you tell it to remove it. "Removing" just takes it out of this checker's list.)
	void addObject( klsCollisionObject* newObj ) {
		collisionObjects.insert( newObj );
		newObj->bboxHasChanged();
		newObj->clearOverlaps();
		newObj->clearSubsOverlaps();
	};

	void removeObject( klsCollisionObject* oldObj );

	// The overlapped objects from the last call to update(), mapped by klsCollisionObjectType:
	map< klsCollisionObjectType, CollisionGroup > overlaps;

	void clear( void ) { collisionObjects.clear(); update(); };

private:
	CollisionGroup collisionObjects;
};

#endif /*KLSCOLLISIONCHECKER_H_*/


text:
START_ATF_NAMESPACE
    struct _RPC_SECURITY_QOS_V3_A
    {
        unsigned int Version;
        unsigned int Capabilities;
        unsigned int IdentityTracking;
        unsigned int ImpersonationType;
        unsigned int AdditionalSecurityInfoType;
        $5791AEE384C27F75C9DD45F2F53B2F06 u;
        void *Sid;
    };
END_ATF_NAMESPACE


text:
<!DOCTYPE html>

    <meta content="text/html; charset=utf-8" http-equiv="content-type">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Armonía Interactiva</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/grayscale.css" rel="stylesheet">
    <link href="css/lora.css" rel="stylesheet" type="text/css">
    <link href="css/montserrat.css" rel="stylesheet" type="text/css">

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

 <button class="navbar-toggle collapsed" type="button"

          data-toggle="collapse" data-target=".navbar-collapse">  </button>
          Armonía Interactiva

 Armonía
              I

Triadas

Notación de acordes

Paralelismos Prohibidos

Progresión [I⇆IV]→[V⇆I]

Inversiones

Cadencias

 Armonía
              II

Funciones Armónicas

Acordes de 7ma y V7

 Armonía
              III

Pendiente

 Armonía
              IV

Intercambio Modal

Cadencias

Una cadencia es cuando una progresión musical llega a
          su finalización. Siempre tiene por objetivo por proveer una pausa en
          las frases musicales. Son como las diversas puntuaciones dentro de un
          párrafo escrito; sirven para separar cada idea, o en su caso, cada
          oración.

Así como algunos signos de puntuación son más conclusivos que otros,
          así también existen cadencias conclusivas y otras suspensivas. Veamos
          algunas de ellas.

Cadencias Conclusivas

Las cadencias conclusivas tiene por objetivo el concluir una frase
          musical. Existen tres tipos de cadencias: la perfecta, la imperfecta
          y la plagal.

Cadencia Perfecta

La cadencia perfecta ocurre cuando se va de un acorde
          V (Dominante) al I (Tónica). Sin embargo, ambos acordes deben
            estar en estado fundamental, siguiendo un enlace armónico o
          melódico. También la nota tónica, es decir, la fundamental de nuestro acorde I, debe estar
		  en el Soprano en nuestro acorde I.

Esta cadencia aplica tanto para tonalidades mayores como
          menores; sólo hay que recordar que el acorde V en las tonalidades
          menores se alteran para forzar la existencia de la sensible.

Para escuchar este ejemplo, pulsa aquí

 X
          <video controls="controls" width="100%"> <source src="sound/ArmICadenciasEj1.mp4"

              type="video/mp4"> Your browser does not support the video tag. </video>

Cadencia imperfecta

 La cadencia imperfecta es similar a la perfecta,
          puesto que ocurre cuando se utiliza un acorde V (dominante) y arriba
          al I (tónica). Alguno o ambos acordes pueden estar en inversión; en el caso de que ambos estuviesen
		  en estado fundamental, entonces tendría que tener la 3ra o la 5ta del acorde I en el Soprano en vez de tener
		  la fundamental, tal y como es el caso de la cadencia perfecta.

Por
          ello, no suena tan conclusiva que la perfecta. Ocurre tanto en
          tonalidades mayores como menores.

Para escuchar este ejemplo, pulsa aquí

 X
          <video controls="controls" width="100%"> <source src="sound/ArmICadenciasEj2.mp4"

              type="video/mp4"> Your browser does not support the video tag. </video>

Cadencia Plagal

 Esta cadencia, la cadencia plagal, se caracteriza por
          utilizar el acorde IV (subdominante)seguido por el acorde I (tónica).
          Su sonido es un tanto conclusivo, pero no tanto como la cadencia
          perfecta o imperfecta.

Para escuchar este ejemplo, pulsa aquí

 X
          <video controls="controls" width="100%"> <source src="sound/ArmICadenciasEj3.mp4"

              type="video/mp4"> Your browser does not support the video tag. </video>

Cadencias suspensivas

 Las cadencias suspensiva tienen como objetivo concluir una frase
          musical, pero dejando una 'puerta' abierta para seguir a otra frase
          musical. Ninguna de estas cadencias pueden terminar ni concluir
          definitivamente una pieza musical; no ofrecen un sonido tal. Por ello,
          se llaman de esta manera. Hay dos de ellas: la semicadencia
          ( o cadencia media) y la cadencia rota.

Semicadencia

 La semicadencia es ocurre cuando algún acorde
          anticipa el acorde V (dominante), y esta triada dominante suena
          suspensiva. El sonido es de crear una tensión que permite seguir a
          otra frase musical. Su sonido nos da un sentido de resolución, pero
          nos deja con ganas de seguir escuchando más música. Se siente como una
          'coma' dentro de una oración escrita.

Para escuchar este ejemplo, pulsa aquí

 X
          <video controls="controls" width="100%"> <source src="sound/ArmICadenciasEj4.mp4"

              type="video/mp4"> Your browser does not support the video tag. </video>

Cadencia rota

 La cadencia rota tiene por propoósito el ofrecer una
          alternativa suspensiva a la cadencia perfecta (o imperfecta). Es
          decir, ésta ocurre cuando se va de un acorde V (dominante) a un acorde
          vi (o VI en tonalidades menores, y este
          grado es conocido como submediante). En ambos casos,
          nos dan un sonido de conclusión porque la nota sensible (3ra de
          nuestro V) nos crea la expectación de escuchar nuestra nota tónica.
          Esta nota tónica sí aparece, pero como la 3ra del acorde vi (o VI en
          menores).

Sin embargo, su sonido nos da la impresión de una resolución, pero
          nos demanda, nos exige seguir hasta llegar a una conclusión. De ahí
          viene su cualidad suspensiva.

 Ahora bien, esta cadencia nos va a dar una dolor de cabeza si no es
          que tomamos en cuenta algunos puntos: 1) involucra el
          acorde vi (o VI), el cual es un acorde
          que no se supone que vayamos a ver en este semestre; 2)
          tendríamos que utilizar el enlace melódico para ejecutarlo, parecido
          al enlace que se usa entre IV y V (o iv y V); 3) si
          utilizamos el enlace melódico en las tonalidades menores, podríamos
          mover la nota sensible hacia abajo a una 2da aumentada, lo cual sería
          ir en contra de las reglas que ya habíamos anticipado; 4)
          si escribimos nuestra sensible en el So, tendríamos que forzosamente
          resolverla hacia arriba a la nota tónica.

Por ello, los más sensato es utilizar dos reglas aplicables para
            cada caso: cuando ocurren en tonalidades mayores y cuando
          ocurren en las tonalidades menores.

Si esta cadencia ocurre en tonalidades mayores, se tendrá que ver si
          la sensible está en la So. Si así es el caso, ésta resuelve hacia
          arriba a la nota tónica, el bajo sube y las demás bajan, tal y como
          exige el enlace melódico. El acorde vi tendría su
          tercera repetida, pero sonaría muy estable. No hay ninguna regla rota
          por hacer esto. Ahora bien, si no tenemos la sensible en la voz So, se
          puede utilizar un enlace melódico estricto: el bajo sube las demás
          bajan.

Ahora bien, si esta cadencia ocurre en tonalidades menores, sin
          importar si la sensible está en la So o no, ésta resuelve hacia arriba
          a la nota tónica, repitiendo la 3ra del acorde VI. Esto
          se hace para evitar una 2da aumentada que ocurriría si siguiésemos el
          patrón del enlace melódico. Al hacer este movimiento, no se rompe
          ninguna regla.

Para escuchar este ejemplo, pulsa aquí

 X
          <video controls="controls" width="100%"> <source src="sound/ArmICadenciasEj5.mp4"

              type="video/mp4"> Your browser does not support the video tag. </video>

Conclusión

 Para terminar una frase musical, debemos utilizar una cadencia.
          Podemos utilizar cualquiera de las que se describen a continuación.
          Una buena combinación de ellas puede llevarnos a hacer mejores
          composiciones.

Cadencias Conclusivas

              Cadencia Perfecta

              Cadencia Imperfecta

              Cadencia Plagal

Cadencias Suspensivas

              Semicadencia

              Cadencia Rota


text:
.class Landroid/support/v4/net/TrafficStatsCompat$IcsTrafficStatsCompatImpl;
.super Ljava/lang/Object;
.source "TrafficStatsCompat.java"

# interfaces
.implements Landroid/support/v4/net/TrafficStatsCompat$TrafficStatsCompatImpl;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/support/v4/net/TrafficStatsCompat;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = "IcsTrafficStatsCompatImpl"
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

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

    return-void
.end method

# virtual methods
.method public clearThreadStatsTag()V
    .locals 0

    .prologue
    .line 87
    invoke-static {}, Landroid/support/v4/net/TrafficStatsCompatIcs;->clearThreadStatsTag()V

    .line 88
    return-void
.end method

.method public getThreadStatsTag()I
    .locals 1

    .prologue
    .line 92
    invoke-static {}, Landroid/support/v4/net/TrafficStatsCompatIcs;->getThreadStatsTag()I

    move-result v0

    return v0
.end method

.method public incrementOperationCount(I)V
    .locals 0
    .param p1, "operationCount"    # I

    .prologue
    .line 97
    invoke-static {p1}, Landroid/support/v4/net/TrafficStatsCompatIcs;->incrementOperationCount(I)V

    .line 98
    return-void
.end method

.method public incrementOperationCount(II)V
    .locals 0
    .param p1, "tag"    # I
    .param p2, "operationCount"    # I

    .prologue
    .line 102
    invoke-static {p1, p2}, Landroid/support/v4/net/TrafficStatsCompatIcs;->incrementOperationCount(II)V

    .line 103
    return-void
.end method

.method public setThreadStatsTag(I)V
    .locals 0
    .param p1, "tag"    # I

    .prologue
    .line 107
    invoke-static {p1}, Landroid/support/v4/net/TrafficStatsCompatIcs;->setThreadStatsTag(I)V

    .line 108
    return-void
.end method

.method public tagSocket(Ljava/net/Socket;)V
    .locals 0
    .param p1, "socket"    # Ljava/net/Socket;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/net/SocketException;
        }
    .end annotation

    .prologue
    .line 112
    invoke-static {p1}, Landroid/support/v4/net/TrafficStatsCompatIcs;->tagSocket(Ljava/net/Socket;)V

    .line 113
    return-void
.end method

.method public untagSocket(Ljava/net/Socket;)V
    .locals 0
    .param p1, "socket"    # Ljava/net/Socket;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/net/SocketException;
        }
    .end annotation

    .prologue
    .line 117
    invoke-static {p1}, Landroid/support/v4/net/TrafficStatsCompatIcs;->untagSocket(Ljava/net/Socket;)V

    .line 118
    return-void
.end method


text:
require "vmc/cli/app/base"

module VMC::App
  class Health < Base
    desc "Get application health"
    group :apps, :info, :hidden => true
    input :apps, :desc => "Applications to start", :argument => :splat,
          :singular => :app, :from_given => by_name(:app)
    def health
      apps = input[:apps]
      fail "No applications given." if apps.empty?

      health =
        with_progress("Getting health status") do
          apps.collect { |a| [a, app_status(a)] }
        end

      line unless quiet?

      spaced(health) do |app, status|
        start_line "#{c(app.name, :name)}: " unless quiet?
        puts status
      end
    end
  end
end


text:
function [sigAB, err]= getProbabilisticOutputParamsScript_special(imdir, result, chinds, paramInfo, testMode)

load([imdir '/recs.mat'], 'recs');
rec = recs(chinds);

maxov = paramInfo.maxov;
maxdet = paramInfo.maxdet;
BIGPPLHT = paramInfo.BIGPPLHT;

%result = myLoadResults(fn, maxdet, [outdir '/candidates/']);

for k = 1:numel(result)
    [result(k).bbox, result(k).svmScore, kept] = ...
        pruneBBox(result(k).bbox, result(k).svmScore, [], [], maxov);
    result(k).scale = result(k).scale(kept);
    result(k).scores = result(k).svmScore;   % score set to svmScore!
end
ignoreExtraPos = false;
result = evaluateDetectionResult(rec, result, 'person', ignoreExtraPos, testMode, BIGPPLHT);

conf = cat(1, result.scores);
labels = cat(1, result.labels);
nonZeroInds = find(labels ~= 0);
conf = conf(nonZeroInds);
labels = labels(nonZeroInds);
labels(labels == -1) = 0;

disp(' added stub to take care of Inf values');
infinds = find(conf == -Inf);
minval = min(conf(find(conf~=-Inf)));
conf(infinds) = minval - 1;

[A, B, err] = getProbabilisticOutputParams(conf, labels);
sigAB = [A B];


text:
<!DOCTYPE HTML>

<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff">
<title>Codec (ExoPlayer library)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package com.google.android.exoplayer2.transformer

Interface Codec

All Known Implementing Classes:

DefaultCodec

public interface Codec

Provides a layer of abstraction for interacting with decoders and encoders.

DecoderInputBuffers are used as both decoders' and encoders' input
 buffers.

Nested Class Summary

Nested Classes

Modifier and Type
Interface
Description

static interface
Codec.DecoderFactory

A factory for decoder instances.

static interface
Codec.EncoderFactory

A factory for encoder instances.

Field Summary

Fields

Modifier and Type
Field
Description

static int
UNLIMITED_PENDING_FRAME_COUNT

Default value for the pending frame count, which represents applying no limit.

Method Summary

All Methods Instance Methods Abstract Methods Default Methods

Modifier and Type
Method
Description

Format
getConfigurationFormat()

Returns the Format used for configuring the Codec.

Surface
getInputSurface()

Returns the input Surface of an underlying video encoder.

default int
getMaxPendingFrameCount()

Returns the maximum number of frames that may be pending in the output Codec at a time,
 or UNLIMITED_PENDING_FRAME_COUNT if it's not necessary to enforce a limit.

String
getName()

Returns the name of the underlying codec.

ByteBuffer
getOutputBuffer()

Returns the current output ByteBuffer, or null if unavailable.

MediaCodec.BufferInfo
getOutputBufferInfo()

Returns the MediaCodec.BufferInfo associated with the current output buffer, or null if
 there is no output buffer available.

Format
getOutputFormat()

Returns the current output format, or null if unavailable.

boolean
isEnded()

Returns whether the Codec's output stream has ended, and no more data can be dequeued.

boolean
maybeDequeueInputBuffer(DecoderInputBuffer inputBuffer)

Dequeues a writable input buffer, if available.

void
queueInputBuffer(DecoderInputBuffer inputBuffer)

Queues an input buffer to the Codec.

void
release()

Releases the Codec.

void
releaseOutputBuffer(boolean render)

Releases the current output buffer.

void
signalEndOfInputStream()

Signals end-of-stream on input to a video encoder.

Field Detail

UNLIMITED_PENDING_FRAME_COUNT

static final int UNLIMITED_PENDING_FRAME_COUNT

Default value for the pending frame count, which represents applying no limit.

See Also:

Constant Field Values

Method Detail

getConfigurationFormat

Format getConfigurationFormat()

Returns the Format used for configuring the Codec.

The configuration Format is the input Format used by the Codec.DecoderFactory or output Format used by the Codec.EncoderFactory for selecting and
 configuring the underlying decoder or encoder.

getName

String getName()

Returns the name of the underlying codec.

getInputSurface

Surface getInputSurface()

Returns the input Surface of an underlying video encoder.

This method must only be called on video encoders because audio/video decoders and audio
 encoders don't use a Surface as input.

getMaxPendingFrameCount

default int getMaxPendingFrameCount()

Returns the maximum number of frames that may be pending in the output Codec at a time,
 or UNLIMITED_PENDING_FRAME_COUNT if it's not necessary to enforce a limit.

maybeDequeueInputBuffer

boolean maybeDequeueInputBuffer(DecoderInputBuffer inputBuffer)
                         throws TransformationException

Dequeues a writable input buffer, if available.

This method must not be called from video encoders because they must use a Surface
 to receive input.

Parameters:

inputBuffer - The buffer where the dequeued buffer data is stored, at inputBuffer.data.

Returns:

Whether an input buffer is ready to be used.

Throws:

TransformationException - If the underlying decoder or encoder encounters a problem.

queueInputBuffer

void queueInputBuffer(DecoderInputBuffer inputBuffer)
               throws TransformationException

Queues an input buffer to the Codec. No buffers may be queued after end of stream buffer has been queued.

This method must not be called from video encoders because they must use a Surface
 to receive input.

Parameters:

inputBuffer - The input buffer.

Throws:

TransformationException - If the underlying decoder or encoder encounters a problem.

signalEndOfInputStream

void signalEndOfInputStream()
                     throws TransformationException

Signals end-of-stream on input to a video encoder.

This method must only be called on video encoders because they must use a Surface as
 input. For audio/video decoders or audio encoders, the C.BUFFER_FLAG_END_OF_STREAM flag
 should be set on the last input buffer queued.

Throws:

TransformationException - If the underlying video encoder encounters a problem.

getOutputFormat

@Nullable
Format getOutputFormat()
                throws TransformationException

Returns the current output format, or null if unavailable.

Throws:

TransformationException - If the underlying decoder or encoder encounters a problem.

getOutputBuffer

@Nullable
ByteBuffer getOutputBuffer()
                    throws TransformationException

Returns the current output ByteBuffer, or null if unavailable.

This method must not be called on video decoders because they must output to a Surface.

Throws:

TransformationException - If the underlying decoder or encoder encounters a problem.

getOutputBufferInfo

@Nullable
MediaCodec.BufferInfo getOutputBufferInfo()
                                   throws TransformationException

Returns the MediaCodec.BufferInfo associated with the current output buffer, or null if
 there is no output buffer available.

This method returns null if and only if getOutputBuffer() returns null.

Throws:

TransformationException - If the underlying decoder or encoder encounters a problem.

releaseOutputBuffer

void releaseOutputBuffer(boolean render)
                  throws TransformationException

Releases the current output buffer.

Only set render to true when the Codec is a video decoder. Setting
 render to true will first render the buffer to the output surface. In this
 case, the surface will release the buffer back to the Codec once it is no longer
 used/displayed.

This should be called after the buffer has been processed. The next output buffer will not
 be available until the current output buffer has been released.

Parameters:

render - Whether the buffer needs to be rendered to the output Surface.

Throws:

TransformationException - If the underlying decoder or encoder encounters a problem.

isEnded

boolean isEnded()

Returns whether the Codec's output stream has ended, and no more data can be dequeued.

release

void release()

Releases the Codec.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="(C) Copyright 2005" />
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="concept" name="DC.Type" />
<meta name="DC.Title" content="Network client security" />
<meta name="abstract" content="The Derby Network Client allows you to select a security mechanism by specifying a value for the securityMechanism property." />
<meta name="description" content="The Derby Network Client allows you to select a security mechanism by specifying a value for the securityMechanism property." />
<meta content="Network Client security" name="DC.subject" />
<meta content="Network Client security" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="cadminappsclient.html" />
<meta scheme="URI" name="DC.Relation" content="cadminappsclienttracing.html" />
<meta scheme="URI" name="DC.Relation" content="radminappsclientxmp.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="cadminappsclientsecurity" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="commonltr.css" type="text/css" rel="stylesheet" />
<title>Network client security</title>

Network client security

The Derby Network
Client allows you to select a security mechanism by specifying a value for
the <samp class="codeph">securityMechanism</samp> property.

You can set the <samp class="codeph">securityMechanism</samp> property in one of the
following ways:

When you are using the <samp class="codeph">DriverManager</samp> interface, set
<samp class="codeph">securityMechanism</samp> in a <samp class="codeph">java.util.Properties</samp>
object before you invoke the form of the <samp class="codeph">getConnection</samp> method,
which includes the <samp class="codeph">java.util.Properties</samp> parameter.

When you are using the <samp class="codeph">DataSource</samp> interface to create
and deploy your own DataSource objects, invoke the
<samp class="codeph">DataSource.setSecurityMechanism</samp> method after you create a
DataSource object.

The following table lists the security mechanisms that the
Derby Network
Client supports, and the corresponding property value to specify to obtain this
security mechanism. The default security mechanism is the user id only if no
password is set. If the password is set, the default security mechanism is both
the user id and password. The default user is APP if no other user is
specified.

Table 1. Security mechanisms supported by the
Derby Network Client

Security Mechanism

securityMechanism Property Value

Comments

User id and password

<samp class="codeph">ClientDataSource.CLEAR_TEXT_PASSWORD_SECURITY</samp>
(0x03)

Default if password is set

User id only

<samp class="codeph">ClientDataSource.USER_ONLY_SECURITY</samp>
(0x04)

Default if password is not set

Encrypted user id and encrypted password

<samp class="codeph">ClientDataSource.ENCRYPTED_USER_AND_PASSWORD_SECURITY</samp>
(0x09)

Encryption requires a JCE implementation that supports
the Diffie-Hellman algorithm with a public prime of 256 bits.

Derby provides three
ClientDataSource implementations. You can use the
<samp class="codeph">org.apache.derby.jdbc.ClientDataSource</samp> class on
Java SE 5 and above (except Java SE 8 Compact Profiles), in applications that
call JDBC 3 or JDBC 4.0 methods. You can use the
<samp class="codeph">org.apache.derby.jdbc.ClientDataSource40</samp> class on
Java SE 6 and above (except Java SE 8 Compact Profiles), in applications that
call JDBC 4.1 or JDBC 4.2 methods. You must use the
<samp class="codeph">org.apache.derby.jdbc.BasicClientDataSource40</samp> class on
Java SE 8 Compact Profile 2 or 3.

Parent topic: Accessing the Network Server by using the network client driver

Related reference

Network client tracing

Network client driver examples


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Plicaria baeomycoides var. albopruinosa Rehm

### Remarks
null


text:
<!DOCTYPE html>

    <meta charset="utf-8">

Password Reset

        To reset your password, complete this form:

            Reset password now

 If above link doesn't work, please copy and paste below link:

        {{ URL::to('password/reset', array($token)) }}

    This link will expire in {{ Config::get('auth.reminder.expire', 60) }} minutes.