text:
<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <display-name>Prancing Donkey Test Web App</display-name>
    <description>Prancing Donkey Test Web App</description>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

</web-app>


text:
package org.apereo.cas.support.saml.idp.metadata;

import org.apereo.cas.support.saml.idp.metadata.locator.AbstractSamlIdPMetadataLocator;
import org.apereo.cas.support.saml.services.idp.metadata.SamlIdPMetadataDocument;
import org.apereo.cas.util.crypto.CipherExecutor;

import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;

/**
 * This is {@link MongoDbSamlIdPMetadataLocator}.
 *
 * @author Misagh Moayyed
 * @since 6.0.0
 */
public class MongoDbSamlIdPMetadataLocator extends AbstractSamlIdPMetadataLocator {
    private final transient MongoTemplate mongoTemplate;
    private final String collectionName;

    public MongoDbSamlIdPMetadataLocator(final CipherExecutor<String, String> metadataCipherExecutor,
                                         final MongoTemplate mongoTemplate,
                                         final String collectionName) {
        super(metadataCipherExecutor);
        this.mongoTemplate = mongoTemplate;
        this.collectionName = collectionName;
    }

    @Override
    public SamlIdPMetadataDocument fetchInternal() {
        setMetadataDocument(mongoTemplate.findOne(new Query(), SamlIdPMetadataDocument.class, this.collectionName));
        return getMetadataDocument();
    }
}

redpajama_set_name: RedPajamaGithub


text:
"""pandoc-source-exec is a panflute pandoc filter to execute source code and
add the output to the pandoc document."""

import glob
import os
import re
import subprocess

__version__ = '0.2.2'

try:
    from pexpect import replwrap
except ImportError:
    pass
try:
    import panflute as pf
except ImportError:
    pass

EXECUTORS = {
    'default': 'echo',
    'perl': '/usr/bin/env perl -e',
    'php': '/usr/bin/env php -r',
    'python': '/usr/bin/env python3 -c',
    'python2': '/usr/bin/env python2 -c',
    'python3': '/usr/bin/env python3 -c',
    'ruby': '/usr/bin/env ruby -e',
}

def select_executor(elem, doc):
    """Determines the executor for the code in `elem.text`.

    The elem attributes and classes select the executor in this order (highest
    to lowest):
        - custom commands (cmd=...)
        - runas (runas=...) takes a key for the executors
        - first element class (.class) determines language and thus executor

    Args:
        elem The AST element.
        doc  The document.

    Returns:
        The command to execute code.
    """
    executor = EXECUTORS['default']

    if 'cmd' in elem.attributes.keys():
        executor = elem.attributes['cmd']
    elif 'runas' in elem.attributes.keys():
        executor = EXECUTORS[elem.attributes['runas']]
    elif elem.classes[0] != 'exec':
        executor = EXECUTORS[elem.classes[0]]

    return executor

def execute_code_block(elem, doc):
    """Executes a code block by passing it to the executor.

    Args:
        elem The AST element.
        doc  The document.

    Returns:
        The output of the command.
    """
    command = select_executor(elem, doc).split(' ')
    code = elem.text
    if 'plt' in elem.attributes or 'plt' in elem.classes:
        code = save_plot(code, elem)
    command.append(code)
    if 'args' in elem.attributes:
        for arg in elem.attributes['args'].split():
            command.append(arg)

    cwd = elem.attributes['wd'] if 'wd' in elem.attributes else None

    return subprocess.run(command,
                          encoding='utf8',
                          stdout=subprocess.PIPE,
                          stderr=subprocess.STDOUT,
                          cwd=cwd).stdout

def execute_interactive_code(elem, doc):
    """Executes code blocks for a python shell.

    Parses the code in `elem.text` into blocks and
    executes them.

    Args:
        elem The AST element.
        doc  The document.

    Return:
        The code with inline results.
    """
    code_lines = [l[4:] for l in elem.text.split('\n')]

    code_blocks = [[code_lines[0]]]
    for line in code_lines[1:]:
        if line.startswith(' ') or line == '':
            code_blocks[-1].append(line)
        else:
            code_blocks.append([line])

    final_code = []
    try:
        child = replwrap.REPLWrapper("python", ">>> ", None)
    except NameError:
        pf.debug('Can not run interactive session. No output produced ' +
                 '(Code was:\n{!s}\n)'
                 .format(elem))
        pf.debug('Please pip install pexpect.')
        return ''
    for code_block in code_blocks:
        result = child.run_command('\n'.join(code_block) + '\n').rstrip('\r\n')
        final_code += [('>>> ' if i == 0 else '... ') + l for i, l in
                       enumerate(code_block)]
        if result:
            final_code += [r for r in result.split('\n')
                           if r.strip() not in code_block]
    return '\n'.join(final_code)

def read_file(filename):
    """Reads a file which matches the pattern `filename`.

    Args:
        filename The filename pattern

    Returns:
        The file content or the empty string, if the file is not found.
    """
    hits = glob.glob('**/{}'.format(filename), recursive=True)
    if not len(hits):
        pf.debug('No file "{}" found.'.format(filename))
        return ''
    elif len(hits) > 1:
        pf.debug('File pattern "{}" ambiguous. Using first.'.format(filename))

    with open(hits[0], 'r') as f:
        return f.read()

def filter_lines(code, line_spec):
    """Removes all lines not matching the line_spec.

    Args:
        code The code to filter
        line_spec The line specification. This should be a comma-separated
                  string of lines or line ranges, e.g. 1,2,5-12,15
                  If a line range starts with -, all lines up to this line are
                  included.
                  If a line range ends with -, all lines from this line on are
                  included.
                  All lines mentioned (ranges are inclusive) are used.
    Returns:
        Only the specified lines.
    """
    code_lines = code.splitlines()

    line_specs = [line_denom.strip() for line_denom in line_spec.split(',')]

    single_lines = set(map(int, filter(lambda line: '-' not in line, line_specs)))
    line_ranges = set(filter(lambda line: '-' in line, line_specs))

    for line_range in line_ranges:
        begin, end = line_range.split('-')
        if not begin:
            begin = 1
        if not end:
            end = len(code_lines)
        single_lines.update(range(int(begin), int(end) + 1))

    keep_lines = []
    for line_number, line in enumerate(code_lines, 1):
        if line_number in single_lines:
            keep_lines.append(line)

    return '\n'.join(keep_lines)

def remove_import_statements(code):
    """Removes lines with import statements from the code.

    Args:
        code: The code to be stripped.

    Returns:
        The code without import statements.
    """
    new_code = []
    for line in code.splitlines():
        if not line.lstrip().startswith('import ') and \
           not line.lstrip().startswith('from '):
            new_code.append(line)

    while new_code and new_code[0] == '':
        new_code.pop(0)
    while new_code and new_code[-1] == '':
        new_code.pop()

    return '\n'.join(new_code)

def save_plot(code, elem):
    """Converts matplotlib plots to tikz code.

    If elem has either the plt attribute (format: plt=width,height) or the
    attributes width=width and/or height=height, the figurewidth and -height
    are set accordingly. If none are given, a height of 4cm and a width of 6cm
    is used as default.

    Args:
        code: The matplotlib code.
        elem: The element.

    Returns:
        The code and some code to invoke matplotlib2tikz.
    """
    if 'plt' in elem.attributes:
        figurewidth, figureheight = elem.attributes['plt'].split(',')
    else:
        try:
            figureheight = elem.attributes['height']
        except KeyError:
            figureheight = '4cm'

        try:
            figurewidth = elem.attributes['width']
        except KeyError:
            figurewidth = '6cm'

    return f"""import matplotlib
matplotlib.use('TkAgg')
{code}
from matplotlib2tikz import get_tikz_code
tikz = get_tikz_code(figureheight='{figureheight}', figurewidth='{figurewidth}')  # noqa
print(tikz)"""

def trimpath(attributes):
    """Simplifies the given path.

    If pathdepth is in attributes, the last pathdepth elements will be
    returned. If pathdepth is "full", the full path will be returned.
    Otherwise the filename only will be returned.

    Args:
        attributes: The element attributes.

    Returns:
        The trimmed path.
    """
    if 'pathdepth' in attributes:
        if attributes['pathdepth'] != 'full':
            pathelements = []
            remainder = attributes['file']
            limit = int(attributes['pathdepth'])
            while len(pathelements) < limit and remainder:
                remainder, pe = os.path.split(remainder)
                pathelements.insert(0, pe)
            return os.path.join(*pathelements)
        return attributes['file']
    return os.path.basename(attributes['file'])

def make_codelisting(inner_elements, caption, label, *,
                     shortcaption=None, above=True):
    r"""Creates a source code listing:

        \begin{codelisting}[hbtp]
        inner_elements
        \caption[caption]{\label{label}caption}
        \end{codelisting}

    and returns the list containing the pandoc elements.

    Args:
        inner_elements: A list of inner pandoc elements, usually a
                        code block and potentially outputs etc.
        caption:        The caption to be used. Will be used below code and in
                        list of code listings.
        label:          The label to use.
        shortcaption:   A short caption to be used in the list of code listings.
                        If None, the normal caption will be used.
        above:          The caption is placed above (True) or below (False)
                        the code listing.

    Returns:
        A list of elements for this codelisting.
    """
    begin = pf.RawBlock(r'\begin{codelisting}[hbtp]', format='tex')
    end = pf.RawBlock(r'\end{codelisting}', format='tex')

    if not shortcaption:
        shortcaption = caption
    cap_begin = f'\\caption[{shortcaption}]{{\\label{{{label}}}'
    caption_elem = pf.RawBlock(cap_begin + caption + '}', format='tex')
    if above:
        return [begin, caption_elem] + inner_elements + [end]
    return [begin] + inner_elements + [caption_elem, end]

def prepare(doc):
    """Sets the caption_found and plot_found variables to False."""
    doc.caption_found = False
    doc.plot_found = False
    doc.listings_counter = 0

def maybe_center_plot(result):
    """Embeds a possible tikz image inside a center environment.

    Searches for matplotlib2tikz last commend line to detect tikz images.

    Args:
        result: The code execution result

    Returns:
        The input result if no tikzpicture was found, otherwise a centered
        version.
    """
    begin = re.search('(% .* matplotlib2tikz v.*)', result)
    if begin:
        result = ('\\begin{center}\n' + result[begin.end():] +
                  '\n\\end{center}')
    return result

def action(elem, doc):  # noqa
    """Processes pf.CodeBlocks.

    For details and a specification of how each command should behave,
    check the example files (especially the md and pdf)!

    Args:
        elem: The element to process.
        doc:  The document.

    Returns:
        A changed element or None.
    """
    if isinstance(elem, pf.CodeBlock):
        doc.listings_counter += 1
        elems = [elem] if 'hide' not in elem.classes else []

        if 'file' in elem.attributes:
            elem.text = read_file(elem.attributes['file'])
            filename = trimpath(elem.attributes)
            prefix = pf.Emph(pf.Str('File:'))

        # Allow boolean values with value "True" to be specified as attributes,
        # but used as classes.
        for a, v in elem.attributes.items():
            if v.lower() == 'true':
                elem.classes.append(a)

        if 'exec' in elem.classes:
            if 'interactive' in elem.classes or elem.text[:4] == '>>> ':
                elem.text = execute_interactive_code(elem, doc)
            else:
                result = execute_code_block(elem, doc)

                if 'hideimports' in elem.classes:
                    elem.text = remove_import_statements(elem.text)

                if 'plt' in elem.attributes or 'plt' in elem.classes:
                    doc.plot_found = True
                    result = maybe_center_plot(result)
                    block = pf.RawBlock(result, format='latex')
                else:
                    block = pf.CodeBlock(result, classes=['changelog'])

                if result:
                    output_label = 'Output:'
                    if 'output_label' in elem.attributes:
                        output_label = elem.attributes['output_label']
                    if output_label != '':
                        elems += [pf.Para(pf.Emph(pf.Str(output_label))), block]
                    else:
                        elems += [block]

        if 'lines' in elem.attributes:
            elem.text = filter_lines(elem.text, elem.attributes['lines'])

        label = elem.attributes.get('label', f'cl:{doc.listings_counter}')

        if 'caption' in elem.attributes.keys():
            doc.caption_found = True
            cap = pf.convert_text(elem.attributes['caption'], output_format='latex')  # noqa
            if 'shortcaption' in elem.attributes.keys():
                shortcap = pf.convert_text(elem.attributes['shortcaption'], output_format='latex')  # noqa
            else:
                shortcap = cap
            if 'file' in elem.attributes.keys():
                cap += pf.convert_text(f' (`{filename}`)', output_format='latex')  # noqa

            elems = make_codelisting(elems, cap, label, shortcaption=shortcap,
                                     above='capbelow' not in elem.classes)
        elif 'caption' in elem.classes:
            doc.caption_found = True
            cap = ''
            if 'file' in elem.attributes.keys():
                cap = pf.convert_text(f'`{filename}`', output_format='latex')
            elems = make_codelisting(elems, cap, label,
                                     above='capbelow' not in elem.classes)
        else:
            if 'file' in elem.attributes.keys():
                elems.insert(0, pf.Para(prefix, pf.Space,
                                        pf.Code(filename)))

        return elems

def finalize(doc):
    """Adds the pgfplots and caption packages to the header-includes if needed.
    """
    if doc.plot_found:
        pgfplots_inline = pf.MetaInlines(pf.RawInline(
            r'''%
\makeatletter
\@ifpackageloaded{pgfplots}{}{\usepackage{pgfplots}}
\makeatother
\usepgfplotslibrary{groupplots}
''', format='tex'))
        try:
            doc.metadata['header-includes'].append(pgfplots_inline)
        except KeyError:
            doc.metadata['header-includes'] = pf.MetaList(pgfplots_inline)

    if doc.caption_found:
        caption_inline = pf.MetaInlines(pf.RawInline(
            r'''%
\makeatletter
\@ifpackageloaded{caption}{}{\usepackage{caption}}
\@ifpackageloaded{cleveref}{}{\usepackage{cleveref}}
\@ifundefined{codelisting}{%
    \DeclareCaptionType{codelisting}[Code Listing][List of Code Listings]
    \crefname{codelisting}{code listing}{code listings}
    \Crefname{codelisting}{Code Listing}{Code Listings}
    \captionsetup[codelisting]{position=bottom}
}{}
\makeatother
''', format='tex'))
        try:
            doc.metadata['header-includes'].append(caption_inline)
        except KeyError:
            doc.metadata['header-includes'] = pf.MetaList(caption_inline)

def main(doc=None):
    return pf.run_filter(action,
                         prepare=prepare,
                         finalize=finalize,
                         doc=doc)

if __name__ == '__main__':
    main()


text:
package cz.znj.kvr.sw.pof.concurrent.lwfuture.concurrent.test;

import cz.znj.kvr.sw.pof.concurrent.lwfuture.concurrent.ListenableFuture;
import cz.znj.kvr.sw.pof.concurrent.lwfuture.concurrent.ListeningExecutorService;
import cz.znj.kvr.sw.pof.concurrent.lwfuture.concurrent.ListeningExecutors;
import cz.znj.kvr.sw.pof.concurrent.lwfuture.concurrent.ListeningScheduledExecutorService;
import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
 * Tests for {@link ListeningExecutors} class.
 *
 * @author
 * 	Zbynek Vyskovsky, mailto:kvr@centrum.cz http://kvr.znj.cz/software/java/ListenableFuture/ http://github.com/kvr000
 */
public class ListeningExecutorsTest
{
	@Test
	public void			testListeningDecoratorBasic()
	{
		ListeningExecutorService executor = ListeningExecutors.listeningDecorator(Executors.newCachedThreadPool());
		try {
			//Assert.assertTrue(executor instanceof ListeningExecutorService);
		}
		finally {
			executor.shutdownNow();
		}
	}

	@Test
	public void			testListeningDecoratorBasicToScheduled()
	{
		ListeningExecutorService executor = ListeningExecutors.listeningDecorator((ExecutorService)Executors.newScheduledThreadPool(1));
		try {
			Assert.assertTrue(executor instanceof ListeningScheduledExecutorService);
		}
		finally {
			executor.shutdownNow();
		}
	}

	@Test
	public void			testListeningDecoratorScheduled()
	{
		ListeningScheduledExecutorService executor = ListeningExecutors.listeningDecorator(Executors.newScheduledThreadPool(1));
		try {
			//Assert.assertTrue(executor instanceof ListeningScheduledExecutorService);
		}
		finally {
			executor.shutdownNow();
		}
	}

	@Test
	public void			testDirectExecutor()
	{
		Assert.assertNotNull(ListeningExecutors.directExecutor());
	}

	@Test
	public void			testRejectingExecutor()
	{
		Assert.assertNotNull(ListeningExecutors.rejectingExecutor());
	}
}


text:
package org.openestate.io.openimmo.xml;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;

/**
 * Java class for <breitband_zugang> element.
 *
 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "breitband_zugang")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
public class BreitbandZugang implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlAttribute(name = "art")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    protected String art;
    @XmlAttribute(name = "speed")
    @XmlJavaTypeAdapter(Adapter2 .class)
    @XmlSchemaType(name = "decimal")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    protected BigDecimal speed;

    /**
     * Gets the value of the art property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public String getArt() {
        return art;
    }

    /**
     * Sets the value of the art property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public void setArt(String value) {
        this.art = value;
    }

    /**
     * Gets the value of the speed property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public BigDecimal getSpeed() {
        return speed;
    }

    /**
     * Sets the value of the speed property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public void setSpeed(BigDecimal value) {
        this.speed = value;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public String toString() {
        final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE2;
        final StringBuilder buffer = new StringBuilder();
        append(null, buffer, strategy);
        return buffer.toString();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        strategy.appendStart(locator, this, buffer);
        appendFields(locator, buffer, strategy);
        strategy.appendEnd(locator, this, buffer);
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            String theArt;
            theArt = this.getArt();
            strategy.appendField(locator, this, "art", buffer, theArt, (this.art!= null));
        }
        {
            BigDecimal theSpeed;
            theSpeed = this.getSpeed();
            strategy.appendField(locator, this, "speed", buffer, theSpeed, (this.speed!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public Object clone() {
        return copyTo(createNewInstance());
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public Object copyTo(Object target) {
        final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE2;
        return copyTo(null, target, strategy);
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
        final Object draftCopy = ((target == null)?createNewInstance():target);
        if (draftCopy instanceof BreitbandZugang) {
            final BreitbandZugang copy = ((BreitbandZugang) draftCopy);
            {
                Boolean artShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.art!= null));
                if (artShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceArt;
                    sourceArt = this.getArt();
                    String copyArt = ((String) strategy.copy(LocatorUtils.property(locator, "art", sourceArt), sourceArt, (this.art!= null)));
                    copy.setArt(copyArt);
                } else {
                    if (artShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.art = null;
                    }
                }
            }
            {
                Boolean speedShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.speed!= null));
                if (speedShouldBeCopiedAndSet == Boolean.TRUE) {
                    BigDecimal sourceSpeed;
                    sourceSpeed = this.getSpeed();
                    BigDecimal copySpeed = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "speed", sourceSpeed), sourceSpeed, (this.speed!= null)));
                    copy.setSpeed(copySpeed);
                } else {
                    if (speedShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.speed = null;
                    }
                }
            }
        }
        return draftCopy;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public Object createNewInstance() {
        return new BreitbandZugang();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
        if ((object == null)||(this.getClass()!= object.getClass())) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final BreitbandZugang that = ((BreitbandZugang) object);
        {
            String lhsArt;
            lhsArt = this.getArt();
            String rhsArt;
            rhsArt = that.getArt();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "art", lhsArt), LocatorUtils.property(thatLocator, "art", rhsArt), lhsArt, rhsArt, (this.art!= null), (that.art!= null))) {
                return false;
            }
        }
        {
            BigDecimal lhsSpeed;
            lhsSpeed = this.getSpeed();
            BigDecimal rhsSpeed;
            rhsSpeed = that.getSpeed();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "speed", lhsSpeed), LocatorUtils.property(thatLocator, "speed", rhsSpeed), lhsSpeed, rhsSpeed, (this.speed!= null), (that.speed!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:15+02:00", comments = "JAXB RI v2.3.0")
    public boolean equals(Object object) {
        final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE2;
        return equals(null, null, object, strategy);
    }

}


text:
using Eth.Rpc;
using Newtonsoft.Json;
using System;
using System.Numerics;

namespace Eth.Json.Converters
{
    public class EthSyncingConverter : JsonConverter
    {
        public override bool CanConvert(Type objectType)
        {
            return objectType == typeof(EthSyncing);
        }

        private static readonly string StartingBlockKey = "startingBlock";
        private static readonly string CurrentBlockKey = "currentBlock";
        private static readonly string HighestBlockKey = "highestBlock";

        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer)
        {
            if(reader.TokenType == JsonToken.Boolean)
            {
                return new EthSyncing(false);
            }
            else
            {
                int depth = reader.Depth;

                BigInteger startingBlock;
                BigInteger currentBlock;
                BigInteger highestBlock;

                while (!(reader.TokenType == JsonToken.EndObject && reader.Depth == depth))
                {
                    reader.Read();

                    if(reader.TokenType == JsonToken.PropertyName)
                    {
                        string propertyName = reader.Value.ToString();

                        if(String.Equals(propertyName, StartingBlockKey))
                        {
                            reader.Read();
                            startingBlock = serializer.Deserialize<BigInteger>(reader);
                        }
                        else if (String.Equals(propertyName, CurrentBlockKey))
                        {
                            reader.Read();
                            currentBlock = serializer.Deserialize<BigInteger>(reader);
                        }
                        else if (String.Equals(propertyName, HighestBlockKey))
                        {
                            reader.Read();
                            highestBlock = serializer.Deserialize<BigInteger>(reader);
                        }
                    }
                }

                return new EthSyncing(startingBlock, currentBlock, highestBlock);
            }
        }

        public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer)
        {
            if(value == null)
            {
                writer.WriteNull();
                return;
            }

            var obj = value as EthSyncing;

            if(obj.IsSynching)
            {
                writer.WriteStartObject();

                writer.WritePropertyName(StartingBlockKey);
                serializer.Serialize(writer, obj.StartingBlock.Value);

                writer.WritePropertyName(CurrentBlockKey);
                serializer.Serialize(writer, obj.CurrentBlock.Value);

                writer.WritePropertyName(HighestBlockKey);
                serializer.Serialize(writer, obj.HighestBlock.Value);

                writer.WriteEndObject();
            }
            else
            {
                writer.WriteValue(false);
            }
        }

        public override bool CanWrite { get { return false; } }
    }
}


text:
import { combineReducers } from 'redux'
import challengeContact from './ChallengeContact/reducers'
import confirmSecret from './ConfirmSecret/reducers'
import createLogin from './CreateLogin/reducers'
import validateUsername from './ValidateUsername/reducers'

export default combineReducers({
  challengeContact,
  confirmSecret,
  createLogin,
  validateUsername,
})


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

<TITLE>
MetricsUtil (Facebook's realtime distributed database, powered by Apache Hadoop based on 0.20-append branch 0.20.1-dev API)
</TITLE>

<META NAME="date" CONTENT="2011-03-30">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.hadoop.metrics

Class MetricsUtil

java.lang.Object
  org.apache.hadoop.metrics.MetricsUtil

public class MetricsUtil
extends java.lang.Object

Utility class to simplify creation and reporting of hadoop metrics.

 For examples of usage, see NameNodeMetrics.

See Also:
MetricsRecord,
MetricsContext,
ContextFactory

Field Summary

static org.apache.commons.logging.Log
LOG

Method Summary

static MetricsRecord
createRecord(MetricsContext context,
             java.lang.String recordName)

          Utility method to create and return new metrics record instance within the
 given context.

static MetricsContext
getContext(java.lang.String contextName)

static MetricsContext
getContext(java.lang.String refName,
           java.lang.String contextName)

          Utility method to return the named context.

Methods inherited from class java.lang.Object

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

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

Method Detail

getContext

public static MetricsContext getContext(java.lang.String contextName)

getContext

public static MetricsContext getContext(java.lang.String refName,
                                        java.lang.String contextName)

Utility method to return the named context.
 If the desired context cannot be created for any reason, the exception
 is logged, and a null context is returned.

createRecord

public static MetricsRecord createRecord(MetricsContext context,
                                         java.lang.String recordName)

Utility method to create and return new metrics record instance within the
 given context. This record is tagged with the host name.

Parameters:
context - the context
recordName - name of the record

Returns:
newly created metrics record

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

This release is based on the Facebook's version of Hadoop.
Copyright © 2009 The Apache Software Foundation.


text:
package dataworks_public

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// ListShiftPersonnels invokes the dataworks_public.ListShiftPersonnels API synchronously
func (client *Client) ListShiftPersonnels(request *ListShiftPersonnelsRequest) (response *ListShiftPersonnelsResponse, err error) {
	response = CreateListShiftPersonnelsResponse()
	err = client.DoAction(request, response)
	return
}

// ListShiftPersonnelsWithChan invokes the dataworks_public.ListShiftPersonnels API asynchronously
func (client *Client) ListShiftPersonnelsWithChan(request *ListShiftPersonnelsRequest) (<-chan *ListShiftPersonnelsResponse, <-chan error) {
	responseChan := make(chan *ListShiftPersonnelsResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.ListShiftPersonnels(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// ListShiftPersonnelsWithCallback invokes the dataworks_public.ListShiftPersonnels API asynchronously
func (client *Client) ListShiftPersonnelsWithCallback(request *ListShiftPersonnelsRequest, callback func(response *ListShiftPersonnelsResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *ListShiftPersonnelsResponse
		var err error
		defer close(result)
		response, err = client.ListShiftPersonnels(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// ListShiftPersonnelsRequest is the request struct for api ListShiftPersonnels
type ListShiftPersonnelsRequest struct {
	*requests.RpcRequest
	ShiftPersonUID          string           `position:"Body" name:"ShiftPersonUID"`
	UserType                string           `position:"Body" name:"UserType"`
	EndTime                 requests.Integer `position:"Body" name:"EndTime"`
	BeginTime               requests.Integer `position:"Body" name:"BeginTime"`
	ShiftScheduleIdentifier string           `position:"Body" name:"ShiftScheduleIdentifier"`
}

// ListShiftPersonnelsResponse is the response struct for api ListShiftPersonnels
type ListShiftPersonnelsResponse struct {
	*responses.BaseResponse
	RequestId string `json:"RequestId" xml:"RequestId"`
	Paging    Paging `json:"Paging" xml:"Paging"`
}

// CreateListShiftPersonnelsRequest creates a request to invoke ListShiftPersonnels API
func CreateListShiftPersonnelsRequest() (request *ListShiftPersonnelsRequest) {
	request = &ListShiftPersonnelsRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("dataworks-public", "2020-05-18", "ListShiftPersonnels", "", "")
	request.Method = requests.POST
	return
}

// CreateListShiftPersonnelsResponse creates a response to parse from ListShiftPersonnels response
func CreateListShiftPersonnelsResponse() (response *ListShiftPersonnelsResponse) {
	response = &ListShiftPersonnelsResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
<?php defined('SYSPATH') || die('No direct script access.');

function _strlen($str)
{
    if (\Phalcana\UTF8::isAscii($str)) {
        return strlen($str);
    }

    return strlen(utf8_decode($str));
}


text:
package com.hazelcast.client.helpers;

import com.hazelcast.map.MapInterceptor;
import com.hazelcast.nio.serialization.Portable;
import com.hazelcast.nio.serialization.PortableReader;
import com.hazelcast.nio.serialization.PortableWriter;
import com.hazelcast.internal.util.StringUtil;

import java.io.IOException;

/**
 * User: danny Date: 11/26/13
 */

public class SimpleClientInterceptor implements MapInterceptor, Portable {

    public static final int ID = 345;

    @Override
    public Object interceptGet(Object value) {
        if (value == null) {
            return null;
        }
        return value + ":";
    }

    @Override
    public void afterGet(Object value) {
    }

    @Override
    public Object interceptPut(Object oldValue, Object newValue) {
        return newValue.toString().toUpperCase(StringUtil.LOCALE_INTERNAL);
    }

    @Override
    public void afterPut(Object value) {
    }

    @Override
    public Object interceptRemove(Object removedValue) {
        if (removedValue.equals("ISTANBUL")) {
            throw new RuntimeException("you can not remove this");
        }
        return removedValue;
    }

    @Override
    public void afterRemove(Object value) {
    }

    @Override
    public int getFactoryId() {
        return PortableHelpersFactory.ID;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public int getClassId() {
        return ID;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public void writePortable(PortableWriter writer) throws IOException {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public void readPortable(PortableReader reader) throws IOException {
        //To change body of implemented methods use File | Settings | File Templates.
    }
}


text:
$LOAD_PATH.unshift 'lib'
require 'mysql2'
require 'timeout'

# Should never exceed worst case 3.5 secs across all 20 threads
Timeout.timeout(3.5) do
  Array.new(20) do
    Thread.new do
      overhead = rand(3)
      puts ">> thread #{Thread.current.object_id} query, #{overhead} sec overhead"
      # 3 second overhead per query
      Mysql2::Client.new(host: "localhost", username: "root").query("SELECT sleep(#{overhead}) as result")
      puts "<< thread #{Thread.current.object_id} result, #{overhead} sec overhead"
    end
  end.each(&:join)
end


text:
package com.github.mdr.mash.ns.collections

import com.github.mdr.mash.functions.{ BoundParams, MashFunction, Parameter, ParameterModel }
import com.github.mdr.mash.ns.core.NumberClass
import com.github.mdr.mash.runtime.MashNumber

object LengthFunction extends MashFunction("collections.length") {

  object Params {
    val Sequence = Parameter(
      nameOpt = Some("sequence"),
      summaryOpt = Some("Sequence to find the length of"))
  }
  import Params._

  val params = ParameterModel(Sequence)

  def call(boundParams: BoundParams): MashNumber = {
    val sequence = boundParams.validateSequence(Sequence)
    MashNumber(sequence.length)
  }

  override def typeInferenceStrategy = NumberClass

  override def summaryOpt = Some("Find the length of a sequence")

  override def descriptionOpt = Some("""Examples:
<mash>
  length [1, 2, 3] # 3
  length []        # 0
</mash>""")

}


text:
import React, { Component } from 'react'
import classNames from 'classnames/bind'
import { Link } from 'react-router'
import sty from './SideBar.scss'

let cx = classNames.bind(sty)

export default class SideBar extends Component {
  static propTypes = {
    mobileNavIsOpen: React.PropTypes.bool.isRequired,
    toggleMenu: React.PropTypes.func.isRequired,
    menuLinks: React.PropTypes.array.isRequired,
    dropDownLinks: React.PropTypes.array.isRequired,
    dropDownActivate: React.PropTypes.func.isRequired,
    dropDownStatus: React.PropTypes.bool.isRequired
  };

  render() {
    let mobileNav = cx({
      mobileNavOpen: this.props.mobileNavIsOpen
      // mobileNavClose: this.props.mobileNavIsOpen
    })
    let menu = cx({
      menuClose: this.props.mobileNavIsOpen === false,
      menuOpen: this.props.mobileNavIsOpen
    })
    return (
      // the mobileNavOffTrigger here is allow user to turn off the mobile nav when they click outside of the mobile nav

            <Link
              to='/'
              onClick={this.handleClick}
            >
             Home
            </Link>
            {this.renderMenuLinks()}

    )
  }

  renderMenuLinks = () => {
    const { menuLinks } = this.props
    return (
      menuLinks.map((link, index) =>
        <Link
          to={`/${link}`}
          activeClassName={sty.activeLink}
          onClick={this.handleClick}
          key={index}
        >
          {link}
        </Link>
      )
    )
  };

  handleClick = () => {
    this.props.toggleMenu()
  };

  componentDidMount() {
    window.onkeydown = this.listenForClose
  }

  componentWillUnmount() {
    window.onkeydown = null
  }
  // note there is a bug in the componentWillReceiveProps need to check it if you want to use it
  // this allow trigger of mobile via passing in props
  // componentWillReceiveProps(nextProps) {
  //   // Allow open props to be controlled by props
  //   if (nextProps.mobileNavIsOpen !== this.props.mobileNavIsOpen) {
  //     this.props.toggleMenu()
  //   }
  // }
  // listen to escape key to close mobile nav
  listenForClose = (e) => {
    e = e || window.event

    if (this.props.mobileNavIsOpen === true && (e.key === 'Escape' || e.keyCode === 27)) {
      this.props.toggleMenu()
    }
  };
}


text:
<?php

namespace Tests\AppBundle\Entity;

use AppBundle\Entity\Post;
use AppBundle\Entity\User;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

class BlameableEntityWithAssociationTest extends KernelTestCase
{
    /**
     * @var \AppBundle\Entity\Post
     */
    private $post;

    /**
     * @var \AppBundle\Entity\User
     */
    private $user;

    public function testCreatedBy()
    {
        $this->post->setCreatedBy($this->user);
        $this->assertEquals($this->user, $this->post->getCreatedBy());
    }

    public function testUpdatedBy()
    {
        $this->post->setUpdatedBy($this->user);
        $this->assertEquals($this->user, $this->post->getUpdatedBy());
    }

    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        $this->post = new Post();
        $this->user = new User();
    }

}


text:
@implementation VTTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];

    VTHomeViewController *homeVC = [[VTHomeViewController alloc] init];
    UINavigationController *homeNav = [[UINavigationController alloc]initWithRootViewController:homeVC];
    homeNav.navigationBarHidden = YES;
    UITabBarItem *homeItem = [self creatTabBarItemWithTitle:@"首页"];
    homeNav.tabBarItem = homeItem;

    VTBubbleViewController *bubbleVC = [[VTBubbleViewController alloc] init];
    UINavigationController *bubbleNav = [[UINavigationController alloc]initWithRootViewController:bubbleVC];
//    bubbleNav.navigationBarHidden = YES;
    UITabBarItem *bubbleItem = [self creatTabBarItemWithTitle:@"气泡"];
    bubbleNav.tabBarItem = bubbleItem;

    VTCenterViewController *centerVC = [[VTCenterViewController alloc] init];
    UINavigationController *centerNav = [[UINavigationController alloc]initWithRootViewController:centerVC];
    centerNav.navigationBarHidden = YES;
    UITabBarItem *centerItem = [self creatTabBarItemWithTitle:@"居中"];
    centerNav.tabBarItem = centerItem;

    VTDivideViewController *divideVC = [[VTDivideViewController alloc] init];
    UINavigationController *divideNav = [[UINavigationController alloc]initWithRootViewController:divideVC];
    divideNav.navigationBarHidden = YES;
    UITabBarItem *divideItem = [self creatTabBarItemWithTitle:@"平分"];
    divideNav.tabBarItem = divideItem;

    VTDataViewController*dataVC = [[VTDataViewController alloc] init];
    UINavigationController *dataNav = [[UINavigationController alloc]initWithRootViewController:dataVC];
    dataNav.navigationBarHidden = YES;
    UITabBarItem *dataItem = [self creatTabBarItemWithTitle:@"webview"];
    dataNav.tabBarItem = dataItem;

    self.viewControllers = @[homeNav, bubbleNav, centerNav, divideNav, dataNav];

    [[UITabBar appearance] setBarTintColor:RGBCOLOR(239, 239, 239)];
    [[UITabBar appearance] setAlpha:0.75];
}

- (UITabBarItem *)creatTabBarItemWithTitle:(NSString*)title {
    UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:title image:nil selectedImage:nil];
    [item setTitleTextAttributes:@{NSForegroundColorAttributeName:RGBCOLOR(169, 37, 37)}  forState:UIControlStateSelected];
    [item setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateNormal];
//    item.imageInsets = UIEdgeInsetsMake(0, 0, 0, 0);
    return item;
}

@end


text:
using System;
using System.Xml.Linq;
using AddinX.Ribbon.Contract.Control.GalleryUnsize;
using AddinX.Ribbon.Contract.Control.Item;
using AddinX.Ribbon.Implementation.Ribbon;

namespace AddinX.Ribbon.Implementation.Control
{
    public class GalleryUnsize : Control, IGalleryUnsize
    {
        private string imageMso;
        private string imagePath;
        private bool imageVisible;
        private string supertip;
        private string screentip;
        private string keytip;
        private bool showLabel = true;
        private bool showItemImage = true;
        private int gallerySize;
        private bool showItemLabel = true;
        private bool dynamicItemsLoading;
        private readonly IItems data;
        private int itemHeight;
        private int itemWidth;
        private int rows;
        private int cols;
        private readonly IGalleryUnsizeControls controls;

        public GalleryUnsize()
        {
            data = new Items();
            ElementName = "gallery";
            Id = new ElementId();
            controls = new Controls();
            imageVisible = false;
            gallerySize = 7;
            itemHeight = 0;
            itemWidth = 0;
            rows = -1;
            cols = -1;
        }

        protected internal IGalleryUnsizeId SetLabel(string value)
        {
            Label = value;
            return this;
        }

        protected internal override XElement ToXml(XNamespace ns)
        {
            var tmpId = (ElementId)Id;

            var element = new XElement(ns + ElementName
                , new XAttribute(tmpId.Type.ToString(), tmpId.Value)
                , new XAttribute("label", Label)
                , new XAttribute("sizeString", new string('W', gallerySize))
                , new XAttribute("showLabel", showLabel.ToString().ToLower())
                , new XAttribute("showItemImage", showItemImage.ToString().ToLower())
                , new XAttribute("showItemLabel", showItemLabel.ToString().ToLower())
                , imageVisible
                    ? string.IsNullOrEmpty(imageMso)
                        ? new XAttribute("image", imagePath)
                        : new XAttribute("imageMso", imageMso)
                    : new XAttribute("showImage", "false")
                , new XAttribute("getEnabled", "GetEnabled")
                , new XAttribute("getVisible", "GetVisible")
                , new XAttribute("onAction", "OnActionDropDown")
                , new XAttribute("getSelectedItemIndex", "GetSelectedItemIndex")
                , new XAttribute("tag", tmpId.Value)
                );

            if (itemHeight > 0)
            {
                element.Add(new XAttribute("itemHeight", itemHeight));
            }

            if (itemWidth > 0)
            {
                element.Add(new XAttribute("itemWidth", itemWidth));
            }

            if (rows >= 0)
            {
                element.Add(new XAttribute("rows", rows));
            }

            if (cols >= 0)
            {
                element.Add(new XAttribute("columns", cols));
            }

            if (!string.IsNullOrEmpty(screentip))
            {
                element.Add(new XAttribute("screentip", screentip));
            }

            if (!string.IsNullOrEmpty(supertip))
            {
                element.Add(new XAttribute("supertip", supertip));
            }

            if (!string.IsNullOrEmpty(keytip))
            {
                element.Add(new XAttribute("keytip", keytip));
            }

            if (dynamicItemsLoading)
            {
                element.Add(new XAttribute("getItemCount", "GetItemCount")
                    , new XAttribute("getItemID", "GetItemId")
                    , new XAttribute("getItemImage", "GetItemImage")
                    , new XAttribute("getItemLabel", "GetItemLabel")
                    , new XAttribute("getItemScreentip", "GetItemScreentip")
                    , new XAttribute("getItemSupertip", "GetItemSupertip"));
            }
            else
            {
                // Add the Items first
                if (((AddInList)data)?.ToXml(ns) != null)
                {
                    element.Add(((AddInList)data).ToXml(ns));
                }
            }
            // Then the buttons
            if (((AddInList)controls)?.ToXml(ns) != null)
            {
                element.Add(((AddInList)controls).ToXml(ns));
            }

            return element;
        }

        public IGalleryUnsizeExtra SizeString(int size)
        {
            gallerySize = size;
            return this;
        }

        public IGalleryUnsizeExtra ItemHeight(int height)
        {
            itemHeight = height;
            return this;
        }

        public IGalleryUnsizeExtra ItemWidth(int width)
        {
            itemWidth = width;
            return this;
        }

        public IGalleryUnsizeExtra NumberRows(int rows)
        {
            this.rows = rows;
            return this;
        }

        public IGalleryUnsizeExtra NumberColumns(int cols)
        {
            this.cols = cols;
            return this;
        }

        public IGalleryUnsizeExtra Supertip(string supertip)
        {
            this.supertip = supertip;
            return this;
        }

        public IGalleryUnsizeExtra Keytip(string keytip)
        {
            this.keytip = keytip;
            return this;
        }

        public IGalleryUnsizeExtra Screentip(string screentip)
        {
            this.screentip = screentip;
            return this;
        }

        public IGalleryUnsizeLabel SetId(string name)
        {
            Id.SetId(name);
            return this;
        }

        public IGalleryUnsizeLabel SetIdMso(string name)
        {
            Id.SetMicrosoftId(name);
            return this;
        }

        public IGalleryUnsizeLabel SetIdQ(string ns, string name)
        {
            Id.SetNamespaceId(ns, name);
            return this;
        }

        public IGalleryUnsizeItemLabel ImageMso(string name)
        {
            imageMso = name;
            return this;
        }

        public IGalleryUnsizeItemLabel ImagePath(string name)
        {
            imageVisible = true;
            imagePath = name;
            return this;
        }

        public IGalleryUnsizeItemLabel NoImage()
        {
            imageVisible = true;
            imageVisible = false;
            return this;
        }

        public IGalleryUnsizeItems ShowItemImage()
        {
            showItemImage = true;
            return this;
        }

        public IGalleryUnsizeItems HideItemImage()
        {
            showItemImage = false;
            return this;
        }

        public IGalleryUnsizeItemImage ShowItemLabel()
        {
            showItemLabel = true;
            return this;
        }

        public IGalleryUnsizeItemImage HideItemLabel()
        {
            showItemLabel = false;
            return this;
        }

        public IGalleryUnsizeImage ShowLabel()
        {
            showLabel = true;
            return this;
        }

        public IGalleryUnsizeImage HideLabel()
        {
            showLabel = false;
            return this;
        }

        public IGalleryUnsizeExtra DynamicItems()
        {
            dynamicItemsLoading = true;
            return this;
        }

        public IGalleryUnsizeExtra AddItems(Action<IItems> items)
        {
            dynamicItemsLoading = false;
            items.Invoke(data);
            return this;
        }

        public IGalleryUnsizeExtra AddButtons(Action<IGalleryUnsizeControls> items)
        {
            items.Invoke(controls);
            return this;
        }
    }
}


text:
namespace syncer {

HttpBridgeNetworkResources::~HttpBridgeNetworkResources() {}

std::unique_ptr<HttpPostProviderFactory>
HttpBridgeNetworkResources::GetHttpPostProviderFactory(
    const scoped_refptr<net::URLRequestContextGetter>& baseline_context_getter,
    const NetworkTimeUpdateCallback& network_time_update_callback,
    CancelationSignal* cancelation_signal) {
  return base::WrapUnique<HttpPostProviderFactory>(
      new HttpBridgeFactory(baseline_context_getter,
                            network_time_update_callback, cancelation_signal));
}

}  // namespace syncer


text:
import java.util.ArrayList;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public final class Reservation {
    private static ArrayList<Reservation> reservations = new ArrayList<>();
    private Itinerary itinerary;
    private String passenger;

    /**
     * Creates a new {@link Reservation} object.
     * @param itinerary The {@link Itinerary} to store in the reservation.
     * @param passenger The passenger the reservation is for.
     */
    public Reservation(Itinerary itinerary, String passenger) {
        this.itinerary = itinerary;
        this.passenger = passenger;
    }

    /**
     * @return The itinerary for this reservation.
     */
    public Itinerary getItinerary() {
        return itinerary;
    }

    /**
     * @return The passenger this reservation is for.
     */
    public String getPassenger() {
        return passenger;
    }

    /**
     * Gets the reservations matching the specified criteria.
     * @param passenger The passenger to match on. May not be null.
     * @param origin The origin airport to match on. May be null.
     * @param destination The destination airport to match on. May be null.
     * @return A list of matching reservations, if any.
     * @throws IllegalArgumentException {@code passenger} is {@code null}.
     */
    public static ArrayList<Reservation> retrieveReservation(String passenger, String origin, String destination) {
        if(passenger == null) {
            throw new IllegalArgumentException("Passenger must not be null");
        }

        Stream<Reservation> matches = reservations.stream()
                .filter(r -> r.passenger.equals(passenger));

        if(origin != null && !origin.equals("")) matches = matches.filter(r -> r.itinerary.getOrigin().equals(origin));
        if(destination != null && !origin.equals("")) matches = matches.filter(r -> r.itinerary.getDestination().equals
                (destination));

        return matches.collect(Collectors.toCollection(ArrayList::new));
    }

    /**
     * Creates and stores a new reservation, provided one does not already exist in the system.
     * @param itinerary The itinerary to store with this reservation.
     * @param passenger The passenger making the reservation.
     * @return A reservation object corresponding to the stored reservation.
     * @throws IllegalArgumentException A reservation with the same passenger and origin/destination pair already
     * exists.
     */
    public static Reservation createReservation(Itinerary itinerary, String passenger) {
        Reservation reservation = new Reservation(itinerary, passenger);

        if(reservations.indexOf(reservation) == -1) {
            reservations.add(reservation);
            return reservation;
        } else {
            throw new IllegalArgumentException(String.format(
                    "%s has already created a reservation between %s and %s.",
                    passenger,
                    itinerary.getOrigin(),
                    itinerary.getDestination()));
        }
    }

    /**
     * Deletes a reservation based on the passed parameters.
     * @param passenger The passenger that made the reservation.
     * @param origin The origin airport for the reservation.
     * @param destination The destination airport for the reservation.
     * @return The deleted reservation, or null if no reservation matched the criteria.
     * @throws IllegalArgumentException One of the passed parameters were null, or they matched more than one
     * reservation.
     */
    public static Reservation deleteReservation(String passenger, String origin, String destination) {
        if(passenger == null || origin == null || destination == null) {
            throw new IllegalArgumentException("All parameters must not be null.");
        }

        ArrayList<Reservation> matches = retrieveReservation(passenger, origin, destination);

        if(matches.size() == 1) {
            reservations.remove(matches.get(0));
            return matches.get(0);
        } else {
            throw new IllegalArgumentException("Provided parameters match multiple reservations.");
        }
    }

    /**
     * Determines equality between two {@link Reservation} instances.
     * @param obj The object to compare to the Reservation instance.
     * @return Whether or not the two objects are equal.
     */
    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof Reservation)) {
            return false;
        }

        Reservation other = (Reservation)obj;
        return this.passenger.equals(other.passenger)
                && this.itinerary.getOrigin().equals(other.itinerary.getOrigin())
                && this.itinerary.getDestination().equals(other.itinerary.getDestination());
    }
}


text:
package uk.org.ponder.saxalizer;
  /** The DeSAXalizable interface is implemented by any object wishing
   * to call on the services of the DeSAXalizer class for serialization to
   * a SAX stream. The interface requires the object to report
   * a list of get methods for querying existing subobjects
   * requiring serialisation. */

public interface DeSAXalizable {
  /** This method returns a list of get methods which the DeSAXalizer
   * will call when wishes to write this object to a stream.
   * The DeSAXalizer will call this method on one object of each
   * DeSAXalizable class that it decides to serialize to an XML stream.
   *
The returned array of method specifications has an entry specifying the
   * XML tagname, method name and return type of each suitable get method of this
   * class. The DeSAXalizer will use reflection to locate and invoke
   * the specified method, so it must be a public method of a public class.
   *
   * @return An array of get method specifications; null is allowed if
   * there are no such get methods.
   */
  SAXAccessMethodSpec[] getSAXGetMethods();

  }


text:
<chapter id='The_Server_Database_of_Keyboard_Components'>
<title>The Server Database of Keyboard Components</title>

<para>
The X server maintains a database of keyboard components and common keyboard
mappings. This database contains five kinds of components; when combined, these
five components provide a complete description of a keyboard and its behavior.
</para>

<para>
The X Keyboard Extension provides requests to list the contents of this
database, to assemble and complete keyboard descriptions by merging the current
keyboard description with the contents of this database, or to replace the
current keyboard description with a complete keyboard description assembled as
described below.
</para>

<sect1 id='Component_Names'>
<title>Component Names</title>

<para>
Component and keymap names have the form "<emphasis>
class</emphasis>
(<emphasis>
member</emphasis>
)" where <emphasis>
class</emphasis>
 describes a subset of the available components for a particular type and the
optional <emphasis>
member</emphasis>
 identifies a specific component from that subset. For example, the name
"atlantis(acme)" might specify the symbols used for the atlantis national
keyboard layout by the vendor "acme." Each class has an optional <emphasis>
default</emphasis>
 member — references which specify a class but not a member refer to the
default member of the class, if one exists.
</para>

<para>
The <emphasis>
class</emphasis>
 and <emphasis>
member</emphasis>
 names are both specified using characters from the Latin-1 character set. XKB
implementations must accept all alphanumeric characters, minus ('-') and
underscore ('_') in class or member names, and must not accept parentheses,
plus, vertical bar, percent sign, asterisk, question mark or white space. The
use of other characters is implementation-dependent.
</para>

</sect1>
<sect1 id='Partial_Components_and_Combining_Multiple_Components'>
<title>Partial Components and Combining Multiple Components</title>

<para>
Some of the elements in the server database contain describe only a piece of
the corresponding keyboard component. These <emphasis>
partial</emphasis>
 components should be combined with other components of the same type to be
useful.
</para>

<para>
For example, a partial symbols map might describe the differences between a
common ASCII keyboard and some national layout. Such a partial map is not
useful on its own because it does not include those symbols that are the same
on both the ASCII and national layouts (such as function keys). On the other
hand, this partial map can configure <emphasis>
any</emphasis>
 ASCII keyboard to use a national layout.
</para>

<para>
Two components can be combined in two ways:
</para>

<itemizedlist>
<listitem>
  <para>If the second component <emphasis>
overrides</emphasis>
 the first, any definitions that are present in both components are taken from
the second.
  </para>
</listitem>
<listitem>
  <para>If the second component <emphasis>
augments</emphasis>
 the first, any definitions that are present in both components are taken from
the first.
  </para>
</listitem>
</itemizedlist>

<para>
Applications can use a <emphasis>
component expression</emphasis>
 to combine multiple components of some time into a complete description of
some aspect of the keyboard. A component expression is a string which lists the
components to be combined separated by operators which specify the rules for
combining them. A complete description is assembled from the listed components,
left to right, as follows:
</para>

<itemizedlist>
<listitem>
  <para>If the new elements are being merged with an existing map, the special
component name '%' refers to the unmodified value of the map.
  </para>
</listitem>
<listitem>
  <para>The '+' operator specifies that the next specified component should
override the current assembled definition.
  </para>
</listitem>
<listitem>
  <para>The '|' operator specifies that the next specified component should
augment the currently assembled definition.
  </para>
</listitem>
<listitem>
  <para>If the new elements are being merged with an existing map and the
component expression begins with an operator, a leading '%' is implied.
  </para>
</listitem>
<listitem>
  <para>If any unknown or illegal characters appear anywhere in the string, the
entire expression is invalid and is ignored.
  </para>
</listitem>
</itemizedlist>

<para>
For example, the component expression "+de" specifies that the default element
of the "de" map should be applied to the current keyboard mapping, overriding
any existing definitions.
</para>

<para>
A slightly more involved example: the expression
"acme(ascii)+de(basic)|iso9995-3" constructs a German (de) mapping for the
ASCII keyboard supplied by the "acme" vendor. The new definition begins with
the symbols for the default ASCII keyboard for Acme, overrides them with any
keys that are defined for the default German keyboard layout and then applies
the definitions from the iso9995-3 to any undefined keys or groups of keys
(part three of the iso9995 standard defines a common set of bindings for the
secondary group, but allows national layouts to override those definitions
where necessary).
</para>

</sect1>
<sect1 id='Component_Hints'>
<title>Component Hints</title>

<para>
Each component has a set of flags that provide some additional hints about that
component. XKB provides these hints for clients that present the keyboard
database to users and specifies their interpretation only loosely. Clients can
use these hints to constrain the list of components or to control the way that
components are presented to the user.
</para>

<para>
Hints for a component are reported with its name. The least significant byte of
the hints field has the same meaning for all five types of keyboard components,
and can contain any combination of the following values:
</para>

<informaltable frame='topbot'>
<?dbfo keep-together="always" ?>
<tgroup cols='2' align='left' colsep='0' rowsep='0'>
<colspec colname='c1' colwidth='1.0*'/>
<colspec colname='c2' colwidth='3.0*'/>
<thead>
  <row rowsep='1'>
    <entry>Flag</entry>
    <entry>Meaning</entry>
  </row>
</thead>
<tbody>
  <row>
    <entry><emphasis>
LC_Hidden</emphasis>
</entry>
    <entry>Indicates a component that should not normally be presented to the
user.</entry>
  </row>
  <row>
    <entry><emphasis>
LC_Default</emphasis>
</entry>
    <entry>Indicates a component that is the default member of its
class.</entry>
  </row>
  <row>
    <entry><emphasis>
LC_Partial</emphasis>
</entry>
    <entry>Indicates a partial component.</entry>
  </row>
</tbody>
</tgroup>
</informaltable>

<para>
The interpretation of the most significant byte of the hints field is dependent
on the type of component. The hints defined for each kind of component are
listed in the section below that describes that kind of component.
</para>

</sect1>
<sect1 id='Keyboard_Components'>
<title>Keyboard Components</title>

<para>
The five types of components stored in the server database of keyboard
components correspond to the <emphasis>
symbols</emphasis>
, <emphasis>
geometry</emphasis>
, <emphasis>
keycodes</emphasis>
, <emphasis>
compat</emphasis>
 and <emphasis>
types</emphasis>
 symbolic names associated with a keyboard.
</para>

</sect1>
<sect1 id='The_Keycodes_Component'>
<title>The Keycodes Component</title>

<para>
The <emphasis>
keycodes</emphasis>
 component of a keyboard mapping specifies the range and interpretation of the
raw keycodes reported by the device. It sets the <emphasis>
keycodes</emphasis>
 symbolic name, the minimum and maximum legal keycodes for the keyboard, and
the symbolic name for each key. The keycodes component might also contain
aliases for some keys, symbolic names for some indicators, and a description of
which indicators are physically present.
</para>

<para>
The special keycodes component named "computed" indicates that XKB should
assign unused keycodes to any unknown keys referenced by name by any of the
other components. The computed keycodes component is useful primarily when
browsing keymaps because it makes it possible to use the symbols and geometry
components without having to find a set of keycodes that includes keycode
definitions for all of the keys listed in the two components.
</para>

<para>
XKB defines no hints that are specific to the keycodes component.
</para>

<sect2 id='The_Types_Component'>
<title>The Types Component</title>

<para>
The <emphasis>
types</emphasis>
 component of a keyboard mapping specifies the key types that can be associated
with the various keyboard keys. It affects the <emphasis>
types</emphasis>
 symbolic name and the list of types associated with the keyboard (see
<link linkend='Key_Types'>Key Types</link>). The types component
of a keyboard mapping can also optionally contain real modifier bindings and
symbolic names for one or more virtual modifiers.
</para>

<para>
The special types component named "canonical" always contains the types and
definitions listed in <link linkend="canonical_key_types">Canonical Key Types</link> of this document.
</para>

<para>
XKB defines no hints that are specific to the types component.
</para>

</sect2>
<sect2 id='The_Compatibility_Map_Component'>
<title>The Compatibility Map Component</title>

<para>
The <emphasis>
compatibility map</emphasis>
 component of a keyboard mapping primarily specifies the rules used to assign
actions to keysyms. It affects the <emphasis>
compat</emphasis>
 symbolic name, the symbol compatibility map and the group compatibility map.
The compat component might also specify maps for some indicators and the real
modifier bindings and symbolic names of some virtual modifiers.
</para>

<para>
XKB defines no hints that are specific to the compatibility map component.
</para>

</sect2>
<sect2 id='The_Symbols_Component'>
<title>The Symbols Component</title>

<para>
The <emphasis>
symbols</emphasis>
 component of a keyboard mapping specifies primarily the symbols bound to each
keyboard key. It affects the <emphasis>
symbols</emphasis>
 symbolic name, a key symbol mapping for each key, they keyboard modifier
mapping, and the symbolic names for the keyboard symbol groups. Optionally, the
<emphasis>
symbols</emphasis>
 component can contain explicit actions and behaviors for some keys, or the
real modifier bindings and symbolic names for some virtual modifiers.
</para>

<para>
XKB defines the following additional hints for the symbols component:
</para>

<informaltable frame='topbot'>
<?dbfo keep-together="always" ?>
<tgroup cols='2' align='left' colsep='0' rowsep='0'>
<colspec colname='c1' colwidth='1.0*'/>
<colspec colname='c2' colwidth='3.0*'/>
<thead>
  <row rowsep='1'>
    <entry>Flag</entry>
    <entry>Meaning</entry>
  </row>
</thead>
<tbody>
  <row>
    <entry><emphasis>
LC_AlphanumericKeys</emphasis>
</entry>
    <entry>Indicates a symbol component that contains bindings primarily for an
alphanumeric section of the keyboard.</entry>
  </row>
  <row>
    <entry><emphasis>
LC_ModifierKeys</emphasis>
</entry>
    <entry>Indicates a symbol component that contains bindings primarily for
modifier keys.</entry>
  </row>
  <row>
    <entry><emphasis>
LC_KeypadKeys</emphasis>
</entry>
    <entry>Indicates a symbol component that contains bindings primarily for
numeric keypad keys.</entry>
  </row>
  <row>
    <entry>LC_FunctionKeys</entry>
    <entry>Indicates a symbol component that contains bindings primarily for
function keys.</entry>
  </row>
  <row>
    <entry>LC_AlternateGroup</entry>
    <entry>Indicates a symbol component that contains bindings for an alternate
keyboard group.</entry>
  </row>
</tbody>
</tgroup>
</informaltable>

<para>
These hints only apply to partial symbols components; full symbols components
are assumed to specify all of the pieces listed above.
</para>

<note><para>The alphanumeric, modifier, keypad or function keys hints should
describe the primary intent of the component designer and should not simply an
exhaustive list of the kinds of keys that are affected. For example, national
keyboard layouts affect primarily alphanumeric keys, but many affect a few
modifier keys too; such mappings should set only <emphasis>
LC_AlphanumericKeys</emphasis>
 hint. In general, symbol components should set only one of those four flags
(though <emphasis>
LC_AlternateGroup</emphasis>
 may be combined with any of the other flags).</para></note>

</sect2>
<sect2 id='The_Geometry_Component'>
<title>The Geometry Component</title>

<para>
The <emphasis>
geometry</emphasis>
 component of a keyboard mapping specifies primarily the geometry of the
keyboard. It contains the geometry symbolic name and the keyboard geometry
description. The geometry component might also contain aliases for some keys or
symbolic names for some indicators and might affect the set of indicators that
are physically present. Key aliases defined in the geometry component of a
keyboard mapping override those defined in the keycodes component.
</para>

<para>
XKB defines no hints that are specific to the geometry component.
</para>

</sect2>
</sect1>
<sect1 id='Complete_Keymaps'>
<title>Complete Keymaps</title>

<para>
The X server also reports a set of fully specified keymaps. The keymaps
specified in this list are usually assembled from the components stored in the
rest of the database and typically represent the most commonly used keymaps for
a particular system.
</para>

<para>
XKB defines no hints that are specific to complete keymaps.
</para>
</sect1>
</chapter>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#EBEBEB"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="96dp"
        android:clickable="true"
        android:layout_marginTop="16dp"
        android:padding="8dp"
        android:background="@drawable/item_selector">

        <ImageView
            android:id="@+id/fragment_me_ivHead"
            android:layout_width="72dp"
            android:layout_height="72dp"
            android:layout_centerVertical="true"
            android:scaleType="centerCrop"
            android:src="@mipmap/head" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:padding="8dp"
            android:layout_toRightOf="@id/fragment_me_ivHead"
            android:orientation="vertical">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="zouzhiwei"
                android:textColor="#000"
                android:layout_margin="4dp"
                android:textSize="14sp"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="4dp"
                android:text="微信号:doubleZ_2B"
                android:textSize="14sp"/>
        </LinearLayout>

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:clickable="true"
            android:padding="4dp"
            android:background="@drawable/ic_two_dimension_code_selector"
            android:layout_centerVertical="true"
            android:layout_marginRight="16dp"/>

    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="97dp"
        android:layout_marginTop="16dp"
        android:background="#fff"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:background="@drawable/item_selector"
            android:clickable="true">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="8dp"
                android:src="@mipmap/ic_album" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:text="相册"
                android:textColor="#000"
                android:textSize="16sp" />
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="9dp"
            android:background="#E9E9E9" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:background="@drawable/item_selector"
            android:clickable="true">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="8dp"
                android:src="@mipmap/ic_collect" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:text="收藏"
                android:textColor="#000"
                android:textSize="16sp" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_marginTop="16dp"
        android:background="@drawable/item_selector"
        android:clickable="true">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="8dp"
            android:src="@mipmap/ic_wallet" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="钱包"
            android:textColor="#000"
            android:textSize="16sp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_marginTop="16dp"
        android:background="@drawable/item_selector"
        android:clickable="true">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="8dp"
            android:src="@mipmap/ic_expression" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="表情"
            android:textColor="#000"
            android:textSize="16sp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_marginTop="16dp"
        android:background="@drawable/item_selector"
        android:clickable="true">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="8dp"
            android:src="@mipmap/ic_setting" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="设置"
            android:textColor="#000"
            android:textSize="16sp" />
    </LinearLayout>

</LinearLayout>


text:
package com.eagle.io;

public class AbbreviateClassName
{
	public static final String CLASS_PREFIX1 = "com.eagle.programmar";
	public static final String CLASS_PREFIX2 = "com.eagle.tokens.punctuation.Punctuation";

	public static final String CLASS_TOKENLIST = "com.eagle.tokens.TokenList";
	public static final String LIST = "List";

	public static String abbrev(String fullName)
	{
		if (fullName.startsWith(CLASS_PREFIX1))
		{
			// Toss the leading "com.eagle.programmar"
			return fullName.substring(CLASS_PREFIX1.length());
		}

		if (fullName.startsWith(CLASS_PREFIX2))
		{
			// Replace the leading "com.eagle.tokens.punctuation." with ","
			return "," + fullName.substring(CLASS_PREFIX2.length());
		}

		if (fullName.equals(CLASS_TOKENLIST))
		{
			return LIST;
		}

		// No change
		return fullName;
	}

	public static String restore(String shortName)
	{
		if (shortName.startsWith("."))
		{
			return CLASS_PREFIX1 + shortName;
		}

		if (shortName.startsWith(","))
		{
			return CLASS_PREFIX2 + shortName.substring(1);
		}

		if (shortName.equals(LIST))
		{
			return CLASS_TOKENLIST;
		}

		// No change
		return shortName;
	}
}


text:
default[:zabbixgridengine][:sgeroot]="/usr/share/gridengine"
default[:zabbixgridengine][:zabbixincludedirectory]="/etc/zabbix/agent_include"


text:
function fimage = regiongrow(I, varargin)
%
% Performing mean_shift operation on image
%
% Usage:
%   [output] = edison_wrapper(I, ...)
%
% Inputs:
%   I - original image
%
% Allowed parameters:
%   'hi' - hard uphill constraint
%   'lo' - soft uphill constraint
%   'sumlo' - sum of consecutive 'lo' constraints allowable
%
% Outputs:
%   result - binary image describing the resulting segmentation
%
hi = 0.0660;
lo =  0.0040;
sumlo =  0.0120;

%fim = im2single(rgbim);
try
    p = struct(varargin{:});
catch
    error('edison_wrapper:parse_inputs','Cannot parse arguments');
end

if ~isfield(p, 'hi')
    p.hi = hi;
end
if ~isfield(p, 'lo')
    p.lo = lo;
end
if ~isfield(p, 'sumlo')
    p.sumlo = sumlo;
end

[fimage] = regiongrow_mex(I, p);

vals = I(fimage);
threshold = mean(vals) + 0.5 * std(vals);
%fimage = imreconstruct(fimage, fimage | (I < threshold));


text:
module AwesomeTranslate

  class << self

    def access_token
      return @access_token if access_token_valid?
      atar = AccessTokenAuthenticationRequest.new
      @access_token = atar.request_access_token
    end

    def access_token_valid?
      @access_token && @access_token['expires_in'] > Time.now
    end

  end

  class AccessTokenAuthenticationRequest < AwesomeTranslate::Request

    def request_access_token
      token = post(request_params)

      #override token['expires_in'], because api return token lifetime in seconds, ie 600
      token['expires_in'] = Time.now + token['expires_in'].to_i
      token
    end

    def request_params
      {
        'client_id'     => AwesomeTranslate.client_id,
        'client_secret' => AwesomeTranslate.client_secret,
        'scope'         => AwesomeTranslate.scope,
        'grant_type'    => AwesomeTranslate.grant_type
      }
    end

  end

end


text:
<?php

/**
 * Interface for renderers
 */
interface VcsStats_Renderer_Interface
{
    /**
     * Generate report output
     *
     * @param VcsStats_Report $report Report
     * @return void
     */
    public function render(VcsStats_Report $report);

    /**
     * Generate section output
     *
     * @param VcsStats_Report $report Report
     * @return void
     */
    public function renderSection(VcsStats_Report_Section $section);

    /**
     * Generate table output
     *
     * @param VcsStats_Table $table Table
     * @return void
     */
    public function renderTable(VcsStats_Report_Element_Table $table);
}


text:
FOUNDATION_EXPORT double XLPagerTabStripVersionNumber;

//! Project version string for XLPagerTabStrip.
FOUNDATION_EXPORT const unsigned char XLPagerTabStripVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <XLPagerTabStrip/PublicHeader.h>

#import "FXPageControl.h"


text:
#ifndef MAYAEGGLOADER_H
#define MAYAEGGLOADER_H

class EggData;

bool MayaLoadEggData(EggData *data,    bool merge, bool model, bool anim, bool respect_normals);
bool MayaLoadEggFile(const char *name, bool merge, bool model, bool anim, bool respect_normals);

#endif


text:
<?php
include_once("../sitesetup.php");
include_once("../pageBuilder/xmlPage.php");
include_once("../toolbox/filetools.php");

define('MISSING', "The requested item does not exist.");
define('DB_EXISTS', "The requested database exists.");
define('TABLE_EXISTS', "The requested table exists.");

function loadExpectedDatabaseAssets($fileName, $databaseName)
{
	/* Load in the install.xml file and related information */
  $databaseAssets = array();

  $xmlDoc = new DOMDocument();

  $xmlDoc->load($fileName);

  $domList = $xmlDoc->getElementsByTagName("database");
  foreach ($domList as $domNode)
  {
  	if ($domNode->hasAttributes())
  	{
  		$dbName = $databaseName;
  		$dbScript = "none";
  		$dbVersion = "none";
      foreach ($domNode->attributes as $attr)
      {
        if ($attr->name == "name")
        {
//          $dbName = $attr->value;
        }
        if ($attr->name == "codefile")
        {
          $dbScript = $attr->value;
        }
        if ($attr->name == "version")
        {
          $dbVersion = $attr->value;
        }
      }
		$databaseAssets[$dbName] = array();
		$databaseAssets[$dbName]["tables"] = array();
		$databaseAssets[$dbName]["codefile"] = $dbScript;
		$databaseAssets[$dbName]["version"] = $dbVersion;

	    /* For each database, there will be a set of tables that correspond to it */
		$tableList = $xmlDoc->getElementsByTagName("table");
		foreach ($tableList as $tableNode)
		{
	  		$tblName = "none";
	  		$tblScript = "none";
	  		$tblVersion = "none";
	      foreach ($tableNode->attributes as $attr)
	      {
	        if ($attr->name == "name")
	        {
	          $tblName = $attr->value;
	        }
	        if ($attr->name == "codefile")
	        {
	          $tblScript = $attr->value;
	        }
	        if ($attr->name == "version")
	        {
	          $tblVersion = $attr->value;
	        }
	      }
			$databaseAssets[$dbName]["tables"][$tblName] = array();
			$databaseAssets[$dbName]["tables"][$tblName]["codefile"] = $tblScript;
			$databaseAssets[$dbName]["tables"][$tblName]["version"] = $tblVersion;
		}
  	}
  }
  return $databaseAssets;
}

function checkDatabase(& $tables)
{
  $systemObject = getSystemObject();

  $returnString = MISSING;

  $dbInstance = $systemObject->getDbInstance();

  if ($dbInstance != null)
  {
  	$dbName = $systemObject->getConfigurationData(SITE_DB_NAME);
    if ($dbInstance->doesDatabaseExist($dbName) == true)
    {
			$returnString = DB_EXISTS;

    	/* Load up each of the tables */
      $cdResourceId = 0;
			// load tables
			$command = "select table_name, table_rows from information_schema.tables where table_schema='$dbName';";
			$dbInstance->issueCommand($command, $cdResourceId);
			$rowResult = $dbInstance->getResult($cdResourceId);
			foreach ($rowResult as $row)
			{
				$tables[$row[0]] = $row[1];
			}

			$dbInstance->releaseResults($cdResourceId);
    }
  }
  return $returnString;
}

function checkTable($tableName)
{
}

function showCurrentSettings($echoData)
{
}

/* Create an xml response and dump it back if this is being called as the source file
 * otherwise just expose the functionality */
if (isFileLoaded(basename(__FILE__)))
{
	/* Create our xml response - default to direct display */
	/* it should look as follows:
	 * <status>
	 *   <results>
	 *     <database name="test">
	 *

	 *

	 *     </database>
	 * </status>
	 */
	$xmlPage = new XmlPageData();
	$xmlPage->setName("status");

	$xmlNode = new XmlDataObject();
	$xmlNode->setName("results");

	$tables = array();
	$dbExists = checkDatabase($tables);

	if ($dbExists == DB_EXISTS)
	{
		$systemObject = getSystemObject();
		$dbName = $systemObject->getConfigurationData(SITE_DB_NAME);
		$databaseNode = new XmlDataObject();
		$databaseNode->setName("database");
		$databaseNode->addAttribute("name", $dbName);
		$xmlNode->addChildObject($databaseNode);

		/* Now query each of the tables */
		foreach ($tables as $tableEntry => $rowsCount)
		{
			$tableNode = new XmlDataObject();
			$tableNode->setName("table");
			$tableNode->addAttribute("name", $tableEntry);
			$tableNode->addAttribute("records", $rowsCount);
			$databaseNode->addChildObject($tableNode);
		}
	}
	$xmlPage->addChildObject($xmlNode);

	$xmlPage->renderPage();
}
?>


text:
using System;
using NUnit.Framework;
using System.IO;

namespace NClang.Tests
{
	[TestFixture]
	public class ClangCompilationDatabaseTest
	{
		[Test]
		public void CreateDatabaseFromDirectory ()
		{
			// cannot really create a database from nothing.
			var dir = Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath);
			Assert.Throws<ClangServiceException>(() => ClangService.CreateDatabaseFromDirectory(dir));
		}
	}
}


text:
title: "Running requests in sequence"
updated: 2022-11-17
---

If you have several requests that have no dependency on each other but have to be executed in a particular order, you can use send events to connect your [blocks](/docs/postman-flows/core-concepts/blocks/).

> Check out the example flow: [Chaining requests](https://www.postman.com/postman/workspace/example-flows/flow/6267f9315d367a64e7ba06e5)

1. **Add a Send Request block**

   Select **+ Block** on the toolbar and select the **Send Request** block from the list to add it to your canvas, then select the request. Repeat this until all the requests are added to the canvas.

   ![running requests add](https://assets.postman.com/postman-labs-docs/running-requests/updated-running-add-requests.gif)

2. **Connect the send events**

   Select the dot (success output) of the source block and connect it to the send input of the target block in the order you want the requests to execute.

   ![Connect send events](https://assets.postman.com/postman-labs-docs/running-requests/updated-running-connect-send-events.gif)

   Here, a POST request is executed and once the request has completed, the PUT request endpoint is called, and then finally a GET request is called.

   > **Important**
   >
   > 1. When a send event connection is made, the input becomes deactivated to show that it will get enabled after the previous blocks get enabled.
   > 2. The send event connection depicts the order in which the blocks will be executed.
   > 3. When using send event, no data is passed from one block to another.

3. **Start the Flow**

   Start the Flow and see the requests run in the order they're configured:

   ![Start the flow](https://assets.postman.com/postman-labs-docs/running-requests/updated-running-run-with-send-events.gif)

If you want to use data from one request in another request, you can learn how to do so in [Chaining requests with data](/docs/postman-flows/flows-intro/chaining-requests-with-data/).


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections.Concurrent;

namespace Analyzer.Utilities
{
    /// <summary>
    /// Like ConcurrentDictionary, but single threaded valueFactory execution in GetOrAdd.
    /// </summary>
    /// <remarks>Useful for long running valueFactory functions, like say performing
    /// dataflow analysis.  This way DFA is invoked only once per key, even if multiple
    /// threads simultaneously request the same key.</remarks>
#pragma warning disable CA1812    // SingleThreadedConcurrentDictionary is too used.
    internal class SingleThreadedConcurrentDictionary<TKey, TValue>
        where TValue : class
#pragma warning restore CA1812
    {
        /// <summary>
        /// An Entry itself serves a lock object, and contains the real value.
        /// </summary>
        private class Entry
        {
            public TValue? Value { get; set; }
        }

        /// <summary>
        /// Holds entries, which contain the actual values.
        /// </summary>
        private readonly ConcurrentDictionary<TKey, Entry> BackingDictionary = new ConcurrentDictionary<TKey, Entry>();

        /// <summary>
        /// Adds a key/value pair using the specified function if the key does not already exist.  Returns the new value, or the existing value if the key exists.
        /// </summary>
        /// <param name="key">Key to add.</param>
        /// <param name="valueFactory">Function to be invoked to generate the key, if necessary.</param>
        /// <returns>Value of the key, which will either be the existing value, or new value if the key was not in the dictionary.</returns>
        public TValue? GetOrAdd(TKey key, Func<TKey, TValue?> valueFactory)
        {
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            if (valueFactory == null)
            {
                throw new ArgumentNullException(nameof(valueFactory));
            }

            // The return value of ConcurrentDictionary.GetOrAdd() is
            // consistent, i.e. the same instance no matter how many times
            // this valueFactory gets executed.  So for a given key, we'll
            // always get back the same Entry instance.
            Entry entry = this.BackingDictionary.GetOrAdd(key, (_) => new Entry());
            if (entry.Value != null)
            {
                return entry.Value;
            }

            lock (entry)
            {
                if (entry.Value == null)
                {
                    entry.Value = valueFactory(key);
                }
            }

            return entry.Value;
        }
    }
}


text:
The catalog is a web frontend for browsing meta-data held by the Quilt registry.

# Developer
## Configuration
The app configuration (API endpoints, bucket federations, etc.) is read from
the `/config.json` path.

## Running the catalog locally
```sh
# local web server for catalog w/hot reload
$ cd catalog
# copy and edit config file
$ cp config.json.example static-dev/config.json
$ vi static-dev/config.json
$ npm start
```

## Notes
- don't be surprised if react-boilerplate code and doc gets way ahead of our repo;
it's rapidly evolving and there isn't a good way to pick up changes

- Redux store.app is generally populated with Immutable.js data structures, whereas
selectors mostly return JS (use Immutable.toJS()) for consumption by React components.
React-redux also seems to rely on JS data structures for `routingState` and `LOCATION_CHANGE`,
but that's handled in a separate domain (`state.route`) via reducer composition;
  - makeSelectorNAME converts to JS for mapping to props
  - leaf nodes may be primitive types
  - use toJS() and fromJS from 'immutable' to convert

### Connecting to the router
- all route handling components already get a bunch of params injected as props
- for everything else: [`withRouter`](https://github.com/ReactTraining/react-router/blob/c3cd9675bd8a31368f87da74ac588981cbd6eae7/upgrade-guides/v2.4.0.#d)

### Fetch
- An accurate check for a successful fetch() would include checking that the promise resolved, then checking that the Response.ok property has a value of true. The code would look something like this:
[msdn fetch doc](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)