text:
FI-Ware Chef Validator
======================

**Table of Contents**

- [Description](#description)
- [Features Implemented](#features-implemented)
- [Installation Manual](#installation-manual)
- [Installation Verification](#installation-verification)
- [User Manual](#user-manual)
- [API Documentation](#api-documentation)
- [License](#license)
- [Getting Started](#getting-started)
- [Installing Dependencies](#installing-dependencies)
- [Executing the listener API](#executing-the-listener-api)
- [External Dependencies](#external-dependencies)
- [Validation Process](#validation-process)
- [Example Client](#example-client)
- [Chef Image generation](#chef-image-generation)

Description
-----------
This project is part of [FIWARE] (http://fiware.org).

A FIWARE validator for the deployment of chef cookbooks implemented as
a service with an OpenStack-native Rest API

Features Implemented
--------------------
A RESTful API for chef cookbook validation

Installation Manual
-------------------
The installation manual is provided in rst format in the [Installation and Administration manual](doc/source/adminmanual.rst)

Installation Verification
-------------------------
The sanity check procedures are detailed in the [Installation and Administration manual](doc/source/adminmanual.rst)

User Manual
-----------
The user manual is provided in rst format in the [User and Programmers manual](doc/source/usermanual.rst)

API Documentation
-----------------

The API definition can be found at <http://docs.chefvalidatorapi.apiary.io/#>

License
-------

Apache License Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>

Getting Started
---------------

To run the code you can clone the git repo with:

    git clone git@github.com:ging/fi-ware-chef_validator.git

Installing Dependencies
-----------------------

To install package dependencies you must run:

    pip install -r requirements.txt

Executing the listener API
--------------------------

The listener api can be manually launched with the following command:

    chef_validator/cmd/chef-validator-api.py --config-dir etc/chef_validator

External Dependencies
---------------------

The system deployment depends on several external services for
successful completion. The dependency list reads as follows:

- **OpenStack Keystone server**: Used for issuing user tokens for several OpenStack services
- **Docker Server**: Used for managing the chef server image
- **OpenStack Glance server**: Used for listing the available virtual machine images
- **OpenStack Nova server**: Used for deploying the selected virtual machine

Validation Process
------------------

The cookbook validation process consists on the following steps:

1. The **Client** sends a POST request to the service API, containing:
    - The name of the cookbook to be tested
    - The *chef supermarket* repository from which to obtain the cookbook
    - The virtual machine name for deployment

2. The **Server** receives the request and takes the following steps:
    - Checks the user permissions to take the next steps by validating against Keystone
    - Downloads the needed *cookbook*
    - Deploys the selected *Virtual Machine* image
    - Instructs the **Chef Server** to deploy the *cookbook* in the given *Virtual Machine*
    - Responds to the **Client** request informing of the status of the validation process

Example Client
---------------
An example client is provided in cmd/chef-validator-client. It can be run with the following command:

    chef_validator/cmd/chef-validator-client.py --validator_url=${url_of_the_validator_api} --username=${username} --password=${password} --image=${author/image_name} --cookbook=${cookbook_name}

Chef Image generation
---------------------
A default chef-solo image can be automatically generated and uploaded to the glance server with the following command:

    chef_validator/cmd/generate_image.py --username=${username} --password=${password} --auth_url={$auth_url} --tag=${author/image_tag} --config-dir {configuration_dir}


text:
<?php

namespace Aosmak\Laravel\Layer\Sdk\Services\Subservices\Interfaces;

use Aosmak\Laravel\Layer\Sdk\Models\ResponseInterface;

/**
 * Interface ConversationServiceInterface
 * @package namespace Aosmak\Laravel\Layer\Sdk\Services\Subservices\Interfaces
 */
interface ConversationServiceInterface extends BaseServiceInterface
{
    /**
     * Create a conversation
     *
     * @param array $data conversation data
     *
     * @return \Aosmak\Laravel\Layer\Sdk\Models\ResponseInterface
     */
    public function create(array $data): ResponseInterface;

    /**
     * Update a conversation
     *
     * @param array $data conversation data
     * @param string $conversationId conversation ID
     *
     * @return \Aosmak\Laravel\Layer\Sdk\Models\ResponseInterface
     */
    public function update(array $data, string $conversationId): ResponseInterface;

    /**
     * Get conversation details
     *
     * @param string $conversationId conversation ID
     *
     * @return \Aosmak\Laravel\Layer\Sdk\Models\ResponseInterface
     */
    public function get(string $conversationId): ResponseInterface;

    /**
     * Delete a conversation
     *
     * @param string $conversationId conversation ID
     *
     * @return \Aosmak\Laravel\Layer\Sdk\Models\ResponseInterface
     */
    public function delete(string $conversationId): ResponseInterface;
}

redpajama_set_name: RedPajamaGithub


text:
CommitManager::CommitManager(){}

void CommitManager::addAction(ActionPtr anAct)
{
  mActionList.push_back(anAct);
}

void CommitManager::removeAction(ActionPtr anAct)
{
  mActionList.remove(anAct);
}

void CommitManager::commit()
{
  ActionList::iterator it = mActionList.begin();
  for(;it!=mActionList.end();it++){
    (*it)->commit();
  }
}

void CommitManager::commit(ActionPtr anAction)
{
	anAction->commit();
}

void CommitManager::abort()
{
  ActionList::iterator it = mActionList.begin();
  for(;it!=mActionList.end();it++){
    (*it)->abort();
  }
}

void CommitManager::abort(ActionPtr anAction)
{
	anAction->abort();
}

void CommitManager::Action::addTuple(TuplePtr t)
{
  _buffer.insert(t);
}

CommitManager::Action::~Action()
{
}

void CommitManager::Action::removeTuple(TuplePtr t)
{
  _buffer.erase(_buffer.find(t));
}


text:
package ch.digitalfondue.stampo.resource;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

import ch.digitalfondue.stampo.StampoGlobalConfiguration;

public interface FileResource extends Resource {

  StampoGlobalConfiguration getConfiguration();
  FileMetadata getMetadata();
  Optional<String> getContent();
  StructuredFileExtension getStructuredFileExtension();

  /**
   * File extensions
   *
   * E.g.
   *
   * <pre>
   * - test -> []
   * - test.txt -> [txt]
   * - test.txt.peb -> [txt, peb]
   * - test.en.txt.peb -> [en, txt, peb]
   * </pre>
   *
   * */
  default List<String> getFileExtensions() {
    String fileName = getPath().getFileName().toString();
    String extensions = fileName.substring(getFileNameWithoutExtensions().length());
    return Arrays.stream(extensions.split("\\.")).filter(s->s.length() > 0).collect(Collectors.toCollection(ArrayList::new));
  }

  default String getFileNameWithoutExtensions() {
    String fileName = getPath().getFileName().toString();
    int idx = fileName.indexOf('.');
    return idx == -1 ? fileName : fileName.substring(0, idx);
  }

  default long getCreationTime() {
    return getMetadata().getDate().map(Date::getTime).orElseGet(() -> Resource.super.getCreationTime());
  }
}


text:
var callback = function(){
	$('.item-skills').each(function(){
		newWidth = $(this).parent().width() * $(this).data('percent');
		$(this).width(0);
    $(this).animate({
        width: newWidth,
    }, 1000);
	});
	$('.icons-red').each(function(){
		height = $(this).height();
    $(this).animate({
        height: 14,
    }, 2000);
	});
};
$(document).ready(callback);

var resize;
window.onresize = function() {
	clearTimeout(resize);
	resize = setTimeout(function(){
		callback();
	}, 100);
};


text:
from proboscis.asserts import assert_equal
from proboscis import test

from fuelweb_test.helpers.decorators import log_snapshot_on_error
from fuelweb_test.settings import DEPLOYMENT_MODE
from fuelweb_test.tests.base_test_case import SetupEnvironment
from fuelweb_test.tests.base_test_case import TestBasic

@test(groups=["thread_1", "neutron", "smoke_neutron"])
class NeutronGre(TestBasic):

    @test(depends_on=[SetupEnvironment.prepare_slaves_3],
          groups=["deploy_neutron_gre", "ha_one_controller_neutron_gre"])
    @log_snapshot_on_error
    def deploy_neutron_gre(self):
        """Deploy cluster in ha mode with 1 controller and Neutron GRE

        Scenario:
            1. Create cluster
            2. Add 1 node with controller role
            3. Add 2 nodes with compute role
            4. Deploy the cluster
            5. Run network verification
            6. Run OSTF

        Duration 35m
        Snapshot deploy_neutron_gre

        """
        self.env.revert_snapshot("ready_with_3_slaves")

        segment_type = 'gre'
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": segment_type,
                'tenant': 'simpleGre',
                'user': 'simpleGre',
                'password': 'simpleGre'
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute', 'cinder'],
                'slave-03': ['compute', 'cinder']
            }
        )
        self.fuel_web.update_internal_network(cluster_id, '192.168.196.0/26',
                                              '192.168.196.1')
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')
        # assert_equal(str(cluster['net_segment_type']), segment_type)
        self.fuel_web.check_fixed_network_cidr(
            cluster_id, self.env.get_ssh_to_remote_by_name('slave-01'))

        self.fuel_web.verify_network(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id)

        self.env.make_snapshot("deploy_neutron_gre")

@test(groups=["thread_1", "neutron"])
class NeutronVlan(TestBasic):

    @test(depends_on=[SetupEnvironment.prepare_slaves_3],
          groups=["deploy_neutron_vlan", "ha_one_controller_neutron_vlan"])
    @log_snapshot_on_error
    def deploy_neutron_vlan(self):
        """Deploy cluster in ha mode with 1 controller and Neutron VLAN

        Scenario:
            1. Create cluster
            2. Add 1 node with controller role
            3. Add 2 nodes with compute role
            4. Deploy the cluster
            5. Run network verification
            6. Run OSTF

        Duration 35m
        Snapshot deploy_neutron_vlan

        """
        self.env.revert_snapshot("ready_with_3_slaves")

        segment_type = 'vlan'
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": segment_type,
                'tenant': 'simpleVlan',
                'user': 'simpleVlan',
                'password': 'simpleVlan'
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')
        # assert_equal(str(cluster['net_segment_type']), segment_type)

        self.fuel_web.verify_network(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id)

        self.env.make_snapshot("deploy_neutron_vlan")

@test(groups=["neutron", "ha", "ha_neutron", "image_based"])
class NeutronGreHa(TestBasic):

    @test(depends_on=[SetupEnvironment.prepare_slaves_5],
          groups=["deploy_neutron_gre_ha", "ha_neutron_gre"])
    @log_snapshot_on_error
    def deploy_neutron_gre_ha(self):
        """Deploy cluster in HA mode with Neutron GRE

        Scenario:
            1. Create cluster
            2. Add 3 nodes with controller role
            3. Add 2 nodes with compute role
            4. Deploy the cluster
            5. Run network verification
            6. Run OSTF

        Duration 80m
        Snapshot deploy_neutron_gre_ha

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        segment_type = 'gre'
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": segment_type,
                'tenant': 'haGre',
                'user': 'haGre',
                'password': 'haGre'
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')

        self.fuel_web.verify_network(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id)

        self.env.make_snapshot("deploy_neutron_gre_ha")

@test(groups=["thread_6", "neutron", "ha", "ha_neutron"])
class NeutronGreHaPublicNetwork(TestBasic):

    @test(depends_on=[SetupEnvironment.prepare_slaves_5],
          groups=["deploy_neutron_gre_ha_public_network"])
    @log_snapshot_on_error
    def deploy_neutron_gre_ha_with_public_network(self):
        """Deploy cluster in HA mode with Neutron GRE and public network
           assigned to all nodes

        Scenario:
            1. Create cluster
            2. Add 3 nodes with controller role
            3. Add 2 nodes with compute role
            4. Enable assign public networks to all nodes option
            5. Deploy the cluster
            6. Check that public network was assigned to all nodes
            7. Run network verification
            8. Run OSTF

        Duration 80m
        Snapshot deploy_neutron_gre_ha_public_network

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        segment_type = 'gre'
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": segment_type,
                'tenant': 'haGre',
                'user': 'haGre',
                'password': 'haGre',
                'assign_to_all_nodes': True
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')

        self.fuel_web.verify_network(cluster_id)

        self.fuel_web.security.verify_firewall(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id)

        self.env.make_snapshot("deploy_neutron_gre_ha_public_network")

@test(groups=["neutron", "ha", "ha_neutron"])
class NeutronVlanHa(TestBasic):

    @test(depends_on=[SetupEnvironment.prepare_slaves_5],
          groups=["deploy_neutron_vlan_ha", "ha_neutron_vlan"])
    @log_snapshot_on_error
    def deploy_neutron_vlan_ha(self):
        """Deploy cluster in HA mode with Neutron VLAN

        Scenario:
            1. Create cluster
            2. Add 3 nodes with controller role
            3. Add 2 nodes with compute role
            4. Deploy the cluster
            5. Run network verification
            6. Run OSTF

        Duration 80m
        Snapshot deploy_neutron_vlan_ha

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        segment_type = 'vlan'
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": segment_type
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            }
        )
        self.fuel_web.update_internal_network(cluster_id, '192.168.196.0/22',
                                              '192.168.196.1')
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')
        # assert_equal(str(cluster['net_segment_type']), segment_type)
        self.fuel_web.check_fixed_network_cidr(
            cluster_id, self.env.get_ssh_to_remote_by_name('slave-01'))

        self.fuel_web.verify_network(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id)

        self.env.make_snapshot("deploy_neutron_vlan_ha")

@test(groups=["thread_6", "neutron", "ha", "ha_neutron"])
class NeutronVlanHaPublicNetwork(TestBasic):

    @test(depends_on=[SetupEnvironment.prepare_slaves_5],
          groups=["deploy_neutron_vlan_ha_public_network"])
    @log_snapshot_on_error
    def deploy_neutron_vlan_ha_with_public_network(self):
        """Deploy cluster in HA mode with Neutron VLAN and public network
           assigned to all nodes

        Scenario:
            1. Create cluster
            2. Add 3 nodes with controller role
            3. Add 2 nodes with compute role
            4. Enable assign public networks to all nodes option
            5. Deploy the cluster
            6. Check that public network was assigned to all nodes
            7. Run network verification
            8. Run OSTF

        Duration 80m
        Snapshot deploy_neutron_vlan_ha_public_network

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        segment_type = 'vlan'
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": segment_type,
                'assign_to_all_nodes': True
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            }
        )
        self.fuel_web.update_internal_network(cluster_id, '192.168.196.0/22',
                                              '192.168.196.1')
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')
        # assert_equal(str(cluster['net_segment_type']), segment_type)
        self.fuel_web.check_fixed_network_cidr(
            cluster_id, self.env.get_ssh_to_remote_by_name('slave-01'))

        self.fuel_web.verify_network(cluster_id)

        self.fuel_web.security.verify_firewall(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id)

        self.env.make_snapshot("deploy_neutron_vlan_ha_public_network")


text:
package org.docksidestage.hangar.dbflute.bsentity;

import java.util.List;
import java.util.ArrayList;

import org.dbflute.Entity;
import org.dbflute.dbmeta.DBMeta;
import org.dbflute.dbmeta.AbstractEntity;
import org.dbflute.dbmeta.accessory.DomainEntity;
import org.dbflute.optional.OptionalEntity;
import org.docksidestage.hangar.dbflute.allcommon.DBMetaInstanceHandler;
import org.docksidestage.hangar.dbflute.exentity.*;

/**
 * The entity of WHITE_BASE_ONE10_CELEB as TABLE.

 *

 * [primary-key]
 *     CELEB_ID
 *
 * [column]
 *     CELEB_ID, CELEB_NAME, BASE_ID
 *
 * [sequence]
 *
 *
 * [identity]
 *
 *
 * [version-no]
 *
 *
 * [foreign table]
 *     WHITE_BASE
 *
 * [referrer table]
 *
 *
 * [foreign property]
 *     whiteBase
 *
 * [referrer property]
 *
 *
 * [get/set template]
 * /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
 * Integer celebId = entity.getCelebId();
 * String celebName = entity.getCelebName();
 * Integer baseId = entity.getBaseId();
 * entity.setCelebId(celebId);
 * entity.setCelebName(celebName);
 * entity.setBaseId(baseId);
 * = = = = = = = = = =/
 *

 * @author DBFlute(AutoGenerator)
 */
public abstract class BsWhiteBaseOne10Celeb extends AbstractEntity implements DomainEntity {

    // ===================================================================================
    //                                                                          Definition
    //                                                                          ==========
    /** The serial version UID for object serialization. (Default) */
    private static final long serialVersionUID = 1L;

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    /** CELEB_ID: {PK, NotNull, INTEGER(10)} */
    protected Integer _celebId;

    /** CELEB_NAME: {NotNull, VARCHAR(200)} */
    protected String _celebName;

    /** BASE_ID: {UQ, INTEGER(10), FK to WHITE_BASE} */
    protected Integer _baseId;

    // ===================================================================================
    //                                                                             DB Meta
    //                                                                             =======
    /** {@inheritDoc} */
    public DBMeta asDBMeta() {
        return DBMetaInstanceHandler.findDBMeta(asTableDbName());
    }

    /** {@inheritDoc} */
    public String asTableDbName() {
        return "WHITE_BASE_ONE10_CELEB";
    }

    // ===================================================================================
    //                                                                        Key Handling
    //                                                                        ============
    /** {@inheritDoc} */
    public boolean hasPrimaryKeyValue() {
        if (_celebId == null) { return false; }
        return true;
    }

    /**
     * To be unique by the unique column.

     * You can update the entity by the key when entity update (NOT batch update).
     * @param baseId : UQ, INTEGER(10), FK to WHITE_BASE. (NotNull)
     */
    public void uniqueBy(Integer baseId) {
        __uniqueDrivenProperties.clear();
        __uniqueDrivenProperties.addPropertyName("baseId");
        setBaseId(baseId);
    }

    // ===================================================================================
    //                                                                    Foreign Property
    //                                                                    ================
    /** WHITE_BASE by my BASE_ID, named 'whiteBase'. */
    protected OptionalEntity<WhiteBase> _whiteBase;

    /**
     * [get] WHITE_BASE by my BASE_ID, named 'whiteBase'.

     * Optional: alwaysPresent(), ifPresent().orElse(), get(), ...
     * @return The entity of foreign property 'whiteBase'. (NotNull, EmptyAllowed: when e.g. null FK column, no setupSelect)
     */
    public OptionalEntity<WhiteBase> getWhiteBase() {
        if (_whiteBase == null) { _whiteBase = OptionalEntity.relationEmpty(this, "whiteBase"); }
        return _whiteBase;
    }

    /**
     * [set] WHITE_BASE by my BASE_ID, named 'whiteBase'.
     * @param whiteBase The entity of foreign property 'whiteBase'. (NullAllowed)
     */
    public void setWhiteBase(OptionalEntity<WhiteBase> whiteBase) {
        _whiteBase = whiteBase;
    }

    // ===================================================================================
    //                                                                   Referrer Property
    //                                                                   =================
    protected <ELEMENT> List<ELEMENT> newReferrerList() { // overriding to import
        return new ArrayList<ELEMENT>();
    }

    // ===================================================================================
    //                                                                      Basic Override
    //                                                                      ==============
    @Override
    protected boolean doEquals(Object obj) {
        if (obj instanceof BsWhiteBaseOne10Celeb) {
            BsWhiteBaseOne10Celeb other = (BsWhiteBaseOne10Celeb)obj;
            if (!xSV(_celebId, other._celebId)) { return false; }
            return true;
        } else {
            return false;
        }
    }

    @Override
    protected int doHashCode(int initial) {
        int hs = initial;
        hs = xCH(hs, asTableDbName());
        hs = xCH(hs, _celebId);
        return hs;
    }

    @Override
    protected String doBuildStringWithRelation(String li) {
        StringBuilder sb = new StringBuilder();
        if (_whiteBase != null && _whiteBase.isPresent())
        { sb.append(li).append(xbRDS(_whiteBase, "whiteBase")); }
        return sb.toString();
    }
    protected <ET extends Entity> String xbRDS(org.dbflute.optional.OptionalEntity<ET> et, String name) { // buildRelationDisplayString()
        return et.get().buildDisplayString(name, true, true);
    }

    @Override
    protected String doBuildColumnString(String dm) {
        StringBuilder sb = new StringBuilder();
        sb.append(dm).append(xfND(_celebId));
        sb.append(dm).append(xfND(_celebName));
        sb.append(dm).append(xfND(_baseId));
        if (sb.length() > dm.length()) {
            sb.delete(0, dm.length());
        }
        sb.insert(0, "{").append("}");
        return sb.toString();
    }

    @Override
    protected String doBuildRelationString(String dm) {
        StringBuilder sb = new StringBuilder();
        if (_whiteBase != null && _whiteBase.isPresent())
        { sb.append(dm).append("whiteBase"); }
        if (sb.length() > dm.length()) {
            sb.delete(0, dm.length()).insert(0, "(").append(")");
        }
        return sb.toString();
    }

    @Override
    public WhiteBaseOne10Celeb clone() {
        return (WhiteBaseOne10Celeb)super.clone();
    }

    // ===================================================================================
    //                                                                            Accessor
    //                                                                            ========
    /**
     * [get] CELEB_ID: {PK, NotNull, INTEGER(10)}

     * @return The value of the column 'CELEB_ID'. (basically NotNull if selected: for the constraint)
     */
    public Integer getCelebId() {
        checkSpecifiedProperty("celebId");
        return _celebId;
    }

    /**
     * [set] CELEB_ID: {PK, NotNull, INTEGER(10)}

     * @param celebId The value of the column 'CELEB_ID'. (basically NotNull if update: for the constraint)
     */
    public void setCelebId(Integer celebId) {
        registerModifiedProperty("celebId");
        _celebId = celebId;
    }

    /**
     * [get] CELEB_NAME: {NotNull, VARCHAR(200)}

     * @return The value of the column 'CELEB_NAME'. (basically NotNull if selected: for the constraint)
     */
    public String getCelebName() {
        checkSpecifiedProperty("celebName");
        return convertEmptyToNull(_celebName);
    }

    /**
     * [set] CELEB_NAME: {NotNull, VARCHAR(200)}

     * @param celebName The value of the column 'CELEB_NAME'. (basically NotNull if update: for the constraint)
     */
    public void setCelebName(String celebName) {
        registerModifiedProperty("celebName");
        _celebName = celebName;
    }

    /**
     * [get] BASE_ID: {UQ, INTEGER(10), FK to WHITE_BASE}

     * @return The value of the column 'BASE_ID'. (NullAllowed even if selected: for no constraint)
     */
    public Integer getBaseId() {
        checkSpecifiedProperty("baseId");
        return _baseId;
    }

    /**
     * [set] BASE_ID: {UQ, INTEGER(10), FK to WHITE_BASE}

     * @param baseId The value of the column 'BASE_ID'. (NullAllowed: null update allowed for no constraint)
     */
    public void setBaseId(Integer baseId) {
        registerModifiedProperty("baseId");
        _baseId = baseId;
    }
}


text:
Contributing
============

If you would like to contribute code to Autofactory you can do so through GitHub
by forking the repository and sending a pull request.

When submitting code, please make every effort to follow existing conventions
and style in order to keep the code as readable as possible.

Where appropriate, please provide unit tests or integration tests. Unit tests
should be JUnit based tests and can use either standard JUnit assertions or
Truth assertions and be added to `<project>/src/test/java`.  Changes to
code generation or other build-time behaviour should go into small maven
projects using the `maven-invoker-plugin`.  Examples of this are in
`generator/src/it` and can include bean-shell verification scripts and other
facilities provided by `maven-invoker-plugin`.

Please make sure your code compiles by running `mvn clean verify` which will
execute both unit and integration test phases.  Additionally, consider using
http://travis-ci.org to validate your branches before you even put them into
pull requests.  All pull requests will be validated by Travis-ci in any case
and must pass before being merged.

If you are adding or modifying files you may add your own copyright line, but
please ensure that the form is consistent with the existing files, and please
note that a Google, Inc. copyright line must appear in every copyright notice.
All files are released with the Apache 2.0 license and any new files may only
be accepted under the terms of that license.

Checkstyle failures during compilation indicate errors in your style and will
be displayed in the console output of the build (including in Travis-CI output),
or can be viewed in the `checkstyle-result.xml` file.  To save yourself some
hassle, consider executing checkstyle first per: 'mvn checkstyle:checkstyle'.
It's fast, and will catch style errors early.

Before your code can be accepted into the project you must sign the
[Individual Contributor License Agreement (CLA)][1].

 [1]: https://developers.google.com/open-source/cla/individual


text:
<!DOCTYPE html>

	<title>Discovery</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" media="screen">
	<link rel="stylesheet" type="text/css" href="css/leaflet.css">
	<link rel="stylesheet" type="text/css" href="css/leaflet.draw.css">
	<link rel="stylesheet" type="text/css" href="css/styles.css">

			Discovery
			<form id="connection-form" class="navbar-form pull-left">

						<input type="text" id="url" placeholder="Server ip / host">
						<select id="index" class="input-small"></select>
						<button type="button" id="connect" class="btn">Connect</button>
						<button type="button" id="disconnect" class="btn">Disconnect</button>

			</form>
			<form id="search-form" class="navbar-form pull-right">

					<button type="button" id="search" class="btn disabled"> Search</button>
					<button type="button" class="btn dropdown-toggle disabled" data-toggle="dropdown">

					</button>

						<fieldset>
							<legend>Query options</legend>

Search on indices…

							<input type="checkbox" name="types" value="node" checked> Node
							<input type="checkbox" name="types" value="way" checked> Way

Max results…

							<input type="text" id="max-results" class="input-small" placeholder="Default (10)">

Filter by name…

							<input type="text" id="name" class="input-small" placeholder="Name">

Filter by tags…

							<button type="button" id="add-filter" class="btn"></button>
						</fieldset>

				<button type="button" class="btn" data-toggle="modal" data-target="#about"></button>
			</form>

About v1.0

Discovery is an elasticsearch site plugin to visualize OpenStreetMap
 data, indexed using the elasticsearch-osmosis-plugin.

It uses these (really!) great plugins:

jQuery and Bootstrap for the UI

Leaflet to render MapQuest open tiles

And elastic.js to query elasticsearch node

This plugin is licensed under the  Apache License, Version 2.0.

			<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>


text:
#include "0root/root.h"

#include <string.h>

// Always verify that a file of level N does not include headers > N!
#include "1base/error.h"
#include "3page_manager/page_manager.h"
#include "3blob_manager/blob_manager.h"
#include "3btree/btree_stats.h"
#include "3btree/btree_index.h"
#include "3btree/btree_update.h"
#include "3btree/btree_node_proxy.h"
#include "4cursor/cursor_local.h"

#ifndef HAM_ROOT_H
#  error "root.h was not included"
#endif

namespace hamsterdb {

/* a unittest hook triggered when a page is split */
void (*g_BTREE_INSERT_SPLIT_HOOK)(void);

// Traverses the tree, looking for the leaf with the specified |key|. Will
// split or merge nodes while descending.
// Returns the leaf page and the |parent| of the leaf (can be null if
// there is no parent).
Page *
BtreeUpdateAction::traverse_tree(const ham_key_t *key,
                        BtreeStatistics::InsertHints &hints,
                        Page **parent)
{
  LocalDatabase *db = m_btree->get_db();
  LocalEnvironment *env = db->lenv();

  Page *page = env->page_manager()->fetch(m_context,
                m_btree->root_address());
  BtreeNodeProxy *node = m_btree->get_node_from_page(page);

  *parent = 0;

  // if the root page is empty with children then collapse it
  if (node->get_count() == 0 && !node->is_leaf()) {
    page = collapse_root(page);
    node = m_btree->get_node_from_page(page);
  }

  int slot;

  // now walk down the tree
  while (!node->is_leaf()) {
    // is a split required?
    if (node->requires_split(m_context)) {
      page = split_page(page, *parent, key, hints);
      node = m_btree->get_node_from_page(page);
    }

    // get the child page
    Page *sib_page = 0;
    Page *child_page = m_btree->find_lower_bound(m_context, page, key, 0, &slot);
    BtreeNodeProxy *child_node = m_btree->get_node_from_page(child_page);

    // We can merge this child with the RIGHT sibling iff...
    // 1. it's not the right-most slot (and therefore the right sibling has
    //      the same parent as the child)
    // 2. the child is a leaf!
    // 3. it's empty or has too few elements
    // 4. its right sibling is also empty
    if (slot < (int)node->get_count() - 1
        && child_node->is_leaf()
        && child_node->requires_merge()
        && child_node->get_right() != 0) {
      sib_page = env->page_manager()->fetch(m_context,
                            child_node->get_right(),
                        PageManager::kOnlyFromCache);
      if (sib_page != 0) {
        BtreeNodeProxy *sib_node = m_btree->get_node_from_page(sib_page);
        if (sib_node->requires_merge()) {
          merge_page(child_page, sib_page);
          // also remove the link to the sibling from the parent
          node->erase(m_context, slot + 1);
          page->set_dirty(true);
        }
      }
    }

    // We can also merge this child with the LEFT sibling iff...
    // 1. it's not the left-most slot
    // 2. the child is a leaf!
    // 3. it's empty or has too few elements
    // 4. its left sibling is also empty
    else if (slot > 0
        && child_node->is_leaf()
        && child_node->requires_merge()
        && child_node->get_left() != 0) {
      sib_page = env->page_manager()->fetch(m_context,
                            child_node->get_left(),
                            PageManager::kOnlyFromCache);
      if (sib_page != 0) {
        BtreeNodeProxy *sib_node = m_btree->get_node_from_page(sib_page);
        if (sib_node->requires_merge()) {
          merge_page(sib_page, child_page);
          // also remove the link to the sibling from the parent
          node->erase(m_context, slot);
          page->set_dirty(true);
          // continue traversal with the sibling
          child_page = sib_page;
          child_node = sib_node;
        }
      }
    }

    *parent = page;

    // go down one level in the tree
    page = child_page;
    node = child_node;
  }

  return (page);
}

Page *
BtreeUpdateAction::merge_page(Page *page, Page *sibling)
{
  LocalDatabase *db = m_btree->get_db();
  LocalEnvironment *env = db->lenv();

  BtreeNodeProxy *node = m_btree->get_node_from_page(page);
  BtreeNodeProxy *sib_node = m_btree->get_node_from_page(sibling);

  if (sib_node->is_leaf())
    BtreeCursor::uncouple_all_cursors(m_context, sibling, 0);

  node->merge_from(m_context, sib_node);
  page->set_dirty(true);

  // fix the linked list
  node->set_right(sib_node->get_right());
  if (node->get_right()) {
    Page *new_right = env->page_manager()->fetch(m_context, node->get_right());
    BtreeNodeProxy *new_right_node = m_btree->get_node_from_page(new_right);
    new_right_node->set_left(page->get_address());
    new_right->set_dirty(true);
  }

  m_btree->get_statistics()->reset_page(sibling);
  m_btree->get_statistics()->reset_page(page);
  env->page_manager()->del(m_context, sibling);

  BtreeIndex::ms_btree_smo_merge++;
  return (page);
}

Page *
BtreeUpdateAction::collapse_root(Page *root_page)
{
  LocalEnvironment *env = root_page->get_db()->lenv();
  BtreeNodeProxy *node = m_btree->get_node_from_page(root_page);
  ham_assert(node->get_count() == 0);

  m_btree->get_statistics()->reset_page(root_page);
  m_btree->set_root_address(m_context, node->get_ptr_down());
  Page *header = env->page_manager()->fetch(m_context, 0);
  header->set_dirty(true);

  Page *new_root = env->page_manager()->fetch(m_context,
                        m_btree->root_address());
  new_root->set_type(Page::kTypeBroot);
  env->page_manager()->del(m_context, root_page);
  return (new_root);
}

Page *
BtreeUpdateAction::split_page(Page *old_page, Page *parent,
                                const ham_key_t *key,
                                BtreeStatistics::InsertHints &hints)
{
  LocalDatabase *db = m_btree->get_db();
  LocalEnvironment *env = db->lenv();

  m_btree->get_statistics()->reset_page(old_page);
  BtreeNodeProxy *old_node = m_btree->get_node_from_page(old_page);

  /* allocate a new page and initialize it */
  Page *new_page = env->page_manager()->alloc(m_context, Page::kTypeBindex);
  {
    PBtreeNode *node = PBtreeNode::from_page(new_page);
    node->set_flags(old_node->is_leaf() ? PBtreeNode::kLeafNode : 0);
  }
  BtreeNodeProxy *new_node = m_btree->get_node_from_page(new_page);

  /* no parent page? then we're splitting the root page. allocate
   * a new root page */
  if (!parent)
    parent = allocate_new_root(old_page);

  Page *to_return = 0;
  ByteArray pivot_key_arena;
  ham_key_t pivot_key = {0};

  /* if the key is appended then don't split the page; simply allocate
   * a new page and insert the new key. */
  int pivot = 0;
  if (hints.flags & HAM_HINT_APPEND && old_node->is_leaf()) {
    int cmp = old_node->compare(m_context, key, old_node->get_count() - 1);
    if (cmp == +1) {
      to_return = new_page;
      pivot_key = *key;
      pivot = old_node->get_count();
    }
  }

  /* no append? then calculate the pivot key and perform the split */
  if (pivot != (int)old_node->get_count()) {
    pivot = get_pivot(old_node, key, hints);

    /* and store the pivot key for later */
    old_node->get_key(m_context, pivot, &pivot_key_arena, &pivot_key);

    /* leaf page: uncouple all cursors */
    if (old_node->is_leaf())
      BtreeCursor::uncouple_all_cursors(m_context, old_page, pivot);
    /* internal page: fix the ptr_down of the new page
     * (it must point to the ptr of the pivot key) */
    else
      new_node->set_ptr_down(old_node->get_record_id(m_context, pivot));

    /* now move some of the key/rid-tuples to the new page */
    old_node->split(m_context, new_node, pivot);

    // if the new key is >= the pivot key then continue with the right page,
    // otherwise continue with the left page
    to_return = m_btree->compare_keys((ham_key_t *)key, &pivot_key) >= 0
                      ? new_page
                      : old_page;
  }

  /* update the parent page */
  BtreeNodeProxy *parent_node = m_btree->get_node_from_page(parent);
  uint64_t rid = new_page->get_address();
  ham_record_t record = ham_make_record(&rid, sizeof(rid));
  ham_status_t st = insert_in_page(parent, &pivot_key, &record, hints);
  if (st)
    throw Exception(st);
  /* new root page? then also set ptr_down! */
  if (parent_node->get_count() == 0)
    parent_node->set_ptr_down(old_page->get_address());

  /* fix the double-linked list of pages, and mark the pages as dirty */
  if (old_node->get_right()) {
    Page *sib_page = env->page_manager()->fetch(m_context,
                    old_node->get_right());
    BtreeNodeProxy *sib_node = m_btree->get_node_from_page(sib_page);
    sib_node->set_left(new_page->get_address());
    sib_page->set_dirty(true);
  }
  new_node->set_left(old_page->get_address());
  new_node->set_right(old_node->get_right());
  old_node->set_right(new_page->get_address());
  new_page->set_dirty(true);
  old_page->set_dirty(true);

  BtreeIndex::ms_btree_smo_split++;

  if (g_BTREE_INSERT_SPLIT_HOOK)
    g_BTREE_INSERT_SPLIT_HOOK();

  return (to_return);
}

Page *
BtreeUpdateAction::allocate_new_root(Page *old_root)
{
  LocalDatabase *db = m_btree->get_db();
  LocalEnvironment *env = db->lenv();

  Page *new_root = env->page_manager()->alloc(m_context, Page::kTypeBroot);

  /* insert the pivot element and set ptr_down */
  BtreeNodeProxy *new_node = m_btree->get_node_from_page(new_root);
  new_node->set_ptr_down(old_root->get_address());

  m_btree->set_root_address(m_context, new_root->get_address());
  Page *header = env->page_manager()->fetch(m_context, 0);
  header->set_dirty(true);

  old_root->set_type(Page::kTypeBindex);

  return (new_root);
}

int
BtreeUpdateAction::get_pivot(BtreeNodeProxy *old_node, const ham_key_t *key,
                            BtreeStatistics::InsertHints &hints) const
{
  uint32_t old_count = old_node->get_count();
  ham_assert(old_count > 2);

  bool pivot_at_end = false;
  if (hints.flags & HAM_HINT_APPEND && hints.append_count > 5)
    pivot_at_end = true;
  else if (old_node->get_right() == 0) {
    int cmp = old_node->compare(m_context, key, old_node->get_count() - 1);
    if (cmp > 0)
      pivot_at_end = true;
  }

  /* The position of the pivot key depends on the previous inserts; if most
   * of them were appends then pick a pivot key at the "end" of the node */
  int pivot;
  if (pivot_at_end || hints.append_count > 30)
    pivot = old_count - 2;
  else if (hints.append_count > 10)
    pivot = (int)(old_count / 100.f * 66);
  else if (hints.prepend_count > 10)
    pivot = (int)(old_count / 100.f * 33);
  else if (hints.prepend_count > 30)
    pivot = 2;
  else
    pivot = old_count / 2;

  ham_assert(pivot > 0 && pivot <= (int)old_count - 2);

  return (pivot);
}

ham_status_t
BtreeUpdateAction::insert_in_page(Page *page, ham_key_t *key,
                            ham_record_t *record,
                            BtreeStatistics::InsertHints &hints,
                            bool force_prepend, bool force_append)
{
  bool exists = false;

  BtreeNodeProxy *node = m_btree->get_node_from_page(page);

  int flags = 0;
  if (force_prepend)
    flags |= PBtreeNode::kInsertPrepend;
  if (force_append)
    flags |= PBtreeNode::kInsertAppend;

  PBtreeNode::InsertResult result = node->insert(m_context, key, flags);
  switch (result.status) {
    case HAM_DUPLICATE_KEY:
      if (hints.flags & HAM_OVERWRITE) {
        /* key already exists; only overwrite the data */
        if (!node->is_leaf())
          return (HAM_SUCCESS);
      }
      else if (!(hints.flags & HAM_DUPLICATE))
        return (HAM_DUPLICATE_KEY);
      /* do NOT shift keys up to make room; just overwrite the
       * current [slot] */
      exists = true;
      break;
    case HAM_SUCCESS:
      break;
    default:
      return (result.status);
  }

  uint32_t new_duplicate_id = 0;
  if (exists) {
    if (node->is_leaf()) {
      // overwrite record blob
      node->set_record(m_context, result.slot, record, m_duplicate_index,
                      hints.flags, &new_duplicate_id);

      hints.processed_leaf_page = page;
      hints.processed_slot = result.slot;
    }
    else {
      // overwrite record id
      ham_assert(record->size == sizeof(uint64_t));
      node->set_record_id(m_context, result.slot, *(uint64_t *)record->data);
    }
  }
  // key does not exist and has to be inserted or appended
  else {
    try {
      if (node->is_leaf()) {
        // allocate record id
        node->set_record(m_context, result.slot, record, m_duplicate_index,
                        hints.flags, &new_duplicate_id);

        hints.processed_leaf_page = page;
        hints.processed_slot = result.slot;
      }
      else {
        // set the internal record id
        ham_assert(record->size == sizeof(uint64_t));
        node->set_record_id(m_context, result.slot, *(uint64_t *)record->data);
      }
    }
    // In case of an error: undo the insert. This happens very rarely but
    // it's possible, i.e. if the BlobManager fails to allocate storage.
    catch (Exception &ex) {
      if (result.slot < (int)node->get_count())
        node->erase(m_context, result.slot);
      throw ex;
    }
  }

  page->set_dirty(true);

  // if this update was triggered with a cursor (and this is a leaf node):
  // couple it to the inserted key
  // TODO only when performing an insert(), not an erase()!
  if (m_cursor && node->is_leaf()) {
    m_cursor->get_parent()->set_to_nil(LocalCursor::kBtree);
    ham_assert(m_cursor->get_state() == BtreeCursor::kStateNil);
    m_cursor->couple_to_page(page, result.slot, new_duplicate_id);
  }

  return (HAM_SUCCESS);
}

} // namespace hamsterdb


text:
Plugin.define "Aardvark-Topsites-PHP" do
author "Brendan Coles <bcoles@gmail.com>" # 2010-06-26
version "0.2"
description "Aardvark Topsites PHP is a free topsites script built on PHP and MySQL."
website "http://www.aardvarktopsitesphp.com/topsites/"

# Dorks #
dorks [
'"Powered by Aardvark Topsites PHP"'
]

# About 330,000 results for "Powered by Aardvark Topsites PHP" @ 2010-06-26

matches [

# GHDB Match
{ :ghdb=>'"Powered by Aardvark Topsites PHP"' },

# Default powered by text
{ :regexp=>/Powered by ]*>[^A]*Aardvark Topsites PHP/i },

# Version detection # Powered by text
{ :version=>/Powered by Aardvark Topsites PHP<\/b><\/a> ([\d\.]+)/ },
{ :version=>/Powered by Aardvark Topsites PHP<\/a> ([\d\.]+)/ },

]

end


text:
The code displayed below will guide you to install an C# app to create right to left text in pdf with pdf sdk. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording and you can use it to create right to left text in pdf with pdf sdk with C#.

Want to save time? You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout Premium Suite for create right to left text in pdf with pdf sdk below and use it in your application. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! If you want to use these C# sample examples in one or many applications then they can be used easily.

All these programming tutorials along with source code samples and ByteScout free trial version are available for download from our website.

## REQUEST FREE TECH SUPPORT

[Click here to get in touch](https://bytescout.zendesk.com/hc/en-us/requests/new?subject=ByteScout%20Premium%20Suite%20Question)

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20Premium%20Suite%20Question)

## ON-PREMISE OFFLINE SDK

[Get Your 60 Day Free Trial](https://bytescout.com/download/web-installer?utm_source=github-readme)
[Explore SDK Docs](https://bytescout.com/documentation/index.html?utm_source=github-readme)
[Sign Up For Online Training](https://academy.bytescout.com/)

## ON-DEMAND REST WEB API

[Get your API key](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Documentation](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Samples](https://github.com/bytescout/ByteScout-SDK-SourceCode/tree/master/PDF.co%20Web%20API)

## VIDEO REVIEW

[https://www.youtube.com/watch?v=NEwNs2b9YN8](https://www.youtube.com/watch?v=NEwNs2b9YN8)

<!-- code block begin -->

##### ****Program.cs:**

```
using System.Diagnostics;
using Bytescout.PDF;

namespace RightToLeftText
{
    /// <summary>
    /// This example demonstrates how to draw right-to-left text.
    /// </summary>
    class Program
    {
        static void Main()
        {
            // Create new document
            Document pdfDocument = new Document();
            pdfDocument.RegistrationName = "demo";
            pdfDocument.RegistrationKey = "demo";
            // Add page
            Page page = new Page(PaperFormat.A4);
            pdfDocument.Pages.Add(page);

            Font font = new Font("Arial", 16);
            Brush brush = new SolidBrush();

            // Set right to left text direction
            StringFormat stringFormat = new StringFormat();
            stringFormat.DirectionRightToLeft = true;

            page.Canvas.DrawString("???? ????? ?????", font, brush, page.Width - 20, 30, stringFormat);
            page.Canvas.DrawString("???, ?????, ????", font, brush, page.Width - 20, 50, stringFormat);
            page.Canvas.DrawString("?? ?? ??", font, brush, page.Width - 20, 70, stringFormat);

            // Save document to file
            pdfDocument.Save("result.pdf");

            // Cleanup
            pdfDocument.Dispose();

            // Open result document in default associated application (for demo purpose)
            ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf");
            processStartInfo.UseShellExecute = true;
            Process.Start(processStartInfo);
        }
    }
}

```

<!-- code block end -->

<!-- code block begin -->

##### ****RightToLeftText.NETCore.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
    <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
    <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
    <GenerateAssemblyTrademarkAttribute>false</GenerateAssemblyTrademarkAttribute>
    <GenerateAssemblyCultureAttribute>false</GenerateAssemblyCultureAttribute>
    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>c:\Program Files\Bytescout PDF SDK\netcoreapp2.0\Bytescout.PDF.dll</HintPath>
    </Reference>
  </ItemGroup>
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****RightToLeftText.VS2005.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{474F52FF-3928-44EA-8F6F-379E9DAA23FF}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>RightToLeftText</RootNamespace>
    <AssemblyName>RightToLeftText</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <ProductVersion>8.0.50727</ProductVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****RightToLeftText.VS2008.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{474F52FF-3928-44EA-8F6F-379E9DAA23FF}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>RightToLeftText</RootNamespace>
    <AssemblyName>RightToLeftText</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <ProductVersion>9.0.30729</ProductVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****RightToLeftText.VS2010.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{474F52FF-3928-44EA-8F6F-379E9DAA23FF}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>RightToLeftText</RootNamespace>
    <AssemblyName>RightToLeftText</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****RightToLeftText.VS2012.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{474F52FF-3928-44EA-8F6F-379E9DAA23FF}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>RightToLeftText</RootNamespace>
    <AssemblyName>RightToLeftText</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****RightToLeftText.VS2013.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{474F52FF-3928-44EA-8F6F-379E9DAA23FF}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>RightToLeftText</RootNamespace>
    <AssemblyName>RightToLeftText</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****RightToLeftText.VS2015.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{474F52FF-3928-44EA-8F6F-379E9DAA23FF}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>RightToLeftText</RootNamespace>
    <AssemblyName>RightToLeftText</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->


text:
/**
 * @tag models, home
 * Wraps backend recipe services.  Enables
 * [Cookbook.Models.Recipe.static.findAll retrieving],
 * [Cookbook.Models.Recipe.static.update updating],
 * [Cookbook.Models.Recipe.static.destroy destroying], and
 * [Cookbook.Models.Recipe.static.create creating] recipes.
 */
$.Model.extend('Cookbook.Models.Recipe',
/* @Static */
{
	/**
 	 * Retrieves recipes data from your backend services.
 	 * @param {Object} params params that might refine your results.
 	 * @param {Function} success a callback function that returns wrapped recipe objects.
 	 * @param {Function} error a callback function for an error in the ajax request.
 	 */
	findAll: function( params, success, error ){
		logger.log("findAll called")
		$.ajax({
			url: '/recipe',
			type: 'get',
			dataType: 'json',
			data: params,
			success: this.callback(['wrapMany',success]),
			error: error
		});
	},
	/**
	 * Updates a recipe's data.
	 * @param {String} id A unique id representing your recipe.
	 * @param {Object} attrs Data to update your recipe with.
	 * @param {Function} success a callback function that indicates a successful update.
 	 * @param {Function} error a callback that should be called with an object of errors.
     */
	update: function( id, attrs, success, error ){
		$.ajax({
			url: '/recipes/'+id,
			type: 'put',
			dataType: 'json',
			data: attrs,
			success: success,
			error: error
		});
	},
	/**
 	 * Destroys a recipe's data.
 	 * @param {String} id A unique id representing your recipe.
	 * @param {Function} success a callback function that indicates a successful destroy.
 	 * @param {Function} error a callback that should be called with an object of errors.
	 */
	destroy: function( id, success, error ){
		$.ajax({
			url: '/recipes/'+id,
			type: 'delete',
			dataType: 'json',
			success: success,
			error: error
		});
	},
	/**
	 * Creates a recipe.
	 * @param {Object} attrs A recipe's attributes.
	 * @param {Function} success a callback function that indicates a successful create.  The data that comes back must have an ID property.
	 * @param {Function} error a callback that should be called with an object of errors.
	 */
	create: function( attrs, success, error ){
		$.ajax({
			url: '/recipes',
			type: 'post',
			dataType: 'json',
			success: success,
			error: error,
			data: attrs
		});
	}
},
/* @Prototype */
{

});


text:
Enquiry = new orion.collection('enquiry', {
  singularName: 'enquiry',
  pluralName: 'enquiries',
  link: {
    title: 'Enquiries'
  },
  title: 'Enquiries',
  tabular: {
    columns: [
      {data: 'name', title: 'Name'},
      {data: 'email', title: 'Email'},
      {data: 'phone', title: 'Phone'},
      {data: 'reason', title: 'Reason'},
      {data: 'message', title: 'Message'},
      orion.attributeColumn('updatedAt', 'updatedAt', 'Updated At')
    ]
  }
});

EnquirySchema = new SimpleSchema({
  name: {type: String, label: "Name"},
  email: {
    type: String,
    regEx: SimpleSchema.RegEx.Email,
    label: "E-mail address"
  },
  phone: {
    type: "tel",
    optional: true,
    label: 'Phone (optional)'
  },
  reason: {
    type: String,
    allowedValues: ['committee', 'treasurer', 'secretary', 'president'],
    label: "What are you contacting us about?",
    autoform: {
      options: [
        {
          label: "General enquiry for the Committee",
          value: 'committee'
        },
        {
          label: "Question for the Treasurer",
          value: 'treasurer'
        },
        {
          label: "Question for the Secretary",
          value: 'secretary'
        },
        {
          label: "Question for the President",
          value: 'president'
        }
      ]
    }
  },
  message: {
    type: String,
    label: 'Message',
    autoform: {
      rows: 10
    }
  },
  updatedAt: orion.attribute('updatedAt', {
    label: 'Updated At'
  }),
  lockedBy: {
    type: String,
    autoform: {
      type: 'hidden'
    },
    optional: true
  }
});

Enquiry.attachSchema(EnquirySchema);


text:
package app.coolweather.com.coolweather.util;

/**
 * Created by zghjh on 2016/9/27.
 */
public interface HttpCallbackListener {

    void onFinish(String response);

    void onError(Exception e);
}


text:
export as namespace History;

export type Action = "POP" | "PUSH" | "REPLACE";
export type BeforeUnloadHook = () => string | boolean;
export type CreateHistory<O, H> = (options?: HistoryOptions & O) => History & H;
export type CreateHistoryEnhancer<O, H, E> = (createHistory: CreateHistory<O, H>) => CreateHistory<O, H & E>;

export interface History {
    listenBefore(hook: TransitionHook): () => void;
    listen(listener: LocationListener): () => void;
    transitionTo(location: Location): void;
    push(path: LocationDescriptor): void;
    replace(path: LocationDescriptor): void;
    go(n: number): void;
    goBack(): void;
    goForward(): void;
    createKey(): LocationKey;
    createPath(path: LocationDescriptor): Path;
    createHref(path: LocationDescriptor): Href;
    createLocation(path?: LocationDescriptor, action?: Action, key?: LocationKey): Location;
    getCurrentLocation(): Location;
}

export interface HistoryOptions {
    getUserConfirmation?: (message: string, callback: (result: boolean) => void) => void;
    keyLength?: number;
}

export type Hash = string;
export type Href = string;

export interface Location {
    pathname: Pathname;
    search: Search;
    query: Query;
    state: LocationState;
    action: Action;
    key: LocationKey;
}

export interface LocationDescriptorObject {
    pathname?: Pathname;
    search?: Search;
    query?: Query;
    state?: LocationState;
}

export type LocationDescriptor = LocationDescriptorObject | Path;

export type LocationKey = string;

export type LocationListener = (location: Location) => void;

export type LocationState = any;

export type Path = string; // Pathname + Search;
export type Pathname = string;
export type Query = any;
export type Search = string;

export type TransitionHook = (location: Location, callback: (result: any) => void) => any;

export { default as createHistory } from "history/lib/createBrowserHistory";
export { default as createHashHistory } from "history/lib/createHashHistory";
export { default as createMemoryHistory, MemoryHistory, MemoryHistoryOptions } from "history/lib/createMemoryHistory";

export { default as useBasename, Basename, HistoryBasename, HistoryBasenameOptions } from "history/lib/useBasename";
export { default as useBeforeUnload, HistoryBeforeUnload } from "history/lib/useBeforeUnload";
export { default as useQueries, HistoryQueries } from "history/lib/useQueries";

import * as Actions from "history/lib/actions";
export { Actions };

export { locationsAreEqual } from "history/lib/LocationUtils";


text:
package guru.nidi.ramltester;

import org.junit.Test;
import org.raml.model.*;

import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;

/**
 * Wait for https://github.com/raml-org/raml-java-parser/issues/80 to be fixed.
 */
public class IncludeTest extends HighlevelTestBase {
    private final RamlDefinition api = RamlLoaders.fromClasspath(getClass()).load("include.raml");

    @Test
    public void load() throws Exception {
        final Raml raml = api.getRaml();
        final Action get = raml.getResource("/site").getAction(ActionType.GET);
        assertNull(get.getQueryParameters().get("string.json"));
        assertNotEquals("string.json", get.getResponses().get("200").getBody().get("application/json").getExample());
        assertNotEquals("string.json", get.getResponses().get("201").getBody().get("application/json").getSchema());
        assertNotEquals("string.json", get.getResponses().get("201").getBody().get("application/json").getExample());
    }

}


text:
import click
from requests import __version__ as requests_version

from alertaclient.version import __version__ as client_version

@click.command('version', short_help='Display version info')
@click.pass_obj
@click.pass_context
def cli(ctx, obj):
    """Show Alerta server and client versions."""
    client = obj['client']
    click.echo('alerta {}'.format(client.mgmt_status()['version']))
    click.echo(f'alerta client {client_version}')
    click.echo(f'requests {requests_version}')
    click.echo(f'click {click.__version__}')
    ctx.exit()


text:
<?php

/**
 * opRankingPluginFrontendRouteCollection
 *
 * @package    opRankingPlugin
 * @subpackage routing
 * @author     Shogo Kawahara <kawahara@tejimaya.net>
 */
class opRankingPluginFrontendRouteCollection extends sfRouteCollection
{
  public function __construct(array $options)
  {
    parent::__construct($options);

    $this->routes = array(
      'ranking' => new sfRoute(
        '/ranking',
        array('module' => 'ranking', 'action' => 'show')
      ),
      'ranking_access' => new sfRoute(
        '/ranking/access',
        array('module' => 'ranking', 'action' => 'show', 'type' => 'access')
      ),
      'ranking_friend' => new sfRoute(
        '/ranking/friend',
        array('module' => 'ranking', 'action' => 'show', 'type' => 'friend')
      ),
      'ranking_community' => new sfRoute(
        '/ranking/community',
        array('module' => 'ranking', 'action' => 'show', 'type' => 'community')
      ),
      'ranking_topic' => new sfRoute(
        '/ranking/topic',
        array('module' => 'ranking', 'action' => 'show', 'type' => 'topic')
      ),
      'ranking_default' => new sfRoute(
        '/ranking/*',
        array('module' => 'default', 'action' => 'error')
      ),
    );
  }
}


text:
import createGetFormInitialValues from './selectors/getFormInitialValues'
import plain from './structure/plain'

export default createGetFormInitialValues(plain)


text:
include ../../premake.mk

CFLAGS  = -I$(BASEDIR)/Server/EventModule -I$(BASEDIR)/Server/Item -I$(BASEDIR)/Server/Script -I$(BASEDIR)/Server/Main -I$(BASEDIR)/Server/Obj -I$(BASEDIR)/Server/Team -I$(BASEDIR)/Server/DB -I$(BASEDIR)/Server/MenPai -I$(BASEDIR)/Server/Packets -I$(BASEDIR)/Server/AI -I$(BASEDIR)/Server/Player -I$(BASEDIR)/Server/ActionModule -I$(BASEDIR)/Server/Skills -I$(BASEDIR)/Server/Skills/SpecialObjLogic -I$(BASEDIR)/Server/Skills/SkillLogic -I$(BASEDIR)/Server/Skills/SkillLogic/Item -I$(BASEDIR)/Server/Skills/SkillLogic/Common -I$(BASEDIR)/Server/Skills/SkillLogic/Human -I$(BASEDIR)/Server/Skills/SkillLogic/Pet -I$(BASEDIR)/Server/Skills/ImpactLogic -I$(BASEDIR)/Server/Mission -I$(BASEDIR)/Server/Ability -I$(BASEDIR)/Server/Other -I$(BASEDIR)/Server/Scene -I$(BASEDIR)/Server/Scene/Scan -I$(BASEDIR)/Server/SMU -I$(BASEDIR)/Server/Base -I$(BASEDIR)/Server
LDFLAGS =
DIRS =
OBJS =  Performance.o \
		GameTable.o \
		RecoverThread.o \
		ThreadPool.o \
		UserPool.o \
		DaemonThread.o \
		WorldManager.o \
		ThreadManager.o \
		MachineManager.o \
		ShareMemManager.o \
		RecoverManager.o \
		ClientManager.o \
		GUIDManager.o \
		XinfaStudySpendMgr.o \
		User.o \
		ServerThread.o \
		Server.o \
		ServerManager.o \
		DiePenaltyManager.o

debug:$(OBJS)
	for dir in $(DIRS); do \
		$(MAKE) debug -C $$dir; \
	done

release:$(OBJS)
	for dir in $(DIRS); do \
		$(MAKE) release -C $$dir; \
	done

all:debug

clean:
	$(RM) -f *.o


text:
// ==UserScript==
// @include        http://*.youtube.com/watch?*
// @include        http://youtube.com/watch?*
// @include        https://*.youtube.com/watch?*
// @include        https://*.youtube.com/watch?*
// ==/UserScript==

/*jslint white: true, browser: true, devel: true,
 windows: true, undef: true,
 nomen: true, eqeqeq: true, plusplus: true, bitwise: true,
 regexp: true, newcap: true, immed: true */
/*global window */

(function (document) {
    window.addEventListener("DOMContentLoaded", function () {
        var timer,
            interval = 1000; //1 second

        //get playerSwf element for YouTube JS API
        var playerSwf = document.getElementById('movie_player'),
            playerHTML5 = document.getElementsByTagName("video") && document.getElementsByTagName("video")[0],
            loopActive = false;

        if (playerSwf || playerHTML5) {
            var callback = function () {
                if (playerSwf.getPlayerState() === 0) {
                    playerSwf.seekTo(0);
                    playerSwf.playVideo();
                }
            };

            var startLoop = function () {
                loopActive = true;
                if (playerSwf) {
                    timer = setInterval(callback, interval);
                }
                if (playerHTML5 && playerHTML5.ended) {
                    playerHTML5.play();
                }
            };

            var stopLoop = function () {
                loopActive = false;
                clearInterval(timer);
            };

            var createButton = function (defaultState) {
                var buttonClass = defaultState ? "selected" : "";
                var containerSpan = document.createElement('span');
                var loopButtonStyle = "";

                var loopButton = '<button id="loopTubeButton" ';
                loopButton += 'class="yt-uix-tooltip-reverse yt-uix-button yt-uix-tooltip"';
                loopButton += 'type="button" title="Loop this video">';
                loopButton += 'Loop';
                loopButton += '</button>';

                containerSpan.innerHTML = loopButtonStyle + loopButton;
                document.getElementById("watch-actions-right").appendChild(containerSpan);

                var loopTubeSpan = document.getElementById("loopTubeSpan");

                if (defaultState) {
                    startLoop();
                }

                containerSpan.onclick = function () {
                    var className = loopTubeSpan.className;
                    if (className === "selected") {
                        className = "";
                        stopLoop();
                    }
                    else {
                        className = "selected";
                        startLoop();
                    }

                    loopTubeSpan.className = className;
                };
            };

            var state = (widget.preferences.alwaysLoop == 1)? true : false;
            createButton(state);

            if (playerHTML5) {
                playerHTML5.addEventListener("ended", function () {
                    if (loopActive) {
                        playerHTML5.play();
                    }
                }, false);
            }
        }

    }, false);
}(document));


text:
SELECT *
FROM city
WHERE countrycode="USA" AND population>100000


text:
@interface UIWindow (HNBSwitchRootConroller)
- (void)switchRootViewController;

@end


text:
import { animate, state, style, transition, trigger } from '@angular/animations';
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, Injector, OnInit, ViewChild } from '@angular/core';
import { ValidatorFn, Validators } from '@angular/forms';
import { MatTab, MatTabGroup } from '@angular/material';

import { NumberConverter } from '../../../decorators/input-converter';
import { OFormComponent } from '../../form/o-form.component';
import { CKEditorComponent } from '../../material/ckeditor/ck-editor.component';
import { DEFAULT_INPUTS_O_FORM_DATA_COMPONENT, OFormDataComponent } from '../../o-form-data-component.class';

export const DEFAULT_INPUTS_O_HTML_INPUT = [
  'oattr: attr',
  'data',
  'autoBinding: automatic-binding',
  'autoRegistering: automatic-registering',
  'orequired: required',
  'minLength: min-length',
  'maxLength: max-length',
  'readOnly: read-only',
  'sqlType: sql-type'
];

export const DEFAULT_OUTPUTS_O_HTML_INPUT = [
  ...DEFAULT_INPUTS_O_FORM_DATA_COMPONENT,
  'onFocus',
  'onBlur'
];

@Component({
  selector: 'o-html-input',
  templateUrl: './o-html-input.component.html',
  styleUrls: ['./o-html-input.component.scss'],
  inputs: DEFAULT_INPUTS_O_HTML_INPUT,
  outputs: DEFAULT_OUTPUTS_O_HTML_INPUT,
  animations: [
    trigger('transitionMessages', [
      state('enter', style({ opacity: 1, transform: 'translateY(0%)' })),
      transition('void => enter', [
        style({ opacity: 0, transform: 'translateY(-100%)' }),
        animate('300ms cubic-bezier(0.55, 0, 0.55, 0.2)'),
      ]),
    ])
  ]
})
export class OHTMLInputComponent extends OFormDataComponent implements OnInit, AfterViewInit {

  protected _minLength: number = -1;
  protected _maxLength: number = -1;

  @ViewChild('ckEditor', { static: false }) ckEditor: CKEditorComponent;

  protected tabGroupContainer: MatTabGroup;
  protected tabContainer: MatTab;

  /** State of the mat-hint and mat-error animations. */
  _subscriptAnimationState: string = '';

  protected _changeDetectorRef: ChangeDetectorRef;

  constructor(
    form: OFormComponent,
    elRef: ElementRef,
    injector: Injector
  ) {
    super(form, elRef, injector);
    this.form = form;
    this.elRef = elRef;
    this._changeDetectorRef = this.injector.get(ChangeDetectorRef);
    try {
      this.tabGroupContainer = this.injector.get(MatTabGroup);
      this.tabContainer = this.injector.get(MatTab);
    } catch (error) {
      // Do nothing due to not always is contained on tab.
    }
  }

  ngOnInit() {
    super.ngOnInit();
    const self = this;
    if (this.form) {
      this.form.beforeCloseDetail.subscribe(() => this.destroyCKEditor());
      this.form.beforeUpdateMode.subscribe(() => this.destroyCKEditor());
    }

    if (this.tabGroupContainer) {
      this.tabGroupContainer.selectedTabChange.subscribe((evt: any) => {
        self.destroyCKEditor();
        if (self.isInActiveTab()) {
          self.ckEditor.initCKEditor(self.oattr);
        }
      });
    }
  }

  ngAfterViewInit() {
    super.ngAfterViewInit();
    // Avoid animations on load.
    this._subscriptAnimationState = 'enter';
    this._changeDetectorRef.detectChanges();
  }

  hasError(error: string): boolean {
    const result = super.hasError(error);
    this._subscriptAnimationState = result ? 'enter' : 'void';
    return result;
  }

  isInActiveTab(): boolean {
    let result: boolean = !(this.tabGroupContainer && this.tabContainer);
    if (!result) {
      const self = this;
      this.tabGroupContainer._tabs.forEach((tab, index) => {
        if (tab === self.tabContainer) {
          result = (self.tabGroupContainer.selectedIndex === index);
        }
      });
    }
    return result;
  }

  resolveValidators(): ValidatorFn[] {
    const validators: ValidatorFn[] = super.resolveValidators();
    if (this.minLength >= 0) {
      validators.push(Validators.minLength(this.minLength));
    }
    if (this.maxLength >= 0) {
      validators.push(Validators.maxLength(this.maxLength));
    }
    return validators;
  }

  clearValue(): void {
    super.clearValue();
    this.ckEditor.instance.updateElement();
    this.ckEditor.instance.setData('');
  }

  destroyCKEditor() {
    if (this.ckEditor) {
      this.ckEditor.destroyCKEditor();
    }
  }

  getCKEditor(): any {
    return this.ckEditor.instance;
  }

  set minLength(val: number) {
    const old = this._minLength;
    this._minLength = NumberConverter(val);
    if (val !== old) {
      this.updateValidators();
    }
  }

  get minLength(): number {
    return this._minLength;
  }

  set maxLength(val: number) {
    const old = this._maxLength;
    this._maxLength = NumberConverter(val);
    if (val !== old) {
      this.updateValidators();
    }
  }

  get maxLength(): number {
    return this._maxLength;
  }
}


text:
static int testStatus = 0;

void aSsErT(bool b, const char *s, int i)
{
    if (b) {
        printf("Error " __FILE__ "(%d): %s    (failed)\n", i, s);
        if (testStatus >= 0 && testStatus <= 100) ++testStatus;
    }
}

# define ASSERT(X) { aSsErT(!(X), #X, __LINE__); }

//=============================================================================
//                       STANDARD BDE TEST DRIVER MACROS
//-----------------------------------------------------------------------------
#define LOOP_ASSERT  BSLS_BSLTESTUTIL_LOOP_ASSERT
#define LOOP2_ASSERT BSLS_BSLTESTUTIL_LOOP2_ASSERT
#define LOOP3_ASSERT BSLS_BSLTESTUTIL_LOOP3_ASSERT
#define LOOP4_ASSERT BSLS_BSLTESTUTIL_LOOP4_ASSERT
#define LOOP5_ASSERT BSLS_BSLTESTUTIL_LOOP5_ASSERT
#define LOOP6_ASSERT BSLS_BSLTESTUTIL_LOOP6_ASSERT

#define Q   BSLS_BSLTESTUTIL_Q   // Quote identifier literally.
#define P   BSLS_BSLTESTUTIL_P   // Print identifier and value.
#define P_  BSLS_BSLTESTUTIL_P_  // P(X) without '\n'.
#define T_  BSLS_BSLTESTUTIL_T_  // Print a tab (w/o newline).
#define L_  BSLS_BSLTESTUTIL_L_  // current Line number

//=============================================================================
//                  GLOBAL TYPEDEFS/CONSTANTS FOR TESTING
//-----------------------------------------------------------------------------

// namespace scope

BSLMF_ASSERT(sizeof(int) >= sizeof(char));

// un-named namespace
namespace {
    BSLMF_ASSERT(1);
#if defined(BSLS_PLATFORM_CMP_SUN)
    BSLMF_ASSERT(1);
#else
    BSLMF_ASSERT(1); BSLMF_ASSERT(1); // not class scope
#endif
}  // close unnamed namespace

namespace {
    BSLMF_ASSERT(1);
}  // close unnamed namespace

namespace Bar {

    BSLMF_ASSERT(1);
#if defined(BSLS_PLATFORM_CMP_SUN)
    BSLMF_ASSERT(1);
#else
    BSLMF_ASSERT(1); BSLMF_ASSERT(1); // not class scope
#endif
}  // close namespace Bar

class MyType {
    // class scope

    BSLMF_ASSERT(sizeof(int) >= sizeof(char));
    BSLMF_ASSERT(sizeof(int) >= sizeof(char));

  public:
    int d_data;
    void foo();
};

void MyType::foo()
{
    // function scope

    BSLMF_ASSERT(sizeof(int) >= sizeof(char));
    BSLMF_ASSERT(1);

    using namespace BloombergLP;
    BSLMF_ASSERT(1);
}

//=============================================================================
//                              MAIN PROGRAM
//-----------------------------------------------------------------------------

int main(int argc, char *argv[])
{
    int test = argc > 1 ? atoi(argv[1]) : 0;
    bool verbose = argc > 2;
    // bool veryVerbose = argc > 3;

    printf("TEST " __FILE__ " CASE %d\n", test);

    switch (test) { case 0:  // Zero is always the leading case.
      case 1: {
        // --------------------------------------------------------------------
        // TESTING BSLMF_ASSERT MACRO
        // We have the following concerns:
        //   1. Works for all non-zero integral values.
        //   2. Works in and out of class scope.
        //
        // Plan:
        //   Invoke the macro at namespace, class, and function scope (above)
        //   and verify that it does not cause a compiler error.  Please see
        //   the 'ttt' test package group for test cases where the macro
        //   should cause a compile-time error.
        //
        // Testing:
        //   BSLMF_ASSERT(expr)
        // --------------------------------------------------------------------

        if (verbose) printf("\nBSLMF_ASSERT Macro\n"
                            "\n==================\n");

        BSLMF_ASSERT(sizeof(int) >= sizeof(char));
        BSLMF_ASSERT(sizeof(int) >= sizeof(char));
        BSLMF_ASSERT(1);  ASSERT(145 == __LINE__);
        BSLMF_ASSERT(1);  ASSERT(146 == __LINE__);
        BSLMF_ASSERT(1 > 0 && 1);

// MSVC: __LINE__ macro breaks when /ZI is used (see Q199057 or KB199057)
// SUN:  BSLMF_ASSERT is defined the way that breaks this test
// GCC:  Declares a function, rather than a typedef, from v4.8.1
#if !defined(BSLS_COMPILERFEATURES_SUPPORT_STATIC_ASSERT) && \
    !defined(BSLS_PLATFORM_CMP_MSVC) &&                      \
    !defined(BSLS_PLATFORM_CMP_SUN)  &&                      \
    !(defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VER_MAJOR > 40800)
        bslmf_Assert_145 t1; // test typedef name creation; matches above line
        bslmf_Assert_146 t2; // test typedef name creation; matches above line
        ASSERT(sizeof t1 == sizeof t2);  // use t1 and t2
#endif

        BSLMF_ASSERT(2);
        BSLMF_ASSERT(-1);

#if defined(BSLS_PLATFORM_CMP_SUN)
        BSLMF_ASSERT(1);
#else
        BSLMF_ASSERT(1); BSLMF_ASSERT(1); // not class scope
#endif

      } break;
      default: {
        fprintf(stderr, "WARNING: CASE `%d' NOT FOUND.\n", test);
        testStatus = -1;
      }
    }

    if (testStatus > 0) {
        fprintf(stderr, "Error, non-zero test status = %d.\n", testStatus);
    }

    return testStatus;
}

// ----------------------------------------------------------------------------
// Copyright 2013 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------


text:
layout: post
title: "Catalan Voters Celebrating that Referendum Took Place (Video)"
author: ""
categories: noticia
tags: [noticia,catalunya,catalonia,independence]
image:
  feature: 007_voting.jpeg
  teaser: 007_voting.jpeg
  credit:
  creditlink: ""
---

This video was recorded during the Catalan Independence Referendum which
took place on October 1st 2017.


text:
using PolymerStarterKitLight.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;

namespace PolymerStarterKitLight.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        public ActionResult Index()
        {
            return View();
        }

        // GET: Elements
        public ActionResult Elements()
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();
            IEnumerable<Tuple<string, string>> actions = executingAssembly.GetTypes()
                .Where(type => typeof(Controller).IsAssignableFrom(type))
                .SelectMany(type => type.GetMethods())
                .Where(method => method.IsPublic && method.IsDefined(typeof(ElementAttribute)))
                .Select(method => Tuple.Create(method.Name, method.DeclaringType.Name.Replace("Controller", string.Empty)));
            this.ViewBag.Actions = actions;
            return View();
        }
    }
}


text:
import six
import webob

from nova.api.openstack.compute.schemas.v3 import quota_classes
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api import validation
import nova.context
from nova import db
from nova import exception
from nova import quota

QUOTAS = quota.QUOTAS
ALIAS = "os-quota-class-sets"

# Quotas that are only enabled by specific extensions
EXTENDED_QUOTAS = {'server_groups': 'os-server-group-quotas',
                   'server_group_members': 'os-server-group-quotas'}

authorize = extensions.os_compute_authorizer(ALIAS)

class QuotaClassSetsController(wsgi.Controller):

    supported_quotas = []

    def __init__(self, **kwargs):
        self.supported_quotas = QUOTAS.resources
        extension_info = kwargs.pop('extension_info').get_extensions()
        for resource, extension in EXTENDED_QUOTAS.items():
            if extension not in extension_info:
                self.supported_quotas.remove(resource)

    def _format_quota_set(self, quota_class, quota_set):
        """Convert the quota object to a result dict."""

        if quota_class:
            result = dict(id=str(quota_class))
        else:
            result = {}

        for resource in self.supported_quotas:
            if resource in quota_set:
                result[resource] = quota_set[resource]

        return dict(quota_class_set=result)

    @extensions.expected_errors(403)
    def show(self, req, id):
        context = req.environ['nova.context']
        authorize(context)
        try:
            nova.context.authorize_quota_class_context(context, id)
            values = QUOTAS.get_class_quotas(context, id)
            return self._format_quota_set(id, values)
        except exception.Forbidden:
            raise webob.exc.HTTPForbidden()

    @extensions.expected_errors((403))
    @validation.schema(quota_classes.update)
    def update(self, req, id, body):
        context = req.environ['nova.context']
        authorize(context)
        quota_class = id

        for key, value in six.iteritems(body['quota_class_set']):
            try:
                db.quota_class_update(context, quota_class, key, value)
            except exception.QuotaClassNotFound:
                db.quota_class_create(context, quota_class, key, value)
            except exception.AdminRequired:
                raise webob.exc.HTTPForbidden()

        values = QUOTAS.get_class_quotas(context, quota_class)
        return self._format_quota_set(None, values)

class QuotaClasses(extensions.V3APIExtensionBase):
    """Quota classes management support."""

    name = "QuotaClasses"
    alias = ALIAS
    version = 1

    def get_resources(self):
        resources = []
        res = extensions.ResourceExtension(
            ALIAS,
            QuotaClassSetsController(extension_info=self.extension_info))
        resources.append(res)
        return resources

    def get_controller_extensions(self):
        return []