text:
package com.gemstone.gemfire.internal.cache.control;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashSet;

import org.junit.experimental.categories.Category;

import com.gemstone.gemfire.cache.Region;
import com.gemstone.junit.UnitTest;

import junit.framework.TestCase;

/**
 * @author dsmith
 *
 */
@Category(UnitTest.class)
public class FilterByPathJUnitTest extends TestCase {
  public void testDefault() {
    FilterByPath filter = new FilterByPath(null, null);
    assertTrue(filter.include(createRegion("a")));
    assertTrue(filter.include(createRegion("b")));
    assertTrue(filter.include(createRegion("c")));
  }

  public void testInclude() {
    HashSet<String> included = new HashSet<String>();
    included.add("a");
    included.add("b");
    FilterByPath filter = new FilterByPath(included, null);
    assertTrue(filter.include(createRegion("a")));
    assertTrue(filter.include(createRegion("b")));
    assertFalse(filter.include(createRegion("c")));
  }

  public void testExclude() {
    HashSet<String> excluded = new HashSet<String>();
    excluded.add("a");
    excluded.add("b");
    FilterByPath filter = new FilterByPath(null, excluded);
    assertFalse(filter.include(createRegion("a")));
    assertFalse(filter.include(createRegion("b")));
    assertTrue(filter.include(createRegion("c")));
  }

  public void testBoth() {
    HashSet<String> included = new HashSet<String>();
    included.add("a");
    included.add("b");
    HashSet<String> excluded = new HashSet<String>();
    excluded.add("a");
    excluded.add("b");
    FilterByPath filter = new FilterByPath(included, excluded);
    assertTrue(filter.include(createRegion("a")));
    assertTrue(filter.include(createRegion("b")));
    assertFalse(filter.include(createRegion("c")));
  }

  private Region<?, ?> createRegion(String name) {
    RegionHandler handler = new RegionHandler(name);
    final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
    return (Region<?,?>) Proxy.newProxyInstance(contextClassLoader, new Class[] {Region.class}, handler);
  }

  public static class RegionHandler implements InvocationHandler {

    private String name;

    public RegionHandler(String name) {
      this.name = "/"+name;
    }
    public Object invoke(Object proxy, Method method, Object[] args)
        throws Throwable {
      return name;
    }

  }
}


text:
{{ template "chrome/system/header/social/_facebook.html" . }}
{{ template "chrome/system/header/social/_twitter.html" . }}
{{ template "chrome/system/header/social/_googleplus.html" . }}

redpajama_set_name: RedPajamaGithub


text:
#pragma once
#include <aws/macie2/Macie2_EXPORTS.h>
#include <aws/macie2/model/FindingsFilterAction.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/macie2/model/FindingCriteria.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace Macie2
{
namespace Model
{
  class AWS_MACIE2_API GetFindingsFilterResult
  {
  public:
    GetFindingsFilterResult();
    GetFindingsFilterResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    GetFindingsFilterResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The action that's performed on findings that meet the filter criteria
     * (findingCriteria). Possible values are: ARCHIVE, suppress (automatically
     * archive) the findings; and, NOOP, don't perform any action on the findings.

     */
    inline const FindingsFilterAction& GetAction() const{ return m_action; }

    /**
     *
The action that's performed on findings that meet the filter criteria
     * (findingCriteria). Possible values are: ARCHIVE, suppress (automatically
     * archive) the findings; and, NOOP, don't perform any action on the findings.

     */
    inline void SetAction(const FindingsFilterAction& value) { m_action = value; }

    /**
     *
The action that's performed on findings that meet the filter criteria
     * (findingCriteria). Possible values are: ARCHIVE, suppress (automatically
     * archive) the findings; and, NOOP, don't perform any action on the findings.

     */
    inline void SetAction(FindingsFilterAction&& value) { m_action = std::move(value); }

    /**
     *
The action that's performed on findings that meet the filter criteria
     * (findingCriteria). Possible values are: ARCHIVE, suppress (automatically
     * archive) the findings; and, NOOP, don't perform any action on the findings.

     */
    inline GetFindingsFilterResult& WithAction(const FindingsFilterAction& value) { SetAction(value); return *this;}

    /**
     *
The action that's performed on findings that meet the filter criteria
     * (findingCriteria). Possible values are: ARCHIVE, suppress (automatically
     * archive) the findings; and, NOOP, don't perform any action on the findings.

     */
    inline GetFindingsFilterResult& WithAction(FindingsFilterAction&& value) { SetAction(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the filter.

     */
    inline const Aws::String& GetArn() const{ return m_arn; }

    /**
     *
The Amazon Resource Name (ARN) of the filter.

     */
    inline void SetArn(const Aws::String& value) { m_arn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the filter.

     */
    inline void SetArn(Aws::String&& value) { m_arn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of the filter.

     */
    inline void SetArn(const char* value) { m_arn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the filter.

     */
    inline GetFindingsFilterResult& WithArn(const Aws::String& value) { SetArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the filter.

     */
    inline GetFindingsFilterResult& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the filter.

     */
    inline GetFindingsFilterResult& WithArn(const char* value) { SetArn(value); return *this;}

    /**
     *
The custom description of the filter.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
The custom description of the filter.

     */
    inline void SetDescription(const Aws::String& value) { m_description = value; }

    /**
     *
The custom description of the filter.

     */
    inline void SetDescription(Aws::String&& value) { m_description = std::move(value); }

    /**
     *
The custom description of the filter.

     */
    inline void SetDescription(const char* value) { m_description.assign(value); }

    /**
     *
The custom description of the filter.

     */
    inline GetFindingsFilterResult& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
The custom description of the filter.

     */
    inline GetFindingsFilterResult& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
The custom description of the filter.

     */
    inline GetFindingsFilterResult& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
The criteria that's used to filter findings.

     */
    inline const FindingCriteria& GetFindingCriteria() const{ return m_findingCriteria; }

    /**
     *
The criteria that's used to filter findings.

     */
    inline void SetFindingCriteria(const FindingCriteria& value) { m_findingCriteria = value; }

    /**
     *
The criteria that's used to filter findings.

     */
    inline void SetFindingCriteria(FindingCriteria&& value) { m_findingCriteria = std::move(value); }

    /**
     *
The criteria that's used to filter findings.

     */
    inline GetFindingsFilterResult& WithFindingCriteria(const FindingCriteria& value) { SetFindingCriteria(value); return *this;}

    /**
     *
The criteria that's used to filter findings.

     */
    inline GetFindingsFilterResult& WithFindingCriteria(FindingCriteria&& value) { SetFindingCriteria(std::move(value)); return *this;}

    /**
     *
The unique identifier for the filter.

     */
    inline const Aws::String& GetId() const{ return m_id; }

    /**
     *
The unique identifier for the filter.

     */
    inline void SetId(const Aws::String& value) { m_id = value; }

    /**
     *
The unique identifier for the filter.

     */
    inline void SetId(Aws::String&& value) { m_id = std::move(value); }

    /**
     *
The unique identifier for the filter.

     */
    inline void SetId(const char* value) { m_id.assign(value); }

    /**
     *
The unique identifier for the filter.

     */
    inline GetFindingsFilterResult& WithId(const Aws::String& value) { SetId(value); return *this;}

    /**
     *
The unique identifier for the filter.

     */
    inline GetFindingsFilterResult& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}

    /**
     *
The unique identifier for the filter.

     */
    inline GetFindingsFilterResult& WithId(const char* value) { SetId(value); return *this;}

    /**
     *
The custom name of the filter.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The custom name of the filter.

     */
    inline void SetName(const Aws::String& value) { m_name = value; }

    /**
     *
The custom name of the filter.

     */
    inline void SetName(Aws::String&& value) { m_name = std::move(value); }

    /**
     *
The custom name of the filter.

     */
    inline void SetName(const char* value) { m_name.assign(value); }

    /**
     *
The custom name of the filter.

     */
    inline GetFindingsFilterResult& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The custom name of the filter.

     */
    inline GetFindingsFilterResult& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
The custom name of the filter.

     */
    inline GetFindingsFilterResult& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
The position of the filter in the list of saved filters on the Amazon Macie
     * console. This value also determines the order in which the filter is applied to
     * findings, relative to other filters that are also applied to the findings.

     */
    inline int GetPosition() const{ return m_position; }

    /**
     *
The position of the filter in the list of saved filters on the Amazon Macie
     * console. This value also determines the order in which the filter is applied to
     * findings, relative to other filters that are also applied to the findings.

     */
    inline void SetPosition(int value) { m_position = value; }

    /**
     *
The position of the filter in the list of saved filters on the Amazon Macie
     * console. This value also determines the order in which the filter is applied to
     * findings, relative to other filters that are also applied to the findings.

     */
    inline GetFindingsFilterResult& WithPosition(int value) { SetPosition(value); return *this;}

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tags = value; }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tags = std::move(value); }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;}

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& AddTags(const Aws::String& key, const Aws::String& value) { m_tags.emplace(key, value); return *this; }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& AddTags(Aws::String&& key, const Aws::String& value) { m_tags.emplace(std::move(key), value); return *this; }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& AddTags(const Aws::String& key, Aws::String&& value) { m_tags.emplace(key, std::move(value)); return *this; }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& AddTags(Aws::String&& key, Aws::String&& value) { m_tags.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& AddTags(const char* key, Aws::String&& value) { m_tags.emplace(key, std::move(value)); return *this; }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& AddTags(Aws::String&& key, const char* value) { m_tags.emplace(std::move(key), value); return *this; }

    /**
     *
A map of key-value pairs that identifies the tags (keys and values) that are
     * associated with the filter.

     */
    inline GetFindingsFilterResult& AddTags(const char* key, const char* value) { m_tags.emplace(key, value); return *this; }

  private:

    FindingsFilterAction m_action;

    Aws::String m_arn;

    Aws::String m_description;

    FindingCriteria m_findingCriteria;

    Aws::String m_id;

    Aws::String m_name;

    int m_position;

    Aws::Map<Aws::String, Aws::String> m_tags;
  };

} // namespace Model
} // namespace Macie2
} // namespace Aws


text:
![status: inactive](https://img.shields.io/badge/status-inactive-red.svg)

This project is no longer actively developed or maintained. For new work on this check out [Getting started with Django](https://cloud.google.com/python/django/).

# Getting started with Django on Google Cloud Platform

This repository is an example of how to run a Django app on Google Managed
VMs.

## Contributing changes

* See [CONTRIBUTING.md](CONTRIBUTING.md)

## Licensing

* See [LICENSE](LICENSE)


text:
import types

import yaql
import yaql.context
import yaql.expressions

import murano.dsl.murano_object as murano_object
import murano.dsl.type_scheme as type_scheme
import murano.dsl.yaql_expression as yaql_expression

class LhsExpression(object):
    class Property(object):
        def __init__(self, getter, setter):
            self._getter = getter
            self._setter = setter

        def get(self):
            return self._getter()

        def set(self, value):
            self._setter(value)

    def __init__(self, expression):
        if isinstance(expression, (yaql_expression.YaqlExpression,
                                   yaql.expressions.Expression)):
            self._expression = expression
        else:
            self._expression = yaql.parse(str(expression))
        self._current_obj = None
        self._current_obj_name = None

    def _create_context(self, root_context, murano_class):
        def _get_value(src, key):
            if isinstance(src, types.DictionaryType):
                return src.get(key)
            elif isinstance(src, types.ListType) and isinstance(
                    key, types.IntType):
                return src[key]
            elif isinstance(src, murano_object.MuranoObject) and isinstance(
                    key, types.StringTypes):
                self._current_obj = src
                self._current_obj_name = key
                return src.get_property(key, murano_class)
            else:
                raise TypeError()

        def _set_value(src, key, value):
            if isinstance(src, types.DictionaryType):
                old_value = src.get(key, type_scheme.NoValue)
                src[key] = value
                if self._current_obj is not None:
                    try:
                        p_value = self._current_obj.get_property(
                            self._current_obj_name, murano_class)
                        self._current_obj.set_property(
                            self._current_obj_name, p_value, murano_class)
                    except Exception as e:
                        if old_value is not type_scheme.NoValue:
                            src[key] = old_value
                        else:
                            src.pop(key, None)
                        raise e
            elif isinstance(src, types.ListType) and isinstance(
                    key, types.IntType):
                old_value = src[key]
                src[key] = value
                if self._current_obj is not None:
                    try:
                        p_value = self._current_obj.get_property(
                            self._current_obj_name, murano_class)
                        self._current_obj.set_property(
                            self._current_obj_name, p_value, murano_class)
                    except Exception as e:
                        src[key] = old_value
                        raise e

            elif isinstance(src, murano_object.MuranoObject) and isinstance(
                    key, types.StringTypes):
                src.set_property(key, value, murano_class)
            else:
                raise TypeError()

        def get_context_data(path):
            path = path()

            def set_data(value):
                if not path or path == '$' or path == '$this':
                    raise ValueError()
                root_context.set_data(value, path)

            return LhsExpression.Property(
                lambda: root_context.get_data(path), set_data)

        @yaql.context.EvalArg('this', arg_type=LhsExpression.Property)
        def attribution(this, arg_name):
            arg_name = arg_name()
            return LhsExpression.Property(
                lambda: _get_value(this.get(), arg_name),
                lambda value: _set_value(this.get(), arg_name, value))

        @yaql.context.EvalArg("this", LhsExpression.Property)
        def indexation(this, index):
            return LhsExpression.Property(
                lambda: _get_value(this.get(), index()),
                lambda value: _set_value(this.get(), index(), value))

        context = yaql.context.Context()
        context.register_function(get_context_data, '#get_context_data')
        context.register_function(attribution, '#operator_.')
        context.register_function(indexation, "where")
        return context

    def __call__(self, value, context, murano_class):
        new_context = self._create_context(context, murano_class)
        new_context.set_data(context.get_data('$'))
        self._current_obj = None
        self._current_obj_name = None
        property = self._expression.evaluate(context=new_context)
        property.set(value)


text:
package com.project.library.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

@Entity
@Table(name = "BOOKS_LENT")
public class BooksLent {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "LENT_ID", unique = true)
	private Long lentId;

	@ManyToOne(optional = false, fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID", unique = true, referencedColumnName = "user_id")
	private User user;

	@ManyToOne(optional = false,  fetch = FetchType.EAGER)
	@JoinColumn(name = "BOOK_ID", unique = true, referencedColumnName = "book_id")
	private Book book;

	@Temporal(TemporalType.DATE)
	@DateTimeFormat(pattern = "yyyy-MM-dd")
    @Column(name = "LENT_FROM", nullable = false)
    private Date lentFrom;

	@Temporal(TemporalType.DATE)
	@DateTimeFormat(pattern = "yyyy-MM-dd")
    @Column(name = "LENT_UNTIL", nullable = false)
    private Date lentUntil;

	@Column(name = "BOOK_RETURNED", nullable = false)
	private boolean bookReturned;

	public Long getLentId() {
		return lentId;
	}

	public void setLentId(Long lentId) {
		this.lentId = lentId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Book getBook() {
		return book;
	}

	public void setBook(Book book) {
		this.book = book;
	}

	public Date getLentFrom() {
		return lentFrom;
	}

	public void setLentFrom(Date lentFrom) {
		this.lentFrom = lentFrom;
	}

	public Date getLentUntil() {
		return lentUntil;
	}

	public void setLentUntil(Date lentUntil) {
		this.lentUntil = lentUntil;
	}

	public boolean isBookReturned() {
		return bookReturned;
	}

	public void setBookReturned(boolean bookReturned) {
		this.bookReturned = bookReturned;
	}

	@Override
	public String toString() {
		return "BooksLent [lentId=" + lentId + ", user=" + user + ", book=" + book + ", lentFrom=" + lentFrom
				+ ", lentUntil=" + lentUntil + ", bookReturned=" + bookReturned + "]";
	}

}


text:
require 'spec_helper'

RSpec.describe Cryptoexchange::Exchanges::Cryptlocex::Market do
  it { expect(described_class::NAME).to eq 'cryptlocex' }
  it { expect(described_class::API_URL).to eq 'https://trade.cryptlocex.com/Api' }
end


text:
namespace Go2.Architecture.Domain.Commands
{
    using System;

    public class CommandHandlerNotFoundException : Exception
    {
        public CommandHandlerNotFoundException(Type type)
            : base(string.Format("Command handler not found for command type: {0}", type))
        {
        }

        public CommandHandlerNotFoundException(Type commandType, Type commandResult)
            : base(string.Format("Command handler not found for command type: {0}, and command result type: {1}", commandType, commandResult))
        {
        }
    }
}


text:
      Posted on

      by

            (

 pts
            )

      Deleted User

  Back to submission


text:
angular.module("MainApp").controller('RegisterController', ['$scope', '$http', '$location', 'userFactory', '$rootScope',
    function($scope, $http, $location, userFactory, $rootScope) {
        // Allow logging in
        $scope.register = function(form) {
            $http.post("/register", form).success(function(response){
                $scope.regerror = null;
                userFactory.set(response);
                $scope.refreshUser();
                if ($rootScope.previousPage){
                    $location.path($rootScope.previousPage);
                } else{
                    $location.path('/');
                }
            }).error(function(response){
                $scope.regerror = "Invalid username or password.";
            });
        };
}]);


text:
using System;
using Csla;

namespace SelfLoadSoftDelete.DataAccess.ERLevel
{
    /// <summary>
    /// DTO for G08_Region type
    /// </summary>
    public partial class G08_RegionDto
    {
        /// <summary>
        /// Gets or sets the parent Country ID.
        /// </summary>
        /// <value>The Country ID.</value>
        public int Parent_Country_ID { get; set; }

        /// <summary>
        /// Gets or sets the Regions ID.
        /// </summary>
        /// <value>The Region ID.</value>
        public int Region_ID { get; set; }

        /// <summary>
        /// Gets or sets the Regions Name.
        /// </summary>
        /// <value>The Region Name.</value>
        public string Region_Name { get; set; }
    }
}


text:
<!doctype html>
<meta charset=utf-8>
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/helpers.js"></script>
<script>
attribution_reporting_promise_test(async t => {
  await Promise.all([
    registerAttributionSrc(t, {source: {
      source_event_id: '1',
      destination: `https://{{host}}`,
      priority: '11',
    }}),
    registerAttributionSrc(t, {source: {
      source_event_id: '2',
      destination: `https://{{host}}`,
      priority: '13',
    }}),
    registerAttributionSrc(t, {source: {
      source_event_id: '3',
      destination: `https://{{host}}`,
      priority: '12',
    }}),
  ]);

  await registerAttributionSrc(t, {trigger: {
    event_trigger_data: [{}],
  }});

  const payload = await pollEventLevelReports();
  assert_equals(payload.reports.length, 1);
  const report = JSON.parse(payload.reports[0].body);
  assert_equals(report.source_event_id, '2');
}, 'Trigger is attributed to highest priority source.');
</script>


text:
<?php

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 27874 $');
define('NOZIP', 1);
// #################### PRE-CACHE TEMPLATES AND DATA ######################
if (! count($phrasegroups))
{
	$phrasegroups = array('vbcms', 'global', 'cpcms', 'cphome');
	$globaltemplates = array(
		'pagenav_curpage', 'pagenav_pagelinkrel', 'pagenav_pagelink','pagenav'
	);
}

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/adminfunctions_cms.php');
require_once(DIR . '/includes/functions_cms_layout.php');
require_once(DIR . '/includes/class_bootstrap_framework.php');
require_once(DIR . '/packages/vbcms/contentmanager.php');
require_once(DIR . '/includes/class_bootstrap_framework.php');
vB_Bootstrap_Framework::init();

if (! isset($vbulletin->userinfo['permissions']['cms']))
{
	vBCMS_Permissions::getUserPerms();
}

define('CMS_ADMIN', true);

// ######################## CHECK ADMIN PERMISSIONS #######################
if (!($vbulletin->userinfo['permissions']['cms']['admin']))
{
	print_cp_no_permission();
}

//Make sure the system knows where we are:
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$sect_js_varname = 'filter_section';
$current_user = new vB_Legacy_CurrentUser();
$per_page = vBCms_ContentManager::getPerPage($current_user);

$styles = false;
$layouts = false;

//It's possible we could have a post "do" and a get "do"that don't match. Let's make sure
// we get the right one.
if (isset($_POST['do']))
{
	$vbulletin->input->clean_array_gpc('p', array(
		'do'   => TYPE_STR,
		'mydo' => TYPE_STR,
	));
}
else
{
	$vbulletin->input->clean_array_gpc('r', array(
		'do'   => TYPE_STR,
	));
}

switch($vbulletin->GPC['do'])
{
	case 'list_nodes': //This is called from ajax.php. It returns a list of
		// sections and leaves for a display panel. Because
		//we're just returning xml for ajax we don't want any headers, etc.
		require_once DIR . '/includes/functions_misc.php';
		$vbulletin->input->clean_array_gpc('r', array(
			'nodeid' => TYPE_UINT,
			'level'  => TYPE_UINT,
		));

		if ($vbulletin->GPC_exists['nodeid'])
		{
			$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
			$xml->add_group('root');

			$xml->add_tag('html',  vBCms_ContentManager::getLeafPanel($vbulletin->GPC['nodeid'],
				   'sel_node_' . $vbulletin->GPC['nodeid'] , $vbulletin->GPC['level']));

			$xml->close_group();
			$xml->print_xml();
		}

		break;

	case 'find_leaves':  //This is also called from ajax.php. It returns a list of
		// sections and leaves for a display panel, with only leaves clickable. Because
		//we're just returning xml for ajax we don't want any headers, etc.
		require_once DIR . '/includes/functions_misc.php';

		$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
		$xml->add_group('root');

		$xml->add_tag('html',  vBCms_ContentManager::getNodeSearchResults());

		$xml->close_group();
		$xml->print_xml();

		break;

	case 'list_sections': //This is called from ajax.php. It returns a list of
		// sub-categories of the current node. Because
		//we're just returning xml for ajax we don't want any headers, etc.
		require_once DIR . '/includes/functions_misc.php';
		$vbulletin->input->clean_array_gpc('r', array(
			'sectionid' => TYPE_UINT,
			'level'     => TYPE_UINT,
		));

		$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
		$xml->add_group('root');

		$xml->add_tag('html',  vBCms_ContentManager::showSections($per_page));
		$xml->close_group();
		$xml->print_xml();

		break;

	case 'list_allsection': //This is called from ajax.php. It returns a list of
		// sub-categories of the current node. Because
		//we're just returning xml for ajax we don't want any headers, etc.
		require_once DIR . '/includes/functions_misc.php';
		$vbulletin->input->clean_array_gpc('r', array(
			'order' => TYPE_UINT,
		));

		$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
		$xml->add_group('root');
		$xml->add_tag('html',  vBCms_ContentManager::getSectionList($vbulletin->GPC['order']));
		$xml->close_group();
		$xml->print_xml();
		break;

	case 'list_categories' : //This is called from ajax with a sectionid to
		// list the categories in that section
		require_once DIR . '/includes/functions_misc.php';
		$vbulletin->input->clean_array_gpc('r', array(
			'sectionid' => TYPE_UINT,
		));

		$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
		$xml->add_group('root');

		$xml->add_tag('html',  vBCms_ContentManager::getCategoryList($vbulletin->GPC['sectionid']));
		$xml->close_group();
		$xml->print_xml();
		break;

	case 'find_categories': //This is called to list categories for the
		//article edit page. It creates a scrolling list. You can give it a string,
		// or a category, or a section.
		//we're just returning xml for ajax we don't want any headers, etc.
		require_once DIR . '/includes/functions_misc.php';
		$vbulletin->input->clean_array_gpc('r', array(
			'order' => TYPE_UINT,
		));

		$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
		$xml->add_group('root');
		$html = vBCms_ContentManager::getCategorySelector();

		if (!empty($html))
		{
			$xml->add_tag('html',  $html);
			$xml->close_group();
			$xml->print_xml();
		}
		break;

	case 'clear_cache':
		print_cp_header($vbphrase['vbcms']);
		if (method_exists(vB_Cache::instance(), 'clean'))
		{
			vB_Cache::instance()->clean(false);
			print_cp_message($vbphrase['cache_cleared']);
		}
		else
		{
			print_cp_message($vbphrase['no_cache_clean']);
		}
		print_cp_footer();
		break;

	case 'perpage': //Here are are updating the number of rows per page
		// This needs to be saved as a user preference. Then we will display
		// results again, which we will do because we don't have a "break"
		$current_user = new vB_Legacy_CurrentUser();
		$vbulletin->input->clean_array_gpc('r', array(
			'perpage' => TYPE_UINT,
			'sentfrom' => TYPE_STR,
		));

		// print_cp_header needs to come before calling vBCms_ContentManager::savePerPage
		// which starts printing a table, creating whitespace before the CP header
		print_cp_header($vbphrase['vbcms']);
		$per_page = vBCms_ContentManager::savePerPage($current_user);

		switch($vbulletin->GPC['sentfrom'])
		{
			case 'section':
				$redirect_do = 'section';
				break;
			case 'category':
				$redirect_do = 'category';
				break;
			case 'nodes':
			default:
				$redirect_do = 'list';
		}
		print_cp_message($vbphrase['saved_perpage'], 'cms_content_admin.php?' . $vbulletin->session->vars['sessionurl'] . "do=$redirect_do");
		print_cp_footer();
		break;

	case 'filter_category':
	case 'category': //Here we are viewing the category browser.
		$vbulletin->input->clean_array_gpc('r', array(
			'nodeid'       => TYPE_INT,
			'title_filter' => TYPE_STR,
			'categoryid'   => TYPE_INT,
			'sectionid'    => TYPE_INT,
			'page'         => TYPE_INT,
			'level'        => TYPE_UINT,
			));
		print_cp_header($vbphrase['category_manager']);

		if ($vbulletin->GPC_exists['sectionid'])
		{
			echo vBCms_ContentManager::showCategories($vbulletin->GPC['sectionid'], $per_page,
				$vbulletin->GPC['page']);
		} else
		{
			echo vBCms_ContentManager::showCategories(false, $per_page,
				$vbulletin->GPC['page']);
		}
		print_cp_footer();
		break;

	case 'delete_category' :
	case 'save_category':
	case 'new_category' :
	case 'save_categories':
	case 'move_category' :
	case 'saveonecategorystate':
		$vbulletin->input->clean_array_gpc('r', array(
			'categoryid'        => TYPE_INT,
			'sectionid'         => TYPE_INT,
			'target_categoryid' => TYPE_INT,
			'title'             => TYPE_STR,
			'page'              => TYPE_INT,
		));

		if ($vbulletin->GPC_exists['sectionid'] OR $vbulletin->GPC_exists['categoryid'])
		{
			echo vBCms_ContentManager:: updateCategories();
		}
		print_cp_header($vbphrase['category_manager']);
		echo vBCms_ContentManager::showCategories($vbulletin->GPC['sectionid'], $per_page,
				$vbulletin->GPC['page']);
		print_cp_footer();
		break;

	case 'move_node' :
	case 'publish_nodes' :
	case 'unpublish_nodes' :
	case 'save_nodes':
	case 'delete_nodes' :
	case 'set_order':
	case 'new':
		echo vBCms_ContentManager:: updateSections();

		print_cp_header($vbphrase['content_manager']);
		echo vBCms_ContentManager::showNodes($per_page);
		print_cp_footer();
		break;

	case 'delete_section' :
	case 'move_section' :
	case 'publish_section' :
	case 'unpublish_section' :
	case 'saveonetitle':
	case 'saveonelayout':
	case 'saveonestyle':
	case 'save_section' :
	case 'saveonecl':
	case 'sectionpriority':
	case 'sectionpp':
	case 'saveonesectionstate':
	case 'new_section':
	case 'set_order':
	case 'swap_sections':
		echo vBCms_ContentManager::updateSections();

		print_cp_header($vbphrase['section_manager']);
		echo vBCms_ContentManager::showSections($per_page);
		print_cp_footer();
		break;

	case 'saveonenodestate':
		vBCms_ContentManager::updateSections();

		print_cp_header($vbphrase['content_manager']);
		echo vBCms_ContentManager::showNodes($per_page);
		print_cp_footer();
		break;

	case 'section': //Here we are viewing the category browser.
		$vbulletin->input->clean_array_gpc('r', array(
			'nodeid'    => TYPE_INT,
			'sectionid' => TYPE_INT,
			'level'     => TYPE_UINT,
		));
		print_cp_header($vbphrase['section_manager']);

		if (! $vbulletin->GPC_exists['level'])
		{
			$vbulletin->GPC['level'] = '-1';
		}

		echo vBCms_ContentManager::showSections($per_page);
		print_cp_footer();

		break;

	case 'nodecontent': //Here we are view a specific node contents
		$vbulletin->input->clean_array_gpc('r', array(
			'nodegroup' => TYPE_INT,
		));
		print_cp_header($vbphrase['content_manager']);
		echo vBCms_ContentManager::showNodes($per_page);
		print_cp_footer();
		break;

	case 'sort':
	case 'filter':
		//figure out what type we're doing. It could be category or section.
		$vbulletin->input->clean_array_gpc('r', array(
			'sortby'         => TYPE_STR,
			'sortdir'        => TYPE_STR,
			'title_filter'   => TYPE_STR,
			'submit'         => TYPE_STR,
			'state_filter'   => TYPE_INT,
			'author_filter'  => TYPE_UINT,
			'filter_section' => TYPE_UINT,
			'sentfrom'       => TYPE_STR,
			'contenttypeid'  => TYPE_INT,
		));

		if ($vbulletin->GPC_exists['sentfrom'] and $vbulletin->GPC['sentfrom'] == 'nodes')
		{
			print_cp_header($vbphrase['content_manager']);
			echo vBCms_ContentManager::showNodes($per_page);
			print_cp_footer();
		}

		if (($vbulletin->GPC_exists['sentfrom'] and $vbulletin->GPC['sentfrom'] == 'section')
			or ($vbulletin->GPC_exists['contenttypeid']
			and $vbulletin->GPC['contenttypeid'] == vB_Types::instance()->getContentTypeID('vBCms_Section')))
		{
			print_cp_header($vbphrase['section_manager']);
			echo vBCms_ContentManager::showSections($per_page);
			print_cp_footer();
		}
		else if (($vbulletin->GPC_exists['sentfrom'] and $vbulletin->GPC['sentfrom'] == 'category') or
			($vbulletin->GPC_exists['contenttypeid']
			and $vbulletin->GPC['contenttypeid'] == vB_Types::instance()->getContentTypeID('vBCms_Category')))
		{
			print_cp_header($vbphrase['category_manager']);
			echo vBCms_ContentManager::showNodes($per_page, 'category');
			print_cp_footer();
		}
		 else
		{
			print_cp_header($vbphrase['content_manager']);
			echo vBCms_ContentManager::showNodes($per_page);
			print_cp_footer();
		}
	break;

	case 'filter_section':
		//figure out what type we're doing. It could be category or section.
		$vbulletin->input->clean_array_gpc('r', array(
			'sectionid' => TYPE_INT));
		print_cp_header($vbphrase['section_manager']);
		echo vBCms_ContentManager::showSections($per_page);
		print_cp_footer();
	break;

	case 'filter_nodesection':
		//figure out what type we're doing. It could be category or section.
		$vbulletin->input->clean_array_gpc('r', array(
			'sectionid' => TYPE_INT,
		));
		print_cp_header($vbphrase['content_manager']);
		echo vBCms_ContentManager::showNodes($per_page);
		print_cp_footer();
		break;

	case 'save':
		//figure out what type we're doing. It could be category or section.
		$vbulletin->input->clean_array_gpc('r', array(
			'sortby'         => TYPE_STR,
			'title_filter'   => TYPE_STR,
			'submit'         => TYPE_STR,
			'state_filter'   => TYPE_INT,
			'author_filter'  => TYPE_UINT,
			'filter_section' => TYPE_UINT,
			'sentfrom'       => TYPE_STR,
			'contenttypeid'  => TYPE_INT,
		));

		if ($vbulletin->GPC_exists['sentfrom'] and $vbulletin->GPC['sentfrom'] == 'section')
		{
			print_cp_header($vbphrase['section_manager']);
			vBCms_ContentManager::updateSections();
			echo vBCms_ContentManager::showSections($per_page);
			print_cp_footer();
		}
		else if (($vbulletin->GPC_exists['sentfrom'] and $vbulletin->GPC['sentfrom'] == 'category') or
			($vbulletin->GPC_exists['contenttypeid']
			and $vbulletin->GPC['contenttypeid'] == vB_Types::instance()->getContentTypeID('vBCms_Category')))
		{
			print_cp_header($vbphrase['category_manager']);
			vBCms_ContentManager::updateCategories();
			echo vBCms_ContentManager::showNodes($per_page, 'category');
			print_cp_footer();
		}
		else if ($vbulletin->GPC_exists['sentfrom'] and $vbulletin->GPC['sentfrom'] == 'nodes')
		{
			print_cp_header($vbphrase['content_manager']);
			vBCms_ContentManager::updateSections();
			echo vBCms_ContentManager::showNodes($per_page);
			print_cp_footer();
		}

	case 'fix_nodes':
		print_cp_header($vbphrase['vbcms']);
		echo vBCms_ContentManager::fixNodeLR();
		print_cp_message($vbphrase['nodetable_repaired']);
		print_cp_footer();
		break;

	case 'list': //This is our default action. We need to display a list of items.

	default:
		$vbulletin->input->clean_array_gpc('r', array(
			'sortby'         => TYPE_STR,
			'sortdir'        => TYPE_STR,
			'title_filter'   => TYPE_STR,
			'submit'         => TYPE_STR,
			'state_filter'   => TYPE_INT,
			'author_filter'  => TYPE_UINT,
			'filter_section' => TYPE_UINT,
			'contenttypeid'  => TYPE_INT));
		print_cp_header($vbphrase['content_manager']);
		echo vBCms_ContentManager::showNodes($per_page);
		print_cp_footer();

	break;
}

/*======================================================================*\
   || ####################################################################
   || #
   || # SVN: $Revision: 27874 $
   || ####################################################################
   \*======================================================================*/


text:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { PlusMenuModule, SectionModule, TabsModule } from '@swimlane/ngx-ui';
import { PrismModule } from '../../common/prism/prism.module';
import { PlusMenuPageRoutingModule } from './plus-menu-page-routing.module';
import { PlusMenuPageComponent } from './plus-menu-page.component';

@NgModule({
  declarations: [PlusMenuPageComponent],
  imports: [CommonModule, PrismModule, SectionModule, PlusMenuModule, PlusMenuPageRoutingModule, TabsModule]
})
export class PlusMenuPageModule {}


text:
import cornerstone from 'cornerstone-core';
import { MeasurementApi } from '../classes';
import log from '../../log';
import refreshCornerstoneViewports from '../lib/refreshCornerstoneViewports';

export default function handleSingleMeasurementRemoved({
  eventData,
  tool,
  toolGroupId,
  toolGroup,
}) {
  log.info('CornerstoneToolsMeasurementRemoved');
  const { measurementData, toolType } = eventData;

  const measurementApi = MeasurementApi.Instance;
  if (!measurementApi) {
    log.warn('Measurement API is not initialized');
  }

  const collection = measurementApi.tools[toolType];

  // Stop here if the tool data shall not be persisted (e.g. temp tools)
  if (!collection) return;

  const measurementTypeId = measurementApi.toolsGroupsMap[toolType];
  const measurement = collection.find(t => t._id === measurementData._id);

  // Stop here if the measurement is already gone or never existed
  if (!measurement) return;

  // Remove all the measurements with the given type and number
  const { lesionNamingNumber, timepointId } = measurement;
  measurementApi.deleteMeasurements(toolType, measurementTypeId, {
    lesionNamingNumber,
    timepointId,
  });

  // TODO: This is very hacky, but will work for now
  refreshCornerstoneViewports();

  if (MeasurementApi.isToolIncluded(tool)) {
    // TODO: Notify that viewer suffered changes
  }
}


text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.7.6.1">
  <compounddef id="structboost_1_1geometry_1_1section" kind="struct" prot="public">
    <compoundname>boost::geometry::section</compoundname>
    <includes local="no">sectionalize.hpp</includes>
    <templateparamlist>
      <param>
        <type>typename Box</type>
      </param>
      <param>
        <type>std::size_t</type>
        <declname>DimensionCount</declname>
        <defname>DimensionCount</defname>
      </param>
    </templateparamlist>
      <sectiondef kind="public-type">
      <memberdef kind="typedef" id="structboost_1_1geometry_1_1section_1af108ac0d53f757d11713b3ed175853e1" prot="public" static="no">
        <type>Box</type>
        <definition>typedef Box boost::geometry::section< Box, DimensionCount >::box_type</definition>
        <argsstring></argsstring>
        <name>box_type</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="79" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="79" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="public-static-attrib">
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1abaf3fc97103a7a6c20908d46269ec2fb" prot="public" static="yes" mutable="no">
        <type>std::size_t const</type>
        <definition>std::size_t const boost::geometry::section< Box, DimensionCount >::dimension_count</definition>
        <argsstring></argsstring>
        <name>dimension_count</name>
        <initializer> DimensionCount</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="80" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="80" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="public-attrib">
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1a8153615660d66b597e495a1362ef8b8c" prot="public" static="no" mutable="no">
        <type><ref refid="namespaceboost_1_1geometry_1af0c576f82145cf6a02dcbf48b675a0c2" kindref="member">signed_size_type</ref></type>
        <definition>signed_size_type boost::geometry::section< Box, DimensionCount >::begin_index</definition>
        <argsstring></argsstring>
        <name>begin_index</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="88" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="88" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1ad5c8cfcb157a993fb536edc1b9e2234b" prot="public" static="no" mutable="no">
        <type>Box</type>
        <definition>Box boost::geometry::section< Box, DimensionCount >::bounding_box</definition>
        <argsstring></argsstring>
        <name>bounding_box</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="84" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="84" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1a260d539a8c1ff423bed29949703ccc5b" prot="public" static="no" mutable="no">
        <type>std::size_t</type>
        <definition>std::size_t boost::geometry::section< Box, DimensionCount >::count</definition>
        <argsstring></argsstring>
        <name>count</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="90" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="90" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1a0e0f083db580cfc0bf5beacf788d5d29" prot="public" static="no" mutable="no">
        <type>int</type>
        <definition>int boost::geometry::section< Box, DimensionCount >::directions[DimensionCount]</definition>
        <argsstring>[DimensionCount]</argsstring>
        <name>directions</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="82" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="82" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1a7f9db8dc6850aeaeed634657ef2a4505" prot="public" static="no" mutable="no">
        <type>bool</type>
        <definition>bool boost::geometry::section< Box, DimensionCount >::duplicate</definition>
        <argsstring></argsstring>
        <name>duplicate</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="92" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="92" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1af420ac0f7a474a972dcb41ba65cb735e" prot="public" static="no" mutable="no">
        <type><ref refid="namespaceboost_1_1geometry_1af0c576f82145cf6a02dcbf48b675a0c2" kindref="member">signed_size_type</ref></type>
        <definition>signed_size_type boost::geometry::section< Box, DimensionCount >::end_index</definition>
        <argsstring></argsstring>
        <name>end_index</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="89" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="89" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1ac48ed22e337456afcf3ee28954e0ace6" prot="public" static="no" mutable="no">
        <type>bool</type>
        <definition>bool boost::geometry::section< Box, DimensionCount >::is_non_duplicate_first</definition>
        <argsstring></argsstring>
        <name>is_non_duplicate_first</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="95" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="95" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1a374dc7fdfb36ae88a3d535ae217f6472" prot="public" static="no" mutable="no">
        <type>bool</type>
        <definition>bool boost::geometry::section< Box, DimensionCount >::is_non_duplicate_last</definition>
        <argsstring></argsstring>
        <name>is_non_duplicate_last</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="96" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="96" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1abb38f79831d1a9d042c6bd0574e7aa06" prot="public" static="no" mutable="no">
        <type><ref refid="namespaceboost_1_1geometry_1af0c576f82145cf6a02dcbf48b675a0c2" kindref="member">signed_size_type</ref></type>
        <definition>signed_size_type boost::geometry::section< Box, DimensionCount >::non_duplicate_index</definition>
        <argsstring></argsstring>
        <name>non_duplicate_index</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="93" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="93" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1a4c7079b7c630b7273f0875a1cc0cc357" prot="public" static="no" mutable="no">
        <type>std::size_t</type>
        <definition>std::size_t boost::geometry::section< Box, DimensionCount >::range_count</definition>
        <argsstring></argsstring>
        <name>range_count</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="91" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="91" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="structboost_1_1geometry_1_1section_1a60a21532b6ed6c463d45e7daf50753e9" prot="public" static="no" mutable="no">
        <type><ref refid="structboost_1_1geometry_1_1ring__identifier" kindref="compound">ring_identifier</ref></type>
        <definition>ring_identifier boost::geometry::section< Box, DimensionCount >::ring_id</definition>
        <argsstring></argsstring>
        <name>ring_id</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="83" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="83" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="public-func">
      <memberdef kind="function" id="structboost_1_1geometry_1_1section_1a8615bfe852bf1c829b9b5874c01e9d35" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type></type>
        <definition>boost::geometry::section< Box, DimensionCount >::section</definition>
        <argsstring>()</argsstring>
        <name>section</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="107" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="98" bodyend="113"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
<para>Structure containing section information. </para>    </briefdescription>
    <detaileddescription>
<para>Section information consists of a bounding box, direction information (if it is increasing or decreasing, per dimension), index information (begin-end, ring, multi) and the number of segments in this section</para><para><parameterlist kind="templateparam"><parameteritem>
<parameternamelist>
<parametername>Box</parametername>
</parameternamelist>
<parameterdescription>
<para>box-type </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>DimensionCount</parametername>
</parameternamelist>
<parameterdescription>
<para>number of dimensions for this section </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>    </detaileddescription>
    <collaborationgraph>
      <node id="1058">
        boost::geometry::section< Box, DimensionCount >
        <link refid="structboost_1_1geometry_1_1section"/>
        <childnode refid="1059" relation="usage">
          <edgelabel>ring_id</edgelabel>
        </childnode>
      </node>
      <node id="1059">
        boost::geometry::ring_identifier
        <link refid="structboost_1_1geometry_1_1ring__identifier"/>
      </node>
    </collaborationgraph>
    <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" line="78" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/detail/sections/sectionalize.hpp" bodystart="77" bodyend="114"/>
    <listofallmembers>
      <member refid="structboost_1_1geometry_1_1section_1a8153615660d66b597e495a1362ef8b8c" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>begin_index</name></member>
      <member refid="structboost_1_1geometry_1_1section_1ad5c8cfcb157a993fb536edc1b9e2234b" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>bounding_box</name></member>
      <member refid="structboost_1_1geometry_1_1section_1af108ac0d53f757d11713b3ed175853e1" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>box_type</name></member>
      <member refid="structboost_1_1geometry_1_1section_1a260d539a8c1ff423bed29949703ccc5b" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>count</name></member>
      <member refid="structboost_1_1geometry_1_1section_1abaf3fc97103a7a6c20908d46269ec2fb" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>dimension_count</name></member>
      <member refid="structboost_1_1geometry_1_1section_1a0e0f083db580cfc0bf5beacf788d5d29" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>directions</name></member>
      <member refid="structboost_1_1geometry_1_1section_1a7f9db8dc6850aeaeed634657ef2a4505" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>duplicate</name></member>
      <member refid="structboost_1_1geometry_1_1section_1af420ac0f7a474a972dcb41ba65cb735e" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>end_index</name></member>
      <member refid="structboost_1_1geometry_1_1section_1ac48ed22e337456afcf3ee28954e0ace6" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>is_non_duplicate_first</name></member>
      <member refid="structboost_1_1geometry_1_1section_1a374dc7fdfb36ae88a3d535ae217f6472" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>is_non_duplicate_last</name></member>
      <member refid="structboost_1_1geometry_1_1section_1abb38f79831d1a9d042c6bd0574e7aa06" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>non_duplicate_index</name></member>
      <member refid="structboost_1_1geometry_1_1section_1a4c7079b7c630b7273f0875a1cc0cc357" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>range_count</name></member>
      <member refid="structboost_1_1geometry_1_1section_1a60a21532b6ed6c463d45e7daf50753e9" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>ring_id</name></member>
      <member refid="structboost_1_1geometry_1_1section_1a8615bfe852bf1c829b9b5874c01e9d35" prot="public" virt="non-virtual"><scope>boost::geometry::section</scope><name>section</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>


text:
#ifndef TORRENT_DISABLE_EXTENSIONS

#include "libtorrent/session.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/thread.hpp"
#include <boost/tuple/tuple.hpp>

#include "test.hpp"
#include "setup_transfer.hpp"
#include "libtorrent/extensions/metadata_transfer.hpp"
#include "libtorrent/extensions/ut_metadata.hpp"
#include "libtorrent/extensions/lt_trackers.hpp"
#include "libtorrent/bencode.hpp"

using boost::tuples::ignore;

int test_main()
{
	using namespace libtorrent;

	// these are declared before the session objects
	// so that they are destructed last. This enables
	// the sessions to destruct in parallel
	session_proxy p1;
	session_proxy p2;

	session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48130, 49000), "0.0.0.0", 0);
	session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49130, 50000), "0.0.0.0", 0);
	ses1.add_extension(create_lt_trackers_plugin);
	ses2.add_extension(create_lt_trackers_plugin);

	add_torrent_params atp;
	atp.info_hash = sha1_hash("12345678901234567890");
	atp.save_path = "./";
	error_code ec;
	torrent_handle tor1 = ses1.add_torrent(atp, ec);
	atp.trackers.push_back("http://test.non-existent.com/announce");
	torrent_handle tor2 = ses2.add_torrent(atp, ec);
	tor2.connect_peer(tcp::endpoint(address_v4::from_string("127.0.0.1"), ses1.listen_port()));

	// trackers are NOT supposed to be exchanged for torrents that we
	// don't have metadata for, since they might be private
	for (int i = 0; i < 10; ++i)
	{
		// make sure this function can be called on
		// torrents without metadata
		print_alerts(ses1, "ses1", false, true);
		print_alerts(ses2, "ses2", false, true);

		if (tor1.trackers().size() != 0) break;
		test_sleep(1000);
	}

	TEST_CHECK(tor1.trackers().size() == 0);

	entry info;
	info["pieces"] = "aaaaaaaaaaaaaaaaaaaa";
	info["name"] = "slightly shorter name, it's kind of sad that people started the trend of incorrectly encoding the regular name field and then adding another one with correct encoding";
	info["name.utf-8"] = "this is a long ass name in order to try to make make_magnet_uri overflow and hopefully crash. Although, by the time you read this that particular bug should have been fixed";
	info["piece length"] = 16 * 1024;
	info["length"] = 3245;
	entry torrent;
	torrent["info"] = info;

	std::vector<char> buf;
	bencode(std::back_inserter(buf), torrent);
	boost::intrusive_ptr<torrent_info> ti(new torrent_info(&buf[0], buf.size(), ec));
	TEST_CHECK(!ec);

	atp.ti = ti;
	atp.info_hash.clear();
	atp.save_path = "./";
	atp.trackers.clear();

	tor1 = ses1.add_torrent(atp, ec);
	atp.trackers.push_back("http://test.non-existent.com/announce");
	tor2 = ses2.add_torrent(atp, ec);
	tor2.connect_peer(tcp::endpoint(address_v4::from_string("127.0.0.1"), ses1.listen_port()));

	TEST_CHECK(tor1.trackers().size() == 0);

	for (int i = 0; i < 60; ++i)
	{
		// make sure this function can be called on
		// torrents without metadata
		print_alerts(ses1, "ses1", false, true);
		print_alerts(ses2, "ses2", false, true);

		if (tor1.trackers().size() == 1) break;
		test_sleep(1000);
	}

	TEST_CHECK(tor1.trackers().size() == 1);

	// this allows shutting down the sessions in parallel
	p1 = ses1.abort();
	p2 = ses2.abort();

	return 0;
}

#else
int test_main() { return 0; }
#endif // TORRENT_DISABLE_EXTENSIONS


text:
using namespace pwiz::util;
using namespace pwiz::cv;
using namespace pwiz::data;
using namespace pwiz::msdata;

ostream* os_ = 0;

void initializeTinyMGF(MSData& msd)
{
    FileContent& fc = msd.fileDescription.fileContent;
    fc.set(MS_MSn_spectrum);
    fc.set(MS_centroid_spectrum);

    //SourceFilePtr sourceFile(new SourceFile);
    //sourceFile->set(MS_multiple_peak_list_nativeID_format);
    // TODO: sourceFile->set(MS_Matrix_Science_MGF_format);
    //msd.fileDescription.sourceFilePtrs.push_back(sourceFile);

    shared_ptr<SpectrumListSimple> spectrumList(new SpectrumListSimple);
    msd.run.spectrumListPtr = spectrumList;
    spectrumList->spectra.push_back(SpectrumPtr(new Spectrum));
    spectrumList->spectra.push_back(SpectrumPtr(new Spectrum));

    Spectrum& s20 = *spectrumList->spectra[0];
    s20.id = "index=0";
    s20.index = 0;
    s20.set(MS_spectrum_title, s20.id);

    s20.set(MS_MSn_spectrum);
    s20.set(MS_ms_level, 2);

    s20.set(MS_centroid_spectrum);
    s20.set(MS_positive_scan);
    s20.set(MS_lowest_observed_m_z, 0.0);
    s20.set(MS_highest_observed_m_z, 18.0);
    s20.set(MS_base_peak_m_z, 0.0);
    s20.set(MS_base_peak_intensity, 20.0);
    s20.set(MS_total_ion_current, 110.0);

    s20.precursors.resize(1);
    Precursor& s20precursor = s20.precursors.front();
    s20precursor.selectedIons.resize(1);
    s20precursor.selectedIons[0].set(MS_selected_ion_m_z, 445.34, MS_m_z);
    s20precursor.selectedIons[0].set(MS_peak_intensity, 120053.0, MS_number_of_detector_counts);
    s20precursor.selectedIons[0].set(MS_charge_state, 2);

    s20.scanList.set(MS_no_combination);
    s20.scanList.scans.push_back(Scan());
    Scan& s20scan = s20.scanList.scans.back();
    s20scan.set(MS_scan_start_time, 4.0, UO_second);

    s20.setMZIntensityArrays(vector<double>(), vector<double>(), MS_number_of_detector_counts);
    vector<double>& s20_mz = s20.getMZArray()->data;
    vector<double>& s20_intensity = s20.getIntensityArray()->data;

    for (int i=0; i<10; i++)
        s20_mz.push_back(i*2);

    for (int i=0; i<10; i++)
        s20_intensity.push_back((10-i)*2);

    s20.defaultArrayLength = s20_mz.size();

    Spectrum& s21 = *spectrumList->spectra[1];
    s21.id = "index=1";
    s21.index = 1;
    s21.set(MS_spectrum_title, s21.id);

    s21.set(MS_MSn_spectrum);
    s21.set(MS_ms_level, 2);

    s21.set(MS_centroid_spectrum);
    s21.set(MS_negative_scan);
    s21.set(MS_lowest_observed_m_z, 3.0);
    s21.set(MS_highest_observed_m_z, 30.0);
    s21.set(MS_base_peak_m_z, 3.0);
    s21.set(MS_base_peak_intensity, 30.0);
    s21.set(MS_total_ion_current, 165.0);

    s21.precursors.resize(1);
    Precursor& s21precursor = s21.precursors.front();
    s21precursor.selectedIons.resize(1);
    s21precursor.selectedIons[0].set(MS_selected_ion_m_z, 424.24, MS_m_z);
    s21precursor.selectedIons[0].set(MS_peak_intensity, 4242.0, MS_number_of_detector_counts);
    s21precursor.selectedIons[0].cvParams.push_back(CVParam(MS_possible_charge_state, 2));
    s21precursor.selectedIons[0].cvParams.push_back(CVParam(MS_possible_charge_state, 3));

    s21.scanList.set(MS_no_combination);
    s21.scanList.scans.push_back(Scan());
    Scan& s21scan = s21.scanList.scans.back();
    s21scan.set(MS_scan_start_time, 42.0, UO_second);

    s21.setMZIntensityArrays(vector<double>(), vector<double>(), MS_number_of_detector_counts);
    vector<double>& s21_mz = s21.getMZArray()->data;
    vector<double>& s21_intensity = s21.getIntensityArray()->data;

    for (int i=1; i<=10; i++)
        s21_mz.push_back(i*3);

    for (int i=0; i<10; i++)
        s21_intensity.push_back((10-i)*3);

    s21.defaultArrayLength = s21_mz.size();

} // initializeTinyMGF()

void testWriteRead(const MSData& msd)
{
    Serializer_MGF serializer;

    ostringstream oss;
    serializer.write(oss, msd);

    if (os_) *os_ << "oss:\n" << oss.str() << endl;

    shared_ptr<istringstream> iss(new istringstream(oss.str()));
    MSData msd2;
    serializer.read(iss, msd2);

    DiffConfig diffConfig;
    diffConfig.ignoreIdentity = true;
    diffConfig.ignoreChromatograms = true;

    Diff<MSData, DiffConfig> diff(msd, msd2, diffConfig);
    if (os_ && diff) *os_ << diff << endl;
    unit_assert(!diff);

    if (os_)
    {
        *os_ << "msd2:\n";
        Serializer_mzML mzmlSerializer;
        mzmlSerializer.write(*os_, msd2);
        *os_ << endl;

        *os_ << "msd2::";
        TextWriter write(*os_);
        write(msd2);

        *os_ << endl;
    }
}

void testWriteRead()
{
    MSData msd;
    initializeTinyMGF(msd);

    testWriteRead(msd);
}

int main(int argc, char* argv[])
{
    TEST_PROLOG(argc, argv)

    try
    {
        if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
        testWriteRead();
    }
    catch (exception& e)
    {
        TEST_FAILED(e.what())
    }
    catch (...)
    {
        TEST_FAILED("Caught unknown exception.")
    }

    TEST_EPILOG
}


text:
package com.vapourdrive.expandedworld.events;

public class ForgeEventHooks
{

}


text:
Familiarize yourself with perfect forwarding failure cases
==========================================================

Base material
-------------

"Forwarding" just means that one function passes - *forwards* -
its parameters to another function. The goal is for the second
function (the one being forwarded to) to receive the same objects
that the first function (the one doing forwarding) received.

That rules out by-value parameters, because they're copies of what
the original caller passed in.

Pointer parameters are also ruled out, because we don't want to force
callers to pass pointers.

When it comes to general-purpose forwarding, we'll be dealing with
parameters that are references.

*Perfect forwarding* means we don't just forward objects, we also
forward their salient characteristics: their types, whether they're
lvalues or rvalues, and whether they're const or volatile.
In conjunction with the observation that we'll be dealing with
reference parameters, this implies that we'll be using universal
references, because only universal reference parameters encode
information about the lvalueness and rvalueness of the arguments
that are passed to them.

Kinds of arguments that can't be perfect-forwarded
--------------------------------------------------

- *braced initializers*
  perfect forwarding fails when either of the following occurs:
  - compilers are unabled to deduce types;
  - compilers deduce the "wrong" type;
- *0 or NULL as null pointers*
  when you try to pass 0 or NULL as a null pointer to a template,
  type deduction goes awry, deducing an integral type (typically int)
  instead of a pointer type for the argument you pass;
  the result is that neither 0 nor NULL can be perfect-forwarded as
  a null pointer. The fix is easy, however: pass "nullptr" instead
  of 0 or NULL;
- declaration-only integral static const data members;
- overloaded function names and template names;
- bitfilds.

Summary
-------

- perfect forwarding fails when template type deduction fails or when
  it deduces the wrong type;
- the kinds of arguments that lead to perfect forwardnig failure are
  braced initializers, null pointers expressed as 0 or NULL,
  declaration-only integral const static data members, template
  and overloaded function names, and bitfields.


text:
<?php

namespace Doctrine\Tests\DBAL\Platforms;

use Doctrine\DBAL\Platforms\InformixPlatform;
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table;

class InformixPlatformTest extends AbstractPlatformTestCase
{

    public function createPlatform()
    {
        return new InformixPlatform();
    }

    public function getGenerateTableSql()
    {
        return 'CREATE TABLE test (id SERIAL NOT NULL, '
            . 'test VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))';
    }

    public function getGenerateTableWithMultiColumnUniqueIndexSql()
    {
        return array(
            'CREATE TABLE test (foo VARCHAR(255) DEFAULT NULL, bar VARCHAR(255) DEFAULT NULL)',
            'CREATE UNIQUE INDEX UNIQ_D87F7E0C8C73652176FF8CAA ON test (foo, bar)'
        );
    }

    public function getGenerateIndexSql()
    {
        return 'CREATE INDEX my_idx ON mytable (user_name, last_login)';
    }

    public function getGenerateUniqueIndexSql()
    {
        return 'CREATE UNIQUE INDEX index_name ON test (test, test2)';
    }

    public function getGenerateForeignKeySql()
    {
        return 'ALTER TABLE test ADD CONSTRAINT FOREIGN KEY (fk_name_id) '
            . 'REFERENCES other_table (id)';
    }

    public function getGenerateConstraintUniqueIndexSql()
    {
        return 'ALTER TABLE test ADD CONSTRAINT UNIQUE (test) '
            . 'CONSTRAINT constraint_name';
    }

    public function getGenerateConstraintPrimaryIndexSql()
    {
        return 'ALTER TABLE test ADD CONSTRAINT PRIMARY KEY (test) '
            . 'CONSTRAINT constraint_name';
    }

    public function getGenerateConstraintForeignKeySql(ForeignKeyConstraint $fk)
    {
        $quotedForeignTable = $fk->getQuotedForeignTableName($this->_platform);

        return 'ALTER TABLE test ADD CONSTRAINT FOREIGN KEY (fk_name) '
            . 'REFERENCES ' . $quotedForeignTable . ' (id) CONSTRAINT constraint_fk';
    }

    public function getBitAndComparisonExpressionSql($value1, $value2)
    {
        return 'BITAND(' . $value1 . ', ' .  $value2 . ')';
    }

    public function getBitOrComparisonExpressionSql($value1, $value2)
    {
        return 'BITOR(' . $value1 . ', ' . $value2 . ')';
    }

    public function getGenerateAlterTableSql()
    {
        return array(
            'RENAME COLUMN mytable.bar TO baz',
            'ALTER TABLE mytable ADD quota INTEGER DEFAULT NULL, DROP foo, '
            . 'MODIFY baz VARCHAR(255) DEFAULT \'def\' NOT NULL, '
            . 'MODIFY bloo BOOLEAN DEFAULT \'f\' NOT NULL',
            'RENAME TABLE mytable TO userlist',
        );
    }

    public function getQuotedColumnInPrimaryKeySQL()
    {
        return array(
            'CREATE TABLE "quoted" ("create" VARCHAR(255) NOT NULL, '
            . 'PRIMARY KEY("create"))'
        );
    }

    public function getQuotedColumnInIndexSQL()
    {
        return array(
            'CREATE TABLE "quoted" ("create" VARCHAR(255) NOT NULL)',
            'CREATE INDEX IDX_22660D028FD6E0FB ON "quoted" ("create")'
        );
    }

    public function getQuotedColumnInForeignKeySQL()
    {
        return array(
            'CREATE TABLE "quoted" ("create" VARCHAR(255) NOT NULL, '
            . 'foo VARCHAR(255) NOT NULL, "bar" VARCHAR(255) NOT NULL)',
            'ALTER TABLE "quoted" ADD CONSTRAINT FOREIGN KEY ("create", foo, '
            . '"bar") REFERENCES "foreign" ("create", bar, "foo-bar") '
            . 'CONSTRAINT FK_WITH_RESERVED_KEYWORD',
            'ALTER TABLE "quoted" ADD CONSTRAINT FOREIGN KEY ("create", foo, '
            . '"bar") REFERENCES foo ("create", bar, "foo-bar") '
            . 'CONSTRAINT FK_WITH_NON_RESERVED_KEYWORD',
            'ALTER TABLE "quoted" ADD CONSTRAINT FOREIGN KEY ("create", foo, '
            . '"bar") REFERENCES "foo-bar" ("create", bar, "foo-bar") '
            . 'CONSTRAINT FK_WITH_INTENDED_QUOTATION'
        );
    }

    public function testReturnsBinaryTypeDeclarationSQL()
    {
        $this->assertSame(
            'BYTE',
            $this->_platform->getBinaryTypeDeclarationSQL(array())
        );

        $this->assertSame(
            'BYTE',
            $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 0))
        );

        $this->assertSame(
            'BYTE',
            $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 9999999))
        );

        $this->assertSame(
            'BYTE',
            $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true))
        );

        $this->assertSame(
            'BYTE',
            $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 0))
        );

        $this->assertSame(
            'BYTE',
            $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 9999999))
        );
    }

    public function testConvertBooleans()
    {
        $this->assertSame(
            array('t', 'f', 't', 'f'),
            $this->_platform->convertBooleans(array(true, false, true, false))
        );

        $this->assertSame('t', $this->_platform->convertBooleans(true));
        $this->assertSame('f', $this->_platform->convertBooleans(false));
    }

    /**
     * @dataProvider dataProviderTestGeneratesTypeDeclarationForStrings
     */
    public function testGeneratesTypeDeclarationForStrings($length, $fixed, $expected)
    {
        $this->assertEquals(
            $expected,
            $this->_platform->getVarcharTypeDeclarationSQL(
                array('fixed' => $fixed, 'length' => $length)
            )
        );
    }

    public function dataProviderTestGeneratesTypeDeclarationForStrings()
    {
        return array(
            array(255,   false, 'VARCHAR(255)'),
            array(32767, false, 'LVARCHAR(32767)'),
            array(32767, true,  'CHAR(32767)'),
            array(32768, false, 'TEXT'),
            array(32768, true,  'TEXT'),
        );
    }

    public function testGetClobTypeDeclarationSQL()
    {
        $this->assertEquals(
            'TEXT',
            $this->_platform->getClobTypeDeclarationSQL(array())
        );
    }

    public function testHasCorrectPlatformName()
    {
        $this->assertEquals('informix', $this->_platform->getName());
    }

    public function testHasCorrectIdentifierQuoteCharacter()
    {
        $this->assertSame('"', $this->_platform->getIdentifierQuoteCharacter());
    }

    public function testHasCorrectMaxIdentifierLength()
    {
        $this->assertSame(128, $this->_platform->getMaxIdentifierLength());
    }

    public function testGeneratesSQLSnippets()
    {
        $this->assertEquals('TODAY', $this->_platform->getNowExpression());

        $this->assertEquals('TODAY', $this->_platform->getCurrentDateSQL());

        $this->assertEquals(
            'CURRENT HOUR TO SECOND',
            $this->_platform->getCurrentTimeSQL()
        );

        $this->assertEquals(
            'CURRENT YEAR TO SECOND',
            $this->_platform->getCurrentTimestampSQL()
        );

        $this->assertEquals(
            "'01/20/2014'::DATE - '01/18/2014'::DATE",
            $this->_platform->getDateDiffExpression("'01/20/2014'", "'01/18/2014'")
        );

        $this->assertEquals(
            'CURRENT + INTERVAL(5) HOUR(9) TO HOUR',
            $this->_platform->getDateAddHourExpression('CURRENT', 5)
        );

        $this->assertEquals(
            'CURRENT - INTERVAL(5) HOUR(9) TO HOUR',
            $this->_platform->getDateSubHourExpression('CURRENT', 5)
        );

        $this->assertEquals(
            'CURRENT + INTERVAL(5) DAY(9) TO DAY',
            $this->_platform->getDateAddDaysExpression('CURRENT', 5)
        );

        $this->assertEquals(
            'CURRENT - INTERVAL(5) DAY(9) TO DAY',
            $this->_platform->getDateSubDaysExpression('CURRENT', 5)
        );

        $this->assertEquals(
            'ADD_MONTHS(CURRENT,5)',
            $this->_platform->getDateAddMonthExpression('CURRENT', 5)
        );

        $this->assertEquals(
            'ADD_MONTHS(CURRENT,-5)',
            $this->_platform->getDateSubMonthExpression('CURRENT', 5)
        );

        $this->assertEquals(
            'CREATE TEMP TABLE',
            $this->_platform->getCreateTemporaryTableSnippetSQL()
        );

        $this->assertEquals(
            'SUBSTRING(col1 FROM 2)',
            $this->_platform->getSubstringExpression('col1', 2)
        );

        $this->assertEquals(
            'SUBSTRING(col1 FROM 2 FOR 4)',
            $this->_platform->getSubstringExpression('col1', 2, 4)
        );

        $this->assertEquals(
            'FOR UPDATE',
            $this->_platform->getForUpdateSQL()
        );
    }

    /**
     * @expectedException \Doctrine\DBAL\DBALException
     * @expectedExceptionMessage not supported by platform
     * @dataProvider dataProviderTestThrowsNotSupportedExceptions
     */
    public function testThrowsNotSupportedExceptions($methodName, $p1 = null, $p2 = null)
    {
        $this->_platform->$methodName($p1, $p2);
    }

    public function dataProviderTestThrowsNotSupportedExceptions()
    {
        return array(
            array('getIndexDeclarationSQL', 'idx1', new Index('idx1', array('col1'))),
            array('getListUsersSQL'),
            array('getMd5Expression', 'column'),
            array('getNotExpression', 'expression'),
            array('getPiExpression')
        );
    }

    public function testReturnsDropForeignKeySQL()
    {

        $table = new Table('test');
        $table->addColumn('fk1', 'string');

        $fk = new ForeignKeyConstraint(
            array('fk1'), 'foreign_table', array('id'), 'fk1_constraint'
        );

        $this->assertEquals(
            'ALTER TABLE test DROP CONSTRAINT fk1_constraint',
            $this->_platform->getDropForeignKeySQL($fk, $table)
        );

        $this->assertEquals(
            'ALTER TABLE test DROP CONSTRAINT fk1_constraint',
            $this->_platform->getDropForeignKeySQL($fk->getName(), $table->getName())
        );

    }

    public function testReturnsCommentOnColumnSQL()
    {
        $this->assertSame(
            '',
            $this->_platform->getCommentOnColumnSQL('table', 'column', 'comment')
        );
    }

    public function testGeneratesTypeDeclarationForBooleans()
    {
        $this->assertEquals(
            'BOOLEAN',
            $this->_platform->getBooleanTypeDeclarationSQL(array())
        );
    }

    public function testGeneratesTypeDeclarationForIntegers()
    {
        $columnDef['autoincrement'] = false;

        $this->assertEquals(
            'INTEGER',
            $this->_platform->getIntegerTypeDeclarationSQL($columnDef)
        );

        $this->assertEquals(
            'BIGINT',
            $this->_platform->getBigIntTypeDeclarationSQL($columnDef)
        );

        $columnDef['autoincrement'] = true;

        $this->assertEquals(
            'SERIAL',
            $this->_platform->getIntegerTypeDeclarationSQL($columnDef)
        );

        $this->assertEquals(
            'BIGSERIAL',
            $this->_platform->getBigIntTypeDeclarationSQL($columnDef)
        );

        $this->assertEquals(
            'SMALLINT',
            $this->_platform->getSmallIntTypeDeclarationSQL(array())
        );
    }

    public function testGeneratesTypeDeclarationForDateAndTime()
    {
        $this->assertEquals(
            'DATETIME YEAR TO SECOND',
            $this->_platform->getDateTimeTypeDeclarationSQL(array())
        );

        $this->assertEquals(
            'DATE',
            $this->_platform->getDateTypeDeclarationSQL(array())
        );

        $this->assertEquals(
            'DATETIME HOUR TO SECOND',
            $this->_platform->getTimeTypeDeclarationSQL(array())
        );
    }

    public function testReturnsSequenceNextValSQL()
    {
        $this->assertEquals(
            'SELECT sequence.NEXTVAL FROM systables WHERE tabid = 1',
            $this->_platform->getSequenceNextValSQL('sequence')
        );
    }

    public function testGeneratesDDLSnippets()
    {
        $sql = 'SELECT * FROM bar';

        $this->assertEquals(
            'CREATE VIEW foo_view AS ' . $sql,
            $this->_platform->getCreateViewSQL('foo_view', $sql)
        );

        $this->assertEquals(
            'DROP VIEW foo_view',
            $this->_platform->getDropViewSQL('foo_view')
        );

        $this->assertEquals(
            'CREATE DATABASE baz_db WITH LOG',
            $this->_platform->getCreateDatabaseSQL('baz_db')
        );
    }

    public function testReturnsIndexDeclarationSQL()
    {
        $index = new Index('idx1', array('col1', 'col2'), false);

        $this->assertEquals(
            'UNIQUE (col1, col2) CONSTRAINT idx1',
            $this->_platform->getUniqueConstraintDeclarationSQL('idx1', $index)
        );
    }

    /**
     * @expectedException \InvalidArgumentException
     */
    public function testThrowsExceptionWhenContraintDeclarationHasNoColumns()
    {
        $index = new Index('ctr1', array());

        $this->_platform->getUniqueConstraintDeclarationSQL('ctr1', $index);
    }

    public function testReturnsSequenceSQL()
    {
        $sequence = new Sequence('test_seq', 1, 10);

        $this->assertEquals(
            'CREATE SEQUENCE ' . $sequence->getQuotedName($this->_platform)
            . ' START WITH ' . $sequence->getInitialValue()
            . ' INCREMENT BY ' . $sequence->getAllocationSize()
            . ' MINVALUE ' . $sequence->getInitialValue(),
            $this->_platform->getCreateSequenceSQL($sequence)
        );

        $this->assertEquals(
            'ALTER SEQUENCE ' . $sequence->getQuotedName($this->_platform)
            . ' INCREMENT BY ' . $sequence->getAllocationSize(),
            $this->_platform->getAlterSequenceSQL($sequence)
        );

        $this->assertEquals(
            'DROP SEQUENCE ' . $sequence->getName(),
            $this->_platform->getDropSequenceSQL($sequence)
        );

        $this->assertEquals(
            'DROP SEQUENCE ' . $sequence->getName(),
            $this->_platform->getDropSequenceSQL($sequence->getName())
        );
    }

    /**
     * @dataProvider dataProviderTestDoModifyLimitQuery
     */
    public function testDoModifyLimitQuery($limit, $offset, $sqlExpected)
    {
      $sql = 'SELECT * FROM foobar';

      $this->assertEquals(
          $sqlExpected,
          $this->_platform->modifyLimitQuery($sql, $limit, $offset)
      );
    }

    public function dataProviderTestDoModifyLimitQuery()
    {
        return array(
            array(null, null, 'SELECT * FROM foobar'),
            array(null, 10, 'SELECT SKIP 10 * FROM foobar'),
            array(5, null, 'SELECT LIMIT 5 * FROM foobar'),
            array(5, 10, 'SELECT SKIP 10 LIMIT 5 * FROM foobar'),
        );
    }

    public function testReturnsSQLResultCasing()
    {
        $this->assertEquals(
            'FOO',
            $this->_platform->getSQLResultCasing('Foo')
        );
    }

    public function testGeneratesCreatePrimaryKeySQL()
    {
        $index = new Index('', array('col1', 'col2'));

        $this->assertEquals(
            'ALTER TABLE test_table ADD CONSTRAINT PRIMARY KEY (col1, col2)',
            $this->_platform->getCreatePrimaryKeySQL($index, 'test_table')
        );

        $index = new Index('pk1', array('col1', 'col2'));

        $this->assertEquals(
            'ALTER TABLE test_table ADD CONSTRAINT PRIMARY KEY (col1, col2) '
            . 'CONSTRAINT pk1',
            $this->_platform->getCreatePrimaryKeySQL($index, 'test_table')
        );

    }

    public function testReturnsCorrectAnswerOnSupportedFeatures()
    {
        $this->assertFalse($this->_platform->hasNativeGuidType());
        $this->assertFalse($this->_platform->hasNativeJsonType());
        $this->assertFalse($this->_platform->supportsCommentOnStatement());
        $this->assertFalse($this->_platform->supportsCreateDropDatabase());
        $this->assertFalse($this->_platform->supportsInlineColumnComments());
        $this->assertFalse($this->_platform->supportsSchemas());

        $this->assertTrue($this->_platform->prefersIdentityColumns());
        $this->assertTrue($this->_platform->supportsAlterTable());
        $this->assertTrue($this->_platform->supportsForeignKeyConstraints());
        $this->assertTrue($this->_platform->supportsForeignKeyOnUpdate());
        $this->assertTrue($this->_platform->supportsGettingAffectedRows());
        $this->assertTrue($this->_platform->supportsIdentityColumns());
        $this->assertTrue($this->_platform->supportsIndexes());
        $this->assertTrue($this->_platform->supportsLimitOffset());
        $this->assertTrue($this->_platform->supportsPrimaryConstraints());
        $this->assertTrue($this->_platform->supportsReleaseSavepoints());
        $this->assertTrue($this->_platform->supportsSavepoints());
        $this->assertTrue($this->_platform->supportsSequences());
        $this->assertTrue($this->_platform->supportsTransactions());
        $this->assertTrue($this->_platform->supportsViews());
    }

    public function testGeneratesListTableConstraintsSQL()
    {
        $this->assertEquals(
            'SELECT sc.constrid, sc.constrname, sc.owner, sc.tabid, '
            . 'sc.constrtype, sc.idxname, sc.collation '
            . 'FROM systables st, sysconstraints sc WHERE '
            . 'st.tabname = \'test_table\' '
            . 'AND st.tabid = sc.tabid',
            $this->_platform->getListTableConstraintsSQL('test_table')
        );
    }

    public function getQuotedAlterTableRenameColumnSQL()
    {
        return array(
            'RENAME COLUMN mytable.unquoted1 TO unquoted',
            'RENAME COLUMN mytable.unquoted2 TO "where"',
            'RENAME COLUMN mytable.unquoted3 TO "foo"',
            'RENAME COLUMN mytable.create TO reserved_keyword',
            'RENAME COLUMN mytable.table TO "from"',
            'RENAME COLUMN mytable.select TO "bar"',
            'RENAME COLUMN mytable.quoted1 TO quoted',
            'RENAME COLUMN mytable.quoted2 TO "and"',
            'RENAME COLUMN mytable.quoted3 TO "baz"',
        );
    }

    public function getQuotedAlterTableChangeColumnLengthSQL()
    {
        return array(
            'ALTER TABLE mytable '
            . 'MODIFY unquoted1 VARCHAR(255) NOT NULL, '
            . 'MODIFY unquoted2 VARCHAR(255) NOT NULL, '
            . 'MODIFY unquoted3 VARCHAR(255) NOT NULL, '
            . 'MODIFY "create" VARCHAR(255) NOT NULL, '
            . 'MODIFY "table" VARCHAR(255) NOT NULL, '
            . 'MODIFY "select" VARCHAR(255) NOT NULL'
        );
    }

    public function testQuotesAlterTableRenameIndexInSchema()
    {
        $this->markTestSkipped('Platform does not support schemas.');
    }

    public function testGetCommentOnColumnSQLWithQuoteCharacter()
    {
        $this->markTestSkipped('Informix does not support column comments.');
    }

    public function testGetCommentOnColumnSQLWithoutQuoteCharacter()
    {
        $this->markTestSkipped('Informix does not support column comments.');
    }

    public function testGeneratesPartialIndexesSqlOnlyWhenSupportingPartialIndexes()
    {
        // SQL declaration for indexes on create table like statements is not
        // supported on Informix so the InformixPlatform::getIndexDeclarationSQL()
        // throws a exception. The testNotGeneratesPartialIndexesSql() method
        // tests that the 'where' clause is not added.
        $this->markTestSkipped('Does not work on InformixPlatform, see method comments.');
    }

    public function testNotGeneratesPartialIndexesSql()
    {
        $where = 'test IS NULL AND test2 IS NOT NULL';

        $indexDef = new \Doctrine\DBAL\Schema\Index(
            'name',
            array('test', 'test2'),
            false,
            false,
            array(),
            array('where' => $where)
        );

        $expected = ' WHERE ' . $where;

        $actuals = array();
        $actuals []= $this->_platform->getUniqueConstraintDeclarationSQL('name', $indexDef);
        $actuals []= $this->_platform->getCreateIndexSQL($indexDef, 'table');

        foreach ($actuals as $actual) {
            $this->assertStringEndsNotWith($expected, $actual, 'WHERE clause should NOT be present');
        }
    }

    public function testReturnsGuidTypeDeclarationSQL()
    {
        $this->assertEquals(
            'CHAR(36)',
            $this->_platform->getGuidTypeDeclarationSQL(array())
        );
    }

    public function getAlterTableRenameColumnSQL()
    {
        return array(
            'RENAME COLUMN foo.bar TO baz'
        );
    }

    public function getQuotesTableIdentifiersInAlterTableSQL()
    {
        return array(
            'ALTER TABLE "foo" DROP CONSTRAINT fk1',
            'ALTER TABLE "foo" DROP CONSTRAINT fk2',
            'RENAME COLUMN "foo".id TO war',
            'ALTER TABLE "foo" ADD bloo INTEGER NOT NULL, DROP baz, MODIFY bar INTEGER DEFAULT NULL',
            'RENAME TABLE "foo" TO "table"',
            'ALTER TABLE "table" ADD CONSTRAINT FOREIGN KEY (fk3) REFERENCES fk_table (id) CONSTRAINT fk_add',
            'ALTER TABLE "table" ADD CONSTRAINT FOREIGN KEY (fk2) REFERENCES fk_table2 (id) CONSTRAINT fk2',
        );
    }

    public function getCommentOnColumnSQL()
    {
        return array('', '', '');
    }

    public function getQuotedNameInIndexSQL()
    {
        return array(
            'CREATE TABLE test (column1 VARCHAR(255) NOT NULL)',
            'CREATE INDEX "key" ON test (column1)'
        );
    }

    public function getQuotesReservedKeywordInUniqueConstraintDeclarationSQL()
    {
        return 'UNIQUE (foo) CONSTRAINT "select"';
    }

    public function getQuotesReservedKeywordInIndexDeclarationSQL()
    {
        // not supported by Informix
        // see InformixPlatform::getIndexDeclarationSQL()
    }

    public function getAlterStringToFixedStringSQL()
    {
        return array(
            'ALTER TABLE mytable MODIFY "name" CHAR(2) NOT NULL'
        );
    }

    protected function getAlterTableRenameIndexSQL()
    {
        return array(
            'RENAME INDEX idx_foo TO idx_bar'
        );
    }

    protected function getQuotedAlterTableRenameIndexSQL()
    {
        return array(
            'RENAME INDEX "create" TO "select"',
            'RENAME INDEX "foo" TO "bar"',
        );
    }

    protected function getAlterTableRenameIndexInSchemaSQL()
    {
        return array(
            'RENAME INDEX idx_foo TO idx_bar'
        );
    }

    public function getGeneratesAlterTableRenameIndexUsedByForeignKeySQL()
    {
        return array(
            'RENAME INDEX idx_foo TO idx_foo_renamed'
        );
    }

    public function supportsInlineIndexDeclaration()
    {
        return false;
    }

    protected function getQuotesReservedKeywordInTruncateTableSQL()
    {
        return 'TRUNCATE "select"';
    }

    protected function getQuotesDropForeignKeySQL()
    {
        return 'ALTER TABLE "table" DROP CONSTRAINT "select"';
    }
}


text: java -server -Xms1G -Xmx1G -Djava.net.preferIPv4Stack=true -cp ../lib/hazelcast-2.5.jar com.hazelcast.examples.StartServer