text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>mlens.parallel.base — mlens 0.2.3 documentation</title>

    <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato" type="text/css" />

    <link rel="stylesheet" href="../../../_static/css/pygments.css" type="text/css" />

    <link rel="stylesheet" href="../../../_static/css/mlens-theme.css" type="text/css" />

    <link rel="stylesheet" href="../../../_static/css/sphinx-glr.css" type="text/css" />

        <link rel="index" title="Index"
              href="../../../genindex.html"/>
        <link rel="search" title="Search" href="../../../search.html"/>
    <link rel="top" title="mlens 0.2.3 documentation" href="../../../index.html"/>
        <link rel="up" title="Module code" href="../../index.html"/>

                0.2.3

  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

mlens.config

dtype

get_dtype

set_dtype

tmpdir

get_tmpdir

set_tmpdir

backend

get_backend

set_backend

start_method

get_start_method

set_start_method

prefix

get_prefix

set_prefix

ivals

get_ivals

set_ivals

Utility

clear_cache

mlens.ensemble

Base ensemble classes

Sequential

BaseEnsemble

Ready-made ensemble classes

SuperLearner

Subsemble

BlendEnsemble

TemporalEnsemble

Sequential

mlens.estimators

BaseEstimator

LearnerEstimator

TransformerEstimator

LayerEnsemble

mlens.model_selection

BaseEval

Evaluator

Benchmark

benchmark

mlens.index

Indexers

BaseIndex

FoldIndex

BlendIndex

SubsetIndex

ClusteredSubsetIndex

FullIndex

Utilities

prune_train

partition

make_tuple

mlens.parallel

Graph Nodes

Layer

Learner

Transformer

EvalLearner

EvalTransformer

BaseNode

SubLearner

SubTransformer

EvalSubTransformer

IndexedEstimator

Cache

Handles

Group

Pipeline

make_group

Wrappers

EstimatorMixin

run

Backend

BaseProcessor

ParallelProcessing

ParallelEvaluation

Job

dump_array

Base classes

BaseBackend

BaseParallel

BaseEstimator

BaseStacker

Mixins

ParamMixin

IndexMixin

OutputMixin

ProbaMixin

mlens.preprocessing

Subset

Shift

mlens.metrics

Data

assemble_data

assemble_table

make_scorer

rmse

mape

wape

mlens.visualization

corrmat

clustered_corrmap

corr_X_y

pca_plot

pca_comp_plot

exp_var_plot

          mlens

Docs »

Module code »

mlens.parallel.base

Source code for mlens.parallel.base

"""ML-Ensemble

:author: Sebastian Flennerhag
:copyright: 2017-2018
:license: MIT

Base classes for parallel estimation

Schedulers for global setups:
   0:
      Base setups - independent of other features:
         IndexMixin._setup_0_index

   1:
      Global setups - reserved for aggregating classes:
         Layer._setup_1_global

   2:
      Dependents on 0:
         ProbaMixin.__setup_2_multiplier

   3:
      Dependents on 0, 2:
         OutputMixin.__setup_3__output_columns

Note that schedulers are experimental and may change without a deprecation
cycle.
"""
import warnings
from abc import abstractmethod
import numpy as np

from ._base_functions import check_stack, check_params
from .. import config
from ..utils.exceptions import ParallelProcessingError
from ..externals.sklearn.base import clone, BaseEstimator as _BaseEstimator

[docs]class ParamMixin(_BaseEstimator, object):

    """Parameter Mixin

    Mixin for protecting static parameters from changes after fitting.

    .. Note::
       To use this mixin the instance inheriting it must set
       ``__static__=list()`` and ``_static_fit_params_=dict()``
       in ``__init__``.
    """

[docs]    def _store_static_params(self):
        """Record current static params for future comparison."""
        if self.__static__:
            for key, val in self.get_params(deep=False).items():
                if key in self.__static__:
                    self._static_fit_params[key] = clone(val, safe=False)

[docs]    def _check_static_params(self):
        """Check if current static params are identical to previous params"""
        current_static_params = {
            k: v for k, v in self.get_params(deep=False).items()
            if k in self.__static__}
        return check_params(self._static_fit_params, current_static_params)

[docs]class IndexMixin(object):

    """Indexer mixin

    Mixin for handling indexers.

    .. note::
       To use this mixin the instance inheriting it must set the
        ``indexer`` or ``indexers`` attribute in ``__init__`` (not both).
    """

    @property
    def __indexer__(self):
        """Flag for existence of indexer"""
        return hasattr(self, 'indexer') or hasattr(self, 'indexers')

[docs]    def _check_indexer(self, indexer):
        """Check consistent indexer classes"""
        cls = indexer.__class__.__name__.lower()
        if 'index' not in cls:
            ValueError("Passed indexer does not appear to be valid indexer")

        lcls = [idx.__class__.__name__.lower() for idx in self._get_indexers()]
        if lcls:
            if 'blendindex' in lcls and cls != 'blendindex':
                raise ValueError(
                    "Instance has blendindex, but was passed full type")
            elif 'blendindex' not in lcls and cls == 'blendindex':
                raise ValueError(
                    "Instance has full type index, but was passed blendindex")

[docs]    def _get_indexers(self):
        """Return list of indexers"""
        if not self.__indexer__:
            raise AttributeError("No indexer or indexers attribute available")
        indexers = [getattr(self, 'indexer', None)]
        if None in indexers:
            indexers = getattr(self, 'indexers', [None])
        return indexers

    def _setup_0_index(self, X, y, job):
        indexers = self._get_indexers()
        for indexer in indexers:
            indexer.fit(X, y, job)

[docs]class OutputMixin(IndexMixin):

    """Output Mixin

    Mixin class for interfacing with ParallelProcessing when outputs are
    desired.

    .. note::
       To use this mixin the instance inheriting it must set the
       ``feature_span`` attribute and ``__no_output__`` flag in ``__init__``.
    """

[docs]    @abstractmethod
    def set_output_columns(self, X, y, job, n_left_concats=0):
        """Set output columns for prediction array"""
        pass

[docs]    def _setup_3_output_columns(self, X, y, job, n_left_concats=0):
        """Set output columns for prediction array. Used during setup"""
        if not self.__no_output__:
            self.set_output_columns(X, y, job, n_left_concats)

[docs]    def shape(self, job):
        """Prediction array shape"""
        if not hasattr(self, 'feature_span'):
            raise ParallelProcessingError(
                "Instance dose not set the feature_span attribute "
                "in the constructor.")

        if not self.feature_span:
            raise ValueError("Columns not set. Call set_output_columns.")
        return self.size(job), self.feature_span[1]

[docs]    def size(self, attr):
        """Get size of dim 0"""
        if attr not in ['n_test_samples', 'n_samples']:
            attr = 'n_test_samples' if attr != 'predict' else 'n_samples'

        indexers = self._get_indexers()
        sizes = list()
        for indexer in indexers:
            sizes.append(getattr(indexer, attr))

        sizes = np.unique(sizes)
        if not sizes.shape[0] == 1:
            warnings.warn(
                "Inconsistent output sizes generated by indexers "
                "(sizes: %r from indexers %r).\n"
                "outputs will be zero-padded"
                % (sizes.tolist(), indexers))
            return max(sizes)
        return sizes[0]

[docs]class ProbaMixin(object):

    """"Probability Mixin

    Mixin for probability features on objects
    interfacing with :class:`~mlens.parallel.backend.ParallelProcessing`

    .. note::
       To use this mixin the instance inheriting it must set the ``proba``
       and the ``_classes(=None)``attribute in ``__init__``.
    """

    def _setup_2_multiplier(self, X, y, job=None):
        if self.proba and y is not None:
            self.classes_ = y

    def _get_multiplier(self, X, y, alt=1):
        if self.proba:
            multiplier = self.classes_
        else:
            multiplier = alt
        return multiplier

    @property
    def _predict_attr(self):
        return 'predict' if not self.proba else 'predict_proba'

    @property
    def classes_(self):
        """Prediction classes during proba"""
        return self._classes

    @classes_.setter
    def classes_(self, y):
        """Set classes given input y"""
        self._classes = np.unique(y).shape[0]

[docs]class BaseBackend(object):

    """Base class for parallel backend

    Implements default backend settings.
    """

[docs]    def __init__(self, backend=None, n_jobs=-1, dtype=None,
                 raise_on_exception=True):
        self.n_jobs = n_jobs
        self.dtype = dtype if dtype is not None else config.get_dtype()
        self.backend = backend if backend is not None else config.get_backend()
        self.raise_on_exception = raise_on_exception

    @abstractmethod
    def __iter__(self):
        yield

[docs]class BaseParallel(BaseBackend):

    """Base class for parallel objects

    Parameters
    ----------
    name : str
        name of instance. Should be unique.

    backend : str or object (default = 'threading')
        backend infrastructure to use during call to
        :class:`mlens.externals.joblib.Parallel`. See Joblib for further
        documentation. To set global backend,
        see :func:`~mlens.config.set_backend`.

    raise_on_exception : bool (default = True)
        whether to issue warnings on soft exceptions or raise error.
        Examples include lack of layers, bad inputs, and failed fit of an
        estimator in a layer. If set to ``False``, warnings are issued instead
        but estimation continues unless exception is fatal. Note that this
        can result in unexpected behavior unless the exception is anticipated.

    verbose : int or bool (default = False)
        level of verbosity.

    n_jobs : int (default = -1)
        Degree of concurrency in estimation. Set to -1 to maximize,
        1 runs on a single process (or thread).

    dtype : obj (default = np.float32)
        data type to use, must be compatible with a numpy array dtype.
    """

[docs]    def __init__(self, name, *args, **kwargs):
        super(BaseParallel, self).__init__(*args, **kwargs)
        self.name = name
        self.__no_output__ = False

[docs]    @abstractmethod
    def __iter__(self):
        """Iterator for process manager"""
        yield

[docs]    def setup(self, X, y, job, skip=None, **kwargs):
        """Setup instance for estimation"""
        skip = ['_setup_%s' % s for s in skip] if skip else []
        funs = [f for f in dir(self)
                if f.startswith('_setup_') and f not in skip]

        for f in sorted(funs):
            func = getattr(self, f)
            args = func.__func__.__code__.co_varnames
            fargs = {k: v for k, v in kwargs.items() if k in args}
            func(X, y, job, **fargs)

[docs]class BaseEstimator(ParamMixin, _BaseEstimator, BaseParallel):

    """Base Parallel Estimator class

    Modified Scikit-learn class to handle backend params that we want to
    protect from changes.
    """

[docs]    def __init__(self, *args, **kwargs):
        super(BaseEstimator, self).__init__(*args, **kwargs)
        self.__static__ = list()
        self._static_fit_params = dict()

[docs]    def get_params(self, deep=True):
        out = super(BaseEstimator, self).get_params(deep=deep)
        for name in BaseBackend.__init__.__code__.co_varnames:
            if name not in ['self']:
                out[name] = getattr(self, name)
        return out

    @property
    @abstractmethod
    def __fitted__(self):
        """Fit status"""
        return self._check_static_params()

[docs]class BaseStacker(BaseEstimator):
    """Base class for instanes that stack job estimators"""

[docs]    def __init__(self, stack=None, verbose=False, *args, **kwargs):
        super(BaseStacker, self).__init__(*args, **kwargs)
        if stack and not isinstance(stack, list):
            raise ValueError("Stack must be a list. Got %r:" % type(stack))
        self.stack = stack if stack else list()
        self._verbose = verbose

[docs]    @abstractmethod
    def __iter__(self):
        yield

[docs]    def push(self, *stack):
        """Push onto stack"""
        check_stack(stack, self.stack)
        for item in stack:
            self.stack.append(item)
            attr = item.name.replace('-', '_').replace(' ', '').strip()
            setattr(self, attr, item)
        return self

[docs]    def replace(self, idx, item):
        """Replace a current member of the stack with a new instance"""
        attr = item.name.replace('-', '_').replace(' ', '').strip()
        setattr(self, attr, item)
        self.stack[idx] = item

[docs]    def pop(self, idx):
        """Pop a previous push with index idx"""
        return self.stack.pop(idx)

[docs]    def get_params(self, deep=True):
        """Get parameters for this estimator.

        Parameters
        ----------
        deep : boolean, optional
            whether to return nested parameters.
        """
        out = super(BaseStacker, self).get_params(deep=deep)
        if not deep:
            return out

        for item in self.stack:
            out[item.name] = item
            for key, val in item.get_params(deep=True).items():
                out['%s__%s' % (item.name, key)] = val
        return out

    @property
    def __fitted__(self):
        """Fitted status"""
        if not self.stack or not self._check_static_params():
            return False
        return all([g.__fitted__ for g in self.stack])

    @property
    def __stack__(self):
        """Check stack"""
        if not isinstance(self.stack, list):
            raise ValueError(
                "Stack corrupted. Extected list. Got %r" % type(self.stack))
        return len(self.stack) > 0

    @property
    def verbose(self):
        """Verbosity"""
        return self._verbose

    @verbose.setter
    def verbose(self, verbose):
        """Set verbosity"""
        self._verbose = verbose
        for g in self.stack:
            g.verbose = verbose

        © Copyright 2017, Sebastian Flennerhag.

  Built with Sphinx using a theme provided by Read the Docs.


text:
title: Google sheets - HLOOKUP encryption etc
layout: post
author: william.howells
permalink: /google-sheets---hlookup-encryption-etc/
source-id: 1R53iKcNMW5GK1buekQ7oVnAxoVOMCCYFvykEXNDEVg4
published: true
---

    Title
    Encryption
    Date
    18/09/17

    Starting point:
    Simple code in sheets.google.com

    Target for this lesson
    To be able to do some more complicated things on sheets.google.com program

    Did I reach my target?
(add details to "Lesson Review")
     Yes

    Lesson Review

    How did I learn? What strategies were effective?

    I worked out that to make my code work properly I would have to include punctuation, so I made the numbers punctuation on the second row of the keyboard.  This meant that I could type out exactly what I wanted to (HI! I AM BARRY SCOTT!), including punctuation and spaces.

    What limited my learning? Which habits do I need to work on?

    I could work out how to create the punctuation above the numbers, and so the numbers as well, but the punctuation on either side of the space bar is harder to work out, as things are used much less (e.g. <>#~| ).  Because of this, including these would probably make it more obvious to find out those encrypted words.

    What will I change for next time? How will I improve my learning?

    I was rather slow during this lesson, so I did not succeed in completing decryption so could not proceed onwards after.  I need to be slightly faster in lessons to come, so that I do not fall behind, as falling behind will cause me difficulties in lessons to come.

redpajama_set_name: RedPajamaGithub


text:
use std::io::Reader;
use std::io::Writer;
use std::str::{from_utf8, from_utf8_owned};
use std::io::net::ip::SocketAddr;
use std::collections::Map;
use std::collections::HashMap;
use std::io::net::tcp::TcpStream;

use std::io::net::ip::{IpAddr};
use std::io::net::tcp::{TcpAcceptor, TcpListener};

use time;
use enums::*;

pub struct Server {
	addr: String,
	port: u16,
	acceptor: TcpAcceptor,
	clients : HashMap< Box<String>, TcpStream>
}

impl Server {

}


text:
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;

using Microsoft.CodeAnalysis;

namespace Microsoft.PSharp.LanguageServices.Parsing.Framework
{
    /// <summary>
    /// An abstract P# visitor.
    /// </summary>
    internal abstract class BaseVisitor
    {
        /// <summary>
        /// The P# project.
        /// </summary>
        protected PSharpProject Project;

        /// <summary>
        /// The error log.
        /// </summary>
        protected List<Tuple<SyntaxToken, string>> ErrorLog;

        /// <summary>
        /// The warning log.
        /// </summary>
        protected List<Tuple<SyntaxToken, string>> WarningLog;

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseVisitor"/> class.
        /// </summary>
        protected BaseVisitor(PSharpProject project, List<Tuple<SyntaxToken, string>> errorLog,
            List<Tuple<SyntaxToken, string>> warningLog)
        {
            this.Project = project;
            this.ErrorLog = errorLog;
            this.WarningLog = warningLog;
        }
    }
}


text:
#include "mitkContourModelSetReader.h"
#include "mitkContourModelReader.h"
#include <mitkCustomMimeType.h>
#include <iostream>
#include <fstream>
#include <locale>

mitk::ContourModelSetReader::ContourModelSetReader(const mitk::ContourModelSetReader& other)
  : mitk::AbstractFileReader(other)
{
}

mitk::ContourModelSetReader::ContourModelSetReader()
  : AbstractFileReader()
{
  std::string category = "ContourModelSet File";
  CustomMimeType customMimeType;
  customMimeType.SetCategory(category);
  customMimeType.AddExtension("cnt_set");

  this->SetDescription(category);
  this->SetMimeType(customMimeType);

  m_ServiceReg = this->RegisterService();
}

mitk::ContourModelSetReader::~ContourModelSetReader()
{
}

std::vector<itk::SmartPointer<mitk::BaseData> > mitk::ContourModelSetReader::Read()
{
  std::vector<itk::SmartPointer<mitk::BaseData> > result;
  std::vector<itk::SmartPointer<mitk::BaseData> > internalResult;

  std::string location = GetInputLocation();

  std::locale::global(std::locale("C"));

  try{
    mitk::ContourModelSet::Pointer contourSet = mitk::ContourModelSet::New();

    mitk::ContourModelReader reader;
    reader.SetInput(location);
    internalResult = reader.Read();

    for(unsigned int i = 0; i < internalResult.size(); ++i)
    {
      contourSet->AddContourModel( dynamic_cast<mitk::ContourModel*>(internalResult.at(i).GetPointer()) );
    }
    result.push_back(dynamic_cast<mitk::BaseData*>(contourSet.GetPointer()));

  }catch(...)
  {
    MITK_ERROR  << "Cannot read contourModel.";
  }

  return result;
}

mitk::ContourModelSetReader* mitk::ContourModelSetReader::Clone() const
{
  return new ContourModelSetReader(*this);
}


text:
if ("undefined" == typeof (ConnectionsToolbar)) {
    var ConnectionsToolbar = {};
};

ConnectionsToolbar.menuUtils = {
    createMenuItem : function(aLabel, aComponent, type, favicon, url, downloadUrl) {
        const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        // create a new XUL menuitem
        var item = document.createElementNS(XUL_NS, "menuitem");

        item.setAttribute("label", aLabel);
        item.addEventListener("command", function(event){
        	ConnectionsToolbar.browserOverlay.gotoURL(url,event);
        	return false;
        });
        item.addEventListener("click", function(event){
        	if (event.button == 1){
        		ConnectionsToolbar.browserOverlay.gotoURL(url,event,"tab");
        	}
        	return false;
        });
        item.setAttribute("context", "menulistContext");
        item.setAttribute("tooltiptext", aLabel+"\n"+url);
        item.setAttribute("url", url);
        if (aComponent != null) {
            item.setAttribute("class", "menuitem-iconic");
            if (aComponent != "files") {
                if (favicon != null) {
                    item.setAttribute("image", favicon);
                } else {
                    item.className += " connections-" + aComponent
                            + "-list-item";
                }
            } else {
                var iconClass = " "
                        + ConnectionsToolbar.fileIcons.getClassForFile(aLabel);
                item.className += iconClass;
                if (type === ConnectionsToolbar.constants.DATA_TYPE.CONTENT) {
                    item.setAttribute("downloadUrl", downloadUrl);
                }
            }
        }
        return item;
    },

    clearMenu : function(node) {
        var menuOptions = node.childNodes;
        for ( var i = menuOptions.length - 1; i >= 0; i--) {
            var currentChild = menuOptions[i];
            if (currentChild.getAttribute("type") != "placeholder") {
                node.removeChild(currentChild);
            } else {
                currentChild.setAttribute("style", "display: none");
            }
        }
    },

    clearAllMenus : function() {
        ConnectionsToolbar.logger.info("Clearing all the menus");
        for (name in ConnectionsToolbar.constants.COMPONENTS) {
            var component = ConnectionsToolbar.constants.COMPONENTS[name];

            for (value in ConnectionsToolbar.constants.DATA_TYPE) {
                var type = ConnectionsToolbar.constants.DATA_TYPE[value];

                ConnectionsToolbar.menuUtils.clearPopup(type + "-" + component + "-popup");
            }
        }
    },

    clearPopup : function(popupID) {
        popup = document.getElementById(popupID);
        if (typeof (popup) != "undefined" && popup != null) {
            ConnectionsToolbar.menuUtils.clearMenu(popup);
        }
    },

    hidePlaceholder : function(node) {
        var menuOptions = node.childNodes;
        for ( var i = 0; i < menuOptions.length; i++) {
            var currentChild = menuOptions[i];
            if (currentChild.getAttribute("type") == "placeholder") {
                currentChild.setAttribute("style", "display: none");
            }
        }
    },

    showPlaceholder : function(node, type, component) {
        ConnectionsToolbar.logger.info("Showing the placeholder for: "
                + component);
        const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        // create a new XUL menuitem
        var item = document.createElementNS(XUL_NS, "menuitem");
        item.setAttribute("type", "placeholdeer");
        ConnectionsToolbar.logger.info("type: " + type);
        if(type == ConnectionsToolbar.constants.DATA_TYPE.RECOMMENDATIONS) {
            item.setAttribute("label", ConnectionsToolbar.NLS.get("connections.recommendations.norecommendations"));
        } else if(type == ConnectionsToolbar.constants.DATA_TYPE.CONTENT) {
            item.setAttribute("label", ConnectionsToolbar.NLS.get("connections." + component + ".nocontent"));
        } else if(type == ConnectionsToolbar.constants.DATA_TYPE.FOLLOWING) {
            item.setAttribute("label", ConnectionsToolbar.NLS.get("connections.following.nofollowing"));
        }
        node.appendChild(item);
    }
};


text:
package org.apache.hadoop.hdfs;

import static org.apache.hadoop.fs.CommonConfigurationKeys.FS_CLIENT_TOPOLOGY_RESOLUTION_ENABLED;
import static org.apache.hadoop.fs.CommonConfigurationKeys.FS_CLIENT_TOPOLOGY_RESOLUTION_ENABLED_DEFAULT;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys;
import org.apache.hadoop.hdfs.client.impl.DfsClientConf;
import org.apache.hadoop.hdfs.client.impl.DfsClientConf.ShortCircuitConf;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.shortcircuit.DomainSocketFactory;
import org.apache.hadoop.hdfs.shortcircuit.ShortCircuitCache;
import org.apache.hadoop.hdfs.util.ByteArrayManager;
import org.apache.hadoop.net.DNSToSwitchMapping;
import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.net.NetworkTopology;
import org.apache.hadoop.net.NodeBase;
import org.apache.hadoop.net.ScriptBasedMapping;
import org.apache.hadoop.util.ReflectionUtils;

import org.apache.hadoop.classification.VisibleForTesting;
import org.apache.hadoop.util.Preconditions;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * ClientContext contains context information for a client.
 *
 * This allows us to share caches such as the socket cache across
 * DFSClient instances.
 */
@InterfaceAudience.Private
public class ClientContext {
  private static final Logger LOG = LoggerFactory.getLogger(
      ClientContext.class);

  /**
   * Global map of context names to caches contexts.
   */
  private final static HashMap<String, ClientContext> CACHES = new HashMap<>();

  /**
   * Name of context.
   */
  private final String name;

  /**
   * The client conf used to initialize context.
   */
  private final DfsClientConf dfsClientConf;

  /**
   * String representation of the configuration.
   */
  private final String confString;

  /**
   * Caches short-circuit file descriptors, mmap regions.
   */
  private final ShortCircuitCache[] shortCircuitCache;

  /**
   * Caches TCP and UNIX domain sockets for reuse.
   */
  private final PeerCache peerCache;

  /**
   * Stores information about socket paths.
   */
  private final DomainSocketFactory domainSocketFactory;

  /**
   * Caches key Providers for the DFSClient
   */
  private final KeyProviderCache keyProviderCache;
  /**
   * True if we should use the legacy BlockReaderLocal.
   */
  private final boolean useLegacyBlockReaderLocal;

  /**
   * True if the legacy BlockReaderLocal is disabled.
   *
   * The legacy block reader local gets disabled completely whenever there is an
   * error or miscommunication.  The new block reader local code handles this
   * case more gracefully inside DomainSocketFactory.
   */
  private volatile boolean disableLegacyBlockReaderLocal = false;

  /** Creating byte[] for {@link DFSOutputStream}. */
  private final ByteArrayManager byteArrayManager;

  /**
   * Whether or not we complained about a DFSClient fetching a CacheContext that
   * didn't match its config values yet.
   */
  private boolean printedConfWarning = false;

  private NodeBase clientNode;
  private boolean topologyResolutionEnabled;

  /**
   * The switch to DeadNodeDetector.
   */
  private boolean deadNodeDetectionEnabled = false;

  /**
   * Detect the dead datanodes in advance, and share this information among all
   * the DFSInputStreams in the same client.
   */
  private volatile DeadNodeDetector deadNodeDetector = null;

  /**
   * The switch for the {@link LocatedBlocksRefresher}.
   */
  private final boolean locatedBlocksRefresherEnabled;

  /**
   * Periodically refresh the {@link org.apache.hadoop.hdfs.protocol.LocatedBlocks} backing
   * registered {@link DFSInputStream}s, to take advantage of changes in block placement.
   */
  private volatile LocatedBlocksRefresher locatedBlocksRefresher = null;

  /**
   * Count the reference of ClientContext.
   */
  private int counter = 0;

  /**
   * ShortCircuitCache array size.
   */
  private final int clientShortCircuitNum;
  private Configuration configuration;

  private ClientContext(String name, DfsClientConf conf,
      Configuration config) {
    final ShortCircuitConf scConf = conf.getShortCircuitConf();

    this.name = name;
    this.dfsClientConf = conf;
    this.confString = scConf.confAsString();
    this.clientShortCircuitNum = conf.getClientShortCircuitNum();
    this.shortCircuitCache = new ShortCircuitCache[this.clientShortCircuitNum];
    for (int i = 0; i < this.clientShortCircuitNum; i++) {
      this.shortCircuitCache[i] = ShortCircuitCache.fromConf(scConf);
    }

    this.configuration = config;
    this.peerCache = new PeerCache(scConf.getSocketCacheCapacity(),
        scConf.getSocketCacheExpiry());
    this.keyProviderCache = new KeyProviderCache(
        scConf.getKeyProviderCacheExpiryMs());
    this.useLegacyBlockReaderLocal = scConf.isUseLegacyBlockReaderLocal();
    this.domainSocketFactory = new DomainSocketFactory(scConf);

    this.byteArrayManager = ByteArrayManager.newInstance(
        conf.getWriteByteArrayManagerConf());
    this.deadNodeDetectionEnabled = conf.isDeadNodeDetectionEnabled();
    this.locatedBlocksRefresherEnabled = conf.isLocatedBlocksRefresherEnabled();
    initTopologyResolution(config);
  }

  private void initTopologyResolution(Configuration config) {
    topologyResolutionEnabled = config.getBoolean(
        FS_CLIENT_TOPOLOGY_RESOLUTION_ENABLED,
        FS_CLIENT_TOPOLOGY_RESOLUTION_ENABLED_DEFAULT);
    if (!topologyResolutionEnabled) {
      return;
    }
    DNSToSwitchMapping dnsToSwitchMapping = ReflectionUtils.newInstance(
        config.getClass(
            CommonConfigurationKeys.NET_TOPOLOGY_NODE_SWITCH_MAPPING_IMPL_KEY,
            ScriptBasedMapping.class, DNSToSwitchMapping.class), config);
    String clientHostName = NetUtils.getLocalHostname();
    List<String> nodes = new ArrayList<>();
    nodes.add(clientHostName);
    List<String> resolvedHosts = dnsToSwitchMapping.resolve(nodes);
    if (resolvedHosts != null && !resolvedHosts.isEmpty() &&
        !resolvedHosts.get(0).equals(NetworkTopology.DEFAULT_RACK)) {
      // The client machine is able to resolve its own network location.
      this.clientNode = new NodeBase(clientHostName, resolvedHosts.get(0));
    }
  }

  public static ClientContext get(String name, DfsClientConf conf,
      Configuration config) {
    ClientContext context;
    synchronized(ClientContext.class) {
      context = CACHES.get(name);
      if (context == null) {
        context = new ClientContext(name, conf, config);
        CACHES.put(name, context);
      } else {
        context.printConfWarningIfNeeded(conf);
      }
    }
    context.reference();
    return context;
  }

  public static ClientContext get(String name, Configuration config) {
    return get(name, new DfsClientConf(config), config);
  }

  /**
   * Get a client context, from a Configuration object.
   *
   * This method is less efficient than the version which takes a DFSClient#Conf
   * object, and should be mostly used by tests.
   */
  @VisibleForTesting
  public static ClientContext getFromConf(Configuration conf) {
    return get(conf.get(HdfsClientConfigKeys.DFS_CLIENT_CONTEXT,
        HdfsClientConfigKeys.DFS_CLIENT_CONTEXT_DEFAULT), conf);
  }

  private void printConfWarningIfNeeded(DfsClientConf conf) {
    String existing = this.getConfString();
    String requested = conf.getShortCircuitConf().confAsString();
    if (!existing.equals(requested)) {
      if (!printedConfWarning) {
        printedConfWarning = true;
        LOG.warn("Existing client context '" + name + "' does not match " +
            "requested configuration.  Existing: " + existing +
            ", Requested: " + requested);
      }
    }
  }

  public String getConfString() {
    return confString;
  }

  public ShortCircuitCache getShortCircuitCache() {
    return shortCircuitCache[0];
  }

  public ShortCircuitCache getShortCircuitCache(long idx) {
    return shortCircuitCache[(int) (idx % clientShortCircuitNum)];
  }

  public PeerCache getPeerCache() {
    return peerCache;
  }

  public KeyProviderCache getKeyProviderCache() {
    return keyProviderCache;
  }

  public boolean getUseLegacyBlockReaderLocal() {
    return useLegacyBlockReaderLocal;
  }

  public boolean getDisableLegacyBlockReaderLocal() {
    return disableLegacyBlockReaderLocal;
  }

  public void setDisableLegacyBlockReaderLocal() {
    disableLegacyBlockReaderLocal = true;
  }

  public DomainSocketFactory getDomainSocketFactory() {
    return domainSocketFactory;
  }

  public ByteArrayManager getByteArrayManager() {
    return byteArrayManager;
  }

  public int getNetworkDistance(DatanodeInfo datanodeInfo) throws IOException {
    // If applications disable the feature or the client machine can't
    // resolve its network location, clientNode will be set to null.
    if (clientNode == null) {
      return DFSUtilClient.isLocalAddress(NetUtils.
          createSocketAddr(datanodeInfo.getXferAddr())) ? 0 :
          Integer.MAX_VALUE;
    }
    NodeBase node = new NodeBase(datanodeInfo.getHostName(),
        datanodeInfo.getNetworkLocation());
    return NetworkTopology.getDistanceByPath(clientNode, node);
  }

  /**
   * The switch to DeadNodeDetector. If true, DeadNodeDetector is available.
   */
  public boolean isDeadNodeDetectionEnabled() {
    return deadNodeDetectionEnabled;
  }

  /**
   * Obtain DeadNodeDetector of the current client.
   */
  public DeadNodeDetector getDeadNodeDetector() {
    return deadNodeDetector;
  }

  /**
   * If true, LocatedBlocksRefresher will be periodically refreshing LocatedBlocks
   * of registered DFSInputStreams.
   */
  public boolean isLocatedBlocksRefresherEnabled() {
    return locatedBlocksRefresherEnabled;
  }

  /**
   * Obtain LocatedBlocksRefresher of the current client.
   */
  public LocatedBlocksRefresher getLocatedBlocksRefresher() {
    return locatedBlocksRefresher;
  }

  /**
   * Increment the counter. Start the dead node detector thread if there is no
   * reference.
   */
  synchronized void reference() {
    counter++;
    if (deadNodeDetectionEnabled && deadNodeDetector == null) {
      deadNodeDetector = new DeadNodeDetector(name, configuration);
      deadNodeDetector.start();
    }
    if (locatedBlocksRefresherEnabled && locatedBlocksRefresher == null) {
      locatedBlocksRefresher = new LocatedBlocksRefresher(name, configuration, dfsClientConf);
      locatedBlocksRefresher.start();
    }
  }

  /**
   * Decrement the counter. Close the dead node detector thread if there is no
   * reference.
   */
  synchronized void unreference() {
    Preconditions.checkState(counter > 0);
    counter--;
    if (counter == 0 && deadNodeDetectionEnabled && deadNodeDetector != null) {
      deadNodeDetector.shutdown();
      deadNodeDetector = null;
    }

    if (counter == 0 && locatedBlocksRefresherEnabled && locatedBlocksRefresher != null) {
      locatedBlocksRefresher.shutdown();
      locatedBlocksRefresher = null;
    }
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XOMNI.SDK.Model.Catalog
{
    public class DynamicNavigation
    {
        public List<DynamicAttribute> DynamicAttributes { get; set; }
    }

}


text:
package ai.clipper.rpc;

import java.util.Map;
import ai.clipper.container.util.ClipperEnum;
import ai.clipper.container.util.EnumUtil;

enum HeartbeatType implements ClipperEnum {
  KeepAlive(0),
  RequestContainerMetadata(1);

  private static final String enumName = "heartbeat message type";
  private final int code;

  HeartbeatType(int code) {
    this.code = code;
  }

  @Override
  public int getCode() {
    return code;
  }

  private static final Map<Integer, HeartbeatType> typeResolutionMap =
      EnumUtil.getTypeResolutionMap(HeartbeatType.values());

  public static HeartbeatType fromCode(int code) throws IllegalArgumentException {
    return EnumUtil.getEnumFromCodeOrThrow(code, enumName, typeResolutionMap);
  }
}


text:
package org.optaplanner.examples.vehiclerouting.domain.solver.nearby;

import org.optaplanner.core.impl.heuristic.selector.common.nearby.NearbyDistanceMeter;
import org.optaplanner.examples.vehiclerouting.domain.Customer;
import org.optaplanner.examples.vehiclerouting.domain.Standstill;
import org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedCustomer;

public class CustomerNearbyDistanceMeter implements NearbyDistanceMeter<Customer, Standstill> {

    @Override
    public double getNearbyDistance(Customer origin, Standstill destination) {
        int distance = origin.getDistanceTo(destination);
        // If arriving early also inflicts a cost (more than just not using the vehicle more), such as the driver's wage, use this:
//        if (origin instanceof TimeWindowedCustomer && destination instanceof TimeWindowedCustomer) {
//            distance += ((TimeWindowedCustomer) origin).getTimeWindowGapTo((TimeWindowedCustomer) destination);
//        }
        return distance;
    }

}


text:
@class WJTableViewCell;
@class WJTableViewSection;
typedef NSInteger(^NumForRow)(NSInteger section);
typedef NSInteger(^NumForSection)();
typedef WJTableViewCell *(^CellForRow)(UITableView* tableView, NSIndexPath *indexPath);
typedef CGFloat (^CellForRowHeight)(UITableView* tableView, NSIndexPath *indexPath);
typedef void(^SelectCellForRow)(UITableView* tableView, WJTableViewSection *section, id data, NSIndexPath *indexPath);

@interface WJTableViewController : UITableViewController

#pragma mark 模块化设置
@property (copy, nonatomic)NSArray *sections;
//@property (copy, nonatomic)CellForRow row;//继承WJTableViewCell

#pragma mark 自定义化
@property (copy, nonatomic) CellForRow cellForRow;//继承WJTableViewCell
@property (copy, nonatomic) NumForRow numForRow;//必填
@property (copy, nonatomic) NumForSection numForSection;//可选 默认为1
@property (copy, nonatomic) CellForRowHeight cellForRowHeight;//可选 默认为44

@property (copy, nonatomic) SelectCellForRow selectCellForRow;//通用
@end


text:
package org.cdlib.xtf.textEngine;

import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.Vector;
import org.apache.lucene.bigram.BigramQueryRewriter;
import org.apache.lucene.chunk.SpanChunkedNotQuery;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.spans.SpanNearQuery;
import org.apache.lucene.search.spans.SpanOrQuery;
import org.apache.lucene.search.spans.SpanQuery;
import org.apache.lucene.search.spans.SpanTermQuery;
import org.cdlib.xtf.textEngine.SpanExactQuery;
import org.cdlib.xtf.util.Tester;
import org.cdlib.xtf.util.Trace;

/**
 * Rewrites a query to eliminate stop words by combining them with
 * adjacent non-stop-words, forming "bi-grams". This is a fairly in-depth
 * process, as bi-gramming across NEAR and OR queries is complex.
 */
public class XtfBigramQueryRewriter extends BigramQueryRewriter
{
  private Set tokenizedFields;

  /**
   * Constructs a rewriter using the given stopword set.
   *
   * @param stopSet   Set of stopwords to remove or bi-gram. This can be
   *                  constructed easily by calling
   *                  {@link #makeStopSet(String)}.
   * @param maxSlop   Maximum slop to allow in a query, based on the index
   *                  being queried.
   * @param tokFields List of fields that are tokenized. We won't rewrite
   *                  queries for non-tokenized fields.
   */
  public XtfBigramQueryRewriter(Set stopSet, int maxSlop, Set tokFields) {
    super(stopSet, maxSlop);
    tokenizedFields = tokFields;
  } // constructor

  /**
   * Rewrite a query of any supported type. Stop words will either be
   * removed or bi-grammed. Skips all queries for un-tokenized fields.
   *
   * @param q   Query to rewrite
   * @return    A new query, or 'q' unchanged if no change was needed.
   */
  public Query rewriteQuery(Query q)
  {
    // Skip all queries for non-tokenized fields
    if (q instanceof SpanQuery &&
        !tokenizedFields.contains(((SpanQuery)q).getField()))
      return q;

    // Handle our special XTF queries.
    if (q instanceof SpanSectionTypeQuery)
      return rewrite((SpanSectionTypeQuery)q);
    else if (q instanceof SpanExactQuery)
      return rewrite((SpanExactQuery)q);
    else if (q instanceof MoreLikeThisQuery)
      return rewrite((MoreLikeThisQuery)q);
    else if (q instanceof NumericRangeQuery)
      return rewrite((NumericRangeQuery)q);

    // Punt to normal handling.
    return super.rewriteQuery(q);
  }

  /**
   * Rewrite a section type query. If's very simple: simply rewrite the
   * sub-queries.
   *
   * @param stq  The query to rewrite
   * @return     Rewritten version, or 'nq' unchanged if no changed needed.
   */
  protected Query rewrite(SpanSectionTypeQuery stq)
  {
    // Rewrite the sub-queries
    SpanQuery textQuery = (SpanQuery)rewriteQuery(stq.getTextQuery());
    SpanQuery secTypeQuery = (SpanQuery)rewriteQuery(stq.getSectionTypeQuery());

    // If the sub-queries didn't change, then neither does the main query.
    if (textQuery == stq.getTextQuery() &&
        secTypeQuery == stq.getSectionTypeQuery())
      return stq;

    // Make a new query
    Query newq = new SpanSectionTypeQuery(textQuery, secTypeQuery);
    copyBoost(stq, newq);
    return newq;
  } // rewrite()

  /**
   * Rewrite a span EXACT query. Stop words will be bi-grammed into adjacent
   * terms.
   *
   * @param q  The query to rewrite
   * @return   Rewritten version, or 'q' unchanged if no changed needed.
   */
  protected Query rewrite(SpanExactQuery q)
  {
    // Rewrite each clause. Allow single clauses to be promoted, and
    // do perform bi-gramming.
    //
    return rewriteClauses(q,
      q.getClauses(),
      true,
      true,
      0,
      new SpanClauseJoiner()
      {
        public SpanQuery join(SpanQuery[] clauses) {
          return new SpanExactQuery(clauses);
        }
      });
  } // rewrite()

  /** Rewrite a "more like this" query */
  protected Query rewrite(MoreLikeThisQuery mlt) {
    Query rewrittenSub = rewriteQuery(mlt.getSubQuery());
    if (rewrittenSub == mlt.getSubQuery() && !forceRewrite(mlt))
      return mlt;
    return copyBoost(mlt, new MoreLikeThisQuery(rewrittenSub));
  }

  /** Rewrite a numeric range query */
  protected Query rewrite(NumericRangeQuery nrq) {
    if (!forceRewrite(nrq))
      return nrq;
    return (NumericRangeQuery)nrq.clone();
  }

  /**
   * Basic regression test
   */
  public static final Tester tester = new Tester("XtfBigramStopFilter")
  {
    private Set stopSet = new HashSet();

    private String queryToText(Query q)
    {
      StringBuffer buf = new StringBuffer();

      if (q.getBoost() != 1.0f) {
        float boost = q.getBoost();
        q.setBoost(1.0f);
        buf.append(queryToText(q));
        q.setBoost(boost);
        buf.append("^" + (int)boost);
        return buf.toString();
      }

      if (q instanceof SpanTermQuery)
        return ((SpanTermQuery)q).getTerm().text();

      if (q instanceof TermQuery)
        return ((TermQuery)q).getTerm().text();

      if (q instanceof SpanNearQuery)
      {
        SpanQuery[] clauses = ((SpanNearQuery)q).getClauses();
        int slop = ((SpanNearQuery)q).getSlop();

        buf.append("\"");
        for (int i = 0; i < clauses.length; i++) {
          if (buf.length() > 1)
            buf.append(" ");
          buf.append(queryToText(clauses[i]));
        }
        buf.append("\"");
        if (slop != 0)
          buf.append("~" + slop);
        return buf.toString();
      }

      if (q instanceof SpanOrQuery)
      {
        SpanQuery[] clauses = ((SpanOrQuery)q).getClauses();

        buf.append("(");
        for (int i = 0; i < clauses.length; i++) {
          if (buf.length() > 1)
            buf.append(" OR ");
          buf.append(queryToText(clauses[i]));
        }
        buf.append(")");
        return buf.toString();
      }

      if (q instanceof SpanChunkedNotQuery) {
        SpanChunkedNotQuery nq = (SpanChunkedNotQuery)q;
        buf.append("(");
        buf.append(queryToText(nq.getInclude()));
        buf.append(" NOT ");
        buf.append(queryToText(nq.getExclude()));
        buf.append(")~" + nq.getSlop());
        return buf.toString();
      }

      if (q instanceof BooleanQuery)
      {
        BooleanClause[] clauses = ((BooleanQuery)q).getClauses();
        buf.append("(");
        for (int i = 0; i < clauses.length; i++) {
          if (buf.length() > 1)
            buf.append(" ");
          if (clauses[i].getOccur() == BooleanClause.Occur.MUST)
            buf.append("+");
          else if (clauses[i].getOccur() == BooleanClause.Occur.MUST_NOT)
            buf.append("-");
          buf.append(queryToText(clauses[i].getQuery()));
        }
        buf.append(")");
        return buf.toString();
      }

      return q.toString();
    } // queryToText()

    private SpanQuery term(String text) {
      return new SpanTermQuery(new Term("text", text));
    }

    private SpanQuery[] terms(String text) {
      Vector v = new Vector();
      StringTokenizer st = new StringTokenizer(text);
      while (st.hasMoreTokens())
        v.add(term(st.nextToken()));
      return (SpanQuery[])v.toArray(new SpanQuery[v.size()]);
    }

    private SpanQuery or(SpanQuery[] clauses) {
      return new SpanOrQuery(clauses);
    }

    private SpanQuery not(int slop, SpanQuery include, SpanQuery exclude) {
      return new SpanChunkedNotQuery(include, exclude, slop);
    }

    private SpanQuery near(int slop, SpanQuery[] clauses) {
      return new SpanNearQuery(clauses, slop, false);
    }

    private SpanQuery and(SpanQuery[] clauses) {
      return near(20, clauses);
    }

    private SpanQuery phrase(SpanQuery[] clauses) {
      return near(0, clauses);
    }

    private SpanQuery[] join(SpanQuery q1, SpanQuery q2) {
      SpanQuery[] array = new SpanQuery[2];
      array[0] = q1;
      array[1] = q2;
      return array;
    }

    private SpanQuery[] join(SpanQuery q1, SpanQuery q2, SpanQuery q3) {
      SpanQuery[] array = new SpanQuery[3];
      array[0] = q1;
      array[1] = q2;
      array[2] = q3;
      return array;
    }

    private Query bool(Query q1, BooleanClause.Occur occur1,
                       Query q2, BooleanClause.Occur occur2,
                       Query q3, BooleanClause.Occur occur3)
    {
      BooleanQuery q = new BooleanQuery();
      q.add(q1, occur1);
      q.add(q2, occur2);
      if (q3 != null)
        q.add(q3, occur3);
      return q;
    }

    private Query regTerm(String text) {
      return new TermQuery(new Term("text", text));
    }

    private SpanQuery boost(float factor, SpanQuery q) {
      q.setBoost(factor);
      return q;
    }

    private Query boost(float factor, Query q) {
      q.setBoost(factor);
      return q;
    }

    private void testQuery(Query query, String expectedResult) {
      BigramQueryRewriter rewriter = new BigramQueryRewriter(stopSet, 20);
      Query newQ = rewriter.rewriteQuery(query);
      String result = queryToText(newQ);
      Trace.debug(queryToText(query) + " --> " + result);
      assert result.equals(expectedResult);
    } // testQuery()

    private void testUnchanged(Query query) {
      BigramQueryRewriter rewriter = new BigramQueryRewriter(stopSet, 20);
      Query newQ = rewriter.rewriteQuery(query);
      assert query == newQ;
    } // testQuery()

    /**
     * Run the test.
     */
    protected void testImpl()
    {
      stopSet = BigramQueryRewriter.makeStopSet("a and it is the of");

      ////////////////////////////////////////////////////////////////////////
      // PHRASE QUERIES
      ////////////////////////////////////////////////////////////////////////

      // Start with some simple ones
      testUnchanged(phrase(terms("hello there")));
      testQuery(phrase(terms("man of war")), "\"man~of of~war\"");
      testQuery(phrase(terms("man of the world")), "\"man~of of~the the~world\"");
      testQuery(phrase(terms("when it is a problem")),
                "\"when~it it~is is~a a~problem\"");
      testQuery(phrase(terms("and martha is")), "\"and~martha martha~is\"");

      // Test phrase queries with non~term clauses.
      testQuery(
        phrase(join(term("the"), or(terms("white beige")), term("rabbit"))),
        "\"(the~white OR the~beige) rabbit\"");

      // It would be a huge pain to deal with trying to apply inner stop
      // words from an OR query to the outer terms. So we just don't.
      //
      testQuery(phrase(join(term("eat"), or(terms("the a")), term("rabbit"))),
                "\"eat rabbit\"");

      // Test boost propagation
      testQuery(phrase(join(term("eat"), boost(5, term("the")), term("wave"))),
                "\"eat~the^5 the~wave^5\"");
      testQuery(phrase(join(term("eat"), term("the"), boost(5, term("wave")))),
                "\"eat~the the~wave^5\"");

      ////////////////////////////////////////////////////////////////////////
      // AND QUERIES
      ////////////////////////////////////////////////////////////////////////

      // Start with simple ones
      testUnchanged(and(terms("hello there")));
      testQuery(and(terms("man of war")),
                "\"(man^0 OR man~of) (of~war OR war^0)\"~20");

      // Test AND queries with non~term clauses.
      testQuery(and(join(term("the"), or(terms("white beige")), term("rabbit"))),
                "\"((the~white OR the~beige) OR (white OR beige)^0) rabbit\"~20");

      // Test boost propagation
      testQuery(boost(2,
                      and(join(term("eat"), boost(5, term("the")), term("wave")))),
                "\"(eat^0 OR eat~the^5) (the~wave^5 OR wave^0)\"~20^2");
      testQuery(boost(5,
                      and(
        join(boost(2, term("eat")), boost(3, or(terms("the a")))))), "eat^10");

      ////////////////////////////////////////////////////////////////////////
      // NEAR QUERIES
      ////////////////////////////////////////////////////////////////////////
      testUnchanged(near(5, terms("three freezy trees")));
      testUnchanged(near(5,
                         join(term("three"),
                              or(terms("freezy breezy")),
                              term("trees"))));
      testQuery(near(5, terms("man of war")),
                "\"(man^0 OR man~of) (of~war OR war^0)\"~5");
      testQuery(
        near(5, terms("when it is a problem")),
        "(\"when~it it~is is~a a~problem\"~5 OR " +
        "\"(when^0 OR when~it) (a~problem OR problem^0)\"~5^0)");
      testQuery(near(5, terms("it is a problem")),
                "(\"it~is is~a a~problem\"~5 OR (a~problem OR problem^0)^0)");
      testQuery(near(5, terms("when it is a")),
                "(\"when~it it~is is~a\"~5 OR (when^0 OR when~it)^0)");

      // Try some near queries with non~term clauses.
      testQuery(near(5, join(or(terms("shake bake")), term("it"))),
                "((shake OR bake)^0 OR (shake~it OR bake~it))");
      testQuery(near(5, join(or(terms("shake bake")), term("it"), term("now"))),
                "\"((shake OR bake)^0 OR (shake~it OR bake~it)) " +
                "(it~now OR now^0)\"~5");
      testQuery(near(5,
                     join(term("jeff"), or(terms("shakes bakes")), term("it"))),
                "\"jeff ((shakes OR bakes)^0 OR (shakes~it OR bakes~it))\"~5");

      // Test boost propagation
      testQuery(
        boost(2,
              near(5,
                   join(boost(3,
                              or(join(boost(4, term("shake")),
                                      boost(5, term("bake"))))),
                        boost(6, term("it")), boost(7, term("now"))))),
        "\"((shake^4 OR bake^5)^2 OR " + "(shake~it^6 OR bake~it^6)^3) " +
        "(it~now^7 OR now^5)\"~5^2");
      testQuery(
        boost(7,
              near(5,
                   join(boost(6,
                              or(join(boost(5, term("shake")),
                                      boost(4, term("bake"))))),
                        boost(3, term("it")), boost(2, term("now"))))),
        "\"((shake^5 OR bake^4)^4 OR " + "(shake~it^5 OR bake~it^4)^6) " +
        "(it~now^3 OR now^1)\"~5^7");

      ////////////////////////////////////////////////////////////////////////
      // OR QUERIES
      ////////////////////////////////////////////////////////////////////////
      testUnchanged(or(join(term("foo"), and(terms("bar gaz")))));
      testQuery(or(join(term("arf"), and(terms("the dog")), term("said"))),
                "(arf OR (the~dog OR dog^0) OR said)");
      testQuery(or(join(term("the"), and(terms("very nice")), term("rabbit"))),
                "(\"very nice\"~20 OR rabbit)");

      // Test boost propagation
      testQuery(boost(5,
                      or(join(boost(2, term("the")),
                              boost(3, term("happy")),
                              boost(4, term("couple"))))),
                "(happy^3 OR couple^4)^5");
      testQuery(
        boost(5,
              or(join(boost(2, term("the")), boost(3, term("happy")),
                      boost(4, term("it"))))),
        "happy^15");

      ////////////////////////////////////////////////////////////////////////
      // NOT QUERIES
      ////////////////////////////////////////////////////////////////////////
      testUnchanged(not(5, term("hello"), term("there")));
      testQuery(not(5, and(terms("the cow")), and(terms("the dog"))),
                "((the~cow OR cow^0) NOT (the~dog OR dog^0))~5");
      testQuery(
        and(join(term("like"), term("a"), not(5, term("cow"), term("dog")))),
        "\"(like^0 OR like~a) ((a~cow NOT dog)~5 OR (cow NOT dog)~5^0)\"~20");

      // A couple tests anticipating future support for case sensitivity and
      // accent insensitivity.
      //
      testQuery(
        and(join(term("the"),
                 not(0, term("hat"), or(terms("hat~p hat~c"))),
                 term("trick"))),
        "\"((the~hat NOT (hat~p OR hat~c))~0 OR " +
        "(hat NOT (hat~p OR hat~c))~0^0) trick\"~20");
      testQuery(
        and(join(term("hank"),
                 not(0, term("hat"), or(terms("hat~p hat~c"))),
                 term("is"))),
        "\"hank ((hat NOT (hat~p OR hat~c))~0^0 OR " +
        "(hat~is NOT (hat~p OR hat~c))~0)\"~20");

      ////////////////////////////////////////////////////////////////////////
      // BOOLEAN QUERIES
      ////////////////////////////////////////////////////////////////////////
      testUnchanged(bool(regTerm("hello"), BooleanClause.Occur.MUST,
                         regTerm("kitty"), BooleanClause.Occur.MUST_NOT,
                         regTerm("pencil"), BooleanClause.Occur.MUST));

      testQuery(bool(regTerm("cats"), BooleanClause.Occur.MUST,
                     regTerm("and"), BooleanClause.Occur.MUST_NOT,
                     regTerm("hats"), BooleanClause.Occur.MUST),
                "(+cats +hats)");
      testQuery(bool(regTerm("cats"), BooleanClause.Occur.MUST,
                     regTerm("and"), BooleanClause.Occur.SHOULD,
                     regTerm("hats"), BooleanClause.Occur.MUST),
                "(+cats +hats)");
      testQuery(bool(regTerm("is"), BooleanClause.Occur.MUST,
                     regTerm("it"), BooleanClause.Occur.MUST,
                     regTerm("fun"), BooleanClause.Occur.SHOULD),
                "(fun)");

      // Test BooleanQuery with non~term clauses
      testQuery(bool(regTerm("whip"), BooleanClause.Occur.MUST,
                     or(terms("it them")), BooleanClause.Occur.MUST,
                     regTerm("good"), BooleanClause.Occur.MUST),
                "(+whip +them +good)");

      // Test boost propagation
      testQuery(boost(2,
                      bool(boost(3, regTerm("it")), BooleanClause.Occur.SHOULD,
                           boost(4, regTerm("and")), BooleanClause.Occur.SHOULD,
                           boost(5, regTerm("harry")), BooleanClause.Occur.MUST)),
                "harry^10");
    } // testImpl()
  }; // Tester
} // class XtfBigramQueryRewriter


text:
package com.mageddo.bookmarks.apiserver;

import java.time.LocalDateTime;

import javax.inject.Inject;

import com.mageddo.bookmarks.entity.BookmarkEntity;
import com.mageddo.bookmarks.enums.BookmarkVisibility;
import com.mageddo.bookmarks.service.BookmarksService;
import com.mageddo.bookmarks.service.SiteMapService;
import com.mageddo.config.DatabaseConfigurator;
import com.mageddo.rawstringliterals.Rsl;

import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import io.micronaut.http.HttpHeaders;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.MediaType;
import io.micronaut.runtime.server.EmbeddedServer;
import io.micronaut.test.annotation.MicronautTest;
import io.restassured.path.xml.XmlPath;
import io.restassured.response.Response;

import static com.mageddo.config.TestUtils.setupRestAssured;
import static io.restassured.RestAssured.get;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;

@Rsl
@MicronautTest(environments = "pg")
public class SiteMapControllerIntTest {

  @Inject
  private EmbeddedServer server;

  @Inject
  private DatabaseConfigurator databaseConfigurator;

  @Inject
  private SiteMapService siteMapService;

  @Inject
  private BookmarksService bookmarksService;

  @BeforeEach
  public void before() {
    setupRestAssured(server);
    databaseConfigurator.migrate();
  }

  @Test
  public void TestGetV1_0Success() {

    // arrange

    bookmarksService.createBookmark(new BookmarkEntity().setName("Awesome Bookmark")
        .setVisibility(BookmarkVisibility.PUBLIC)
        .setLastUpdate(LocalDateTime.parse("2017-08-07T00:00:00")));

    bookmarksService.createBookmark(new BookmarkEntity().setName("Private Bookmark")
        .setVisibility(BookmarkVisibility.PRIVATE)
        .setLastUpdate(LocalDateTime.parse("2017-08-06T00:00:00")));

    // act
    final Response req = get("/api/v1.0/sitemap");
    final String body = req.andReturn()
        .body()
        .asString();

    //assert
    req.then()
        .assertThat()
        .statusCode(HttpStatus.OK.getCode())
        .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML);

    final XmlPath xml = XmlPath.from(StringUtils.trim(body));

    assertEquals(1, xml.getList("urlset").size());
    assertThat(xml.get("urlset[0].url.loc"), endsWith("/awesome-bookmark"));
    assertThat(xml.get("urlset[0].url.changefreq"), equalTo("weekly"));
    assertThat(xml.get("urlset[0].url.priority"), equalTo("1"));
    assertThat(body, xml.get("urlset[0].url.lastmod"), equalTo("2017-08-07"));

  }

}


text:
describe Fastlane do
  describe Fastlane::Setup do
    it "#files_to_copy" do
      expect(Fastlane::SetupIos.new.files_to_copy).to eq(['Deliverfile', 'deliver', 'screenshots', 'metadata'])
    end

    it "#show_infos" do
      Fastlane::SetupIos.new.show_infos
    end

    describe "Complete setup process" do
      let (:fixtures) { File.expand_path("./fastlane/spec/fixtures/setup_workspace/") }
      let (:workspace) { File.expand_path("/tmp/setup_workspace/") }
      before do
        fastlane_folder = File.join(workspace, 'fastlane')
        FileUtils.rm_rf(workspace) if File.directory? workspace
        FileUtils.cp_r(fixtures, File.expand_path('..', workspace)) # copy workspace to work on to /tmp

        allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(fastlane_folder)

        ENV['DELIVER_USER'] = 'felix@sunapps.net'
      end

      it "setup is successful and generated initial Fastfile" do
        expect(FastlaneCore::UI).to receive(:input).and_return("y") # iOS project, yeah

        require 'produce'

        app = "app"

        dev_team_id = "123123"
        app_identifier = "tools.fastlane.app"
        expect(Spaceship).to receive(:login)
        expect(Spaceship).to receive(:select_team).and_return(dev_team_id)
        expect(Spaceship::App).to receive(:find).with(app_identifier).and_return(app)

        itc_team_id = "itc_321"
        expect(Spaceship::Tunes).to receive(:login)
        expect(Spaceship::Tunes).to receive(:select_team).and_return(itc_team_id)
        expect(Spaceship::Tunes::Application).to receive(:find).with(app_identifier).and_return(app)

        expect(FastlaneCore::UI).to receive(:confirm).and_return(true)

        FastlaneCore::FastlaneFolder.create_folder!(workspace)
        Dir.chdir(workspace) do
          setup = Fastlane::SetupIos.new
          expect(setup).to receive(:enable_deliver).and_return(nil)
          allow(setup).to receive(:app_identifier).and_return(app_identifier) # to also support linux (travis)
          project = "proj"
          allow(setup).to receive(:project).and_return(project)
          allow(project).to receive(:mac?).and_return(false)
          allow(project).to receive(:schemes).and_return(["MyScheme"])
          allow(project).to receive(:default_app_identifier).and_return(app_identifier)
          allow(project).to receive(:default_app_name).and_return("Project Name")
          allow(project).to receive(:is_workspace).and_return(false)
          allow(project).to receive(:path).and_return("./path")
          allow(project).to receive(:project_name).and_return("ProjectName")
          allow(project).to receive(:select_scheme)

          expect(setup.run).to eq(true)
          expect(setup.tools).to eq({ snapshot: false, cocoapods: true, carthage: false })

          content = File.read(File.join(FastlaneCore::FastlaneFolder.path, 'Fastfile'))
          expect(content).to include "# update_fastlane"
          expect(content).to include "upload_to_app_store"
          expect(content).to include "run_tests"
          expect(content).to include "build_app(scheme: \"MyScheme\")"

          content = File.read(File.join(FastlaneCore::FastlaneFolder.path, 'Appfile'))

          expect(content).to include "app_identifier \"#{app_identifier}\""
          expect(content).to include "team_id \"#{dev_team_id}\""
          expect(content).to include "itc_team_id \"#{itc_team_id}\""
          expect(content).to include "apple_id \"y\""
        end
      end

      describe "react-native" do
        it "tells the user to naviate into the subfolder to run `fastlane init`" do
          expect do
            expect(Fastlane::SetupIos).to receive(:project_uses_react_native?).with(path: "./ios").and_return(true)

            setup = Fastlane::Setup.new
            setup.run
          end.to raise_error("Please navigate to the platform subfolder and run `fastlane init` again")
        end

        it "tells the user to set a custom app identifier if none is set yet" do
          expect do
            setup = Fastlane::SetupIos.new

            expect(Fastlane::SetupIos).to receive(:project_uses_react_native?).with(no_args).and_return(true)
            expect(setup).to receive(:setup_project).and_return(nil)

            setup.run
          end.to raise_error("Could not detect bundle identifier of your react-native app. Make sure to open the Xcode project and update the bundle identifier in the `General` section of your project settings. Restart `fastlane init` once you're done!")
        end
      end

      after do
        ENV.delete('DELIVER_USER')
      end
    end
  end
end


text:
Basic configuration can be in _EventDispatcher_ `__construct` as first parameter.

```php
$EventDispatcher = new EventDispatcher([
    'option_key' => 'value'
]);
```

Available options:

* **type** - File type of event configuration, can be: `array`, `yaml`, `ini`, `xml`, `json` (default: `array`)
* **from_file** - Allow to load configuration from file (`file_path` | `false` default: `false`)
* **log_events** - Allow to log events to log file (`true` | `false` default: `false`)
* **log_all_events** - Allow to log all events to log file, otherwise log only specified one (`true` | `false` default: `true`)
* **log_object** - Namespace of class, or log object to handle log, default is: `\SimpleLog\Log` (Must be instance of `\SimpleLog\LogInterface`)
* **events** - Complete list of events to handle with event object and listeners
* **log_config** - Configuration for SimpleLog object
    * **log_path** -  Path to log file (default: ./log)
    * **level** - (default: debug)
    * **storage** - (default: \SimpleLog\Storage\File)

## Configuration EventDispatcher via methods
Some of configuration options can be changed by some special methods. There are
three categories of that methods, first to turn on option, second to turn off
and last to check that option is on or off.

* **setEventLog** - Set *log_events* option to `true` or `false` to enable or disable event logging
* **getConfiguration** - Return `EventDispatcher` configuration or single option if key is given as value
* **logAllEvents** - Set *log_all_events* option to given parameter (will be split into separate methods in future)
* **logEvent** - Allow to log specified events

## Event configuration
To store event listeners for specified event code and object to store event statement
we use event configuration, that can be applied in constructor or specified
method `setEventConfiguration`.
Both of them accept the same configuration structure, that is an array.
Event configuration must have event code, as key for another array. Event code
is used to recognize event trigger and store configuration. On next level configurations
has two keys `object` (optional) and `listeners`. First one define namespace
of class that will be used to store event statement. That value is optional, when
it not defined, the will be used `BlueEvent\Event\BaseEvent`.
Last one `listeners` define all event listeners as array. Listeners are methods
or functions (everything that can be called by `call_user_func`) that will be
launch each time when event code was triggered.
Event configuration structure example:

```php
$config = [
    'events' => [
        'event_code' => [
            'object'    => 'EventStatementClass',
            'listeners' => [
                'Listener::method',
                'AnotherListener::method',
                'someFunction',
            ]
        ],
        'another_event_code' => [
            'listeners' => [
                [new \Listener, 'method'],
                function ($event) {
                    //listener logic
                },
            ]
        ],
    ]
];
new EventDispatcher($config);
```

If you use `setEventConfiguration` method, you need to omit `events` key.

### Load configuration from file
If event configuration must be loaded from file, there are two possibilities.
First is set `from_file` to __path to configuration file__, set event configuration type by `type`
(depend of file content).

```php
$EventDispatcher = new EventDispatcher(
    [
        'from_file' => 'path/to/file.json',
        'type'      => 'json'
    ]
);
```

Second possibility is to use method `readEventConfiguration` that will load configuration
from file after create dispatcher instance. First parameter is path to event configuration
and second configuration type

```php
$EventDispatcher->readEventConfiguration(
    'path/to/file.json',
    'json'
);
```

Available configuration types are:

* **array** - load configuration from php file, set as configuration (file must return array)
* **json**
* **yaml**
* **xml** - use xml without attributes
* **ini**

### Check current event configuration
To ger current event configuration just execute `getEventConfiguration` that will
return full loaded event configuration array.


text: Processing scripts for born-digital images


text:
@extends('layouts.default')

@section('content')

Cookie Policy

What Are Cookies

As is common practice with almost all professional websites this site uses cookies, which are tiny files that are downloaded to your computer, to improve your experience. This page describes what information they gather, how we use it and why we sometimes need to store these cookies. We will also share how you can prevent these cookies from being stored however this may downgrade or 'break' certain elements of the sites functionality.

How We Use Cookies

We use cookies for a variety of reasons detailed below. Unfortunately in most cases there are no industry standard options for disabling cookies without completely disabling the functionality and features they add to this site. It is recommended that you leave on all cookies if you are not sure whether you need them or not in case they are used to provide a service that you use.

Disabling Cookies

You can prevent the setting of cookies by adjusting the settings on your browser (see your browser Help for how to do this). Be aware that disabling cookies will affect the functionality of this and many other websites that you visit. Disabling cookies will usually result in also disabling certain functionality and features of the this site. Therefore it is recommended that you do not disable cookies.

The Cookies We Set

Site preferences cookies

In order to provide you with a great experience on this site we provide the functionality to set your preferences for how this site runs when you use it. In order to remember your preferences we need to set cookies so that this information can be called whenever you interact with a page is affected by your preferences.

Third Party Cookies

In some special cases we also use cookies provided by trusted third parties. The following section details which third party cookies you might encounter through this site.

This site uses Google Analytics which is one of the most widespread and trusted analytics solution on the web for helping us to understand how you use the site and ways that we can improve your experience. These cookies may track things such as how long you spend on the site and the pages that you visit so we can continue to produce engaging content.

For more information on Google Analytics cookies, see the official Google Analytics page.

More Information

Hopefully that has clarified things for you and as was previously mentioned if there is something that you aren't sure whether you need or not it's usually safer to leave cookies enabled in case it does interact with one of the features you use on our site.

@overwrite


text:
/**
 *
 */
package org.bgp4j.config.nodes.impl;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

import org.apache.commons.lang3.builder.CompareToBuilder;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.bgp4j.config.nodes.PrefixRoutingFilterConfiguration;
import org.bgp4j.config.nodes.RoutingFilterConfiguration;
import org.bgp4j.net.NetworkLayerReachabilityInformation;

/**
 * @author rainer
 *
 */
public class PrefixRoutingFilterConfigurationImpl extends RoutingFilterConfigurationImpl implements	PrefixRoutingFilterConfiguration {

	private Set<NetworkLayerReachabilityInformation> filterPrefixes = new TreeSet<NetworkLayerReachabilityInformation>();

	public PrefixRoutingFilterConfigurationImpl() {}

	public PrefixRoutingFilterConfigurationImpl(String name, Collection<NetworkLayerReachabilityInformation> filterPrefixes) {
		super(name);

		this.filterPrefixes.addAll(filterPrefixes);
	}

	/* (non-Javadoc)
	 * @see org.bgp4j.config.nodes.PrefixRoutingFilterConfiguration#getFilterPrefixes()
	 */
	@Override
	public Set<NetworkLayerReachabilityInformation> getFilterPrefixes() {
		return filterPrefixes;
	}

	void setFilterPrefixes(Set<NetworkLayerReachabilityInformation> filterPrefixes) {
		this.filterPrefixes.clear();

		if(filterPrefixes != null)
			this.filterPrefixes.addAll(filterPrefixes);
	}

	/* (non-Javadoc)
	 * @see org.bgp4j.config.nodes.impl.RoutingFilterConfigurationImpl#getType()
	 */
	@Override
	protected RoutingFilterType getType() {
		return RoutingFilterType.PREFIX;
	}

	/* (non-Javadoc)
	 * @see org.bgp4j.config.nodes.impl.RoutingFilterConfigurationImpl#subclassCompareTo(org.apache.commons.lang3.builder.CompareToBuilder, org.bgp4j.config.nodes.RoutingFilterConfiguration)
	 */
	@Override
	protected void subclassCompareTo(CompareToBuilder builder, RoutingFilterConfiguration o) {
		PrefixRoutingFilterConfiguration p = (PrefixRoutingFilterConfiguration)o;

		builder.append(getFilterPrefixes().size(), p.getFilterPrefixes().size());

		if(builder.toComparison() == 0) {
			Iterator<NetworkLayerReachabilityInformation> lit = getFilterPrefixes().iterator();
			Iterator<NetworkLayerReachabilityInformation> rit = p.getFilterPrefixes().iterator();

			while(lit.hasNext())
				builder.append(lit.next(), rit.next());
		}
	}

	/* (non-Javadoc)
	 * @see org.bgp4j.config.nodes.impl.RoutingFilterConfigurationImpl#subclassEquals(org.apache.commons.lang3.builder.EqualsBuilder, org.bgp4j.config.nodes.RoutingFilterConfiguration)
	 */
	@Override
	protected void subclassEquals(EqualsBuilder builder, RoutingFilterConfiguration o) {
		PrefixRoutingFilterConfiguration p = (PrefixRoutingFilterConfiguration)o;

		builder.append(getFilterPrefixes().size(), p.getFilterPrefixes().size());

		if(builder.isEquals()) {
			Iterator<NetworkLayerReachabilityInformation> lit = getFilterPrefixes().iterator();
			Iterator<NetworkLayerReachabilityInformation> rit = p.getFilterPrefixes().iterator();

			while(lit.hasNext())
				builder.append(lit.next(), rit.next());
		}
	}

	/* (non-Javadoc)
	 * @see org.bgp4j.config.nodes.impl.RoutingFilterConfigurationImpl#subclassHashCode(org.apache.commons.lang3.builder.HashCodeBuilder)
	 */
	@Override
	protected void subclassHashCode(HashCodeBuilder builder) {
		for(NetworkLayerReachabilityInformation nlri : getFilterPrefixes())
			builder.append(nlri);
	}

}


text:
require 'matrix'

module Afterburn
  module ListAggregation

    def aggregate(lists, timestamps, opts = {})
      data = lists.map { |list| list.timestamp_count_vector(timestamps) }.inject(&:+).to_a
      [
        default_options(timestamps.first).merge({
          "name" => opts[:name],
          "data" => data
        })
      ]
    end
    alias :sum :aggregate

    def map(lists, timestamps, opts = {})
      lists.map do |list|
        default_options(timestamps.first).merge({
          "name" => opts[:name] || list.name,
          "data" => list.timestamp_count_vector(timestamps).to_a
        })
      end
    end

    def default_options(start_time)
      {
        "pointInterval" => one_day_in_milliseconds,
        "pointStart" => start_milliseconds(start_time)
      }
    end

    def start_milliseconds(start_time)
      start_time.to_i * 1000
    end

    def one_day_in_milliseconds
      24 * 3600 * 1000
    end

  end

end


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.cjj.MaterialRefreshLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/refresh"
        app:wave_color="#20ff2020"
        app:progress_show_circle_backgroud="true"
        app:overlay="false"
        app:wave_show="true"
        app:progress_backgroud_color="#FFFAFAFA"
        app:progress_colors="@array/material_colors"
        app:wave_height_type="normal"
        app:progress_show_arrow="true"
        app:isLoadMore="true"
        >

        <android.support.v7.widget.RecyclerView
            android:id="@+id/hotmovie_recyclerview"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

    </com.cjj.MaterialRefreshLayout>

    <include layout="@layout/netload_cache_pager"/>
</RelativeLayout>


text:
<tool id="gost.semantic.tagger" name="GOST" version="1.0.0">
 <description>Semantic Tagger</description>
 <command>$__tool_directory__/semtagger.lsd $input $output</command>
 <inputs>
  <param format="lif,text" label="Input Document" name="input" type="data"/>
 </inputs>
 <outputs>
  <data format="lif" label="Semantic Tags" name="output"/>
 </outputs>
 <help>

  <![CDATA[

Gene Ontology Semantic Tagger (GOST)
=====================================

**What it does**
Performs entity identification and semantic markup with detailed semantic categories in biomedical texts, using a set of over `200 semantic labels <http://ucrel.lancs.ac.uk/usas/semtags.txt>` as well as types from the `Gene Ontology <http://geneontology.org>`_ .

**Required annotations**

* None

**Generated Annotations**

* A LIF document with a new view containing `SemanticRole <http://vocab.lappsgrid.org/SemanticRole.html>`_ annotations

**License**

GOST is licensed under the `Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License <http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US>`_

]]>

 </help>
    <citations>
        <citation type="bibtex">
            <![CDATA[
@inproceedings{Elhaj(2018bioNlp),
   title = "Profiling Medical Journal Articles Using a Gene Ontology Semantic Tagger",
   author = "El-Haj, Mahmoud  and
     Rayson, Paul  and
     Piao, Scott  and
     Knight, Jo",
   booktitle = "Proceedings of the 11th Language Resources and Evaluation Conference",
   month = may,
   year = "2018",
   address = "Miyazaki, Japan",
   publisher = "European Language Resource Association",
   url = "https://www.aclweb.org/anthology/L18-1726",
}
   ]]>

        </citation>
    </citations>
</tool>


text:
function launch_vm(){
   IMAGE_NAME=ubuntubase
   TEST_INSTANCE_NAME=$1
   KEY_NAME=bm_test_key
   LOCAL_IMAGE=ubuntuJDK.qcow2
   PUB_KEY_FOR_VM=$2
   FLAVOR=$3
   BASE=/root/

   CUR_DIR=$(cd "$(dirname "$0")"; pwd)

   img_list=$(glance image-list)
   if ! echo $img_list | grep $IMAGE_NAME ; then
        glance image-create --name=$IMAGE_NAME --disk-format=qcow2 --container-format=bare --is-public=true --file=$CUR_DIR/$LOCAL_IMAGE
   fi
   key_list=$(nova keypair-list)
   if ! echo $key_list | grep $KEY_NAME ; then
        nova keypair-add --pub-key $PUB_KEY_FOR_VM $KEY_NAME
   fi

   nova boot $TEST_INSTANCE_NAME --image $IMAGE_NAME --flavor $FLAVOR --key-name=$KEY_NAME
}

function wait_system_ready(){
    wait_count=0
    WAIT_MAX=$2
    set +e

    CUR_DIR=$(cd "$(dirname "$0")"; pwd)
    while (( $wait_count < $WAIT_MAX ))
    do
        ssh -o StrictHostKeyChecking=no -i $CUR_DIR/id_rsa root@$1 "exit"
        if (( $? == 0 )); then echo "$1 OS is ready";break;fi
        sleep $3
        ((wait_count++))
   done
   if (( wait_count < $WAIT_MAX )); then
        echo "$1 OS installation done"
        return 0
   else
        return 1
   fi
}

function wait_all(){
    set $1
    for server in "$@"
    do
    	wait_system_ready $server 15 10
    	[[ $? != 0 ]] && echo "$server isn't up in reasonable time"
    done
}

if [[ $# != 2 && $# != 3 ]]; then
	echo "Usage: $0 [number_of_cluster_nodes] [base_hostname_for_nodes] [size(optional, default=small)(small,medium,large,xlarge)]"
	cat << EOF
         RAM(MB)  Disk(GB) VCPU
small  | 2048      | 20   | 2
medium | 4096      | 40   | 2
large  | 8192      | 80   | 4
xlarge | 8192      | 120  | 4
EOF
	exit 1
fi

num=$1

echo "$num"|grep -E '[0-9]+' > /dev/null
[[ $? != 0 ]] && echo "Please specify a number for the first parameter!" && exit 1

flavor=${3:-small}
[[ $flavor != small && $flavor != medium && $flavor != large && $flavor != xlarge ]] && echo "Size parameter must be one of (small,medium,large,xlarge)" && exit 1

flavor=spark."$flavor"
master_name=$(echo "$2"master| tr '[:upper:]' '[:lower:]')
slave_name=$(echo "$2"slave| tr '[:upper:]' '[:lower:]')

CUR_DIR=$(cd "$(dirname "$0")"; pwd)
PDIR=`basename $CUR_DIR`
source $CUR_DIR/keystonerc
nova list > /dev/null
[[ $? != 0 ]] && echo "OpenStack credentials ($CUR_DIR/keystonerc) are not correct or OpenStack installation is not working! " && exit 1

startt=`date`
nova show $master_name 2>&1 >/dev/null
[[ $? == 0 ]] && echo "VM with the same name exists. Please specify another name" && exit 1

nova show $slave_name 2>&1 >/dev/null
[[ $? == 0 ]] && echo "VM with the same name exists. Please specify another name" && exit 1

chmod 600 $CUR_DIR/id_rsa.pub
chmod 600 $CUR_DIR/id_rsa

launch_vm $master_name $CUR_DIR/id_rsa.pub $flavor

count=1
while (( $num > $count ))
do
    vmname="$slave_name""$count"
	launch_vm $vmname $CUR_DIR/id_rsa.pub $flavor
	let count+=1
done

echo "sleeping for 1 min..."
sleep 60
master_ip=`nova list|grep $master_name|cut -d '|' -f 7|cut -d '=' -f 2|sed 's/\s*//g'`
if [[ $num > 1 ]]; then
   slave_ips=`nova list|grep $slave_name|cut -d '|' -f 7|cut -d '=' -f 2|sed 's/\s*//g'`
   [[ -z $slave_ips ]] && echo "Slave VM launching failed...exiting..." && exit 1
fi
[[ -z $master_ip ]] && echo "Master VM launching failed...exiting..." && exit 1

wait_all $master_ip
wait_all `echo $slave_ips`

echo "VM launched successfully..."
echo "Master IP: $master_ip"
echo "Slave IP(s): $slave_ips"

rm -rf /root/.ssh/known_hosts

	scp -r -o StrictHostKeyChecking=no -i $CUR_DIR/id_rsa $CUR_DIR $master_ip:/root/
	ssh -o StrictHostKeyChecking=no -i $CUR_DIR/id_rsa $master_ip "/root/$PDIR/local-hadoop24-setup.sh master $master_name $num"
	ssh -o StrictHostKeyChecking=no -i $CUR_DIR/id_rsa $master_ip "/root/$PDIR/spark1.0-setup.sh"
        sleep 20

        if [[ $num > 1 ]]; then
	set $slave_ips
	for slave in $*
	do
	    scp -r -o StrictHostKeyChecking=no -i $CUR_DIR/id_rsa $CUR_DIR $slave:/root/
	    ssh -o StrictHostKeyChecking=no -i $CUR_DIR/id_rsa $slave "/root/$PDIR/local-hadoop24-setup.sh slave $master_name"
	    ssh -o StrictHostKeyChecking=no -i $CUR_DIR/id_rsa $slave "/root/$PDIR/spark1.0-setup.sh $master_name"
	done
        fi

echo "VM launched successfully..."
echo "Master IP: $master_ip"
echo "Slave IP(s): $slave_ips"
echo "Starting time: $startt"
echo "Finish time: `date`"


text:
<?php

require_once(dirname(__FILE__).'/../lib/BasesfLinkedinAuthActions.class.php');

class sfLinkedinAuthActions extends BasesfLinkedinAuthActions
{

}


text:
Montric.ApplicationController = Ember.Controller.extend({
    needs: ['mainCharts', 'user'],

    timezones: null,
    selectedTimezone: null,
    chartTimespans: null,
    selectedChartTimespan: null,
    chartResolutions: null,
    selectedChartResolution: null,
    selectedChartFromString: null,
    selectedChartToString: null,
    selectedChartFrom: null,
    selectedChartTo: null,
    dateFormat: 'dd mmmm yyyy HH:MM',
    showLiveCharts: null,

    /* GIANT hack in order to be able to pull the chart-related properties out from the ChartAdapter */
    init: function() {
        this._super();

        console.log('ApplicationController init');
        this.get('controllers.user');
        this.set('showLiveCharts', true);
        this.set('timezones', []);
        this.set('chartTimespans', []);
        this.set('chartResolutions', []);
        this.set('selectedChartTo', new Date());
        var fromDate = new Date(this.get('selectedChartTo').getTime() - (10 * 60 * 1000));
        if (fromDate) {
            this.set('selectedChartFrom', fromDate);
        }

        this.generateChartStrings();

        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-12', timezoneName: 'UTC-12'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-11', timezoneName: 'UTC-11'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-10', timezoneName: 'UTC-10'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-9', timezoneName: 'UTC-9'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-8', timezoneName: 'UTC-8'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-7', timezoneName: 'UTC-7'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-6', timezoneName: 'UTC-6'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-5', timezoneName: 'UTC-5'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-4', timezoneName: 'UTC-4'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-3', timezoneName: 'UTC-3'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-2', timezoneName: 'UTC-2'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '-1', timezoneName: 'UTC-1'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '0', timezoneName: 'UTC0'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '1', timezoneName: 'UTC+1'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '2', timezoneName: 'UTC+2'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '3', timezoneName: 'UTC+3'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '4', timezoneName: 'UTC+4'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '5', timezoneName: 'UTC+5'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '6', timezoneName: 'UTC+6'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '7', timezoneName: 'UTC+7'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '8', timezoneName: 'UTC+8'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '9', timezoneName: 'UTC+9'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '10', timezoneName: 'UTC+10'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '11', timezoneName: 'UTC+11'}));
        this.get('timezones').pushObject(Ember.Object.create({timezoneValue: '12', timezoneName: 'UTC+12'}));

        var timezoneOffsetIndex = (-1 * new Date().getTimezoneOffset() / 60) + 12;
        this.set('selectedTimezone', this.get('timezones').objectAt(timezoneOffsetIndex));

        this.get('chartTimespans').pushObject(Ember.Object.create({timespanName: '10 Minutes', timespanValue: '10'}));
        this.get('chartTimespans').pushObject(Ember.Object.create({timespanName: '20 Minutes', timespanValue: '20'}));
        this.get('chartTimespans').pushObject(Ember.Object.create({timespanName: '30 Minutes', timespanValue: '30'}));
        this.get('chartTimespans').pushObject(Ember.Object.create({timespanName: '1 hour', timespanValue: '60'}));
        this.get('chartTimespans').pushObject(Ember.Object.create({timespanName: '2 hours', timespanValue: '120'}));
        this.get('chartTimespans').pushObject(Ember.Object.create({timespanName: '6 hours', timespanValue: '360'}));
        this.get('chartTimespans').pushObject(Ember.Object.create({timespanName: '12 hours', timespanValue: '720'}));
        this.get('chartTimespans').pushObject(Ember.Object.create({timespanName: '24 hours', timespanValue: '1440'}));

        this.set('selectedChartTimespan', this.get('chartTimespans').objectAt(0));

        this.get('chartResolutions').pushObject(Ember.Object.create({chartResolutionName: '15 seconds', chartResolutionValue: '15'}));
        this.get('chartResolutions').pushObject(Ember.Object.create({chartResolutionName: '30 seconds', chartResolutionValue: '30'}));
        this.get('chartResolutions').pushObject(Ember.Object.create({chartResolutionName: '45 seconds', chartResolutionValue: '45'}));
        this.get('chartResolutions').pushObject(Ember.Object.create({chartResolutionName: '1 minute', chartResolutionValue: '60'}));
        this.get('chartResolutions').pushObject(Ember.Object.create({chartResolutionName: '3 minutes', chartResolutionValue: '180'}));
        this.get('chartResolutions').pushObject(Ember.Object.create({chartResolutionName: '10 minutes', chartResolutionValue: '600'}));
        this.get('chartResolutions').pushObject(Ember.Object.create({chartResolutionName: '20 minutes', chartResolutionValue: '1200'}));
        this.get('chartResolutions').pushObject(Ember.Object.create({chartResolutionName: '40 minutes', chartResolutionValue: '2400'}));

        this.set('selectedChartResolution', this.get('chartResolutions').objectAt(0));

        Montric.set('selectedTimezone', this.get('selectedTimezone.timezoneValue'));
        Montric.set('selectedChartTimespan', this.get('selectedChartTimespan.timespanValue'));
        Montric.set('selectedChartResolution', this.get('selectedChartResolution.chartResolutionValue'));
        Montric.set('selectedChartFromMs', this.get('selectedChartFrom').getTime());
        Montric.set('showLiveCharts', this.get('showLiveCharts'));
        Montric.set('selectedChartToMs', this.get('selectedChartTo').getTime());
    },

    selectedTimezoneObserver: function() {
        console.log('selectedTimezoneObserver');
        Montric.set('selectedTimezone', this.get('selectedTimezone.timezoneValue'));
    }.observes('selectedTimezone'),

    selectedChartTimespanObserver: function() {
        Montric.set('selectedChartTimespan', this.get('selectedChartTimespan.timespanValue'));
    }.observes('selectedChartTimespan'),

    selectedChartResolutionObserver: function() {
        Montric.set('selectedChartResolution', this.get('selectedChartResolution.chartResolutionValue'));
    }.observes('selectedChartResolution'),

    showLiveChartsObserver: function() {
        Montric.set('showLiveCharts', this.get('showLiveCharts'));
    }.observes('showLiveCharts'),

    selectedChartFromObserver: function() {
        Montric.set('selectedChartFromMs', this.get('selectedChartFrom').getTime());
    }.observes('selectedChartFrom'),

    selectedChartToObserver: function() {
        Montric.set('selectedChartToMs', this.get('selectedChartTo').getTime());
    }.observes('selectedChartTo'),

    historicalChartsSelected: function() {
        this.set('showLiveCharts', false);
    },

    liveChartsSelected: function() {
        this.set('showLiveCharts', true);
    },

    updateChartDates: function () {
        console.log('updateChartDates');
        var fromDate = Date.fromString(this.get('selectedChartFromString'));
        var toDate = Date.fromString(this.get('selectedChartToString'));

        if (toDate != null && toDate.getYear() != 1970) {
            this.set('selectedChartTo', toDate);
        } else {
            this.set('selectedChartFrom', new Date());
        }

        if (fromDate != null && fromDate.getYear() != 1970) {
            this.set('selectedChartFrom', fromDate);
        } else {
            var fromDate = new Date(this.get('selectedChartFrom').getTime() - (10 * 60 * 1000));
            this.set('selectedChartFrom', fromDate);
        }

        var chartsController = this.get('controllers.mainCharts');
        console.log('chartsController');
        console.log(chartsController);

        if (chartsController) {
            chartsController.reloadCharts();
        }
    },

    generateChartStrings: function () {
        this.set('selectedChartFromString', this.generateChartString(this.get('selectedChartFrom')));
        this.set('selectedChartToString', this.generateChartString(this.get('selectedChartTo')));
    },

    generateChartString: function (date) {
        var fmt = this.get('dateFormat') || 'dd.mm.yy';

        var dateString = date ? dateFormat(date, fmt) : "";
        return dateString;
    },

    showModal: function() {
        console.log('showModal');
        $("#chartOptionsModal").modal({show: true});
    }
});


text:
School Topics
=============

TO DO.


text:
_[www.codever.land/bookmarks/t/choo](https://www.codever.land/bookmarks/t/choo)_
---
#### [awesome-choo](https://github.com/choojs/awesome-choo#readme)
_https://github.com/choojs/awesome-choo#readme_

🌅 Awesome things related with choo framework. Contribute to choojs/awesome-choo development by creating an account on GitHub.
* **tags**: [awesome-list](../tagged/awesome-list.md), [frontend](../tagged/frontend.md), [choo](../tagged/choo.md)
* :octocat: **[source code](https://github.com/choojs/awesome-choo#readme)**
---


text:
<resources>
    <string name="app_name">httpUtil</string>
</resources>


text:
@import "./breakpoints.css";
@import "./spacing.css";
@import "./fonts.css";
@import "./colors.css";
@import "./easings.css";


text:
TABLE OF INTERACTIONS WITH

IBRUTINIB

See also: metabolized tyrosine-kinase inhibitors

From the French ANSM drug interactions document of September 2016, p. 110

IBRUTINIB

RxNorm: 1442981

ATC: L01XE27

AMIODARONE

RxNorm: 703

ATC: C01BD01

Increase of the plasma concentrations of ibrutinib due to decrease of its hepatic metabolism by the amiodarone

Precaution for use

Strict clinical monitoring and reduction of the dose of ibrutinib to 140 mg per day during the length of time these medications are administered together.

IBRUTINIB

RxNorm: 1442981

ATC: L01XE27

DILTIAZEM

RxNorm: 3443

ATC: C08DB01

Increase of the plasma concentrations of ibrutinib due to decrease of its hepatic metabolism by the diltiazem

Precaution for use

Strict clinical monitoring and reduction of the dose of ibrutinib to 140 mg/day during the length of time these medications are administered together.

IBRUTINIB

RxNorm: 1442981

ATC: L01XE27

VERAPAMIL

RxNorm: 11170

ATC: C08DA01

Increase of the plasma concentrations of irutinib due to decrease of its hepatic metabolism by the verapamil

Precaution for use

Strict clinical monitoring and reduction of the dose of ibrutinib to 140mg per day during the length of time these medications are administered together.