text:
"""
Python implementation of the fast ICA algorithms.

Reference: Tables 8.3 and 8.4 page 196 in the book:
Independent Component Analysis, by  Hyvarinen et al.
"""

# Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux,
#          Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann
# License: BSD 3 clause

import warnings

import numpy as np
from scipy import linalg

from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..externals.six import moves
from ..externals.six import string_types
from ..utils import check_array, as_float_array, check_random_state
from ..utils.validation import check_is_fitted
from ..utils.validation import FLOAT_DTYPES

__all__ = ['fastica', 'FastICA']

def _gs_decorrelation(w, W, j):
    """
    Orthonormalize w wrt the first j rows of W

    Parameters
    ----------
    w : ndarray of shape(n)
        Array to be orthogonalized

    W : ndarray of shape(p, n)
        Null space definition

    j : int < p
        The no of (from the first) rows of Null space W wrt which w is
        orthogonalized.

    Notes
    -----
    Assumes that W is orthogonal
    w changed in place
    """
    w -= np.dot(np.dot(w, W[:j].T), W[:j])
    return w

def _sym_decorrelation(W):
    """ Symmetric decorrelation
    i.e. W <- (W * W.T) ^{-1/2} * W
    """
    s, u = linalg.eigh(np.dot(W, W.T))
    # u (resp. s) contains the eigenvectors (resp. square roots of
    # the eigenvalues) of W * W.T
    return np.dot(np.dot(u * (1. / np.sqrt(s)), u.T), W)

def _ica_def(X, tol, g, fun_args, max_iter, w_init):
    """Deflationary FastICA using fun approx to neg-entropy function

    Used internally by FastICA.
    """

    n_components = w_init.shape[0]
    W = np.zeros((n_components, n_components), dtype=X.dtype)
    n_iter = []

    # j is the index of the extracted component
    for j in range(n_components):
        w = w_init[j, :].copy()
        w /= np.sqrt((w ** 2).sum())

        for i in moves.xrange(max_iter):
            gwtx, g_wtx = g(np.dot(w.T, X), fun_args)

            w1 = (X * gwtx).mean(axis=1) - g_wtx.mean() * w

            _gs_decorrelation(w1, W, j)

            w1 /= np.sqrt((w1 ** 2).sum())

            lim = np.abs(np.abs((w1 * w).sum()) - 1)
            w = w1
            if lim < tol:
                break

        n_iter.append(i + 1)
        W[j, :] = w

    return W, max(n_iter)

def _ica_par(X, tol, g, fun_args, max_iter, w_init):
    """Parallel FastICA.

    Used internally by FastICA --main loop

    """
    W = _sym_decorrelation(w_init)
    del w_init
    p_ = float(X.shape[1])
    for ii in moves.xrange(max_iter):
        gwtx, g_wtx = g(np.dot(W, X), fun_args)
        W1 = _sym_decorrelation(np.dot(gwtx, X.T) / p_
                                - g_wtx[:, np.newaxis] * W)
        del gwtx, g_wtx
        # builtin max, abs are faster than numpy counter parts.
        lim = max(abs(abs(np.diag(np.dot(W1, W.T))) - 1))
        W = W1
        if lim < tol:
            break
    else:
        warnings.warn('FastICA did not converge. Consider increasing '
                      'tolerance or the maximum number of iterations.')

    return W, ii + 1

# Some standard non-linear functions.
# XXX: these should be optimized, as they can be a bottleneck.
def _logcosh(x, fun_args=None):
    alpha = fun_args.get('alpha', 1.0)  # comment it out?

    x *= alpha
    gx = np.tanh(x, x)  # apply the tanh inplace
    g_x = np.empty(x.shape[0])
    # XXX compute in chunks to avoid extra allocation
    for i, gx_i in enumerate(gx):  # please don't vectorize.
        g_x[i] = (alpha * (1 - gx_i ** 2)).mean()
    return gx, g_x

def _exp(x, fun_args):
    exp = np.exp(-(x ** 2) / 2)
    gx = x * exp
    g_x = (1 - x ** 2) * exp
    return gx, g_x.mean(axis=-1)

def _cube(x, fun_args):
    return x ** 3, (3 * x ** 2).mean(axis=-1)

def fastica(X, n_components=None, algorithm="parallel", whiten=True,
            fun="logcosh", fun_args=None, max_iter=200, tol=1e-04, w_init=None,
            random_state=None, return_X_mean=False, compute_sources=True,
            return_n_iter=False):
    """Perform Fast Independent Component Analysis.

    Read more in the :ref:`User Guide <ICA>`.

    Parameters
    ----------
    X : array-like, shape (n_samples, n_features)
        Training vector, where n_samples is the number of samples and
        n_features is the number of features.

    n_components : int, optional
        Number of components to extract. If None no dimension reduction
        is performed.

    algorithm : {'parallel', 'deflation'}, optional
        Apply a parallel or deflational FASTICA algorithm.

    whiten : boolean, optional
        If True perform an initial whitening of the data.
        If False, the data is assumed to have already been
        preprocessed: it should be centered, normed and white.
        Otherwise you will get incorrect results.
        In this case the parameter n_components will be ignored.

    fun : string or function, optional. Default: 'logcosh'
        The functional form of the G function used in the
        approximation to neg-entropy. Could be either 'logcosh', 'exp',
        or 'cube'.
        You can also provide your own function. It should return a tuple
        containing the value of the function, and of its derivative, in the
        point. Example:

        def my_g(x):
            return x ** 3, 3 * x ** 2

    fun_args : dictionary, optional
        Arguments to send to the functional form.
        If empty or None and if fun='logcosh', fun_args will take value
        {'alpha' : 1.0}

    max_iter : int, optional
        Maximum number of iterations to perform.

    tol : float, optional
        A positive scalar giving the tolerance at which the
        un-mixing matrix is considered to have converged.

    w_init : (n_components, n_components) array, optional
        Initial un-mixing array of dimension (n.comp,n.comp).
        If None (default) then an array of normal r.v.'s is used.

    random_state : int, RandomState instance or None, optional (default=None)
        If int, random_state is the seed used by the random number generator;
        If RandomState instance, random_state is the random number generator;
        If None, the random number generator is the RandomState instance used
        by `np.random`.

    return_X_mean : bool, optional
        If True, X_mean is returned too.

    compute_sources : bool, optional
        If False, sources are not computed, but only the rotation matrix.
        This can save memory when working with big data. Defaults to True.

    return_n_iter : bool, optional
        Whether or not to return the number of iterations.

    Returns
    -------
    K : array, shape (n_components, n_features) | None.
        If whiten is 'True', K is the pre-whitening matrix that projects data
        onto the first n_components principal components. If whiten is 'False',
        K is 'None'.

    W : array, shape (n_components, n_components)
        Estimated un-mixing matrix.
        The mixing matrix can be obtained by::

            w = np.dot(W, K.T)
            A = w.T * (w * w.T).I

    S : array, shape (n_samples, n_components) | None
        Estimated source matrix

    X_mean : array, shape (n_features, )
        The mean over features. Returned only if return_X_mean is True.

    n_iter : int
        If the algorithm is "deflation", n_iter is the
        maximum number of iterations run across all components. Else
        they are just the number of iterations taken to converge. This is
        returned only when return_n_iter is set to `True`.

    Notes
    -----

    The data matrix X is considered to be a linear combination of
    non-Gaussian (independent) components i.e. X = AS where columns of S
    contain the independent components and A is a linear mixing
    matrix. In short ICA attempts to `un-mix' the data by estimating an
    un-mixing matrix W where ``S = W K X.``

    This implementation was originally made for data of shape
    [n_features, n_samples]. Now the input is transposed
    before the algorithm is applied. This makes it slightly
    faster for Fortran-ordered input.

    Implemented using FastICA:
    `A. Hyvarinen and E. Oja, Independent Component Analysis:
    Algorithms and Applications, Neural Networks, 13(4-5), 2000,
    pp. 411-430`

    """
    random_state = check_random_state(random_state)
    fun_args = {} if fun_args is None else fun_args
    # make interface compatible with other decompositions
    # a copy is required only for non whitened data
    X = check_array(X, copy=whiten, dtype=FLOAT_DTYPES).T

    alpha = fun_args.get('alpha', 1.0)
    if not 1 <= alpha <= 2:
        raise ValueError('alpha must be in [1,2]')

    if fun == 'logcosh':
        g = _logcosh
    elif fun == 'exp':
        g = _exp
    elif fun == 'cube':
        g = _cube
    elif callable(fun):
        def g(x, fun_args):
            return fun(x, **fun_args)
    else:
        exc = ValueError if isinstance(fun, six.string_types) else TypeError
        raise exc("Unknown function %r;"
                  " should be one of 'logcosh', 'exp', 'cube' or callable"
                  % fun)

    n, p = X.shape

    if not whiten and n_components is not None:
        n_components = None
        warnings.warn('Ignoring n_components with whiten=False.')

    if n_components is None:
        n_components = min(n, p)
    if (n_components > min(n, p)):
        n_components = min(n, p)
        warnings.warn('n_components is too large: it will be set to %s' % n_components)

    if whiten:
        # Centering the columns (ie the variables)
        X_mean = X.mean(axis=-1)
        X -= X_mean[:, np.newaxis]

        # Whitening and preprocessing by PCA
        u, d, _ = linalg.svd(X, full_matrices=False)

        del _
        K = (u / d).T[:n_components]  # see (6.33) p.140
        del u, d
        X1 = np.dot(K, X)
        # see (13.6) p.267 Here X1 is white and data
        # in X has been projected onto a subspace by PCA
        X1 *= np.sqrt(p)
    else:
        # X must be casted to floats to avoid typing issues with numpy
        # 2.0 and the line below
        X1 = as_float_array(X, copy=False)  # copy has been taken care of

    if w_init is None:
        w_init = np.asarray(random_state.normal(size=(n_components,
                            n_components)), dtype=X1.dtype)

    else:
        w_init = np.asarray(w_init)
        if w_init.shape != (n_components, n_components):
            raise ValueError('w_init has invalid shape -- should be %(shape)s'
                             % {'shape': (n_components, n_components)})

    kwargs = {'tol': tol,
              'g': g,
              'fun_args': fun_args,
              'max_iter': max_iter,
              'w_init': w_init}

    if algorithm == 'parallel':
        W, n_iter = _ica_par(X1, **kwargs)
    elif algorithm == 'deflation':
        W, n_iter = _ica_def(X1, **kwargs)
    else:
        raise ValueError('Invalid algorithm: must be either `parallel` or'
                         ' `deflation`.')
    del X1

    if whiten:
        if compute_sources:
            S = np.dot(np.dot(W, K), X).T
        else:
            S = None
        if return_X_mean:
            if return_n_iter:
                return K, W, S, X_mean, n_iter
            else:
                return K, W, S, X_mean
        else:
            if return_n_iter:
                return K, W, S, n_iter
            else:
                return K, W, S

    else:
        if compute_sources:
            S = np.dot(W, X).T
        else:
            S = None
        if return_X_mean:
            if return_n_iter:
                return None, W, S, None, n_iter
            else:
                return None, W, S, None
        else:
            if return_n_iter:
                return None, W, S, n_iter
            else:
                return None, W, S

class FastICA(BaseEstimator, TransformerMixin):
    """FastICA: a fast algorithm for Independent Component Analysis.

    Read more in the :ref:`User Guide <ICA>`.

    Parameters
    ----------
    n_components : int, optional
        Number of components to use. If none is passed, all are used.

    algorithm : {'parallel', 'deflation'}
        Apply parallel or deflational algorithm for FastICA.

    whiten : boolean, optional
        If whiten is false, the data is already considered to be
        whitened, and no whitening is performed.

    fun : string or function, optional. Default: 'logcosh'
        The functional form of the G function used in the
        approximation to neg-entropy. Could be either 'logcosh', 'exp',
        or 'cube'.
        You can also provide your own function. It should return a tuple
        containing the value of the function, and of its derivative, in the
        point. Example:

        def my_g(x):
            return x ** 3, 3 * x ** 2

    fun_args : dictionary, optional
        Arguments to send to the functional form.
        If empty and if fun='logcosh', fun_args will take value
        {'alpha' : 1.0}.

    max_iter : int, optional
        Maximum number of iterations during fit.

    tol : float, optional
        Tolerance on update at each iteration.

    w_init : None of an (n_components, n_components) ndarray
        The mixing matrix to be used to initialize the algorithm.

    random_state : int, RandomState instance or None, optional (default=None)
        If int, random_state is the seed used by the random number generator;
        If RandomState instance, random_state is the random number generator;
        If None, the random number generator is the RandomState instance used
        by `np.random`.

    Attributes
    ----------
    components_ : 2D array, shape (n_components, n_features)
        The unmixing matrix.

    mixing_ : array, shape (n_features, n_components)
        The mixing matrix.

    n_iter_ : int
        If the algorithm is "deflation", n_iter is the
        maximum number of iterations run across all components. Else
        they are just the number of iterations taken to converge.

    Notes
    -----
    Implementation based on
    `A. Hyvarinen and E. Oja, Independent Component Analysis:
    Algorithms and Applications, Neural Networks, 13(4-5), 2000,
    pp. 411-430`

    """
    def __init__(self, n_components=None, algorithm='parallel', whiten=True,
                 fun='logcosh', fun_args=None, max_iter=200, tol=1e-4,
                 w_init=None, random_state=None):
        super(FastICA, self).__init__()
        self.n_components = n_components
        self.algorithm = algorithm
        self.whiten = whiten
        self.fun = fun
        self.fun_args = fun_args
        self.max_iter = max_iter
        self.tol = tol
        self.w_init = w_init
        self.random_state = random_state

    def _fit(self, X, compute_sources=False):
        """Fit the model

        Parameters
        ----------
        X : array-like, shape (n_samples, n_features)
            Training data, where n_samples is the number of samples
            and n_features is the number of features.

        compute_sources : bool
            If False, sources are not computes but only the rotation matrix.
            This can save memory when working with big data. Defaults to False.

        Returns
        -------
            X_new : array-like, shape (n_samples, n_components)
        """
        fun_args = {} if self.fun_args is None else self.fun_args
        whitening, unmixing, sources, X_mean, self.n_iter_ = fastica(
            X=X, n_components=self.n_components, algorithm=self.algorithm,
            whiten=self.whiten, fun=self.fun, fun_args=fun_args,
            max_iter=self.max_iter, tol=self.tol, w_init=self.w_init,
            random_state=self.random_state, return_X_mean=True,
            compute_sources=compute_sources, return_n_iter=True)

        if self.whiten:
            self.components_ = np.dot(unmixing, whitening)
            self.mean_ = X_mean
            self.whitening_ = whitening
        else:
            self.components_ = unmixing

        self.mixing_ = linalg.pinv(self.components_)

        if compute_sources:
            self.__sources = sources

        return sources

    def fit_transform(self, X, y=None):
        """Fit the model and recover the sources from X.

        Parameters
        ----------
        X : array-like, shape (n_samples, n_features)
            Training data, where n_samples is the number of samples
            and n_features is the number of features.

        y : Ignored.

        Returns
        -------
        X_new : array-like, shape (n_samples, n_components)
        """
        return self._fit(X, compute_sources=True)

    def fit(self, X, y=None):
        """Fit the model to X.

        Parameters
        ----------
        X : array-like, shape (n_samples, n_features)
            Training data, where n_samples is the number of samples
            and n_features is the number of features.

        y : Ignored.

        Returns
        -------
        self
        """
        self._fit(X, compute_sources=False)
        return self

    def transform(self, X, y='deprecated', copy=True):
        """Recover the sources from X (apply the unmixing matrix).

        Parameters
        ----------
        X : array-like, shape (n_samples, n_features)
            Data to transform, where n_samples is the number of samples
            and n_features is the number of features.
        y : (ignored)
            .. deprecated:: 0.19
               This parameter will be removed in 0.21.
        copy : bool (optional)
            If False, data passed to fit are overwritten. Defaults to True.

        Returns
        -------
        X_new : array-like, shape (n_samples, n_components)
        """
        if not isinstance(y, string_types) or y != 'deprecated':
            warnings.warn("The parameter y on transform() is "
                          "deprecated since 0.19 and will be removed in 0.21",
                          DeprecationWarning)

        check_is_fitted(self, 'mixing_')

        X = check_array(X, copy=copy, dtype=FLOAT_DTYPES)
        if self.whiten:
            X -= self.mean_

        return np.dot(X, self.components_.T)

    def inverse_transform(self, X, copy=True):
        """Transform the sources back to the mixed data (apply mixing matrix).

        Parameters
        ----------
        X : array-like, shape (n_samples, n_components)
            Sources, where n_samples is the number of samples
            and n_components is the number of components.
        copy : bool (optional)
            If False, data passed to fit are overwritten. Defaults to True.

        Returns
        -------
        X_new : array-like, shape (n_samples, n_features)
        """
        check_is_fitted(self, 'mixing_')

        X = check_array(X, copy=(copy and self.whiten), dtype=FLOAT_DTYPES)
        X = np.dot(X, self.mixing_.T)
        if self.whiten:
            X += self.mean_

        return X


text:
/**
 * Java Factorial Using Recursion Example
 * This Java example shows how to generate factorial of a given number
 * using recursive function.
 *
 * @author Keeyana Jones <keeyanajones@yahoo.com>
 *
 **/
package javaproject;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class JavaFactorialUsingRecursion {

    public static void main(String args[]) throws NumberFormatException, IOException {

        System.out.println("Enter the number: ");

        // get input from the user
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());

        // call the recursive function to generate factorial
        int result= fact(a);

        System.out.println("Factorial of the number is: " + result);
    }

    static int fact(int b) {
        if (b <= 1)
            // if the number is 1 then return 1
            return 1;
        else
            // else call the same function with the value - 1
            return b * fact(b - 1);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package eu.cloudopting.docker.cluster;

import java.io.File;

/**
 *
 * Represents a machine
 *
 */
public class Machine {
	private String hostname;
	private int port;
	private int dockerPort;
	private File privateKey;
	private String passphrase;
	private String user;
	private String password;

	/**
	 * New machine from private key + passphrase credentials.
	 * @param hostname Hostname or ip address
	 * @param port SSH port
	 * @param privateKey Private key with SSH privileges
	 * @param passphrase Passphrase to decrypt the privateKey. Null if passphrase not needed.
	 */
	public Machine(String hostname, int port, File privateKey, String passphrase){
		this.hostname = hostname;
		this.port = port;
		this.privateKey = privateKey;
		this.passphrase = passphrase;
		this.user = null;
		this.password = null;
		this.dockerPort = 0;
	}

	/**
	 * New machine from user + password credentials.
	 * @param hostname Hostname or ip address
	 * @param port SSH port
	 * @param user User
	 * @param password Password for user
	 */
	public Machine(String hostname, int port, String user, String password){
		this.hostname = hostname;
		this.port = port;
		this.user = user;
		this.password = password;
		this.privateKey = null;
		this.passphrase = null;
		this.dockerPort = 0;
	}

	/**
	 * New machine from docker port.
	 * @param hostname Hostname or ip address
	 * @param dockerPort Docker port
	 */
	public Machine(String hostname, int dockerPort){
		this.hostname = hostname;
		this.port = 0;
		this.privateKey = null;
		this.passphrase = null;
		this.user = null;
		this.password = null;
		this.dockerPort = dockerPort;
	}

	/**
	 * @return the hostname
	 */
	public String getHostname() {
		return hostname;
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return port;
	}

	/**
	 * @return the privateKey
	 */
	public File getPrivateKey() {
		return privateKey;
	}

	/**
	 * @return the passphrase
	 */
	public String getPassphrase() {
		return passphrase;
	}

	/**
	 * @return the user
	 */
	public String getUser() {
		return user;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @return the dockerPort
	 */
	public int getDockerPort() {
		return dockerPort;
	}

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Uredo tephrosiae Rabenh.

### Remarks
null


text:
/* eslint-disable prefer-arrow-callback */

import { Meteor } from 'meteor/meteor';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';

import { Todos } from '../todos.js';
import { Lists } from '../../lists/lists.js';

Meteor.publishComposite('todos.inList', function todosInList(listId) {
  new SimpleSchema({
    listId: { type: String },
  }).validate({ listId });

  const userId = this.userId;

  return {
    find() {
      const query = {
        _id: listId,
        $or: [{ userId: { $exists: false } }, { userId }],
      };

      // We only need the _id field in this query, since it's only
      // used to drive the child queries to get the todos
      const options = {
        fields: { _id: 1, name: 1 },
      };

      return Lists.find(query, options);
    },

    children: [{
      find(list) {
        console.log('list :'+list.name+' '+list._id);
        if(list.name=='全部'){
          const lists = Lists.find({ $or: [
            { userId: { $exists: false } },
            { userId: userId },
          ] }).fetch();
          var cout=0;
          let lids = lists.map((l, index) => {
            cout+=l.incompleteCount;
            return l._id;
          })
          list.incompleteCount=cout;
          console.log('in:'+lids);
          return Todos.find({ listId: {$in: lids} }, {fields: Todos.publicFields});
        }else
          return Todos.find({ listId: list._id }, { fields: Todos.publicFields });
      },
    }],
  };
});

//c4w 8.6
Meteor.publishComposite('todos.inTodo', function todosInTodo(todoId) {
  new SimpleSchema({
    todoId: { type: String },
  }).validate({ todoId });

  //const userId = this.userId;

  return {
    find() {
      const query = {
        _id: todoId,
        //$or: [{ userId: { $exists: false } }, { userId }],
      };

      // We only need the _id field in this query, since it's only
      // used to drive the child queries to get the todos
      return Todos.find(query, { fields: Todos.publicFields });
    },
  };
});


text:
.. _toy weather data:

Toy weather data
================

Here is an example of how to easily manipulate a toy weather dataset using
xray and other recommended Python libraries:

.. contents::
   :local:
   :depth: 1

Shared setup:

.. literalinclude:: _code/weather_data_setup.py

.. ipython:: python
   :suppress:

   execfile("examples/_code/weather_data_setup.py")

Examine a dataset with pandas_ and seaborn_
-------------------------------------------

.. _pandas: http://pandas.pydata.org
.. _seaborn: http://stanford.edu/~mwaskom/software/seaborn

.. ipython:: python

    ds

    df = ds.to_dataframe()

    df.head()

    df.describe()

    @savefig examples_tmin_tmax_plot.png
    ds.mean(dim='location').to_dataframe().plot()

.. ipython::
    :verbatim:

    In [6]: sns.pairplot(df.reset_index(), vars=ds.data_vars)
    Out[6]: <seaborn.axisgrid.PairGrid at 0x7f0fd2368a10>

.. image:: examples_pairplot.png

.. .. ipython:: python
    @savefig examples_pairplot.png
    sns.pairplot(df.reset_index(), vars=ds.data_vars)

.. _average by month:

Probability of freeze by calendar month
---------------------------------------

.. ipython:: python

    freeze = (ds['tmin'] <= 0).groupby('time.month').mean('time')
    freeze

    @savefig examples_freeze_prob.png
    freeze.to_pandas().plot()

.. _monthly average:

Monthly averaging
-----------------

.. ipython:: python

    monthly_avg = ds.resample('1MS', dim='time', how='mean')

    @savefig examples_tmin_tmax_plot_mean.png
    monthly_avg.sel(location='IA').to_dataframe().plot(style='s-')

Note that ``MS`` here refers to Month-Start; ``M`` labels Month-End (the last
day of the month).

.. _monthly anomalies:

Calculate monthly anomalies
---------------------------

In climatology, "anomalies" refer to the difference between observations and
typical weather for a particular season. Unlike observations, anomalies should
not show any seasonal cycle.

.. ipython:: python

    climatology = ds.groupby('time.month').mean('time')
    anomalies = ds.groupby('time.month') - climatology

    @savefig examples_anomalies_plot.png
    anomalies.mean('location').to_dataframe()[['tmin', 'tmax']].plot()

.. _fill with climatology:

Fill missing values with climatology
------------------------------------

The :py:func:`~xray.Dataset.fillna` method on grouped objects lets you easily
fill missing values by group:

.. ipython:: python

    # throw away the first half of every month
    some_missing = ds.tmin.sel(time=ds['time.day'] > 15).reindex_like(ds)
    filled = some_missing.groupby('time.month').fillna(climatology.tmin)

    both = xray.Dataset({'some_missing': some_missing, 'filled': filled})
    both

    df = both.sel(time='2000').mean('location').reset_coords(drop=True).to_dataframe()

    @savefig examples_filled.png
    df[['filled', 'some_missing']].plot()


text:
Downloaded the bacteria.good.tgz file from Pat's dropbox folder.

Uploaded to SuperMikeII:
```
$ scp bacteria.good.tgz jcthrash@mike.hpc.lsu.edu:~/
```

Uncompressed:
```
$ tar -zxvf bacteria.good.tgz
```

Spent time exploring text file, looking for environmental information.
```
$ head bacteria.good.metadata
$ head bacteria.good.metadata | cut -f 1,18
$ head bacteria.good.metadata | cut -f 1,15
$ head bacteria.good.metadata | cut -f 1,20
```

Discovered columns didn't match header. Example: entries under "journal" actually have the isolation source information.

Total lines in the table, including the header:
```
$ wc -l bacteria.good.metadata
1222203 bacteria.good.metadata
```

Total unique isolation source terms:
```
$ cat bacteria.good.metadata | cut -f 20 | sort | uniq | wc -l
12976
```

Total entries without a designated isolation source:
```
$ cat bacteria.good.metadata | cut -f 20 | grep -w NA | wc -l
77228
```

This is very good. It means that we will be able to incorporate 1222202 - 77228 = 1144974 sequences into parsing strategies that involve environmental source.

Honed in on our strategy for parsing the data:

1. Create two levels of re-classification- coarse and fine
	Example: Aquatic	Marine, Estuarine, Fresh, Unspecified
	Example: Host-associated	Mammalian, Fish, etc.

2. Append the list of unique isolation source terms with the course and fine terms. This will create a table that we can use with a script to append the master metadata file.


text:
var searchApp = angular.module('searchApp', [])
	.controller('searchControllers', ['$scope', '$http', function($scope, $http) {
  $http.get('/feeds/feed.json').success(function(data) {
    $scope.results = data;
  });
}]);


text:
'use strict';

import Component, {Config} from 'metal-jsx';

import Tree from './Tree';
import {setIn} from './util';

class JSONEditor extends Component {
  handleChange(locator, value) {
    const {data, onChange} = this.props;

    onChange(setIn(data, locator, value));
  }

  handleToggleExpand(value) {
    const {expandedNodes} = this.state;

    if (expandedNodes.has(value)) {
      expandedNodes.delete(value);
    } else {
      expandedNodes.add(value);
    }

    this.state.expandedNodes = expandedNodes;
  }

  render() {
    const {arrowRenderer, data, typeColors} = this.props;

    return (
      <Tree
        arrowRenderer={arrowRenderer}
        data={data}
        elementClasses="json-editor-container"
        expandedNodes={this.state.expandedNodes}
        onChange={this.handleChange.bind(this)}
        onToggleExpand={this.handleToggleExpand.bind(this)}
        typeColors={typeColors}
      />
    );
  }
}

JSONEditor.STATE = {
  expandedNodes: Config.instanceOf(WeakSet).value(new WeakSet())
};

JSONEditor.PROPS = {
  arrowRenderer: Config.func().value(() => {}),
  data: Config.object().value({}),
  onChange: Config.func(),
  typeColors: Config.object()
};

export default JSONEditor;


text:
Notes on the npm supporting fork
=======================================
We forked from the official version at https://github.com/rails/jquery-ujs to support npm.

* Reasons: [rails/jquery-ujs/issues/423](https://github.com/rails/jquery-ujs/issues/423) and
  [rails/jquery-ujs/pull/380](https://github.com/rails/jquery-ujs/pull/380)
* We'll do our best to keep the npm version consistent with the version used by jquery-ujs.
* There should be 2 files that differ: Addition of a `package.json` and changes ONLY to the top of the README.md
* For advice on how to use the npm version with Rails and Webpack, see
  [shakacode/react-webpack-rails-tutorial/pull/88](https://github.com/shakacode/react-webpack-rails-tutorial/pull/88) and
  [forum article on considerations for jquery with Rails and webpack](http://forum.railsonmaui.com/t/considerations-for-jquery-with-rails-and-webpack/344).
* Publishing to npm:

```bash
   git pull https://github.com/rails/jquery-ujs.git master
   vim package.json # updating version number
   git commit -am 'the version number'
   git push --follow-tags origin master
   npm publish
```

Unobtrusive scripting adapter for jQuery
========================================

This unobtrusive scripting support file is developed for the Ruby on Rails framework, but is not strictly tied to any specific backend. You can drop this into any application to:

- force confirmation dialogs for various actions;
- make non-GET requests from hyperlinks;
- make forms or hyperlinks submit data asynchronously with Ajax;
- have submit buttons become automatically disabled on form submit to prevent double-clicking.

These features are achieved by adding certain ["data" attributes][data] to your HTML markup. In Rails, they are added by the framework's template helpers.

Full [documentation is on the wiki][wiki], including the [list of published Ajax events][events].

Requirements
------------

- [jQuery 1.8.x or higher][jquery];
- HTML5 doctype (optional).

If you don't use HTML5, adding "data" attributes to your HTML4 or XHTML pages might make them fail [W3C markup validation][validator]. However, this shouldn't create any issues for web browsers or other user agents.

Installation using the jquery-rails gem
------------

For automated installation in Rails, use the "jquery-rails" gem. Place this in your Gemfile:

```ruby
gem 'jquery-rails'
```

And run:

```shell
$ bundle install
```

Require both `jquery` and `jquery_ujs` into your application.js manifest.

```javascript
//= require jquery
//= require jquery_ujs
```

Installation using Bower
------------

Run `bower install jquery-ujs --save` to install the jquery-ujs package.

Usage
------------

Require both `jquery` and `jquery-ujs` into your application.js manifest.

```javascript
//= require jquery
//= require jquery-ujs
```

How to run tests
------------

Follow [this wiki](https://github.com/rails/jquery-ujs/wiki/Running-Tests-and-Contributing) to run tests.

## Contributing to jquery-ujs

jquery-ujs is work of many contributors. You're encouraged to submit pull requests, propose
features and discuss issues.

See [CONTRIBUTING](CONTRIBUTING.md).

## License
jquery-ujs is released under the [MIT License](MIT-LICENSE).

[data]: http://www.w3.org/TR/html5/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes "Embedding custom non-visible data with the data-* attributes"
[wiki]: https://github.com/rails/jquery-ujs/wiki
[events]: https://github.com/rails/jquery-ujs/wiki/ajax
[jquery]: http://docs.jquery.com/Downloading_jQuery
[validator]: http://validator.w3.org/
[csrf]: http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html
[adapter]: https://github.com/rails/jquery-ujs/raw/master/src/rails.js


text:
package org.aying.echarts;

import org.aying.echarts.axis.AngleAxis;
import org.aying.echarts.axis.CartesianAxis;
import org.aying.echarts.axis.ParallelAxis;
import org.aying.echarts.axis.RadiusAxis;
import org.aying.echarts.axis.SingleAxis;
import org.aying.echarts.base.BaseAnimation;
import org.aying.echarts.series.Serie;
import org.jetbrains.annotations.Contract;

import java.io.Serializable;
import java.time.format.TextStyle;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * ECharts 选项配置模型。
 *
 * @author Fuchun
 * @since 1.0
 */
public class Option extends BaseAnimation<Option> implements Serializable {

    private static final long serialVersionUID = -2913905133593279045L;

    /* 标题组件配置。 */
    private Title title;
    /* 图例组件配置。 */
    private Legend legend;
    /* 绘图网格配置。 */
    private Grid grid;
    /* 直角坐标系 grid 中的 x 轴配置 */
    private CartesianAxis xAxis;
    /* 直角坐标系 grid 中的 y 轴配置 */
    private CartesianAxis yAxis;
    /* 极坐标系配置 */
    private Polar polar;
    /* 极坐标系的半径轴配置 */
    private RadiusAxis radiusAxis;
    /* 极坐标系的角度轴配置。 */
    private AngleAxis angleAxis;
    /* 雷达图坐标系配置 */
    private Radar radar;
    /* 区域缩放组件配置 */
    private Set<DataZoom> dataZooms;
    /* 视觉映射组件配置 */
    private Set<VisualMap<?>> visualMaps;
    /* 提示框组件配置 */
    private Tooltip tooltip;
    /* 工具栏配置 */
    private Toolbox toolbox;
    /* 区域选择组件配置 */
    private Brush brush;
    /* 地理坐标系组件配置。 */
    private Geo geo;
    /* 平行坐标系配置 */
    private Parallel parallel;
    /* 平行坐标系中的坐标轴配置 */
    private ParallelAxis parallelAxis;
    /* 单轴配置 */
    private SingleAxis singleAxis;
    /* timeline 配置 */
    private Timeline timeline;
    /* 系列列表。 */
    private Set<Serie> series;

    /* 调色盘颜色列表。如果系列没有设置颜色,则会依次循环从该列表中取颜色作为系列颜色。 */
    private List<String> color;
    /* 背景色,默认无背景。transparent */
    private String backgroundColor;
    /* 全局的字体样式。 */
    private TextStyle textStyle;

    /* 这里是 Animation 的属性区,继承自 BaseAnimation */

    /* 渐进式渲染时每一帧绘制图形数量,设为 0 时不启用渐进式渲染,支持每个系列单独配置。 */
    private Integer progressive;
    /* 启用渐进式渲染的图形数量阈值,在单个系列的图形数量超过该阈值时启用渐进式渲染。 */
    private Integer progressiveThreshold;
    /* 图形混合模式。 */
    private String blendMode;
    /* 图形数量阈值,决定是否开启单独的 hover 层,在整个图表的图形数量大于该阈值时开启单独的 hover 层。 */
    private Integer hoverLayerThreshold;

    public Option() {
        super();
    }

    public Option title(Title title) {
        this.title = title;
        return this;
    }

    public Option legend(Legend legend) {
        this.legend = legend;
        return this;
    }

    public Option grid(Grid grid) {
        this.grid = grid;
        return this;
    }

    public Option xAxis(CartesianAxis xAxis) {
        this.xAxis = xAxis;
        return this;
    }

    public Option yAxis(CartesianAxis yAxis) {
        this.yAxis = yAxis;
        return this;
    }

    public Option polar(Polar polar) {
        this.polar = polar;
        return this;
    }

    public Option radiusAxis(RadiusAxis radiusAxis) {
        this.radiusAxis = radiusAxis;
        return this;
    }

    public Option angleAxis(AngleAxis angleAxis) {
        this.angleAxis = angleAxis;
        return this;
    }

    public Option radar(Radar radar) {
        this.radar = radar;
        return this;
    }

    @Contract("null -> fail")
    public Option dataZoom(DataZoomInside inside) {
        return addDataZoom(inside);
    }

    @Contract("null -> fail")
    public Option dataZoom(DataZoomSelect select) {
        return addDataZoom(select);
    }

    @Contract("null -> fail")
    public Option dataZoom(DataZoomSlider slider) {
        return addDataZoom(slider);
    }

    protected Option addDataZoom(DataZoom dz) {
        Objects.requireNonNull(dz, "dataZoom");
        if (dataZooms == null) {
            dataZooms = new HashSet<>();
        }
        dataZooms.add(dz);
        return this;
    }

    public Option continuous(ContinuousVisualMap vm) {
        return addVisualMap(vm);
    }

    public Option piecewise(PiecewiseVisualMap vm) {
        return addVisualMap(vm);
    }

    protected Option addVisualMap(VisualMap<?> vm) {
        Objects.requireNonNull(vm, "visualMap");
        if (visualMaps == null) {
            visualMaps = new HashSet<>(2);
        }
        visualMaps.add(vm);
        return this;
    }

    public Option tooltip(Tooltip tooltip) {
        this.tooltip = tooltip;
        return this;
    }

    public Option toolbox(Toolbox toolbox) {
        this.toolbox = toolbox;
        return this;
    }

    public Option brush(Brush brush) {
        this.brush = brush;
        return this;
    }

    public Option geo(Geo geo) {
        this.geo = geo;
        return this;
    }

    public Option parallel(Parallel parallel) {
        this.parallel = parallel;
        return this;
    }

    public Option parallelAxis(ParallelAxis parallelAxis) {
        this.parallelAxis = parallelAxis;
        return this;
    }

    public Option singleAxis(SingleAxis singleAxis) {
        this.singleAxis = singleAxis;
        return this;
    }

    public Option timeline(Timeline timeline) {
        this.timeline = timeline;
        return this;
    }

    public Option addSerie(Serie serie) {
        if (series == null) {
            series = new HashSet<>(18);
        }
        series.add(serie);
        return this;
    }

    public Option color(Collection<String> colors) {
        if (colors == null || colors.isEmpty()) {
            this.color = null;
        } else {
            this.color = new LinkedList<>(colors);
        }
        return this;
    }

    public Option bgColor(String bgColor) {
        this.backgroundColor = bgColor;
        return this;
    }

    public Option textStyle(TextStyle textStyle) {
        this.textStyle = textStyle;
        return this;
    }

    public Option progressive(Integer progressive) {
        this.progressive = progressive;
        return this;
    }

    public Option progressiveThreshold(Integer progressiveThreshold) {
        this.progressiveThreshold = progressiveThreshold;
        return this;
    }

    public Option blendMode(String blendMode) {
        this.blendMode = blendMode;
        return this;
    }

    public Option hoverLayerThreshold(Integer hoverLayerThreshold) {
        this.hoverLayerThreshold = hoverLayerThreshold;
        return this;
    }

    public Title getTitle() {
        return title;
    }

    public void setTitle(Title title) {
        this.title = title;
    }

    public Legend getLegend() {
        return legend;
    }

    public void setLegend(Legend legend) {
        this.legend = legend;
    }

    public Grid getGrid() {
        return grid;
    }

    public void setGrid(Grid grid) {
        this.grid = grid;
    }

    public CartesianAxis getxAxis() {
        return xAxis;
    }

    public void setxAxis(CartesianAxis xAxis) {
        this.xAxis = xAxis;
    }

    public CartesianAxis getyAxis() {
        return yAxis;
    }

    public void setyAxis(CartesianAxis yAxis) {
        this.yAxis = yAxis;
    }

    public Polar getPolar() {
        return polar;
    }

    public void setPolar(Polar polar) {
        this.polar = polar;
    }

    public RadiusAxis getRadiusAxis() {
        return radiusAxis;
    }

    public void setRadiusAxis(RadiusAxis radiusAxis) {
        this.radiusAxis = radiusAxis;
    }

    public AngleAxis getAngleAxis() {
        return angleAxis;
    }

    public void setAngleAxis(AngleAxis angleAxis) {
        this.angleAxis = angleAxis;
    }

    public Radar getRadar() {
        return radar;
    }

    public void setRadar(Radar radar) {
        this.radar = radar;
    }

    public Set<DataZoom> getDataZooms() {
        return dataZooms;
    }

    public void setDataZooms(Set<DataZoom> dataZooms) {
        this.dataZooms = dataZooms;
    }

    public Set<VisualMap<?>> getVisualMaps() {
        return visualMaps;
    }

    public void setVisualMaps(Set<VisualMap<?>> visualMaps) {
        this.visualMaps = visualMaps;
    }

    public Tooltip getTooltip() {
        return tooltip;
    }

    public void setTooltip(Tooltip tooltip) {
        this.tooltip = tooltip;
    }

    public Toolbox getToolbox() {
        return toolbox;
    }

    public void setToolbox(Toolbox toolbox) {
        this.toolbox = toolbox;
    }

    public Brush getBrush() {
        return brush;
    }

    public void setBrush(Brush brush) {
        this.brush = brush;
    }

    public Geo getGeo() {
        return geo;
    }

    public void setGeo(Geo geo) {
        this.geo = geo;
    }

    public Parallel getParallel() {
        return parallel;
    }

    public void setParallel(Parallel parallel) {
        this.parallel = parallel;
    }

    public ParallelAxis getParallelAxis() {
        return parallelAxis;
    }

    public void setParallelAxis(ParallelAxis parallelAxis) {
        this.parallelAxis = parallelAxis;
    }

    public SingleAxis getSingleAxis() {
        return singleAxis;
    }

    public void setSingleAxis(SingleAxis singleAxis) {
        this.singleAxis = singleAxis;
    }

    public Timeline getTimeline() {
        return timeline;
    }

    public void setTimeline(Timeline timeline) {
        this.timeline = timeline;
    }

    public Set<Serie> getSeries() {
        return series;
    }

    public void setSeries(Set<Serie> series) {
        this.series = series;
    }

    public List<String> getColor() {
        return color;
    }

    public void setColor(List<String> color) {
        this.color = color;
    }

    public String getBackgroundColor() {
        return backgroundColor;
    }

    public void setBackgroundColor(String backgroundColor) {
        this.backgroundColor = backgroundColor;
    }

    public TextStyle getTextStyle() {
        return textStyle;
    }

    public void setTextStyle(TextStyle textStyle) {
        this.textStyle = textStyle;
    }

    public Integer getProgressive() {
        return progressive;
    }

    public void setProgressive(Integer progressive) {
        this.progressive = progressive;
    }

    public Integer getProgressiveThreshold() {
        return progressiveThreshold;
    }

    public void setProgressiveThreshold(Integer progressiveThreshold) {
        this.progressiveThreshold = progressiveThreshold;
    }

    public String getBlendMode() {
        return blendMode;
    }

    public void setBlendMode(String blendMode) {
        this.blendMode = blendMode;
    }

    public Integer getHoverLayerThreshold() {
        return hoverLayerThreshold;
    }

    public void setHoverLayerThreshold(Integer hoverLayerThreshold) {
        this.hoverLayerThreshold = hoverLayerThreshold;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Option)) return false;
        if (!super.equals(o)) return false;
        Option option = (Option) o;
        return Objects.equals(title, option.title) &&
                Objects.equals(legend, option.legend) &&
                Objects.equals(grid, option.grid) &&
                Objects.equals(xAxis, option.xAxis) &&
                Objects.equals(yAxis, option.yAxis) &&
                Objects.equals(polar, option.polar) &&
                Objects.equals(radiusAxis, option.radiusAxis) &&
                Objects.equals(angleAxis, option.angleAxis) &&
                Objects.equals(radar, option.radar) &&
                Objects.equals(dataZooms, option.dataZooms) &&
                Objects.equals(visualMaps, option.visualMaps) &&
                Objects.equals(tooltip, option.tooltip) &&
                Objects.equals(toolbox, option.toolbox) &&
                Objects.equals(brush, option.brush) &&
                Objects.equals(geo, option.geo) &&
                Objects.equals(parallel, option.parallel) &&
                Objects.equals(parallelAxis, option.parallelAxis) &&
                Objects.equals(singleAxis, option.singleAxis) &&
                Objects.equals(timeline, option.timeline) &&
                Objects.equals(series, option.series) &&
                Objects.equals(color, option.color) &&
                Objects.equals(backgroundColor, option.backgroundColor) &&
                textStyle == option.textStyle &&
                Objects.equals(progressive, option.progressive) &&
                Objects.equals(progressiveThreshold, option.progressiveThreshold) &&
                Objects.equals(blendMode, option.blendMode) &&
                Objects.equals(hoverLayerThreshold, option.hoverLayerThreshold);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), title, legend, grid, xAxis, yAxis, polar, radiusAxis,
                angleAxis, radar, dataZooms, visualMaps, tooltip, toolbox, brush, geo, parallel,
                parallelAxis, singleAxis, timeline, series, color, backgroundColor, textStyle,
                progressive, progressiveThreshold, blendMode, hoverLayerThreshold);
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder(32)
                .append(getClass()).append("{");
        sb.append("title=").append(title);
        sb.append(", legend=").append(legend);
        sb.append(", grid=").append(grid);
        sb.append(", xAxis=").append(xAxis);
        sb.append(", yAxis=").append(yAxis);
        sb.append(", polar=").append(polar);
        sb.append(", radiusAxis=").append(radiusAxis);
        sb.append(", angleAxis=").append(angleAxis);
        sb.append(", radar=").append(radar);
        sb.append(", dataZooms=").append(dataZooms);
        sb.append(", visualMaps=").append(visualMaps);
        sb.append(", tooltip=").append(tooltip);
        sb.append(", toolbox=").append(toolbox);
        sb.append(", brush=").append(brush);
        sb.append(", geo=").append(geo);
        sb.append(", parallel=").append(parallel);
        sb.append(", parallelAxis=").append(parallelAxis);
        sb.append(", singleAxis=").append(singleAxis);
        sb.append(", timeline=").append(timeline);
        sb.append(", series=").append(series);
        sb.append(", color=").append(color);
        sb.append(", backgroundColor='").append(backgroundColor).append('\'');
        sb.append(", textStyle=").append(textStyle);
        appendAnimation(sb);
        sb.append(", progressive=").append(progressive);
        sb.append(", progressiveThreshold=").append(progressiveThreshold);
        sb.append(", blendMode='").append(blendMode).append('\'');
        sb.append(", hoverLayerThreshold=").append(hoverLayerThreshold);
        sb.append('}');
        return sb.toString();
    }
}


text:
title: Ntelijan rechèch & jwenn (anciennement Approfondir)
inshort: Anplwaye jwenn wofil & sanisfè
translator: Microsoft Cognitive Services
---

Biwo Approfondir se yon anplwaye konbine wofil paj ak kontan jwenn
Si yon moun.

Wofil paj bay kontak enfòmasyon sou chak anplwaye nan a
sistèm, ki enkli yo non, nimewo telefòn, biwo kote yo ye, kouryèll,
direktè, elatriye, ki dabitid rempli pa biwo an, 365
administratè. Yon tablo rudimentaire òganizasyon an tou te gen ladann.

Sepandan, paj wofil a tou bay espas pou nou ajoute plis
enfòmasyon prive sou tèt ou, tankou alma mater, aptitid, depi lontan
pwojè, enterè, ak lòt detay pèsonèl yo. Fouye itil pou
jwenn moun ki baze sou kapasite yo ak eksperyans atravè yon antrepriz
pa gen pou yo konnen ki moun yo anvan yo jwenn yo.

Pati pi kontan jwenn Approfondir affiche fichiers nan biwo 365
(dabitid nan SharePoint en ak OneDrive pou biznis) sa yo
konvenab pou ou. Fichiers modifié oubyen te louvwi zam sou collègues ou ak
moun ou travay ak ap fè a kòm posib enpòtan baze
sou ou pou moun kouche.

Fouye pa kapab pataje avèk lòt moun ak eksperyans nan chak moun
ak Approfondir inik, menm jan an pou ou eksperyans sou Facebook ak
LinkedIn. Ou pral sèlman pou montre pi kontan ou deja gen aksè a.
Fouye pa bay plis aksè a kontan ou pa ta dwe wè.

Fouye se yon nan bagay sila yo ke w ap pi bon nèt yo t' ap jwe ak pou
se vre wi: konprann li. Li se yon zouti ke kèk shrug pandan ke lòt moun sezi anpil
ki jan yo te viv san l. Nenpòt moun ou enterè, ou ta dwe
toujou enfòme m wofil ou ak aptitid kolekte koresponn ak eksperyans sa lòt moun
ka jwenn ou pou asistans lè grangou a rive.

Resous
---------

-[Ki se biwo
    Fouye?](https://support.office.com/en-us/article/What-is-Office-Delve-1315665a-c6af-4409-a28d-49f8916878ca)
    \[Microsoft\]

-[Senk rezon pou biwo nan renmen
    Fouye](https://sharepointmaven.com/5-reasons-love-new-office-365-delve/)
    \[SharePoint Maven\]

Menm jan an aplikasyon pou
--------------------

-Facebook ak LinkedIn

Commentaires
---------

-[Fouye UserVoice](https://office365.uservoice.com/forums/273487-delve)
    \[UserVoice\]

-[Fouye sou TechCommunity](https://techcommunity.microsoft.com/t5/Delve/ct-p/OfficeDelve)
    \[Microsoft\]

Otè
---------

-[Matt Wade](https://www.linkedin.com/in/thatmattwade/), biwo sèvis MVP


text:
package org.apache.camel.management.event;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;

/**
 * @version $Revision$
 */
public class ExchangeFailureHandledEvent extends AbstractExchangeEvent {
    private static final long serialVersionUID = -7554809462006009547L;

    private final Processor failureHandler;
    private final boolean deadLetterChannel;
    private final boolean handled;

    public ExchangeFailureHandledEvent(Exchange source, Processor failureHandler, boolean deadLetterChannel) {
        super(source);
        this.failureHandler = failureHandler;
        this.deadLetterChannel = deadLetterChannel;
        this.handled = source.getProperty(Exchange.ERRORHANDLER_HANDLED, false, Boolean.class);
    }

    public Processor getFailureHandler() {
        return failureHandler;
    }

    public boolean isDeadLetterChannel() {
        return deadLetterChannel;
    }

    public boolean isHandled() {
        return handled;
    }

    @Override
    public String toString() {
        if (isDeadLetterChannel()) {
            return getExchange().getExchangeId() + " exchange failed: " + getExchange() + " but was handled by dead letter channel: " + failureHandler;
        } else {
            return getExchange().getExchangeId() + " exchange failed: " + getExchange() + " but was processed by: " + failureHandler;
        }
    }
}


text:
using System;
using Csla.Server.Hosts;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Csla.Serialization;
using System.IO;
using System.Security.Principal;
using Csla.Core;
using Csla.Server;

namespace ExtendableWcfPortalForDotNet.Server
{
  /// <summary>
  /// Exposes server-side DataPortal functionality
  /// through WCF.
  /// </summary>
  [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
  [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  public class WcfPortal : IExtendableWcfPortalForDotNet
  {
    #region IWcfPortal Members

    /// <summary>
    /// Create a new business object.
    /// </summary>
    /// <param name="request">The request parameter object.</param>
    [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
    public WcfResponse Create(CriteriaRequest request)
    {
      Csla.Server.DataPortal portal = new Csla.Server.DataPortal();
      Exception error = null;
      DataPortalResult  result = null;
      WcfResponse response = null;
      ISerializationFormatter formatter = SerializationFormatterFactory.GetFormatter();
      try
      {
        request = ConvertRequest(request);
        DataPortalContext context = new DataPortalContext(
            formatter.Deserialize(request.Principal) as IPrincipal,
            true,
            request.ClientCulture,
            request.ClientUICulture,
            formatter.Deserialize(request.ClientContext) as ContextDictionary,
            formatter.Deserialize(request.GlobalContext) as ContextDictionary);
        result = portal.Create(Type.GetType(request.TypeName), formatter.Deserialize(request.CriteriaData), context);
        response = new WcfResponse(
            formatter.Serialize(result.ReturnObject),
            formatter.Serialize(error),
            formatter.Serialize(Csla.ApplicationContext.GlobalContext));
      }
      catch (Exception ex)
      {
        error = ex;
        response = new WcfResponse(
           null,
           formatter.Serialize(error),
           formatter.Serialize(Csla.ApplicationContext.GlobalContext));
      }
      return ConvertResponse(response);
    }

    /// <summary>
    /// Get an existing business object.
    /// </summary>
    /// <param name="request">The request parameter object.</param>
    [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
    public WcfResponse Fetch(CriteriaRequest request)
    {
      Csla.Server.DataPortal portal = new Csla.Server.DataPortal();
      Exception error = null;
      DataPortalResult result = null;
      WcfResponse response = null;
      ISerializationFormatter formatter = SerializationFormatterFactory.GetFormatter();
      try
      {
        request = ConvertRequest(request);
        DataPortalContext context = new DataPortalContext(
            formatter.Deserialize(request.Principal) as IPrincipal,
            true,
            request.ClientCulture,
            request.ClientUICulture,
            formatter.Deserialize(request.ClientContext) as ContextDictionary,
            formatter.Deserialize(request.GlobalContext) as ContextDictionary);
        result = portal.Fetch(Type.GetType(request.TypeName), formatter.Deserialize(request.CriteriaData), context);
        response = new WcfResponse(
            formatter.Serialize(result.ReturnObject),
            formatter.Serialize(error),
            formatter.Serialize(Csla.ApplicationContext.GlobalContext));
      }
      catch (Exception ex)
      {
        error = ex;
        response = new WcfResponse(
           null,
           formatter.Serialize(error),
           formatter.Serialize(Csla.ApplicationContext.GlobalContext));
      }
      return ConvertResponse(response);
    }

    /// <summary>
    /// Update a business object.
    /// </summary>
    /// <param name="request">The request parameter object.</param>
    [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
    public WcfResponse Update(UpdateRequest request)
    {
      Csla.Server.DataPortal portal = new Csla.Server.DataPortal();
      Exception error = null;
      DataPortalResult result = null;
      WcfResponse response = null;
      ISerializationFormatter formatter = SerializationFormatterFactory.GetFormatter();
      try
      {
        request = ConvertRequest(request);
        DataPortalContext context = new DataPortalContext(
            formatter.Deserialize(request.Principal) as IPrincipal,
            true,
            request.ClientCulture,
            request.ClientUICulture,
            formatter.Deserialize(request.ClientContext) as ContextDictionary,
            formatter.Deserialize(request.GlobalContext) as ContextDictionary);
        result = portal.Update(formatter.Deserialize(request.ObjectData), context);
        response = new WcfResponse(
            formatter.Serialize(result.ReturnObject),
            formatter.Serialize(error),
            formatter.Serialize(Csla.ApplicationContext.GlobalContext));
      }
      catch (Exception ex)
      {
        error = ex;
        response = new WcfResponse(
           null,
           formatter.Serialize(error),
           formatter.Serialize(Csla.ApplicationContext.GlobalContext));
      }
      return ConvertResponse(response);
    }

    /// <summary>
    /// Delete a business object.
    /// </summary>
    /// <param name="request">The request parameter object.</param>
    [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
    public WcfResponse Delete(CriteriaRequest request)
    {
      Csla.Server.DataPortal portal = new Csla.Server.DataPortal();
      Exception error = null;
      DataPortalResult result = null;
      WcfResponse response = null;
      ISerializationFormatter formatter = SerializationFormatterFactory.GetFormatter();
      try
      {
        request = ConvertRequest(request);
        DataPortalContext context = new DataPortalContext(
            formatter.Deserialize(request.Principal) as IPrincipal,
            true,
            request.ClientCulture,
            request.ClientUICulture,
            formatter.Deserialize(request.ClientContext) as ContextDictionary,
            formatter.Deserialize(request.GlobalContext) as ContextDictionary);
        result = portal.Delete(Type.GetType(request.TypeName), formatter.Deserialize(request.CriteriaData), context);
        response = new WcfResponse(
            formatter.Serialize(result.ReturnObject),
            formatter.Serialize(error),
            formatter.Serialize(Csla.ApplicationContext.GlobalContext));
      }
      catch (Exception ex)
      {
        error = ex;
        response = new WcfResponse(
            null,
            formatter.Serialize(error),
            formatter.Serialize(Csla.ApplicationContext.GlobalContext));
      }
      return ConvertResponse(response);
    }

    #endregion

    protected virtual WcfResponse ConvertResponse(WcfResponse response)
    {
      return response;
    }

    protected virtual CriteriaRequest ConvertRequest(CriteriaRequest request)
    {
      return request;
    }
    protected virtual UpdateRequest ConvertRequest(UpdateRequest request)
    {
      return request;
    }
  }
}


text:
namespace el {

class BindExpr : public DefineExpr {
  Ref<Expr> target_;
public:
  explicit BindExpr(Ref<Expr> target)
    : target_(target) {
  }

  inline Ref<Expr> Target(void) const {
    return target_;
  }

  virtual void Trace(std::ostream& stream) const override {
    stream << target_ << " :: ";
    if (Definitions().Count() == 1) {
      stream << Definitions()[0].GetName()
             << " " << Definitions()[0].GetBody();
    }
    else {
      stream << "( ";
      for (auto i = 0; i < Definitions().Count(); ++i) {
        stream << Definitions()[0].GetName() << " "
               << Definitions()[0].GetBody();
      }
      stream << " )";
    }
  }

  EL_EXPR_VISITOR
};

}

#endif  // __EL_BIND_EXPR_HEADER_H__


text:
require "nesta-plugin-dateslugs/version"

Nesta::Plugin.register(__FILE__)


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.default = {
	layout: 'Layout',
	restapi: '/restapi',
	routes: 'routes',
	staticEntry: 'index.html',
	// codeSpliting: true,
	gulp: {
		publishCopy: ['!' + __dirname + '/should_ignore', '!' + __dirname + '/should_ignore/**/*'],
		publishBabel: ['!' + __dirname + '/should_ignore/**/*.js']
	}
};


text:
from lib.utils import *

def _help():
    usage = '''
Usage: set [options] (var) [value]

[options]:
-h                Print this help.

-del (var)        Delete variable
                  (var) if defined.

where (var) is a valid
global variable
if [value] is not given,
current value is returned
'''
    print(usage)

def main(argv):
    if '-h' in argv:
        _help()
        return
    # The shell doesnt send the
    # command name in the arg list
    # so the next line is not needed
    # anymore
    # argv.pop(0) #remove arg

    # to show all vars
    if len(argv) < 1:
        for i in prop.vars():
            print(i, ' = ', prop.get(i))
        return
    if '-del' in argv:
        try:
            var = argv[1]
            # detect system vars
            if var == 'save_state' or var == 'c_char':
                err(4, add='Cant delete system variable "' + var + '"')
                return
            prop.delete(var)
            return
        except IndexError:
            err(4, add='variable name was missing')
            return

    var = argv[0]

    if len(argv) < 2:
        val = prop.get(var)
        if val == NULL:
            err(4, var)
            return
        print(val)
        return

    # remove name of var
    argv.pop(0)
    # make the rest the val
    val = make_s(argv)
    try:
        prop.set(var, val)
    except ValueError:
        err(4, add="can't create this variable")


text:
Imports System.Text
Imports System.Net
Imports System.IO
Imports System.Web

Namespace CroudiaAccess
    Public Module AccessToCroudia
        Friend Function POSTAccess(ByVal EndPoint As String, ByVal Oauth As OauthTokens, Optional ByVal Dic As RequestParam = Nothing) As WebResponse
            If String.IsNullOrEmpty(EndPoint) Then
                Throw New ArgumentException("EndPoint")
            End If
            If IsNothing(Oauth) Then
                Throw New ArgumentException("Oauth")
            End If
            Dim wa As HttpWebRequest = CType(WebRequest.Create(EndPoint), System.Net.HttpWebRequest)
            Dim parameter As String = ParamParse(Dic)
            wa.Method = "POST"
            If Not String.IsNullOrEmpty(Oauth.AccessToken) Then
                wa.Headers(HttpRequestHeader.Authorization) = String.Format("Bearer {0}", Oauth.AccessToken)
            End If
            wa.ContentType = "application/x-www-form-urlencoded"
            wa.ContentLength = Encoding.UTF8.GetByteCount(parameter)
            Dim reqStream As Stream = wa.GetRequestStream()
            reqStream.Write(Encoding.UTF8.GetBytes(parameter), 0, Encoding.UTF8.GetByteCount(parameter))
            reqStream.Close()
            Try
                Return wa.GetResponse()
            Catch ex As WebException
                If ex.Status = System.Net.WebExceptionStatus.ProtocolError Then
                    Return ex.Response()
                Else
                    Throw New Exception(ex.ToString)
                End If
            End Try
            Return Nothing
        End Function

        Friend Function GETAccess(ByVal EndPoint As String, ByVal Oauth As OauthTokens, Optional ByVal Dic As RequestParam = Nothing) As WebResponse
            If String.IsNullOrEmpty(EndPoint) Then
                Throw New ArgumentException("EndPoint")
            End If
            If IsNothing(Oauth) Then
                Throw New ArgumentException("Oauth")
            End If
            Dim parameter As String = ""
            If Not IsNothing(Dic) Then
                parameter = "?" & ParamParse(Dic)
            End If
            Dim wa As System.Net.HttpWebRequest = _
        CType(System.Net.WebRequest.Create(EndPoint & parameter),  _
            System.Net.HttpWebRequest)
            wa.Method = "GET" 'GET
            wa.ContentType = "application/x-www-form-urlencoded"
            wa.Headers(HttpRequestHeader.Authorization) = String.Format("Bearer {0}", Oauth.AccessToken)
            Try
                Return wa.GetResponse()
            Catch ex As WebException
                If ex.Status = System.Net.WebExceptionStatus.ProtocolError Then
                    Return ex.Response()
                Else
                    Throw New Exception(ex.ToString)
                End If
            End Try
        End Function

        Friend Function MultiPartPOSTAccess(ByVal EndPoint As String, ByVal Oauth As OauthTokens, ByVal Dic As RequestParam) As WebResponse
            If String.IsNullOrEmpty(EndPoint) Then
                Throw New ArgumentException("EndPoint")
            End If
            If IsNothing(Oauth) Then
                Throw New ArgumentException("Oauth")
            End If
            If IsNothing(Dic) Then
                Throw New ArgumentException("Dic")
            End If
            Dim boundary As String = "fisttwitboundary"
            Dim wa As System.Net.HttpWebRequest = _
        CType(System.Net.WebRequest.Create(EndPoint),  _
            System.Net.HttpWebRequest)
            wa.Method = "POST"
            wa.ContentType = "multipart/form-data;boundary=" & boundary
            wa.Headers(HttpRequestHeader.Authorization) = String.Format("Bearer {0}", Oauth.AccessToken)
            Dim pd As New StringBuilder
            Dim KeyInData As String = Nothing
            For Each v As KeyValuePair(Of String, Object) In Dic
                If v.Value.GetType.Name = GetType(Byte()).Name Then
                    KeyInData = v.Key
                Else
                    pd.Append(String.Format("--" & boundary & vbCrLf & _
          "Content-Disposition: form-data; name=""{0}""" _
          & vbCrLf & vbCrLf & v.Value & vbCrLf, v.Key))
                End If
            Next
            pd.Append(String.Format("--" & boundary & vbCrLf & _
        "Content-Type: application/octet-stream" & vbCrLf &
        "Content-Disposition: form-data; name=""{0}""; filename=""{1}""" & vbCrLf & vbCrLf, KeyInData, New Random().Next))
            Dim PostByte As Byte() = Encoding.UTF8.GetBytes(pd.ToString)
            Dim PostEnd As String = vbCrLf & "--" & boundary & "--" & vbCrLf
            Dim PostEndByte As Byte() = Encoding.UTF8.GetBytes(PostEnd)
            Dim PostData As Byte() = CType(Dic(KeyInData), Byte())
            wa.ContentLength = PostByte.Length + PostEndByte.Length + PostData.Length
            Dim reqStream As System.IO.Stream = wa.GetRequestStream()
            reqStream.Write(PostByte, 0, PostByte.Length)
            reqStream.Write(PostData, 0, PostData.Length)
            reqStream.Write(PostEndByte, 0, PostEndByte.Length)
            reqStream.Close()
            Try
                Return wa.GetResponse()
            Catch ex As WebException
                If ex.Status = System.Net.WebExceptionStatus.ProtocolError Then
                    Return ex.Response()
                Else
                    Throw New Exception(ex.ToString)
                End If
            End Try
        End Function

        Private Function ParamParse(ByVal Param As RequestParam) As String
            If IsNothing(Param) Then Return ""
            Dim value As New StringBuilder("?")
            For Each v As KeyValuePair(Of String, Object) In Param
                If Not value.ToString = "" Then
                    value.Append("&" & v.Key & "=" & HttpUtility.UrlEncode(v.Value))
                Else
                    value.Append(v.Key & "=" & HttpUtility.UrlEncode(v.Value))
                End If
            Next
            Return value.ToString
        End Function
    End Module

End Namespace

Friend Enum HttpMethod
    HttpPOST
    HttpGET
    HttpPOSTMultipart
End Enum


text:
<!DOCTYPE html>

    <title>"Book 4: Chapter 4" | Symbollic Logic | Lewis Carroll | Lit2Go ETC</title>
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/screenless.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/printless.css" type="text/css" media="print" title="no title" charset="utf-8">

          Lit2Go

<form action="http://etc.usf.edu/lit2go/search/"><input type="text" name="q" placeholder="Search" value=""></form>

Authors

Books

Genres

Collections

Readability

      Symbollic Logic

      by Lewis Carroll

      "Book 4: Chapter 4"

        Additional Information

            Year Published:
            1896

            Language:
            English

            Country of Origin:
            United States of America

            Source:
            Carroll, L. (1896). Symbollic Logic. New York; Macmillan & Co.

            Readability:

                Flesch–Kincaid Level:
                10.5

            Word Count:
            2,262

            Genre:
            Informational

            Keywords:
            math history, mathematics

            ✎ Cite This

  Share
  |

Downloads

          Audio

          Passage PDF

Student Activity

            APA

            MLA

            Chicago

            Carroll, L. (1896). "Book 4: Chapter 4". Symbollic Logic (Lit2Go Edition). Retrieved February 15, 2016, from http://etc.usf.edu/lit2go/212/symbollic-logic/4693/book-4-chapter-4/

            Carroll, Lewis. ""Book 4: Chapter 4"." Symbollic Logic. Lit2Go Edition. 1896. Web. <http://etc.usf.edu/lit2go/212/symbollic-logic/4693/book-4-chapter-4/>. February 15, 2016.

            Lewis Carroll, ""Book 4: Chapter 4"," Symbollic Logic, Lit2Go Edition, (1896), accessed February 15, 2016, http://etc.usf.edu/lit2go/212/symbollic-logic/4693/book-4-chapter-4/.

Back

Next

                  <audio controls style="width:99%;">
            <source src="http://etc.usf.edu/lit2go/audio/mp3/symbollic-logic-020-book-4-chapter-4.4693.mp3" type="audio/mpeg" />
                          <source src="http://etc.usf.edu/lit2go/audio/ogg/symbollic-logic-020-book-4-chapter-4.4693.ogg" type="audio/ogg" />
                        The embedded audio player requires a modern internet browser. You should visit Browse Happy and update your internet browser today!
          </audio>

	CHAPTER IV.

	INTERPRETATION, IN TERMS OF x AND y, OF TRILITERAL DIAGRAM, WHEN MARKED WITH COUNTERS OR DIGITS.

	The problem before us is, given a marked Triliteral Diagram, to ascertain what Propositions of Relation, in terms of x and y, are represented on it.

	The best plan, for a beginner, is to draw a Biliteral Dia- gram alongside of it, and to transfer, from the one to the other, all the information he can. He can then read off, from the Biliteral Diagram, the required Propositions. After a little practice, he will be able to dispense with the Biliteral Diagram, and to read off the result from the Triliteral Diagram itself.

	To transfer the information, observe the following Rules:-

	(1) Examine the N.W. Quarter of the Triliteral Dia- gram.

	(2) If it contains a “1”, in either Cell, it is certainly occupied, and you may mark the N.W. Quarter of the Biliteral Diagram with a “1”.

	(3) If it contains two “0”s, one in each Cell, it is cer- tainly empty, and you may mark the N.W. Quarter of the Biliteral Diagram with a “0”.

	(4) Deal in the same way with the N.E., the S.W., and the S.E. Quarter.

	[Let us take, as examples, the results of the four Examples worked in the previous Chapters.]

	                          (1)

	                    ---------------

	                   |(0)    |    (0)|

	                   |    ---|---    |

	                   |   |   |(0)|   |

	                   |---|---|---|---|

	                   |   |   |(0)|   |

	                   |    ---|---    |

	                   |       |       |

	                    ---------------

	In the N.W. Quarter, only one of the two Cells is marked as empty: so we do not know whether the N.W. Quarter of the Biliteral Diagram is occupied or empty: so we cannot mark it.

	   In the N.E. Quarter, we find two "0"s: so            -------

	this Quarter is certainly empty; and we mark it       |   |(0)|

	so on the Biliteral Diagram.                          |---|---|

	                                                       |   |   |

	   In the S.W. Quarter, we have no information at all.  -------

	In the S.E. Quarter, we have not enough to use.

	We may read off the result as “No x are y’”, or “No y are x,” whichever we prefer.

	                          (2)

	                    ---------------

	                   |       |       |

	                   |    ---|---    |

	                   |   |(0)|(1)|   |

	                   |---|---|---|---|

	                   |   |(0)|   |   |

	                   |    ---|---    |

	                   |       |       |

	                    ---------------

	In the N.W. Quarter, we have not enough information to use.

	                                                     -------

	   In the N.E. Quarter, we find a "1".  This shows  |   |(1)|

	us that it is occupied: so we may mark the N.E.    |---|---|

	Quarter on the Biliteral Diagram with a "1".       |   |   |

	                                                     -------

	In the S.W. Quarter, we have not enough information to use.

	In the S.E. Quarter, we have none at all.

	We may read off the result as “Some x are y’”, or “Some y’ are x”, whichever we prefer.

	                          (3)

	                    ---------------

	                   |       |       |

	                   |    ---|---    |

	                   |   |   |(0)|   |

	                   |---|(1)|---|---|

	                   |   |   |(0)|   |

	                   |    ---|---    |

	                   |(0)    |    (0)|

	                    ---------------

	In the N.W. Quarter, we have no information. (The “1”, sitting on the fence, is of no use to us until we know on which side he means to jump down!)

	In the N.E. Quarter, we have not enough information to use.

	Neither have we in the S.W. Quarter.

	                                                         -------

	   The S.E. Quarter is the only one that yields enough  |   |   |

	information to use.  It is certainly empty: so we      |---|---|

	mark it as such on the Biliteral Diagram.              |   |(0)|

	                                                         -------

	We may read off the results as “No x’ are y’”, or “No y’ are x’”, whichever we prefer.

	                          (4)

	                    ---------------

	                   |(0)    |       |

	                   |    ---|---    |

	                   |   |(1)|   |   |

	                   |---|---|---|---|

	                   |   |(0)|(0)|   |

	                   |    ---|---    |

	                   |(0)    |       |

	                    ---------------

	                                                       -------

	   The N.W. Quarter is occupied, in spite of the "0"  |(1)|   |

	in the Outer Cell.  So we mark it with a "1" on      |---|---|

	the Biliteral Diagram.                               |   |   |

	                                                       -------

	   The N.E. Quarter yields no information.             -------

	                                                      |(1)|   |

	   The S.W. Quarter is certainly empty.  So we mark   |---|---|

	it as such on the Biliteral Diagram.                 |(0)|   |

	                                                       -------

	The S.E. Quarter does not yield enough information to use.

	We read of the result as “Ally are x.”]

Back

Next

            This collection of children's literature is a part of the Educational Technology Clearinghouse and is funded by various grants.

            Copyright © 2006—2016 by the Florida Center for Instructional Technology, College of Education, University of South Florida.

License

Credits

FAQ

Giving

This document was downloaded from Lit2Go, a free online collection of stories and poems in Mp3 (audiobook) format published by the Florida Center for Instructional Technology. For more information, including classroom activities, readability data, and original sources, please visit http://etc.usf.edu/lit2go/212/symbollic-logic/4693/book-4-chapter-4/.

Lit2Go: Symbollic Logic

"Book 4: Chapter 4"


text:
*NOTE* that this kernel is *DEPRECATED* in favour of the
[native GAP kernel](https://github.com/gap-packages/JupyterKernel) and
currently does not have a maintainer.

If you would like to take over maintainership of the code, contact
me by email.

A Jupyter kernel for the [GAP Computer Algebra System](https://www.gap-system.org/).

## Installation

You need a very recent version (current `master` or wait for GAP 4.9)
of [GAP](https://www.gap-system.org) installed, and either `gap` has to be in
your `PATH` or you have to set the environment variable `JUPYTER_GAP_EXECUTABLE`
to your gap executable.

To install the kernel

```shell
    python setup.py install
```

or if you want to install the latest released version

```
    pip install jupyter-kernel-gap
```

should work, too.

## Getting Started

To use `jupyter-kernel-gap`, use one of the following:

```shell
    jupyter notebook
    jupyter qtconsole --kernel gap
    jupyter console --kernel gap
```

If you want to use the `JUPYTER_DotSplash` function, you will need `graphviz` installed
and in the path. If you want to use `JUPYTER_TikZSplash`, you will need a `TeX` installation
including the `TikZ` packages with `pdflatex` and and `pdf2svg` installed.

## Bug reports and feature requests

Please submit bug reports and feature requests via our GitHub issue tracker:

  <https://github.com/gap-packages/jupyter-kernel-gap/issues>

# License

jupyter-kernel-gap is free software; you can redistribute it and/or modify it
under the terms of the BSD 3-clause license.

For details see the file LICENSE.


text:
package libproxy

import (
	"io"
	"net"
	"strings"
)

// Conn defines a network connection
type Conn interface {
	net.Conn
	CloseWrite() error
}

// ProxyStream data between client and backend, until both are at EOF or quit is closed.
func ProxyStream(client, backend Conn, quit <-chan struct{}) error {
	event := make(chan int64)
	var broker = func(to, from Conn) {
		written, err := io.Copy(to, from)
		if err != nil && err != io.EOF && !errIsBeingClosed(err) {
			log.Println("error copying:", err)
		}
		err = to.CloseWrite()
		if err != nil && !errIsNotConnected(err) && !errIsBeingClosed(err) {
			log.Println("error CloseWrite to:", err)
		}
		event <- written
	}

	go broker(client, backend)
	go broker(backend, client)

	var transferred int64
	for i := 0; i < 2; i++ {
		select {
		case written := <-event:
			transferred += written
		case <-quit:
			// Interrupt the two brokers and "join" them.
			backend.Close()
			for ; i < 2; i++ {
				transferred += <-event
			}
			return nil
		}
	}
	backend.Close()
	return nil
}

func errIsNotConnected(err error) bool {
	return strings.HasSuffix(err.Error(), "is not connected")
}

func errIsConnectionRefused(err error) bool {
	return strings.HasSuffix(err.Error(), "connection refused")
}

func errIsBeingClosed(err error) bool {
	return strings.HasSuffix(err.Error(), "is being closed.")
}


text:
SPI flash related APIs
======================

Overview
--------
Spi_flash component contains APIs related to reading, writing, erasing,
memory mapping data in the external SPI flash. It also has higher-level
APIs which work with partition table and partitions.

Note that all the functionality is limited to the "main" flash chip,
i.e. the flash chip from which program runs. For ``spi_flash_*`` functions,
this is software limitation. Underlying ROM functions which work with SPI flash
do not have provisions for working with flash chips attached to SPI peripherals
other than SPI0.

SPI flash access APIs
---------------------

This is the set of APIs for working with data in flash:

- ``spi_flash_read`` used to read data from flash to RAM
- ``spi_flash_write`` used to write data from RAM to flash
- ``spi_flash_erase_sector`` used to erase individual sectors of flash
- ``spi_flash_erase_range`` used to erase range of addresses in flash
- ``spi_flash_get_chip_size`` returns flash chip size, in bytes, as configured in menuconfig

There are some data alignment limitations which need to be considered when using
spi_flash_read/spi_flash_write functions:

- buffer in RAM must be 4-byte aligned
- size must be 4-byte aligned
- address in flash must be 4-byte aligned

These alignment limitations are purely software, and should be removed in future
versions.

It is assumed that correct SPI flash chip size is set at compile time using
menuconfig. While run-time detection of SPI flash chip size is possible, it is
not implemented yet. Applications which need this (e.g. to provide one firmware
binary for different flash sizes) can do flash chip size detection and set
the correct flash chip size in ``chip_size`` member of ``g_rom_flashchip``
structure. This size is used by ``spi_flash_*`` functions for bounds checking.

SPI flash APIs disable instruction and data caches while reading/writing/erasing.
See implementation notes below on details how this happens. For application
this means that at some periods of time, code can not be run from flash,
and constant data can not be fetched from flash by the CPU. This is not an
issue for normal code which runs in a task, because SPI flash APIs prevent
other tasks from running while caches are disabled. This is an issue for
interrupt handlers, which can still be called while flash operation is in
progress. If the interrupt handler is not placed into IRAM, there is a
possibility that interrupt will happen at the time when caches are disabled,
which will cause an illegal instruction exception.

To prevent this, make sure that all ISR code, and all functions called from ISR
code are placed into IRAM, or are located in ROM. Most useful C library
functions are located in ROM, so they can be called from ISR.

To place a function into IRAM, use ``IRAM_ATTR`` attribute, e.g.::

	#include "esp_attr.h"

	void IRAM_ATTR gpio_isr_handler(void* arg)
	{
		// ...
	}

When flash encryption is enabled, ``spi_flash_read`` will read data as it is
stored in flash (without decryption), and ``spi_flash_write`` will write data
in plain text. In other words, ``spi_flash_read/write`` APIs don't have
provisions to deal with encrypted data.

Partition table APIs
--------------------

ESP-IDF uses partition table to maintain information about various regions of
SPI flash memory (bootloader, various application binaries, data, filesystems).
More information about partition tables can be found in docs/partition_tables.rst.

This component provides APIs to enumerate partitions found in the partition table
and perform operations on them. These functions are declared in ``esp_partition.h``:

- ``esp_partition_find`` used to search partition table for entries with specific type, returns an opaque iterator
- ``esp_partition_get`` returns a structure describing the partition, for the given iterator
- ``esp_partition_next`` advances iterator to the next partition found
- ``esp_partition_iterator_release`` releases iterator returned by ``esp_partition_find``
- ``esp_partition_find_first`` is a convenience function which returns structure describing the first partition found by esp_partition_find
- ``esp_partition_read``, ``esp_partition_write``, ``esp_partition_erase_range`` are equivalent to ``spi_flash_read``, ``spi_flash_write``, ``spi_flash_erase_range``, but operate within partition boundaries

Most application code should use ``esp_partition_*`` APIs instead of lower level
``spi_flash_*`` APIs. Partition APIs do bounds checking and calculate correct
offsets in flash based on data stored in partition table.

Memory mapping APIs
-------------------

ESP32 features memory hardware which allows regions of flash memory to be mapped
into instruction and data address spaces. This mapping works only for read operations,
it is not possible to modify contents of flash memory by writing to mapped memory
region. Mapping happens in 64KB pages. Memory mapping hardware can map up to
4 megabytes of flash into data address space, and up to 16 megabytes of flash into
instruction address space. See the technical reference manual for more details
about memory mapping hardware.

Note that some number of 64KB pages is used to map the application
itself into memory, so the actual number of available 64KB pages may be less.

Reading data from flash using a memory mapped region is the only way to decrypt
contents of flash when flash encryption is enabled. Decryption is performed at
hardware level.

Memory mapping APIs are declared in ``esp_spi_flash.h`` and ``esp_partition.h``:

- ``spi_flash_mmap`` maps a region of physical flash addresses into instruction space or data space of the CPU
- ``spi_flash_munmap`` unmaps previously mapped region
- ``esp_partition_mmap`` maps part of a partition into the instruction space or data space of the CPU

Differences between ``spi_flash_mmap`` and ``esp_partition_mmap`` are as follows:

- ``spi_flash_mmap`` must be given a 64KB aligned physical address
- ``esp_partition_mmap`` may be given an arbitrary offset within the partition, it will adjust returned pointer to mapped memory as necessary

Note that because memory mapping happens in 64KB blocks, it may be possible to
read data outside of the partition provided to ``esp_partition_mmap``.

Implementation notes
--------------------

In order to perform some flash operations, we need to make sure both CPUs
are not running any code from flash for the duration of the flash operation.
In a single-core setup this is easy: we disable interrupts/scheduler and do
the flash operation. In the dual-core setup this is slightly more complicated.
We need to make sure that the other CPU doesn't run any code from flash.

When SPI flash API is called on CPU A (can be PRO or APP), we start
spi_flash_op_block_func function on CPU B using esp_ipc_call API. This API
wakes up high priority task on CPU B and tells it to execute given function,
in this case spi_flash_op_block_func. This function disables cache on CPU B and
signals that cache is disabled by setting s_flash_op_can_start flag.
Then the task on CPU A disables cache as well, and proceeds to execute flash
operation.

While flash operation is running, interrupts can still run on CPUs A and B.
We assume that all interrupt code is placed into RAM. Once interrupt allocation
API is added, we should add a flag to request interrupt to be disabled for
the duration of flash operations.

Once flash operation is complete, function on CPU A sets another flag,
s_flash_op_complete, to let the task on CPU B know that it can re-enable
cache and release the CPU. Then the function on CPU A re-enables the cache on
CPU A as well and returns control to the calling code.

Additionally, all API functions are protected with a mutex (s_flash_op_mutex).

In a single core environment (CONFIG_FREERTOS_UNICORE enabled), we simply
disable both caches, no inter-CPU communication takes place.


text:
from pyvisdk.esxcli.executer import execute_soap
from pyvisdk.esxcli.base import Base

class IscsiNetworkportal(Base):
    '''
    Operations that can be performed on iSCSI Network Portal (iSCSI vmknic)
    '''
    moid = 'ha-cli-handler-iscsi-networkportal'
    def add(self, adapter, nic, force=None):
        '''
        Add a network portal for iSCSI adapter
        :param adapter: string, The iSCSI adapter name.
        :param force: boolean, The force flag (force add of iSCSI vmknic even it's not compatible for iscsi multipathing)
        :param nic: string, The iSCSI network portal (bound vmknic)
        :returns: void
        '''
        return execute_soap(self._client, self._host, self.moid, 'vim.EsxCLI.iscsi.networkportal.Add',
                            adapter=adapter,
                            force=force,
                            nic=nic,
                            )
    def list(self, adapter=None):
        '''
        List Network Portal for iSCSI Adapter
        :param adapter: string, The iSCSI adapter name.
        :returns: vim.EsxCLI.iscsi.networkportal.list.NetworkPortal[]
        '''
        return execute_soap(self._client, self._host, self.moid, 'vim.EsxCLI.iscsi.networkportal.List',
                            adapter=adapter,
                            )
    def remove(self, adapter, nic, force=None):
        '''
        Remove a network portal for iSCSI adapter
        :param adapter: string, The iSCSI adapter name.
        :param force: boolean, The force flag (force removal of iSCSI vmknic when sessions are active using it)
        :param nic: string, The iSCSI network portal (bound vmknic)
        :returns: void
        '''
        return execute_soap(self._client, self._host, self.moid, 'vim.EsxCLI.iscsi.networkportal.Remove',
                            adapter=adapter,
                            force=force,
                            nic=nic,
                            )