text:
import abc
import warnings

import numpy as np
from collections.abc import Iterable

np.seterr('warn')

from scipy.special import gamma as scipy_gamma
from scipy.special import gammaln as scipy_gammaln
from astropy.modeling.fitting import _fitter_to_model_params
from astropy.modeling import models

from stingray import Lightcurve, Powerspectrum
from stingray.utils import assign_if_not_finite

# TODO: Add checks and balances to code

#from stingray.modeling.parametricmodels import logmin

__all__ = ["set_logprior", "Posterior", "PSDPosterior", "LogLikelihood", "PoissonLogLikelihood",
           "PSDLogLikelihood", "GaussianLogLikelihood", "LaplaceLogLikelihood",
           "PoissonPosterior", "GaussianPosterior", "LaplacePosterior",
           "PriorUndefinedError", "LikelihoodUndefinedError"]

logmin = -10000000000000000.0

class PriorUndefinedError(Exception):
    pass

class LikelihoodUndefinedError(Exception):
    pass

class IncorrectParameterError(Exception):
    pass

def set_logprior(lpost, priors):
    """
    This function constructs the ``logprior`` method required to successfully
    use a :class:`Posterior` object.

    All instances of class :class:`Posterior` and its subclasses require to implement a
    ``logprior`` methods. However, priors are strongly problem-dependent and
    therefore usually user-defined.

    This function allows for setting the ``logprior`` method on any instance
    of class :class:`Posterior` efficiently by allowing the user to pass a
    dictionary of priors and an instance of class :class:`Posterior`.

    Parameters
    ----------
    lpost : :class:`Posterior` object
        An instance of class :class:`Posterior` or any of its subclasses

    priors : dict
        A dictionary containing the prior definitions. Keys are parameter
        names as defined by the ``astropy.models.FittableModel`` instance supplied
        to the ``model`` parameter in :class:`Posterior`. Items are functions
        that take a parameter as input and return the log-prior probability
        of that parameter.

    Returns
    -------
        logprior : function
            The function definition for the prior

    Examples
    --------
    Make a light curve and power spectrum

    >>> photon_arrivals = np.sort(np.random.uniform(0,1000, size=10000))
    >>> lc = Lightcurve.make_lightcurve(photon_arrivals, dt=1.0)
    >>> ps = Powerspectrum(lc, norm="frac")

    Define the model

    >>> pl = models.PowerLaw1D()
    >>> pl.x_0.fixed = True

    Instantiate the posterior:

    >>> lpost = PSDPosterior(ps.freq, ps.power, pl, m=ps.m)

    Define the priors:

    >>> p_alpha = lambda alpha: ((-1. <= alpha) & (alpha <= 5.))
    >>> p_amplitude = lambda amplitude: ((-10 <= np.log(amplitude)) &
    ...                                 ((np.log(amplitude) <= 10.0)))
    >>> priors = {"alpha":p_alpha, "amplitude":p_amplitude}

    Set the logprior method in the lpost object:

    >>> lpost.logprior = set_logprior(lpost, priors)
    """

    # get the number of free parameters in the model
    #free_params = [p for p in lpost.model.param_names if not
    #                getattr(lpost.model, p).fixed]
    free_params = [key for key, l in lpost.model.fixed.items() if not l]

    # define the logprior
    def logprior(t0, neg=False):
        """
        The logarithm of the prior distribution for the
        model defined in self.model.

        Parameters
        ----------
        t0 : {list | numpy.ndarray}
            The list with parameters for the model

        Returns
        -------
        logp : float
            The logarithm of the prior distribution for the model and
            parameters given.
        """

        if len(t0) != len(free_params):
            raise IncorrectParameterError("The number of parameters passed into "
                                          "the prior does not match the number "
                                          "of parameters in the model.")

        logp = 0.0 # initialize log-prior
        ii = 0 # counter for the variable parameter

        # loop through all parameter names, but only compute
        # prior for those that are not fixed
        # Note: need to do it this way to preserve order of parameters
        # correctly!
        for pname in lpost.model.param_names:
            if not lpost.model.fixed[pname]:
                with warnings.catch_warnings(record=True) as out:
                    logp += np.log(priors[pname](t0[ii]))
                    if len(out) > 0:
                        if isinstance(out[0].message, RuntimeWarning):
                            logp = np.nan

                ii += 1

        logp = assign_if_not_finite(logp, logmin)

        if neg:
            return -logp
        else:
            return logp

    return logprior

class LogLikelihood(object, metaclass=abc.ABCMeta):
    """

    Abstract Base Class defining the structure of a :class:`LogLikelihood` object.
    This class cannot be called itself, since each statistical distribution
    has its own definition for the likelihood, which should occur in subclasses.

    Parameters
    ----------
    x : iterable
        x-coordinate of the data. Could be multi-dimensional.

    y : iterable
        y-coordinate of the data. Could be multi-dimensional.

    model : an ``astropy.modeling.FittableModel`` instance
        Your model

    kwargs :
        keyword arguments specific to the individual sub-classes. For
        details, see the respective docstrings for each subclass

    """

    def __init__(self, x, y, model, **kwargs):
        self.x = x
        self.y = y

        self.model = model

    @abc.abstractmethod
    def evaluate(self, parameters):
        """
        This is where you define your log-likelihood. Do this, but do it in a subclass!

        """
        pass

    def __call__(self, parameters, neg=False):
        return self.evaluate(parameters, neg)

class GaussianLogLikelihood(LogLikelihood):
    """
    Likelihood for data with Gaussian uncertainties.
    Astronomers also call this likelihood *Chi-Squared*, but be aware
    that this has *nothing* to do with the likelihood based on the
    Chi-square distribution, which is also defined as in of
    :class:`PSDLogLikelihood` in this module!

    Use this class here whenever your data has Gaussian uncertainties.

    Parameters
    ----------
    x : iterable
        x-coordinate of the data

    y : iterable
        y-coordinte of the data

    yerr : iterable
        the uncertainty on the data, as standard deviation

    model : an ``astropy.modeling.FittableModel`` instance
        The model to use in the likelihood.

    Attributes
    ----------
    x : iterable
        x-coordinate of the data

    y : iterable
        y-coordinte of the data

    yerr : iterable
        the uncertainty on the data, as standard deviation

    model : an Astropy Model instance
        The model to use in the likelihood.

    npar : int
        The number of free parameters in the model
    """

    def __init__(self, x, y, yerr, model):

        self.x = x
        self.y = y
        self.yerr = yerr
        self.model = model

        self.npar = 0
        for pname in self.model.param_names:
            if not self.model.fixed[pname]:
                self.npar += 1

    def evaluate(self, pars, neg=False):
        """
        Evaluate the Gaussian log-likelihood for a given set of parameters.

        Parameters
        ----------
        pars : numpy.ndarray
            An array of parameters at which to evaluate the model
            and subsequently the log-likelihood. Note that the
            length of this array must match the free parameters in
            ``model``, i.e. ``npar``

        neg : bool, optional, default ``False``
            If ``True``, return the *negative* log-likelihood, i.e.
            ``-loglike``, rather than ``loglike``. This is useful e.g.
            for optimization routines, which generally minimize
            functions.

        Returns
        -------
        loglike : float
            The log(likelihood) value for the data and model.

        """
        if np.size(pars) != self.npar:
            raise IncorrectParameterError("Input parameters must" +
                                          " match model parameters!")

        _fitter_to_model_params(self.model, pars)

        mean_model = self.model(self.x)

        loglike = np.sum(-0.5*np.log(2.*np.pi) - np.log(self.yerr) -
                         (self.y-mean_model)**2/(2.*self.yerr**2))

        loglike = assign_if_not_finite(loglike, logmin)

        if neg:
            return -loglike
        else:
            return loglike

class PoissonLogLikelihood(LogLikelihood):
    """
    Likelihood for data with uncertainties following a Poisson distribution.
    This is useful e.g. for (binned) photon count data.

    Parameters
    ----------
    x : iterable
        x-coordinate of the data

    y : iterable
        y-coordinte of the data

    model : an ``astropy.modeling.FittableModel`` instance
        The model to use in the likelihood.

    Attributes
    ----------
    x : iterable
        x-coordinate of the data

    y : iterable
        y-coordinte of the data

    yerr : iterable
        the uncertainty on the data, as standard deviation

    model : an ``astropy.modeling.FittableModel`` instance
        The model to use in the likelihood.

    npar : int
        The number of free parameters in the model
    """
    def __init__(self, x, y, model):

        self.x = x
        self.y = y
        self.model = model
        self.npar = 0
        for pname in self.model.param_names:
            if not self.model.fixed[pname]:
                self.npar += 1

    def evaluate(self, pars, neg=False):
        """
        Evaluate the log-likelihood for a given set of parameters.

        Parameters
        ----------
        pars : numpy.ndarray
            An array of parameters at which to evaluate the model
            and subsequently the log-likelihood. Note that the
            length of this array must match the free parameters in
            ``model``, i.e. ``npar``

        neg : bool, optional, default ``False``
            If ``True``, return the *negative* log-likelihood, i.e.
            ``-loglike``, rather than ``loglike``. This is useful e.g.
            for optimization routines, which generally minimize
            functions.

        Returns
        -------
        loglike : float
            The log(likelihood) value for the data and model.

        """
        if np.size(pars) != self.npar:
            raise IncorrectParameterError("Input parameters must" +
                                          " match model parameters!")

        _fitter_to_model_params(self.model, pars)

        mean_model = self.model(self.x)

        loglike = np.sum(-mean_model + self.y*np.log(mean_model) \
               - scipy_gammaln(self.y + 1.))

        loglike = assign_if_not_finite(loglike, logmin)

        if neg:
            return -loglike
        else:
            return loglike

class PSDLogLikelihood(LogLikelihood):
    """
    A likelihood based on the Chi-square distribution, appropriate for modelling
    (averaged) power spectra. Note that this is *not* the same as the statistic
    astronomers commonly call *Chi-Square*, which is a fit statistic derived from
    the Gaussian log-likelihood, defined elsewhere in this module.

    Parameters
    ----------
    freq : iterable
        Array with frequencies

    power : iterable
        Array with (averaged/singular) powers corresponding to the
        frequencies in ``freq``

    model : an ``astropy.modeling.FittableModel`` instance
        The model to use in the likelihood.

    m : int
        1/2 of the degrees of freedom

    Attributes
    ----------
    x : iterable
        x-coordinate of the data

    y : iterable
        y-coordinte of the data

    yerr : iterable
        the uncertainty on the data, as standard deviation

    model : an ``astropy.modeling.FittableModel`` instance
        The model to use in the likelihood.

    npar : int
        The number of free parameters in the model
    """

    def __init__(self, freq, power, model, m=1):

        LogLikelihood.__init__(self, freq, power, model)

        self.m = m
        self.npar = 0
        for pname in self.model.param_names:
            if not self.model.fixed[pname] and not self.model.tied[pname]:
                self.npar += 1

    def evaluate(self, pars, neg=False):
        """
        Evaluate the log-likelihood for a given set of parameters.

        Parameters
        ----------
        pars : numpy.ndarray
            An array of parameters at which to evaluate the model
            and subsequently the log-likelihood. Note that the
            length of this array must match the free parameters in
            ``model``, i.e. ``npar``

        neg : bool, optional, default ``False``
            If ``True``, return the *negative* log-likelihood, i.e.
            ``-loglike``, rather than ``loglike``. This is useful e.g.
            for optimization routines, which generally minimize
            functions.

        Returns
        -------
        loglike : float
            The log(likelihood) value for the data and model.

        """
        if np.size(pars) != self.npar:
            raise IncorrectParameterError("Input parameters must" +
                                          " match model parameters!")

        _fitter_to_model_params(self.model, pars)

        mean_model = self.model(self.x)

        with warnings.catch_warnings(record=True) as out:
            if not isinstance(self.m, Iterable) and self.m == 1:
                loglike = -np.sum(np.log(mean_model)) - \
                          np.sum(self.y/mean_model)

            else:
                dof = 2.0 * self.m
                loglike = -(
                    np.sum(dof * np.log(mean_model)) +
                    np.sum(dof * self.y / mean_model) +
                    np.sum(dof * (2.0 / dof - 1.0) * np.log(self.y)))

        loglike = assign_if_not_finite(loglike, logmin)

        if neg:
            return -loglike
        else:
            return loglike

class LaplaceLogLikelihood(LogLikelihood):
    """
    A Laplace likelihood for the cospectrum.

    Parameters
    ----------
    x : iterable
        Array with independent variable

    y : iterable
        Array with dependent variable

    model : an ``astropy.modeling.FittableModel`` instance
        The model to use in the likelihood.

    yerr : iterable
        Array with the uncertainties on ``y``, in standard deviation

    Attributes
    ----------
    x : iterable
        x-coordinate of the data

    y : iterable
        y-coordinte of the data

    yerr : iterable
        the uncertainty on the data, as standard deviation

    model : an ``astropy.modeling.FittableModel`` instance
        The model to use in the likelihood.

    npar : int
        The number of free parameters in the model
    """

    def __init__(self, x, y, yerr, model):
        LogLikelihood.__init__(self, x, y, model)
        self.yerr = yerr

        self.npar = 0
        for pname in self.model.param_names:
            if not self.model.fixed[pname] and not self.model.tied[pname]:
                self.npar += 1

    def evaluate(self, pars, neg=False):
        """
        Evaluate the log-likelihood for a given set of parameters.

        Parameters
        ----------
        pars : numpy.ndarray
            An array of parameters at which to evaluate the model
            and subsequently the log-likelihood. Note that the
            length of this array must match the free parameters in
            ``model``, i.e. ``npar``

        neg : bool, optional, default ``False``
            If ``True``, return the *negative* log-likelihood, i.e.
            ``-loglike``, rather than ``loglike``. This is useful e.g.
            for optimization routines, which generally minimize
            functions.

        Returns
        -------
        loglike : float
            The log(likelihood) value for the data and model.
        """

        if np.size(pars) != self.npar:
            raise IncorrectParameterError("Input parameters must" +
                                          " match model parameters!")

        _fitter_to_model_params(self.model, pars)

        mean_model = self.model(self.x)

        with warnings.catch_warnings(record=True) as out:

                        loglike = np.sum(-np.log(2.*self.yerr) - \
                                  (np.abs(self.y - mean_model)/self.yerr))

        loglike = assign_if_not_finite(loglike, logmin)

        if neg:
            return -loglike
        else:
            return loglike

class Posterior(object):
    """
    Define a :class:`Posterior` object.

    The :class:`Posterior` describes the Bayesian probability distribution of
    a set of parameters :math:`\\theta` given some observed data :math:`D` and
    some prior assumptions :math:`I`.

    It is defined as

    .. math::

        p(\\theta | D, I) = p(D | \\theta, I) p(\\theta | I)/p(D| I)

    where :math:`p(D | \\theta, I)` describes the likelihood, i.e. the
    sampling distribution of the data and the (parametric) model, and
    :math:`p(\\theta | I)` describes the prior distribution, i.e. our information
    about the parameters :math:`\\theta` before we gathered the data.
    The marginal likelihood :math:`p(D| I)` describes the probability of
    observing the data given the model assumptions, integrated over the
    space of all parameters.

    Parameters
    ----------
    x : iterable
        The abscissa or independent variable of the data. This could
        in principle be a multi-dimensional array.

    y : iterable
        The ordinate or dependent variable of the data.

    model : ``astropy.modeling.models`` instance
        The parametric model supposed to represent the data. For details
        see the ``astropy.modeling`` documentation

    kwargs :
        keyword arguments related to the subclasses of :class:`Posterior`. For
        details, see the documentation of the individual subclasses

    References
    ----------
    * Sivia, D. S., and J. Skilling. "Data Analysis: \
        A Bayesian Tutorial. 2006."
    * Gelman, Andrew, et al. Bayesian data analysis. Vol. 2. Boca Raton, \
        FL, USA: Chapman & Hall/CRC, 2014.
    * von Toussaint, Udo. "Bayesian inference in physics." \
        Reviews of Modern Physics 83.3 (2011): 943.
    * Hogg, David W. "Probability Calculus for inference". \
        arxiv: 1205.4446

    """
    def __init__(self, x, y, model, **kwargs):

        self.x = x
        self.y = y

        self.model = model

        self.npar = 0
        for pname in self.model.param_names:
            if not self.model.fixed[pname]:
                self.npar += 1

    def logposterior(self, t0, neg=False):
        """
        Definition of the log-posterior.
        Requires methods ``loglikelihood`` and ``logprior`` to both
        be defined.

        Note that ``loglikelihood`` is set in the subclass of :class:`Posterior`
        appropriate for your problem at hand, as is ``logprior``.

        Parameters
        ----------
        t0 : numpy.ndarray
            An array of parameters at which to evaluate the model
            and subsequently the log-posterior. Note that the
            length of this array must match the free parameters in
            ``model``, i.e. ``npar``

        neg : bool, optional, default ``False``
            If ``True``, return the *negative* log-posterior, i.e.
            ``-lpost``, rather than ``lpost``. This is useful e.g.
            for optimization routines, which generally minimize
            functions.

        Returns
        -------
        lpost : float
            The value of the log-posterior for the given parameters ``t0``
        """

        if not hasattr(self, "logprior"):
            raise PriorUndefinedError("There is no prior implemented. " +
                                      "Cannot calculate posterior!")

        if not hasattr(self, "loglikelihood"):
            raise LikelihoodUndefinedError("There is no likelihood implemented. " +
                                           "Cannot calculate posterior!")

        logpr = self.logprior(t0)
        loglike = self.loglikelihood(t0)

        if np.isclose(logpr, logmin):
            lpost = logmin
        else:
            lpost = logpr + loglike

        if neg is True:
            return -lpost
        else:
            return lpost

    def __call__(self, t0, neg=False):
        return self.logposterior(t0, neg=neg)

class PSDPosterior(Posterior):
    """
    :class:`Posterior` distribution for power spectra.
    Uses an exponential distribution for the errors in the likelihood,
    or a :math:`\\chi^2` distribution with :math:`2M` degrees of freedom, where
    :math:`M` is the number of frequency bins or power spectra averaged in each bin.

    Parameters
    ----------
    ps : {:class:`stingray.Powerspectrum` | :class:`stingray.AveragedPowerspectrum`} instance
        the :class:`stingray.Powerspectrum` object containing the data

    model : instance of any subclass of ``astropy.modeling.FittableModel``
        The model for the power spectrum.

    priors : dict of form ``{"parameter name": function}``, optional
        A dictionary with the definitions for the prior probabilities.
        For each parameter in ``model``, there must be a prior defined with
        a key of the exact same name as stored in ``model.param_names``.
        The item for each key is a function definition defining the prior
        (e.g. a lambda function or a ``scipy.stats.distribution.pdf``.
        If ``priors = None``, then no prior is set. This means priors need
        to be added by hand using the :func:`set_logprior` function defined in
        this module. Note that it is impossible to call a :class:`Posterior` object
        itself or the ``self.logposterior`` method without defining a prior.

    m : int, default ``1``
        The number of averaged periodograms or frequency bins in ``ps``.
        Useful for binned/averaged periodograms, since the value of
        m will change the likelihood function!

    Attributes
    ----------
    ps : {:class:`stingray.Powerspectrum` | :class:`stingray.AveragedPowerspectrum`} instance
        the :class:`stingray.Powerspectrum` object containing the data

    x : numpy.ndarray
        The independent variable (list of frequencies) stored in ``ps.freq``

    y : numpy.ndarray
        The dependent variable (list of powers) stored in ``ps.power``

    model : instance of any subclass of ``astropy.modeling.FittableModel``
        The model for the power spectrum.

    """

    def __init__(self, freq, power, model, priors=None, m=1):
        self.loglikelihood = PSDLogLikelihood(freq, power,
                                              model, m=m)

        self.m = m
        Posterior.__init__(self, freq, power, model)

        if not priors is None:
            self.logprior = set_logprior(self, priors)

class PoissonPosterior(Posterior):
    """
    :class:`Posterior` for Poisson light curve data. Primary intended use is for
    modelling X-ray light curves, but alternative uses are conceivable.

    Parameters
    ----------
    x : numpy.ndarray
        The independent variable (e.g. time stamps of a light curve)

    y : numpy.ndarray
        The dependent variable (e.g. counts per bin of a light curve)

    model : instance of any subclass of ``astropy.modeling.FittableModel``
        The model for the power spectrum.

    priors : dict of form ``{"parameter name": function}``, optional
        A dictionary with the definitions for the prior probabilities.
        For each parameter in ``model``, there must be a prior defined with
        a key of the exact same name as stored in ``model.param_names``.
        The item for each key is a function definition defining the prior
        (e.g. a lambda function or a ``scipy.stats.distribution.pdf``.
        If ``priors = None``, then no prior is set. This means priors need
        to be added by hand using the :func:`set_logprior` function defined in
        this module. Note that it is impossible to call a :class:`Posterior` object
        itself or the ``self.logposterior`` method without defining a prior.

    Attributes
    ----------
    x : numpy.ndarray
        The independent variable (list of frequencies) stored in ps.freq

    y : numpy.ndarray
        The dependent variable (list of powers) stored in ps.power

    model : instance of any subclass of ``astropy.modeling.FittableModel``
        The model for the power spectrum.

    """
    def __init__(self, x, y, model, priors=None):

        self.x = x
        self.y = y

        self.loglikelihood = PoissonLogLikelihood(self.x, self.y, model)

        Posterior.__init__(self, self.x, self.y, model)

        if not priors is None:
            self.logprior = set_logprior(self, priors)

class GaussianPosterior(Posterior):
    """
    A general class for two-dimensional data following a Gaussian
    sampling distribution.

    Parameters
    ----------
    x : numpy.ndarray
        independent variable

    y : numpy.ndarray
        dependent variable

    yerr : numpy.ndarray
        measurement uncertainties for y

    model : instance of any subclass of ``astropy.modeling.FittableModel``
        The model for the power spectrum.

    priors : dict of form ``{"parameter name": function}``, optional
        A dictionary with the definitions for the prior probabilities.
        For each parameter in ``model``, there must be a prior defined with
        a key of the exact same name as stored in ``model.param_names``.
        The item for each key is a function definition defining the prior
        (e.g. a lambda function or a ``scipy.stats.distribution.pdf``.
        If ``priors = None``, then no prior is set. This means priors need
        to be added by hand using the :func:`set_logprior` function defined in
        this module. Note that it is impossible to call a :class:`Posterior` object
        itself or the ``self.logposterior`` method without defining a prior.

    """
    def __init__(self, x, y, yerr, model, priors=None):

        self.loglikelihood = GaussianLogLikelihood(x, y, yerr, model)

        Posterior.__init__(self, x, y, model)

        self.yerr = yerr

        if not priors is None:
            self.logprior = set_logprior(self, priors)

class LaplacePosterior(Posterior):
    """
    A general class for two-dimensional data following a Gaussian
    sampling distribution.

    Parameters
    ----------
    x : numpy.ndarray
        independent variable

    y : numpy.ndarray
        dependent variable

    yerr : numpy.ndarray
        measurement uncertainties for y, in standard deviation

    model : instance of any subclass of ``astropy.modeling.FittableModel``
        The model for the power spectrum.

    priors : dict of form ``{"parameter name": function}``, optional
        A dictionary with the definitions for the prior probabilities.
        For each parameter in ``model``, there must be a prior defined with
        a key of the exact same name as stored in ``model.param_names``.
        The item for each key is a function definition defining the prior
        (e.g. a lambda function or a ``scipy.stats.distribution.pdf``.
        If ``priors = None``, then no prior is set. This means priors need
        to be added by hand using the :func:`set_logprior` function defined in
        this module. Note that it is impossible to call a :class:`Posterior` object
        itself or the ``self.logposterior`` method without defining a prior.

    """
    def __init__(self, x, y, yerr, model, priors=None):

        self.loglikelihood = LaplaceLogLikelihood(x, y, yerr, model)

        Posterior.__init__(self, x, y, model)

        self.yerr = yerr

        if not priors is None:
            self.logprior = set_logprior(self, priors)


text:
//package com.mjiayou.trecore.util;
//
//import android.content.Context;
//import android.content.SharedPreferences;
//import android.text.TextUtils;
//
//import com.google.gson.Gson;
//import com.google.gson.reflect.TypeToken;
//import com.mjiayou.trecore.bean.entity.TCUser;
//import com.mjiayou.trecore.helper.GsonHelper;
//import com.mjiayou.trecorelib.util.LogUtil;
//
//import java.lang.reflect.Type;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Set;
//
///**
// * Created by treason on 16/5/14.
// */
//public class SharedUtil {
//
//    private static final String TAG = "SharedUtil";
//
//    // var
//    private static SharedUtil mInstance;
//    private Context mContext;
//    private Gson mGson;
//
//    // SharedPreferences
//    // APP配置
//    private SharedPreferences mSharedConfig;
//    private String PREFERENCES_CONFIG = "preferences_config";
//    private String KEY_CONFIG_IS_FIRST = "key_config_is_first"; // 是否第一次使用APP
//    private String KEY_CONFIG_VERSION_CODE = "key_config_version_code"; // 本地记录版本号
//    private String KEY_CONFIG_THEME_ID = "key_config_theme_id"; // 当前主题ID
//    // 个人账户信息
//    private SharedPreferences mSharedAccount;
//    private String PREFERENCES_ACCOUNT = "preferences_account";
//    private String KEY_ACCOUNT_USERNAME = "key_account_username"; // 用户名
//    private String KEY_ACCOUNT_PASSWORD = "key_account_password"; // 密码
//    private String KEY_ACCOUNT_TOKEN = "key_account_token"; // Token
//    private String KEY_ACCOUNT_USER_ID = "key_account_user_id"; // UserID
//    private String KEY_ACCOUNT_USER_INFO = "key_account_user_info"; // 用户个人信息
//    private String KEY_ACCOUNT_UUID = "key_account_uuid"; // UUID
//    // 本地缓存数据
//    private SharedPreferences mSharedCache;
//    private String PREFERENCE_CACHE = "preference_cache";
//    private String KEY_CACHE_SEARCH_HISTORY = "key_cache_search_history";
//    private String KEY_CACHE_USER_LIST = "key_cache_user_list";
//    // 通用
//    private SharedPreferences mSharedCommon;
//    private String PREFERENCE_COMMON = "preference_common";
//    private String KEY_COMMON_TEST = "key_common_test";
//
//    /**
//     * 构造函数
//     */
//    private SharedUtil(Context context) {
//        this.mContext = context;
//        this.mGson = GsonHelper.get();
//        this.mSharedConfig = context.getSharedPreferences(PREFERENCES_CONFIG, Context.MODE_PRIVATE);
//        this.mSharedAccount = context.getSharedPreferences(PREFERENCES_ACCOUNT, Context.MODE_PRIVATE);
//        this.mSharedCache = context.getSharedPreferences(PREFERENCE_CACHE, Context.MODE_PRIVATE);
//        this.mSharedCommon = context.getSharedPreferences(PREFERENCE_COMMON, Context.MODE_PRIVATE);
//    }
//
//    /**
//     * 单例模式,获取实例
//     */
//    public static SharedUtil get(Context context) {
//        if (mInstance == null) {
//            synchronized (SharedUtil.class) {
//                if (mInstance == null) {
//                    mInstance = new SharedUtil(context);
//                }
//            }
//        }
//        return mInstance;
//    }
//
//    // ******************************** 封装 ********************************
//
//    /**
//     * 日志规范
//     */
//    private void logSet(String key, Object value) {
//        LogUtil.i(TAG, "SET " + key + " -> " + value);
//    }
//
//    private void logSetFailed() {
//        LogUtil.i(TAG, "SET failed");
//    }
//
//    private void logGet(String key, Object value) {
//        LogUtil.i(TAG, "GET " + key + " -> " + value);
//    }
//
//    private void logGetFailed() {
//        LogUtil.i(TAG, "GET failed");
//    }
//
//    private void logRemovePrepare(String key) {
//        LogUtil.i(TAG, "REMOVE prepare " + key);
//    }
//
//    private void logRemoveSucceed() {
//        LogUtil.i(TAG, "REMOVE succeed");
//    }
//
//    private void logRemoveFailed() {
//        LogUtil.i(TAG, "REMOVE failed");
//    }
//
//    /**
//     * 保存数据
//     */
//    public void setShared(SharedPreferences sharedPreferences, String key, Object value) {
//        if (sharedPreferences != null && !TextUtils.isEmpty(key) && value != null) {
//            SharedPreferences.Editor editor = sharedPreferences.edit();
//            if (value instanceof Boolean) {
//                editor.putBoolean(key, (Boolean) value);
//
//            } else if (value instanceof String) {
//                editor.putString(key, (String) value);
//
//            } else if (value instanceof Integer) {
//                editor.putInt(key, (Integer) value);
//
//            } else if (value instanceof Float) {
//                editor.putFloat(key, (Float) value);
//
//            } else if (value instanceof Long) {
//                editor.putLong(key, (Long) value);
//            }
//            editor.commit();
//            logSet(key, value);
//        } else {
//            logSetFailed();
//        }
//    }
//
//    public void setShared(SharedPreferences sharedPreferences, String key, boolean value) {
//        if (sharedPreferences != null && !TextUtils.isEmpty(key)) {
//            SharedPreferences.Editor editor = sharedPreferences.edit();
//            editor.putBoolean(key, value);
//            editor.commit();
//            logSet(key, value);
//        } else {
//            logSetFailed();
//        }
//    }
//
//    public void setShared(SharedPreferences sharedPreferences, String key, String value) {
//        if (sharedPreferences != null && !TextUtils.isEmpty(key) && value != null) {
//            SharedPreferences.Editor editor = sharedPreferences.edit();
//            editor.putString(key, value);
//            editor.commit();
//            logSet(key, value);
//        } else {
//            logSetFailed();
//        }
//    }
//
//    public void setShared(SharedPreferences sharedPreferences, String key, int value) {
//        if (sharedPreferences != null && !TextUtils.isEmpty(key)) {
//            SharedPreferences.Editor editor = sharedPreferences.edit();
//            editor.putInt(key, value);
//            editor.commit();
//            logSet(key, value);
//        } else {
//            logSetFailed();
//        }
//    }
//
//    public void setShared(SharedPreferences sharedPreferences, String key, float value) {
//        if (sharedPreferences != null && !TextUtils.isEmpty(key)) {
//            SharedPreferences.Editor editor = sharedPreferences.edit();
//            editor.putFloat(key, value);
//            editor.commit();
//            logSet(key, value);
//        } else {
//            logSetFailed();
//        }
//    }
//
//    public void setShared(SharedPreferences sharedPreferences, String key, long value) {
//        if (sharedPreferences != null && !TextUtils.isEmpty(key)) {
//            SharedPreferences.Editor editor = sharedPreferences.edit();
//            editor.putLong(key, value);
//            editor.commit();
//            logSet(key, value);
//        } else {
//            logSetFailed();
//        }
//    }
//
//    /**
//     * 读取数据
//     */
//    public Object getShared(SharedPreferences sharedPreferences, String key, Object defValue) {
//        try {
//            Object value = new Object();
//            if (defValue instanceof Boolean) {
//                value = sharedPreferences.getBoolean(key, (Boolean) defValue);
//
//            } else if (defValue instanceof String) {
//                value = sharedPreferences.getString(key, (String) defValue);
//
//            } else if (defValue instanceof Integer) {
//                value = sharedPreferences.getInt(key, (Integer) defValue);
//
//            } else if (defValue instanceof Float) {
//                value = sharedPreferences.getFloat(key, (Float) defValue);
//
//            } else if (defValue instanceof Long) {
//                value = sharedPreferences.getLong(key, (Long) defValue);
//            }
//            logGet(key, value);
//            return value;
//        } catch (Exception e) {
//            LogUtil.printStackTrace(e);
//            logGetFailed();
//        }
//        return defValue;
//    }
//
//    public boolean getShared(SharedPreferences sharedPreferences, String key, boolean defValue) {
//        try {
//            boolean value = sharedPreferences.getBoolean(key, defValue);
//            logGet(key, value);
//            return value;
//        } catch (Exception e) {
//            LogUtil.printStackTrace(e);
//            logGetFailed();
//        }
//        return defValue;
//    }
//
//    public String getShared(SharedPreferences sharedPreferences, String key, String defValue) {
//        try {
//            String value = sharedPreferences.getString(key, defValue);
//            logGet(key, value);
//            return value;
//        } catch (Exception e) {
//            LogUtil.printStackTrace(e);
//            logGetFailed();
//        }
//        return defValue;
//    }
//
//    public int getShared(SharedPreferences sharedPreferences, String key, int defValue) {
//        try {
//            int value = sharedPreferences.getInt(key, defValue);
//            logGet(key, value);
//            return value;
//        } catch (Exception e) {
//            LogUtil.printStackTrace(e);
//            logGetFailed();
//        }
//        return defValue;
//    }
//
//    public float getShared(SharedPreferences sharedPreferences, String key, float defValue) {
//        try {
//            float value = sharedPreferences.getFloat(key, defValue);
//            logGet(key, value);
//            return value;
//        } catch (Exception e) {
//            LogUtil.printStackTrace(e);
//            logGetFailed();
//        }
//        return defValue;
//    }
//
//    public long getShared(SharedPreferences sharedPreferences, String key, long defValue) {
//        try {
//            long value = sharedPreferences.getLong(key, defValue);
//            logGet(key, value);
//            return value;
//        } catch (Exception e) {
//            LogUtil.printStackTrace(e);
//            logGetFailed();
//        }
//        return defValue;
//    }
//
//    /**
//     * 清除全部数据
//     */
//    public void removeShared(SharedPreferences sharedPreferences) {
//        try {
//            SharedPreferences.Editor editor = sharedPreferences.edit();
//            Set<String> keySet = sharedPreferences.getAll().keySet();
//            for (String key : keySet) {
//                editor.remove(key);
//                logRemovePrepare(key);
//            }
//            editor.commit();
//            logRemoveSucceed();
//        } catch (Exception e) {
//            LogUtil.printStackTrace(e);
//            logRemoveFailed();
//        }
//    }
//
//    /**
//     * 清除全部
//     */
//    public void clearAll() {
//        clearConfig();
//        clearAccount();
//        clearCache();
//        clearCommon();
//    }
//
//    // ******************************** shortcut ********************************
//
//    // **************** mSharedConfig start ****************
//
//    /**
//     * 是否第一次使用APP
//     */
//    public void setConfigIsFirst(boolean isFirst) {
//        setShared(mSharedConfig, KEY_CONFIG_IS_FIRST, isFirst);
//    }
//
//    public boolean getConfigIsFirst() {
//        return getShared(mSharedConfig, KEY_CONFIG_IS_FIRST, true);
//    }
//
//    /**
//     * 记录版本号
//     */
//    public void setConfigVersionCode(int versionCode) {
//        setShared(mSharedConfig, KEY_CONFIG_VERSION_CODE, versionCode);
//    }
//
//    public int getConfigVersionCode() {
//        return getShared(mSharedConfig, KEY_CONFIG_VERSION_CODE, -1); // 默认返回-1,表示没有旧版本
//    }
//
//    /**
//     * 主题ID
//     */
//    public void setConfigThemeId(int themeId) {
//        setShared(mSharedConfig, KEY_CONFIG_THEME_ID, themeId);
//    }
//
//    public int getConfigThemeId() {
//        return getShared(mSharedConfig, KEY_CONFIG_THEME_ID, ThemeUtil.THEME_DEFAULT);
//    }
//
//    /**
//     * 清除配置信息
//     */
//    public void clearConfig() {
//        removeShared(mSharedConfig);
//    }
//
//    // **************** mSharedAccount ****************
//
//    /**
//     * 用户名
//     */
//    public void setAccountUsername(String username) {
//        setShared(mSharedAccount, KEY_ACCOUNT_USERNAME, username);
//    }
//
//    public String getAccountUsername() {
//        return getShared(mSharedAccount, KEY_ACCOUNT_USERNAME, "");
//    }
//
//    /**
//     * 密码
//     */
//    public void setAccountPassword(String password) {
//        setShared(mSharedAccount, KEY_ACCOUNT_PASSWORD, password);
//    }
//
//    public String getAccountPassword() {
//        return getShared(mSharedAccount, KEY_ACCOUNT_PASSWORD, "");
//    }
//
//    /**
//     * Token
//     */
//    public void setAccountToken(String token) {
//        setShared(mSharedAccount, KEY_ACCOUNT_TOKEN, token);
//    }
//
//    public String getAccountToken() {
//        return getShared(mSharedAccount, KEY_ACCOUNT_TOKEN, "");
//    }
//
//    /**
//     * UserID
//     */
//    public void setAccountUserID(String userID) {
//        setShared(mSharedAccount, KEY_ACCOUNT_USER_ID, userID);
//    }
//
//    public String getAccountUserID() {
//        return getShared(mSharedAccount, KEY_ACCOUNT_USER_ID, "");
//    }
//
//    /**
//     * 用户信息
//     */
//    public void setAccountUserInfo(TCUser user) {
//        String data = mGson.toJson(user);
//        setShared(mSharedAccount, KEY_ACCOUNT_USER_INFO, data);
//    }
//
//    public TCUser getAccountUserInfo() {
//        String data = getShared(mSharedAccount, KEY_ACCOUNT_USER_INFO, "");
//        if (!TextUtils.isEmpty(data)) {
//            return mGson.fromJson(data, TCUser.class);
//        }
//        return null;
//    }
//
//    /**
//     * UUID
//     */
//    public void setAccountUUID(String uuid) {
//        setShared(mSharedAccount, KEY_ACCOUNT_UUID, uuid);
//    }
//
//    public String getAccountUUID() {
//        return getShared(mSharedAccount, KEY_ACCOUNT_UUID, "");
//    }
//
//    /**
//     * 清除账户信息
//     */
//    public void clearAccount() {
//        removeShared(mSharedAccount);
//    }
//
//    // **************** mSharedCache ****************
//
//    /**
//     * 搜索关键字历史记录
//     */
//    public void setCacheSearchHistory(List<String> list) {
//        String data = mGson.toJson(list);
//        setShared(mSharedCache, KEY_CACHE_SEARCH_HISTORY, data);
//    }
//
//    public List<String> getCacheSearchHistory() {
//        String data = getShared(mSharedCache, KEY_CACHE_SEARCH_HISTORY, "");
//        if (!TextUtils.isEmpty(data)) {
//            Type type = new TypeToken<ArrayList<String>>() {
//            }.getType();
//            return mGson.fromJson(data, type);
//        }
//        return null;
//    }
//
//    /**
//     * 缓存用户列表
//     */
//    public void setCacheUserList(List<TCUser> list) {
//        String data = mGson.toJson(list);
//        setShared(mSharedCache, KEY_CACHE_USER_LIST, data);
//    }
//
//    public List<TCUser> getCacheUserList() {
//        String data = getShared(mSharedCache, KEY_CACHE_USER_LIST, "");
//        if (!TextUtils.isEmpty(data)) {
//            Type type = new TypeToken<ArrayList<TCUser>>() {
//            }.getType();
//            return mGson.fromJson(data, type);
//        }
//        return null;
//    }
//
//    /**
//     * 清除缓存信息
//     */
//    public void clearCache() {
//        removeShared(mSharedCache);
//    }
//
//    // **************** mSharedCommon ****************
//
//    /**
//     * CommonTest
//     */
//    public void setCommonTest(String value) {
//        setShared(mSharedCommon, KEY_COMMON_TEST, value);
//    }
//
//    public String getCommonTest() {
//        return getShared(mSharedCommon, KEY_COMMON_TEST, "");
//    }
//
//    /**
//     * Common
//     */
//    public void setCommon(String key, String value) {
//        setShared(mSharedCommon, key, value);
//    }
//
//    public String getCommon(String key) {
//        return getShared(mSharedCommon, key, "");
//    }
//
//    /**
//     * 清除信息
//     */
//    public void clearCommon() {
//        removeShared(mSharedCommon);
//    }
//}

redpajama_set_name: RedPajamaGithub


text:
package org.devdom.influencer.model.dto;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Carlos Vasquez Polanco
 */
@Entity
@Table(name = "education_institution")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EducationInstitution.findAll", query = "SELECT e FROM EducationInstitution e"),
    @NamedQuery(name = "EducationInstitution.findById", query = "SELECT e FROM EducationInstitution e WHERE e.id = :id"),
    @NamedQuery(name = "EducationInstitution.findByAbout", query = "SELECT e FROM EducationInstitution e WHERE e.about = :about"),
    @NamedQuery(name = "EducationInstitution.findByCategory", query = "SELECT e FROM EducationInstitution e WHERE e.category = :category"),
    @NamedQuery(name = "EducationInstitution.findByLocationCity", query = "SELECT e FROM EducationInstitution e WHERE e.locationCity = :locationCity"),
    @NamedQuery(name = "EducationInstitution.findByLocationCountry", query = "SELECT e FROM EducationInstitution e WHERE e.locationCountry = :locationCountry"),
    @NamedQuery(name = "EducationInstitution.findByLocationStreet", query = "SELECT e FROM EducationInstitution e WHERE e.locationStreet = :locationStreet"),
    @NamedQuery(name = "EducationInstitution.findByWebsite", query = "SELECT e FROM EducationInstitution e WHERE e.website = :website"),
    @NamedQuery(name = "EducationInstitution.findByName", query = "SELECT e FROM EducationInstitution e WHERE e.name = :name"),
    @NamedQuery(name = "EducationInstitution.findByLatitude", query = "SELECT e FROM EducationInstitution e WHERE e.latitude = :latitude"),
    @NamedQuery(name = "EducationInstitution.findByLongitude", query = "SELECT e FROM EducationInstitution e WHERE e.longitude = :longitude")})
public class EducationInstitution implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 250)
    @Column(name = "id")
    private String id;
    @Size(max = 5000)
    @Column(name = "about")
    private String about;
    @Size(max = 120)
    @Column(name = "category")
    private String category;
    @Size(max = 300)
    @Column(name = "location_city")
    private String locationCity;
    @Size(max = 300)
    @Column(name = "location_country")
    private String locationCountry;
    @Size(max = 300)
    @Column(name = "location_street")
    private String locationStreet;
    @Size(max = 120)
    @Column(name = "website")
    private String website;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 300)
    @Column(name = "name")
    private String name;
    @Size(max = 100)
    @Column(name = "latitude")
    private String latitude;
    @Size(max = 100)
    @Column(name = "longitude")
    private String longitude;

    public EducationInstitution() {
    }

    public EducationInstitution(String id) {
        this.id = id;
    }

    public EducationInstitution(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAbout() {
        return about;
    }

    public void setAbout(String about) {
        this.about = about;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getLocationCity() {
        return locationCity;
    }

    public void setLocationCity(String locationCity) {
        this.locationCity = locationCity;
    }

    public String getLocationCountry() {
        return locationCountry;
    }

    public void setLocationCountry(String locationCountry) {
        this.locationCountry = locationCountry;
    }

    public String getLocationStreet() {
        return locationStreet;
    }

    public void setLocationStreet(String locationStreet) {
        this.locationStreet = locationStreet;
    }

    public String getWebsite() {
        return website;
    }

    public void setWebsite(String website) {
        this.website = website;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof EducationInstitution)) {
            return false;
        }
        EducationInstitution other = (EducationInstitution) object;
        return (this.id != null || other.id == null) && (this.id == null || this.id.equals(other.id));
    }

    @Override
    public String toString() {
        return "EducationInstitution{" + "id=" + id + ", about=" + about + ", category=" + category + ", locationCity=" + locationCity + ", locationCountry=" + locationCountry + ", locationStreet=" + locationStreet + ", website=" + website + ", name=" + name + ", latitude=" + latitude + ", longitude=" + longitude + '}';
    }

}


text:
require 'spree_core'
require 'spree_postal_code_restriction/engine'


text:
import React from 'react'
import EventRegistration from '../../containers/EventRegistration'
import withLayout from '../../components/Layout'

const NewEventPage = () => <EventRegistration />

export default withLayout(NewEventPage)


text:
using System;
using System.Collections.Generic;
using SharpKit.JavaScript;
namespace Y_
{
    ///
    /// The class allows you to create a Drag & Drop reordered list.
    ///
    public partial class Sortable : Y_.Base
    {
        [JsMethod(JsonInitializers=true)]
        public Sortable(){}
        ///
        /// Test a Node or a selector for the container
        ///
        public void _test(Node node, object test){}
        ///
        /// A custom callback to allow a user to extract some sort of id or any other data from the node to use in the "ordering list" and then that data should be returned from the callback.
        ///
        public Y_.Array getOrdering(object Function){return null;}
        ///
        /// Get a Sortable instance back from a node reference or a selector string.
        ///
        public void getSortable(object node){}
        ///
        /// Join this Sortable with another Sortable instance.
        ///

        ///
full: Exchange nodes with both lists.

        ///
inner: Items can go into this list from the joined list.

        ///
outer: Items can go out of the joined list into this list.

        ///
none: Removes the join.

        ///

        ///
        public void join(object Sortable, object String){}
        ///
        /// Passthrough to the DD.Delegate.ddplug method
        ///
        public void plug(object Class, object Object){}
        ///
        /// Register a Sortable instance with the singleton to allow lookups later.
        ///
        public void reg(object Sortable){}
        ///
        /// Passthrough to the DD.Delegate syncTargets method.
        ///
        public void sync(){}
        ///
        /// Unregister a Sortable instance with the singleton.
        ///
        public void unreg(object Sortable){}
        ///
        /// A reference to the DD.Delegate instance.
        ///
        public Y_.DD_.Delegate @delegate{get;set;}
        ///
        /// Drag handles to pass on to the internal DD.Delegate instance.
        ///
        public Y_.Array handles{get;set;}
    }
}


text:
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

import React from 'react';

import classNames from 'classnames';
import warning from 'warning';
import withStyles from '../styles/withStyles';

export const styles = theme => {
  const shadows = {};

  theme.shadows.forEach((shadow, index) => {
    shadows[`shadow${index}`] = {
      boxShadow: shadow
    };
  });

  return _extends({
    root: {
      backgroundColor: theme.palette.background.paper
    },
    rounded: {
      borderRadius: 2
    }
  }, shadows);
};

class Paper extends React.Component {

  render() {
    const _props = this.props,
          {
      classes,
      className: classNameProp,
      component: ComponentProp,
      square,
      elevation
    } = _props,
          other = _objectWithoutProperties(_props, ['classes', 'className', 'component', 'square', 'elevation']);

    warning(elevation >= 0 && elevation < 25, `Material-UI: this elevation \`${elevation}\` is not implemented.`);

    const className = classNames(classes.root, classes[`shadow${elevation >= 0 ? elevation : 0}`], {
      [classes.rounded]: !square
    }, classNameProp);

    return React.createElement(ComponentProp, _extends({ className: className }, other));
  }
}

Paper.defaultProps = {
  component: 'div',
  elevation: 2,
  square: false
};
export default withStyles(styles, { name: 'MuiPaper' })(Paper);


text:
//
//  TextView.h
//  CoreTextExtensions
//
//  Created by Oliver Drobnik on 1/9/11.
//  Copyright 2011 Drobnik.com. All rights reserved.
//

#import <CoreText/CoreText.h>

@class DTAttributedTextContentView;
@class DTCoreTextLayoutFrame;
@class DTTextBlock;
@class DTCoreTextLayouter;
@class DTTextAttachment;

/**
 Protocol to provide custom views for elements in an DTAttributedTextContentView. Also the delegate gets notified once the text view has been drawn.
 */
@protocol DTAttributedTextContentViewDelegate <NSObject>

@optional

/**
 @name Notifications
 */

/**
 Called after a layout frame or a part of it is drawn.

 @param attributedTextContentView The content view that drew a layout frame
 @param layoutFrame The layout frame that was drawn for
 @param context The graphics context that was drawn into
 */
- (void)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView didDrawLayoutFrame:(DTCoreTextLayoutFrame *)layoutFrame inContext:(CGContextRef)context;

/**
 Called before the text belonging to a text block is drawn.

 This gives the developer an opportunity to draw a custom background below a text block.

 @param attributedTextContentView The content view that drew a layout frame
 @param textBlock The text block
 @param rect The frame within the content view's coordinate system that will be drawn into
 @param context The graphics context that will be drawn into
 @param layoutFrame The layout frame that will be drawn for
 @param returns `YES` is the standard fill of the text block should be drawn, `NO` if it should not
 */
- (BOOL)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView shouldDrawBackgroundForTextBlock:(DTTextBlock *)textBlock frame:(CGRect)frame context:(CGContextRef)context forLayoutFrame:(DTCoreTextLayoutFrame *)layoutFrame;

/**
 @name Providing Custom Views for Content
 */

/**
 Provide custom view for an attachment, e.g. an imageView for images

 @param attributedTextContentView The content view asking for a custom view
 @param attachment The <DTTextAttachment> that this view should represent
 @param frame The frame that the view should use to fit on top of the space reserved for the attachment
 @returns The view that should represent the given attachment
 */
- (UIView *)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView viewForAttachment:(DTTextAttachment *)attachment frame:(CGRect)frame;

/**
 Provide button to be placed over links, the identifier is used to link multiple parts of the same A tag

 @param attributedTextContentView The content view asking for a custom view
 @param url The `NSURL` of the hyperlink
 @param identifier An identifier that uniquely identifies the hyperlink within the document
 @param frame The frame that the view should use to fit on top of the space reserved for the attachment
 @returns The view that should represent the given hyperlink
 */
- (UIView *)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView viewForLink:(NSURL *)url identifier:(NSString *)identifier frame:(CGRect)frame;

/**
 Provide generic views for all attachments.

 This is only called if the more specific delegate methods are not implemented.

 @param attributedTextContentView The content view asking for a custom view
 @param string The attributed sub-string containing this element
 @param frame The frame that the view should use to fit on top of the space reserved for the attachment
 @returns The view that should represent the given hyperlink or text attachment
 @see attributedTextContentView:viewForAttachment:frame: and attributedTextContentView:viewForAttachment:frame:
 */
- (UIView *)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView viewForAttributedString:(NSAttributedString *)string frame:(CGRect)frame;

@end

@interface DTAttributedTextContentView : UIView
{
	NSAttributedString *_attributedString;
	DTCoreTextLayoutFrame *_layoutFrame;

	UIEdgeInsets edgeInsets;

	NSMutableDictionary *customViewsForAttachmentsIndex;
}

- (id)initWithAttributedString:(NSAttributedString *)attributedString width:(CGFloat)width;

- (void)layoutSubviewsInRect:(CGRect)rect;
- (void)relayoutText;
- (void)removeAllCustomViews;
- (void)removeAllCustomViewsForLinks;

- (CGSize)attributedStringSizeThatFits:(CGFloat)width;
- (CGSize)suggestedFrameSizeToFitEntireStringConstraintedToWidth:(CGFloat)width; // obeys the edge insets

// properties are overwritten with locking to avoid problem with async drawing
@property (atomic, strong) DTCoreTextLayouter *layouter;
@property (atomic, strong) DTCoreTextLayoutFrame *layoutFrame;

@property (nonatomic, strong) NSMutableSet *customViews;

@property (nonatomic, copy) NSAttributedString *attributedString;
@property (nonatomic) UIEdgeInsets edgeInsets;
@property (nonatomic) BOOL drawDebugFrames;
@property (nonatomic) BOOL shouldDrawImages;
@property (nonatomic) BOOL shouldDrawLinks;
@property (nonatomic) BOOL shouldLayoutCustomSubviews;
@property (nonatomic) CGPoint layoutOffset;
@property (nonatomic) CGSize backgroundOffset;

@property (nonatomic, assign) IBOutlet id <DTAttributedTextContentViewDelegate> delegate;	// subtle simulator bug - use assign not __unsafe_unretained

@property (nonatomic, assign) dispatch_semaphore_t selfLock;

@end

@interface DTAttributedTextContentView (Tiling)

+ (void)setLayerClass:(Class)layerClass;
+ (Class)layerClass;

@end


text:
@import Foundation;
@import Darwin.POSIX.pwd;

#import "DDKeychain.h"

@import Dynamo;

int main( int argc, char *argv[] ) {
    unsigned short serverPort = 8080;
    NSString *documentRoot = [NSHomeDirectory() stringByAppendingPathComponent:@"Sites"];
    const char *runAs = NULL;
    NSString *keyChainName;

    switch ( argc ) {
    default:
        runAs = argv[4];
    case 4:
        keyChainName = [[NSString alloc] initWithUTF8String:argv[3]];
    case 3:
        documentRoot = [[NSString alloc] initWithUTF8String:argv[2]];
    case 2:
        serverPort = atoi( argv[1] );
    case 1:
        break;
    }

    NSMutableArray *swiftlets = [NSMutableArray new];
    [swiftlets addObject:[[LoggingSwiftlet alloc] initWithLogger:^( NSString *request) {
        NSLog( @"%@", request );
    }]];
    [swiftlets addObject:[[ServerPagesSwiftlet alloc] initWithDocumentRoot:documentRoot]];
    [swiftlets addObject:[[DocumentSwiftlet alloc] initWithDocumentRoot:documentRoot report404:TRUE]];

    if ( keyChainName ) {
        NSArray *certs = [DDKeychain SSLIdentityAndCertificates:keyChainName];
        (void)[[DynamoSSLWebServer alloc] initWithPortNumber:serverPort swiftlets:swiftlets certs:certs surrogate:nil];
    }
    else {
        [swiftlets insertObject:[[SSLProxySwiftlet alloc] initWithLogger:nil] atIndex:1];
        [swiftlets insertObject:[[ProxySwiftlet alloc] initWithLogger:nil] atIndex:2];
        (void)[[DynamoWebServer alloc] initWithPortNumber:serverPort swiftlets:swiftlets localhostOnly:NO];
    }

    if ( runAs ) {
        struct passwd *pwd = getpwnam( runAs );
        if ( pwd )
            setuid( pwd->pw_uid );
        else {
            NSLog( @"Could not locate username %s for setuid()", runAs );
            exit(1);
        }
    }

    [[NSRunLoop mainRunLoop] run];
}


text:
Changelog
=========

3.1
---

  * Show, eq, ord: hygienically invoke functions from referenced modules
    (such as X.pp for X.t when deriving show) to coexist with modules
    shadowing ones from standard library.
  * Iter, map, fold: hygienically invoke List and Array functions.

3.0
---

  * Implement hygiene: Ppx_deriving.{create_quoter,quote,sanitize,with_quoter}.
  * Show, eq, ord: add support for `lazy_t`.
  * Add support for `[@nobuiltin]` attribute.
  * Add Ppx_deriving.hash_variant.
  * Remove allow_std_type_shadowing option.
  * Remove Ppx_deriving.extract_typename_of_type_group.

2.1
---

  * Fix breakage occurring with 4.02.2 w.r.t record labels
  * Fix prefixed attribute names (`[@deriving.foo.attr]` and `[@foo.attr]`).
  * Add allow_std_type_shadowing option for eq and show.

2.0
---

  * Add support for open types.

1.1
---

  * New plugin: create.
  * Show, eq, ord: handle `_`.
  * Show, eq, ord, map, iter, fold: handle inheriting from a parametric
    polymorphic variant type.
  * Make `Ppx_deriving.poly_{fun,arrow}_of_type_decl` construct functions
    in correct order. This also fixes all derivers with types with
    more than one parameter.
  * Add `Ppx_deriving.fold_{left,right}_type_decl`.

1.0
---

  * Make deriver names lowercase.
  * Remove Findlib+dynlink integration. All derivers must now be
    explicitly required.
  * Allow shortening [%derive.x:] to [%x:] when deriver x exists.
  * Make `Ppx_deriving.core_type` field optional to allow ignoring
    unsupported [%x:] shorthands.
  * Add support for [@@deriving foo { optional = true }] that does
    not error out if foo is missing, useful for optional dependencies.
  * Rename ~name and ~prefix of `Ppx_deriving.attr` and
    `Ppx_deriving.Arg.payload` to `~deriver`.
  * Renamed `Ppx_deriving.Arg.payload` to `get_attr`.
  * Add `Ppx_deriving.Arg.get_expr` and `get_flag`.

0.3
---

  * Show, Eq, Ord, Iter, Fold: handle ref.
  * Show: handle functions.
  * Show: include break hints in format strings.
  * Show: pull fprintf into local environment.
  * Show: add `[@polyprinter]` and `[@opaque]`.
  * Add `Ppx_deriving.Arg.expr`.

0.2
---

  * New plugins: Enum, Iter, Map, Fold.
  * All plugins: don't concatenate affix if type is named `t`.
  * Add `[%derive.Foo:]` shorthand.
  * Show, Eq, Ord: add support for list, array, option.
  * Show: include full module path in output, including for types with manifest.
  * A lot of changes in `Ppx_deriving interface`.

0.1
---

  * Initial release.


text:
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {BrowserModule} from '@angular/platform-browser';
import {RouterModule, Routes} from '@angular/router';
import {DialogEditor} from './../components/core/dialog_editor';
import {DialogPreview} from './../components/preview/dialog_preview';
import {DialogPreviewModule} from './../components/preview/module';
import {GraphCoreModule} from './../components/core/module';
import {GraphService} from './../services/graph/graph_service';
import {PersistenceService} from './../services/persistence/persistence_service_interface';
import {SemanticMatchService} from './../services/inference/interfaces';
import {SemanticInferenceService} from './../services/inference/semantic_inference_service';
import {BaseSerializationService, SerializationService} from './../services/persistence/graph_serialization';

// App Specific imports.
import {FirebasePersistenceService} from './../services/persistence/firebase/firebase_persistence_service';
import {TFJSSemanticMatchService} from './../services/inference/tfjs_universal_encoder/tfjs_semantic_match_service';
import {DefaultProjectInspectorModule} from './../components/inspector/project_inspector/default_project_inspector/module';

import {MainApp} from './app';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { environment } from '../environments/environment';

const routes: Routes = [
  {path: '', pathMatch: 'full', component: DialogEditor},
  {path: 'edit/:graphId', component: DialogEditor},
  {path: 'preview/:graphId/:nodeId', component: DialogPreview},
  {path: 'preview/:graphId', component: DialogPreview},
];

@NgModule({
  declarations: [
    MainApp,
  ],
  imports: [
    BrowserModule,
    CommonModule,
    FormsModule,
    RouterModule.forRoot(routes),
    GraphCoreModule,
    DefaultProjectInspectorModule,
    BrowserAnimationsModule,
    DialogPreviewModule,
  ],
  exports: [],
  providers: [
    GraphService,
    {provide: SerializationService, useClass: BaseSerializationService},
    {provide: PersistenceService, useClass: FirebasePersistenceService},
    {provide: SemanticMatchService, useClass: TFJSSemanticMatchService},
    SemanticInferenceService,
  ],
  bootstrap: [MainApp],
})
export class AppModule {
}


text:
import { Directive, ElementRef, Input, Output, EventEmitter } from '@angular/core';
import { Observable, Subject, Subscription } from 'rxjs';

@Directive({
  selector: '[popUp]'
})
export class PopUpDirective {

  @Output() popComplete: EventEmitter<boolean> = new EventEmitter();

  public refElement: HTMLElement;

  constructor(private el: ElementRef) {
    this.refElement = <HTMLElement>this.el.nativeElement;
  }

}


text:
package org.apache.hadoop.hdfs;

import java.io.IOException;
import java.net.URI;
import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.crypto.key.KeyProvider;
import org.apache.hadoop.crypto.key.KeyProviderFactory;
import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
import org.junit.Assert;
import org.junit.Test;

public class TestKeyProviderCache {

  public static class DummyKeyProvider extends KeyProvider {

    public static int CLOSE_CALL_COUNT = 0;

    public DummyKeyProvider(Configuration conf) {
      super(conf);
    }

    @Override
    public KeyVersion getKeyVersion(String versionName) throws IOException {
      return null;
    }

    @Override
    public List<String> getKeys() throws IOException {
      return null;
    }

    @Override
    public List<KeyVersion> getKeyVersions(String name) throws IOException {
      return null;
    }

    @Override
    public Metadata getMetadata(String name) throws IOException {
      return null;
    }

    @Override
    public KeyVersion createKey(String name, byte[] material, Options options)
        throws IOException {
      return null;
    }

    @Override
    public void deleteKey(String name) throws IOException {
    }

    @Override
    public KeyVersion rollNewVersion(String name, byte[] material)
        throws IOException {
      return null;
    }

    @Override
    public void flush() throws IOException {
    }

    @Override
    public void close() {
      CLOSE_CALL_COUNT += 1;
    }
  }

  public static class Factory extends KeyProviderFactory {

    @Override
    public KeyProvider createProvider(URI providerName, Configuration conf)
        throws IOException {
      if ("dummy".equals(providerName.getScheme())) {
        return new DummyKeyProvider(conf);
      }
      return null;
    }
  }

  @Test
  public void testCache() throws Exception {
    KeyProviderCache kpCache = new KeyProviderCache(10000);
    Configuration conf = new Configuration();
    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
        "dummy://foo:bar@test_provider1");
    KeyProvider keyProvider1 = kpCache.get(conf,
        getKeyProviderUriFromConf(conf));
    Assert.assertNotNull("Returned Key Provider is null !!", keyProvider1);

    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
        "dummy://foo:bar@test_provider1");
    KeyProvider keyProvider2 = kpCache.get(conf,
        getKeyProviderUriFromConf(conf));

    Assert.assertTrue("Different KeyProviders returned !!",
        keyProvider1 == keyProvider2);

    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
        "dummy://test_provider3");
    KeyProvider keyProvider3 = kpCache.get(conf,
        getKeyProviderUriFromConf(conf));

    Assert.assertFalse("Same KeyProviders returned !!",
        keyProvider1 == keyProvider3);

    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
        "dummy://hello:there@test_provider1");
    KeyProvider keyProvider4 = kpCache.get(conf,
        getKeyProviderUriFromConf(conf));

    Assert.assertFalse("Same KeyProviders returned !!",
        keyProvider1 == keyProvider4);

    kpCache.invalidateCache();
    Assert.assertEquals("Expected number of closing calls doesn't match",
        3, DummyKeyProvider.CLOSE_CALL_COUNT);
  }

  private URI getKeyProviderUriFromConf(Configuration conf) {
    String providerUriStr = conf.get(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH);
    if (providerUriStr == null || providerUriStr.isEmpty()) {
      return null;
    }
    return URI.create(providerUriStr);
  }
}


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

<title>R.dimen</title>
<meta name="date" content="2017-12-04">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

h4bit.h4bit

Class R.dimen

java.lang.Object

h4bit.h4bit.R.dimen

Enclosing class:

R

public static final class R.dimen
extends java.lang.Object

Field Summary

Fields

Modifier and Type
Field and Description

static int
abc_action_bar_content_inset_material

static int
abc_action_bar_content_inset_with_nav

static int
abc_action_bar_default_height_material

static int
abc_action_bar_default_padding_end_material

static int
abc_action_bar_default_padding_start_material

static int
abc_action_bar_elevation_material

static int
abc_action_bar_icon_vertical_padding_material

static int
abc_action_bar_overflow_padding_end_material

static int
abc_action_bar_overflow_padding_start_material

static int
abc_action_bar_progress_bar_size

static int
abc_action_bar_stacked_max_height

static int
abc_action_bar_stacked_tab_max_width

static int
abc_action_bar_subtitle_bottom_margin_material

static int
abc_action_bar_subtitle_top_margin_material

static int
abc_action_button_min_height_material

static int
abc_action_button_min_width_material

static int
abc_action_button_min_width_overflow_material

static int
abc_alert_dialog_button_bar_height

static int
abc_button_inset_horizontal_material

static int
abc_button_inset_vertical_material

static int
abc_button_padding_horizontal_material

static int
abc_button_padding_vertical_material

static int
abc_cascading_menus_min_smallest_width

static int
abc_config_prefDialogWidth

static int
abc_control_corner_material

static int
abc_control_inset_material

static int
abc_control_padding_material

static int
abc_dialog_fixed_height_major

static int
abc_dialog_fixed_height_minor

static int
abc_dialog_fixed_width_major

static int
abc_dialog_fixed_width_minor

static int
abc_dialog_list_padding_bottom_no_buttons

static int
abc_dialog_list_padding_top_no_title

static int
abc_dialog_min_width_major

static int
abc_dialog_min_width_minor

static int
abc_dialog_padding_material

static int
abc_dialog_padding_top_material

static int
abc_dialog_title_divider_material

static int
abc_disabled_alpha_material_dark

static int
abc_disabled_alpha_material_light

static int
abc_dropdownitem_icon_width

static int
abc_dropdownitem_text_padding_left

static int
abc_dropdownitem_text_padding_right

static int
abc_edit_text_inset_bottom_material

static int
abc_edit_text_inset_horizontal_material

static int
abc_edit_text_inset_top_material

static int
abc_floating_window_z

static int
abc_list_item_padding_horizontal_material

static int
abc_panel_menu_list_width

static int
abc_progress_bar_height_material

static int
abc_search_view_preferred_height

static int
abc_search_view_preferred_width

static int
abc_seekbar_track_background_height_material

static int
abc_seekbar_track_progress_height_material

static int
abc_select_dialog_padding_start_material

static int
abc_switch_padding

static int
abc_text_size_body_1_material

static int
abc_text_size_body_2_material

static int
abc_text_size_button_material

static int
abc_text_size_caption_material

static int
abc_text_size_display_1_material

static int
abc_text_size_display_2_material

static int
abc_text_size_display_3_material

static int
abc_text_size_display_4_material

static int
abc_text_size_headline_material

static int
abc_text_size_large_material

static int
abc_text_size_medium_material

static int
abc_text_size_menu_header_material

static int
abc_text_size_menu_material

static int
abc_text_size_small_material

static int
abc_text_size_subhead_material

static int
abc_text_size_subtitle_material_toolbar

static int
abc_text_size_title_material

static int
abc_text_size_title_material_toolbar

static int
cast_expanded_controller_ad_background_layout_height

static int
cast_expanded_controller_ad_background_layout_width

static int
cast_expanded_controller_ad_layout_height

static int
cast_expanded_controller_ad_layout_width

static int
cast_expanded_controller_control_button_margin

static int
cast_expanded_controller_control_toolbar_min_height

static int
cast_expanded_controller_margin_between_seek_bar_and_control_buttons

static int
cast_expanded_controller_margin_between_status_text_and_seek_bar

static int
cast_expanded_controller_seekbar_disabled_alpha

static int
cast_intro_overlay_button_margin_bottom

static int
cast_intro_overlay_focus_radius

static int
cast_intro_overlay_title_margin_top

static int
cast_libraries_material_featurehighlight_center_horizontal_offset

static int
cast_libraries_material_featurehighlight_center_threshold

static int
cast_libraries_material_featurehighlight_inner_margin

static int
cast_libraries_material_featurehighlight_inner_radius

static int
cast_libraries_material_featurehighlight_outer_padding

static int
cast_libraries_material_featurehighlight_text_body_size

static int
cast_libraries_material_featurehighlight_text_header_size

static int
cast_libraries_material_featurehighlight_text_horizontal_margin

static int
cast_libraries_material_featurehighlight_text_horizontal_offset

static int
cast_libraries_material_featurehighlight_text_max_width

static int
cast_libraries_material_featurehighlight_text_vertical_space

static int
cast_mini_controller_control_button_margin

static int
cast_mini_controller_icon_height

static int
cast_mini_controller_icon_width

static int
cast_notification_image_size

static int
cast_tracks_chooser_dialog_no_message_text_size

static int
cast_tracks_chooser_dialog_row_text_size

static int
disabled_alpha_material_dark

static int
disabled_alpha_material_light

static int
highlight_alpha_material_colored

static int
highlight_alpha_material_dark

static int
highlight_alpha_material_light

static int
hint_alpha_material_dark

static int
hint_alpha_material_light

static int
hint_pressed_alpha_material_dark

static int
hint_pressed_alpha_material_light

static int
mr_controller_volume_group_list_item_height

static int
mr_controller_volume_group_list_item_icon_size

static int
mr_controller_volume_group_list_max_height

static int
mr_controller_volume_group_list_padding_top

static int
mr_dialog_fixed_width_major

static int
mr_dialog_fixed_width_minor

static int
notification_action_icon_size

static int
notification_action_text_size

static int
notification_big_circle_margin

static int
notification_content_margin_start

static int
notification_large_icon_height

static int
notification_large_icon_width

static int
notification_main_column_padding_top

static int
notification_media_narrow_margin

static int
notification_right_icon_size

static int
notification_right_side_padding_top

static int
notification_small_icon_background_padding

static int
notification_small_icon_size_as_large

static int
notification_subtext_size

static int
notification_top_pad

static int
notification_top_pad_large_text

static int
place_autocomplete_button_padding

static int
place_autocomplete_powered_by_google_height

static int
place_autocomplete_powered_by_google_start

static int
place_autocomplete_prediction_height

static int
place_autocomplete_prediction_horizontal_margin

static int
place_autocomplete_prediction_primary_text

static int
place_autocomplete_prediction_secondary_text

static int
place_autocomplete_progress_horizontal_margin

static int
place_autocomplete_progress_size

static int
place_autocomplete_separator_start

Constructor Summary

Constructors

Constructor and Description

dimen()

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

abc_action_bar_content_inset_material

public static final int abc_action_bar_content_inset_material

See Also:

Constant Field Values

abc_action_bar_content_inset_with_nav

public static final int abc_action_bar_content_inset_with_nav

See Also:

Constant Field Values

abc_action_bar_default_height_material

public static final int abc_action_bar_default_height_material

See Also:

Constant Field Values

abc_action_bar_default_padding_end_material

public static final int abc_action_bar_default_padding_end_material

See Also:

Constant Field Values

abc_action_bar_default_padding_start_material

public static final int abc_action_bar_default_padding_start_material

See Also:

Constant Field Values

abc_action_bar_elevation_material

public static final int abc_action_bar_elevation_material

See Also:

Constant Field Values

abc_action_bar_icon_vertical_padding_material

public static final int abc_action_bar_icon_vertical_padding_material

See Also:

Constant Field Values

abc_action_bar_overflow_padding_end_material

public static final int abc_action_bar_overflow_padding_end_material

See Also:

Constant Field Values

abc_action_bar_overflow_padding_start_material

public static final int abc_action_bar_overflow_padding_start_material

See Also:

Constant Field Values

abc_action_bar_progress_bar_size

public static final int abc_action_bar_progress_bar_size

See Also:

Constant Field Values

abc_action_bar_stacked_max_height

public static final int abc_action_bar_stacked_max_height

See Also:

Constant Field Values

abc_action_bar_stacked_tab_max_width

public static final int abc_action_bar_stacked_tab_max_width

See Also:

Constant Field Values

abc_action_bar_subtitle_bottom_margin_material

public static final int abc_action_bar_subtitle_bottom_margin_material

See Also:

Constant Field Values

abc_action_bar_subtitle_top_margin_material

public static final int abc_action_bar_subtitle_top_margin_material

See Also:

Constant Field Values

abc_action_button_min_height_material

public static final int abc_action_button_min_height_material

See Also:

Constant Field Values

abc_action_button_min_width_material

public static final int abc_action_button_min_width_material

See Also:

Constant Field Values

abc_action_button_min_width_overflow_material

public static final int abc_action_button_min_width_overflow_material

See Also:

Constant Field Values

abc_alert_dialog_button_bar_height

public static final int abc_alert_dialog_button_bar_height

See Also:

Constant Field Values

abc_button_inset_horizontal_material

public static final int abc_button_inset_horizontal_material

See Also:

Constant Field Values

abc_button_inset_vertical_material

public static final int abc_button_inset_vertical_material

See Also:

Constant Field Values

abc_button_padding_horizontal_material

public static final int abc_button_padding_horizontal_material

See Also:

Constant Field Values

abc_button_padding_vertical_material

public static final int abc_button_padding_vertical_material

See Also:

Constant Field Values

abc_cascading_menus_min_smallest_width

public static final int abc_cascading_menus_min_smallest_width

See Also:

Constant Field Values

abc_config_prefDialogWidth

public static final int abc_config_prefDialogWidth

See Also:

Constant Field Values

abc_control_corner_material

public static final int abc_control_corner_material

See Also:

Constant Field Values

abc_control_inset_material

public static final int abc_control_inset_material

See Also:

Constant Field Values

abc_control_padding_material

public static final int abc_control_padding_material

See Also:

Constant Field Values

abc_dialog_fixed_height_major

public static final int abc_dialog_fixed_height_major

See Also:

Constant Field Values

abc_dialog_fixed_height_minor

public static final int abc_dialog_fixed_height_minor

See Also:

Constant Field Values

abc_dialog_fixed_width_major

public static final int abc_dialog_fixed_width_major

See Also:

Constant Field Values

abc_dialog_fixed_width_minor

public static final int abc_dialog_fixed_width_minor

See Also:

Constant Field Values

abc_dialog_list_padding_bottom_no_buttons

public static final int abc_dialog_list_padding_bottom_no_buttons

See Also:

Constant Field Values

abc_dialog_list_padding_top_no_title

public static final int abc_dialog_list_padding_top_no_title

See Also:

Constant Field Values

abc_dialog_min_width_major

public static final int abc_dialog_min_width_major

See Also:

Constant Field Values

abc_dialog_min_width_minor

public static final int abc_dialog_min_width_minor

See Also:

Constant Field Values

abc_dialog_padding_material

public static final int abc_dialog_padding_material

See Also:

Constant Field Values

abc_dialog_padding_top_material

public static final int abc_dialog_padding_top_material

See Also:

Constant Field Values

abc_dialog_title_divider_material

public static final int abc_dialog_title_divider_material

See Also:

Constant Field Values

abc_disabled_alpha_material_dark

public static final int abc_disabled_alpha_material_dark

See Also:

Constant Field Values

abc_disabled_alpha_material_light

public static final int abc_disabled_alpha_material_light

See Also:

Constant Field Values

abc_dropdownitem_icon_width

public static final int abc_dropdownitem_icon_width

See Also:

Constant Field Values

abc_dropdownitem_text_padding_left

public static final int abc_dropdownitem_text_padding_left

See Also:

Constant Field Values

abc_dropdownitem_text_padding_right

public static final int abc_dropdownitem_text_padding_right

See Also:

Constant Field Values

abc_edit_text_inset_bottom_material

public static final int abc_edit_text_inset_bottom_material

See Also:

Constant Field Values

abc_edit_text_inset_horizontal_material

public static final int abc_edit_text_inset_horizontal_material

See Also:

Constant Field Values

abc_edit_text_inset_top_material

public static final int abc_edit_text_inset_top_material

See Also:

Constant Field Values

abc_floating_window_z

public static final int abc_floating_window_z

See Also:

Constant Field Values

abc_list_item_padding_horizontal_material

public static final int abc_list_item_padding_horizontal_material

See Also:

Constant Field Values

abc_panel_menu_list_width

public static final int abc_panel_menu_list_width

See Also:

Constant Field Values

abc_progress_bar_height_material

public static final int abc_progress_bar_height_material

See Also:

Constant Field Values

abc_search_view_preferred_height

public static final int abc_search_view_preferred_height

See Also:

Constant Field Values

abc_search_view_preferred_width

public static final int abc_search_view_preferred_width

See Also:

Constant Field Values

abc_seekbar_track_background_height_material

public static final int abc_seekbar_track_background_height_material

See Also:

Constant Field Values

abc_seekbar_track_progress_height_material

public static final int abc_seekbar_track_progress_height_material

See Also:

Constant Field Values

abc_select_dialog_padding_start_material

public static final int abc_select_dialog_padding_start_material

See Also:

Constant Field Values

abc_switch_padding

public static final int abc_switch_padding

See Also:

Constant Field Values

abc_text_size_body_1_material

public static final int abc_text_size_body_1_material

See Also:

Constant Field Values

abc_text_size_body_2_material

public static final int abc_text_size_body_2_material

See Also:

Constant Field Values

abc_text_size_button_material

public static final int abc_text_size_button_material

See Also:

Constant Field Values

abc_text_size_caption_material

public static final int abc_text_size_caption_material

See Also:

Constant Field Values

abc_text_size_display_1_material

public static final int abc_text_size_display_1_material

See Also:

Constant Field Values

abc_text_size_display_2_material

public static final int abc_text_size_display_2_material

See Also:

Constant Field Values

abc_text_size_display_3_material

public static final int abc_text_size_display_3_material

See Also:

Constant Field Values

abc_text_size_display_4_material

public static final int abc_text_size_display_4_material

See Also:

Constant Field Values

abc_text_size_headline_material

public static final int abc_text_size_headline_material

See Also:

Constant Field Values

abc_text_size_large_material

public static final int abc_text_size_large_material

See Also:

Constant Field Values

abc_text_size_medium_material

public static final int abc_text_size_medium_material

See Also:

Constant Field Values

abc_text_size_menu_header_material

public static final int abc_text_size_menu_header_material

See Also:

Constant Field Values

abc_text_size_menu_material

public static final int abc_text_size_menu_material

See Also:

Constant Field Values

abc_text_size_small_material

public static final int abc_text_size_small_material

See Also:

Constant Field Values

abc_text_size_subhead_material

public static final int abc_text_size_subhead_material

See Also:

Constant Field Values

abc_text_size_subtitle_material_toolbar

public static final int abc_text_size_subtitle_material_toolbar

See Also:

Constant Field Values

abc_text_size_title_material

public static final int abc_text_size_title_material

See Also:

Constant Field Values

abc_text_size_title_material_toolbar

public static final int abc_text_size_title_material_toolbar

See Also:

Constant Field Values

cast_expanded_controller_ad_background_layout_height

public static final int cast_expanded_controller_ad_background_layout_height

See Also:

Constant Field Values

cast_expanded_controller_ad_background_layout_width

public static final int cast_expanded_controller_ad_background_layout_width

See Also:

Constant Field Values

cast_expanded_controller_ad_layout_height

public static final int cast_expanded_controller_ad_layout_height

See Also:

Constant Field Values

cast_expanded_controller_ad_layout_width

public static final int cast_expanded_controller_ad_layout_width

See Also:

Constant Field Values

cast_expanded_controller_control_button_margin

public static final int cast_expanded_controller_control_button_margin

See Also:

Constant Field Values

cast_expanded_controller_control_toolbar_min_height

public static final int cast_expanded_controller_control_toolbar_min_height

See Also:

Constant Field Values

cast_expanded_controller_margin_between_seek_bar_and_control_buttons

public static final int cast_expanded_controller_margin_between_seek_bar_and_control_buttons

See Also:

Constant Field Values

cast_expanded_controller_margin_between_status_text_and_seek_bar

public static final int cast_expanded_controller_margin_between_status_text_and_seek_bar

See Also:

Constant Field Values

cast_expanded_controller_seekbar_disabled_alpha

public static final int cast_expanded_controller_seekbar_disabled_alpha

See Also:

Constant Field Values

cast_intro_overlay_button_margin_bottom

public static final int cast_intro_overlay_button_margin_bottom

See Also:

Constant Field Values

cast_intro_overlay_focus_radius

public static final int cast_intro_overlay_focus_radius

See Also:

Constant Field Values

cast_intro_overlay_title_margin_top

public static final int cast_intro_overlay_title_margin_top

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_center_horizontal_offset

public static final int cast_libraries_material_featurehighlight_center_horizontal_offset

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_center_threshold

public static final int cast_libraries_material_featurehighlight_center_threshold

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_inner_margin

public static final int cast_libraries_material_featurehighlight_inner_margin

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_inner_radius

public static final int cast_libraries_material_featurehighlight_inner_radius

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_outer_padding

public static final int cast_libraries_material_featurehighlight_outer_padding

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_text_body_size

public static final int cast_libraries_material_featurehighlight_text_body_size

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_text_header_size

public static final int cast_libraries_material_featurehighlight_text_header_size

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_text_horizontal_margin

public static final int cast_libraries_material_featurehighlight_text_horizontal_margin

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_text_horizontal_offset

public static final int cast_libraries_material_featurehighlight_text_horizontal_offset

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_text_max_width

public static final int cast_libraries_material_featurehighlight_text_max_width

See Also:

Constant Field Values

cast_libraries_material_featurehighlight_text_vertical_space

public static final int cast_libraries_material_featurehighlight_text_vertical_space

See Also:

Constant Field Values

cast_mini_controller_control_button_margin

public static final int cast_mini_controller_control_button_margin

See Also:

Constant Field Values

cast_mini_controller_icon_height

public static final int cast_mini_controller_icon_height

See Also:

Constant Field Values

cast_mini_controller_icon_width

public static final int cast_mini_controller_icon_width

See Also:

Constant Field Values

cast_notification_image_size

public static final int cast_notification_image_size

See Also:

Constant Field Values

cast_tracks_chooser_dialog_no_message_text_size

public static final int cast_tracks_chooser_dialog_no_message_text_size

See Also:

Constant Field Values

cast_tracks_chooser_dialog_row_text_size

public static final int cast_tracks_chooser_dialog_row_text_size

See Also:

Constant Field Values

disabled_alpha_material_dark

public static final int disabled_alpha_material_dark

See Also:

Constant Field Values

disabled_alpha_material_light

public static final int disabled_alpha_material_light

See Also:

Constant Field Values

highlight_alpha_material_colored

public static final int highlight_alpha_material_colored

See Also:

Constant Field Values

highlight_alpha_material_dark

public static final int highlight_alpha_material_dark

See Also:

Constant Field Values

highlight_alpha_material_light

public static final int highlight_alpha_material_light

See Also:

Constant Field Values

hint_alpha_material_dark

public static final int hint_alpha_material_dark

See Also:

Constant Field Values

hint_alpha_material_light

public static final int hint_alpha_material_light

See Also:

Constant Field Values

hint_pressed_alpha_material_dark

public static final int hint_pressed_alpha_material_dark

See Also:

Constant Field Values

hint_pressed_alpha_material_light

public static final int hint_pressed_alpha_material_light

See Also:

Constant Field Values

mr_controller_volume_group_list_item_height

public static final int mr_controller_volume_group_list_item_height

See Also:

Constant Field Values

mr_controller_volume_group_list_item_icon_size

public static final int mr_controller_volume_group_list_item_icon_size

See Also:

Constant Field Values

mr_controller_volume_group_list_max_height

public static final int mr_controller_volume_group_list_max_height

See Also:

Constant Field Values

mr_controller_volume_group_list_padding_top

public static final int mr_controller_volume_group_list_padding_top

See Also:

Constant Field Values

mr_dialog_fixed_width_major

public static final int mr_dialog_fixed_width_major

See Also:

Constant Field Values

mr_dialog_fixed_width_minor

public static final int mr_dialog_fixed_width_minor

See Also:

Constant Field Values

notification_action_icon_size

public static final int notification_action_icon_size

See Also:

Constant Field Values

notification_action_text_size

public static final int notification_action_text_size

See Also:

Constant Field Values

notification_big_circle_margin

public static final int notification_big_circle_margin

See Also:

Constant Field Values

notification_content_margin_start

public static final int notification_content_margin_start

See Also:

Constant Field Values

notification_large_icon_height

public static final int notification_large_icon_height

See Also:

Constant Field Values

notification_large_icon_width

public static final int notification_large_icon_width

See Also:

Constant Field Values

notification_main_column_padding_top

public static final int notification_main_column_padding_top

See Also:

Constant Field Values

notification_media_narrow_margin

public static final int notification_media_narrow_margin

See Also:

Constant Field Values

notification_right_icon_size

public static final int notification_right_icon_size

See Also:

Constant Field Values

notification_right_side_padding_top

public static final int notification_right_side_padding_top

See Also:

Constant Field Values

notification_small_icon_background_padding

public static final int notification_small_icon_background_padding

See Also:

Constant Field Values

notification_small_icon_size_as_large

public static final int notification_small_icon_size_as_large

See Also:

Constant Field Values

notification_subtext_size

public static final int notification_subtext_size

See Also:

Constant Field Values

notification_top_pad

public static final int notification_top_pad

See Also:

Constant Field Values

notification_top_pad_large_text

public static final int notification_top_pad_large_text

See Also:

Constant Field Values

place_autocomplete_button_padding

public static final int place_autocomplete_button_padding

See Also:

Constant Field Values

place_autocomplete_powered_by_google_height

public static final int place_autocomplete_powered_by_google_height

See Also:

Constant Field Values

place_autocomplete_powered_by_google_start

public static final int place_autocomplete_powered_by_google_start

See Also:

Constant Field Values

place_autocomplete_prediction_height

public static final int place_autocomplete_prediction_height

See Also:

Constant Field Values

place_autocomplete_prediction_horizontal_margin

public static final int place_autocomplete_prediction_horizontal_margin

See Also:

Constant Field Values

place_autocomplete_prediction_primary_text

public static final int place_autocomplete_prediction_primary_text

See Also:

Constant Field Values

place_autocomplete_prediction_secondary_text

public static final int place_autocomplete_prediction_secondary_text

See Also:

Constant Field Values

place_autocomplete_progress_horizontal_margin

public static final int place_autocomplete_progress_horizontal_margin

See Also:

Constant Field Values

place_autocomplete_progress_size

public static final int place_autocomplete_progress_size

See Also:

Constant Field Values

place_autocomplete_separator_start

public static final int place_autocomplete_separator_start

See Also:

Constant Field Values

Constructor Detail

dimen

public dimen()

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
slowly working on this, it is not **complete..**
so far
- [x] brew install and run a `brew bundle` see [Brewfile](Brewfile)
- [x] global packages used for node dev
- [ ] aliases
- [ ] git
- [ ] bash_profile
- [ ] bash_prompt

#### setup
```sh
git clone https://github.com/stewart42/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
sh install.sh
```

#### acknowledgements
used [dotfiles](http://dotfiles.github.io/) heavily for ideas and code snippets, theck them out, they are cool!