text:
using UnityEngine;
using System.Collections;
using Pathfinding;
using System.Collections.Generic;
using strange.extensions.dispatcher.eventdispatcher.api;
using strange.extensions.context.api;

namespace COPUnity
{
    public class AStarController : MonoView
    {
        public CharacterController controller;
        public Seeker seeker;

        // injections
        [Inject]
        public IPathfinder pathfinder { get; set; }

        [Inject(WeaponId.HockeyStick)]
        public IWeapon weapon { get; set; }

        [Inject(ContextKeys.CONTEXT_DISPATCHER)]
        public IEventDispatcher eventBus { get; set; }

        // internal path from pathfinder
        List<Vector3> path;
        int currentWaypoint = 0;

        // settings
        float movespeed = 12f;
        float rotationSpeed = 10f;
        float gravity = -10f;
        float maxWaypointDist = 0.2f;

        protected override void OnAwake()
        {
            Debug.Log("Weapon " + weapon.Description);

            controller = this.GetComponent<CharacterController>();
            seeker = this.GetComponent<Seeker>();

            eventBus.Dispatch(CameraEvent.SET_TARGET, this.transform);
        }

        void Update()
        {
            // input
            if(Input.GetKeyDown(KeyCode.Mouse0) || Input.GetKeyDown(KeyCode.Mouse1))
            {
                Ray ray = Camera.main.ScreenPointToRay(UnityEngine.Input.mousePosition);
                RaycastHit hit;

                if (Physics.Raycast(ray, out hit, Mathf.Infinity, LayerMask.NameToLayer("Ground")))
                {
                    // without dependency injection
                    // var nearestWalkablePos = AstarPath.active.GetNearest(hit.point).clampedPosition;

                    // with dependency injection
                    var nearestWalkablePos = pathfinder.GetNearest(hit.point);

                    seeker.StartPath(this.transform.position, nearestWalkablePos, onPathCalculated);
                }
            }

            // movement
            var movedir = calculateMovedir();
            var flags = controller.Move (movedir * movespeed * Time.deltaTime);

            // rotation
            var rotation = Quaternion.Euler (0, calculateRotation(movedir), 0);
            this.transform.rotation = Quaternion.Slerp(this.transform.rotation, rotation, Time.deltaTime * rotationSpeed);
        }

        Vector3 calculateMovedir()
        {
            Vector3 movedir = Vector3.zero;

            if(path == null)
            {
                return movedir;
            }

            if(isAtEndOfPath())
            {
                path = null;
                return movedir;
            }

            movedir = (path[currentWaypoint] - this.transform.position).normalized;

            var dist = path[currentWaypoint] - this.transform.position;// + movedir;
            dist.y = 0;

            if(dist.magnitude < maxWaypointDist)
            {
                currentWaypoint++;
            }

            if (!controller.isGrounded)
            {
                movedir.y -= 10f * Time.deltaTime;
            }

            return movedir;
        }

        float calculateRotation(Vector3 movedir)
        {
            float yRotation = this.transform.rotation.eulerAngles.y;

            if(path == null)
            {
                return yRotation;
            }

            if(isAtEndOfPath())
            {
                return yRotation;
            }

            if(movedir == Vector3.zero)
            {
                return yRotation;
            }

            Quaternion targetRotation = Quaternion.LookRotation(movedir);

            targetRotation.x = 0;
            targetRotation.z = 0;

            yRotation = targetRotation.eulerAngles.y;
            return yRotation;
        }

        void onPathCalculated(Path p)
        {
            if (!p.error)
            {
                path = p.vectorPath;
                currentWaypoint = 1;
            }
            else Debug.LogError("Pathfinder returned with an error:\n" + p.error);
        }

        bool isAtEndOfPath()
        {
            if (path == null) return true;
            else return (currentWaypoint >= path.Count);
        }
    }
}


text:
require 'json'

class DbCredentials
	attr_accessor :db, :hostname, :port, :uid, :password

	def initialize
		vcap_services = JSON.parse(ENV('VCAP_SERVICES'))
		dbcred = vcap_services["credentials"]
		@db = dbcred["db"]
		@hostname = dbcred["hostname"]
		@port = dbcred["port"]
		@uid = dbcred["username"]
		@pwd = dbcred["password"]

redpajama_set_name: RedPajamaGithub


text:
var geocoder;
var autocomplete;

function initialize()
{
	geocoder = new google.maps.Geocoder();

	autocomplete = new google.maps.places.Autocomplete( /** @type {HTMLInputElement} */ document.getElementById( 'forecast_address' ) );
}

function locate_address()
{
	var address = document.getElementById( 'forecast_address' ).value;

	geocoder.geocode( { 'address': address }, function( results, status )
	{
		if ( status == google.maps.GeocoderStatus.OK )
		{
			var latitude = results[ 0 ].geometry.location.lat();
			var longitude = results[ 0 ].geometry.location.lng();

			var uri = "http://forecast.io/embed/#lat=" + latitude + "&lon=" + longitude + "&name=" + encodeURI( address ) + "&text-color=black&color=#e1ddce&font=%27Lucida Grande%27%2CVerdana%2CLucida%2CHelvetica%2CArial%2Csans-serif&units=ca";

			document.getElementById( "forecast_div" ).innerHTML = "<iframe id='forecast_embed' type='text/html' frameborder='0' height='245' width='100%' src='" + uri + "'></iframe>";
		}
		else
		{
			document.getElementById( "forecast_div" ).innerHTML = "Error: weather report cannot be displayed because location detection was not successful for the input address due to the following reason: \"" + status + "\".";
		}
	});
}

google.maps.event.addDomListener( window, 'load', initialize );


text:
FROM    ubuntu:20.04
WORKDIR /opt/koadic
RUN     apt-get update && apt-get install -y python3 python3-pip socat
COPY    . /opt/koadic
RUN     pip3 install -r requirements.txt
ENTRYPOINT ["./koadic"]


text:
package cz.kea.impl.services;

import cz.kea.api.services.PasswordEncryptionService;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

/**
 * @author Jakub Jaros (jakub.jaros@ibacz.eu)
 */
@Service
public class PasswordEncryptionServiceImpl implements PasswordEncryptionService {

    @Override
    public String encrypt(String password) {
        return DigestUtils.md5DigestAsHex(password.getBytes());
    }
}


text:
'use strict';

// add translations for edit mode
if (vis.editMode) {
    $.extend(true, systemDictionary, {
        "nDevs": {
            "en": "Devices"
        },
        "selDev": {
            "en": "Selection"
        },
        "oid_dev_": {
            "en": "id"
        },
        "group_device": {
            "en": "Generated - Do not change"
        },
        "oid_connected_": {
            "en": "Connected id"
        },
        "oid_volume_": {
            "en": "Volume id"
        },
        "oid_muted_": {
            "en": "Muted id"
        },
        "oid_playing_": {
            "en": "Playing id"
        },
        "oid_paused_": {
            "en": "Paused id"
        },
        "oid_url2play_": {
            "en": "url2play id"
        },
        "oid_playerState_": {
            "en": "Player State id"
        },
        "oid_title_": {
            "en": "Title id"
        },
        "oid_url_": {
            "en": "ContentID id"
        },
        "oid_displayName_": {
            "en": "Display Name id"
        },
        "oid_statusText_": {
            "en": "Player Status id"
        }
    });
}

// add translations for non-edit mode
$.extend(true, systemDictionary, {
    "Instance": {"en": "Instance", "de": "Instanz", "ru": "Инстанция"}
});

//Helpers
function getValidDevId(devId) {

    if (typeof devId !== 'string' && !(devId instanceof String))
        return undefined;

    var devIdParts = devId.split('.');
    if (devIdParts.length < 3) {
        console.log('Error: ' + devId + ' is not a device/channel/state');
        return undefined;
    }

    if (devIdParts[0] !== 'chromecast') {
        console.log('Error: ' + devId + ' does not bellong to the chromecast adapter');
        return undefined;
    }

    var normDevice = devIdParts[0] + '.' + devIdParts[1] + '.' + devIdParts[2];

    if (vis.states[normDevice + '.status.connected.val'] === undefined) {
        console.log('Error: ' + normDevice + '.status.connected not found');
        return undefined;
    }

    return normDevice;

}

function registerForDeviceUpdates($widget, ioBrokerState) {
    //Check if state exits
    if (vis.states[ioBrokerState + '.val'] === undefined) {
        console.log('ERROR: ' + ioBrokerState + ' not available.');
        setWidget(undefined);
    } else {
        //register for iobroker state updates
        vis.states.bind(ioBrokerState + '.val', function (e, newVal) {
            console.log('Updated ' + ioBrokerState + ': ' + newVal);
            setWidget(newVal);
        });

        setWidget(vis.states[ioBrokerState + '.val']);

        //register for widget state updates
        if ($widget.is('input') && ($widget.attr('type') === 'url'))
            $widget.closest('form').submit(function (e) {
                e.preventDefault();
                send2ioBroker(e);
            });
        else
            $widget.change(send2ioBroker);
    }

    function setWidget(newVal) {
        if ($widget.attr('type') === 'checkbox')
            $widget.prop('checked', newVal);
        else if ($widget.is('span'))
            $widget.text(newVal);
        else
            $widget.val(newVal);
    }

    function getWidgetVal() {
        if ($widget.attr('type') == 'checkbox')
            return $widget.prop('checked');
        else if ($widget.is('span'))
            return $widget.text();
        else
            return $widget.val();
    }

    function send2ioBroker(evt) {
        console.log('Sending to ' + ioBrokerState + ': ' + getWidgetVal());
        vis.setValue(ioBrokerState, getWidgetVal());
    }
}

// this code can be placed directly in chromecast.html
vis.binds.chromecast = {
    version: '1.3.5',
    showVersion: function () {
        if (vis.binds.chromecast.version) {
            console.log('Version chromecast: ' + vis.binds.chromecast.version);
            vis.binds.chromecast.version = null;
        }
    },

    device: {
        init: function (widgetID, view, data, style) {
            var $div = $('#' + widgetID);
            // if nothing found => wait
            if (!$div.length) {
                return setTimeout(function () {
                    vis.binds.chromecast.device.init(widgetID, view, data, style);
                }, 100);
            }

            $div.append('<select class="chromecastDeviceSelector"/>');
            var $select = $div.find('select.chromecastDeviceSelector');
            for (var devIndex = 1; devIndex <= data.nDevs; devIndex++) {
                var validDevId = undefined;
                try {
                    validDevId = getValidDevId(data['oid_dev_' + devIndex]);
                } catch (e) {
                }

                if (validDevId) {
                    //Create selection
                    var name = validDevId.split('.')[2];
                    $select.append('<option value="' + devIndex + '" class="chromecastDeviceSelectorValue">' + name + '</option>');

                    //Create div
                    console.log('creating ' + validDevId);
                    $div.append('
');
                    var $device = $div.find('.chromecastDevice_' + devIndex);
                    $device.hide();

                    //Connected
                    $device.append('
<input class="chromecastConnected" type="checkbox"/>Connected
');
                    registerForDeviceUpdates($device.find('input.chromecastConnected'), data['oid_connected_' + devIndex]);

                    //Volume
                    $device.append('
<input class="chromecastVolume" type="range" min="0" max="100" />Volume
');
                    registerForDeviceUpdates($device.find('input.chromecastVolume'), data['oid_volume_' + devIndex]);

                    //Muted
                    $device.append('
<input class="chromecastMuted" type="checkbox"/>Muted
');
                    registerForDeviceUpdates($device.find('input.chromecastMuted'), data['oid_muted_' + devIndex]);

                    //Playing
                    $device.append('
<input class="chromecastPlaying" type="checkbox"/>Playing
');
                    registerForDeviceUpdates($device.find('.chromecastPlaying'), data['oid_playing_' + devIndex]);

                    //Paused
                    $device.append('
<input class="chromecastPaused" type="checkbox"/>Paused
');
                    registerForDeviceUpdates($device.find('.chromecastPaused'), data['oid_paused_' + devIndex]);

                    //url2play
                    $device.append('
url2play: <form><input class="chromecastUrl2play" type="url"/></form>
');
                    registerForDeviceUpdates($device.find('.chromecastUrl2play'), data['oid_url2play_' + devIndex]);

                    //display name
                    $device.append('

');
                    registerForDeviceUpdates($device.find('.chromecastDisplayName'), data['oid_displayName_' + devIndex]);

                    //Player Description
                    $device.append('

');
                    registerForDeviceUpdates($device.find('.chromecastPlayerDescription'), data['oid_statusText_' + devIndex]);

                    //player state
                    $device.append('
Status:
');
                    registerForDeviceUpdates($device.find('.chromecastPlayerState'), data['oid_playerState_' + devIndex]);

                    //Playing URL
                    $device.append('
Playing URL:
');
                    registerForDeviceUpdates($device.find('.chromecastPlayerURL'), data["oid_url_" + devIndex]);

                    //Title
                    $device.append('
Title:
');
                    registerForDeviceUpdates($device.find('.chromecastMetadataTitle'), data["oid_title_" + devIndex]);
                }
            }

            var currentSelection = data.selDev;
            $select.change(function () {

                var $device_old = $div.find('div.chromecastDevice_' + currentSelection);
                var $device_new = $div.find('div.chromecastDevice_' + $select.val());

                $device_old.hide();
                $device_new.show();

                currentSelection = $select.val();
            });
            $select.val(data.selDev).change();
        },
    },
    oidChanged: function (widgetID, view, newId, attr, isCss) {
        var mods = [];

        //We just got the widgetID and the view -> find and
        //call this function for all oid_dev_*
        var nDevs = vis.views[view].widgets[widgetID].data.nDevs;
        for (var index = 1; index <= nDevs; index++) {
            attr = 'oid_dev_' + index;
            newId = vis.views[view].widgets[widgetID].data[attr];
            mods += oidDevChanged(widgetID, view, newId, attr, isCss);
        }
        return mods;
    }
};

function oidDevChanged(widgetID, view, newId, attr, isCss) {
    var oid2State = {
        oid_connected_: 'status.connected',
        oid_volume_: 'status.volume',
        oid_muted_: 'status.muted',
        oid_playing_: 'status.playing',
        oid_paused_: 'player.paused',
        oid_url2play_: 'player.url2play',
        oid_playerState_: 'player.playerState',
        oid_title_: 'metadata.title',
        oid_url_: 'media.contentId',
        oid_displayName_: 'status.displayName',
        oid_statusText_: 'status.text'
    };

    var mods = [];
    if (!attr) {
        //We just got the widgetID and the view -> find and
        //call this function for all oid_dev_*
        var nDevs = vis.views[view].widgets[widgetID].data.nDevs;
        for (var k = 1; k <= nDevs; k++) {
            attr = 'oid_dev_' + k;
            newId = vis.views[view].widgets[widgetID].data[attr];
            mods += oidDevChanged(widgetID, view, newId, attr, isCss);
        }
        return mods;
    }

    //Get device index
    var index = attr.split('_')[2];

    //This is not the oid_dev -> look for the corresponding oid_dev and
    //call this function with it
    if (attr.indexOf('oid_dev_') < 0) {
        attr = 'oid_dev_' + index;
        newId = vis.views[view].widgets[widgetID].data['oid_dev_' + index];
        return vis.binds.chromecast.oidDevChanged(widgetID, view, newId, attr, isCss)
    }

    var validDevId = getValidDevId(newId);
    if (validDevId) {
        //Set device id
        vis.views[view].widgets[widgetID].data[attr] = validDevId;
        mods.push(attr);
        //Set derived props
        for (var oid in oid2State) {
            if (oid2State.hasOwnProperty(oid)) {
                vis.views[view].widgets[widgetID].data[oid + index] =
                    validDevId + '.' + oid2State[oid];
                mods.push(oid + index);
            }
        }

    } else {
        //Reset derived props
        for (var oid_ in oid2State) {
            if (oid2State.hasOwnProperty(oid_)) {
                vis.views[view].widgets[widgetID].data[oid_ + index] = undefined;
                mods.push(oid_ + index);
            }
        }
    }
    return mods;
}

vis.binds.chromecast.showVersion();


text:
package org.apache.commons.graph.spanning;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.apache.commons.graph.CommonsGraph.minimumSpanningTree;

import org.apache.commons.graph.Graph;
import org.apache.commons.graph.SpanningTree;
import org.apache.commons.graph.model.BaseLabeledVertex;
import org.apache.commons.graph.model.BaseLabeledWeightedEdge;
import org.apache.commons.graph.model.BaseWeightedEdge;
import org.apache.commons.graph.model.MutableSpanningTree;
import org.apache.commons.graph.model.UndirectedMutableGraph;
import org.apache.commons.graph.weight.primitive.DoubleWeightBaseOperations;
import org.junit.Test;

public final class KruskalTestCase
{

    @Test( expected = NullPointerException.class )
    public void testNullGraph()
    {
        minimumSpanningTree( (Graph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>) null )
            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
            .fromArbitrarySource()
            .applyingKruskalAlgorithm( new DoubleWeightBaseOperations() );
    }

    @Test( expected = NullPointerException.class )
    public void testNullVertex()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input =
            new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();
        minimumSpanningTree( input )
            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
            .fromSource( null )
            .applyingKruskalAlgorithm( new DoubleWeightBaseOperations() );
    }

    @Test( expected = NullPointerException.class )
    public void testNullMonoid()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input = null;
        BaseLabeledVertex a = null;
        try
        {
            input = new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();
            a = new BaseLabeledVertex( "A" );
            input.addVertex( a );
        }
        catch ( NullPointerException e )
        {
            //try..catch need to avoid a possible test success even if a NPE is thorw during graph population
            fail( e.getMessage() );
        }

        minimumSpanningTree( input )
            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
            .fromSource( a )
            .applyingKruskalAlgorithm( null );
    }

    @Test( expected = IllegalStateException.class )
    public void testNotExistVertex()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input =
            new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();

        minimumSpanningTree( input )
            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
            .fromSource( new BaseLabeledVertex( "NOT EXIST" ) );
    }

    @Test( expected = IllegalStateException.class )
    public void testEmptyGraph()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input =
            new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();

        minimumSpanningTree( input )
            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
            .fromArbitrarySource()
            .applyingKruskalAlgorithm( new DoubleWeightBaseOperations() );
    }

    /**
     * Test Graph and Prim's solution can be seen on
     * Wikipedia
     */
    @Test
    public void verifyWikipediaMinimumSpanningTree()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input
            = new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();

        BaseLabeledVertex a = new BaseLabeledVertex( "A" );
        BaseLabeledVertex b = new BaseLabeledVertex( "B" );
        BaseLabeledVertex c = new BaseLabeledVertex( "C" );
        BaseLabeledVertex d = new BaseLabeledVertex( "D" );
        BaseLabeledVertex e = new BaseLabeledVertex( "E" );
        BaseLabeledVertex f = new BaseLabeledVertex( "F" );
        BaseLabeledVertex g = new BaseLabeledVertex( "G" );

        input.addVertex( a );
        input.addVertex( b );
        input.addVertex( c );
        input.addVertex( d );
        input.addVertex( e );
        input.addVertex( f );
        input.addVertex( g );

        input.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 7D ), b );
        input.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> d", 5D ), d );

        input.addEdge( b, new BaseLabeledWeightedEdge<Double>( "b <-> c", 8D ), c );
        input.addEdge( b, new BaseLabeledWeightedEdge<Double>( "b <-> d", 9D ), d );
        input.addEdge( b, new BaseLabeledWeightedEdge<Double>( "b <-> e", 7D ), e );

        input.addEdge( c, new BaseLabeledWeightedEdge<Double>( "c <-> e", 5D ), e );

        input.addEdge( d, new BaseLabeledWeightedEdge<Double>( "d <-> e", 15D ), e );
        input.addEdge( d, new BaseLabeledWeightedEdge<Double>( "d <-> f", 6D ), f );

        input.addEdge( e, new BaseLabeledWeightedEdge<Double>( "e <-> f", 8D ), f );
        input.addEdge( e, new BaseLabeledWeightedEdge<Double>( "e <-> g", 9D ), g );

        input.addEdge( f, new BaseLabeledWeightedEdge<Double>( "f <-> g", 11D ), g );

        // expected

        MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> expected =
            new MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double>( new DoubleWeightBaseOperations(), new BaseWeightedEdge<Double>() );

        for ( BaseLabeledVertex vertex : input.getVertices() )
        {
            expected.addVertex( vertex );
        }

        expected.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 7D ), b );
        expected.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> d", 5D ), d );
        expected.addEdge( b, new BaseLabeledWeightedEdge<Double>( "b <-> e", 9D ), e );
        expected.addEdge( c, new BaseLabeledWeightedEdge<Double>( "c <-> e", 5D ), e );
        expected.addEdge( d, new BaseLabeledWeightedEdge<Double>( "d <-> f", 6D ), f );
        expected.addEdge( e, new BaseLabeledWeightedEdge<Double>( "e <-> g", 9D ), g );

        // Actual

        SpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> actual =
                        minimumSpanningTree( input )
                            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
                            .fromArbitrarySource()
                            .applyingKruskalAlgorithm( new DoubleWeightBaseOperations() );

        // assert!

        assertEquals( expected, actual );
    }

    /**
     * Test Graph and Prim's solution can be seen on
     * Wikipedia
     */
    @Test
    public void verifyNotConnectedMinimumSpanningTree()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input
            = new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();

        BaseLabeledVertex a = new BaseLabeledVertex( "A" );
        BaseLabeledVertex b = new BaseLabeledVertex( "B" );
        BaseLabeledVertex c = new BaseLabeledVertex( "C" );
        BaseLabeledVertex d = new BaseLabeledVertex( "D" );

        input.addVertex( a );
        input.addVertex( b );
        input.addVertex( c );
        input.addVertex( d );

        input.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 7D ), b );

        // expected

        MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> expected =
            new MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double>( new DoubleWeightBaseOperations(), new BaseWeightedEdge<Double>() );

        for ( BaseLabeledVertex vertex : input.getVertices() )
        {
            expected.addVertex( vertex );
        }
        expected.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 7D ), b );

        // Actual

        SpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> actual =
                        minimumSpanningTree( input )
                            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
                            .fromArbitrarySource()
                            .applyingKruskalAlgorithm( new DoubleWeightBaseOperations() );

        // assert!

        assertEquals( expected, actual );
    }

    /**
     * Test the the minimum spanning tree on a path graph with 4 vertices
     * and unit weights.
     */
    @Test
    public void testP4UniformWeightsMinimumSpanningTree()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input
            = new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();

        BaseLabeledVertex a = new BaseLabeledVertex( "A" );
        BaseLabeledVertex b = new BaseLabeledVertex( "B" );
        BaseLabeledVertex c = new BaseLabeledVertex( "C" );
        BaseLabeledVertex d = new BaseLabeledVertex( "D" );

        input.addVertex( a );
        input.addVertex( b );
        input.addVertex( c );
        input.addVertex( d );

        input.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 1D ), b );
        input.addEdge( b, new BaseLabeledWeightedEdge<Double>( "b <-> c", 1D ), c );
        input.addEdge( c, new BaseLabeledWeightedEdge<Double>( "c <-> d", 1D ), d );

        // Expected
        MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> expected =
            new MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double>( new DoubleWeightBaseOperations(), new BaseWeightedEdge<Double>() );

        for ( BaseLabeledVertex vertex : input.getVertices() )
        {
            expected.addVertex( vertex );
        }
        expected.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 1D ), b );
        expected.addEdge( b, new BaseLabeledWeightedEdge<Double>( "b <-> c", 1D ), c );
        expected.addEdge( c, new BaseLabeledWeightedEdge<Double>( "c <-> d", 1D ), d );

        // Actual
        SpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> actual =
                        minimumSpanningTree( input )
                            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
                            .fromArbitrarySource()
                            .applyingKruskalAlgorithm( new DoubleWeightBaseOperations() );

        // assert!
        assertEquals( expected, actual );
    }

    /**
     * Test the algorithm with a disconnected graph on 4 vertices.  In this
     * case, we expect the Minimum spanning "tree" to actually be a minimum
     * spanning forest with 2 components.
     */
    @Test
    public void testDisconnectedMinimumSpanningTree()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input
            = new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();

        BaseLabeledVertex a = new BaseLabeledVertex( "A" );
        BaseLabeledVertex b = new BaseLabeledVertex( "B" );
        BaseLabeledVertex c = new BaseLabeledVertex( "C" );
        BaseLabeledVertex d = new BaseLabeledVertex( "D" );

        input.addVertex( a );
        input.addVertex( b );
        input.addVertex( c );
        input.addVertex( d );

        input.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 4D ), b );
        input.addEdge( c, new BaseLabeledWeightedEdge<Double>( "c <-> d", 2D ), d );

        // Expected
        MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> expected =
            new MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double>( new DoubleWeightBaseOperations(), new BaseWeightedEdge<Double>() );

        for ( BaseLabeledVertex vertex : input.getVertices() )
        {
            expected.addVertex( vertex );
        }
        expected.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 4D ), b );
        expected.addEdge( c, new BaseLabeledWeightedEdge<Double>( "c <-> d", 2D ), d );

        // Actual
        SpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> actual =
                        minimumSpanningTree( input )
                            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
                            .fromArbitrarySource()
                            .applyingKruskalAlgorithm( new DoubleWeightBaseOperations() );

        // assert!
        assertEquals( expected, actual );
    }

    /**
     * Test the the minimum spanning tree on a path graph with 4 vertices
     * and non-uniform weights.
     */
    @Test
    public void testP4NonUniformWeightsMinimumSpanningTree()
    {
        UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>> input
            = new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>>();

        BaseLabeledVertex a = new BaseLabeledVertex( "A" );
        BaseLabeledVertex b = new BaseLabeledVertex( "B" );
        BaseLabeledVertex c = new BaseLabeledVertex( "C" );
        BaseLabeledVertex d = new BaseLabeledVertex( "D" );

        input.addVertex( a );
        input.addVertex( b );
        input.addVertex( c );
        input.addVertex( d );

        input.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 4D ), b );
        input.addEdge( b, new BaseLabeledWeightedEdge<Double>( "b <-> c", 3D ), c );
        input.addEdge( c, new BaseLabeledWeightedEdge<Double>( "c <-> d", 2D ), d );

        // Expected
        MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> expected =
            new MutableSpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double>( new DoubleWeightBaseOperations(), new BaseWeightedEdge<Double>() );

        for ( BaseLabeledVertex vertex : input.getVertices() )
        {
            expected.addVertex( vertex );
        }
        expected.addEdge( a, new BaseLabeledWeightedEdge<Double>( "a <-> b", 4D ), b );
        expected.addEdge( b, new BaseLabeledWeightedEdge<Double>( "b <-> c", 3D ), c );
        expected.addEdge( c, new BaseLabeledWeightedEdge<Double>( "c <-> d", 2D ), d );

        // Actual
        SpanningTree<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double> actual =
                        minimumSpanningTree( input )
                            .whereEdgesHaveWeights( new BaseWeightedEdge<Double>() )
                            .fromArbitrarySource()
                            .applyingKruskalAlgorithm( new DoubleWeightBaseOperations() );

        // assert!
        assertEquals( expected, actual );
    }

}


text:
package com.banana.banana.main;

public class CoupleInfoResponse {
	public int success;
	public CoupleInfoResult result;
}


text:
wget --no-verbose --output-document /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key

yum -y install jenkins

# modify jenkins configuration. ------------------------------------------------
jenkinsconfig="/etc/sysconfig/jenkins"

# check if jenkins config file exists.
if [ -f "${jenkinsconfig}" ]; then
  cp -p ${jenkinsconfig} ${jenkinsconfig}.orig

  # modify jenkins config file.
  sed -i -e '/^JENKINS_JAVA_CMD/s/^.*$/JENKINS_JAVA_CMD="\/usr\/local\/java\/jdk180\/bin\/java"/' ${jenkinsconfig}
  sed -i -e '/^JENKINS_PORT/s/^.*$/JENKINS_PORT="9080"/' ${jenkinsconfig}
fi

# start and enable jenkins daemon. ---------------------------------------------
systemctl start jenkins
systemctl enable jenkins

# display network configuration. -----------------------------------------------
#ip addr show


text:
var Step = require("step"),
    dns = require("dns"),
    http = require("http"),
    https = require("https"),
    url = require("url"),
    querystring = require("querystring")
    webfinger = require("webfinger");

var request = function(module, options, parsers, callback) {

    var types = [], prop;

    for (prop in parsers) {
        if (parsers.hasOwnProperty(prop)) {
            types.push(prop);
        }
    }

    var req = module.request(options, function(res) {

        var body = "";

        res.setEncoding('utf8');

        res.on('data', function (chunk) {
            body = body + chunk;
        });

        res.on("error", function(err) {
            callback(err, null);
        });

        res.on("end", function() {

            var ct, matched, parser, newopts;

            if (res.statusCode > 300 && res.statusCode < 400 && res.headers.location) {

                newopts = url.parse(res.headers.location);

                // Don't redirect if it's not allowed

                if (options.httpsOnly && newopts.protocol != "https:") {
                    callback(new Error("Refusing to redirect to non-HTTPS url: " + res.headers.location), null);
                    return;
                }

                newopts.httpsOnly = options.httpsOnly;

                request(((newopts.protocol == "https:") ? https : http), newopts, parsers, callback);
                return;

            } else if (res.statusCode !== 200) {
                callback(new Error("Bad response code: " + res.statusCode + ":" + body), null);
                return;
            }

            if (!res.headers["content-type"]) {
                callback(new Error("No Content-Type header"), null);
                return;
            }

            ct = res.headers["content-type"];

            matched = types.filter(function(type) { return (ct.substr(0, type.length) == type); });

            if (matched.length == 0) {
                callback(new Error("Content-Type '"+ct+"' does not match any expected types: "+types.join(",")), null);
                return;
            }

            parser = parsers[matched];

            parser(body, callback);
        });
    });

    req.on('error', function(err) {
        callback(err, null);
    });

    req.end();
};

var lookup = function(server, resource, httpsOnly, callback) {

    var parsed,
        params,
        qs,
        options;

    parsed = url.parse(server);

    if ((parsed.protocol !== "https:") && httpsOnly) {
        callback(new Error("Refusing to use insecure WebFist server: " + server), null);
        return;
    }

    params = {
        resource: resource
    };

    qs = querystring.stringify(params),

    options = {
        hostname: parsed.hostname,
        port: parsed.port,
        path: "/.well-known/webfinger?" + qs,
        method: "GET",
        httpsOnly: httpsOnly
    };

    request(((parsed.protocol == "https:") ? https : http), options, {"application/json": webfinger.jrd, "application/jrd+json": webfinger.jrd}, callback);
};

var webfist = function(resource, options, callback) {

    // Options parameter is optional

    if (!callback) {
        callback = options;
        options = {};
    }

    // Prefix it with acct: if it looks like a bare webfinger

    if (resource.indexOf(":") === -1) {
        if (resource.indexOf("@") !== -1) {
            resource = "acct:" + resource;
        }
    }

    Step(
        function() {
            lookup(options.server || 'http://webfist.org/', resource, options.httpsOnly, this);
        },
        function(err, jrd) {
            var delegations, newopts;
            if (err) throw err;
            if (!jrd.hasOwnProperty("links")) {
                throw new Error("No links in WebFist JRD");
            }

            // First, get the WebFist delegation links
            delegations = jrd.links.filter(function(link) {
                return (link.hasOwnProperty("rel") &&
                        link.rel == "http://webfist.org/spec/rel" &&
                        link.hasOwnProperty("href"));
            });

            if (!delegations || delegations.length === 0) {
                throw new Error("No delegation links in WebFist JRD");
            }

            // Fetch the real resource descriptor
            newopts = url.parse(delegations[0].href);

            if ((newopts.protocol !== "https:") && options.httpsOnly) {
                callback(new Error("Refusing to fetch non-HTTPS delegation: " + delegations[0].href), null);
                return;
            }

            newopts.httpsOnly = options.httpsOnly;

            request(((newopts.protocol == "https:") ? https : http), newopts, {"application/json": webfinger.jrd, "application/jrd+json": webfinger.jrd}, this);
        },
        callback
    );
};

exports.webfist = webfist;


text:
/*jshint node:true*/
module.exports = {
  description: 'Installation blueprint for ember-parallax',
  normalizeEntityName: function() {},
  beforeInstall: function() {
    return this.addAddonToProject('ember-windoc', '~0.1.1');
  }

  // locals: function(options) {
  //   // Return custom template variables here.
  //   return {
  //     foo: options.entity.options.foo
  //   };
  // }

  // afterInstall: function(options) {
  //   // Perform extra work here.
  // }
};


text:
<div class="<%= domainPrefix %>-widget <%= _.slugify(widgetName) %>-admin"<% if(jsFramework != 'angularjs' && jsFramework != 'module') { %>>
    <% } else if(jsFramework == 'angularjs') { %>
     ng-controller="<%= domainPrefix %>.<%= _.classify(widgetName) %>CtrlAdmi">
<% } else if(jsFramework == 'module') { %>
     data-module="<%= domainPrefix %>.<%= _.classify(widgetName) %>Admin">
<% } %>

<%= domainPrefix %>.<%= _.classify(widgetName) %>Admin


text:
import sys
import argparse

from . import git
from . import semver

from typing import *

git.assert_in_git_repository()

parser = argparse.ArgumentParser(description='List / update semver tags')

parser.add_argument('--major', action='store_true', default=False, help='Increase major version')
parser.add_argument('--minor', action='store_true', default=False, help='Increase minor version')
parser.add_argument('--patch', action='store_true', default=False, help='Increase patch version')
parser.add_argument('--suffix', type=str, default="", help='Suffix (for example v1.2.3-suffix)')

args = parser.parse_args()
incr_major: bool = args.major
incr_minor: bool = args.minor
incr_patch: bool = args.patch
suffix: str = args.suffix

versions = semver.get_all_versions_ordered(output_non_versions=True)
max_version = versions[-1] if versions else semver.Version("v0.0.0", "v", 0, 0, 0, "")

if not versions:
    print("No tags")
    sys.exit(0)

if incr_major or incr_minor or incr_patch:
    if incr_patch:
        max_version.patch += 1
    if incr_minor:
        max_version.minor += 1
        max_version.patch = 0
    if incr_major:
        max_version.major += 1
        max_version.minor = 0
        max_version.patch = 0
    new_tag = f'{max_version.prefix}{max_version.major}.{max_version.minor}.{max_version.patch}'
    if suffix:
        new_tag += "-" + suffix
    print(f"Creating new version/tag: {new_tag}")
    success, output = git.execute_git(f"tag {new_tag}")
    if not success:
        print(f'Error creating tag: {output}')
        sys.exit(1)
    print(f'Tag {new_tag} created, you can push it now')
else:
    for n, version in enumerate(versions):
        if n > 0:
            previous_ver = versions[n-1]
            if previous_ver.major != version.major:
                print(f"New major: {version.major}")
            if previous_ver.minor != version.minor:
                print(f"New minor: {version.major}.{version.minor}")
        print(f" * {version.tag}")
    print()
    print(f"Last version: {max_version.tag}")
    print()


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.allurent.flexunit2.vfu.framework.testsequence.commands - API Documentation</title>
<base target="classFrame">
<link rel="stylesheet" href="../../../../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../../../../print.css" type="text/css" media="print">

Package com.allurent.flexunit2.vfu.framework.testsequence.commands

Classes

AssertComponentMatchBaseline

DispatchAndWaitForEvent

DispatchEvent

DoAction

SetProperty

SetStyle

TestSequenceCommand

ValidateNow

WaitForEvent

WaitForEventOrQuiesce

WaitForQuiesce


text:
namespace password_manager {

PasswordStoreBuiltInBackend::PasswordStoreBuiltInBackend(
    std::unique_ptr<LoginDatabase> login_db,
    std::unique_ptr<UnsyncedCredentialsDeletionNotifier> notifier) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  background_task_runner_ = base::ThreadPool::CreateSequencedTaskRunner(
      {base::MayBlock(), base::TaskPriority::USER_VISIBLE});
  DCHECK(background_task_runner_);
  helper_ = std::make_unique<LoginDatabaseAsyncHelper>(
      std::move(login_db), std::move(notifier),
      base::SequencedTaskRunnerHandle::Get());
}

PasswordStoreBuiltInBackend::~PasswordStoreBuiltInBackend() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}

void PasswordStoreBuiltInBackend::Shutdown(
    base::OnceClosure shutdown_completed) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  if (helper_) {
    background_task_runner_->DeleteSoon(FROM_HERE, std::move(helper_));
    std::move(shutdown_completed).Run();
  }
}

void PasswordStoreBuiltInBackend::InitBackend(
    RemoteChangesReceived remote_form_changes_received,
    base::RepeatingClosure sync_enabled_or_disabled_cb,
    base::OnceCallback<void(bool)> completion) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::Initialize,
          base::Unretained(helper_.get()),  // Safe until `Shutdown()`.
          std::move(remote_form_changes_received),
          std::move(sync_enabled_or_disabled_cb)),
      std::move(completion));
}

void PasswordStoreBuiltInBackend::GetAllLoginsAsync(
    LoginsOrErrorReply callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::GetAllLogins,
          base::Unretained(helper_.get())),  // Safe until `Shutdown()`.
      std::move(callback));
}

void PasswordStoreBuiltInBackend::GetAutofillableLoginsAsync(
    LoginsOrErrorReply callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::GetAutofillableLogins,
          base::Unretained(helper_.get())),  // Safe until `Shutdown()`.
      std::move(callback));
}

void PasswordStoreBuiltInBackend::FillMatchingLoginsAsync(
    LoginsReply callback,
    bool include_psl,
    const std::vector<PasswordFormDigest>& forms) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  if (forms.empty()) {
    std::move(callback).Run({});
    return;
  }

  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::FillMatchingLogins,
          base::Unretained(helper_.get()),  // Safe until `Shutdown()`.
          forms, include_psl),
      std::move(callback));
}

void PasswordStoreBuiltInBackend::AddLoginAsync(
    const PasswordForm& form,
    PasswordStoreChangeListReply callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(&LoginDatabaseAsyncHelper::AddLogin,
                     base::Unretained(helper_.get()), form),
      std::move(callback));
}

void PasswordStoreBuiltInBackend::UpdateLoginAsync(
    const PasswordForm& form,
    PasswordStoreChangeListReply callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(&LoginDatabaseAsyncHelper::UpdateLogin,
                     base::Unretained(helper_.get()), form),
      std::move(callback));
}

void PasswordStoreBuiltInBackend::RemoveLoginAsync(
    const PasswordForm& form,
    PasswordStoreChangeListReply callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::RemoveLogin,
          base::Unretained(helper_.get()),  // Safe until `Shutdown()`.
          form),
      std::move(callback));
}

void PasswordStoreBuiltInBackend::RemoveLoginsCreatedBetweenAsync(
    base::Time delete_begin,
    base::Time delete_end,
    PasswordStoreChangeListReply callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::RemoveLoginsCreatedBetween,
          base::Unretained(helper_.get()),  // Safe until `Shutdown()`.
          delete_begin, delete_end),
      std::move(callback));
}

void PasswordStoreBuiltInBackend::RemoveLoginsByURLAndTimeAsync(
    const base::RepeatingCallback<bool(const GURL&)>& url_filter,
    base::Time delete_begin,
    base::Time delete_end,
    base::OnceCallback<void(bool)> sync_completion,
    PasswordStoreChangeListReply callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::RemoveLoginsByURLAndTime,
          base::Unretained(helper_.get()),  // Safe until `Shutdown()`.
          url_filter, delete_begin, delete_end, std::move(sync_completion)),
      std::move(callback));
}

void PasswordStoreBuiltInBackend::DisableAutoSignInForOriginsAsync(
    const base::RepeatingCallback<bool(const GURL&)>& origin_filter,
    base::OnceClosure completion) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReply(
      FROM_HERE,
      base::BindOnce(
          base::IgnoreResult(
              &LoginDatabaseAsyncHelper::DisableAutoSignInForOrigins),
          base::Unretained(helper_.get()),  // Safe until `Shutdown()`.
          origin_filter),
      std::move(completion));
}

SmartBubbleStatsStore* PasswordStoreBuiltInBackend::GetSmartBubbleStatsStore() {
  return this;
}

FieldInfoStore* PasswordStoreBuiltInBackend::GetFieldInfoStore() {
  return this;
}

std::unique_ptr<syncer::ProxyModelTypeControllerDelegate>
PasswordStoreBuiltInBackend::CreateSyncControllerDelegate() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  // Note that a callback is bound for
  // GetSyncControllerDelegate() because this getter itself
  // must also run in the backend sequence, and the proxy object below will take
  // care of that.
  // Since the controller delegate can (only in theory) invoke the factory after
  // `Shutdown` was called, it only returns nullptr then to prevent a UAF.
  return std::make_unique<syncer::ProxyModelTypeControllerDelegate>(
      background_task_runner_,
      base::BindRepeating(&LoginDatabaseAsyncHelper::GetSyncControllerDelegate,
                          base::Unretained(helper_.get())));
}

void PasswordStoreBuiltInBackend::ClearAllLocalPasswords() {
  NOTREACHED();
}

void PasswordStoreBuiltInBackend::OnSyncServiceInitialized(
    syncer::SyncService* sync_service) {
  NOTIMPLEMENTED();
}

void PasswordStoreBuiltInBackend::AddSiteStats(const InteractionsStats& stats) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTask(
      FROM_HERE, base::BindOnce(&LoginDatabaseAsyncHelper::AddSiteStats,
                                base::Unretained(helper_.get()), stats));
}

void PasswordStoreBuiltInBackend::RemoveSiteStats(const GURL& origin_domain) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTask(
      FROM_HERE,
      base::BindOnce(&LoginDatabaseAsyncHelper::RemoveSiteStats,
                     base::Unretained(helper_.get()), origin_domain));
}

void PasswordStoreBuiltInBackend::GetSiteStats(
    const GURL& origin_domain,
    base::WeakPtr<PasswordStoreConsumer> consumer) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  consumer->cancelable_task_tracker()->PostTaskAndReplyWithResult(
      background_task_runner_.get(), FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::GetSiteStats,
          base::Unretained(helper_.get()),  // Safe until `Shutdown()`.
          origin_domain),
      base::BindOnce(&PasswordStoreConsumer::OnGetSiteStatistics, consumer));
}

void PasswordStoreBuiltInBackend::RemoveStatisticsByOriginAndTime(
    const base::RepeatingCallback<bool(const GURL&)>& origin_filter,
    base::Time delete_begin,
    base::Time delete_end,
    base::OnceClosure completion) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReply(
      FROM_HERE,
      base::BindOnce(&LoginDatabaseAsyncHelper::RemoveStatisticsByOriginAndTime,
                     base::Unretained(helper_.get()), origin_filter,
                     delete_begin, delete_end),
      std::move(completion));
}

void PasswordStoreBuiltInBackend::AddFieldInfo(const FieldInfo& field_info) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTask(
      FROM_HERE, base::BindOnce(&LoginDatabaseAsyncHelper::AddFieldInfo,
                                base::Unretained(helper_.get()), field_info));
}

void PasswordStoreBuiltInBackend::GetAllFieldInfo(
    base::WeakPtr<PasswordStoreConsumer> consumer) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  consumer->cancelable_task_tracker()->PostTaskAndReplyWithResult(
      background_task_runner_.get(), FROM_HERE,
      base::BindOnce(
          &LoginDatabaseAsyncHelper::GetAllFieldInfo,
          base::Unretained(helper_.get())),  // Safe until `Shutdown()`.
      base::BindOnce(&PasswordStoreConsumer::OnGetAllFieldInfo, consumer));
}

void PasswordStoreBuiltInBackend::RemoveFieldInfoByTime(
    base::Time remove_begin,
    base::Time remove_end,
    base::OnceClosure completion) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(helper_);
  background_task_runner_->PostTaskAndReply(
      FROM_HERE,
      base::BindOnce(&LoginDatabaseAsyncHelper::RemoveFieldInfoByTime,
                     base::Unretained(helper_.get()), remove_begin, remove_end),
      std::move(completion));
}

}  // namespace password_manager


text:
require 'aruba/cucumber'

require 'rake'
require 'ggake'

module GgakeWorld
  include Rake::DSL

  def run_haml(haml_file, output_dir = './')
    in_current_dir do
      file haml_file
      tname = haml_template(haml_file, output: output_dir)
      Rake::Task[tname].invoke
    end
  end

end

World(GgakeWorld)