text:
package org.ovirt.engine.ui.webadmin.widget.footer;

import java.util.Date;

import org.ovirt.engine.core.common.businessentities.AuditLog;
import org.ovirt.engine.core.common.job.Job;
import org.ovirt.engine.ui.common.system.ClientStorage;
import org.ovirt.engine.ui.common.uicommon.model.SearchableTabModelProvider;
import org.ovirt.engine.ui.common.widget.table.SimpleActionTable;
import org.ovirt.engine.ui.common.widget.table.column.AuditLogSeverityColumn;
import org.ovirt.engine.ui.common.widget.table.column.FullDateTimeColumn;
import org.ovirt.engine.ui.common.widget.table.column.ImageResourceColumn;
import org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip;
import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
import org.ovirt.engine.ui.webadmin.ApplicationResources;
import org.ovirt.engine.ui.webadmin.ApplicationTemplates;
import org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider;
import org.ovirt.engine.ui.webadmin.uicommon.model.AlertFirstRowModelProvider;
import org.ovirt.engine.ui.webadmin.uicommon.model.AlertModelProvider;
import org.ovirt.engine.ui.webadmin.uicommon.model.AlertModelProvider.AlertCountChangeHandler;
import org.ovirt.engine.ui.webadmin.uicommon.model.EventFirstRowModelProvider;
import org.ovirt.engine.ui.webadmin.uicommon.model.EventModelProvider;
import org.ovirt.engine.ui.webadmin.uicommon.model.TaskFirstRowModelProvider;
import org.ovirt.engine.ui.webadmin.uicommon.model.TaskModelProvider;
import org.ovirt.engine.ui.webadmin.uicommon.model.TaskModelProvider.TaskCountChangeHandler;
import org.ovirt.engine.ui.webadmin.widget.table.column.TaskStatusColumn;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.ToggleButton;
import com.google.gwt.user.client.ui.Widget;

public class AlertsEventsFooterView extends Composite implements AlertCountChangeHandler, TaskCountChangeHandler {

    interface WidgetUiBinder extends UiBinder<Widget, AlertsEventsFooterView> {
        WidgetUiBinder uiBinder = GWT.create(WidgetUiBinder.class);
    }

    @UiField
    Style style;

    @UiField
    SimplePanel tablePanel;

    @UiField
    SimplePanel widgetPanel;

    @UiField
    SimplePanel firstRowTablePanel;

    @UiField
    ToggleButton alertButton;

    @UiField
    ToggleButton eventButton;

    @UiField
    ToggleButton taskButton;

    @UiField
    PushButton expandButton;

    @UiField
    PushButton collapseButton;

    @UiField
    Label message;

    SimpleActionTable<AuditLog> alertsTable;
    SimpleActionTable<AuditLog> eventsTable;
    TasksTree tasksTree;
    SimpleActionTable<AuditLog> _alertsTable;
    SimpleActionTable<AuditLog> _eventsTable;
    SimpleActionTable<Job> _tasksTable;

    String buttonUpStart;
    String buttonUpStretch;
    String buttonUpEnd;
    String buttonDownStart;
    String buttonDownStretch;
    String buttonDownEnd;

    private final ApplicationTemplates templates;
    private final ApplicationResources resources;
    private final SafeHtml alertImage;

    public AlertsEventsFooterView(AlertModelProvider alertModelProvider,
            AlertFirstRowModelProvider alertFirstRowModelProvider,
            EventModelProvider eventModelProvider,
            EventFirstRowModelProvider eventFirstRowModelProvider,
            TaskModelProvider taskModelProvider,
            TaskFirstRowModelProvider taskFirstRowModelProvider,
            ApplicationResources resources,
            ApplicationTemplates templates,
            EventBus eventBus,
            ClientStorage clientStorage) {
        this.resources = resources;
        this.templates = templates;
        initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this));
        initButtonHandlers();
        alertModelProvider.setAlertCountChangeHandler(this);
        taskModelProvider.setTaskCountChangeHandler(this);

        alertsTable = createActionTable(alertModelProvider);
        alertsTable.setBarStyle(style.barStyle());
        initTable(alertsTable);

        _alertsTable = createActionTable(alertFirstRowModelProvider);
        _alertsTable.setBarStyle(style.barStyle());
        _alertsTable.getElement().getStyle().setOverflowY(Overflow.HIDDEN);
        initTable(_alertsTable);

        eventsTable = createActionTable(eventModelProvider);
        eventsTable.setBarStyle(style.barStyle());
        initTable(eventsTable);

        _eventsTable = createActionTable(eventFirstRowModelProvider);
        _eventsTable.setBarStyle(style.barStyle());
        _eventsTable.getElement().getStyle().setOverflowY(Overflow.HIDDEN);
        initTable(_eventsTable);

        tasksTree = new TasksTree();
        tasksTree.updateTree(taskModelProvider.getModel());

        _tasksTable =
                new SimpleActionTable<Job>(taskFirstRowModelProvider, getTableResources(), eventBus, clientStorage);
        _tasksTable.setBarStyle(style.barStyle());
        _tasksTable.getElement().getStyle().setOverflowY(Overflow.HIDDEN);
        initTaskTable(_tasksTable);

        taskButton.setValue(false);
        alertButton.setValue(false);
        eventButton.setValue(true);
        message.setText("Last Message:");
        collapseButton.setVisible(false);

        tablePanel.clear();
        firstRowTablePanel.clear();
        tablePanel.add(eventsTable);
        firstRowTablePanel.add(_eventsTable);

        String image = AbstractImagePrototype.create(resources.alertConfigureImage()).getHTML();
        alertImage = SafeHtmlUtils.fromTrustedString(image);

        // no body is invoking the alert search (timer)
        alertModelProvider.getModel().Search();

        // no body is invoking the alert search (timer)
        taskModelProvider.getModel().Search();

        updateButtonResources();
        updateEventsButton();
        updateTaskButton(0);
        setAlertCount(0);
    }

    SimpleActionTable<AuditLog> createActionTable(SearchableTabModelProvider<AuditLog, ?> modelProvider) {
        return new SimpleActionTable<AuditLog>(modelProvider, getTableResources(),
                ClientGinjectorProvider.instance().getEventBus(),
                ClientGinjectorProvider.instance().getClientStorage());
    }

    AlertsEventsFooterResources getTableResources() {
        return GWT.<AlertsEventsFooterResources> create(AlertsEventsFooterResources.class);
    }

    @Override
    public void onAlertCountChange(int count) {
        setAlertCount(count);
    }

    @Override
    public void onRunningTasksCountChange(int count) {
        updateTaskButton(count);
    }

    void setAlertCount(int count) {

        String countStr = count + " " + "Alerts";

        SafeHtml up = templates.alertEventButton(alertImage, countStr,
                buttonUpStart, buttonUpStretch, buttonUpEnd, style.alertButtonUpStyle());
        SafeHtml down = templates.alertEventButton(alertImage, countStr,
                buttonDownStart, buttonDownStretch, buttonDownEnd, style.alertButtonDownStyle());

        alertButton.getUpFace().setHTML(up);
        alertButton.getDownFace().setHTML(down);
    }

    private void updateTaskButton(int count) {
        String tasksGrayImageSrc = AbstractImagePrototype.create(resources.iconTask()).getHTML();
        SafeHtml tasksGrayImage = SafeHtmlUtils.fromTrustedString(tasksGrayImageSrc);

        SafeHtml up = templates.alertEventButton(tasksGrayImage, "Tasks (" + count + ")",
                buttonUpStart, buttonUpStretch, buttonUpEnd, style.taskButtonUpStyle());
        SafeHtml down = templates.alertEventButton(tasksGrayImage, "Tasks (" + count + ")",
                buttonDownStart, buttonDownStretch, buttonDownEnd, style.taskButtonDownStyle());

        taskButton.getUpFace().setHTML(up);
        taskButton.getDownFace().setHTML(down);
    }

    void updateEventsButton() {
        String eventsGrayImageSrc = AbstractImagePrototype.create(resources.eventsGrayImage()).getHTML();
        SafeHtml eventsGrayImage = SafeHtmlUtils.fromTrustedString(eventsGrayImageSrc);

        SafeHtml up = templates.alertEventButton(eventsGrayImage, "Events",
                buttonUpStart, buttonUpStretch, buttonUpEnd, style.eventButtonUpStyle());
        SafeHtml down = templates.alertEventButton(eventsGrayImage, "Events",
                buttonDownStart, buttonDownStretch, buttonDownEnd, style.eventButtonDownStyle());

        eventButton.getUpFace().setHTML(up);
        eventButton.getDownFace().setHTML(down);
    }

    void updateButtonResources() {
        buttonUpStart = resources.footerButtonUpStart().getURL();
        buttonUpStretch = resources.footerButtonUpStretch().getURL();
        buttonUpEnd = resources.footerButtonUpEnd().getURL();
        buttonDownStart = resources.footerButtonDownStart().getURL();
        buttonDownStretch = resources.footerButtonDownStretch().getURL();
        buttonDownEnd = resources.footerButtonDownEnd().getURL();
    }

    void initButtonHandlers() {
        alertButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (alertButton.getValue()) {
                    eventButton.setValue(false);
                    taskButton.setValue(false);
                    tablePanel.clear();
                    tablePanel.add(alertsTable);

                    firstRowTablePanel.clear();
                    firstRowTablePanel.add(_alertsTable);

                    message.setText("Last Message:");
                    collapseButton.setVisible(false);
                }
                else {
                    alertButton.setValue(true);
                }
            }
        });

        eventButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (eventButton.getValue()) {
                    alertButton.setValue(false);
                    taskButton.setValue(false);
                    tablePanel.clear();
                    tablePanel.add(eventsTable);

                    firstRowTablePanel.clear();
                    firstRowTablePanel.add(_eventsTable);

                    message.setText("Last Message:");
                    collapseButton.setVisible(false);
                }
                else {
                    eventButton.setValue(true);
                }
            }
        });

        taskButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (taskButton.getValue()) {
                    alertButton.setValue(false);
                    eventButton.setValue(false);
                    tablePanel.clear();
                    tablePanel.add(tasksTree);

                    firstRowTablePanel.clear();
                    firstRowTablePanel.add(_tasksTable);

                    message.setText("Last Task:");
                    collapseButton.setVisible(true);
                }
                else {
                    taskButton.setValue(true);
                }
            }
        });

        expandButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                String height = widgetPanel.getElement().getParentElement().getParentElement().getStyle().getHeight();
                int offset = 30;
                if (height.equals("30px")) {
                    offset = 162;
                }
                widgetPanel.getElement().getParentElement().getParentElement().getStyle().setHeight(offset, Unit.PX);
                widgetPanel.getElement().getParentElement().getParentElement().getStyle().setBottom(0, Unit.PX);
                Element e =
                        (Element) widgetPanel.getElement()
                                .getParentElement()
                                .getParentElement()
                                .getParentElement()
                                .getChild(2);
                e.getStyle().setBottom(offset, Unit.PX);
                e =
                        (Element) widgetPanel.getElement()
                                .getParentElement()
                                .getParentElement()
                                .getParentElement()
                                .getChild(3);
                e.getStyle().setBottom(offset + 2, Unit.PX);
            }
        });

        collapseButton.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                tasksTree.collapseAllTasks();
            }
        });
    }

    void initTable(SimpleActionTable<AuditLog> table) {
        table.addColumn(new AuditLogSeverityColumn(), "", "30px");

        TextColumnWithTooltip<AuditLog> logTimeColumn = new FullDateTimeColumn<AuditLog>() {
            @Override
            protected Date getRawValue(AuditLog object) {
                return object.getlog_time();
            }
        };
        table.addColumn(logTimeColumn, "Time", "160px");

        TextColumnWithTooltip<AuditLog> messageColumn = new TextColumnWithTooltip<AuditLog>() {
            @Override
            public String getValue(AuditLog object) {
                return object.getmessage();
            }
        };
        table.addColumn(messageColumn, "Message");
    }

    void initTaskTable(SimpleActionTable<Job> taskTable) {
        ImageResourceColumn<Job> taskStatusColumn = new ImageResourceColumn<Job>() {
            @Override
            public ImageResource getValue(Job object) {
                EntityModel entityModel = new EntityModel();
                entityModel.setEntity(object);
                return new TaskStatusColumn().getValue(entityModel);
            }
        };

        taskTable.addColumn(taskStatusColumn, "Status", "30px");

        FullDateTimeColumn<Job> timeColumn = new FullDateTimeColumn<Job>() {
            @Override
            protected Date getRawValue(Job object) {
                return object.getEndTime() == null ? object.getStartTime() : object.getEndTime();
            }
        };
        taskTable.addColumn(timeColumn, "Time", "160px");

        TextColumnWithTooltip<Job> descriptionColumn = new TextColumnWithTooltip<Job>() {
            @Override
            public String getValue(Job object) {
                return object.getDescription();
            }
        };
        taskTable.addColumn(descriptionColumn, "Description");
    }

    public interface AlertsEventsFooterResources extends CellTable.Resources {
        interface TableStyle extends CellTable.Style {
        }

        @Override
        @Source({ CellTable.Style.DEFAULT_CSS, "org/ovirt/engine/ui/webadmin/css/FooterHeaderlessTable.css" })
        TableStyle cellTableStyle();
    }

    interface Style extends CssResource {

        String barStyle();

        String alertButtonUpStyle();

        String alertButtonDownStyle();

        String eventButtonUpStyle();

        String eventButtonDownStyle();

        String taskButtonUpStyle();

        String taskButtonDownStyle();
    }

    @Override
    public void onTaskCountChange(int count) {
        return;
    }
}


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

    /// <summary>
    /// This is a WPF wrapper of OxyPlot.LogarithmicAxis.
    /// </summary>
    public class LogarithmicAxis : Axis
    {
        /// <summary>
        /// Gets or sets the logarithmic base (normally 10).
        /// http://en.wikipedia.org/wiki/Logarithm
        /// </summary>
        /// <value>The logarithmic base.</value>
        public static readonly DependencyProperty BaseProperty = DependencyProperty.Register(
            "Base", typeof(double), typeof(LogarithmicAxis), new PropertyMetadata(10.0, DataChanged));

        /// <summary>
        /// The power padding property.
        /// </summary>
        public static readonly DependencyProperty PowerPaddingProperty = DependencyProperty.Register(
            "PowerPadding", typeof(bool), typeof(LogarithmicAxis), new PropertyMetadata(true, DataChanged));

        /// <summary>
        /// Initializes a new instance of the <see cref = "LogarithmicAxis" /> class.
        /// </summary>
        public LogarithmicAxis()
        {
            this.InternalAxis = new OxyPlot.Axes.LogarithmicAxis();
            this.FilterMinValue = 0;
        }

        /// <summary>
        /// Gets or sets Base.
        /// </summary>
        public double Base
        {
            get
            {
                return (double)this.GetValue(BaseProperty);
            }

            set
            {
                this.SetValue(BaseProperty, value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the ActualMaximum and ActualMinimum values should be padded to the nearest power of the Base.
        /// </summary>
        public bool PowerPadding
        {
            get
            {
                return (bool)this.GetValue(PowerPaddingProperty);
            }

            set
            {
                this.SetValue(PowerPaddingProperty, value);
            }
        }

        /// <summary>
        /// The create model.
        /// </summary>
        /// <returns>
        /// </returns>
        public override OxyPlot.Axes.Axis CreateModel()
        {
            this.SynchronizeProperties();
            return this.InternalAxis;
        }

        /// <summary>
        /// The synchronize properties.
        /// </summary>
        protected override void SynchronizeProperties()
        {
            base.SynchronizeProperties();
            var a = this.InternalAxis as OxyPlot.Axes.LogarithmicAxis;
            a.Base = this.Base;
            a.PowerPadding = this.PowerPadding;
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
PSmmAstNode smmLoadAst(PSmmLexer lex, PIbsAllocator a);

#endif


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Repert. mic. uomo 295 (1934)

#### Original name
Indiellaceae Nann.

### Remarks
null


text:
require 'rubygems'
require 'bundler'

Bundler.require
Bundler.require(:test)

require 'minitest/autorun'
require 'mocha' # needs to be required after minitest so it has stub/mock methods mixed in

$LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))

require 'restricted_performer'


text:
import { stretch } from '../../src/decorators'
import * as shared from './shared'

describe('stretch()', () => {
  shared.decorate(stretch)
  shared.behavesLikeAPageSizer()
})


text:
"""Small version of full_model_4bit_weights_and_fixed_acts."""

from aqt.jax_legacy.jax.wmt_mlperf.hparams_configs import base_config
from aqt.jax_legacy.jax.wmt_mlperf.hparams_configs.experimental import small_model_bfloat16

def get_config():
  config = small_model_bfloat16.get_config(
      quant_target=base_config.QuantTarget.WEIGHTS_AND_FIXED_ACTS)
  config.weight_prec = 4
  config.quant_act.prec = 4
  return config


text:
'use strict';

// MODULES //

var path = require( 'path' );
var logger = require( 'debug' );
var objectKeys = require( '@stdlib/utils/keys' );
var replace = require( '@stdlib/string/replace' );
var extname = require( '@stdlib/utils/extname' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var readDir = require( '@stdlib/fs/read-dir' ).sync;
var readFile = require( '@stdlib/fs/read-file' ).sync;
var writeFile = require( '@stdlib/fs/write-file' ).sync;
var parse = require( '@stdlib/_tools/repl-txt/parse' );
var node2info = require( '@stdlib/_tools/repl-txt/abridge' );

// VARIABLES //

var debug = logger( 'repl:help:build' );

// Source documentation directory:
var SRC_DIR = path.resolve( __dirname, '..', 'docs', 'commands' );

// Output file directory:
var OUTPUT_DIR = path.resolve( __dirname, '..', 'data' );

// FUNCTIONS //

/**
* Filters a list of files for documentation files.
*
* @private
* @param {Array} list - file list
* @returns {Array} filtered list
*/
function filterFiles( list ) {
	var out;
	var ext;
	var i;

	out = [];
	for ( i = 0; i < list.length; i++ ) {
		ext = extname( list[ i ] );
		if ( ext === '.txt' ) {
			out.push( list[ i ] );
		}
	}
	return out;
}

/**
* Returns a section AST node having a specified title.
*
* @private
* @param {ObjectArray} nodes - section AST nodes
* @param {string} name - section name
* @returns {(Object|null)} AST node or null
*/
function findSection( nodes, name ) {
	var i;
	for ( i = 0; i < nodes.length; i++ ) {
		if ( nodes[ i ].title === name ) {
			return nodes[ i ];
		}
	}
	return null;
}

/**
* Saves a JSON database.
*
* @private
* @param {string} basename - base file name (excluding extension)
* @param {Object} json - JSON database
*/
function save( basename, json ) {
	var fpath;
	var fopts;
	var keys;
	var csv;
	var tmp;
	var i;

	debug( 'Writing to JSON file.' );
	fopts = {
		'encoding': 'utf8'
	};
	fpath = path.join( OUTPUT_DIR, basename+'.json' );
	writeFile( fpath, JSON.stringify( json ), fopts );

	debug( 'Writing to CSV file.' );
	keys = objectKeys( json );
	csv = '';
	for ( i = 0; i < keys.length; i++ ) {
		tmp = replace( json[ keys[i] ], /\r?\n/g, '\\n' );
		tmp = replace( tmp, '"', '\\"' );
		csv += keys[ i ] + ',"' + tmp + '"\n'; // Note: ensures trailing newline
	}
	fpath = path.join( OUTPUT_DIR, basename+'.csv' );
	writeFile( fpath, csv, fopts );
}

/**
* Main execution sequence.
*
* @private
* @returns {void}
*/
function main() {
	var files;
	var ropts;
	var alias;
	var asts;
	var code;
	var len;
	var ast;
	var dbs;
	var tmp;
	var s;
	var i;
	var j;
	var k;

	debug( 'Reading directory: %s', SRC_DIR );
	files = readDir( SRC_DIR );
	if ( files instanceof Error ) {
		debug( 'Encountered an error when attempting to read directory. Error: %s', files.message );
		console.error( 'Error: %s', files.message ); // eslint-disable-line no-console
		return;
	}
	debug( 'Filtering for documentation files.' );
	files = filterFiles( files );
	len = files.length;
	if ( len === 0 ) {
		debug( 'Unable to resolve documentation files.' );
		return;
	}
	debug( 'Found %d documentation files.', len );

	debug( 'Generating ASTs.' );
	ropts = {
		'encoding': 'utf8'
	};
	asts = [];
	for ( i = 0; i < len; i++ ) {
		files[ i ] = readFile( path.join( SRC_DIR, files[ i ] ), ropts );
		asts.push( parse( files[ i ] ) );
	}
	debug( 'Finished generating ASTs.' );

	debug( 'Generating databases.' );
	dbs = {
		'help': {},
		'info': {},
		'example': {}
	};
	for ( i = 0; i < len; i++ ) {
		ast = asts[ i ];
		alias = ast[ 0 ].signature.name;

		debug( 'Processing alias: %s', alias );
		dbs.help[ alias ] = files[ i ];

		debug( 'Number of documented interfaces: %d', ast.length );
		debug( 'Processing interfaces.' );
		for ( j = 0; j < ast.length; j++ ) {
			tmp = ast[ j ].signature.name;
			debug( 'Interface: %s', tmp );

			if ( tmp.slice( 0, alias.length ) !== alias ) {
				debug( 'Interface is documented neither as the alias nor an associated method. Skipping...' );
				continue;
			}

			// Help text:
			if ( tmp === alias ) {
				// Main alias should exclusively correspond to the full help text:
				debug( 'Interface corresponds to the main alias.' );
			} else if ( hasOwnProp( dbs.help, tmp ) ) {
				// Concatenate associated signatures (e.g., same API, but multiple parameterizations based on argument types, etc):
				dbs.help[ tmp ] += ast[ j ].raw;
			} else {
				dbs.help[ tmp ] = '\n' + ast[ j ].raw;
			}

			// Info:
			if ( hasOwnProp( dbs.info, tmp ) ) {
				dbs.info[ tmp ] += node2info( ast[ j ] );
			} else {
				dbs.info[ tmp ] = node2info( ast[ j ] );
			}

			// Example:
			s = findSection( ast[ j ].sections, 'Examples' );
			if ( s ) {
				code = '';
				for ( k = 0; k < s.examples.length; k++ ) {
					code += s.examples[ k ].code + '\n';
				}
				if ( hasOwnProp( dbs.example, tmp ) ) {
					// Concatenate associated examples (e.g., same API, but multiple parameterizations based on argument types, etc):
					dbs.example[ tmp ] += code;
				} else {
					dbs.example[ tmp ] = code;
				}
			} else {
				debug( 'Unable to resolve examples.' );
			}

			debug( 'Finished processing interface.' );
		}
		debug( 'Successfully processed alias: %s', alias );
	}

	debug( 'Saving help text database.' );
	save( 'help', dbs.help );

	debug( 'Saving abbreviate help text database.' );
	save( 'info', dbs.info );

	debug( 'Saving example database.' );
	save( 'example', dbs.example );
}

// MAIN //

main();


text:
//
// This code is part of the XPCOM extensions for Python.
//
// Written May 2000 by Mark Hammond.
//
// Based heavily on the Python COM support, which is
// (c) Mark Hammond and Greg Stein.
//
// (c) 2000, ActiveState corp.

#include "PyXPCOM_std.h"

static nsIInterfaceInfo *GetI(PyObject *self) {
	nsIID iid = NS_GET_IID(nsIInterfaceInfo);

	if (!Py_nsISupports::Check(self, iid)) {
		PyErr_SetString(PyExc_TypeError, "This object is not the correct interface");
		return NULL;
	}
	return (nsIInterfaceInfo *)Py_nsISupports::GetI(self);
}

static PyObject *PyGetName(PyObject *self, PyObject *args)
{
	if (!PyArg_ParseTuple(args, ":GetName"))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	char *name;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->GetName(&name);
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	PyObject *ret = PyString_FromString(name);
	nsMemory::Free(name);
	return ret;
}

static PyObject *PyGetIID(PyObject *self, PyObject *args)
{
	if (!PyArg_ParseTuple(args, ":GetIID"))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	nsIID *iid_ret;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->GetInterfaceIID(&iid_ret);
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	PyObject *ret = Py_nsIID::PyObjectFromIID(*iid_ret);
	nsMemory::Free(iid_ret);
	return ret;
}

static PyObject *PyIsScriptable(PyObject *self, PyObject *args)
{
	if (!PyArg_ParseTuple(args, ":IsScriptable"))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	PRBool b_ret;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->IsScriptable(&b_ret);
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	return PyInt_FromLong(b_ret);
}

static PyObject *PyGetParent(PyObject *self, PyObject *args)
{
	if (!PyArg_ParseTuple(args, ":GetParent"))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	nsCOMPtr<nsIInterfaceInfo> pRet;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->GetParent(getter_AddRefs(pRet));
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	return Py_nsISupports::PyObjectFromInterface(pRet, NS_GET_IID(nsIInterfaceInfo), PR_FALSE);
}

static PyObject *PyGetMethodCount(PyObject *self, PyObject *args)
{
	if (!PyArg_ParseTuple(args, ":GetMethodCount"))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	PRUint16 ret;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->GetMethodCount(&ret);
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	return PyInt_FromLong(ret);
}

static PyObject *PyGetConstantCount(PyObject *self, PyObject *args)
{
	if (!PyArg_ParseTuple(args, ":GetConstantCount"))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	PRUint16 ret;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->GetConstantCount(&ret);
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	return PyInt_FromLong(ret);
}

static PyObject *PyGetMethodInfo(PyObject *self, PyObject *args)
{
	PRUint16 index;
	if (!PyArg_ParseTuple(args, "h:GetMethodInfo", &index))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	PRUint16 nmethods;
	pI->GetMethodCount(&nmethods);
	if (index>=nmethods) {
		PyErr_SetString(PyExc_ValueError, "The method index is out of range");
		return NULL;
	}

	const nsXPTMethodInfo *pRet;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->GetMethodInfo(index, &pRet);
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	return PyObject_FromXPTMethodDescriptor(pRet);
}

static PyObject *PyGetMethodInfoForName(PyObject *self, PyObject *args)
{
	char *name;
	if (!PyArg_ParseTuple(args, "s:GetMethodInfoForName", &name))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	const nsXPTMethodInfo *pRet;
	PRUint16 index;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->GetMethodInfoForName(name, &index, &pRet);
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	PyObject *ret_i = PyObject_FromXPTMethodDescriptor(pRet);
	if (ret_i==NULL)
		return NULL;
	PyObject *real_ret = Py_BuildValue("iO", (int)index, ret_i);
	Py_DECREF(ret_i);
	return real_ret;
}

static PyObject *PyGetConstant(PyObject *self, PyObject *args)
{
	PRUint16 index;
	if (!PyArg_ParseTuple(args, "h:GetConstant", &index))
		return NULL;

	nsIInterfaceInfo *pI = GetI(self);
	if (pI==NULL)
		return NULL;

	const nsXPTConstant *pRet;
	nsresult r;
	Py_BEGIN_ALLOW_THREADS;
	r = pI->GetConstant(index, &pRet);
	Py_END_ALLOW_THREADS;
	if ( NS_FAILED(r) )
		return PyXPCOM_BuildPyException(r);
	return PyObject_FromXPTConstant(pRet);
}

static PRBool __GetMethodInfoHelper(nsIInterfaceInfo *pii, int mi, int pi, const nsXPTMethodInfo **ppmi)
{
	PRUint16 nmethods=0;
	pii->GetMethodCount(&nmethods);
	if (mi<0 || mi>=nmethods) {
		PyErr_SetString(PyExc_ValueError, "The method index is out of range");
		return PR_FALSE;
	}
	const nsXPTMethodInfo *pmi;
	nsresult r = pii->GetMethodInfo(mi, &pmi);
	if ( NS_FAILED(r) ) {
		PyXPCOM_BuildPyException(r);
		return PR_FALSE;
	}

	int nparams=0;
	nparams = pmi->GetParamCount();
	if (pi<0 || pi>=nparams) {
		PyErr_SetString(PyExc_ValueError, "The param index is out of range");
		return PR_FALSE;
	}
	*ppmi = pmi;
	return PR_TRUE;
}

static PyObject *PyGetInfoForParam(PyObject *self, PyObject *args)
{
	nsIInterfaceInfo *pii = GetI(self);
	if (pii==NULL)
		return NULL;
	PRUint16 mi, pi;
	if (!PyArg_ParseTuple(args, "hh:GetInfoForParam", &mi, &pi))
		return NULL;
	const nsXPTMethodInfo *pmi;
	if (!__GetMethodInfoHelper(pii, mi, pi, &pmi))
		return NULL;
	const nsXPTParamInfo& param_info = pmi->GetParam((PRUint8)pi);
	nsCOMPtr<nsIInterfaceInfo> pnewii;
	nsresult n = pii->GetInfoForParam(mi, &param_info, getter_AddRefs(pnewii));
	if (NS_FAILED(n))
		return PyXPCOM_BuildPyException(n);
	return Py_nsISupports::PyObjectFromInterface(pnewii, NS_GET_IID(nsIInterfaceInfo));
}

static PyObject *PyGetIIDForParam(PyObject *self, PyObject *args)
{
	nsIInterfaceInfo *pii = GetI(self);
	if (pii==NULL)
		return NULL;
	PRUint16 mi, pi;
	if (!PyArg_ParseTuple(args, "hh:GetIIDForParam", &mi, &pi))
		return NULL;
	const nsXPTMethodInfo *pmi;
	if (!__GetMethodInfoHelper(pii, mi, pi, &pmi))
		return NULL;
	const nsXPTParamInfo& param_info = pmi->GetParam((PRUint8)pi);
	nsIID *piid;
	nsresult n = pii->GetIIDForParam(mi, &param_info, &piid);
	if (NS_FAILED(n) || piid==nsnull)
		return PyXPCOM_BuildPyException(n);
	PyObject *rc = Py_nsIID::PyObjectFromIID(*piid);
	nsMemory::Free((void*)piid);
	return rc;
}

static PyObject *PyGetTypeForParam(PyObject *self, PyObject *args)
{
	nsIInterfaceInfo *pii = GetI(self);
	if (pii==NULL)
		return NULL;
	PRUint16 mi, pi, dim;
	if (!PyArg_ParseTuple(args, "hhh:GetTypeForParam", &mi, &pi, &dim))
		return NULL;
	const nsXPTMethodInfo *pmi;
	if (!__GetMethodInfoHelper(pii, mi, pi, &pmi))
		return NULL;
	nsXPTType datumType;
	const nsXPTParamInfo& param_info = pmi->GetParam((PRUint8)pi);
	nsresult n = pii->GetTypeForParam(mi, &param_info, dim, &datumType);
	if (NS_FAILED(n))
		return PyXPCOM_BuildPyException(n);
	return PyObject_FromXPTType(&datumType);
}

static PyObject *PyGetSizeIsArgNumberForParam(PyObject *self, PyObject *args)
{
	nsIInterfaceInfo *pii = GetI(self);
	if (pii==NULL)
		return NULL;
	PRUint16 mi, pi, dim;
	if (!PyArg_ParseTuple(args, "hhh:GetSizeIsArgNumberForParam", &mi, &pi, &dim))
		return NULL;
	const nsXPTMethodInfo *pmi;
	if (!__GetMethodInfoHelper(pii, mi, pi, &pmi))
		return NULL;
        PRUint8 ret;
	const nsXPTParamInfo& param_info = pmi->GetParam((PRUint8)pi);
	nsresult n = pii->GetSizeIsArgNumberForParam(mi, &param_info, dim, &ret);
	if (NS_FAILED(n))
		return PyXPCOM_BuildPyException(n);
	return PyInt_FromLong(ret);
}

static PyObject *PyGetLengthIsArgNumberForParam(PyObject *self, PyObject *args)
{
	nsIInterfaceInfo *pii = GetI(self);
	if (pii==NULL)
		return NULL;
	PRUint16 mi, pi, dim;
	if (!PyArg_ParseTuple(args, "hhh:GetLengthIsArgNumberForParam", &mi, &pi, &dim))
		return NULL;
	const nsXPTMethodInfo *pmi;
	if (!__GetMethodInfoHelper(pii, mi, pi, &pmi))
		return NULL;
        PRUint8 ret;
	const nsXPTParamInfo& param_info = pmi->GetParam((PRUint8)pi);
	nsresult n = pii->GetLengthIsArgNumberForParam(mi, &param_info, dim, &ret);
	if (NS_FAILED(n))
		return PyXPCOM_BuildPyException(n);
	return PyInt_FromLong(ret);
}

static PyObject *PyGetInterfaceIsArgNumberForParam(PyObject *self, PyObject *args)
{
	nsIInterfaceInfo *pii = GetI(self);
	if (pii==NULL)
		return NULL;
	PRUint16 mi, pi;
	if (!PyArg_ParseTuple(args, "hhh:GetInterfaceIsArgNumberForParam", &mi, &pi))
		return NULL;
	const nsXPTMethodInfo *pmi;
	if (!__GetMethodInfoHelper(pii, mi, pi, &pmi))
		return NULL;
        PRUint8 ret;
	const nsXPTParamInfo& param_info = pmi->GetParam((PRUint8)pi);
	nsresult n = pii->GetInterfaceIsArgNumberForParam(mi, &param_info, &ret);
	if (NS_FAILED(n))
		return PyXPCOM_BuildPyException(n);
	return PyInt_FromLong(ret);
}

struct PyMethodDef
PyMethods_IInterfaceInfo[] =
{
	{ "GetName", PyGetName, 1},
	{ "GetIID", PyGetIID, 1},
	{ "IsScriptable", PyIsScriptable, 1},
	{ "GetParent", PyGetParent, 1},
	{ "GetMethodCount", PyGetMethodCount, 1},
	{ "GetConstantCount", PyGetConstantCount, 1},
	{ "GetMethodInfo", PyGetMethodInfo, 1},
	{ "GetMethodInfoForName", PyGetMethodInfoForName, 1},
	{ "GetConstant", PyGetConstant, 1},
	{ "GetInfoForParam", PyGetInfoForParam, 1},
	{ "GetIIDForParam", PyGetIIDForParam, 1},
	{ "GetTypeForParam", PyGetTypeForParam, 1},
	{ "GetSizeIsArgNumberForParam", PyGetSizeIsArgNumberForParam, 1},
	{ "GetLengthIsArgNumberForParam", PyGetLengthIsArgNumberForParam, 1},
	{ "GetInterfaceIsArgNumberForParam", PyGetInterfaceIsArgNumberForParam, 1},
	{NULL}
};

/*
  NS_IMETHOD GetMethodInfo(PRUint16 index, const nsXPTMethodInfo * *info) = 0;
  NS_IMETHOD GetMethodInfoForName(const char *methodName, PRUint16 *index, const nsXPTMethodInfo * *info) = 0;
  NS_IMETHOD GetConstant(PRUint16 index, const nsXPTConstant * *constant) = 0;
  NS_IMETHOD GetInfoForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, nsIInterfaceInfo **_retval) = 0;
  NS_IMETHOD GetIIDForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, nsIID * *_retval) = 0;
  NS_IMETHOD GetTypeForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, nsXPTType *_retval) = 0;
  NS_IMETHOD GetSizeIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, PRUint8 *_retval) = 0;
  NS_IMETHOD GetLengthIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint16 dimension, PRUint8 *_retval) = 0;
  NS_IMETHOD GetInterfaceIsArgNumberForParam(PRUint16 methodIndex, const nsXPTParamInfo * param, PRUint8 *_retval) = 0;

*/


text:
package org.commcare.views;

import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import org.commcare.preferences.MainConfigurablePreferences;
import org.javarosa.core.services.locale.Localization;

/**
 * Allow password field to show/hide password text
 *
 * @author Phillip Mates (pmates@dimagi.com)
 */
public class PasswordShow {

    private boolean isPasswordVisible;
    private final Button showPasswordButton;
    private final EditText passwordField;
    private final String showText, hideText;

    public PasswordShow(Button showPasswordButton, EditText passwordField) {
        this.showPasswordButton = showPasswordButton;
        this.passwordField = passwordField;

        showText = Localization.get("login.show.password");
        hideText = Localization.get("login.hide.password");
    }

    public void setupPasswordVisibility() {
        switch (MainConfigurablePreferences.getPasswordDisplayOption()) {
            case ALWAYS_HIDDEN:
                passwordAlwaysHiddenState();
                break;
            case DEFAULT_HIDE:
                passwordHiddenState();
                break;
            case DEFAULT_SHOW:
                passwordShownState();
                break;
        }
        showPasswordButton.setOnClickListener(v -> togglePasswordVisibility());
    }

    private void passwordAlwaysHiddenState() {
        isPasswordVisible = false;
        showPasswordButton.setVisibility(View.INVISIBLE);
    }

    private void passwordHiddenState() {
        isPasswordVisible = false;
        showPasswordButton.setVisibility(View.VISIBLE);
        showPasswordButton.setText(showText);
        passwordField.setTransformationMethod(PasswordTransformationMethod.getInstance());
        passwordField.setSelection(passwordField.getText().length());
    }

    private void passwordShownState() {
        isPasswordVisible = true;
        showPasswordButton.setVisibility(View.VISIBLE);
        showPasswordButton.setText(hideText);
        passwordField.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
        passwordField.setSelection(passwordField.getText().length());
    }

    private void togglePasswordVisibility() {
        if (isPasswordVisible) {
            passwordHiddenState();
        } else {
            passwordShownState();
        }
    }

    public enum PasswordShowOption {
        ALWAYS_HIDDEN,
        DEFAULT_SHOW,
        DEFAULT_HIDE;

        public static PasswordShowOption fromString(String optionAsString) {
            switch (optionAsString) {
                case "always_hidden":
                    return ALWAYS_HIDDEN;
                case "default_show":
                    return DEFAULT_SHOW;
                case "default_hide":
                    return DEFAULT_HIDE;
                default:
                    return ALWAYS_HIDDEN;
            }
        }
    }

}


text:
<?php
/**
 * YiiDebugToolbarPanelViews class file.
 *
 * @author Sergey Malyshev <malyshev.php@gmail.com>
 */

Yii::import('yii-debug-toolbar.YiiDebugViewRenderer');

/**
 * YiiDebugToolbarPanelViews represents an ...
 *
 * Description of YiiDebugToolbarPanelViews
 *
 * @author Sergey Malyshev <malyshev.php@gmail.com>
 * @version $Id$
 * @package
 * @since 1.1.7
 */
class YiiDebugToolbarPanelViews extends YiiDebugToolbarPanel
{
	public $i = 'l';

    private $_viewsCount = 0;

    private $_viewRenderer;

    public function getViewsCount()
    {
        return count($this->_viewRenderer->debugStackTrace);
    }

    public function init()
    {
        parent::init();
        $this->_viewRenderer = Yii::app()->getComponent('viewRenderer');
    }

    public function run()
    {
        $data = array();
        $viewRenderer = $this->_viewRenderer;

        if ($viewRenderer instanceof YiiDebugViewRenderer) {
            $data = $this->_viewRenderer->debugStackTrace;
        }

        $this->render('views', array('data'=>$data));
    }

    public function getInheritance(ReflectionClass $class)
    {
        $data = array();

        while($class = $class->getParentClass())
        {
            $data[] = $class->name;
            if('CBaseController' === $class->name)
                break;
        }

        return implode(' » ', $data);
    }

    public function getFilePath($file)
    {
        return trim(str_replace(Yii::getPathOfAlias('webroot'), '', $file), '\\/');
    }

    public function getFileAlias($file)
    {
        return str_replace(DIRECTORY_SEPARATOR, '.',
                dirname(trim(str_replace(Yii::getPathOfAlias('webroot'), '', $file), '\\/')) . '/'
                . basename(trim(str_replace(Yii::getPathOfAlias('webroot'), '', $file), '\\/'), '.php'));
    }

    public function getWidgetsData()
    {

    }

     /**
     * {@inheritdoc}
     */
    public function getMenuTitle()
    {
        return YiiDebug::t('Views Rendering');
    }

    /**
     * {@inheritdoc}
     */
    public function getMenuSubTitle()
    {
        return $this->viewsCount;
    }

    /**
     * {@inheritdoc}
     */
    public function getTitle()
    {
        return YiiDebug::t('Views Rendering');
    }

    /**
     * {@inheritdoc}
     */
    public function getSubTitle()
    {
        return false;
    }
}


text:
package Nov2020Leetcode;

public class _0191NumberOf1Bits {

	public static void main(String[] args) {
		System.out.println(hammingWeight(00000000000000000000000000001011));
		System.out.println(hammingWeight(00000000000000000000000010000000));
		//System.out.println(hammingWeight(11111111111111111111111111111101));
	}

	public static int hammingWeight(int n) {
		String str = Integer.toBinaryString(n);
		int count = 0;
		for (int i = 0; i < str.length(); i++) {
			count += str.charAt(i) == '1' ? 1 : 0;
		}
		return count;
	}
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Syn. pl. 2(2):303. 1807

#### Original name
null

### Remarks
null


text:
/*
 1 - Gallery with custom transitions. The full list of available transition you can check here: http://sachinchoolur.github.io/lightGallery/demos/transitions.html
 2 - Type of easing to be used for css animations
 3 - Type of easing to be used for jquery animations
 4 - Transition duration (in ms).
 5 - Height of the gallery. ex: '100%' , '300px'
 6 - Width of the gallery. ex: '100%' , '300px'
 7 - Add custom class for gallery, can be used to set different style for different gallery
 8 - Starting animation class for the gallery.
 9 - Lightgallery backdrop transtion duration. Do not change the value of backdrop via css.
 10 - Delay for hiding gallery controls in ms
 11 - force lightgallery to use css left property instead of transform.
 12 - allows clicks on dimmer to close gallery.
 13 - If false, will disable the ability to loop back to the beginning of the gallery when on the last element.
 14 - Whether the LightGallery could be closed by pressing the "Esc" key.
 15 - Enable keyboard navigation
 16 - If false, prev/next buttons will not be displayed.
 17 - Enable slideEnd animation
 18 - If true, prev/next button will be hidden on first/last image.
 19 - Chane slide on mousewheel
 20 - You can specify where the sub-html should be appended. '.lg-sub-html' or '.lg-item'
 21 - number of preload slides. will exicute only after the current slide is fully loaded.
 ex:// you clicked on 4th image and if preload = 1 then 3rd slide and 5th slide will be loaded in the background after the 4th slide is fully loaded..
 if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded
 22 - Show Content once it is fully loaded
 23 - Custom selector property instead of just child. pass this to select same element ex : .class #id
 24 - custom html for next control
 25 - custom html for prev control
 26 - Allows to set which image/video should load initially
 27 - Set maximum width for iframe.
 28 - Enable download button. By default download url will be taken from data-src/href attribute but it supports only for modern browsers.
 If you want you can provide another url for download via data-download-url
 29 - Whether to show total number of images and index number of currently displayed image.
 30 - Where the counter should be appended
 31 - By setting the swipeThreshold (in px) you can set how far the user must swipe for the next/prev image.
 32 - Enables desktop mouse drag support
 33 - Enables touch support
 34 - LightGallery can be instantiated and launched programmatically by setting this option to true and populating dynamicEl option (see below) with the definitions of images.

 ===

 1a - Enable thumbnails for the gallery
 2a - Enable thumbnail animation.
 3a - Position of selected thumbnail. 'left' or 'middle' or 'right'
 4a - Width of each thumbnails.
 5a - Height of the thumbnail container including padding and border
 6a - Spacing between each thumbnails
 7a - Whether to display thumbnail toggle button.
 8a - Enables desktop mouse drag support for thumbnails.
 9a - Enables thumbnail touch/swipe support for touch devices
 10a - You can automatically load thumbnails for youtube videos from youtube by setting loadYoutubeThumbnail true
 11a - You can specify the thumbnail size by setting respective number.
 0 - 480x360 pixels -> Player Background Thumbnail
 1 - 120x90 pixels -> Start Thumbnail
 2 - 120x90 pixels -> Middle Thumbnail
 3 - 120x90 pixels -> End Thumbnail
 hqdefault - 480x360 pixels -> High Quality Thumbnail
 mqdefault - 320x180 pixels -> Medium Quality Thumbnail
 default - 120x90 pixels -> Normal Quality Thumbnail
 sddefault - 640x480 pixels -> Standard Definition Thumbnail
 maxresdefault - 1920x1080 pixels -> Maximum Resolution Thumbnail

 -- sddefault and maxresdefault are optional. which may or may not exist. --
 12a - You can automatically load thumbnails for vimeo videos from vimeo by setting loadYoutubeThumbnail true.
 13a - Thumbnail size for vimeo videos: 'thumbnail_large' or 'thumbnail_medium' or 'thumbnail_small'
 thumbnail_small - 100x75 pixels -> Samll size Thumbnail
 thumbnail_medium - 200x150 pixels -> Medium size Thumbnail
 thumbnail_large - 640x360 pixels -> Large size Thumbnail
 14a - You can automatically load thumbnails for dailymotion videos from dailymotion by setting loadYoutubeThumbnail true.

 ===

 1b - Enable gallery autoplay
 2b - The time (in ms) between each auto transition.
 3b - Enable autoplay progress bar
 4b - If false autoplay will be stopped after first user action
 5b - Show/hide autoplay controls.
 6b - Where the autoply controls should be appended.

 ===

 1c - Set limit for video maximal width.

 ===

 1d - Enable/Disable fullscreen mode

 ===

 1e - Enable/Disable zoom option
 2e - Value of zoom should be incremented/decremented
 3e - Some css styles will be added to the images if zoom is enabled. So it might conflict if you add some custom styles to the images such as the initial transition
 while opening the gallery. So you can delay adding zoom related styles to the images by changing the value of enableZoomAfter.

 ===

 HTML markup ex.

 ===

 For more info follow this url: http://sachinchoolur.github.io/lightGallery/

 */

(function ($) {
    "use strict";

    function validatedata($attr, $defaultValue) {
        "use strict";
        if ($attr !== undefined) {
            return $attr
        }
        return $defaultValue;
    }

    function parseBoolean(str, $defaultValue) {
        "use strict";
        if (str == 'true') {
            return true;
        } else if (str == "false") {
            return false;
        }
        return $defaultValue;
    }

    $(document).on('ready', function(){
        if ($().lightGallery){
            if ($('._js-lightGallery').length > 0){
                var $lightGallery = $('._js-lightGallery');
                $lightGallery.each(function(){
                    var $this = $(this);

                    // Lightgallery core

                    var _mode = validatedata($this.attr("data-mode"), 'lg-slide'), // *1
                        _cssEasing = validatedata($this.attr("data-cssEasing"), 'ease'), // *2
                        _jQueryEasing = validatedata($this.attr("data-jqEasing"), 'linear'), // *3
                        _speed = parseInt(validatedata($this.attr("data-speed"), 600), 0), // *4
                        _height = validatedata($this.attr("data-height"), '100%'), // *5
                        _width = validatedata($this.attr('data-width'), '100%'), // *6
                        _addClass = validatedata($this.attr('data-class'), ''), // *7
                        _startClass = validatedata($this.attr('data-startClass'), 'lg-start-zoom'), // *8
                        _backdropDuration = parseInt(validatedata($this.attr("data-backdropDuration"), 150), 0), // *9
                        _hideBarsDelay = parseInt(validatedata($this.attr("data-hideBarsDelay"), 6000), 0), // *10
                        _useLeft = parseBoolean($this.attr("data-useLeft"), false), // *11
                        _closable = parseBoolean($this.attr("data-closable"), true), // *12
                        _loop = parseBoolean($this.attr("data-loop"), true), // *13
                        _escKey = parseBoolean($this.attr("data-escKey"), true), // *14
                        _keyPress = parseBoolean($this.attr("data-keyPress"), true), // *15
                        _controls = parseBoolean($this.attr("data-controls"), true), // *16
                        _slideEndAnimatoin = parseBoolean($this.attr("data-slideEndAnimation"), true), // *17
                        _hideControlOnEnd = parseBoolean($this.attr("data-controlsStartEnd"), false), // *18
                        _mousewheel = parseBoolean($this.attr("data-mousewheel"), true), // *19
                        _appendSubHtmlTo = validatedata($this.attr('data-appendSubHtmlTo'), '.lg-sub-html'), // *20
                        _preload = parseInt(validatedata($this.attr("data-preload"), 1), 0), // *21
                        _showAfterLoad = parseBoolean($this.attr("data-showAfterLoad"), true), // *22
                        _selector = validatedata($this.attr('data-selector'), ''), // *23
                        _nextHTML = validatedata($this.attr('data-nextHTML'), ''), // *24
                        _prevHTML = validatedata($this.attr('data-prevHTML'), ''), // *25
                        _index = parseInt(validatedata($this.attr("data-index"), 0), 0), // *26
                        _iframeMaxWidth = validatedata($this.attr('data-iframeMaxWidth'), '100%'), // *27
                        _download = parseBoolean($this.attr("data-download"), true), // *28
                        _counter = parseBoolean($this.attr("data-counter"), true), // *29
                        _appendCounterTo = validatedata($this.attr('data-appendCounterTo'), '.lg-toolbar'), // *30
                        _swipeThreshold = parseInt(validatedata($this.attr("data-swipeThreshold"), 50), 0), // *31
                        _enableDrag = parseBoolean($this.attr("data-drag"), true), // *32
                        _enableTouch = parseBoolean($this.attr("data-touch"), true), // *33
                        _dynamic = parseBoolean($this.attr("data-dynamic"), false); // *34

                    // Thumbnail plugin

                    var _thumbnail = parseBoolean($this.attr("data-thumbnail"), true), // *1a
                        _animateThumb = parseBoolean($this.attr("data-animateThumb"), true), // *2a
                        _currentPagerPosition =  validatedata($this.attr('data-currentPagerPosition'), 'middle'), // *3a
                        _thumbWidth = parseInt(validatedata($this.attr("data-thumbWidth"), 100), 0), // *4a
                        _thumbContHeight = parseInt(validatedata($this.attr("data-thumbContHeight"), 100), 0), // *5a
                        _thumbMargin = parseInt(validatedata($this.attr("data-thumbMargin"), 5), 0), // *6a
                        _toogleThumb = parseBoolean($this.attr("data-toogleThumb"), true), // *7a
                        _enableThumbDrag = parseBoolean($this.attr("data-enableThumbDrag"), true), // *8a
                        _enableThumbSwipe = parseBoolean($this.attr("data-enableThumbSwipe"), true), // *9a
                        _loadYoutubeThumbnail = parseBoolean($this.attr("data-loadYoutubeThumbnail"), true),// *10a,
                        _youtubeThumbSize = parseInt(validatedata($this.attr("data-youtubeThumbSize"), 1), 0),// *11a,
                        _loadVimeoThumbnail = parseBoolean($this.attr("data-loadVimeoThumbnail"), true), // *12a
                        _vimeoThumbSize = validatedata($this.attr('data-vimeoThumbSize'), 'thumbnail_small'), // *13a
                        _loadDailymotionThumbnail = parseBoolean($this.attr("data-loadDailymotionThumbnail"), true); // *14a

                    // Autoplay plugin

                    var _autoplay = parseBoolean($this.attr("data-autoplay"), true), // *1b
                        _pause = parseInt(validatedata($this.attr("data-pause"), 5000), 0),// *2b
                        _progressBar = parseBoolean($this.attr("data-progressBar"), true), // *3b
                        _fourceAutoplay = parseBoolean($this.attr("data-fourceAutoplay"), false), // *4b
                        _autoplayControls = parseBoolean($this.attr("data-autoplayControls"), true), // *5b
                        _appendAutoplayControlsTo = validatedata($this.attr('data-appendAutoplayControlsTo'), '.lg-toolbar'); // *6b

                    // Video plugin

                    var _videoMaxWidth = validatedata($this.attr('data-videoMaxWidth'), '855'); // *1c

                    // Fullscreen plugin

                    var _fullScreen = parseBoolean($this.attr("data-fullScreen"), true); // *1d

                    // Zoom plugin

                    var _zoom = parseBoolean($this.attr("data-zoom"), true), // *1e
                        _scale = parseInt(validatedata($this.attr("data-scale"), 1), 0),// *2e
                        _enableZoomAfter = parseInt(validatedata($this.attr("data-enableZoomAfter"), 50), 0);// *3e

                    // Hash plugin

                    var _hash = parseBoolean($this.attr("data-hash"), false), // *1f
                        _galleryId = parseInt(validatedata($this.attr("data-galleryId"), 1), 0);// *3e

                    // Attributes

                    // Light Gallery init with default options

                    $this.lightGallery({
                        mode: _mode,
                        cssEasing : _cssEasing,
                        easing: _jQueryEasing,
                        speed: _speed,
                        height: _height,
                        width: _width,
                        addClass: _addClass,
                        startClass: _startClass,
                        backdropDuration: _backdropDuration,
                        hideBarsDelay: _hideBarsDelay,
                        useLeft: _useLeft,
                        closable: _closable,
                        loop: _loop,
                        escKey: _escKey,
                        keyPress: _keyPress,
                        controls: _controls,
                        slideEndAnimatoin: _slideEndAnimatoin,
                        hideControlOnEnd: _hideControlOnEnd,
                        mousewheel: _mousewheel,
                        appendSubHtmlTo: _appendSubHtmlTo,
                        preload: _preload,
                        showAfterLoad: _showAfterLoad,
                        selector: _selector,
                        nextHTML: _nextHTML,
                        prevHTML: _prevHTML,
                        index: _index,
                        iframeMaxWidth: _iframeMaxWidth,
                        download: _download,
                        counter: _counter,
                        appendCounterTo: _appendCounterTo,
                        swipeThreshold: _swipeThreshold,
                        enableDrag: _enableDrag,
                        enableTouch: _enableTouch,
                        dynamic: _dynamic,
                        thumbnail: _thumbnail,
                        animateThumb: _animateThumb,
                        currentPagerPosition: _currentPagerPosition,
                        thumbWidth: _thumbWidth,
                        thumbContHeight: _thumbContHeight,
                        thumbMargin: _thumbMargin,
                        toogleThumb: _toogleThumb,
                        enableThumbDrag: _enableThumbDrag,
                        enableThumbSwipe: _enableThumbSwipe,
                        loadYoutubeThumbnail: _loadYoutubeThumbnail,
                        youtubeThumbSize: _youtubeThumbSize,
                        loadVimeoThumbnail: _loadVimeoThumbnail,
                        vimeoThumbSize: _vimeoThumbSize,
                        loadDailymotionThumbnail: _loadDailymotionThumbnail,
                        autoplay: _autoplay,
                        pause: _pause,
                        progressBar: _progressBar,
                        fourceAutoplay: _fourceAutoplay,
                        autoplayControls: _autoplayControls,
                        appendAutoplayControlsTo: _appendAutoplayControlsTo,
                        videoMaxWidth: _videoMaxWidth,
                        fullScreen: _fullScreen,
                        zoom: _zoom,
                        scale: _scale,
                        enableZoomAfter: _enableZoomAfter,
                        hash: _hash,
                        galleryId: _galleryId
                    });
                });
            }
        }
    });

}(jQuery));


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Projection;
using Microsoft.VisualStudio.Utilities;

namespace Roslyn.Hosting.Diagnostics.VenusMargin
{
    [Export(typeof(IWpfTextViewMarginProvider))]
    [Name(VenusMargin.MarginName)]
    [Order(After = PredefinedMarginNames.BottomControl)]
    [Order(After = "TagNavigatorMargin")]
    [MarginContainer(PredefinedMarginNames.Bottom)]
    [ContentType("text")]
    [TextViewRole(PredefinedTextViewRoles.Interactive)]
    internal sealed class MarginFactory : IWpfTextViewMarginProvider
    {
        private readonly ITextEditorFactoryService _textEditorFactory;

        [ImportingConstructor]
        [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
        public MarginFactory(ITextEditorFactoryService textEditorFactory)
        {
            _textEditorFactory = textEditorFactory;
        }

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            if (!(textViewHost.TextView.TextBuffer is IProjectionBuffer))
            {
                return null;
            }

            return new VenusMargin(textViewHost.TextView, _textEditorFactory);
        }
    }
}


text:
namespace {

const char kValidUrl[] = "http://www.example.com";
const char kInvalidUrl[] = "invalid.url";

TEST(SessionSyncServiceFactoryTest, ShouldSyncURL) {
  EXPECT_TRUE(
      SessionSyncServiceFactory::ShouldSyncURLForTesting(GURL(kValidUrl)));
  EXPECT_TRUE(SessionSyncServiceFactory::ShouldSyncURLForTesting(
      GURL("other://anything")));
  EXPECT_TRUE(SessionSyncServiceFactory::ShouldSyncURLForTesting(
      GURL("chrome-other://anything")));

  EXPECT_FALSE(
      SessionSyncServiceFactory::ShouldSyncURLForTesting(GURL(kInvalidUrl)));
  EXPECT_FALSE(SessionSyncServiceFactory::ShouldSyncURLForTesting(
      GURL("file://anything")));
  EXPECT_FALSE(SessionSyncServiceFactory::ShouldSyncURLForTesting(
      GURL(chrome::kChromeUIVersionURL)));
  EXPECT_FALSE(SessionSyncServiceFactory::ShouldSyncURLForTesting(
      GURL("chrome-native://anything")));
  EXPECT_FALSE(SessionSyncServiceFactory::ShouldSyncURLForTesting(
      GURL("chrome-distiller://anything")));

  EXPECT_FALSE(SessionSyncServiceFactory::ShouldSyncURLForTesting(
      GURL("chrome-untrusted://anything")));
  EXPECT_TRUE(SessionSyncServiceFactory::ShouldSyncURLForTesting(
      GURL(chrome::kChromeUIHistoryURL)));
}

}  // namespace


text:
public String removeDuplicateLetters(String sr) {

    int[] res = new int[26]; //will contain number of occurences of character (i+'a')
    boolean[] visited = new boolean[26]; //will contain if character (i+'a') is present in current result Stack
    char[] ch = sr.toCharArray();
    for(char c: ch){  //count number of occurences of character
        res[c-'a']++;
    }
    Stack<Character> st = new Stack<>(); // answer stack
    int index;
    for(char s:ch){
        index= s-'a';
        res[index]--;   //decrement number of characters remaining in the string to be analysed
        if(visited[index]) //if character is already present in stack, dont bother
            continue;
        //if current character is smaller than last character in stack which occurs later in the string again
        //it can be removed and  added later e.g stack = bc remaining string abc then a can pop b and then c
        while(!st.isEmpty() && s<st.peek() && res[st.peek()-'a']!=0){
            visited[st.pop()-'a']=false;
        }
        st.push(s); //add current character and mark it as visited
        visited[index]=true;
    }

    StringBuilder sb = new StringBuilder();
    //pop character from stack and build answer string from back
    while(!st.isEmpty()){
        sb.insert(0,st.pop());
    }
    return sb.toString();

    public String removeDuplicateLetters2(String s) {
        int[] cnt = new int[26];
        int pos = 0; // the position for the smallest s[i]
        for (int i = 0; i < s.length(); i++) cnt[s.charAt(i) - 'a']++;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) < s.charAt(pos)) pos = i;
            if (--cnt[s.charAt(i) - 'a'] == 0) break;
        }
        return s.length() == 0 ? "" : s.charAt(pos) + removeDuplicateLetters(s.substring(pos + 1).replaceAll("" + s.charAt(pos), ""));
    }
}


text:
#Requires -Version 3.0
$script:ME_BASE = "MergeEnv_Base"
$script:ME_SOURCE = "MergeEnv_Source"
$script:ME_TARGET = "MergeEnv_Target"
$script:ME_MERGING = "MergeEnv_CurrentlyMerging"
$script:ME_TOOL = "MergeEnv_MergeTool"

#region Helper functions.

function setUserEnvVar ([string]$Name, [string]$Value)
{
  [Environment]::SetEnvironmentVariable($Name, $Value, "User")
}

function getUserEnvVar ([string]$Name)
{
  [Environment]::GetEnvironmentVariable($Name, "User")
}

function msgUserEnvVarSetTo([string]$varName)
{
  "Set user environment variable `"{0}`" to: {1}" -f $varName, $(getUserEnvVar($varName))
}

#endregion

# IMPORT
$modulePath = (Split-Path -parent $MyInvocation.MyCommand.Definition)
. $modulePath\functions\New-MergeFolder.ps1
. $modulePath\functions\Get-MergeEnvironment.ps1
. $modulePath\functions\Clear-MergeTool.ps1
. $modulePath\functions\Set-MergeEnvironment.ps1
. $modulePath\functions\Join-CALTextfiles.ps1

function Clear-MergeEnvironment
{
  setUserEnvVar $script:ME_BASE $null
  setUserEnvVar $script:ME_SOURCE $null
  setUserEnvVar $script:ME_TARGET $null
}

function Set-MergeTool ($Executable)
{
  # The user may only specify a file.
  $null = Test-Path $Executable -PathType Leaf -ErrorAction Stop
  $Executable = Get-Item $Executable
  setUserEnvVar "MergeEnv_MergeTool" $Executable
}

function Start-MergeSession
{
  [CmdletBinding()]
  param(
    $Filename
  )

  # Do not continue if it seems like a merge is currently in process.
  $currentlyMerging = getUserEnvVar $script:ME_MERGING

  if ($currentlyMerging -ne $null)
  {
    if (Test-Path $currentlyMerging)
    {
      Write-Error "You seem to be merging `"$currentlyMerging`" currently. Call Stop-MergeSession before you start a new one."
      return
    }
    else
    {
      setUserEnvVar $script:ME_MERGING $null
    }
  }

  # Check that the file exists in Base and Source folder.
  $basePath = Join-Path -Path (getUserEnvVar $script:ME_BASE) -ChildPath $Filename
  Write-Verbose -Message "Base path: $basePath"
  $sourcePath = Join-Path -Path (getUserEnvVar $script:ME_SOURCE) -ChildPath $Filename
  Write-Verbose -Message "Source path: $sourcePath"
  $baseFile = Get-Item $basePath -ErrorAction Stop
  Write-Verbose -Message "Base file exists: $baseFile"
  $sourceFile = Get-Item $sourcePath -ErrorAction Stop
  Write-Verbose -Message "Source file exists: $sourceFile"

  $outputDir = (getUserEnvVar $script:ME_TARGET)
  $null = Test-Path -Path $outputDir -PathType Container -ErrorAction Stop
  Write-Verbose -Message "Output directory exists: $outputDir"

  Write-Debug "Pre-checks successful."

  $newFileName = "!" + (Split-Path -Path $basePath -Leaf)
  Write-Verbose -Message "New file name: $newFileName"

  $fileToReceiveMerge = Join-Path $outputDir $newFileName
  Write-Verbose -Message "Output path to copy to will be: $fileToReceiveMerge"

  Write-Debug -Message "Next the file will be copied."
  Copy-Item $baseFile $fileToReceiveMerge

  [Environment]::SetEnvironmentVariable("MergeEnv_CurrentlyMerging", $fileToReceiveMerge, "User")

  $mergeTool = [Environment]::GetEnvironmentVariable("MergeEnv_MergeTool", "User")

  Write-Debug -Message "Next the merge tool will be launched."
  & "$mergeTool" $fileToReceiveMerge $sourceFile

}

function Start-RevisionMergeSession
{
  [CmdletBinding()]
  param(
    $Filename
  )

  $sourcePath = Join-Path -Path (getUserEnvVar $script:ME_SOURCE) -ChildPath $Filename
  $sourceFile = Get-Item $sourcePath -ErrorAction Stop

  $mergedPath = Join-Path -Path (getUserEnvVar $script:ME_TARGET) -ChildPath $Filename
  $mergedFile = Get-Item $mergedPath -ErrorAction Stop

  $mergeTool = getUserEnvVar $script:ME_TOOL
  & "$mergeTool" $mergedFile $sourceFile
}

# Idee: "Cancel"-MergeSession

function Stop-MergeSession
{
  [CmdletBinding()]
  param ()

  $currentlyMerging = getUserEnvVar $script:ME_MERGING

  if ($currentlyMerging -eq $null)
  {
    return
  }

  if (-not (Test-Path -Path $currentlyMerging -PathType Leaf))
  {
    return
  }

  $currentlyMerging = Get-Item -Path $currentlyMerging -ErrorAction Stop
  Write-Verbose -Message "Currently merging: $currentlyMerging"

  if (-not ($currentlyMerging.Name -like "!*"))
  {
    return
  }

  $newName = $currentlyMerging.Name.TrimStart("!")
  Write-Verbose -Message "New name: $newName"

  Write-Debug "Pre-checks successful."

  Write-Verbose "Clearing merge marker from file name."
  Rename-Item -Path $currentlyMerging -NewName $newName -ErrorAction Stop

  Write-Debug -Message "Next the environment variable containing the path to the currently merged file will be removed."
  setUserEnvVar $script:ME_MERGING $null

}

New-Alias -Name startms -Value Start-MergeSession
New-Alias -Name sms -Value Start-MergeSession -Description "Start-MergeSession"
New-Alias -Name stopms -Value Stop-MergeSession
New-Alias -Name ems -Value Stop-MergeSession -Description "End-MergeSession; Alternative zu Stop-MergeSession"
New-Alias -Name rev -Value Start-RevisionMergeSession

Export-ModuleMember -Function *Merge* -Alias * -Cmdlet *
Export-ModuleMember -Function Join-CALTextfiles


text:
import { Component, OnInit, Input } from '@angular/core';
import {
    ScanningResultService,
    VulnerabilityItem,
    VulnerabilitySeverity
} from '../service/index';
import { ErrorHandler } from '../error-handler/index';

import { toPromise } from '../utils';
import { GRID_COMPONENT_HTML } from './scanning.html';
import { SCANNING_STYLES } from './scanning.css';

@Component({
    selector: 'hbr-vulnerabilities-grid',
    styles: [SCANNING_STYLES],
    template: GRID_COMPONENT_HTML
})
export class ResultGridComponent implements OnInit {
    scanningResults: VulnerabilityItem[] = [];
    dataCache: VulnerabilityItem[] = [];

    @Input() tagId: string;
    @Input() repositoryId: string;

    constructor(
        private scanningService: ScanningResultService,
        private errorHandler: ErrorHandler
    ) { }

    ngOnInit(): void {
        this.loadResults(this.repositoryId, this.tagId);
    }

    loadResults(repositoryId: string, tagId: string): void {
        toPromise<VulnerabilityItem[]>(this.scanningService.getVulnerabilityScanningResults(repositoryId, tagId))
            .then((results: VulnerabilityItem[]) => {
                this.dataCache = results;
                this.scanningResults = this.dataCache.filter((item: VulnerabilityItem) => item.id !== '');
            })
            .catch(error => { this.errorHandler.error(error) })
    }

    //TODO: Should query from back-end service
    filterVulnerabilities(terms: string): void {
        if (terms.trim() === '') {
            this.scanningResults = this.dataCache.filter((item: VulnerabilityItem) => item.id !== '');
        } else {
            this.scanningResults = this.dataCache.filter((item: VulnerabilityItem) => this._regexpFilter(terms, item.package));
        }
    }

    refresh(): void {
        this.loadResults(this.repositoryId, this.tagId);
    }

    severityText(severity: VulnerabilitySeverity): string {
        switch (severity) {
            case VulnerabilitySeverity.HIGH:
                return 'VULNERABILITY.SEVERITY.HIGH';
            case VulnerabilitySeverity.MEDIUM:
                return 'VULNERABILITY.SEVERITY.MEDIUM';
            case VulnerabilitySeverity.LOW:
                return 'VULNERABILITY.SEVERITY.LOW';
            case VulnerabilitySeverity.NONE:
                return 'VULNERABILITY.SEVERITY.NEGLIGIBLE';
            case VulnerabilitySeverity.UNKNOWN:
                return 'VULNERABILITY.SEVERITY.UNKNOWN';
            default:
                return 'UNKNOWN';
        }
    }

    _regexpFilter(terms: string, testedValue: any): boolean {
        let reg = new RegExp('.*' + terms + '.*', 'i');
        return reg.test(testedValue);
    }
}


text:
import {
  GET_USER_INFO_REQUEST, GET_USER_INFO_SUCCESS, GET_USER_INFO_FAILURE,
  GET_USER_INSURANCE_REQUEST, GET_USER_INSURANCE_SUCCESS,
  GET_USER_INSURANCE_FAILURE, GET_ALL_USER_REMINDERS_REQUEST,
  GET_ALL_USER_REMINDERS_SUCCESS, GET_ALL_USER_REMINDERS_FAILURE,
  GET_USER_CONTACTS_REQUEST, GET_USER_CONTACTS_SUCCESS,
  GET_USER_CONTACTS_FAILURE, DID_INIT
} from '../../patients/actions/action-constants.js';

const initialState = {
  isFetching: false,
  loaded: false,
  init: false,
  user: {},
  e_contacts: {},
  appointment: [],
  healthLog: [],
  insurance: [],
  medication: [],
  patient: [],
  provider: [],
  reminders: []
};

export default function userInfoReducer(state = initialState, action) {
  switch (action.type) {
    case GET_USER_INFO_REQUEST:
			return {
				...state,
				isFetching: true,
				loaded: false,
			}
    case GET_USER_INFO_SUCCESS:
      return {
        ...state,
        isFetching: false,
        loaded: true,
        init: false,
        user: action.user,
        contacts: action.contacts
      }
    case GET_USER_INFO_FAILURE:
      return {
          ...state,
          isFetching: false,
          loaded: false
      }
    case GET_USER_INSURANCE_REQUEST:
			return {
				...state,
				isFetching: true,
				loaded: false
			}
    case GET_USER_INSURANCE_SUCCESS:
      return {
        ...state,
        isFetching: false,
        loaded: true,
        init: false,
        insurance: action.payload
      }
    case GET_USER_INSURANCE_FAILURE:
      return {
          ...state,
          isFetching: false,
          loaded: false,
          err: action.payload
      }
    case GET_ALL_USER_REMINDERS_REQUEST:
			return {
				...state,
				isFetching: true,
				loaded: false
			}
    case GET_ALL_USER_REMINDERS_SUCCESS:
      return {
        ...state,
        isFetching: false,
        loaded: true,
        init: false,
        reminders: action.payload
      }
    case GET_ALL_USER_REMINDERS_FAILURE:
      return {
          ...state,
          isFetching: false,
          loaded: false,
          err: action.payload
      }
    case GET_USER_CONTACTS_REQUEST:
			return {
				...state,
				isFetching: true,
				loaded: false
			}
    case GET_USER_CONTACTS_SUCCESS:
      return {
        ...state,
        isFetching: false,
        loaded: true,
        init: false,
        e_contacts: action.payload
      }
    case GET_USER_CONTACTS_FAILURE:
      return {
          ...state,
          isFetching: false,
          loaded: false
      }
    case DID_INIT:
      return {
          ...state,
          init: action.payload
      }
    default:
      return {...state};
  }
};


text:
from IHM.tkinter_IHM import *

init_IHM()


text:
<!doctype html>

    <title>WebGL Demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="../webgl.css" type="text/css">

    <canvas id="glcanvas">
      Your browser doesn't appear to support the <canvas> element.
    </canvas>


text:
package com.sap.hcp.cf.logging.common.converter;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

import java.io.IOException;
import java.util.Arrays;

import org.junit.Test;
import org.slf4j.MDC;

import com.fasterxml.jackson.jr.ob.JSONObjectException;

public class TestContextPropsConverter extends AbstractConverterTest {

    @Test
    public void testEmpty() throws JSONObjectException, IOException {
        DefaultPropertiesConverter cpc = new DefaultPropertiesConverter();
        MDC.clear();
        assertThat(mapFrom(formatProps(cpc)), is(mdcMap()));
    }

    @Test
    public void testSingleArg() throws JSONObjectException, IOException {
        DefaultPropertiesConverter cpc = new DefaultPropertiesConverter();
        MDC.clear();
        MDC.put(SOME_KEY, SOME_VALUE);
        assertThat(mapFrom(formatProps(cpc)), is(mdcMap()));
    }

    @Test
    public void testTwoArgs() throws JSONObjectException, IOException {
        DefaultPropertiesConverter cpc = new DefaultPropertiesConverter();
        MDC.clear();
        MDC.put(SOME_KEY, SOME_VALUE);
        MDC.put(SOME_OTHER_KEY, SOME_OTHER_VALUE);
        assertThat(mapFrom(formatProps(cpc)), is(mdcMap()));
    }

    @Test
    public void testStrangeArgs() throws JSONObjectException, IOException {
        DefaultPropertiesConverter cpc = new DefaultPropertiesConverter();
        MDC.clear();
        MDC.put(SOME_KEY, SOME_VALUE);
        MDC.put(STRANGE_SEQ, STRANGE_SEQ);
        assertThat(mapFrom(formatProps(cpc)), is(mdcMap()));
    }

    @Test
    public void testExclusion() throws JSONObjectException, IOException {
        DefaultPropertiesConverter cpc = new DefaultPropertiesConverter();
        String[] exclusions = new String[] { SOME_KEY };
        cpc.setExclusions(Arrays.asList(exclusions));
        MDC.clear();
        MDC.put(SOME_KEY, SOME_VALUE);
        MDC.put(SOME_OTHER_KEY, SOME_OTHER_VALUE);
        assertThat(mapFrom(formatProps(cpc)), is(mdcMap(exclusions)));
    }

    @Test
    public void testExclusionStrangeSeq() throws JSONObjectException, IOException {
        DefaultPropertiesConverter cpc = new DefaultPropertiesConverter();
        String[] exclusions = new String[] { STRANGE_SEQ };
        cpc.setExclusions(Arrays.asList(exclusions));
        MDC.clear();
        MDC.put(SOME_KEY, SOME_VALUE);
        MDC.put(STRANGE_SEQ, STRANGE_SEQ);
        assertThat(mapFrom(formatProps(cpc)), is(mdcMap(exclusions)));
    }
}


text:
import axios from 'axios'
import { IPayloadDevice, IPayloadUserInfo } from '../../common/types'
import { getCsrfToken } from '../lib/getCsrfToken'
import {
  Action,
  CREATE_DEVICE,
  DELETE_DEVICE,
  UPDATE_DEVICE,
  UPDATE_USER,
} from '../store/actionTypes'

export function updateUser () {
  return async (dispatch) => {
    try {
      const { data: { payload } } = await axios.post('/api/user', { _csrf: getCsrfToken() })
      const action: Action<IPayloadUserInfo> = {
        type: UPDATE_USER,
        payload: {
          isLoggedIn: payload.isLoggedIn,
          userId: payload.userId,
        },
      }
      dispatch(action)
    } catch (error) {
      const action: Action<IPayloadUserInfo> = {
        type: UPDATE_USER,
        payload: { isLoading: false },
        error,
      }
      dispatch(action)
    }
  }
}

export function getUserDevices () {
  return async (dispatch) => {
    dispatch({ type: UPDATE_USER, payload: { isLoading: true } })
    try {
      const { data: { payload } } = await axios.post('/api/user/devices', { _csrf: getCsrfToken() })
      const action: Action<IPayloadUserInfo> = {
        type: UPDATE_USER,
        payload: {
          isLoading: false,
          devices: payload,
        }
      }
      dispatch(action)
    } catch (error) {
      const action: Action<IPayloadUserInfo> = {
        type: UPDATE_USER,
        payload: { isLoading: false },
        error,
      }
      dispatch(action)
    }
  }
}

export function getDevice (id: string) {
  return async (dispatch) => {
    dispatch({ type: UPDATE_DEVICE, payload: { isLoading: true } })
    try {
      const { data: { payload } } = await axios.post(`/api/device/${id}`, {
        _csrf: getCsrfToken()
      })

      const action: Action<IPayloadDevice> = {
        type: UPDATE_DEVICE,
        payload: {
          isLoading: false,
          id: payload.id,
          displayName: payload.meta.displayName,
        }
      }
      dispatch(action)
    } catch (error) {
      const action: Action<IPayloadDevice> = {
        type: UPDATE_DEVICE,
        payload: { isLoading: false },
        error,
      }
      dispatch(action)
    }
  }
}

export function handleDeviceChange (key, value): Action<IPayloadDevice> {
  return {
    type: UPDATE_DEVICE,
    payload: {
      [key]: value
    }
  }
}

export function deleteDevice (id) {
  return async (dispatch) => {
    dispatch({ type: UPDATE_DEVICE, payload: { isLoading: true } })
    try {
      await axios.delete(`/api/device`, { data: { id, _csrf: getCsrfToken(), } })
      const action: Action<IPayloadDevice> = {
        type: DELETE_DEVICE,
        payload: {
          isLoading: false,
          id: null,
          displayName: null,
        },
      }
      dispatch(action)
    } catch (error) {
      const action: Action<IPayloadDevice> = {
        type: DELETE_DEVICE,
        payload: { isLoading: false },
        error,
      }
      dispatch(action)
    }
  }
}

export function createDevice () {
  return async (dispatch) => {
    dispatch({ type: UPDATE_DEVICE, payload: { isLoading: true } })
    try {
      const { data: { payload } } = await axios.post(`/api/device`, {
        _csrf: getCsrfToken(),
      })

      const action: Action<IPayloadDevice> = {
        type: CREATE_DEVICE,
        payload: {
          isLoading: false,
          id: payload.id,
          displayName: payload.meta.displayName,
        },
      }
      dispatch(action)
    } catch (error) {
      const action: Action<IPayloadDevice> = {
        type: CREATE_DEVICE,
        payload: { isLoading: false },
        error,
      }
      dispatch(action)
    }
  }
}

export function saveDevice (payload) {
  return async (dispatch) => {
    dispatch({ type: UPDATE_DEVICE, payload: { isLoading: true } })
    try {
      const { data } = await axios.post(`/api/device/${payload.id}/edit`, {
        _csrf: getCsrfToken(),
        displayName: payload.displayName,
      })

      const action: Action<IPayloadDevice> = {
        type: UPDATE_DEVICE,
        payload: {
          isLoading: false,
          id: data.payload.id,
          displayName: data.payload.meta.displayName,
        },
      }
      dispatch(action)
    } catch (error) {
      const action: Action<IPayloadDevice> = {
        type: UPDATE_DEVICE,
        payload: { isLoading: false },
        error,
      }
      dispatch(action)
    }
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <include layout="@layout/title_historydetail" />

    <TextView
        android:id="@+id/tv_faq_1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"

        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:textSize="18sp"
        android:text="@string/str_faq_q_1"
        android:textColor="@color/blue"
        android:textStyle="bold|italic"
        android:background="@color/gainsboro"
        />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:singleLine="false"
        android:textSize="12sp"
        android:gravity="center_vertical"
        android:text="@string/str_faq_a_1"
        />

    <TextView
        android:id="@+id/tv_faq_2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
         android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:textSize="18sp"
        android:text="@string/str_faq_q_2"
        android:textColor="@color/blue"
        android:textStyle="bold|italic"
        android:background="@color/gainsboro"
        />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:singleLine="false"
        android:textSize="12sp"
        android:gravity="center_vertical"
        android:text="@string/str_faq_a_2"
        />

    <TextView
        android:id="@+id/tv_faq_3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
         android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:textSize="18sp"
        android:text="@string/str_faq_q_3"
        android:textColor="@color/blue"
        android:textStyle="bold|italic"
        android:background="@color/gainsboro"
        />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:singleLine="false"
        android:textSize="12sp"
        android:gravity="center_vertical"
        android:text="@string/str_faq_a_3"
        />

</LinearLayout>


text:
package com.taobao.weex.common;

import com.taobao.weex.WXEnvironment;

import java.util.Map;

public class WXPerformance {

  public static final String DEFAULT = "default";

  /**
   * Business unit, mandatory. If no business unit can be provided, set the field as default
   */
  public String bizType = "weex";

  /**
   * URL used for rendering view, optional
   */
  public String templateUrl;

  /**
   * Time spent for reading, time unit is ms.
   */
  public double localReadTime;

  /**
   * Name of the page
   */
  public String pageName = DEFAULT;

  /**
   * Size of JavaScript framework, the unit is KB
   */
  public double JSLibSize;

  /**
   * Time of initial JavaScript library
   */
  public long JSLibInitTime;

  /**
   * Size of JavaScript template
   */
  public double JSTemplateSize;

  public long templateLoadTime;

  /**
   * Time used for
   * {@link com.taobao.weex.bridge.WXBridgeManager#createInstance(String, String, Map, String)}
   */
  public double communicateTime;

  /**
   * Time spent when rendering first screen
   */
  public double screenRenderTime;

  /**
   * Time spent, the unit is micro second
   */
  public double totalTime;

  /**
   * load bundle js time, unite ms
   */
  public long networkTime;

  /**
   * Version of JavaScript libraray
   */
  public String JSLibVersion = WXEnvironment.JS_LIB_SDK_VERSION;

  /**
   * Version of Weex SDK
   */
  public String WXSDKVersion = WXEnvironment.WXSDK_VERSION;

  /**
   * The detail message of render failure
   */
  public String renderFailedDetail;

  /**
   * Error code
   */
  public String errCode;

  /**
   * Error message
   */
  public String errMsg;

  @Override
  public String toString() {
    if (WXEnvironment.isApkDebugable()) {
      return "bizType:" + bizType + ",pageName:" + pageName + ",templateLoadTime" + templateLoadTime
             + ",localReadTime:" + localReadTime + ",JSLibInitTime:" + JSLibInitTime
             + ",JSLibSize:" + JSLibSize + ",templateUrl" + templateUrl
             + ",JSTemplateSize:" + JSTemplateSize + ",communicateTime:" + communicateTime
             + ",screenRenderTime:" + screenRenderTime
             + ",totalTime:" + totalTime + ",JSLibVersion:" + JSLibVersion + ",WXSDKVersion:" + WXSDKVersion
             + ",errCode:" + errCode + ",renderFailedDetail:" + renderFailedDetail
             + ",errMsg:" + errMsg;
    }
    return super.toString();
  }
}


text:
/**
 * Created by MIC on 2016/6/11.
 */

import ErrorBase from "../../mic/ErrorBase";

export default class EOFError extends ErrorBase {

    constructor(message: string = "") {
        super(message);
    }

    get name(): string {
        return "EOFError";
    }

}


text:
package org.codehaus.groovy.classgen.asm;

import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.expr.Expression;

/**
 * Interface for modules which are capable of resolving the type of an expression.
 * Several implementations are available, depending on whether you are in a dynamic
 * or static compilation mode.
 *
 * @author Cedric Champeau
 */
public interface TypeChooser {

    /**
     * Resolve the type of an expression. Depending on the implementations, the
     * returned type may be the declared type or an inferred type.
     * @param expression the expression for which the type must be returned.
     * @param classNode the classnode this expression belongs to
     * @return the resolved type.
     */
    ClassNode resolveType(final Expression expression, ClassNode classNode);

}


text:
<?php

require_once 'Zend/Gdata/Photos.php';
require_once 'Zend/Gdata/Photos/CommentEntry.php';
require_once 'Zend/Http/Client.php';
require_once 'Zend/Http/Client/Adapter/Test.php';

/**
 * @category   Zend
 * @package    Zend_Gdata_Photos
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @group      Zend_Gdata
 * @group      Zend_Gdata_Photos
 */
class Zend_Gdata_Photos_PhotosCommentEntryTest extends PHPUnit_Framework_TestCase
{

    protected $commentEntry = null;

    /**
      * Called before each test to setup any fixtures.
      */
    public function setUp()
    {
        $commentEntryText = file_get_contents(
                '_files/TestCommentEntry.xml',
                true);
        $this->commentEntry = new Zend_Gdata_Photos_CommentEntry($commentEntryText);
    }

    /**
      * Verify that a given property is set to a specific value
      * and that the getter and magic variable return the same value.
      *
      * @param object $obj The object to be interrogated.
      * @param string $name The name of the property to be verified.
      * @param object $value The expected value of the property.
      */
    protected function verifyProperty($obj, $name, $value)
    {
        $propName = $name;
        $propGetter = "get" . ucfirst($name);

        $this->assertEquals($obj->$propGetter(), $obj->$propName);
        $this->assertEquals($value, $obj->$propGetter());
    }

    /**
      * Verify that a given property is set to a specific value
      * and that the getter and magic variable return the same value.
      *
      * @param object $obj The object to be interrogated.
      * @param string $name The name of the property to be verified.
      * @param string $secondName 2nd level accessor function name
      * @param object $value The expected value of the property.
      */
    protected function verifyProperty2($obj, $name, $secondName, $value)
    {
        $propName = $name;
        $propGetter = "get" . ucfirst($name);
        $secondGetter = "get" . ucfirst($secondName);

        $this->assertEquals($obj->$propGetter(), $obj->$propName);
        $this->assertEquals($value, $obj->$propGetter()->$secondGetter());
    }

    /**
      * Verify that a given property is set to a specific value,
      * that it keeps that value when set using the setter,
      * and that the getter and magic variable return the same value.
      *
      * @param object $obj The object to be interrogated.
      * @param string $name The name of the property to be verified.
      * @param string $secondName 2nd level accessor function name
      * @param object $value The expected value of the property.
      */
    protected function verifyProperty3($obj, $name, $secondName, $value)
    {
        $propName = $name;
        $propGetter = "get" . ucfirst($name);
        $propSetter = "set" . ucfirst($name);
        $secondGetter = "get" . ucfirst($secondName);
        $secondSetter = "set" . ucfirst($secondName);

        $this->assertEquals($obj->$propGetter(), $obj->$propName);
        $obj->$propSetter($obj->$propName);
        $this->assertEquals($value, $obj->$propGetter()->$secondGetter());
    }

    /**
      * Check for the existence of an <atom:id> and verify that it contains
      * the expected value.
      */
    public function testId()
    {
        $entry = $this->commentEntry;

        // Assert that the entry's ID is correct
        $this->assertTrue($entry->getId() instanceof Zend_Gdata_App_Extension_Id);
        $this->verifyProperty2($entry, "id", "text",
                "http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/100/commentid/5");
    }

    /**
      * Check for the existence of an <atom:author> and verify that they
      * contain the expected values.
      */
    public function testAuthor()
    {
        $entry = $this->commentEntry;

        // Assert that the entry's author is correct
        $entryAuthor = $entry->getAuthor();
        $this->assertEquals($entryAuthor, $entry->author);
        $this->assertEquals(1, count($entryAuthor));
        $this->assertTrue($entryAuthor[0] instanceof Zend_Gdata_App_Extension_Author);
        $this->verifyProperty2($entryAuthor[0], "name", "text", "sample");
        $this->assertTrue($entryAuthor[0]->getUri() instanceof Zend_Gdata_App_Extension_Uri);
        $this->verifyProperty2($entryAuthor[0], "uri", "text", "http://picasaweb.google.com/sample.user");
    }

    /**
      * Check for the existence of an <atom:published> and verify that it contains
      * the expected value.
      */
    public function testPublished()
    {
        $entry = $this->commentEntry;

        // Assert that the photo entry has an Atom Published object
        $this->assertTrue($entry->getPublished() instanceof Zend_Gdata_App_Extension_Published);
        $this->verifyProperty2($entry, "published", "text", "2007-09-21T18:22:53.000Z");
    }

    /**
      * Check for the existence of an <atom:updated> and verify that it contains
      * the expected value.
      */
    public function testUpdated()
    {
        $entry = $this->commentEntry;

        // Assert that the entry's updated date is correct
        $this->assertTrue($entry->getUpdated() instanceof Zend_Gdata_App_Extension_Updated);
        $this->verifyProperty2($entry, "updated", "text",
                "2007-09-21T18:22:53.000Z");
    }

    /**
      * Check for the existence of an <atom:title> and verify that it contains
      * the expected value.
      */
    public function testTitle()
    {
        $entry = $this->commentEntry;

        // Assert that the entry's title is correct
        $this->assertTrue($entry->getTitle() instanceof Zend_Gdata_App_Extension_Title);
        $this->verifyProperty2($entry, "title", "text", "sample");
    }

    /**
      * Check for the existence of an <atom:content> and verify that it contains
      * the expected value.
      */
    public function testContent()
    {
        $entry = $this->commentEntry;

        // Assert that the entry's title is correct
        $this->assertTrue($entry->getContent() instanceof Zend_Gdata_App_Extension_Content);
        $this->verifyProperty2($entry, "content", "text", "test comment");
    }

    /**
      * Check for the existence of an <gphoto:id> and verify that it contains
      * the expected value.
      */
    public function testGphotoId()
    {
        $entry = $this->commentEntry;

        // Assert that the entry's title is correct
        $this->assertTrue($entry->getGphotoId() instanceof Zend_Gdata_Photos_Extension_Id);
        $this->verifyProperty2($entry, "gphotoId", "text",
                "5");
        $this->verifyProperty3($entry, "gphotoId", "text",
                "5");
    }

    /**
      * Check for the existence of an <gphoto:photoid> and verify that it contains
      * the expected value.
      */
    public function testGphotoPhotoId()
    {
        $entry = $this->commentEntry;

        // Assert that the entry's title is correct
        $this->assertTrue($entry->getGphotoPhotoId() instanceof Zend_Gdata_Photos_Extension_PhotoId);
        $this->verifyProperty2($entry, "gphotoPhotoId", "text",
                "100");
        $this->verifyProperty3($entry, "gphotoPhotoId", "text",
                "100");
    }

}


text:
#ifndef WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_
#define WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_

#include <string>

#include "webrtc/common_types.h"
#include "webrtc/frame_callback.h"
#include "webrtc/modules/remote_bitrate_estimator/rate_statistics.h"
#include "webrtc/system_wrappers/interface/thread_annotations.h"
#include "webrtc/video_engine/include/vie_codec.h"
#include "webrtc/video_engine/include/vie_rtp_rtcp.h"
#include "webrtc/video_receive_stream.h"
#include "webrtc/video_renderer.h"

namespace webrtc {

class Clock;
class CriticalSectionWrapper;
class ViECodec;
class ViEDecoderObserver;

namespace internal {

class ReceiveStatisticsProxy : public ViEDecoderObserver,
                               public RtcpStatisticsCallback,
                               public StreamDataCountersCallback {
 public:
  ReceiveStatisticsProxy(uint32_t ssrc,
                         Clock* clock,
                         ViERTP_RTCP* rtp_rtcp,
                         ViECodec* codec,
                         int channel);
  virtual ~ReceiveStatisticsProxy();

  VideoReceiveStream::Stats GetStats() const;

  void OnDecodedFrame();
  void OnRenderedFrame();

  // Overrides ViEDecoderObserver.
  virtual void IncomingCodecChanged(const int video_channel,
                                    const VideoCodec& video_codec) OVERRIDE {}
  virtual void IncomingRate(const int video_channel,
                            const unsigned int framerate,
                            const unsigned int bitrate) OVERRIDE;
  virtual void DecoderTiming(int decode_ms,
                             int max_decode_ms,
                             int current_delay_ms,
                             int target_delay_ms,
                             int jitter_buffer_ms,
                             int min_playout_delay_ms,
                             int render_delay_ms) OVERRIDE {}
  virtual void RequestNewKeyFrame(const int video_channel) OVERRIDE {}

  // Overrides RtcpStatisticsBallback.
  virtual void StatisticsUpdated(const webrtc::RtcpStatistics& statistics,
                                 uint32_t ssrc) OVERRIDE;

  // Overrides StreamDataCountersCallback.
  virtual void DataCountersUpdated(const webrtc::StreamDataCounters& counters,
                                   uint32_t ssrc) OVERRIDE;

 private:
  std::string GetCName() const;

  const int channel_;
  Clock* const clock_;
  ViECodec* const codec_;
  ViERTP_RTCP* const rtp_rtcp_;

  scoped_ptr<CriticalSectionWrapper> crit_;
  VideoReceiveStream::Stats stats_ GUARDED_BY(crit_);
  RateStatistics decode_fps_estimator_ GUARDED_BY(crit_);
  RateStatistics renders_fps_estimator_ GUARDED_BY(crit_);
};

}  // namespace internal
}  // namespace webrtc
#endif  // WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_


text:
#include <aws/redshift/model/AssociateDataShareConsumerRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::Redshift::Model;
using namespace Aws::Utils;

AssociateDataShareConsumerRequest::AssociateDataShareConsumerRequest() :
    m_dataShareArnHasBeenSet(false),
    m_associateEntireAccount(false),
    m_associateEntireAccountHasBeenSet(false),
    m_consumerArnHasBeenSet(false),
    m_consumerRegionHasBeenSet(false)
{
}

Aws::String AssociateDataShareConsumerRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=AssociateDataShareConsumer&";
  if(m_dataShareArnHasBeenSet)
  {
    ss << "DataShareArn=" << StringUtils::URLEncode(m_dataShareArn.c_str()) << "&";
  }

  if(m_associateEntireAccountHasBeenSet)
  {
    ss << "AssociateEntireAccount=" << std::boolalpha << m_associateEntireAccount << "&";
  }

  if(m_consumerArnHasBeenSet)
  {
    ss << "ConsumerArn=" << StringUtils::URLEncode(m_consumerArn.c_str()) << "&";
  }

  if(m_consumerRegionHasBeenSet)
  {
    ss << "ConsumerRegion=" << StringUtils::URLEncode(m_consumerRegion.c_str()) << "&";
  }

  ss << "Version=2012-12-01";
  return ss.str();
}

void  AssociateDataShareConsumerRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
  uri.SetQueryString(SerializePayload());
}