text:
'use strict';

let sendCommandParams = [];

const Driver = require('../../gather/driver.js');
const Connection = require('../../gather/connections/connection.js');
const Element = require('../../lib/element.js');
const assert = require('assert');
const EventEmitter = require('events').EventEmitter;

const connection = new Connection();
const driverStub = new Driver(connection);

const redirectDevtoolsLog = require('../fixtures/wikipedia-redirect.devtoolslog.json');
const MAX_WAIT_FOR_PROTOCOL = 20;

function createOnceStub(events) {
  return (eventName, cb) => {
    if (events[eventName]) {
      return cb(events[eventName]);
    }

    throw Error(`Stub not implemented: ${eventName}`);
  };
}

function createSWRegistration(id, url, isDeleted) {
  return {
    isDeleted: !!isDeleted,
    registrationId: id,
    scopeURL: url,
  };
}

function createActiveWorker(id, url, controlledClients, status = 'activated') {
  return {
    registrationId: id,
    scriptURL: url,
    controlledClients,
    status,
  };
}

connection.sendCommand = function(command, params) {
  sendCommandParams.push({command, params});
  switch (command) {
    case 'DOM.getDocument':
      return Promise.resolve({root: {nodeId: 249}});
    case 'DOM.querySelector':
      return Promise.resolve({
        nodeId: params.selector === 'invalid' ? 0 : 231,
      });
    case 'DOM.querySelectorAll':
      return Promise.resolve({
        nodeIds: params.selector === 'invalid' ? [] : [231],
      });
    case 'Runtime.evaluate':
      return Promise.resolve({result: {value: 123}});
    case 'Runtime.getProperties':
      return Promise.resolve({
        result: params.objectId === 'invalid' ? [] : [{
          name: 'test',
          value: {
            value: '123',
          },
        }, {
          name: 'novalue',
        }],
      });
    case 'Page.getResourceTree':
      return Promise.resolve({frameTree: {frame: {id: 1}}});
    case 'Page.createIsolatedWorld':
      return Promise.resolve({executionContextId: 1});
    case 'Network.getResponseBody':
      return new Promise(res => setTimeout(res, MAX_WAIT_FOR_PROTOCOL + 20));
    case 'Page.enable':
    case 'Network.enable':
    case 'Tracing.start':
    case 'ServiceWorker.enable':
    case 'ServiceWorker.disable':
    case 'Network.setExtraHTTPHeaders':
    case 'Network.emulateNetworkConditions':
    case 'Emulation.setCPUThrottlingRate':
      return Promise.resolve({});
    case 'Tracing.end':
      return Promise.reject(new Error('tracing not started'));
    default:
      throw Error(`Stub not implemented: ${command}`);
  }
};

/* eslint-env jest */

describe('Browser Driver', () => {
  beforeEach(() => {
    sendCommandParams = [];
  });

  it('returns null when DOM.querySelector finds no node', () => {
    return driverStub.querySelector('invalid').then(value => {
      assert.equal(value, null);
    });
  });

  it('returns element when DOM.querySelector finds node', () => {
    return driverStub.querySelector('meta head').then(value => {
      assert.equal(value instanceof Element, true);
    });
  });

  it('returns [] when DOM.querySelectorAll finds no node', () => {
    return driverStub.querySelectorAll('invalid').then(value => {
      assert.deepEqual(value, []);
    });
  });

  it('returns element when DOM.querySelectorAll finds node', () => {
    return driverStub.querySelectorAll('a').then(value => {
      assert.equal(value.length, 1);
      assert.equal(value[0] instanceof Element, true);
    });
  });

  it('returns value when getObjectProperty finds property name', () => {
    return driverStub.getObjectProperty('test', 'test').then(value => {
      assert.deepEqual(value, 123);
    });
  });

  it('returns null when getObjectProperty finds no property name', () => {
    return driverStub.getObjectProperty('invalid', 'invalid').then(value => {
      assert.deepEqual(value, null);
    });
  });

  it('returns null when getObjectProperty finds property name with no value', () => {
    return driverStub.getObjectProperty('test', 'novalue').then(value => {
      assert.deepEqual(value, null);
    });
  });

  it('throws if getRequestContent takes too long', () => {
    return driverStub.getRequestContent('', MAX_WAIT_FOR_PROTOCOL).then(_ => {
      assert.ok(false, 'long-running getRequestContent supposed to reject');
    }, e => {
      assert.equal(e.code, 'REQUEST_CONTENT_TIMEOUT');
    });
  });

  it('evaluates an expression', () => {
    return driverStub.evaluateAsync('120 + 3').then(value => {
      assert.deepEqual(value, 123);
      assert.equal(sendCommandParams[0].command, 'Runtime.evaluate');
    });
  });

  it('evaluates an expression in isolation', () => {
    return driverStub.evaluateAsync('120 + 3', {useIsolation: true}).then(value => {
      assert.deepEqual(value, 123);

      assert.ok(sendCommandParams.length > 1, 'did not create execution context');
      const evaluateCommand = sendCommandParams.find(data => data.command === 'Runtime.evaluate');
      assert.equal(evaluateCommand.params.contextId, 1);

      // test repeat isolation evaluations
      sendCommandParams = [];
      return driverStub.evaluateAsync('120 + 3', {useIsolation: true});
    }).then(value => {
      assert.deepEqual(value, 123);
      assert.ok(sendCommandParams.length === 1, 'created unnecessary 2nd execution context');
    });
  });

  it('will track redirects through gotoURL load', () => {
    const delay = _ => new Promise(resolve => setTimeout(resolve));

    class ReplayConnection extends EventEmitter {
      connect() {
        return Promise.resolve();
      }
      disconnect() {
        return Promise.resolve();
      }
      replayLog() {
        redirectDevtoolsLog.forEach(msg => this.emit('protocolevent', msg));
      }
      sendCommand(method) {
        const resolve = Promise.resolve();

        // If navigating, wait, then replay devtools log in parallel to resolve.
        if (method === 'Page.navigate') {
          resolve.then(delay).then(_ => this.replayLog());
        }

        return resolve;
      }
    }
    const replayConnection = new ReplayConnection();
    const driver = new Driver(replayConnection);

    // Redirect in log will go through
    const startUrl = 'http://en.wikipedia.org/';
    // then https://en.wikipedia.org/
    // then https://en.wikipedia.org/wiki/Main_Page
    const finalUrl = 'https://en.m.wikipedia.org/wiki/Main_Page';

    const loadOptions = {
      waitForLoad: true,
      passContext: {
        passConfig: {
          networkQuietThresholdMs: 1,
        },
      },
    };

    return driver.gotoURL(startUrl, loadOptions).then(loadedUrl => {
      assert.equal(loadedUrl, finalUrl);
    });
  });

  it('waits for tracingComplete when tracing already started', () => {
    const fakeConnection = new Connection();
    const fakeDriver = new Driver(fakeConnection);
    const commands = [];
    fakeConnection.sendCommand = evt => {
      commands.push(evt);
      return Promise.resolve();
    };

    fakeDriver.once = createOnceStub({'Tracing.tracingComplete': {}});
    return fakeDriver.beginTrace().then(() => {
      assert.deepEqual(commands, ['Page.enable', 'Tracing.end', 'Tracing.start']);
    });
  });

  it('will request default traceCategories', () => {
    return driverStub.beginTrace().then(() => {
      const traceCmd = sendCommandParams.find(obj => obj.command === 'Tracing.start');
      const categories = traceCmd.params.categories;
      assert.ok(categories.includes('devtools.timeline'), 'contains devtools.timeline');
    });
  });

  it('will use requested additionalTraceCategories', () => {
    return driverStub.beginTrace({additionalTraceCategories: 'v8,v8.execute,toplevel'}).then(() => {
      const traceCmd = sendCommandParams.find(obj => obj.command === 'Tracing.start');
      const categories = traceCmd.params.categories;
      assert.ok(categories.includes('blink'), 'contains default categories');
      assert.ok(categories.includes('v8.execute'), 'contains added categories');
      assert.ok(categories.indexOf('toplevel') === categories.lastIndexOf('toplevel'),
          'de-dupes categories');
    });
  });

  it('should send the Network.setExtraHTTPHeaders command when there are extra-headers', () => {
    return driverStub.setExtraHTTPHeaders({
      'Cookie': 'monster',
      'x-men': 'wolverine',
    }).then(() => {
      assert.equal(sendCommandParams[0].command, 'Network.setExtraHTTPHeaders');
    });
  });

  it('should not send the Network.setExtraHTTPHeaders command when there no extra-headers', () => {
    return driverStub.setExtraHTTPHeaders().then(() => {
      assert.equal(sendCommandParams[0], undefined);
    });
  });
});

describe('Multiple tab check', () => {
  beforeEach(() => {
    sendCommandParams = [];
  });

  it('will pass if there are no current service workers', () => {
    const pageUrl = 'https://example.com/';
    driverStub.once = createOnceStub({
      'ServiceWorker.workerRegistrationUpdated': {
        registrations: [],
      },
    });

    driverStub.on = createOnceStub({
      'ServiceWorker.workerVersionUpdated': {
        versions: [],
      },
    });

    return driverStub.assertNoSameOriginServiceWorkerClients(pageUrl);
  });

  it('will pass if there is an active service worker for a different origin', () => {
    const pageUrl = 'https://example.com/';
    const secondUrl = 'https://example.edu';
    const swUrl = `${secondUrl}sw.js`;

    const registrations = [
      createSWRegistration(1, secondUrl),
    ];
    const versions = [
      createActiveWorker(1, swUrl, ['uniqueId']),
    ];

    driverStub.once = createOnceStub({
      'ServiceWorker.workerRegistrationUpdated': {
        registrations,
      },
    });

    driverStub.on = createOnceStub({
      'ServiceWorker.workerVersionUpdated': {
        versions,
      },
    });

    return driverStub.assertNoSameOriginServiceWorkerClients(pageUrl);
  });

  it('will fail if a service worker with a matching origin has a controlled client', () => {
    const pageUrl = 'https://example.com/';
    const swUrl = `${pageUrl}sw.js`;
    const registrations = [
      createSWRegistration(1, pageUrl),
    ];
    const versions = [
      createActiveWorker(1, swUrl, ['uniqueId']),
    ];

    driverStub.once = createOnceStub({
      'ServiceWorker.workerRegistrationUpdated': {
        registrations,
      },
    });

    driverStub.on = createOnceStub({
      'ServiceWorker.workerVersionUpdated': {
        versions,
      },
    });

    return driverStub.assertNoSameOriginServiceWorkerClients(pageUrl)
      .then(_ => assert.ok(false),
          err => {
            assert.ok(err.message.toLowerCase().includes('multiple tabs'));
          });
  });

  it('will succeed if a service worker with a matching origin has no controlled clients', () => {
    const pageUrl = 'https://example.com/';
    const swUrl = `${pageUrl}sw.js`;
    const registrations = [createSWRegistration(1, pageUrl)];
    const versions = [createActiveWorker(1, swUrl, [])];

    driverStub.once = createOnceStub({
      'ServiceWorker.workerRegistrationUpdated': {
        registrations,
      },
    });

    driverStub.on = createOnceStub({
      'ServiceWorker.workerVersionUpdated': {
        versions,
      },
    });

    return driverStub.assertNoSameOriginServiceWorkerClients(pageUrl);
  });

  it('will wait for serviceworker to be activated', () => {
    const pageUrl = 'https://example.com/';
    const swUrl = `${pageUrl}sw.js`;
    const registrations = [createSWRegistration(1, pageUrl)];
    const versions = [createActiveWorker(1, swUrl, [], 'installing')];

    driverStub.once = createOnceStub({
      'ServiceWorker.workerRegistrationUpdated': {
        registrations,
      },
    });

    driverStub.on = (eventName, cb) => {
      if (eventName === 'ServiceWorker.workerVersionUpdated') {
        cb({versions});

        setTimeout(() => {
          cb({
            versions: [
              createActiveWorker(1, swUrl, [], 'activated'),
            ],
          });
        }, 1000);

        return;
      }

      throw Error(`Stub not implemented: ${eventName}`);
    };

    return driverStub.assertNoSameOriginServiceWorkerClients(pageUrl);
  });

  describe('.goOnline', () => {
    it('re-establishes previous throttling settings', async () => {
      await driverStub.goOnline({
        passConfig: {useThrottling: true},
        settings: {
          throttlingMethod: 'devtools',
          throttling: {
            requestLatencyMs: 500,
            downloadThroughputKbps: 1000,
            uploadThroughputKbps: 1000,
          },
        },
      });

      const emulateCommand = sendCommandParams
        .find(item => item.command === 'Network.emulateNetworkConditions');
      assert.ok(emulateCommand, 'did not call emulate network');
      assert.deepStrictEqual(emulateCommand.params, {
        offline: false,
        latency: 500,
        downloadThroughput: 1000 * 1024 / 8,
        uploadThroughput: 1000 * 1024 / 8,
      });
    });

    it('clears network emulation when throttling is not devtools', async () => {
      await driverStub.goOnline({
        passConfig: {useThrottling: true},
        settings: {
          throttlingMethod: 'provided',
        },
      });

      const emulateCommand = sendCommandParams
        .find(item => item.command === 'Network.emulateNetworkConditions');
      assert.ok(emulateCommand, 'did not call emulate network');
      assert.deepStrictEqual(emulateCommand.params, {
        offline: false,
        latency: 0,
        downloadThroughput: 0,
        uploadThroughput: 0,
      });
    });

    it('clears network emulation when useThrottling is false', async () => {
      await driverStub.goOnline({
        passConfig: {useThrottling: false},
        settings: {
          throttlingMethod: 'devtools',
          throttling: {
            requestLatencyMs: 500,
            downloadThroughputKbps: 1000,
            uploadThroughputKbps: 1000,
          },
        },
      });

      const emulateCommand = sendCommandParams
        .find(item => item.command === 'Network.emulateNetworkConditions');
      assert.ok(emulateCommand, 'did not call emulate network');
      assert.deepStrictEqual(emulateCommand.params, {
        offline: false,
        latency: 0,
        downloadThroughput: 0,
        uploadThroughput: 0,
      });
    });
  });

  describe('.goOffline', () => {
    it('should send offline emulation', async () => {
      await driverStub.goOffline();
      const emulateCommand = sendCommandParams
        .find(item => item.command === 'Network.emulateNetworkConditions');
      assert.ok(emulateCommand, 'did not call emulate network');
      assert.deepStrictEqual(emulateCommand.params, {
        offline: true,
        latency: 0,
        downloadThroughput: 0,
        uploadThroughput: 0,
      });
    });
  });
});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Jimin</title>

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

    <link href="css/agency.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

<link rel="icon" type="image/ico" href="http://static.tumblr.com/2d5d2a400df502d4629dffe34d6b30a2/
7fblnyd/eVhnqbz5k/tumblr_static_bb88rybs7ncw4sgskskwosog8.gif"/>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Kpop Starter Kit

Jimin

 지민

"Throw a stone at me if you've
                    done as much as I did."

Park Jimin

            October 13, 1995.

            Busan

            Jimin is a precious BTS member. He may be small, but he is extremely talented. Jimin is a great dancer and hits high notes effortlessly. Jimin is very sexy and confident on stage, but offstage he is shy and sweet. Jimin cares a lot about the other members. His laugh is also very precious.

Videos

Pictures

Enjoy big discounts for Links of London with these vouchers.
Powered by flickr embed.

redpajama_set_name: RedPajamaGithub


text:
var assert = require('assert');
var resolve = require('../');

var fixtures_dir = __dirname + '/fixtures';

test('module to implicit extension', function(done) {
    var opts = { filename: fixtures_dir + '/node_modules/module-o/main.js' }
    resolve('module-a', opts, function(err, path) {
        assert.ifError(err);
        assert.equal(path, require.resolve('./fixtures/node_modules/module-o/x.js'));
        done();
    });
});

test('implicit extension to implicit extension', function(done) {
    var opts = { filename: fixtures_dir + '/node_modules/module-p/main.js' }
    resolve('./z.js', opts, function(err, path) {
        assert.ifError(err);
        assert.equal(path, require.resolve('./fixtures/node_modules/module-p/x.js'));
        done();
    });
});

test('implicit extension to implicit extension', function(done) {
    var opts = { filename: fixtures_dir + '/node_modules/module-p/main.js' }
    resolve('./z', opts, function(err, path) {
        assert.ifError(err);
        assert.equal(path, require.resolve('./fixtures/node_modules/module-p/x.js'));
        done();
    });
});

test('explicit extension to explicit extension', function(done) {
    var opts = { filename: fixtures_dir + '/node_modules/module-q/main.js' }
    resolve('./z.js', opts, function(err, path) {
        assert.ifError(err);
        assert.equal(path, require.resolve('./fixtures/node_modules/module-q/x.js'));
        done();
    });
});

test('implicit extension to explicit extension', function(done) {
    var opts = { filename: fixtures_dir + '/node_modules/module-r/main.js' }
    resolve('./z.js', opts, function(err, path) {
        assert.ifError(err);
        assert.equal(path, require.resolve('./fixtures/node_modules/module-r/x.js'));
        done();
    });
});

test('module implicit extension to explicit extension', function(done) {
    var opts = { filename: fixtures_dir + '/node_modules/module-s/main.js' }
    resolve('whatever/z.js', opts, function(err, path) {
        assert.ifError(err);
        assert.equal(path, require.resolve('./fixtures/node_modules/module-s/x.js'));
        done();
    });
});

test('module implicit extension to explicit extension', function(done) {
    var opts = { filename: fixtures_dir + '/node_modules/module-s/main.js' }
    resolve('whatever/z', opts, function(err, path) {
        assert.ifError(err);
        assert.equal(path, require.resolve('./fixtures/node_modules/module-s/x.js'));
        done();
    });
});


text:
package com.gooddata;

/**
 * Signals that something unexpected happened in GoodData SDK.
 */
public class GoodDataException extends RuntimeException {

    /**
     * Construct a GoodDataException with the specified detail message.
     *
     * @param message the detail message
     */
    public GoodDataException(String message) {
        super(message);
    }

    /**
     * Construct a GoodDataException with the specified detail message and cause.
     *
     * @param message the detail message
     * @param cause   the cause
     */
    public GoodDataException(String message, Throwable cause) {
        super(message, cause);
    }
}


text:
#ifndef QUICKSTEP_CLI_FLAGS_HPP_
#define QUICKSTEP_CLI_FLAGS_HPP_

#include "gflags/gflags_declare.h"

namespace quickstep {

/** \addtogroup CLI
 *  @{
 */

/**
 * @brief A collection of common flags shared by Quickstep CLIs in both the
 * single-node and the distributed version.
 **/

DECLARE_bool(print_query);

DECLARE_bool(initialize_db);

DECLARE_int32(num_workers);

DECLARE_string(worker_affinities);

DECLARE_string(storage_path);

DECLARE_bool(preload_buffer_pool);

/** @} */

}  // namespace quickstep

#endif  // QUICKSTEP_CLI_FLAGS_HPP_


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "Engine/DataTable.h"
#include "ListenerManager.h"

struct FDataTableEditorColumnHeaderData
{
	/** Unique ID used to identify this column */
	FName ColumnId;

	/** Display name of this column */
	FText DisplayName;

	/** The calculated width of this column taking into account the cell data for each row */
	float DesiredColumnWidth;
};

struct FDataTableEditorRowListViewData
{
	/** Unique ID used to identify this row */
	FName RowId;

	/** Display name of this row */
	FText DisplayName;

	/** Array corresponding to each cell in this row */
	TArray<FText> CellData;
};

typedef TSharedPtr<FDataTableEditorColumnHeaderData> FDataTableEditorColumnHeaderDataPtr;
typedef TSharedPtr<FDataTableEditorRowListViewData>  FDataTableEditorRowListViewDataPtr;

struct UNREALED_API FDataTableEditorUtils
{
	enum class EDataTableChangeInfo
	{
		/** The data corresponding to a single row has been changed */
		RowData,
		/** The data corresponding to the entire list of rows has been changed */
		RowList,
	};

	enum class ERowMoveDirection
	{
		Up,
		Down,
	};

	class FDataTableEditorManager : public FListenerManager < UDataTable, EDataTableChangeInfo >
	{
		FDataTableEditorManager() {}
	public:
		UNREALED_API static FDataTableEditorManager& Get();

		class UNREALED_API ListenerType : public InnerListenerType<FDataTableEditorManager>
		{
		};
	};

	typedef FDataTableEditorManager::ListenerType INotifyOnDataTableChanged;

	static bool RemoveRow(UDataTable* DataTable, FName Name);
	static uint8* AddRow(UDataTable* DataTable, FName RowName);
	static bool RenameRow(UDataTable* DataTable, FName OldName, FName NewName);
	static bool MoveRow(UDataTable* DataTable, FName RowName, ERowMoveDirection Direction, int32 NumRowsToMoveBy = 1);

	static void BroadcastPreChange(UDataTable* DataTable, EDataTableChangeInfo Info);
	static void BroadcastPostChange(UDataTable* DataTable, EDataTableChangeInfo Info);

	static void CacheDataTableForEditing(const UDataTable* DataTable, TArray<FDataTableEditorColumnHeaderDataPtr>& OutAvailableColumns, TArray<FDataTableEditorRowListViewDataPtr>& OutAvailableRows);

	static TArray<UScriptStruct*> GetPossibleStructs();
};


text:
START_ATF_NAMESPACE
    namespace Info
    {
        using _RENAME_POTION_USE_INFOInit2_ptr = void (WINAPIV*)(struct _RENAME_POTION_USE_INFO*);
        using _RENAME_POTION_USE_INFOInit2_clbk = void (WINAPIV*)(struct _RENAME_POTION_USE_INFO*, _RENAME_POTION_USE_INFOInit2_ptr);

        using _RENAME_POTION_USE_INFOctor__RENAME_POTION_USE_INFO4_ptr = void (WINAPIV*)(struct _RENAME_POTION_USE_INFO*);
        using _RENAME_POTION_USE_INFOctor__RENAME_POTION_USE_INFO4_clbk = void (WINAPIV*)(struct _RENAME_POTION_USE_INFO*, _RENAME_POTION_USE_INFOctor__RENAME_POTION_USE_INFO4_ptr);
    }; // end namespace Info
END_ATF_NAMESPACE


text:
package com.github.joelittlejohn.embedmongo;

import java.io.IOException;
import java.net.ServerSocket;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import org.junit.After;
import org.junit.Test;

public class PortUtilsTest {

    private final ScheduledExecutorService testPooledExecutor = Executors.newScheduledThreadPool(20);

    @After
    public void tearDown() throws Exception {
        testPooledExecutor.shutdown();
    }

    /**
     * This test executes method
     * {@link com.github.joelittlejohn.embedmongo.PortUtils#allocateRandomPort()}
     * many times concurrently to make sure that port allocation works correctly
     * under stress.
     */
    @Test
    public void testAllocateRandomPort() throws Exception {
        final int testAllocationCount = 10000;
        final CountDownLatch allocationsCounter = new CountDownLatch(testAllocationCount);

        final Runnable allocatePort = new Runnable() {
            @Override
            public void run() {
                int port = -1;
                try {
                    port = PortUtils.allocateRandomPort();
                    new ServerSocket(port);
                    // port has been bound successfully
                } catch (IOException e) {
                    throw new RuntimeException("Port " + port + " cannot be bind!");
                } finally {
                    allocationsCounter.countDown();
                }
            }
        };

        final Random randomGenerator = new Random();
        for (int i = 0; i < testAllocationCount; i++) {
            // schedule execution a little to in the future to simulate less predictable environment
            testPooledExecutor.schedule(allocatePort, randomGenerator.nextInt(10), TimeUnit.MILLISECONDS);
        }
        allocationsCounter.await(10, TimeUnit.SECONDS);
    }

}


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">

<display-name>Archetype Created Web Application</display-name>

    <servlet>
        <servlet-name>smsMoReceiver</servlet-name>
        <servlet-class>hms.tap.api.sms.MoSmsReceiver</servlet-class>
        <init-param>
            <param-name>smsReceiver</param-name>
            <param-value>$name</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>smsMoReceiver</servlet-name>
        <url-pattern>/sms</url-pattern>
    </servlet-mapping>

</web-app>


text:
import { connect } from 'react-redux';
import Trash from './component';
import { getFilteredCards } from 'reducers';
import { clearTrash } from 'actions';

function mapStateToProps(state) {
    return {
        cards: state.user.cards,
        filteredCards: getFilteredCards(state)
    };
}

function mapDispathToProps(dispatch) {
    return {
        handleClearTrash(event) {
            console.log(event);
            dispatch(clearTrash());
        }
    };
}

export default connect(mapStateToProps, mapDispathToProps)(Trash);


text:
<!DOCTYPE html>

<title>Canvas test: 2d.path.rect.zero.3</title>

<link rel="stylesheet" href="../tests.css">
<link rel="prev" href="minimal.2d.path.rect.zero.2.html" title="2d.path.rect.zero.2">
<link rel="next" href="minimal.2d.path.rect.zero.4.html" title="2d.path.rect.zero.4">

Pass

Fail

These images should be identical:

<canvas id="c" class="output" width="100" height="50">
FAIL (fallback content)
</canvas>

Expected output:


text:
/**
 * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
 * @version v25.1.0
 * @link http://www.ag-grid.com/
 * @license MIT
 */
"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var managedFocusComponent_1 = require("../../widgets/managedFocusComponent");
var keyboard_1 = require("../../utils/keyboard");
var AbstractHeaderWrapper = /** @class */ (function (_super) {
    __extends(AbstractHeaderWrapper, _super);
    function AbstractHeaderWrapper() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    AbstractHeaderWrapper.prototype.shouldStopEventPropagation = function (e) {
        var _a = this.focusController.getFocusedHeader(), headerRowIndex = _a.headerRowIndex, column = _a.column;
        return keyboard_1.isUserSuppressingHeaderKeyboardEvent(this.gridOptionsWrapper, e, headerRowIndex, column);
    };
    AbstractHeaderWrapper.prototype.getColumn = function () {
        return this.column;
    };
    AbstractHeaderWrapper.prototype.getPinned = function () {
        return this.pinned;
    };
    return AbstractHeaderWrapper;
}(managedFocusComponent_1.ManagedFocusComponent));
exports.AbstractHeaderWrapper = AbstractHeaderWrapper;

//# sourceMappingURL=abstractHeaderWrapper.js.map


text:
package name.marmar.javatwo.filter;

import java.io.IOException;
import java.util.logging.Logger;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.PreMatching;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;

@Provider
@PreMatching
public class CORSRequestOptionsFilter implements ContainerRequestFilter {

    @Override
    public void filter( ContainerRequestContext requestCtx ) throws IOException {
        // When HttpMethod comes as OPTIONS, just acknowledge that it accepts...
        if ( requestCtx.getRequest().getMethod().equals( "OPTIONS" ) ) {
            // Just send a OK signal back to the browser
            requestCtx.abortWith( Response.status( Response.Status.OK ).build() );
        }
    }
}


text:
layout: page
title: Cordova - Tanner Wedding
date: 2016-05-24
author: Patrick Salazar
tags: weekly links, java
status: published
summary: Sed dapibus varius lacinia. Vivamus sed.
banner: images/banner/office-01.jpg
booking:
  startDate: 11/04/2017
  endDate: 11/09/2017
  ctyhocn: SAVGWHX
  groupCode: CTW
published: true
---
Suspendisse potenti. Quisque semper imperdiet neque, id bibendum sem accumsan id. Suspendisse vitae justo in tellus porttitor pulvinar. Suspendisse ullamcorper diam consequat, congue justo quis, lacinia massa. Sed convallis ligula ut vulputate ullamcorper. In lacus orci, rhoncus sit amet massa sit amet, eleifend interdum leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Sed consectetur purus vitae convallis semper.

1 Donec vestibulum lacus eu turpis facilisis, sed ullamcorper tellus gravida
1 Donec ut lectus sed nunc vestibulum fringilla eu a ligula
1 Nulla vulputate lacus in leo gravida hendrerit.

Pellentesque accumsan lacinia nisi. Nunc accumsan elit sapien, in scelerisque orci consectetur sed. Donec gravida mollis felis, vehicula pretium enim ultrices eu. Etiam non turpis ac ante mollis malesuada. Ut hendrerit lorem nibh, vitae tincidunt turpis rutrum in. Pellentesque hendrerit faucibus mollis. Proin blandit quam vitae convallis elementum. Nam ultrices, arcu vel tristique vulputate, velit ex porta libero, nec tristique elit sem eu lectus. Ut dignissim dolor quis nulla cursus porta. Phasellus pulvinar risus sit amet enim accumsan molestie sit amet at nisl. Pellentesque ornare, lectus nec mattis tincidunt, mi massa varius diam, ac auctor tortor justo ut diam. Proin arcu lorem, elementum sed vulputate ut, viverra in enim. Integer non nisi justo. Nulla ac nunc rhoncus, porta mi in, mattis massa.


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Pomodoro Clock</title>

    <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'>
    <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css'>
    <link rel="stylesheet" href="css/style.css">

Pomodoro Timer

Stay Focused!

25:00

 Work Time

 Break time

      <button id = "chevLeftWorkTime" type="button" class="btn btn-sm">

     </button>
         25:00
        <button id = "chevRightWorkTime" type="button" class="btn btn-sm">

          </button>

      <button id = "chevLeftBreakTime" type="button" class="btn btn-sm">

     </button>
         5:00
        <button id = "chevRightBreakTime" type="button" class="btn btn-sm">

          </button>

        <button id = "startTime" type="button" class="btn btn-md">

        </button>

        <button id = "pauseTime" type="button" class="btn btn-md">

        </button>

        <button id = "stopTime" type="button" class="btn btn-md">

        </button>

Pomodoro Clock by Lisa Copeland


text:
'use strict'

const SIZE_STATUS_ACTIVE = 'SIZE_STATUS_active'
const SIZE_STATUS_INACTIVE = 'SIZE_STATUS_INACTIVE'

module.exports = {
	SIZE_STATUS_ACTIVE,
	SIZE_STATUS_INACTIVE
}


text:
{"threeColumns": true}
# Introduction

The Appbase JS library allows developers to create realtime multi-user apps using a graph data model and realtime smart-search capabilities.

To use it in the browser, use this link: https://cdn.appbase.io/latest/appbase.js

To use it with nodejs, do `npm install appbasejs`

The Appbase library exposes the ``Appbase`` object. The methods in the JS lib rely on three main objects.

1. **Appbase**
2. **Namespace Reference** (referred as ``nsref`` in this doc)
3. **Vertex Reference** (referred as ``vref`` in this doc)

# Appbase

**Appbase** is the global object exposed the JS library. It has the following four methods: ``credentials()``,
``ns()``, ``uuid()``, and ``serverTime()``.

## Setting up

### credentials()

Authorize the app credentials using the appname and appsecret identifiers, as they appear in the [Dev Console](//appbase.io/developer).

```js
Appbase.credentials('aphrodite',
'4d8d0072580912343cd74aa0015cd217',
function(error, isAuthorized) {
  if (!error && isAuthorized)
    console.log("app successfully registered");
});
```
**Usage**

``Appbase.credentials(appname, [appsecret , onComplete])``

- **appname** ``String`` — App name
- **appsecret** ``String`` (optional) — App secret key
    While using Appbase clientside, app secret should not be used, as it will be exposed in the Javascript file. [User Authentication](http://docs.appbase.io/#/v2.0/javascript/oauth) is recommended in the clientside use of Appbase Library.
- **onComplete** ``Function`` — will be passed two arguments:

	- **error** ``String`` / ``null`` — *String* containing the error message, *null* if event listening is successful
	- **isAuthorized** ``Boolean`` — Whether the credentials are correct or not

## Namespaces

### ns()

Get the namespace reference with the passed *string identifier*. It creates a new namespace if one doesn't already exist, else returns reference to the existing namespace. See _Namespace Reference_ docs for how namespaces work.

```js
var nsref = Appbase.ns("Domains");
```

**Usage**

``Appbase.ns(namespace)``

* **namespace** ``String`` — Namespace identifier (can contain all ascii characters except for whitespaces, '/', ':', and '~'.)

**Returns**

``Object`` **nsref** *Namespace Reference*

## Fantastic Search

### rawSearch()

Appbase uses ElasticSearch in the backend. To completely understand how it works, please refer to [this page](http://docs.appbase.io/docs/elasticsearch.html).

## Utility

### uuid()

Returns a 32-character uuid.

```js
console.log(Appbase.uuid());  // 32-character string
```

**Usage**

``Appbase.uuid()``

**Returns**

``String`` UUID

### serverTime()

Obtain the current time in *milliseconds* since epoch.

```js
var abref = Appbase.serverTime(
  function onComplete(error, time) {
    if (error === null) { // confirming no errors
      console.log(time);  // 1413133493597
    }
  });
```

**Usage**

``Appbase.serverTime(onComplete)``

- **onComplete** ``Function`` will be passed with two arguments.

  - **error** `String` / `null` — *String* containing the error message, *null* if `serverTime()` returns successfully.
  - **time** `Number` — the current time of server in  milliseconds since epoch

# Namespace Reference

Namespace Reference Object or ``nsref`` has methods for creating vertices, searching vertices, and event listeners to the addition and removal of vertices.

## Vertices

### v()

Creates a new vertex or obtains a reference to an existing vertex.

```js
nsref = Appbase.ns("Domains");
// will return the vertex at path "Domains/www.appbase.io"
// will create one if it does not exist.
vref1 = nsref.v("www.appbase.io");
// will return the vertex at path "Domains/www.appbase.io/subdomains"
// Will only return if the vertex at the path exists.
vref2 = nsref.v("www.appbase.io/subdomains");
```

**Usage**

``nsref.v(path)``

- **path** `String` — Relative path of the vertex reference. If creating a new vertex, this is the vertex identifier. ``/`` character is used for separating path variables. The path can contain all ascii characters except for whitespaces, ':', and '~'.

**Returns**

**vref** ``Object`` *Vertex Reference*

``Note:`` Use a string identifier if you are creating a new vertex. A new vertex cannot be created recursively, avoid using non-existent paths.

## Search

### search()

Powerful realtime search on vertices inside a namespace, with options to search using one or more data properties. It returns not just matched strings, but all the matching vertices.

**Note:** Search has to be manually enabled on the namesapces using the [Developer Dashboard](http://appbase.io/developer).

1. Enable the search by toggling the  switch in your app's preferred namespace. If search is enabled, you should see an this icon  next to the namespace.
2. Second and final step, use this code snippet on the enabled namespace and have a full-text search widget.

```js
// Suppose there is a "tweets" namespace
// containing vertices with a property "message".
Appbase.ns('tweets')
.search({text:'hello',
properties: ['message']},
function(error, array) {
    if (!error) {
    	console.log(array);
    }
});
```

**Usage**

``nsref.search(queryObj, onComplete)``

- **queryObj** ``Object`` — A Javascript Object containing the following fields and values

	- **text** ``String`` — Search query string
	- **properties** ``Array`` — One or more properties on which to apply the search.

- **onComplete** ``Function`` — will be passed two arguments:

	- **error** ``String`` / ``null`` — *String* containing the error message, *null* if event listening is successful
	- **results** ``Array`` — Search results as an Array of matching vertices.

## Retrieving Data

### on()

Retrieve existing vertices, and listen to addition or removal of vertices.

```js
// get reference to the namespace 'Domain'
var domain = Appbase.ns("Domain");

domain.on('vertex_added', function (err, vref, vsnap) {
   if (err) console.log(err);
   else {
   	 console.log(vref.URL(), vsnap.properties());
   }
}, function() {
  console.log('Existing vertices retrieved.');
});

setTimeout(function(){
    domain.v('www.appbase.io');
}, 2000);

/* After 2s, it adds the newly added vertex's URL -
'http://api.appbase.io/yourAppName/v2/Domain/www.appbase.io/' */
```

**Usage**

``nsref.on(eventType , callback [, onComplete])``

- **eventType** ``String`` — Either "vertex_added" or "vertex_removed"
- **callback** ``Function`` (optional) — is called when with existing vertices, and when ever a new vertex is added. It will be passed two arguments:

  - **error** `String` / `null` — *String* containing the error message, *null* if event listening is successful
  - **vref** `Vertex Reference` — of the newly added vertex.
  - **snapObj** `Property Snapshot` -- Snapshot of the data stored in the vertex. Take a look at the documentation of `Property Snapshot` on this page
- **onComplete** ``Function`` - Called when all the existing vertices have been retrieved. It will be called only once, with arguments:

  - **nsref** ``Namespace Reference`` — of the vertex where the edge is added.

``Note:`` ``vertex_added`` event listener returns the existing vertices in the namespace when listening for the first time.

### off()

Turn off the listeners on a given namespace reference.

``nsref.off([eventType])``

- **eventType** ``String`` (optional) — Either "vertex_added" or "vertex_removed". Turns off all listeners on the reference if this argument is not passed.

## Utility

### name()

Returns the name of the current reference.

```js
var nsref = Appbase.ns('user')
var name = nsref.name(); // name = 'user'
```

**Usage**

``nsref.name()``

**Returns**

**name** ``String`` Name of the ``nsref``.

### path()

Returns the path of the current reference.

```js
var path = nsref.path() // path equals "Domains"
```

**Usage**

``nsref.path()``

The method accepts no arguments, and returns a path of the ``nsref`` resource. Since namespaces are top-level objects, the path for a namespace is just the *namesapce identifier*.

**Returns**

**path** ``String`` Path of the ``nsref`` is usually the namespace identifier.

### URL()

Appbase URL of the current reference.

```js
// url equals "api.appbase.io/appname/v2/Domains"
var url = nsref.URL()
```

**Usage**

``nsref.URL()``

The method accepts no arguments, and returns a URL of the ``nsref`` resource.

**Returns**

**url** ``String`` Data URL of the namespace reference. The format of the URL is ``api.appbase.io/:appname/:version/namespace``.

# Vertex Reference

Vertex Reference Object or ``vref`` has the methods for setting data, creating links to other vertices, and different listeners to notify about data changes, link changes, etc.

## Storing Data

### setData()

Set one or more data properties on this vertex reference.

```js
var vref = Appbase.ns("Domains").v("www.appbase.io");
data = {
  "tld": "io",
  "registered": "2013",
  "visits": 0
}
vref.setData(data, function(error, vref) {
  if (!error) console.log("data successfully set.");
});
```

**Usage**

``vref.setData(dataObject [, onComplete])``

- **dataObject** ``Object`` — A valid JSON object. Can contain a nested object, or arrays.
- **onComplete** ``Function`` (optional) — will be passed two arguments:

	- **error** ``String`` / ``null`` — *String* containing the error message, *null* if ``setData()`` worked successfully.
	- **vref** ``Object`` — *Vertex Reference* of the vertex on which ``setData()`` has been applied.

### commitData()

Atomically modify properties of the vertex. Unlike setData(), which just overwrites the properties regardless of their previous values, commitData() is used to modify the existing value to a new value, ensuring there are no conflicts with other clients writing to the same location at the same time.

```js
var vref = Appbase.ns("Domains").v("www.appbase.io");
vref.commitData(function(previousData) {
  var newData = {
    visits: previousData.visits
  };
  newData.visits += 1;
  return newData;
}, function(error, vref) {
  if (!error) console.log("data successfully commited.");
});
```

**Usage**

``vref.commitData(applyFunction [, onComplete])``

- **applyFunction** ``Function`` — is used to transform the current value into a new value. It will be passed the current data as a JSON object and it is supposed to return the new data as a JSON object. Note: only the properties defined in the new JSON object is commited to the server, others are persisted.
- **onComplete** ``Function`` (optional) — will be passed two arguments:

	- **error** ``String`` / ``null`` — *String* containing the error message, *null* if ``commitData()`` worked successfully.
	- **vref** ``Object`` — *Vertex Reference* of the vertex on which ``commitData()`` has been applied.

`applyFunction` is called once and the new data is sent to the server for write. If another client writes to the vertex before your new value is successfully written, the `applyFunction` will be called again with the new current value, and the write will be retried.

### removeData()

Removes one or more data properties from this vertex reference.

```js
vref.removeData("registered", function(error, vref) {
  if (!error) console.log("property removed successfully");
});
```

**Usage**

``vref.removeData(propertyName [, onComplete])``

- **propertyName** ``String`` / ``Array`` — One or more property names to be deleted.
- **onComplete** ``Function`` (optional) — will be passed two arguments:

	- **error** ``String`` / ``null`` — *String* containing the error message, *null* if ``removeData()`` worked successfully.
	- **vref** ``Vertex Reference`` —  of the vertex on which ``removeData()`` has been applied.

### setEdge()

Create a link to another vertex. You can optionally set priority to links.

```js
vref = Appbase.ns("Domains").v("www.appbase.io");
// Creates an edge "subdomains" to a new vertex
vref.setEdge("subdomains");
```

**Usage**

``vref.setEdge(edgeName [, outVertex, priority, onComplete])``

- **edgeName** ``String`` — Identifier for the outVertex. The identifier can contain all ascii characters except  whitespaces, ':', '/' and '~'. You can use ``Appbase.uuid()`` for setting a unique identifier.
- **outVertex** ``Vertex Reference`` (optional) — If passed, ``setEdge()`` will create a link from ``vref`` to the ``outVertex``. Otherwise, it will create a new vertex and create a link from ``vref`` to it.
- **priority** ``Number`` (optional) — If passed, the link will be assigned the priority. By default, the timestamp of edge creation is used as it's priority.
- **onComplete** ``Function`` (optional) — will be passed three arguments:

	- **error** ``String`` / ``null`` — *String* containing the error message, *null* if ``setEdge()`` worked successfully.
	- **vref** ``Vertex Reference`` — of the vertex on which ``setEdge()`` has been applied.
    - **outVertexRef** ``Vertex Reference`` - of the vertex which is added as an edge.

### removeEdge()

Remove a link from the current vertex.

```js
vref = Appbase.ns("Domains").v("www.appbase.io");
vref.removeEdge("subdomains", function(error, vref) {
  if (!error) console.log("vertex removed successfully");
});
```

**Usage**

``vref.removeEdge(edgeName [, onComplete])``

- **edgeName** ``String`` / ``Array`` — One or more edge names to be deleted.
- **onComplete** ``Function`` (optional) — will be passed two arguments:

	- **error** ``String`` / ``null`` — *String* containing the error message, *null* if ``removeEdge()`` worked successfully.
	- **vref** ``Vertex Reference`` —  of the vertex on which ``removeEdge()`` has been applied.

### destroy()

Destroys a vertex from Appbase. All edges pointing to this vertex are also removed. This causes **vertex_removed** to be fired on the namespace where this vertex belongs.

```js
vref = Appbase.ns("Domains").v("www.appbase.io");
vref.destroy(function(error, vref) {
  if (!error) console.log("vertex destroyed.");
});
```

**Usage**

``vref.destroy([, onComplete])``

- **onComplete** ``Function`` (optional) — will be passed the argument:

	- **error** ``String`` / ``null`` — *String* containing the error message, *null* if ``removeEdge()`` worked successfully.

## Retrieving Data

### on('properties')

Fetch current properties, and listen to changes in the properties of a vertex.

```js
var vref = Appbase.ns("Domains").v("www.appbase.io");

vref.on('properties', function(err,ref,snap){
   console.log(snap.properties().visits);
);

// It would print the current number of visits,
// and also every time the number changes.
```

**Usage**

``vref.on('properties', callback)``

- **callback** ``Function`` --- will be passed these as arguments:
    - **error** `String` / `null` -- *String* containing the error message, *null* if :function-name:`on('properties')` listening is successful
    - **abref** `Appbase Vertex Reference` -- points to the path on which the event is fired
    - **snapObj** `Property Snapshot` -- Snapshot of the data stored in the vertex. Take a look at the documentation of `Property Snapshot` on this page

### once('properties')

As the name suggests, it works exactly like `on("properties")` except that it will be fired only once. When you want to fetch only the current properties and don't want to listen to changes, you can use `once()`.

**Usage**

``vref.once('properties', callback)``

### on('edge_added')

Get existing edges added at a location, and listen to new ones.

**Usage**

``vref.on('edge_added' [, filters ],  callback [, onComplete])``

- **filters** `JSON Object` - Allows filtering of edges, and supports `startAt`, `endAt`, `limit`, `skip` and `onlyNew` filters
- **callback** `Function` - will be passed these as arguments:
    - **error** `String` / `null`
    - **edgeRef** `Appbase Vertex Reference` - pointing to path of the edge
    - **snapObj** `Edge Snapshot` - Snapshot of the edge. Take a look at the documentation of `Edge Snapshot` on this page
- **onComplete** ``Function`` - Called when all the existing edges have been retrieved. It will be called only once, with argments:
    - **vref** ``Vertex reference`` - of the vertex where edges are being added

With edge filters, it is possible to fetch only certain edges. It comes handy when there are large number of edges and you want to paginate them.

When more than one filter is provided, they work as logical `AND` and only the edges matchihg all filters will be fetched. This is what each filter means:

 1. **startAt** `Number` - Edges having priorities equal or more than this
 2. **endAt** `Number` - Edges having priorities equal or less than this
 3. **limit** `Number` - Only this number of edges
 4. **skip** `Number` - Skipping certain number of edges, which match all the other filters
 5. **onlyNew** `Boolean` - return only newly created edges

Notice that:
 - Filters are a way to fetch existing edges, thus they work only with _edge_added_ event
 - Edges are always returned ordered according to their priorities
 - When *endAt* < *startAt*, edges are returned in reverse order
 - You can NOT apply all the numeric filters (first four) to newly created edges, they are only for existing edges and it is NOT possible to apply filters to newly created edges in realtime
	- This means that the numeric filters can not be used with *onlyNew* set to be `true`
	- *Newly created* edges will NOT be fired when any of the numeric filter is applied, i.e. only the existing edges will be returned

```js
var belasTweets = Appbase.ns("user").v("bela/tweets");
belasTweets.on('edge_added', function(error, eRef, eSnap) {
	console.log("Added: ", eSnap.properties(),
  "with priority", eSnap.priority());
});
```

### on('edge_removed')

Listen to removal of edges.

**Usage**

``vref.on('edge_removed', callback)``

- **callback** `Function` - will be passed these as arguments:
    - **error** `String` / `null` --
    - **edgeRef** `Appbase Vertex Reference` - pointing to path of the edge.
    - **snapObj** `Edge Snapshot` - Snapshot of the edge. Take a look at the documentation of `Edge Snapshot` on this page

```js
var belasTweets = Appbase.ns("user").v("bela/tweets");
belasTweets.on('edge_removed', function(error, eRef, eSnap) {
  console.log(eRef.name(), eSnap.properties(), "removed");
});
```

### on('edge_changed')

When ever an edge is replaced, i.e. `setEdge()` is called with an existing edge name, this event is fired.

**Usage**

``vref.on('edge_changed', callback)``

- **callback** `Function` - will be passed these as arguments:
    - **error** `String` / `null` --
    - **edgeRef** `Appbase Vertex Reference` - pointing to path of the edge.
    - **snapObj** `Edge Snapshot` - Snapshot of the edge. Take a look at the documentation of `Edge Snapshot` on this page

```js
var belasTweets = Appbase.ns("user").v("bela/tweets");
belasTweets.on('edge_changed', function(error, eRef, eSnap) {
  console.log(eRef.name(), eSnap.properties(), "replaced");
});
```

## Utility

### outVertex()

Reference to the corresponding ``outVertex`` with the given name.

```js
vref = Appbase.ns("Domains").v("www.appbase.io");
// Returns the vertex reference to "Domains/www.appbase.io/subdomains".
outVertex = vref.outVertex("subdomains");
```

**Usage**

``vref.outVertex(edgeName)``

- **edgeName** ``String`` -- outVertex identifier.

**Returns**

- **vref** ``Vertex Reference`` of the outVertex.

### inVertex()

Reference to the corresponding ``inVertex`` from the current vertex.

```js
vref = Appbase.ns("Domains").v("www.appbase.io/subdomains");
// Returns the vertex reference to "Domains/www.appbase.io".
inVertex = vref.inVertex();
```

**Usage**

``vref.inVertex()``

``Note:`` Since vertices are accessed via a path, there is only one ``inVertex`` for each vertex. Calling this method on the root vertex such as ``Appbase.ns("Domains").v("www.appbase.io") will thrown an error.

**Returns**

- **vref** ``Vertex Reference`` of the inVertex.

### path()

Returns the path of the current reference.

```js
var path = vref.path() // path equals "Domains"
```

**Usage**

``vref.path()``

The method accepts no arguments, and returns a path of the ``vref`` resource.

**Returns**

**path** ``String`` Path of the ``vref`` is a UNIX style path of the format namespace/:vertex1/:vertex2/vref.

### name()

Returns the name of the current reference.

```js
var vref = Appbase.ns('user').v('andy/tools/rockhammer')
var name = vref.name(); // name = 'rockhammer'
```

**Usage**

``vref.name()``

**Returns**

**name** ``String`` Name of the ``vref``.

### URL()

Appbase URL of the current reference.

```js
// url equals "api.appbase.io/appname/v2/Domains"
var url = vref.URL();
```

**Usage**

``vref.URL()``

The method accepts no arguments, and returns a URL of the ``vref`` resource.

**Returns**

**url** ``String`` Data URL of the namespace reference. The format of the URL is ``api.appbase.io/:appname/:version/ns/:vertex1/:vertex2``.

# Data Snapshots

Data snapshots are immutable copies of the data stored at `Appbase References`_. There are two kinds of snapshots: `Property Snapshot`_ and `Edge Snapshot`_, fired when listening to on('properties') or one of the edge listeners.

### Property Snapshot

It holds the property data of a vertex in Appbase. It has the following methods to obtain the changes in the Appbase Reference.

| Method              | Returns                                                        |
|----------------     |----------------                                                |
| properties()        | data properties as a Javascript object                         |
| prevProperties()    | data properties before data change as a Javascript object      |

### Edge Snapshot

It holds the edge data. It has the following methods to obtain the edge related changes in the Appbase Reference.

| Method             | Returns                                                       |
|--------------------|---------------------------------------------------------------|
| name()             | name of the edge                                              |
| priority()         | current priority of the edge                                  |
| prevPriority()     | previous priority of the edge (``null`` if not set)           |
| properties()       | data properties as a Javascript object                        |
| prevProperties()   | data properties before data change as a Javascript object     |


text:
package gameplayer;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import mastercode.GameDataManager;
import mastercode.GameObjectDataParser;
import mastercode.GameObjectManager;
import mastercode.GameObjectManagerInterface;
import mastercode.Translator;
import gameengine.controller.HUDController;
import util.Reflection;
import gameengine.InventoryItem;
import gameengine.NonPlayerCharacter;
import gameengine.events.GameEventManager;
import gameengine.gamedata.DataConstants;
import gameengine.gamedata.GameIntro;
import gameengine.gamedata.GameIntroParser;
import gameengine.gamedata.GameMap;
import gameengine.gamedata.MapsAndTilesManager;
import gameengine.gamedata.PlayerCharacterData;
import gameengine.gamedata.QuestData;
import gameengine.party.PartyObject;
import gameengine.state.BattleState;
import gameengine.state.GameState;
import gameengine.state.GameTimeObject;
import gameengine.state.MapState;
import gameengine.state.TimeDecorator;
import jgame.platform.JGEngine;

/**
 * The JGEngine for the model (back end)
 * @author Amy/Tara/Ashley/Tim
 *
 */
@SuppressWarnings("serial")
public class PlayerEngine extends JGEngine implements DataConstants {

	private static final String MAP_STATE = "MAP";
	private Map<String, GameState> myStateMap;
	private GameState myCurrentState;
	private GameState myPreviousState;
	private GameEventManager myGameEventManager;

	private GameObjectDataParser myParser;
	private GameEventManager myEventManager;
	private GameIntroParser myGameIntroParser;

	private MapsAndTilesManager myMapsAndTilesManager;
	private GameObjectManager myGameObjectManager;

	private GameDataManager myDataManager;
	public static final int DEFAULT_TILE_SIZE = 39;
	public static final int NUMBER_OF_TILES = 17;
	@SuppressWarnings("unused")
        private int myWidth;
	@SuppressWarnings("unused")
        private int myHeight;
	private HUDController myController;
	private PartyObject myParty;
	private TimeDecorator myTimeDecorator;
	private GameTimeObject myTime;

	@SuppressWarnings("unused")
        private final static String MEDIA_PATH = "media"+File.separator+"media.tbl";

	/*
	 * instructions of the game that will be displayed on the splash screen
	 */
	private String myInstructions;

	/*
	 * the graphics name is the battle state background in the media table
	 */
	private String myBattleBackgroundGFX;

	/**
	 * file path of the properties file (ExpectingKeys.properties)
	 */
	private final String PROPERTIES_FILEPATH = "src/gameengine/gamedata/ExpectingKeys.properties";

	/**
	 * Keeps track of the list of GameObjects in the game, including Characters, tiles, items, etc
	 */

	public PlayerEngine (int width, int height, HUDController controller) {
		myWidth = width;
		myHeight = height;
		myController = controller;
		initEngineComponent(width, height);
		myStateMap = new HashMap<String, GameState>();

		//                initializeGameTime();
		//                myTime = new GameTimeObject(2000.0, 500.0, true, true);
		stop();
	}

	/**
	 * create game time object throught the Translator class
	 */
	private void initializeGameTime (String jsonFilePath) {
		Translator translator = new Translator();
		Object[] timeArgs = translator.translateSpecifiedItem("GameTimeObject",
				jsonFilePath, PROPERTIES_FILEPATH).get(0);
		for (Object o : timeArgs) {
			System.out.println("*****PlayerEngine: printing timeargs: "+o.toString()+", type is "+o.getClass().getName());
		}
		myTime = (GameTimeObject) Reflection.createInstance("gameengine.state.GameTimeObject", timeArgs);
	}

	public void setEventManager(GameEventManager newEventManager) {
		myGameEventManager = newEventManager;
	}

	public void initEngine(String filePath) {

		initializeGameTime(filePath);

		myGameIntroParser = new GameIntroParser(filePath);
		GameIntro introInfo = myGameIntroParser.parserIntroInformation();
		myInstructions = introInfo.getInstruction();
		myBattleBackgroundGFX = introInfo.getBattleBackgroundGFX();

		myMapsAndTilesManager = new MapsAndTilesManager(filePath);
		myMapsAndTilesManager.createMaps();

		myEventManager = new GameEventManager(this);
		this.setEventManager(myEventManager);

		myParser = new GameObjectDataParser(filePath, myEventManager);
		myDataManager = myParser.createData();
		myGameObjectManager = myDataManager.getGameObjectManager();

	}

	@Override
	public void initCanvas () {
		setCanvasSettings(NUMBER_OF_TILES, NUMBER_OF_TILES, DEFAULT_TILE_SIZE, DEFAULT_TILE_SIZE, null, null, null);
	}

	@Override
	public void initGame () {
		setFrameRate(60, 2);
		removeGameState("Game");
		setGameState("Game");
	}

	//* Title Screen *//
	public void startTitle() {
		removeObjects(null,0);
	}

	public void paintFrameTitle() {
		pressSpace();
	}

	public void doFrameTitle() {
		spaceSetState("Game");
	}

	public void pressSpace() {
		drawString("***~PRESS SPACE TO START~***",pfWidth()/2,(pfHeight()/2)-50,0);
		drawString(myInstructions,pfWidth()/2,pfHeight()/2,0);
	}

	public void startGameOver() {
		removeObjects(null,0);
	}

	public void doFrameGameOver() {
		spaceSetState("Title");
	}

	public void paintFrameGameOver() {
		drawString("***GAME OVER***",pfWidth()/2,(pfHeight()/2)-50,0);
		drawString(myInstructions,pfWidth()/2,pfHeight()/2,0);
	}

	public void spaceSetState(String state) {
		if(getKey(' ')) {
			clearKey(' ');
			removeGameState(state);
			setGameState(state);
		}
	}

	public void initStates(GameMap firstMap) {
		MapState mapState = new MapState(this, myGameObjectManager, myDataManager);
		mapState.setMaps(firstMap);
		myStateMap.put(MAP_STATE, mapState);
		System.out.println("^^^^PlayerEngine: initState: mapstate = " +mapState);
	}

	public void setBattleState(Queue<NonPlayerCharacter> enemy) {
		myPreviousState = myCurrentState;
		myCurrentState = new BattleState(this, myParty, enemy, myBattleBackgroundGFX);
	}

	public void startGame() {

		myParty = myParser.createPartyObject();
		myParty.setPlayerEngine(this);
		if (myParty.getPlayerStats() != null){
			myController.updateActionPanelStats(myParty);
		}
		myController.updateActionPanelParty(myParty);

		String firstMapID = myParty.getActivePlayer().getMapUniqueID();
		GameMap map = myMapsAndTilesManager.getMapByUniqueID(firstMapID);

		initStates(map);
		myCurrentState = myStateMap.get(MAP_STATE);

		myTimeDecorator = new TimeDecorator(myCurrentState, myTime);
	}

	public void doFrameGame () {

		myTime.update();
		if (myCurrentState instanceof BattleState) {
			myCurrentState.doFrameGameState();
		} else {
			myTimeDecorator.doFrameGameState();
		}
		myGameEventManager.runAllEvents();

		dbgShowFullStackTrace(true);
		dbgShowMessagesInPf(false);
	}

	public void paintFrameGame () {
		if (myCurrentState instanceof BattleState) {
			myCurrentState.paintFrameGameState();
		} else {
			myTimeDecorator.paintFrameGameState();
		}
	}

	// Sets the player field for a MapState
	public void setPlayerField(String uniqueID) {
		int[] dimensions = myMapsAndTilesManager.getMapDimensions(uniqueID);
		setPFSize(dimensions[0],dimensions[1]+2);
	}

	/**
	 * set JGEngine in player character
	 */
	public void setPlayerCharacterDisplay () {
		GameObjectManagerInterface manager = new GameObjectManager(null);

		manager.setPlayerCharacterDisplay(this);
	}

	public GameMap getMaps(String uniqueID) {
		return myMapsAndTilesManager.getMapByUniqueID(uniqueID);
	}

	public HUDController getController(){
		return myController;
	}

	public void setGameStateMap(String mapID) {
		myCurrentState.setGameMap(this.getMaps(mapID));
	}

	public void moveParty(int[] newXY) {
		myParty.setPos((double) newXY[0], (double) newXY[1]);
	}

	public double[] getPartyXY() {
		double[] coordinate = {myParty.x, myParty.y};
		return coordinate;
	}

	public void addPartyQuest(QuestData quest) {

		myParty.addQuest(quest);
	}

	public boolean checkQuestCompletionandClear(String questType, String goalID) {
		boolean completed = myParty.checkQuestCompletion(questType, goalID); //Checks for quest completion and clears if completed
		this.getController().updateActionPanelQuests(myParty.getQuestDescriptions());
		return completed;
	}

	public void updateQuestStatus() {
		this.getController().updateActionPanelQuests(myParty.getQuestDescriptions());
	}

	public void addToInventory(InventoryItem item) {
		myParty.addToInventory(item);

		this.getController().updateActionPanelStats(myParty);
		this.getController().updateActionPanelInventory(myParty.getItems());
		this.getController().updateActionPanelParty(myParty);
	}

	public void boostStats(String stat, int increment) {
		myParty.incrementStat(stat, increment);
	}

	public void returnToPreviousState() {
		myCurrentState = myPreviousState;
		if(myCurrentState instanceof MapState) {
			MapState state = (MapState) myCurrentState;
			state.setMaps(state.getActiveMap());
		}

	}

	public PlayerCharacterData getActivePlayer() {
		return myParty.getActivePlayer();
	}

	public GameEventManager getEventManager() {
		return myEventManager;
	}

	public GameObjectManager getMyGameObjectManager() {
		return myGameObjectManager;
	}

	public GameDataManager getMyDataManager() {
		return myDataManager;
	}

	public PartyObject getParty(){
		return myParty;
	}
}


text:
#include "lib.h"
#include "array.h"
#include "lib-signals.h"
#include "ioloop.h"
#include "istream.h"
#include "istream-dot.h"
#include "istream-seekable.h"
#include "str.h"
#include "unichar.h"
#include "module-dir.h"
#include "wildcard-match.h"
#include "master-service.h"
#include "mail-user.h"
#include "mail-namespace.h"
#include "mail-storage.h"
#include "mail-storage-settings.h"
#include "mail-storage-service.h"
#include "mail-search-build.h"
#include "mail-search-parser.h"
#include "mailbox-list-iter.h"
#include "client-connection.h"
#include "doveadm.h"
#include "doveadm-settings.h"
#include "doveadm-print.h"
#include "doveadm-dsync.h"
#include "doveadm-mail.h"

#include <stdio.h>
#include <stdlib.h>

#define DOVEADM_MAIL_CMD_INPUT_TIMEOUT_MSECS (5*60*1000)

ARRAY_TYPE(doveadm_mail_cmd) doveadm_mail_cmds;
void (*hook_doveadm_mail_init)(struct doveadm_mail_cmd_context *ctx);
struct doveadm_mail_cmd_module_register
	doveadm_mail_cmd_module_register = { 0 };
char doveadm_mail_cmd_hide = '\0';

static int killed_signo = 0;

bool doveadm_is_killed(void)
{
	return killed_signo != 0;
}

void doveadm_mail_failed_error(struct doveadm_mail_cmd_context *ctx,
			       enum mail_error error)
{
	int exit_code = 0;

	switch (error) {
	case MAIL_ERROR_NONE:
		i_unreached();
	case MAIL_ERROR_TEMP:
		exit_code = EX_TEMPFAIL;
		break;
	case MAIL_ERROR_NOTPOSSIBLE:
	case MAIL_ERROR_EXISTS:
	case MAIL_ERROR_CONVERSION:
	case MAIL_ERROR_INVALIDDATA:
		exit_code = DOVEADM_EX_NOTPOSSIBLE;
		break;
	case MAIL_ERROR_PARAMS:
		exit_code = EX_USAGE;
		break;
	case MAIL_ERROR_PERM:
		exit_code = EX_NOPERM;
		break;
	case MAIL_ERROR_NOQUOTA:
		exit_code = EX_CANTCREAT;
		break;
	case MAIL_ERROR_NOTFOUND:
		exit_code = DOVEADM_EX_NOTFOUND;
		break;
	case MAIL_ERROR_EXPUNGED:
	case MAIL_ERROR_INUSE:
		exit_code = EX_TEMPFAIL;
		break;
	}
	/* tempfail overrides all other exit codes, otherwise use whatever
	   error happened first */
	if (ctx->exit_code == 0 || exit_code == EX_TEMPFAIL)
		ctx->exit_code = exit_code;
}

void doveadm_mail_failed_storage(struct doveadm_mail_cmd_context *ctx,
				 struct mail_storage *storage)
{
	enum mail_error error;

	mail_storage_get_last_error(storage, &error);
	doveadm_mail_failed_error(ctx, error);
}

void doveadm_mail_failed_mailbox(struct doveadm_mail_cmd_context *ctx,
				 struct mailbox *box)
{
	doveadm_mail_failed_storage(ctx, mailbox_get_storage(box));
}

void doveadm_mail_failed_list(struct doveadm_mail_cmd_context *ctx,
			      struct mailbox_list *list)
{
	enum mail_error error;

	mailbox_list_get_last_error(list, &error);
	doveadm_mail_failed_error(ctx, error);
}

struct doveadm_mail_cmd_context *
doveadm_mail_cmd_alloc_size(size_t size)
{
	struct doveadm_mail_cmd_context *ctx;
	pool_t pool;

	i_assert(size >= sizeof(struct doveadm_mail_cmd_context));

	pool = pool_alloconly_create("doveadm mail cmd", 1024);
	ctx = p_malloc(pool, size);
	ctx->pool = pool;
	return ctx;
}

static int
cmd_purge_run(struct doveadm_mail_cmd_context *ctx, struct mail_user *user)
{
	struct mail_namespace *ns;
	struct mail_storage *storage;
	int ret = 0;

	for (ns = user->namespaces; ns != NULL; ns = ns->next) {
		if (ns->type != MAIL_NAMESPACE_TYPE_PRIVATE ||
		    ns->alias_for != NULL)
			continue;

		storage = mail_namespace_get_default_storage(ns);
		if (mail_storage_purge(storage) < 0) {
			i_error("Purging namespace '%s' failed: %s", ns->prefix,
				mail_storage_get_last_error(storage, NULL));
			doveadm_mail_failed_storage(ctx, storage);
			ret = -1;
		}
	}
	return ret;
}

static struct doveadm_mail_cmd_context *cmd_purge_alloc(void)
{
	struct doveadm_mail_cmd_context *ctx;

	ctx = doveadm_mail_cmd_alloc(struct doveadm_mail_cmd_context);
	ctx->v.run = cmd_purge_run;
	return ctx;
}

static void doveadm_mail_cmd_input_input(struct doveadm_mail_cmd_context *ctx)
{
	while (i_stream_read(ctx->cmd_input) > 0)
		i_stream_skip(ctx->cmd_input, i_stream_get_data_size(ctx->cmd_input));
	if (!ctx->cmd_input->eof)
		return;

	if (ctx->cmd_input->stream_errno != 0) {
		i_error("read(%s) failed: %s",
			i_stream_get_name(ctx->cmd_input),
			i_stream_get_error(ctx->cmd_input));
	}
	io_loop_stop(current_ioloop);
}

static void doveadm_mail_cmd_input_timeout(struct doveadm_mail_cmd_context *ctx)
{
	struct istream *input;

	input = i_stream_create_error_str(ETIMEDOUT, "Timed out in %u secs",
			DOVEADM_MAIL_CMD_INPUT_TIMEOUT_MSECS/1000);
	i_stream_set_name(input, i_stream_get_name(ctx->cmd_input));
	i_stream_destroy(&ctx->cmd_input);
	ctx->cmd_input = input;
	io_loop_stop(current_ioloop);
}

static void doveadm_mail_cmd_input_read(struct doveadm_mail_cmd_context *ctx)
{
	struct ioloop *ioloop;
	struct io *io;
	struct timeout *to;

	ioloop = io_loop_create();
	io = io_add(ctx->cmd_input_fd, IO_READ,
		    doveadm_mail_cmd_input_input, ctx);
	to = timeout_add(DOVEADM_MAIL_CMD_INPUT_TIMEOUT_MSECS,
			 doveadm_mail_cmd_input_timeout, ctx);
	/* read the pending input from stream. */
	io_loop_set_running(ioloop);
	doveadm_mail_cmd_input_input(ctx);
	if (io_loop_is_running(ioloop))
		io_loop_run(ioloop);
	io_remove(&io);
	timeout_remove(&to);
	io_loop_destroy(&ioloop);

	i_assert(ctx->cmd_input->eof);
	i_stream_seek(ctx->cmd_input, 0);
}

void doveadm_mail_get_input(struct doveadm_mail_cmd_context *ctx)
{
	struct istream *inputs[2];

	if (ctx->cmd_input != NULL)
		return;

	if (ctx->conn != NULL)
		inputs[0] = i_stream_create_dot(ctx->conn->input, FALSE);
	else {
		inputs[0] = i_stream_create_fd(STDIN_FILENO, 1024*1024, FALSE);
		i_stream_set_name(inputs[0], "stdin");
	}
	inputs[1] = NULL;
	ctx->cmd_input_fd = i_stream_get_fd(inputs[0]);
	ctx->cmd_input = i_stream_create_seekable_path(inputs, 1024*256,
						       "/tmp/doveadm.");
	i_stream_set_name(ctx->cmd_input, i_stream_get_name(inputs[0]));
	i_stream_unref(&inputs[0]);

	doveadm_mail_cmd_input_read(ctx);
}

struct mailbox *
doveadm_mailbox_find(struct mail_user *user, const char *mailbox)
{
	struct mail_namespace *ns;

	if (!uni_utf8_str_is_valid(mailbox)) {
		i_fatal_status(EX_DATAERR,
			       "Mailbox name not valid UTF-8: %s", mailbox);
	}

	ns = mail_namespace_find(user->namespaces, mailbox);
	return mailbox_alloc(ns->list, mailbox, MAILBOX_FLAG_IGNORE_ACLS);
}

struct mail_search_args *
doveadm_mail_build_search_args(const char *const args[])
{
	struct mail_search_parser *parser;
	struct mail_search_args *sargs;
	const char *error, *charset = "UTF-8";

	parser = mail_search_parser_init_cmdline(args);
	if (mail_search_build(mail_search_register_get_human(),
			      parser, &charset, &sargs, &error) < 0)
		i_fatal("%s", error);
	mail_search_parser_deinit(&parser);
	return sargs;
}

static int cmd_force_resync_box(struct doveadm_mail_cmd_context *ctx,
				const struct mailbox_info *info)
{
	struct mailbox *box;
	int ret = 0;

	box = mailbox_alloc(info->ns->list, info->vname,
			    MAILBOX_FLAG_IGNORE_ACLS);
	if (mailbox_open(box) < 0) {
		i_error("Opening mailbox %s failed: %s", info->vname,
			mailbox_get_last_error(box, NULL));
		doveadm_mail_failed_mailbox(ctx, box);
		ret = -1;
	} else if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FORCE_RESYNC |
				MAILBOX_SYNC_FLAG_FIX_INCONSISTENT) < 0) {
		i_error("Forcing a resync on mailbox %s failed: %s",
			info->vname, mailbox_get_last_error(box, NULL));
		doveadm_mail_failed_mailbox(ctx, box);
		ret = -1;
	}
	mailbox_free(&box);
	return ret;
}

static int cmd_force_resync_run(struct doveadm_mail_cmd_context *ctx,
				struct mail_user *user)
{
	const enum mailbox_list_iter_flags iter_flags =
		MAILBOX_LIST_ITER_RETURN_NO_FLAGS |
		MAILBOX_LIST_ITER_STAR_WITHIN_NS;
	const enum mail_namespace_type ns_mask = MAIL_NAMESPACE_TYPE_MASK_ALL;
	struct mailbox_list_iterate_context *iter;
	const struct mailbox_info *info;
	int ret = 0;

	iter = mailbox_list_iter_init_namespaces(user->namespaces, ctx->args,
						 ns_mask, iter_flags);
	while ((info = mailbox_list_iter_next(iter)) != NULL) {
		if ((info->flags & (MAILBOX_NOSELECT |
				    MAILBOX_NONEXISTENT)) == 0) T_BEGIN {
			if (cmd_force_resync_box(ctx, info) < 0)
				ret = -1;
		} T_END;
	}
	if (mailbox_list_iter_deinit(&iter) < 0) {
		i_error("Listing mailboxes failed: %s",
			mailbox_list_get_last_error(user->namespaces->list, NULL));
		doveadm_mail_failed_list(ctx, user->namespaces->list);
		ret = -1;
	}
	return ret;
}

static void
cmd_force_resync_init(struct doveadm_mail_cmd_context *_ctx ATTR_UNUSED,
		      const char *const args[])
{
	if (args[0] == NULL)
		doveadm_mail_help_name("force-resync");
}

static struct doveadm_mail_cmd_context *cmd_force_resync_alloc(void)
{
	struct doveadm_mail_cmd_context *ctx;

	ctx = doveadm_mail_cmd_alloc(struct doveadm_mail_cmd_context);
	ctx->v.init = cmd_force_resync_init;
	ctx->v.run = cmd_force_resync_run;
	return ctx;
}

static int
doveadm_mail_next_user(struct doveadm_mail_cmd_context *ctx,
		       const struct mail_storage_service_input *input,
		       const char **error_r)
{
	const char *error, *ip;
	int ret;

	ip = net_ip2addr(&input->remote_ip);
	if (ip[0] == '\0')
		i_set_failure_prefix("doveadm(%s): ", input->username);
	else
		i_set_failure_prefix("doveadm(%s,%s): ", ip, input->username);

	/* see if we want to execute this command via (another)
	   doveadm server */
	ret = doveadm_mail_server_user(ctx, input, error_r);
	if (ret != 0)
		return ret;

	ret = mail_storage_service_lookup(ctx->storage_service, input,
					  &ctx->cur_service_user, &error);
	if (ret <= 0) {
		if (ret < 0) {
			*error_r = t_strdup_printf("User lookup failed: %s",
						   error);
		}
		return ret;
	}

	if (ctx->v.prerun != NULL) {
		if (ctx->v.prerun(ctx, ctx->cur_service_user, error_r) < 0) {
			mail_storage_service_user_free(&ctx->cur_service_user);
			return -1;
		}
	}

	ret = mail_storage_service_next(ctx->storage_service,
					ctx->cur_service_user,
					&ctx->cur_mail_user);
	if (ret < 0) {
		*error_r = "User init failed";
		mail_storage_service_user_free(&ctx->cur_service_user);
		return ret;
	}

	if (ctx->cmd_input != NULL)
		i_stream_seek(ctx->cmd_input, 0);
	if (ctx->v.run(ctx, ctx->cur_mail_user) < 0) {
		i_assert(ctx->exit_code != 0);
	}
	mail_user_unref(&ctx->cur_mail_user);
	mail_storage_service_user_free(&ctx->cur_service_user);
	return 1;
}

int doveadm_mail_single_user(struct doveadm_mail_cmd_context *ctx,
			     const struct mail_storage_service_input *input,
			     const char **error_r)
{
	i_assert(input->username != NULL);

	ctx->cur_client_ip = input->remote_ip;
	ctx->cur_username = input->username;
	ctx->storage_service_input = *input;
	ctx->storage_service = mail_storage_service_init(master_service, NULL,
							 ctx->service_flags);
	ctx->v.init(ctx, ctx->args);
	if (hook_doveadm_mail_init != NULL)
		hook_doveadm_mail_init(ctx);

	return doveadm_mail_next_user(ctx, input, error_r);
}

static void sig_die(const siginfo_t *si, void *context ATTR_UNUSED)
{
	killed_signo = si->si_signo;
}

static void
doveadm_mail_all_users(struct doveadm_mail_cmd_context *ctx, char *argv[],
		       const char *wildcard_user)
{
	struct mail_storage_service_input input;
	unsigned int user_idx;
	const char *ip, *user, *error;
	int ret;

	ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP;

	memset(&input, 0, sizeof(input));
	input.service = "doveadm";

	ctx->storage_service_input = input;
	ctx->storage_service = mail_storage_service_init(master_service, NULL,
							 ctx->service_flags);
        lib_signals_set_handler(SIGINT, 0, sig_die, NULL);
	lib_signals_set_handler(SIGTERM, 0, sig_die, NULL);

	ctx->v.init(ctx, (const void *)argv);

	mail_storage_service_all_init(ctx->storage_service);

	if (hook_doveadm_mail_init != NULL)
		hook_doveadm_mail_init(ctx);

	user_idx = 0;
	while ((ret = ctx->v.get_next_user(ctx, &user)) > 0) {
		if (wildcard_user != NULL) {
			if (!wildcard_match_icase(user, wildcard_user))
				continue;
		}
		input.username = user;
		ctx->cur_username = user;
		doveadm_print_sticky("username", user);
		T_BEGIN {
			ret = doveadm_mail_next_user(ctx, &input, &error);
			if (ret < 0)
				i_error("%s", error);
			else if (ret == 0)
				i_info("User no longer exists, skipping");
		} T_END;
		if (ret == -1)
			break;
		if (doveadm_verbose) {
			if (++user_idx % 100 == 0) {
				printf("\r%d", user_idx);
				fflush(stdout);
			}
		}
		if (killed_signo != 0) {
			i_warning("Killed with signal %d", killed_signo);
			ret = -1;
			break;
		}
	}
	if (doveadm_verbose)
		printf("\n");
	ip = net_ip2addr(&ctx->cur_client_ip);
	if (ip[0] == '\0')
		i_set_failure_prefix("doveadm: ");
	else
		i_set_failure_prefix("doveadm(%s): ", ip);
	if (ret < 0) {
		i_error("Failed to iterate through some users");
		ctx->exit_code = EX_TEMPFAIL;
	}
}

static void
doveadm_mail_cmd_init_noop(struct doveadm_mail_cmd_context *ctx ATTR_UNUSED,
			   const char *const args[] ATTR_UNUSED)
{
}

static int
doveadm_mail_cmd_get_next_user(struct doveadm_mail_cmd_context *ctx,
			       const char **username_r)
{
	if (ctx->users_list_input == NULL)
		return mail_storage_service_all_next(ctx->storage_service, username_r);

	*username_r = i_stream_read_next_line(ctx->users_list_input);
	if (ctx->users_list_input->stream_errno != 0) {
		i_error("read(%s) failed: %s",
			i_stream_get_name(ctx->users_list_input),
			i_stream_get_error(ctx->users_list_input));
		return -1;
	}
	return *username_r != NULL ? 1 : 0;
}

static void
doveadm_mail_cmd_deinit_noop(struct doveadm_mail_cmd_context *ctx ATTR_UNUSED)
{
}

struct doveadm_mail_cmd_context *
doveadm_mail_cmd_init(const struct doveadm_mail_cmd *cmd,
		      const struct doveadm_settings *set)
{
	struct doveadm_mail_cmd_context *ctx;

	ctx = cmd->alloc();
	ctx->set = set;
	ctx->cmd = cmd;
	if (ctx->v.init == NULL)
		ctx->v.init = doveadm_mail_cmd_init_noop;
	if (ctx->v.get_next_user == NULL)
		ctx->v.get_next_user = doveadm_mail_cmd_get_next_user;
	if (ctx->v.deinit == NULL)
		ctx->v.deinit = doveadm_mail_cmd_deinit_noop;

	p_array_init(&ctx->module_contexts, ctx->pool, 5);
	return ctx;
}

static void
doveadm_mail_cmd(const struct doveadm_mail_cmd *cmd, int argc, char *argv[])
{
	struct doveadm_mail_cmd_context *ctx;
	const char *getopt_args, *wildcard_user, *error;
	int ret, c;

	ctx = doveadm_mail_cmd_init(cmd, doveadm_settings);
	ctx->full_args = (const void *)(argv + 1);

	ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT;
	if (doveadm_debug)
		ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_DEBUG;

	getopt_args = "AF:S:u:";
	/* keep context's getopt_args first in case it contains '+' */
	if (ctx->getopt_args != NULL)
		getopt_args = t_strconcat(ctx->getopt_args, getopt_args, NULL);
	ctx->cur_username = getenv("USER");
	wildcard_user = NULL;
	while ((c = getopt(argc, argv, getopt_args)) > 0) {
		switch (c) {
		case 'A':
			ctx->iterate_all_users = TRUE;
			break;
		case 'S':
			doveadm_settings->doveadm_socket_path = optarg;
			if (doveadm_settings->doveadm_worker_count == 0)
				doveadm_settings->doveadm_worker_count = 1;
			break;
		case 'u':
			ctx->service_flags |=
				MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP;
			ctx->cur_username = optarg;
			if (strchr(ctx->cur_username, '*') != NULL ||
			    strchr(ctx->cur_username, '?') != NULL) {
				wildcard_user = ctx->cur_username;
				ctx->cur_username = NULL;
			}
			break;
		case 'F':
			ctx->service_flags |=
				MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP;
			wildcard_user = "*";
			ctx->users_list_input =
				i_stream_create_file(optarg, 1024);
			break;
		default:
			if (ctx->v.parse_arg == NULL ||
			    !ctx->v.parse_arg(ctx, c))
				doveadm_mail_help(cmd);
		}
	}
	argv += optind;
	if (argv[0] != NULL && cmd->usage_args == NULL) {
		i_fatal_status(EX_USAGE, "doveadm %s: Unknown parameter: %s",
			       cmd->name, argv[0]);
	}
	ctx->args = (const void *)argv;
	if (ctx->v.preinit != NULL)
		ctx->v.preinit(ctx);

	ctx->iterate_single_user =
		!ctx->iterate_all_users && wildcard_user == NULL;
	if (doveadm_print_is_initialized() && !ctx->iterate_single_user) {
		doveadm_print_header("username", "Username",
				     DOVEADM_PRINT_HEADER_FLAG_STICKY |
				     DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE);
	}

	if (ctx->iterate_single_user) {
		struct mail_storage_service_input input;

		if (ctx->cur_username == NULL)
			i_fatal_status(EX_USAGE, "USER environment is missing and -u option not used");

		memset(&input, 0, sizeof(input));
		input.service = "doveadm";
		input.username = ctx->cur_username;
		ret = doveadm_mail_single_user(ctx, &input, &error);
		if (ret < 0)
			i_fatal("%s", error);
		else if (ret == 0)
			i_fatal_status(EX_NOUSER, "User doesn't exist");
	} else {
		ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_TEMP_PRIV_DROP;
		doveadm_mail_all_users(ctx, argv, wildcard_user);
	}
	if (ctx->search_args != NULL)
		mail_search_args_unref(&ctx->search_args);
	doveadm_mail_server_flush();
	ctx->v.deinit(ctx);
	doveadm_print_flush();

	/* service deinit unloads mail plugins, so do it late */
	mail_storage_service_deinit(&ctx->storage_service);

	if (ctx->users_list_input != NULL)
		i_stream_unref(&ctx->users_list_input);
	if (ctx->cmd_input != NULL)
		i_stream_unref(&ctx->cmd_input);
	if (ctx->exit_code != 0)
		doveadm_exit_code = ctx->exit_code;
	pool_unref(&ctx->pool);
}

static bool
doveadm_mail_cmd_try_find_multi_word(const struct doveadm_mail_cmd *cmd,
				     const char *cmdname, int *argc,
				     const char *const **argv)
{
	unsigned int len;

	if (*argc < 2)
		return FALSE;
	*argc -= 1;
	*argv += 1;

	len = strlen((*argv)[0]);
	if (strncmp(cmdname, (*argv)[0], len) != 0)
		return FALSE;

	if (cmdname[len] == ' ') {
		/* more args */
		return doveadm_mail_cmd_try_find_multi_word(cmd, cmdname + len + 1,
							    argc, argv);
	}
	if (cmdname[len] != '\0')
		return FALSE;

	/* match */
	return TRUE;
}

const struct doveadm_mail_cmd *
doveadm_mail_cmd_find_from_argv(const char *cmd_name, int *argc,
				const char *const **argv)
{
	const struct doveadm_mail_cmd *cmd;
	unsigned int cmd_name_len;
	const char *const *orig_argv;
	int orig_argc;

	i_assert(*argc > 0);

	cmd_name_len = strlen(cmd_name);
	array_foreach(&doveadm_mail_cmds, cmd) {
		if (strcmp(cmd->name, cmd_name) == 0)
			return cmd;

		/* see if it matches a multi-word command */
		if (strncmp(cmd->name, cmd_name, cmd_name_len) == 0 &&
		    cmd->name[cmd_name_len] == ' ') {
			const char *subcmd = cmd->name + cmd_name_len + 1;

			orig_argc = *argc;
			orig_argv = *argv;
			if (doveadm_mail_cmd_try_find_multi_word(cmd, subcmd,
								 argc, argv))
				return cmd;
			*argc = orig_argc;
			*argv = orig_argv;
		}
	}

	return NULL;
}

bool doveadm_mail_try_run(const char *cmd_name, int argc, char *argv[])
{
	const struct doveadm_mail_cmd *cmd;

	cmd = doveadm_mail_cmd_find_from_argv(cmd_name, &argc, (void *)&argv);
	if (cmd == NULL)
		return FALSE;
	doveadm_mail_cmd(cmd, argc, argv);
	return TRUE;
}

void doveadm_mail_register_cmd(const struct doveadm_mail_cmd *cmd)
{
	/* for now we'll just assume that cmd will be permanently in memory */
	array_append(&doveadm_mail_cmds, cmd, 1);
}

const struct doveadm_mail_cmd *doveadm_mail_cmd_find(const char *cmd_name)
{
	const struct doveadm_mail_cmd *cmd;

	array_foreach(&doveadm_mail_cmds, cmd) {
		if (strcmp(cmd->name, cmd_name) == 0)
			return cmd;
	}
	return NULL;
}

void doveadm_mail_usage(string_t *out)
{
	const struct doveadm_mail_cmd *cmd;

	array_foreach(&doveadm_mail_cmds, cmd) {
		if (cmd->usage_args == &doveadm_mail_cmd_hide)
			continue;
		str_printfa(out, "%s\t[-u <user>|-A] [-S <socket_path>]",
			    cmd->name);
		if (cmd->usage_args != NULL)
			str_printfa(out, " %s", cmd->usage_args);
		str_append_c(out, '\n');
	}
}

void doveadm_mail_help(const struct doveadm_mail_cmd *cmd)
{
	fprintf(stderr, "doveadm %s [-u <user>|-A] [-S <socket_path>] %s\n",
		cmd->name, cmd->usage_args == NULL ? "" : cmd->usage_args);
	exit(EX_USAGE);
}

void doveadm_mail_try_help_name(const char *cmd_name)
{
	const struct doveadm_mail_cmd *cmd;

	cmd = doveadm_mail_cmd_find(cmd_name);
	if (cmd != NULL)
		doveadm_mail_help(cmd);
}

bool doveadm_mail_has_subcommands(const char *cmd_name)
{
	const struct doveadm_mail_cmd *cmd;
	unsigned int len = strlen(cmd_name);

	array_foreach(&doveadm_mail_cmds, cmd) {
		if (strncmp(cmd->name, cmd_name, len) == 0 &&
		    cmd->name[len] == ' ')
			return TRUE;
	}
	return FALSE;
}

void doveadm_mail_help_name(const char *cmd_name)
{
	doveadm_mail_try_help_name(cmd_name);
	i_fatal("Missing help for command %s", cmd_name);
}

static struct doveadm_mail_cmd cmd_force_resync = {
	cmd_force_resync_alloc, "force-resync", "<mailbox mask>"
};
static struct doveadm_mail_cmd cmd_purge = {
	cmd_purge_alloc, "purge", NULL
};

static struct doveadm_mail_cmd *mail_commands[] = {
	&cmd_force_resync,
	&cmd_purge,
	&cmd_expunge,
	&cmd_save,
	&cmd_search,
	&cmd_fetch,
	&cmd_flags_add,
	&cmd_flags_remove,
	&cmd_flags_replace,
	&cmd_import,
	&cmd_index,
	&cmd_altmove,
	&cmd_copy,
	&cmd_deduplicate,
	&cmd_move,
	&cmd_mailbox_list,
	&cmd_mailbox_create,
	&cmd_mailbox_delete,
	&cmd_mailbox_rename,
	&cmd_mailbox_subscribe,
	&cmd_mailbox_unsubscribe,
	&cmd_mailbox_status,
	&cmd_mailbox_metadata_set,
	&cmd_mailbox_metadata_unset,
	&cmd_mailbox_metadata_get,
	&cmd_mailbox_metadata_list,
	&cmd_batch,
	&cmd_dsync_backup,
	&cmd_dsync_mirror,
	&cmd_dsync_server
};

void doveadm_mail_init(void)
{
	struct module_dir_load_settings mod_set;
	unsigned int i;

	i_array_init(&doveadm_mail_cmds, 32);
	for (i = 0; i < N_ELEMENTS(mail_commands); i++)
		doveadm_mail_register_cmd(mail_commands[i]);

	memset(&mod_set, 0, sizeof(mod_set));
	mod_set.abi_version = DOVECOT_ABI_VERSION;
	mod_set.require_init_funcs = TRUE;
	mod_set.debug = doveadm_debug;
	mod_set.binary_name = "doveadm";

	/* load all configured mail plugins */
	mail_storage_service_modules =
		module_dir_load_missing(mail_storage_service_modules,
					doveadm_settings->mail_plugin_dir,
					doveadm_settings->mail_plugins,
					&mod_set);
}

void doveadm_mail_deinit(void)
{
	array_free(&doveadm_mail_cmds);
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Öst. Z. Pilzk. 8: 218 (1999)

#### Original name
Rhodocybe parilis var. wagramensis Hauskn. & Noordel.

### Remarks
null


text:
using System;
using System.Collections.Generic;
using System.Text;

public enum ReportLevel
{
    INFO,
    WARNING,
    ERROR,
    CRITICAL,
    FATAL
}


text:
using Newtonsoft.Json.Linq;

namespace PactNet.Matchers
{
    internal interface IMatcher
    {
        MatcherResult Match(string path, JToken expected, JToken actual);
    }
}


text: module.exports = require('./dist/documents/SearchDomain')


text:
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2013, PAL Robotics S.L.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//   * Redistributions of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//   * Redistributions in binary form must reproduce the above copyright
//     notice, this list of conditions and the following disclaimer in the
//     documentation and/or other materials provided with the distribution.
//   * Neither the name of PAL Robotics S.L. nor the names of its
//     contributors may be used to endorse or promote products derived from
//     this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//////////////////////////////////////////////////////////////////////////////

/// \author Adolfo Rodriguez Tsouroukdissian

#ifndef JOINT_LIMITS_INTERFACE_JOINT_LIMITS_ROSPARAM_H
#define JOINT_LIMITS_INTERFACE_JOINT_LIMITS_ROSPARAM_H

#include <string>

#include <ros/ros.h>
#include <joint_limits_interface/joint_limits.h>

namespace joint_limits_interface
{

/**
 * \brief Populate a JointLimits instance from the ROS parameter server.
 *
 * It is assumed that the following parameter structure is followed on the provided NodeHandle. Unspecified parameters
 * are simply not added to the joint limits specification.
 * \code
 * joint_limits:
 *   foo_joint:
 *     has_position_limits: true
 *     min_position: 0.0
 *     max_position: 1.0
 *     has_velocity_limits: true
 *     max_velocity: 2.0
 *     has_acceleration_limits: true
 *     max_acceleration: 5.0
 *     has_jerk_limits: true
 *     max_jerk: 100.0
 *     has_effort_limits: true
 *     max_effort: 20.0
 *   bar_joint:
 *     has_position_limits: false # Continuous joint
 *     has_velocity_limits: true
 *     max_velocity: 4.0
 * \endcode
 *
 * This specification is similar to the one used by MoveIt!,
 * but additionally supports jerk and effort limits.
 *
 * \param[in] joint_name Name of joint whose limits are to be fetched.
 * \param[in] nh NodeHandle where the joint limits are specified.
 * \param[out] limits Where joint limit data gets written into. Limits specified in the parameter server will overwrite
 * existing values. Values in \p limits not specified in the parameter server remain unchanged.
 * \return True if a limits specification is found (ie. the \p joint_limits/joint_name parameter exists in \p nh), false otherwise.
 */
inline bool getJointLimits(const std::string& joint_name, const ros::NodeHandle& nh, JointLimits& limits)
{
  // Node handle scoped where the joint limits are defined
  ros::NodeHandle limits_nh;
  try
  {
    const std::string limits_namespace = "joint_limits/" + joint_name;
    if (!nh.hasParam(limits_namespace))
    {
      ROS_DEBUG_STREAM("No joint limits specification found for joint '" << joint_name <<
                       "' in the parameter server (namespace " << nh.getNamespace() + "/" + limits_namespace << ").");
      return false;
    }
    limits_nh = ros::NodeHandle(nh, limits_namespace);
  }
  catch(const ros::InvalidNameException& ex)
  {
    ROS_ERROR_STREAM(ex.what());
    return false;
  }

  // Position limits
  bool has_position_limits = false;
  if(limits_nh.getParam("has_position_limits", has_position_limits))
  {
    if (!has_position_limits) {limits.has_position_limits = false;}
    double min_pos, max_pos;
    if (has_position_limits && limits_nh.getParam("min_position", min_pos) && limits_nh.getParam("max_position", max_pos))
    {
      limits.has_position_limits = true;
      limits.min_position = min_pos;
      limits.max_position = max_pos;
    }

    bool angle_wraparound;
    if (!has_position_limits && limits_nh.getParam("angle_wraparound", angle_wraparound))
    {
      limits.angle_wraparound = angle_wraparound;
    }
  }

  // Velocity limits
  bool has_velocity_limits = false;
  if(limits_nh.getParam("has_velocity_limits", has_velocity_limits))
  {
    if (!has_velocity_limits) {limits.has_velocity_limits = false;}
    double max_vel;
    if (has_velocity_limits && limits_nh.getParam("max_velocity", max_vel))
    {
      limits.has_velocity_limits = true;
      limits.max_velocity = max_vel;
    }
  }

  // Acceleration limits
  bool has_acceleration_limits = false;
  if(limits_nh.getParam("has_acceleration_limits", has_acceleration_limits))
  {
    if (!has_acceleration_limits) {limits.has_acceleration_limits = false;}
    double max_acc;
    if (has_acceleration_limits && limits_nh.getParam("max_acceleration", max_acc))
    {
      limits.has_acceleration_limits = true;
      limits.max_acceleration = max_acc;
    }
  }

  // Jerk limits
  bool has_jerk_limits = false;
  if(limits_nh.getParam("has_jerk_limits", has_jerk_limits))
  {
    if (!has_jerk_limits) {limits.has_jerk_limits = false;}
    double max_jerk;
    if (has_jerk_limits && limits_nh.getParam("max_jerk", max_jerk))
    {
      limits.has_jerk_limits = true;
      limits.max_jerk = max_jerk;
    }
  }

  // Effort limits
  bool has_effort_limits = false;
  if(limits_nh.getParam("has_effort_limits", has_effort_limits))
  {
    if (!has_effort_limits) {limits.has_effort_limits = false;}
    double max_effort;
    if (has_effort_limits && limits_nh.getParam("max_effort", max_effort))
    {
      limits.has_effort_limits = true;
      limits.max_effort = max_effort;
    }
  }

  return true;
}

}

#endif


text:
<?php

namespace PHPParser\Token;

abstract class Token {

}