text:
import { useQuery } from 'react-query'
import { useParams } from 'react-router-dom'

// FPCC
import { useSiteStore } from 'context/SiteContext'
import api from 'services/api'

function WidgetWordOfTheDayData() {
  const { site } = useSiteStore()
  const { uid } = site
  const { sitename } = useParams()

  const { data, error, isError } = useQuery(['wotd', uid], () => api.widget.getWordOfTheDay({ siteId: uid }), {
    // The query will not execute until the uid exists
    enabled: !!uid,
    refetchOnWindowFocus: false,
    refetchOnReconnect: false,
  })

  let partOfSpeech = ''
  let audio = []

  if (data?.partOfSpeech) {
    partOfSpeech = `Part of Speech: ${data?.partOfSpeech}`
  }

  if (data?.relatedAudio?.length > 0) {
    data?.relatedAudio?.forEach((element) => {
      audio.push(element.id)
    })
  }

  return {
    audio: audio,
    hasShare: true,
    heading: data?.title,
    isError: isError && error && error?.response?.status === 404,
    subheading: data?.translations ? data?.translations.join('; ') : '',
    metadata: [partOfSpeech],
    title: 'WORD OF THE DAY',
    url: `${window.location.origin.toString()}/${sitename}/words/${data?.id}`,
    relativeUrl: `/${sitename}/words/${data?.id}`,
  }
}

export default WidgetWordOfTheDayData


text:
EditorAbstractWindowFactory* EditorWindowFactory::s_factoryInst = nullptr;

// ¸ù¾Ý¿½±´µÄ¿Ø¼þÊý¾Ý£¬¹¹Ôì¿Ø¼þ
EditorAbstractWindow * EditorWindowFactory::createCopyObjectWnd(CopyWindowInfo winObject,
	EditorAbstractWindow* parent, int relX, int relY, int width, int height)
{
	EditorAbstractWindow* editorWnd = WindowFactoryImpl::createEditorWnd(winObject.getWinName(),
		parent, relX, relY, width, height);

	// ÉèÖÃΪ¿½±´¶ÔÏóµÄÊôÐÔÖµ
	auto& winAttrs = winObject.getWinAttrValues();
	// ÐÞ¸ÄÊôÐÔÖµÁбí
	// Ð޸ĶÔÏóÃû
	auto iter = winAttrs.find(OBJECT_NAME);
	if (iter != winAttrs.end() && !(iter->second).As<wxString>().empty())
	{
		wxString curName = iter->second.As<wxString>();
		changeWindowName(curName);
		iter->second = curName;
	}
	else
	{
		// ¸øĬÈϵÄÃû³Æ
		 long winTypeNum = ++m_winTypeToNums[editorWnd->getWindowClassName()];
		 wxString objectName = editorWnd->getWindowClassName() + (wxString() << winTypeNum);
		 winAttrs[OBJECT_NAME] = objectName;
	}
	// Ð޸ķ¶Î§ÐÅÏ¢
	winAttrs[WIN_POSX] = editorWnd->getRelX();
	winAttrs[WIN_POSY] = editorWnd->getRelY();
	winAttrs[WIN_SIZEX] = editorWnd->getWidth();
	winAttrs[WIN_SIZEY] = editorWnd->getHeight();

	for (const auto& value : winAttrs)
	{
		editorWnd->updateWinAttr(value.first, value.second);
	}

	return editorWnd;
}

// ´´½¨Ò»¸ö¹ÜÀí¿Ø¼þ
EditorAbstractWindow * EditorWindowFactory::createManageWnd(int width, int height)
{
	auto editorMgr = new EditorManageWindow(0, 0, width, height);
	editorMgr->updateWinAttr(OBJECT_NAME, wxString("WorkArea"));
	return editorMgr;
}

// ¸ù¾Ý¿½±´¿Ø¼þÃû£¬¸øпؼþÈ¡Ò»¸öÃû×Ö
void EditorWindowFactory::changeWindowName(wxString & winName)
{
	wxString suffix;
	wxRegEx matchSuffix = "_[[:digit:]]*$";
	if (matchSuffix.Matches(winName))
	{
		suffix = matchSuffix.GetMatch(winName);
		if (suffix == "_")
		{
			winName += "1";
		}
		else
		{
			wxString numStr = suffix.Right(suffix.size() - 1);
			long num = 0;
			numStr.ToLong(&num);
			wxString newNum;
			newNum << (num + 1);
			winName.replace(winName.size() - suffix.size() + 1, suffix.size() - 1, newNum);
		}
	}
	else
	{
		winName += "_1";
	}
}

// ¸ù¾Ý¿Ø¼þÃû»ñÈ¡¶ÔÓ¦µÄ¿Ø¼þ¶ÔÏó
EditorAbstractWindow * WindowFactoryImpl::createEditorWnd(const wxString & winName,
	EditorAbstractWindow* parent, int relX, int relY, int width, int height)
{
	if (winName == EDITOR_LABEL_TYPE)
	{
		if (width <= 0 || height <= 0)
		{
			width = EDITOR_LABEL_WIDTH;
			height = EDITOR_LABEL_HEIGHT;
		}
		return new EditorLabel(parent, relX, relY, width, height);
	}
	else if (winName == EDITOR_BUTTON_TYPE)
	{
		if (width <= 0 || height <= 0)
		{
			width = EDITOR_BUTTON_WIDTH;
			height = EDITOR_BUTTON_HEIGHT;
		}
		return new EditorButton(parent, relX, relY, width, height);
	}
	else if (winName == EDITOR_FRAME_TYPE)
	{
		if (width <= 0 || height <= 0)
		{
			width = EDITOR_FRAME_WIDTH;
			height = EDITOR_FRAME_HEIGHT;
		}
		return new EditorFrame(parent, relX, relY, width, height);
	}

	if (width < 0 || height < 0)
	{
		width = EDITOR_WINDOW_WIDTH;
		height = EDITOR_WINDOW_HEIGHT;
	}

	throw ExtraExcept::unexpected_situation("WindowFactoryImpl::createEditorWnd will return nullptr");

	return nullptr;
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace MwbExporter\Formatter;

use MwbExporter\Model\Column;

interface DatatypeConverterInterface
{
    const DATATYPE_TINYINT             = 'com.mysql.rdbms.mysql.datatype.tinyint';
    const DATATYPE_SMALLINT            = 'com.mysql.rdbms.mysql.datatype.smallint';
    const DATATYPE_MEDIUMINT           = 'com.mysql.rdbms.mysql.datatype.mediumint';
    const DATATYPE_INT                 = 'com.mysql.rdbms.mysql.datatype.int';
    const DATATYPE_BIGINT              = 'com.mysql.rdbms.mysql.datatype.bigint';
    const DATATYPE_FLOAT               = 'com.mysql.rdbms.mysql.datatype.float';
    const DATATYPE_DOUBLE              = 'com.mysql.rdbms.mysql.datatype.double';
    const DATATYPE_DECIMAL             = 'com.mysql.rdbms.mysql.datatype.decimal';
    const DATATYPE_CHAR                = 'com.mysql.rdbms.mysql.datatype.char';
    const DATATYPE_VARCHAR             = 'com.mysql.rdbms.mysql.datatype.varchar';
    const DATATYPE_BINARY              = 'com.mysql.rdbms.mysql.datatype.binary';
    const DATATYPE_VARBINARY           = 'com.mysql.rdbms.mysql.datatype.varbinary';
    const DATATYPE_TINYTEXT            = 'com.mysql.rdbms.mysql.datatype.tinytext';
    const DATATYPE_TEXT                = 'com.mysql.rdbms.mysql.datatype.text';
    const DATATYPE_MEDIUMTEXT          = 'com.mysql.rdbms.mysql.datatype.mediumtext';
    const DATATYPE_LONGTEXT            = 'com.mysql.rdbms.mysql.datatype.longtext';
    const DATATYPE_TINYBLOB            = 'com.mysql.rdbms.mysql.datatype.tinyblob';
    const DATATYPE_BLOB                = 'com.mysql.rdbms.mysql.datatype.blob';
    const DATATYPE_MEDIUMBLOB          = 'com.mysql.rdbms.mysql.datatype.mediumblob';
    const DATATYPE_LONGBLOB            = 'com.mysql.rdbms.mysql.datatype.longblob';
    const DATATYPE_DATETIME            = 'com.mysql.rdbms.mysql.datatype.datetime';
    const DATATYPE_DATETIME_F          = 'com.mysql.rdbms.mysql.datatype.datetime_f';
    const DATATYPE_DATE                = 'com.mysql.rdbms.mysql.datatype.date';
    const DATATYPE_TIME                = 'com.mysql.rdbms.mysql.datatype.time';
    const DATATYPE_YEAR                = 'com.mysql.rdbms.mysql.datatype.year';
    const DATATYPE_TIMESTAMP           = 'com.mysql.rdbms.mysql.datatype.timestamp';
    const DATATYPE_TIMESTAMP_F         = 'com.mysql.rdbms.mysql.datatype.timestamp_f';
    const DATATYPE_GEOMETRY            = 'com.mysql.rdbms.mysql.datatype.geometry';
    const DATATYPE_LINESTRING          = 'com.mysql.rdbms.mysql.datatype.linestring';
    const DATATYPE_POLYGON             = 'com.mysql.rdbms.mysql.datatype.polygon';
    const DATATYPE_MULTIPOINT          = 'com.mysql.rdbms.mysql.datatype.multipoint';
    const DATATYPE_MULTILINESTRING     = 'com.mysql.rdbms.mysql.datatype.multilinestring';
    const DATATYPE_MULTIPOLYGON        = 'com.mysql.rdbms.mysql.datatype.multipolygon';
    const DATATYPE_GEOMETRYCOLLECTION  = 'com.mysql.rdbms.mysql.datatype.geometrycollection';
    const DATATYPE_BIT                 = 'com.mysql.rdbms.mysql.datatype.bit';
    const DATATYPE_ENUM                = 'com.mysql.rdbms.mysql.datatype.enum';
    const DATATYPE_SET                 = 'com.mysql.rdbms.mysql.datatype.set';
    const USERDATATYPE_BOOLEAN         = 'com.mysql.rdbms.mysql.userdatatype.boolean';
    const USERDATATYPE_BOOL            = 'com.mysql.rdbms.mysql.userdatatype.bool';
    const USERDATATYPE_FIXED           = 'com.mysql.rdbms.mysql.userdatatype.fixed';
    const USERDATATYPE_FLOAT4          = 'com.mysql.rdbms.mysql.userdatatype.float4';
    const USERDATATYPE_FLOAT8          = 'com.mysql.rdbms.mysql.userdatatype.float8';
    const USERDATATYPE_INT1            = 'com.mysql.rdbms.mysql.userdatatype.int1';
    const USERDATATYPE_INT2            = 'com.mysql.rdbms.mysql.userdatatype.int2';
    const USERDATATYPE_INT3            = 'com.mysql.rdbms.mysql.userdatatype.int3';
    const USERDATATYPE_INT4            = 'com.mysql.rdbms.mysql.userdatatype.int4';
    const USERDATATYPE_INT8            = 'com.mysql.rdbms.mysql.userdatatype.int8';
    const USERDATATYPE_INTEGER         = 'com.mysql.rdbms.mysql.userdatatype.integer';
    const USERDATATYPE_LONGVARBINARY   = 'com.mysql.rdbms.mysql.userdatatype.longvarbinary';
    const USERDATATYPE_LONGVARCHAR     = 'com.mysql.rdbms.mysql.userdatatype.longvarchar';
    const USERDATATYPE_LONG            = 'com.mysql.rdbms.mysql.userdatatype.long';
    const USERDATATYPE_MIDDLEINT       = 'com.mysql.rdbms.mysql.userdatatype.middleint';
    const USERDATATYPE_NUMERIC         = 'com.mysql.rdbms.mysql.userdatatype.numeric';
    const USERDATATYPE_DEC             = 'com.mysql.rdbms.mysql.userdatatype.dec';
    const USERDATATYPE_CHARACTER       = 'com.mysql.rdbms.mysql.userdatatype.character';

    public function setup();
    public function getDataType($key);
    public function getNativeType($type);
    public function getMappedType(Column $column);
    public function getType(Column $column);
}


text:
""" Node the calls to the 'open' built-in.

This is a rather two sided beast, as it may be read or write. And we would like to be able
to track it, so we can include files into the executable, or write more efficiently.
"""

from nuitka.PythonVersions import python_version

from .ExpressionBases import ExpressionChildrenHavingBase
from .shapes.BuiltinTypeShapes import tshape_file

class ExpressionBuiltinOpenMixin(object):
    # Mixins are required to slots
    __slots__ = ()

    @staticmethod
    def getTypeShape():
        return tshape_file

    def computeExpression(self, trace_collection):
        trace_collection.onExceptionRaiseExit(BaseException)

        # Note: Quite impossible to predict without further assumptions, but we could look
        # at the arguments at least.
        return self, None, None

if python_version < 0x300:

    class ExpressionBuiltinOpen(
        ExpressionBuiltinOpenMixin, ExpressionChildrenHavingBase
    ):
        kind = "EXPRESSION_BUILTIN_OPEN"

        named_children = ("filename", "mode", "buffering")

        def __init__(self, filename, mode, buffering, source_ref):
            ExpressionChildrenHavingBase.__init__(
                self,
                values={"filename": filename, "mode": mode, "buffering": buffering},
                source_ref=source_ref,
            )

else:

    class ExpressionBuiltinOpen(
        ExpressionBuiltinOpenMixin, ExpressionChildrenHavingBase
    ):
        kind = "EXPRESSION_BUILTIN_OPEN"

        named_children = (
            "filename",
            "mode",
            "buffering",
            "encoding",
            "errors",
            "newline",
            "closefd",
            "opener",
        )

        def __init__(
            self,
            filename,
            mode,
            buffering,
            encoding,
            errors,
            newline,
            closefd,
            opener,
            source_ref,
        ):
            ExpressionChildrenHavingBase.__init__(
                self,
                values={
                    "filename": filename,
                    "mode": mode,
                    "buffering": buffering,
                    "encoding": encoding,
                    "errors": errors,
                    "newline": newline,
                    "closefd": closefd,
                    "opener": opener,
                },
                source_ref=source_ref,
            )


text:
Welcome back

	<form>
		Email<input type="text" ng-model="auth.email">

		Pasword<input type="text" ng-model="auth.password">

		<button ng-click="submitLogin()">Login</button>
	</form>
	Don't have an account? Register here!

	Opps, I forgot my password.

	{{debug}}


text:
"""Neighbor table management"""

import itertools
import logging
from scapy.all import get_if_hwaddr, in6_getifaddr, IPV6_ADDR_LINKLOCAL

from . import ipcmd

logger = logging.getLogger(__name__)

class NeighTableIface(dict):
    """Store information about an interface entry of the neighbour table
    """

    def __init__(self, iface):
        """Retrieve current neighbors of interface iface in this object"""
        super(NeighTableIface, self).__init__()
        self.iface = iface
        # Hardware address
        self.ifhwaddr = None
        # Link-local IPv6 address
        self.llip6addr = None
        # Neighbor proxies
        self.proxies = None
        # Routes to hosts
        self.host_routes = None
        self.reload()

    def reload(self):
        """Reload tables from current state"""
        self.ifhwaddr = get_if_hwaddr(self.iface)
        lladdresses = [
            addr for addr, scope, iface in in6_getifaddr()
            if scope == IPV6_ADDR_LINKLOCAL and iface == self.iface]
        if len(lladdresses) != 1:
            raise Exception("Unable to find link-local address of {0}"
                            .format(self.iface))
        self.llip6addr = lladdresses[0]
        self.clear()
        for _, ip, hw in ipcmd.list_neigh(iface=self.iface):
            self[ip] = hw
        self.proxies = set()
        for _, ip in ipcmd.list_neigh_proxy(iface=self.iface):
            self.proxies.add(ip)
        self.host_routes = set()
        for _, ip in ipcmd.list_host_routes(iface=self.iface):
            self.host_routes.add(ip)

    def dump(self):
        """Dump content for debugging purpose"""
        for ip, hw in self.items():
            yield '{0} @ {1}_{2}'.format(ip, self.iface, hw)
        for ip in self.proxies:
            yield '{0} @ {1}_PROXY'.format(ip, self.iface)
        for ip in self.host_routes:
            yield 'Route:{0} @ {1}'.format(ip, self.iface)

    def update(self, ip, hw):
        """Update a neighbor entry

        Return True if something changed
        """
        # Never list the self interface in neighbors, but the code may try do
        # add it because ifhwaddr is stored in this class and that makes
        # this test easy here.
        if hw == self.ifhwaddr:
            return False
        old_hw = self.get(ip)
        if old_hw is None:
            logger.info("New neighbor appeared: {0} @ {1}_{2}"
                        .format(ip, self.iface, hw))
        elif old_hw != hw:
            logger.info("HW address changed for {0} @ {1}: {2} -> {3}"
                        .format(ip, self.iface, old_hw, hw))
        else:
            return False

        # Here, we are sure ip-hw association needs to be updated
        self[ip] = hw
        if ip in self.proxies:
            self.del_neigh_proxy(ip)
        if ip not in self.host_routes:
            self.add_host_route(ip)
        return True

    def remove_neigh(self, ip):
        """Remove a neighbor.

        This flushes the kernel cache because that means an IP has moved to
        another location
        """
        try:
            ipcmd.del_neigh(self.iface, ip)
        except ipcmd.IpCmdError:
            pass
        self.del_host_route(ip)
        if ip in self:
            del self[ip]

    def add_neigh_proxy(self, ip):
        """Add a neighbor proxy"""
        if ip not in self.proxies:
            logger.info("Add Neighbor Proxy {0} @ {1}".format(ip, self.iface))
        try:
            ipcmd.add_neigh_proxy(self.iface, ip)
        except ipcmd.IpCmdError:
            # Failure is normal if the proxy already existed
            if ip in self.proxies:
                return
            # Reload tables
            self.reload()
            if ip in self.proxies:
                return
            # Let's try again, and failure goes up this time
            ipcmd.add_neigh_proxy(self.iface, ip)
        self.proxies.add(ip)

    def del_neigh_proxy(self, ip):
        """Delete a neighbor proxy"""
        if ip in self.proxies:
            logger.info("Delete Neighbor Proxy {0} @ {1}"
                        .format(ip, self.iface))
        try:
            ipcmd.del_neigh_proxy(self.iface, ip)
        except ipcmd.IpCmdError:
            # Failure is normal if the proxy did not exist
            if ip not in self.proxies:
                return
            # Reload tables
            self.reload()
            if ip not in self.proxies:
                return
            # Let's try again, and failure goes up this time
            ipcmd.del_neigh_proxy(self.iface, ip)
        self.proxies.discard(ip)

    def add_host_route(self, ip):
        """Add a route to an host"""
        if ip not in self.host_routes:
            logger.info("Add Host Route {0} @ {1}".format(ip, self.iface))
        try:
            ipcmd.add_route(self.iface, ip)
        except ipcmd.IpCmdError:
            # Failure is normal if the proxy already existed
            if ip in self.host_routes:
                return
            # Reload tables
            self.reload()
            if ip in self.host_routes:
                return
            # Let's try again, and failure goes up this time
            ipcmd.add_route(self.iface, ip)
        self.host_routes.add(ip)

    def del_host_route(self, ip):
        """Delete a neighbor proxy"""
        if ip in self.host_routes:
            logger.info("Delete Host Route {0} @ {1}".format(ip, self.iface))
        try:
            ipcmd.del_route(self.iface, ip)
        except ipcmd.IpCmdError:
            # Failure is normal if the host route did not exist
            if ip not in self.host_routes:
                return
            # Reload tables
            self.reload()
            if ip not in self.host_routes:
                return
            # Let's try again, and failure goes up this time
            ipcmd.del_route(self.iface, ip)
        self.host_routes.discard(ip)

class NeighTable(dict):
    """Store information about a neighbor table.

    A neighbor table is a dict in following format:
        interface name (iface) -> IP address (ip) -> Hardware address (hw)
    """

    def __init__(self, *ifaces):
        """Initialise a neighbor table with some interfaces"""
        super(NeighTable, self).__init__()
        for iface in ifaces:
            self[iface] = NeighTableIface(iface)
        self.check_proxy()

    def add_iface(self, iface):
        """Add an interface and retrieve its current state"""
        self[iface] = NeighTableIface(iface)

    def dump(self):
        """Dump content for debugging purpose"""
        for entries in self.values():
            for line in entries.dump():
                yield line

    def is_local_hw(self, hw):
        """Test wether a hardware address is local to this host

        This only tests if hw is is one of the known interfaces.
        """
        return any([hw == entry.ifhwaddr for entry in self.values()])

    def update(self, iface, ip, hw, update_proxy=False):
        """Update a neighbour entry

        Return True if something changed
        """
        # Some packets have an empty source address, ignore them
        if ip in ['0.0.0.0', '::']:
            return False

        entry = self.get(iface)
        if entry is None:
            logger.error(
                "Error: add a neigh entry for unknown interface {0}"
                .format(iface))
            return False

        # Do nothing if I initiated the packet, it may be a proxy
        if hw == entry.ifhwaddr or self.is_local_hw(hw):
            return False

        # Remove the IP address if it was in an other interface
        for other_iface, other_entry in self.items():
            if iface != other_iface and ip in other_entry:
                logger.info("{0} has moved from {1} to {2}"
                            .format(ip, iface, other_iface))
                other_entry.remove_neigh(ip)

        if not entry.update(ip, hw):
            return False

        # Update the proxy if needed
        if update_proxy:
            self.check_proxy(updated_iface=iface, updated_ip=ip)
        return True

    def check_proxy(self, updated_iface=None, updated_ip=None):
        """Check the proxy state and add/remove entries if needed"""
        for entries in self.values():
            for ip in entries.keys():
                # Remove bad proxies
                if ip in entries.proxies:
                    entries.del_neigh_proxy(ip)
                # Add host routes
                if ip not in entries.host_routes:
                    entries.add_host_route(ip)
            # Remove no-longer existing host routes
            for ip in list(entries.host_routes):
                if ip not in entries:
                    entries.del_host_route(ip)
            # Remove proxy entries which no longer matches a neighbor
            for ip in list(entries.proxies):
                if all([ip not in e for e in self.values()]):
                    entries.del_neigh_proxy(ip)

        # Checks between interfaces
        ifaces = list(self.keys())
        for iface, p_iface in itertools.product(ifaces, ifaces):
            if p_iface == iface:
                continue
            # Each IP of iface needs to be proxyfied by p_iface
            entries = self[iface]
            p_entries = self[p_iface]
            for ip in list(entries.keys()):
                # Test wether ip has been seen by both iface and p_iface
                if ip in p_entries:
                    logger.warning(
                        "IP {0} seen from both {1} and {2}. Discarding both."
                        .format(ip, iface, p_iface))
                    entries.remove_neigh(ip)
                    p_entries.remove_neigh(ip)
                    continue

                # Add needed neigh proxy
                if ip not in p_entries.proxies:
                    p_entries.add_neigh_proxy(ip)


text:
IPython.WidgetManager = function(){;};

IPython.Session.prototype._handle_start_success = function (data, status, xhr) {
    this.id = data.id;
    // since base_url can be absolute path, we just assume that the pathname will
    // always be '/'
    var kernel_service_url = "/api/kernels";
    this.kernel = new IPython.Kernel(kernel_service_url);
    this.kernel.base_url = this.base_url;
    this.kernel._kernel_started(data.kernel);
};

IPython.Kernel.prototype._kernel_started = function (json) {
    console.log("Kernel started: ", json.id);
    this.running = true;
    this.kernel_id = json.id;
    // trailing 's' in https will become wss for secure web sockets
    if (typeof location != 'undefined') {
        this.ws_host = location.protocol.replace('http', 'ws') + "//" + location.host;
    } else {
        // if location is undefined, we assume base_url is aboslute
        this.ws_host = this.base_url.replace('http', 'ws');
    }
    this.kernel_url = IPython.utils.url_path_join(this.kernel_service_url, this.kernel_id);
    this.start_channels();
};

/*
 * Changed to respect absolute urls
 */
IPython.utils.url_join_encode = function () {
    // join a sequence of url components with '/',
    // encoding each component with encodeURIComponent
    //
    var uri = IPython.utils.url_path_join.apply(null, arguments);
    if (uri.indexOf("://") == -1) { // relative path
        return IPython.utils.encode_uri_components(uri);
    }

    var bits = uri.split("/");
    // the first three represent the protocol and host
    var components = bits.splice(3);

    var protocol_host = bits.join('/');
    var path = components.map(encodeURIComponent).join('/');
    var ret = protocol_host + '/' + path;
    return ret;
};

/*
 * Will not replace '//' which would mess up absolute urls
 */
IPython.utils.url_path_join = function () {
    // join a sequence of url components with '/'
    var url = '';
    for (var i = 0; i < arguments.length; i++) {
        if (arguments[i] === '') {
            continue;
        }
        if (url.length > 0 && (url[url.length-1] != '/' && arguments[i][0] != '/')) {
            url = url + '/' + arguments[i];
        } else {
            url = url + arguments[i];
        }
    }
    return url;
};


text:
<?php
include 'inc/encrypt.php';
include 'inc/mysqli.php';
header('Content-Type:application/json');
$myArray = array();
if ($result = $mysqli->query("SELECT project.project_ID, project.project_name, project.customer_ID, project.team_leader_ID, project.project_status
from project")) {

    while($row = $result->fetch_object()) {
            $myArray[] = $row;
    }
    echo json_encode($myArray);
}

$result->close();
$mysqli->close();
?>


text:
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import importutils

from cinder import exception
from cinder.i18n import _
from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts
from cinder.zonemanager import fc_san_lookup_service as fc_service
from cinder.zonemanager import utils as fczm_utils

LOG = logging.getLogger(__name__)

class BrcdFCSanLookupService(fc_service.FCSanLookupService):
    """The SAN lookup service that talks to Brocade switches.

    Version History:
        1.0.0 - Initial version
        1.1 - Add support to use config option for switch southbound protocol

    """

    VERSION = "1.1"

    def __init__(self, **kwargs):
        """Initializing the client."""
        super(BrcdFCSanLookupService, self).__init__(**kwargs)
        self.configuration = kwargs.get('configuration', None)
        self.create_configuration()

    def create_configuration(self):
        """Configuration specific to SAN context values."""
        config = self.configuration

        fabric_names = [x.strip() for x in config.fc_fabric_names.split(',')]
        LOG.debug('Fabric Names: %s', fabric_names)

        # There can be more than one SAN in the network and we need to
        # get credentials for each for SAN context lookup later.
        if len(fabric_names) > 0:
            self.fabric_configs = fabric_opts.load_fabric_configurations(
                fabric_names)

    def get_device_mapping_from_network(self,
                                        initiator_wwn_list,
                                        target_wwn_list):
        """Provides the initiator/target map for available SAN contexts.

        Looks up nameserver of each fc SAN configured to find logged in devices
        and returns a map of initiator and target port WWNs for each fabric.

        :param initiator_wwn_list: List of initiator port WWN
        :param target_wwn_list: List of target port WWN
        :returns: List -- device wwn map in following format

        .. code-block:: default

            {
                <San name>: {
                    'initiator_port_wwn_list':
                    ('200000051e55a100', '200000051e55a121'..)
                    'target_port_wwn_list':
                    ('100000051e55a100', '100000051e55a121'..)
                }
            }

        :raises Exception: when connection to fabric is failed
        """
        device_map = {}
        formatted_target_list = []
        formatted_initiator_list = []
        fabric_map = {}
        fabric_names = self.configuration.fc_fabric_names
        fabrics = None
        if not fabric_names:
            raise exception.InvalidParameterValue(
                err=_("Missing Fibre Channel SAN configuration "
                      "param - fc_fabric_names"))

        fabrics = [x.strip() for x in fabric_names.split(',')]
        LOG.debug("FC Fabric List: %s", fabrics)
        if fabrics:
            for t in target_wwn_list:
                formatted_target_list.append(fczm_utils.get_formatted_wwn(t))

            for i in initiator_wwn_list:
                formatted_initiator_list.append(fczm_utils.
                                                get_formatted_wwn(i))

            for fabric_name in fabrics:
                fabric_ip = self.fabric_configs[fabric_name].safe_get(
                    'fc_fabric_address')

                # Get name server data from fabric and find the targets
                # logged in
                nsinfo = ''
                try:
                    LOG.debug("Getting name server data for "
                              "fabric %s", fabric_ip)
                    conn = self._get_southbound_client(fabric_name)
                    nsinfo = conn.get_nameserver_info()
                except exception.FCSanLookupServiceException:
                    with excutils.save_and_reraise_exception():
                        LOG.error("Failed collecting name server info from"
                                  " fabric %s", fabric_ip)
                except Exception as e:
                    msg = _("SSH connection failed "
                            "for %(fabric)s with error: %(err)s"
                            ) % {'fabric': fabric_ip, 'err': e}
                    LOG.error(msg)
                    raise exception.FCSanLookupServiceException(message=msg)

                LOG.debug("Lookup service:nsinfo-%s", nsinfo)
                LOG.debug("Lookup service:initiator list from "
                          "caller-%s", formatted_initiator_list)
                LOG.debug("Lookup service:target list from "
                          "caller-%s", formatted_target_list)
                visible_targets = [x for x in nsinfo
                                   if x in formatted_target_list]
                visible_initiators = [x for x in nsinfo
                                      if x in formatted_initiator_list]

                if visible_targets:
                    LOG.debug("Filtered targets is: %s", visible_targets)
                    # getting rid of the : before returning
                    for idx, elem in enumerate(visible_targets):
                        elem = str(elem).replace(':', '')
                        visible_targets[idx] = elem
                else:
                    LOG.debug("No targets are in the nameserver for SAN %s",
                              fabric_name)

                if visible_initiators:
                    # getting rid of the : before returning ~sk
                    for idx, elem in enumerate(visible_initiators):
                        elem = str(elem).replace(':', '')
                        visible_initiators[idx] = elem
                else:
                    LOG.debug("No initiators are in the nameserver "
                              "for SAN %s", fabric_name)

                fabric_map = {
                    'initiator_port_wwn_list': visible_initiators,
                    'target_port_wwn_list': visible_targets
                }
                device_map[fabric_name] = fabric_map
        LOG.debug("Device map for SAN context: %s", device_map)
        return device_map

    def _get_southbound_client(self, fabric):
        """Implementation to get SouthBound Connector.

         South bound connector will be
         dynamically selected based on the configuration

        :param fabric: fabric information
        """
        fabric_info = self.fabric_configs[fabric]
        fc_ip = fabric_info.safe_get('fc_fabric_address')
        sb_connector = fabric_info.safe_get('fc_southbound_protocol')
        if sb_connector is None:
            sb_connector = self.configuration.brcd_sb_connector
        try:
            conn_factory = importutils.import_object(
                "cinder.zonemanager.drivers.brocade."
                "brcd_fc_zone_connector_factory."
                "BrcdFCZoneFactory")
            client = conn_factory.get_connector(fabric_info,
                                                sb_connector.upper())
        except Exception:
            msg = _("Failed to create south bound connector for %s.") % fc_ip
            LOG.exception(msg)
            raise exception.FCZoneDriverException(msg)
        return client


text:
.class Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;
.super Ljava/lang/Object;
.source "SemAddDeleteHorizontalListAnimator.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->prepareDelete(Ljava/util/ArrayList;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

.field final synthetic val$adapter:Landroid/widget/ListAdapter;

.field final synthetic val$childCountBefore:I

.field final synthetic val$defaultHeight:I

.field final synthetic val$defaultTop:I

.field final synthetic val$deletedItemPosHash:Ljava/util/HashSet;

.field final synthetic val$deletedItems:Ljava/util/ArrayList;

.field final synthetic val$firstVisiblePosBefore:I

# direct methods
.method constructor <init>(Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;Landroid/widget/ListAdapter;IIIILjava/util/ArrayList;Ljava/util/HashSet;)V
    .locals 0

    iput-object p1, p0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    iput-object p2, p0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$adapter:Landroid/widget/ListAdapter;

    iput p3, p0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$defaultTop:I

    iput p4, p0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$defaultHeight:I

    iput p5, p0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$firstVisiblePosBefore:I

    iput p6, p0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$childCountBefore:I

    iput-object p7, p0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$deletedItems:Ljava/util/ArrayList;

    iput-object p8, p0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$deletedItemPosHash:Ljava/util/HashSet;

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

    return-void
.end method

# virtual methods
.method public run()V
    .locals 53

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    invoke-static/range {v49 .. v49}, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->-get1(Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;)Landroid/widget/SemHorizontalListView;

    move-result-object v28

    invoke-virtual/range {v28 .. v28}, Landroid/widget/SemHorizontalListView;->getChildCount()I

    move-result v11

    invoke-virtual/range {v28 .. v28}, Landroid/widget/SemHorizontalListView;->getFirstVisiblePosition()I

    move-result v17

    invoke-virtual/range {v28 .. v28}, Landroid/widget/SemHorizontalListView;->getLastVisiblePosition()I

    move-result v25

    invoke-virtual/range {v28 .. v28}, Landroid/widget/SemHorizontalListView;->getHeaderViewsCount()I

    move-result v20

    invoke-virtual/range {v28 .. v28}, Landroid/widget/SemHorizontalListView;->getFooterViewsCount()I

    move-result v19

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$adapter:Landroid/widget/ListAdapter;

    move-object/from16 v49, v0

    invoke-interface/range {v49 .. v49}, Landroid/widget/ListAdapter;->getCount()I

    move-result v6

    const/16 v45, 0x0

    new-instance v9, Ljava/util/ArrayList;

    invoke-direct {v9}, Ljava/util/ArrayList;-><init>()V

    const/16 v42, 0x0

    const/16 v44, 0x0

    const/16 v21, 0x0

    move/from16 v0, v20

    if-le v11, v0, :cond_1

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    invoke-static/range {v49 .. v49}, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->-wrap0(Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;)I

    move-result v49

    invoke-virtual/range {v28 .. v28}, Landroid/widget/SemHorizontalListView;->getDividerHeight()I

    move-result v50

    add-int v42, v49, v50

    move-object/from16 v0, v28

    move/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/widget/SemHorizontalListView;->getChildAt(I)Landroid/view/View;

    move-result-object v49

    invoke-virtual/range {v49 .. v49}, Landroid/view/View;->getTop()I

    move-result v44

    move-object/from16 v0, v28

    move/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/widget/SemHorizontalListView;->getChildAt(I)Landroid/view/View;

    move-result-object v49

    invoke-virtual/range {v49 .. v49}, Landroid/view/View;->getHeight()I

    move-result v21

    :goto_0
    const/16 v29, 0x1

    move-object/from16 v0, p0

    iget v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$firstVisiblePosBefore:I

    move/from16 v49, v0

    sub-int v30, v49, v17

    move/from16 v31, v30

    add-int/lit8 v49, v25, 0x1

    move-object/from16 v0, p0

    iget v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$childCountBefore:I

    move/from16 v50, v0

    sub-int v50, v50, v11

    add-int v34, v49, v50

    const/16 v23, 0x0

    :goto_1
    move/from16 v0, v23

    if-ge v0, v11, :cond_8

    move-object/from16 v0, v28

    move/from16 v1, v23

    invoke-virtual {v0, v1}, Landroid/widget/SemHorizontalListView;->getChildAt(I)Landroid/view/View;

    move-result-object v10

    add-int v37, v23, v17

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$adapter:Landroid/widget/ListAdapter;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    move/from16 v1, v37

    invoke-interface {v0, v1}, Landroid/widget/ListAdapter;->getItemId(I)J

    move-result-wide v26

    invoke-virtual {v10}, Landroid/view/View;->getLeft()I

    move-result v49

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v33, v0

    const/16 v48, 0x0

    const-wide/16 v50, -0x1

    cmp-long v49, v26, v50

    if-nez v49, :cond_3

    move/from16 v0, v37

    move/from16 v1, v20

    if-ge v0, v1, :cond_2

    add-int/lit8 v49, v37, 0x1

    move/from16 v0, v49

    int-to-long v0, v0

    move-wide/from16 v26, v0

    :cond_0
    :goto_2
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->mOldHeaderFooterViewCache:Ljava/util/LinkedHashMap;

    move-object/from16 v49, v0

    invoke-static/range {v26 .. v27}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v50

    invoke-virtual/range {v49 .. v50}, Ljava/util/LinkedHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v48

    check-cast v48, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;

    :goto_3
    if-eqz v48, :cond_5

    invoke-virtual/range {v48 .. v48}, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->recycleBitmap()V

    const/16 v29, 0x0

    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->left:I

    move/from16 v49, v0

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v49, v0

    cmpl-float v49, v49, v33

    if-nez v49, :cond_4

    :goto_4
    add-int/lit8 v23, v23, 0x1

    goto :goto_1

    :cond_1
    move-object/from16 v0, p0

    iget v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$defaultTop:I

    move/from16 v44, v0

    move-object/from16 v0, p0

    iget v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$defaultHeight:I

    move/from16 v21, v0

    goto/16 :goto_0

    :cond_2
    sub-int v49, v6, v19

    move/from16 v0, v37

    move/from16 v1, v49

    if-lt v0, v1, :cond_0

    add-int v49, v37, v19

    sub-int v49, v49, v6

    add-int/lit8 v18, v49, 0x1

    move/from16 v0, v18

    neg-int v0, v0

    move/from16 v49, v0

    move/from16 v0, v49

    int-to-long v0, v0

    move-wide/from16 v26, v0

    goto :goto_2

    :cond_3
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->mOldViewCache:Ljava/util/LinkedHashMap;

    move-object/from16 v49, v0

    invoke-static/range {v26 .. v27}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v50

    invoke-virtual/range {v49 .. v50}, Ljava/util/LinkedHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v48

    check-cast v48, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;

    goto :goto_3

    :cond_4
    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->left:I

    move/from16 v49, v0

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v49, v0

    sub-float v45, v49, v33

    :goto_5
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    const/16 v50, 0x0

    move-object/from16 v0, v49

    move/from16 v1, v45

    move/from16 v2, v50

    invoke-virtual {v0, v10, v1, v2}, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->getTranslateAnim(Landroid/view/View;FF)Landroid/animation/ObjectAnimator;

    move-result-object v7

    invoke-virtual {v9, v7}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_4

    :cond_5
    if-lez v31, :cond_6

    if-eqz v29, :cond_6

    move/from16 v0, v30

    neg-int v0, v0

    move/from16 v41, v0

    add-int/lit8 v31, v31, -0x1

    :goto_6
    const/16 v36, -0x1

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    invoke-static/range {v49 .. v49}, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->-get1(Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;)Landroid/widget/SemHorizontalListView;

    move-result-object v49

    invoke-virtual/range {v49 .. v49}, Landroid/widget/SemHorizontalListView;->isLayoutRtl()Z

    move-result v49

    if-eqz v49, :cond_7

    invoke-virtual {v10}, Landroid/view/View;->getLeft()I

    move-result v49

    mul-int v50, v41, v42

    sub-int v36, v49, v50

    :goto_7
    move/from16 v0, v36

    int-to-float v0, v0

    move/from16 v49, v0

    sub-float v45, v49, v33

    goto :goto_5

    :cond_6
    sub-int v41, v34, v37

    add-int/lit8 v34, v34, 0x1

    goto :goto_6

    :cond_7
    invoke-virtual {v10}, Landroid/view/View;->getLeft()I

    move-result v49

    mul-int v50, v41, v42

    add-int v36, v49, v50

    goto :goto_7

    :cond_8
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->mOldViewCache:Ljava/util/LinkedHashMap;

    move-object/from16 v49, v0

    invoke-virtual/range {v49 .. v49}, Ljava/util/LinkedHashMap;->entrySet()Ljava/util/Set;

    move-result-object v49

    invoke-interface/range {v49 .. v49}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v15

    const/16 v46, 0x0

    :goto_8
    invoke-interface {v15}, Ljava/util/Iterator;->hasNext()Z

    move-result v49

    if-eqz v49, :cond_10

    invoke-interface {v15}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v35

    check-cast v35, Ljava/util/Map$Entry;

    invoke-interface/range {v35 .. v35}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v48

    check-cast v48, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->mGhostViewSnapshots:Ljava/util/ArrayList;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    move-object/from16 v1, v48

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    new-instance v43, Landroid/graphics/Rect;

    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->left:I

    move/from16 v49, v0

    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->right:I

    move/from16 v50, v0

    add-int v51, v44, v21

    move-object/from16 v0, v43

    move/from16 v1, v49

    move/from16 v2, v44

    move/from16 v3, v50

    move/from16 v4, v51

    invoke-direct {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;-><init>(IIII)V

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->oldPosition:I

    move/from16 v50, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$deletedItems:Ljava/util/ArrayList;

    move-object/from16 v51, v0

    invoke-virtual/range {v49 .. v51}, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->getNewPosition(ILjava/util/ArrayList;)I

    move-result v32

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->val$deletedItemPosHash:Ljava/util/HashSet;

    move-object/from16 v49, v0

    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->oldPosition:I

    move/from16 v50, v0

    invoke-static/range {v50 .. v50}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v50

    invoke-virtual/range {v49 .. v50}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z

    move-result v24

    sub-int v12, v32, v17

    if-ltz v12, :cond_9

    if-lt v12, v11, :cond_f

    :cond_9
    if-nez v11, :cond_d

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    invoke-static/range {v49 .. v49}, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->-get1(Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;)Landroid/widget/SemHorizontalListView;

    move-result-object v49

    invoke-virtual/range {v49 .. v49}, Landroid/widget/SemHorizontalListView;->isLayoutRtl()Z

    move-result v49

    if-eqz v49, :cond_c

    invoke-virtual/range {v28 .. v28}, Landroid/widget/SemHorizontalListView;->getWidth()I

    move-result v49

    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->right:I

    move/from16 v50, v0

    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->left:I

    move/from16 v51, v0

    sub-int v50, v50, v51

    sub-int v49, v49, v50

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v16, v0

    :goto_9
    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->left:I

    move/from16 v49, v0

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v49, v0

    sub-float v45, v16, v49

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    invoke-static/range {v49 .. v49}, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->-get1(Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;)Landroid/widget/SemHorizontalListView;

    move-result-object v49

    invoke-virtual/range {v49 .. v49}, Landroid/widget/SemHorizontalListView;->isLayoutRtl()Z

    move-result v49

    if-eqz v49, :cond_e

    neg-int v0, v12

    move/from16 v49, v0

    mul-int v49, v49, v42

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v49, v0

    add-float v45, v45, v49

    :goto_a
    new-instance v13, Landroid/graphics/Rect;

    move-object/from16 v0, v43

    invoke-direct {v13, v0}, Landroid/graphics/Rect;-><init>(Landroid/graphics/Rect;)V

    move/from16 v0, v45

    float-to-int v0, v0

    move/from16 v49, v0

    const/16 v50, 0x0

    move/from16 v0, v49

    move/from16 v1, v50

    invoke-virtual {v13, v0, v1}, Landroid/graphics/Rect;->offset(II)V

    if-eqz v24, :cond_a

    sget v49, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->START_SCALE_FACTOR:F

    const/high16 v50, 0x3f800000    # 1.0f

    sub-float v49, v50, v49

    const/high16 v50, 0x40000000    # 2.0f

    div-float v49, v49, v50

    invoke-virtual {v13}, Landroid/graphics/Rect;->width()I

    move-result v50

    move/from16 v0, v50

    int-to-float v0, v0

    move/from16 v50, v0

    mul-float v49, v49, v50

    move/from16 v0, v49

    float-to-int v0, v0

    move/from16 v22, v0

    sget v49, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->START_SCALE_FACTOR:F

    const/high16 v50, 0x3f800000    # 1.0f

    sub-float v49, v50, v49

    const/high16 v50, 0x40000000    # 2.0f

    div-float v49, v49, v50

    invoke-virtual {v13}, Landroid/graphics/Rect;->height()I

    move-result v50

    move/from16 v0, v50

    int-to-float v0, v0

    move/from16 v50, v0

    mul-float v49, v49, v50

    move/from16 v0, v49

    float-to-int v0, v0

    move/from16 v47, v0

    new-instance v14, Landroid/graphics/Rect;

    iget v0, v13, Landroid/graphics/Rect;->left:I

    move/from16 v49, v0

    add-int v49, v49, v22

    iget v0, v13, Landroid/graphics/Rect;->top:I

    move/from16 v50, v0

    add-int v50, v50, v47

    iget v0, v13, Landroid/graphics/Rect;->right:I

    move/from16 v51, v0

    sub-int v51, v51, v22

    iget v0, v13, Landroid/graphics/Rect;->bottom:I

    move/from16 v52, v0

    sub-int v52, v52, v47

    move/from16 v0, v49

    move/from16 v1, v50

    move/from16 v2, v51

    move/from16 v3, v52

    invoke-direct {v14, v0, v1, v2, v3}, Landroid/graphics/Rect;-><init>(IIII)V

    move-object v13, v14

    :cond_a
    const-string/jumbo v49, "bounds"

    sget-object v50, Lcom/samsung/android/animation/SemAnimatorUtils;->BOUNDS_EVALUATOR:Landroid/animation/TypeEvaluator;

    const/16 v51, 0x2

    move/from16 v0, v51

    new-array v0, v0, [Ljava/lang/Object;

    move-object/from16 v51, v0

    const/16 v52, 0x0

    aput-object v43, v51, v52

    const/16 v52, 0x1

    aput-object v13, v51, v52

    invoke-static/range {v49 .. v51}, Landroid/animation/PropertyValuesHolder;->ofObject(Ljava/lang/String;Landroid/animation/TypeEvaluator;[Ljava/lang/Object;)Landroid/animation/PropertyValuesHolder;

    move-result-object v39

    const-string/jumbo v49, "alpha"

    const/16 v50, 0xff

    const/16 v51, 0x0

    filled-new-array/range {v50 .. v51}, [I

    move-result-object v50

    invoke-static/range {v49 .. v50}, Landroid/animation/PropertyValuesHolder;->ofInt(Ljava/lang/String;[I)Landroid/animation/PropertyValuesHolder;

    move-result-object v38

    move-object/from16 v0, v48

    iget-object v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->viewSnapshot:Landroid/graphics/drawable/BitmapDrawable;

    move-object/from16 v49, v0

    const/16 v50, 0x2

    move/from16 v0, v50

    new-array v0, v0, [Landroid/animation/PropertyValuesHolder;

    move-object/from16 v50, v0

    const/16 v51, 0x0

    aput-object v39, v50, v51

    const/16 v51, 0x1

    aput-object v38, v50, v51

    invoke-static/range {v49 .. v50}, Landroid/animation/ObjectAnimator;->ofPropertyValuesHolder(Ljava/lang/Object;[Landroid/animation/PropertyValuesHolder;)Landroid/animation/ObjectAnimator;

    move-result-object v7

    if-nez v46, :cond_b

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->mBitmapUpdateListener:Landroid/animation/ValueAnimator$AnimatorUpdateListener;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    invoke-virtual {v7, v0}, Landroid/animation/ObjectAnimator;->addUpdateListener(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V

    const/16 v46, 0x1

    :cond_b
    invoke-virtual {v9, v7}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto/16 :goto_8

    :cond_c
    invoke-virtual/range {v28 .. v28}, Landroid/widget/SemHorizontalListView;->getPaddingLeft()I

    move-result v49

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v16, v0

    goto/16 :goto_9

    :cond_d
    const/16 v49, 0x0

    move-object/from16 v0, v28

    move/from16 v1, v49

    invoke-virtual {v0, v1}, Landroid/widget/SemHorizontalListView;->getChildAt(I)Landroid/view/View;

    move-result-object v49

    invoke-virtual/range {v49 .. v49}, Landroid/view/View;->getLeft()I

    move-result v49

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v16, v0

    goto/16 :goto_9

    :cond_e
    neg-int v0, v12

    move/from16 v49, v0

    mul-int v49, v49, v42

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v49, v0

    sub-float v45, v45, v49

    goto/16 :goto_a

    :cond_f
    move-object/from16 v0, v28

    invoke-virtual {v0, v12}, Landroid/widget/SemHorizontalListView;->getChildAt(I)Landroid/view/View;

    move-result-object v49

    invoke-virtual/range {v49 .. v49}, Landroid/view/View;->getLeft()I

    move-result v49

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v40, v0

    move-object/from16 v0, v48

    iget v0, v0, Lcom/samsung/android/animation/SemAbsAddDeleteAnimator$ViewInfo;->left:I

    move/from16 v49, v0

    move/from16 v0, v49

    int-to-float v0, v0

    move/from16 v49, v0

    sub-float v45, v40, v49

    goto/16 :goto_a

    :cond_10
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->mOldViewCache:Ljava/util/LinkedHashMap;

    move-object/from16 v49, v0

    invoke-virtual/range {v49 .. v49}, Ljava/util/LinkedHashMap;->clear()V

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;->this$0:Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;

    move-object/from16 v49, v0

    move-object/from16 v0, v49

    iget-object v0, v0, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->mOldHeaderFooterViewCache:Ljava/util/LinkedHashMap;

    move-object/from16 v49, v0

    invoke-virtual/range {v49 .. v49}, Ljava/util/LinkedHashMap;->clear()V

    new-instance v8, Landroid/animation/AnimatorSet;

    invoke-direct {v8}, Landroid/animation/AnimatorSet;-><init>()V

    invoke-virtual {v8, v9}, Landroid/animation/AnimatorSet;->playTogether(Ljava/util/Collection;)V

    new-instance v49, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2$1;

    move-object/from16 v0, v49

    move-object/from16 v1, p0

    invoke-direct {v0, v1}, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2$1;-><init>(Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator$2;)V

    move-object/from16 v0, v49

    invoke-virtual {v8, v0}, Landroid/animation/AnimatorSet;->addListener(Landroid/animation/Animator$AnimatorListener;)V

    sget-object v49, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->DELETE_INTERPOLATOR:Landroid/view/animation/Interpolator;

    move-object/from16 v0, v49

    invoke-virtual {v8, v0}, Landroid/animation/AnimatorSet;->setInterpolator(Landroid/animation/TimeInterpolator;)V

    sget v49, Lcom/samsung/android/animation/SemAddDeleteHorizontalListAnimator;->TRANSLATION_DURATION:I

    move/from16 v0, v49

    int-to-long v0, v0

    move-wide/from16 v50, v0

    move-wide/from16 v0, v50

    invoke-virtual {v8, v0, v1}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;

    invoke-virtual {v8}, Landroid/animation/AnimatorSet;->start()V

    return-void
.end method


text:
<?php

namespace TestApp\MainBundle\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Httpful\Request;
use TestApp\MainBundle\Entity\Contact;
use TestApp\MainBundle\Entity;

class DefaultController extends Controller
{

    public function indexAction()
    {
        $uri = "http://api.sypexgeo.net";
        $defaultCity = "Moscow";

        // get city by ip
        $response = Request::get($uri)
            ->expectsJson()
            ->sendIt();
        $currentCity = $response->body->city->name_en;

        $repository = $this->getDoctrine()->getRepository('TestAppMainBundle:Contact');
        //get contact by city english name
        $contact = $repository->findOneBy (array('city_en' => $currentCity));
        if (!$contact) {
            $contact = $repository->findOneBy (array('city_en' => $defaultCity));
        }

        /*return new Response(' Created product id ' . $contact->getId() . $response->body->ip . "  " . $response->body->city->name_en . "  " . $response->body->city->name_ru . '');*/

        return $this->redirect(strtolower ($contact->getCityEn()));
    }

/*
    public function contactAction($city)
    {
        $defaultCity = "Moscow";

        // get city by ip

        $currentCity = $city;

        $repository = $this->getDoctrine()->getRepository('TestAppMainBundle:Contact');
        //get contact by city english name
        $contact = $repository->findOneBy (array('city_en' => $currentCity));
        if (!$contact) {
            return $this->redirect(strtolower ($defaultCity));
        }

        $contacts = $repository->findAll();

        return $this->render('TestAppMainBundle:Default:index.html.twig', array('contacts' => $contacts, 'contact' => $contact));

    }*/

}


text:
using System.Collections.Generic;
using System.Linq;

namespace CasaDoCodigo.TDD.Cap2
{
    public class CarrinhoDeCompras
    {
        private readonly IList<Produto> _items;

        public CarrinhoDeCompras()
        {
            _items = new List<Produto>();
        }

        public IReadOnlyCollection<Produto> Produtos => _items.ToArray();

        public void Adiciona(Produto produto)
        {
            _items.Add(produto);
        }
    }
}


text:
<component name="libraryTable">
  <library name="Maven: org.jboss.deployers:jboss-deployers-client-spi:2.2.2.GA">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/jboss/deployers/jboss-deployers-client-spi/2.2.2.GA/jboss-deployers-client-spi-2.2.2.GA.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/jboss/deployers/jboss-deployers-client-spi/2.2.2.GA/jboss-deployers-client-spi-2.2.2.GA-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/jboss/deployers/jboss-deployers-client-spi/2.2.2.GA/jboss-deployers-client-spi-2.2.2.GA-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
package org.apache.commons.collections15.comparators;

import junit.framework.Test;
import junit.framework.TestSuite;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;

/**
 * Tests for ReverseComparator.
 *
 * @author Matt Hall, John Watkinson, Unknown
 * @version $Revision: 1.1 $ $Date: 2005/10/11 19:11:58 $
 */
public class TestReverseComparator extends AbstractTestComparator {

    public TestReverseComparator(String testName) {
        super(testName);
    }

    public static Test suite() {
        return new TestSuite(TestReverseComparator.class);
    }

    /**
     * For the purposes of this test, return a
     * ReverseComparator that wraps the java.util.Collections.reverseOrder()
     * Comparator.  The resulting comparator should
     * sort according to natural Order.  (Note: we wrap
     * a Comparator taken from the JDK so that we can
     * save a "canonical" form in CVS.
     *
     * @return Comparator that returns "natural" order
     */
    public Comparator makeComparator() {
        return new ReverseComparator(Collections.reverseOrder());
    }

    public List getComparableObjectsOrdered() {
        List list = new LinkedList();
        list.add(new Integer(1));
        list.add(new Integer(2));
        list.add(new Integer(3));
        list.add(new Integer(4));
        list.add(new Integer(5));
        return list;
    }

    /**
     * Override this inherited test since Collections.reverseOrder
     * doesn't adhere to the "soft" Comparator contract, and we've
     * already "cannonized" the comparator returned by makeComparator.
     */
    public void testSerializeDeserializeThenCompare() throws Exception {
        Comparator comp = new ReverseComparator(new ComparableComparator());

        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(buffer);
        out.writeObject(comp);
        out.close();

        ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
        Object dest = in.readObject();
        in.close();
        assertEquals("obj != deserialize(serialize(obj))", comp, dest);
    }

}


text:
var http = require('http');
var https = require('https');
var log = require('../util/log');

function RpcClient(opts) {
  opts = opts || {};
  this.host = opts.host || '127.0.0.1';
  this.port = opts.port || 7692;
  this.user = opts.user || 'bitchcoinrpc';
  this.pass = opts.pass || '7ydepugKcPc8mutWQgnzDKeN9HSFw6gnuvPUCAzZrvnD';
  this.protocol = (opts.protocol == 'http') ? http : https;
  this.batchedCalls = null;
  this.disableAgent = opts.disableAgent || false;
}

RpcClient.prototype.batch = function(batchCallback, resultCallback) {
  this.batchedCalls = [];
  batchCallback();
  rpc.call(this, this.batchedCalls, resultCallback);
  this.batchedCalls = null;
}

var callspec = {
  addMultiSigAddress: '',
  addNode: '',
  backupWallet: '',
  createMultiSig: '',
  createRawTransaction: '',
  decodeRawTransaction: '',
  dumpPrivKey: '',
  encryptWallet: '',
  getAccount: '',
  getAccountAddress: 'str',
  getAddedNodeInfo: '',
  getAddressesByAccount: '',
  getBalance: 'str int',
  getBestBlockHash: '',
  getBlock: '',
  getBlockCount: '',
  getBlockHash: 'int',
  getBlockNumber: '',
  getBlockTemplate: '',
  getConnectionCount: '',
  getDifficulty: '',
  getGenerate: '',
  getHashesPerSec: '',
  getInfo: '',
  getMemoryPool: '',
  getMiningInfo: '',
  getNewAddress: '',
  getPeerInfo: '',
  getRawMemPool: '',
  getRawTransaction: 'str int',
  getReceivedByAccount: 'str int',
  getReceivedByAddress: 'str int',
  getTransaction: '',
  getTxOut: 'str int bool',
  getTxOutSetInfo: '',
  getWork: '',
  help: '',
  importAddress: 'str str bool',
  importPrivKey: 'str str bool',
  keyPoolRefill: '',
  listAccounts: 'int',
  listAddressGroupings: '',
  listReceivedByAccount: 'int bool',
  listReceivedByAddress: 'int bool',
  listSinceBlock: 'str int',
  listTransactions: 'str int int',
  listUnspent: 'int int',
  listLockUnspent: 'bool',
  lockUnspent: '',
  move: 'str str float int str',
  sendFrom: 'str str float int str str',
  sendMany: 'str str int str', //not sure this is will work
  sendRawTransaction: '',
  sendToAddress: 'str float str str',
  setAccount: '',
  setGenerate: 'bool int',
  setTxFee: 'float',
  signMessage: '',
  signRawTransaction: '',
  stop: '',
  submitBlock: '',
  validateAddress: '',
  verifyMessage: '',
  walletLock: '',
  walletPassPhrase: 'string int',
  walletPassphraseChange: '',
};

var slice = function(arr, start, end) {
  return Array.prototype.slice.call(arr, start, end);
};

function generateRPCMethods(constructor, apiCalls, rpc) {
  function createRPCMethod(methodName, argMap) {
    return function() {
      var limit = arguments.length - 1;
      if (this.batchedCalls) var limit = arguments.length;
      for (var i = 0; i < limit; i++) {
        if (argMap[i]) arguments[i] = argMap[i](arguments[i]);
      };
      if (this.batchedCalls) {
        this.batchedCalls.push({
          jsonrpc: '2.0',
          method: methodName,
          params: slice(arguments)
        });
      } else {
        rpc.call(this, {
          method: methodName,
          params: slice(arguments, 0, arguments.length - 1)
        }, arguments[arguments.length - 1]);
      }
    };
  };

  var types = {
    str: function(arg) {
      return arg.toString();
    },
    int: function(arg) {
      return parseFloat(arg);
    },
    float: function(arg) {
      return parseFloat(arg);
    },
    bool: function(arg) {
      return (arg === true || arg == '1' || arg == 'true' || arg.toString().toLowerCase() == 'true');
    },
  };

  for (var k in apiCalls) {
    if (apiCalls.hasOwnProperty(k)) {
      var spec = apiCalls[k].split(' ');
      for (var i = 0; i < spec.length; i++) {
        if (types[spec[i]]) {
          spec[i] = types[spec[i]];
        } else {
          spec[i] = types.string;
        }
      }
      var methodName = k.toLowerCase();
      constructor.prototype[k] = createRPCMethod(methodName, spec);
      constructor.prototype[methodName] = constructor.prototype[k];
    }
  }
}

function rpc(request, callback) {
  var self = this;
  var request;
  request = JSON.stringify(request);
  var auth = Buffer(self.user + ':' + self.pass).toString('base64');

  var options = {
    host: self.host,
    path: '/',
    method: 'POST',
    port: self.port,
    agent: self.disableAgent ? false : undefined,
  };
  if (self.httpOptions) {
    for (var k in self.httpOptions) {
      options[k] = self.httpOptions[k];
    }
  }
  var err = null;
  var req = this.protocol.request(options, function(res) {

    var buf = '';
    res.on('data', function(data) {
      buf += data;
    });
    res.on('end', function() {
      if (res.statusCode == 401) {
        callback(new Error('bitcoin JSON-RPC connection rejected: 401 unauthorized'));
        return;
      }
      if (res.statusCode == 403) {
        callback(new Error('bitcoin JSON-RPC connection rejected: 403 forbidden'));
        return;
      }

      if (err) {
        callback(err);
        return;
      }
      try {
        var parsedBuf = JSON.parse(buf);
      } catch (e) {
        log.err(e.stack);
        log.err(buf);
        log.err('HTTP Status code:' + res.statusCode);
        callback(e);
        return;
      }
      callback(parsedBuf.error, parsedBuf);
    });
  });
  req.on('error', function(e) {
    var err = new Error('Could not connect to bitcoin via RPC: ' + e.message);
    log.err(err);
    callback(err);
  });

  req.setHeader('Content-Length', request.length);
  req.setHeader('Content-Type', 'application/json');
  req.setHeader('Authorization', 'Basic ' + auth);
  req.write(request);
  req.end();
};

generateRPCMethods(RpcClient, callspec, rpc);

module.exports = RpcClient;


text:
using namespace boost;
using namespace boost::python;
using namespace IECore;

namespace IECorePython
{

void bindImageCropOp()
{
	RunTimeTypedClass<ImageCropOp>()
		.def( init<>() )
	;
}

} // namespace IECorePython


text:
namespace ginseng
{
	namespace util
	{
		namespace meta
		{
			namespace implementation
			{
				template
				<
					template <typename...> typename TemplateType,
					typename Tuple,
					bool ENOUGH,
					size_t INDEX,
					size_t TYPES_COUNT,
					typename... Types
				>
				struct MoveStdTupleTypesProxy : MoveStdTupleTypesProxy
				<
					TemplateType,
					Tuple,
					TYPES_COUNT == INDEX + 1,
					INDEX + 1,
					TYPES_COUNT,
					Types...,
					typename std::tuple_element<INDEX, Tuple>::type
				>
				{
				};

				template
				<
					template <typename...> typename TemplateType,
					typename Tuple,
					size_t INDEX,
					size_t TYPES_COUNT,
					typename... Types
				>
				struct MoveStdTupleTypesProxy<TemplateType, Tuple, true, INDEX, TYPES_COUNT, Types...>
				{
					using ResultType = TemplateType<Types...>;
				};

				template <template <typename...> typename TemplateType, typename Tuple>
				struct MoveStdTupleTypes
				{
					using ResultType = typename MoveStdTupleTypesProxy
						<
							TemplateType,
							Tuple,
							std::tuple_size<Tuple>::value == 1,
							1,
							std::tuple_size<Tuple>::value,
							typename std::tuple_element<0, Tuple>::type
						>::ResultType;
				};

				template <template <typename...> typename TemplateType>
				struct MoveStdTupleTypes<TemplateType, std::tuple<>>
				{
					using ResultType = TemplateType<>;
				};
			}

			template <template <typename...> typename TemplateType, typename Tuple>
			using MoveStdTupleTypes = typename implementation::MoveStdTupleTypes<TemplateType, Tuple>::ResultType;
		}
	}
}

#endif // GINSENGPROJECT_MOVESTDTUPLETYPES_H


text:
var _ = require('lodash'),
  path = require('path');

var self = module.exports = {
  __module: {
    properties: {
      log: 'grunt/log',
      config: 'config',
      scatter: 'container!'
    },
    provides: {"grunt/tasks/configure_task": {after: ['./develop']}}
  },

  TASK_NAME: 'particles-sources',

  configure_task: function(input) {
    var filesDesc = [];
    var grunt = input.grunt;

    self.scatter.module.container.resolver.iterateParticles(function(component) {
      filesDesc.push(path.join(component.root, "**/*.{js,json}"));
      Array.prototype.push.apply(filesDesc, component.descriptor.excludeFull);
    });

    self.log.debug({taskConfig: filesDesc}, "watch:"+self.TASK_NAME+" task");

    //now set the grunt config
    grunt.config.set('watch.'+self.TASK_NAME, {
      files: filesDesc,
      tasks: ['particles-build', 'particles-develop-internal'],
      options: {
        spawn: false
      }
    });

    return input;
  }
};


text:
import {omit} from "lodash";
import HTTPError from "./http-error";

function defaultTransform({name,roles,session,token,iat,exp}) {
  return {
    userCtx: { name, roles },
    session, token,
    issued: new Date(iat * 1000),
    expires: new Date(exp * 1000)
  };
}

export default function({transform=defaultTransform}) {
  return function(req, res, next) {
    res.ok = function(data) {
      if (req.accepts("json")) {
        if (typeof transform === "function") {
          data = transform.call(req.app, data, this);
        }

        return res.json({
          ok: true,
          ...omit(data, "ok")
        });
      }

      if (req.accepts("application/jwt")) {
        return res.type('application/jwt').send(data.token);
      }

      next(new HTTPError(406));
    };

    next();
  };
}


text:
using Google.Api.Gax;
using Google.Apis.Storage.v1;
using System.Threading;
using System.Threading.Tasks;
using Object = Google.Apis.Storage.v1.Data.Object;

namespace Google.Cloud.Storage.V1
{
    public sealed partial class StorageClientImpl : StorageClient
    {
        /// <inheritdoc />
        public override Object PatchObject(
            Object obj,
            PatchObjectOptions options = null)
            => CreatePatchObjectRequest(obj, options).Execute();

        /// <inheritdoc />
        public override Task<Object> PatchObjectAsync(
            Object obj,
            PatchObjectOptions options = null,
            CancellationToken cancellationToken = default(CancellationToken))
            => CreatePatchObjectRequest(obj, options).ExecuteAsync(cancellationToken);

        private ObjectsResource.PatchRequest CreatePatchObjectRequest(Object obj, PatchObjectOptions options)
        {
            GaxPreconditions.CheckNotNull(obj, nameof(obj));
            GaxPreconditions.CheckArgument(obj.Bucket != null, nameof(obj), "The Bucket property of the object to update is null");
            GaxPreconditions.CheckArgument(obj.Name != null, nameof(obj), "The Name property of the object to update is null");
            var request = Service.Objects.Patch(obj, obj.Bucket, obj.Name);
            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            ApplyEncryptionKey(options?.EncryptionKey, request);
            return request;
        }
    }
}


text:
#pragma once

#include <algorithm>
#include <functional>
#include <map>
#include <random>

template<typename Map>
typename Map::const_iterator nearest_less_item(
    Map const &map,
    typename Map::key_type const &key
) {
  typename Map::const_iterator iterator = map.lower_bound(key);
  if (iterator != map.begin()) {
    return --iterator;
  }
  return map.end();
}

template<typename T>
std::vector<T> observe(std::function<T()> generator,
                       const size_t sample_size) {
  std::vector<T> sample;
  sample.reserve(sample_size);
  for (size_t _ = 0; _ < sample_size; ++_) {
    sample.push_back(generator());
  }
  std::sort(sample.begin(), sample.end());
  return sample;
}

template<typename Number>
std::map<Number, size_t> frequency_polygon(
    const std::vector<Number> &observations
) {
  static_assert(std::is_arithmetic<Number>(),
                "``Number`` type should be arithmetic.");

  std::map<Number, size_t> result;
  size_t cumulative = 0;
  for (const Number observation : observations) {
    cumulative++;
    result[observation] = cumulative;
  }
  return result;
}

template<typename Number, class Float>
std::function<Float(Float)> empirical_distribution_function(
    const std::vector<Number> &sample
) {
  static_assert(std::is_arithmetic<Number>(),
                "``Number`` type should be arithmetic.");
  static_assert(std::is_floating_point<Float>(),
                "``Float`` type should be floating point.");

  size_t sample_size = sample.size();
  std::map<Number, size_t> polygon = frequency_polygon<Number>(sample);

  return [=](Float x_coordinate) -> Float {
    size_t nearest_less_frequency;
    auto nearest_less_point_ptr = nearest_less_item(polygon,
                                                    x_coordinate);
    if (nearest_less_point_ptr == polygon.end()) {
      nearest_less_frequency = 0;
    } else {
      nearest_less_frequency = nearest_less_point_ptr->second;
    }
    return Float(nearest_less_frequency) / sample_size;
  };
}

namespace kolmogorov_smirnov {
/**
 * based on
 * https://en.wikipedia.org/wiki/Kolmogorov–Smirnov_test
 */
template<class Float>
Float statistic(std::function<Float(Float)> edf,
                std::function<Float(Float)> other_edf,
                const Float start,
                const Float stop,
                const Float step) {
  static_assert(std::is_floating_point<Float>(),
                "``Float`` type should be floating point.");

  Float result = 0;
  for (Float point = start; point < stop; point += step) {
    result = std::max(std::abs(edf(point) - other_edf(point)),
                      result);
  }
  return result;
}

template<class Float>
Float c_alpha(Float threshold) {
  static_assert(std::is_floating_point<Float>(),
                "``Float`` type should be floating point.");

  return std::sqrt(-std::log(threshold / 2) / 2);
}

template<class Float>
bool test(std::function<Float(Float)> edf,
          std::function<Float(Float)> other_edf,
          size_t points_count,
          size_t other_points_count,
          const Float start,
          const Float stop,
          const Float threshold) {
  static_assert(std::is_floating_point<Float>(),
                "``Float`` type should be floating point.");

  size_t steps_count = std::max(points_count,
                                other_points_count);
  Float step = stop / steps_count - start / steps_count;
  Float statistic_value = statistic(edf, other_edf,
                                    start, stop, step);
  Float boundary = c_alpha(threshold)
      * std::sqrt(points_count + other_points_count)
      / std::sqrt(points_count * other_points_count);
  bool null_hypothesis_is_rejected = statistic_value > boundary;
  return !null_hypothesis_is_rejected;
}
}

static const double THRESHOLD = 0.001;

template<typename Number, class Float>
bool are_samples_similar(const std::vector<Number> &sample,
                         const std::vector<Number> &other_sample,
                         const Float start,
                         const Float stop,
                         const Float threshold) {
  static_assert(std::is_arithmetic<Number>(),
                "``Number`` type should be arithmetic.");
  static_assert(std::is_floating_point<Float>(),
                "``Float`` type should be floating point.");

  auto edf = empirical_distribution_function<Number, Float>(sample);
  auto other_edf =
      empirical_distribution_function<Number, Float>(other_sample);

  return kolmogorov_smirnov::test(edf,
                                  other_edf,
                                  sample.size(),
                                  other_sample.size(),
                                  start,
                                  stop,
                                  threshold);
}

template<typename Number, class Float>
bool are_generators_similar(std::function<Number()> generator,
                            std::function<Number()> other_generator,
                            const Float start,
                            const Float stop,
                            const size_t start_sample_size = 1'000,
                            const size_t stop_sample_size = 10'000,
                            const Float threshold = THRESHOLD) {
  static_assert(std::is_arithmetic<Number>(),
                "``Number`` type should be arithmetic.");
  static_assert(std::is_floating_point<Float>(),
                "``Float`` type should be floating point.");

  static std::random_device random_device;

  std::uniform_int_distribution<size_t> samples_sizes(start_sample_size,
                                                      stop_sample_size);

  const size_t sample_size = samples_sizes(random_device);
  const size_t other_sample_size = samples_sizes(random_device);

  std::vector<Number> sample = observe(generator,
                                       sample_size);
  std::vector<Number> other_sample = observe(other_generator,
                                             other_sample_size);
  return are_samples_similar(sample,
                             other_sample,
                             start,
                             stop,
                             threshold);
}

template<typename Number, class Float>
bool are_samplers_similar(std::function<std::vector<Number>()> sampler,
                          std::function<std::vector<Number>()> other_sampler,
                          const Float start,
                          const Float stop,
                          const Float threshold = THRESHOLD) {
  static_assert(std::is_arithmetic<Number>(),
                "``Number`` type should be arithmetic.");
  static_assert(std::is_floating_point<Float>(),
                "``Float`` type should be floating point.");

  std::vector<Number> sample = sampler();
  std::vector<Number> other_sample = other_sampler();
  return are_samples_similar(sample,
                             other_sample,
                             start,
                             stop,
                             threshold);
}


text:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textColor="@color/text_gray"
    android:textSize="16sp"
    android:paddingLeft="16dp"
    android:paddingStart="16dp"
    android:paddingRight="16dp"
    android:paddingEnd="16dp"
    /><!-- From: file:/home/mrietveld/programming/bottomsheet/bottomsheet-commons/src/main/res/layout/sheet_list_item_subheader.xml -->


text:
package org.springframework.boot.cli.command.test;

import org.springframework.boot.cli.compiler.GroovyCompilerConfiguration;

/**
 * Configuration for {@link TestRunner}.
 *
 * @author Phillip Webb
 */
public interface TestRunnerConfiguration extends GroovyCompilerConfiguration {

}


text:
#region License
// Copyright (c) 2013 James Newton-King
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion

using System;
using System.Diagnostics;

namespace Newtonsoft.Json.Glimpse.Messages
{
  internal class JsonTraceMessage
  {
    public TimeSpan? Duration { get; set; }
    public DateTime MessageDate { get; set; }
    public string Message { get; set; }
    public TraceLevel Level { get; set; }
    public Exception Exception { get; set; }
    public JsonAction Action { get; set; }
    public int Ordinal { get; set; }
    public string JsonText { get; set; }
    public string Type { get; set; }
  }
}


text:
package edu.regis.mvanhemert.ice.trainer.modeltrainer;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import opennlp.tools.doccat.DoccatFactory;
import opennlp.tools.doccat.DoccatModel;
import opennlp.tools.doccat.DocumentCategorizerME;
import opennlp.tools.doccat.DocumentSample;
import opennlp.tools.doccat.DocumentSampleStream;
import opennlp.tools.util.MarkableFileInputStreamFactory;
import opennlp.tools.util.ObjectStream;
import opennlp.tools.util.PlainTextByLineStream;
import opennlp.tools.util.TrainingParameters;

public class DocumentCategorizerModelTrainer extends ModelTrainer {

	private static final Log LOGGER = LogFactory.getLog(DocumentCategorizerModelTrainer.class);

	@Override
	public boolean trainModel(String trainingFileLocation, String modelFileLocation) throws IOException {
		LOGGER.info("Starting the sentence model trainer. Source file: " + trainingFileLocation + ". Model file: "
				+ modelFileLocation);

		boolean success = false;
		DoccatModel model;
		File trainingFile = Paths.get(trainingFileLocation).toFile();

		ObjectStream<String> stream = new PlainTextByLineStream(new MarkableFileInputStreamFactory(trainingFile),
				StandardCharsets.UTF_8);

		DoccatFactory df = new DoccatFactory();

		try (ObjectStream<DocumentSample> sampleStream = new DocumentSampleStream(stream)) {
			model = DocumentCategorizerME.train("en", sampleStream, TrainingParameters.defaultParams(), df);
		}

		try (OutputStream modelOut = new BufferedOutputStream(
				Files.newOutputStream(Paths.get(modelFileLocation), StandardOpenOption.CREATE))) {

			model.serialize(modelOut);
			success = true;
		}

		return success;
	}

}


text:
var UIRichTextTest = UIScene.extend({
    _richText:null,
    init: function () {
        if (this._super()) {
            //init text
            this._topDisplayLabel.setString("");
            this._bottomDisplayLabel.setString("RichText");

            var widgetSize = this._widget.getContentSize();
            var button = new ccui.Button();
            button.setTouchEnabled(true);
            button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", "");
            button.setTitleText("switch");
            button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5));
            button.addTouchEventListener(this.touchEvent,this);
            this._mainNode.addChild(button);

            // RichText
            var richText = new ccui.RichText();
            richText.ignoreContentAdaptWithSize(false);
            richText.width = 120;
            richText.height = 100;

            var re1 = new ccui.RichElementText(1, cc.color.WHITE, 255, "This color is white. ", "Helvetica", 10);
            var re2 = new ccui.RichElementText(2, cc.color.YELLOW, 255, "And this is yellow. ", "Helvetica", 10);
            var re3 = new ccui.RichElementText(3, cc.color.BLUE, 255, "This one is blue. ", "Helvetica", 10);
            var re4 = new ccui.RichElementText(4, cc.color.GREEN, 255, "And green. ", "Helvetica", 10);
            var re5 = new ccui.RichElementText(5, cc.color.RED, 255, "Last one is red ", "Helvetica", 10);

            var reimg = new ccui.RichElementImage(6, cc.color.WHITE, 255, "ccs-res/cocosui/sliderballnormal.png");

            ccs.armatureDataManager.addArmatureFileInfo("ccs-res/cocosui/100/100.ExportJson");
            var pAr = new ccs.Armature("100");
            pAr.getAnimation().play("Animation1");

            var recustom = new ccui.RichElementCustomNode(1, cc.color.WHITE, 255, pAr);
            var re6 = new ccui.RichElementText(7, cc.color.ORANGE, 255, "Have fun!! ", "Helvetica", 10);
            richText.pushBackElement(re1);
            richText.insertElement(re2, 1);
            richText.pushBackElement(re3);
            richText.pushBackElement(re4);
            richText.pushBackElement(re5);
            richText.insertElement(reimg, 2);
            richText.pushBackElement(recustom);
            richText.pushBackElement(re6);

            richText.x = widgetSize.width / 2;
            richText.y = widgetSize.height / 2;

            this._mainNode.addChild(richText);
            this._richText = richText;
            return true;
        }
        return false;
    },
    touchEvent: function (sender, type) {
        if (type == ccui.Widget.TOUCH_ENDED) {
            if (this._richText.isIgnoreContentAdaptWithSize()) {
                this._richText.ignoreContentAdaptWithSize(false);
                this._richText.setContentSize(cc.size(120, 100));
            } else {
                this._richText.ignoreContentAdaptWithSize(true);
            }
        }
    }
});


text:
PyFarm
======

**NOTE**: This repo has been broken down into individual projects under
https://github.com/pyfarm for  better transparency, isolation, and tracking.
All that remains in this repo are tools for development and deployment.

A Python based distributed job system which is intended to be easy to deploy
and maintain.  Initially developed to be used solely by the Visual Effects
industry there is the intention to expand into other areas as well such as the
general scientific community.  Currently the project is undergoing heavy
development and this page serves as a placeholder.  For more direct information
about the project please use the resources below or view the online
`documentation <https://pyfarm.readthedocs.org>`_

Subprojects
===========
Below are the current subprojects of PyFarm which are under active development.
More detailed information about the individual project(s) can be found in either
the documentation or in the respective repo.

* `pyfarm.core <https://github.com/pyfarm/pyfarm-core>`_

    Sub-library containing core modules, classes, and data types which are
    used throughout the project.

    .. image:: https://travis-ci.org/pyfarm/pyfarm-core.png?branch=master
        :target: https://travis-ci.org/pyfarm/pyfarm-core
        :align: left

    .. image:: https://coveralls.io/repos/pyfarm/pyfarm-core/badge.png?branch=master
        :target: https://coveralls.io/r/pyfarm/pyfarm-core?branch=master
        :align: left

* `pyfarm.master <https://github.com/pyfarm/pyfarm-master>`_

    Sub-library which contains the code necessary to communicate with the
    database via a REST api.

    .. image:: https://travis-ci.org/pyfarm/pyfarm-master.png?branch=master
        :target: https://travis-ci.org/pyfarm/pyfarm-master
        :align: left

    .. image:: https://coveralls.io/repos/pyfarm/pyfarm-master/badge.png?branch=master
        :target: https://coveralls.io/r/pyfarm/pyfarm-master?branch=master
        :align: left

* `pyfarm.agent <https://github.com/pyfarm/pyfarm-agent>`_

    Core module containing code to run PyFarm's agent.

    .. image:: https://travis-ci.org/pyfarm/pyfarm-agent.png?branch=master
        :target: https://travis-ci.org/pyfarm/pyfarm-agent
        :align: left

    .. image:: https://coveralls.io/repos/pyfarm/pyfarm-agent/badge.png?branch=master
        :target: https://coveralls.io/r/pyfarm/pyfarm-agent?branch=master
        :align: left


text:
package smalljavas;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import java.time.LocalDate;
import java.util.*;

import org.junit.*;

import smalljavas.Customer.Gender;

public class DBIT
{
	private DB db;

	@Before public void setup() throws Exception {
		db = new DB(
			DataSourceFactory.newMySqlDataSource(
				"localhost",
				"smalljavas",
				"root",
				"f1gaf1ga",
				new Properties()
			)
		);
	}

	@Test
	public void find_previously_stored_object() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.male);
		c.incrementAccessCount();

		db.insert(c);
		Customer fetched = db.select(Customer.class, c.getID());

		System.out.println("orig ...: " + c);
		System.out.println("fetched : " + fetched);
		assertEquals(c, fetched);
	}

	@Test
	public void returns_null_when_not_found() {
		assertNull(db.select(Customer.class, ID.valueOf("not-exists")));
	}

	@Test
	public void delete_previously_stored_object() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.male);

		db.insert(c);
		db.delete(Customer.class, c.getID());

		assertNull(db.select(Customer.class, c.getID()));
	}

	@Test
	public void delete_an_object() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.male);

		db.insert(c);
		db.delete(c);

		assertNull(db.select(Customer.class, c.getID()));
	}

	@Test
	public void update_previously_stored_object() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.male);

		db.insert(c);

		c.incrementAccessCount();
		db.update(c);

		assertEquals(1, db.select(Customer.class, c.getID()).getAccessCount());
	}

	@Test
	public void newSQL_returns_expected_insert_statement() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.male);
		String sql = DB.newSQL("insert into ${table} (${columns}) values (${values})", c.getClass());
		assertEquals("insert into CUSTOMERS (ID, FIRST_NAME, LAST_NAME, BIRTH_DATE, TITLE, GENDER, ACCESS_COUNT) values (:id, :firstName, :lastName, :birthDate, :title, :gender, :accessCount)", sql);
	}

	@Test
	public void newSQL_returns_expected_update_statement() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.male);
		String sql = DB.newSQL("update ${table} set ${columnsAndValues} where ID = :id", c.getClass());
		assertEquals("update CUSTOMERS set ID = :id, FIRST_NAME = :firstName, LAST_NAME = :lastName, BIRTH_DATE = :birthDate, TITLE = :title, GENDER = :gender, ACCESS_COUNT = :accessCount where ID = :id", sql);
	}

	@Test
	public void newParamMap_returns_expected_map() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.male);
		Map<String, Object> map = DB.newParamMap(c);
		assertThat(map, hasEntry("firstName", (Object) "Mario"));
	}

	@Test
	public void newParamMap_handle_ID() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.male);
		Map<String, Object> map = DB.newParamMap(c);
		assertThat(map, hasKey("id"));
		assertTrue(map.get("id") instanceof String);
	}

	@Test
	public void newParamMap_handle_enums() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.female);
		Map<String, Object> map = DB.newParamMap(c);
		assertThat(map, hasEntry("gender", (Object) "female"));
	}

	@Test
	public void newParamMap_handle_integers() {
		Customer c = new Customer("Mario", "Rossi", LocalDate.parse("1970-01-02"), "mr", Gender.female);
		c.incrementAccessCount();
		Map<String, Object> map = DB.newParamMap(c);
		assertThat(map, hasEntry("accessCount", (Object) 1));
	}
}