text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:osgi="http://www.springframework.org/schema/osgi"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/osgi
            http://www.springframework.org/schema/osgi/spring-osgi.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:annotation-config/>

    <bean id="updateService" class="org.jtheque.updates.impl.UpdateServiceImpl" />

    <osgi:service ref="updateService" interface="org.jtheque.updates.UpdateService"/>

    <osgi:reference id="webHelper" interface="org.jtheque.core.utils.WebHelper"/>
    <osgi:reference id="resourceService" interface="org.jtheque.resources.ResourceService"/>
    <osgi:reference id="core" interface="org.jtheque.core.Core"/>
    <osgi:reference id="iuiUtils" interface="org.jtheque.ui.UIUtils"/>
</beans>


text:
""" PolymorphicQuerySet support functions
    Please see README.rst or DOCS.rst or http://chrisglass.github.com/django_polymorphic/
"""
from __future__ import absolute_import

import copy
import django
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q, FieldDoesNotExist
from django.db.utils import DEFAULT_DB_ALIAS

from django.db.models.fields.related import RelatedField
if django.VERSION < (1, 6):
    # There was no common base class in Django 1.5, mention all variants here.
    from django.db.models.fields.related import RelatedObject, ManyToOneRel, ManyToManyRel
    REL_FIELD_CLASSES = (RelatedField, RelatedObject, ManyToOneRel, ManyToManyRel)  # Leaving GenericRel out.
elif django.VERSION < (1, 8):
    # As of Django 1.6 there is a ForeignObjectRel.
    from django.db.models.fields.related import ForeignObjectRel, RelatedObject
    REL_FIELD_CLASSES = (RelatedField, ForeignObjectRel, RelatedObject)
else:
    # As of Django 1.8 the base class serves everything. RelatedObject is gone.
    from django.db.models.fields.related import ForeignObjectRel
    REL_FIELD_CLASSES = (RelatedField, ForeignObjectRel)

from functools import reduce

###################################################################################
# PolymorphicQuerySet support functions

# These functions implement the additional filter- and Q-object functionality.
# They form a kind of small framework for easily adding more
# functionality to filters and Q objects.
# Probably a more general queryset enhancement class could be made out of them.

def translate_polymorphic_filter_definitions_in_kwargs(queryset_model, kwargs, using=DEFAULT_DB_ALIAS):
    """
    Translate the keyword argument list for PolymorphicQuerySet.filter()

    Any kwargs with special polymorphic functionality are replaced in the kwargs
    dict with their vanilla django equivalents.

    For some kwargs a direct replacement is not possible, as a Q object is needed
    instead to implement the required functionality. In these cases the kwarg is
    deleted from the kwargs dict and a Q object is added to the return list.

    Modifies: kwargs dict
    Returns: a list of non-keyword-arguments (Q objects) to be added to the filter() query.
    """
    additional_args = []
    for field_path, val in kwargs.copy().items():  # Python 3 needs copy

        new_expr = _translate_polymorphic_filter_definition(queryset_model, field_path, val, using=using)

        if type(new_expr) == tuple:
            # replace kwargs element
            del(kwargs[field_path])
            kwargs[new_expr[0]] = new_expr[1]

        elif isinstance(new_expr, models.Q):
            del(kwargs[field_path])
            additional_args.append(new_expr)

    return additional_args

def translate_polymorphic_Q_object(queryset_model, potential_q_object, using=DEFAULT_DB_ALIAS):
    def tree_node_correct_field_specs(my_model, node):
        " process all children of this Q node "
        for i in range(len(node.children)):
            child = node.children[i]

            if type(child) == tuple:
                # this Q object child is a tuple => a kwarg like Q( instance_of=ModelB )
                key, val = child
                new_expr = _translate_polymorphic_filter_definition(my_model, key, val, using=using)
                if new_expr:
                    node.children[i] = new_expr
            else:
                # this Q object child is another Q object, recursively process this as well
                tree_node_correct_field_specs(my_model, child)

    if isinstance(potential_q_object, models.Q):
        tree_node_correct_field_specs(queryset_model, potential_q_object)

    return potential_q_object

def translate_polymorphic_filter_definitions_in_args(queryset_model, args, using=DEFAULT_DB_ALIAS):
    """
    Translate the non-keyword argument list for PolymorphicQuerySet.filter()

    In the args list, we return all kwargs to Q-objects that contain special
    polymorphic functionality with their vanilla django equivalents.
    We traverse the Q object tree for this (which is simple).

    Returns: modified Q objects
    """
    if django.VERSION >= (1, 10):
        q_objects = [copy.deepcopy(q) for q in args]
    elif django.VERSION >= (1, 6):
        q_objects = [q.clone() for q in args]
    else:
        q_objects = args  # NOTE: edits existing objects in place.
    return [translate_polymorphic_Q_object(queryset_model, q, using=using) for q in q_objects]

def _translate_polymorphic_filter_definition(queryset_model, field_path, field_val, using=DEFAULT_DB_ALIAS):
    """
    Translate a keyword argument (field_path=field_val), as used for
    PolymorphicQuerySet.filter()-like functions (and Q objects).

    A kwarg with special polymorphic functionality is translated into
    its vanilla django equivalent, which is returned, either as tuple
    (field_path, field_val) or as Q object.

    Returns: kwarg tuple or Q object or None (if no change is required)
    """

    # handle instance_of expressions or alternatively,
    # if this is a normal Django filter expression, return None
    if field_path == 'instance_of':
        return _create_model_filter_Q(field_val, using=using)
    elif field_path == 'not_instance_of':
        return _create_model_filter_Q(field_val, not_instance_of=True, using=using)
    elif not '___' in field_path:
        return None  # no change

    # filter expression contains '___' (i.e. filter for polymorphic field)
    # => get the model class specified in the filter expression
    newpath = translate_polymorphic_field_path(queryset_model, field_path)
    return (newpath, field_val)

def translate_polymorphic_field_path(queryset_model, field_path):
    """
    Translate a field path from a keyword argument, as used for
    PolymorphicQuerySet.filter()-like functions (and Q objects).
    Supports leading '-' (for order_by args).

    E.g.: if queryset_model is ModelA, then "ModelC___field3" is translated
    into modela__modelb__modelc__field3.
    Returns: translated path (unchanged, if no translation needed)
    """
    classname, sep, pure_field_path = field_path.partition('___')
    if not sep:
        return field_path
    assert classname, 'PolymorphicModel: %s: bad field specification' % field_path

    negated = False
    if classname[0] == '-':
        negated = True
        classname = classname.lstrip('-')

    if '__' in classname:
        # the user has app label prepended to class name via __ => use Django's get_model function
        appname, sep, classname = classname.partition('__')
        model = models.get_model(appname, classname)
        assert model, 'PolymorphicModel: model %s (in app %s) not found!' % (model.__name__, appname)
        if not issubclass(model, queryset_model):
            e = 'PolymorphicModel: queryset filter error: "' + model.__name__ + '" is not derived from "' + queryset_model.__name__ + '"'
            raise AssertionError(e)

    else:
        # the user has only given us the class name via ___
        # => select the model from the sub models of the queryset base model

        # Test whether it's actually a regular relation__ _fieldname (the field starting with an _)
        # so no tripple ClassName___field was intended.
        try:
            if django.VERSION >= (1, 8):
                # This also retreives M2M relations now (including reverse foreign key relations)
                field = queryset_model._meta.get_field(classname)
            else:
                field = queryset_model._meta.get_field_by_name(classname)[0]

            if isinstance(field, REL_FIELD_CLASSES):
                # Can also test whether the field exists in the related object to avoid ambiguity between
                # class names and field names, but that never happens when your class names are in CamelCase.
                return field_path  # No exception raised, field does exist.
        except FieldDoesNotExist:
            pass

        # function to collect all sub-models, this should be optimized (cached)
        def add_all_sub_models(model, result):
            if issubclass(model, models.Model) and model != models.Model:
                # model name is occurring twice in submodel inheritance tree => Error
                if model.__name__ in result and model != result[model.__name__]:
                    e = 'PolymorphicModel: model name alone is ambiguous: %s.%s and %s.%s!\n'
                    e += 'In this case, please use the syntax: applabel__ModelName___field'
                    assert model, e % (
                        model._meta.app_label, model.__name__,
                        result[model.__name__]._meta.app_label, result[model.__name__].__name__)

                result[model.__name__] = model

            for b in model.__subclasses__():
                add_all_sub_models(b, result)

        submodels = {}
        add_all_sub_models(queryset_model, submodels)
        model = submodels.get(classname, None)
        assert model, 'PolymorphicModel: model %s not found (not a subclass of %s)!' % (classname, queryset_model.__name__)

    # create new field path for expressions, e.g. for baseclass=ModelA, myclass=ModelC
    # 'modelb__modelc" is returned
    def _create_base_path(baseclass, myclass):
        bases = myclass.__bases__
        for b in bases:
            if b == baseclass:
                return myclass.__name__.lower()
            path = _create_base_path(baseclass, b)
            if path:
                return path + '__' + myclass.__name__.lower()
        return ''

    basepath = _create_base_path(queryset_model, model)

    if negated:
        newpath = '-'
    else:
        newpath = ''

    newpath += basepath
    if basepath:
        newpath += '__'

    newpath += pure_field_path
    return newpath

def _create_model_filter_Q(modellist, not_instance_of=False, using=DEFAULT_DB_ALIAS):
    """
    Helper function for instance_of / not_instance_of
    Creates and returns a Q object that filters for the models in modellist,
    including all subclasses of these models (as we want to do the same
    as pythons isinstance() ).
    .
    We recursively collect all __subclasses__(), create a Q filter for each,
    and or-combine these Q objects. This could be done much more
    efficiently however (regarding the resulting sql), should an optimization
    be needed.
    """

    if not modellist:
        return None

    from .models import PolymorphicModel

    if type(modellist) != list and type(modellist) != tuple:
        if issubclass(modellist, PolymorphicModel):
            modellist = [modellist]
        else:
            assert False, 'PolymorphicModel: instance_of expects a list of (polymorphic) models or a single (polymorphic) model'

    def q_class_with_subclasses(model):
        q = Q(polymorphic_ctype=ContentType.objects.db_manager(using).get_for_model(model, for_concrete_model=False))
        for subclass in model.__subclasses__():
            q = q | q_class_with_subclasses(subclass)
        return q

    qlist = [q_class_with_subclasses(m) for m in modellist]

    q_ored = reduce(lambda a, b: a | b, qlist)
    if not_instance_of:
        q_ored = ~q_ored
    return q_ored

redpajama_set_name: RedPajamaGithub


text:
import classNames from "classnames/dedupe";
import React from "react";

class FullScreenModalHeader extends React.Component {
  render() {
    const { children, className } = this.props;
    const classes = classNames("modal-full-screen-header pod", className);

    return (
      <div className={classes}>
        {children}
      </div>
    );
  }
}

const classProps = React.PropTypes.oneOfType([
  React.PropTypes.array,
  React.PropTypes.object,
  React.PropTypes.string
]);

FullScreenModalHeader.propTypes = {
  children: React.PropTypes.node.isRequired,
  className: classProps
};

module.exports = FullScreenModalHeader;


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>Barrage</title>
	<link rel="stylesheet prefetch" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/style.css">

		弹幕墙

						<input type="text" placeholder="说点什么吧" class="form-control bar_text"/>

						<button type="button" class="btn btn-default s_sub">发射</button>
						<button type="button" class="btn btn-warning s_del">清屏</button>


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.umd.smile.demonstration;

import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;

import edu.umd.smile.demonstration.Demonstrator.HandId;
import edu.umd.smile.object.ObjectBondTracker.ObjectBond;

/**
 *
 * @author dwhuang
 */
public interface DemoActionListener {
    public void demoGrasp(HandId handId, Spatial s, Vector3f pos, Quaternion rot);
    public void demoRelease(HandId handId);
    public void demoDestroy(HandId handId);
	public void demoTrigger(HandId handId, Spatial s);
	public void demoPointTo(HandId handId, Spatial s);
	public void demoFasten(HandId handId, ObjectBond bond);
	public void demoLoosen(HandId handId, ObjectBond bond);
}


text:
<?php

namespace Oro\Bundle\DataGridBundle\Migrations\Data\ORM;

use Doctrine\Common\Persistence\ObjectManager;
use Oro\Bundle\EmailBundle\Migrations\Data\ORM\AbstractEmailFixture;
use Oro\Bundle\MigrationBundle\Fixture\VersionedFixtureInterface;

class LoadEmailTemplates extends AbstractEmailFixture implements VersionedFixtureInterface
{
    /**
     * {@inheritdoc}
     */
    public function getVersion()
    {
        return '1.1';
    }

    /**
     * {@inheritdoc}
     */
    protected function findExistingTemplate(ObjectManager $manager, array $template)
    {
        if (empty($template['params']['name'])) {
            return null;
        }

        return $manager->getRepository('OroEmailBundle:EmailTemplate')->findOneBy([
            'name' => $template['params']['name'],
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function getEmailsDir()
    {
        return $this->container
            ->get('kernel')
            ->locateResource('@OroDataGridBundle/Migrations/Data/ORM/emails');
    }
}


text:
typedef struct {
	int c;
	FILE *fp;
	int cnt;
	int n;
} doscan_t;

extern int _doscan(FILE*, const char*, __va_list);
extern int _doscan_next(doscan_t *);
extern int _doscan_double(doscan_t *, double *);

#endif


text:
from pymongo import MongoClient
from bson import ObjectId

from twisted.trial.unittest import TestCase

from tests.utils import ObjectMaker

from vusion.component import DialogueWorkerPropertyHelper
from vusion.persist import UnattachedMessageManager, UnattachedMessage

class testUnattachedMessage(TestCase, ObjectMaker):

    def setUp(self):
        self.database_name = 'test_program_db'

        c = MongoClient(w=1)
        db = c.test_program_db
        self.manager = UnattachedMessageManager(db, 'unattached_messages')

        #parameters:
        self.property_helper = DialogueWorkerPropertyHelper(None, None)
        self.property_helper['timezone'] = 'Africa/Kampala'
        self.manager.set_property_helper(self.property_helper)

    def tearDown(self):
        self.clearData()

    def clearData(self):
        self.manager.drop()

    def test_get_unattached_message(self):
        unattached = self.mkobj_unattach_message()
        unattached_id = self.manager.save(unattached)

        saved_unattached = self.manager.get_unattached_message(unattached_id)
        self.assertTrue(isinstance(saved_unattached, UnattachedMessage))

    def test_get_unattached_message_not_present(self):
        saved_unattached = self.manager.get_unattached_message(ObjectId())
        self.assertEqual(None, saved_unattached)

    def test_get_unattached_messages(self):
        unattached_future = self.mkobj_unattach_message(fixed_time='3200-01-01T10:10:10')
        unattached_id_future = self.manager.save(unattached_future)

        unattached_future = self.mkobj_unattach_message(fixed_time='1200-01-01T10:10:10')
        self.manager.save(unattached_future)

        unattacheds = self.manager.get_unattached_messages()

        self.assertEqual(1, unattacheds.count())
        unattached = unattacheds.next()
        self.assertEqual(unattached_id_future, unattached['_id'])

    def test_get_unattached_message_selector_tag(self):
        unattached_geek = self.mkobj_unattach_message(
            send_to_type='match',
            send_to_match_operator='all',
            send_to_match_conditions=['geek'])
        unattached_geek_id = self.manager.save(unattached_geek)

        unattached = self.mkobj_unattach_message()
        self.manager.save(unattached)

        unattacheds = self.manager.get_unattached_messages_selector_tag('geek')
        self.assertEqual(1, unattacheds.count())
        unattached = unattacheds.next()
        self.assertEqual(unattached_geek_id, unattached['_id'])


text:
module Syncro
  module Scriber
    class ScribeObserver
      include Singleton

      def after_create(scribe)
        sessions = scribe.to_sessions
        sessions.each {|c| c.add_scribe(scribe) }
      end

      def update(observed_method, object) #:nodoc:
        send(observed_method, object) if respond_to?(observed_method)
      end

      def observed_class_inherited(subclass) #:nodoc:
        subclass.add_observer(self)
      end
    end
  end
end

Syncro::Scriber::Scribe.add_observer(
  Syncro::Scriber::ScribeObserver.instance
)


text:
"""A setuptools based setup module.

See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
    long_description = f.read()

# Arguments marked as "Required" below must be included for upload to PyPI.
# Fields marked as "Optional" may be commented out.

setup(
    # This is the name of your project. The first time you publish this
    # package, this name will be registered for you. It will determine how
    # users can install this project, e.g.:
    #
    # $ pip install sampleproject
    #
    # And where it will live on PyPI: https://pypi.org/project/sampleproject/
    #
    # There are some restrictions on what makes a valid project name
    # specification here:
    # https://packaging.python.org/specifications/core-metadata/#name
    name='dg', # Required

    # Versions should comply with PEP 440:
    # https://www.python.org/dev/peps/pep-0440/
    #
    # For a discussion on single-sourcing the version across setup.py and the
    # project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version='1.0.0',  # Required

    # This is a one-line description or tagline of what your project does. This
    # corresponds to the "Summary" metadata field:
    # https://packaging.python.org/specifications/core-metadata/#summary
    description='python for deepgreen',   # Required

    # This is an optional longer description of your project that represents
    # the body of text which users will see when they visit PyPI.
    #
    # Often, this is the same as your README, so you can just read it in from
    # that file directly (as we have already done above)
    #
    # This field corresponds to the "Description" metadata field:
    # https://packaging.python.org/specifications/core-metadata/#description-optional
    long_description=long_description,  # Optional

    # This should be a valid link to your project's main homepage.
    #
    # This field corresponds to the "Home-Page" metadata field:
    # https://packaging.python.org/specifications/core-metadata/#home-page-optional
    url='https://github.com/vitesse-ftian/dgtools/py',   # Optional

    # This should be your name or the name of the organization which owns the
    # project.
    author='Feng Tian',   # Optional

    # This should be a valid email address corresponding to the author listed
    # above.
    author_email='ftian@vitessedata.com',   # Optional

    # Classifiers help users find your project by categorizing it.
    #
    # For a list of valid classifiers, see
    # https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[  # Optional
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 4 - Beta',

        # Indicate who your project is intended for
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Build Tools',

        # Pick your license as you wish
        'License :: OSI Approved :: MIT License',

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
    ],

    # This field adds keywords for your project which will appear on the
    # project page. What does your project relate to?
    #
    # Note that this is a string of words separated by whitespace, not a list.
    keywords='deepgreen', # Optional

    # You can just specify package directories manually here if your project is
    # simple. Or you can use find_packages().
    #
    # Alternatively, if you just want to distribute a single Python file, use
    # the `py_modules` argument instead as follows, which will expect a file
    # called `my_module.py` to exist:
    #
    #   py_modules=["my_module"],
    #
    packages=find_packages(exclude=['contrib', 'docs', 'tests']),  # Required

    # This field lists other packages that your project depends on to run.
    # Any package you put here will be installed by pip when your project is
    # installed, so they must be valid existing projects.
    #
    # For an analysis of "install_requires" vs pip's requirements files see:
    # https://packaging.python.org/en/latest/requirements.html
    install_requires=['psycopg2', 'tabulate'],   # Optional

    # List additional groups of dependencies here (e.g. development
    # dependencies). Users will be able to install these using the "extras"
    # syntax, for example:
    #
    #   $ pip install sampleproject[dev]
    #
    # Similar to `install_requires` above, these must be valid existing
    # projects.
    # extras_require={  # Optional
    #     'dev': ['check-manifest'],
    #     'test': ['coverage'],
    # },

    # If there are data files included in your packages that need to be
    # installed, specify them here.
    #
    # If using Python 2.6 or earlier, then these have to be included in
    # MANIFEST.in as well.
    # package_data={  # Optional
    #     'sample': ['package_data.dat'],
    # },

    # Although 'package_data' is the preferred approach, in some case you may
    # need to place data files outside of your packages. See:
    # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files
    #
    # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
    # data_files=[('my_data', ['data/data_file'])],  # Optional

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # `pip` to create the appropriate form of executable for the target
    # platform.
    #
    # For example, the following would provide a command called `sample` which
    # executes the function `main` from this package when invoked:
    # entry_points={  # Optional
    #     'console_scripts': [
    #         'sample=sample:main',
    #     ],
    # },
)


text:
<TITLE>Review for Lola rennt (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Lola rennt (1998)

reviewed by
Michael Elliott

Christian Critic's Movie Parables - http://www.christiancritic.com

RUN LOLA RUN
(LOLA RENNT)
In German w/English subtitles
*** out of **** stars
=============================

DIRECTED BY:      Tom Tykwer
STARRING:         Franka Potente, Moritz Bleibtreu, Herbert Knaup, Nina
Petri
WRITTEN BY:       Tom Tykwer
RATED:            R for sex, violence, and profanity
SCRIPTURE
REFERENCES:       2 Thessalonians 1:11, 1 Thessalonians 1:7, Titus 2:6-8

What we have here is a simple matter of style over substance. RUN LOLA
RUN, a 1998 German film which is beginning to make its way across the US,
playing in art houses and film festivals, does not have much of a story
but what it has, it tells very well.

Writer/director Tom Tykwer (WINTER SLEEPER) has taken a basic plot line,
multiplied it by three, added a techno-rock musical score and used many
inventive camera techniques to keep us riveted to the story (even though,
as I've said, there's not much of a story there.)

It all begins when Lola gets a phone call from her boyfriend, Manni.
Engaged in some shady drug deal, he finds himself owing 100,000 marks to a
man who would just as soon kill him as sneeze in his direction.  If Manni
doesn't come up with the money in 20 minutes, he's a dead man.  And with
that piece of information, Lola is off and running.

Dashing through the streets of Berlin, trying to think up a way to get
that kind of money that quickly, she rushes past people and events almost
without acknowledging their existence.

20 minutes later we see the outcome of her mad run and the results of the
decisions she made along the way.  The ending may disappoint many in the
audience but there's no need for despair.  The movie is a long way from
over.

Just like that, we're back at the phone call that began it all and once
again, Lola is off and running.  This time however, a slight delay in the
beginning results in some major differences down the road.  As we have
heard elsewhere, timing is everything.  Lola is forced to make decisions
she didn't have to make in the "first run" because she arrived at various
places a few seconds earlier or later.  Again, we play the story out to
its conclusion to find out what happens when the 20 minute deadline
expires.

Still not happy with the outcome?  Let us go back to the phone and again,
Lola will take off running.  And once again, slight changes early on in
the run have a major impact in the end result.  Clearly, the point being
made is that our lives consist of millions of such minuscule moments which
add to the overall course of our lives.  For the third time, we take the
story all the way to its ultimate conclusion.

What makes the movie work is the stylistic approach of Mr. Tykwer.  He
uses many camera tricks to heighten the enjoyment of the film.  Split
screen, stop action, slo-mo, animation mixed with live action...he
includes it all.  There is no getting bored with Mr. Tykwer at the helm of
the film.

The music by Reinhold Heil is techno rock at its best:  pounding bass,
rhythmic beat, and all.  During each run, there is no slowdown in the
action.  The urgency of the situation is pressed upon all we see.
However, in between each run are short segments with a calmer, more
intimate Lola and Manni, engaging in the silly and endearing pillow talk
of a couple obviously in love.

Franka Potente (AM I BEAUTIFUL?) is Lola, hair dyed an unnaturally red
color (which takes on the look of flames streaming off her head as she
runs full blast through the streets of Berlin.)  With a scream that could
(and does) shatter glass, Lola is truly a memorable character.

One of the themes that runs throughout the film is the impact our lives
have with others even though we may only slightly interact with them.
Whether we are aware of it or not, we leave a mark wherever we go.
Whether that mark is a good one, inspiring and encouraging to others, or a
negative one, harmful and detrimental to others, is entirely up to us and
the way we conduct our lives.

God commands us to behave ourselves worthy of His calling, as His
ambassadors on this earth.  The impression we make should remind others of
the glory and goodness of God.  Lola and Manni are not God's
representatives, nor do they present themselves as such.  But they do
illustrate how one life can affect many others.  If they leave negative
impacts, we can leave positive ones.  All it takes is an awareness and a
willingness to live for God and the fortitude to do it.

Michael Elliott
August, 1999
http://www.christiancritic.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
import { Api } from '../../api/index'
import c3 from 'c3'
import * as Utils from '../utils.js'
import _ from 'lodash'
import events from 'events'

export class ChartComponent extends events.EventEmitter {
  constructor() {
    super();

    this._api = null;

    this.wrapper = null;
    this.chart = null;
    this.downloader = null;
    this.formatValue = null;

    // Prevent from throwing exception in EventEmitter
    this.on('error', (sender, error) => {
      console.trace(error);
    });
  }

  getApiInstance() {
    if (!this._api) {
      this._api = new Api();
    }
    this._api.downloader = this.downloader;
    return this._api;
  }

  getValueFormatter(currency) {
    var formatValue = this.formatValue;
    if (!_.isFunction(formatValue)) {
      formatValue = Utils.defaultFormatValue;
    }
    return function(value) {
      return Utils.moneyFormat(formatValue(value), currency);
    };
  }

  build(chartType, endpoint, cube, params, wrapper, colorScale, model) {
    params = _.cloneDeep(params);

    var that = this;
    this.wrapper = wrapper;

    if (colorScale === undefined) {
      colorScale = Utils.defaultColorScale();
    }

    that.emit('loading', that);

    if (chartType == 'line') {
      params.order = params.order || [{key: _.first(params.group), direction: ':asc'}];
    }

    var series;
    var groupFields = _.first(params.group);
    if (params.series) {
      params.group = _.union(params.group, params.series);
      series = _.first(params.series);
      params.series = undefined;
      params.order = params.order || [
        {key: series, direction: 'asc'},
        {key: params.aggregates, direction: 'desc'}
      ];
    }

    if (series && chartType == 'line') {
      chartType = 'area';
    }

    params.page = 0;
    params.pagesize = 2000;

    var api = this.getApiInstance();
    api.aggregate(endpoint, cube, params, model)
      .then((data) => {
        var columns = Utils.buildC3Columns(data, groupFields, series, params.aggregates);
        var types = {};
        var c3Groups = _.map(_.slice(columns, 1), (column) => {return column[0]});
        var showLegend = (c3Groups.length > 1);
        _.each(_.slice(columns, 1), (column) => {
          types[column[0]] = chartType;
        });

        var currency = data.currency[params.aggregates];
        var valueFormat = that.getValueFormatter(currency);

        var colors = {};
        _.each(columns, (value, index) => {
          colors[value[0]] = colorScale(index);
        });

        that.chart = c3.generate({
          bindto: that.wrapper,
          data: {
            names: Utils.buildC3BarNames(data, params.aggregates),
            columns: columns,
            color: colors,
            type: chartType || 'bar',
            x: _.first(_.first(columns)),
            groups: [c3Groups],
            types: types,
            onclick: (d, element) => {
              that.emit('click', that, d);
            }
          },
          point: {
            show: false
          },
          grid: {
            focus: {
              show: false
            }
          },
          axis: {
            x: {
              type: 'category',
              tick: {
                culling: true,
                fit: true
              }
            },
            y: {
              tick: {
                format: valueFormat,
                culling: true,
                fit: true
              },
              lines: [{value: 0}]
            }
          },
          tooltip: {
            format: {
              value: valueFormat
            }
          },
          legend: {
            show: showLegend
          }
        });

        that.emit('loaded', that, data);
        that.emit('ready', that, data, null);
      })
      .catch((error) => {
        that.emit('error', that, error);
        that.emit('ready', that, null, error);
      });
  }
}

export default ChartComponent


text:
namespace WinAppDriver.Handlers
{
    using System.Collections.Generic;
    using System.Windows.Automation;
    using WinAppDriver.UI;

    [Route("GET", "/session/:sessionId/source")]
    internal class GetSourceHandler : IHandler
    {
        private IUIAutomation uiAutomation;

        public GetSourceHandler(IUIAutomation uiAutomation)
        {
            this.uiAutomation = uiAutomation;
        }

        public object Handle(Dictionary<string, string> urlParams, string body, ref ISession session)
        {
            var start = session.FocusOnCurrentWindow ?
                this.uiAutomation.GetFocusedWindowOrRoot() :
                AutomationElement.RootElement;
            return this.uiAutomation.DumpXml(start);
        }
    }
}


text:
<?php

namespace Whoisdoma\WhoisParser\Templates;

use Whoisdoma\WhoisParser\Templates\Type\Regex;

class Tr extends Regex
{

    /**
	 * Blocks within the raw output of the whois
	 *
	 * @var array
	 * @access protected
	 */
    protected $blocks = array(
            1 => '/registrant:\n(.*?)(?=\*\* (administrative contact|registrar))/is',
            2 => '/administrative contact:\n(.*?)(?=technical contact)/is',
            3 => '/technical contact:\n(.*?)(?=billing contact)/is',
            4 => '/billing contact:\n(.*?)(?=domain servers)/is',
            5 => '/domain servers:\n(.*?)(?=\*\* additional info)/is',
            6 => '/additional info:\n(.*?)$/is');

    /**
	 * Items for each block
	 *
	 * @var array
	 * @access protected
	 */
    protected $blockItems = array(1 => array('/registrant:\n(.+)$/is' => 'contacts:owner:address'),
            2 => array('/nic handle(?>[\x20\t]*): (.+)$/im' => 'contacts:admin:handle',
                    '/organization name(?>[\x20\t]*): (.*)$/im' => 'contacts:admin:organization',
                    '/address(?>[\x20\t]*): (.+)(?=phone)/is' => 'contacts:admin:address',
                    '/phone(?>[\x20\t]*): (.+)$/im' => 'contacts:admin:phone',
                    '/fax(?>[\x20\t]*): (.+)$/im' => 'contacts:admin:fax'),
            3 => array('/nic handle(?>[\x20\t]*): (.+)$/im' => 'contacts:tech:handle',
                    '/organization name(?>[\x20\t]*): (.*)$/im' => 'contacts:tech:organization',
                    '/address(?>[\x20\t]*): (.+)(?=phone)/is' => 'contacts:tech:address',
                    '/phone(?>[\x20\t]*): (.+)$/im' => 'contacts:tech:phone',
                    '/fax(?>[\x20\t]*): (.+)$/im' => 'contacts:tech:fax'),
            4 => array('/nic handle(?>[\x20\t]*): (.+)$/im' => 'contacts:billing:handle',
                    '/organization name(?>[\x20\t]*): (.*)$/im' => 'contacts:billing:organization',
                    '/address(?>[\x20\t]*): (.+)(?=phone)/is' => 'contacts:billing:address',
                    '/phone(?>[\x20\t]*): (.+)$/im' => 'contacts:billing:phone',
                    '/fax(?>[\x20\t]*): (.+)$/im' => 'contacts:billing:fax'),
            5 => array('/\n(?>[\x20\t]*)(.+)$/im' => 'nameserver'),
            6 => array('/created on(?>[\.]*): (.+)$/im' => 'created',
                    '/expires on(?>[\.]*): (.+)$/im' => 'expires'));

    /**
     * RegEx to check availability of the domain name
     *
     * @var string
     * @access protected
     */
    protected $available = '/No match found for/i';

    /**
     * After parsing do something
     *
     * Fix contact addresses
     *
     * @param  object &$WhoisParser
     * @return void
     */
    public function postProcess(&$WhoisParser)
    {
        $ResultSet = $WhoisParser->getResult();

        foreach ($ResultSet->contacts as $contactType => $contactArray) {
            foreach ($contactArray as $contactObject) {
                $contactObject->address = explode("\n", trim($contactObject->address));
                $contactObject->address = array_map('trim', $contactObject->address);

                if ($contactType === 'owner') {
                    $contactObject->organization = $contactObject->address[0];
                    $contactObject->phone = $contactObject->address[6];
                    $contactObject->fax = $contactObject->address[7];
                    $contactObject->country = $contactObject->address[4];
                    $contactObject->city = $contactObject->address[2];
                    $contactObject->email = $contactObject->address[5];
                    $contactObject->address = $contactObject->address[1];
                } else {
                    if (sizeof($contactObject->address) === 4) {
                        $contactObject->country = $contactObject->address[3];
                        $contactObject->city = $contactObject->address[2];
                    }

                    $contactObject->address = $contactObject->address[0];
                }
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="ShcpParEgrRecienNacido" table="shcp_par_egr_recien_nacido">
    <indexes>
      <index name="IDX_9E873A8F7DFA12F6" columns="id_establecimiento"/>
      <index name="IDX_9E873A8FD766E548" columns="id_admision_parto"/>
    </indexes>
    <id name="id" type="integer" column="id">
      <generator strategy="SEQUENCE"/>
    </id>
    <field name="egrnOrden" type="string" column="egrn_orden" nullable="true"/>
    <field name="egrnCondicion" type="string" column="egrn_condicion" nullable="true"/>
    <field name="egrnFalleceTraslado" type="string" column="egrn_fallece_traslado" nullable="true"/>
    <field name="egrnEdad" type="integer" column="egrn_edad" nullable="true"/>
    <field name="egrnMenor1dia" type="string" column="egrn_menor_1dia" nullable="true"/>
    <field name="egrnFecha" type="date" column="egrn_fecha" nullable="true"/>
    <field name="egrnHora" type="time" column="egrn_hora" nullable="true"/>
    <field name="egrnNombre" type="string" column="egrn_nombre" length="100" nullable="true"/>
    <field name="egrnApellido" type="string" column="egrn_apellido" length="100" nullable="true"/>
    <field name="egrnResponsa" type="bigint" column="egrn_responsa" nullable="true"/>
    <field name="egrnAlimentoAlta" type="string" column="egrn_alimento_alta" nullable="true"/>
    <field name="egrnBocaArriba" type="string" column="egrn_boca_arriba" nullable="true"/>
    <field name="egrnBcg" type="string" column="egrn_bcg" nullable="true"/>
    <field name="egrnPeso" type="integer" column="egrn_peso" nullable="true"/>
    <many-to-one field="idAdmisionParto" target-entity="ShcpParAdmision">
      <join-columns>
        <join-column name="id_admision_parto" referenced-column-name="id"/>
      </join-columns>
    </many-to-one>
    <many-to-one field="idEstablecimiento" target-entity="CtlEstablecimiento">
      <join-columns>
        <join-column name="id_establecimiento" referenced-column-name="id"/>
      </join-columns>
    </many-to-one>
  </entity>
</doctrine-mapping>


text:
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package google.registry.flows.exceptions;

import google.registry.flows.EppException.ParameterValuePolicyErrorException;

/** Domain transfer period must be one year. */
public class TransferPeriodMustBeOneYearException extends ParameterValuePolicyErrorException {
  public TransferPeriodMustBeOneYearException() {
    super("Domain transfer period must be one year");
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beih. Nova Hedwigia 59: 489 (1979)

#### Original name
Rhodophyllus eudermus Romagn. & Gilles

### Remarks
null


text:
namespace Steinberg {

//------------------------------------------------------------------------
// CPU Info
//------------------------------------------------------------------------
FCpuInfo::FCpuInfo()
: numLogical (0)
, numAvailable (0)
{
	initialize ();
}

//------------------------------------------------------------------------
FCpuInfo::~FCpuInfo()
{
}

//------------------------------------------------------------------------
void FCpuInfo::initialize ()
{
#if WINDOWS
	SYSTEM_INFO sinfo;
	GetSystemInfo (&sinfo);
	numLogical = sinfo.dwNumberOfProcessors;

	DWORD_PTR processAffinityMask = 0;
	DWORD_PTR systemAffinityMask = 0;
	if (GetProcessAffinityMask (GetCurrentProcess (), &processAffinityMask, &systemAffinityMask))
	{
		while (processAffinityMask != 0)
		{
			if (processAffinityMask & (DWORD_PTR) 1)
				numAvailable++;
			processAffinityMask >>= 1;
		}
	}

#elif MAC
	size_t len = sizeof (int);
	int value = 0;
	sysctlbyname ("hw.ncpu", &value, &len, NULL, 0);
	numLogical = value;
	sysctlbyname ("hw.availcpu", &value, &len, NULL, 0);
	numAvailable = value;
#endif
}

//------------------------------------------------------------------------
bool FCpuInfo::isLogicalAvailable (int32 index)
{
#if WINDOWS
	if (index >= numLogical)
		return false;

	DWORD_PTR processAffinityMask = 0;
	DWORD_PTR systemAffinityMask = 0;
	if (GetProcessAffinityMask (GetCurrentProcess (), &processAffinityMask, &systemAffinityMask))
		return (processAffinityMask & ((DWORD_PTR) 1 << index)) > 0;

	return false;
#elif MAC
	return (index < numAvailable);
#endif
}

} // namespace


text:
PKG_NAME=$(python setup.py --name)
PKG_VERSION=$(python setup.py --version)

git tag -am "release v${PKG_VERSION}" v${PKG_VERSION}
git push --tags
python setup.py sdist upload -r https://pypi.python.org/pypi


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Continuum</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="css/normalize.css" media="screen">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="css/stylesheet.css" media="screen">
    <link rel="stylesheet" type="text/css" href="css/light.css" media="screen">

    <link rel="apple-touch-icon" sizes="57x57" href="img/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="img/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="img/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="img/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="img/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="img/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="img/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="img/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="img/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192"  href="img/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="img/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="img/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">

Continuum

A range or series of things that are slightly different from each other and that exist between two different possibilities

      View on GitHub
      Download .zip
      Download .tar.gz

Continuum

A tool for storing and analyzing large amounts of time based data

        Core Library

                Storage,
                Retrieval, Analysis of Time Data

Documented

Tested

Covered

REST Interface

Backup / Restore

Streaming Replication

master/slave

master/master

MIT Licensed

Project Goals

 Presentation:

    PDF
    HTML

200k writes per second forever on commodity hardware

Memory mapped files, Log-Structured-Merge trees for storage and retreival

Leverage existing technologies: RocksDB, LevelDB, BerkeleyDB

Downsample for disk space efficiency

Continuous, scalable, infinite time data stream using windowing, downsampling, or both

Specialized schema design for time series and time key data

Atom

Contract (Fusion/Fission)

Time Series

Space/Time: Analysis, Dashboard/UI

Small number of unique time series with very large data volume (millions to trillions)

Infinite storage using retention policies and downsampling (RRDTool, Whisper, InfluxDB inspired)

Downsampling OK

Example: "Realtime" performance metrics, measurements of cpu, or weather temperature readings over time

Time Key Value

Time/key:value: User Session and Session Metrics

Large number of unique keys with smaller amount of data (10s to 1000s)

For aggregating data by a unique key

Stream to cold storage over time

Fast data (SSD): hot, newest data

Slow data: rolling window of data through ColdStorage (S3, Hadoop, NAS)

Example: "Realtime" analytics data events grouped by session or user id

Build and Install

 make

or

./gradlew install

Maven

    <dependency>
        <groupId>continuum</groupId>
        <artifactId>core</artifactId>
        <version>0.+</version>
    </dependency>

Gradle

compile 'continuum:core:0.+'

API

Creating Atoms

        // open continuum
        Continuum continuum = continuum().open()

        // create an atom
        Atom atom = continuum.atom()
                        .name('temp')
                        .particles(city:'lax', state:'ca', country:'us')
                        .value(99.5)
                        .build()

        continuum.write(atom)

Scans and Slices

        // scan continuum and get a slice of the atoms
        Slice slice =
            continuum.slice(
                scan('temp')                            // temp series
                    .function(Function.AVG)             // average temperature
                    .particles(country: 'us')           // where country = us
                    .group('state', 'city')             // group by state, city
                    .end(Interval.valueOf('10d'))       // last 10 days of atoms
                    .interval(Interval.valueOf('1d'))   // in 1 day intervals
                    .build())

        Values values = slice.values()                  // {min,max,count,sum,value}
        List<Slice> groups = slice.slices()                    // {ca:values,lax:values}

        continuum.close()

Scaling

Add disks

Cold online backup (backup/restore)

Hot online backup(s) (read-only replication)

Application level sharding by key or time

Cluserting (master-master replication)

Authors

Zack Bartel (@zackb), and Matt Johnson (@mj-dlvr) work on Continuum.

Hacking

We love contributions. For now please open an issue or contact me

        Continuum is maintained by zackb
        Copyright DLVR


text:
<html ng-app="thLazyDemo">
  <body>
    <th-lazy src="/components/thLazy/examples/1 - Simple/thLazyExampleTemplate.html">
    </th-lazy>
  </body>
</html>


text:
Memory saving JSON merge for Ruby.

Using picojson parsing JSON.

[kazuho / picojson](https://github.com/kazuho/picojson)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'picojson_ruby'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install picojson_ruby

## Usage

### append
Add JSON for one item.

```
p PicojsonRuby.append("{}", "key", "value")
# => "{\"key\":\"value\"}"
```

### merge
Under Development

## Contributing

1. Fork it ( https://github.com/[my-github-username]/picojson_ruby/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request


text:
package factories

import (
	sourcetypes "github.com/maximilien/kn-source-pkg/pkg/types"
	"k8s.io/client-go/rest"
	"knative.dev/client-contrib/plugins/source-kafka/pkg/types"
)

// source_factory

func (f *kafkaClientFactory) KafkaSourceClient() types.KafkaSourceClient {
	return f.kafkaSourceClient
}

func (f *kafkaClientFactory) KnSourceParams() *sourcetypes.KnSourceParams {
	return f.CreateKnSourceParams()
}

func (f *kafkaClientFactory) CreateKnSourceParams() *sourcetypes.KnSourceParams {
	if f.kafkaSourceParams == nil {
		f.initKafkaSourceParams()
	}
	return f.kafkaSourceParams.KnSourceParams
}

func (f *kafkaClientFactory) CreateKnSourceClient(restConfig *rest.Config, namespace string) sourcetypes.KnSourceClient {
	f.CreateKafkaSourceClient(restConfig, namespace)
	return f.KafkaSourceClient()
}

// rune_factory

func (f *kafkaSourceRunEFactory) KnSourceParams() *sourcetypes.KnSourceParams {
	return f.KafkaSourceFactory().KnSourceParams()
}

func (f *kafkaSourceRunEFactory) KnSourceClient(restConfig *rest.Config, namespace string) sourcetypes.KnSourceClient {
	return f.KafkaSourceFactory().CreateKnSourceClient(restConfig, namespace)
}

func (f *kafkaSourceRunEFactory) KnSourceFactory() sourcetypes.KnSourceFactory {
	return f.kafkaSourceFactory
}

// flags_factory

func (f *kafkaSourceFlagsFactory) KnSourceFactory() sourcetypes.KnSourceFactory {
	return f.kafkaSourceFactory
}

func (f *kafkaSourceFlagsFactory) KnSourceParams() *sourcetypes.KnSourceParams {
	return f.kafkaSourceFactory.KnSourceParams()
}

// command_factory
func (f *kafkaSourceCommandFactory) KnSourceFactory() sourcetypes.KnSourceFactory {
	return f.kafkaSourceFactory
}

func (f *kafkaSourceCommandFactory) KnSourceParams() *sourcetypes.KnSourceParams {
	return f.kafkaSourceFactory.KnSourceParams()
}


text:
package org.jetbrains.idea.eclipse;

public class EclipseLinkedResourcesTest extends EclipseVarsTest{
  @Override
  protected String getRelativeTestPath() {
    return "linked";
  }

  public void testResolvedVars() throws Exception {
    EclipseClasspathTest.doTest("/test", getProject());
  }

  public void testResolvedVarsInOutput() throws Exception {
    EclipseClasspathTest.doTest("/test", getProject());
  }

  public void testResolvedVarsInIml() throws Exception {
    EclipseImlTest.doTest("/test", getProject());
  }

  public void testResolvedVarsInOutputImlCheck() throws Exception {
    EclipseImlTest.doTest("/test", getProject());
  }

  public void testResolvedVarsInLibImlCheck() throws Exception {
    EclipseImlTest.doTest("/test", getProject());
  }

  public void testResolvedVarsInLibImlCheck1() throws Exception {
    EclipseClasspathTest.doTest("/test", getProject());
  }
}


text:
#import "RCTBundleURLProvider.h"
#import "RCTDefines.h"
#import "RCTConvert.h"

NSString *const RCTBundleURLProviderUpdatedNotification = @"RCTBundleURLProviderUpdatedNotification";

static NSString *const kRCTJsLocationKey = @"RCT_jsLocation";
static NSString *const kRCTEnableLiveReloadKey = @"RCT_enableLiveReload";
static NSString *const kRCTEnableDevKey = @"RCT_enableDev";
static NSString *const kRCTEnableMinificationKey = @"RCT_enableMinification";

static NSString *const kDefaultPort = @"8081";
static NSString *ipGuess;

@implementation RCTBundleURLProvider

#if RCT_DEV
+ (void)initialize
{
  NSString *ipPath = [[NSBundle mainBundle] pathForResource:@"ip" ofType:@"txt"];
  NSString *ip = [NSString stringWithContentsOfFile:ipPath encoding:NSUTF8StringEncoding error:nil];
  ipGuess = [ip stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
}
#endif

- (instancetype)init
{
  self = [super init];
  if (self) {
    [self setDefaults];
  }
  return self;
}

- (NSDictionary *)defaults
{
  return @{
    kRCTEnableLiveReloadKey: @NO,
    kRCTEnableDevKey: @YES,
    kRCTEnableMinificationKey: @NO,
  };
}

- (void)settingsUpdated
{
  [[NSNotificationCenter defaultCenter] postNotificationName:RCTBundleURLProviderUpdatedNotification object:self];
}

- (void)setDefaults
{
  [[NSUserDefaults standardUserDefaults] registerDefaults:[self defaults]];
  [self settingsUpdated];
}

- (void)resetToDefaults
{
  for (NSString *key in [[self defaults] allKeys]) {
    [[NSUserDefaults standardUserDefaults] removeObjectForKey:key];
  }
  [self setDefaults];
}

- (BOOL)isPackagerRunning:(NSString *)host
{
  if (RCT_DEV) {
    NSURL *url = [[NSURL URLWithString:serverRootWithHost(host)] URLByAppendingPathComponent:@"status"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    NSURLResponse *response;
    NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:NULL];
    NSString *status = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    return [status isEqualToString:@"packager-status:running"];
  }
  return NO;
}

static NSString *serverRootWithHost(NSString *host)
{
  return [NSString stringWithFormat:@"http://%@:%@/", host, kDefaultPort];
}

- (NSString *)guessPackagerHost
{
  NSString *host = ipGuess ?: @"localhost";
  if ([self isPackagerRunning:host]) {
    return host;
  }
  return nil;
}

- (NSString *)packagerServerRoot
{
  NSString *location = [self jsLocation];
  if (location != nil) {
    return serverRootWithHost(location);
  } else {
    NSString *host = [self guessPackagerHost];
    if (!host) {
      return nil;
    } else {
      return serverRootWithHost(host);
    }
  }
}

- (NSURL *)packagerServerURL
{
  NSString *root = [self packagerServerRoot];
  return root ? [NSURL URLWithString:root] : nil;
}

- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackResource:(NSString *)resourceName
{
  resourceName = resourceName ?: @"main";
  NSString *serverRoot = [self packagerServerRoot];
  if (!serverRoot) {
    return [[NSBundle mainBundle] URLForResource:resourceName withExtension:@"jsbundle"];
  } else {
    NSString *fullBundlePath = [serverRoot stringByAppendingFormat:@"%@.bundle", bundleRoot];
    if ([fullBundlePath hasPrefix:@"http"]) {
      NSString *dev = [self enableDev] ? @"true" : @"false";
      NSString *min = [self enableMinification] ? @"true": @"false";
      fullBundlePath = [fullBundlePath stringByAppendingFormat:@"?platform=ios&dev=%@&minify=%@", dev, min];
    }
    return [NSURL URLWithString:fullBundlePath];
  }
}

- (void)updateDefaults:(id)object forKey:(NSString *)key
{
  [[NSUserDefaults standardUserDefaults] setObject:object forKey:key];
  [[NSUserDefaults standardUserDefaults] synchronize];
  [self settingsUpdated];
}

- (BOOL)enableDev
{
  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableDevKey];
}

- (BOOL)enableLiveReload
{
  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableLiveReloadKey];
}

- (BOOL)enableMinification
{
  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableMinificationKey];
}

- (NSString *)jsLocation
{
  return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTJsLocationKey];
}

- (void)setEnableDev:(BOOL)enableDev
{
  [self updateDefaults:@(enableDev) forKey:kRCTEnableDevKey];
}

- (void)setEnableLiveReload:(BOOL)enableLiveReload
{
  [self updateDefaults:@(enableLiveReload) forKey:kRCTEnableLiveReloadKey];
}

- (void)setJsLocation:(NSString *)jsLocation
{
  [self updateDefaults:jsLocation forKey:kRCTJsLocationKey];
}

- (void)setEnableMinification:(BOOL)enableMinification
{
  [self updateDefaults:@(enableMinification) forKey:kRCTEnableMinificationKey];
}

+ (instancetype)sharedSettings
{
  static RCTBundleURLProvider *sharedInstance;
  static dispatch_once_t once_token;
  dispatch_once(&once_token, ^{
    sharedInstance = [RCTBundleURLProvider new];
  });
  return sharedInstance;
}
@end


text:
package com.lht.dot.logic;

import com.lht.common.base.ILogic;
import com.lht.dot.module.models.model.Collection;

import java.util.List;

/**
 * Created by lht-Mac on 2017/7/9.
 */

public interface ICollectionListLogic extends ILogic {

    int PAGE_FORWARD = 1, PAGE_BACK = -1;
    int PAGE_START = 1, PAGE_LIMIT = 20;

    int MSG_COLLECTION_LIST_LOAD_SUCCESS = LogicMessageIdBaseConst.MSG_COLLECTIONS_LIST + 1;
    int MSG_COLLECTION_LIST_LOAD_FAILED = LogicMessageIdBaseConst.MSG_COLLECTIONS_LIST + 2;

    void loadCollectionList(int page);

    List<Collection> getCollectionList();

    void page(int step);

    int getPage();
}


text:
package tv.camfire.jetty.server.session

import com.redis.RedisClientPool

/**
 * User: jonathan
 * Date: 7/29/13
 * Time: 7:20 PM
 */
class RedisClientFactory(redisHost: String = "localhost",
                         redisPort: Int = 6379,
                         val sessionKeyPrefix: String = ""
                          ) {

  def create(): RedisClientPool = {
    new RedisClientPool(redisHost, redisPort)
  }
}


text:
[![Stories in Ready](https://badge.waffle.io/NobleBarnacle/beer-tab.png?label=ready&title=Ready)](https://waffle.io/NobleBarnacle/beer-tab)
# BEER TAB

An app that allows friends to keep track of beers that they owe each other.

## Table of Contents

1. [Team](#team)
2. [Usage](#Usage)
3. [Requirements](#requirements)
4. [Development](#development)
    i. [Installing Dependencies](#installing-dependencies)
    ii. [Roadmap](#roadmap)
1. [Contributing](#contributing)

## Team

  - __Product Owner__: Nate Meier
  - __Scrum Master__: Andrés Viesca
  - __Development Team Members__: Steven Wu, Michael Kurrels

## Usage

Users type in the name of a friend to whom they owe a beer. The beer recipient is made aware that they
are owed a beer in their personal tab network. Users can confirm that they have recieved the beer that
they were owed using the "Receive" button. Additionally, users can use the "Owe" button to notify a contact
that they owe them another beer.

## Requirements

### node_modules: Production
- bcrypt-nodejs 0.0.3
- bluebird  2.9.34
- body-parser  1.13.3
- express  4.13.3
- jwt-simple  0.3.0
- mongodb  2.0.40
- mongoose  4.1.2
- morgan  1.6.1
- request  2.60.0

### node_modules: Development
- grunt  0.4.5
- grunt-contrib-concat  0.5.1
- grunt-contrib-cssmin  0.13.0
- grunt-contrib-jshint  0.11.2
- grunt-contrib-uglify  0.9.1
- grunt-contrib-watch  0.6.1
- grunt-mocha-test  0.12.7
- grunt-nodemon  0.4.0
- grunt-shell  1.1.2
- mocha  2.2.5

### bower_components
- angular  ~1.4.3
- bootstrap  ~3.3.5
- angular-ui-router  ~0.2.13
- ng-table  ~0.8.3
- angular-jwt  ~0.0.9

## Development

### Installing Dependencies

Type these commands to get started:

1. `npm install` node dependencies
2. `bower install` bower dependencies
3. `npm install -g grunt-cli` grunt command line integration
4. `brew install mongodb` if you need to install mongoDB client
5. create `/data/db` folder at root directly if it doesn't exist already
6. run `mongod` process from the terminal
7. run `grunt build` to compile everything
8. run `grunt server-dev` to initiate grunt watch process

### Roadmap

View the project roadmap on waffle.io [here](https://waffle.io/viridescentgrizzly/beer-tab).

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.


text:
'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var Payload = new Schema({
	first: {
		type: String,
		required: true
	},
	second: {
		type: String,
		required: true
	}
});

module.exports = mongoose.model('payload', Payload);


text:
/** \file test_fft.h
  *
  * \brief Describes functions exported by test_fft.c.
  *
  * This file is licensed as described by the file LICENCE.
  */

#ifndef LPC11UXX_TEST_FFT_H_INCLUDED
#define LPC11UXX_TEST_FFT_H_INCLUDED

#ifdef TEST_FFT
extern void testFFT(void);
#endif // #ifdef TEST_FFT

#endif // #ifndef LPC11UXX_TEST_FFT_H_INCLUDED


text:
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    dotEnv: {
      clientAllowedKeys: ['PASSCODE'],
      path: {
        development: '.env',
        test: '.env',
        production: '.env.production'
      }
    }
  });

  // Use `app.import` to add additional libraries to the generated
  // output files.
  //
  // If you need to use different assets in different
  // environments, specify an object as the first parameter. That
  // object's keys should be the environment name and the values
  // should be the asset to use in that environment.
  //
  // If the library that you are including contains AMD or ES6
  // modules that you would like to import into your application
  // please specify an object with the list of modules as keys
  // along with the exports of each module as its value.

  return app.toTree();
};


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Sporormia petasoniformis Moreau

### Remarks
null


text:
Pinpoint saves additional information(transactionId, spanId) in log messages to classify them by request.

When tomcat processes multiple requests concurrently, we can see log files printed in chronological order.
But we can not classify them by each request.
For example when an exception message is logged, we can not easily identify all the logs related to the request that threw the exception.

Pinpoint is able to classify logs by requests by storing additional information(transactionId, spanId) in MDC of each request.
The transactionId printed in the log message is the same as the transactionId in Pinpoint Web's Transaction List view.

Let's take a look at a more specific example.
The log below is from an exception that occurred without using Pinpoint.
As you can see, it is hard to identify the logs related to the request that threw the exception.
ex) Without Pinpoint
```
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76 ) get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123 ) get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) get content name : SPORTS
2015-04-04 14:35:20 [INFO](ContentInfoCollector:25 ) get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:56 ) get content name : NATIONAL
2015-04-04 14:35:20 [INFO](ContentInfoCollector:34 ) get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoService:55 ) check authorization of user
2015-04-04 14:35:20 [INFO](ContentInfoService:14 ) get title of content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14 ) execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114 ) execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:74 ) get top linking for content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14 ) execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114 ) execute query ...
2015-04-04 14:35:22 [INFO](ContentDAOImpl:186 ) execute query ...
2015-04-04 14:35:22 [ERROR]ContentDAOImpl:158 )
     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
          at example.ContentDAO.executequery(ContentDAOImpl.java:152)
          ...
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
          ...
     Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure The last packet sent successfully to the server was 0 milliseconds ago.
     The driver has not received any packets from the server.
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
          ... 12 more
     Caused by: java.net.ConnectException: Connection refused
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
          at java.net.Socket.connect(Socket.java:529)
          ...13 more
2015-04-04 14:35:22 [INFO](ContentDAO:145 ) execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:38 ) update hits for content
2015-04-04 14:35:20 [INFO](ContentInfoService:89 ) check of user
2015-04-04 14:35:24 [INFO](ContentDAO:146 ) execute query ...
2015-04-04 14:35:25 [INFO](ContentDAO:123 ) execute query ...
```

Pinpoint classifies logs by requests by storing additional information(transactionId, spanId) in MDC of each request.
ex) With Pinpoint
```
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76) [txId : agent^14252^17 spanId : 1224] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123) [txId : agent^142533^18 spanId : 1231] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) [txId : agent^142533^19 spanId : 1246] get content name : SPORTS
2015-04-04 14:35:20 [INFO](ContentInfoCollector:25) [txId : agent^142533^20 spanId : 1263] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:56) [txId : agent^142533^21 spanId : 1265] get content name : NATIONAL
2015-04-04 14:35:20 [INFO](ContentInfoCollector:34) [txId : agent^142533^22 spanId : 1278] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoService:55) [txId : agent^14252^18 spanId : 1231] check authorization of user
2015-04-04 14:35:20 [INFO](ContentInfoService:14) [txId : agent^14252^17 spanId : 1224] get title of content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14) [txId : agent^14252^17 spanId : 1224] execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114) [txId : agent^142533^19 spanId : 1246] execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:74) [txId : agent^14252^17 spanId : 1224] get top linking for content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14) [txId : agent^142533^18 spanId : 1231] execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114) [txId : agent^142533^21 spanId : 1265] execute query ...
2015-04-04 14:35:22 [INFO](ContentDAOImpl:186) [txId : agent^142533^22 spanId : 1278] execute query ...
2015-04-04 14:35:22 [ERROR](ContentDAOImpl:158) [txId : agent^142533^18 spanId : 1231]
     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
          at com.pinpoint.example.dao.ContentDAO.executequery(ContentDAOImpl.java:152)
          ...
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
          ...
     Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure The last packet sent successfully to the server was 0 milliseconds ago.
     The driver has not received any packets from the server.
          ...
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
          ... 12 more
     Caused by: java.net.ConnectException: Connection refused
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
          at java.net.Socket.connect(Socket.java:529)
          ... 13 more
2015-04-04 14:35:22 [INFO](ContentDAO:145) [txId : agent^14252^17 spanId : 1224] execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:38) [txId : agent^142533^19 spanId : 1246] update hits for content
2015-04-04 14:35:20 [INFO](ContentInfoService:89) [txId : agent^142533^21 spanId : 1265] check of user
2015-04-04 14:35:24 [INFO](ContentDAO:146) [txId : agent^142533^22 spanId : 1278] execute query ...
2015-04-04 14:35:25 [INFO](ContentDAO:123) [txId : agent^14252^17 spanId : 1224] execute query ...
```

The transactionId printed in the log message is the same as the transactionId in Pinpoint Web's Transaction List view.
![per-request_feature_1.jpg](img/per-request_feature_1.jpg)

### 2. How to configure

**2-1 Pinpoint agent configuration**

To enable this feature, set the logging property corresponding to the logging library in use to true in *pinpoint.config*.
For example,

ex) pinpoint.config when using log4j
```
###########################################################
# log4j
###########################################################
profiler.log4j.logging.transactioninfo=true

###########################################################
# logback
###########################################################
profiler.logback.logging.transactioninfo=false
```

ex) pinpoint.config when using logback
```
###########################################################
# log4j
###########################################################
profiler.log4j.logging.transactioninfo=false

###########################################################
# logback
###########################################################
profiler.logback.logging.transactioninfo=true
```

**2-2 log4j, logback configuration**

Change the log message format to print the transactionId, and spanId saved in MDC.

ex) log4j : log4j.xml
```xml
Before
<appender name = "console" class= "org.apache.log4j.ConsoleAppender" >
     <layout class = "org.apache.log4j.EnhancedPatternLayout">
          <param name = "ConversionPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) %m%n" />
     </layout >
</appender >

After
<appender name = "console" class= "org.apache.log4j.ConsoleAppender" >
     <layout class = "org.apache.log4j.EnhancedPatternLayout">
          <param name = "ConversionPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) [TxId : %X{PtxId} , SpanId : %X{PspanId}] %m%n" />
        </layout >
</appender >
```

ex) logback : logback.xml
```xml
Before
<appender name = "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" >
     <layout class = "ch.qos.logback.classic.PatternLayout">
          <Pattern >%d{HH:mm} %-5level %logger{36} - %msg%n</Pattern >
     </layout >
</appender >

After
<appender name = "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" >
     <layout class = "ch.qos.logback.classic.PatternLayout">
          <Pattern >%d{HH:mm} %-5level %logger{36} - [TxId : %X{PtxId} , SpanId : %X{PspanId}] %msg%n</Pattern >
     </layout >
</appender >
```

**2-3 Checking log message**

If the per-request logging is correctly configured, the transactionId, and spanId are printed in the log file.

```
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76 ) [txId : agent^14252^17 spanId : 1224] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123 ) [txId : agent^142533^18 spanId : 1231] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) [txId : agent^142533^19 spanId : 1246] get content name : SPORTS
```

### 3. expose log in Pinpoint web

If you want to add links to the logs in the transaction list view, you should configure and implement the logic as below.
Pinpoint Web only adds link buttons - you should implement the logic to retrieve the log message.

If you want to expose your agent's log messages, please follow the steps below.

**step 1**
You should implement a controller that receives transactionId, spanId, transanction_start_time as parameters and retrieve the logs yourself.
We do not yet provide a way to retrieve the logs.

example)
```java
@Controller
public class Nelo2LogController {

    @RequestMapping(value = "/????")
    public String NeloLogForTransactionId(@RequestParam (value= "transactionId", required=true) String transactionId,
                                            @RequestParam(value= "spanId" , required=false) String spanId,
                                            @RequestParam(value="time" , required=true) long time ) {

          // you should implement the logic to retrieve your agent's logs.
    }
```

**step 2**
In *pinpoint-web.properties* file, set `log.enable` to true, and `log.page.url` to the url of the controller above.
The value set in `log.button.name` will show up as the button text in the Web UI.
```properties
log.enable= true
log.page.url=XXXX.pinpoint
log.button.name= log
```

If those are correctly configured, the buttons are added in the transaction list view.
![per-request_feature_2.jpg](img/per-request_feature_2.jpg)

For details in how the log buttons are generated, please refer to Pinpoint Web's BusinessTransactionController and ScatterChartController.

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

# 한국어 가이드

## Per-request logging

### 1. 기능 설명

Pinpoint에서는 log message를 request 단위로 구분할 수 있도록 log message 에 추가정보를 저장 해준다.

다수의 요청을 처리하는 tomcat을 사용할 경우 로그 파일을 보면 시간순으로 출력된 로그를 확인할 수 있다.
그러나 동시에 요청된 다수의 request 각각에 대한 로그를 구분 해서 볼 수 없다.
예를 들어 로그에서 exception message가 출력됐을때 그 exception이 발생한 request의 모든 log를 확인 하기 힘들다.

Pinpoint는 로그 메세지 마다 request와 연관된 정보(transactionId, spanId)를 MDC에 넣어줘서 request 단위로 log message를 구분할 수 있도록 해준다.
로그에 출력된 transactionId는 pinpoint web의 transaction List 화면에 출려된 transactionId와 일치한다.

구체적으로 예를 들어보자.
Pinpoint를 사용하지 않았을때 exception이 발생했을 경우 로그 메시지를 살펴 보자.
요청된 다수의 request 각각을 구분하여 로그를 확인 할 수가 없다.

ex) Without Pinpoint
```
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76 ) get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123 ) get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) get content name : SPORTS
2015-04-04 14:35:20 [INFO](ContentInfoCollector:25 ) get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:56 ) get content name : NATIONAL
2015-04-04 14:35:20 [INFO](ContentInfoCollector:34 ) get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoService:55 ) check authorization of user
2015-04-04 14:35:20 [INFO](ContentInfoService:14 ) get title of content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14 ) execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114 ) execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:74 ) get top linking for content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14 ) execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114 ) execute query ...
2015-04-04 14:35:22 [INFO](ContentDAOImpl:186 ) execute query ...
2015-04-04 14:35:22 [ERROR]ContentDAOImpl:158 )
     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
          at example.ContentDAO.executequery(ContentDAOImpl.java:152)
          ...
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
          ...
     Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure The last packet sent successfully to the server was 0 milliseconds ago.
     The driver has not received any packets from the server.
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
          ... 12 more
     Caused by: java.net.ConnectException: Connection refused
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
          at java.net.Socket.connect(Socket.java:529)
          ...13 more
2015-04-04 14:35:22 [INFO](ContentDAO:145 ) execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:38 ) update hits for content
2015-04-04 14:35:20 [INFO](ContentInfoService:89 ) check of user
2015-04-04 14:35:24 [INFO](ContentDAO:146 ) execute query ...
2015-04-04 14:35:25 [INFO](ContentDAO:123 ) execute query ...
```

Pinpoint는 로그 메세지 마다 request와 연관된 정보(transactionId, spanId)를 MDC에 넣어줘서 request 단위로 log message를 구분시켜 준다.

ex) With Pinpoint

```
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76) [txId : agent^14252^17 spanId : 1224] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123) [txId : agent^142533^18 spanId : 1231] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) [txId : agent^142533^19 spanId : 1246] get content name : SPORTS
2015-04-04 14:35:20 [INFO](ContentInfoCollector:25) [txId : agent^142533^20 spanId : 1263] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:56) [txId : agent^142533^21 spanId : 1265] get content name : NATIONAL
2015-04-04 14:35:20 [INFO](ContentInfoCollector:34) [txId : agent^142533^22 spanId : 1278] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoService:55) [txId : agent^14252^18 spanId : 1231] check authorization of user
2015-04-04 14:35:20 [INFO](ContentInfoService:14) [txId : agent^14252^17 spanId : 1224] get title of content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14) [txId : agent^14252^17 spanId : 1224] execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114) [txId : agent^142533^19 spanId : 1246] execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:74) [txId : agent^14252^17 spanId : 1224] get top linking for content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14) [txId : agent^142533^18 spanId : 1231] execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114) [txId : agent^142533^21 spanId : 1265] execute query ...
2015-04-04 14:35:22 [INFO](ContentDAOImpl:186) [txId : agent^142533^22 spanId : 1278] execute query ...
2015-04-04 14:35:22 [ERROR](ContentDAOImpl:158) [txId : agent^142533^18 spanId : 1231]
     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
          at com.pinpoint.example.dao.ContentDAO.executequery(ContentDAOImpl.java:152)
          ...
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
          ...
     Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure The last packet sent successfully to the server was 0 milliseconds ago.
     The driver has not received any packets from the server.
          ...
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
          ... 12 more
     Caused by: java.net.ConnectException: Connection refused
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
          at java.net.Socket.connect(Socket.java:529)
          ... 13 more
2015-04-04 14:35:22 [INFO](ContentDAO:145) [txId : agent^14252^17 spanId : 1224] execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:38) [txId : agent^142533^19 spanId : 1246] update hits for content
2015-04-04 14:35:20 [INFO](ContentInfoService:89) [txId : agent^142533^21 spanId : 1265] check of user
2015-04-04 14:35:24 [INFO](ContentDAO:146) [txId : agent^142533^22 spanId : 1278] execute query ...
2015-04-04 14:35:25 [INFO](ContentDAO:123) [txId : agent^14252^17 spanId : 1224] execute query ...
```

로그메시지에 출력된 transactionId는 Pinpoint web의 transactionlist의 transactionId와 일치한다.
![per-request_feature_1.jpg](img/per-request_feature_1.jpg)

### 2. 설정 방법

**2-1 Pinpoint agent 설정**

Pinpoint를 사용하려면 Pinpoint agent 설정파일(Pinpoint.config)의 logging 설정 값을 true로 변경해야한다.
사용하는 logging 라이브러리에 해당하는 설정값만 true로 변경하면 된다.
아래 설정에 대한 예시가 있다.

ex) Pinpoint.config  - log4j 를 사용할 경우
```
###########################################################
# log4j
###########################################################
profiler.log4j.logging.transactioninfo=true

###########################################################
# logback
###########################################################
profiler.logback.logging.transactioninfo=false
```

ex) Pinpoint.config  - logback 를 사용할 경우
```
###########################################################
# log4j
###########################################################
profiler.log4j.logging.transactioninfo=false

###########################################################
# logback
###########################################################
profiler.logback.logging.transactioninfo=true
```

**2-2 log4j, logback 설정 파일 설정**

logging 설정 파일의 log message pattern 설정에 Pinpoint에서 MDC에 저장한 transactionId, spanId값이 출력될수 있도록 설정을 추가하자.

ex) log4j - log4j.xml
```xml
변경 전
<appender name = "console" class= "org.apache.log4j.ConsoleAppender" >
     <layout class = "org.apache.log4j.EnhancedPatternLayout">
          <param name = "ConversionPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) %m%n" />
     </layout >
</appender >

변경 후
<appender name = "console" class= "org.apache.log4j.ConsoleAppender" >
     <layout class = "org.apache.log4j.EnhancedPatternLayout">
          <param name = "ConversionPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) [TxId : %X{PtxId} , SpanId : %X{PspanId}] %m%n" />
        </layout >
</appender >
```

ex) logback - logback.xml
```xml
변경 전
<appender name = "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" >
     <layout class = "ch.qos.logback.classic.PatternLayout">
          <Pattern >%d{HH:mm} %-5level %logger{36} - %msg%n</Pattern >
     </layout >
</appender >

변경 후
<appender name = "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" >
     <layout class = "ch.qos.logback.classic.PatternLayout">
          <Pattern >%d{HH:mm} %-5level %logger{36} - [TxId : %X{PtxId} , SpanId : %X{PspanId}] %msg%n</Pattern >
     </layout >
</appender >
```

**2-3 로그 출력 확인**

Pinpoint agent가 적용된 서비스를 동작하여 log message에 아래와 같이 tansactionId, spanId 정보가 출력되는것을 확인하면 된다.

```
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76 ) [txId : agent^14252^17 spanId : 1224] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123 ) [txId : agent^142533^18 spanId : 1231] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) [txId : agent^142533^19 spanId : 1246] get content name : SPORTS
```

### 3. Pinpoint web에서 로그 확인
Pinpoint web의 transaction list 화면에서 log를 출력하는 링크를 제공하고 싶다면 아래와 같이 설정 및 구현을 추가하면 된다.
Pinpoint web에서는 버튼 을 추가해주기만 하고 로그를 가져오는 로직은 직접 구현을 해야한다.

로그 메시지를 Pinpoint web에서 보여주기 위해서는 아래와 같이 2가지 step을 따라야 한다.

**step 1**
transactionId와 spanId, transaction 시작 시간을 파라미터로 받아서 로그 메시지를 가져오는 controller을 구현해야한다.

example)
```java
@Controller
public class Nelo2LogController {

    @RequestMapping(value = "/XXXX")
    public String NeloLogForTransactionId(@RequestParam (value= "transactionId", required=true) String transactionId,
                                            @RequestParam(value= "spanId" , required=false) String spanId,
                                            @RequestParam(value="time" , required=true) long time ) {

          // you should implement the logic to retrieve your agent's logs.
    }
```

**step 2**
Pinpoint-web.properties 파일에서 버튼을 추가해주는 기능을 활성화 하기 위해서 log.enable의 값을 true로 설정하고
위에서 구현한 controller의 url과 button의 이름을 추가해주자.

```properties
log.enable=true
log.page.url=XXXX.Pinpoint
log.button.name=log
```

위와 같이 설정 및 구현을 추가하고 pinpoint web을 동작시키면 아래와 같이 버튼이 추가 된다.
![per-request_feature_2.jpg](img/per-request_feature_2.jpg)
로그 버튼을 생성해주는 과정을 보시려면, Pinpoint Web의 BusinessTransactionController 와 ScatterChartController class를 참고하세요.


text:
title: "Talk @ AnacondaCON 2018: Deploying Python and R to Spark"
slug: anacondacon-deploying-python-r-to-spark
date: 2017-04-17
tags: ["Talk", "Python", "R", "Spark", "Hadoop"]
author: Daniel Rodriguez
---

Watch me give a talk at our annual Anaconda conference about the work we are doing
to make data scientist deploy Python and R easier inside Anaconda Enterprise 5.

{{< youtube id="vmd7L-FAhus" class="video" >}}

Official abstract:

> Anaconda Enterprise provides an easy yet powerful architecture that allows people to connect from interactive sessions and deployments to running Spark clusters from Python and R.  We will take a look at the Anaconda Enterprise 5 architecture for connecting to Hadoop/Spark clusters powered by Sparkmagic and Apache Livy (incubating), while taking a look at the benefits of this architecture and how it allows users to securely and easily connect to remote Hadoop/Spark clusters. We also will look at how Anaconda Enterprise enables users to do runtime distribution of custom Anaconda installers using Cloudera Parcels and Ambari Management Packs, allowing data scientists to ship Anaconda environments and leverage libraries from Anaconda.

Let me know if you liked the show and what can we do better next year!
Including new topics you want us to present.