text:
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
#include "cloudata_types.h"

namespace cloudata {

const char* ThriftHandle::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1";
const uint8_t ThriftHandle::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};

uint32_t ThriftHandle::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->id);
          this->__isset.id = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t ThriftHandle::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ThriftHandle");
  xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeString(this->id);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* ThriftColumnInfo::ascii_fingerprint = "AB879940BD15B6B25691265F7384B271";
const uint8_t ThriftColumnInfo::binary_fingerprint[16] = {0xAB,0x87,0x99,0x40,0xBD,0x15,0xB6,0xB2,0x56,0x91,0x26,0x5F,0x73,0x84,0xB2,0x71};

uint32_t ThriftColumnInfo::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->columnName);
          this->__isset.columnName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->numOfVersion);
          this->__isset.numOfVersion = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->columnType);
          this->__isset.columnType = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t ThriftColumnInfo::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ThriftColumnInfo");
  xfer += oprot->writeFieldBegin("columnName", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeString(this->columnName);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("numOfVersion", ::apache::thrift::protocol::T_STRING, 2);
  xfer += oprot->writeString(this->numOfVersion);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("columnType", ::apache::thrift::protocol::T_STRING, 3);
  xfer += oprot->writeString(this->columnType);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* ThriftTableSchema::ascii_fingerprint = "7C47590FF98310A192E67ECF9E2BE693";
const uint8_t ThriftTableSchema::binary_fingerprint[16] = {0x7C,0x47,0x59,0x0F,0xF9,0x83,0x10,0xA1,0x92,0xE6,0x7E,0xCF,0x9E,0x2B,0xE6,0x93};

uint32_t ThriftTableSchema::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->tableName);
          this->__isset.tableName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->description);
          this->__isset.description = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->numOfVersion);
          this->__isset.numOfVersion = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->owner);
          this->__isset.owner = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->columns.clear();
            uint32_t _size0;
            ::apache::thrift::protocol::TType _etype3;
            iprot->readListBegin(_etype3, _size0);
            this->columns.resize(_size0);
            uint32_t _i4;
            for (_i4 = 0; _i4 < _size0; ++_i4)
            {
              xfer += this->columns[_i4].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.columns = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t ThriftTableSchema::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ThriftTableSchema");
  xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeString(this->tableName);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 2);
  xfer += oprot->writeString(this->description);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("numOfVersion", ::apache::thrift::protocol::T_STRING, 3);
  xfer += oprot->writeString(this->numOfVersion);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("owner", ::apache::thrift::protocol::T_STRING, 4);
  xfer += oprot->writeString(this->owner);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 5);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->columns.size());
    std::vector<ThriftColumnInfo> ::const_iterator _iter5;
    for (_iter5 = this->columns.begin(); _iter5 != this->columns.end(); ++_iter5)
    {
      xfer += (*_iter5).write(oprot);
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* ThriftCellValue::ascii_fingerprint = "7F21FB535884165D6350077C7B970E93";
const uint8_t ThriftCellValue::binary_fingerprint[16] = {0x7F,0x21,0xFB,0x53,0x58,0x84,0x16,0x5D,0x63,0x50,0x07,0x7C,0x7B,0x97,0x0E,0x93};

uint32_t ThriftCellValue::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->data);
          this->__isset.data = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->timestamp);
          this->__isset.timestamp = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->deleted);
          this->__isset.deleted = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t ThriftCellValue::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ThriftCellValue");
  xfer += oprot->writeFieldBegin("data", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeBinary(this->data);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_STRING, 2);
  xfer += oprot->writeString(this->timestamp);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("deleted", ::apache::thrift::protocol::T_BOOL, 3);
  xfer += oprot->writeBool(this->deleted);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* ThriftCell::ascii_fingerprint = "90D6EE2C45FD925C6D61315DFCCE78D9";
const uint8_t ThriftCell::binary_fingerprint[16] = {0x90,0xD6,0xEE,0x2C,0x45,0xFD,0x92,0x5C,0x6D,0x61,0x31,0x5D,0xFC,0xCE,0x78,0xD9};

uint32_t ThriftCell::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->cellKey);
          this->__isset.cellKey = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->values.clear();
            uint32_t _size6;
            ::apache::thrift::protocol::TType _etype9;
            iprot->readListBegin(_etype9, _size6);
            this->values.resize(_size6);
            uint32_t _i10;
            for (_i10 = 0; _i10 < _size6; ++_i10)
            {
              xfer += this->values[_i10].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.values = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t ThriftCell::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ThriftCell");
  xfer += oprot->writeFieldBegin("cellKey", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeString(this->cellKey);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 2);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->values.size());
    std::vector<ThriftCellValue> ::const_iterator _iter11;
    for (_iter11 = this->values.begin(); _iter11 != this->values.end(); ++_iter11)
    {
      xfer += (*_iter11).write(oprot);
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* ThriftRow::ascii_fingerprint = "3BB06B7E989815D8A14528A649595B56";
const uint8_t ThriftRow::binary_fingerprint[16] = {0x3B,0xB0,0x6B,0x7E,0x98,0x98,0x15,0xD8,0xA1,0x45,0x28,0xA6,0x49,0x59,0x5B,0x56};

uint32_t ThriftRow::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->rowKey);
          this->__isset.rowKey = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_MAP) {
          {
            this->cells.clear();
            uint32_t _size12;
            ::apache::thrift::protocol::TType _ktype13;
            ::apache::thrift::protocol::TType _vtype14;
            iprot->readMapBegin(_ktype13, _vtype14, _size12);
            uint32_t _i16;
            for (_i16 = 0; _i16 < _size12; ++_i16)
            {
              std::string _key17;
              xfer += iprot->readString(_key17);
              std::vector<ThriftCell> & _val18 = this->cells[_key17];
              {
                _val18.clear();
                uint32_t _size19;
                ::apache::thrift::protocol::TType _etype22;
                iprot->readListBegin(_etype22, _size19);
                _val18.resize(_size19);
                uint32_t _i23;
                for (_i23 = 0; _i23 < _size19; ++_i23)
                {
                  xfer += _val18[_i23].read(iprot);
                }
                iprot->readListEnd();
              }
            }
            iprot->readMapEnd();
          }
          this->__isset.cells = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t ThriftRow::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ThriftRow");
  xfer += oprot->writeFieldBegin("rowKey", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeString(this->rowKey);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("cells", ::apache::thrift::protocol::T_MAP, 2);
  {
    xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, this->cells.size());
    std::map<std::string, std::vector<ThriftCell> > ::const_iterator _iter24;
    for (_iter24 = this->cells.begin(); _iter24 != this->cells.end(); ++_iter24)
    {
      xfer += oprot->writeString(_iter24->first);
      {
        xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, _iter24->second.size());
        std::vector<ThriftCell> ::const_iterator _iter25;
        for (_iter25 = _iter24->second.begin(); _iter25 != _iter24->second.end(); ++_iter25)
        {
          xfer += (*_iter25).write(oprot);
        }
        xfer += oprot->writeListEnd();
      }
    }
    xfer += oprot->writeMapEnd();
  }
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* ThriftIOException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1";
const uint8_t ThriftIOException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};

uint32_t ThriftIOException::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->message);
          this->__isset.message = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t ThriftIOException::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ThriftIOException");
  xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeString(this->message);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

} // namespace


text:
#if !defined(BOOST_SPIRIT_EXTENDED_VARIANT_AUGUST_6_2011_0859AM)
#define BOOST_SPIRIT_EXTENDED_VARIANT_AUGUST_6_2011_0859AM

#if defined(_MSC_VER)
#pragma once
#endif

#include <boost/variant.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>

///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit
{
    template <
        BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
            BOOST_VARIANT_LIMIT_TYPES,
            typename T, boost::detail::variant::void_)
            // We should not be depending on detail::variant::void_
            // but I'm not sure if this can fixed. Any other way is
            // clumsy at best.
        >
    struct extended_variant
    {
        // tell spirit that this is an adapted variant
        struct adapted_variant_tag;

        typedef boost::variant<
            BOOST_VARIANT_ENUM_PARAMS(T)>
        variant_type;
        typedef typename variant_type::types types;

        typedef extended_variant<BOOST_VARIANT_ENUM_PARAMS(T)> base_type;

        extended_variant() : var() {}

        template <typename T>
        extended_variant(T const& var)
            : var(var) {}

        template <typename F>
        typename F::result_type apply_visitor(F const& v)
        {
            return var.apply_visitor(v);
        }

        template <typename F>
        typename F::result_type apply_visitor(F const& v) const
        {
            return var.apply_visitor(v);
        }

        template <typename F>
        typename F::result_type apply_visitor(F& v)
        {
            return var.apply_visitor(v);
        }

        template <typename F>
        typename F::result_type apply_visitor(F& v) const
        {
            return var.apply_visitor(v);
        }

        variant_type const& get() const
        {
            return var;
        }

        variant_type& get()
        {
            return var;
        }

        variant_type var;
    };
}}

#endif

redpajama_set_name: RedPajamaGithub


text:
title: Search
id: dd2f8565-e340-426b-91f8-b11ca42f6970
overview: >
  Whether you're searching for Bobby Fischer or finding Nemo, search is a common staple of the web experience. Who has time for clicking? Get searching!
---

## Overview {#overview}

Statamic's search engine is preconfigured to Just Work™ right out of the box. All you need to do is kick off the first pass of the indexer. Which leads us to our logical first section...

## Indexing {#indexing}

Statamic builds indexes of your content to provide lickity-split search results. If you don't know what indexes are, that's okay. It doesn't really matter.

To kick off the indexer you can run `php please search:update` in your terminal, visit `/cp/search/update`, or simply perform a search _in the control panel_. Also, in the Control Panel you will find settings to enable automatic indexing of content. Every time a change to content is detected, that update is pushed into the index.

### What fields are indexed {#searchable-fields}

By default, just the `title` is indexed. If you'd like to customize this, you may edit the `searchable` array in `site/settings/search.yaml`.

``` .lang-yaml
searchable:
  - title
  - content
```

This setting only applies to the `default` index.

## The Search Tag {#search-tag}

Statamic has a Search results tag that will allow you to retrieve content based on a search query. Head over to the [Search tag page][search_tag] for more details, but it works like this:

```
{{ search:results }}
	<a href="{{ url }}">{{ title }}</a>
{{ /search:results }}
```

## Drivers {#drivers}

Statamic's search component comes loaded with a couple different drivers. You may specify which to use by adding the appropriate
`driver` value to your `site/settings/search.yaml` file.

### Local {#local-driver}

The local driver (internally named "Comb") is the default driver and it will build its index in your filesystem.

It is enabled by default, but you can be explicit about it by adding the following to your `search.yaml`:

``` .lang-yaml
driver: local
```

The local driver requires no additional setup aside from having the `local` folder writable, and from initially indexing your content.

The local driver will provide you with basic search abilities. If you are looking for more flexibility/features –
like field weighting, typo tolerance, etc – we recommend using the Algolia driver.

### Algolia {#algolia-driver}

[Algolia](https://www.algolia.com/referrals/36eaab9b/join) is a popular search service. It is lightning fast and highly customizable.

To enable the Algolia driver (first make sure you have an account) head to the `Settings > Search` page, select `algolia`, and enter your API credentials.

Or, you may add the following to your `search.yaml`:

``` .lang-yaml
driver: algolia
algolia_app_id: your-app-id
algolia_api_key: your-admin-api-key
```

## Searching Collections {#collection-indexes}

By default, all content will go into a default master index.

To give a collection its own index, add a `searchable` array into the collection's `folder.yaml` with a list of the fields that should be indexed.

For example, in `site/content/collections/blog/folder.yaml`:

``` .lang-yaml
searchable:
  - title
  - subtitle
  - content
```

This tells Statamic that only those 3 fields should be indexed, and will result in a leaner index with faster searches.

Then, to create the index, run the following command:

``` .lang-bash
php please search:update collections/blog
```

## Searching in the Control Panel {#searching-in-the-cp}
In the Control Panel, the search bar at the top of the page will allow you to search for content and will take you directly to the page to edit it.

When searching a collection's entries (not the global search) the [collection's index](#collection-indexes) will be favored.
If no index exists, then the default index will be used. If the default index hasn't been created either, Statamic will simply try to find an entry with a matching title.

## Algolia {#algolia}

If you are using the Algolia driver we recommend using a Javascript implementation to communicate directly with them, as this will be incredibly fast, and avoids using Statamic as a middleman. You don't even need to worry about importing data. Statamic will handle that part when indexing.

Here's a couple of links to get you started:

- [Free Algolia Signup](https://www.algolia.com/referrals/36eaab9b/join)
- [Algolia JavaScript docs](https://www.algolia.com/doc/javascript)
- [Algolia demos](https://www.algolia.com/demos)

[search_tag]: /tags/search


text:
#import <XCTest/XCTest.h>
#import "WXSDKManager.h"
#import "WXSDKInstance.h"
#import "TestSupportUtils.h"

@interface WXSDKManagerTests : XCTestCase

@end

@implementation WXSDKManagerTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
}

- (void)testWXSDKManager {
    id bridgeMgr = [WXSDKManager bridgeMgr];
    XCTAssertNotNil(bridgeMgr);
    XCTAssertTrue([bridgeMgr isKindOfClass:NSClassFromString(@"WXBridgeManager")]);

    [WXSDKManager storeInstance:[WXSDKInstance new] forID:@"0"];
    WXSDKInstance *instance0 = [WXSDKManager instanceForID:@"0"];
    XCTAssertNotNil(instance0);

    [WXSDKManager storeInstance:[WXSDKInstance new] forID:@"1"];
    WXSDKInstance *instance1 = [WXSDKManager instanceForID:@"1"];
    XCTAssertNotNil(instance1);

    [WXSDKManager removeInstanceforID:@"0"];
    instance0 = [WXSDKManager instanceForID:@"0"];
    XCTAssertNil(instance0);

    [WXSDKManager unload];
   // [TestSupportUtils waitSecs:5];
    instance1 = [WXSDKManager instanceForID:@"1"];
    //XCTAssertNil(instance1);
}

- (void)testUnload {

}

@end


text:
module Cardapi

  # Um servico que cria uma transacao
  class TransactionCreatorService

    # A criacao de uma transacao funciona assim:
    # A transacao é instanciada, servicos de regras universais sao chamados
    # A transacao é despachada para a aplicacao mae.
    def self.create(context, params)
        @transaction = Transaction.new(params)
        # TODO: regras universais entram aqui (chamando outros servicos!!!)
        context.adapter.processa(@transaction)
    end

  end
end


text:
@class DBFILESExportArg;

NS_ASSUME_NONNULL_BEGIN

#pragma mark - API Object

///
/// The `ExportArg` struct.
///
/// This class implements the `DBSerializable` protocol (serialize and
/// deserialize instance methods), which is required for all Obj-C SDK API route
/// objects.
///
@interface DBFILESExportArg : NSObject <DBSerializable, NSCopying>

#pragma mark - Instance fields

/// The path of the file to be exported.
@property (nonatomic, readonly, copy) NSString *path;

/// The file format to which the file should be exported. This must be one of
/// the formats listed in the file's export_options returned by `getMetadata`.
/// If none is specified, the default format (specified in export_as in file
/// metadata) will be used.
@property (nonatomic, readonly, copy, nullable) NSString *exportFormat;

#pragma mark - Constructors

///
/// Full constructor for the struct (exposes all instance variables).
///
/// @param path The path of the file to be exported.
/// @param exportFormat The file format to which the file should be exported.
/// This must be one of the formats listed in the file's export_options returned
/// by `getMetadata`. If none is specified, the default format (specified in
/// export_as in file metadata) will be used.
///
/// @return An initialized instance.
///
- (instancetype)initWithPath:(NSString *)path exportFormat:(nullable NSString *)exportFormat;

///
/// Convenience constructor (exposes only non-nullable instance variables with
/// no default value).
///
/// @param path The path of the file to be exported.
///
/// @return An initialized instance.
///
- (instancetype)initWithPath:(NSString *)path;

- (instancetype)init NS_UNAVAILABLE;

@end

#pragma mark - Serializer Object

///
/// The serialization class for the `ExportArg` struct.
///
@interface DBFILESExportArgSerializer : NSObject

///
/// Serializes `DBFILESExportArg` instances.
///
/// @param instance An instance of the `DBFILESExportArg` API object.
///
/// @return A json-compatible dictionary representation of the
/// `DBFILESExportArg` API object.
///
+ (nullable NSDictionary<NSString *, id> *)serialize:(DBFILESExportArg *)instance;

///
/// Deserializes `DBFILESExportArg` instances.
///
/// @param dict A json-compatible dictionary representation of the
/// `DBFILESExportArg` API object.
///
/// @return An instantiation of the `DBFILESExportArg` object.
///
+ (DBFILESExportArg *)deserialize:(NSDictionary<NSString *, id> *)dict;

@end

NS_ASSUME_NONNULL_END


text:
Paperbag
========

contenteditable is ugly as all hell. Put a paper bag over it.

[DEMO](http://blog.stevearc.com/paperbag/)

### Requirements
* Angularjs
* rangy-core.js
* rangy-selectionsaverestore.js
* rangy-serializer.js


text:
package io.github.resilience4j.timelimiter;

import io.vavr.control.Try;
import org.junit.Test;
import org.slf4j.Logger;

import java.time.Duration;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.then;
import static org.mockito.Mockito.mock;

public class TimeLimiterEventPublisherTest {

    private static final Duration NEVER = Duration.ZERO;

    private Logger logger = mock(Logger.class);

    @Test
    public void shouldReturnTheSameConsumer() {
        TimeLimiter timeLimiter = TimeLimiter.of(NEVER);

        TimeLimiter.EventPublisher eventPublisher = timeLimiter.getEventPublisher();
        TimeLimiter.EventPublisher eventPublisher2 = timeLimiter.getEventPublisher();

        assertThat(eventPublisher).isEqualTo(eventPublisher2);
    }

    @Test
    public void shouldConsumeOnSuccessEvent() throws Exception {
        TimeLimiter timeLimiter = TimeLimiter.of(NEVER);
        timeLimiter.getEventPublisher()
            .onSuccess(event -> logger.info(event.getEventType().toString()));
        Supplier<CompletableFuture<String>> futureSupplier = () ->
            CompletableFuture.completedFuture("Hello world");

        String result = timeLimiter.decorateFutureSupplier(futureSupplier).call();

        assertThat(result).isEqualTo("Hello world");
        then(logger).should().info("SUCCESS");
    }

    @Test
    public void shouldConsumeOnTimeoutEvent() {
        TimeLimiter timeLimiter = TimeLimiter.of(NEVER);
        timeLimiter.getEventPublisher()
            .onTimeout(event -> logger.info(event.getEventType().toString()));
        Supplier<CompletableFuture<String>> futureSupplier = () ->
            CompletableFuture.supplyAsync(this::timeout);

        Try.ofCallable(timeLimiter.decorateFutureSupplier(futureSupplier));

        then(logger).should().info("TIMEOUT");
    }

    @Test
    public void shouldConsumeOnErrorEvent() {
        TimeLimiter timeLimiter = TimeLimiter.of(Duration.ofSeconds(1));
        timeLimiter.getEventPublisher()
            .onError(event -> logger
                .info(event.getEventType().toString() + " " + event.getThrowable().toString()));
        Supplier<CompletableFuture<String>> futureSupplier = () ->
            CompletableFuture.supplyAsync(this::fail);

        Try.ofCallable(timeLimiter.decorateFutureSupplier(futureSupplier));

        then(logger).should().info("ERROR java.lang.RuntimeException");
    }

    private String fail() {
        throw new RuntimeException();
    }

    private String timeout() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            // nothing
        }
        return "timeout";
    }
}


text:
Undoiverse
==========

--------
Contents
--------

- [Introduction](#introduction)
- [How it Works](#how-it-works)
- [What it Isn't](#what-it-isnt)
- [Getting Started](#getting-started)
- [Basic Usage](#basic-usage)
- [Advanced Usage](#advanced-usage)
- [Command Line](#command-line)
- [Changelog and Roadmap](#changelog-and-roadmap)
- [Contributing](#contributing)

------------
Introduction
------------

The dream of virtual worlds has fired our collective imagination for a long
while. A [metaverse⤴](https://en.wikipedia.org/wiki/Metaverse) where people can
meet, learn, make things and share ideas. Recent web technologies (WebGL, Web
Audio, WebSockets, WebVR) provide the foundations for immersive 3D experiences
on the web. At the same time, development platforms like Unity and Unreal make
it easy to build games that work on mobile, desktop, VR/AR and consoles.

But none of these technologies and platforms address the server-side needs of
_multiuser creative applications_.

[Undoiverse⤴](http://undoiverse.loop.coop) is an open source server-side
JavaScript module. It allows hundreds of users to create, collaborate and
communicate in a shared 'free roaming' 3D environment. Although you can build
[multiplayer VR games⤴](https://goo.gl/VJgGdZ) with it, Undoiverse is really
intended for multiuser creative VR experiences - the features it provides will
be very familiar to anyone who's used creative applications like Photoshop,
GarageBand, PowerPoint or AutoCAD:

- Copy and Paste
- Undo and Redo
- Group and Ungroup
- Lock and Unlock
- Save and Save As
- …and [so on](#the-standard-plugins)

### For Example

Say you want to develop a gamified learning app for young engineers, loosely
based on [Scrapheap Challenge / Junkyard Wars⤴](https://goo.gl/zNwChk). A dozen
mechanics in two teams scavenge a giant pile of rusty parts, and race to
assemble a working car.

First, players sign in to your app and customise their avatars. Then your app
randomly generates a few thousand car parts and scatters them around the virtual
junkyard. Next your app initialises a new Undoiverse instance and tells it a
little about each player, avatar and car part.

The game starts, and Undoiverse tracks the locations and attributes of the car
parts as players collect them, carry them, chop them up and weld them together.

Undoiverse's main task is to keep players' devices constantly updated with the
current state of car parts and avatars in their vicinity. But you can install
Plugins to extend Undoiverse's capabilities, letting players send messages to
each other, undo their mistakes, or search the scrapheap for a particular kind
of steering wheel.

Just to be clear: Undoiverse only runs on the server, so it can't help you with
lighting, physics, 3D rendering or the user interface — your frontend code needs
to do all that. Your frontend could be an iPhone app, a PlayStation 4 VR game or
an HTML5 web page. In fact your players can all be using different frontend
technologies at the same time, linked together via the same server.

### Project Goals

[__@todo__ Discuss]

### About These Docs

This documentation assumes that you are a developer with some experience of 3D
and JavaScript. You might be starting a new project from scratch, or you might
have a single-user creative app running already that you'd like to make
multiuser, and add a Git-based undo/redo system to.

[__@todo__ Write a conclusion to the Introduction. Explain how the docs are
split into various READMEs, and their current status is. Suggest where to go for
more info on Node, 3D, JavaScript, hosting, writing client-side apps, etc.]

------------
How It Works
------------

At its most basic level, Undoiverse is designed to __manage the interactions
between Clients, Entities and Locations in a free roaming multiuser creative
application.__ By concentrating on one job within a particular kind of app,
Undoiverse can be kept lean and efficient.

Undoiverse has a loosely coupled, modular architecture. Code is organised into
groups of [plugins⤴](https://goo.gl/zDyhwb), which talk to each other via [events⤴](https://goo.gl/QvtIvZ). This helps keep code focused, maintainable,
and easy to test. It also means that your app can add features with the minimum
of fuss.

### The Undoiverse Class

The Undoiverse Class is defined in 'undoiverse.js', and provides two main
services:

1. __Initialisation__ — When you call `new Undoiverse()` to create an instance,
   the `constructor()` processes your configuration object, activates the [Core Plugins](#the-core-plugins) and activates any other plugins that you specify.

2. __Communication__ — As your app runs, the instance coordinates messages sent
   between your app, your users, and whatever Undoiverse Plugins you activated.

The [Basic Usage](#basic-usage) and [Advanced Usage](#advanced-usage) sections
below cover most of the Undoiverse Class's API. The 'undoiverse.js' file is well
commented and fairly easy to understand.

### The Core Plugins

The Core Plugins are Client, Entity and Location. Undoiverse can't run without
them, so it automatically activates them during initialisation. For full API
and documentation, see [plugins/core/README.md](
https://github.com/loopdotcoop/undoiverse/tree/master/plugins/core).

- __Client__ — Your app's client-side code could be JavaScript running in a
  browser, C# in a Unity app, or Python compiled to an '.exe' on a PC.
  Devices running this code talk to your app's Undoiverse instance (which is
  running on a server), usually via [WebSockets⤴](goo.gl/xe3ER9). The Client
  Plugin keeps a record of these Clients while they are connected, and it also
  keeps track as they shift their attention between Locations.

- __Entity__ — In the [Scrapheap Challenge example](#for-example) above, the
  scene contains avatars (which each belong to a Client), car parts (of various
  kinds) and mechanic's tools (for cutting and joining car parts). The Entity
  Plugin doesn't differentiate between any of these kinds of things — it just
  keeps track of Entities as they're created, moved from Location to Location,
  edited, joined, split apart and deleted.

- __Location__ — During initialisation, your configuration object decides how
  many Locations your app will need, typically between 50 and 1000. The Location
  Plugin doesn't care whether these Locations are arranged in a grid, or nested
  inside each other, or whether they represent places in the real world or not.
  Each Location is just a simple list which can contain Clients and Entities.

At any one time, your app might have 500 active Clients and a million current
Entities, spread across a thousand Locations. Assuming your app is left
permanently running, it might deal with 100,000 Client connections and a couple
of billion Entities over the course of a year.

[__@todo__ Describe how Client/Entity/Location work together to give you the
minimum you need for a collaborative creative 3D app. Mention that Undoiverse
can work with only these three activated, and describe the experience the
user would have in an app like that.]

### The Standard Plugins

The Standard Plugins are all optional. They're organised into seven groups:
[__@todo__ Explain how the Scrapheap Challenge game would use each of them.]

1. __Corral__ — [__@todo__ Describe]

   - Alias, for Entities which share some attributes with other Entities
   - Clipboard, for cut, copy and paste
   - Clone, for Entities which start with attributes copied from other Entities
   - Group, (and ungroup) for using an Entity to contain other Entities
   - Repeat, to run an earlier Entity operation a second time
   - Unite, (and sever) for combining two or more Entities into a single Entity

2. __Develop__ — [__@todo__ Describe]

   - Alert, a channel for auto-sending messages to developers and admins
   - Benchmark, for measuring, recording, analysing and improving performance
   - Log, various kinds of text output
   - Reflect, to help developers understand current app state

3. __History__ — This group of plugins depend on a Git repo (local, remote or
   GitHub) which records all events in the virtual environment. Once Git is set
   up in your 'Scrapheap Challenge' app, everything that each mechanic does is
   permanently archived. This allows you enable the other History group plugins:

   - Branch, for forking and Merging (creating and combining Git branches)
   - Git, to use a local or remote Git repo
   - GitHub, to use a private or public GitHub repo
   - Scrub, for rewind and playback of history-state
   - Traverse, for undo, redo, revert or jumping to arbitrary points in history

   So you can use a GitHub repo to rewind and replay the process of building a
   car, or allow mechanics to undo their mistakes.

4. __Message__ — [__@todo__ Describe]

   - Ask, allows the app to retrieve data from Clients
   - Broadcast, for sending messages to all Clients
   - Conference, to let two or more Clients communicate with each other
   - Notify, for sending messages to one Client

5. __Own__ — [__@todo__ Describe]

   - Allow, for defining credentials and permissions
   - Hide, (and show) to prevent an Entity from being seen
   - Lock, (and unlock) to prevent an Entity from being modified
   - Open, (and close) to open an Entity in read-only or read/write mode
   - Save, and save-as, to create named a snapshot of Entity state

6. __Persist__ — Various ways of storing Undoiverse's current state, using the
   local file system, memory, databases, or remote services.

   - Mongo, for the [MongoDB](https://www.mongodb.com/) document store
   - Csv, for persisting to a set of comma-separated-value files
   - Keyval, for key-value stores like [Redis](http://redis.io/)
   - Memory, for persisting to a simple in-memory JavaScript object
   - Sql, for relational DBMS's like [MySQL](https://mysql.com/)

7. __Query__ — Some kinds of simple search and filter operations are possible
   with just the Core Plugins activated. But the Query group of plugins really
   come into their own when the History and Persist groups are enabled.

   - Count, to count the number of Elements which match the search terms
   - Find, to list Elements which match the search terms
   - Stats, for analysis of the current or historical data set
   - Validator, for diagnosing problems with the data set
   - Watcher, for subscribing to changes to the data set

Full API documentation for the Standard Plugins can be found in their respective
directories:

1. [plugins/corral/README.md](
   https://github.com/loopdotcoop/undoiverse/tree/master/plugins/corral)
2. [plugins/develop/README.md](
   https://github.com/loopdotcoop/undoiverse/tree/master/plugins/develop)
3. [plugins/history/README.md](
   https://github.com/loopdotcoop/undoiverse/tree/master/plugins/history)
4. [plugins/message/README.md](
   https://github.com/loopdotcoop/undoiverse/tree/master/plugins/message)
5. [plugins/own/README.md](
   https://github.com/loopdotcoop/undoiverse/tree/master/plugins/own)
6. [plugins/persist/README.md](
   https://github.com/loopdotcoop/undoiverse/tree/master/plugins/persist)
7. [plugins/query/README.md](
   https://github.com/loopdotcoop/undoiverse/tree/master/plugins/query)

### Boilerplate Plugins

[__@todo__ Give these a quick mention]

### Community Plugins

We invite you to contribute your own plugins to the community.
[__@todo__ Discuss this in more detail]

We intend to cease all major API updates to the Undoiverse Class and the Core
and Standard Plugins by the end of 2017 — they'll only be updated for
compatibility and performance after that. So progress in 2018 and beyond will be
through Community Plugins.

-------------
What it Isn't
-------------

[__@todo__ Introduce this - common misconceptions]

### AI

[__@todo__ How an app dev could treat their own AI bots as regular users]

### Collisions and Physics

[__@todo__ Discuss Undoiverse's basic understanding of collisions, which is
limited to intersecting Locations. Your app might be able to rule out collisions
between Entities which do not share any locations]

### Models, Textures and Audio

[__@todo__ Discuss CDN vs keeping assets in the same Git repo as the History
plugins use. Discuss using payload attributes to modify static assets. Discuss
why attributes should only represent vertices for very simple geometries]

-------------
Project Goals
-------------

[__@todo__ Write the Project Goals section.]

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

### What You'll Need

### Installing From NPM

### Installing the Command Line Tool

### Running on your local machine

### Running on a remote server

[__@todo__ Describe how to monitor and control a Node process running an
Undoiverse instance on a remote server, eg via SSH. Also, an Undoiverse instance
running in a browser, via the JavaScript console.]

-----------
Basic Usage
-----------

### Instantiation

### Events

### Properties

### Methods

### Exceptions

### Browser Usage

Undoiverse is optimised to run under Node on a server, but it can also be made
to run in a browser. [__@todo__ Discuss]

--------------
Advanced Usage
--------------

### Connecting to a GitHub Repo

### Multi-Op Transactions

### Profiling and Benchmarking

### Optimising Performance

------------
Command Line
------------

### Development Commands

### Deployment Commands

#### Deploy to Your Own Server

#### Deploy to a Docker Hosting Service

[__@todo__ link to specific instructions for OpenShift, Google Container Engine,
AWS, Azure, etc]

#### Deploy to the Free Undoiverse Demo-Server

#### Deploy to the Commercial Undoiverse Server

---------------------
Changelog and Roadmap
---------------------

Tasks are popped off the 'Roadmap' list and added to the 'Changelog' list. If
the 'ATA' date matches or beats the 'ETA' date, then we're winning!

### Changelog

- Create a GitHub repo with fairly standard NPM-development stuff.
  README.md first draft.
  V: 0.0.1
  ETA: 20160908
  ATA: 20160909

- README.md second draft.
  V: 0.0.2
  ETA: 20160914
  ATA: 20160914

- README.md third draft.
  V: 0.0.3
  ETA: 20161026
  ATA: 20161026

- Change README.md from 'draft' to 'live' status. This means that the basic API
  and architecture, and the project goals and scope have been agreed by the team
  and set in stone.
  V: 0.1.0
  ETA: 20161102
  ATA: 20161103

- Initial directory structure in place.
  Functional Undoiverse Class and Core Plugins, passing low-level unit tests.
  Basic test system for the Undoiverse project in place (we're getting on fine
  without any build or deploy systems, so far).
  Project page at http://undoiverse.loop.coop/ just duplicates this README.
  V: 0.2.0
  ETA: 20161109
  ATA: 20161110

- 'uu.js' has `box()` (unit tested) for rendering ASCII boxes.
  `browse()` can return an ASCII box in 'plugins/core/client' and '...entity'.
  V: 0.2.2
  ETA: 20161123
  ATA: 20161122

### Roadmap

- `browse()` can return an ASCII box in 'plugins/core/location'.
  'plugins/develop/log' able to output to console and/or directly to file.
  'plugins/develop/log' formats for raw log-lines, ASCII rendered Locations,
  lists of Clients and Entities, and a summary of current state.
  V: 0.3.0
  ETA: 20170120

- Stronger Undoiverse Class and Core Plugins, passing a decent set of unit
  tests. Unit tests now test against the output of 'plugins/develop/log'.
  Pull in work from the http://life.loop.coop project.
  V: 0.4.0
  ETA: 20170202

- Core Usage Examples begun - between them, they should thoroughly cover all
  Undoiverse Class and Core Plugin code.
  'plugins/message/ask' production-ready.
  V: 0.5.0
  ETA: 20170209

- Undoiverse Class and Core Plugins production-ready, thoroughly tested and
  reasonably well optimised.
  Remaining Develop Plugins production-ready: Alert, Benchmark, Reflect.
  Core Usage Examples well tested on a variety of UAs/platforms.
  V: 0.6.0
  ETA: 20170214

- Command Line basically functional, passing a fairly good set of unit tests.
  Some Boilerplate Plugins production-ready.
  V: 0.7.0
  ETA: 20170221

- Documentation tidy and correct. Complete for Undoiverse Class, Core Plugins,
  'plugins/develop/log' and Core Usage Examples. Incomplete (with '@todos')
  for Command Line, the remaining Standard Plugins, Community Plugins.
  http://undoiverse.loop.coop/ is responsive and properly styled, with a logo.
  V: 1.0.0
  ETA: 20170311

- 'plugins/history/git' and 'plugins/persist/memory' production-ready.
  V: 1.1.0
  ETA: 20170325

- Remaining History Plugins production-ready: Github, Traverse, Scrub, Branch.
  V: 1.2.0
  ETA: 20170408

- Remaining Persist Plugins production-ready: Mongo, Csv, Keyval, Sql.
  V: 1.2.0
  ETA: 20170420

- Query Plugins production-ready: Count, Find, Stats, Validator, Watcher.
  V: 1.3.0
  ETA: 20170501

- Own Plugins production-ready: Allow, Hide, Lock, Open, Save.
  V: 1.4.0
  ETA: 20170522

- Corral Plugins production-ready: Alias, Clipboard, Clone, Group, Repeat,
  Unite.
  V: 1.5.0
  ETA: 20170612

- Remaining Message Plugins production-ready: Broadcast, Conference, Notify.
  V: 1.6.0
  ETA: 20170703

- Polish the Command Line experience, with an excellent set of unit tests which
  find problems across a wide range of platforms.
  V: 1.7.0
  ETA: 20170717

- Plugin Usage Examples complete.
  Remaining Boilerplate Plugins production-ready.
  Documentation tidy and correct.
  V: 2.0.0
  ETA: 20170807

- Arrive at a conclusion whether major (breaking) API changes are needed to the
  Undoiverse Class and the Core and Standard Plugins. Ideally not, but if they
  _are_ needed, let's aim to complete them all by the end of 2017. After that,
  the only modifications to the Undoiverse Class and the Core and Standard
  Plugins should be refactoring for compatibility and performance.
  Progress in 2018 and beyond will be made through Community Plugins, better
  examples, better documentation, and so on.
  V: 2.1.0
  ETA: 20171106

------------
Contributing
------------

Undoiverse is an open source project by digital tinkerers
[Loop.Coop⤴](http://loop.coop/).

[__@todo__ Explain how developers can contribute to Undoiverse Class and the
Core and Standard Plugins. Also explain how developers can build their own
Community Plugins, and make them available to other Undoiverse devs.]

[__@todo__ Explain code-style — ES6 for Node.js, with minimal `{}`'s and `;`s.]

---

#### README last modified 22nd November 2016


text:
namespace RakNet {
  class RakPeerInterface;
  class ConnectionGraph2;
  class FullyConnectedMesh2;
  class NatPunchthroughClient;
  class NetworkIDManager;
}

namespace swift {

class NetworkObjectBase;

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

// -----------------------------------------------------------------------------
class SWIFT_DLL Network : public Singleton<Network> {

 ///////////////////////////////////////////////////////////////////////////////
 // ----------------------------------------------------------- public interface
 public:
  enum Phase {
    GETTING_EXTERNAL_IP,
    GETTING_INTERNAL_IP,
    READY
  };

  // ------------------------------------------------------------------- signals
  Signal<std::string, bool> on_connection_result;

  // ------------------------------------------------------------ public methods
  void update();

  template<typename T> void register_type(std::string const& type) {
    replica_->register_object(RakNet::RakString(type.c_str()), [](){ return new T(); });
  };

  void connect(std::string const& internal_address,
               std::string const& external_address,
               math::uint64 network_id);
  void connect(std::string const& other);
  void natpunch(math::uint64 uuid);
  void disconnect(math::uint64 uuid);

  void distribute_object(NetworkObjectBase* object);

  template<typename Function>
  void distribute_function(std::string const& function_name, Function const& f) {
    rpc_->RegisterFunction(function_name.c_str(), f);
  }

  template<typename ...Args>
  void call_function(std::string const& function_name, RakNet::NetworkID const& id, Args&& ... a) {
    rpc_->CallCPP(function_name.c_str(), id, a...);
  }

  std::string const& get_internal_address() const;
  std::string const& get_external_address() const;
  math::uint64       get_network_id() const;

  int                get_average_ping(math::uint64 to_other) const;

  bool is_in_same_network(std::string const& other) const;

  friend class Singleton<Network>;

 ///////////////////////////////////////////////////////////////////////////////
 // ---------------------------------------------------------- private interface
 private:
  Network();
  ~Network();

  RakNet::RakPeerInterface*      peer_;
  RakNet::NatPunchthroughClient* npt_;
  RakNet::NetworkIDManager*      id_manager_;
  RakNet::RPC3*                  rpc_;
  ReplicationManager*            replica_;

  Phase                          phase_;

  std::string                    nat_server_address_;

  std::string                    internal_id_;
  std::string                    external_id_;
};

}

#endif  // SWIFT2D_NETWORK_HPP


text:
"""Tests for the base baremetal driver class."""

import mox

from oslo.config import cfg

from nova.compute import power_state
from nova import exception
from nova import test
from nova.tests.image import fake as fake_image
from nova.tests import utils
from nova.tests.virt.baremetal.db import base as bm_db_base
from nova.tests.virt.baremetal.db import utils as bm_db_utils
from nova.virt.baremetal import baremetal_states
from nova.virt.baremetal import db
from nova.virt.baremetal import driver as bm_driver
from nova.virt.baremetal import fake
from nova.virt.baremetal import pxe

CONF = cfg.CONF

COMMON_FLAGS = dict(
    firewall_driver='nova.virt.baremetal.fake.FakeFirewallDriver',
    host='test_host',
)

BAREMETAL_FLAGS = dict(
    driver='nova.virt.baremetal.fake.FakeDriver',
    instance_type_extra_specs=['cpu_arch:test', 'test_spec:test_value'],
    power_manager='nova.virt.baremetal.fake.FakePowerManager',
    vif_driver='nova.virt.baremetal.fake.FakeVifDriver',
    volume_driver='nova.virt.baremetal.fake.FakeVolumeDriver',
    group='baremetal',
)

class BareMetalDriverNoDBTestCase(test.NoDBTestCase):

    def setUp(self):
        super(BareMetalDriverNoDBTestCase, self).setUp()
        self.flags(**COMMON_FLAGS)
        self.flags(**BAREMETAL_FLAGS)
        self.driver = bm_driver.BareMetalDriver(None)

    def test_validate_driver_loading(self):
        self.assertTrue(isinstance(self.driver.driver,
                                    fake.FakeDriver))
        self.assertTrue(isinstance(self.driver.vif_driver,
                                    fake.FakeVifDriver))
        self.assertTrue(isinstance(self.driver.volume_driver,
                                    fake.FakeVolumeDriver))
        self.assertTrue(isinstance(self.driver.firewall_driver,
                                    fake.FakeFirewallDriver))

class BareMetalDriverWithDBTestCase(bm_db_base.BMDBTestCase):

    def setUp(self):
        super(BareMetalDriverWithDBTestCase, self).setUp()
        self.flags(**COMMON_FLAGS)
        self.flags(**BAREMETAL_FLAGS)

        fake_image.stub_out_image_service(self.stubs)
        self.context = utils.get_test_admin_context()
        self.driver = bm_driver.BareMetalDriver(None)
        self.addCleanup(fake_image.FakeImageService_reset)

    def _create_node(self, node_info=None, nic_info=None):
        result = {}
        if node_info is None:
            node_info = bm_db_utils.new_bm_node(
                            id=123,
                            service_host='test_host',
                            cpus=2,
                            memory_mb=2048,
                        )
        if nic_info is None:
            nic_info = [
                    {'address': '01:23:45:67:89:01', 'datapath_id': '0x1',
                        'port_no': 1},
                    {'address': '01:23:45:67:89:02', 'datapath_id': '0x2',
                        'port_no': 2},
                ]
        result['node_info'] = node_info
        result['nic_info'] = nic_info
        result['node'] = db.bm_node_create(self.context, node_info)

        for nic in nic_info:
            db.bm_interface_create(
                                    self.context,
                                    result['node']['id'],
                                    nic['address'],
                                    nic['datapath_id'],
                                    nic['port_no'],
                )
        result['instance'] = utils.get_test_instance()
        result['instance']['node'] = result['node']['uuid']
        result['spawn_params'] = dict(
                admin_password='test_pass',
                block_device_info=None,
                context=self.context,
                image_meta=utils.get_test_image_info(
                                None, result['instance']),
                injected_files=[('/fake/path', 'hello world')],
                instance=result['instance'],
                network_info=utils.get_test_network_info(),
            )
        result['destroy_params'] = dict(
                instance=result['instance'],
                network_info=result['spawn_params']['network_info'],
                block_device_info=result['spawn_params']['block_device_info'],
            )

        return result

    def test_get_host_stats(self):
        node = self._create_node()
        stats = self.driver.get_host_stats()
        self.assertTrue(isinstance(stats, list))
        self.assertEqual(len(stats), 1)
        stats = stats[0]
        self.assertEqual(stats['cpu_arch'], 'test')
        self.assertEqual(stats['test_spec'], 'test_value')
        self.assertEqual(stats['hypervisor_type'], 'baremetal')
        self.assertEqual(stats['hypervisor_hostname'], node['node']['uuid'])
        self.assertEqual(stats['host'], 'test_host')
        self.assertEqual(stats['vcpus'], 2)
        self.assertEqual(stats['host_memory_total'], 2048)

    def test_spawn_ok(self):
        node = self._create_node()
        self.driver.spawn(**node['spawn_params'])
        row = db.bm_node_get(self.context, node['node']['id'])
        self.assertEqual(row['task_state'], baremetal_states.ACTIVE)
        self.assertEqual(row['instance_uuid'], node['instance']['uuid'])
        self.assertEqual(row['instance_name'], node['instance']['hostname'])

    def test_macs_from_nic_for_instance(self):
        node = self._create_node()
        expected = set([nic['address'] for nic in node['nic_info']])
        self.assertEqual(
            expected, self.driver.macs_for_instance(node['instance']))

    def test_macs_for_instance_after_spawn(self):
        node = self._create_node()
        self.driver.spawn(**node['spawn_params'])

        expected = set([nic['address'] for nic in node['nic_info']])
        self.assertEqual(
            expected, self.driver.macs_for_instance(node['instance']))

    def test_macs_for_instance(self):
        node = self._create_node()
        expected = set(['01:23:45:67:89:01', '01:23:45:67:89:02'])
        self.assertEqual(
            expected, self.driver.macs_for_instance(node['instance']))

    def test_macs_for_instance_no_interfaces(self):
        # Nodes cannot boot with no MACs, so we raise an error if that happens.
        node = self._create_node(nic_info=[])
        self.assertRaises(exception.NovaException,
            self.driver.macs_for_instance, node['instance'])

    def test_spawn_node_already_associated(self):
        node = self._create_node()
        db.bm_node_update(self.context, node['node']['id'],
                {'instance_uuid': '1234-5678'})

        self.assertRaises(exception.NovaException,
                self.driver.spawn, **node['spawn_params'])

        row = db.bm_node_get(self.context, node['node']['id'])
        self.assertEqual(row['task_state'], None)

    def test_spawn_node_in_use(self):
        node = self._create_node()

        self.driver.spawn(**node['spawn_params'])
        self.assertRaises(exception.NovaException,
                self.driver.spawn, **node['spawn_params'])

    def test_spawn_node_not_found(self):
        node = self._create_node()
        db.bm_node_update(self.context, node['node']['id'],
                {'uuid': 'hide-this-node'})

        self.assertRaises(exception.NovaException,
                self.driver.spawn, **node['spawn_params'])

        row = db.bm_node_get(self.context, node['node']['id'])
        self.assertEqual(row['task_state'], None)

    def test_spawn_fails(self):
        node = self._create_node()

        self.mox.StubOutWithMock(fake.FakePowerManager, 'activate_node')
        fake.FakePowerManager.activate_node().AndRaise(test.TestingException)
        self.mox.ReplayAll()

        self.assertRaises(test.TestingException,
                self.driver.spawn, **node['spawn_params'])

        row = db.bm_node_get(self.context, node['node']['id'])
        self.assertEqual(row['task_state'], baremetal_states.DELETED)

    def test_spawn_fails_to_cleanup(self):
        node = self._create_node()

        self.mox.StubOutWithMock(fake.FakePowerManager, 'activate_node')
        self.mox.StubOutWithMock(fake.FakePowerManager, 'deactivate_node')
        fake.FakePowerManager.deactivate_node().AndReturn(None)
        fake.FakePowerManager.activate_node().AndRaise(test.TestingException)
        fake.FakePowerManager.deactivate_node().AndRaise(test.TestingException)
        self.mox.ReplayAll()

        self.assertRaises(test.TestingException,
                self.driver.spawn, **node['spawn_params'])

        row = db.bm_node_get(self.context, node['node']['id'])
        self.assertEqual(row['task_state'], baremetal_states.ERROR)

    def test_destroy_ok(self):
        node = self._create_node()
        self.driver.spawn(**node['spawn_params'])
        self.driver.destroy(**node['destroy_params'])

        row = db.bm_node_get(self.context, node['node']['id'])
        self.assertEqual(row['task_state'], baremetal_states.DELETED)
        self.assertEqual(row['instance_uuid'], None)
        self.assertEqual(row['instance_name'], None)

    def test_destroy_fails(self):
        node = self._create_node()

        self.mox.StubOutWithMock(fake.FakePowerManager, 'deactivate_node')
        fake.FakePowerManager.deactivate_node().AndReturn(None)
        fake.FakePowerManager.deactivate_node().AndRaise(test.TestingException)
        self.mox.ReplayAll()

        self.driver.spawn(**node['spawn_params'])
        self.assertRaises(test.TestingException,
                self.driver.destroy, **node['destroy_params'])

        row = db.bm_node_get(self.context, node['node']['id'])
        self.assertEqual(row['task_state'], baremetal_states.ERROR)
        self.assertEqual(row['instance_uuid'], node['instance']['uuid'])

    def test_get_available_resources(self):
        node = self._create_node()

        resources = self.driver.get_available_resource(node['node']['uuid'])
        self.assertEqual(resources['memory_mb'],
                         node['node_info']['memory_mb'])
        self.assertEqual(resources['memory_mb_used'], 0)
        self.assertEqual(resources['supported_instances'],
                '[["test", "baremetal", "baremetal"]]')

        self.driver.spawn(**node['spawn_params'])
        resources = self.driver.get_available_resource(node['node']['uuid'])
        self.assertEqual(resources['memory_mb_used'],
                         node['node_info']['memory_mb'])

        self.driver.destroy(**node['destroy_params'])
        resources = self.driver.get_available_resource(node['node']['uuid'])
        self.assertEqual(resources['memory_mb_used'], 0)
        self.assertEqual(resources['stats']['test_spec'], 'test_value')

    def test_get_available_nodes(self):
        self.assertEqual(0, len(self.driver.get_available_nodes()))
        self.assertEqual(0, len(self.driver.get_available_nodes(refresh=True)))

        node1 = self._create_node()
        self.assertEqual(1, len(self.driver.get_available_nodes()))

        node1['instance']['hostname'] = 'test-host-1'
        self.driver.spawn(**node1['spawn_params'])
        self.assertEqual(1, len(self.driver.get_available_nodes()))
        self.assertEqual([node1['node']['uuid']],
                         self.driver.get_available_nodes())

    def test_list_instances(self):
        self.assertEqual([], self.driver.list_instances())

        node1 = self._create_node()
        self.assertEqual([], self.driver.list_instances())

        node_info = bm_db_utils.new_bm_node(
                        id=456,
                        service_host='test_host',
                        cpus=2,
                        memory_mb=2048,
                    )
        nic_info = [
                {'address': 'cc:cc:cc', 'datapath_id': '0x1',
                    'port_no': 1},
                {'address': 'dd:dd:dd', 'datapath_id': '0x2',
                    'port_no': 2},
            ]
        node2 = self._create_node(node_info=node_info, nic_info=nic_info)
        self.assertEqual([], self.driver.list_instances())

        node1['instance']['hostname'] = 'test-host-1'
        node2['instance']['hostname'] = 'test-host-2'

        self.driver.spawn(**node1['spawn_params'])
        self.assertEqual(['test-host-1'],
                self.driver.list_instances())

        self.driver.spawn(**node2['spawn_params'])
        self.assertEqual(['test-host-1', 'test-host-2'],
                self.driver.list_instances())

        self.driver.destroy(**node1['destroy_params'])
        self.assertEqual(['test-host-2'],
                self.driver.list_instances())

        self.driver.destroy(**node2['destroy_params'])
        self.assertEqual([], self.driver.list_instances())

    def test_get_info_no_such_node(self):
        node = self._create_node()
        self.assertRaises(exception.InstanceNotFound,
                self.driver.get_info,
                node['instance'])

    def test_get_info_ok(self):
        node = self._create_node()
        db.bm_node_associate_and_update(self.context, node['node']['uuid'],
                {'instance_uuid': node['instance']['uuid'],
                 'instance_name': node['instance']['hostname'],
                 'task_state': baremetal_states.ACTIVE})
        res = self.driver.get_info(node['instance'])
        self.assertEqual(res['state'], power_state.RUNNING)

    def test_get_info_with_defunct_pm(self):
        # test fix for bug 1178378
        node = self._create_node()
        db.bm_node_associate_and_update(self.context, node['node']['uuid'],
                {'instance_uuid': node['instance']['uuid'],
                 'instance_name': node['instance']['hostname'],
                 'task_state': baremetal_states.ACTIVE})

        # fake the power manager and don't get a power state
        self.mox.StubOutWithMock(fake.FakePowerManager, 'is_power_on')
        fake.FakePowerManager.is_power_on().AndReturn(None)
        self.mox.ReplayAll()

        res = self.driver.get_info(node['instance'])
        # prior to the fix, returned power_state was SHUTDOWN
        self.assertEqual(res['state'], power_state.NOSTATE)
        self.mox.VerifyAll()

    def test_dhcp_options_for_instance(self):
        node = self._create_node()
        fake_bootfile = "pxelinux.0"
        self.mox.StubOutWithMock(pxe, 'get_pxe_bootfile_name')
        pxe.get_pxe_bootfile_name(mox.IgnoreArg()).AndReturn(fake_bootfile)
        self.mox.ReplayAll()
        expected = [{'opt_name': 'bootfile-name', 'opt_value': fake_bootfile},
                    {'opt_name': 'server-ip-address', 'opt_value': CONF.my_ip},
                    {'opt_name': 'tftp-server', 'opt_value': CONF.my_ip}]

        res = self.driver.dhcp_options_for_instance(node['instance'])
        self.assertEqual(expected.sort(), res.sort())
        self.mox.VerifyAll()


text:
export HDF5_DIR=$PREFIX

$PYTHON setup.py install


text: a readme that should not be included.


text:
package api

import (
	"encoding/json"
	"fmt"
)

type BaseResponse struct {
	Ok      bool             `json:"ok"`
	Index   string           `json:"_index,omitempty"`
	Type    string           `json:"_type,omitempty"`
	Id      string           `json:"_id,omitempty"`
	Source  *json.RawMessage `json:"_source,omitempty"` // depends on the schema you've defined
	Version int              `json:"_version,omitempty"`
	Found   bool             `json:"found,omitempty"`
	Exists  bool             `json:"exists,omitempty"`
	Created bool             `json:"created,omitempty"`
	Matches []string         `json:"matches,omitempty"` // percolate matches
}

type Status struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Failed     int `json:"failed"`
}

type Match struct {
	OK           bool         `json:"ok"`
	Matches      []string     `json:"matches"`
	Explaination Explaination `json:"explaination,omitempty"`
}

type Explaination struct {
	Value       float32        `json:"value"`
	Description string         `json:"description"`
	Details     []Explaination `json:"details,omitempty"`
}

func Pretty(pretty bool) string {
	prettyString := ""
	if pretty == true {
		prettyString = "pretty=1"
	}
	return prettyString
}

// http://www.elasticsearch.org/guide/reference/api/search/search-type/

func Scan(scan int) string {
	scanString := ""
	if scan > 0 {
		scanString = fmt.Sprintf("&search_type=scan&size=%v", scan)
	}
	return scanString
}

func Scroll(duration string) string {
	scrollString := ""
	if duration != "" {
		scrollString = "&scroll=" + duration
	}
	return scrollString
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Index of new symbols in 0.9.20: HarfBuzz Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="HarfBuzz Manual">
<link rel="up" href="pt02.html" title="Part II. Reference manual">
<link rel="prev" href="api-index-0-9-11.html" title="Index of new symbols in 0.9.11">
<link rel="next" href="api-index-0-9-22.html" title="Index of new symbols in 0.9.22">
<meta name="generator" content="GTK-Doc V1.27.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">

B

Index of new symbols in 0.9.20

B

hb_buffer_flags_t, enum in Buffers

hb_buffer_serialize_flags_t, enum in Buffers

Generated by GTK-Doc V1.27.1


text:
<!DOCTYPE html>
<head>
	<meta http-equiv="refresh" content="0; url=http://www.github.com/sarthfrey/sleephacks" />
</head>
<body>
</body>
</html>


text:
package net.devromik.zookeeperConfig;

import org.joda.time.DateTime;

/**
 * @author Shulnyaev Roman
 */
public interface ZookeeperNodeListener {
    void onZookeeperNodeAdded(String path, String data, DateTime when);
    void onZookeeperNodeUpdated(String path, String data, DateTime when);
    void onZookeeperNodeDeleted(String path);
}


text:
This simple extension allows you to place menus in placeholders via the
administration interface.

## Requirements

* django-cms
* And all the requirements the above project(s) depend on.

## Installation

1. make sure you are using a python virtual environment
    `mkdir -p ~/Dev/virtualenv && virtualenv ~/Dev/virtualenv/projectname && . ~/Dev/virtualenv/projectname/bin/activate && mkdir -p ~/Dev/projects/projectname/ && cd ~/Dev/projects/projectname; `

2. install it from pypi

    `pip install cmsplugin-embedded-menu`

3. or, install it from github

    `pip install git+https://github.com/airtonix/cmsplugin-embedded-menu`

## Configuration

1. add `cmsplugin_embeddedmenu` to your `INSTALLED_APPS`

2. perform a `./manage.py migrate` (for south users), or `./manage.py syncdb`

3. There is no step three!

## Override Template

Choosing a template in the administration interface means that you
populate the following two relative paths (to any of your app template dirs)
with templates you desire to be made available.

* cmsplugin_embeddedmenu/layouts

Any .html file that doesn't contain the word 'base' will be presented in
the template selector combo dropdown in the admin interface.

For example, if your django project was at :

    ~/Dev/Django/MyProjectName/

And you had a django application named `SomethingSomethingSomething` at :

    ~/Dev/Django/MyProjectName/SomethingSomethingSomething/

Then templates for this plugin could be found at :

    ~/Dev/Django/MyProjectName/SomethingSomethingSomething/templates/cmsplugin_embeddedmenu/layouts/*.html

In fact, anywhere django looks for templates, you can place the following tree :

    /cmsplugin_embeddedmenu
        /layouts
            /*.html

### Purpose of Templates

#### Containers

These are the top most elements in any menuplugin that exists in a placeholder.

By default it contains a H3 element and DIV element with the following attribtues :

*H3*

 * Text: `MenuTitle`, input from plugin settings
 * Text: `MenuSubtitle`, input from plugin settings

*DIV*

 * `id='cms-menu-{{ plugin.id }}'`, where plugin.id matches the instance of the settings model for that menu.
 * `class='cms-plugin cms-menuplugin'`
 * `data-plugin-position={{ plugin.position}}`, sorted position within the placeholder.

#### Menus

These wrap each branch in a menu, they pull in each menu item node with the template selected from the
next template group `cmsplugin_embeddedmenu/layouts/items/*.html`

By default, menu branchs are displayed as un-orderded lists (UL) with no attributes.

#### Items

Renders each menu item node as a list-item(LI) with the following attributes:

*LI*

 * `class='selected ancestor sibling descendant'`
    * `selected` applies if the node matches the page being viewed
    * `ancestor`  applies if it contains a menu branch.
 * `data-node-depth={{item.level}}`, how deep in the tree this node is.

If this node is a parent to other pages, then it will include the chosen `Menus` template inside the `LI` after the `A`

### Customising Templates

Templates in all groups are provided the context :

a CMSPlugin has many useful attributes for you to use, the main one
is `plugin.instance` a reference to the settings model.

    plugin :
        An instance of CMSPlugin, which itself provides reference
        to either of the settings models as outlined below.

#### base.html

base.html in the `cmsplugin_embeddedmenu` directory is used to load the
selected template chosen in the administration interface.

#### ./layouts/*.html

templates here are provided the context :

    plugin.instance
        template
            Chosen template.

## Contributions

anyone is free to contribute, simply submit a merge request at
github : http://github.com/airtonix/cmsplugin-embedded-menu

## Todo

provide option to manipulate menu choices:

* Look at reducing queries.
* Look at caching options.


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = require("react");
var office_ui_fabric_react_1 = require("office-ui-fabric-react");
var MyRecentDocuments_module_scss_1 = require("../MyRecentDocuments.module.scss");
var sp_http_1 = require("@microsoft/sp-http");
var SearchUtils_1 = require("../../SearchUtils");
var Utils_1 = require("../../Utils");
var MyRecentDocuments = (function (_super) {
    __extends(MyRecentDocuments, _super);
    function MyRecentDocuments(props, state) {
        var _this = _super.call(this, props) || this;
        _this.state = {
            myDocuments: [],
            loading: true,
            error: null
        };
        return _this;
    }
    MyRecentDocuments.prototype.componentDidMount = function () {
        this.loadMyDocuments(this.props.siteUrl, this.props.numberOfDocuments);
    };
    MyRecentDocuments.prototype.componentDidUpdate = function (prevProps, prevState, prevContext) {
        if (this.props.numberOfDocuments !== prevProps.numberOfDocuments ||
            this.props.siteUrl !== prevProps.siteUrl && (this.props.numberOfDocuments && this.props.siteUrl)) {
            this.loadMyDocuments(this.props.siteUrl, this.props.numberOfDocuments);
        }
    };
    MyRecentDocuments.prototype.render = function () {
        var loading = this.state.loading ? React.createElement("div", { style: { margin: '0 auto' } },
            React.createElement(office_ui_fabric_react_1.Spinner, { label: 'Loading...' })) : React.createElement("div", null);
        var error = this.state.error ? React.createElement("div", null,
            React.createElement("strong", null, "Error: "),
            " ",
            this.state.error) : React.createElement("div", null);
        var documents = this.state.myDocuments.map(function (doc, i) {
            var iconUrl = "https://spoprod-a.akamaihd.net/files/odsp-next-prod_ship-2016-08-15_20160815.002/odsp-media/images/filetypes/32/" + doc.extension + ".png";
            return (React.createElement(office_ui_fabric_react_1.DocumentCard, { onClickHref: doc.url, key: doc.id },
                React.createElement(office_ui_fabric_react_1.DocumentCardPreview, { previewImages: [
                        {
                            previewImageSrc: doc.previewImageUrl,
                            iconSrc: iconUrl,
                            width: 318,
                            height: 196,
                            accentColor: '#ce4b1f'
                        }
                    ] }),
                React.createElement(office_ui_fabric_react_1.DocumentCardTitle, { title: doc.title }),
                React.createElement(office_ui_fabric_react_1.DocumentCardActivity, { activity: doc.activity.name + " " + doc.activity.date, people: [
                        { name: doc.activity.actorName, profileImageSrc: doc.activity.actorPhotoUrl }
                    ] })));
        });
        return (React.createElement("div", { className: MyRecentDocuments_module_scss_1.default.myRecentDocuments },
            React.createElement("div", { className: office_ui_fabric_react_1.css('ms-font-xl', MyRecentDocuments_module_scss_1.default.webPartTitle) }, this.props.title),
            loading,
            error,
            documents,
            React.createElement("div", { style: { clear: 'both' } })));
    };
    MyRecentDocuments.prototype.loadMyDocuments = function (siteUrl, numberOfDocuments) {
        var _this = this;
        var myDocuments = [];
        this.props.httpClient.get(siteUrl + "/_api/search/query?querytext='*'&properties='GraphQuery:actor(me\\,or(action\\:1001\\,action\\:1003)),GraphRankingModel:{\"features\"\\:[{\"function\"\\:\"EdgeTime\"}]}'&selectproperties='Author,AuthorOwsUser,DocId,DocumentPreviewMetadata,Edges,EditorOwsUser,FileExtension,FileType,HitHighlightedProperties,HitHighlightedSummary,LastModifiedTime,LikeCountLifetime,ListID,ListItemID,OriginalPath,Path,Rank,SPWebUrl,SecondaryFileExtension,ServerRedirectedURL,SiteTitle,Title,ViewCountLifetime,siteID,uniqueID,webID'&rowlimit=" + numberOfDocuments + "&ClientType='MyRecentDocuments'&RankingModelId='0c77ded8-c3ef-466d-929d-905670ea1d72'", sp_http_1.SPHttpClient.configurations.v1, {
            headers: {
                'Accept': 'application/json;odata=nometadata',
                'odata-version': ''
            }
        })
            .then(function (response) {
            return response.json();
        })
            .then(function (response) {
            if (!response ||
                !response.PrimaryQueryResult ||
                !response.PrimaryQueryResult.RelevantResults ||
                response.PrimaryQueryResult.RelevantResults.RowCount === 0) {
                return Promise.resolve();
            }
            var actorId = undefined;
            for (var i = 0; i < response.PrimaryQueryResult.RelevantResults.Table.Rows.length; i++) {
                var row = response.PrimaryQueryResult.RelevantResults.Table.Rows[i];
                var edges = JSON.parse(SearchUtils_1.SearchUtils.getValueFromResults('Edges', row.Cells));
                if (edges.length < 1) {
                    continue;
                }
                // we can get multiple edges back so let's show the information from the latest one
                var latestEdge = edges[0];
                if (edges.length > 1) {
                    var latestEdgeDate = new Date(latestEdge.Properties.Time);
                    for (var i_1 = 1; i_1 < edges.length; i_1++) {
                        var edgeDate = new Date(edges[i_1].Properties.Time);
                        if (edgeDate > latestEdgeDate) {
                            latestEdge = edges[i_1];
                            latestEdgeDate = edgeDate;
                        }
                    }
                }
                if (!actorId) {
                    // since all edges that we're retrieving are personal (I viewed, I modified)
                    // we only need to get the actor ID once because it's the same on all edges (me)
                    actorId = latestEdge.ActorId;
                }
                var cells = row.Cells;
                var date = new Date(latestEdge.Properties.Time);
                var dateString = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();
                myDocuments.push({
                    id: SearchUtils_1.SearchUtils.getValueFromResults('DocId', cells),
                    url: SearchUtils_1.SearchUtils.getValueFromResults('ServerRedirectedURL', cells),
                    title: SearchUtils_1.SearchUtils.getValueFromResults('Title', cells),
                    previewImageUrl: SearchUtils_1.SearchUtils.getPreviewImageUrl(cells, siteUrl),
                    extension: SearchUtils_1.SearchUtils.getValueFromResults('FileType', cells),
                    activity: {
                        actorId: latestEdge.ActorId,
                        date: dateString,
                        name: SearchUtils_1.SearchUtils.getActionName(latestEdge.Properties.Action)
                    }
                });
            }
            return _this.getActorsInfo(actorId, siteUrl);
        }).
            then(function (actorInformation) {
            if (actorInformation) {
                for (var i = 0; i < myDocuments.length; i++) {
                    if (myDocuments[i].activity.actorId !== actorInformation.id) {
                        continue;
                    }
                    myDocuments[i].activity.actorName = actorInformation.name;
                    myDocuments[i].activity.actorPhotoUrl = actorInformation.photoUrl;
                }
            }
            _this.setState({
                loading: false,
                error: null,
                myDocuments: myDocuments
            });
        }, function (error) {
            _this.setState({
                loading: false,
                error: error,
                myDocuments: []
            });
        });
    };
    MyRecentDocuments.prototype.getActorsInfo = function (actorId, siteUrl) {
        var _this = this;
        if (!actorId) {
            return Promise.resolve();
        }
        return new Promise(function (resolve, reject) {
            _this.props.httpClient.get(siteUrl + "/_api/search/query?querytext='WorkId:" + actorId + "'&selectproperties='DocId,Title,WorkEmail'&ClientType='MyRecentDocuments'&SourceId='b09a7990-05ea-4af9-81ef-edfab16c4e31'", sp_http_1.SPHttpClient.configurations.v1, {
                headers: {
                    'Accept': 'application/json;odata=nometadata',
                    'odata-version': ''
                }
            })
                .then(function (response) {
                return response.json();
            })
                .then(function (response) {
                if (!response ||
                    !response.PrimaryQueryResult ||
                    !response.PrimaryQueryResult.RelevantResults ||
                    response.PrimaryQueryResult.RelevantResults.RowCount === 0) {
                    return Promise.resolve();
                }
                var cells = response.PrimaryQueryResult.RelevantResults.Table.Rows[0].Cells;
                resolve({
                    email: SearchUtils_1.SearchUtils.getValueFromResults('WorkEmail', cells),
                    id: parseInt(SearchUtils_1.SearchUtils.getValueFromResults('DocId', cells)),
                    name: SearchUtils_1.SearchUtils.getValueFromResults('Title', cells),
                    photoUrl: Utils_1.Utils.getUserPhotoUrl(SearchUtils_1.SearchUtils.getValueFromResults('WorkEmail', cells), siteUrl)
                });
            }, function (error) {
                reject(error);
            });
        });
    };
    return MyRecentDocuments;
}(React.Component));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = MyRecentDocuments;

//# sourceMappingURL=MyRecentDocuments.js.map


text:
'use strict';

var assert = require('assert');
var bowerDirectory = require('bower-directory');
var path = require('path');
var renameAlias = require('../../../tasks/lib/renameAlias');

var bowerDir = bowerDirectory.sync();

describe('renameAlias', function() {
	it('should rename paths with "bower:" prefix to be relative to bower_components', function() {
		var parentPath = path.resolve('assets/src/metal-modal/modal.js');
		var renamedPath = renameAlias('bower:metal-tooltip/tooltip', parentPath);
		assert.strictEqual(path.join(bowerDir, 'metal-tooltip/tooltip'), renamedPath);
	});

	it('should not rename absolute paths', function() {
		var parentPath = path.resolve('assets/src/metal-modal/modal.js');
		var renamedPath = renameAlias('/metal-tooltip/tooltip', parentPath);
		assert.strictEqual('/metal-tooltip/tooltip', renamedPath);
	});

	it('should rename relative paths to be relative to the parent path', function() {
		var parentPath = path.resolve('assets/src/metal-modal/modal.js');
		var renamedPath = renameAlias('./modal.soy', parentPath);
		assert.strictEqual(path.resolve('assets/src/metal-modal/modal.soy'), renamedPath);
	});
});


text:
'use strict'; // eslint-disable-line

const joi = require('joi');
const {
    certFilePathsJoi,
    hostPortJoi,
    logJoi,
    mongoJoi,
    qpKafkaJoi,
    transportJoi,
    authJoi,
} = require('./config/configItems.joi');

const logSourcesJoi = joi.string().valid('bucketd', 'mongo', 'ingestion',
    'dmd', 'kafka');

const joiSchema = joi.object({
    replicationGroupId: joi.string().length(7).required(),
    zookeeper: {
        connectionString: joi.string().required(),
        autoCreateNamespace: joi.boolean().default(false),
    },
    kafka: {
        hosts: joi.string().required(),
        backlogMetrics: {
            zkPath: joi.string().default('/backbeat/run/kafka-backlog-metrics'),
            intervalS: joi.number().default(60),
        },
    },
    transport: transportJoi,
    s3: hostPortJoi.required(),
    vaultAdmin: hostPortJoi,
    queuePopulator: {
        auth: authJoi,
        cronRule: joi.string().required(),
        batchMaxRead: joi.number().default(10000),
        batchTimeoutMs: joi.number().default(9000),
        zookeeperPath: joi.string().required(),

        logSource: joi.alternatives().try(logSourcesJoi).required(),
        subscribeToLogSourceDispatcher: joi.boolean().default(false),
        bucketd: hostPortJoi
            .keys({ transport: transportJoi })
            .when('logSource', { is: 'bucketd', then: joi.required() }),
        dmd: hostPortJoi.keys({
            logName: joi.string().default('s3-recordlog'),
        }).when('logSource', { is: 'dmd', then: joi.required() }),
        mongo: mongoJoi,
        kafka: qpKafkaJoi.when('logSource', { is: 'kafka', then: joi.required() }),
        probeServer: joi.object({
            bindAddress: joi.string().default('localhost'),
            port: joi.number().required(),
        }),
    },
    log: logJoi,
    extensions: joi.object(),
    metrics: {
        topic: joi.string().required(),
        groupIdPrefix: joi.string().default('backbeat-metrics-group'),
    },
    server: {
        healthChecks: joi.object({
            allowFrom: joi.array().items(joi.string()).default([]),
        }).required(),
        host: joi.string().required(),
        port: joi.number().default(8900),
    },
    redis: {
        host: joi.string().default('localhost'),
        port: joi.number().default(6379),
        name: joi.string().default('backbeat'),
        password: joi.string().default('').allow(''),
        sentinels: joi.alternatives([joi.string(), joi.array().items(
            joi.object({
                host: joi.string().required(),
                port: joi.number().required(),
            }))]
        ),
        sentinelPassword: joi.string().default('').allow(''),
    },
    localCache: {
        host: joi.string().default('localhost'),
        port: joi.number().default(6379),
        password: joi.string(),
    },
    healthcheckServer: joi.object({
        bindAddress: joi.string().default('127.0.0.1'),
        port: joi.number().default(4042),
    }).required(),
    certFilePaths: certFilePathsJoi,
    internalCertFilePaths: certFilePathsJoi,
});

module.exports = joiSchema;


text:
<?php declare(strict_types=1);

namespace DrdPlus\Skills;

interface WithBonusToMovementSpeed
{
    public function getBonusToMovementSpeed(): int;
}