text:
<TITLE>Review for Shanghai Noon (2000)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Shanghai Noon (2000)

reviewed by
Steve Rhodes

SHANGHAI NOON
A film review by Steve Rhodes
Copyright 2000 Steve Rhodes
RATING (0 TO ****):  ***

A kidnapped princess, 100,000 pieces of gold and Jackie Chan's
exhilarating stunts: if you think that these sound like the perfect
ingredients for a high old-time at your local cinema, you're right.  As
they say in commercials, "But wait, there's more!"

Based on an idea of Jackie's, SHANGHAI NOON, directed by Tom Dey, is set
in the Old West.  Expanding on Jackie's story outline, Miles Millar and
Alfred Gough's hilarious script starts in the Forbidden City before it
heads for the Chinese mining camps in Nevada in 1881.  (This permits the
story to subtly but effectively explore the rampant racism in that
period in our history.)

Last, but not least, Jackie is perfectly matched with Owen Wilson, as a
sidekick who can best be thought of as the anti-Jackie.  Owen's
character is as unsure and lazy as Jackie's character is bold and
energetic.  Hands down, however, Owen gets almost all of the best lines.

Owen plays Roy O'Bannon, a robber who couldn't shoot the broadside of
the proverbial barn and who would rather spend his time with the ladies
anyway.  (When Roy finds his mug on a wanted poster, he goes wild with
delight.  "It'll drive the girls crazy!" he declares, barely able to
control his excitement.)  His ladies are all women in red who occupy a
bordello so chaste that it could appear in a PG-rated picture.
(SHANGHAI NOON is a mild PG-13.)

Jackie plays Chon Wang, an Imperial Guard who is sent to America as part
of a contingent sent to deliver 100,000 pieces of gold as a ransom for a
kidnapped Chinese princess.  Through a series of misadventures, Chon
ends up partnering with Roy.  The two try to make themselves into a
couple of tough Western dudes so they can rescue the princess.  When Roy
finds out how Chon Wang's name is pronounced, he laughs.  "John Wayne --
that's a terrible cowboy name," Roy tells Chon.  "That's not going to
work."

Well, something that certainly does work is the chemistry between these
two charming actors.  Even if their characters are opposites, their
eventual friendship is as genuine as is the rough road to it.  Acting a
bit like Mel Gibson -- the writers collaborated on Mel's LETHAL WEAPON 4
-- Roy doesn't leave all of the physical antics to Chon.  "I don't know
karate, but I know crazy, and I will use it," Roy explains.

As always, Jackie dazzles the audience with his good-spirited stunts
that are choreographed with ballet precision.  With his baby-faced looks
and his broad smile, he would be a hard actor not to love.  And when he
gets hurt, as he often does while doing his own stunts, you can truly
feel his pain.  In every movie he manages to find fresh approaches to
the fighting sequences.  This time he wields everything from moose horns
-- sans moose -- to a horseshoe on a rope.

It is perhaps a little know facet of Jackie's oeuvre, but Jackie is just
as funny when he isn't showing off his athletic dexterity.  SHANGHAI
NOON's funniest sequence -- even more so than the wonderful outtakes --
has Chon and Roy taking a bubble bath in adjoining tubs.  They ham it up
singing a drinking song that it is side-splittingly funny.

As the resilient Princess Pei Pei (you can guess how her name can be
mispronounced), Lucy Liu is underutilized but still manages to give her
character an inner spark.  In a variation on a shotgun marriage, Chon
ends up with a wife through a peace pipe marriage.  Native American
model Brandon Merrill plays Falling Leaves, Chon's new sharpshooter
wife.

The movie's delights don't end with the acting and the script.  Thanks
to Daniel Mindel's lush cinematography and Randy Edelman's old-fashioned
western film music, the movie is a real treat for the eyes and ears.  A
thoroughly enjoyable film, it is (arguably) Jackie's best movie ever.

SHANGHAI NOON runs a fast 1:45.  It is rated PG-13 for action violence,
some drug humor, language and sensuality and would be fine for kids
around 8 and up.

My son Jeffrey, age 11, adored the movie, awarding it a full ****.  He
said that he thought it "was really funny, yet in a cool sense."  His
favorite character was Roy.

Email: Steve.Rhodes@InternetReviews.com
Web: http://www.InternetReviews.com

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

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

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

Broken URLs inthe reviews are the responsibility of the author.

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

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

redpajama_set_name: RedPajamaGithub


text:
const themeOptions = require('gatsby-theme-apollo-docs/theme-options');

module.exports = {
  pathPrefix: '/docs/apollo-server',
  plugins: [
    {
      resolve: 'gatsby-theme-apollo-docs',
      options: {
        ...themeOptions,
        root: __dirname,
        subtitle: 'Apollo Server',
        description: 'A guide to using Apollo Server',
        githubRepo: 'apollographql/apollo-server',
        defaultVersion: '2',
        versions: {
          '1': 'version-1',
        },
        sidebarCategories: {
          null: [
            'index',
            'getting-started',
            '[Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)',
            '[Apollo Federation](https://www.apollographql.com/docs/federation/)',
          ],
          'Defining a Schema': [
            'schema/schema',
            'schema/scalars-enums',
            'schema/unions-interfaces',
            'schema/directives',
            'schema/creating-directives',
          ],
          'Fetching Data': [
            'data/resolvers',
            'data/data-sources',
            'data/errors',
            'data/file-uploads',
            'data/subscriptions',
          ],
          Testing: [
            'testing/mocking',
            'testing/testing',
            '[Apollo Studio Explorer](https://www.apollographql.com/docs/studio/explorer/)',
            'testing/graphql-playground'
          ],
          Performance: ['performance/caching', 'performance/apq'],
          Security: ['security/authentication', 'security/terminating-ssl'],
          Integrations: [
            'integrations/middleware',
            'integrations/plugins',
          ],
          Deployment: [
            'deployment/heroku',
            'deployment/lambda',
            'deployment/netlify',
            'deployment/azure-functions',
          ],
          Monitoring: ['monitoring/metrics', 'monitoring/health-checks'],
          'API Reference': [
            'api/apollo-server',
            'api/plugin/usage-reporting',
            'api/plugin/schema-reporting',
            'api/plugin/inline-trace',
            'api/graphql-tools',
            '[@apollo/federation](https://www.apollographql.com/docs/federation/api/apollo-federation/)',
            '[@apollo/gateway](https://www.apollographql.com/docs/federation/api/apollo-gateway/)',
          ],
          Appendices: [
            'proxy-configuration',
            'migration-two-dot',
            'migration-file-uploads',
            'migration-engine-plugins',
          ],
        },
      },
    },
  ],
};


text:
import ipc from '~shared/data/ipc';

const sendMessage = () => {
  postMessage({
    type: ipc.ALBUM_CREATED,
  });
};

let closeStream = null;

export const openAlbumsCreationStream = async (dbApis) => {
  if (closeStream) {
    closeStream();
  }
  const handleHook = (args) => {
    args[2].on('complete', sendMessage);
  };
  dbApis.albumsCollection.hook('creating', handleHook);
  closeStream = () => {
    dbApis.albumsCollection.hook('creating').unsubscribe(handleHook);
  };
};

export const closeAlbumsCreationStream = () => {

};


text: RENAME TABLE a TO b,`c` TO `a`,foo.bar TO hello.world


text:
RoGameState::RoGameState(RokLegendPtr game, RoBackgroundScorePtr backgroundScore)
    : mGame(game)
    , mBackgroundScore(backgroundScore)
    , mShouldInitialize(true)
{
}

RoGameState::~RoGameState()
{
    //
}

void RoGameState::initialize()
{
    if (mShouldInitialize)
    {
        addTaskHandlers();
        roLOG_DBG << "Initialized game state: " << typeid(*this).name();
        mShouldInitialize = false;
    }
}

bool RoGameState::update(float timeSinceLastFrameInSecs)
{
    if (mShouldInitialize)
    {
        initialize();
    }
    auto inputKey = RoCli::GetCharacterIfEntered();
    if (RoCli::IsEscapeKey(inputKey.get_value_or(0)))
    {
        mGame->exit();
        return false;
    }
    return updateState(timeSinceLastFrameInSecs);
}

void RoGameState::exitGame() const
{
    mGame->exit();
}

#include "../RoGameBindings.h"
#include <core/RoException.h>
#include <core/RoErrorInfo.h>

RoGameStatePtr RoGameStateFactory::getGameState(RoGameStates gameStateType)
{
    switch (gameStateType)
    {
    case RoGameStates::LOGIN:
        return RoGameBindings::getLoginState();
    case RoGameStates::CHARACTER_SERVER_SELECT:
        return RoGameBindings::getCharacterServerSelectState();
    case RoGameStates::CHARACTER_SELECT:
        return RoGameBindings::getCharacterSelectionState();
    }
    roTHROW(RoInvalidOperation()
        << RoErrorInfoDetail("Unimplemented game state.")
        << RoErrorInfoItemName(to_string(gameStateType)));
}

std::string to_string(const RoGameStates gameStateType)
{
    switch (gameStateType)
    {
    case RoGameStates::LOGIN_SERVER_SELECT:
        return "Login Server Select";
    case RoGameStates::LOGIN:
        return "Login";
    case RoGameStates::CHARACTER_SERVER_SELECT:
        return "Character Server Select";
    case RoGameStates::CHARACTER_SELECT:
        return "Character Select";
    case RoGameStates::MAP:
        return "Map";
    }
    return "UKNOWN state type";
}

std::ostream& operator<<(std::ostream& stream, const RoGameStates gameStateType)
{
    return stream << to_string(gameStateType);
}


text:
package com.marvinlabs.widget.slideshow;

import android.widget.Adapter;

/**
 * A SlideAdapter object acts as a bridge between a SlideShowView and the underlying SlideShow.
 * The SlideAdapter is responsible for making a View for each slide in the slideshow.
 * <p/>
 * Created by Vincent Mimoun-Prat @ MarvinLabs on 28/05/2014.
 */
public interface SlideShowAdapter extends Adapter {

    public enum SlideStatus {
        READY, LOADING, NOT_AVAILABLE;
    }

    /**
     * This function is called when a slide is scheduled to be next to play. You can take this opportunity to do some work to get
     * that slide ready to play (e.g. download the corresponding image)
     *
     * @param position The next slide index
     */
    public void prepareSlide(int position);

    /**
     * This function is called when a slide won't be needed anymore (until it gets prepared again). This is an opportunity to release
     * memory corresponding to the slide that got prepared previously.
     *
     * @param position The slide index
     */
    public void discardSlide(int position);

    /**
     * Is the slide at that position ready to be played? The slide show will wait until that slide is ready to be played or until the adapter
     * says the slide will never be ready and thus should skip it.
     *
     * @param position The slide index
     * @return The status of the given slide
     */
    public SlideStatus getSlideStatus(int position);

}


text:
"""Common classes related to LLVM.

"""

VERSION = '0.7'

from weakref import WeakValueDictionary

#===----------------------------------------------------------------------===
# Exceptions
#===----------------------------------------------------------------------===

class LLVMException(Exception):
    """Generic LLVM exception."""

    def __init__(self, msg=""):
        Exception.__init__(self, msg)

#===----------------------------------------------------------------------===
# Ownables
#===----------------------------------------------------------------------===

class Ownable(object):
    """Objects that can be owned.

    Modules and Module Providers can be owned, i.e., the responsibility of
    destruction of ownable objects can be handed over to other objects. The
    llvm.Ownable class represents objects that can be so owned. This class
    is NOT intended for public use.
    """

    def __init__(self, ptr, del_fn):
        self.ptr = ptr
        self.owner = None
        self.del_fn = del_fn

    def _own(self, owner):
        if self.owner:
            raise LLVMException("object already owned")
        self.owner = owner

    def _disown(self):
        if not self.owner:
            raise LLVMException("not owned")
        self.owner = None

    def __del__(self):
        if not self.owner:
            self.del_fn(self.ptr)

#===----------------------------------------------------------------------===
# Dummy owner, will not delete ownee. Be careful.
#===----------------------------------------------------------------------===

class DummyOwner(object):
    pass

#===----------------------------------------------------------------------===
# A metaclass to prevent aliasing.  It stores a (weak) reference to objects
# constructed based on a PyCObject.  If an object is constructed based on a
# PyCObject with the same underlying pointer as a previous object, a reference
# to the previous object is returned rather than a new one.
#===----------------------------------------------------------------------===

class _ObjectCache(type):
    """A metaclass to prevent aliasing.

    Classes using 'ObjectCache' as a metaclass must have constructors
    that take a PyCObject as their first argument.  When the class is
    called (to create a new instance of the class), the value of the
    pointer wrapped by the PyCObj is checked:

        If no previous object has been created based on the same
        underlying pointer (note that different PyCObject objects can
        wrap the same pointer), the object will be initialized as
        usual and returned.

        If a previous has been created based on the same pointer,
        then a reference to that object will be returned, and no
        object initialization is performed.
    """

    __instances = WeakValueDictionary()

    def __call__(cls, ptr, *args, **kwargs):
        objid = _core.PyCObjectVoidPtrToPyLong(ptr)
        key = "%s:%d" % (cls.__name__, objid)
        obj = _ObjectCache.__instances.get(key)
        if obj is None:
            obj = super(_ObjectCache, cls).__call__(ptr, *args, **kwargs)
            _ObjectCache.__instances[key] = obj
        return obj

    @staticmethod
    def forget(obj):
        objid = _core.PyCObjectVoidPtrToPyLong(obj.ptr)
        key = "%s:%d" % (type(obj).__name__, objid)
        if key in _ObjectCache.__instances:
            del _ObjectCache.__instances[key]

#===----------------------------------------------------------------------===
# Cacheables
#===----------------------------------------------------------------------===

# version 2/3 compatibility help
#   version 2 metaclass
#       class Cacheable(object):
#           __metaclass__ = _ObjectCache  # Doing nothing for version 3
#
#   version 3 metaclass
#       class Cacheable(metaclass=_ObjectCache):
#
# Reference: http://mikewatkins.ca/2008/11/29/python-2-and-3-metaclasses/#using-the-metaclass-in-python-3-x
ObjectCache = _ObjectCache('ObjectCache', (object, ), {})

class Cacheable(ObjectCache):
    """Objects that can be cached.

    Objects that wrap a PyCObject are cached to avoid "aliasing", i.e.,
    two Python objects each containing a PyCObject which internally points
    to the same C pointer."""

    def forget(self):
        ObjectCache.forget(self)


text:
"""
    Cloudbreak API

    Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloudbreak is a RESTful application development platform with the goal of helping developers to build solutions for deploying Hadoop YARN clusters in different environments. Once it is deployed in your favourite servlet container it exposes a REST API allowing to span up Hadoop clusters of arbitary sizes and cloud providers. Provisioning Hadoop has never been easier. Cloudbreak is built on the foundation of cloud providers API (Amazon AWS, Microsoft Azure, Google Cloud Platform, Openstack), Apache Ambari, Docker lightweight containers, Swarm and Consul. For further product documentation follow the link: http://hortonworks.com/apache/cloudbreak/

    OpenAPI spec version: 2.9.0

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from pprint import pformat
from six import iteritems
import re

class SharedServiceResponse(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'shared_cluster_name': 'str',
        'shared_cluster_id': 'int',
        'attached_clusters': 'list[AttachedClusterInfoResponse]'
    }

    attribute_map = {
        'shared_cluster_name': 'sharedClusterName',
        'shared_cluster_id': 'sharedClusterId',
        'attached_clusters': 'attachedClusters'
    }

    def __init__(self, shared_cluster_name=None, shared_cluster_id=None, attached_clusters=None):
        """
        SharedServiceResponse - a model defined in Swagger
        """

        self._shared_cluster_name = None
        self._shared_cluster_id = None
        self._attached_clusters = None

        if shared_cluster_name is not None:
          self.shared_cluster_name = shared_cluster_name
        if shared_cluster_id is not None:
          self.shared_cluster_id = shared_cluster_id
        if attached_clusters is not None:
          self.attached_clusters = attached_clusters

    @property
    def shared_cluster_name(self):
        """
        Gets the shared_cluster_name of this SharedServiceResponse.

        :return: The shared_cluster_name of this SharedServiceResponse.
        :rtype: str
        """
        return self._shared_cluster_name

    @shared_cluster_name.setter
    def shared_cluster_name(self, shared_cluster_name):
        """
        Sets the shared_cluster_name of this SharedServiceResponse.

        :param shared_cluster_name: The shared_cluster_name of this SharedServiceResponse.
        :type: str
        """

        self._shared_cluster_name = shared_cluster_name

    @property
    def shared_cluster_id(self):
        """
        Gets the shared_cluster_id of this SharedServiceResponse.

        :return: The shared_cluster_id of this SharedServiceResponse.
        :rtype: int
        """
        return self._shared_cluster_id

    @shared_cluster_id.setter
    def shared_cluster_id(self, shared_cluster_id):
        """
        Sets the shared_cluster_id of this SharedServiceResponse.

        :param shared_cluster_id: The shared_cluster_id of this SharedServiceResponse.
        :type: int
        """

        self._shared_cluster_id = shared_cluster_id

    @property
    def attached_clusters(self):
        """
        Gets the attached_clusters of this SharedServiceResponse.

        :return: The attached_clusters of this SharedServiceResponse.
        :rtype: list[AttachedClusterInfoResponse]
        """
        return self._attached_clusters

    @attached_clusters.setter
    def attached_clusters(self, attached_clusters):
        """
        Sets the attached_clusters of this SharedServiceResponse.

        :param attached_clusters: The attached_clusters of this SharedServiceResponse.
        :type: list[AttachedClusterInfoResponse]
        """

        self._attached_clusters = attached_clusters

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if not isinstance(other, SharedServiceResponse):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other


text:
QueryFilterCallback::QueryFilterCallback()
{
	_callback = new UserQueryFilterCallback(this);
}
QueryFilterCallback::~QueryFilterCallback()
{
	this->!QueryFilterCallback();
}
QueryFilterCallback::!QueryFilterCallback()
{
	SAFE_DELETE(_callback);
}

//

UserQueryFilterCallback::UserQueryFilterCallback(QueryFilterCallback^ managed)
{
	_managed = managed;
}

PxQueryHitType::Enum UserQueryFilterCallback::preFilter(const PxFilterData& filterData, const PxShape* shape, const PxRigidActor* actor, PxHitFlags& queryFlags)
{
	auto fd = FilterData::ToManaged(filterData);
	auto s = (shape == NULL ? nullptr : ObjectTable::Instance->GetObject<Shape^>((intptr_t)shape));
	auto a = (actor == NULL ? nullptr : ObjectTable::Instance->GetObject<RigidActor^>((intptr_t)actor));
	auto qf = ToManagedEnum(HitFlag, queryFlags);

	QueryHitType ret = _managed->PreFilter(fd, s, a, qf);

	return ToUnmanagedEnum(PxQueryHitType, ret);
}
PxQueryHitType::Enum UserQueryFilterCallback::postFilter(const PxFilterData& filterData, const PxQueryHit& hit)
{
	auto fd = FilterData::ToManaged(filterData);
	auto qh = QueryHit::ToManaged((PxQueryHit*)&hit);

	QueryHitType ret = _managed->PostFilter(fd, qh);

	return ToUnmanagedEnum(PxQueryHitType, ret);
}

UserQueryFilterCallback* QueryFilterCallback::UnmanagedPointer::get()
{
	return _callback;
}


text:
package org.apache.jmeter.gui.util;

import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import javax.swing.event.TableModelEvent;
import javax.swing.table.DefaultTableModel;

import org.apache.jorphan.collections.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PowerTableModel extends DefaultTableModel {
    private static final Logger log = LoggerFactory.getLogger(PowerTableModel.class);

    private static final long serialVersionUID = 234L;

    private Data model = new Data();

    private Class<?>[] columnClasses;

    private static final List<Object> DEFAULT_ARGS = Collections.unmodifiableList(Arrays.asList("", Integer.valueOf(0),
            Long.valueOf(0L), Boolean.FALSE, Float.valueOf(0F), Double.valueOf(0D), Character.valueOf(' '),
            Byte.valueOf(Byte.MIN_VALUE), Short.valueOf(Short.MIN_VALUE)));

    public PowerTableModel(String[] headers, Class<?>[] classes) {
        if (headers.length != classes.length){
            throw new IllegalArgumentException("Header and column array sizes differ");
        }
        model.setHeaders(headers);
        columnClasses = classes;
    }

    public PowerTableModel() {
    }

    public void setRowValues(int row, Object[] values) {
        if (values.length != model.getHeaderCount()){
            throw new IllegalArgumentException("Incorrect number of data items");
        }
        model.setCurrentPos(row);
        for (int i = 0; i < values.length; i++) {
            model.addColumnValue(model.getHeaders()[i], values[i]);
        }
    }

    public Data getData() {
        return model;
    }

    public void addNewColumn(String colName, Class<?> colClass) {
        model.addHeader(colName);
        Class<?>[] newClasses = new Class[columnClasses.length + 1];
        System.arraycopy(columnClasses, 0, newClasses, 0, columnClasses.length);
        newClasses[newClasses.length - 1] = colClass;
        columnClasses = newClasses;
        Object defaultValue = createDefaultValue(columnClasses.length - 1);
        model.setColumnData(colName, defaultValue);
        this.fireTableStructureChanged();
    }

    @Override
    public void removeRow(int row) {
        log.debug("remove row: {}", row);
        if (model.size() > row) {
            log.debug("Calling remove row on Data");
            model.removeRow(row);
        }
    }

    public void removeColumn(int col) {
        model.removeColumn(col);
        this.fireTableStructureChanged();
    }

    public void setColumnData(int col, List<?> data) {
        model.setColumnData(col, data);
    }

    public List<?> getColumnData(String colName) {
        return model.getColumnAsObjectArray(colName);
    }

    public void clearData() {
        String[] headers = model.getHeaders();
        model = new Data();
        model.setHeaders(headers);
        this.fireTableDataChanged();
    }

    @Override
    public void addRow(Object[] data) {
        if (data.length != model.getHeaderCount()){
            throw new IllegalArgumentException("Incorrect number of data items");
        }
        model.setCurrentPos(model.size());
        for (int i = 0; i < data.length; i++) {
            model.addColumnValue(model.getHeaders()[i], data[i]);
        }
    }

    @Override
    public void moveRow(int start, int end, int to) {
        ArrayList<Object[]> rows = new ArrayList<>();
        for(int i=0; i < getRowCount(); i++){
            rows.add(getRowData(i));
        }

        List<Object[]> subList = new ArrayList<>(rows.subList(start, end));
        for (int x = end - 1; x >= start; x--) {
            rows.remove(x);
        }

        rows.addAll(to, subList);
        for(int i = 0; i < rows.size(); i++){
            setRowValues(i, rows.get(i));
        }

        super.fireTableChanged(new TableModelEvent(this));
    }

    public void addNewRow() {
        addRow(createDefaultRow());
    }

    private Object[] createDefaultRow() {
        Object[] rowData = new Object[getColumnCount()];
        for (int i = 0; i < rowData.length; i++) {
            rowData[i] = createDefaultValue(i);
        }
        return rowData;
    }

    public Object[] getRowData(int row) {
        Object[] rowData = new Object[getColumnCount()];
        Arrays.setAll(rowData, i -> model.getColumnValue(i, row));
        return rowData;
    }

    private Object createDefaultValue(int i) { // CHECKSTYLE IGNORE ReturnCount
        Class<?> colClass = getColumnClass(i);
        try {
            return colClass.getDeclaredConstructor().newInstance();
        } catch (Exception e) {
            for (Object initArg: DEFAULT_ARGS) {
                try {
                    Constructor<?> constr = colClass.getConstructor(initArg.getClass());
                    return constr.newInstance(initArg);
                } catch (ReflectiveOperationException ignored) {
                    // no need to log this, as we are just trying out all available default args
                }
            }
        }
        return "";
    }

    /**
     * Required by table model interface.
     *
     * @return the RowCount value
     */
    @Override
    public int getRowCount() {
        if (model == null) {
            return 0;
        }
        return model.size();
    }

    /**
     * Required by table model interface.
     *
     * @return the ColumnCount value
     */
    @Override
    public int getColumnCount() {
        return model.getHeaders().length;
    }

    /**
     * Required by table model interface.
     *
     * @return the ColumnName value
     */
    @Override
    public String getColumnName(int column) {
        return model.getHeaders()[column];
    }

    @Override
    public boolean isCellEditable(int row, int column) {
        // all table cells are editable
        return true;
    }

    @Override
    public Class<?> getColumnClass(int column) {
        return columnClasses[column];
    }

    /**
     * Required by table model interface. return the ValueAt value
     */
    @Override
    public Object getValueAt(int row, int column) {
        return model.getColumnValue(column, row);
    }

    /**
     * Sets the ValueAt attribute of the Arguments object.
     *
     * @param value
     *            the new ValueAt value
     */
    @Override
    public void setValueAt(Object value, int row, int column) {
        if (row < model.size()) {
            model.setCurrentPos(row);
            model.addColumnValue(model.getHeaders()[column], value);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Xml;

delegate void delReaderCallback(string evnt, Object value, Object obj);

internal class WACallback
    {
    internal delReaderCallback callback = null;
    internal Object obj = null;
    internal bool isAsync = false;
    internal Object call(string evnt, Object value)
        {
        if (callback != null)
            callback(evnt, value, obj);
        return null;
        }
    }

public class WABarcodeReader
    {
    string _serverUrl = "wabr.inliteresearch.com";
    string _authorization = "";

    internal delReaderCallback diagCallback = null;
    internal string _image = "";

    WABarcode[] _barcodes = new WABarcode[] { };
    string _error = "";

    void _ReaderCallback(string evnt, Object value, Object obj)
        {
        if (value == null || obj == null) return;
        WABarcodeReader wabr = (WABarcodeReader)obj;
        if (evnt == "error")
            wabr._error = value.ToString();
        else if (evnt == "barcodes")
            wabr._barcodes = (WABarcode[])value;
        if (diagCallback != null)
            diagCallback(evnt, value, _image);
        return;
        }

    public WABarcodeReader(string serverUrl, string authorization = "")
        {
        _serverUrl = serverUrl;
        _authorization = authorization;
        }

    public static string validtypes = "1d,Code39,Code128,Code93,Codabar,Ucc128,Interleaved2of5," +
                                      "Ean13,Ean8,Upca,Upce," +
                                      "2d,Pdf417,DataMatrix,QR," +
                                      "DrvLic," +
                                      "postal,imb,bpo,aust,sing,postnet," +
                                      "Code39basic,Patch";

    public string types = "";
    public string directions = "";
    public uint tbr_code = 0;

    internal WABarcode[] Read(string image, string types = "", string directions = "", uint tbr_code = 0)
        {
        ReadAsync(image, null, null, types, directions, tbr_code);
        if (_error != "")
            throw new Exception(_error);
        return _barcodes;

        }

    internal void ReadAsync(string image, delReaderCallback callback, Object obj, string types = "", string directions = "", uint tbr_code = 0)
        {
        _barcodes = new WABarcode[] { };
        _error = "";

        WACallback cb = new WACallback();
        if (callback != null)
            {
            cb.callback = callback;
            cb.obj = obj;
            cb.isAsync = true;
            }
        else
            {
            cb.callback = _ReaderCallback;
            cb.obj = this;
            cb.isAsync = false;
            }
        _image = image;
        cb.call("image", image);

        string[] names = image.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
        List<string> urls = new List<string>(), files = new List<string>(), images = new List<string>();
        foreach (string name1 in names)
            {
            string name = name1.Trim();
            string s = name.ToLower();
            if (s.StartsWith("http://") || s.StartsWith("https://") || s.StartsWith("ftp://") || s.StartsWith("file://"))
                urls.Add(name);
            else if (File.Exists(name))
                files.Add(name);
            else if (name.StartsWith("data:") || WAUtils.isBase64(name))
                images.Add(name);
            else
                throw new Exception("Invalid image source: " + name.Substring(0, Math.Min(name.Length, 256)));
            }

        ReadLocal(urls, files, images, types, directions, tbr_code, cb);
        }

    public static WABarcode[] ParseResponse(string txtResponse)
        {
        List<WABarcode> barcodes = new List<WABarcode>();
        if (txtResponse.StartsWith("<"))
            {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(txtResponse);
            foreach (XmlNode nodeBarcode in doc.DocumentElement.SelectNodes("//Barcode"))
                {
                WABarcode barcode = new WABarcode();
                barcode.Text = WAUtils.nodeValue(nodeBarcode, "Text", "");
                barcode.Left = WAUtils.nodeValue(nodeBarcode, "Left", 0);
                barcode.Right = WAUtils.nodeValue(nodeBarcode, "Right", 0);
                barcode.Top = WAUtils.nodeValue(nodeBarcode, "Top", 0);
                barcode.Bottom = WAUtils.nodeValue(nodeBarcode, "Bottom", 0);
                barcode.Length = WAUtils.nodeValue(nodeBarcode, "Length", 0);
                barcode.Data = WAUtils.decodeBase64(WAUtils.nodeValue(nodeBarcode, "Data", ""));
                barcode.Page = WAUtils.nodeValue(nodeBarcode, "Page", 0);
                barcode.File = WAUtils.nodeValue(nodeBarcode, "File", "");
                barcode.Meta = WAUtils.nodeToXmlDocument(nodeBarcode, "Meta");

                barcode.Type = WAUtils.nodeValue(nodeBarcode, "Type", "");
                barcode.Rotation = WAUtils.nodeValue(nodeBarcode, "Rotation", "");

                XmlDocument docValues = WAUtils.nodeToXmlDocument(nodeBarcode, "Values");
                if (docValues != null)
                    {
                    foreach (XmlNode node in docValues.DocumentElement.ChildNodes)
                        barcode.Values.Add(node.Name, node.InnerText);
                    }

                barcodes.Add(barcode);
                }
            }
        return barcodes.ToArray();
        }

    void ReadLocal(List<string> urls, List<string> files, List<string> images, string types_, string dirs_, uint tbr_, WACallback cb)
        {
        string server = _serverUrl;
        if (server == "")
            server = "https://wabr.inliteresearch.com"; // default server
        Dictionary<string, string> queries = new Dictionary<string, string>();

        string url = "";
        foreach (string s in urls)
            {
            if (url != "") url += "|";
            url += s;
            }
        if ("url" != "")
            queries.Add("url", url);

        string image = "";
        foreach (string s in images)
            {
            if (image != "") image += "|";
            image += s;
            }
        if ("image" != "")
            queries.Add("image", image);

        queries.Add("format", "xml");
        queries.Add("fields", "meta");
        if (types_ != "")
            queries.Add("types", types_);
        if (dirs_ != "")
            queries.Add("options", dirs_);
        if (tbr_ != 0)
            queries.Add("tbr", tbr_.ToString());

        string serverUrl = String.Format("{0}/barcodes", server);
        WAHttpRequest http = new WAHttpRequest();

        http.ExecRequest(serverUrl, _authorization, files, queries, cb);
        }
    }

/// <summary>
///    Web API  Barcode class
/// </summary>
public class WABarcode
    {
    public WABarcode()
        {
        Values = new Dictionary<string, string>();
        }
    /// <summary>
    /// Barcode data as a string
    /// </summary>
    public string Text
    { get; set; }
    /// <summary>
    /// Barcode data as a byte array
    /// </summary>
    public byte[] Data
    { get; set; }

    /// <summary>
    /// Barcode type (symbology)
    /// </summary>
    public string Type
    { get; set; }

    /// <summary>
    /// Length of barcode data
    /// </summary>
    public int Length
    { get; set; }

    /// <summary>
    /// Page number in the image file containing the barcode
    /// </summary>
    public int Page
    { get; set; }

    /// <summary>
    /// Direction of the barcode rotation on an image
    /// </summary>
    public string Rotation
    { get; set; }

    /// <summary>
    /// Left coordinate of enclosing rectangle
    /// </summary>
    public int Left
    { get; set; }

    /// <summary>
    /// Top coordinate of enclosing rectangle
    /// </summary>
    public int Top
    { get; set; }

    /// <summary>
    /// Right coordinate of enclosing rectangle
    /// </summary>
    public int Right
    { get; set; }

    /// <summary>
    /// Bottom coordinate of enclosing rectangle
    /// </summary>
    public int Bottom
    { get; set; }

    /// <summary>
    /// Name of the image file containing the barcode.
    /// </summary>
    public string File
    { get; set; }

    /// <summary>
    /// Barcode reference information  (XML-formatted)
    /// </summary>
    public XmlDocument Meta
    { get; set; }

    /// <summary>
    ///  Decoded Values (e.g. Driver License/ID Data)
    /// </summary>
    public Dictionary<string, string> Values
    { get; set; }

    }

internal class WAHttpRequest
    {
    internal static int _timeoutSec = 0;
    internal static string _method = "post";  // gen be "get", "post", "postenc"

    private string procWebException(WebException e, WACallback cb)
        {
        string err = "";
        using (WebResponse response = e.Response)
            {
            HttpWebResponse result = (HttpWebResponse)response;
            if (result != null)
                err = "HttpError " + ((int)result.StatusCode).ToString() + ".  " + result.StatusDescription;
            else
                err = "ResponseError: " + e.Message;
            cb.call("response", err);
            if (response != null)
                {
                // WAUtils.printLine("Error code: {0}", httpResponse.StatusCode);
                using (Stream data = response.GetResponseStream())
                    if (data != null)
                        using (var reader = new StreamReader(data))
                            {
                            string message = reader.ReadToEnd();
                            if (!message.StartsWith("<!DOCTYPE")) // Do not display HTML message
                                err += ".  " + message;
                            }
                }
            }
        return err;
        }

    private string procWebResponse(HttpWebResponse result, WACallback cb)
        {
        try
            {
            cb.call("response", result);
            using (Stream stream = result.GetResponseStream())
                {
                using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
                    {
                    string txtResponse = reader.ReadToEnd();
                    return txtResponse;
                    }
                }
            }
        finally
            {
            result.Close();
            }
        }

    private async Task performRequest(string url, string auth, string method, string type, byte[] data, WACallback cb, int retries)
        {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
        if (auth == null) auth = "";
        if (auth == "")
            {
            string env = Environment.GetEnvironmentVariable("WABR_AUTH");
            if (env != null) auth = env;
            }

        request.Method = method;
        if (type != "")
            request.ContentType = type;
        if (auth != "")
            request.Headers.Add("Authorization", auth);
        try
            {
            if (_timeoutSec != 0) // default is 100sec
                request.Timeout = _timeoutSec * 1000;

            if (data != null)
                {
                try
                    {
                    request.ContentLength = data.Length;
                    if (cb.isAsync)
                        using (Stream stream = await request.GetRequestStreamAsync())
                            {
                            stream.Write(data, 0, data.Length);
                            stream.Close();
                            }
                    else
                        using (Stream stream = request.GetRequestStream())
                            {
                            stream.Write(data, 0, data.Length);
                            stream.Close();
                            }
                    }
                catch (Exception ex)
                    {
                    string err = "RequestError: " + ex.Message;
                    cb.call("error", err);
                    }
                }
            HttpWebResponse result = null;
            if (cb.isAsync)
                result = (HttpWebResponse)(await request.GetResponseAsync());
            else
                result = (HttpWebResponse)(request.GetResponse());
            string txtResponse = procWebResponse(result, cb);
            WABarcode[] barcodes = WABarcodeReader.ParseResponse(txtResponse);
            cb.call("barcodes", barcodes);
            }
        catch (Exception ex)
            {
            WebException e = null;
            if (ex is WebException) e = (WebException)ex;
            else if (ex.InnerException is WebException) e = (WebException)ex.InnerException;
            string err = ""; // getResponse (request);
            if (e != null)
                {
                // Receive failure can be result of Server closing without notifying connection
                // e.g. if Server stopped than started or W3WP.exe was killed
                if (e.Status == WebExceptionStatus.KeepAliveFailure && retries < 2)
                    performRequest(url, auth, method, type, data, cb, retries + 1);
                else if (e.Response != null && e.Response.ResponseUri != null &&
                    e.Response.ResponseUri.ToString().ToLower() != url.ToLower() && retries < 3) // Possible redirect retry, e.g using http:// instead of https://
                    performRequest(e.Response.ResponseUri.ToString(), auth, method, type, data, cb, retries + 1);
                else
                    err = procWebException(e, cb);
                }
            else
                {
                err = "FAILURE: " + ex.Message + " {" + ex.GetType().ToString() + "}";
                }
            if (err != "")
                cb.call("error", err);
            }
        }

    private static byte[] GetMultipartFormData(Dictionary<string, string> queries, List<string> files, string boundary)
        {
        Encoding encoding = Encoding.UTF8;
        Stream formDataStream = new System.IO.MemoryStream();
        bool needsCLRF = false;
        foreach (var param in queries)
            {
            if (needsCLRF)
                formDataStream.Write(encoding.GetBytes("\r\n"), 0, encoding.GetByteCount("\r\n"));
            needsCLRF = true;
            string postData = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"{1}\"\r\n\r\n{2}",
                boundary,
                param.Key,
                param.Value);
            formDataStream.Write(encoding.GetBytes(postData), 0, encoding.GetByteCount(postData));
            }

        foreach (var file in files)
            {
            if (needsCLRF)
                formDataStream.Write(encoding.GetBytes("\r\n"), 0, encoding.GetByteCount("\r\n"));
            string header = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"{1}\"; filename=\"{2}\"\r\n\r\n",
                boundary,
                "file",
                Path.GetFileName(file));

            formDataStream.Write(encoding.GetBytes(header), 0, encoding.GetByteCount(header));

            using (FileStream fileStream = new FileStream(file, FileMode.Open, System.IO.FileAccess.Read))
                {
                fileStream.CopyTo(formDataStream);
                }
            }

        // Add the end of the request.  Start with a newline
        string footer = "\r\n--" + boundary + "--\r\n";
        formDataStream.Write(encoding.GetBytes(footer), 0, encoding.GetByteCount(footer));

        // Dump the Stream into a byte[]
        formDataStream.Position = 0;
        byte[] formData = new byte[formDataStream.Length];
        formDataStream.Read(formData, 0, formData.Length);
        formDataStream.Close();

        var request = System.Text.Encoding.Default.GetString(formData); // TEMP  testing

        return formData;
        }
    internal void ExecRequest(string serverUrl, string auth, List<string> files, Dictionary<string, string> queries, WACallback cb = null)
        {
        try
            {

            switch (WAHttpRequest._method)
                {
                case "get":
                        {
                        string query = "";
                        foreach (string key in queries.Keys)
                            {
                            if (key != "image")
                                query += key + "=" + HttpUtility.UrlEncode(queries[key]) + "&";
                            }
                        performRequest(serverUrl + "?" + query, auth, "GET", "", null, cb, 0);

                        }
                    break;
                case "post":
                        {
                        string formDataBoundary = String.Format("----------{0:N}", Guid.NewGuid());
                        byte[] formData = GetMultipartFormData(queries, files, formDataBoundary);
                        performRequest(serverUrl, auth, "POST", "multipart/form-data; boundary=" + formDataBoundary, formData, cb, 0);

                        }
                    break;
                case "postenc":
                        {
                        string query = "";
                        foreach (string key in queries.Keys)
                            query += key + "=" + HttpUtility.UrlEncode(queries[key]) +
                                    "&";
                        byte[] data = Encoding.ASCII.GetBytes(query);
                        performRequest(serverUrl, auth, "POST", "application/x-www-form-urlencoded", data, cb, 0);

                        }
                    break;
                default:
                    string err = "Invalid HTTP method: " + WAHttpRequest._method;
                    cb.call("error", err);
                    break;
                }
            }
        catch (Exception ex)
            {
            cb.call("error", ex.Message);
            }
        }

    }

delegate void delPrintLine(string msg);

internal class WAUtils
    {
    internal static delPrintLine fncPrintLine = null;

    internal static string signature(string image)
        {
        if (image == null || image == "") return "";
        return " [" + image.Substring(0, Math.Min(80, image.Length)) + "] ";
        }

    internal static void printLine(string msg = "")
        {
        if (fncPrintLine != null)
            fncPrintLine(msg);
        }

    internal static string stringAppend(string str, string add, string sep)
        {
        if (sep == "") sep = " ,";
        if (add == "")
            return str;
        else
            {
            string sout = str;
            if (sout != "") sout += sep;
            sout += add;
            return sout;
            }
        }

    internal static string nodeValue(XmlNode nodeParent, string name, string def)
        {
        string sout = def;
        XmlNode node = nodeParent.SelectSingleNode(name);
        if (node != null) sout = node.InnerText;
        return sout;
        }

    internal static string nodeValueXml(XmlNode nodeParent, string name, string def)
        {
        string sout = def;
        XmlNode node = nodeParent.SelectSingleNode(name);
        if (node != null) sout = node.InnerXml;
        return sout;
        }

    internal static int nodeValue(XmlNode nodeParent, string name, int def)
        {
        int nout = def;
        XmlNode node = nodeParent.SelectSingleNode(name);
        if (node != null) Int32.TryParse(node.InnerText, out nout);
        return nout;
        }

    internal static byte[] decodeBase64(string base64)
        {
        if (String.IsNullOrEmpty(base64))
            return null;

        try
        { return Convert.FromBase64String(base64); }
        catch (FormatException)
        { return null; }
        }

    internal static XmlDocument nodeToXmlDocument(XmlNode nodeParent, string name)
        {
        XmlNode node = nodeParent.SelectSingleNode(name);
        if (node == null)
            return null;

        if (String.IsNullOrEmpty(node.InnerXml))
            return null;
        try
            {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(node.InnerXml);
            return doc;
            }
        catch (Exception)
        { return null; }
        }

    internal static string FileToBase64(string file)
        {
        try
            {
            FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read);
            byte[] filebytes = new byte[fs.Length];
            fs.Read(filebytes, 0, Convert.ToInt32(fs.Length));
            string base64 = Convert.ToBase64String(filebytes, Base64FormattingOptions.InsertLineBreaks);
            string ext = Path.GetExtension(file).Replace(".", "");
            base64 = "data:image/" + ext + ";base64," + base64;
            // Optionally attach suffix with reference file name to be placed in Barcode.File property
            base64 = base64 + ":::" + Path.GetFileName(file);
            return base64;
            }
        catch (Exception ex)
            {
            WAUtils.printLine();
            WAUtils.printLine(ex.Message);
            return "";
            }
        }

    internal static Boolean isBase64(String value) // IsBase64String
        {
        string v = value;
        // replace formating characters
        v = v.Replace("\r\n", "");
        v = v.Replace("\r", "");
        // remove reference file name, if  present
        int ind = v.IndexOf(":::");
        if (ind > 0)
            v = v.Substring(0, ind);

        if (v == null || v.Length == 0 || (v.Length % 4) != 0)
            return false;
        var index = v.Length - 1;
        if (v[index] == '=')
            index--;
        if (v[index] == '=')
            index--;
        for (var i = 0; i <= index; i++)
            if (IsInvalidBase64char(v[i]))
                return false;
        return true;
        }

    private static Boolean IsInvalidBase64char(char value)
        {
        var intValue = (Int32)value;
        if (intValue >= 48 && intValue <= 57)
            return false;
        if (intValue >= 65 && intValue <= 90)
            return false;
        if (intValue >= 97 && intValue <= 122)
            return false;
        return intValue != 43 && intValue != 47;
        }
    }


text:
package fr.bellingard.accountmanager.model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Optional;

/**
 * Represents a bank account or a category.
 */
public class Account extends Element {

    // For every account
    private Account parent;
    private Collection<Account> subAccounts;
    private Collection<Transaction> transactions;

    // For bank accounts only
    private Institution institution;
    private String accountNumber;

    private boolean closed;
    private boolean favorite;

    /**
     * Creates an account.
     *
     * @param id
     * @param name
     */
    public Account(String id, String name) {
        super(id, name);
        subAccounts = new ArrayList<>();
        transactions = new ArrayList<>();
        closed = false;
        favorite = false;
    }

    /**
     * Computes and returns the balance.
     *
     * @return
     */
    public Long getBalance() {
        return transactions.stream()
                .mapToLong(t -> t.getToAccount().equals(this) ? t.getAmount() : -t.getAmount())
                .sum();
    }

    /**
     * Returns the parent of this account, if any.
     *
     * @return
     */
    public Optional<Account> getParent() {
        return Optional.ofNullable(parent);
    }

    /**
     * Sets the parent of this account.
     *
     * @param parent
     */
    public void setParent(Account parent) {
        if (this.parent != null) {
            this.parent.removeSubAccount(this);
        }
        this.parent = parent;
        parent.addSubAccount(this);
    }

    private void addSubAccount(Account account) {
        subAccounts.add(account);
    }

    private void removeSubAccount(Account account) {
        subAccounts.remove(account);
    }

    /**
     * Lists sub accounts.
     *
     * @return
     */
    public Collection<Account> listSubAccount() {
        return subAccounts;
    }

    /**
     * Give the institution of this account. Only available if this is a bank account.
     *
     * @return
     */
    public Optional<Institution> getInstitution() {
        return Optional.ofNullable(institution);
    }

    /**
     * Sets the institution for this (bank) account.
     *
     * @param institution
     */
    public void setInstitution(Institution institution) {
        if (this.institution != null) {
            this.institution.removeAccount(this);
        }
        this.institution = institution;
        institution.addAccount(this);
    }

    /**
     * Tells whether or not the account is closed
     * @return closed
     */
    public boolean isClosed() {
        return closed;
    }

    /**
     * Sets whether or not the account is closed
     * @param closed
     */
    public void setClosed(boolean closed) {
        this.closed = closed;
    }

    /**
     * Tells whether or not the account is a favorite one
     * @return favorite
     */
    public boolean isFavorite() {
        return favorite;
    }

    /**
     * Sets whether or not the account is a favorite one
     * @param favorite
     */
    public void setFavorite(boolean favorite) {
        this.favorite = favorite;
    }

    /**
     * Give the bank account number. Only available if this is a bank account.
     *
     * @return
     */
    public Optional<String> getAccountNumber() {
        return Optional.ofNullable(accountNumber);
    }

    /**
     * Sets the bank account number.
     *
     * @param accountNumber
     */
    public void setAccountNumber(String accountNumber) {
        this.accountNumber = accountNumber;
    }

    /**
     * Adds the given transaction.
     *
     * @param transaction
     */
    public void addTransaction(Transaction transaction) {
        transactions.add(transaction);
    }

    /**
     * Removes the given transaction.
     *
     * @param transaction
     */
    public void removeTransaction(Transaction transaction) {
        transactions.remove(transaction);
    }

    /**
     * Lists all the transactions.
     *
     * @return
     */
    public Collection<Transaction> listTransactions() {
        return transactions;
    }

    @Override
    public String toString() {
        return "Account{" +
                "id='" + getId() + '\'' +
                ", name='" + getName() + '\'' +
                ", parent=" + (parent == null ? "null" : parent.getName()) +
                ", subAccounts=" + Arrays.asList(subAccounts.stream().map(Account::getName).toArray()) +
                ", institution=" + (institution == null ? "" : institution.getName()) +
                ", accountNumber='" + accountNumber + '\'' +
                ", transactions=" + transactions.size() +
                '}';
    }
}


text:
require('should');
var CODES = require('../../codes');
var users_manager = require('../../users-manager');

describe('users-manager.js', function() {
  describe('#signIn()', function() {
    it('should return SUCCESS if user can sign in', function() {
      var expected = CODES.STATUS.SUCCESS;
      var actual   = users_manager.signIn('Darkneon');
      actual.should.equal(expected);
    })

    it ('should return ALREADY_EXISTS if username is already taken', function() {
      var expected = CODES.STATUS.ALREADY_EXISTS;
      var actual;
      actual = users_manager.signIn('Darkneon');
      actual = users_manager.signIn('Darkneon');
      actual.should.equal(expected);
    })
  })
})


text:
package org.jetbrains.plugins.scala.testingSupport.scalatest.base.staticStringTest

import org.jetbrains.plugins.scala.testingSupport.scalatest.base.ScalaTestTestCase

trait MethodsStaticStringTest extends ScalaTestTestCase {

  private val ClassName = "ScalaTestMethodsTest"
  private val FileName = ClassName + ".scala"

  addSourceFile(FileName,
    s"""$ImportsForPropSpec
       |
       |class $ClassName extends $PropSpecBase {
       |  property(" testName ".trim + "1") {
       |  }
       |
       |  property("TeStNaMe2".toLowerCase) {
       |  }
       |
       |  property("testName3Suffix".stripSuffix("Suffix")) {
       |  }
       |
       |  property("prefixtestName4".stripPrefix("prefix")) {
       |  }
       |
       |  property("junktestName5".substring(4)) {
       |  }
       |
       |  property("JunktestName6Junk".substring(4, 13)) {
       |  }
       |
       |  property("testReplace7".replace("Replace", "Name")) {
       |  }
       |}
       |""".stripMargin.trim)

  def testTrim(): Unit = {
    assertConfigAndSettings(createTestCaretLocation(3, 7, FileName), ClassName, "testName1")
  }

  def testToLowerCase(): Unit = {
    assertConfigAndSettings(createTestCaretLocation(6, 7, FileName), ClassName, "testname2")
  }

  def testStripSuffix(): Unit = {
    assertConfigAndSettings(createTestCaretLocation(9, 7, FileName), ClassName, "testName3")
  }

  def testStripPrefix(): Unit = {
    assertConfigAndSettings(createTestCaretLocation(12, 7, FileName), ClassName, "testName4")
  }

  def testSubstring1(): Unit = {
    assertConfigAndSettings(createTestCaretLocation(15, 7, FileName), ClassName, "testName5")
  }

  def testSubstring2(): Unit = {
    assertConfigAndSettings(createTestCaretLocation(18, 7, FileName), ClassName, "testName6")
  }

  def testReplace(): Unit = {
    assertConfigAndSettings(createTestCaretLocation(21, 7, FileName), ClassName, "testName7")
  }
}


text:
namespace ride::apigl
{

struct cursor_cache
{
    SDL_Cursor* get_or_create(CursorType cursor);
    void set_cursor(CursorType new_cursor);

    std::map<CursorType, SDL_Cursor*> cache;
};

}


text:
package graph;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Ignacio Arnaldo
 * modified by Pranav Batra
 */
public class Graph {

    Map<Coordinates,Node> graphMap;
    private long nodeCounter;
    private double minX,maxX,minY,maxY;

    /**
     * Constructor
     */
    public Graph(){
        graphMap = new HashMap<>();
        nodeCounter = 0;
    }

    /**
     * whether an edge lies within the pre-fix map area
     * @param anEdge
     * @return isWithinRange flag
     */
    public boolean isWithinRange(Edge anEdge){
        boolean inRange = false;
        Coordinates coordsFrom = anEdge.getCoordsFrom();
        Coordinates coordsTo = anEdge.getCoordsTo();
        if(coordsFrom.getCoordX()<=maxX && coordsFrom.getCoordX()>=minX && coordsFrom.getCoordY()<=maxY && coordsFrom.getCoordY()>=minY
            &&  coordsTo.getCoordX()<=maxX && coordsTo.getCoordX()>=minX && coordsTo.getCoordY()<=maxY && coordsTo.getCoordY()>=minY){
            inRange = true;
        }
        return inRange;
    }

    /**
     * Add edge and 2 nodes to the graph. We check whether the node alreay
     * exists.
     * @param anEdge
     */
    public void addNodesAndEdge(Edge anEdge){
        Coordinates coordsFrom = anEdge.getCoordsFrom();
        Coordinates coordsTo = anEdge.getCoordsTo();
        if (graphMap.containsKey(coordsFrom)){
            if (graphMap.containsKey(coordsTo)){
                Node nodeFrom = graphMap.get(coordsFrom);
                ArrayList<Edge> listAux = nodeFrom.getEdges();

                Node nodeTo = graphMap.get(coordsTo);
                anEdge.setNodeIDto(nodeTo.getNodeID());
                listAux.add(anEdge);
            }else{
                Node nodeFrom = graphMap.get(coordsFrom);
                ArrayList<Edge> listAux = nodeFrom.getEdges();

                Node nodeTo = new Node(/*coordsTo.getCoordX(),coordsTo.getCoordY(),*/nodeCounter);
                nodeCounter++;
                graphMap.put(coordsTo, nodeTo);

                anEdge.setNodeIDto(nodeTo.getNodeID());
                listAux.add(anEdge);
            }
        }else{
            if (graphMap.containsKey(coordsTo)){
                Node nodeFrom = new Node(/*coordsFrom.getCoordX(),coordsFrom.getCoordY(),*/nodeCounter);
                nodeCounter++;
                graphMap.put(coordsFrom, nodeFrom);
                ArrayList<Edge> listAux = nodeFrom.getEdges();

                Node nodeTo = graphMap.get(coordsTo);

                anEdge.setNodeIDto(nodeTo.getNodeID());
                listAux.add(anEdge);
            }else{
                Node nodeFrom = new Node(/*coordsFrom.getCoordX(),coordsFrom.getCoordY(),*/nodeCounter);
                nodeCounter++;
                graphMap.put(coordsFrom, nodeFrom);
                ArrayList<Edge> listAux = nodeFrom.getEdges();

                Node nodeTo = new Node(/*coordsTo.getCoordX(),coordsTo.getCoordY(),*/nodeCounter);
                nodeCounter++;
                graphMap.put(coordsTo, nodeTo);

                anEdge.setNodeIDto(nodeTo.getNodeID());
                listAux.add(anEdge);
            }
        }
    }

    /**
     * Returns the roads graph as a Map object
     * @return graphMap
     */
    public Map<Coordinates,Node> getMap(){
        return graphMap;
    }

    /**
     * set maximum X coordinate
     * @param aMaxX
     */
    public void setMaxX(double aMaxX){
        maxX = aMaxX;
    }

    /**
     * Set minimum X coordinate
     * @param aMinX
     */
    public void setMinX(double aMinX){
        minX = aMinX;
    }

    /**
     * set maximum X coordinate
     * @param aMaxY
     */
    public void setMaxY(double aMaxY){
        maxY = aMaxY;
    }

    /**
     * set minimum Y coordinate
     * @param aMinY
     */
    public void setMinY(double aMinY){
        minY = aMinY;
    }

}


text:
extern "C" {
#endif

  //! returns the descriptor of a serial port
  int serial_open(const char* name);

  //! sets the attributes
  int serial_set_interface_attribs (int fd, int speed, int parity);

  //! puts the port in blocking/nonblocking mode
  void serial_set_blocking (int fd, int should_block);

  //! write on the serial port
  int serial_write(int fd, const char* buffer, int len);

  //! reads from the serial port (timeout is in seconds): return -1 means timeout, return 0 means disconnection, otherwise the number of bytes read is returned
  int serial_read(int fd, char* buffer, int len, double timeout);

  //! reads a line from the serial port (timeout is in seconds): return -1 means timeout, return 0 means disconnection, otherwise the number of bytes read is returned
  int serial_readline(int fd, char* buffer, int len, double timeout);

#ifdef __cplusplus
}
#endif


text:
/*
 * test_training.cpp
 *
 *  Created on: Mar 9, 2012
 *      Author: aitor
 */
#include <pcl/pcl_macros.h>
//#include <pcl/apps/3d_rec_framework/pipeline/global_nn_classifier.h>
//#include "cus_global_nn_classifier.h"
//#include <pcl/apps/3d_rec_framework/pipeline/global_nn_recognizer_cvfh.h>
#include "cus_global_nn_recognizer_ourcvfh.h"
#include <pcl/apps/3d_rec_framework/pc_source/mesh_source.h>
//#include <pcl/apps/3d_rec_framework/feature_wrapper/global/vfh_estimator.h>
//#include <pcl/apps/3d_rec_framework/feature_wrapper/global/esf_estimator.h>
//#include <pcl/apps/3d_rec_framework/feature_wrapper/global/cvfh_estimator.h>
//#include <pcl/apps/3d_rec_framework/feature_wrapper/global/ourcvfh_estimator.h>
#include "cus_ourcvfh_estimator.h"
//#include <pcl/apps/3d_rec_framework/tools/openni_frame_source.h>
#include <pcl/apps/3d_rec_framework/utils/metrics.h>
//#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/apps/dominant_plane_segmentation.h>
#include <pcl/console/parse.h>
#include <pcl/console/time.h>
#include "pcl_ros/point_cloud.h"
#include "geometries.hpp"
#include "ros/ros.h"
#include <dynamic_reconfigure/server.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pwd.h>
#include <visualization_msgs/Marker.h>
#include <visualization_msgs/MarkerArray.h>
#include <geometry_msgs/Point.h>
#include <pcl/recognition/hv/hypotheses_verification.h>
#include <pcl/recognition/hv/hv_go.h>
#include "fast_segmentation.hpp"
#include <object_vision/recognitionConfig.h>

#define VISUALIZE_BB
#define VISUALIZE_MODEL
#define SAVE_PCD

typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<pcl::PointXYZ> CloudType;

// testing branch is working on our-cvfh
//static pcl::rec_3d_framework::GlobalNNCVFHPipeline<Metrics::HistIntersectionUnionDistance, PointType, pcl::VFHSignature308> global;
static cus_rec_3d_framework::GlobalNNCVFHRecognizer<Metrics::HistIntersectionUnionDistance, PointType, pcl::VFHSignature308> global;
ros::Publisher marker_pub;
ros::Publisher model_pub;
static size_t prev_marker_size;
static cus_obj_seg::FastObjectSegmentation cus_dps;
static pcl::apps::DominantPlaneSegmentation<PointType> dps;
static bool useCustSegmentation;

static object_vision::recognitionConfig last_config;

//static struct settings
//{
//    bool cus_seg;
//    float leaf_size;
//    float cluster_tolerance;
//    float min_angle;
//    float max_angle;
//    float cluster_tolerance;
//    float min_cluster_size;
//    float object_min_height;
//    float

//};

void cfg_cb(object_vision::recognitionConfig &config, uint32_t level) {
    ROS_INFO("Reconfigure Request:");
    //  ROS_INFO("Reconfigure Request: %d %f %s %s %d",
//            config.int_param, config.double_param,
//            config.str_param.c_str(),
//            config.bool_param?"True":"False",
//            config.size);
    useCustSegmentation = config.use_custom_dps;

    cus_dps.setLeafSize(config.downsample_size);
    dps.setDownsamplingSize(config.downsample_size);

    cus_dps.setMinAngle(config.min_angle);
    cus_dps.setMaxAngle(config.max_angle);

    cus_dps.setClusterTolerance(config.cluster_tolerance);
    dps.setDistanceBetweenClusters(config.cluster_tolerance);

    cus_dps.setMinClusterSize(config.min_cluster_size);
    dps.setMinClusterSize(config.min_cluster_size);

    cus_dps.setMinObjectDistance(config.object_min_height);
    dps.setObjectMinHeight(config.object_min_height);

    cus_dps.setMaxObjectDistance(config.object_max_height);
    dps.setObjectMaxHeight(config.object_max_height);

    global.setICPIterations(config.icp_iterations);

    last_config = config;

    // will force a retrain if new angle is different
    //global.setEpsAngle(config.epsilon_angle_thresh / (180 * M_PI)); // 5 degrees);
}

void clearOldMarkers(std::string frame_id, size_t num_markers, std::string ns1, std::string ns2)
{

pcl::ScopeTime cluster_process_time ("Deleting old markers ------------------ ");
  visualization_msgs::MarkerArray del_marker_array;
  for (int id=0; id < num_markers; id++)
    {
      visualization_msgs::Marker delete_obj_marker;
      delete_obj_marker.header.stamp = ros::Time::now();
      delete_obj_marker.header.frame_id = frame_id;
      delete_obj_marker.id = id;
      delete_obj_marker.action = visualization_msgs::Marker::DELETE;
      delete_obj_marker.ns = ns1;
      del_marker_array.markers.push_back(delete_obj_marker);

      visualization_msgs::Marker delete_text_marker;
      delete_text_marker.header.stamp = ros::Time::now();
      delete_text_marker.header.frame_id = frame_id;
      delete_text_marker.id = id;
      delete_text_marker.action = visualization_msgs::Marker::DELETE;
      delete_text_marker.ns = ns2;
      del_marker_array.markers.push_back(delete_text_marker);

    }
  marker_pub.publish(del_marker_array);
}

void
segmentAndClassify_cb (const sensor_msgs::PointCloud2ConstPtr& cloud_msg)
{
    //bool useCustSegmentation = false;

    // Set our initial shape type to be a cube
    uint32_t shape = visualization_msgs::Marker::CUBE;

    visualization_msgs::MarkerArray marker_array;
    std::string marker_ns_obj = "object";
    std::string marker_ns_text = "object_desc";
    std::string frame_id = global.getFrameID();

    pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_scene (new pcl::PointCloud<pcl::PointXYZRGB>);
    pcl::fromROSMsg(*cloud_msg, *cloud_scene);
    cloud_scene->is_dense = false;

    float Z_DIST_ = 1.5f;
    float text_scale = 0.02f;
    float distance_thresh = 0.43f;

    pcl::ScopeTime frame_process ("Global frame processing ------------- ");
    //frame = camera.snap ();
    CloudType::Ptr xyz_points (new CloudType);
    pcl::copyPointCloud (*cloud_scene, *xyz_points);

//std::cout << "Removing color from scene, width: " << xyz_points->width << "height: " << xyz_points->height << " IsDense: " << cloud_scene->is_dense << std::endl;

    pcl::console::TicToc tt_seg;
    tt_seg.tic();

    //Step 1 -> Segment

    std::vector<CloudType::Ptr> clusters;
    std::vector<pcl::PointIndices> indices;
    if(useCustSegmentation){
        std::cout << " ---- using custom object segmentation pipeline ----" << std::endl;
        cus_dps.setInputCloud(xyz_points);
        cus_dps.compute(clusters);
        cus_dps.getClusterIndices(indices);

    }
    else
    {

        pcl::apps::DominantPlaneSegmentation<PointType> l_dps;
        std::cout << " ---- using pcl app object segmentation pipeline ----" << std::endl;
        l_dps.setInputCloud (xyz_points);
        l_dps.setMaxZBounds (Z_DIST_);
        l_dps.setObjectMinHeight (0.02);
        l_dps.setMinClusterSize (50);
        l_dps.setWSize (9);
        l_dps.setDistanceBetweenClusters (0.25f);
        l_dps.setObjectMaxHeight(0.5);
        l_dps.setDownsamplingSize (0.02f);

        std::cout << "object_min_height: " << last_config.object_min_height << std::endl;
        l_dps.setObjectMinHeight (last_config.object_min_height);
        std::cout << "min_cluster_size" << last_config.min_cluster_size << std::endl;
        l_dps.setMinClusterSize (last_config.min_cluster_size);
        l_dps.setWSize (9);
        std::cout << "cluster_tolerance" << last_config.cluster_tolerance << std::endl;
        l_dps.setDistanceBetweenClusters (last_config.cluster_tolerance);
        std::cout << "object_max_height" << last_config.object_max_height << std::endl;
        l_dps.setObjectMaxHeight(last_config.object_max_height);
        std::cout << "downsample_size" << last_config.downsample_size << std::endl;
        l_dps.setDownsamplingSize (last_config.downsample_size);
        l_dps.compute_fast (clusters);
        l_dps.getIndicesClusters (indices);
        //std::cout << "Indicies recieved: " << indices.empty() << std::endl;
        //Eigen::Vector4f table_plane_;
        //dps.getTableCoefficients (table_plane_);
        //Eigen::Vector3f normal_plane_ = Eigen::Vector3f (table_plane_[0], table_plane_[1], table_plane_[2]);

    }

    std::cout << "[Segmentation done, " << tt_seg.toc() << " ms] \n";

    pcl::console::TicToc tt;
    tt.tic();

    size_t cur_marker_size = 0;
    CloudType::Ptr models_out (new CloudType);
    std::cout << "Indicies size " << indices.size() << " Clusters size " << clusters.size() << std::endl;
    for (size_t i = 0; i < clusters.size (); i++)
    {

#ifdef SAVE_PCD
        pcl::PCDWriter writer;
        std::stringstream obj_file_name;
        obj_file_name << "cloud_objects_" << i << "_cus_seg_" << useCustSegmentation << ".pcd";
        std::cout << "Saving cluster cloud as " << obj_file_name.str() << std::endl;
//        CloudType::Ptr cluster_to_save (new CloudType);
//        pcl::copyPointCloud(*clusters[i], *cluster_to_save);
        writer.write<PointType>(obj_file_name.str(), *clusters[i], false);
#endif

        std::ostringstream prob_str;
        prob_str.precision (4);

        std::stringstream clus_proc_time_str;
        clus_proc_time_str << "Catagorized cluster " << i << " --------";
        pcl::ScopeTime cluster_process_time (clus_proc_time_str.str().c_str());
//std::cout << "working on " << i << "th cluster" << std::endl;
        std::stringstream cluster_name;
        cluster_name << "cluster_" << i;
        global.setInputCloud (xyz_points);
        global.setIndices (indices[i].indices);
        //global.classify ();
        global.recognize();

        //std::vector < std::string > categories;
        std::vector<float> dists;
        boost::shared_ptr<std::vector<pcl::rec_3d_framework::Model<PointType> > > models;
        boost::shared_ptr<std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > > transforms;

        global.getDescriptorDistances(dists);
std::cout << "Total number of distances: " << dists.size() << std::endl;
        models = global.getModels();
std::cout << "Total number of models: " << models->size() << std::endl;
        transforms = global.getTransforms();
std::cout << "Total number of transforms: " << transforms->size() << std::endl;

        CloudType::Ptr transform_cloud(new CloudType);
        if(models->size() > 0)
        {
            //pcl::ScopeTime model_grab_process ("Grabbing model ------------- ");
            pcl::rec_3d_framework::Model<PointType> best_model = (*models).at(0);
            prob_str << "Best match: Model ID: " << best_model.id_ << ", in class: " << best_model.class_<< ", at distance " << dists[0] << std::endl;
            if(dists[0] < distance_thresh)
            {
                pcl::ScopeTime transforming_process ("Found Match -> Transforming model ------------- ");
                pcl::transformPointCloud(*best_model.getAssembled(0.01f), *transform_cloud, (*transforms)[0]);
                *models_out += *transform_cloud;
#ifdef VISUALIZE_BB
                if(global.getCreateModelBoxes())
                {
                    PointType centroid;
                    pcl::computeCentroid(*transform_cloud, centroid);
                    boost::shared_ptr<c44::BoundingBox> obj_box = global.getBoundingBoxOfModel(best_model.id_); //(clusters[i], frame_id, prob_str.str(), i, marker_ns_obj, marker_ns_text);
                    // std::cout << "Inside loop, Marker " << i << " type: " << obj_box.text_marker.type << std::endl;
                    obj_box->text_marker.text = prob_str.str();
                    obj_box->transform_Markers((*transforms)[0], centroid);
                    marker_array.markers.push_back(obj_box->obj_marker);
                    marker_array.markers.push_back(obj_box->text_marker);
                    cur_marker_size += 2;
                }
#endif
            }
        }
    }

#ifdef VISUALIZE_MODEL
    if(models_out->size() > 0)
    {
        sensor_msgs::PointCloud2::Ptr model_msg (new sensor_msgs::PointCloud2);
        pcl::toROSMsg(*models_out, *model_msg);
        model_msg->header.frame_id = frame_id;
        model_msg->header.stamp = ros::Time::now();
        model_pub.publish(*model_msg);

#ifdef VISUALIZE_BB
std::cout << "Previous Marker size: " << prev_marker_size << ", Current Marker size: " << cur_marker_size << std::endl;

        clearOldMarkers(frame_id, prev_marker_size, marker_ns_obj, marker_ns_text);
std::cout << "Number of markers to publish" << marker_array.markers.size() << endl;
        marker_pub.publish(marker_array);

        prev_marker_size = marker_array.markers.size();
#endif
    }
#endif

    std::cout << "[Classification done, " << tt.toc() << " ms] \n";
std::cout << "Objects segmented: " << clusters.size() << std::endl;
}

int
main (int argc, char ** argv)
{
    prev_marker_size = 0;
    const char* home = getenv("HOME");

    if(!home){
        std::cerr << "Can't find home directory";
    }
    std::string home_path(home);

    //std::string scene_path = "scene.pcd";
    std::string model_dir = home_path + "/model_db/models"; //home_path + "/catkin_ws/src/object_vision_3D/classification/models";
    std::string desc_name = "our-cvfh";
    std::string training_dir = home_path + "/model_db/trained_models"; //home_path + "/catkin_ws/src/object_vision_3D/classification/trained_models";
    std::string frame_id = "camera_depth_optical_frame";
    int NN = 10;

    // set defaults for object segmentation
    useCustSegmentation = false;
    cus_dps.setLeafSize(0.02);
    cus_dps.setNeighbors_to_analyze(20);
    cus_dps.setStdDeviation(1.0);
    cus_dps.setMinAngle(0);
    cus_dps.setMaxAngle(1.57);
    cus_dps.setRansacIterations(1000);
    cus_dps.setThresholdDistance(0.01);
    cus_dps.setMinObjectDistance(0.02);
    cus_dps.setMaxObjectDistance(0.5);
    cus_dps.setClusterTolerance(0.05);
    cus_dps.setMinClusterSize(20);
    cus_dps.setMaxClusterSize(1000);

    ros::init(argc, argv, "quanta_obj_seg");
    ros::NodeHandle nh;
    ros::NodeHandle priv_nh;

    //pcl::console::parse_argument (argc, argv, "-scene_path", scene_path);
    //pcl::console::parse_argument (argc, argv, "-models_dir", path);
    //pcl::console::parse_argument (argc, argv, "-training_dir", training_dir);
    //pcl::console::parse_argument (argc, argv, "-descriptor_name", desc_name);
    //pcl::console::parse_argument (argc, argv, "-nn", NN);

    //pcl::console::parse_argument (argc, argv, "-z_dist", chop_at_z_);
    //pcl::console::parse_argument (argc, argv, "-tesselation_level", views_level_);

    boost::shared_ptr<pcl::rec_3d_framework::MeshSource<PointType> > mesh_source (new pcl::rec_3d_framework::MeshSource<PointType>);
    mesh_source->setPath (model_dir);
    mesh_source->setResolution (150);
    mesh_source->setTesselationLevel (1);
    mesh_source->setViewAngle (57.f);
    mesh_source->setRadiusSphere (1.5f);
    mesh_source->setModelScale (1.f);
    mesh_source->generate (training_dir);

    boost::shared_ptr<pcl::rec_3d_framework::Source<PointType> > cast_source;
    cast_source = boost::static_pointer_cast<pcl::rec_3d_framework::MeshSource<PointType> > (mesh_source);

    boost::shared_ptr<pcl::rec_3d_framework::PreProcessorAndNormalEstimator<PointType, pcl::Normal> > normal_estimator;
    normal_estimator.reset (new pcl::rec_3d_framework::PreProcessorAndNormalEstimator<PointType, pcl::Normal>);
    //normal_estimator->normal_radius_ = 0.03;
    normal_estimator->setCMR (true);
    normal_estimator->setDoVoxelGrid (true);
    normal_estimator->setRemoveOutliers (true);
    normal_estimator->setFactorsForCMR (3, 7);
    //normal_estimator->setCMR(false);
    //normal_estimator->setValuesForCMRFalse(0.005f, 0.03f);

    boost::shared_ptr<cus_rec_3d_framework::OURCVFHEstimator<PointType, pcl::VFHSignature308> > ourcvfh_estimator;
    ourcvfh_estimator.reset (new cus_rec_3d_framework::OURCVFHEstimator<PointType, pcl::VFHSignature308>);
    ourcvfh_estimator->setNormalEstimator (normal_estimator);
    float eps_angle_thresh = 20 / (180 * M_PI); // 5 degrees
    ourcvfh_estimator->setCVFHParams(eps_angle_thresh, 1.0f, 6.f);
    ourcvfh_estimator->setMinPoints(10);
    //ourcvfh_estimator->setRefineClustersParam();
    //ourcvfh_estimator->setAdaptativeMLS(true);

//    boost::shared_ptr<pcl::GlobalHypothesesVerification<pcl::PointXYZ, pcl::PointXYZ> > global_hv (
//                                                                                new pcl::GlobalHypothesesVerification<pcl::PointXYZ,
//                                                                                pcl::PointXYZ>);
//    //boost::shared_ptr<pcl::HypothesisVerification<PointType, PointType> > global_hv;
//    global_hv->setResolution(0.01f);
//    global_hv->setDetectClutter(true);
//    global_hv->setRadiusClutter(0.10f);
//    global_hv->setInlierThreshold(0.01f);
//    global_hv->setRegularizer(3.0f);
//    global_hv->setClutterRegularizer(7.5f);
//    global_hv->setOcclusionThreshold(0.01f);
//    global_hv->setMaxIterations(5000);

//    boost::shared_ptr<pcl::HypothesisVerification<pcl::PointXYZ, pcl::PointXYZ> > cast_hv_alg;
//    cast_hv_alg = boost::static_pointer_cast<pcl::HypothesisVerification<pcl::PointXYZ, pcl::PointXYZ> > (global_hv);

    //boost::shared_ptr<pcl::rec_3d_framework::GlobalEstimator<PointType, pcl::VFHSignature308> > cast_estimator;
    //cast_estimator = boost::dynamic_pointer_cast<pcl::rec_3d_framework::OURCVFHEstimator<PointType, pcl::VFHSignature308> > (ourcvfh_estimator);
    global.setFrameID(frame_id);
    global.setICPIterations(0);
    global.setCreateModelBoxes(true);
    global.setDataSource (cast_source);
    global.setTrainingDir (training_dir);
    global.setModelDir(model_dir);
    global.setDescriptorName (desc_name);
    global.setFeatureEstimator (ourcvfh_estimator);
    global.setNN (NN);
//    global.setHVAlgorithm(cast_hv_alg);

    dynamic_reconfigure::Server<object_vision::recognitionConfig> server;
    dynamic_reconfigure::Server<object_vision::recognitionConfig>::CallbackType f;

    f = boost::bind(&cfg_cb, _1, _2);
    server.setCallback(f);

    global.initialize (false);

    std::string sub_topic = nh.resolveName("camera/depth/points");
    std::string pub_topic = nh.resolveName("obj_marker");
    uint32_t queue_size = 1;

    // to create a subscriber, you can do this (as above):
    ros::Subscriber sub = nh.subscribe<sensor_msgs::PointCloud2> (sub_topic, queue_size, segmentAndClassify_cb);

    marker_pub = nh.advertise<visualization_msgs::MarkerArray>("visualization_marker", 1);
    model_pub = nh.advertise<sensor_msgs::PointCloud2>("visualization_model", 1);

    ros::spin();

    return 0;
}


text:
struct DeviceDependentObjects;
class PP_FXAA;
class PostProcessing
{

public:
	static PostProcessing* Instance;
	static void StartUp();
	static void ShutDown();
	PostProcessing();
	~PostProcessing();
	void Update();
	std::vector<PostProcessEffectBase*> Effects;
	void AddEffect(PostProcessEffectBase* effect);
	void ExecPPStack(FrameBuffer* Target, RHICommandList* CommandList);
	void Init(FrameBuffer* Target);
	void Resize(FrameBuffer * Target);
	static PostProcessing* Get();
	//void AddCompostPass(FrameBuffer* buffer);
	class PP_ColourCorrect* ColourCorrect = nullptr;
	class PP_Blur* Blur = nullptr;
	class PP_Bloom* Bloom = nullptr;
	class PP_SSAO* SSAO = nullptr;
	class PP_Debug* Debug = nullptr;
	FrameBuffer* Gbuffer = nullptr;
private:
	PP_FXAA* FXAA = nullptr;
};


text:
@implementation UIImage (HMJOriginalImage)
+ (instancetype)imageWithOriginalWithImageName:(NSString *)imageName
{
    UIImage *image = [UIImage imageNamed:imageName];
    return [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
@end


text:
package mysql

import (
	"database/sql"
	"fmt"
	"log"
	"strings"

	"strconv"

	_ "github.com/go-sql-driver/mysql"
	"github.com/oliread/secretshop"
)

type processedReplay struct {
	GameID        uint64
	GameStart     float32
	GameEnd       float32
	StrategyStart float32
	Players       string
	Heroes        string
	FriendlyName  string
}

// Store implementation of secretshop.Store
type Store struct {
	db *sql.DB
}

// NewStore handles creating a store and connecting to a database with information
// from a config file
func NewStore(c *secretshop.Config, data secretshop.ConfigDBInfo) (err error) {
	connString := data.Address
	connPort := strconv.Itoa(data.Port)
	if connPort != "0" {
		connString = strings.Join([]string{data.Address, connPort}, ":")
	}

	connInfo := fmt.Sprintf("%s:%s@tcp(%s)/%s", data.User, data.Pass, connString, data.DB)
	db, err := sql.Open("mysql", connInfo)
	if err != nil {
		return err
	}

	if err := db.Ping(); err != nil {
		return err
	}

	c.Stores["mysql"] = Store{
		db: db,
	}

	return nil
}

// SaveItemPurchase implementation for secretshop.Store
func (s Store) SaveItemPurchase(i *secretshop.ItemPurchase) error {
	stmt, err := s.db.Prepare("INSERT item_purchase SET gameId=?,steamId=?,hero=?,item=?,timestamp=?")
	if err != nil {
		return err
	}
	defer stmt.Close()

	if _, err := stmt.Exec(i.GameID, i.SteamID, i.Hero, i.Item, i.Timestamp); err != nil {
		return err
	}

	return nil
}

// LoadItemPurchase implementation for secretshop.Store
func (s Store) LoadItemPurchase(filters map[string]interface{}) (i []secretshop.ItemPurchase, err error) {
	query := "SELECT * FROM item_purchase"
	conditions := []string{}
	args := []interface{}{}

	if gameIDs, ok := filters["gameId"]; ok {
		vars := make([]string, len(gameIDs.([]uint64)))
		for i, gameID := range gameIDs.([]uint64) {
			vars[i] = "?"
			args = append(args, gameID)
		}
		gameList := strings.Join(vars, ",")
		conditions = append(conditions, "gameId IN ("+gameList+")")
	}

	if players, ok := filters["player"]; ok {
		vars := make([]string, len(players.([]uint64)))
		for i, player := range players.([]uint64) {
			vars[i] = "?"
			args = append(args, player)
		}
		playerList := strings.Join(vars, ",")
		conditions = append(conditions, "steamId IN ("+playerList+")")
	}

	if heroes, ok := filters["hero"]; ok {
		vars := make([]string, len(heroes.([]string)))
		for i, hero := range heroes.([]string) {
			vars[i] = "?"
			args = append(args, hero)
		}
		heroList := strings.Join(vars, ",")
		conditions = append(conditions, "hero IN ("+heroList+")")
	}

	if items, ok := filters["item"]; ok {
		vars := make([]string, len(items.([]string)))
		for i, item := range items.([]string) {
			vars[i] = "?"
			args = append(args, item)
		}
		itemList := strings.Join(vars, ",")
		conditions = append(conditions, "item IN ("+itemList+")")
	}

	var rows *sql.Rows
	if len(filters) > 0 {
		where := strings.Join(conditions, " AND ")
		query = strings.Join([]string{query, where}, " WHERE ")
		rows, err = s.db.Query(query, args...)
		if err != nil {
			return nil, err
		}
	} else {
		rows, err = s.db.Query(query)
		if err != nil {
			return nil, err
		}
	}

	for rows.Next() {
		var (
			gameID    uint64
			steamID   uint64
			hero      string
			item      string
			timestamp float32
		)
		err := rows.Scan(&gameID, &steamID, &hero, &item, &timestamp)
		if err != nil {
			return nil, err
		}
		purchase := secretshop.ItemPurchase{
			GameID:    gameID,
			SteamID:   steamID,
			Hero:      hero,
			Item:      item,
			Timestamp: timestamp,
		}
		i = append(i, purchase)
	}

	return i, nil
}

// SaveReplayInfo implementation for secretshop.Store
func (s Store) SaveReplayInfo(r *secretshop.Replay) error {
	p := processReplay(r)
	stmt, err := s.db.Prepare("INSERT replay_info SET gameId=?,strategyStart=?,gameStart=?,gameEnd=?,players=?,heroes=?")
	if err != nil {
		return err
	}
	defer stmt.Close()

	if _, err := stmt.Exec(p.GameID, p.StrategyStart, p.GameStart, p.GameEnd, p.Players, p.Heroes); err != nil {
		return err
	}

	return nil
}

// LoadReplayInfo implementation for secretshop.Store
func (s Store) LoadReplayInfo(gameIDs []uint64) (map[uint64]secretshop.Replay, error) {
	r := secretshop.Replay{}
	vars := make([]string, len(gameIDs))
	args := make([]interface{}, len(gameIDs))

	for i := 0; i < len(gameIDs); i++ {
		vars[i] = "?"
		args[i] = gameIDs[i]
	}

	query := "SELECT * FROM replay_info"
	if len(gameIDs) > 0 {
		query = "SELECT * FROM replay_info WHERE gameId IN (" + strings.Join(vars, ",") + ")"
	}

	log.Printf("GameIds: %+v", gameIDs)
	log.Printf("Query: %s", query)
	log.Printf("Args: %+v", args)

	rows, err := s.db.Query(query, args...)
	if err != nil {
		return nil, err
	}

	replays := make(map[uint64]secretshop.Replay)
	for rows.Next() {
		var (
			id            uint64
			strategyStart float32
			gameStart     float32
			gameEnd       float32
			players       string
			heroes        string
			friendlyName  string
		)
		rows.Scan(&id, &strategyStart, &gameStart, &gameEnd, &players, &heroes, &friendlyName)
		playerInfo := strings.Split(players, ",")
		heroInfo := strings.Split(heroes, ",")
		r.GameID = id
		r.StrategyStart = strategyStart
		r.GameStart = gameStart
		r.GameEnd = gameEnd
		r.Players = make(map[string]uint64)
		r.FriendlyName = friendlyName
		for i := 0; i < len(playerInfo); i++ {
			player, err := strconv.ParseUint(playerInfo[i], 10, 64)
			if err != nil {
				return nil, err
			}

			r.Players[heroInfo[i]] = player
		}
		replays[id] = r
	}

	return replays, nil
}

// SaveReplayInfoFriendlyName implementation for secretshop.Store
func (s Store) SaveReplayInfoFriendlyName(gameID uint64, friendlyName string) error {
	stmt, err := s.db.Prepare("UPDATE replay_info SET friendlyName=? WHERE gameId=?")
	if err != nil {
		return err
	}
	defer stmt.Close()

	if _, err := stmt.Exec(friendlyName, gameID); err != nil {
		return err
	}

	return nil
}

// SavePlayerInfo implementation for secretshop.Store
func (s Store) SavePlayerInfo(p *secretshop.PlayerInfo) error {
	stmt, err := s.db.Prepare("INSERT player_info SET steamId=?,team=?,name=?")
	if err != nil {
		return err
	}
	defer stmt.Close()

	if _, err := stmt.Exec(p.SteamID, p.Team, p.Name); err != nil {
		return err
	}

	return nil
}

// LoadPlayerInfo implementation for secretshop.Store
func (s Store) LoadPlayerInfo() (p map[uint64]secretshop.PlayerInfo, err error) {
	playerInfo := make(map[uint64]secretshop.PlayerInfo)
	rows, err := s.db.Query("SELECT * FROM player_info")
	if err != nil {
		return nil, err
	}

	for rows.Next() {
		var (
			steamID uint64
			team    string
			name    string
		)

		if err := rows.Scan(&steamID, &team, &name); err != nil {
			return nil, err
		}

		player := secretshop.PlayerInfo{
			SteamID: steamID,
			Team:    team,
			Name:    name,
		}

		playerInfo[steamID] = player
	}

	return playerInfo, nil
}

func processReplay(r *secretshop.Replay) (p processedReplay) {
	p = processedReplay{
		GameID:        r.GameID,
		GameStart:     r.GameStart,
		GameEnd:       r.GameEnd,
		StrategyStart: r.StrategyStart,
	}

	index := 0
	heroes := make([]string, len(r.Players))
	players := make([]string, len(r.Players))
	for hero, player := range r.Players {
		heroes[index] = hero
		players[index] = strconv.FormatUint(player, 10)
		index++
	}

	p.Heroes = strings.Join(heroes, ",")
	p.Players = strings.Join(players, ",")
	return p
}


text:
package com.egopulse.web.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Indicate the method or all methods in the type execution times will be long and need to be processed with a
 * dedicated worker
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ResponseNext {
}