text:
'use strict';

const path = require('path');
const ResourceMap = require('./resource-map');
const SystemjsTransformer = require('./panto-transformer-systemjs');
const AspectTransformer = require('panto-transformer-aspect');
const ResourceTransformer = require('panto-transformer-resource');

module.exports = (panto, conf) => {

    const Stream = panto.Stream;

    const {
        node_modules,
        namespace,
        ignore,
        binary_resource,
        isDev
    } = conf;

    const {
        extend
    } = panto._;

    const WRITE_ORIGIN = {
        destname: file => `${namespace}/${file.filename}`
    };

    const WRITE_STATIC = {
        destname: file => path.join('static', namespace, file.stamp)
    };

    const SET_RES_MAP = {
        aspect: file => {
            if (file.stamp) {
                resourceMap.set(`${namespace}:${file.filename}`, {
                    uri: `${namespace}/${file.stamp}`
                });
            }
            if (file.deps) {
                resourceMap.set(`${namespace}:${file.filename}`, {
                    deps: file.deps
                });
            }
        }
    };

    const GET_RES = extend({}, conf, {
        getResourceAlias: name => {
            const moduleId = `${namespace}:${name}`;
            return resourceMap.has(moduleId) ? ('/' + resourceMap.get(moduleId).get('uri')) : null;
        }
    });

    const isSkip = isDev;

    const resourceMap = new ResourceMap();

    panto.loadTransformer('systemjs', SystemjsTransformer);

    // rest
    panto.rest().tag('rest').ignore({
        exclude: `**/{${ignore}}`
    }).read().write(WRITE_ORIGIN);

    // node_modules
    const nodeModules = panto.$(`${node_modules}/**/*.{js,json}`, true).tag('node_modules').read();

    nodeModules.write(WRITE_ORIGIN);

    nodeModules.systemjs(extend({}, conf, {
        ignoreError: true,
        isSilent: true,
        isCacheable: true
    })).uglify({
        ignoreError: true,
        isSlient: true,
        isSkip,
        isCacheable: true
    }).stamp({
        isCacheable: true
    }).aspect(SET_RES_MAP).write(WRITE_STATIC);

    // binary
    const binaryAspectStream = new Stream(new AspectTransformer(SET_RES_MAP));

    panto.pick(`src/**/*.{${binary_resource}}`).tag('binary').read().stamp({
        isCacheable: true
    }).connect(binaryAspectStream).write(WRITE_STATIC);

   // html resource
    const tpl = panto.pick(`src/**/*.{html,htm,shtml,xhtml,tpl}`).tag('html').read();

    tpl.stamp({
        isCacheable: true
    }).aspect(SET_RES_MAP).write(WRITE_STATIC);

    const srcJs = panto.pick(`src/**/*.{js,jsx}`).tag('src js').read();
    // server js
    srcJs.babel({
        isSkip: 'src/lib/**/*.js',
        babelOptions: {
            "extends": path.join(__dirname, '..', '.babelrc-server')
        },
        isCacheable: true
    }).write(WRITE_ORIGIN);

    // css
    const cssAspectStream = new Stream(new AspectTransformer(SET_RES_MAP));
    const cssResourceStream = new Stream(new ResourceTransformer(GET_RES));

    binaryAspectStream.connect(cssResourceStream);

    panto.pick(`src/**/*.{css,less}`).tag('css').read().less({
        isCacheable: true
    }).connect(cssResourceStream).stamp({
        isCacheable: true
    }).connect(cssAspectStream).write(WRITE_STATIC);

    // client js
    const srcClientAspectStream = new Stream(new AspectTransformer(SET_RES_MAP));

    srcJs.babel({
        isSkip: 'src/lib/**/*.js',
        babelOptions: {
            extends: path.join(__dirname, '..', '.babelrc-client')
        },
        isCacheable: true
    }).systemjs(extend({}, conf, {
        ignoreError: true,
        isSilent: false,
        isSkip: 'src/lib/**/*.js',
        isCacheable: true
    })).uglify({
        isSlient: true,
        isCacheable: true
    }).stamp({
        isCacheable: true
    }).connect(srcClientAspectStream).write(WRITE_STATIC);

    const htmlTemplateResourceStream = new Stream(new ResourceTransformer(GET_RES));

    binaryAspectStream.connect(htmlTemplateResourceStream, false);
    cssAspectStream.connect(htmlTemplateResourceStream, false);
    srcClientAspectStream.connect(htmlTemplateResourceStream, false);

    tpl.connect(htmlTemplateResourceStream).write(WRITE_ORIGIN);

    panto.on('complete', files => {
        panto.log.info(files);
        panto.file.write(`${namespace}/resource-map.json`, resourceMap.toJSONString());
        panto.log.info('resource-map.json created');
    }).on('error', err => panto.log.error(err));
};


text:
#define BLOCK_SIZE 128

#define TERM_SCORES_CACHE_SIZE 32

#define CHUNK 1024
#define MASK (CHUNK-1)

#define NO_MORE_DOCS 2147483647

typedef struct {
  bool docsOnly;

  // How many docs left
  int docsLeft;

  // Where (mapped in RAM) we decode docs/freqs from:
  unsigned char* docFreqs;

  // Current doc/freq block:
  unsigned int *docDeltas;
  unsigned int *freqs;
  int nextDocID;
  int docFreqBlockLastRead;
  int docFreqBlockEnd;

  // Where (mapped in RAM) we decode positions from:
  unsigned char *pos;

  // How many positions left
  long posLeft;

  // Current block of position deltas:
  unsigned int *posDeltas;
  int posBlockLastRead;
  int posBlockEnd;
  //int nextPos;
  long posUpto;

  bool indexHasPayloads;
  bool indexHasOffsets;

  // Used only by ExactPhraseQuery
  unsigned long tfSum;
  unsigned long *tfSums;
  unsigned int *tfs;
  int posLeftInDoc;
  int nextPos;

  int id;
} PostingsState;

// exported from common.cpp:
void nextDocFreqBlock(PostingsState* sub);
void nextPosBlock(PostingsState* sub);
void skipPositions(PostingsState *sub, long posCount);

void downHeapNoScores(int heapSize, int *topDocIDs);
void downHeap(int heapSize, int *topDocIDs, float *topScores);

int booleanQueryOnlyShould(PostingsState* subs,
                           unsigned char *liveDocsBytes,
                           double **termScoreCache,
                           float *termWeights,
                           int maxDoc,
                           int topN,
                           int numScorers,
                           int docBase,
                           unsigned int *filled,
                           int *docIDs,
                           float *scores,
                           unsigned int *coords,
                           float *topScores,
                           int *topDocIDs,
                           float *coordFactors,
                           float *normTable,
                           unsigned char *norms,
                           PostingsState *dsSubs,
                           unsigned int *dsCounts,
                           unsigned int *dsMissingDims,
                           unsigned int dsNumDims,
                           unsigned int *dsTotalHits,
                           unsigned int *dsTermsPerDim,
                           unsigned long *dsHitBits,
                           unsigned long **dsNearMissBits);

int booleanQueryShouldMustNot(PostingsState* subs,
                              unsigned char *liveDocsBytes,
                              double **termScoreCache,
                              float *termWeights,
                              int maxDoc,
                              int topN,
                              int numScorers,
                              int docBase,
                              int numMustNot,
                              unsigned int *filled,
                              int *docIDs,
                              float *scores,
                              unsigned int *coords,
                              float *topScores,
                              int *topDocIDs,
                              float *coordFactors,
                              float *normTable,
                              unsigned char *norms,
                              unsigned char *skips,
                              PostingsState *dsSubs,
                              unsigned int *dsCounts,
                              unsigned int *dsMissingDims,
                              unsigned int dsNumDims,
                              unsigned int *dsTotalHits,
                              unsigned int *dsTermsPerDim,
                              unsigned long *dsHitBits,
                              unsigned long **dsNearMissBits);

int booleanQueryShouldMust(PostingsState* subs,
                           unsigned char *liveDocsBytes,
                           double **termScoreCache,
                           float *termWeights,
                           int maxDoc,
                           int topN,
                           int numScorers,
                           int docBase,
                           int numMust,
                           unsigned int *filled,
                           int *docIDs,
                           float *scores,
                           unsigned int *coords,
                           float *topScores,
                           int *topDocIDs,
                           float *coordFactors,
                           float *normTable,
                           unsigned char *norms,
                           PostingsState *dsSubs,
                           unsigned int *dsCounts,
                           unsigned int *dsMissingDims,
                           unsigned int dsNumDims,
                           unsigned int *dsTotalHits,
                           unsigned int *dsTermsPerDim,
                           unsigned long *dsHitBits,
                           unsigned long **dsNearMissBits);

int booleanQueryShouldMustMustNot(PostingsState* subs,
                                  unsigned char *liveDocsBytes,
                                  double **termScoreCache,
                                  float *termWeights,
                                  int maxDoc,
                                  int topN,
                                  int numScorers,
                                  int docBase,
                                  int numMust,
                                  int numMustNot,
                                  unsigned int *filled,
                                  int *docIDs,
                                  float *scores,
                                  unsigned int *coords,
                                  float *topScores,
                                  int *topDocIDs,
                                  float *coordFactors,
                                  float *normTable,
                                  unsigned char *norms,
                                  PostingsState *dsSubs,
                                  unsigned int *dsCounts,
                                  unsigned int *dsMissingDims,
                                  unsigned int dsNumDims,
                                  unsigned int *dsTotalHits,
                                  unsigned int *dsTermsPerDim,
                                  unsigned long *dsHitBits,
                                  unsigned long **dsNearMissBits);

int phraseQuery(PostingsState* subs,
                unsigned char *liveDocsBytes,
                double *termScoreCache,
                float termWeight,
                int maxDoc,
                int topN,
                int numScorers,
                int docBase,
                unsigned int *filled,
                int *docIDs,
                unsigned int *coords,
                float *topScores,
                int *topDocIDs,
                float *normTable,
                unsigned char *norms,
                int *posOffsets);

unsigned int drillSidewaysCollect(unsigned int topN,
                                  unsigned int docBase,
                                  int *topDocIDs,
                                  float *topScores,
                                  float *normTable,
                                  unsigned char *norms,
                                  float *coordFactors,
                                  unsigned int *coords,
                                  unsigned int *filled,
                                  int numFilled,
                                  int *docIDs,
                                  float *scores,
                                  unsigned int *counts,
                                  unsigned int *missingDims,
                                  unsigned int docUpto,
                                  PostingsState *subs,
                                  int numDims,
                                  unsigned int *termsPerDim,
                                  unsigned int *totalHits,
                                  unsigned long *hitBits,
                                  unsigned long **nearMissBits);

bool isSet(unsigned char *bits, unsigned int docID);
void setLongBit(unsigned long *bits, unsigned int docID);

// FixedBitSet.nextSetBit:
int nextSetBit(unsigned long *bits, int index);

void countFacets(unsigned long *bits, unsigned int maxDoc, unsigned int *facetCounts, unsigned long *docToAddress, unsigned char *facetBytes);

//#define DEBUG

#ifndef DEBUG
// nocommit put back
//#define printf NO
//#define fflush NO
#endif

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Interface com.intel.hadoop.graphbuilder.graph.Graph
</TITLE>

<META NAME="date" CONTENT="2012-11-08">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
com.intel.hadoop.graphbuilder.graph.Graph

Packages that use Graph

com.intel.hadoop.graphbuilder.graph

com.intel.hadoop.graphbuilder.graph.glgraph

com.intel.hadoop.graphbuilder.graph.simplegraph

Uses of Graph in com.intel.hadoop.graphbuilder.graph

Methods in com.intel.hadoop.graphbuilder.graph with parameters of type Graph

 java.io.StringWriter
EdgeFormatter.edataWriter(Graph g)

 java.io.StringWriter
EdgeFormatter.structWriter(Graph g)

 void
GraphOutput.write(Graph g,
      EdgeFormatter formatter,
      org.apache.hadoop.mapred.OutputCollector out,
      org.apache.hadoop.mapred.Reporter reporter)

          Write out the graph to the OutputCollector.

 void
GraphOutput.writeAndClear(Graph g,
              EdgeFormatter formatter,
              org.apache.hadoop.mapred.OutputCollector out,
              org.apache.hadoop.mapred.Reporter reporter)

          Write out the graph and clearing the fields written to free up memory.

Uses of Graph in com.intel.hadoop.graphbuilder.graph.glgraph

Classes in com.intel.hadoop.graphbuilder.graph.glgraph that implement Graph

 class
GLGraph<VidType,VertexData,EdgeData>

          This is equivalent to GraphLab2 distributed graph ://code.google.com
 /p/graphlabapi/source/browse/src/graphlab/graph/distributed_graph.hpp.

Methods in com.intel.hadoop.graphbuilder.graph.glgraph with parameters of type Graph

 java.io.StringWriter
GLJsonFormatter.edataWriter(Graph g)

 java.io.StringWriter
GLJsonFormatter.structWriter(Graph graph)

 void
GLGraphOutput.write(Graph g,
      EdgeFormatter formatter,
      org.apache.hadoop.mapred.OutputCollector out,
      org.apache.hadoop.mapred.Reporter reporter)

 void
GLGraphOutput.writeAndClear(Graph g,
              EdgeFormatter formatter,
              org.apache.hadoop.mapred.OutputCollector out,
              org.apache.hadoop.mapred.Reporter reporter)

Uses of Graph in com.intel.hadoop.graphbuilder.graph.simplegraph

Classes in com.intel.hadoop.graphbuilder.graph.simplegraph that implement Graph

 class
SimpleGraph<VidType,VertexData,EdgeData>

          This is a pre-finalized but post-partitioned adjacency format for GraphLab2.

 class
SimpleSubGraph<VidType,VertexData,EdgeData>

          Represents a subpartition within a normal partition.

Methods in com.intel.hadoop.graphbuilder.graph.simplegraph with parameters of type Graph

 java.io.StringWriter
SimpleJsonFormatter.edataWriter(Graph g)

 java.io.StringWriter
SimpleJsonFormatter.structWriter(Graph g)

 void
SimpleGraphOutput.write(Graph g,
      EdgeFormatter formatter,
      org.apache.hadoop.mapred.OutputCollector out,
      org.apache.hadoop.mapred.Reporter reporter)

 void
SimpleGraphOutput.writeAndClear(Graph g,
              EdgeFormatter formatter,
              org.apache.hadoop.mapred.OutputCollector out,
              org.apache.hadoop.mapred.Reporter reporter)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
Shiva client
============

The `Shiva-Client <https://github.com/tooxie/shiva-client>`_ is a web-based
front-end for Shiva-Server built as a single page application using HTML5
technologies. It includes its own test web server so you don't need to install
one.

Wish you were here
------------------

Or you can also build your own client and put your own ideas into practice. I
encourage you to do so. Build your own music player that meets your exact
needs.

Feel free to `issue a PR <https://github.com/tooxie/shiva-server/pulls>`_ if
you need new functionality in Shiva.


text:
import sublime

_settings_file = "GitConflictResolver.sublime-settings"
_subl_settings = {}
_default_settings = {
    "live_matching": True,
    "matching_scope": 'invalid',
    "fill_conflict_area": False,
    "outline_conflict_area": True,
    "ours_gutter": True,
    "ancestor_gutter": True,
    "theirs_gutter": True,
    "git_path": "git",
    "show_only_filenames": True
}

def load():
    global _subl_settings

    _subl_settings = sublime.load_settings(_settings_file)

def get(key):
    return _subl_settings.get(key, _default_settings[key])


text:
#import <iLifeSlideshow/MREffect.h>

@interface MREffectPList : MREffect
{
}

@end


text:
<?php

class Google_Service_DatabaseMigrationService_SshScript extends Google_Model
{
  public $script;

  public function setScript($script)
  {
    $this->script = $script;
  }
  public function getScript()
  {
    return $this->script;
  }
}


text:
using System;
using System.Collections.Generic;
using EasyNetQ.Consumer;
using RabbitMQ.Client.Exceptions;

namespace EasyNetQ.Hosepipe
{
    public interface IQueueRetrieval
    {
        IEnumerable<HosepipeMessage> GetMessagesFromQueue(QueueParameters parameters);
    }

    public class QueueRetrieval : IQueueRetrieval
    {
        private readonly IErrorMessageSerializer errorMessageSerializer;

        public QueueRetrieval(IErrorMessageSerializer errorMessageSerializer)
        {
            this.errorMessageSerializer = errorMessageSerializer;
        }

        public IEnumerable<HosepipeMessage> GetMessagesFromQueue(QueueParameters parameters)
        {
            using var connection = HosepipeConnection.FromParameters(parameters);
            using var channel = connection.CreateModel();

            try
            {
                channel.QueueDeclarePassive(parameters.QueueName);
            }
            catch (OperationInterruptedException exception)
            {
                Console.WriteLine(exception.Message);
                yield break;
            }

            var count = 0;
            while (count++ < parameters.NumberOfMessagesToRetrieve)
            {
                var basicGetResult = channel.BasicGet(parameters.QueueName, parameters.Purge);
                if (basicGetResult == null) break; // no more messages on the queue

                var properties = new MessageProperties(basicGetResult.BasicProperties);
                var info = new MessageReceivedInfo(
                    "hosepipe",
                    basicGetResult.DeliveryTag,
                    basicGetResult.Redelivered,
                    basicGetResult.Exchange,
                    basicGetResult.RoutingKey,
                    parameters.QueueName
                );

                yield return new HosepipeMessage(errorMessageSerializer.Serialize(basicGetResult.Body.ToArray()), properties, info);
            }
        }
    }
}


text:
<?php

final class PhabricatorCacheEngine extends Phobject {

  public function getViewer() {
    return PhabricatorUser::getOmnipotentUser();
  }

  public function updateObject($object) {
    $objects = array(
      $object->getPHID() => $object,
    );

    $new_objects = $objects;
    while (true) {
      $discovered_objects = array();
      $load = array();

      $extensions = PhabricatorCacheEngineExtension::getAllExtensions();
      foreach ($extensions as $key => $extension) {
        $discoveries = $extension->discoverLinkedObjects($this, $new_objects);
        if (!is_array($discoveries)) {
          throw new Exception(
            pht(
              'Cache engine extension "%s" did not return a list of linked '.
              'objects.',
              get_class($extension)));
        }

        foreach ($discoveries as $discovery) {
          if ($discovery === null) {
            // This is allowed because it makes writing extensions a lot
            // easier if they don't have to check that related PHIDs are
            // actually set to something.
            continue;
          }

          $is_phid = is_string($discovery);
          if ($is_phid) {
            $phid = $discovery;
          } else {
            $phid = $discovery->getPHID();
            if (!$phid) {
              throw new Exception(
                pht(
                  'Cache engine extension "%s" returned object (of class '.
                  '"%s") with no PHID.',
                  get_class($extension),
                  get_class($discovery)));
            }
          }

          if (isset($objects[$phid])) {
            continue;
          }

          if ($is_phid) {
            $load[$phid] = $phid;
          } else {
            $objects[$phid] = $discovery;
            $discovered_objects[$phid] = $discovery;

            // If another extension only knew about the PHID of this object,
            // we don't need to load it any more.
            unset($load[$phid]);
          }
        }
      }

      if ($load) {
        $load_objects = id(new PhabricatorObjectQuery())
          ->setViewer($this->getViewer())
          ->withPHIDs($load)
          ->execute();
        foreach ($load_objects as $phid => $loaded_object) {
          $objects[$phid] = $loaded_object;
          $discovered_objects[$phid] = $loaded_object;
        }
      }

      // If we didn't find anything new to update, we're all set.
      if (!$discovered_objects) {
        break;
      }

      $new_objects = $discovered_objects;
    }

    foreach ($extensions as $extension) {
      $extension->deleteCaches($this, $objects);
    }
  }

}


text:
#ifndef _KDS_H_
#define _KDS_H_

#include "mmbuf.h"
#include "rtrie.h"
#include "dpref.h"
#include "ttrie.h"
#include "cpref.h"

#define STATE_RAW 0
#define STATE_DIRTY 1
#define STATE_CONVERTED 2

#define KDS_MAPPING_UNKNOWN 0
#define KDS_MAPPING_1_TO_1 2
#define KDS_MAPPING_1_TO_MANY 4

#define KDS_META_SUFFIX ".meta"
#define KDS_DPREF_SUFFIX ".dpref"
#define KDS_CPREF_SUFFIX ".cpref"
#define KDS_TTRIE_SUFFIX ".ttrie"
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Plan of attack.
// Do stage one first......................................... DONE
// Stage two ttrie.  We need iter method for this............. DONE
// Need to perist global meta data............................
//     fieldname, Number of keys, total number of messages. one_to_one, one_to_many.
// Stage 3, cref needs an interface put infront of it.........
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////

struct keyds
{
    char state;

    // These are stored in .meta
    char mode;
    char mapping_type;
    unsigned long long total_messages;               // These are duplicated with what is stored below. Is this needed? remove
    unsigned long long num_keys;                     // These are duplicated with what is stored below. Is this needed? remove

    // These are calculated at run time.
    char *field_name;
    char *folder_path;
    char *meta_file_path;
    char *dpref_file_path;
    char *cpref_file_path;
    char *ttrie_file_path;

    // WRITE: Stage one.
    struct rtrie__view rtrie;
    struct dpref__obj dref;
    struct dpref__buffer *buffers;  //pointer to array of buffers.
    unsigned int last_i;            // Last_i used in buffers

    // WRITE: Stage two.
    // READ:
    struct mmbuf__obj *meta_file;
    struct ttrie__obj ttrie;
    struct cpref__obj cref;
};

/**
 * General methods
**/
int kds__open(struct keyds *kds, char *folder_path, char *fieldname, char mode);
int kds__close(struct keyds *kds);

/* WRITTING
   A field_name coresponds to an rtrie and a dpref. e.g. wSrcTime
   Each field_value corresponds to an int. e.g. 12:00:12.123 : 12
   each int coreresponds to a element in an array of dpref buffers 12 : <dpref_buffer: msg_refs 1, 8, 13>

   On pulp__optimize
   for each field rtrie convert it into ttrie
       iterate each element of the ttrie.
           convert the dpref to something like cpref. depending on one to one, percentage of population etc.
           Convert the index to a initial offset kinda value.
       persist the ttrie.
 */

/**
 *  Write methods
**/
int kds__append(struct keyds *kds, void *value, int val_len, unsigned long long msg_num);
int kds__optimize_write(struct keyds *kds);

/* READING

   BLAH
 */

/**
 *  Read methods
**/
unsigned long long kds__len(struct keyds *k);                // This should be a passthrough to rtrie in w mode, in read mode can just return this. OR should we just pass through as well?
unsigned long long kds__total_refs(struct keyds *k);         // This should be a passthrough to dref in w mode. in read mode can just return the value. OR shold we just pass through as well?
int kds__get_key_i(struct keyds *k, unsigned long long i, void *key, int*key_len);
int kds__contains(struct keyds *k, void *key, int key_len);

struct query_context
{
    signed int refs_type;
    void *self;                                                      //<--- arbitrary data probably cpref
    struct keyds *kds_data;
    signed long long (*len)(struct query_context*);
    signed long long (*geti)(struct query_context*, signed long long);
    signed long long (*next)(struct query_context*);
    signed long long (*prev)(struct query_context*);
    signed long long (*ge)(struct query_context*, signed long long);
    signed long long (*le)(struct query_context*, signed long long);
};

void kds__setup_query(struct query_context *q, struct keyds *k);
int kds__lookup(struct query_context *q, char *key, int n);

// Once we have looked up a key, we can use the query context and call its methods.
/*
q->len(q)
q->geti(q, i)
q->next(q)
q->prev(q)
q->ge(q, ref)
q->le(q, ref)
*/

void kds__teardown_query(struct query_context *q);

#endif


text:
require 'spec_helper'

describe Lou::QueryStringParser do
  context "with with kitchen sink (virtual attributes, filter, orders, and limit)" do
    let(:query_string) { "filter=last_name:eq=\"Juan de Marco\"+category_id:in=1,2,3+company_id:eq=77+employee_id:in=4,5&limit=10&order=id:desc" }
    let(:search) { described_class.new(query_string, options) }
    let(:options) {{
      virtual_attributes: {
        company_id: { joins: :employees },
        employee_id: { joins: :employees }
      }
    }}

    it "has a limit of 10" do
      search.limit.should be 10
    end

    it "has an order_by of id" do
      search.order_by.should eq :id
    end

    it "has an order_direction of desc" do
      search.order_direction.should eq :desc
    end

    it "has the correct selectors" do
      search.selectors.size.should eq 2
      search.selectors[:last_name].should eq({ operator: :eq, value: 'Juan de Marco' })
      search.selectors[:category_id].should eq ({ operator: :in, value: ['1', '2', '3'] })
    end

    it "has the correct joins" do
      search.joins.size.should eq 1
      search.joins[:employees].should =~ [
        { attribute: :company_id, operator: :eq, value: '77' },
        { attribute: :employee_id, operator: :in, value: ['4', '5'] }]
    end
  end

  context "with with virtual attributes in the options" do
    let(:search) { described_class.new(query_string, options) }
    let(:options) {{
      virtual_attributes: {
        company_id: { joins: :employees },
        employee_id: { joins: :employees }
      }
    }}

    context "with virtual attributes in the query string" do
      let(:query_string) { "filter=last_name:eq=\"Juan de Marco\"+company_id:eq=77+employee_id:in=4,5" }

      it "has the correct joins" do
        search.joins.size.should eq 1
        search.joins[:employees].should =~ [
          { attribute: :company_id, operator: :eq, value: '77' },
          { attribute: :employee_id, operator: :in, value: ['4', '5'] }]
      end
    end

    context "with no virtual attributes in the query string" do
      let(:query_string) { "filter=last_name:eq=\"Juan de Marco\"" }

      it "has the correct joins" do
        search.joins.size.should eq 0
      end
    end
  end

  context "with nil query string" do
    let(:query_string) { nil }
    let(:search) { described_class.new(query_string) }

    it "has a limit of nil" do
      search.limit.should be nil
    end

    it "has an order_by of nil" do
      search.order_by.should eq nil
    end

    it "has an order_direction of nil" do
      search.order_direction.should eq nil
    end

    it "has no selectors" do
      search.selectors.should eq({})
    end
  end

  context "with an empty query string" do
    let(:query_string) { "" }
    let(:search) { described_class.new(query_string) }

    it "has a limit of nil" do
      search.limit.should be nil
    end

    it "has an order_by of nil" do
      search.order_by.should eq nil
    end

    it "has an order_direction of nil" do
      search.order_direction.should eq nil
    end

    it "has no selectors" do
      search.selectors.should eq({})
    end
  end
end


text:
package com.all.action;

public interface ActionHandler<T extends ActionObject> {
	void handle(T arg);
}


text:
package mslogic;

/**
 * @author othscs120 Created on: 11/5/2014 , Time is : 1:06 PM Part of Project:
 * MineSweeper
 */
public class MS_Square {

    public static final int SHOWN = 0, UP = 1, FLAG = 2, QUESTION = 3;

    private boolean mine; //if the square is a mine.

    private int state, number;

    public MS_Square() {
        mine = false;
        number = 0;
        state = UP;
    }

    public boolean isMine() {
        return mine;
    }

    @SuppressWarnings("SameParameterValue")
    public void setMine(boolean mine) {
        this.mine = mine;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int count) {
        this.number = count;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
}