text:
Annotations Reference
=====================

In this chapter a reference of every Doctrine 2 ODM Annotation is
given with short explanations on their context and usage.

@AlsoLoad
---------

Specify one or more MongoDB fields to use for loading data if the original field
does not exist.

.. code-block:: php

    <?php

    /** @Field(type="string") @AlsoLoad("name") */
    public $fullName;

The ``$fullName`` property will be loaded from ``fullName`` if it exists, but
fall back to ``name`` if it does not exist. If multiple fall back fields are
specified, ODM will consider them in order until the first is found.

Additionally, `@AlsoLoad`_ may annotate a method with one or more field names.
Before normal hydration, the field(s) will be considered in order and the method
will be invoked with the first value found as its single argument.

.. code-block:: php

    <?php

    /** @AlsoLoad({"name", "fullName"}) */
    public function populateFirstAndLastName(string $name): void
    {
        list($this->firstName, $this->lastName) = explode(' ', $name);
    }

For additional information on using `@AlsoLoad`_, see
:doc:`Migrations <migrating-schemas>`.

@ChangeTrackingPolicy
---------------------

This annotation is used to change the change tracking policy for a document:

.. code-block:: php

    <?php

    /**
     * @Document
     * @ChangeTrackingPolicy("DEFERRED_EXPLICIT")
     */
    class Person
    {
        // ...
    }

For a list of available policies, read the section on :ref:`change tracking policies <change_tracking_policies>`.

@DefaultDiscriminatorValue
--------------------------

This annotation can be used when using `@DiscriminatorField`_. It will be used
as a fallback value if a document has no discriminator field set. This must
correspond to a value from the configured discriminator map.

.. code-block:: php

    <?php

    /**
     * @Document
     * @InheritanceType("SINGLE_COLLECTION")
     * @DiscriminatorField("type")
     * @DiscriminatorMap({"person" = Person::class, "employee" = Employee::class})
     * @DefaultDiscriminatorValue("person")
     */
    class Person
    {
        // ...
    }

@DiscriminatorField
-------------------

This annotation is required for the top-most class in a
:ref:`single collection inheritance <single_collection_inheritance>` hierarchy.
It takes a string as its only argument, which specifies the database field to
store a class name or key (if a discriminator map is used). ODM uses this field
during hydration to select the instantiation class.

.. code-block:: php

    <?php

    /**
     * @Document
     * @InheritanceType("SINGLE_COLLECTION")
     * @DiscriminatorField("type")
     */
    class SuperUser
    {
        // ...
    }

.. note::

    For backwards compatibility, the discriminator field may also be specified
    via either the ``name`` or ``fieldName`` annotation attributes.

@DiscriminatorMap
-----------------

This annotation is required for the top-most class in a
:ref:`single collection inheritance <single_collection_inheritance>` hierarchy.
It takes an array as its only argument, which maps keys to class names. The
class names must be fully qualified. Using the ``::class constant`` is supported. When
a document is persisted to the database, its class name key will be stored in
the discriminator field instead of the |FQCN|. If the discriminator map is non-empty
and it does not contain the class name of the persisted document, a
``\Doctrine\ODM\MongoDB\Mapping\MappingException`` will be thrown.

.. code-block:: php

    <?php

    /**
     * @Document
     * @InheritanceType("SINGLE_COLLECTION")
     * @DiscriminatorField("type")
     * @DiscriminatorMap({"person" = Person::class, "employee" = Employee::class})
     */
    class Person
    {
        // ...
    }

@Document
---------

Required annotation to mark a PHP class as a document, whose persistence will be
managed by ODM.

Optional attributes:

-
   ``db`` - By default, the document manager will use the MongoDB database
   defined in the configuration, but this option may be used to override the
   database for a particular document class.
-
   ``collection`` - By default, the collection name is derived from the
   document's class name, but this option may be used to override that behavior.
-
   ``repositoryClass`` - Specifies a custom repository class to use.
-
   ``indexes`` - Specifies an array of indexes for this document (deprecated,
   specify all ``@Index`` annotations on a class level).
-
   ``readOnly`` - Prevents document from being updated: it can only be inserted,
   upserted or removed.
-
   ``writeConcern`` - Specifies the write concern for this document that
   overwrites the default write concern specified in the configuration. It does
   not overwrite a write concern given as :ref:`option <flush_options>` to the
  ``flush``  method when committing your documents.

.. code-block:: php

    <?php

    /**
     * @Document(
     *     db="documents",
     *     collection="users",
     *     repositoryClass="MyProject\UserRepository",
     *     indexes={
     *         @Index(keys={"username"="desc"}, options={"unique"=true})
     *     },
     *     readOnly=true,
     * )
     */
    class User
    {
        //...
    }

@EmbedMany
----------

This annotation is similar to `@EmbedOne`_, but instead of embedding one
document, it embeds a collection of documents.

Optional attributes:

-
    ``targetDocument`` - A |FQCN| of the target document.
-
    ``discriminatorField`` - The database field name to store the discriminator
    value within the embedded document.
-
    ``discriminatorMap`` - Map of discriminator values to class names.
-
    ``defaultDiscriminatorValue`` - A default value for discriminatorField if no
    value has been set in the embedded document.
-
    ``strategy`` - The strategy used to persist changes to the collection.
    Possible values are ``addToSet``, ``pushAll``, ``set``, and ``setArray``.
    ``pushAll`` is the default. See :ref:`storage_strategies` for more
    information.
-
    ``collectionClass`` - A |FQCN| of class that implements ``Collection``
    interface and is used to hold documents. When typed properties
    are used it is inherited from PHP type, otherwise Doctrine's ``ArrayCollection`` is
    used by default.
-
    ``notSaved`` - The property is loaded if it exists in the database; however,
    ODM will not save the property value back to the database.

.. code-block:: php

    <?php

    /**
     * @EmbedMany(
     *     strategy="set",
     *     discriminatorField="type",
     *     discriminatorMap={
     *         "book"=Documents\BookTag::class,
     *         "song"=Documents\SongTag::class
     *     },
     *     defaultDiscriminatorValue="book"
     * )
     */
    private $tags = [];

Depending on the embedded document's class, a value of ``user`` or ``author``
will be stored in the ``type`` field and used to reconstruct the proper class
during hydration. The ``type`` field need not be mapped on the embedded
document classes.

@EmbedOne
---------

The `@EmbedOne`_ annotation works similarly to `@ReferenceOne`_, except that
that document will be embedded within the parent document. Consider the
following excerpt from the MongoDB documentation:

    The key question in MongoDB schema design is "does this object merit its own
    collection, or rather should it be embedded within objects in other
    collections?" In relational databases, each sub-item of interest typically
    becomes a separate table (unless you are denormalizing for performance). In
    MongoDB, this is not recommended – embedding objects is much more efficient.
    Data is then collocated on disk; client-server turnarounds to the database
    are eliminated. So in general, the question to ask is, "why would I not want
    to embed this object?"

Optional attributes:

-
    ``targetDocument`` - A |FQCN| of the target document. When typed properties
    are used it is inherited from PHP type.
-
    ``discriminatorField`` - The database field name to store the discriminator
    value within the embedded document.
-
    ``discriminatorMap`` - Map of discriminator values to class names.
-
    ``defaultDiscriminatorValue`` - A default value for discriminatorField if no
    value has been set in the embedded document.
-
    ``notSaved`` - The property is loaded if it exists in the database; however,
    ODM will not save the property value back to the database.

.. code-block:: php

    <?php

    /**
     * @EmbedOne(
     *     discriminatorField="type",
     *     discriminatorMap={
     *         "user"=Documents\User::class,
     *         "author"=Documents\Author::class
     *     },
     *     defaultDiscriminatorValue="user"
     * )
     */
    private $creator;

Depending on the embedded document's class, a value of ``user`` or ``author``
will be stored in the ``type`` field and used to reconstruct the proper class
during hydration. The ``type`` field need not be mapped on the embedded
document classes.

@EmbeddedDocument
-----------------

Marks the document as embeddable. This annotation is required for any documents
to be stored within an `@EmbedOne`_, `@EmbedMany`_ or `@File\\Metadata`_
relationship.

.. code-block:: php

    <?php

    /** @EmbeddedDocument */
    class Money
    {
        /** @Field(type="float") */
        private $amount;

        public function __construct(float $amount)
        {
            $this->amount = $amount;
        }
        //...
    }

    /** @Document(db="finance", collection="wallets") */
    class Wallet
    {
        /** @EmbedOne(targetDocument=Money::class) */
        private $money;

        public function setMoney(Money $money): void
        {
            $this->money = $money;
        }
        //...
    }
    //...
    $wallet = new Wallet();
    $wallet->setMoney(new Money(34.39));
    $dm->persist($wallet);
    $dm->flush();

Unlike normal documents, embedded documents cannot specify their own database or
collection. That said, a single embedded document class may be used with
multiple document classes, and even other embedded documents!

Optional attributes:

-
   ``indexes`` - Specifies an array of indexes for this embedded document, to be
   included in the schemas of any embedding documents (deprecated, specify all
   ``@Index`` annotations on a class level).

@Field
------

Marks an annotated instance variable for persistence. Values for this field will
be saved to and loaded from the document store as part of the document class'
lifecycle.

Optional attributes:

-
   ``type`` - Name of the ODM type, which will determine the value's
   representation in PHP and BSON (i.e. MongoDB). See
   :ref:`doctrine_mapping_types` for a list of types. Defaults to "string" or
   :ref:`Type from PHP property type <reference-php-mapping-types>`.
-
   ``enumType`` - A |FQCN| of an ``enum``. ODM will automatically handle conversion
   from the backing value stored in the database to an ``enum``. Can be auto-detected
   by :ref:`type from PHP property type <reference-php-mapping-types>`.
-
   ``name`` - By default, the property name is used for the field name in
   MongoDB; however, this option may be used to specify a database field name.
-
   ``nullable`` - By default, ODM will ``$unset`` fields in MongoDB if the PHP
   value is null. Specify true for this option to force ODM to store a null
   value in the database instead of unsetting the field.
-
   ``notSaved`` - The property is loaded if it exists in the database; however,
   ODM will not save the property value back to the database.

Examples:

.. code-block:: php

    <?php

    /**
     * @Field(type="string")
     */
    protected $username;

    /**
     * @Field(type="string", name="co")
     */
    protected $country;

    /**
     * @Field(type="float")
     */
    protected $height;

.. _file:

@File
-----

This marks the document as a GridFS file. GridFS allow storing larger amounts of
data than regular documents.

Optional attributes:

-
   ``db`` - By default, the document manager will use the MongoDB database
   defined in the configuration, but this option may be used to override the
   database for a particular file.
-
   ``bucketName`` - By default, files are stored in a bucket called ``fs``. You
   can customize that bucket name with this property.
-
   ``repositoryClass`` - Specifies a custom repository class to use. The class
   must extend the ``Doctrine\ODM\MongoDB\Repository\GridFSRepository``
   interface.
-
   ``indexes`` - Specifies an array of indexes for this document (deprecated,
   specify all ``@Index`` annotations on a class level).
-
   ``readOnly`` - Prevents the file from being updated: it can only be inserted,
   upserted or removed.
-
   ``writeConcern`` - Specifies the write concern for this file that overwrites
   the default write concern specified in the configuration.

.. _file_chunksize:

@File\ChunkSize
---------------

This maps the ``chunkSize`` property of a GridFS file to a property. It contains
the size of a single file chunk in bytes. No other options can be set.

.. _file_filename:

@File\Filename
--------------

This maps the ``filename`` property of a GridFS file to a property. No other
options can be set.

.. _file_length:

@File\Length
------------

This maps the ``length`` property of a GridFS file to a property. It contains
the size of the entire file in bytes. No other options can be set.

.. _file_metadata:

@File\Metadata
--------------

This maps the ``metadata`` property of a GridFS file to a property. Metadata can
be used to store additional properties in a file. The metadata document must be
an embedded document mapped using `@EmbeddedDocument`_.

Optional attributes:

-
    ``targetDocument`` - A |FQCN| of the target document.
-
    ``discriminatorField`` - The database field name to store the discriminator
    value within the embedded document.
-
    ``discriminatorMap`` - Map of discriminator values to class names.
-
    ``defaultDiscriminatorValue`` - A default value for ``discriminatorField``
    if no value has been set in the embedded document.

@File\UploadDate
----------------

This maps the ``uploadDate`` property of a GridFS file to a property. No other
options can be set.

.. _haslifecyclecallbacks:

@HasLifecycleCallbacks
----------------------

This annotation must be set on the document class to instruct Doctrine to check
for lifecycle callback annotations on public methods. Using `@PreFlush`_,
`@PreLoad`_, `@PostLoad`_, `@PrePersist`_, `@PostPersist`_, `@PreRemove`_,
`@PostRemove`_, `@PreUpdate`_, or `@PostUpdate`_ on methods without this
annotation will cause Doctrine to ignore the callbacks.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class User
    {
        /** @PostPersist */
        public function sendWelcomeEmail(): void {}
    }

@Id
---

The annotated instance variable will be marked as the document identifier. The
default behavior is to store an `MongoDB\BSON\ObjectId`_ instance, but you may
customize this via the :ref:`strategy <basic_mapping_identifiers>` attribute.

.. code-block:: php

    <?php

    /** @Document */
    class User
    {
        /** @Id */
        protected $id;
    }

@Index
------

This annotation is used  to specify indexes to be created on the
collection (or embedding document's collection in the case of
`@EmbeddedDocument`_). It may also be used at the property-level to define
single-field indexes.

Optional attributes:

-
    ``keys`` - Mapping of indexed fields to their ordering or index type. ODM
    will allow ``asc`` and ``desc`` to be used in place of ``1`` and ``-1``,
    respectively. Special index types (e.g. ``2dsphere``) should be specified as
    strings. This is required when `@Index`_ is used at the class level.
-
    ``options`` - Options for creating the index. Options are documented in the
    :ref:`indexes chapter <indees>`.

The ``keys`` and ``options`` attributes correspond to the arguments for
`MongoDB\Collection::createIndex() <https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-createIndex/>`_.
ODM allows mapped field names (i.e. PHP property names) to be used when defining
``keys``.

.. code-block:: php

    <?php

    /**
     * @Document
     * @Index(keys={"username"="desc"}, options={"unique"=true})
     */
    class User
    {
        //...
    }

If you are creating a single-field index, you can simply specify an `@Index`_ or
`@UniqueIndex`_ on a mapped property:

.. code-block:: php

    <?php

    /** @Field(type="string") @UniqueIndex */
    private $username;

.. note::

    If the ``name`` option is specified on an index in an embedded document, it
    will be prefixed with the embedded field path before creating the index.
    This is necessary to avoid index name conflict when the same document is
    embedded multiple times in a single collection. Prefixing of the index name
    can cause errors due to excessive index name length. In this case, try
    shortening the index name or embedded field path.

@Indexes
--------

.. note::
    The ``@Indexes`` annotation was deprecated in 2.2 and will be removed in 3.0.
    Please move all nested ``@Index`` annotations to a class level.

This annotation may be used at the class level to specify an array of `@Index`_
annotations. It is functionally equivalent to specifying multiple ``@Index``
annotations on a class level.

.. code-block:: php

    <?php

    /**
     * @Document
     * @Indexes({
     *   @Index(keys={"username"="desc"}, options={"unique"=true})
     * })
     */
    class User
    {
        //...
    }

@InheritanceType
----------------

This annotation must appear on the top-most class in an
:ref:`inheritance hierarchy <inheritance_mapping>`. ``SINGLE_COLLECTION`` and
``COLLECTION_PER_CLASS`` are currently supported.

Examples:

.. code-block:: php

    <?php

    /**
     * @Document
     * @InheritanceType("COLLECTION_PER_CLASS")
     */
    class Person
    {
        // ...
    }

    /**
     * @Document
     * @InheritanceType("SINGLE_COLLECTION")
     * @DiscriminatorField("type")
     * @DiscriminatorMap({"person"=Person::class, "employee"=Employee::class})
     */
    class Person
    {
        // ...
    }

@Lock
-----

The annotated instance variable will be used to store lock information for :ref:`pessimistic locking <transactions_and_concurrency_pessimistic_locking>`.
This is only compatible with the ``int`` type, and cannot be combined with `@Id`_.

.. code-block:: php

    <?php

    /** @Field(type="int") @Lock */
    private $lock;

@MappedSuperclass
-----------------

The annotation is used to specify classes that are parents of document classes
and should not be managed directly. See
:ref:`inheritance mapping <inheritance_mapping>` for additional information.

.. code-block:: php

    <?php

    /** @MappedSuperclass */
    class BaseDocument
    {
        // ...
    }

@PostLoad
---------

Marks a method on the document class to be called on the ``postLoad`` event. The
`@HasLifecycleCallbacks`_ annotation must be present on the same class for the
method to be registered.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PostLoad */
        public function postLoad(): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@PostPersist
------------

Marks a method on the document class to be called on the ``postPersist`` event.
The `@HasLifecycleCallbacks`_ annotation must be present on the same class for
the method to be registered.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PostPersist */
        public function postPersist(): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@PostRemove
-----------

Marks a method on the document class to be called on the ``postRemove`` event.
The `@HasLifecycleCallbacks`_ annotation must be present on the same class for
the method to be registered.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PostRemove */
        public function postRemove(): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@PostUpdate
-----------

Marks a method on the document class to be called on the ``postUpdate`` event.
The `@HasLifecycleCallbacks`_ annotation must be present on the same class for
the method to be registered.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PostUpdate */
        public function postUpdate(): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@PreFlush
---------

Marks a method on the document class to be called on the ``preFlush`` event. The
`@HasLifecycleCallbacks`_ annotation must be present on the same class for the
method to be registered.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PreFlush */
        public function preFlush(): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@PreLoad
--------

Marks a method on the document class to be called on the ``preLoad`` event. The
`@HasLifecycleCallbacks`_ annotation must be present on the same class for the
method to be registered.

.. code-block:: php

    <?php

    use Doctrine\ODM\MongoDB\Event\PreLoadEventArgs;

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PreLoad */
        public function preLoad(PreLoadEventArgs $eventArgs): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@PrePersist
-----------

Marks a method on the document class to be called on the ``prePersist`` event.
The `@HasLifecycleCallbacks`_ annotation must be present on the same class for
the method to be registered.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PrePersist */
        public function prePersist(): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@PreRemove
----------

Marks a method on the document class to be called on the ``preRemove`` event.
The `@HasLifecycleCallbacks`_ annotation must be present on the same class for
the method to be registered.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PreRemove */
        public function preRemove(): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@PreUpdate
----------

Marks a method on the document class to be called on the ``preUpdate`` event.
The `@HasLifecycleCallbacks`_ annotation must be present on the same class for
the method to be registered.

.. code-block:: php

    <?php

    /** @Document @HasLifecycleCallbacks */
    class Article
    {
        // ...

        /** @PreUpdate */
        public function preUpdated(): void
        {
            // ...
        }
    }

See :ref:`lifecycle_events` for more information.

@ReadPreference
---------------

Specifies `Read Preference <https://docs.mongodb.com/manual/core/read-preference/>_`
that will be applied when querying for the annotated document.

.. code-block:: php

    <?php

    namespace Documents;

    /**
     * @Document
     * @ODM\ReadPreference("primaryPreferred", tags={
     *   { "dc"="east" },
     *   { "dc"="west" },
     *   {  }
     * })
     */
    class User
    {
    }

.. _annotations_reference_reference_many:

@ReferenceMany
--------------

Defines that the annotated instance variable holds a collection of referenced
documents.

Optional attributes:

-
    ``targetDocument`` - A |FQCN| of the target document. A ``targetDocument``
    is required when using ``storeAs: id``.
-
    ``storeAs`` - Indicates how to store the reference. ``id`` stores the
    identifier, ``ref`` an embedded object containing the ``id`` field and
    (optionally) a discriminator. ``dbRef`` and ``dbRefWithDb`` store a `DBRef`_
    object and are deprecated in favor of ``ref``. Note that ``id`` references
    are not compatible with the discriminators.
-
    ``cascade`` - Cascade Option
-
    ``discriminatorField`` - The field name to store the discriminator value within
    the reference object.
-
    ``discriminatorMap`` - Map of discriminator values to class names.
-
    ``defaultDiscriminatorValue`` - A default value for ``discriminatorField``
    if no value has been set in the referenced document.
-
    ``inversedBy`` - The field name of the inverse side. Only allowed on owning side.
-
    ``mappedBy`` - The field name of the owning side. Only allowed on the
    inverse side.
-
    ``repositoryMethod`` - The name of the repository method to call to populate
    this reference.
-
    ``sort`` - The default sort for the query that loads the reference.
-
    ``criteria`` - Array of default criteria for the query that loads the
    reference.
-
    ``limit`` - Limit for the query that loads the reference.
-
    ``skip`` - Skip for the query that loads the reference.
-
    ``strategy`` - The strategy used to persist changes to the collection.
    Possible values are ``addToSet``, ``pushAll``, ``set``, and ``setArray``.
    ``pushAll`` is the default. See :ref:`storage_strategies` for more
    information.
-
    ``collectionClass`` - A |FQCN| of class that implements ``Collection``
    interface and is used to hold documents. When typed properties
    are used it is inherited from PHP type, otherwise Doctrine's ``ArrayCollection`` is
    used by default
-
    ``prime`` - A list of references contained in the target document that will
    be initialized when the collection is loaded. Only allowed for inverse
    references.
-
    ``notSaved`` - The property is loaded if it exists in the database; however,
    ODM will not save the property value back to the database.

.. code-block:: php

    <?php

    /**
     * @ReferenceMany(
     *     strategy="set",
     *     targetDocument=Documents\Item::class,
     *     cascade="all",
     *     sort={"sort_field": "asc"}
     *     discriminatorField="type",
     *     discriminatorMap={
     *         "book"=Documents\BookItem::class,
     *         "song"=Documents\SongItem::class
     *     },
     *     defaultDiscriminatorValue="book"
     * )
     */
    private $cart;

.. _annotations_reference_reference_one:

@ReferenceOne
-------------

Defines an instance variable holds a related document instance.

Optional attributes:

-
    ``targetDocument`` - A |FQCN| of the target document. A ``targetDocument``
    is required when using ``storeAs: id``. When typed properties are used
    it is inherited from PHP type.
-
    ``storeAs`` - Indicates how to store the reference. ``id`` stores the
    identifier, ``ref`` an embedded object containing the ``id`` field and
    (optionally) a discriminator. ``dbRef`` and ``dbRefWithDb`` store a `DBRef`_
    object and are deprecated in favor of ``ref``. Note that ``id`` references
    are not compatible with the discriminators.
-
    ``cascade`` - Cascade Option
-
    ``discriminatorField`` - The field name to store the discriminator value
    within the reference object.
-
    ``discriminatorMap`` - Map of discriminator values to class names.
-
    ``defaultDiscriminatorValue`` - A default value for ``discriminatorField``
    if no value has been set in the referenced document.
-
    ``inversedBy`` - The field name of the inverse side. Only allowed on owning
    side.
-
    ``mappedBy`` - The field name of the owning side. Only allowed on the
    inverse side.
-
    ``repositoryMethod`` - The name of the repository method to call to populate
    this reference.
-
    ``sort`` - The default sort for the query that loads the reference.
-
    ``criteria`` - Array of default criteria for the query that loads the
    reference.
-
    ``limit`` - Limit for the query that loads the reference.
-
    ``skip`` - Skip for the query that loads the reference.
-
    ``notSaved`` - The property is loaded if it exists in the database; however,
    ODM will not save the property value back to the database.

.. code-block:: php

    <?php

    /**
     * @ReferenceOne(
     *     targetDocument=Documents\Item::class,
     *     cascade="all",
     *     discriminatorField="type",
     *     discriminatorMap={
     *         "book"=Documents\BookItem::class,
     *         "song"=Documents\SongItem::class
     *     },
     *     defaultDiscriminatorValue="book"
     * )
     */
    private $cart;

@ShardKey
---------

This annotation may be used at the class level to specify a shard key to be used
for sharding the document collection.

.. code-block:: php

    <?php

    /**
     * @Document
     * @ShardKey(keys={"username"="asc"})
     */
    class User
    {
        //...
    }

@UniqueIndex
------------

Alias of `@Index`_, with the ``unique`` option set by default.

.. code-block:: php

    <?php

    /** @Field(type="string") @UniqueIndex */
    private $email;

.. _annotations_reference_version:

@Validation
-----------

This annotation may be used at the class level to specify the validation schema
for the related collection.

-
   ``validator`` - Specifies a schema that will be used by
   MongoDB to validate data inserted or updated in the collection.
   Please refer to the following
   `MongoDB documentation (Schema Validation ¶) <https://docs.mongodb.com/manual/core/schema-validation/>`_
   for more details. The value should be a string representing a BSON document under the
   `Extended JSON specification <https://github.com/mongodb/specifications/blob/master/source/extended-json.rst>`_.
   The recommended way to fill up this property is to create a class constant
   (eg. ``::VALIDATOR``) using the
   `HEREDOC/NOWDOC syntax <https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc>`_
   for clarity and to reference it as the annotation value.
   Please note that if you decide to insert the schema directly in the annotation without
   using a class constant then double quotes ``"`` have to be escaped by doubling them ``""``.
   This method also requires that you don't prefix multiline strings by the Docblock asterisk symbol ``*``.
-
   ``action`` - Determines how MongoDB handles documents that violate
   the validation rules. Please refer to the related
   `MongoDB documentation (Accept or Reject Invalid Documents ¶) <https://docs.mongodb.com/manual/core/schema-validation/#accept-or-reject-invalid-documents>`_
   for more details. The allowed values are the following:

       - ``error``
       - ``warn``

   If it is not defined then the default behavior (``error``) will be used.
   Those values are also declared as constants for convenience:

      - ``\Doctrine\ODM\MongoDB\Mapping\ClassMetadata::SCHEMA_VALIDATION_ACTION_ERROR``
      - ``\Doctrine\ODM\MongoDB\Mapping\ClassMetadata::SCHEMA_VALIDATION_ACTION_WARN``

   Import the ``ClassMetadata`` namespace to use those constants in your annotation.
-
   ``level`` - Determines which operations MongoDB applies the
   validation rules. Please refer to the related
   `MongoDB documentation (Existing Documents ¶) <https://docs.mongodb.com/manual/core/schema-validation/#existing-documents>`_
   for more details. The allowed values are the following:

      - ``off``
      - ``strict``
      - ``moderate``

   If it is not defined then the default behavior (``strict``) will be used.
   Those values are also declared as constants for convenience:

      - ``\Doctrine\ODM\MongoDB\Mapping\ClassMetadata::SCHEMA_VALIDATION_LEVEL_OFF``
      - ``\Doctrine\ODM\MongoDB\Mapping\ClassMetadata::SCHEMA_VALIDATION_LEVEL_STRICT``
      - ``\Doctrine\ODM\MongoDB\Mapping\ClassMetadata::SCHEMA_VALIDATION_LEVEL_MODERATE``

   Import the ``ClassMetadata`` namespace to use those constants in your annotation.

.. code-block:: php

    <?php

    use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
    // ... other imports

    /**
     * @Document
     * @Validation(
     *     validator=SchemaValidated::VALIDATOR,
     *     action=ClassMetadata::SCHEMA_VALIDATION_ACTION_WARN,
     *     level=ClassMetadata::SCHEMA_VALIDATION_LEVEL_MODERATE,
     * )
     */
    class SchemaValidated
    {
        public const VALIDATOR = <<<'EOT'
    {
        "$jsonSchema": {
            "required": ["name"],
            "properties": {
                "name": {
                    "bsonType": "string",
                    "description": "must be a string and is required"
                }
            }
        },
        "$or": [
            { "phone": { "$type": "string" } },
            { "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
            { "status": { "$in": [ "Unknown", "Incomplete" ] } }
        ]
    }
    EOT;

        // rest of the class code...
    }

@Version
--------

The annotated instance variable will be used to store version information for :ref:`optimistic locking <transactions_and_concurrency_optimistic_locking>`.
This is only compatible with types implementing the ``\Doctrine\ODM\MongoDB\Types\Versionable`` interface and cannot be
combined with `@Id`_. Following ODM types can be used for versioning: ``int``, ``decimal128``, ``date``, and
``date_immutable``.

.. code-block:: php

    <?php

    /** @Field(type="int") @Version */
    private $version;

By default, Doctrine ODM updates :ref:`embed-many <embed_many>` and
:ref:`reference-many <reference_many>` collections in separate write operations,
which do not bump the document version. Users employing document versioning are
encouraged to use the :ref:`atomicSet <atomic_set>` or
:ref:`atomicSetArray <atomic_set_array>` strategies for such collections, which
will ensure that collections are updated in the same write operation as the
versioned parent document.

@View
-----

Required annotation to mark a PHP class as a view. Views are created from
aggregation pipelines, which are returned from a special repository method.
Views can be used like collections for any read operations. Result documents are
not managed and cannot be referenced using the :ref:`reference-many <reference_many>`
and :ref:`reference-one <reference_one>` mappings.

Required attributes:

-
   ``rootClass`` - this is the base collection that the view is created from
-
   ``repositoryClass`` - a repository class is required. This repository must
   implement the ``MongoDB\ODM\MongoDB\Repository\ViewRepository`` interface.

Optional attributes:

-
   ``db`` - By default, the document manager will use the MongoDB database
   defined in the configuration, but this option may be used to override the
   database for a particular document class.
-
   ``view`` - By default, the view name is derived from the document's class
   name, but this option may be used to override that behavior.

.. code-block:: php

    <?php

    /**
     * @View(
     *     db="documents",
     *     rootClass=User::class,
     *     repositoryClass=UserNameRepository::class,
     * )
     */
    class UserName
    {
        //...
    }

    class UserNameRepository implements \Doctrine\ODM\MongoDB\Repository\ViewRepository
    {
        public function createViewAggregation(Builder $builder) : void
        {
            $builder->project()
                ->includeFields(['username']);
        }
    }

The ``createViewAggregation`` method can add any aggregation pipeline stage,
except for the ``$out`` and ``$merge`` stages. The pipeline is created for the
root class specified in the view mapping.

.. note::

    Views must be created before they can be queried. This can be done using the
    ``odm:schema:create`` command.

.. _BSON specification: http://bsonspec.org/spec.html
.. _DBRef: https://docs.mongodb.com/manual/reference/database-references/#dbrefs
.. _geoNear command: https://docs.mongodb.com/manual/reference/command/geoNear/
.. _MongoDB\BSON\ObjectId: https://www.php.net/manual/en/class.mongodb-bson-objectid.php
.. |FQCN| raw:: html
  <abbr title="Fully-Qualified Class Name">FQCN</abbr>


text:
using System;
using System.Collections.Generic;
using Wyam.Common;

namespace Wyam.Core.Modules
{
    // Appends the specified content to the existing content
    public class Append : ContentModule
    {
        public Append(object content)
            : base(content)
        {
        }

        public Append(Func<IDocument, object> content)
            : base(content)
        {
        }

        public Append(params IModule[] modules)
            : base(modules)
        {
        }

        protected override IEnumerable<IDocument> Execute(object content, IDocument input, IExecutionContext context)
        {
            return new [] { content == null ? input : input.Clone(input.Content + content) };
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file 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.
 */
package com.amazonaws.services.elasticloadbalancing.model.transform;

import java.util.Map;

import com.amazonaws.transform.Unmarshaller;
import com.msi.tough.query.QueryUtil;
import com.transcend.loadbalancer.message.DeregisterInstancesFromLoadBalancerMessage.DeregisterInstancesFromLoadBalancerRequest;

/**
 * DeregisterInstancesFromLoadBalancerRequestUnmarshaller
 */
public class DeregisterInstancesFromLoadBalancerRequestUnmarshaller
        implements
        Unmarshaller<DeregisterInstancesFromLoadBalancerRequest, Map<String, String[]>> {

    private static DeregisterInstancesFromLoadBalancerRequestUnmarshaller instance;

    public static DeregisterInstancesFromLoadBalancerRequestUnmarshaller getInstance() {
        if (instance == null) {
            instance = new DeregisterInstancesFromLoadBalancerRequestUnmarshaller();
        }
        return instance;
    }

    @Override
    public DeregisterInstancesFromLoadBalancerRequest unmarshall(
            final Map<String, String[]> in) throws Exception {
        final DeregisterInstancesFromLoadBalancerRequest.Builder
            req = DeregisterInstancesFromLoadBalancerRequest.newBuilder();
        req.setLoadBalancerName(QueryUtil
                .requiredString(in, "LoadBalancerName"));
        int i = 0;
        while (true) {
            i++;
            final String s[] = in.get("Instances.member." + i + ".InstanceId");
            if (s == null) {
                break;
            }
            req.addInstance(s[0]);
        }
        return req.buildPartial();
    }
}


text:
package httpview

import (
	"github.com/gorilla/context"
	"net/http"
	"net/url"
)

// Set the redirect information for the given request
func RedirectLocal(req *http.Request, path string) {
	context.Set(req, redirectInfoKey, makeRedirectFor(req, &url.URL{Path: path}))
}

// Return a URL from the given hos
func makeRedirectFor(req *http.Request, path *url.URL) *url.URL {
	return cleanUrl(req.URL.ResolveReference(path))
}

// Remove everything from the url except for
// Host/Port/Scheme/Path
func cleanUrl(dirty *url.URL) *url.URL {
	copy := *dirty
	copy.RawQuery = ""
	copy.Opaque = ""
	copy.Fragment = ""
	copy.User = nil
	return &copy
}


text:
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import jdbm.InverseHashView;
import jdbm.PrimaryStoreMap;
import jdbm.RecordManager;
import jdbm.RecordManagerFactory;
import jdbm.SecondaryKeyExtractor;
import jdbm.SecondaryTreeMap;
import jdbm.Serializer;
import jdbm.SerializerInput;
import jdbm.SerializerOutput;
import jdbm.helper.Serialization;

/**
 * Demonstrates more advanced usage of JDBM:
 * Secondary maps, 1:N relations.
 *
 * @author Jan Kotek
 *
 */
public class Persons2 {

	static class Person implements Serializable{
		/** field used for person identification (primary key)**/
		String name;
		/** persisted with Person (embedded field in JPA terms) **/
		Address adress;
		/** N:1 relation */
		Person father;

		/** constructor, getters and setters are excluded for simplicity */
		public Person(String name, Address adress,Person father) {
			super();
			this.name = name;
			this.adress = adress;
			this.father = father;
		}

		public String toString(){
			return "Person["+name+"]";
		}

		public int hashCode() {
			return name == null? 0 : name.hashCode();
		}

		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null || !(obj instanceof Person))
				return false;
			Person other = (Person) obj;
			if (name == null) {
				if (other.name != null)
					return false;
			} else if (!name.equals(other.name))
				return false;
			return true;
		}

	}

	static class Address implements Serializable{
		String streetName;
		String town;
		String country;

		public Address(String streetName, String town, String country) {
			super();
			this.streetName = streetName;
			this.town = town;
			this.country = country;
		}

	}

	/** dao object which handles Person persistence */
	static class PersonDao implements Serializer<Person>{

		/**
		 * This is map in which persons are inserted in.
		 * Key is number assigned by store (recordId).
		 * You should prefer recordId as primary index, it is more flexible.
		 */
		PrimaryStoreMap<Long,Person> persons;

		/** Inverse view on person, it helps to find recordId which belongs to person */
		InverseHashView<	Long, Person> personsInverse;

		/**
		 * Secondary view on persons, which identifies person by name.
		 * This map is readonly, it is autoupdated by JDBM as primary map changes.
		 * Key is name, value is recordId ( key from primary map),
		 * third parameter is Person (value from primary map)
		 */
		SecondaryTreeMap<String, Long, Person> personsByName;

		/**
		 * Secondary view on persons, which identifies person its town
		 * This map is readonly, it is autoupdated by JDBM as primary map changes.
		 * Key is town name extracted from primary table,
		 * value is recordId ( key from primary map),
		 * third parameter is town from  (value from primary map)
		 */
		SecondaryTreeMap<String, Long, Person> personsByTown;

		public PersonDao(RecordManager recman) {
			persons = recman.storeMap("persons",this);
			personsInverse = persons.inverseHashView("personsInverse");
			personsByName = persons.secondaryTreeMap("personsByName",
						new SecondaryKeyExtractor<String, Long, Person>() {
							public String extractSecondaryKey(Long key, Person value) {
								return value.name;
							}});
			personsByTown = persons.secondaryTreeMap("personsByTown",
						new SecondaryKeyExtractor<String, Long, Person>() {
							public String extractSecondaryKey(Long key, Person value) {
								if(value.adress == null)
									return null;
								return value.adress.town;
							}});

		}

		public Person personByRecordId(Long recid){
			return persons.get(recid);
		}

		public Person personByName(String name){
			if(!personsByName.containsKey(name))
				return null;
			Iterator<Long> iter = personsByName.get(name).iterator();
			if(iter.hasNext())
				return personsByName.getPrimaryValue(iter.next());
			else
				return null;
		}

		public Iterable<Person> personsByTown(String name){
			List<Person> ret = new ArrayList<Person>();
			for(Long l: personsByTown.get(name)){
				ret.add(personsByTown.getPrimaryValue(l));
			}
			return ret;
		}

		public void insertPerson(Person person){
			Long recid = personsInverse.findKeyForValue(person);
			if(recid == null)
				persons.putValue(person);
			else
				persons.put(recid, person);
		}

		public Person deserialize(SerializerInput in) throws IOException, ClassNotFoundException {
			String name = in.readObject();
			Address address = in.readObject();
			Person father = persons.get(in.readObject());
			Person p = new Person(name,address,father);

			return p;
		}

		public void serialize(SerializerOutput out, Person obj)
				throws IOException {
			out.writeObject(obj.name);
			out.writeObject(obj.adress);
			out.writeObject(findOrPersistPerson(obj.father));
		}

		protected Long findOrPersistPerson(Person person){
			if(person == null)
				return null;
			Long recid = personsInverse.findKeyForValue(person);
			if(recid == null)
				recid = persons.putValue(person);
			return recid;
		}

	}

	public static void main(String[] args) throws IOException {
		//init Record Manager and dao
		RecordManager recman = RecordManagerFactory.createRecordManager("persons2");
		PersonDao dao = new PersonDao(recman);

		//create a few persons
		Person patrick = new Person("Patrick Moore",
				new Address("First street", "Athlone","Ireland"),
				null);

		Person jack = new Person("Jack Moore",
				new Address("First street", "Athlone","Ireland"),
				patrick);

		Person paul = new Person("Paul Moore",
				new Address("Shop street", "Galway","Ireland"),
				patrick);

		//now store all this stuff
		dao.insertPerson(jack);
		dao.insertPerson(patrick);
		dao.insertPerson(paul);

		System.out.println("Number of persons: "+dao.persons.size());

		System.out.println("Persons with name Patrick Moore: "+dao.personByName("Patrick Moore"));
		System.out.println("Persons living in Galway: "+dao.personsByTown("Galway"));
		System.out.println("Father of Paul Moore: "+dao.personByName("Paul Moore").father);

	}

}


text:
using System;
using System.Text;
using PureCat.Message.Spi.Codec;
using PureCat.Util;
using PureCat.Message.Spi;

namespace PureCat.Message.Internals
{

    public abstract class AbstractMessage : IMessage
    {
        private readonly string _name;
        private readonly string _type;
        private bool _completed;
        private StringBuilder _data;
        private IMessageManager _messageManager;

        protected AbstractMessage(string type, string name, IMessageManager messageManager = null)
        {
            _type = type;
            _name = name;
            _messageManager = messageManager;
            TimestampInMicros = MilliSecondTimer.CurrentTimeMicros;
        }

        /// <summary>
        ///   其实是Ticks除以10
        /// </summary>
        protected long TimestampInMicros { get; private set; }

        #region IMessage Members

        public IMessageManager MessageManager { get { return _messageManager; } }

        public string Data { get { return _data?.Length == null ? string.Empty : _data.ToString(); } }

        public string Name { get { return _name; } }

        public string Status { get; set; } = PureCatConstants.SUCCESS;
        /// <summary>
        ///   其实是Ticks除以10000
        /// </summary>
        public long Timestamp { get { return TimestampInMicros / 1000L; } set { TimestampInMicros = value * 1000L; } }

        public string Type { get { return _type; } }

        public void AddData(string keyValuePairs)
        {
            if (_data == null)
            {
                _data = new StringBuilder(keyValuePairs);
            }
            else
            {
                _data.Append(keyValuePairs);
            }
        }

        public void AddData(string key, Object value)
        {
            if (_data == null)
            {
                _data = new StringBuilder();
            }
            else if (_data.Length > 0)
            {
                _data.Append('&');
            }

            _data.Append(key).Append('=').Append(value);
        }

        public virtual void Complete()
        {
            SetCompleted(true);
        }

        public bool IsCompleted()
        {
            return _completed;
        }

        public bool IsSuccess()
        {
            return PureCatConstants.SUCCESS == Status;
        }

        public void SetStatus(Exception e)
        {
            Status = e.GetType().FullName;
        }

        #endregion

        protected void SetCompleted(bool completed)
        {
            _completed = completed;
        }

        public override string ToString()
        {
            PlainTextMessageCodec codec = new PlainTextMessageCodec();
            ChannelBuffer buf = new ChannelBuffer(8192);

            codec.EncodeMessage(this, buf);
            buf.Reset();

            return buf.ToString();
        }
    }
}


text:
Yet another post

[meta:author]: <> (Jonas Colmsjo)
[meta:title]: <> (Portal-frameworks.md)
[meta:date]: <> (2012-01-01)
[meta:nested:key]: <> (Metadata value)

##!!truncate

[[Main_Page]]

== Enterprise portals ==

* http://www.liferay.com - de flesta features kostar pengar

* http://www.jboss.org/gatein
** http://www.exoplatform.com/company/public/website
** http://www.jboss.org/jbossportal

* http://glassfish.java.net/ - en applikationsserver, kanske inte Enterprise portal?
* http://www.jasig.org/uportlal

* http://portals.apache.org/pluto/
* http://www.teamlab.com/ - CMS, projects, är den verkligen FOSS?
* http://www.hippoportal.org/ - verkar gammal
* http://portalfoundation.codeplex.com/
* http://ajaxportal.codeplex.com/

* http://en.wikipedia.org/wiki/Enterprise_portal

== CMS Alternatives ==

* List - http://en.wikipedia.org/wiki/List_of_content_management_frameworks

* http://www.webgui.org/features
* Drupal and Joolma
* Python based
** http://www.zope.org/
** http://plone.org/
** PSP - Python Server Pages
** http://ppa.sourceforge.net/
** http://wiki.python.org/moin/Applications

Kommer högt upp när man söker:
* http://www.pimcore.org/
* http://diem-project.org/
* RESTx

= editors=

* jwysiwyg
* tinymce
* fckeditor
* exteditor
* phpstorm
* aptana
* Eclipse
* Netbeans
* zend studio
* komodo
* nusphere phpEd


text:
<!DOCTYPE HTML>

		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>EC2RegisterImageRequest Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 963)" />

AWS SDK for iOS v1.7.1

				Amazon Web Services, Inc.

EC2RegisterImageRequest Class Reference

					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents">Table of Contents</button>

					<select id="jumpTo">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<option value="properties">Properties</option>

	<option value="//api/name/architecture">    architecture</option>

	<option value="//api/name/blockDeviceMappings">    blockDeviceMappings</option>

	<option value="//api/name/descriptionValue">    descriptionValue</option>

	<option value="//api/name/dryRun">    dryRun</option>

	<option value="//api/name/imageLocation">    imageLocation</option>

	<option value="//api/name/kernelId">    kernelId</option>

	<option value="//api/name/name">    name</option>

	<option value="//api/name/ramdiskId">    ramdiskId</option>

	<option value="//api/name/rootDeviceName">    rootDeviceName</option>

	<option value="//api/name/sriovNetSupport">    sriovNetSupport</option>

	<option value="//api/name/virtualizationType">    virtualizationType</option>

	<option value="instance_methods">Instance Methods</option>

	<option value="//api/name/addBlockDeviceMapping:">    - addBlockDeviceMapping:</option>

	<option value="//api/name/description">    - description</option>

	<option value="//api/name/init">    - init</option>

	<option value="//api/name/initWithImageLocation:">    - initWithImageLocation:</option>

</select>

Overview

Tasks

Properties

architecture

blockDeviceMappings

descriptionValue

dryRun

imageLocation

kernelId

name

ramdiskId

rootDeviceName

sriovNetSupport

virtualizationType

Instance Methods

addBlockDeviceMapping:

description

init

initWithImageLocation:

Index

Hierarchy

EC2RegisterImageRequest Class Reference

	Inherits from
	AmazonServiceRequestConfig : NSObject

	Declared in
	EC2RegisterImageRequest.h

Overview

Register Image Request

Tasks

		  dryRun

	property

		  imageLocation

	property

		  name

	property

		  descriptionValue

	property

		  architecture

	property

		  kernelId

	property

		  ramdiskId

	property

		  rootDeviceName

	property

		  blockDeviceMappings

	property

		  virtualizationType

	property

		  sriovNetSupport

	property

		– init

		– initWithImageLocation:

		– addBlockDeviceMapping:

		– description

Properties

architecture

The architecture of the image.
 Valid Values: i386,
x86_64

Constraints:

Allowed Values: i386, x86_64

@property (nonatomic, retain) NSString *architecture

Discussion

The architecture of the image.
 Valid Values: i386,
x86_64

Constraints:

Allowed Values: i386, x86_64

Declared In

		EC2RegisterImageRequest.h

blockDeviceMappings

The block device mappings for the new AMI, which specify how different
block devices (ex: EBS volumes and ephemeral drives) will be exposed
on instances launched from the new image.

@property (nonatomic, retain) NSMutableArray *blockDeviceMappings

Discussion

The block device mappings for the new AMI, which specify how different
block devices (ex: EBS volumes and ephemeral drives) will be exposed
on instances launched from the new image.

Declared In

		EC2RegisterImageRequest.h

descriptionValue

The description describing the new AMI.

@property (nonatomic, retain) NSString *descriptionValue

Discussion

The description describing the new AMI.

Declared In

		EC2RegisterImageRequest.h

dryRun

The value of the DryRun property for this object.

@property (nonatomic) BOOL dryRun

Discussion

The value of the DryRun property for this object.

Declared In

		EC2RegisterImageRequest.h

imageLocation

The full path to your AMI manifest in Amazon S3 storage.

@property (nonatomic, retain) NSString *imageLocation

Discussion

The full path to your AMI manifest in Amazon S3 storage.

Declared In

		EC2RegisterImageRequest.h

kernelId

The optional ID of a specific kernel to register with the new AMI.

@property (nonatomic, retain) NSString *kernelId

Discussion

The optional ID of a specific kernel to register with the new AMI.

Declared In

		EC2RegisterImageRequest.h

name

The name to give the new Amazon Machine Image.
 Constraints: 3-128
alphanumeric characters, parenthesis (()), commas
(,), slashes (/), dashes (-),
or underscores(_)

@property (nonatomic, retain) NSString *name

Discussion

The name to give the new Amazon Machine Image.
 Constraints: 3-128
alphanumeric characters, parenthesis (()), commas
(,), slashes (/), dashes (-),
or underscores(_)

Declared In

		EC2RegisterImageRequest.h

ramdiskId

The optional ID of a specific ramdisk to register with the new AMI.

 Some kernels require additional drivers at launch. Check the
kernel requirements for information on whether you need to specify a
RAM disk.

@property (nonatomic, retain) NSString *ramdiskId

Discussion

The optional ID of a specific ramdisk to register with the new AMI.

 Some kernels require additional drivers at launch. Check the
kernel requirements for information on whether you need to specify a
RAM disk.

Declared In

		EC2RegisterImageRequest.h

rootDeviceName

The root device name (e.g., /dev/sda1).

@property (nonatomic, retain) NSString *rootDeviceName

Discussion

The root device name (e.g., /dev/sda1).

Declared In

		EC2RegisterImageRequest.h

sriovNetSupport

The value of the SriovNetSupport property for this object.

@property (nonatomic, retain) NSString *sriovNetSupport

Discussion

The value of the SriovNetSupport property for this object.

Declared In

		EC2RegisterImageRequest.h

virtualizationType

The value of the VirtualizationType property for this object.

@property (nonatomic, retain) NSString *virtualizationType

Discussion

The value of the VirtualizationType property for this object.

Declared In

		EC2RegisterImageRequest.h

Instance Methods

addBlockDeviceMapping:

Adds a single object to blockDeviceMappings.
This function will alloc and init blockDeviceMappings if not already done.

- (void)addBlockDeviceMapping:(EC2BlockDeviceMapping *)blockDeviceMappingObject

Discussion

Adds a single object to blockDeviceMappings.
This function will alloc and init blockDeviceMappings if not already done.

Declared In

		EC2RegisterImageRequest.h

description

Returns a string representation of this object; useful for testing and
debugging.

- (NSString *)description

Return Value

A string representation of this object.

Discussion

Returns a string representation of this object; useful for testing and
debugging.

Declared In

		EC2RegisterImageRequest.h

init

Default constructor for a new RegisterImageRequest object.  Callers should use the
property methods to initialize this object after creating it.

- (id)init

Discussion

Default constructor for a new RegisterImageRequest object.  Callers should use the
property methods to initialize this object after creating it.

Declared In

		EC2RegisterImageRequest.h

initWithImageLocation:

Constructs a new RegisterImageRequest object.
Callers should use properties to initialize any additional object members.

- (id)initWithImageLocation:(NSString *)theImageLocation

Parameters

theImageLocation

The full path to your AMI manifest in Amazon
S3 storage.

Discussion

Constructs a new RegisterImageRequest object.
Callers should use properties to initialize any additional object members.

Declared In

		EC2RegisterImageRequest.h

Index

Hierarchy

© 2013 Amazon Web Services, Inc.. All rights reserved. (Last updated: 2013-12-12)

						Generated by appledoc 2.2 (build 963).


text:
package com.raspoid.examples.robots.poc;

import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
import com.raspoid.GPIOPin;
import com.raspoid.Tools;
import com.raspoid.additionalcomponents.Button;
import com.raspoid.additionalcomponents.Joystick;
import com.raspoid.additionalcomponents.LED;
import com.raspoid.additionalcomponents.adc.PCF8591;
import com.raspoid.additionalcomponents.adc.PCF8591InputChannel;
import com.raspoid.exceptions.RaspoidException;

/**
 * A JoystickRemote is used to remotely control our proof of concept robot ({@link RobotPOC}).
 *
 * @author Julien Louette & Gaël Wittorski
 * @version 1.0
 */
public class JoystickRemote {

    /**
     * Mode to control the position of the camera support.
     */
    private static final int CAMERA_SUPPORT_MODE = 0;

    /**
     * Mode to control the direction of the robot.
     */
    private static final int ROBOT_MOTORS_MODE = 1;

    /**
     * Array containing the different modes of the joystick.
     */
    private static final int[] modes = {CAMERA_SUPPORT_MODE, ROBOT_MOTORS_MODE};

    /**
     * The position (index) of the current mode in the modes array.
     * @see #modes
     */
    private int currentModePos = 0;

    /**
     * Current selected mode.
     */
    private int currentMode = modes[0];

    /**
     * [Joystick] joystick instance.
     * Uses inputs 0, 1 and 2 from ADC8591.
     */
    private Joystick joystick = null;

    private Button switchModeButton = null;

    private LED led = null;

    private DataOutputStream outputStream = null;

    private Socket socket = null;

    private boolean running = false;

    /**
     * Constructor for a new Joystick remote, used to control our RobotPOC.
     * We use a websocket to share the current position of the joystick.
     * @param ipAddress the IP address of the RobotPOC MessageLikeSocketServer.
     * @param port the port of the RobotPOC MessageLikeSocketServer.
     */
    public JoystickRemote(String ipAddress, String port) {
        PCF8591 pcf8591 = new PCF8591();
        joystick = new Joystick(pcf8591, PCF8591InputChannel.CHANNEL_1, PCF8591InputChannel.CHANNEL_0, PCF8591InputChannel.CHANNEL_2);

        led = new LED(GPIOPin.GPIO_00);
        led.pulse(1000);

        switchModeButton = new Button(GPIOPin.GPIO_04);
        switchModeButton.getGpioPinDigitalInput().addListener((GpioPinListenerDigital)
            (GpioPinDigitalStateChangeEvent event) -> {
                if(switchModeButton.isPressed())
                    switchMode();
            });

        connectToRobotPOC(ipAddress, port);

        // To execute on exit
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            if(socket != null) {
                try {
                    socket.close();
                } catch (IOException e) {
                    throw new RaspoidException("Error when closing socket.", e);
                }
            }
        }));
    }

    /**
     * Starts updating and sending values to the RobotPOC.
     */
    public void start() {
        running = true;
    }

    /**
     * Pauses updating and sending values to the RobotPOC.
     */
    public void pause() {
        running = false;
    }

    private void connectToRobotPOC(String ipAddress, String port) {
        try {
            Tools.log("Asking connection with the server.");
            socket = new Socket(ipAddress, Integer.parseInt(port));
            Tools.log("Connection established.");

            outputStream = new DataOutputStream(socket.getOutputStream());

            new Thread(() -> {
                boolean neutralValueSent = false;
                while(true) {
                    if(running) {
                        neutralValueSent = updateAndSendNewJoystickValue(neutralValueSent);
                    }
                    Tools.sleepMilliseconds(100);
                }
            }).start();
        } catch (NumberFormatException | IOException e) {
            throw new RaspoidException("Error when opening socket with server.", e);
        }
    }

    private boolean updateAndSendNewJoystickValue(boolean neutralValueSent) {
        boolean sendNewValue;
        int[] result = joystick.getXYPosition();
        int x = result[0];
        int y = result[1];
        if(x == -1 && y == -1) {
            // button pressed, no message sent
            neutralValueSent = false;
            sendNewValue = false;
        } else if(x <= 133 && x >= 129 && y <= 133 && y >= 129) {
            // neutral position
            if(!neutralValueSent) {
                sendNewValue = true;
                neutralValueSent = true;
            } else {
                sendNewValue = false;
            }
        } else {
            neutralValueSent = false;
            sendNewValue = true;
        }
        if(sendNewValue)
            sendNewValue(result[0], result[1]);
        return neutralValueSent;
    }

    private void sendNewValue(int x, int y) {
        String request = "error";
        if(currentMode == CAMERA_SUPPORT_MODE)
            request = "joystick_camera";
        else if(currentMode == ROBOT_MOTORS_MODE)
            request = "joystick_robot_motors";
        try {
            request = request + "/" + x + "/" + y;
            byte[] message = request.getBytes("UTF-8");
            outputStream.writeInt(message.length);
            outputStream.write(message);
            outputStream.flush();
        } catch (IOException e) {
            throw new RaspoidException("Problem when sending new Joystick update: (request) " + request, e);
        }
    }

    /**
     * Selects the next mode in modes array.
     * @return
     */
    private int switchMode() {
        if(currentModePos == (modes.length - 1))
            currentModePos = 0;
        else
            currentModePos++;
        currentMode = modes[currentModePos];

        Tools.log("New mode selected: " + currentMode);

        return currentMode;
    }

    /**
     * Command-line interface.
     *
Usage:
     *

     * JoystickRemote ip_address port_nb
     *

     *

     * @param args input args: <ip_address> <port_nb>
     */
    public static void main(String[] args) {
        if(args.length != 2)
            throw new RaspoidException("Usage: JoystickRemote <ip_address> <port>");

        new JoystickRemote(args[0], args[1]).start();

        while(true) {
            Tools.sleepMilliseconds(100);
        }
    }
}


text:
<!DOCTYPE html>

<meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="recursos medicina USAC San Carlos, facultad de ciencias medicas, anatomia, Fisiologia, bioquimica11usac, salud publica, Semiologia medica, decano, ayuda para estudiantes, resumenes de fisiologia yurimon">
  <meta name="author" content="Jorge A.M.L. AML Productions y Solarin Industries.">
  <link rel="icon" href="pictures/icon.png">
  <meta property="og:image" content="../pictures/icon.png" />
	<title>Casos Clínicos</title>

    <link href="css/theme-aml/asphalt.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/upgrade 1.1/footer.css">
    <link href="css/starter-templateA_without_hover.css" rel="stylesheet">
    <link rel="stylesheet" media="(max-width: 736px)" href="css/upgrade 1.1/max-736px.css">
    <link rel="stylesheet" media="(min-width: 860px)" href="css/upgrade 1.1/min-320px.css">

    <link rel="stylesheet" type="text/css" href="css/whhg.css">

    <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" rel="stylesheet">
    <link href="css/bootstrap/ie10-viewport-bug-workaround.css" rel="stylesheet">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>

          MedicinaResources.com

Ayuda

contacto

Información

                Catedras y libros

Catedra de Anatomia

Catedra de Fisiologia

Catedra de Histologia

Catedra de Bioquimica

Catedra de Salud Publica

Catedra de Semiologia

Libros

Anatomia

Fisiologia

Histologia

Bioquimica

Salud Publica

Semiologia

        Programación11
        Libros6
        Resumenes varios28
        Resumenes Yury Mazariegos 11
        Resumenes Kenia32
        Resumenes Jorge13
        Casos Clínicos Resueltos10
        Presentaciones García33
        Presentaciones Molina27
        Parciales32

Descargar

  Todos los Casos Clínicos 2016.

  Nauseas y Vomitos.

  Sindrome del Vertigo.

  Fisiología Postural.

  Redactar un Caso Clínico.

 Amón...

El tema Amón, te ofrece una experiencia para navegar hacia el infinito, lo divino, para aquellos que quieren lograr la inmortalidad como todo un Faraón.

Hojas de Trabajo

        Laboratorio 1
        Laboratorio 2
        Laboratorio 3

          Descargar
          Contenido
          Caso
          Código

            Descargar
            Caso Clínico 1 por Edwin Delgado Word
            Neurologico
            2016A26C204CC1

            Descargar
            Caso Clínico 1 por Zapparoli Word
            Neurologico
            2016A26A204CC2

            Descargar
            Caso Clínico 1 por Jorge Word
            Neurologico
            2016A26C204CC3

            Descargar
            Caso Clínico 1 por Ernesto Word
            Neurologico
            2016A26A204CC4

            Descargar
            Caso Clínico 1 por Eunice PDF
            Neurologico
            2016A26C204CC5

            Descargar
            Caso Clínico 1 por Yessenia Word
            Neurologico
            2016A26A204CC6

            Descargar
            Caso Clínico 2 por Eunice PDF
            Cardiología
            2016A26C204CC7

            Descargar
            Caso Clínico 3 por Ernesto Word
            Neurologico
            2016A26A204CC8

            Descargar
            Caso Clínico 3 por Grupo 35 PDF
            Nefrología
            2016A26C204CC9

            Descargar
            Caso Clínico 4 por Cesar Word
            Endocrinología
            2016A26A204CC10

Descarga nuestra extensión para chrome

Aprende la básico de la Endocrinología con una nueva pestaña con nuestro plugin de Flash Cards  Descargalo aquí o haz click sobre la imagen.

Estudia de una forma diferente y más tecnologica usando flash card, memoriza las Hormonas del cuerpo humano, sus funciones y su estructura química sacado de la tabla del capítulo de: Introducción a la Endocrinología.

   Actualizado el 2 de Septiembre del 2017.

Comparte nuestra página a un amigo

MedicinaResources

Información

Ayuda

Aviso Legal

Contacto

Logos

Politica de seguridad

Generar error 404

Catedras

Cátedra de anatomia

Cátedra de Fisiología

Cátedra de Histología

Cátedra de Bioquímica

Cátedra Salud Pública

Catedra de Semiologia

Cursos

Anatomía

Fisiología

Histología

Bioquímica

Salud Pública

Semiologia

Extras Educativos

Mapa del Sitio

CERN

Socig

EUROfusion

Science in school

Wageningen university

Instituto nacional de Salud

European Southern Observatory

European Molecular Biology Laboratory

Blogs

Blog del sitio

Blog de Jonathan Molina

Blog de Silvia Gonzales

      Contacto
      medicinaofficialmail@gmail.com
      Santiago-Guatemala
      ®2017 MedicinaResources
      ®2014-2017 AML Productions.
      ®2004-2017 Solarin Industries

       Version: 1.1

Copyright ® 2017 Medicinaresources. all rigths reserved.

Made with  and  by  AML Productions.


text:
from PyQt4 import QtGui, QtCore
from core import map
import gui.form.entitydialog
from core.localisation import _

class formNpcDialog(gui.form.entitydialog.entityDialog):
	"""
	Window to fill some informations to create a NPC
	label npc name      npc name field
	label npc species   npc species field
	label npc gender    npc gender field
	create button       cancel button
	"""
	_npcInternalNameField = None
	_npcNameField = None
	_npcTypeField = None
	_npcSizeField = None

	_title = _('NEW_NPC_DIALOG_TITLE')

	def __init__(self, parent, app, coordinates=None, row=None):
		"""
		Creates the window GUI and displays the window
		"""
		gui.form.entitydialog.entityDialog.__init__(self, parent, app, coordinates, row)
		self.entityType = 'npc'

	def getFields(self, npc=None):
		"""
		Creates the UI
		"""
		layout = QtGui.QGridLayout()

		npcInternalNameLabel = QtGui.QLabel(_('NPC_INTERNAL_NAME_LABEL'))
		self._npcInternalNameField = QtGui.QLineEdit()

		npcNameLabel = QtGui.QLabel(_('NPC_NAME_LABEL'))
		self._npcNameField = QtGui.QLineEdit()

		npcSpeciesLabel = QtGui.QLabel(_('NPC_SPECIES_LABEL'))
		self._npcSpeciesField = QtGui.QComboBox()
		self._npcSpeciesField.addItems(self._app.map.getSpeciesNames())

		npcGenderLabel = QtGui.QLabel(_('NPC_GENDER_LABEL'))
		self._npcGenderField = QtGui.QComboBox()
		self._npcGenderField.addItems(map.map.getGenders())

		if npc is not None:
			self._npcNameField.setText(npc['name'])
			self._npcInternalNameField.setText(npc['internalName'])
			self._npcSpeciesField.setCurrentIndex(npc['species'])
			self._npcGenderField.setCurrentIndex(npc['gender'])

		layout.addWidget(npcInternalNameLabel, 0, 0)
		layout.addWidget(self._npcInternalNameField, 0, 1)
		layout.addWidget(npcNameLabel, 1, 0)
		layout.addWidget(self._npcNameField, 1, 1)
		layout.addWidget(npcSpeciesLabel, 2, 0)
		layout.addWidget(self._npcSpeciesField, 2, 1)
		layout.addWidget(npcGenderLabel, 3, 0)
		layout.addWidget(self._npcGenderField, 3, 1)

		return layout

	def validateFormData(self):
		valid = True
		internalName = str(self._npcInternalNameField.text()).strip()
		name = str(self._npcNameField.text()).strip()
		species = int(self._npcSpeciesField.currentIndex())
		gender = int(self._npcGenderField.currentIndex())

		if internalName == "":
			self.displayMessage(_('ERROR_EMPTY_NPC_INTERNAL_NAME'))
			valid = False
		elif self._editedRow != internalName and self._app.hasEntityWithName(self.entityType, internalName):
			self.displayMessage(_('ERROR_DUPLICATE_NPC_INTERNAL_NAME'))
			valid = False
		if name == "":
			self.displayMessage(_('ERROR_EMPTY_NPC_NAME'))
			valid = False
		if species < 0 or species >= len(self._app.map.getSpeciesNames()):
			self.displayMessage(_('ERROR_INVALID_NPC_SPECIES'))
			valid = False
		if gender < 0 or gender >= len(map.map.getGenders()):
			self.displayMessage(_('ERROR_INVALID_NPC_GENDER'))
			valid = False

		if valid is False:
			return False

		return {
			'name': name,
			'gender': self._npcGenderField.currentIndex(),
			'species': self._npcSpeciesField.currentIndex(),
			'internalName': internalName
		}


text:
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
  <Asset Type="Graphics:FontDescription">
    <!-- Value replaced by generator -->
    <FontName>{0}</FontName>
    <!-- Value replaced by generator -->
    <Size>{1}</Size>
    <Spacing>0</Spacing>
    <UseKerning>true</UseKerning>
    <!-- Value replaced by generator -->
    <Style>{2}</Style>
    <DefaultCharacter>*</DefaultCharacter>
    <CharacterRegions>
      <CharacterRegion>
        <Start> </Start>
        <End>ſ</End>
      </CharacterRegion>
    </CharacterRegions>
  </Asset>
</XnaContent>


text:
const express = require('express');
const mongoose = require('mongoose');
const router = express.Router();
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const Account = require('./models/account');

passport.use(new LocalStrategy(Account.authenticate()));
passport.serializeUser(Account.serializeUser());
passport.deserializeUser(Account.deserializeUser());
mongoose.connect('mongodb://localhost/myblog');

router.post('/register', (req, res) => Account.register(
  new Account({ username: req.body.username }),
  req.body.password,
  (err, account) => {
    if (err) {
      console.log(req.body.username);
      console.log(req.body.passpord);
      console.log(err);
      return res.send(JSON.stringify({ account }));
    }
    passport.authenticate('local')(req, res, () => {
      console.log(req.body.username);
      console.log(req.body.password);
      console.log('yes!!!!');
      return res.send(JSON.stringify({ account }));
    });
  }
));
router.post('/login',
  passport.authenticate('local'),
  (req, res) => res.send(JSON.stringify({ username: req.body.username })));
router.get('/logout',
  (req, res) => {
    req.logout();
    res.send(JSON.stringify({ logout: true }));
  });
router.get('/ping', (req, res) =>
    res.status(200).send('pong!')
);
module.exports = router;


text:
package at.doml.genalg.codecs;

import at.doml.genalg.codecs.abstracts.AbstractDoubleArrayToBinaryCodec;

/**
 * An implementation of AbstractDoubleArrayToBinaryCodec which encodes doubles with gray
 * binary code. This class extends the DoubleArrayToNaturalBinaryCodec due to similarities in conversion.
 * The values are converted to natural binary first and then to gray code. Values can range from specified
 * lowerBound to specified upperBound, with all zeroes representing lowerBound
 * and leading one with remaining zeroes representing upperBound. Minimum and maximum number of bits per
 * value is specified in AbstractDoubleArrayToBinaryCodec.
 *
 * @author Domagoj Latečki
 * @version 1.0
 * @since 1.8
 * @see AbstractDoubleArrayToBinaryCodec
 * @see DoubleArrayToNaturalBinaryCodec
 */
public class DoubleArrayToGrayBinaryCodec extends DoubleArrayToNaturalBinaryCodec {

    /**
     * Serial version UID.
     */
    private static final long serialVersionUID = 3484670780845767156L;

    /**
     * Constructs a DoubleArrayToGrayBinaryCodec object with provided coding parameters.
     *
     * @param bitsPerValue number of code bits per single double value. Minimum value is 8, and maximum
     *            value is 32.
     * @param lowerBound minimum value to encode. All values smaller than this will have bits set to all zeroes.
     * @param upperBound maximum value to encode. All values greater than this will have bits set to all ones.
     * @throws IllegalArgumentException thrown if number of code bits is less than 8 or greater than 32.
     */
    public DoubleArrayToGrayBinaryCodec(int bitsPerValue, double lowerBound, double upperBound) {
        super(bitsPerValue, lowerBound, upperBound);
    }

    @Override
    protected long calculateEncodedLowerBound(double lowerBound, int bitsPerValue) {

        return 0L;
    }

    @Override
    protected long calculateEncodedUpperBound(double upperBound, int bitsPerValue) {

        long encodedValue = 1L;

        for (int i = 0, bound = bitsPerValue - 1; i < bound; i++) {
            encodedValue = encodedValue << 1L;
        }

        return encodedValue;
    }

    @Override
    protected long encodeValue(double value, double lowerBound, double upperBound, double step, int bitsPerValue) {

        long binaryValue = super.encodeValue(value, lowerBound, upperBound, step, bitsPerValue);

        return binaryValue ^ binaryValue >>> 1;
    }

    @Override
    protected double decodeValue(long value, double lowerBound, double upperBound, double step, int bitsPerValue) {

        long binaryValue = value;

        for (long mask = binaryValue >>> 1L; mask != 0; mask = mask >>> 1L) {
            binaryValue = binaryValue ^ mask;
        }

        return super.decodeValue(binaryValue, lowerBound, upperBound, step, bitsPerValue);
    }
}


text:
package com.intellij.psi.impl.source.codeStyle;

import com.intellij.configurationStore.SchemeDataHolder;
import com.intellij.configurationStore.SerializableScheme;
import com.intellij.openapi.application.ApplicationBundle;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.options.ExternalizableSchemeAdapter;
import com.intellij.openapi.options.SchemeState;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.psi.codeStyle.CodeStyleScheme;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import org.jdom.Element;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class CodeStyleSchemeImpl extends ExternalizableSchemeAdapter implements CodeStyleScheme, SerializableScheme {
  private static final Logger LOG = Logger.getInstance(CodeStyleSchemeImpl.class);

  private SchemeDataHolder<? super CodeStyleSchemeImpl> myDataHolder;
  private String myParentSchemeName;
  private final boolean myIsDefault;
  private volatile CodeStyleSettings myCodeStyleSettings;
  private long myLastModificationCount;

  private final Object lock = new Object();

  CodeStyleSchemeImpl(@NotNull String name, String parentSchemeName, @NotNull SchemeDataHolder<? super CodeStyleSchemeImpl> dataHolder) {
    setName(name);
    myDataHolder = dataHolder;
    myIsDefault = DEFAULT_SCHEME_NAME.equals(name);
    myParentSchemeName = parentSchemeName;
  }

  public CodeStyleSchemeImpl(@NotNull String name, boolean isDefault, @Nullable CodeStyleScheme parentScheme) {
    setName(name);
    myIsDefault = isDefault;
    init(parentScheme, null);
  }

  @NotNull
  private CodeStyleSettings init(@Nullable CodeStyleScheme parentScheme, @Nullable Element root) {
    final CodeStyleSettings settings;
    if (parentScheme == null) {
      settings = CodeStyleSettingsManager.getInstance().createSettings();
    }
    else {
      CodeStyleSettings parentSettings = parentScheme.getCodeStyleSettings();
      settings = CodeStyleSettingsManager.getInstance().cloneSettings(parentSettings);
      while (parentSettings.getParentSettings() != null) {
        parentSettings = parentSettings.getParentSettings();
      }
      settings.setParentSettings(parentSettings);
    }

    if (root != null) {
      try {
        settings.readExternal(root);
      }
      catch (InvalidDataException e) {
        LOG.error(e);
      }
    }

    myCodeStyleSettings = settings;
    return settings;
  }

  @Override
  @NotNull
  public CodeStyleSettings getCodeStyleSettings() {
    CodeStyleSettings settings = myCodeStyleSettings;
    if (settings != null) {
      return settings;
    }

    synchronized (lock) {
      SchemeDataHolder<? super CodeStyleSchemeImpl> dataHolder = myDataHolder;
      if (dataHolder == null) {
        return myCodeStyleSettings;
      }

      Element element = dataHolder.read();
      // nullize only after element is successfully read, otherwise our state will be undefined - both myDataHolder and myCodeStyleSettings are null
      myDataHolder = null;
      settings = init(myParentSchemeName == null ? null : CodeStyleSchemesImpl.getSchemeManager().findSchemeByName(myParentSchemeName), element);
      dataHolder.updateDigest(this);
      myParentSchemeName = null;
    }
    return settings;
  }

  public void setCodeStyleSettings(@NotNull CodeStyleSettings codeStyleSettings) {
    myCodeStyleSettings = codeStyleSettings;
    synchronized (lock) {
      myParentSchemeName = null;
      myDataHolder = null;
    }
  }

  @Override
  public boolean isDefault() {
    return myIsDefault;
  }

  @Nullable
  @Override
  public SchemeState getSchemeState() {
    synchronized (lock) {
      if (myDataHolder == null) {
        final long currModificationCount = myCodeStyleSettings.getModificationTracker().getModificationCount();
        if (myLastModificationCount != currModificationCount) {
          myLastModificationCount = currModificationCount;
          return SchemeState.POSSIBLY_CHANGED;
        }
      }
      return SchemeState.UNCHANGED;
    }
  }

  @Override
  @NotNull
  public Element writeScheme() {
    SchemeDataHolder<? super CodeStyleSchemeImpl> dataHolder;
    synchronized (lock) {
      dataHolder = myDataHolder;
    }

    if (dataHolder == null) {
      Element newElement = new Element(CODE_STYLE_TAG_NAME);
      newElement.setAttribute(CODE_STYLE_NAME_ATTR, getName());
      myCodeStyleSettings.writeExternal(newElement);
      return newElement;
    }
    else {
      return dataHolder.read();
    }
  }

  @Override
  public @NotNull @Nls String getDisplayName() {
    if (DEFAULT_SCHEME_NAME.equals(getName())) {
      return ApplicationBundle.message("code.style.scheme.default");
    }
    return super.getDisplayName();
  }
}


text:
Upgrading from 1.3 to 1.3.1
###########################

.. note:: The instructions on this page assume you are running version
	1.3. If you have not upgraded to that version please do so first.

Before performing an update you should take your site offline by
replacing the index.php file with a static one.

Step 1: Update your CodeIgniter files
=====================================

Replace the following directories in your "system" folder with the new
versions:

.. note:: If you have any custom developed files in these folders please
	make copies of them first.

-  drivers
-  init/init_unit_test.php (new for 1.3.1)
-  language/
-  libraries
-  scaffolding

Step 2: Update your user guide
==============================

Please also replace your local copy of the user guide with the new
version.


text:
module DatastaxRails
  # = DatastaxRails Serialization
  module Serialization
    extend ActiveSupport::Concern
    include ActiveModel::Serializers::JSON

    def serializable_hash(options = nil)
      options = options.try(:clone) || {}

      options[:except] = Array.wrap(options[:except]).map(&:to_s)

      hash = super(options)

      serializable_add_includes(options) do |association, records, opts|
        hash[association] = if records.is_a?(Enumerable)
                              records.map { |r| r.serializable_hash(opts) }
                            else
                              records.serializable_hash(opts)
                            end
      end

      serializable_convert_uuids(hash)

      hash
    end

    private

    def serializable_convert_uuids(hash)
      hash.each do |k, v|
        serializable_convert_uuids(v) if v.is_a?(Hash)
        hash[k] = v.to_s if v.is_a?(::Cql::Uuid)
      end
    end

    # Add associations specified via the <tt>:include</tt> option.
    #
    # Expects a block that takes as arguments:
    #   +association+ - name of the association
    #   +records+     - the association record(s) to be serialized
    #   +opts+        - options for the association records
    def serializable_add_includes(options = {})
      include_associations = options.delete(:include)
      return unless include_associations

      base_only_or_except = { except: options[:except],
                              only:   options[:only] }

      include_has_options = include_associations.is_a?(Hash)
      associations = include_has_options ? include_associations.keys : Array.wrap(include_associations)

      associations.each do |association|
        records = case self.class.reflect_on_association(association).macro
                  when :has_many, :has_and_belongs_to_many
                    send(association).to_a
                  when :has_one, :belongs_to
                    send(association)
                  end

        next unless records
        association_options = include_has_options ? include_associations[association] : base_only_or_except
        opts = options.merge(association_options)
        yield(association, records, opts)
      end

      options[:include] = include_associations
    end
  end
end

require 'datastax_rails/serializers/xml_serializer'


text:
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
  <id>fr.guillaume_gomez.ProcessViewer</id>
  <metadata_license>MIT</metadata_license>
  <project_license>MIT</project_license>
  <name>Process Viewer</name>
  Process viewer GUI written in Rust
  <description>

      Process Viewer provides current status of your processes
      (cpu and memory usage) and your system (usage of every core
      and of your RAM, and the temperature of your components if
      this information is available).

  </description>
  <releases>
    <release version="0.3.5" date="2020-03-15"/>
  </releases>
  <content_rating type="oars-1.0" />
  <developer_name>Guillaume Gomez</developer_name>
  <url type="homepage">https://github.com/GuillaumeGomez/process-viewer/</url>
  <url type="bugtracker">https://github.com/GuillaumeGomez/process-viewer/issues</url>
  <launchable type="desktop-id">process-viewer.desktop</launchable>
</component>


text:
package com.cloud.api.query.vo;

import com.cloud.network.security.SecurityGroup;
import com.cloud.network.security.SecurityRule.SecurityRuleType;
import com.cloud.server.ResourceTag.ResourceObjectType;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "security_group_view")
public class SecurityGroupJoinVO extends BaseViewVO implements ControlledViewEntity {

    @Id
    @Column(name = "id", updatable = false, nullable = false)
    private long id;

    @Column(name = "name")
    private String name;

    @Column(name = "description")
    private String description;

    @Column(name = "uuid")
    private String uuid;

    @Column(name = "account_id")
    private long accountId;

    @Column(name = "account_uuid")
    private String accountUuid;

    @Column(name = "account_name")
    private String accountName = null;

    @Column(name = "account_type")
    private short accountType;

    @Column(name = "domain_id")
    private long domainId;

    @Column(name = "domain_uuid")
    private String domainUuid;

    @Column(name = "domain_name")
    private String domainName = null;

    @Column(name = "domain_path")
    private String domainPath = null;

    @Column(name = "project_id")
    private long projectId;

    @Column(name = "project_uuid")
    private String projectUuid;

    @Column(name = "project_name")
    private String projectName;

    @Column(name = "job_id")
    private Long jobId;

    @Column(name = "job_uuid")
    private String jobUuid;

    @Column(name = "job_status")
    private int jobStatus;

    @Column(name = "rule_id")
    private Long ruleId;

    @Column(name = "rule_uuid")
    private String ruleUuid;

    @Column(name = "rule_start_port")
    private int ruleStartPort;

    @Column(name = "rule_end_port")
    private int ruleEndPort;

    @Column(name = "rule_protocol")
    private String ruleProtocol;

    @Column(name = "rule_type")
    private String ruleType;

    @Column(name = "rule_allowed_network_id")
    private Long ruleAllowedNetworkId = null;

    @Column(name = "rule_allowed_ip_cidr")
    private String ruleAllowedSourceIpCidr = null;

    @Column(name = "tag_id")
    private long tagId;

    @Column(name = "tag_uuid")
    private String tagUuid;

    @Column(name = "tag_key")
    private String tagKey;

    @Column(name = "tag_value")
    private String tagValue;

    @Column(name = "tag_domain_id")
    private long tagDomainId;

    @Column(name = "tag_account_id")
    private long tagAccountId;

    @Column(name = "tag_resource_id")
    private long tagResourceId;

    @Column(name = "tag_resource_uuid")
    private String tagResourceUuid;

    @Column(name = "tag_resource_type")
    @Enumerated(value = EnumType.STRING)
    private ResourceObjectType tagResourceType;

    @Column(name = "tag_customer")
    private String tagCustomer;

    public SecurityGroupJoinVO() {
    }

    public void setId(final long id) {
        this.id = id;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    public void setUuid(final String uuid) {
        this.uuid = uuid;
    }

    public void setAccountId(final long accountId) {
        this.accountId = accountId;
    }

    public void setAccountUuid(final String accountUuid) {
        this.accountUuid = accountUuid;
    }

    public void setAccountName(final String accountName) {
        this.accountName = accountName;
    }

    public void setAccountType(final short accountType) {
        this.accountType = accountType;
    }

    public void setDomainId(final long domainId) {
        this.domainId = domainId;
    }

    public void setDomainUuid(final String domainUuid) {
        this.domainUuid = domainUuid;
    }

    public void setDomainName(final String domainName) {
        this.domainName = domainName;
    }

    public void setDomainPath(final String domainPath) {
        this.domainPath = domainPath;
    }

    public void setProjectId(final long projectId) {
        this.projectId = projectId;
    }

    public void setProjectUuid(final String projectUuid) {
        this.projectUuid = projectUuid;
    }

    public void setProjectName(final String projectName) {
        this.projectName = projectName;
    }

    public void setJobId(final Long jobId) {
        this.jobId = jobId;
    }

    public void setJobUuid(final String jobUuid) {
        this.jobUuid = jobUuid;
    }

    public void setJobStatus(final int jobStatus) {
        this.jobStatus = jobStatus;
    }

    public void setRuleId(final Long ruleId) {
        this.ruleId = ruleId;
    }

    public void setRuleUuid(final String ruleUuid) {
        this.ruleUuid = ruleUuid;
    }

    public void setRuleStartPort(final int ruleStartPort) {
        this.ruleStartPort = ruleStartPort;
    }

    public void setRuleEndPort(final int ruleEndPort) {
        this.ruleEndPort = ruleEndPort;
    }

    public void setRuleProtocol(final String ruleProtocol) {
        this.ruleProtocol = ruleProtocol;
    }

    public void setRuleType(final String ruleType) {
        this.ruleType = ruleType;
    }

    public void setRuleAllowedNetworkId(final Long ruleAllowedNetworkId) {
        this.ruleAllowedNetworkId = ruleAllowedNetworkId;
    }

    public void setRuleAllowedSourceIpCidr(final String ruleAllowedSourceIpCidr) {
        this.ruleAllowedSourceIpCidr = ruleAllowedSourceIpCidr;
    }

    public void setTagId(final long tagId) {
        this.tagId = tagId;
    }

    public void setTagUuid(final String tagUuid) {
        this.tagUuid = tagUuid;
    }

    public void setTagKey(final String tagKey) {
        this.tagKey = tagKey;
    }

    public void setTagValue(final String tagValue) {
        this.tagValue = tagValue;
    }

    public void setTagDomainId(final long tagDomainId) {
        this.tagDomainId = tagDomainId;
    }

    public void setTagAccountId(final long tagAccountId) {
        this.tagAccountId = tagAccountId;
    }

    public void setTagResourceId(final long tagResourceId) {
        this.tagResourceId = tagResourceId;
    }

    public void setTagResourceUuid(final String tagResourceUuid) {
        this.tagResourceUuid = tagResourceUuid;
    }

    public void setTagResourceType(final ResourceObjectType tagResourceType) {
        this.tagResourceType = tagResourceType;
    }

    public void setTagCustomer(final String tagCustomer) {
        this.tagCustomer = tagCustomer;
    }

    @Override
    public long getId() {
        return id;
    }

    @Override
    public String getUuid() {
        return uuid;
    }

    public String getName() {
        return name;
    }

    @Override
    public long getAccountId() {
        return accountId;
    }

    @Override
    public long getDomainId() {
        return domainId;
    }

    @Override
    public String getDomainPath() {
        return domainPath;
    }

    @Override
    public short getAccountType() {
        return accountType;
    }

    @Override
    public String getAccountUuid() {
        return accountUuid;
    }

    @Override
    public String getAccountName() {
        return accountName;
    }

    @Override
    public String getDomainUuid() {
        return domainUuid;
    }

    @Override
    public String getDomainName() {
        return domainName;
    }

    @Override
    public String getProjectUuid() {
        return projectUuid;
    }

    @Override
    public String getProjectName() {
        return projectName;
    }

    public long getProjectId() {
        return projectId;
    }

    public Long getJobId() {
        return jobId;
    }

    public String getJobUuid() {
        return jobUuid;
    }

    public int getJobStatus() {
        return jobStatus;
    }

    public String getDescription() {
        return description;
    }

    public Long getRuleId() {
        return ruleId;
    }

    public String getRuleUuid() {
        return ruleUuid;
    }

    public int getRuleStartPort() {
        return ruleStartPort;
    }

    public int getRuleEndPort() {
        return ruleEndPort;
    }

    public String getRuleProtocol() {
        return ruleProtocol;
    }

    public SecurityRuleType getRuleType() {
        if ("ingress".equalsIgnoreCase(ruleType)) {
            return SecurityRuleType.IngressRule;
        } else {
            return SecurityRuleType.EgressRule;
        }
    }

    public Long getRuleAllowedNetworkId() {
        return ruleAllowedNetworkId;
    }

    public String getRuleAllowedSourceIpCidr() {
        return ruleAllowedSourceIpCidr;
    }

    public long getTagId() {
        return tagId;
    }

    public String getTagUuid() {
        return tagUuid;
    }

    public String getTagKey() {
        return tagKey;
    }

    public String getTagValue() {
        return tagValue;
    }

    public long getTagDomainId() {
        return tagDomainId;
    }

    public long getTagAccountId() {
        return tagAccountId;
    }

    public long getTagResourceId() {
        return tagResourceId;
    }

    public String getTagResourceUuid() {
        return tagResourceUuid;
    }

    public ResourceObjectType getTagResourceType() {
        return tagResourceType;
    }

    public String getTagCustomer() {
        return tagCustomer;
    }

    @Override
    public Class<?> getEntityType() {
        return SecurityGroup.class;
    }
}


text:
package fr.ujm.tse.lt2c.satin.triplestore.smart.test;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import fr.ujm.tse.lt2c.satin.slider.interfaces.TripleStore;
import fr.ujm.tse.lt2c.satin.slider.triplestore.ImmutableTriple;
import fr.ujm.tse.lt2c.satin.slider.triplestore.VerticalPartioningTripleStoreRWSmartLock;

public class TestGetVerticalPartitioningTripleStoreRWLock {

    @Test
    public void test() {
        final TripleStore ts = new VerticalPartioningTripleStoreRWSmartLock();

        ts.add(new ImmutableTriple(1, 2, 3));
        ts.add(new ImmutableTriple(3, 2, 1));
        ts.add(new ImmutableTriple(4, 5, 6));

        assertEquals(ts.getbyObject(3).size(), 1);
        assertEquals(ts.getbyPredicate(2).size(), 2);
        assertEquals(ts.getbySubject(1).size(), 1);
        assertEquals(ts.getMultiMapForPredicate(2).size(), 2);
        assertEquals(ts.getMultiMapForPredicate(5).size(), 1);

        assertEquals(ts.getbyObject(7).size(), 0);
        assertEquals(ts.getbyPredicate(7).size(), 0);
        assertEquals(ts.getbySubject(7).size(), 0);
        assertEquals(ts.getMultiMapForPredicate(7), null);

    }

}