text:
var Sources = $CL.namespace('SqlConnect.View.Sources');

$CL.require('Cl.Backbone.BlockingView');

Sources.Options = function() {};

Sources.Options = $CL.extendClass(Sources.Options, Cl.Backbone.BlockingView, {
    render : function() {
        this.parent.prototype.render.apply(this);

        if (!$CL.isEmpty(this.data.options)) {
            this.$el.find('select[name=sqlconnect-source-count-column]').val(this.data.options.countColumn);

            if (this.data.options.customSql) {
                this.$el.find('textarea[name=sqlconnect-source-custom-sql]').val(this.data.options.customSql);
            }
        }
    }
});

redpajama_set_name: RedPajamaGithub


text:
var BadgeKeeper = function(pId, isProduction) {

    var projectId = pId;
    var isStagingArea = isNullOrUndefined(isProduction) ? true : false;
    var stagingUrl = 'https://api.badgekeeper.net/';//'https://badgesapi.azurewebsites.net/'
    var projectBadgesUrl = null;
    var userBadgesUrl = null;
    var postVariablesUrl = null;

    this.setUrls = function(getProjectBadgesUrl, getUserBadgesUrl, postUserVariablesUrl) {
        projectBadgesUrl = getProjectBadgesUrl;
        userBadgesUrl = getUserBadgesUrl;
        postVariablesUrl = postUserVariablesUrl;
    };

    var validate = function(path) {
	    if (isNullOrUndefined(path)) {
	        throw new Error("Error: code 1. Path is invalid Please check settings.");
	    }
	    if (isNullOrUndefined(projectId)) {
	        throw new Error("Error: code 2. You must set up project id property.");
	    }
    };

	this.get = function(userId, fnCallback, loadIcons) {
	    // Form url to get achievements by project or by project and user
	    var path = projectBadgesUrl;
	    if (isStagingArea) {
	        if (isNullOrUndefined(userId)) {
	            path = stagingUrl + 'api/gateway/' + projectId + '/get/' + userId;
	        } else {
	            path = stagingUrl + 'api/gateway/' + projectId + '/users/get/' + userId;
	        }
	    }
	    path += shouldLoadIconsPath(loadIcons);
	    validate(path);

		$.ajax({
			url: path,
			type: 'GET',
			contentType: 'application/json;charset=utf-8',

			success: function (response) {
			    if (!isNullOrUndefined(fnCallback)) {
			        fnCallback(response);
				}
            },
            error: function (xhr, status) {
                if (!isNullOrUndefined(fnCallback)) {
					fnCallback(status);
				}
            }
		});
	};

	this.post = function (userId, values, fnCallback) {
	    // Form url to post user values
	    var path = postVariablesUrl;
	    if (isStagingArea) {
	        path = stagingUrl + 'api/gateway/' + projectId + '/users/post/' + userId;
	    }

	    validate(path);
	    if (isNullOrUndefined(userId)) {
	        throw new Error("Error: code 3. Cannot submit results without user id provided.");
	    }

        // Form body with user values
	    var jsonData = [];
	    for (var i = 0; i < values.length; i++) {
	        var key = null;
	        var value = 0;
	        for (var item in values[i]) {
	            key = item;
	            value = values[i][key];
	        }

            // Body fields validation
	        if (isNullOrUndefined(key)) {
	            throw new Error("Error: code 4. Cannot submit results without achievement Name provided.");
	        }
	        if (isNullOrUndefined(value)) {
	            throw new Error("Error: code 5. Cannot submit results without achievement Value provided");
	        }
	        var item = { "Key": key, "Value": value };
	        jsonData.push(item);
	    }

	    $.ajax({
	        url: path,
	        type: 'POST',
	        data: JSON.stringify(jsonData),
	        contentType: 'application/json;charset=utf-8',

	        success: function (response) {
	            if (!isNullOrUndefined(fnCallback)) {
	                fnCallback(response);
	            }
	        },
	        error: function (xhr, status) {
	            if (!isNullOrUndefined(fnCallback)) {
	                fnCallback(status);
	            }
	        }
	    });
	};

	function isNullOrUndefined(value) {
		var result = (value == null);
		return result;
	};

	function shouldLoadIconsPath(shouldLoadIcons) {
	    var result = '?shouldLoadIcons=' + (shouldLoadIcons === true ? "true" : "false");
	    return result;
	};
}


text:
#define BOOST_ENABLE_ASSERT_HANDLER

#include "boost/bind/apply.hpp" // Included just to test proper interaction with boost::apply<> as reported by Daniel Wallin
#include "boost/mpl/bool.hpp"
#include "boost/mpl/bool_fwd.hpp"  // For mpl::true_ and mpl::false_
#include "boost/static_assert.hpp"

#include "boost/optional/optional.hpp"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#include "boost/none.hpp"

#include "boost/test/minimal.hpp"

#include "optional_test_common.cpp"

class NonConstructible
{
private:
    NonConstructible();
    NonConstructible(NonConstructible const&);
#if (!defined BOOST_NO_CXX11_RVALUE_REFERENCES)
    NonConstructible(NonConstructible &&);
#endif
};

void test_non_constructible()
{
    optional<NonConstructible> o;
    BOOST_CHECK(!o);
    BOOST_CHECK(o == boost::none);
    try {
        o.value();
        BOOST_CHECK(false);
    }
    catch(...) {
        BOOST_CHECK(true);
    }
}

class Guard
{
public:
    explicit Guard(int) {}
private:
    Guard();
    Guard(Guard const&);
#if (!defined BOOST_NO_CXX11_RVALUE_REFERENCES)
    Guard(Guard &&);
#endif
};

void test_guard()
{
    optional<Guard> o;
    o.emplace(1);
    BOOST_CHECK(o);
}

void test_non_assignable()
{
    optional<const std::string> o;
    o.emplace("cat");
    BOOST_CHECK(o);
    BOOST_CHECK(*o == "cat");
}

int test_main( int, char* [] )
{
  try
  {
    test_non_constructible();
    test_guard();
    test_non_assignable();
  }
  catch ( ... )
  {
    BOOST_ERROR("Unexpected Exception caught!");
  }

  return 0;
}


text:
This repo creates a Docker image for [Magento](http://magento.com/).

## Magento versions

Version | Git branch | Tag name
--------| ---------- |---------
1.9.1.0 | master     | latest
1.8.1.0 | 1.8.1.0    | 1.8.1.0
1.7.0.2 | 1.7.0.2    | 1.7.0.2
1.6.2.0 | 1.6.2.0    | 1.6.2.0

## How to use

### Use as standalone container

You can use `docker run` to run this image directly.

```bash
docker run -p 80:80 alexcheng/magento
```

Then finish Magento installation using web UI. You need to have an existing MySQL server.

Magento is installed into `/var/www/htdocs` folder.

### Use Docker Compose

[Docker Compose](https://docs.docker.com/compose/) is the recommended way to run this image with MySQL database.

A sample `docker-compose.yml` can be found in this repo.

```yaml
web:
  image: alexcheng/magento
  ports:
    - "80:80"
  links:
    - mysql
  env_file:
    - env
mysql:
  image: mysql:5.6.23
  env_file:
    - env
```

Then use `docker-compose up -d` to start MySQL and Magento server.

## Magento sample data

Installation script for Magento sample data is also provided.

__Please note:__ Sample data must be installed __before__ Magento itself.

Use `/usr/local/bin/install-sampledata` to install sample data for Magento.

```bash
docker exec -it <container id> install-sampledata
```

Magento 1.9 sample data is compressed version from [Vinai/compressed-magento-sample-data](https://github.com/Vinai/compressed-magento-sample-data). Magento 1.6 - 1.8 uses the [official sample data](http://devdocs.magento.com/guides/m1x/ce18-ee113/ht_magento-ce-sample.data.html).

## Magento installation script

A Magento installation script is also provided as `/usr/local/bin/install-magento`. This script can install Magento without using web UI. This script requires certain environment variables to run:

Environment variable      | Description | Default value (used by Docker Compose - `env` file)
--------------------      | ----------- | ---------------------------
MYSQL_HOST                | MySQL host  | mysql
MYSQL_DATABASE            | MySQL db name for Magento | magento
MYSQL_USER                | MySQL username | magento
MYSQL_PASSWORD            | MySQL password | magento
MAGENTO_LOCALE            | Magento locale | en_GB
MAGENTO_TIMEZONE          | Magento timezone |Pacific/Auckland
MAGENTO_DEFAULT_CURRENCY  | Magento default currency | NZD
MAGENTO_URL               | Magento base url | http://mymagentostore.com
MAGENTO_ADMIN_FIRSTNAME   | Magento admin firstname | Admin
MAGENTO_ADMIN_LASTNAME    | Magento admin lastname | MyStore
MAGENTO_ADMIN_EMAIL       | Magento admin email | amdin@mymagentostore.com
MAGENTO_ADMIN_USERNAME    | Magento admin username | admin
MAGENTO_ADMIN_PASSWORD    | Magento admin password | magentorocks1

If you want to use `install-magento` script and this images is started as a standalone container using `docker run`, make sure these environment variables are passed in `docker run` with `-e` switch.

After Docker container started, use `docker ps` to find container id of image `alexcheng/magento`, then use `docker exec` to call `install-magento` script.

```bash
docker exec -it <container id> install-magento
```

If Docker Compose is used, you can just modify `env` file in the same directory of `docker-compose.yml` file to update those environment variables.

After calling `install-magento`, Magento is installed and ready to use. Use provided admin username and password to log into Magento backend.

If you use default base url (http://mymagentostore.com) or other test url, you need to [modify your host file](http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/) to map the host name to docker container. For Boot2Docker, use `boot2docker ip` to find the IP address.


text:
import warnings

from zoo.pipeline.api.keras.models import Sequential
from zoo.pipeline.api.keras.layers import *
from zoo.models.common import ZooModel
from zoo.common.utils import callZooFunc

if sys.version >= '3':
    long = int
    unicode = str

class TextClassifier(ZooModel):
    """
    The model used for text classification with WordEmbedding as its first layer.

    # Arguments
    class_num: The number of text categories to be classified. Positive int.
    embedding_file: The path to the word embedding file.
                    Currently only the following GloVe files are supported:
                    "glove.6B.50d.txt", "glove.6B.100d.txt", "glove.6B.200d.txt"
                    "glove.6B.300d.txt", "glove.42B.300d.txt", "glove.840B.300d.txt".
                    You can download from: https://nlp.stanford.edu/projects/glove/.
    word_index: Dictionary of word (string) and its corresponding index (int).
                The index is supposed to start from 1 with 0 reserved for unknown words.
                During the prediction, if you have words that are not in the word_index
                for the training, you can map them to index 0.
                Default is None. In this case, all the words in the embedding_file will
                be taken into account and you can call
                WordEmbedding.get_word_index(embedding_file) to retrieve the dictionary.
    sequence_length: The length of a sequence. Positive int. Default is 500.
    encoder: The encoder for input sequences. String. 'cnn' or 'lstm' or 'gru' are supported.
             Default is 'cnn'.
    encoder_output_dim: The output dimension for the encoder. Positive int. Default is 256.
    """

    def __init__(self, class_num, embedding_file, word_index=None, sequence_length=500,
                 encoder="cnn", encoder_output_dim=256, **kwargs):
        if 'token_length' in kwargs:
            kwargs.pop('token_length')
            warnings.warn('The "token_length" argument in TextClassifier has been deprecated '
                          'since 0.3.0, instead you should pass the arguments "embedding_file" '
                          'and "word_index" to construct a TextClassifier with WordEmbedding '
                          'as the first layer.')
        if 'bigdl_type' in kwargs:
            kwargs.pop('bigdl_type')
            self.bigdl_type = kwargs.get("bigdl_type")
        else:
            self.bigdl_type = "float"
        if kwargs:
            raise TypeError('Wrong arguments for TextClassifier: ' + str(kwargs))
        self.class_num = class_num
        self.embedding = WordEmbedding(embedding_file, word_index, input_length=sequence_length)
        self.sequence_length = sequence_length
        self.encoder = encoder
        self.encoder_output_dim = encoder_output_dim
        self.model = self.build_model()
        super(TextClassifier, self).__init__(None, self.bigdl_type,
                                             int(class_num),
                                             self.embedding,
                                             int(sequence_length),
                                             encoder,
                                             int(encoder_output_dim),
                                             self.model)

    def build_model(self):
        model = Sequential()
        model.add(self.embedding)
        if self.encoder.lower() == 'cnn':
            model.add(Convolution1D(self.encoder_output_dim, 5, activation='relu'))
            model.add(GlobalMaxPooling1D())
        elif self.encoder.lower() == 'lstm':
            model.add(LSTM(self.encoder_output_dim))
        elif self.encoder.lower() == 'gru':
            model.add(GRU(self.encoder_output_dim))
        else:
            raise ValueError('Unsupported encoder for TextClassifier: ' + self.encoder)
        model.add(Dense(128))
        model.add(Dropout(0.2))
        model.add(Activation('relu'))
        model.add(Dense(self.class_num, activation='softmax'))
        return model

    @staticmethod
    def load_model(path, weight_path=None, bigdl_type="float"):
        """
        Load an existing TextClassifier model (with weights).

        # Arguments
        path: The path for the pre-defined model.
              Local file system, HDFS and Amazon S3 are supported.
              HDFS path should be like 'hdfs://[host]:[port]/xxx'.
              Amazon S3 path should be like 's3a://bucket/xxx'.
        weight_path: The path for pre-trained weights if any. Default is None.
        """
        jmodel = callZooFunc(bigdl_type, "loadTextClassifier", path, weight_path)
        model = ZooModel._do_load(jmodel, bigdl_type)
        model.__class__ = TextClassifier
        return model

    # For the following methods, please refer to KerasNet for documentation.
    def compile(self, optimizer, loss, metrics=None):
        if isinstance(optimizer, six.string_types):
            optimizer = to_bigdl_optim_method(optimizer)
        if isinstance(loss, six.string_types):
            loss = to_bigdl_criterion(loss)
        if metrics and all(isinstance(metric, six.string_types) for metric in metrics):
            metrics = to_bigdl_metrics(metrics, loss)
        callZooFunc(self.bigdl_type, "textClassifierCompile",
                    self.value,
                    optimizer,
                    loss,
                    metrics)

    def set_tensorboard(self, log_dir, app_name):
        callZooFunc(self.bigdl_type, "textClassifierSetTensorBoard",
                    self.value,
                    log_dir,
                    app_name)

    def set_checkpoint(self, path, over_write=True):
        callZooFunc(self.bigdl_type, "textClassifierSetCheckpoint",
                    self.value,
                    path,
                    over_write)

    def fit(self, x, batch_size=32, nb_epoch=10, validation_data=None):
        """
        Fit on TextSet.
        """
        assert isinstance(x, TextSet), "x should be a TextSet"
        if validation_data:
            assert isinstance(validation_data, TextSet), "validation_data should be a TextSet"
        callZooFunc(self.bigdl_type, "textClassifierFit",
                    self.value,
                    x,
                    batch_size,
                    nb_epoch,
                    validation_data)

    def evaluate(self, x, batch_size=32):
        """
        Evaluate on TextSet.
        """
        assert isinstance(x, TextSet), "x should be a TextSet"
        return callZooFunc(self.bigdl_type, "textClassifierEvaluate",
                           self.value,
                           x,
                           batch_size)

    def predict(self, x, batch_per_thread=4):
        """
        Predict on TextSet.
        """
        assert isinstance(x, TextSet), "x should be a TextSet"
        results = callZooFunc(self.bigdl_type, "textClassifierPredict",
                              self.value,
                              x,
                              batch_per_thread)
        return TextSet(results)


text:
package scala
package collection

import scala.collection.immutable.TreeMap
import scala.collection.mutable.Builder
import scala.language.higherKinds

import scala.annotation.unchecked.uncheckedVariance

/** Base type of sorted sets */
trait SortedMap[K, +V]
  extends Map[K, V]
    with SortedMapOps[K, V, SortedMap, SortedMap[K, V]] {

  def unsorted: Map[K, V] = this

  override protected def fromSpecificIterable(coll: Iterable[(K, V)] @uncheckedVariance): SortedMapCC[K, V] @uncheckedVariance = sortedMapFactory.from(coll)
  override protected def newSpecificBuilder(): mutable.Builder[(K, V), SortedMapCC[K, V]] @uncheckedVariance = sortedMapFactory.newBuilder[K, V]()

  /**
    * @note This operation '''has''' to be overridden by concrete collection classes to effectively
    *       return a `SortedMapFactory[SortedMapCC]`. The implementation in `SortedMap` only returns
    *       a `SortedMapFactory[SortedMap]`, but the compiler will '''not''' throw an error if the
    *       effective `SortedMapCC` type constructor is more specific than `SortedMap`.
    *
    * @return The factory of this collection.
    */
  def sortedMapFactory: SortedMapFactory[SortedMapCC] = SortedMap

  override def empty: SortedMapCC[K, V] @uncheckedVariance = sortedMapFactory.empty
}

trait SortedMapOps[K, +V, +CC[X, Y] <: Map[X, Y] with SortedMapOps[X, Y, CC, _], +C <: SortedMapOps[K, V, CC, C]]
  extends MapOps[K, V, Map, C]
     with SortedOps[K, C] {

  /**
    * Type alias to `CC`. It is used to provide a default implementation of the `fromSpecificIterable`
    * and `newSpecificBuilder` operations.
    *
    * Due to the `@uncheckedVariance` annotation, usage of this type member can be unsound and is
    * therefore not recommended.
    */
  protected type SortedMapCC[K, V] = CC[K, V] @uncheckedVariance

  def sortedMapFactory: SortedMapFactory[SortedMapCC]

  /** Similar to `mapFromIterable`, but returns a SortedMap collection type.
    * Note that the return type is now `CC[K2, V2]` aka `SortedMapCC[K2, V2]` rather than `MapCC[(K2, V2)]`.
    */
  @`inline` protected final def sortedMapFromIterable[K2, V2](it: Iterable[(K2, V2)])(implicit ordering: Ordering[K2]): CC[K2, V2] = sortedMapFactory.from(it)

  def unsorted: Map[K, V]

  /**
    * Creates an iterator over all the key/value pairs
    * contained in this map having a key greater than or
    * equal to `start` according to the ordering of
    * this map. x.iteratorFrom(y) is equivalent
    * to but often more efficient than x.from(y).iterator.
    *
    * @param start The lower bound (inclusive)
    * on the keys to be returned
    */
  def iteratorFrom(start: K): Iterator[(K, V)]

  /**
    * Creates an iterator over all the keys(or elements)  contained in this
    * collection greater than or equal to `start`
    * according to the ordering of this collection. x.keysIteratorFrom(y)
    * is equivalent to but often more efficient than
    * x.from(y).keysIterator.
    *
    * @param start The lower bound (inclusive)
    * on the keys to be returned
    */
  def keysIteratorFrom(start: K): Iterator[K]

  /**
    * Creates an iterator over all the values contained in this
    * map that are associated with a key greater than or equal to `start`
    * according to the ordering of this map. x.valuesIteratorFrom(y) is
    * equivalent to but often more efficient than
    * x.from(y).valuesIterator.
    *
    * @param start The lower bound (inclusive)
    * on the keys to be returned
    */
  def valuesIteratorFrom(start: K): Iterator[V] = iteratorFrom(start).map(_._2)

  def firstKey: K = head._1
  def lastKey: K = last._1

  /** Find the element with smallest key larger than or equal to a given key.
    * @param key The given key.
    * @return `None` if there is no such node.
    */
  def minAfter(key: K): Option[(K, V)] = rangeFrom(key).headOption

  /** Find the element with largest key less than a given key.
    * @param key The given key.
    * @return `None` if there is no such node.
    */
  def maxBefore(key: K): Option[(K, V)] = rangeUntil(key).lastOption

  def rangeTo(to: K): C = {
    val i = keySet.rangeFrom(to).iterator()
    if (i.isEmpty) return coll
    val next = i.next()
    if (ordering.compare(next, to) == 0)
      if (i.isEmpty) coll
      else rangeUntil(i.next())
    else
      rangeUntil(next)
  }

  override def keySet: SortedSet[K] = new KeySortedSet

  /** The implementation class of the set returned by `keySet` */
  @SerialVersionUID(3L)
  protected class KeySortedSet extends SortedSet[K] with GenKeySet with GenKeySortedSet {
    def diff(that: Set[K]): SortedSet[K] = fromSpecificIterable(view.filterNot(that))
    def rangeImpl(from: Option[K], until: Option[K]): SortedSet[K] = {
      val map = SortedMapOps.this.rangeImpl(from, until)
      new map.KeySortedSet
    }
  }

  /** A generic trait that is reused by sorted keyset implementations */
  protected trait GenKeySortedSet extends GenKeySet { this: SortedSet[K] =>
    implicit def ordering: Ordering[K] = SortedMapOps.this.ordering
    def iteratorFrom(start: K): Iterator[K] = SortedMapOps.this.keysIteratorFrom(start)
  }

  override def withFilter(p: ((K, V)) => Boolean): SortedMapOps.WithFilter[K, V, IterableCC, MapCC, CC] = new SortedMapOps.WithFilter(this, p)

  // And finally, we add new overloads taking an ordering
  /** Builds a new sorted map by applying a function to all elements of this $coll.
    *
    *  @param f      the function to apply to each element.
    *  @return       a new $coll resulting from applying the given function
    *                `f` to each element of this $coll and collecting the results.
    */
  def map[K2, V2](f: ((K, V)) => (K2, V2))(implicit ordering: Ordering[K2]): CC[K2, V2] =
    sortedMapFactory.from(new View.Map[(K, V), (K2, V2)](toIterable, f))

  /** Builds a new sorted map by applying a function to all elements of this $coll
    *  and using the elements of the resulting collections.
    *
    *  @param f      the function to apply to each element.
    *  @return       a new $coll resulting from applying the given collection-valued function
    *                `f` to each element of this $coll and concatenating the results.
    */
  def flatMap[K2, V2](f: ((K, V)) => IterableOnce[(K2, V2)])(implicit ordering: Ordering[K2]): CC[K2, V2] =
    sortedMapFactory.from(new View.FlatMap(toIterable, f))

  /** Builds a new sorted map by applying a partial function to all elements of this $coll
    *  on which the function is defined.
    *
    *  @param pf     the partial function which filters and maps the $coll.
    *  @return       a new $coll resulting from applying the given partial function
    *                `pf` to each element on which it is defined and collecting the results.
    *                The order of the elements is preserved.
    */
  def collect[K2, V2](pf: PartialFunction[(K, V), (K2, V2)])(implicit ordering: Ordering[K2]): CC[K2, V2] =
    flatMap { kv =>
      if (pf.isDefinedAt(kv)) new View.Single(pf(kv))
      else View.Empty
    }

  /** Returns a new $coll containing the elements from the left hand operand followed by the elements from the
    *  right hand operand. The element type of the $coll is the most specific superclass encompassing
    *  the element types of the two operands.
    *
    *  @param xs   the traversable to append.
    *  @tparam K2  the type of the keys of the returned $coll.
    *  @tparam V2  the type of the values of the returned $coll.
    *  @return     a new collection of type `CC[K2, V2]` which contains all elements
    *              of this $coll followed by all elements of `xs`.
    */
  def concat[K2 >: K, V2 >: V](xs: Iterable[(K2, V2)])(implicit ordering: Ordering[K2]): CC[K2, V2] = sortedMapFactory.from(new View.Concat(toIterable, xs))

  /** Alias for `concat` */
  @`inline` final def ++ [K2 >: K, V2 >: V](xs: Iterable[(K2, V2)])(implicit ordering: Ordering[K2]): CC[K2, V2] = concat(xs)

  @deprecated("Consider requiring an immutable SortedMap or fall back to SortedMap.concat ", "2.13.0")
  override def + [V1 >: V](kv: (K, V1)): CC[K, V1] = sortedMapFactory.from(new View.Appended(toIterable, kv))

  // We override these methods to fix their return type (which would be `Map` otherwise)
  override def concat[V2 >: V](xs: collection.Iterable[(K, V2)]): CC[K, V2] = sortedMapFactory.from(new View.Concat(toIterable, xs))
  override def ++ [V2 >: V](xs: collection.Iterable[(K, V2)]): CC[K, V2] = concat(xs)
  // TODO Also override mapValues

}

object SortedMapOps {
  /** Specializes `MapWithFilter` for sorted Map collections
    *
    * @define coll sorted map collection
    */
  class WithFilter[K, +V, +IterableCC[_], +MapCC[X, Y] <: Map[X, Y], +CC[X, Y] <: Map[X, Y] with SortedMapOps[X, Y, CC, _]](
    self: SortedMapOps[K, V, CC, _] with MapOps[K, V, MapCC, _] with IterableOps[(K, V), IterableCC, _],
    p: ((K, V)) => Boolean
  ) extends MapOps.WithFilter[K, V, IterableCC, MapCC](self, p) {

    def map[K2 : Ordering, V2](f: ((K, V)) => (K2, V2)): CC[K2, V2] =
      self.sortedMapFactory.from(new View.Map(filtered, f))

    def flatMap[K2 : Ordering, V2](f: ((K, V)) => IterableOnce[(K2, V2)]): CC[K2, V2] =
      self.sortedMapFactory.from(new View.FlatMap(filtered, f))

    override def withFilter(q: ((K, V)) => Boolean): WithFilter[K, V, IterableCC, MapCC, CC] =
      new WithFilter[K, V, IterableCC, MapCC, CC](self, (kv: (K, V)) => p(kv) && q(kv))

  }

}

object SortedMap extends SortedMapFactory.Delegate[SortedMap](TreeMap)


text:
If you have local gems that are not contained within your project (for example, you would like to share your local gems across projects), and you use a deployment system like CloudFoundry, bundler creates a situation where your Gemfile and Gemfile.lock do not match, which causes `bundle install --deployment`, a command used in many buildpacks, to fail.

This project is a recreates a situation I ran into while working on a project for a client.

This was tested using:

1. Mac running OS X 10.11 (El Capitan)
2. Rails 4.2.4
3. bundler 1.10.6

## Steps to Reproduce

1. `rails new app1` to create the first app that shares your local gem
2. `rails new app2` to create the second app that shares your local gem
3. `mkdir components` to create a directory where I put all of my shared components, including local gems
4. `cd components`
5. `bundle gem shared_gem` to create the shared gem
6. Add this line to both app1 and app2 Gemfile:

   `gem 'shared_gem', path: '../components/shared_gem'`

7. `bundle install` in `app1`
8. I added root controllers and routes, which use the shared gem, to both Rails apps just to verify that everything was wired up correctly.
9. Now I want to recreate a deployment situation. The example I will use is the [Pivotal Web Services PaaS](http://run.pivotal.io/), which uses CloudFoundry. When you do a `cf push`, the current directory is pushed. This is different from something like [Heroku](https://www.heroku.com/) which uses git and pushes your entire project. Because of this, I need to vendor my gems so that they are contained with my project directory, rather than living outside in the `components` directory. I do this by running these commands for `app1`:

   `bundle package --all`

   `bundle install`

10. Now, to simulate a Pivotal Web Services deployment, I will move my app into a new directory to recreate the fact that the `../components` path in my Gemfile is no longer present

    From the project root directory:

    `mkdir -p fake_deployment/fake_app`

    `cp app1 fake_deployment/fake_app/app1`

    `cd fake_deployment/fake_app/app1`

Now that we've created a simulation of the deployment, when you run the same command that the CloudFoundry (and Heroku) buildpacks run, `bundle install --deployment`, this is the error you get:

```
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have added to the Gemfile:
* source: source at ../components/shared_gem

You have deleted from the Gemfile:
* source: source at vendor/cache/shared_gem
```

The issue is that `bundle package --all && bundle install` modifies my Gemfile.lock to point to `vendor/cache`, but my Gemfile still points to my `../components` directory.

Here is my current workaround:

```
gem 'shared_gem', path: (Pathname.new('../components').exist? ? '../components/shared_gem' : 'vendor/cache/shared_gem')
```


text:
/**********************************************************
// Author   : K.(k79k06k02k)
// FileName : TableClassBase.cs
**********************************************************/
namespace ClientDataBase
{
    public class TableClassBase { }
}


text:
using Joyomanju, Test

@test 1 == 1


text:
import { StoreField } from './store';
import { Style } from './style';

export interface VirtualDomAttribute extends VirtualDomPart {
    render?: (deps: any) => VirtualDomAttribute;
    value: string | null;
}

export interface VirtualDomCssClass extends VirtualDomPart {
    render?: (deps: any) => VirtualDomCssClass;
    rendered?: boolean;
    style: Style | null;
}

export interface VirtualDomCssRule extends VirtualDomPart {
    render?: (deps: any) => VirtualDomCssRule;
    rendered?: boolean;
    selector: string;
    style: Style;
}

export interface VirtualDomEvent extends VirtualDomPart {
    name: "click" | "input";
    listener: (event: any, options?: boolean) => void | null;
    render?: (deps: any) => VirtualDomEvent;
    options?: boolean;
}

export interface VirtualDomNode extends VirtualDomPart {
    attributes?: Array<VirtualDomAttribute>;
    classes?: Array<VirtualDomCssClass>;
    events?: Array<VirtualDomEvent>;
    nativeNode?: any;
    nodes?: Array<VirtualDomNode>;
    render?: (deps: any) => Promise<VirtualDomNode>;
    text?: string; // Used when Node is a text node.
}

export interface VirtualDomPart {
    deps?: any;
    name?: string;
    parent?: VirtualDomNode;
    shouldNotRender?: boolean;
}