text:
package sarama

import (
	"net"
	"strconv"
)

// ConsumerMetadataResponse holds the response for a consumer group meta data requests
type ConsumerMetadataResponse struct {
	Err             KError
	Coordinator     *Broker
	CoordinatorID   int32  // deprecated: use Coordinator.ID()
	CoordinatorHost string // deprecated: use Coordinator.Addr()
	CoordinatorPort int32  // deprecated: use Coordinator.Addr()
}

func (r *ConsumerMetadataResponse) decode(pd packetDecoder, version int16) (err error) {
	tmp := new(FindCoordinatorResponse)

	if err := tmp.decode(pd, version); err != nil {
		return err
	}

	r.Err = tmp.Err

	r.Coordinator = tmp.Coordinator
	if tmp.Coordinator == nil {
		return nil
	}

	// this can all go away in 2.0, but we have to fill in deprecated fields to maintain
	// backwards compatibility
	host, portstr, err := net.SplitHostPort(r.Coordinator.Addr())
	if err != nil {
		return err
	}
	port, err := strconv.ParseInt(portstr, 10, 32)
	if err != nil {
		return err
	}
	r.CoordinatorID = r.Coordinator.ID()
	r.CoordinatorHost = host
	r.CoordinatorPort = int32(port)

	return nil
}

func (r *ConsumerMetadataResponse) encode(pe packetEncoder) error {
	if r.Coordinator == nil {
		r.Coordinator = new(Broker)
		r.Coordinator.id = r.CoordinatorID
		r.Coordinator.addr = net.JoinHostPort(r.CoordinatorHost, strconv.Itoa(int(r.CoordinatorPort)))
	}

	tmp := &FindCoordinatorResponse{
		Version:     0,
		Err:         r.Err,
		Coordinator: r.Coordinator,
	}

	if err := tmp.encode(pe); err != nil {
		return err
	}

	return nil
}

func (r *ConsumerMetadataResponse) key() int16 {
	return 10
}

func (r *ConsumerMetadataResponse) version() int16 {
	return 0
}

func (r *ConsumerMetadataResponse) headerVersion() int16 {
	return 0
}

func (r *ConsumerMetadataResponse) requiredVersion() KafkaVersion {
	return V0_8_2_0
}

redpajama_set_name: RedPajamaGithub


text:
steal("./steal-style.css!", function(){
	return {};
});


text:
<?php

/* TroiswaBlogBundle:Block:admineditarticle.html.twig */
class __TwigTemplate_818c518ef3405fe7d0cdb7b629b93bea1bac01384455bc63d562719594c41df5 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("TroiswaBlogBundle::layout.html.twig");

        $this->blocks = array(
            'content' => array($this, 'block_content'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "TroiswaBlogBundle::layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_content($context, array $blocks = array())
    {
        // line 4
        echo "

Edit an Article

        ";
        // line 8
        echo         $this->env->getExtension('form')->renderer->renderBlock((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), 'form_start', array("method" => "POST", "role" => "form"));
        echo "

            ";
        // line 11
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "author"), 'label');
        echo "
            ";
        // line 12
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "author"), 'widget', array("id" => "author", "attr" => array("placeholder" => "Author", "class" => "form-control")));
        echo "
            ";
        // line 13
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "author"), 'errors');
        echo "

            ";
        // line 17
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "title"), 'label');
        echo "
            ";
        // line 18
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "title"), 'widget', array("id" => "author", "attr" => array("placeholder" => "Title", "class" => "form-control")));
        echo "
            ";
        // line 19
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "title"), 'errors');
        echo "

            ";
        // line 23
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "content"), 'label');
        echo "
            ";
        // line 24
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "content"), 'widget', array("id" => "content", "attr" => array("placeholder" => "Content", "class" => "form-control")));
        echo "
            ";
        // line 25
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "content"), 'errors');
        echo "

            ";
        // line 29
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "category"), 'label', array("label" => "Category"));
        echo "
            ";
        // line 30
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "category"), 'widget', array("attr" => array("class" => "category")));
        echo "
            ";
        // line 31
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "category"), 'errors');
        echo "

            ";
        // line 35
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "cover"), 'label', array("label" => "Popularity"));
        echo "
            ";
        // line 36
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "cover"), 'widget', array("attr" => array("class" => "cover")));
        echo "
            ";
        // line 37
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "cover"), 'errors');
        echo "

            ";
        // line 41
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), "submit"), 'widget', array("attr" => array("class" => "btn btn-primary")));
        echo "
            ";
        // line 42
        echo         $this->env->getExtension('form')->renderer->renderBlock((isset($context["formArt"]) ? $context["formArt"] : $this->getContext($context, "formArt")), 'form_end');
        echo "

    ";
        // line 47
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : $this->getContext($context, "app")), "session"), "flashbag"), "get", array(0 => "notice"), "method"));
        foreach ($context['_seq'] as $context["_key"] => $context["flash"]) {
            // line 48
            echo "
";
            echo twig_escape_filter($this->env, (isset($context["flash"]) ? $context["flash"] : $this->getContext($context, "flash")), "html", null, true);
            echo "

    ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['flash'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 50
        echo "

";
        // line 53
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["article"]) ? $context["article"] : $this->getContext($context, "article")), "title"), "html", null, true);
        echo "
        Posted on ";
        // line 54
        echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute((isset($context["article"]) ? $context["article"] : $this->getContext($context, "article")), "dateCreation"), "Y-m-d"), "html", null, true);
        echo " by ";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["article"]) ? $context["article"] : $this->getContext($context, "article")), "author"), "html", null, true);
        echo "

";
        // line 56
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["article"]) ? $context["article"] : $this->getContext($context, "article")), "content"), "html", null, true);
        echo "

";
    }

    public function getTemplateName()
    {
        return "TroiswaBlogBundle:Block:admineditarticle.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  159 => 56,  152 => 54,  148 => 53,  143 => 50,  134 => 48,  130 => 47,  122 => 42,  118 => 41,  111 => 37,  107 => 36,  103 => 35,  96 => 31,  92 => 30,  88 => 29,  81 => 25,  77 => 24,  73 => 23,  66 => 19,  62 => 18,  58 => 17,  51 => 13,  47 => 12,  43 => 11,  37 => 8,  31 => 4,  28 => 3,);
    }
}


text:
package org.forpdi.core.company;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;

import org.forpdi.core.event.Current;

/**
 *
 * @author Renato R. R. de Oliveira
 *
 */
@RequestScoped
public class CurrentDomainProducer {

	@Inject private CompanyBS bs;
	private CompanyDomain domain;

	@Produces
	@Current
	public CompanyDomain getInstance() {
		if (domain == null) {
			domain = bs.currentDomain();
		}
		return domain;
	}
}


text:
var player, tech, el;

module('HTML5', {
  'setup': function() {

    el = document.createElement('div');
    el.innerHTML = '<div />';

    player = {
      id: function(){ return 'id'; },
      el: function(){ return el; },
      options_: {},
      options: function(){ return {}; },
      controls: function(){ return false; },
      usingNativeControls: function(){ return false; },
      on: function(){ return this; },
      off: function() { return this; },
      ready: function(){}
    };
    tech = new vjs.Html5(player, {});
  },
  'teardown': function() {
    tech.dispose();
    el = null;
    player = null;
    tech = null;
  }
});

test('should detect whether the volume can be changed', function(){
  var testVid, ConstVolumeVideo;
  if (!{}['__defineSetter__']) {
    ok(true, 'your browser does not support this test, skipping it');
    return;
  }
  testVid = vjs.TEST_VID;
  ConstVolumeVideo = function(){
    this.volume = 1;
    this.__defineSetter__('volume', function(){});
  };
  vjs.TEST_VID = new ConstVolumeVideo();

  ok(!vjs.Html5.canControlVolume());
  vjs.TEST_VID = testVid;
});

test('should re-link the player if the tech is moved', function(){
  vjs.Html5.movingMediaElementInDOM = false;
  tech.createEl();

  strictEqual(player, tech.el()['player']);
});

test('test playbackRate', function() {
  var playbackRate;

  tech.createEl();

  tech.el().playbackRate = 1.25;
  strictEqual(tech.playbackRate(), 1.25);

  tech['setPlaybackRate'](0.75);
  strictEqual(tech.playbackRate(), 0.75);
});

test('patchCanPlayType patches canplaytype with our function, conditionally', function() {
  // the patch runs automatically so we need to first unpatch
  vjs.Html5.unpatchCanPlayType();

  var oldAV = vjs.ANDROID_VERSION,
      video = document.createElement('video'),
      canPlayType = vjs.TEST_VID.constructor.prototype.canPlayType,
      patchedCanPlayType,
      unpatchedCanPlayType;

  vjs.ANDROID_VERSION = 4.0;
  vjs.Html5.patchCanPlayType();

  notStrictEqual(video.canPlayType, canPlayType, 'original canPlayType and patched canPlayType should not be equal');

  patchedCanPlayType = video.canPlayType;
  unpatchedCanPlayType = vjs.Html5.unpatchCanPlayType();

  strictEqual(canPlayType, vjs.TEST_VID.constructor.prototype.canPlayType, 'original canPlayType and unpatched canPlayType should be equal');
  strictEqual(patchedCanPlayType, unpatchedCanPlayType, 'patched canPlayType and function returned from unpatch are equal');

  vjs.ANDROID_VERSION = oldAV;
  vjs.Html5.unpatchCanPlayType();
});

test('should return maybe for HLS urls on Android 4.0 or above', function() {
  var oldAV = vjs.ANDROID_VERSION,
      video = document.createElement('video');

  vjs.ANDROID_VERSION = 4.0;
  vjs.Html5.patchCanPlayType();

  strictEqual(video.canPlayType('application/x-mpegurl'), 'maybe', 'android version 4.0 or above should be a maybe for x-mpegurl');
  strictEqual(video.canPlayType('application/x-mpegURL'), 'maybe', 'android version 4.0 or above should be a maybe for x-mpegURL');
  strictEqual(video.canPlayType('application/vnd.apple.mpegurl'), 'maybe', 'android version 4.0 or above should be a maybe for vnd.apple.mpegurl');
  strictEqual(video.canPlayType('application/vnd.apple.mpegURL'), 'maybe', 'android version 4.0 or above should be a maybe for vnd.apple.mpegurl');

  vjs.ANDROID_VERSION = oldAV;
  vjs.Html5.unpatchCanPlayType();
});

test('should return a maybe for mp4 on OLD ANDROID', function() {
  var isOldAndroid = vjs.IS_OLD_ANDROID,
      video = document.createElement('video');

  vjs.IS_OLD_ANDROID = true;
  vjs.Html5.patchCanPlayType();

  strictEqual(video.canPlayType('video/mp4'), 'maybe', 'old android should return a maybe for video/mp4');

  vjs.IS_OLD_ANDROID = isOldAndroid;
  vjs.Html5.unpatchCanPlayType();
});


text:
package org.drools.planner.core.heuristic.selector.move.generic.chained;

import java.util.Iterator;

import org.drools.planner.core.heuristic.selector.common.iterator.UpcomingSelectionIterator;
import org.drools.planner.core.heuristic.selector.move.generic.GenericMoveSelector;
import org.drools.planner.core.heuristic.selector.value.iterator.ValueIterator;
import org.drools.planner.core.heuristic.selector.value.ValueSelector;
import org.drools.planner.core.heuristic.selector.value.chained.SubChain;
import org.drools.planner.core.heuristic.selector.value.chained.SubChainSelector;
import org.drools.planner.core.move.Move;

public class SubChainChangeMoveSelector extends GenericMoveSelector {

    protected final SubChainSelector subChainSelector;
    protected final ValueSelector valueSelector;
    protected final boolean randomSelection;
    protected final boolean selectReversingMoveToo;

    public SubChainChangeMoveSelector(SubChainSelector subChainSelector, ValueSelector valueSelector,
            boolean randomSelection, boolean selectReversingMoveToo) {
        this.subChainSelector = subChainSelector;
        this.valueSelector = valueSelector;
        this.randomSelection = randomSelection;
        this.selectReversingMoveToo = selectReversingMoveToo;
        if (subChainSelector.getVariableDescriptor() != valueSelector.getVariableDescriptor()) {
            throw new IllegalStateException("The selector (" + this
                    + ") has a subChainSelector (" + subChainSelector
                    + ") with variableDescriptor (" + subChainSelector.getVariableDescriptor()
                    + ") which is not the same as the valueSelector (" + valueSelector
                    +")'s variableDescriptor(" + valueSelector.getVariableDescriptor() + ").");
        }
        if (!randomSelection) {
            if (subChainSelector.isNeverEnding()) {
                throw new IllegalStateException("The selector (" + this
                        + ") has a subChainSelector (" + subChainSelector
                        + ") with neverEnding (" + subChainSelector.isNeverEnding() + ").");
            }
            if (valueSelector.isNeverEnding()) {
                throw new IllegalStateException("The selector (" + this
                        + ") has a valueSelector (" + valueSelector
                        + ") with neverEnding (" + valueSelector.isNeverEnding() + ").");
            }
        }
        solverPhaseLifecycleSupport.addEventListener(subChainSelector);
        solverPhaseLifecycleSupport.addEventListener(valueSelector);
    }

    // ************************************************************************
    // Worker methods
    // ************************************************************************

    public boolean isContinuous() {
        return subChainSelector.isContinuous() || valueSelector.isContinuous();
    }

    public boolean isNeverEnding() {
        return randomSelection;
    }

    public long getSize() {
        return subChainSelector.getSize() * valueSelector.getSize();
    }

    public Iterator<Move> iterator() {
        if (!randomSelection) {
            return new OriginalSubChainChangeMoveIterator();
        } else {
            return new RandomSubChainChangeMoveIterator();
        }
    }

    private class OriginalSubChainChangeMoveIterator extends UpcomingSelectionIterator<Move> {

        private Iterator<SubChain> subChainIterator;
        private ValueIterator valueIterator;

        private SubChain upcomingSubChain;

        private Move nextReversingSelection = null;

        private OriginalSubChainChangeMoveIterator() {
            subChainIterator = subChainSelector.iterator();
            valueIterator = valueSelector.iterator();
            // valueIterator.hasNext() returns true if there is a next for any entity parameter
            if (!subChainIterator.hasNext() || !valueIterator.hasNext()) {
                upcomingSelection = null;
            } else {
                upcomingSubChain = subChainIterator.next();
                createUpcomingSelection();
            }
        }

        protected void createUpcomingSelection() {
            if (selectReversingMoveToo && nextReversingSelection != null) {
                upcomingSelection = nextReversingSelection;
                nextReversingSelection = null;
                return;
            }
            while (!valueIterator.hasNext(upcomingSubChain.getFirstEntity())) {
                if (!subChainIterator.hasNext()) {
                    upcomingSelection = null;
                    return;
                }
                upcomingSubChain = subChainIterator.next();
                valueIterator = valueSelector.iterator();
            }
            Object toValue = valueIterator.next(upcomingSubChain);
            upcomingSelection = new SubChainChangeMove(upcomingSubChain, valueSelector.getVariableDescriptor(), toValue);
            if (selectReversingMoveToo) {
                nextReversingSelection = new SubChainReversingChangeMove(
                        upcomingSubChain, valueSelector.getVariableDescriptor(), toValue);
            }
        }

    }

    private class RandomSubChainChangeMoveIterator extends UpcomingSelectionIterator<Move> {

        private Iterator<SubChain> subChainIterator;
        private ValueIterator valueIterator;

        private RandomSubChainChangeMoveIterator() {
            subChainIterator = subChainSelector.iterator();
            valueIterator = valueSelector.iterator();
            // valueIterator.hasNext() returns true if there is a next for any subChain parameter
            if (!subChainIterator.hasNext() || !valueIterator.hasNext()) {
                upcomingSelection = null;
            } else {
                createUpcomingSelection();
            }
        }

        protected void createUpcomingSelection() {
            // Ideally, this code should have read:
            //     SubChain subChain = subChainIterator.next();
            //     Object toValue = valueIterator.next(subChain);
            // But empty selectors and ending selectors (such as non-random or shuffled) make it more complex
            if (!subChainIterator.hasNext()) {
                subChainIterator = subChainSelector.iterator();
            }
            SubChain subChain = subChainIterator.next();
            int subChainIteratorCreationCount = 0;
            // This loop is mostly only relevant when the subChainIterator or valueIterator is non-random or shuffled
            while (!valueIterator.hasNext(subChain)) {
                // First try to reset the valueIterator to get a next value
                valueIterator = valueSelector.iterator();
                // If that's not sufficient (that subChain has an empty value list), then use the next subChain
                if (!valueIterator.hasNext(subChain)) {
                    if (!subChainIterator.hasNext()) {
                        subChainIterator = subChainSelector.iterator();
                        subChainIteratorCreationCount++;
                        if (subChainIteratorCreationCount >= 2) {
                            // All subChain-value combinations have been tried (some even more than once)
                            upcomingSelection = null;
                            return;
                        }
                    }
                    subChain = subChainIterator.next();
                }
            }
            Object toValue = valueIterator.next(subChain);
            boolean reversing = selectReversingMoveToo ? workingRandom.nextBoolean() : false;
            upcomingSelection = reversing
                    ? new SubChainReversingChangeMove(subChain, valueSelector.getVariableDescriptor(), toValue)
                    : new SubChainChangeMove(subChain, valueSelector.getVariableDescriptor(), toValue);
        }

    }

    @Override
    public String toString() {
        return getClass().getSimpleName() + "(" + subChainSelector + ", " + valueSelector + ")";
    }

}


text:
layout: page
title: Documentation
order: 1
permalink: /docs/
---

* [IAM](iam.html)
* [Resources](resources.html)
* [EVCI](evci.html)


text:
<?php

namespace slatiusa\treetable;

use \Yii;
use yii\grid\GridView;
use yii\helpers\Json;
use slatiusa\treetable\TreetableAsset;

class Treetable extends GridView
{
    /**
    * @var array configuration options for the treetable() component
    */
    public $treetableOptions = ['expandable' => true, 'indent' => 0];

    /**
    * @var boolean load default theme
    */
    public $treetableTheme = false;

    /**
     * @var integer a counter used to generate [[id]] for widgets.
     * @internal
     */
    public static $counter = 0;

	/**
	 * Initializes the widget
     *
     * Register the assets and activate the jquery.treetable() on the table
	 */
	public function init() {

        /* Register the assets */
        TreetableAsset::register($this->view, $this->treetableTheme);

        /* Determine table id */
        if (in_array('id', $this->tableOptions))
            $id = $this->tableOptions['id'];
        else
            $this->tableOptions['id'] = 'treetable' . static::$counter++;;

        /* Activate the jquery code */
        $options = Json::htmlEncode($this->treetableOptions);
        $this->view->registerJs("$('#".$this->tableOptions['id']."').treetable(".$options.");");

        parent::init();
	}
}


text:
// Code generated by client-gen. DO NOT EDIT.

package fake

import (
	clientset "github.com/openebs/maya/pkg/client/generated/openebs.io/runtask/v1beta1/clientset/internalclientset"
	openebsv1beta1 "github.com/openebs/maya/pkg/client/generated/openebs.io/runtask/v1beta1/clientset/internalclientset/typed/runtask/v1beta1"
	fakeopenebsv1beta1 "github.com/openebs/maya/pkg/client/generated/openebs.io/runtask/v1beta1/clientset/internalclientset/typed/runtask/v1beta1/fake"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/watch"
	"k8s.io/client-go/discovery"
	fakediscovery "k8s.io/client-go/discovery/fake"
	"k8s.io/client-go/testing"
)

// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
	o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
	for _, obj := range objects {
		if err := o.Add(obj); err != nil {
			panic(err)
		}
	}

	cs := &Clientset{}
	cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
	cs.AddReactor("*", "*", testing.ObjectReaction(o))
	cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
		gvr := action.GetResource()
		ns := action.GetNamespace()
		watch, err := o.Watch(gvr, ns)
		if err != nil {
			return false, nil, err
		}
		return true, watch, nil
	})

	return cs
}

// Clientset implements clientset.Interface. Meant to be embedded into a
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
	testing.Fake
	discovery *fakediscovery.FakeDiscovery
}

func (c *Clientset) Discovery() discovery.DiscoveryInterface {
	return c.discovery
}

var _ clientset.Interface = &Clientset{}

// OpenebsV1beta1 retrieves the OpenebsV1beta1Client
func (c *Clientset) OpenebsV1beta1() openebsv1beta1.OpenebsV1beta1Interface {
	return &fakeopenebsv1beta1.FakeOpenebsV1beta1{Fake: &c.Fake}
}


text:
RPY_EXTERN char *vmprof_init(int, double, char *);
RPY_EXTERN void vmprof_ignore_signals(int);
RPY_EXTERN int vmprof_enable(void);
RPY_EXTERN int vmprof_disable(void);
RPY_EXTERN int vmprof_register_virtual_function(char *, long, int);


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class DisconnectButtonController : MonoBehaviour {

    public NetworkManager mng;
    public FSM fsm;

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {

	}

    public void OnClick()
    {
        mng.StopClient();
        fsm.StateTrans(FSM.State.Unconnected);
    }

}


text:
<ControllerDef>
 <Tags filename="chrysalis/objects/desk/workdesk/tags.xml"/>
 <Fragments filename="chrysalis/objects/desk/workdesk/fragment_ids.xml"/>
 <FragmentDefs>
  <Interact scopes="SlaveCharacter+SlaveObject"/>
  <Closed scopes="SlaveCharacter+SlaveObject"/>
  <Open scopes="SlaveCharacter+SlaveObject"/>
  <Opening scopes="SlaveCharacter+SlaveObject"/>
  <Closing scopes="SlaveCharacter+SlaveObject"/>
 </FragmentDefs>
 <ScopeContextDefs>
  <SlaveCharacter />
  <SlaveObject />
 </ScopeContextDefs>
 <ScopeDefs>
  <SlaveCharacter layer="0" numLayers="3" context="SlaveCharacter" Tags="ScopeSlave"/>
  <SlaveObject layer="0" numLayers="3" context="SlaveObject" Tags="ScopeSlave"/>
 </ScopeDefs>
</ControllerDef>


text:
def split_all_strings(input_array, splitter):
    # splits all strings in a list with the splitter and adds them back
    # by: Cody Kochmann
    if isinstance(input_array, basestring):
        # patch to accept input_array in string form
        input_array = [input_array]
    result = []
    for i in input_array:
        for x in i.split(split_char):
            result.append(x)
    return(result)


text:
namespace NServiceBus.Persistence.AzureTable
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Reflection;
    using Microsoft.Azure.Cosmos.Table;
    using System.Collections.Concurrent;
    using System.Linq.Expressions;
    using Newtonsoft.Json;
    using Newtonsoft.Json.Serialization;

    static class DictionaryTableEntityExtensionsNew
    {
        public static TEntity ToSagaDataNew<TEntity>(DictionaryTableEntity entity)
        {
            return (TEntity)ToSagaData(typeof(TEntity), entity);
        }

        private static object ToSagaData(Type sagaDataType, DictionaryTableEntity entity)
        {
            var toCreate = Activator.CreateInstance(sagaDataType);
            foreach (var accessor in GetPropertyAccessors(sagaDataType))
            {
                if (!entity.ContainsKey(accessor.Name))
                {
                    continue;
                }

                var value = entity[accessor.Name];
                var type = accessor.PropertyType;

                if (type == typeof(byte[]))
                {
                    accessor.Setter(toCreate, value.BinaryValue);
                }
                else if (TrySetNullable(value, toCreate, accessor))
                {
                }
                else if (type == typeof(string))
                {
                    accessor.Setter(toCreate, value.StringValue);
                }
                else
                {
                    if (value.PropertyType == EdmType.String)
                    {
                        // possibly serialized JSON.NET value
                        try
                        {
                            using (var stringReader = new StringReader(value.StringValue))
                            {
                                var deserialized = jsonSerializer.Deserialize(stringReader, type);
                                accessor.Setter(toCreate, deserialized);
                            }
                        }
                        catch (Exception)
                        {
                            throw new NotSupportedException($"The property type '{type.Name}' is not supported in Azure Table Storage and it cannot be deserialized with JSON.NET.");
                        }
                    }
                    else
                    {
                        throw new NotSupportedException($"The property type '{type.Name}' is not supported in Azure Table Storage");
                    }
                }
            }
            return toCreate;
        }

        public static DictionaryTableEntity ToDictionaryTableEntity(object sagaData, DictionaryTableEntity toPersist)
        {
            foreach (var accessor in GetPropertyAccessors(sagaData.GetType()))
            {
                var name = accessor.Name;
                var type = accessor.PropertyType;
                var value = accessor.Getter(sagaData);

                if (type == typeof(byte[]))
                {
                    toPersist[name] = new EntityProperty((byte[])value);
                }
                else if (TryGetNullable(type, value, out bool? @bool))
                {
                    toPersist[name] = new EntityProperty(@bool);
                }
                else if (TryGetNullable(type, value, out DateTime? dateTime))
                {
                    if (!dateTime.HasValue || dateTime.Value < StorageTableMinDateTime)
                    {
                        throw new Exception($"Saga data of type '{sagaData.GetType().FullName}' with DateTime property '{name}' has an invalid value '{dateTime}'. Value cannot be null and must be equal to or greater than '{StorageTableMinDateTime}'.");
                    }

                    toPersist[name] = new EntityProperty(dateTime);
                }
                else if (TryGetNullable(type, value, out Guid? guid))
                {
                    toPersist[name] = new EntityProperty(guid);
                }
                else if (TryGetNullable(type, value, out int? @int))
                {
                    toPersist[name] = new EntityProperty(@int);
                }
                else if (TryGetNullable(type, value, out long? @long))
                {
                    toPersist[name] = new EntityProperty(@long);
                }
                else if (TryGetNullable(type, value, out double? @double))
                {
                    toPersist[name] = new EntityProperty(@double);
                }
                else if (type == typeof(string))
                {
                    toPersist[name] = new EntityProperty((string)value);
                }
                else
                {
                    using (var sw = new StringWriter())
                    {
                        try
                        {
                            jsonSerializerWithNonAbstractDefaultContractResolver.Serialize(sw, value, type);
                        }
                        catch (Exception)
                        {
                            throw new NotSupportedException($"The property type '{type.Name}' is not supported in Azure Table Storage and it cannot be serialized with JSON.NET.");
                        }
                        toPersist[name] = new EntityProperty(sw.ToString());
                    }
                }
            }
            return toPersist;
        }

        private static IReadOnlyCollection<PropertyAccessor> GetPropertyAccessors(Type sagaDataType)
        {
            var accessors = propertyAccessorCache.GetOrAdd(sagaDataType, dataType =>
            {
                var setters = new List<PropertyAccessor>();
                var entityProperties = dataType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
                foreach (var propertyInfo in entityProperties)
                {
                    setters.Add(new PropertyAccessor(propertyInfo));
                }
                return setters;
            });
            return accessors;
        }

        static bool TryGetNullable<TPrimitive>(Type type, object value, out TPrimitive? nullable)
            where TPrimitive : struct
        {
            if (type == typeof(TPrimitive))
            {
                nullable = (TPrimitive)value;
                return true;
            }

            if (type == typeof(TPrimitive?))
            {
                nullable = (TPrimitive?)value;
                return true;
            }

            nullable = null;
            return false;
        }

        static bool TrySetNullable(EntityProperty value, object toCreate, PropertyAccessor setter)
        {
            return
                TrySetNullable<bool>(value, toCreate, setter) ||
                TrySetNullable<DateTime>(value, toCreate, setter) ||
                TrySetNullable<Guid>(value, toCreate, setter) ||
                TrySetNullable<int>(value, toCreate, setter) ||
                TrySetNullable<double>(value, toCreate, setter) ||
                TrySetNullable<long>(value, toCreate, setter);
        }

        static bool TrySetNullable<TPrimitive>(EntityProperty property, object entity, PropertyAccessor setter)
            where TPrimitive : struct
        {
            if (setter.PropertyType == typeof(TPrimitive))
            {
                var value = (TPrimitive?)property.PropertyAsObject;
                var nonNullableValue = value ?? default;
                setter.Setter(entity, nonNullableValue);
                return true;
            }

            if (setter.PropertyType == typeof(TPrimitive?))
            {
                var value = (TPrimitive?)property.PropertyAsObject;
                setter.Setter(entity, value);
                return true;
            }

            return false;
        }

        public static TableQuery<DictionaryTableEntity> BuildWherePropertyQuery(Type type, string property, object value)
        {
            TableQuery<DictionaryTableEntity> query;

            var propertyInfo = type.GetProperty(property);
            if (propertyInfo == null)
            {
                return null;
            }

            if (propertyInfo.PropertyType == typeof(byte[]))
            {
                query = new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterConditionForBinary(property, QueryComparisons.Equal, (byte[])value));
            }
            else if (propertyInfo.PropertyType == typeof(bool))
            {
                query = new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterConditionForBool(property, QueryComparisons.Equal, (bool)value));
            }
            else if (propertyInfo.PropertyType == typeof(DateTime))
            {
                query = new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterConditionForDate(property, QueryComparisons.Equal, (DateTime)value));
            }
            else if (propertyInfo.PropertyType == typeof(Guid))
            {
                query = new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterConditionForGuid(property, QueryComparisons.Equal, (Guid)value));
            }
            else if (propertyInfo.PropertyType == typeof(int))
            {
                query = new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterConditionForInt(property, QueryComparisons.Equal, (int)value));
            }
            else if (propertyInfo.PropertyType == typeof(long))
            {
                query = new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterConditionForLong(property, QueryComparisons.Equal, (long)value));
            }
            else if (propertyInfo.PropertyType == typeof(double))
            {
                query = new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterConditionForDouble(property, QueryComparisons.Equal, (double)value));
            }
            else if (propertyInfo.PropertyType == typeof(string))
            {
                query = new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterCondition(property, QueryComparisons.Equal, (string)value));
            }
            else
            {
                throw new NotSupportedException($"The property type '{propertyInfo.PropertyType.Name}' is not supported in Azure Table Storage");
            }

            return query;
        }

        static readonly ConcurrentDictionary<Type, IReadOnlyCollection<PropertyAccessor>> propertyAccessorCache = new ConcurrentDictionary<Type, IReadOnlyCollection<PropertyAccessor>>();

        static readonly JsonSerializer jsonSerializer = JsonSerializer.Create();
        static readonly JsonSerializer jsonSerializerWithNonAbstractDefaultContractResolver = new JsonSerializer
        {
            ContractResolver = new NonAbstractDefaultContractResolver(),
        };

        private static readonly DateTime StorageTableMinDateTime = new DateTime(1601, 1, 1);

        sealed class PropertyAccessor
        {
            public PropertyAccessor(PropertyInfo propertyInfo)
            {
                Setter = GenerateSetter(propertyInfo);
                Getter = GenerateGetter(propertyInfo);
                Name = propertyInfo.Name;
                PropertyType = propertyInfo.PropertyType;
            }

            private static Func<object, object> GenerateGetter(PropertyInfo propertyInfo)
            {
                var instance = Expression.Parameter(typeof(object), "instance");
                var instanceCast = !propertyInfo.DeclaringType.IsValueType
                    ? Expression.TypeAs(instance, propertyInfo.DeclaringType)
                    : Expression.Convert(instance, propertyInfo.DeclaringType);
                var getter = Expression
                    .Lambda<Func<object, object>>(
                        Expression.TypeAs(Expression.Call(instanceCast, propertyInfo.GetGetMethod()), typeof(object)), instance)
                    .Compile();
                return getter;
            }

            private static Action<object, object> GenerateSetter(PropertyInfo propertyInfo)
            {
                var instance = Expression.Parameter(typeof(object), "instance");
                var value = Expression.Parameter(typeof(object), "value");
                // value as T is slightly faster than (T)value, so if it's not a value type, use that
                var instanceCast = !propertyInfo.DeclaringType.IsValueType
                    ? Expression.TypeAs(instance, propertyInfo.DeclaringType)
                    : Expression.Convert(instance, propertyInfo.DeclaringType);
                var valueCast = !propertyInfo.PropertyType.IsValueType
                    ? Expression.TypeAs(value, propertyInfo.PropertyType)
                    : Expression.Convert(value, propertyInfo.PropertyType);
                var setter = Expression
                    .Lambda<Action<object, object>>(Expression.Call(instanceCast, propertyInfo.GetSetMethod(), valueCast), instance,
                        value).Compile();
                return setter;
            }

            public Action<object, object> Setter { get; }
            public Func<object, object> Getter { get; }
            public string Name { get; }
            public Type PropertyType { get; }
        }

        class NonAbstractDefaultContractResolver : DefaultContractResolver
        {
            protected override JsonObjectContract CreateObjectContract(Type objectType)
            {
                if (objectType.IsAbstract || objectType.IsInterface)
                {
                    throw new ArgumentException("Cannot serialize an abstract class/interface", nameof(objectType));
                }
                return base.CreateObjectContract(objectType);
            }
        }
    }
}


text:
<?php

namespace ZendTest\Filter;

use Zend\Filter\Decompress as DecompressFilter;

/**
 * @group      Zend_Filter
 */
class DecompressTest extends \PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        if (!extension_loaded('bz2')) {
            $this->markTestSkipped('This filter is tested with the bz2 extension');
        }
    }

    public function tearDown()
    {
        if (file_exists(__DIR__ . '/_files/compressed.bz2')) {
            unlink(__DIR__ . '/_files/compressed.bz2');
        }
    }

    /**
     * Basic usage
     *
     * @return void
     */
    public function testBasicUsage()
    {
        $filter  = new DecompressFilter('bz2');

        $text       = 'compress me';
        $compressed = $filter->compress($text);
        $this->assertNotEquals($text, $compressed);

        $decompressed = $filter($compressed);
        $this->assertEquals($text, $decompressed);
    }

    /**
     * Setting Archive
     *
     * @return void
     */
    public function testCompressToFile()
    {
        $filter   = new DecompressFilter('bz2');
        $archive = __DIR__ . '/_files/compressed.bz2';
        $filter->setArchive($archive);

        $content = $filter->compress('compress me');
        $this->assertTrue($content);

        $filter2  = new DecompressFilter('bz2');
        $content2 = $filter2($archive);
        $this->assertEquals('compress me', $content2);

        $filter3 = new DecompressFilter('bz2');
        $filter3->setArchive($archive);
        $content3 = $filter3(null);
        $this->assertEquals('compress me', $content3);
    }

    /**
     * Basic usage
     *
     * @return void
     */
    public function testDecompressArchive()
    {
        $filter   = new DecompressFilter('bz2');
        $archive = __DIR__ . '/_files/compressed.bz2';
        $filter->setArchive($archive);

        $content = $filter->compress('compress me');
        $this->assertTrue($content);

        $filter2  = new DecompressFilter('bz2');
        $content2 = $filter2($archive);
        $this->assertEquals('compress me', $content2);
    }

    public function testFilterMethodProxiesToDecompress()
    {
        $filter   = new DecompressFilter('bz2');
        $archive = __DIR__ . '/_files/compressed.bz2';
        $filter->setArchive($archive);

        $content = $filter->compress('compress me');
        $this->assertTrue($content);

        $filter2  = new DecompressFilter('bz2');
        $content2 = $filter2->filter($archive);
        $this->assertEquals('compress me', $content2);
    }

    public function returnUnfilteredDataProvider()
    {
        return [
            [null],
            [new \stdClass()],
            [[
                'decompress me',
                'decompress me too, please'
            ]]
        ];
    }

    /**
     * @dataProvider returnUnfilteredDataProvider
     * @return void
     */
    public function testReturnUnfiltered($input)
    {
        $filter = new DecompressFilter('bz2');

        $this->assertEquals($input, $filter($input));
    }
}


text:
package org.ovirt.engine.core.bll.memory;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainAvailableDiskSizeComparator;
import org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainNumberOfVmDisksComparator;
import org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeComparator;
import org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainFilter;
import org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainSpaceRequirementsFilter;
import org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainStatusFilter;
import org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainTypeFilter;
import org.ovirt.engine.core.common.businessentities.StorageDomain;
import org.ovirt.engine.core.common.businessentities.VM;
import org.ovirt.engine.core.common.businessentities.storage.DiskImage;
import org.ovirt.engine.core.common.businessentities.storage.StorageType;
import org.ovirt.engine.core.common.businessentities.storage.VolumeType;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.dal.dbbroker.DbFacade;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MemoryStorageHandler {

    private static final MemoryStorageHandler instance = new MemoryStorageHandler();

    private static final Logger log = LoggerFactory.getLogger(MemoryStorageHandler.class);

    private MemoryStorageHandler() {
    }

    public static MemoryStorageHandler getInstance() {
        return instance;
    }

    /**
     * Returns a StorageDomain in the given StoragePool that has
     * at least as much as requested free space and can be used to store memory images
     *
     * @param storagePoolId
     *           The storage pool where the search for a domain will be made
     * @param memoryDisks
     *           Disks for which space is needed
     * @param vmDisks
     *           The vm's active snapshot disks.
     * @param vmForLogging
     *           The VM which the memory volumes being created belong to.

     *           Note: This parameter is used for logging purposed only.
     * @return storage domain in the given pool with at least the required amount of free space,
     *         or null if no such storage domain exists in the pool
     */
    public StorageDomain findStorageDomainForMemory(Guid storagePoolId, List<DiskImage> memoryDisks,
            Collection<DiskImage> vmDisks, VM vmForLogging) {
        List<StorageDomain> domainsInPool =
                DbFacade.getInstance().getStorageDomainDao().getAllForStoragePool(storagePoolId);
        StorageDomain storageDomainForMemory = findStorageDomainForMemory(domainsInPool, memoryDisks, vmDisks);
        if (storageDomainForMemory != null) {
            updateDisksStorage(storageDomainForMemory, memoryDisks);
            if (vmForLogging != null) {
                log.info("The memory volumes of VM (name '{}', id '{}') will be " +
                                "stored in storage domain (name '{}', id '{}')",
                        vmForLogging.getName(), vmForLogging.getId(), storageDomainForMemory.getName(),
                        storageDomainForMemory.getId());
            }
        }
        return storageDomainForMemory;
    }

    public void updateDisksStorage(StorageDomain storageDomain, List<DiskImage> memoryDisks) {
        for (DiskImage disk : memoryDisks) {
            disk.setStorageIds(new ArrayList<>(Collections.singletonList(storageDomain.getId())));
        }
        /*
        There should be two disks in the disksList, first of which is memory disk.
        Only its volume type should be modified.
         */
        updateDiskVolumeType(storageDomain.getStorageType(), memoryDisks.get(0));
    }

    protected StorageDomain findStorageDomainForMemory(List<StorageDomain> domainsInPool, List<DiskImage> memoryDisks,
            Collection<DiskImage> vmDisks) {
        domainsInPool = filterStorageDomains(domainsInPool, memoryDisks);
        sortStorageDomains(domainsInPool, vmDisks);
        return domainsInPool.isEmpty() ? null : domainsInPool.get(0);
    }

    protected List<? extends StorageDomainFilter> getStorageDomainFilters() {
        return Arrays.asList(new StorageDomainStatusFilter(),
                new StorageDomainTypeFilter(),
                new StorageDomainSpaceRequirementsFilter());
    }

    protected List<? extends Comparator<StorageDomain>> getStorageDomainComparators(
            List<StorageDomain> domainsInPool, Collection<DiskImage> vmDisks) {
        return Arrays.asList(new StorageDomainNumberOfVmDisksComparator(domainsInPool, vmDisks),
                new StorageTypeComparator(),
                new StorageDomainAvailableDiskSizeComparator());
    }

    protected List<StorageDomain> filterStorageDomains(List<StorageDomain> domainsInPool, List<DiskImage> memoryDisks) {
        for (StorageDomainFilter storageDomainFilter : getStorageDomainFilters()) {
            domainsInPool = storageDomainFilter.filterStorageDomains(domainsInPool, memoryDisks);
        }
        return domainsInPool;
    }

    protected void sortStorageDomains(List<StorageDomain> domainsInPool, Collection<DiskImage> vmDisks) {
        Comparator<StorageDomain> comp = null;
        // When there is more than one comparator, a nested sort is performed.
        for (Comparator<StorageDomain> comparator : getStorageDomainComparators(domainsInPool, vmDisks)) {
            // A reversed sort will be performed to get the "biggest" storage domain first.
            comp = (comp == null) ? comparator.reversed() : comp.thenComparing(comparator.reversed());
        }
        Collections.sort(domainsInPool, comp);
    }

    private void updateDiskVolumeType(StorageType storageType, DiskImage disk) {
        VolumeType volumeType = storageType.isFileDomain() ? VolumeType.Sparse : VolumeType.Preallocated;
        disk.setVolumeType(volumeType);
    }
}


text:
package org.apache.coyote;

import java.io.IOException;

import org.apache.tomcat.util.buf.ByteChunk;

/**
 * Input buffer.
 *
 * @author Remy Maucherat
 */
public interface InputBuffer {

    /** Return from the input stream.
        IMPORTANT: the current model assumes that the protocol will 'own' the
        buffer and return a pointer to it in ByteChunk ( i.e. the param will
        have chunk.getBytes()==null before call, and the result after the call ).
    */
    public int doRead(ByteChunk chunk, Request request)
        throws IOException;

}


text:
int setpriority(int which, id_t who, int prio)
{
	return syscall(SYS_setpriority, which, who, prio);
}


text:
'use strict';

// MODULES //

var reWhitespace = require( '@stdlib/regexp/whitespace' ).REGEXP;

// MAIN //

/**
* Capitalizes the first letter of each word in an input string.
*
* @param {string} str - string to convert
* @returns {string} start case string
*
* @example
* var str = startcase( 'beep boop foo bar' );
* // returns 'Beep Boop Foo Bar'
*/
function startcase( str ) {
	var cap;
	var out;
	var ch;
	var i;

	cap = true;
	out = '';
	for ( i = 0; i < str.length; i++ ) {
		ch = str.charAt( i );
		if ( reWhitespace.test( ch ) ) {
			cap = true;
		} else if ( cap ) {
			ch = ch.toUpperCase();
			cap = false;
		}
		out += ch;
	}
	return out;
}

// EXPORTS //

module.exports = startcase;


text:
package org.openspaces.persistency.patterns;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import org.openspaces.persistency.support.ConcurrentMultiDataIterator;
import org.openspaces.persistency.support.SerialMultiDataIterator;

import com.gigaspaces.datasource.DataIterator;
import com.gigaspaces.datasource.DataSourceIdQuery;
import com.gigaspaces.datasource.DataSourceIdsQuery;
import com.gigaspaces.datasource.DataSourceQuery;
import com.gigaspaces.datasource.SpaceDataSource;
import com.gigaspaces.metadata.SpaceTypeDescriptor;

/**
 * A space data source that redirects the query operations to the given data source that
 * can handle the given type.
 * @author eitany
 * @since 9.5
 */
public class SpaceDataSourceSplitter extends SpaceDataSource {

    private final ManagedEntriesSpaceDataSource[] dataSources;

    private final Map<String, SpaceDataSource> entriesToDataSource = new HashMap<String, SpaceDataSource>();

    private int initalLoadThreadPoolSize = 10;

    public SpaceDataSourceSplitter(ManagedEntriesSpaceDataSource[] dataSources) {
        this.dataSources = dataSources;
        for (ManagedEntriesSpaceDataSource dataSource : dataSources) {
            for (String entry : dataSource.getManagedEntries()) {
                entriesToDataSource.put(entry, dataSource);
            }
        }
    }

    public void setInitalLoadThreadPoolSize(int initalLoadThreadPoolSize) {
        this.initalLoadThreadPoolSize = initalLoadThreadPoolSize;
    }

    protected SpaceDataSource getDataSource(String entry) {
        return entriesToDataSource.get(entry);
    }

    /**
     * Iterates through all the given data sources and assembles their respective {@link com.gigaspaces.datasource.DataIterator}s
     * from {@link com.gigaspaces.datasource.SpaceDataSource#initialDataLoad()}. Constructs a {@link org.openspaces.persistency.support.ConcurrentMultiDataIterator}
     * on top of them.
     */
    @SuppressWarnings("unchecked")
    @Override
    public DataIterator<Object> initialDataLoad() {
        ArrayList<DataIterator> iterators = new ArrayList<DataIterator>(dataSources.length);
        for (SpaceDataSource dataSource : dataSources) {
            DataIterator<Object> iterator = dataSource.initialDataLoad();
            if (iterator != null)
                iterators.add(iterator);
        }
        return new ConcurrentMultiDataIterator(iterators.toArray(new DataIterator[iterators.size()]), initalLoadThreadPoolSize);
    }

    /**
     * Iterates through all the given data sources and assembles their respective {@link com.gigaspaces.datasource.DataIterator}s
     * from {@link com.gigaspaces.datasource.SpaceDataSource#initialMetadataLoad()}. Constructs a {@link org.openspaces.persistency.support.SerialMultiDataIterator}
     * on top of them.
     */
    @SuppressWarnings("unchecked")
    @Override
    public DataIterator<SpaceTypeDescriptor> initialMetadataLoad() {
        ArrayList<DataIterator<SpaceTypeDescriptor>> iterators = new ArrayList<DataIterator<SpaceTypeDescriptor>>(dataSources.length);
        for (SpaceDataSource dataSource : dataSources) {
            DataIterator<SpaceTypeDescriptor> iterator = dataSource.initialMetadataLoad();
            if (iterator != null)
                iterators.add(iterator);
        }
        return new SerialMultiDataIterator(iterators.toArray(new DataIterator[iterators.size()]));
    }

    /**
     * Delegates the query to the corresponding data source
     */
    @Override
    public DataIterator<Object> getDataIterator(DataSourceQuery query) {
        SpaceDataSource dataSource = getDataSource(query.getTypeDescriptor().getTypeName());
        return dataSource == null ? null : dataSource.getDataIterator(query);
    }

    /**
     * Delegates the query to the corresponding data source
     */
    @Override
    public Object getById(DataSourceIdQuery idQuery) {
        SpaceDataSource dataSource = getDataSource(idQuery.getTypeDescriptor().getTypeName());
        return dataSource == null ? null : dataSource.getById(idQuery);
    }

    /**
     * Delegates the query to the corresponding data source
     */
    @Override
    public DataIterator<Object> getDataIteratorByIds(DataSourceIdsQuery idsQuery) {
        SpaceDataSource dataSource = getDataSource(idsQuery.getTypeDescriptor().getTypeName());
        return dataSource == null ? null : dataSource.getDataIteratorByIds(idsQuery);
    }
}


text:
date >> /home/pi/.bitcoin/running.log

if [ "$(pidof bitcoind)" ]
then
   echo sync at block >> /home/pi/.bitcoin/running.log
	/usr/local/bin/bitcoind getblockcount >> /home/pi/.bitcoin/running.log

else

	/usr/local/bin/bitcoind -dns -noupnp -maxconnections=24 -timeout=120 -noirc -gen=0 -maxorphantx=15 -maxorphanblocks=15 -dbcache=15 -daemon -checkblocks=25 -maxreceivebuffer=1250 -maxsendbuffer=250 -disablewallet &
	echo was dead >> /home/pi/.bitcoin/running.log

  fi


text:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/icons"
        android:orientation="vertical">

        <include
            android:id="@+id/app_bar"
            layout="@layout/app_bar"></include>

        <EditText
            android:id="@+id/name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/activity_horizontal_margin"
            android:hint="Name"
            android:inputType="textPersonName"
            android:lines="1"
            android:padding="10dp" />

        <EditText
            android:id="@+id/email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/activity_horizontal_margin"
            android:hint="e-mail"
            android:inputType="textEmailAddress"
            android:lines="1"
            android:padding="10dp" />

        <EditText
            android:id="@+id/password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/activity_horizontal_margin"
            android:hint="Password"
            android:inputType="textPassword"
            android:lines="1"
            android:padding="10dp" />

        <Button
            android:id="@+id/create_account"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/activity_horizontal_margin"
            android:background="@color/colorAccent"
            android:padding="10dp"
            android:text="Sign Up"
            android:textAllCaps="false"
            android:textColor="@color/icons" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="20dp"
            android:padding="50dp"
            android:visibility="invisible"></TextView>
    </LinearLayout>
</ScrollView>