text:
Using BigQuery with Pandas
~~~~~~~~~~~~~~~~~~~~~~~~~~

Retrieve BigQuery data as a Pandas DataFrame
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As of version 0.29.0, you can use the
:func:`~google.cloud.bigquery.table.RowIterator.to_dataframe` function to
retrieve query results or table rows as a :class:`pandas.DataFrame`.

First, ensure that the :mod:`pandas` library is installed by running:

.. code-block:: bash

   pip install --upgrade pandas

Alternatively, you can install the BigQuery Python client library with
:mod:`pandas` by running:

.. code-block:: bash

   pip install --upgrade 'google-cloud-bigquery[pandas]'

To retrieve query results as a :class:`pandas.DataFrame`:

.. literalinclude:: ../snippets.py
   :language: python
   :dedent: 4
   :start-after: [START bigquery_query_results_dataframe]
   :end-before: [END bigquery_query_results_dataframe]

To retrieve table rows as a :class:`pandas.DataFrame`:

.. literalinclude:: ../snippets.py
   :language: python
   :dedent: 4
   :start-after: [START bigquery_list_rows_dataframe]
   :end-before: [END bigquery_list_rows_dataframe]

The following data types are used when creating a pandas DataFrame.

.. list-table:: Pandas Data Type Mapping
   :header-rows: 1

   * - BigQuery
     - pandas
     - Notes
   * - BOOL
     - boolean
     -
   * - DATETIME
     - datetime64[ns], object
     - The object dtype is used when there are values not representable in a
       pandas nanosecond-precision timestamp.
   * - DATE
     - dbdate, object
     - The object dtype is used when there are values not representable in a
       pandas nanosecond-precision timestamp.

       Requires the ``db-dtypes`` package. See the `db-dtypes usage guide
       <https://googleapis.dev/python/db-dtypes/latest/usage.html>`_
   * - FLOAT64
     - float64
     -
   * - INT64
     - Int64
     -
   * - TIME
     - dbtime
     - Requires the ``db-dtypes`` package. See the `db-dtypes usage guide
       <https://googleapis.dev/python/db-dtypes/latest/usage.html>`_

Retrieve BigQuery GEOGRAPHY data as a GeoPandas GeoDataFrame
------------------------------------------------------------

`GeoPandas <https://geopandas.org/>`_ adds geospatial analytics
capabilities to Pandas.  To retrieve query results containing
GEOGRAPHY data as a :class:`geopandas.GeoDataFrame`:

.. literalinclude:: ../samples/geography/to_geodataframe.py
   :language: python
   :dedent: 4
   :start-after: [START bigquery_query_results_geodataframe]
   :end-before: [END bigquery_query_results_geodataframe]

Load a Pandas DataFrame to a BigQuery Table
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As of version 1.3.0, you can use the
:func:`~google.cloud.bigquery.client.Client.load_table_from_dataframe` function
to load data from a :class:`pandas.DataFrame` to a
:class:`~google.cloud.bigquery.table.Table`. To use this function, in addition
to :mod:`pandas`, you will need to install the :mod:`pyarrow` library. You can
install the BigQuery Python client library with :mod:`pandas` and
:mod:`pyarrow` by running:

.. code-block:: bash

   pip install --upgrade google-cloud-bigquery[pandas,pyarrow]

The following example demonstrates how to create a :class:`pandas.DataFrame`
and load it into a new table:

.. literalinclude:: ../samples/load_table_dataframe.py
   :language: python
   :dedent: 4
   :start-after: [START bigquery_load_table_dataframe]
   :end-before: [END bigquery_load_table_dataframe]


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/contactcenterinsights/v1/resources.proto

namespace Google\Cloud\ContactCenterInsights\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Issue Modeling result on a conversation.
 *
 * Generated from protobuf message google.cloud.contactcenterinsights.v1.IssueModelResult
 */
class IssueModelResult extends \Google\Protobuf\Internal\Message
{
    /**
     * Issue model that generates the result.
     * Format: projects/{project}/locations/{location}/issueModels/{issue_model}
     *
     * Generated from protobuf field string issue_model = 1 [(.google.api.resource_reference) = {
     */
    private $issue_model = '';
    /**
     * All the matched issues.
     *
     * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.IssueAssignment issues = 2;
     */
    private $issues;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $issue_model
     *           Issue model that generates the result.
     *           Format: projects/{project}/locations/{location}/issueModels/{issue_model}
     *     @type array<\Google\Cloud\ContactCenterInsights\V1\IssueAssignment>|\Google\Protobuf\Internal\RepeatedField $issues
     *           All the matched issues.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Issue model that generates the result.
     * Format: projects/{project}/locations/{location}/issueModels/{issue_model}
     *
     * Generated from protobuf field string issue_model = 1 [(.google.api.resource_reference) = {
     * @return string
     */
    public function getIssueModel()
    {
        return $this->issue_model;
    }

    /**
     * Issue model that generates the result.
     * Format: projects/{project}/locations/{location}/issueModels/{issue_model}
     *
     * Generated from protobuf field string issue_model = 1 [(.google.api.resource_reference) = {
     * @param string $var
     * @return $this
     */
    public function setIssueModel($var)
    {
        GPBUtil::checkString($var, True);
        $this->issue_model = $var;

        return $this;
    }

    /**
     * All the matched issues.
     *
     * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.IssueAssignment issues = 2;
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getIssues()
    {
        return $this->issues;
    }

    /**
     * All the matched issues.
     *
     * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.IssueAssignment issues = 2;
     * @param array<\Google\Cloud\ContactCenterInsights\V1\IssueAssignment>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setIssues($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\IssueAssignment::class);
        $this->issues = $arr;

        return $this;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package org.skife.jdbi.v2.sqlobject.stringtemplate;

import org.skife.jdbi.v2.sqlobject.SqlQuery;

@UseStringTemplate3StatementLocator("/org/skife/jdbi/v2/sqlobject/stringtemplate/Kombucha.sql.stg")
public interface Kombucha
{
    @SqlQuery
    String getIngredients();
}


text:
#include "LockAppCommandDelegate.h"
#include <platform/PlatformManager.h>

#include <LockManager.h>
#include <utility>

using chip::to_underlying;

class LockAppCommandHandler
{
public:
    static LockAppCommandHandler * FromJSON(const char * json);

    static void HandleCommand(intptr_t context);

    LockAppCommandHandler(std::string && cmd, Json::Value && params) :
        mCommandName(std::move(cmd)), mCommandParameters(std::move(params))
    {}

private:
    std::string mCommandName;
    Json::Value mCommandParameters;
};

LockAppCommandHandler * LockAppCommandHandler::FromJSON(const char * json)
{
    // Command format:
    // { "Cmd": "SetDoorState", "Params": { "EndpointId": 1, "DoorState": 2} }
    Json::Reader reader;
    Json::Value value;
    if (!reader.parse(json, value))
    {
        ChipLogError(NotSpecified, "Lock App: Error parsing JSON with error %s:", reader.getFormattedErrorMessages().c_str());
        return nullptr;
    }

    if (value.empty() || !value.isObject())
    {
        ChipLogError(NotSpecified, "Lock App: Invalid JSON command received");
        return nullptr;
    }

    if (!value.isMember("Cmd") || !value["Cmd"].isString())
    {
        ChipLogError(NotSpecified, "Lock App: Invalid JSON command received: command name is missing");
        return nullptr;
    }

    Json::Value params = Json::objectValue;
    if (value.isMember("Params"))
    {
        if (!value["Params"].isObject())
        {
            ChipLogError(NotSpecified, "Lock App: Invalid JSON command received: specified parameters are incorrect");
            return nullptr;
        }
        params = value["Params"];
    }
    auto commandName = value["Cmd"].asString();
    return chip::Platform::New<LockAppCommandHandler>(std::move(commandName), std::move(params));
}

void LockAppCommandHandler::HandleCommand(intptr_t context)
{
    auto * self         = reinterpret_cast<LockAppCommandHandler *>(context);
    const auto & params = self->mCommandParameters;
    // Determine the endpoint ID from the parameters JSON. If it is missing, use the default endpoint defined in the
    // door-lock-server.h
    chip::EndpointId endpointId = DOOR_LOCK_SERVER_ENDPOINT;
    if (params.isMember("EndpointId"))
    {
        VerifyOrExit(params["EndpointId"].isUInt(),
                     ChipLogError(NotSpecified, "Lock App: Unable to execute command \"%s\": invalid endpoint Id",
                                  self->mCommandName.c_str()));
        endpointId = static_cast<chip::EndpointId>(params["EndpointId"].asUInt());
    }

    // TODO: Make commands separate objects derived from some base class to clean up this mess.

    // Now we can try to execute a command
    if (self->mCommandName == "SetDoorState")
    {
        VerifyOrExit(params.isMember("DoorState"),
                     ChipLogError(NotSpecified,
                                  "Lock App: Unable to execute command to set the door state: DoorState is missing in command"));

        VerifyOrExit(
            params["DoorState"].isUInt(),
            ChipLogError(NotSpecified, "Lock App: Unable to execute command to set the door state: invalid type for DoorState"));

        auto doorState = params["DoorState"].asUInt();
        VerifyOrExit(doorState < to_underlying(DlDoorState::kUnknownEnumValue),
                     ChipLogError(NotSpecified,
                                  "Lock App: Unable to execute command to set door state: DoorState is out of range [doorState=%u]",
                                  doorState));
        LockManager::Instance().SetDoorState(endpointId, static_cast<DlDoorState>(doorState));
    }
    else if (self->mCommandName == "SendDoorLockAlarm")
    {
        VerifyOrExit(
            params.isMember("AlarmCode"),
            ChipLogError(NotSpecified, "Lock App: Unable to execute command to send lock alarm: AlarmCode is missing in command"));

        VerifyOrExit(
            params["AlarmCode"].isUInt(),
            ChipLogError(NotSpecified, "Lock App: Unable to execute command to send lock alarm: invalid type for AlarmCode"));

        auto alarmCode = params["AlarmCode"].asUInt();
        VerifyOrExit(
            alarmCode < to_underlying(DlAlarmCode::kUnknownEnumValue),
            ChipLogError(NotSpecified,
                         "Lock App: Unable to execute command to send lock alarm: AlarmCode is out of range [alarmCode=%u]",
                         alarmCode));
        LockManager::Instance().SendLockAlarm(endpointId, static_cast<DlAlarmCode>(alarmCode));
    }
    else
    {
        ChipLogError(NotSpecified, "Lock App: Unable to execute command \"%s\": command not supported", self->mCommandName.c_str());
    }

exit:
    chip::Platform::Delete(self);
}

void LockAppCommandDelegate::OnEventCommandReceived(const char * json)
{
    auto handler = LockAppCommandHandler::FromJSON(json);
    if (nullptr == handler)
    {
        ChipLogError(NotSpecified, "Lock App: Unable to instantiate a command handler");
        return;
    }

    chip::DeviceLayer::PlatformMgr().ScheduleWork(LockAppCommandHandler::HandleCommand, reinterpret_cast<intptr_t>(handler));
}


text:
@class GIFDeleteHandle;

@protocol GIFDeleteHandleDelegate <NSObject>
-(void)didDelete;
@end

@interface GIFDeleteHandle : UIView

@property (weak, nonatomic) id<GIFDeleteHandleDelegate>delegate;

@end


text:
package me.infuzion.chat.server.api.event.connection;

import me.infuzion.chat.server.api.IChatClient;
import me.infuzion.chat.server.api.event.Cancelable;

@SuppressWarnings({"WeakerAccess", "unused"})
public class KickEvent extends QuitEvent implements Cancelable {
    boolean canceled = false;

    public KickEvent(IChatClient client) {
        super(client);
    }

    @Override
    public boolean isCanceled() {
        return canceled;
    }

    @Override
    public void setCanceled(boolean canceled) {
        this.canceled = canceled;
    }
}


text:
{% extends "django_registration/registration_base.html" %}
{% load i18n %}

{% block bootstrap3_title %}{% blocktrans %}Account activation failed{% endblocktrans %} | {% endblock %}

{% block content %}

{% trans "Account activation failed." %}

{% trans "Did you remember to consume the activation link within 7 days?" %}

{% endblock %}


text:
import contextlib
import blinker
import blinker._saferef
import pprint
import copy
import functools
import os
import typing
import textwrap

import ruamel.yaml

from mitmproxy import exceptions
from mitmproxy.utils import typecheck

"""
    The base implementation for Options.
"""

unset = object()

class _Option:
    __slots__ = ("name", "typespec", "value", "_default", "choices", "help")

    def __init__(
        self,
        name: str,
        typespec: type,
        default: typing.Any,
        help: str,
        choices: typing.Optional[typing.Sequence[str]]
    ) -> None:
        typecheck.check_type(name, default, typespec)
        self.name = name
        self.typespec = typespec
        self._default = default
        self.value = unset
        self.help = textwrap.dedent(help).strip().replace("\n", " ")
        self.choices = choices

    def __repr__(self):
        return "{value} [{type}]".format(value=self.current(), type=self.typespec)

    @property
    def default(self):
        return copy.deepcopy(self._default)

    def current(self) -> typing.Any:
        if self.value is unset:
            v = self.default
        else:
            v = self.value
        return copy.deepcopy(v)

    def set(self, value: typing.Any) -> None:
        typecheck.check_type(self.name, value, self.typespec)
        self.value = value

    def reset(self) -> None:
        self.value = unset

    def has_changed(self) -> bool:
        return self.current() != self.default

    def __eq__(self, other) -> bool:
        for i in self.__slots__:
            if getattr(self, i) != getattr(other, i):
                return False
        return True

    def __deepcopy__(self, _):
        o = _Option(
            self.name, self.typespec, self.default, self.help, self.choices
        )
        if self.has_changed():
            o.value = self.current()
        return o

class OptManager:
    """
        OptManager is the base class from which Options objects are derived.

        .changed is a blinker Signal that triggers whenever options are
        updated. If any handler in the chain raises an exceptions.OptionsError
        exception, all changes are rolled back, the exception is suppressed,
        and the .errored signal is notified.

        Optmanager always returns a deep copy of options to ensure that
        mutation doesn't change the option state inadvertently.
    """
    def __init__(self):
        self.__dict__["_options"] = {}
        self.__dict__["changed"] = blinker.Signal()
        self.__dict__["errored"] = blinker.Signal()
        self.__dict__["_processed"] = {}

    def add_option(
        self,
        name: str,
        typespec: type,
        default: typing.Any,
        help: str,
        choices: typing.Optional[typing.Sequence[str]] = None
    ) -> None:
        if name in self._options:
            raise ValueError("Option %s already exists" % name)
        self._options[name] = _Option(name, typespec, default, help, choices)

    @contextlib.contextmanager
    def rollback(self, updated, reraise=False):
        old = copy.deepcopy(self._options)
        try:
            yield
        except exceptions.OptionsError as e:
            # Notify error handlers
            self.errored.send(self, exc=e)
            # Rollback
            self.__dict__["_options"] = old
            self.changed.send(self, updated=updated)
            if reraise:
                raise e

    def subscribe(self, func, opts):
        """
            Subscribe a callable to the .changed signal, but only for a
            specified list of options. The callable should accept arguments
            (options, updated), and may raise an OptionsError.

            The event will automatically be unsubscribed if the callable goes out of scope.
        """
        for i in opts:
            if i not in self._options:
                raise exceptions.OptionsError("No such option: %s" % i)

        # We reuse blinker's safe reference functionality to cope with weakrefs
        # to bound methods.
        func = blinker._saferef.safe_ref(func)

        @functools.wraps(func)
        def _call(options, updated):
            if updated.intersection(set(opts)):
                f = func()
                if f:
                    f(options, updated)
                else:
                    self.changed.disconnect(_call)

        # Our wrapper function goes out of scope immediately, so we have to set
        # weakrefs to false. This means we need to keep our own weakref, and
        # clean up the hook when it's gone.
        self.changed.connect(_call, weak=False)

    def __eq__(self, other):
        return self._options == other._options

    def __copy__(self):
        o = OptManager()
        o.__dict__["_options"] = copy.deepcopy(self._options)
        return o

    def __getattr__(self, attr):
        if attr in self._options:
            return self._options[attr].current()
        else:
            raise AttributeError("No such option: %s" % attr)

    def __setattr__(self, attr, value):
        self.update(**{attr: value})

    def keys(self):
        return set(self._options.keys())

    def __contains__(self, k):
        return k in self._options

    def reset(self):
        """
            Restore defaults for all options.
        """
        for o in self._options.values():
            o.reset()
        self.changed.send(self, updated=set(self._options.keys()))

    def update_known(self, **kwargs):
        """
            Update and set all known options from kwargs. Returns a dictionary
            of unknown options.
        """
        known, unknown = {}, {}
        for k, v in kwargs.items():
            if k in self._options:
                known[k] = v
            else:
                unknown[k] = v
        updated = set(known.keys())
        if updated:
            with self.rollback(updated, reraise=True):
                for k, v in known.items():
                    self._options[k].set(v)
                self.changed.send(self, updated=updated)
        return unknown

    def update(self, **kwargs):
        u = self.update_known(**kwargs)
        if u:
            raise KeyError("Unknown options: %s" % ", ".join(u.keys()))

    def setter(self, attr):
        """
            Generate a setter for a given attribute. This returns a callable
            taking a single argument.
        """
        if attr not in self._options:
            raise KeyError("No such option: %s" % attr)

        def setter(x):
            setattr(self, attr, x)
        return setter

    def toggler(self, attr):
        """
            Generate a toggler for a boolean attribute. This returns a callable
            that takes no arguments.
        """
        if attr not in self._options:
            raise KeyError("No such option: %s" % attr)
        o = self._options[attr]
        if o.typespec != bool:
            raise ValueError("Toggler can only be used with boolean options")

        def toggle():
            setattr(self, attr, not getattr(self, attr))
        return toggle

    def default(self, option: str) -> typing.Any:
        return self._options[option].default

    def has_changed(self, option):
        """
            Has the option changed from the default?
        """
        return self._options[option].has_changed()

    def merge(self, opts):
        """
            Merge a dict of options into this object. Options that have None
            value are ignored. Lists and tuples are appended to the current
            option value.
        """
        toset = {}
        for k, v in opts.items():
            if v is not None:
                if isinstance(v, (list, tuple)):
                    toset[k] = getattr(self, k) + v
                else:
                    toset[k] = v
        self.update(**toset)

    def __repr__(self):
        options = pprint.pformat(self._options, indent=4).strip(" {}")
        if "\n" in options:
            options = "\n    " + options + "\n"
        return "{mod}.{cls}({{{options}}})".format(
            mod=type(self).__module__,
            cls=type(self).__name__,
            options=options
        )

    def set(self, *spec):
        vals = {}
        for i in spec:
            vals.update(self._setspec(i))
        self.update(**vals)

    def parse_setval(self, optname: str, optstr: typing.Optional[str]) -> typing.Any:
        """
            Convert a string to a value appropriate for the option type.
        """
        if optname not in self._options:
            raise exceptions.OptionsError("No such option %s" % optname)
        o = self._options[optname]

        if o.typespec in (str, typing.Optional[str]):
            return optstr
        elif o.typespec in (int, typing.Optional[int]):
            if optstr:
                try:
                    return int(optstr)
                except ValueError:
                    raise exceptions.OptionsError("Not an integer: %s" % optstr)
            elif o.typespec == int:
                raise exceptions.OptionsError("Option is required: %s" % optname)
            else:
                return None
        elif o.typespec == bool:
            if not optstr or optstr == "true":
                return True
            elif optstr == "false":
                return False
            else:
                raise exceptions.OptionsError(
                    "Boolean must be \"true\", \"false\", or have the value " "omitted (a synonym for \"true\")."
                )
        elif o.typespec == typing.Sequence[str]:
            if not optstr:
                return []
            else:
                return getattr(self, optname) + [optstr]
        raise NotImplementedError("Unsupported option type: %s", o.typespec)

    def _setspec(self, spec):
        d = {}
        parts = spec.split("=", maxsplit=1)
        if len(parts) == 1:
            optname, optval = parts[0], None
        else:
            optname, optval = parts[0], parts[1]
        d[optname] = self.parse_setval(optname, optval)
        return d

    def make_parser(self, parser, optname, metavar=None, short=None):
        o = self._options[optname]

        def mkf(l, s):
            l = l.replace("_", "-")
            f = ["--%s" % l]
            if s:
                f.append("-" + s)
            return f

        flags = mkf(optname, short)

        if o.typespec == bool:
            g = parser.add_mutually_exclusive_group(required=False)
            onf = mkf(optname, None)
            offf = mkf("no-" + optname, None)
            # The short option for a bool goes to whatever is NOT the default
            if short:
                if o.default:
                    offf = mkf("no-" + optname, short)
                else:
                    onf = mkf(optname, short)
            g.add_argument(
                *offf,
                action="store_false",
                dest=optname,
            )
            g.add_argument(
                *onf,
                action="store_true",
                dest=optname,
                help=o.help
            )
            parser.set_defaults(**{optname: None})
        elif o.typespec in (int, typing.Optional[int]):
            parser.add_argument(
                *flags,
                action="store",
                type=int,
                dest=optname,
                help=o.help,
                metavar=metavar,
            )
        elif o.typespec in (str, typing.Optional[str]):
            parser.add_argument(
                *flags,
                action="store",
                type=str,
                dest=optname,
                help=o.help,
                metavar=metavar,
                choices=o.choices
            )
        elif o.typespec == typing.Sequence[str]:
            parser.add_argument(
                *flags,
                action="append",
                type=str,
                dest=optname,
                help=o.help + " May be passed multiple times.",
                metavar=metavar,
                choices=o.choices,
            )
        else:
            raise ValueError("Unsupported option type: %s", o.typespec)

def dump_defaults(opts):
    """
        Dumps an annotated file with all options.
    """
    # Sort data
    s = ruamel.yaml.comments.CommentedMap()
    for k in sorted(opts.keys()):
        o = opts._options[k]
        s[k] = o.default
        txt = o.help.strip()

        if o.choices:
            txt += " Valid values are %s." % ", ".join(repr(c) for c in o.choices)
        else:
            if o.typespec in (str, int, bool):
                t = o.typespec.__name__
            elif o.typespec == typing.Optional[str]:
                t = "optional str"
            elif o.typespec == typing.Sequence[str]:
                t = "sequence of str"
            else:  # pragma: no cover
                raise NotImplementedError
            txt += " Type %s." % t

        txt = "\n".join(textwrap.wrap(txt))
        s.yaml_set_comment_before_after_key(k, before = "\n" + txt)
    return ruamel.yaml.round_trip_dump(s)

def parse(text):
    if not text:
        return {}
    try:
        data = ruamel.yaml.load(text, ruamel.yaml.RoundTripLoader)
    except ruamel.yaml.error.YAMLError as v:
        if hasattr(v, "problem_mark"):
            snip = v.problem_mark.get_snippet()
            raise exceptions.OptionsError(
                "Config error at line %s:\n%s\n%s" %
                (v.problem_mark.line + 1, snip, v.problem)
            )
        else:
            raise exceptions.OptionsError("Could not parse options.")
    if isinstance(data, str):
        raise exceptions.OptionsError("Config error - no keys found.")
    return data

def load(opts, text):
    """
        Load configuration from text, over-writing options already set in
        this object. May raise OptionsError if the config file is invalid.

        Returns a dictionary of all unknown options.
    """
    data = parse(text)
    return opts.update_known(**data)

def load_paths(opts, *paths):
    """
        Load paths in order. Each path takes precedence over the previous
        path. Paths that don't exist are ignored, errors raise an
        OptionsError.

        Returns a dictionary of unknown options.
    """
    ret = {}
    for p in paths:
        p = os.path.expanduser(p)
        if os.path.exists(p) and os.path.isfile(p):
            with open(p, "rt", encoding="utf8") as f:
                try:
                    txt = f.read()
                except UnicodeDecodeError as e:
                    raise exceptions.OptionsError(
                        "Error reading %s: %s" % (p, e)
                    )
            try:
                ret.update(load(opts, txt))
            except exceptions.OptionsError as e:
                raise exceptions.OptionsError(
                    "Error reading %s: %s" % (p, e)
                )
    return ret

def serialize(opts, text, defaults=False):
    """
        Performs a round-trip serialization. If text is not None, it is
        treated as a previous serialization that should be modified
        in-place.

        - If "defaults" is False, only options with non-default values are
            serialized. Default values in text are preserved.
        - Unknown options in text are removed.
        - Raises OptionsError if text is invalid.
    """
    data = parse(text)
    for k in opts.keys():
        if defaults or opts.has_changed(k):
            data[k] = getattr(opts, k)
    for k in list(data.keys()):
        if k not in opts._options:
            del data[k]
    return ruamel.yaml.round_trip_dump(data)

def save(opts, path, defaults=False):
    """
        Save to path. If the destination file exists, modify it in-place.

        Raises OptionsError if the existing data is corrupt.
    """
    if os.path.exists(path) and os.path.isfile(path):
        with open(path, "rt", encoding="utf8") as f:
            try:
                data = f.read()
            except UnicodeDecodeError as e:
                raise exceptions.OptionsError(
                    "Error trying to modify %s: %s" % (path, e)
                )
    else:
        data = ""
    data = serialize(opts, data, defaults)
    with open(path, "wt", encoding="utf8") as f:
        f.write(data)


text:
exports = module.exports = function Debug(command) {
  this.getCommand = function(outputmethod, callback) {
    var self = this;
    this._prepare(function(err, meta) {
      if (err) {
        callback(null, err);
      } else {
        var args = self.buildFfmpegArgs(true, meta);
        // kinda hacky, have to make sure the returned object is no array
        if (args.length === undefined) {
          callback(null, args);
        } else {
          var cmd = '';
          cmd += 'ffmpeg';
          args.forEach(function(el) {
            cmd += ' ' + el;
          });
          callback(cmd, null);
        }
      }
    });
    return this;
  };

  this.getArgs = function(callback) {
    if (callback) {
      var self = this;
      this._prepare(function(err, meta) {
        if (err) {
          callback(null, err);
        } else {
          var args = self.buildFfmpegArgs(true, meta);
          // kinda hacky, have to make sure the returned object is no array
          if (args.length === undefined) {
            callback(null, args);
          } else {
            callback(args, null);
          }
        }
      });
    } else {
      return this.buildFfmpegArgs(true, null);
    }
  };
};


text:
import os
try:
   import cPickle as pickle
except:
   import pickle
from unittest import TestCase

from django.conf import settings
from tarantool_utils.celery import TarantoolBackend

class TarantoolCeleryBackendTestCase(TestCase):
    def __init__(self, *args, **kwargs):
        super(TarantoolCeleryBackendTestCase, self).__init__(*args, **kwargs)
        backend_space = int(os.environ.get('CELERY_TARANTOOL_BACKEND_SPACE', '4'))
        self.backend_space = backend_space
        self.backend = TarantoolBackend(url=settings.CELERY_RESULT_BACKEND)

    def setUp(self):
        self.clean_tnt()

    def clean_tnt(self):
        lua_code = 'box.space[%s]:truncate()' % (self.backend_space,)
        self.backend._tnt.call('box.dostring', lua_code)

    def test_make_value(self):
        self.assertEqual(pickle.dumps('ololo'), self.backend.make_value('ololo'))

    def test_get(self):
        reference_value = 'test get value'
        pickled_value = pickle.dumps(reference_value)
        self.backend._tnt.insert(self.backend_space, ('test_get', pickled_value,
                           100500L))
        value = self.backend.get('test_get')
        self.assertEqual(reference_value, value)

        self.assertIsNone(self.backend.get('test_get_1'))

    def test_set(self):
        reference_value = 'test set value'
        self.backend._tnt.insert(self.backend_space, ('test_set', 'ololo value',
                           100500L))
        is_ok = self.backend.set('test_set', reference_value)
        self.assertEqual(reference_value, self.backend.get('test_set'))

    def test_delete(self):
        key = 'test_delete_1'
        self.backend.set(key, 'ololo')
        self.backend.delete(key)
        self.assertIsNone(self.backend.get(key))

        self.backend.delete('ololo delete key')

    def test_mget(self):
        self.backend.set('get many key1', 'val1')
        self.backend.set('get many key2', 'val2')
        data = self.backend.mget(['get many key1', 'get many key2'])
        self.assertEqual({'get many key1': 'val1', 'get many key2': 'val2'},
                         data)

    def test_expire(self):
        self.backend.set('expire key', 'value')
        response1 = self.backend._tnt.select(self.backend_space, 'expire key')
        timeout1 = int(response1[0][2])
        self.backend.expire('expire key', 5)
        response2 = self.backend._tnt.select(self.backend_space, 'expire key')
        timeout2 = int(response2[0][2])
        self.assertNotEqual(timeout1, timeout2)


text:
package es.agustruiz.deadpoolcomics.presentation.view;

import java.util.Collection;

import es.agustruiz.deadpoolcomics.presentation.model.ComicPresentation;

public interface ComicListView extends LoadDataView {

    void renderComicList(Collection<ComicPresentation> comicPresentationCollection);

    void viewComic(ComicPresentation comicPresentation);

}


text:
<?php

/**
 * Controller TreeOfSaviorAppController
 **/
class TreeOfSaviorAppController extends AppController {
}


text:
namespace ui {

class DriWindowDelegateManager;
class SurfaceOzoneCanvas;

// SurfaceFactoryOzone implementation on top of DRM/KMS using dumb buffers.
// This implementation is used in conjunction with the software rendering
// path.
class DriSurfaceFactory : public SurfaceFactoryOzone {
 public:
  DriSurfaceFactory(DriWindowDelegateManager* window_manager);
  ~DriSurfaceFactory() override;

  // SurfaceFactoryOzone:
  scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
      gfx::AcceleratedWidget widget) override;
  bool LoadEGLGLES2Bindings(
      AddGLLibraryCallback add_gl_library,
      SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;

 protected:
  DriWindowDelegateManager* window_manager_;  // Not owned.

  DISALLOW_COPY_AND_ASSIGN(DriSurfaceFactory);
};

}  // namespace ui

#endif  // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_


text:
/**
* A class to implement search using
* inverted index functionality
*/
class InvertedIndex {
  /**
  * Constructor for the inverted-index class
  */
  constructor() {
    this.fileIndexes = {};
  }

  /**
  * Searches for indexes of a query string in a file or group of files
  * @param {String} query - words to search for.
  * @param {Array} fileNames - Names of files we want to search in
  * @return {Object} - An Object containing each file and the
  * indexes of words in the query string
  */
  searchIndex(query, fileNames) {
    const fileIndexResult = {};
    const tokens = InvertedIndexUtility.tokenize(query);
    fileNames.forEach((fileName) => {
      const builtFileIndex = {};
      const fileIndex = this.fileIndexes[fileName];
      tokens.forEach((word) => {
        if (fileIndex[word]) {
          builtFileIndex[word] = fileIndex[word];
        } else {
          builtFileIndex[word] = [];
        }
      });
      fileIndexResult[fileName] = builtFileIndex;
    });
    return fileIndexResult;
  }

  /**
  * Creates Index for a specific file and add it to the files map
  * @param {String} fileName - Name of the book file
  * @param {Array} books - Array of books in the file
  * @return {String} A message describing the status of the operation
  */
  createIndex(fileName, books) {
    if (this.fileIndexes[fileName]) {
      return 'Index Already Exists';
    }

    const fileIndex = {};
    books.forEach((value, index) => {
      const words = InvertedIndexUtility.tokenize(this.getAllText(value));
      words.forEach((word) => {
        this.addWordToFileIndex(fileIndex, word, index);
      });
    });
    this.fileIndexes[fileName] = fileIndex;
    return 'Index Created';
  }

  /**
  * Get the index map of a specific file names from the files map
  * @param {Array} fileNames - Array of file names to search for
  * @return {Object} - An object containing the indexes for books in each file
  * or an empty object
  */
  getIndex(fileNames) {
    const foundIndexes = {};
    fileNames.forEach((fileName) => {
      if (this.fileIndexes[fileName]) {
        foundIndexes[fileName] = this.fileIndexes[fileName];
      }
    });
    return foundIndexes;
  }

  /**
  * Method to test if a book is valid
  * @param {Array} books - The array of books to verify
  * @return {Boolean} true if the books is valid and false otherwise
  */
  validateBook(books) {
    // check that is an array and not empty
    let bookValid = (Array.isArray(books) && books.length > 0);
    if (!bookValid) {
      return false;
    }
    books.forEach((book) => {
      // if anybook is invalid in the list of books
      // then the books file is invalid
      if (!book.title || !book.text) {
        bookValid = false;
      }
    });
    return bookValid;
  }

  /**
  * Method to get all text(text and title) in a specific book
  * @param {Object} book - book object from which
  * we want to extract all text (title and text)
  * @return {String} - a string containing all texts in the book
  */
  getAllText(book) {
    return `${book.title} ${book.text}`;
  }

  /**
  * Method to add a word and its documentIndex to an index
  * @param {Map} fileIndex - Map to hold words and their indexes
  * @param {String} word - Word to be added to the fileIndex
  * @param {Number} documentIndex - ID of document in which the word exists
  * @return {Boolean} True if the word was added to the index map
  * or false otherwise
  */
  addWordToFileIndex(fileIndex, word, documentIndex) {
    let returnValue = false;
    if (fileIndex[word] && fileIndex[word].indexOf(documentIndex) < 0) {
      fileIndex[word].push(documentIndex);
      returnValue = true;
    } else {
      const documentIndexes = [];
      documentIndexes.push(documentIndex);
      fileIndex[word] = documentIndexes;
      returnValue = true;
    }
    return returnValue;
  }
}


text:
DROP TABLE access_tokens;
DROP TABLE account_data;
DROP TABLE events;
DROP TABLE room_account_data;
DROP TABLE profiles;
DROP TABLE room_aliases;
DROP TABLE room_memberships;
DROP TABLE rooms;
DROP TABLE users;
DROP TABLE room_tags;


text:
package org.openhds.controller.service;

import java.sql.SQLException;
import java.util.Calendar;

import org.openhds.controller.exception.ConstraintViolations;
import org.openhds.domain.annotations.Authorized;
import org.openhds.domain.model.FieldWorker;
import org.openhds.domain.model.Individual;
import org.openhds.domain.model.Location;
import org.openhds.domain.model.Membership;
import org.openhds.domain.model.PrivilegeConstants;
import org.openhds.domain.model.Relationship;
import org.openhds.domain.model.SocialGroup;

public interface BaselineService {

	@Authorized({PrivilegeConstants.CREATE_ENTITY})
	public void createResidencyAndMembershipForIndividual(Individual individual, Membership membership, Location currentLocation, FieldWorker collectedBy, Calendar startDate) throws SQLException, ConstraintViolations, IllegalArgumentException, ConstraintViolations;

	@Authorized({PrivilegeConstants.CREATE_ENTITY})
	public void createSocialGroupAndResidencyForIndividual(Individual individual, SocialGroup socialGroup, Location currentLocation, FieldWorker collectedBy, Calendar startDate) throws SQLException, ConstraintViolations, IllegalArgumentException, ConstraintViolations;

	@Authorized({PrivilegeConstants.CREATE_ENTITY})
	public void createResidencyForIndividual(Individual individual, Location currentLocation, FieldWorker collectedBy, Calendar startDate) throws SQLException, ConstraintViolations, IllegalArgumentException, ConstraintViolations;

	@Authorized({PrivilegeConstants.CREATE_ENTITY})
	public void createResidencyMembershipAndRelationshipForIndividual(Individual individual, Membership membership, Relationship relationship, Location currentLocation, FieldWorker collectedBy, Calendar convertedEntryDate) throws SQLException, ConstraintViolations, IllegalArgumentException, ConstraintViolations;

	@Authorized({PrivilegeConstants.CREATE_ENTITY})
	public void createMembershipForIndividual(Individual individual, Membership membership, SocialGroup socialgroup, FieldWorker collectedBy, Calendar startDate) throws SQLException, ConstraintViolations, IllegalArgumentException, ConstraintViolations;

	@Authorized({PrivilegeConstants.CREATE_ENTITY})
	public void createIndividual(Individual individual) throws IllegalArgumentException, ConstraintViolations, SQLException;

	@Authorized({PrivilegeConstants.CREATE_ENTITY})
	public void createLocation(Location location) throws IllegalArgumentException, ConstraintViolations, SQLException;

	@Authorized({PrivilegeConstants.CREATE_ENTITY})
	public void createSocialGroup(SocialGroup group) throws IllegalArgumentException, ConstraintViolations, SQLException;
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ramularia helvetica Jaap & J. Lindau

### Remarks
null


text:
package piano;

import javax.sound.midi.MidiUnavailableException;

import midi.Midi;
import music.Pitch;

public class PianoMachine {

	private Midi midi;

	/**
	 * constructor for PianoMachine.
	 *
	 * initialize midi device and any other state that we're storing.
	 */
    public PianoMachine() {
    	try {
            midi = Midi.getInstance();
        } catch (MidiUnavailableException e1) {
            System.err.println("Could not initialize midi device");
            e1.printStackTrace();
            return;
        }
    }

    //TODO write method spec
    public void beginNote(Pitch rawPitch) {
    	midi.beginNote(new Pitch(0).toMidiFrequency());
    	//TODO implement for question 1

    }

    //TODO write method spec
    public void endNote(Pitch rawPitch) {
    	midi.endNote(new Pitch(0).toMidiFrequency());
    	//TODO implement for question 1
    }

    //TODO write method spec
    public void changeInstrument() {
       	//TODO: implement for question 2
    }

    //TODO write method spec
    public void shiftUp() {
    	//TODO: implement for question 3
    }

    //TODO write method spec
    public void shiftDown() {
    	//TODO: implement for question 3
    }

    //TODO write method spec
    public boolean toggleRecording() {
    	return false;
    	//TODO: implement for question 4
    }

    //TODO write method spec
    protected void playback() {
        //TODO: implement for question 4
    }

}


text:
title: "Maven - Change Local Repository Location"
permalink: /maven-change-location-local-repository.html
excerpt: "A short tutorial on how to change the location of the Maven local repository."
date: 2014-06-29
last_modified_at: 2014-06-29
header:
  teaser: "assets/images/teaser/maven-teaser.png"
categories: [Apache Maven]
tags: [Apache Maven, Change, Configuration, Local, Location, Maven, Repository, Setup]
redirect_from:
  - /2014/06/maven-change-location-of-local.html
  - /2014/06/maven-change-location-local-repository.html
published: true
---

A repository in [Maven](https://maven.apache.org/){:target="_blank"} is used to hold build artifacts and dependencies of varying types. There are strictly only two types of repositories: local and remote.

The **local repository** refers to a copy on your own machine that is a cache of the remote downloads and also contains the temporary build artifacts that have not yet been released.

When [installing Maven]({{ site.url }}/maven-download-install-apache-maven-3-2-windows.html), the local repository is located under a default location. The following tutorial shows how you can change the location of this local repository on Windows.

# Maven Local Repository

Maven is configured based on a <var>settings.xml</var> file that can be specified at two levels:

1. **User Level**: provides configuration for a single user and is typically provided in <var>${user.home}/.m2/settings.xml</var>.
2. **Global level**: provides configuration for all Maven users on a machine (assuming they're all using the same Maven installation) and it's typically provided in <var>${maven.home}/conf/settings.xml</var>.

In this example we will change the local repository location by creating/editing a <var>settings.xml</var> file at user level.

Navigate to <var>[maven_install_dir]/conf</var> and if not already present copy the <var>setting.xml</var> file to the <var>.m2</var> directory located in the user home directory (in this example the user is <var>'source4code'</var>) as shown below.

Open the copied <var>settings.xml</var> file and add/update the <var>'<localRepository>'</var> element to point to the new location of the local repository. In this example the location is set to <var>C:\source4code\local-repo</var>.

``` xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->
  <localRepository>C:\source4code\local-repo</localRepository>

  ...

</settings>
```

Next time Maven tries to resolve and download dependencies to the local repository, they will be stored in the newly defined location.

The below image shows the result after creating a quickstart Maven project. The artifacts are now downloaded to the <var>C:\source4code\local-repo</var> directory that was configured in the above <var>settings.xml</var>.

---

This concludes changing the location of the Maven local repository. If you found this post helpful or have any questions or remarks, please leave a comment below.


text:
<?php

/**
 * Admin shop system setting manager.
 * Collects shop system settings, updates it on user submit, etc.
 * Admin Menu: Main Menu -> Core Settings -> System.
 */
class Shop_System extends Shop_Config
{

    /**
     * Current class template name.
     *
     * @var string
     */
    protected $_sThisTemplate = 'shop_system.tpl';

    /**
     * Executes parent method parent::render(), passes shop configuration parameters
     * to Smarty and returns name of template file "shop_system.tpl".
     *
     * @return string
     */
    public function render()
    {
        $myConfig = $this->getConfig();
        parent::render();

        $aConfArrs = array();

        $oLang = oxRegistry::getLang();

        $aLanguages = $oLang->getLanguageArray();
        $sLangAbbr = $aLanguages[$oLang->getObjectTplLanguage()]->abbr;

        // loading shop location countries list (defines in which country shop exists)
        include "shop_countries.php";

        $soxId = $this->getEditObjectId();
        if (!$soxId) {
            $soxId = $myConfig->getShopId();
        }

        $oDb = oxDb::getDb();
        $sShopCountry = $oDb->getOne("select DECODE( oxvarvalue, " . $oDb->quote($myConfig->getConfigParam('sConfigKey')) . ") as oxvarvalue from oxconfig where oxshopid = '$soxId' and oxvarname = 'sShopCountry'", false, false);

        $this->_aViewData["shop_countries"] = $aLocationCountries[$sLangAbbr];
        $this->_aViewData["confstrs"]["sShopCountry"] = $sShopCountry;

        return $this->_sThisTemplate;
    }
}


text:
<query id="getSiteStartLogDate" action="select">
    <tables>
        <table name="counter_status" />
    </tables>
    <columns>
        <column name="min(regdate)" alias="regdate" />
    </columns>
    <conditions>
        <condition operation="equal" column="site_srl" var="site_srl" default="0" pipe="and" />
        <condition operation="excess" column="regdate" default="1" notnull="notnull" pipe="and" />
    </conditions>
</query>


text:
package org.kie.io;

import java.util.Properties;

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

public class ResourceTypeImpl {
    private static final String                    KIE_RESOURCE_CONF_CLASS = "kie.resource.conf.class";

    private static final Logger                    logger                  = LoggerFactory.getLogger( ResourceTypeImpl.class );

    public static Properties toProperties(ResourceConfiguration conf) {
        Properties prop = conf.toProperties();
        prop.setProperty( KIE_RESOURCE_CONF_CLASS, conf.getClass().getName() );
        return prop;
    }

    public static ResourceConfiguration fromProperties(Properties prop) {
        String className = prop.getProperty( KIE_RESOURCE_CONF_CLASS );
        try {
            // not sure how to get the proper classloader here, but the resource configurations
            // should be accessible from the current classloader
            ResourceConfiguration conf = (ResourceConfiguration) Class.forName( className ).newInstance();
            conf.fromProperties( prop );
            return conf;
        } catch ( Exception e ) {
            logger.error( "Error loading resource configuration from properties", e );
        }
        return null;
    }

}


text:
layout: post
date: 2020-03-24
title: "34esima hacknight: COVID-19"
img: turin.jpg
abstract: Online 07/04/2020 h. 18.30
---

	Proviamo ad esorcizzare la pandemia provando a contribuire a progetti che la riguardano.
        Tutti i dettagli della serata sono nel repository di onboarding.

L'evento è gratuito ma occorre registrarsi.

Vi aspettiamo martedì 7 aprile nella chat della serata.

Cos'è hacknight?

Lo scopo di hacknight è quello di sensibilizzare le comunità di sviluppatori allo sviluppo di software libero.

Ad una serata hacknight i partecipanti sono invitati a contribuire attivamente ad un progetto open source aiutati da contributori dello stesso.

Cosa devo portare?

Il tuo computer e voglia di fare.

Evento organizzato in collaborazione con:

        {% for partner in site.partners %}

{% if partner.img %}{% else %}{{ partner.name }}{% endif %}

        {% endfor %}


text:
package practice.net.chat.client;

public interface ReceiveEvent {

    void receive(String message);

}


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

namespace Versionr
{
    public class JSONHelper
    {
        public static List<string> ReadStringList(JsonReader jr)
        {
            List<string> results = new List<string>();
            while (jr.Read())
            {
                if (jr.TokenType == JsonToken.String)
                    results.Add(jr.Value.ToString());
                else if (jr.TokenType == JsonToken.EndArray)
                    return results;
                else
                    throw new Exception();
            }
            throw new Exception();
        }
        public static string[] ReadStringArray(JsonReader jr)
        {
            return ReadStringList(jr).ToArray();
        }
    }
    public class Extern
    {
        public string Location { get; set; }
        public string Host { get; set; }
        public string PartialPath { get; set; }
        public string Branch { get; set; }
        public string Target { get; set; }
        public Extern()
        {
        }
        public Extern(JsonReader reader)
        {
            string currentProperty = null;
            while (reader.Read())
            {
                switch (reader.TokenType)
                {
                    case JsonToken.PropertyName:
                        currentProperty = reader.Value.ToString();
                        break;
                    case JsonToken.String:
                        if (currentProperty == "Location")
                            Location = reader.Value.ToString();
                        else if (currentProperty == "Host")
                            Host = reader.Value.ToString();
                        else if (currentProperty == "PartialPath")
                            PartialPath = reader.Value.ToString();
                        else if (currentProperty == "Branch")
                            Branch = reader.Value.ToString();
                        else if (currentProperty == "Target")
                            Target = reader.Value.ToString();
                        else
                            throw new Exception();
                        break;
                    case JsonToken.EndObject:
                        return;
                    default:
                        throw new Exception();
                }
            }
            throw new Exception();
        }
    }
    public class Ignores
    {
        private string[] m_Patterns;
        private string[] m_DirectoryPatterns;
        private string[] m_Directories;
        private string[] m_FilePatterns;
        private string[] m_Extensions;
        public string[] Extensions
        {
            get
            {
                return m_Extensions;
            }
            set
            {
                m_Extensions = value?.Select(x => x.ToLowerInvariant()).ToArray();
            }
        }
        public string[] Patterns
        {
            get
            {
                return m_Patterns;
            }
            set
            {
                m_Patterns = value;
                if (m_Patterns == null)
                    return;
                m_PatternRegexes = null;
                m_RegexDirectoryPatterns = null;
                m_RegexFilePatterns = null;
            }
        }
        public string[] Directories
        {
            get
            {
                return m_Directories;
            }
            set
            {
                m_Directories = value;
            }
        }
        public string[] FilePatterns
        {
            get
            {
                return m_FilePatterns;
            }
            set
            {
                m_FilePatterns = value;
                if (m_FilePatterns == null)
                    return;

                m_RegexFilePatterns = null;
            }
        }
        public string[] DirectoryPatterns
        {
            get
            {
                return m_DirectoryPatterns;
            }
            set
            {
                m_DirectoryPatterns = value;
                if (m_DirectoryPatterns == null)
                    return;

                m_RegexFilePatterns = null;
            }
        }
        public Ignores()
        {
            m_Directories = new string[0];
        }

        public Ignores(JsonReader reader)
        {
            m_Directories = new string[0];
            string currentProperty = null;
            while (reader.Read())
            {
                switch (reader.TokenType)
                {
                    case JsonToken.PropertyName:
                        currentProperty = reader.Value.ToString();
                        break;
                    case JsonToken.StartArray:
                        if (currentProperty == "Patterns")
                            Patterns = JSONHelper.ReadStringArray(reader);
                        else if (currentProperty == "DirectoryPatterns")
                            DirectoryPatterns = JSONHelper.ReadStringArray(reader);
                        else if (currentProperty == "Directories")
                            Directories = JSONHelper.ReadStringArray(reader);
                        else if (currentProperty == "FilePatterns")
                            FilePatterns = JSONHelper.ReadStringArray(reader);
                        else if (currentProperty == "Extensions")
                            Extensions = JSONHelper.ReadStringArray(reader);
                        else
                            throw new Exception();
                        break;
                    case JsonToken.EndObject:
                        return;
                    default:
                        throw new Exception();
                }
            }
            throw new Exception();
        }

        System.Text.RegularExpressions.Regex[] m_PatternRegexes = null;
        System.Text.RegularExpressions.Regex[] m_RegexFilePatterns = null;
        System.Text.RegularExpressions.Regex[] m_RegexDirectoryPatterns = null;

        [Newtonsoft.Json.JsonIgnore]
        public System.Text.RegularExpressions.Regex[] RegexPatterns
        {
            get
            {
                if (m_PatternRegexes == null)
                {
                    if (m_Patterns != null)
                        m_PatternRegexes = m_Patterns.Select(x => new System.Text.RegularExpressions.Regex(x.ToLowerInvariant(), System.Text.RegularExpressions.RegexOptions.Compiled)).ToArray();
                    else
                        m_PatternRegexes = new System.Text.RegularExpressions.Regex[0];
                }
                return m_PatternRegexes;
            }
        }
        [Newtonsoft.Json.JsonIgnore]
        public System.Text.RegularExpressions.Regex[] RegexFilePatterns
        {
            get
            {
                if (m_RegexFilePatterns == null)
                {
                    if (m_FilePatterns != null)
                    {
                        var regexes = m_FilePatterns.Select(x => new System.Text.RegularExpressions.Regex(x.ToLowerInvariant(), System.Text.RegularExpressions.RegexOptions.Compiled));

                        m_RegexFilePatterns = regexes.Concat(RegexPatterns).ToArray();
                    }
                    else
                        m_RegexFilePatterns = RegexPatterns;
                }
                return m_RegexFilePatterns;
            }
        }
        [Newtonsoft.Json.JsonIgnore]
        public System.Text.RegularExpressions.Regex[] RegexDirectoryPatterns
        {
            get
            {
                if (m_RegexDirectoryPatterns == null)
                {
                    if (m_DirectoryPatterns != null)
                    {
                        var regexes = m_DirectoryPatterns.Select(x => new System.Text.RegularExpressions.Regex(x.ToLowerInvariant(), System.Text.RegularExpressions.RegexOptions.Compiled));

                        m_RegexDirectoryPatterns = regexes.Concat(RegexPatterns).ToArray();
                    }
                    else
                        m_RegexDirectoryPatterns = RegexPatterns;
                }
                return m_RegexDirectoryPatterns;
            }
        }

        private static T[] SafeMerge<T>(T[] a, T[] b)
        {
            if (a != null && b != null)
                return a.Concat(b).ToArray();
            else if (a != null)
                return a;
            else
                return b;
        }

        internal void Merge(Ignores ignore)
        {
            Extensions = SafeMerge(Extensions, ignore.Extensions);
            FilePatterns = SafeMerge(FilePatterns, ignore.FilePatterns);
            DirectoryPatterns = SafeMerge(DirectoryPatterns, ignore.DirectoryPatterns);
            Patterns = SafeMerge(Patterns, ignore.Patterns);
        }
    }

	public class SvnCompatibility
	{
		public string[] SymlinkPatterns
		{
			set
			{
                var patterns = value.Select(x => new System.Text.RegularExpressions.Regex(x, System.Text.RegularExpressions.RegexOptions.Compiled)).ToArray();
                if (Utilities.SvnIntegration.SymlinkPatterns != null)
                    Utilities.SvnIntegration.SymlinkPatterns = Utilities.SvnIntegration.SymlinkPatterns.Concat(patterns).ToArray();
                else
                    Utilities.SvnIntegration.SymlinkPatterns = patterns;
            }
        }
        public SvnCompatibility()
        {

        }
        public SvnCompatibility(JsonReader reader)
        {
            string currentProperty = null;
            while (reader.Read())
            {
                switch (reader.TokenType)
                {
                    case JsonToken.PropertyName:
                        currentProperty = reader.Value.ToString();
                        break;
                    case JsonToken.StartArray:
                        if (currentProperty == "SymlinkPatterns")
                            SymlinkPatterns = JSONHelper.ReadStringArray(reader);
                        else
                            throw new Exception();
                        break;
                    case JsonToken.EndObject:
                        return;
                    default:
                        throw new Exception();
                }
            }
            throw new Exception();
        }
    }

    public class TagPreset
    {
        public string Tag { get; set; }
        public string Description { get; set; }
        public TagPreset(JsonReader reader)
        {
            string currentProperty = null;
            while (reader.Read())
            {
                switch (reader.TokenType)
                {
                    case JsonToken.PropertyName:
                        currentProperty = reader.Value.ToString();
                        break;
                    case JsonToken.String:
                        if (currentProperty == "Tag")
                            Tag = reader.Value.ToString();
                        else if (currentProperty == "Description")
                            Description = reader.Value.ToString();
                        else
                            throw new Exception();
                        break;
                    case JsonToken.EndObject:
                        return;
                    default:
                        throw new Exception();
                }
            }
            throw new Exception();
        }
    }

    public class Directives
    {
        public Ignores Ignore { get; set; }
        public Ignores Include { get; set; }
        public string DefaultCompression { get; set; }
        public string ExternalDiff { get; set; }
        public bool? NonBlockingDiff { get; set; }
        public bool? UseTortoiseMerge { get; set; }
        public string ExternalMerge { get; set; }
        public string ExternalMerge2Way { get; set; }
        public SvnCompatibility Svn { get; set; }
        public Dictionary<string, Extern> Externals { get; set; }
        private string m_UserName;
        public Newtonsoft.Json.Linq.JArray Hooks { get; set; }
        public Dictionary<string, Newtonsoft.Json.Linq.JToken> Tokens { get; set; } = new Dictionary<string, Newtonsoft.Json.Linq.JToken>();
        public string UserName
        {
            get { return (String.IsNullOrEmpty(m_UserName)) ? Environment.UserName : m_UserName; }
            set { m_UserName = value; }
        }
        public List<TagPreset> TagPresets { get; set; }
        public List<string> Sparse { get; set; } = new List<string>();
        public List<string> Excludes { get; set; } = new List<string>();

        public string ObjectStorePath = null;
        public Directives()
        {
            Ignore = new Ignores();
            Externals = new Dictionary<string, Extern>();
            TagPresets = new List<TagPreset>();
        }
        public Directives(JsonReader reader)
        {
            Ignore = new Ignores();
            Externals = new Dictionary<string, Extern>();
            string currentProperty = null;
            while (reader.Read())
            {
                switch (reader.TokenType)
                {
                    case JsonToken.PropertyName:
                        currentProperty = reader.Value.ToString();
                        break;
                    case JsonToken.String:
                        switch (currentProperty)
                        {
                            case "DefaultCompression":
                                DefaultCompression = reader.Value.ToString();
                                break;
                            case "ExternalMerge":
                                ExternalMerge = reader.Value.ToString();
                                break;
                            case "ExternalMerge2Way":
                                ExternalMerge2Way = reader.Value.ToString();
                                break;
                            case "ExternalDiff":
                                ExternalDiff = reader.Value.ToString();
                                break;
                            case "UserName":
                                UserName = reader.Value.ToString();
                                break;
                            case "ObjectStorePath":
                                ObjectStorePath = reader.Value.ToString();
                                break;
                            default:
                                Tokens[currentProperty] = Newtonsoft.Json.Linq.JToken.FromObject(reader.Value);
                                break;
                        }
                        break;
                    case JsonToken.Boolean:
                        if (currentProperty == "NonBlockingDiff")
                            NonBlockingDiff = System.Boolean.Parse(reader.Value.ToString());
                        else if (currentProperty == "UseTortoiseMerge")
                            UseTortoiseMerge = System.Boolean.Parse(reader.Value.ToString());
                        else
                            Tokens[currentProperty] = Newtonsoft.Json.Linq.JToken.FromObject(reader.Value);
                        break;
                    case JsonToken.EndObject:
                        return;
                    case JsonToken.StartObject:
                        if (currentProperty == "Ignore")
                            Ignore = new Ignores(reader);
                        else if (currentProperty == "Include")
                            Include = new Ignores(reader);
                        else if (currentProperty == "Svn")
                            Svn = new SvnCompatibility(reader);
                        else if (currentProperty == "Externals")
                        {
                            Externals = new Dictionary<string, Extern>();
                            while (reader.Read())
                            {
                                if (reader.TokenType == JsonToken.PropertyName)
                                    currentProperty = reader.Value.ToString();
                                else if (reader.TokenType == JsonToken.StartObject)
                                    Externals[currentProperty] = new Extern(reader);
                                else if (reader.TokenType == JsonToken.EndObject)
                                    break;
                                else
                                    throw new Exception();
                            }
                        }
                        else
                            Tokens[currentProperty] = Newtonsoft.Json.Linq.JObject.Load(reader);
                        break;
                    case JsonToken.StartArray:
                        if (currentProperty == "TagPresets")
                        {
                            TagPresets = new List<TagPreset>();
                            while(reader.Read())
                            {
                                if (reader.TokenType == JsonToken.StartObject)
                                {
                                    TagPreset tag = new TagPreset(reader);
                                    if (!String.IsNullOrEmpty(tag.Tag) &&
                                        tag.Tag[0] == '#' &&
                                        !tag.Tag.Contains(' ') &&
                                        !tag.Tag.Contains('\t'))
                                        TagPresets.Add(tag);
                                }
                                else if (reader.TokenType == JsonToken.EndArray)
                                    break;
                                else
                                    throw new Exception();
                            }
                        }
                        else if (currentProperty == "Sparse")
                        {
                            Sparse = JSONHelper.ReadStringList(reader);
                        }
                        else if (currentProperty == "Excludes")
                        {
                            Excludes = JSONHelper.ReadStringList(reader);
                        }
                        else if (currentProperty == "Hooks")
                        {
                            Hooks = Newtonsoft.Json.Linq.JArray.Load(reader);
                        }
                        else
                            Tokens[currentProperty] = Newtonsoft.Json.Linq.JArray.Load(reader);
                        break;
                    default:
                        throw new Exception("Unhandled setup in configuration file");
                        break;
                }
            }
        }
        public void Merge(Directives other)
        {
            if (Ignore != null && other.Ignore != null)
                Ignore.Merge(other.Ignore);
            else if (other.Ignore != null)
                Ignore = other.Ignore;

            if (other.UseTortoiseMerge != null)
                UseTortoiseMerge = other.UseTortoiseMerge;

            if (Include != null && other.Include != null)
                Include.Merge(other.Include);
            else if (other.Include != null)
                Include = other.Include;

            if (other.DefaultCompression != null)
                DefaultCompression = other.DefaultCompression;
            if (other.ExternalDiff != null)
                ExternalDiff = other.ExternalDiff;
            if (other.ExternalMerge != null)
                ExternalMerge = other.ExternalMerge;
            if (other.ExternalMerge2Way != null)
                ExternalMerge2Way = other.ExternalMerge2Way;
            if (other.NonBlockingDiff != null)
                NonBlockingDiff = other.NonBlockingDiff;
            if (other.m_UserName != null)
                m_UserName = other.m_UserName;
            if (!string.IsNullOrEmpty(other.ObjectStorePath))
                ObjectStorePath = other.ObjectStorePath;

            if (other.Externals != null)
            {
                if (Externals == null)
                    Externals = new Dictionary<string, Extern>();
                foreach (var x in other.Externals)
                    Externals[x.Key] = x.Value;
            }

            foreach (var x in other.Tokens)
            {
                Newtonsoft.Json.Linq.JToken prior;
                if (Tokens.TryGetValue(x.Key, out prior))
                {
                    if (prior.Type == Newtonsoft.Json.Linq.JTokenType.Array && x.Value.Type == Newtonsoft.Json.Linq.JTokenType.Array)
                    {
                        Newtonsoft.Json.Linq.JArray array = prior as Newtonsoft.Json.Linq.JArray;
                        Newtonsoft.Json.Linq.JArray merge = x.Value as Newtonsoft.Json.Linq.JArray;
                        foreach (var y in merge)
                            array.Add(y);
                        continue;
                    }
                }
                Tokens[x.Key] = x.Value;
            }

            if (other.Hooks != null)
            {
                if (Hooks != null)
                {
                    foreach (var x in other.Hooks)
                        Hooks.Add(x);
                }
                else
                    Hooks = other.Hooks;
            }

            if (other.Sparse.Count > 0)
                Sparse = Sparse.Concat(other.Sparse).ToList();
            if (other.Excludes.Count > 0)
                Excludes = Excludes.Concat(other.Excludes).ToList();

            if (other.TagPresets != null)
            {
                if (TagPresets == null)
                    TagPresets = new List<TagPreset>();
                TagPresets.AddRange(other.TagPresets);
                TagPresets = TagPresets.Distinct().ToList();
            }
        }
    }
}


text:
NS_ASSUME_NONNULL_BEGIN

@protocol SDLTimerTargetDelegate <NSObject>

- (void)timerElapsed;

@end

@interface SDLTimerTarget : NSObject

@property (nonatomic, weak) id<SDLTimerTargetDelegate> delegate;

@end

@implementation SDLTimerTarget

- (instancetype)initWithDelegate:(id)delegate {
    self = [super init];
    if (self) {
        _delegate = delegate;
    }
    return self;
}

- (void)timerElapsed {
    if ([self.delegate conformsToProtocol:@protocol(SDLTimerTargetDelegate)]) {
        [_delegate timerElapsed];
    }
}

@end

@interface SDLTimer () <SDLTimerTargetDelegate>

@property (strong, nonatomic, nullable) NSTimer *timer;

@end

@implementation SDLTimer

- (instancetype)initWithDuration:(NSTimeInterval)duration {
    return [self initWithDuration:duration repeat:NO];
}

- (instancetype)initWithDuration:(NSTimeInterval)duration repeat:(BOOL)repeat {
    self = [super init];
    if (!self) { return nil; }

    NSAssert(duration > 0, @"Cannot create a timer with a 0 duration");

    _duration = duration;
    _repeat = repeat;
    _timerRunning = NO;

    return self;
}

- (void)dealloc {
    [self cancel];
}

- (void)start {
    [self startOnRunLoop:[NSRunLoop mainRunLoop]];
}

- (void)startOnRunLoop:(NSRunLoop *)runLoop {
    if (self.duration > 0) {
        [self stopAndDestroyTimer];

        SDLTimerTarget *timerTarget = [[SDLTimerTarget alloc] initWithDelegate:self];
        self.timer = [NSTimer timerWithTimeInterval:self.duration target:timerTarget selector:@selector(timerElapsed) userInfo:nil repeats:_repeat];
        [runLoop addTimer:self.timer forMode:NSRunLoopCommonModes];
        self.timerRunning = YES;
    }
}

- (void)cancel {
    [self stopAndDestroyTimer];
    if (self.timerRunning && self.canceledBlock != nil) {
        self.timerRunning = NO;
        self.canceledBlock();
    }
    self.timerRunning = NO;
}

- (void)timerElapsed {
    if (self.repeat == NO) {
        [self stopAndDestroyTimer];
        self.timerRunning = NO;
    }
    if (self.elapsedBlock != nil) {
        self.elapsedBlock();
    }
}

- (void)stopAndDestroyTimer {
    if (self.timer != nil) {
        [self.timer invalidate];
        self.timer = nil;
    }
}

@end

NS_ASSUME_NONNULL_END


text:
/* jshint unused: false */
'use strict';

var _ = require('underscore');
var assert = require('./assert');
var test = require('./test').suite('pattern');

/**
 * @constructor
 * @param {string}
 * @param {(function (?): boolean)=}
 */
var Variable = function Variable (name, constraint) {
    this.name = name;
    this.constraint = (constraint !== undefined) ? constraint : null;
};

Variable.prototype.toString = function () {
    return 'Variable(' + this.name + ')';
};

var variable = function (name, constraint) {
    return new Variable(name, constraint);
};

var isVariable = function (thing) {
    return !!(thing && thing.constructor === Variable);
};

test('isVariable', function () {
    var examples = [
        [variable('a'), true],
        ['asdf', false],
        [{}, false],
        [[], false],
        [undefined, false]
    ];
    examples.forEach(function (pair) {
        var thing = pair[0];
        assert(isVariable(thing) === pair[1], 'isVariable failed on ' + thing);
    });
});

var isPattern = (function () {
    var isPattern = function (patt, avoid) {
        if (isVariable(patt)) {
            if (_.has(avoid, patt.name)) {
                return false;
            } else {
                avoid[patt.name] = null;
                return true;
            }
        } else if (_.isString(patt)) {
            return true;
        } else if (_.isArray(patt)) {
            for (var i = 0; i < patt.length; ++i) {
                if (!isPattern(patt[i], avoid)) {
                    return false;
                }
            }
            return true;
        } else {
            return false;
        }
    };
    return function (patt) {
        return isPattern(patt, {});
    };
})();

test('isPattern', function () {
    var examples = [
        [variable('a'), true],
        ['asdf', true],
        [{}, false],
        [[['asdf', variable('x')], variable('y')], true],
        [[variable('x'), variable('x')], false],
        [undefined, false]
    ];
    assert.forward(isPattern, examples);
});

var unify = function (patt, struct, matched, allowBacktracking) {
    if (isVariable(patt)) {
        if (patt.constraint === null || patt.constraint(struct)) {
            if (allowBacktracking) {
                matched = _.extend({}, matched);
            }
            matched[patt.name] = struct;
            return matched;
        }
    } else if (_.isArray(patt) && _.isArray(struct)) {
        if (patt.length === struct.length) {
            for (var i = 0; i < struct.length; ++i) {
                matched = unify(patt[i], struct[i], matched);
                if (matched === undefined) {
                    return;
                }
            }
            return matched;
        }
    } else if (patt === struct) {
        return matched;
    }
};

var match = function () {
    // check statically
    assert(arguments.length % 2 === 0, 'bad pattern,handler list');
    var lineCount = arguments.length / 2;
    var patts = [];
    var handlers = [];
    for (var line = 0; line < lineCount; ++line) {
        var patt = arguments[2 * line];
        var handler = arguments[2 * line + 1];
        assert(
            isPattern(patt),
            'bad pattern at line ' + line + ':\n  ' + patt);
        assert(_.isFunction(handler), 'bad handler at line ' + line);
        patts.push(patt);
        handlers.push(handler);
    }
    // run optimized
    var slice = Array.prototype.slice;
    return function (struct) {
        for (var line = 0; line < lineCount; ++line) {
            var matched = unify(patts[line], struct, {});
            if (matched !== undefined) {
                var args = slice.call(arguments);
                args[0] = matched;
                var result = handlers[line].apply(null, args);
                if (result !== undefined) {
                    return result;
                }
            }
        }
        throw new Error('Unmatched Expression:\n  ' + JSON.stringify(struct));
    };
};

test('match', function () {
    var x = variable('x');
    var y = variable('y');
    var z = variable('z');
    var string = variable('string', _.isString);
    var array = variable('array', _.isArray);

    var t = match(
        ['APP', 'I', x], function (match) {
            var tx = t(match.x);
            return tx;
        },
        ['APP', ['APP', 'K', x], y], function (match) {
            var tx = t(match.x);
            return tx;
        },
        ['APP', ['APP', ['APP', 'B', x], y], z], function (match) {
            var xyz = ['APP', match.x, ['APP', match.y, match.z]];
            return t(xyz);
        },
        ['APP', x, y], function (match) {
            var tx = t(match.x);
            var ty = t(match.y);
            return ['APP', tx, ty];
        },
        ['typed:', string], function (match) {
            return 'string';
        },
        ['typed:', array], function (match) {
            return 'array';
        },
        x, function (match) {
            return match.x;
        }
    );

    var examples = [
        [['APP', 'I', 'a'], 'a'],
        [['APP', ['APP', 'K', 'a'], 'b'], 'a'],
        [['typed:', 'test'], 'string'],
        [['typed:', []], 'array']
    ];
    assert.forward(t, examples);
});

module.exports = {
    variable: variable,
    unify: function (patt, struct) {
        assert(isPattern(patt), 'bad pattern: ' + patt);
        return unify(patt, struct, {});
    },
    match: match
};


text:
// [!output WTL_VIEW_FILE].cpp : implementation of the [!output WTL_VIEW_CLASS] class
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resource.h"

#include "[!output WTL_VIEW_FILE].h"

BOOL [!output WTL_VIEW_CLASS]::PreTranslateMessage(MSG* pMsg)
{
[!if WTL_HOST_AX]
	if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
	   (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
		return FALSE;

	HWND hWndCtl = ::GetFocus();
	if(IsChild(hWndCtl))
	{
		// find a direct child of the dialog from the window that has focus
		while(::GetParent(hWndCtl) != m_hWnd)
			hWndCtl = ::GetParent(hWndCtl);

		// give control a chance to translate this message
		if(::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg) != 0)
			return TRUE;
	}

[!endif]
[!if WTL_VIEWTYPE_HTML]
	if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
	   (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
		return FALSE;

	// give HTML page a chance to translate this message
	return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);
[!else]
[!if WTL_VIEWTYPE_FORM]
	return CWindow::IsDialogMessage(pMsg);
[!else]
	pMsg;
	return FALSE;
[!endif]
[!endif]
}
[!if WTL_VIEWTYPE_GENERIC]

LRESULT [!output WTL_VIEW_CLASS]::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CPaintDC dc(m_hWnd);

	//TODO: Add your drawing code here

	return 0;
}
[!endif]


text:
boorufs
=======

Easy/shitty fs based on FUSE to browse danbooru from your favourite filemanager/image viewer.

## Usage:

`python boorufs.py MOUNTPOINT`

- `MOUNTPOINT` is any directory where you can write

Once it's mounted, open `MOUNTPOINT/any_tags` to browse a tag.

`fusermount -u -z MOUNTPOINT` to close/delete the mountpoint

## Config:
Configuring boorufs is simple, you just need to edit booru.cfg.

`[danbooru]` Name of the booru

`type = danbooru` type of the booru. danbooru and moebooru are supported so far

`url = http://danbooru.donmai.us` Url of the booru, with "http://" and without the ending "/"

`limit = 10` How many files to requests. Note that most booru are limited to 100

## Require:
- [Requests](http://docs.python-requests.org/en/latest/)
- [fuse-python](https://pypi.python.org/pypi/fuse-python)

## Shortcomings:
- Cache images on /tmp/boorufs/
- No way to navigate, needs to open directly the tag
- Buggy

![boorufs](https://raw.github.com/Spittie/boorufs/master/boorufs.gif)


text:
package com.example.lyw.expressdelivery.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.example.lyw.expressdelivery.R;
import com.example.lyw.expressdelivery.entity.PersonNearly;
import com.example.lyw.expressdelivery.entity.TypeTwoHolder;

import java.util.List;

/**
 * Created by LYW on 2017/3/16.
 */

public class DeliveryAdapter extends BaseAdapter {

    private LayoutInflater mInflater;
    private List<PersonNearly> mPepoles;
    private Context mContext;

    public DeliveryAdapter(List<PersonNearly> mPepoles, Context mContext) {
        this.mPepoles = mPepoles;
        this.mContext = mContext;
        mInflater = LayoutInflater.from(mContext);

    }

    @Override
    public int getCount() {
        return mPepoles.size();
    }

    @Override
    public Object getItem(int i) {
        return mPepoles.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
        TypeTwoHolder holder = null;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.item_fujinren_layout,
                    viewGroup, false);

        }
        holder = new TypeTwoHolder(convertView,mPepoles.get(position));
        return convertView;
    }
}