text:
Sync Menu

        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Options </button>

Auto Refresh {{ getOption('autorefresh') }}

     Home
    Maintenance
    Sync Menu

        <input type="checkbox" title="Auto Refresh" ng-model="options.autorefresh"/> Auto Refresh

Data Sources

                    <input type="text" style="float:right;margin:3px 10px;" placeholder="Filter" ng-model="filters.title">

                            ID
                            Title
                            Sync Status
                            Total Published

                            Actions

 0">
                                {{ ds.id }}
                                {{ ds.title }}

                                    <progress animate="false">
                                        <bar ng-click="predicate = 'count_INDEXED';reverse=!reverse" value="ds.count_INDEXED / ds.count_PUBLISHED * 100" type="success">
                                            {{ ds.count_INDEXED | number}} Indexed
                                        </bar>
                                        <bar ng-click="predicate = 'count_MISSING';reverse=!reverse" value="ds.count_MISSING / ds.count_PUBLISHED * 100" type="danger">
                                            {{ ds.count_MISSING | number }} Missing
                                        </bar>
                                    </progress>

                                {{ ds.count_PUBLISHED | number }}

                                        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Queue </button>

Index

Index Portal

Index Relations

Index Missing

Clear Index

Fix Relationship and Index

Full Sync

Sync Missing

                    <form class="form-search pull-left" ng-submit="syncRo(subject)">

                            <button type="submit" class="btn" ng-disabled="syncing">Sync</button>
                            <input type="text" class="input-medium search-query" placeholder="Key, ID or Slug" ng-model="subject">

                        Loading...
                    </form>

                        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Mass Queue </button>

Index All

Index Portal All

Index Relations All

Sync All

Fix Relationship and Index All

Tasks Report

                            {{ status }}
                            {{ count }}

Tasks

                    <task-list tasks="tasks"></task-list>


text:
<?php

// /Users/tam/Sandbox/mbay/vendor/bundles/Symfony/Bundle/WebConfiguratorBundle/Resources/views/final.html.twig
return array (
);

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML>

<title>Constant Field Values (LWJGL 3.1.0 - NanoVG)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2016-10-30">
<link rel="stylesheet" type="text/css" href="javadoc.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Deprecated

Index

Prev

Next

Frames

No Frames

All Classes

SEARCH:
<input type="text" id="search" value=" " disabled="disabled">
<input type="reset" id="reset" value=" " disabled="disabled">

JavaScript is disabled on your browser.

Constant Field Values

Contents

org.lwjgl.*

org.lwjgl.*

org.lwjgl.nanovg.NanoVG

Modifier and Type
Constant Field
Value

public static final int
NVG_ALIGN_BASELINE
64

public static final int
NVG_ALIGN_BOTTOM
32

public static final int
NVG_ALIGN_CENTER
2

public static final int
NVG_ALIGN_LEFT
1

public static final int
NVG_ALIGN_MIDDLE
16

public static final int
NVG_ALIGN_RIGHT
4

public static final int
NVG_ALIGN_TOP
8

public static final int
NVG_ATOP
3

public static final int
NVG_BEVEL
3

public static final int
NVG_BUTT
0

public static final int
NVG_CCW
1

public static final int
NVG_COPY
9

public static final int
NVG_CW
2

public static final int
NVG_DESTINATION_ATOP
7

public static final int
NVG_DESTINATION_IN
5

public static final int
NVG_DESTINATION_OUT
6

public static final int
NVG_DESTINATION_OVER
4

public static final int
NVG_DST_ALPHA
256

public static final int
NVG_DST_COLOR
16

public static final int
NVG_HOLE
2

public static final int
NVG_IMAGE_FLIPY
8

public static final int
NVG_IMAGE_GENERATE_MIPMAPS
1

public static final int
NVG_IMAGE_PREMULTIPLIED
16

public static final int
NVG_IMAGE_REPEATX
2

public static final int
NVG_IMAGE_REPEATY
4

public static final int
NVG_LIGHTER
8

public static final int
NVG_MITER
4

public static final int
NVG_ONE
2

public static final int
NVG_ONE_MINUS_DST_ALPHA
512

public static final int
NVG_ONE_MINUS_DST_COLOR
32

public static final int
NVG_ONE_MINUS_SRC_ALPHA
128

public static final int
NVG_ONE_MINUS_SRC_COLOR
8

public static final float
NVG_PI
3.1415927410125732f

public static final int
NVG_ROUND
1

public static final int
NVG_SOLID
1

public static final int
NVG_SOURCE_IN
1

public static final int
NVG_SOURCE_OUT
2

public static final int
NVG_SOURCE_OVER
0

public static final int
NVG_SQUARE
2

public static final int
NVG_SRC_ALPHA
64

public static final int
NVG_SRC_ALPHA_SATURATE
1024

public static final int
NVG_SRC_COLOR
4

public static final int
NVG_XOR
10

public static final int
NVG_ZERO
1

org.lwjgl.nanovg.NanoVGGL2

Modifier and Type
Constant Field
Value

public static final int
NVG_ANTIALIAS
1

public static final int
NVG_DEBUG
4

public static final int
NVG_IMAGE_NODELETE
65536

public static final int
NVG_STENCIL_STROKES
2

org.lwjgl.nanovg.NanoVGGL3

Modifier and Type
Constant Field
Value

public static final int
NVG_ANTIALIAS
1

public static final int
NVG_DEBUG
4

public static final int
NVG_IMAGE_NODELETE
65536

public static final int
NVG_STENCIL_STROKES
2

org.lwjgl.nanovg.NanoVGGLES2

Modifier and Type
Constant Field
Value

public static final int
NVG_ANTIALIAS
1

public static final int
NVG_DEBUG
4

public static final int
NVG_IMAGE_NODELETE
65536

public static final int
NVG_STENCIL_STROKES
2

org.lwjgl.nanovg.NanoVGGLES3

Modifier and Type
Constant Field
Value

public static final int
NVG_ANTIALIAS
1

public static final int
NVG_DEBUG
4

public static final int
NVG_IMAGE_NODELETE
65536

public static final int
NVG_STENCIL_STROKES
2

Skip navigation links

Package

Class

Deprecated

Index

Prev

Next

Frames

No Frames

All Classes

JavaScript is disabled on your browser.

Copyright LWJGL. All Rights Reserved. License terms.


text:
```{eval-rst}

.. automodule:: hanlp.pretrained.glove
    :members:

```


text:
"""
    jinja2.sandbox
    ~~~~~~~~~~~~~~

    Adds a sandbox layer to Jinja as it was the default behavior in the old
    Jinja 1 releases.  This sandbox is slightly different from Jinja 1 as the
    default behavior is easier to use.

    The behavior can be changed by subclassing the environment.

    :copyright: (c) 2010 by the Jinja Team.
    :license: BSD.
"""
import types
import operator
from collections import Mapping
from jinja2.environment import Environment
from jinja2.exceptions import SecurityError
from jinja2._compat import string_types, text_type, PY2
from jinja2.utils import Markup

has_format = False
if hasattr(text_type, 'format'):
    from markupsafe import EscapeFormatter
    from string import Formatter
    has_format = True

#: maximum number of items a range may produce
MAX_RANGE = 100000

#: attributes of function objects that are considered unsafe.
if PY2:
    UNSAFE_FUNCTION_ATTRIBUTES = set(['func_closure', 'func_code', 'func_dict',
                                      'func_defaults', 'func_globals'])
else:
    # On versions > python 2 the special attributes on functions are gone,
    # but they remain on methods and generators for whatever reason.
    UNSAFE_FUNCTION_ATTRIBUTES = set()

#: unsafe method attributes.  function attributes are unsafe for methods too
UNSAFE_METHOD_ATTRIBUTES = set(['im_class', 'im_func', 'im_self'])

#: unsafe generator attirbutes.
UNSAFE_GENERATOR_ATTRIBUTES = set(['gi_frame', 'gi_code'])

#: unsafe attributes on coroutines
UNSAFE_COROUTINE_ATTRIBUTES = set(['cr_frame', 'cr_code'])

#: unsafe attributes on async generators
UNSAFE_ASYNC_GENERATOR_ATTRIBUTES = set(['ag_code', 'ag_frame'])

import warnings

# make sure we don't warn in python 2.6 about stuff we don't care about
warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,
                        module='jinja2.sandbox')

from collections import deque

_mutable_set_types = (set,)
_mutable_mapping_types = (dict,)
_mutable_sequence_types = (list,)

# on python 2.x we can register the user collection types
try:
    from UserDict import UserDict, DictMixin
    from UserList import UserList
    _mutable_mapping_types += (UserDict, DictMixin)
    _mutable_set_types += (UserList,)
except ImportError:
    pass

# if sets is still available, register the mutable set from there as well
try:
    from sets import Set
    _mutable_set_types += (Set,)
except ImportError:
    pass

#: register Python 2.6 abstract base classes
try:
    from collections import MutableSet, MutableMapping, MutableSequence
    _mutable_set_types += (MutableSet,)
    _mutable_mapping_types += (MutableMapping,)
    _mutable_sequence_types += (MutableSequence,)
except ImportError:
    pass

_mutable_spec = (
    (_mutable_set_types, frozenset([
        'add', 'clear', 'difference_update', 'discard', 'pop', 'remove',
        'symmetric_difference_update', 'update'
    ])),
    (_mutable_mapping_types, frozenset([
        'clear', 'pop', 'popitem', 'setdefault', 'update'
    ])),
    (_mutable_sequence_types, frozenset([
        'append', 'reverse', 'insert', 'sort', 'extend', 'remove'
    ])),
    (deque, frozenset([
        'append', 'appendleft', 'clear', 'extend', 'extendleft', 'pop',
        'popleft', 'remove', 'rotate'
    ]))
)

class _MagicFormatMapping(Mapping):
    """This class implements a dummy wrapper to fix a bug in the Python
    standard library for string formatting.

    See http://bugs.python.org/issue13598 for information about why
    this is necessary.
    """

    def __init__(self, args, kwargs):
        self._args = args
        self._kwargs = kwargs
        self._last_index = 0

    def __getitem__(self, key):
        if key == '':
            idx = self._last_index
            self._last_index += 1
            try:
                return self._args[idx]
            except LookupError:
                pass
            key = str(idx)
        return self._kwargs[key]

    def __iter__(self):
        return iter(self._kwargs)

    def __len__(self):
        return len(self._kwargs)

def inspect_format_method(callable):
    if not has_format:
        return None
    if not isinstance(callable, (types.MethodType,
                                 types.BuiltinMethodType)) or \
       callable.__name__ != 'format':
        return None
    obj = callable.__self__
    if isinstance(obj, string_types):
        return obj

def safe_range(*args):
    """A range that can't generate ranges with a length of more than
    MAX_RANGE items.
    """
    rng = range(*args)
    if len(rng) > MAX_RANGE:
        raise OverflowError('range too big, maximum size for range is %d' %
                            MAX_RANGE)
    return rng

def unsafe(f):
    """Marks a function or method as unsafe.

    ::

        @unsafe
        def delete(self):
            pass
    """
    f.unsafe_callable = True
    return f

def is_internal_attribute(obj, attr):
    """Test if the attribute given is an internal python attribute.  For
    example this function returns `True` for the `func_code` attribute of
    python objects.  This is useful if the environment method
    :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.

    >>> from jinja2.sandbox import is_internal_attribute
    >>> is_internal_attribute(str, "mro")
    True
    >>> is_internal_attribute(str, "upper")
    False
    """
    if isinstance(obj, types.FunctionType):
        if attr in UNSAFE_FUNCTION_ATTRIBUTES:
            return True
    elif isinstance(obj, types.MethodType):
        if attr in UNSAFE_FUNCTION_ATTRIBUTES or \
           attr in UNSAFE_METHOD_ATTRIBUTES:
            return True
    elif isinstance(obj, type):
        if attr == 'mro':
            return True
    elif isinstance(obj, (types.CodeType, types.TracebackType, types.FrameType)):
        return True
    elif isinstance(obj, types.GeneratorType):
        if attr in UNSAFE_GENERATOR_ATTRIBUTES:
            return True
    elif hasattr(types, 'CoroutineType') and isinstance(obj, types.CoroutineType):
        if attr in UNSAFE_COROUTINE_ATTRIBUTES:
            return True
    elif hasattr(types, 'AsyncGeneratorType') and isinstance(obj, types.AsyncGeneratorType):
        if attri in UNSAFE_ASYNC_GENERATOR_ATTRIBUTES:
            return True
    return attr.startswith('__')

def modifies_known_mutable(obj, attr):
    """This function checks if an attribute on a builtin mutable object
    (list, dict, set or deque) would modify it if called.  It also supports
    the "user"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and
    with Python 2.6 onwards the abstract base classes `MutableSet`,
    `MutableMapping`, and `MutableSequence`.

    >>> modifies_known_mutable({}, "clear")
    True
    >>> modifies_known_mutable({}, "keys")
    False
    >>> modifies_known_mutable([], "append")
    True
    >>> modifies_known_mutable([], "index")
    False

    If called with an unsupported object (such as unicode) `False` is
    returned.

    >>> modifies_known_mutable("foo", "upper")
    False
    """
    for typespec, unsafe in _mutable_spec:
        if isinstance(obj, typespec):
            return attr in unsafe
    return False

class SandboxedEnvironment(Environment):
    """The sandboxed environment.  It works like the regular environment but
    tells the compiler to generate sandboxed code.  Additionally subclasses of
    this environment may override the methods that tell the runtime what
    attributes or functions are safe to access.

    If the template tries to access insecure code a :exc:`SecurityError` is
    raised.  However also other exceptions may occur during the rendering so
    the caller has to ensure that all exceptions are caught.
    """
    sandboxed = True

    #: default callback table for the binary operators.  A copy of this is
    #: available on each instance of a sandboxed environment as
    #: :attr:`binop_table`
    default_binop_table = {
        '+':        operator.add,
        '-':        operator.sub,
        '*':        operator.mul,
        '/':        operator.truediv,
        '//':       operator.floordiv,
        '**':       operator.pow,
        '%':        operator.mod
    }

    #: default callback table for the unary operators.  A copy of this is
    #: available on each instance of a sandboxed environment as
    #: :attr:`unop_table`
    default_unop_table = {
        '+':        operator.pos,
        '-':        operator.neg
    }

    #: a set of binary operators that should be intercepted.  Each operator
    #: that is added to this set (empty by default) is delegated to the
    #: :meth:`call_binop` method that will perform the operator.  The default
    #: operator callback is specified by :attr:`binop_table`.
    #:
    #: The following binary operators are interceptable:
    #: ``//``, ``%``, ``+``, ``*``, ``-``, ``/``, and ``**``
    #:
    #: The default operation form the operator table corresponds to the
    #: builtin function.  Intercepted calls are always slower than the native
    #: operator call, so make sure only to intercept the ones you are
    #: interested in.
    #:
    #: .. versionadded:: 2.6
    intercepted_binops = frozenset()

    #: a set of unary operators that should be intercepted.  Each operator
    #: that is added to this set (empty by default) is delegated to the
    #: :meth:`call_unop` method that will perform the operator.  The default
    #: operator callback is specified by :attr:`unop_table`.
    #:
    #: The following unary operators are interceptable: ``+``, ``-``
    #:
    #: The default operation form the operator table corresponds to the
    #: builtin function.  Intercepted calls are always slower than the native
    #: operator call, so make sure only to intercept the ones you are
    #: interested in.
    #:
    #: .. versionadded:: 2.6
    intercepted_unops = frozenset()

    def intercept_unop(self, operator):
        """Called during template compilation with the name of a unary
        operator to check if it should be intercepted at runtime.  If this
        method returns `True`, :meth:`call_unop` is excuted for this unary
        operator.  The default implementation of :meth:`call_unop` will use
        the :attr:`unop_table` dictionary to perform the operator with the
        same logic as the builtin one.

        The following unary operators are interceptable: ``+`` and ``-``

        Intercepted calls are always slower than the native operator call,
        so make sure only to intercept the ones you are interested in.

        .. versionadded:: 2.6
        """
        return False

    def __init__(self, *args, **kwargs):
        Environment.__init__(self, *args, **kwargs)
        self.globals['range'] = safe_range
        self.binop_table = self.default_binop_table.copy()
        self.unop_table = self.default_unop_table.copy()

    def is_safe_attribute(self, obj, attr, value):
        """The sandboxed environment will call this method to check if the
        attribute of an object is safe to access.  Per default all attributes
        starting with an underscore are considered private as well as the
        special attributes of internal python objects as returned by the
        :func:`is_internal_attribute` function.
        """
        return not (attr.startswith('_') or is_internal_attribute(obj, attr))

    def is_safe_callable(self, obj):
        """Check if an object is safely callable.  Per default a function is
        considered safe unless the `unsafe_callable` attribute exists and is
        True.  Override this method to alter the behavior, but this won't
        affect the `unsafe` decorator from this module.
        """
        return not (getattr(obj, 'unsafe_callable', False) or
                    getattr(obj, 'alters_data', False))

    def call_binop(self, context, operator, left, right):
        """For intercepted binary operator calls (:meth:`intercepted_binops`)
        this function is executed instead of the builtin operator.  This can
        be used to fine tune the behavior of certain operators.

        .. versionadded:: 2.6
        """
        return self.binop_table[operator](left, right)

    def call_unop(self, context, operator, arg):
        """For intercepted unary operator calls (:meth:`intercepted_unops`)
        this function is executed instead of the builtin operator.  This can
        be used to fine tune the behavior of certain operators.

        .. versionadded:: 2.6
        """
        return self.unop_table[operator](arg)

    def getitem(self, obj, argument):
        """Subscribe an object from sandboxed code."""
        try:
            return obj[argument]
        except (TypeError, LookupError):
            if isinstance(argument, string_types):
                try:
                    attr = str(argument)
                except Exception:
                    pass
                else:
                    try:
                        value = getattr(obj, attr)
                    except AttributeError:
                        pass
                    else:
                        if self.is_safe_attribute(obj, argument, value):
                            return value
                        return self.unsafe_undefined(obj, argument)
        return self.undefined(obj=obj, name=argument)

    def getattr(self, obj, attribute):
        """Subscribe an object from sandboxed code and prefer the
        attribute.  The attribute passed *must* be a bytestring.
        """
        try:
            value = getattr(obj, attribute)
        except AttributeError:
            try:
                return obj[attribute]
            except (TypeError, LookupError):
                pass
        else:
            if self.is_safe_attribute(obj, attribute, value):
                return value
            return self.unsafe_undefined(obj, attribute)
        return self.undefined(obj=obj, name=attribute)

    def unsafe_undefined(self, obj, attribute):
        """Return an undefined object for unsafe attributes."""
        return self.undefined('access to attribute %r of %r '
                              'object is unsafe.' % (
            attribute,
            obj.__class__.__name__
        ), name=attribute, obj=obj, exc=SecurityError)

    def format_string(self, s, args, kwargs):
        """If a format call is detected, then this is routed through this
        method so that our safety sandbox can be used for it.
        """
        if isinstance(s, Markup):
            formatter = SandboxedEscapeFormatter(self, s.escape)
        else:
            formatter = SandboxedFormatter(self)
        kwargs = _MagicFormatMapping(args, kwargs)
        rv = formatter.vformat(s, args, kwargs)
        return type(s)(rv)

    def call(__self, __context, __obj, *args, **kwargs):
        """Call an object from sandboxed code."""
        fmt = inspect_format_method(__obj)
        if fmt is not None:
            return __self.format_string(fmt, args, kwargs)

        # the double prefixes are to avoid double keyword argument
        # errors when proxying the call.
        if not __self.is_safe_callable(__obj):
            raise SecurityError('%r is not safely callable' % (__obj,))
        return __context.call(__obj, *args, **kwargs)

class ImmutableSandboxedEnvironment(SandboxedEnvironment):
    """Works exactly like the regular `SandboxedEnvironment` but does not
    permit modifications on the builtin mutable objects `list`, `set`, and
    `dict` by using the :func:`modifies_known_mutable` function.
    """

    def is_safe_attribute(self, obj, attr, value):
        if not SandboxedEnvironment.is_safe_attribute(self, obj, attr, value):
            return False
        return not modifies_known_mutable(obj, attr)

if has_format:
    # This really is not a public API apparenlty.
    try:
        from _string import formatter_field_name_split
    except ImportError:
        def formatter_field_name_split(field_name):
            return field_name._formatter_field_name_split()

    class SandboxedFormatterMixin(object):

        def __init__(self, env):
            self._env = env

        def get_field(self, field_name, args, kwargs):
            first, rest = formatter_field_name_split(field_name)
            obj = self.get_value(first, args, kwargs)
            for is_attr, i in rest:
                if is_attr:
                    obj = self._env.getattr(obj, i)
                else:
                    obj = self._env.getitem(obj, i)
            return obj, first

    class SandboxedFormatter(SandboxedFormatterMixin, Formatter):
        def __init__(self, env):
            SandboxedFormatterMixin.__init__(self, env)
            Formatter.__init__(self)

    class SandboxedEscapeFormatter(SandboxedFormatterMixin, EscapeFormatter):
        def __init__(self, env, escape):
            SandboxedFormatterMixin.__init__(self, env)
            EscapeFormatter.__init__(self, escape)


text:
<?php
namespace TYPO3\CMS\Form\Domain\Validator;

use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
 * Class EmailValidator
 */
class EmailValidator extends AbstractValidator
{
    /**
     * Constant for localisation
     *
     * @var string
     */
    const LOCALISATION_OBJECT_NAME = 'tx_form_system_validate_email';

    /**
     * Check if $value is valid. If it is not valid, needs to add an error
     * to result.
     *
     * @param mixed $value
     * @return void
     */
    public function isValid($value)
    {
        if (empty($value) || !is_string($value)) {
            return;
        }

        if (!GeneralUtility::validEmail($value)) {
            $this->addError(
                $this->renderMessage(
                    $this->options['errorMessage'][0],
                    $this->options['errorMessage'][1],
                    'error'
                ),
                1442000235
            );
        }
    }
}


text:
exopy.tasks.tasks.logic.views.conditional_view module
====================================================

.. automodule:: exopy.tasks.tasks.logic.views.conditional_view
    :members:
    :undoc-members:
    :show-inheritance:


text:
import com.pervasive.datarush.operators.DataflowProcess;
import com.pervasive.datarush.ports.StringOutput;
import com.pervasive.datarush.operators.CompositionContext;
import com.pervasive.datarush.operators.io.textfile.WriteText;
import com.pervasive.datarush.operators.io.textfile.ReadText;
import com.pervasive.datarush.operators.io.textfile.ReadTextProperties;
import com.pervasive.datarush.flows.ScalarFlow;

public class WriteToFile extends DataflowProcess {

    public WriteToFile(CompositionContext ctx, ScalarFlow input) {
        super(ctx);
        ctx.add(new WriteText(input, "reversed_output.txt"));
    }

  @Override
  protected void execute() {
  }
}


text:
import * as assert from 'assert';
import { findExpressionInStackFrame } from 'vs/workbench/contrib/debug/browser/debugHover';
import { createMockSession } from 'vs/workbench/contrib/debug/test/browser/callStack.test';
import { StackFrame, Thread, DebugModel, Scope, Variable } from 'vs/workbench/contrib/debug/common/debugModel';
import { Source } from 'vs/workbench/contrib/debug/common/debugSource';
import type { IScope, IExpression } from 'vs/workbench/contrib/debug/common/debug';

suite('Debug - Hover', () => {
	test('find expression in stack frame', async () => {
		const model = new DebugModel([], [], [], [], [], <any>{ isDirty: (e: any) => false });
		const session = createMockSession(model);
		let stackFrame: StackFrame;

		const thread = new class extends Thread {
			public getCallStack(): StackFrame[] {
				return [stackFrame];
			}
		}(session, 'mockthread', 1);

		const firstSource = new Source({
			name: 'internalModule.js',
			path: 'a/b/c/d/internalModule.js',
			sourceReference: 10,
		}, 'aDebugSessionId');

		let scope: Scope;
		stackFrame = new class extends StackFrame {
			getScopes(): Promise<IScope[]> {
				return Promise.resolve([scope]);
			}
		}(thread, 1, firstSource, 'app.js', 'normal', { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 10 }, 1);

		let variableA: Variable;
		let variableB: Variable;
		scope = new class extends Scope {
			getChildren(): Promise<IExpression[]> {
				return Promise.resolve([variableA]);
			}
		}(stackFrame, 1, 'local', 1, false, 10, 10);

		variableA = new class extends Variable {
			getChildren(): Promise<IExpression[]> {
				return Promise.resolve([variableB]);
			}
		}(session, 1, scope, 2, 'A', 'A', undefined!, 0, 0, {}, 'string');
		variableB = new Variable(session, 1, scope, 2, 'B', 'A.B', undefined!, 0, 0, {}, 'string');

		assert.equal(await findExpressionInStackFrame(stackFrame, []), undefined);
		assert.equal(await findExpressionInStackFrame(stackFrame, ['A']), variableA);
		assert.equal(await findExpressionInStackFrame(stackFrame, ['doesNotExist', 'no']), undefined);
		assert.equal(await findExpressionInStackFrame(stackFrame, ['a']), undefined);
		assert.equal(await findExpressionInStackFrame(stackFrame, ['B']), undefined);
		assert.equal(await findExpressionInStackFrame(stackFrame, ['A', 'B']), variableB);
		assert.equal(await findExpressionInStackFrame(stackFrame, ['A', 'C']), undefined);

		// We do not search in expensive scopes
		scope.expensive = true;
		assert.equal(await findExpressionInStackFrame(stackFrame, ['A']), undefined);
	});
});


text:
import collections
import os

from artificialproject.field_generators import (
    GenerationFailedException,
    StringGenerator,
)
from artificialproject.random import weighted_choice

class FilePathGenerator:
    BUILD_FILE_NAME = "BUCK"

    def __init__(self):
        self._component_generator = StringGenerator()
        self._file_samples = collections.defaultdict(
            lambda: collections.defaultdict(set)
        )
        self._file_samples_dirty = False
        self._package_depths = collections.Counter()
        self._file_depths_in_package = collections.Counter()
        self._sizes_by_depth = collections.defaultdict(collections.Counter)
        self._sizes_by_depth_in_package = collections.defaultdict(collections.Counter)
        self._build_file_sizes = collections.Counter()
        self._root = {}
        self._package_paths = {}
        self._available_directories = {}
        self._last_package_path = None
        self._last_package_remaining_targets = None

    def analyze_project_data(self, project_data):
        dir_entries = collections.defaultdict(set)
        build_file_entries = collections.defaultdict(set)
        for target_data in project_data.values():
            base_path = target_data["buck.base_path"]
            build_file_entries[base_path].add(target_data["name"])
            components = self._split_path_into_components(base_path)
            # TODO(jakubzika): Targets in the root of the repo are ignored
            # because _generate_path does not handle depth == 0.
            if components:
                self._package_depths.update([len(components)])
            for component in components:
                self._component_generator.add_string_sample(component)
            for i, name in enumerate(components):
                prefix = components[:i]
                dir_entries[tuple(prefix)].add(name)
        for base_path, names in build_file_entries.items():
            self._build_file_sizes.update([len(names)])
        for path, entries in dir_entries.items():
            self._sizes_by_depth[len(path)].update([len(entries)])

    def add_package_file_sample(self, package_path, relative_path):
        components = self._split_path_into_components(relative_path)
        self._file_depths_in_package.update([len(components)])
        for i, name in enumerate(components):
            prefix = components[:i]
            self._file_samples[package_path][tuple(prefix)].add(name)
        self._file_samples_dirty = True

    def generate_package_path(self):
        if self._last_package_path is not None:
            path = self._last_package_path
            self._last_package_remaining_targets -= 1
            if self._last_package_remaining_targets <= 0:
                self._last_package_path = None
            return path
        depth = weighted_choice(self._package_depths)
        path, parent_dir = self._generate_path(
            "//", self._root, depth, self._sizes_by_depth, self._component_generator
        )
        directory = {self.BUILD_FILE_NAME.lower(): None}
        parent_dir[os.path.basename(path).lower()] = directory
        self._last_package_path = path
        self._last_package_remaining_targets = (
            weighted_choice(self._build_file_sizes) - 1
        )
        return path

    def generate_path_in_package(
        self, package_path, depth, component_generator, extension
    ):
        if depth == 0:
            return ""
        if self._file_samples_dirty:
            self._sizes_by_depth_in_package.clear()
            for dir_entries in self._file_samples.values():
                for path, entries in dir_entries.items():
                    self._sizes_by_depth_in_package[len(path)].update([len(entries)])
            self._file_samples_dirty = False
        root = self._root
        components = self._split_path_into_components(package_path)
        for component in components:
            root = root[component.lower()]
        path, parent_dir = self._generate_path(
            package_path,
            root,
            depth,
            self._sizes_by_depth_in_package,
            component_generator,
            extension,
        )
        parent_dir[os.path.basename(path).lower()] = None
        return path

    def register_path(self, path):
        directory = self._root
        existed = True
        for component in self._split_path_into_components(path):
            if component not in directory:
                directory[component] = {}
                existed = False
            directory = directory[component]
            if directory is None:
                raise GenerationFailedException()
        if existed:
            raise GenerationFailedException()

    def _split_path_into_components(self, path):
        components = []
        while path:
            path, component = os.path.split(path)
            components.append(component)
        return components[::-1]

    def _generate_path(
        self,
        package_key,
        root,
        depth,
        sizes_by_depth,
        component_generator,
        extension=None,
    ):
        assert depth >= 1
        parent_path, parent_dir = self._generate_parent(
            package_key, root, depth - 1, sizes_by_depth, component_generator
        )
        name = self._generate_name(parent_dir, component_generator, extension)
        return os.path.join(parent_path, name), parent_dir

    def _generate_parent(
        self, package_key, root, depth, sizes_by_depth, component_generator
    ):
        if depth == 0:
            return "", root
        key = (package_key, depth)
        value = self._available_directories.get(key)
        if value is not None:
            key_found = True
            path, directory, size = value
        else:
            key_found = False
            parent_path, parent_dir = self._generate_parent(
                package_key, root, depth - 1, sizes_by_depth, component_generator
            )
            name = self._generate_name(parent_dir, component_generator)
            path = os.path.join(parent_path, name)
            directory = {}
            parent_dir[name.lower()] = directory
            size = weighted_choice(sizes_by_depth[depth])
        size -= 1
        if size > 0:
            self._available_directories[key] = (path, directory, size)
        elif key_found:
            del self._available_directories[key]
        return path, directory

    def _generate_name(self, directory, generator, extension=None):
        for i in range(1000):
            name = generator.generate_string()
            if extension is not None:
                name += extension
            if (
                name.lower() not in directory
                and name.lower() != self.BUILD_FILE_NAME.lower()
            ):
                return name
        raise GenerationFailedException()


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>RendererMap Constructor</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            log4net SDK Reference

RendererMap Constructor

 Default Constructor

        [Visual Basic]

Public Sub New()

        [C#]

public RendererMap();

Remarks

 Default constructor.

See Also

RendererMap Class | log4net.ObjectRenderer Namespace

Copyright 2001-2006 The Apache Software Foundation.

Generated from assembly log4net [1.2.10.0]


text:
#ifndef MSOUTLOOKCONTACTOPERATIONS_H
#define MSOUTLOOKCONTACTOPERATIONS_H

#import "MSOutlookModels.h"
#import "api/api.h"
#import "core/core.h"
#import "MSOutlookItemOperations.h"

/** MSOutlookContactOperations
 *
 */
@interface MSOutlookContactOperations : MSOutlookItemOperations

- (instancetype)initOperationWithUrl:(NSString *)urlComponent parent:(id<MSOrcExecutable>)parent;

@end

#endif


text:
//
//  ZCHomeViewController.m
//  随手记
//
//  Created by MrZhao on 16/7/4.
//  Copyright (c) 2016年 MrZhao. All rights reserved.
//

#import "ZCHomeViewController.h"
#import "ZCViewControllerDispatchMediation.h"
#import "ZCItemView.h"
#import "Masonry.h"
#import "ZCConst.h"

@interface ZCHomeViewController ()
/*
 *标题图片
 */
@property (nonatomic, strong)UIImageView *icon;
/*
 *标题
 */
@property (nonatomic, strong)UILabel *titleLabel;
/*
 *标题描述
 */
@property (nonatomic, strong)UILabel *descLabel;
/*
 *自拍
 */
@property (nonatomic, strong)ZCItemView *camerer;
/*
 *录视频
 */
@property (nonatomic, strong)ZCItemView *video;
/*
 *直播
 */
@property (nonatomic, strong)ZCItemView *timeVideo;
/*
 *笔记
 */
@property (nonatomic, strong)ZCItemView *notes;

@end

@implementation ZCHomeViewController

#pragma mark life cycle
/*在该方法中通常做添加子视图操作,子视图的创建不要在这里面做*/
- (void)viewDidLoad {

    [super viewDidLoad];

    [self.view addSubview:self.icon];//注意不能用_icon这是调用set方法,那么所有控件都不会创建了

    [self.view addSubview:self.titleLabel];

    [self.view addSubview:self.descLabel];

    [self.view addSubview:self.camerer];

    [self.view addSubview:self.video];

    [self.view addSubview:self.notes];

    [self.view addSubview:self.timeVideo];

}
/*在该方法中通常配置操作 ,子视图的frame设置不要在这里面做*/
- (void)viewWillAppear:(BOOL)animated{

    self.view.backgroundColor = [UIColor colorWithRed:231/255.0 green:143/255.0 blue:186/255.0 alpha:1.0];

}
/*在该方法中设置子视图的frame比较准确*/
-(void)viewDidLayoutSubviews {

    [super viewDidLayoutSubviews];

    CGFloat margin = 15;
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {

        make.left.mas_equalTo((ScreenW - 70) / 2);
        make.top.mas_equalTo(64);
        make.width.mas_equalTo(70);
        make.height.mas_equalTo(70);

    }];

    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo((ScreenW - 90) / 2);
        make.top.mas_equalTo(self.icon.mas_bottom).offset(10);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(40);

    }];

    [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo((ScreenW - 90) / 2);
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(10);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(40);
    }];

    CGFloat imageWH = 90;
    CGFloat camererX = (ScreenW - 2 * imageWH - 4* margin) /2;
    CGFloat camererY = ScreenH / 2 - 50;
    self.camerer.frame = CGRectMake(camererX, camererY, imageWH, imageWH);

    CGFloat videoX = CGRectGetMaxX(self.camerer.frame) + 4*margin;
    self.video.frame = CGRectMake(videoX, camererY , imageWH, imageWH);

    CGFloat notesY = CGRectGetMaxY(self.video.frame) + 4 *margin;
    self.notes.frame = CGRectMake(camererX, notesY, imageWH, imageWH);

    self.timeVideo.frame = CGRectMake(videoX , notesY, imageWH, imageWH);
}

#pragma mark 点击各item调用的方法
//照相
- (void)camererButtonClik {

    ZCViewControllerDispatchMediation *mediationVc =[ZCViewControllerDispatchMediation shareViewControllerDispatchMediation];

    [mediationVc dispatchViewControllerWithVc:self type:kCamererVc paramers:nil];

}
- (void)videoButtonClik {

    ZCViewControllerDispatchMediation *mediationVc =[ZCViewControllerDispatchMediation shareViewControllerDispatchMediation];
    [mediationVc dispatchViewControllerWithVc:self type:kVideoVc paramers:nil];

}
- (void)notesButtonClik {

}
- (void)timeVideoButtonClik {

    ZCViewControllerDispatchMediation *mediationVc =[ZCViewControllerDispatchMediation shareViewControllerDispatchMediation];
    [mediationVc dispatchViewControllerWithVc:self type:kTimeVideoVc paramers:nil];
}

#pragma mark 子控件懒加载方法,懒加载方法往后,这样不影响主逻辑
- (UIImageView *)icon {

    if (_icon == nil) {

        self.icon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"camerer"]];
    }
    return _icon;
}
- (UILabel *)titleLabel {

    if (_titleLabel == nil) {

        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.text = @"随手记";
        self.titleLabel.contentMode = UIViewContentModeCenter;
        self.titleLabel.textColor = [UIColor whiteColor];
        self.titleLabel.font = [UIFont systemFontOfSize:30];
    }
    return _titleLabel;
}
- (UILabel *)descLabel {
    if (_descLabel == nil) {
        self.descLabel = [[UILabel alloc] init];
        self.descLabel.text = @"记录生活点滴";
        self.descLabel.textColor = [UIColor whiteColor];
        self.descLabel.font = [UIFont systemFontOfSize:15];
        self.descLabel.contentMode = UIViewContentModeCenter;
    }
    return _descLabel;
}
- (ZCItemView *)camerer{
    if (_camerer == nil) {

        self.camerer = [[ZCItemView alloc] init];
        [self.camerer configItemViewWithImageName:@"camerer" title:@"拍照" backgroundColor:  [UIColor colorWithRed:222/255.0 green:47/255.0 blue:120/255.0 alpha:1.0] tagert:self action:@selector(camererButtonClik)];

    }
    return _camerer;
}

- (ZCItemView *)video{

    if (_video == nil) {

        self.video =  [[ZCItemView alloc] init];

        [self.video configItemViewWithImageName:@"video" title:@"视频自拍" backgroundColor: [UIColor colorWithRed:245/255.0 green:184/255.0 blue:14/255.0 alpha:1.0]
                                         tagert:self action:@selector(videoButtonClik)];

    }
    return _video;
}

- (ZCItemView *)timeVideo{
    if (_timeVideo == nil) {

        self.timeVideo =  [[ZCItemView alloc] init];

        [self.timeVideo configItemViewWithImageName:@"timeVideo" title:@"TV直播" backgroundColor: [UIColor colorWithRed:113/255.0 green:58/255.0 blue:161/255.0 alpha:1.0] tagert:self action:@selector(timeVideoButtonClik)];

    }
    return _timeVideo;
}
- (ZCItemView *)notes{
    if (_notes == nil) {

        self.notes =  [[ZCItemView alloc] init];

        [self.notes configItemViewWithImageName:@"notes" title:@"日记" backgroundColor: [UIColor colorWithRed:113/255.0 green:58/255.0 blue:161/255.0 alpha:1.0] tagert:self action:@selector(notesButtonClik)];
    }
    return _notes;
}

@end


text:
define(['jquery', 'modernizr', 'domready!'],
function($, Modernizr) {
  var CompatManager = (function() {
    var _this = this;

    // Holds all registered compat modules, keyed
    // by name.
    var all = {};

    // Registers a compat module.
    //
    // The module is identified by its name.
    //
    // It will load when the precondition is true. The precondition
    // argument may either by a callback or a boolean.
    //
    // The load function will receive a promise as its first parameter
    // which must be resolved when the loading finished.
    var register = function(name, precondition, load) {
      _this.all[name] = function(dfr) {
        if (($.isFunction(precondition) && precondition()) || precondition) {
          load(dfr);
        }
      };
    };

    // Returns an array of available compat modules names.
    var available = function() {
        var keys = [];
        $.each(_this.all, function(k, v) { keys.push(k); });
        return keys;
    };

    // Runs the selected or when the first argument is omitted
    // all available compat modules. Returns a promise which
    // will resovle when all compat modules finished loading.
    var run = function(selected) {
      var dfrs = [];

      $.each(selected || _this.available(), function(v) {
        var dfr = new $.Deferred();

        if (!_this.all.hasOwnProperty(v)) {
          dfr.reject();
        } else if ($.inArray(v, window.Compat.applied) === -1) {
          _this.all[v](dfr);

          dfr.done(function() {
            window.Compat.applied.push(v);
          });
        } else {
          dfr.resolve();
        }
        dfrs.push(dfr);
      });

      return dfrs ? $.when.apply(dfrs) : (new $.Deferred()).resolve();
    };

    // Global storage for already applied modules.
    if (!window.Compat) {
      window.Compat = {
        applied: []
      };
    }

    return {
      available: available,
      register: register,
      run: run
    };
  })();

  CompatManager.register('inputDate', !Modernizr.inputtypes.date, function(dfr) {
    require(['inputDate', 'moment'], function(P, moment) {
      P.pattern = '[0-9]{1,2}.[0-9]{1,2}.[0-9]{4}';
      P.placeholder = 'tt.mm.jjjj';

      P.canonicalize = function(value) {
        var parsed = moment(value, 'DD.MM.YYYY');

        if (!parsed.isValid()) {
           return value;
        }
        return parsed.format('YYYY-MM-DD');
      };
      P.localize = function(value) {
        var parsed = moment(value, 'YYYY-MM-DD');

        if (!parsed || !parsed.isValid()) {
           return value;
        }
        return parsed.format('DD.MM.YYYY');
      };

      P.make('input[type="date"]');
      dfr.resolve();
    });
  });

  CompatManager.register(
    'balanceText',
    function() {
      var style = document.documentElement.style;
      return !(style.textWrap || style.WebkitTextWrap || style.MozTextWrap || style.MsTextWrap || style.OTextWrap);
    },
    function(dfr) {
      require(['balanceText'], dfr.resolve);
      // Script automatically intializes on CSS class .balance-text.
    }
  );

  CompatManger.register('animationFrame', !window.requestAnimationFrame, function(dfr) {
      require(['animationFrame'], dfr.resolve);
  });

  return CompatManager;
});


text:
require "mpt_tree/engine"

module MptTree

  def acts_as_tree
    has_one :mpt_tree_node, :as=>:tree, :dependent=>:destroy, :class_name=>"MptTree::Node"
    default_scope lambda {joins(:mpt_tree_node).order('mpt_tree_nodes.lft')}

    class_eval do
      def make_it_root
        create_mpt_tree_node #unless MptTree::Node.root_created? self.class.name
        self.reload
      end

      def tree
        node_ids = mpt_tree_node.tree
        self.class.name.constantize.where(:id => node_ids)
      end

      def insert(node)
        raise "can not be inserted! node already have parent." if node.mpt_tree_node
        mpt_tree_node.insert(node)
      end

      def parent
        ancestors.last
      end

      def siblings
        parent.nodes_at_level(level(parent)) - [self]
      end

      def children
        nodes_at_level(1)
      end

      def self.root
        name.constantize.first
      end

      def root?
         (level(self.class.name.constantize.first) == 0) ? true : false
      end

      def leaf?
        !children.present?
      end

      def ancestors
        node_ids = mpt_tree_node.ancestors
        self.class.name.constantize.where(:id => node_ids)
      end

      def self_with_ancestors
        ancestors << self
      end

      def level(parent=nil)
        mpt_tree_node.level(parent)
      end

      def nodes_at_level(level)
        nodes = Array.new
        tree.each do |node|
          nodes << node if node.level(self) == level
        end
        nodes
      end

      def change_parent(node)
        mpt_tree_node.destroy
        self.reload
        node.insert(self)
      end

      alias_method :<<, :insert
    end
  end
end


text:
package com.crowdshelf.app.ui.fragments;

import android.content.Context;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;

import com.crowdshelf.app.io.DbEvent;
import com.crowdshelf.app.io.ScannerEvent;
import com.crowdshelf.app.ui.activities.MainTabbedActivity;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import com.mixpanel.android.mpmetrics.MixpanelAPI;
import com.squareup.otto.Subscribe;

import java.util.ArrayList;
import java.util.List;

import me.dm7.barcodescanner.zxing.ZXingScannerView;
import ntnu.stud.markul.crowdshelf.R;

/**
 * Created by markuslund92 on 14.09.15.
 */
public class ScannerFragment extends Fragment implements ZXingScannerView.ResultHandler {
    private static final String TAG = "ScannerFragment";
    private static final String FLASH_STATE = "FLASH_STATE";
    private static final String AUTO_FOCUS_STATE = "AUTO_FOCUS_STATE";
    private static final String SELECTED_FORMATS = "SELECTED_FORMATS";
    private static final String CAMERA_ID = "CAMERA_ID";
    private ZXingScannerView mScannerView;
    private boolean mFlash;
    private boolean mAutoFocus;
    private ArrayList<Integer> mSelectedIndices;
    private int mCameraId = -1;
    private ScannerScreenFragment.OnScannerScreenInteractionListener mListener;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state) {
        MainTabbedActivity.getBus().register(this);
        mScannerView = new ZXingScannerView(getActivity());
        if (state != null) {
            mFlash = state.getBoolean(FLASH_STATE, false);
            mAutoFocus = state.getBoolean(AUTO_FOCUS_STATE, true);
            mSelectedIndices = state.getIntegerArrayList(SELECTED_FORMATS);
            mCameraId = state.getInt(CAMERA_ID, -1);
        } else {
            mFlash = false;
            mAutoFocus = true;
            mSelectedIndices = null;
            mCameraId = -1;
        }
        setupFormats();
        return mScannerView;
    }

    @Override
    public void onCreate(Bundle state) {
        super.onCreate(state);
        setHasOptionsMenu(false);
    }

    @Subscribe
    public void handleScannerEvents(ScannerEvent event) {
        Log.i(TAG, "Handle Scanner Event: " + event.getScannerEventType());
        switch (event.getScannerEventType()) {
            case TURN_SCANNER_OFF:
//                try{
//                    mScannerView.stopCamera();
//                }catch (Exception e){
//                    e.printStackTrace();
//                }

                break;
            case TURN_SCANNER_ON:
//                try{
////                    mScannerView.setResultHandler(this);
//                    mScannerView.startCamera(mCameraId);
////                    mScannerView.setFlash(mFlash);
////                    mScannerView.setAutoFocus(mAutoFocus);
//                }catch (Exception e){
//                    e.printStackTrace();
//                }

                break;
        }
    }

                public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        super.onCreateOptionsMenu(menu, inflater);

        MenuItem menuItem;

        if (mFlash) {
            menuItem = menu.add(Menu.NONE, R.id.menu_flash, 0, R.string.flash_on);
        } else {
            menuItem = menu.add(Menu.NONE, R.id.menu_flash, 0, R.string.flash_off);
        }
        MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_ALWAYS);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle presses on the action bar items
        switch (item.getItemId()) {
            case R.id.menu_flash:
                mFlash = !mFlash;
                if (mFlash) {
                    item.setTitle(R.string.flash_on);
                } else {
                    item.setTitle(R.string.flash_off);
                }
                mScannerView.setFlash(mFlash);
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        mScannerView.setResultHandler(this);
        mScannerView.startCamera(mCameraId);
        mScannerView.setFlash(mFlash);
        mScannerView.setAutoFocus(mAutoFocus);
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBoolean(FLASH_STATE, mFlash);
        outState.putBoolean(AUTO_FOCUS_STATE, mAutoFocus);
        outState.putIntegerArrayList(SELECTED_FORMATS, mSelectedIndices);
        outState.putInt(CAMERA_ID, mCameraId);
    }

    @Override
    public void handleResult(Result rawResult) {
        try {
            Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
            Ringtone r = RingtoneManager.getRingtone(getActivity().getApplicationContext(), notification);
            r.play();
            MainTabbedActivity.getMixpanel().track("BookScanned");
        } catch (Exception e) {
        }
        mListener.isbnReceived(rawResult.getText());
        mScannerView.startCamera(mCameraId);
        mScannerView.setFlash(mFlash);
        mScannerView.setAutoFocus(mAutoFocus);
    }

    public void setupFormats() {
        List<BarcodeFormat> formats = new ArrayList<>();
        if (mSelectedIndices == null || mSelectedIndices.isEmpty()) {
            mSelectedIndices = new ArrayList<>();
            for (int i = 0; i < ZXingScannerView.ALL_FORMATS.size(); i++) {
                mSelectedIndices.add(i);
            }
        }

        for (int index : mSelectedIndices) {
            formats.add(ZXingScannerView.ALL_FORMATS.get(index));
        }
        if (mScannerView != null) {
            mScannerView.setFormats(formats);
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        Log.i(TAG, "onPause");
        mScannerView.stopCamera();
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);

        if (context instanceof MainTabbedActivity) {
            Log.i(TAG, "onAttach, is MainTabbedActivity");
            try {
                mListener = (ScannerScreenFragment.OnScannerScreenInteractionListener) context;
            } catch (ClassCastException e) {
                throw new ClassCastException(context.toString()
                        + " must implement OnUserScreenFragmentInteractionListener");
            }
        }
    }
}


text:
.class Lcom/samsung/android/settings/notification/BlockNotificationList$SummaryProvider;
.super Ljava/lang/Object;
.source "BlockNotificationList.java"

# interfaces
.implements Lcom/android/settings/dashboard/SummaryLoader$SummaryProvider;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/samsung/android/settings/notification/BlockNotificationList;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "SummaryProvider"
.end annotation

# instance fields
.field private final mContext:Landroid/content/Context;

.field private final mSummaryLoader:Lcom/android/settings/dashboard/SummaryLoader;

# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/android/settings/dashboard/SummaryLoader;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/samsung/android/settings/notification/BlockNotificationList$SummaryProvider;->mContext:Landroid/content/Context;

    iput-object p2, p0, Lcom/samsung/android/settings/notification/BlockNotificationList$SummaryProvider;->mSummaryLoader:Lcom/android/settings/dashboard/SummaryLoader;

    return-void
.end method

# virtual methods
.method public setListening(Z)V
    .locals 3

    if-eqz p1, :cond_0

    iget-object v0, p0, Lcom/samsung/android/settings/notification/BlockNotificationList$SummaryProvider;->mSummaryLoader:Lcom/android/settings/dashboard/SummaryLoader;

    iget-object v1, p0, Lcom/samsung/android/settings/notification/BlockNotificationList$SummaryProvider;->mContext:Landroid/content/Context;

    const v2, 0x7f12138a    # 1.9416874E38f

    invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, p0, v1}, Lcom/android/settings/dashboard/SummaryLoader;->setSummary(Lcom/android/settings/dashboard/SummaryLoader$SummaryProvider;Ljava/lang/CharSequence;)V

    :cond_0
    return-void
.end method


text:
void doOneBitMaskImages(CGContextRef context);

void doMaskImageWithMaskFromURL(CGContextRef context,
					CFURLRef imageURL, size_t imagewidth,
				    size_t imageheight, size_t bitsPerComponent,
				    CFURLRef theMaskingImageURL, size_t maskwidth,
				    size_t maskheight);

void doMaskImageWithColorFromURL(CGContextRef context, CFURLRef url,
 					size_t width, size_t height,
					Boolean isColor);

void exportImageWithMaskFromURLWithDestination(CGContextRef context,
				    CFURLRef imageURL, size_t imagewidth,
				    size_t imageheight, size_t bitsPerComponent,
				    CFURLRef theMaskingImageURL, size_t maskwidth,
				    size_t maskheight);

void doMaskImageWithGrayImageFromURL(CGContextRef context, CFURLRef imageURL, size_t imagewidth,
				    size_t imageheight, size_t bitsPerComponent,
				    CFURLRef theMaskingImageURL, size_t maskwidth,
				    size_t maskheight);

void drawWithClippingMask(CGContextRef context,
				CFURLRef theMaskingImageURL,  size_t maskwidth,
				size_t maskheight);

#endif	// __ImageMasking__


text:
package gov.healthit.chpl.domain;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.springframework.util.StringUtils;

import gov.healthit.chpl.dto.CQMResultCriteriaDTO;
import gov.healthit.chpl.dto.CQMResultDetailsDTO;

public class CQMResultCriteria {

	private Long id;
	private Long criteriaId;
	private String criteriaNumber;

	public CQMResultCriteria(){

	}

	public CQMResultCriteria(CQMResultCriteriaDTO dto){
		this.id = dto.getId();
		this.criteriaId = dto.getCriterionId();
		if(dto.getCriterion() != null) {
			this.criteriaNumber = dto.getCriterion().getNumber();
		}
	}

	public Long getId() {
		return id;
	}

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

	public Long getCriteriaId() {
		return criteriaId;
	}

	public void setCriteriaId(Long criteriaId) {
		this.criteriaId = criteriaId;
	}

	public String getCriteriaNumber() {
		return criteriaNumber;
	}

	public void setCriteriaNumber(String criteriaNumber) {
		this.criteriaNumber = criteriaNumber;
	}
}


text:
Template['header'].helpers({
  activeRouteClass: function(/*route names */) {
      var args = Array.prototype.slice.call(arguments, 0);

      args.pop();

      var active = _.any(args, function(name) {
        return Router.current() && Router.current().route.name === name;
      });

      return active && 'active';
    },
  username: function() {
    console.log(Meteor.user());
    if(Meteor.user()) {
      return Meteor.user().username;
    }

  }
});

Template['header'].events({
    // 'click .dropdown.item' : function () {
    //     // As long as the new Meteor UI isn't out the whole template will re-render
    //
    //     // $('.demo.sidebar').sidebar('toggle');
    //     $('.header-wrapper').toggleClass('active');
    //     $('.angle.icon').toggleClass('down').toggleClass('up');
    // }
});
Template['header'].rendered = function () {

};


text:
package io.airlift.discovery.client;

import com.google.common.collect.ImmutableList;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static java.util.Objects.requireNonNull;

public class HttpServiceSelectorImpl
        implements HttpServiceSelector
{
    private final ServiceSelector serviceSelector;

    public HttpServiceSelectorImpl(ServiceSelector serviceSelector)
    {
        requireNonNull(serviceSelector, "serviceSelector is null");
        this.serviceSelector = serviceSelector;
    }

    @Override
    public String getType()
    {
        return serviceSelector.getType();
    }

    @Override
    public String getPool()
    {
        return serviceSelector.getPool();
    }

    @Override
    public List<URI> selectHttpService()
    {
        List<ServiceDescriptor> serviceDescriptors = new ArrayList<>(serviceSelector.selectAllServices());
        if (serviceDescriptors.isEmpty()) {
            return ImmutableList.of();
        }

        // favor https over http
        List<URI> httpsUri = new ArrayList<>();
        for (ServiceDescriptor serviceDescriptor : serviceDescriptors) {
            String https = serviceDescriptor.getProperties().get("https");
            if (https != null) {
                try {
                    httpsUri.add(new URI(https));
                }
                catch (URISyntaxException ignored) {
                }
            }
        }
        List<URI> httpUri = new ArrayList<>();
        for (ServiceDescriptor serviceDescriptor : serviceDescriptors) {
            String http = serviceDescriptor.getProperties().get("http");
            if (http != null) {
                try {
                    httpUri.add(new URI(http));
                }
                catch (URISyntaxException ignored) {
                }
            }
        }

        // return random(https) + random(http)
        Collections.shuffle(httpsUri);
        Collections.shuffle(httpUri);
        return ImmutableList.<URI>builder().addAll(httpsUri).addAll(httpUri).build();
    }
}


text:
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Extensions;

namespace Umbraco.Cms.Core.Strings
{
    /// <summary>
    /// New default implementation of string functions for short strings such as aliases or URL segments.
    /// </summary>
    /// <remarks>
    /// <para>Not optimized to work on large bodies of text.</para>
    /// <para>Meant to replace <c>LegacyShortStringHelper</c> where/when backward compatibility is not an issue.</para>
    /// <para>NOTE: pre-filters run _before_ the string is re-encoded.</para>
    /// </remarks>
    public class DefaultShortStringHelper : IShortStringHelper
    {
        #region Ctor, consts and vars

        public DefaultShortStringHelper(IOptions<RequestHandlerSettings> settings)
        {
            _config = new DefaultShortStringHelperConfig().WithDefault(settings.Value);
        }

        // clones the config so it cannot be changed at runtime
        public DefaultShortStringHelper(DefaultShortStringHelperConfig config)
        {
            _config = config.Clone();
        }

        // see notes for CleanAsciiString
        //// beware! the order is quite important here!
        //const string ValidStringCharactersSource = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        //readonly static char[] ValidStringCharacters;

        private readonly DefaultShortStringHelperConfig _config;

        // see notes for CleanAsciiString
        //static DefaultShortStringHelper()
        //{
        //    ValidStringCharacters = ValidStringCharactersSource.ToCharArray();
        //}

        #endregion

        #region Filters

        // ok to be static here because it's not configurable in any way
        private static readonly char[] InvalidFileNameChars =
            Path.GetInvalidFileNameChars()
            .Union("!*'();:@&=+$,/?%#[]-~{}\"<>\\^`| ".ToCharArray())
            .Distinct()
            .ToArray();

        public static bool IsValidFileNameChar(char c)
        {
            return InvalidFileNameChars.Contains(c) == false;
        }

        #endregion

        #region IShortStringHelper CleanFor...

        /// <summary>
        /// Cleans a string to produce a string that can safely be used in an alias.
        /// </summary>
        /// <param name="text">The text to filter.</param>
        /// <returns>The safe alias.</returns>
        /// <remarks>
        /// <para>The string will be cleaned in the context of the default culture.</para>
        /// <para>Safe aliases are Ascii only.</para>
        /// </remarks>
        public virtual string CleanStringForSafeAlias(string text)
        {
            return CleanStringForSafeAlias(text, _config.DefaultCulture);
        }

        /// <summary>
        /// Cleans a string, in the context of a specified culture, to produce a string that can safely be used in an alias.
        /// </summary>
        /// <param name="text">The text to filter.</param>
        /// <param name="culture">The culture.</param>
        /// <returns>The safe alias.</returns>
        /// <remarks>
        /// <para>Safe aliases are Ascii only.</para>
        /// </remarks>
        public virtual string CleanStringForSafeAlias(string text, string culture)
        {
            return CleanString(text, CleanStringType.Alias, culture);
        }

        /// <summary>
        /// Cleans a string to produce a string that can safely be used in an URL segment.
        /// </summary>
        /// <param name="text">The text to filter.</param>
        /// <returns>The safe URL segment.</returns>
        /// <remarks>
        /// <para>The string will be cleaned in the context of the default culture.</para>
        /// <para>Url segments are Ascii only (no accents...).</para>
        /// </remarks>
        public virtual string CleanStringForUrlSegment(string text)
        {
            return CleanStringForUrlSegment(text, _config.DefaultCulture);
        }

        /// <summary>
        /// Cleans a string, in the context of a specified culture, to produce a string that can safely be used in an URL segment.
        /// </summary>
        /// <param name="text">The text to filter.</param>
        /// <param name="culture">The culture.</param>
        /// <returns>The safe URL segment.</returns>
        /// <remarks>
        /// <para>Url segments are Ascii only (no accents...).</para>
        /// </remarks>
        public virtual string CleanStringForUrlSegment(string text, string? culture)
        {
            return CleanString(text, CleanStringType.UrlSegment, culture);
        }

        /// <summary>
        /// Cleans a string, in the context of the default culture, to produce a string that can safely be used as a filename,
        /// both internally (on disk) and externally (as a URL).
        /// </summary>
        /// <param name="text">The text to filter.</param>
        /// <returns>The safe filename.</returns>
        /// <remarks>Legacy says this was used to "overcome an issue when Umbraco is used in IE in an intranet environment" but that issue is not documented.</remarks>
        public virtual string CleanStringForSafeFileName(string text)
        {
            return CleanStringForSafeFileName(text, _config.DefaultCulture);
        }

        /// <summary>
        /// Cleans a string to produce a string that can safely be used as a filename,
        /// both internally (on disk) and externally (as a URL).
        /// </summary>
        /// <param name="text">The text to filter.</param>
        /// <param name="culture">The culture.</param>
        /// <returns>The safe filename.</returns>
        public virtual string CleanStringForSafeFileName(string text, string culture)
        {
            if (string.IsNullOrWhiteSpace(text))
                return string.Empty;

            culture = culture ?? "";
            text = text.ReplaceMany(Path.GetInvalidFileNameChars(), '-');

            var name = Path.GetFileNameWithoutExtension(text);
            var ext = Path.GetExtension(text); // includes the dot, empty if no extension

            Debug.Assert(name != null, "name != null");
            if (name.Length > 0)
                name = CleanString(name, CleanStringType.FileName, culture);
            Debug.Assert(ext != null, "ext != null");
            if (ext.Length > 0)
                ext = CleanString(ext.Substring(1), CleanStringType.FileName, culture);

            return ext.Length > 0 ? (name + "." + ext) : name;
        }

        #endregion

        #region CleanString

        // MS rules & guidelines:
        // - Do capitalize both characters of two-character acronyms, except the first word of a camel-cased identifier.
        //     eg "DBRate" (pascal) or "ioHelper" (camel) - "SpecialDBRate" (pascal) or "specialIOHelper" (camel)
        // - Do capitalize only the first character of acronyms with three or more characters, except the first word of a camel-cased identifier.
        //     eg "XmlWriter (pascal) or "htmlReader" (camel) - "SpecialXmlWriter" (pascal) or "specialHtmlReader" (camel)
        // - Do not capitalize any of the characters of any acronyms, whatever their length, at the beginning of a camel-cased identifier.
        //     eg "xmlWriter" or "dbWriter" (camel)
        //
        // Our additional stuff:
        // - Leading digits are removed.
        // - Many consecutive separators are folded into one unique separator.

        private const byte StateBreak = 1;
        private const byte StateUp = 2;
        private const byte StateWord = 3;
        private const byte StateAcronym = 4;

        /// <summary>
        /// Cleans a string.
        /// </summary>
        /// <param name="text">The text to clean.</param>
        /// <param name="stringType">A flag indicating the target casing and encoding of the string. By default,
        /// strings are cleaned up to camelCase and Ascii.</param>
        /// <returns>The clean string.</returns>
        /// <remarks>The string is cleaned in the context of the default culture.</remarks>
        public string CleanString(string text, CleanStringType stringType)
        {
            return CleanString(text, stringType, _config.DefaultCulture, null);
        }

        /// <summary>
        /// Cleans a string, using a specified separator.
        /// </summary>
        /// <param name="text">The text to clean.</param>
        /// <param name="stringType">A flag indicating the target casing and encoding of the string. By default,
        /// strings are cleaned up to camelCase and Ascii.</param>
        /// <param name="separator">The separator.</param>
        /// <returns>The clean string.</returns>
        /// <remarks>The string is cleaned in the context of the default culture.</remarks>
        public string CleanString(string text, CleanStringType stringType, char separator)
        {
            return CleanString(text, stringType, _config.DefaultCulture, separator);
        }

        /// <summary>
        /// Cleans a string in the context of a specified culture.
        /// </summary>
        /// <param name="text">The text to clean.</param>
        /// <param name="stringType">A flag indicating the target casing and encoding of the string. By default,
        /// strings are cleaned up to camelCase and Ascii.</param>
        /// <param name="culture">The culture.</param>
        /// <returns>The clean string.</returns>
        public string CleanString(string text, CleanStringType stringType, string? culture)
        {
            return CleanString(text, stringType, culture, null);
        }

        /// <summary>
        /// Cleans a string in the context of a specified culture, using a specified separator.
        /// </summary>
        /// <param name="text">The text to clean.</param>
        /// <param name="stringType">A flag indicating the target casing and encoding of the string. By default,
        /// strings are cleaned up to camelCase and Ascii.</param>
        /// <param name="separator">The separator.</param>
        /// <param name="culture">The culture.</param>
        /// <returns>The clean string.</returns>
        public string CleanString(string text, CleanStringType stringType, char separator, string culture)
        {
            return CleanString(text, stringType, culture, separator);
        }

        protected virtual string CleanString(string text, CleanStringType stringType, string? culture, char? separator)
        {
            // be safe
            if (text == null) throw new ArgumentNullException(nameof(text));
            culture = culture ?? "";

            // get config
            var config = _config.For(stringType, culture);
            stringType = config.StringTypeExtend(stringType);

            // apply defaults
            if ((stringType & CleanStringType.CaseMask) == CleanStringType.None)
                stringType |= CleanStringType.CamelCase;
            if ((stringType & CleanStringType.CodeMask) == CleanStringType.None)
                stringType |= CleanStringType.Ascii;

            // use configured unless specified
            separator = separator ?? config.Separator;

            // apply pre-filter
            if (config.PreFilter != null)
                text = config.PreFilter(text);

            // apply replacements
            //if (config.Replacements != null)
            //    text = ReplaceMany(text, config.Replacements);

            // recode
            var codeType = stringType & CleanStringType.CodeMask;
            switch (codeType)
            {
                case CleanStringType.Ascii:
                    text = Utf8ToAsciiConverter.ToAsciiString(text);
                    break;
                case CleanStringType.TryAscii:
                    const char ESC = (char) 27;
                    var ctext = Utf8ToAsciiConverter.ToAsciiString(text, ESC);
                    if (ctext.Contains(ESC) == false) text = ctext;
                    break;
                default:
                    text = RemoveSurrogatePairs(text);
                    break;
            }

            // clean
            text = CleanCodeString(text, stringType, separator.Value, culture, config);

            // apply post-filter
            if (config.PostFilter != null)
                text = config.PostFilter(text);

            return text;
        }

        private static string RemoveSurrogatePairs(string text)
        {
            var input = text.ToCharArray();
            var output = new char[input.Length];
            var opos = 0;

            for (var ipos = 0; ipos < input.Length; ipos++)
            {
                var c = input[ipos];
                if (char.IsSurrogate(c)) // ignore high surrogate
                {
                    ipos++; // and skip low surrogate
                    output[opos++] = '?';
                }
                else
                {
                    output[opos++] = c;
                }
            }

            return new string(output, 0, opos);
        }

        // here was a subtle, ascii-optimized version of the cleaning code, and I was
        // very proud of it until benchmarking showed it was an order of magnitude slower
        // that the utf8 version. Micro-optimizing sometimes isn't such a good idea.

        // note: does NOT support surrogate pairs in text
        internal string CleanCodeString(string text, CleanStringType caseType, char separator, string culture, DefaultShortStringHelperConfig.Config config)
        {
            int opos = 0, ipos = 0;
            var state = StateBreak;

            culture = culture ?? "";
            caseType &= CleanStringType.CaseMask;

            // if we apply global ToUpper or ToLower to text here
            // then we cannot break words on uppercase chars
            var input = text;

            // it's faster to use an array than a StringBuilder
            var ilen = input.Length;
            var output = new char[ilen * 2]; // twice the length should be OK in all cases

            for (var i = 0; i < ilen; i++)
            {
                var c = input[i];
                // leading as long as StateBreak and ipos still zero
                var leading = state == StateBreak && ipos == 0;
                var isTerm = config.IsTerm(c, leading);

                //var isDigit = char.IsDigit(c);
                var isUpper = char.IsUpper(c); // false for digits, symbols...
                //var isLower = char.IsLower(c); // false for digits, symbols...

                // what should I do with surrogates? - E.g emojis like 🎈
                // no idea, really, so they are not supported at the moment and we just continue
                var isPair = char.IsSurrogate(c);
                if (isPair)
                {
                    continue;
                }

                switch (state)
                {
                    // within a break
                    case StateBreak:
                        // begin a new term if char is a term char,
                        // and ( pos > 0 or it's also a valid leading char )
                        if (isTerm)
                        {
                            ipos = i;
                            if (opos > 0 && separator != char.MinValue)
                                output[opos++] = separator;
                            state = isUpper ? StateUp : StateWord;
                        }
                        break;

                    // within a term / word
                    case StateWord:
                        // end a term if char is not a term char,
                        // or ( it's uppercase and we break terms on uppercase)
                        if (isTerm == false || (config.BreakTermsOnUpper && isUpper))
                        {
                            CopyTerm(input, ipos, output, ref opos, i - ipos, caseType, culture, false);
                            ipos = i;
                            state = isTerm ? StateUp : StateBreak;
                            if (state != StateBreak && separator != char.MinValue)
                                output[opos++] = separator;
                        }
                        break;

                    // within a term / acronym
                    case StateAcronym:
                        // end an acronym if char is not a term char,
                        // or if it's not uppercase / config
                        if (isTerm == false || (config.CutAcronymOnNonUpper && isUpper == false))
                        {
                            // whether it's part of the acronym depends on whether we're greedy
                            if (isTerm && config.GreedyAcronyms == false)
                                i -= 1; // handle that char again, in another state - not part of the acronym
                            if (i - ipos > 1) // single-char can't be an acronym
                            {
                                CopyTerm(input, ipos, output, ref opos, i - ipos, caseType, culture, true);
                                ipos = i;
                                state = isTerm ? StateWord : StateBreak;
                                if (state != StateBreak && separator != char.MinValue)
                                    output[opos++] = separator;
                            }
                            else if (isTerm)
                            {
                                state = StateWord;
                            }
                        }
                        else if (isUpper == false) // isTerm == true
                        {
                            // it's a term char and we don't cut...
                            // keep moving forward as a word
                            state = StateWord;
                        }
                        break;

                    // within a term / uppercase = could be a word or an acronym
                    case StateUp:
                        if (isTerm)
                        {
                            // add that char to the term and pick word or acronym
                            state = isUpper ? StateAcronym : StateWord;
                        }
                        else
                        {
                            // single char, copy then break
                            CopyTerm(input, ipos, output, ref opos, 1, caseType, culture, false);
                            state = StateBreak;
                        }
                        break;

                    default:
                        throw new Exception("Invalid state.");
                }
            }

            switch (state)
            {
                case StateBreak:
                    break;

                case StateWord:
                    CopyTerm(input, ipos, output, ref opos, input.Length - ipos, caseType, culture, false);
                    break;

                case StateAcronym:
                case StateUp:
                    CopyTerm(input, ipos, output, ref opos, input.Length - ipos, caseType, culture, true);
                    break;

                default:
                    throw new Exception("Invalid state.");
            }

            return new string(output, 0, opos);
        }

        // note: supports surrogate pairs in input string
        internal void CopyTerm(string input, int ipos, char[] output, ref int opos, int len,
            CleanStringType caseType, string culture, bool isAcronym)
        {
            var term = input.Substring(ipos, len);
            var cultureInfo = string.IsNullOrEmpty(culture) ? CultureInfo.InvariantCulture : CultureInfo.GetCultureInfo(culture);

            if (isAcronym)
            {
                if ((caseType == CleanStringType.CamelCase && len <= 2 && opos > 0) ||
                        (caseType == CleanStringType.PascalCase && len <= 2) ||
                        (caseType == CleanStringType.UmbracoCase))
                    caseType = CleanStringType.Unchanged;
            }

            // note: MSDN seems to imply that ToUpper or ToLower preserve the length
            // of the string, but that this behavior is not guaranteed and could change.

            char c;
            int i;
            string s;
            switch (caseType)
            {
                //case CleanStringType.LowerCase:
                //case CleanStringType.UpperCase:
                case CleanStringType.Unchanged:
                    term.CopyTo(0, output, opos, len);
                    opos += len;
                    break;

                case CleanStringType.LowerCase:
                    term = term.ToLower(cultureInfo);
                    term.CopyTo(0, output, opos, term.Length);
                    opos += term.Length;
                    break;

                case CleanStringType.UpperCase:
                    term = term.ToUpper(cultureInfo);
                    term.CopyTo(0, output, opos, term.Length);
                    opos += term.Length;
                    break;

                case CleanStringType.CamelCase:
                    c = term[0];
                    i = 1;
                    if (char.IsSurrogate(c))
                    {
                        s = term.Substring(ipos, 2);
                        s = opos == 0 ? s.ToLower(cultureInfo) : s.ToUpper(cultureInfo);
                        s.CopyTo(0, output, opos, s.Length);
                        opos += s.Length;
                        i++; // surrogate pair len is 2
                    }
                    else
                    {
                        output[opos] = opos++ == 0 ? char.ToLower(c, cultureInfo) : char.ToUpper(c, cultureInfo);
                    }
                    if (len > i)
                    {
                        term = term.Substring(i).ToLower(cultureInfo);
                        term.CopyTo(0, output, opos, term.Length);
                        opos += term.Length;
                    }
                    break;

                case CleanStringType.PascalCase:
                    c = term[0];
                    i = 1;
                    if (char.IsSurrogate(c))
                    {
                        s = term.Substring(ipos, 2);
                        s = s.ToUpper(cultureInfo);
                        s.CopyTo(0, output, opos, s.Length);
                        opos += s.Length;
                        i++; // surrogate pair len is 2
                    }
                    else
                    {
                        output[opos++] = char.ToUpper(c, cultureInfo);
                    }
                    if (len > i)
                    {
                        term = term.Substring(i).ToLower(cultureInfo);
                        term.CopyTo(0, output, opos, term.Length);
                        opos += term.Length;
                    }
                    break;

                case CleanStringType.UmbracoCase:
                    c = term[0];
                    i = 1;
                    if (char.IsSurrogate(c))
                    {
                        s = term.Substring(ipos, 2);
                        s = opos == 0 ? s : s.ToUpper(cultureInfo);
                        s.CopyTo(0, output, opos, s.Length);
                        opos += s.Length;
                        i++; // surrogate pair len is 2
                    }
                    else
                    {
                        output[opos] = opos++ == 0 ? c : char.ToUpper(c, cultureInfo);
                    }
                    if (len > i)
                    {
                        term = term.Substring(i);
                        term.CopyTo(0, output, opos, term.Length);
                        opos += term.Length;
                    }
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(caseType));
            }
        }

        #endregion

        #region SplitPascalCasing

        /// <summary>
        /// Splits a Pascal-cased string into a phrase separated by a separator.
        /// </summary>
        /// <param name="text">The text to split.</param>
        /// <param name="separator">The separator, which defaults to a whitespace.</param>
        /// <returns>The split text.</returns>
        /// <remarks>Supports Utf8 and Ascii strings, not Unicode strings.</remarks>
        // NOTE does not support surrogates pairs at the moment
        public virtual string SplitPascalCasing(string text, char separator)
        {
            // be safe
            if (text == null)
                throw new ArgumentNullException(nameof(text));

            var input = text.ToCharArray();
            var output = new char[input.Length * 2];
            var opos = 0;
            var a = input.Length > 0 ? input[0] : char.MinValue;
            var upos = char.IsUpper(a) ? 1 : 0;

            for (var i = 1; i < input.Length; i++)
            {
                var c = input[i];
                if (char.IsUpper(c))
                {
                    output[opos++] = a;
                    if (upos == 0)
                    {
                        if (opos > 0)
                            output[opos++] = separator;
                        upos = i + 1;
                    }
                }
                else
                {
                    if (upos > 0)
                    {
                        if (upos < i && opos > 0)
                            output[opos++] = separator;
                        upos = 0;
                    }
                    output[opos++] = a;
                }
                a = c;
            }
            if (a != char.MinValue)
                output[opos++] = a;
            return new string(output, 0, opos);
        }

        #endregion
    }
}


text:
namespace boost_no_long_long = empty_boost;
#endif

int main( int, char *[] )
{
   return boost_no_long_long::test();
}


text:
set -eo pipefail -o nounset

genome=https://raw.githubusercontent.com/gogetdata/ggd-recipes/master/genomes/Homo_sapiens/GRCh37/GRCh37.genome

wget --quiet -O - ftp://gsapubftp-anonymous@ftp.broadinstitute.org/bundle/b37/hapmap_3.3.b37.vcf.gz \
    | gzip -dc \
    | gsort /dev/stdin $genome \
    | bgzip -c > grch37-hapmap-broad-v1.vcf.gz

tabix grch37-hapmap-broad-v1.vcf.gz


text:
"""
Binder classes perform two functions through their format method

- given a query template with %(somevar)s python substition

    class MyClass(object):
        pass

    arg1 = MyClass()
    arg1.customer = 101

    default = MyClass()
    default.customer = 201
    arg2.country = "CAN"

    qry, sub = format("
        select *
        from customer
        where country = %(country)s
        and custid = %(customer)s", arg1, default)

    means that we will be fetching for country=CAN, custid=101

- the query template itself is transformed to a format
  that fits the underlying database's bind variable
  scheme which protects against sql injection attacks.

  For example, assuming an Oracle database (paramstyle="named")

  qry:
      "select * from customer where country = :country and custid = :customer"
  sub:
      {"country":"CAN", "customer" : 101}

  Postgres (paramstyle=""):

  qry:
      "select * from customer where country = :country and custid = :customer"
  sub:
      {"country":"CAN", "customer" : 101}

  a positional database (paramstyle="numeric") (NotImplementedError)
  would instead return

  qry:
      "select * from customer where country = :1 and custid = :2"
  sub:
      ["CAN", 101]

"""

import re

class Binder(object):
    """query template and substitution management - generic
    """

    def __init__(self, *args, **kwds):
        pass

    def format(self, tqry, *args):
        """
        :param tqry: query with optional substitution variables
                     Python style i.e.
                     select * from orders where custid = %(custid)s
        :param *args: zero or more arguments that will be checked
                      left-to-right, argument[<key>], getattr(argument,<key>)
        """

    def __repr__(self):
        msg = "%s paramstyle=%s" % (self.__class__.__name__, self.paramstyle)

        if hasattr(self, "supports"):
            msg += " supports: %s" % (self.supports)

        return msg

    def _case_sensitive(self, key):
        return [key]

    def _case_insensitive(self, key):
        if key == key.upper():
            return [key, key.lower()]
        if key == key.lower():
            return [key, key.upper()]
        return [key]

    _key_expand = _case_sensitive

    def _get_from_args(self, key_in):
        """generic way to look for a key in the arg list"""

        li_key = self._key_expand(key_in)

        for key in li_key:
            for arg in self.li_arg:
                try:
                    got = arg[key]
                    return got
                except (KeyError):
                    try:
                        # try getattr
                        got = getattr(arg, key)
                        return got
                    except AttributeError:
                        continue

                except (AttributeError, TypeError):
                    # no __getitem__, try getattr
                    try:
                        got = getattr(arg, key)
                        return got
                    except AttributeError:
                        continue

        try:
            raise KeyError(key_in)
        except Exception as e:
            raise

    @classmethod
    def factory(cls, paramstyle, case_insensitive=False):
        """
        return a Binder subclass instance appropriate
        to the underlying db library paramstyle bind variable

        :param paramstyle: parameter style string as per PEP-249
        :case_insensitive: %(custid)s will match {"custid":1} or {"CUSTID":2}, with priority
        going to the initial case.  mixed-case keys (custId) will only match {"custId":3}

        """

        try:
            inst = cls._di_paramstyle[paramstyle]()
            if case_insensitive:
                inst._key_expand = inst._case_insensitive

            return inst
        except KeyError:
            msg = """got:%s,
                  but expecting one of %s.
                  See
                  https://www.python.org/dev/peps/pep-0249/#paramstyle
                  for details""" % (
                paramstyle,
                "/".join(list(cls._di_paramstyle.keys())),
            )
            raise ValueError(msg)
        except NotImplementedError:
            msg = "%s is not implemented yet" % (paramstyle)
            raise NotImplementedError(msg)

    _di_paramstyle = {}

    # the regular expression pattern that looks for list type binds
    re_pattern_listsubstition = re.compile("%\([a-zA-Z0-9_]+\)l")

    # leading '__' variable name makes name clashes more unlikely
    T_LIST_KEYNAME = "%s_%03d__"

    # def _pre_process(self):
    #     """do nothing for now - intended to support list substitutions"""
    #     pass

    def _pre_process(self):
        li_listsubstition = self.re_pattern_listsubstition.findall(self.tqry)
        if li_listsubstition:
            self.preprocess_listsubstitution(li_listsubstition)

    def preprocess_listsubstitution(self, li_hit):
        """ this will transform %(xxx)l into %(__xxx_000)s, %(__xxx_001)s """

        di_list_sub = {}

        self.li_arg.insert(0, di_list_sub)

        for hit in li_hit:
            key = hit[2:-2]
            got = self._get_from_args(key)

            if not isinstance(got, (list, set)):
                raise ValueError(
                    "list substitutions require an iterable parameter: `%s` was of type `%s`"
                    % (key, type(got))
                )
                #
                # self.tqry = self.tqry.replace(hit, hit[:-1] + "s")
            else:

                li = []
                if not got:
                    # empty list or set
                    self.tqry = self.tqry.replace(hit, "NULL")
                    continue

                for ix, val in enumerate(got):
                    ikeyname = self.T_LIST_KEYNAME % (key, ix)
                    ikeyname_sub = "%%(%s)s" % (ikeyname)
                    di_list_sub[ikeyname] = val
                    li.append(ikeyname_sub)

                # replace the original bind %(xxx)l with
                # %(__xxx_000)s, %(__xxx_001)s, ...
                repval = ", ".join(li)
                self.tqry = self.tqry.replace(hit, repval)

class Binder_pyformat(Binder):
    """support Postgresql
       query template and substitution management for postgresql
       query is unchanged because postgresql is happy
       with %(somevar)s as a  bind
    """

    paramstyle = "pyformat"
    supports = "Postgresql"

    def _pre_process(self):
        li_listsubstition = self.re_pattern_listsubstition.findall(self.tqry)
        if li_listsubstition:
            self.preprocess_listsubstitution(li_listsubstition)

    def format(self, tqry, *args):
        """
        looks up substitutions and sets them up in dictionary self.sub

        postgresql accepts Python named variable so keeping the query as is

        select * from foo where bar = %(somebar)s"
        =>
        select * from foo where bar = %(somebar)s
        {"somebar" : value-found-for-somebar}
        """

        self.sub = {}
        self.li_arg = list(args)
        self.tqry = tqry

        self._pre_process()

        try:
            self.tqry % (self)
        except (Exception,) as e:
            raise

        # Postgresql query format stays as %(foo)s
        # so we just return the original query
        # (which _pre_process may have altered)
        return self.tqry, self.sub

    __call__ = format

    def __getitem__(self, key):
        if key in self.sub:
            return None

        got = self._get_from_args(key)
        self.sub[key] = got
        return None

PARAMSTYLE_QMARK = PARAMSTYLE_SQLITE = PARAMSTYLE_SQLSERVER = "qmark"

class BinderQmark(Binder):
    """ supports:  sqlite3, SQL Server
        query template and substitution management for sqlite3
        query changes from %(somevar)s to ?

        select * from foo where bar = %(somebar)s
        =>
        select * from foo where bar = ?,
        (value-found-for-somebar,)
    """

    paramstyle = PARAMSTYLE_QMARK
    supports = "sqlite3, mssql"
    qry_replace = "?"

    def format(self, tqry, *args):
        """
        looks up substitutions and sets them up in self.sub

        Note:
            Assuming both will be happy with a tuple.
            Might be one SQL Server needs a list instead.

        """
        self.tqry = tqry
        self._di_sub = {}
        self.sub = []
        self.li_arg = list(args)

        self._pre_process()

        try:
            qry = self.tqry % (self)
        except (Exception,) as e:
            raise

        return qry, tuple(self.sub)

    __call__ = format

    def __getitem__(self, key):
        """
        finds a substitution and append it to the bind list
        but also transforms the variable in the query to ?
        """

        qry_replace = self.qry_replace

        try:
            got = self._di_sub[key]
        except KeyError:
            got = self._di_sub[key] = self._get_from_args(key)

        self.sub.append(got)
        return qry_replace

class BinderFormat(BinderQmark):

    """supports: MySQL
       query template and substitution management for MySQL
       query changes from %(somevar)s to %s format
       parameters are (<var1>,<var2>,)

       Note: pretty much identical to BinderQmark/sqlite3
       except for the placeholder being %s

    """

    paramstyle = "format"
    supports = "MySQL"
    qry_replace = "%s"

class BinderNamed(Binder):
    """supports: Oracle
       query template and substitution management for Oracle
       query changes from %(somevar)s to :somevar format
       list-based substitutions:
           %(somelist)l :__somelist_000, :__somelist_001...
    """

    paramstyle = "named"
    supports = "Oracle"
    t_qry_replace = ":%s"

    def format(self, tqry, *args):
        """
        looks up substitutions and sets them up in self.sub

        but also transforms the query to Oracle named
        format
        "select * from foo where bar = %(somebar)s"
        =>
        "select * from foo where bar = :somebar "
        {"somebar" : value-found-for-somebar}

        """

        self.sub = {}
        self.li_arg = list(args)
        self.tqry = tqry

        self._pre_process()

        try:
            qry = self.tqry % (self)
        except (Exception,) as e:
            raise

        return qry, self.sub

    __call__ = format

    def __getitem__(self, key):
        """
        finds a substitution
        but also transforms the variable in the query to Oracle named
        format :foo
        """

        # already seen so already in the substition dict
        # replace the query's %(foo)s with :foo
        if key in self.sub:
            return self.t_qry_replace % (key)

        got = self._get_from_args(key)
        self.sub[key] = got
        return self.t_qry_replace % (key)

    """
    https://www.python.org/dev/peps/pep-0249/#paramstyle

    paramstyle  Meaning

    qmark       Question mark style, e.g. ...WHERE name=?   sequence
    numeric     Numeric, positional style, e.g. ...WHERE name=:1
    named       Named style, e.g. ...WHERE name=:name
    format      ANSI C printf format codes, e.g. ...WHERE name=%s
    pyformat    Python extended format codes, e.g. ...WHERE name=%(name)s
    """

ExperimentalBinderNamed = BinderNamed

class Binder_NotImplementedError(Binder):
    """not implemented yet"""

    paramstyle = "not implemented"

    def __init__(self, *args, **kwds):
        raise NotImplementedError()

# This is what decides how the Binder
# will process incoming template substitutions
Binder._di_paramstyle["pyformat"] = Binder_pyformat
Binder._di_paramstyle["named"] = BinderNamed
Binder._di_paramstyle[PARAMSTYLE_QMARK] = BinderQmark
Binder._di_paramstyle["format"] = BinderFormat

Binder._di_paramstyle["experimentalnamed"] = ExperimentalBinderNamed

# and these are not done yet
Binder._di_paramstyle["numeric"] = Binder_NotImplementedError


text:
/**
 * Service layer beans.
 */
package org.kalnee.trivor.insights.service;