text:
package com.gitblit.wicket.pages;

import java.io.OutputStream;
import java.util.List;

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
import org.apache.wicket.markup.repeater.data.ListDataProvider;
import org.apache.wicket.request.target.resource.ResourceStreamRequestTarget;
import org.apache.wicket.util.resource.AbstractResourceStreamWriter;
import org.apache.wicket.util.resource.IResourceStream;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;

import com.gitblit.models.PathModel;
import com.gitblit.models.SubmoduleModel;
import com.gitblit.models.UserModel;
import com.gitblit.servlet.RawServlet;
import com.gitblit.utils.ByteFormat;
import com.gitblit.utils.JGitUtils;
import com.gitblit.wicket.CacheControl;
import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.CacheControl.LastModified;
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.panels.CommitHeaderPanel;
import com.gitblit.wicket.panels.CompressedDownloadsPanel;
import com.gitblit.wicket.panels.LinkPanel;
import com.gitblit.wicket.panels.PathBreadcrumbsPanel;

@CacheControl(LastModified.BOOT)
public class TreePage extends RepositoryPage {

	public TreePage(PageParameters params) {
		super(params);

		final String path = WicketUtils.getPath(params);

		Repository r = getRepository();
		RevCommit commit = getCommit();
		List<PathModel> paths = JGitUtils.getFilesInPath2(r, path, commit);

		// tree page links
		add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,
				WicketUtils.newPathParameter(repositoryName, objectId, path)));
		add(new CompressedDownloadsPanel("compressedLinks", getRequest()
				.getRelativePathPrefixToContextRoot(), repositoryName, objectId, path));

		add(new CommitHeaderPanel("commitHeader", repositoryName, commit));

		// breadcrumbs
		add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, path, objectId));
		if (path != null && path.trim().length() > 0) {
			// add .. parent path entry
			String parentPath = null;
			if (path.lastIndexOf('/') > -1) {
				parentPath = path.substring(0, path.lastIndexOf('/'));
			}
			PathModel model = new PathModel("..", parentPath, null, 0, FileMode.TREE.getBits(), null, objectId);
			model.isParentPath = true;
			paths.add(0, model);
		}

		final String id = getBestCommitId(commit);

		final ByteFormat byteFormat = new ByteFormat();
		final String baseUrl = WicketUtils.getGitblitURL(getRequest());

		// changed paths list
		ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);
		DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {
			private static final long serialVersionUID = 1L;
			int counter;

			@Override
			public void populateItem(final Item<PathModel> item) {
				final PathModel entry = item.getModelObject();

				item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));
				item.add(WicketUtils.setHtmlTooltip(new Label("filestore", ""), getString("gb.filestore"))
									.setVisible(entry.isFilestoreItem()));

				if (entry.isParentPath) {
					// parent .. path
					item.add(WicketUtils.newBlankImage("pathIcon"));
					item.add(new Label("pathSize", ""));
					item.add(new LinkPanel("pathName", null, entry.name, TreePage.class,
							WicketUtils.newPathParameter(repositoryName, id, entry.path)));
					item.add(new Label("pathLinks", ""));
				} else {
					if (entry.isTree()) {
						// folder/tree link
						item.add(WicketUtils.newImage("pathIcon", "folder_16x16.png"));
						item.add(new Label("pathSize", ""));
						item.add(new LinkPanel("pathName", "list", entry.name, TreePage.class,
								WicketUtils.newPathParameter(repositoryName, id,
										entry.path)));

						// links
						Fragment links = new Fragment("pathLinks", "treeLinks", this);
						links.add(new BookmarkablePageLink<Void>("tree", TreePage.class,
								WicketUtils.newPathParameter(repositoryName, id,
										entry.path)));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(repositoryName, id,
										entry.path)));
						links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,
								repositoryName, objectId, entry.path));

						item.add(links);
					} else if (entry.isSubmodule()) {
						// submodule
						String submoduleId = entry.objectId;
						String submodulePath;
						boolean hasSubmodule = false;
						SubmoduleModel submodule = getSubmodule(entry.path);
						submodulePath = submodule.gitblitPath;
						hasSubmodule = submodule.hasSubmodule;

						item.add(WicketUtils.newImage("pathIcon", "git-orange-16x16.png"));
						item.add(new Label("pathSize", ""));
						item.add(new LinkPanel("pathName", "list", entry.name + " @ " +
								getShortObjectId(submoduleId), TreePage.class,
								WicketUtils.newPathParameter(submodulePath, submoduleId, "")).setEnabled(hasSubmodule));

						Fragment links = new Fragment("pathLinks", "submoduleLinks", this);
						links.add(new BookmarkablePageLink<Void>("view", SummaryPage.class,
								WicketUtils.newRepositoryParameter(submodulePath)).setEnabled(hasSubmodule));
						links.add(new BookmarkablePageLink<Void>("tree", TreePage.class,
								WicketUtils.newPathParameter(submodulePath, submoduleId,
										"")).setEnabled(hasSubmodule));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(repositoryName, id,
										entry.path)));
						links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,
								submodulePath, submoduleId, "").setEnabled(hasSubmodule));
						item.add(links);
					} else {
						// blob link
						String displayPath = entry.name;
						String path = entry.path;
						if (entry.isSymlink()) {
							path = JGitUtils.getStringContent(getRepository(), getCommit().getTree(), path);
							displayPath = entry.name + " -> " + path;
						}
						item.add(WicketUtils.getFileImage("pathIcon", entry.name));
						item.add(new Label("pathSize", byteFormat.format(entry.size)));

						// links
						Fragment links = new Fragment("pathLinks", "blobLinks", this);

						if (entry.isFilestoreItem()) {
							item.add(new LinkPanel("pathName", "list", displayPath, new Link<Object>("link", null) {

								private static final long serialVersionUID = 1L;

								@Override
							    public void onClick() {

							    	 IResourceStream resourceStream = new AbstractResourceStreamWriter() {

										private static final long serialVersionUID = 1L;

										@Override
							    	      public void write(OutputStream output) {
							    	   		 UserModel user =  GitBlitWebSession.get().getUser();
										     user = user == null ? UserModel.ANONYMOUS : user;

							    	        app().filestore().downloadBlob(entry.getFilestoreOid(), user, getRepositoryModel(), output);
							    	      }
							    	  };

							    	getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(resourceStream, entry.path));
							    }}));

							links.add(new Link<Object>("view", null) {

								private static final long serialVersionUID = 1L;

								@Override
							    public void onClick() {

							    	 IResourceStream resourceStream = new AbstractResourceStreamWriter() {

										private static final long serialVersionUID = 1L;

										@Override
							    	      public void write(OutputStream output) {
							    	   		 UserModel user =  GitBlitWebSession.get().getUser();
										     user = user == null ? UserModel.ANONYMOUS : user;

							    	        app().filestore().downloadBlob(entry.getFilestoreOid(), user, getRepositoryModel(), output);
							    	      }
							    	  };

							    	getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(resourceStream, entry.path));
							    }});

							links.add(new Link<Object>("raw", null) {

								private static final long serialVersionUID = 1L;

								@Override
							    public void onClick() {

							    	 IResourceStream resourceStream = new AbstractResourceStreamWriter() {

										private static final long serialVersionUID = 1L;

										@Override
							    	      public void write(OutputStream output) {
							    	   		 UserModel user =  GitBlitWebSession.get().getUser();
										     user = user == null ? UserModel.ANONYMOUS : user;

							    	        app().filestore().downloadBlob(entry.getFilestoreOid(), user, getRepositoryModel(), output);
							    	      }
							    	  };

							    	getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(resourceStream, entry.path));
							    }});

						} else {
							item.add(new LinkPanel("pathName", "list", displayPath, BlobPage.class,
									WicketUtils.newPathParameter(repositoryName, id,
											path)));

							links.add(new BookmarkablePageLink<Void>("view", BlobPage.class,
									WicketUtils.newPathParameter(repositoryName, id,
											path)));
							String rawUrl = RawServlet.asLink(getContextUrl(), repositoryName, id, path);
							links.add(new ExternalLink("raw", rawUrl));
						}

						links.add(new BookmarkablePageLink<Void>("blame", BlamePage.class,
								WicketUtils.newPathParameter(repositoryName, id,
										path)));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(repositoryName, id,
										path)));
						item.add(links);
					}
				}
				WicketUtils.setAlternatingBackground(item, counter);
				counter++;
			}
		};
		add(pathsView);
	}

	@Override
	protected String getPageName() {
		return getString("gb.tree");
	}

	@Override
	protected boolean isCommitPage() {
		return true;
	}

}


text:
/* eslint-disable */
import $ from 'jquery';
import config from './config';
import auth from './auth';
import util from './util';

/**
 * Compatability module which proxies requests to the Kloudless API via
 * iexd.html (hosted on the API domain) to avoid IE9 restrictions on
 * cross-domain requests.
 *
 * Adds a jQuery AJAX transport which handles all requests to the API server.
 *
 * In particular, IE9 has some limitations on use of XDomainRequest that
 * prevent us from using it to talk to the API server:
 *  - can't send custom headers like Authorization
 *  - protocol of the page needs to be https (protocols must match)
 *  - only GET and POST methods can be used
 *  - can only use text/plain for the request's Content-Type
 */
'use strict';

// do nothing if proper cross-domain requests are supported

if (!util.supportsCORS()) {
  $.ajaxTransport('+*', function (options, originalOptions, jqXHR) {
    if (!canHandleRequest(options)) {
      return;
    }

    return {
      send: function (headers, completeCallback) {
        var requestId = util.randomID();
        options.headers = headers;

        var data = {
          type: 'proxy',
          origin: document.URL,
          id: requestId,
          options: options
        };

        auth.postMessage(data, requestId, function (response) {
          completeCallback(
            response.status, response.statusText, response.responses, response.headers);
        });
      },

      /* we don't support aborting requests on IE9 :-) */
      abort: function () {
      }
    };
  });
}

function canHandleRequest(options) {
  return options.crossDomain &&
    options.url.substring(0, config.base_url.length) == config.base_url;
}

redpajama_set_name: RedPajamaGithub


text:
package com.jayway.annostatemachine.android.emitter;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import com.jayway.annostatemachine.SignalPayload;
import com.jayway.annostatemachine.StateMachineFront;

/**
 * Helper methods that emit signals to state machines
 */
public class Emitters {

    public static <Signal extends Enum> View.OnClickListener onClick(View view,
                                                        @NonNull final StateMachineFront<Signal> stateMachine,
                                                        @NonNull final Signal signal,
                                                        @Nullable final SignalPayload payload) {
        View.OnClickListener listener = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                stateMachine.send(signal, payload);
            }
        };
        view.setOnClickListener(listener);
        return listener;
    }

    public static <Signal extends Enum> View.OnClickListener onClick(View view,
                                                        @NonNull final StateMachineFront<Signal> stateMachine,
                                                        @NonNull final Signal signal) {
        View.OnClickListener listener = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                stateMachine.send(signal);
            }
        };
        view.setOnClickListener(listener);
        return listener;
    }

    public static <Signal extends Enum>CheckBox.OnCheckedChangeListener onCheckedChanged(CheckBox checkBox,
                                                                            @NonNull final StateMachineFront<Signal> stateMachine,
                                                                            @NonNull final Signal signal, final String keyForCheckedState) {
        return onCheckedChanged(checkBox, stateMachine, signal, null, keyForCheckedState);
    }

    public static <Signal extends Enum>CheckBox.OnCheckedChangeListener onCheckedChanged(CheckBox checkBox,
                                                                                @NonNull final StateMachineFront<Signal> stateMachine,
                                                                                @NonNull final Signal signal, final SignalPayload<Signal> payload,
                                                                                final String keyForCheckedState) {
        CompoundButton.OnCheckedChangeListener listener = new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                SignalPayload thePayload = payload != null ? payload : new SignalPayload();
                thePayload.put(keyForCheckedState, isChecked);
                stateMachine.send(signal, thePayload);
            }
        };
        checkBox.setOnCheckedChangeListener(listener);
        return listener;
    }
}


text:
arduino = Runtime.createAndStart("arduino","Arduino")
arduino.setBoardMega()
arduino.connect("COM3")

arduino1 = Runtime.createAndStart("arduino1","Arduino")

#connecting arduino1 to arduino Serial1 instead to a COMX
arduino1.connect(arduino,"Serial1")

servo = Runtime.createAndStart("servo","Servo")
servo.attach(arduino1,5)

#attaching procedure take a bit more time to do, wait a little before using it
sleep(5)

#nooo 10000 value/second is too much !!!
def publishPinDarkMatter(pins):
  for pin in range(0, len(pins)):
    servo.map(0,180,0,pins[pin].value+1)
    servo.moveTo(pins[pin].value-1)

arduino1.addListener("publishPinArray",Python.getName(),"publishPinDarkMatter")
arduino1.enablePin(14,10000)


text:
var path = require('path');
var webpack = require('webpack');

module.exports = {
  devtool: 'eval',
  entry: [
    'webpack-hot-middleware/client',
    './app/index'
  ],
  output: {
    path: path.join(__dirname, 'dist'),
    filename: 'bundle.js',
    publicPath: '/static/'
  },
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin()
  ],
  babel: {
    stage: 0
  },
  module: {
    loaders: [{
      test: /\.js$/,
      loaders: ['babel']
    }]
  }
};


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_vertical_margin"
    android:paddingRight="@dimen/activity_vertical_margin"
    android:orientation="vertical"
    android:gravity="center">

    <Button
        android:id="@+id/testBtn"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Start Test"/>

</LinearLayout>


text:
(function() {
	'use strict';

	// VARIABLES //

	// TODO: clean me.

	var FIGURES = {}, IDS;

	FIGURES[ 2 ] = require( './' + 2 + '/figure.js' );
	FIGURES[ 3 ] = require( './' + 3 + '/figure.js' );
	FIGURES[ 4 ] = require( './' + 4 + '/figure.js' );

	IDS = Object.keys( FIGURES );

	// FUNCTIONS //

	/**
	* FUNCTION: onError( response, error )
	*	Sends an error response.
	*
	* @param {object} response - HTTP response object
	* @param {object} error - error object
	*/
	function onError( response, error ) {
		response.writeHead( error.status, {
			'Content-Type': 'application/json'
		});
		response.write( JSON.stringify( error ) );
		response.end();
	} // end FUNCTION onError()

	// ROUTES //

	/**
	* FUNCTION: routes( clbk )
	*
	*/
	var routes = function ( clbk ) {

		// NOTE: the 'this' context is the application.

		// Base route:
		this.get( '/figures', function onRequest( request, response ) {
			response.writeHead( 200, {
				'Content-Type': 'text/html'
			});
			response.write( '...rpo dynamics figures...' );
			response.end();
		});

		// Figure route:
		this.get( '/figure/:id', function onRequest( request, response ) {
			var id = request.params.id;

			// CHECK!!!
			if ( IDS.indexOf( id ) === -1 ) {
				onError( response, {
					'status': 400,
					'message': 'Invalid request. Provided figure number does not correspond to any figure.'
				});
				return;
			}

			// Generate the figure:
			FIGURES[ id ]( function onFigure( error, html ) {
				if ( error ) {
					onError( error );
					return;
				}
				response.writeHead( 200, {
					'Content-Type': 'text/html'
				});
				response.write( html );
				response.end();
			});
		});

		// Callback:
		clbk();

	}; // end ROUTES

	// EXPORTS //

	module.exports = routes;

})();


text:
import warnings
from collections import Iterable
from numbers import Number

import numpy as np

from scipy.optimize import fmin_l_bfgs_b

from sklearn.base import clone
from sklearn.base import is_regressor
from sklearn.externals.joblib import Parallel, delayed
from sklearn.utils import check_random_state

from ..acquisition import _gaussian_acquisition
from ..acquisition import gaussian_acquisition_1D
from ..learning import RandomForestRegressor, ExtraTreesRegressor
from ..learning import GradientBoostingQuantileRegressor
from ..space import Categorical
from ..space import Space
from ..utils import create_result

class Optimizer(object):
    """Run bayesian optimisation loop.

    An `Optimizer` represents the steps of a bayesian optimisation loop. To
    use it you need to provide your own loop mechanism. The various
    optimisers provided by `skopt` use this class under the hood.

    Use this class directly if you want to control the iterations of your
    bayesian optimisation loop.

    Parameters
    ----------
    * `dimensions` [list, shape=(n_dims,)]:
        List of search space dimensions.
        Each search dimension can be defined either as

        - a `(upper_bound, lower_bound)` tuple (for `Real` or `Integer`
          dimensions),
        - a `(upper_bound, lower_bound, "prior")` tuple (for `Real`
          dimensions),
        - as a list of categories (for `Categorical` dimensions), or
        - an instance of a `Dimension` object (`Real`, `Integer` or
          `Categorical`).

    * `base_estimator` [sklearn regressor]:
        Should inherit from `sklearn.base.RegressorMixin`.
        In addition the `predict` method, should have an optional `return_std`
        argument, which returns `std(Y | x)`` along with `E[Y | x]`.

    * `n_random_starts` [int, default=10]:
        Number of evaluations of `func` with random initialization points
        before approximating the `func` with `base_estimator`. While random
        points are being suggested no model will be fit to the observations.

    * `acq_func` [string, default=`"EI"`]:
        Function to minimize over the posterior distribution. Can be either

        - `"LCB"` for lower confidence bound.
        - `"EI"` for negative expected improvement.
        - `"PI"` for negative probability of improvement.
        - `"gp_hedge"` Probabilistically choose one of the above three
          acquisition functions at every iteration.
            - The gains `g_i` are initialized to zero.
            - At every iteration,
                - Each acquisition function is optimised independently to
                  propose an candidate point `X_i`.
                - Out of all these candidate points, the next point `X_best` is
                  chosen by $softmax(\eta g_i)$
                - After fitting the surrogate model with `(X_best, y_best)`,
                  the gains are updated such that $g_i -= \mu(X_i)$

    * `acq_optimizer` [string, `"sampling"` or `"lbfgs"`, default=`"lbfgs"`]:
        Method to minimize the acquistion function. The fit model
        is updated with the optimal value obtained by optimizing `acq_func`
        with `acq_optimizer`.

        - If set to `"sampling"`, then `acq_func` is optimized by computing
          `acq_func` at `n_points` randomly sampled points.
        - If set to `"lbfgs"`, then `acq_func` is optimized by
              - Sampling `n_restarts_optimizer` points randomly.
              - `"lbfgs"` is run for 20 iterations with these points as initial
                points to find local minima.
              - The optimal of these local minima is used to update the prior.

    * `random_state` [int, RandomState instance, or None (default)]:
        Set random state to something other than None for reproducible
        results.

    * `acq_func_kwargs` [dict]:
        Additional arguments to be passed to the acquistion function.

    * `acq_optimizer_kwargs` [dict]:
        Additional arguments to be passed to the acquistion optimizer.

    Attributes
    ----------
    * `Xi` [list]:
        Points at which objective has been evaluated.
    * `yi` [scalar]:
        Values of objective at corresponding points in `Xi`.
    * `models` [list]:
        Regression models used to fit observations and compute acquisition
        function.
    * `space`
        An instance of `skopt.space.Space`. Stores parameter search space used
        to sample points, bounds, and type of parameters.

    """
    def __init__(self, dimensions, base_estimator,
                 n_random_starts=10, acq_func="gp_hedge",
                 acq_optimizer="lbfgs",
                 random_state=None, acq_func_kwargs=None,
                 acq_optimizer_kwargs=None):
        # Arguments that are just stored not checked
        self.acq_func = acq_func
        self.rng = check_random_state(random_state)
        self.acq_func_kwargs = acq_func_kwargs

        if self.acq_func == "gp_hedge":
            self.cand_acq_funcs_ = ["EI", "LCB", "PI"]
            self.gains_ = np.zeros(3)
        else:
            self.cand_acq_funcs_ = [self.acq_func]

        if acq_func_kwargs is None:
            acq_func_kwargs = dict()
        self.eta = acq_func_kwargs.get("eta", 1.0)

        if acq_optimizer_kwargs is None:
            acq_optimizer_kwargs = dict()

        self.n_points = acq_optimizer_kwargs.get("n_points", 10000)
        self.n_restarts_optimizer = acq_optimizer_kwargs.get(
            "n_restarts_optimizer", 5)
        n_jobs = acq_optimizer_kwargs.get("n_jobs", 1)

        self.space = Space(dimensions)
        self.models = []
        self.Xi = []
        self.yi = []

        self._cat_inds = []
        self._non_cat_inds = []
        for ind, dim in enumerate(self.space.dimensions):
            if isinstance(dim, Categorical):
                self._cat_inds.append(ind)
            else:
                self._non_cat_inds.append(ind)
        self._check_arguments(base_estimator, n_random_starts, acq_optimizer)

        self.n_jobs = n_jobs

    def _check_arguments(self, base_estimator, n_random_starts, acq_optimizer):
        """Check arguments for sanity."""
        if not is_regressor(base_estimator):
            raise ValueError(
                "%s has to be a regressor." % base_estimator)
        self.base_estimator = base_estimator

        if n_random_starts < 0:
            raise ValueError(
                "Expected `n_random_starts` >= 0, got %d" % n_random_starts)
        self._n_random_starts = n_random_starts

        if (isinstance(base_estimator, (ExtraTreesRegressor,
                                        RandomForestRegressor,
                                        GradientBoostingQuantileRegressor))
            and not acq_optimizer == "sampling"):
            raise ValueError("The tree-based regressor {0} should run with "
                             "acq_optimizer='sampling'".format(type(base_estimator)))

        if acq_optimizer not in ["lbfgs", "sampling"]:
            raise ValueError("Expected acq_optimizer to be 'lbfgs' or "
                             "'sampling', got {0}".format(acq_optimizer))
        self.acq_optimizer = acq_optimizer

    def ask(self):
        """Suggest next point at which to evaluate the objective.

        Returns a random point for the first `n_random_starts` calls, after
        that `base_estimator` is used to determine the next point.
        """
        if self._n_random_starts > 0:
            self._n_random_starts -= 1
            # this will not make a copy of `self.rng` and hence keep advancing
            # our random state.
            return self.space.rvs(random_state=self.rng)[0]

        else:
            if not self.models:
                raise RuntimeError("Random evaluations exhausted and no "
                                   "model has been fit.")

            next_x = self._next_x
            min_delta_x = min([self.space.distance(next_x, xi)
                               for xi in self.Xi])
            if abs(min_delta_x) <= 1e-8:
                warnings.warn("The objective has been evaluated "
                              "at this point before.")

            # return point computed from last call to tell()
            return next_x

    def tell(self, x, y, fit=True):
        """Record an observation (or several) of the objective function.

        Provide values of the objective function at points suggested by `ask()`
        or other points. By default a new model will be fit to all
        observations. The new model is used to suggest the next point at
        which to evaluate the objective. This point can be retrieved by calling
        `ask()`.

        To add observations without fitting a new model set `fit` to False.

        To add multiple observations in a batch pass a list-of-lists for `x`
        and a list of scalars for `y`.

        Parameters
        ----------
        * `x` [list or list-of-lists]:
            Point at which objective was evaluated.
        * `y` [scalar or list]:
            Value of objective at `x`.
        * `fit` [bool, default=True]
            Fit a model to observed evaluations of the objective. A model will
            only be fitted after `n_random_starts` points have been queried
            irrespective of the value of `fit`.
        """
        # if y isn't a scalar it means we have been handed a batch of points
        if (isinstance(y, Iterable) and all(isinstance(point, Iterable)
                                            for point in x)):
            if not np.all([p in self.space for p in x]):
                raise ValueError("Not all points are within the bounds of"
                                 " the space.")
            self.Xi.extend(x)
            self.yi.extend(y)

        elif isinstance(x, Iterable) and isinstance(y, Number):
            if x not in self.space:
                raise ValueError("Point (%s) is not within the bounds of"
                                 " the space (%s)."
                                 % (x, self.space.bounds))
            self.Xi.append(x)
            self.yi.append(y)

        else:
            raise ValueError("Type of arguments `x` (%s) and `y` (%s) "
                             "not compatible." % (type(x), type(y)))

        if fit and self._n_random_starts == 0:
            transformed_bounds = np.array(self.space.transformed_bounds)
            est = clone(self.base_estimator)

            with warnings.catch_warnings():
                warnings.simplefilter("ignore")
                est.fit(self.space.transform(self.Xi), self.yi)

            if hasattr(self, "next_xs_") and self.acq_func == "gp_hedge":
                self.gains_ -= est.predict(np.vstack(self.next_xs_))
            self.models.append(est)

            X = self.space.transform(self.space.rvs(
                n_samples=self.n_points, random_state=self.rng))
            self.next_xs_ = []
            for cand_acq_func in self.cand_acq_funcs_:
                values = _gaussian_acquisition(
                    X=X, model=est, y_opt=np.min(self.yi),
                    acq_func=cand_acq_func,
                    acq_func_kwargs=self.acq_func_kwargs)
                # Find the minimum of the acquisition function by randomly
                # sampling points from the space
                if self.acq_optimizer == "sampling":
                    next_x = X[np.argmin(values)]

                # Use BFGS to find the mimimum of the acquisition function, the
                # minimization starts from `n_restarts_optimizer` different
                # points and the best minimum is used
                elif self.acq_optimizer == "lbfgs":
                    x0 = X[np.argsort(values)[:self.n_restarts_optimizer]]

                    with warnings.catch_warnings():
                        warnings.simplefilter("ignore")
                        results = Parallel(n_jobs=self.n_jobs)(
                            delayed(fmin_l_bfgs_b)(
                                gaussian_acquisition_1D, x,
                                args=(est, np.min(self.yi), cand_acq_func,
                                      self.acq_func_kwargs),
                                bounds=self.space.transformed_bounds,
                                approx_grad=False,
                                maxiter=20)
                            for x in x0)

                    cand_xs = np.array([r[0] for r in results])
                    cand_acqs = np.array([r[1] for r in results])
                    next_x = cand_xs[np.argmin(cand_acqs)]

                # lbfgs should handle this but just in case there are
                # precision errors.
                if not self.space.is_categorical:
                    next_x = np.clip(
                        next_x, transformed_bounds[:, 0],
                        transformed_bounds[:, 1])
                self.next_xs_.append(next_x)

            if self.acq_func == "gp_hedge":
                logits = np.array(self.gains_)
                logits -= np.max(logits)
                exp_logits = np.exp(self.eta * logits)
                probs = exp_logits / np.sum(exp_logits)
                next_x = self.next_xs_[np.argmax(self.rng.multinomial(1,
                                                                      probs))]
            else:
                next_x = self.next_xs_[0]

            # note the need for [0] at the end
            self._next_x = self.space.inverse_transform(
                next_x.reshape((1, -1)))[0]

        # Pack results
        return create_result(self.Xi, self.yi, self.space, self.rng,
                             models=self.models)

    def run(self, func, n_iter=1):
        """Execute ask() + tell() `n_iter` times"""
        for _ in range(n_iter):
            x = self.ask()
            self.tell(x, func(x))

        return create_result(self.Xi, self.yi, self.space, self.rng,
                             models=self.models)


text:
import {combineReducers} from 'redux';
import params from './AppReducer';

//----------------------------------------------------//
// Add reducers as neccessary.                        //
// A popular convention is to name reducers           //
// after the state slices they manage, so             //
// you can use ES6 property shorthand notation        //
// http://redux.js.org/docs/api/combineReducers.html  //
//----------------------------------------------------//
const rootReducer = combineReducers({
  params
});

export default rootReducer;


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.automation.models;

import com.azure.core.http.rest.Response;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.automation.fluent.models.HybridRunbookWorkerInner;
import java.time.OffsetDateTime;

/** An immutable client-side representation of HybridRunbookWorker. */
public interface HybridRunbookWorker {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the systemData property: Resource system metadata.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the ip property: Gets or sets the assigned machine IP address.
     *
     * @return the ip value.
     */
    String ip();

    /**
     * Gets the registeredDateTime property: Gets or sets the registration time of the worker machine.
     *
     * @return the registeredDateTime value.
     */
    OffsetDateTime registeredDateTime();

    /**
     * Gets the lastSeenDateTime property: Last Heartbeat from the Worker.
     *
     * @return the lastSeenDateTime value.
     */
    OffsetDateTime lastSeenDateTime();

    /**
     * Gets the vmResourceId property: Azure Resource Manager Id for a virtual machine.
     *
     * @return the vmResourceId value.
     */
    String vmResourceId();

    /**
     * Gets the workerType property: Type of the HybridWorker.
     *
     * @return the workerType value.
     */
    WorkerType workerType();

    /**
     * Gets the workerName property: Name of the HybridWorker.
     *
     * @return the workerName value.
     */
    String workerName();

    /**
     * Gets the inner com.azure.resourcemanager.automation.fluent.models.HybridRunbookWorkerInner object.
     *
     * @return the inner object.
     */
    HybridRunbookWorkerInner innerModel();

    /** The entirety of the HybridRunbookWorker definition. */
    interface Definition
        extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
    }
    /** The HybridRunbookWorker definition stages. */
    interface DefinitionStages {
        /** The first stage of the HybridRunbookWorker definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the HybridRunbookWorker definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName.
             *
             * @param resourceGroupName Name of an Azure Resource group.
             * @param automationAccountName The name of the automation account.
             * @param hybridRunbookWorkerGroupName The hybrid runbook worker group name.
             * @return the next definition stage.
             */
            WithCreate withExistingHybridRunbookWorkerGroup(
                String resourceGroupName, String automationAccountName, String hybridRunbookWorkerGroupName);
        }
        /**
         * The stage of the HybridRunbookWorker definition which contains all the minimum required properties for the
         * resource to be created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate extends DefinitionStages.WithName, DefinitionStages.WithVmResourceId {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            HybridRunbookWorker create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            HybridRunbookWorker create(Context context);
        }
        /** The stage of the HybridRunbookWorker definition allowing to specify name. */
        interface WithName {
            /**
             * Specifies the name property: Gets or sets the name of the resource..
             *
             * @param name Gets or sets the name of the resource.
             * @return the next definition stage.
             */
            WithCreate withName(String name);
        }
        /** The stage of the HybridRunbookWorker definition allowing to specify vmResourceId. */
        interface WithVmResourceId {
            /**
             * Specifies the vmResourceId property: Azure Resource Manager Id for a virtual machine..
             *
             * @param vmResourceId Azure Resource Manager Id for a virtual machine.
             * @return the next definition stage.
             */
            WithCreate withVmResourceId(String vmResourceId);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    HybridRunbookWorker refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    HybridRunbookWorker refresh(Context context);

    /**
     * Move a hybrid worker to a different group.
     *
     * @param hybridRunbookWorkerMoveParameters The hybrid runbook worker move parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void move(HybridRunbookWorkerMoveParameters hybridRunbookWorkerMoveParameters);

    /**
     * Move a hybrid worker to a different group.
     *
     * @param hybridRunbookWorkerMoveParameters The hybrid runbook worker move parameters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    Response<Void> moveWithResponse(
        HybridRunbookWorkerMoveParameters hybridRunbookWorkerMoveParameters, Context context);
}


text:
const Botkit = require('botkit');

class SlackBot {
    constructor(storage, log) {
        // track all bots created
        this._bots = {}
        this.log = log

        // create Botkit controller
        this.controller = Botkit.slackbot({
            stats_optout: true,
            storage: storage
        }).configureSlackApp({
            clientId: process.env.SLACK_CLIENT_ID,
            clientSecret: process.env.SLACK_CLIENT_SECRET,
            scopes: ['bot']
        })

        // setup webserver to handle events and oauth requests
        this._setupWebserver();

        // register create_bot event to take care of bot tracking
        this.controller.on('create_bot', (bot) => {
            if (!this._bots[bot.config.token]) {
                bot.startRTM((err) => {
                    if (err) {
                        this.log.error(err);
                        process.abort();
                    }

                    this._trackBot(bot);
                })
            }
        })

        // connect bot to all teams
        this._connectBots()
    }

    _connectBots() {
        this.controller.storage.teams.all((err, teams) => {
            if (err) {
                throw new Error(err)
            }

            teams.forEach((team) => {
                if (team.bot) {
                    // TODO: throttle this call to prevent hitting the rate-limit on start.rtm
                    const bot = this.controller.spawn(team).startRTM((err) => {
                        if (err) {
                            this.log.warn(`Error connecting bot to slack team: ${err}`)
                        } else {
                            this._trackBot(bot)
                        }
                    })
                }
            })
        })
    }

    _setupWebserver() {
        this.controller.setupWebserver(process.env.PORT, (err, server) => {
            if (err) {
                this.log.error(err)
                process.abort()
            }

            this.controller.createWebhookEndpoints(server);
            this.controller.createOauthEndpoints(server, (err, req, res) => {
                if (err) {
                    res.status(500).send(`ERROR: ${err}`)
                } else {
                    res.send('Success')
                }
            })
        })
    }

    _trackBot(bot) {
        this._bots[bot.config.token] = bot;
    }
}

module.exports = SlackBot


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 334762 $ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="hwapi.content-mimetype">
 <refnamediv>
  <refname>hw_api_content::mimetype</refname>
  <refpurpose>Returns mimetype</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>string</type><methodname>hw_api_content::mimetype</methodname>
   <void/>
  </methodsynopsis>
  <para>
   Returns the mimetype of the content.
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns the mimetype as a string.
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 * @class Ext.chart.Legend
 * @extends Ext.dataview.DataView
 *
 * A default legend for charts.
 *
 *     @example preview
 *     var chart = new Ext.chart.Chart({
 *         animate: true,
 *         store: {
 *           fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5'],
 *           data: [
 *               {'name':'metric one', 'data1':10, 'data2':12, 'data3':14, 'data4':8, 'data5':13},
 *               {'name':'metric two', 'data1':7, 'data2':8, 'data3':16, 'data4':10, 'data5':3},
 *               {'name':'metric three', 'data1':5, 'data2':2, 'data3':14, 'data4':12, 'data5':7},
 *               {'name':'metric four', 'data1':2, 'data2':14, 'data3':6, 'data4':1, 'data5':23},
 *               {'name':'metric five', 'data1':27, 'data2':38, 'data3':36, 'data4':13, 'data5':33}
 *           ]
 *         },
 *         legend: {
 *           position: 'bottom'
 *         },
 *         axes: [{
 *             type: 'numeric',
 *             position: 'left',
 *             fields: ['data1'],
 *             title: {
 *                 text: 'Sample Values',
 *                 fontSize: 15
 *             },
 *             grid: true,
 *             minimum: 0
 *         }, {
 *             type: 'category',
 *             position: 'bottom',
 *             fields: ['name'],
 *             title: {
 *                 text: 'Sample Values',
 *                 fontSize: 15
 *             }
 *         }],
 *         series: [{
 *             type: 'area',
 *             title: ['Data1', 'Data2', 'Data3'],
 *             subStyle: {
 *                 fill: ['blue', 'green', 'red']
 *             },
 *             xField: 'name',
 *             yField: ['data1', 'data2', 'data3']
 *
 *         }]
 *     });
 *     Ext.Viewport.setLayout('fit');
 *     Ext.Viewport.add(chart);
 */
Ext.define("Ext.chart.Legend", {
    xtype: 'legend',
    extend: "Ext.dataview.DataView",
    config: {
        itemTpl: [
            "<span class=\"x-legend-item-marker {[values.disabled?\'x-legend-inactive\':\'\']}\" style=\"background:{mark};\"></span>{name}"
        ],
        baseCls: 'x-legend',
        padding: 5,
        disableSelection: true,
        inline: true,
        /**
         * @cfg {String} position
         * @deprecated Use `docked` instead.
         * Delegates to `docked`
         */
        position: 'top',
        horizontalHeight: 48,
        verticalWidth: 150
    },

    constructor: function () {
        this.callSuper(arguments);

        var scroller = this.getScrollable().getScroller(),
            onDrag = scroller.onDrag;
        scroller.onDrag = function (e) {
            e.stopPropagation();
            onDrag.call(this, e);
        };
    },

    doSetDocked: function (docked) {
        this.callSuper(arguments);
        if (docked === 'top' || docked === 'bottom') {
            this.setLayout({type: 'hbox', pack: 'center'});
            this.setInline(true);
            // TODO: Remove this when possible
            this.setWidth(null);
            this.setHeight(this.getHorizontalHeight());
            this.setScrollable({direction: 'horizontal' });
        } else {
            this.setLayout({pack: 'center'});
            this.setInline(false);
            // TODO: Remove this when possible
            this.setWidth(this.getVerticalWidth());
            this.setHeight(null);
            this.setScrollable({direction: 'vertical' });
        }
    },

    updatePosition: function (position) {
        this.setDocked(position);
    },

    onItemTap: function (container, target, index, e) {
        this.callSuper(arguments);
        var me = this,
            store = me.getStore(),
            record = store && store.getAt(index);
        record.beginEdit();
        record.set('disabled', !record.get('disabled'));
        record.commit();
    }
});


text:
package me.ehlxr.cache;

import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;

/**
 * Created by lixiangrong on 2017/4/11.
 */
public class TestFutureCahe<K, V> {
    private final ConcurrentHashMap<K, Future<V>> cacheMap = new ConcurrentHashMap<K, Future<V>>();

    public static void main(String[] args) {
        final TestFutureCahe<String, String> TestGuaVA = new TestFutureCahe<String, String>();

        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {

                System.out.println("T1======start========");
                Object value = TestGuaVA.getCache("key", "T1");
                System.out.println("T1 value==============" + value);
                System.out.println("T1======end========");

            }
        });

        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("T2======start========");
                Object value = TestGuaVA.getCache("key", "T2");
                System.out.println("T2 value==============" + value);
                System.out.println("T2======end========");

            }
        });

        Thread t3 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("T3======start========");
                Object value = TestGuaVA.getCache("key", "T3");
                System.out.println("T3 value==============" + value);
                System.out.println("T3======end========");

            }
        });

        t1.start();
        t2.start();
        t3.start();

    }

    public Object getCache(K keyValue, String ThreadName) {
        Future<V> value = null;
        try {
            System.out.println("ThreadName getCache==============" + ThreadName);
            //从缓存获取数据
            value = cacheMap.get(keyValue);
            //如果没有的话,把数据放到缓存
            if (value == null) {
                value = putCache(keyValue, ThreadName);
                return value.get();
            }
            return value.get();

        } catch (Exception e) {
        }
        return null;
    }

    public Future<V> putCache(K keyValue, final String ThreadName) {
        //      //把数据放到缓存
        Future<V> value = null;
        Callable<V> callable = new Callable<V>() {
            @SuppressWarnings("unchecked")
            @Override
            public V call() throws Exception {
                //可以根据业务从数据库获取等取得数据,这边就模拟已经获取数据了
                System.out.println("ThreadName 执行业务数据并返回处理结果的数据(访问数据库等)==============" + ThreadName);
                return (V) "dataValue";
            }
        };
        FutureTask<V> futureTask = new FutureTask<V>(callable);
        value = cacheMap.putIfAbsent(keyValue, futureTask);
        if (value == null) {
            value = futureTask;
            futureTask.run();
        }
        return value;
    }

}


text:
<scan-settings-section>

    [[i18n('resolutionDropdownLabel')]]

    <select id="resolutionSelect" class="md-select"
        value="{{selectedOption::change}}" disabled="[[disabled]]"
        aria-labelledby="resolutionLabel">
      <template is="dom-repeat" items="[[options]]" as="resolution">
        <option value="[[resolution]]"
            selected$="[[isDefaultOption(resolution)]]">
          [[getResolutionString_(resolution)]]
        </option>
      </template>
    </select>

</scan-settings-section>


text:
id: 106
title: Eleganto Responsive Minimal Blogger Template Premium Free
date: 2019-12-10T07:16:00+00:00
author: admin
layout: post
guid: http://localhost/wordpress/2019/12/10/eleganto-responsive-minimal-blogger-template-premium-free/
permalink: /2019/12/10/eleganto-responsive-minimal-blogger-template-premium-free/
tdc_dirty_content:
  - "1"
tdc_icon_fonts:
  - 'a:0:{}'
cyberseo_rss_source:
  - https://www.psdly.com/blogger-template/feed?paged=9
cyberseo_post_link:
  - https://www.psdly.com/eleganto-blogger-template-premium
categories:
  - Uncategorized
---

        Eleganto Blogger Template Premium Free Download

    Download Free Eleganto Responsive Minimal Blogger Template Premium version, no encrypted code and nulled version. Original premium XML Eleganto theme file. You can use your own website footer credit and unlimited domains.

Premium Eleganto Blogger Template has full responsiveness design support all browser popular browsers like chrome, opera, safari, firefox and more. Eleganto has an advance admin layout it helps you to customize your website easily without coding.

        Download free Eleganto Responsive Minimal Blogger Template Premium

Eleganto Responsive Blogger Template Release on 21/12/2015 by Templateyard. This Template Supports Featured Slider, Special Ad Spot, Shortcodes and much more HTML and CSS gadget like subscribe box, search widget, 404 pages, social plugins, ad spot.

Check Out Some More Blogger Template:

Hope this article helpful for you. Before the close, this page kindly gives us your valuable comments or share this article on social media networks to grow up my website fastly.