text:
package org.gradle.api.internal.artifacts.ivyservice.ivyresolve;

import org.gradle.api.Transformer;
import org.gradle.api.artifacts.component.ComponentIdentifier;
import org.gradle.api.artifacts.component.ModuleComponentIdentifier;
import org.gradle.api.internal.artifacts.repositories.resolver.MetadataFetchingCost;
import org.gradle.internal.component.external.model.ModuleComponentResolveMetadata;
import org.gradle.internal.component.model.ComponentOverrideMetadata;
import org.gradle.internal.resolve.ModuleVersionResolveException;
import org.gradle.internal.resolve.resolver.ComponentMetaDataResolver;
import org.gradle.internal.resolve.result.BuildableComponentResolveResult;
import org.gradle.internal.resolve.result.BuildableModuleComponentMetaDataResolveResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

public class RepositoryChainComponentMetaDataResolver implements ComponentMetaDataResolver {
    private static final Logger LOGGER = LoggerFactory.getLogger(RepositoryChainComponentMetaDataResolver.class);

    private final List<ModuleComponentRepository> repositories = new ArrayList<ModuleComponentRepository>();
    private final List<String> repositoryNames = new ArrayList<String>();
    private final VersionedComponentChooser versionedComponentChooser;
    private final Transformer<ModuleComponentResolveMetadata, RepositoryChainModuleResolution> metaDataFactory;

    public RepositoryChainComponentMetaDataResolver(VersionedComponentChooser componentChooser, Transformer<ModuleComponentResolveMetadata, RepositoryChainModuleResolution> metaDataFactory) {
        this.versionedComponentChooser = componentChooser;
        this.metaDataFactory = metaDataFactory;
    }

    public void add(ModuleComponentRepository repository) {
        repositories.add(repository);
        repositoryNames.add(repository.getName());
    }

    public void resolve(ComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
        if (!(identifier instanceof ModuleComponentIdentifier)) {
            throw new UnsupportedOperationException("Can resolve meta-data for module components only.");
        }

        resolveModule((ModuleComponentIdentifier) identifier, componentOverrideMetadata, result);
    }

    @Override
    public boolean isFetchingMetadataCheap(ComponentIdentifier identifier) {
        if (identifier instanceof ModuleComponentIdentifier) {
            for (ModuleComponentRepository repository : repositories) {
                ModuleComponentRepositoryAccess localAccess = repository.getLocalAccess();
                MetadataFetchingCost fetchingCost = localAccess.estimateMetadataFetchingCost((ModuleComponentIdentifier) identifier);
                if (fetchingCost.isFast()) {
                    return true;
                } else if (fetchingCost.isExpensive()) {
                    return false;
                }
            }
        }
        return true;
    }

    private void resolveModule(ModuleComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
        LOGGER.debug("Attempting to resolve component for {} using repositories {}", identifier, repositoryNames);

        List<ComponentMetaDataResolveState> resolveStates = new ArrayList<ComponentMetaDataResolveState>();
        for (ModuleComponentRepository repository : repositories) {
            resolveStates.add(new ComponentMetaDataResolveState(identifier, componentOverrideMetadata, repository, versionedComponentChooser));
        }

        try {
            final RepositoryChainModuleResolution latestResolved = findBestMatch(resolveStates);
            if (latestResolved == null) {
                for (ComponentMetaDataResolveState resolveState : resolveStates) {
                    resolveState.applyTo(result);
                }
                result.notFound(identifier);
            } else {
                LOGGER.debug("Using {} from {}", latestResolved.module.getId(), latestResolved.repository);
                result.resolved(metaDataFactory.transform(latestResolved));
            }
        } catch (Throwable error) {
            result.failed(new ModuleVersionResolveException(identifier, error));
        }
    }

    private RepositoryChainModuleResolution findBestMatch(List<ComponentMetaDataResolveState> resolveStates) throws Throwable {
        LinkedList<ComponentMetaDataResolveState> queue = new LinkedList<ComponentMetaDataResolveState>();
        queue.addAll(resolveStates);

        LinkedList<ComponentMetaDataResolveState> missing = new LinkedList<ComponentMetaDataResolveState>();

        // A first pass to do local resolves only
        RepositoryChainModuleResolution best = findBestMatch(queue, missing);
        if (best != null) {
            return best;
        }

        // Nothing found locally - try a remote search for all resolve states that were not yet searched remotely
        queue.addAll(missing);
        missing.clear();
        return findBestMatch(queue, missing);
    }

    private RepositoryChainModuleResolution findBestMatch(LinkedList<ComponentMetaDataResolveState> queue, Collection<ComponentMetaDataResolveState> missing) throws Throwable {
        RepositoryChainModuleResolution best = null;
        while (!queue.isEmpty()) {
            ComponentMetaDataResolveState request = queue.removeFirst();
            BuildableModuleComponentMetaDataResolveResult metaDataResolveResult;
            metaDataResolveResult = request.resolve();
            switch (metaDataResolveResult.getState()) {
                case Failed:
                    throw metaDataResolveResult.getFailure();
                case Missing:
                    // Queue this up for checking again later
                    if (request.canMakeFurtherAttempts()) {
                        missing.add(request);
                    }
                    break;
                case Resolved:
                    RepositoryChainModuleResolution moduleResolution = new RepositoryChainModuleResolution(request.repository, metaDataResolveResult.getMetaData());
                    if (!metaDataResolveResult.getMetaData().isMissing()) {
                        return moduleResolution;
                    }
                    best = best != null ? best : moduleResolution;
                    break;
                default:
                    throw new IllegalStateException("Unexpected state for resolution: " + metaDataResolveResult.getState());
            }
        }

        return best;
    }
}


text:
update kren_recip_deliv_t set recip_id = 'testuser1' where recip_id = 'TestUser1'
/
update kren_recip_deliv_t set recip_id = 'testuser2' where recip_id = 'TestUser2'
/
update kren_recip_deliv_t set recip_id = 'testuser4' where recip_id = 'TestUser4'
/
update kren_recip_deliv_t set recip_id = 'testuser5' where recip_id = 'TestUser5'
/
update kren_recip_deliv_t set recip_id = 'testuser6' where recip_id = 'TestUser6'
/
update kren_recip_list_t set recip_id = 'testuser1' where recip_id = 'TestUser1'
/
update kren_recip_list_t set recip_id = 'testuser3' where recip_id = 'TestUser3'
/
update kren_rvwer_t set prncpl_id = 'testuser3' where prncpl_id = 'TestUser3'
/
update kren_chnl_subscrp_t set prncpl_id = 'testuser4' where prncpl_id = 'TestUser4'
/

-- KULRICE-3449
insert into KRIM_GRP_MBR_T (GRP_MBR_ID, VER_NBR, OBJ_ID, GRP_ID, MBR_ID, MBR_TYP_CD, ACTV_FRM_DT, ACTV_TO_DT) VALUES('1207', 1, '6798B3E6C3C49827AE62E5F7A275A1A3', '2000', 'admin', 'P', Null, Null)
/

redpajama_set_name: RedPajamaGithub


text:
<?php

class Ess_M2ePro_Block_Adminhtml_Amazon_Listing_Variation_Product_SwitchToIndividualPopup
    extends Mage_Adminhtml_Block_Template
{
    //########################################

    public function __construct()
    {
        parent::__construct();

        // Initialization block
        // ---------------------------------------
        $this->setId('amazonListingAddNewAsinManualPopup');
        // ---------------------------------------

        $this->setTemplate('M2ePro/amazon/listing/variation/product/switch_to_individual_popup.phtml');
    }

    protected function _beforeToHtml()
    {
        parent::_beforeToHtml();

        $data = array(
            'class'   => 'switch-to-individual-btn',
            'label'   => Mage::helper('M2ePro')->__('Yes')
        );
        $this->setChild(
            'yes_btn',
            $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data)
        );

        $data = array(
            'class'   => 'switch-to-individual-popup-close',
            'label'   => Mage::helper('M2ePro')->__('No')
        );
        $this->setChild(
            'no_btn',
            $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data)
        );

        return $this;
    }

    //########################################
}


text:
<md-toolbar color="primary">
    Accessory
</md-toolbar>

        <md-card (click)="onSelect(widget)">

{{widget.nameLabel}}

{{widget.stateLabel}}

        </md-card>

{{getHumanizeLastUpdated()}}


text: Flask framework for new website


text:
[![Selena.js](logo.png)](http://selenajs.enytc.com)

#Selena.js [![Build Status](https://secure.travis-ci.org/chrisenytc/selena-example.png?branch=master)](http://travis-ci.org/chrisenytc/selena-example) [![Dependency Status](https://gemnasium.com/chrisenytc/selena-example.png)](https://gemnasium.com/chrisenytc/selena-example) [![GH version](https://badge-me.herokuapp.com/app/gh/chrisenytc/selena-example.png)](http://badges.enytc.com/for/gh/chrisenytc/selena-example) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/chrisenytc/selena-example/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

> An wonderful full stack framework for node.js

## Getting Started

1º Clone selena repo

```bashm
git clone https://github.com/enytc/selena.git
```

2º Enter in Selena directory
```bash
cd selena
```

3º Install dependencies

```bash
npm install
```

4º Configure the settings in `app/config`

5º Build Selena

```bash
npm build
```

6º Start Selena

```bash
npm start
```

Test your selena app

```bash
npm test
```

##### Using Yeoman Generator

Install Selena.js generator

```bash
npm install -g generator-selena
```

Run Selena.js

```bash
yo selena
```

###### Learn to use the Selena.js generator

[![Demo](https://raw2.github.com/enytc/selena/gh-pages/src/img/howtouse-play.png)](http://ascii.io/a/7475/)

For more informations access this links.

NPM: [npm link](https://npmjs.org/package/generator-selena)
Repository: [generator-selena](https://github.com/chrisenytc/generator-selena)

## Documentation

### Overview

Selena.js can work with HTTP or HTTPS. You can simply switch the settings in your enviroment.

**INFO** To use htps you need to generate or have a key and a certificate. e.g: `cert.pem` and `key.pem`

You can rename the files in `app/config/<env>/ssl.json`.

[How to generate a ssl cert](http://greengeckodesign.com/blog/2013/06/15/creating-an-ssl-certificate-for-node-dot-js/)

[How to generate a ssl cert with pem](http://docs.nodejitsu.com/articles/HTTP/servers/how-to-create-a-HTTPS-server)

Example:

Edit: `app/config/<env>/app.json`

```json
{
  "https": true
}
```

#### Params to Selena.js constructor

**Parameter**: `options`
**Type**: `Object`
**Example**:
```javascript
{
 http: {
  port: 80,
  options: {}
  },
 https: {
  port: 403,
  options: {}
  }
}
```

**options** are options that can be passed optionally to connect to database using mongoose.

### Controllers

How to use controllers

There are two kinds of controllers, each with a different purpose and operation.

##### Default Controller

The default controller is the model used to define routes based on `controller/action'

Conventions:

- The file name and the methods will be used on the route. e.g: tasks.js => `/` or `tasks/tasks/index`
- The default method always has to be the `index`
- If you want to override the route use the option: `path:'/newcustomroute/test '`
- If you wish to protect the route only for logged in users. Use the option: `requireLogin: true`
- Routes can optionally have a `.json` extension or without the extension. e.g: `/tasks/all.json` or `/tasks/all`
- All models can be found at: `global.models`. e.g: `global.models.Task`
- All configurations can be found at: `global.configs`. e.g: `global.configs.app`

Example:

```javascript

var Model = global.models.Model;

module.exports = {

 /*
  * GET /
  */

 index: {
  method: 'GET',
  requireLogin: true,
  path: '/newcustomroute',
  fn: function (req, res) {
   res.jsonp(200, {
    message: 'Request received successfully!'
   });
  }
 }
};

```

##### Restful Controller

The restful controller is responsible for providing restful routes following the model of restful applications.

Conventions:

- If you wish to protect the restful route only for logged in users. Use the option `requireLogin: true`

Example:

```javascript
module.exports = {

  /*
   * GET /tasks
   */

   requireLogin: true,

  index: function (req, res) {
    res.jsonp(200, {
      welcome: 'Welcome to selena App'
    });
  },

  /*
   * GET /tasks/new
   */

  new: function (req, res) {
    res.jsonp(200, {
      welcome: 'Welcome to selena App'
    });
  },

  /*
   * POST /tasks
   */

  create: function (req, res) {
    res.jsonp(200, {
      welcome: 'Welcome to selena App'
    });
  },

  /*
   * GET /tasks/:task
   */

  show: function (req, res) {
    res.jsonp(200, {
      welcome: 'Welcome to selena App'
    });
  },

  /*
   * GET /tasks/:task/edit
   */

  edit: function (req, res) {
    res.jsonp(200, {
      welcome: 'Welcome to selena App'
    });
  },

  /*
   * PUT /tasks/:task
   */

  update: function (req, res) {
    res.jsonp(200, {
      welcome: 'Welcome to selena App'
    });
  },

  /*
   * DELETE /tasks/:task
   */

  destroy: function (req, res) {
    res.jsonp(200, {
      welcome: 'Welcome to selena App'
    });
  }
};
```

For more information see the documentation of the implementation of the restful Selena.js: [express-resource](https://npmjs.org/package/express-resource)

## Models

How to use Models

The models in Selena.js uses the mongoose and follows the implementation of the example below:

```javascript
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

/**
 * Taks Schema
 */
var TaskSchema = new Schema({
  created: {
    type: Date,
    default: Date.now
  },
  title: {
    type: String,
    default: '',
    trim: true,
    required: true
  },
  slug: {
    type: String,
    trim: true,
    required: true,
    unique: true
  },
  content: {
    type: String,
    default: '',
    trim: true
  },
  closed: {
    type: Boolean,
    default: false
  }
});

//Exports model
module.exports = mongoose.model('Task', TaskSchema);
```

## Views

How to use Swig views

The Selena.js uses the Swig as its template engine, you can see more information on how to use Swig on the link below.

[How to use Swig](http://paularmstrong.github.io/swig/)

You can also use any of the listed template engines in this link:

[List of supported template engines](https://github.com/visionmedia/consolidate.js#supported-template-engines)

Example:

`app/views/index.html`

```html
{% extends '../layouts/default.html' %}

{% block content %}
<div><strong>Hello World</strong></div>
{% endblock %}

```

## Internationalisation (i18n)

How to use Livi18n

The language files of Selena.js are in the folder `app/locales`

To use the Livi18n you must follow some conventions:

1. All language files are in `app/locales`, except as you change the settings in `app/config/<env>/i18n.json`
2. File names will be used to get the translation strings.

Quick example:

`app/locales/messages.json`

```json
{
  "welcome": "Hello :name, Welcome to Selena.js!",
  "message": ":name have :&: The Vampire Diaries Book||:name have :&: The Vampire Diaries Books"
}
```

In Views

`app/views/index.html`

```html
<div class="content">
  <p>{{ {key: 'messages.welcome', options: {name: 'Selena'}, defaultValue: 'TestValue'}) }}</p>
  <p>{{ {key: 'messages.message', options: {name: 'Selena'}, value: 10, defaultValue: 'TestValue'}) }}</p>
</div>
```

In Controllers

`app/controllers/index.js`

```javascript
module.exports = {

 /*
  * GET /
  */

 index: {
  method: 'GET',
  fn: function (req, res) {
   res.jsonp(200, {
    welcome: req.t({key: 'messages.welcome', options: {name: 'Selena'}, defaultValue: 'TestValue'});,
    message: req.p({key: 'messages.message', options: {name: 'Selena'}, value: 10, defaultValue: 'TestValue'});
   });
  }
 }
};
```

For more information see the documentation of the implementation of the Livi18n in Selena.js:

[Example of Livi18n on Backend](https://github.com/chrisenytc/livi18n/#examples)

[Example of Livi18n on Frontend with json API](https://github.com/chrisenytc/livi18n.js/#documentation)

[Example of Livi18n on Frontend with socket.io API](https://github.com/chrisenytc/livi18n.socket.js/#documentation)

## Middlewares

How to use middlewares

You can add and manage middlewares very easily in Selena.js and may activate it or deactivate it very easily and quickly.

The Selena.js middleware follow the format below:

```javascript
module.exports = {

  /*
   * Set true if you want enable this middleware
   */
  enabled: false,
  fn: function () {
    return function (req, res, next) {
      //console.log('Called');
      next();
    };
  }
};
```

##### Shared Middlewares

You can create or use shared middlewares by the community Selena.js on NPM.

###### Using shared middlewares

1º Search for middlewares in `https://npmjs.org/search?q=selena-` or `http://selenajs.enytc.com/#/middlewares`

2º Install middleware `npm install selena-example --save`

3º Declare and enable in `app/config/<env>/middlewares.jsonp`

Example:

```json
[
  {
    "enabled": true,
    "name": "selena-example"
  }
]

```

Now your shared middlewares are ready to be used.

###### Creating your Selena.js middleware

The middlewares of Selena.js are exactly the same as the middlewares of  Express.js but just need to follow some conventions.

Conventions:

- The name of the middleware must always start with `selena-`. e.g: `selena-example`.
- The middleware should be sent to NPM.
- The middlewares must have the tag `selenamiddleware`.

Following these conventions your middleware may appear in Selena.js site, so you can help many people.

Example:

```javascript
/*
 * selena-example
 * https://github.com/chrisenytc/selena-example
 *
 * Copyright (c) 2014 Christopher EnyTC
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function () {
  return function (req, res, next) {
    //console.log('Called');
    next();
};

```

## Services

How to use services

Services are specific to provide static JSON files can be accessed via: `/ws/nameofjsonfile.json`

Conventions:

- All services are on route `/ws/`
- The name of the JSON file will be used as the name of the route. e.g: `/ws/nameofjsonfile`
- Routes can use the `.json` extension optionally. e.g: `/ws/nameofjsonfile.json`

The services accept any valid JSON.

Example:

```json
[
  {
    "name": "Bella"
  },
  {
    "name": "Livia"
  }
]
```

## Sockets

How to use Sockets

The selena.js uses socket.io, you need to follow some conventions to able to use it.

1. The file name and the method name will be used as socket path. e.g: `test.js` + `index` = `test/index`
2. You can listen or emit a message using that path. e.g: `on: function(data){}` or `emit: 'message-example'`
3. `this` variable has the scope of socket.io and can use all of its methods. e.g: `this.on('test/index', function(data){});`, `this.emit('test/index', 'message-example')` and more.

Example:

`app/sockets/test.js`

```javascript
module.exports = {

  /*
   * SOCKET test
   */

  index: {
    on: function(data) {
      //show received data
      console.log(data);
      //emit new data
      this.emit('test/another/event', data);
    },
    emit: 'test this'
  }
};
```

For more information see the documentation of socket.io:

[How to use Socket.io](http://socket.io/#how-to-use)

## Assets and Public

The `assets` folder is where are the project dependencies, installed using bower.

The `public` folder is where are the frontend application with angularJS.

**controllers** Folder that contains all the angularJS controllers.

**directives** Folder that contains all the angularJS directives.

**filters** Folder that contains all the angularJS filters.

**services** Folder that contains all the angularJS services.

**views** Folder that contains all the angularJS views.

**app.js** AngularJS Module with dependencies.

**init.js** Initialize Application.

## Core

The Selena.js was created to be as configurable, yet you have total freedom to alter the Core of Selena.js.

The Core Selena.js is in the `lib` folder.

## Settings

How to use Settings

The Selena.js works with environments, you can have multiple configurations in your application.

The defaults environments are: `development`, `test` and `production`. You also create your own customized reports environments.

You can access the contents of environments using `app.get('nameofconfigfile')`

Conventions:

- The name of the configuration files in `app/config/<envs>` are the names used to get the contents of the settings in: `app.get('nameofconfigfile')`

##### Custom Environments

How to create custom environments

1º Create `mycustomenv` folder in `app/config/`

2º Create config files in `app/config/mycustomenv`

3º Run your environment

```bash
NODE_ENV=mycustomenv node app
```

Example:

```bash
NODE_ENV=production node app
```

## Contributing

See the [CONTRIBUTING Guidelines](CONTRIBUTING.md)

## Support
If you have any problem or suggestion please open an issue [here](https://github.com/enytc/selena/issues).

## License

The BSD License

Copyright (c) 2014, EnyTC Corporation

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or
  other materials provided with the distribution.

* Neither the name of the EnyTC Corporation nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


text:
package com.gmail.biweiguo.smartshopper;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.Date;

import android.util.Log;

public class Item implements Comparable<Item> {

	private static final String defaultString = "01/01/2114"; //a remote day
	private static boolean cartMode = true;
	private static boolean boughtMode = true; //true for showing details
    private String itemName;
    private int id;
    //private int count;
    private String store;
    private String dateString;
    private Date date;
    private double price;

    static SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
	private static final Date defaultDate = parseDate(defaultString);

    public static Date parseDate (String str) {
    	Date date = null;
    	try {
    		date = sdf.parse(str);
    	}catch (ParseException e) {
    		e.printStackTrace();
    		Log.d("Item", "Can't format date!");
    	}
    	return date;
    }

    public Item()
    {
        this.itemName = "";
        this.store = "";
        this.date = defaultDate;
        this.dateString = defaultString;
        this.price = -1;		//for an item that's not bought yet
    }

    public Item(String itemName) {
        super();
        this.itemName = itemName;
        this.store = "";
        this.date = defaultDate;
        this.dateString = defaultString;
        this.price = -1;
    }

    public void setDefault() {

    	if(store.equals(""))
    		this.store = "wherever";
    	if(dateString.equals("")) {
    		setDateString(defaultString);
    		setDate(defaultDate);
    	}
    }

    public int getId() {
        return id;
    }

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

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

 /*  I don't think count is that necessary
    public int getCount() {
        return count;
    }

    public void setCount(int count) {
    	this.count = count;
    }
*/

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
    	this.price = price;
    }

    public String getStore() {
    	return store;
    }

    public void setStore (String store) {
    	this.store = store;
    }

    public Date getDate() {
    	return date;
    }

    public void setDate (Date date) {
    	this.date = date;
    }

    public String getDateString() {
    	return dateString;
    }

    public void setDateString(String str) {
    	this.dateString = str;
    }

    public static void setCartMode(boolean mode){

    	cartMode = mode;
    }

    public static void setBoughtMode(boolean mode) {

    	boughtMode = mode;
    }

    public static String getDefaultString() {
    	return defaultString;
    }

    @Override
    public String toString() {

    	StringBuilder sb = new StringBuilder();
    	String str = new String();

    	//for items on shopping list
    	if(price == -1) {
    		if(cartMode) {
	    		if(dateString.equals(defaultString))
	    			str = sb.append(itemName).append(" from ").append(store).append(" by ").append("whenever").toString();
	    		else
	    			str = sb.append(itemName).append(" from ").append(store).append(" by ").append(dateString).toString();
	    	}
	    	else
	    		str = itemName;
    	}
    	//for items on bought list, without price information
    	else if(price == 0) {
	    	if(boughtMode) {
	    		if(store.equals("wherever")) {
	    			str = sb.append(itemName).append(" on ").append(dateString).toString();
	    		}
	    		else
	    			str = sb.append(itemName).append(" from ").append(store).append(" on ").append(dateString).toString();
	    	}
	    	else
	    		str = itemName;
    	}
    	//for items on bought list, with price information
    	else {
    		if(boughtMode) {
	    		if(store.equals("wherever")) {
	    			str = sb.append(itemName).append(" on ").append(dateString).append(" price: $").append(price).toString();
	    		}
	    		else
	    			str = sb.append(itemName).append(" from ").append(store).append(" on ").append(dateString).
	    					append(" price: $").append(price).toString();
	    	}
	    	else
	    		str = itemName;
    	}

    	return str;

    }

    public int compareTo(Item compareItem) {

		String compare = ((Item) compareItem).getStore();

		//ascending order
		return this.getStore().compareTo(compare);

	}

	public static Comparator<Item> StoreComparator = new Comparator<Item>() {

		public int compare(Item item1, Item item2) {

			String store1 = item1.getStore().toUpperCase();
			String store2 = item2.getStore().toUpperCase();

			//ascending order
			return store1.compareTo(store2);

		}

	};

	public static Comparator<Item> DateComparator = new Comparator<Item>() {

		public int compare(Item item1, Item item2) {

			Date date1 = item1.getDate();
			Date date2 = item2.getDate();

			//descending order
			return date1.compareTo(date2);

		}

	};

	public static Comparator<Item> PriceComparator = new Comparator<Item>() {

		public int compare(Item item1, Item item2) {

			double store1 = item1.getPrice();
			double store2 = item2.getPrice();
			//descending order
			if(store1 < store2)
				return 1;
			else if(store1 > store2)
				return -1;
			else
				return 0;
		}

	};

}


text:
package org.kie.workbench.common.screens.projecteditor.client.build.exec.impl;

import java.util.HashMap;

import org.assertj.core.api.Assertions;
import org.guvnor.common.services.project.model.GAV;
import org.guvnor.common.services.project.model.POM;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.kie.workbench.common.screens.projecteditor.build.exec.SnapshotDeploymentSettings;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildType;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.Executor;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.build.BuildExecutor;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.deploy.ProductionBuildAndDeployExecutor;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.deploy.SnapshotBuildAndDeployExecutor;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.install.ProductionInstallExecutor;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.install.SnapshotInstallExecutor;
import org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.redeploy.SnapshotRedeployExecutor;
import org.kie.workbench.common.services.shared.project.KieModule;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import static org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.util.BuildExecutionTestConstants.ARTIFACT;
import static org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.util.BuildExecutionTestConstants.GROUP;
import static org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.util.BuildExecutionTestConstants.SNAPSHOT;
import static org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.util.BuildExecutionTestConstants.VERSION;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@RunWith(MockitoJUnitRunner.class)
public class BuildExecutionManagerImplTest {

    @Mock
    private BuildExecutor defaultBuildExecutor;

    @Mock
    private ProductionBuildAndDeployExecutor productionBuildAndDeployExecutor;

    @Mock
    private ProductionInstallExecutor productionInstallExecutor;

    @Mock
    private BuildExecutor snapshotBuildExecutor;

    @Mock
    private SnapshotBuildAndDeployExecutor snapshotBuildAndDeployExecutor;

    @Mock
    private SnapshotInstallExecutor snapshotInstallExecutor;

    @Mock
    private SnapshotRedeployExecutor snapshotRedeployExecutor;

    @Mock
    private SnapshotDeploymentSettings settings;

    @Mock
    private KieModule module;

    @Mock
    private BuildExecutionContext context;

    private BuildExecutionManagerImpl buildExecutionManager;

    @Before
    public void init() {

        when(module.getPom()).thenReturn(new POM(new GAV(GROUP, ARTIFACT, VERSION)));

        when(context.getModule()).thenReturn(module);

        this.buildExecutionManager = new BuildExecutionManagerImpl() {
            @Override
            protected void init() {
                defaultRunners = new HashMap<>();
                defaultRunners.put(BuildType.BUILD, defaultBuildExecutor);
                defaultRunners.put(BuildType.DEPLOY, productionBuildAndDeployExecutor);
                defaultRunners.put(BuildType.INSTALL, productionInstallExecutor);

                snapshotRunners = new HashMap<>();
                snapshotRunners.put(BuildType.BUILD, snapshotBuildExecutor);
                snapshotRunners.put(BuildType.DEPLOY, snapshotBuildAndDeployExecutor);
                snapshotRunners.put(BuildType.INSTALL, snapshotInstallExecutor);
                snapshotRunners.put(BuildType.REDEPLOY, snapshotRedeployExecutor);
            }
        };

        buildExecutionManager.init();
    }

    @Test
    public void testDefaultBuild() {
        testExecutor(BuildType.BUILD, defaultBuildExecutor);
    }

    @Test
    public void testDefaultBuildAndDeploy() {
        testExecutor(BuildType.DEPLOY, productionBuildAndDeployExecutor);
    }

    @Test
    public void testDefaultInstall() {
        testExecutor(BuildType.INSTALL, productionInstallExecutor);
    }

    @Test
    public void testDefaultRedeploy() {
        Assertions.assertThatThrownBy(() -> buildExecutionManager.execute(BuildType.REDEPLOY, context))
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessage("Cannot run REDEPLOY for module groupId:artifactId:version");
    }

    @Test
    public void testSnapshotBuild() {
        testSnapshotExecutor(BuildType.BUILD, snapshotBuildExecutor);
    }

    @Test
    public void testSnapshotBuildAndDeploy() {
        testSnapshotExecutor(BuildType.DEPLOY, snapshotBuildAndDeployExecutor);
    }

    @Test
    public void testSnapshotInstall() {
        testSnapshotExecutor(BuildType.INSTALL, snapshotInstallExecutor);
    }

    @Test
    public void testSnapshotRedeploy() {
        testSnapshotExecutor(BuildType.REDEPLOY, snapshotRedeployExecutor);
    }

    private void testSnapshotExecutor(BuildType buildType, Executor executor) {
        module.getPom().getGav().setVersion(VERSION + SNAPSHOT);
        testExecutor(buildType, executor);
    }

    private void testExecutor(BuildType buildType, Executor executor) {
        buildExecutionManager.execute(buildType, context);
        verify(executor).run(eq(context));
    }
}


text:
#import "ORKTouchAbilityTapContentView.h"
#import "ORKTouchAbilityTapTrial.h"

#import "ORKHelpers_Internal.h"

@interface ORKTouchAbilityTapContentView ()

@property (nonatomic, assign) BOOL success;

@property (nonatomic, assign) NSUInteger numberOfColumns;
@property (nonatomic, assign) NSUInteger numberOfRows;
@property (nonatomic, assign) NSUInteger targetColumn;
@property (nonatomic, assign) NSUInteger targetRow;
@property (nonatomic, assign) CGSize targetSize;

@property (nonatomic, strong) UIView *targetView;
@property (nonatomic, strong) UITapGestureRecognizer *tapGestureRecognizer;

@property (nonatomic, copy) NSArray *targetConstraints;

@end

@implementation ORKTouchAbilityTapContentView

#pragma mark - Properties

- (UIView *)targetView {
    if (!_targetView) {
        _targetView = [[UIView alloc] initWithFrame:CGRectZero];
    }
    return _targetView;
}

- (UITapGestureRecognizer *)tapGestureRecognizer {
    if (!_tapGestureRecognizer) {
        _tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGestureRecognizer:)];
    }
    return _tapGestureRecognizer;
}

#pragma mark - UIView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {

        self.targetView.backgroundColor = self.tintColor;
        self.targetView.translatesAutoresizingMaskIntoConstraints = NO;

        [self.contentView addSubview:self.targetView];

        self.tapGestureRecognizer.enabled = NO;
        [self.contentView addGestureRecognizer:self.tapGestureRecognizer];
    }
    return self;
}

- (void)tintColorDidChange {
    [super tintColorDidChange];
    self.targetView.backgroundColor = self.tintColor;
}

- (void)updateConstraints {
    [super updateConstraints];

    if (self.numberOfColumns == 0 || self.numberOfRows == 0 || self.targetView.superview == nil) {
        return;
    }

    CGFloat width = self.contentView.frame.size.width / self.numberOfColumns;
    CGFloat height = self.contentView.frame.size.height / self.numberOfRows;

    CGFloat columnMidX = width * (self.targetColumn + 1.0/2.0);
    CGFloat rowMidY = height * (self.targetRow + 1.0/2.0);

    if (self.targetConstraints != nil) {
        [NSLayoutConstraint deactivateConstraints:self.targetConstraints];
        self.targetConstraints = nil;
    }

    NSMutableArray *constraintsArray = [NSMutableArray array];

    [constraintsArray addObject:[NSLayoutConstraint constraintWithItem:self.targetView
                                                             attribute:NSLayoutAttributeWidth
                                                             relatedBy:NSLayoutRelationEqual
                                                                toItem:nil
                                                             attribute:NSLayoutAttributeNotAnAttribute
                                                            multiplier:1.0
                                                              constant:self.targetSize.width]];

    [constraintsArray addObject:[NSLayoutConstraint constraintWithItem:self.targetView
                                                             attribute:NSLayoutAttributeHeight
                                                             relatedBy:NSLayoutRelationEqual
                                                                toItem:nil
                                                             attribute:NSLayoutAttributeNotAnAttribute
                                                            multiplier:1.0
                                                              constant:self.targetSize.height]];

    [constraintsArray addObject:[NSLayoutConstraint constraintWithItem:self.targetView
                                                             attribute:NSLayoutAttributeCenterX
                                                             relatedBy:NSLayoutRelationEqual
                                                                toItem:self.contentView
                                                             attribute:NSLayoutAttributeLeft
                                                            multiplier:1.0
                                                              constant:columnMidX]];

    [constraintsArray addObject:[NSLayoutConstraint constraintWithItem:self.targetView
                                                             attribute:NSLayoutAttributeCenterY
                                                             relatedBy:NSLayoutRelationEqual
                                                                toItem:self.contentView
                                                             attribute:NSLayoutAttributeTop
                                                            multiplier:1.0
                                                              constant:rowMidY]];

    self.targetConstraints = constraintsArray;
    [NSLayoutConstraint activateConstraints:self.targetConstraints];
}

#pragma mark - ORKTouchAbilityCustomView

+ (Class)trialClass {
    return [ORKTouchAbilityTapTrial class];
}

- (ORKTouchAbilityTrial *)trial {

    ORKTouchAbilityTapTrial *trial = (ORKTouchAbilityTapTrial *)[super trial];
    trial.targetFrameInWindow = [self.targetView convertRect:self.targetView.bounds toView:nil];
    trial.success = self.success;

    return trial;
}

- (void)startTrial {
    [super startTrial];
    self.tapGestureRecognizer.enabled = YES;
}

- (void)endTrial {
    [super endTrial];
    self.tapGestureRecognizer.enabled = NO;
}

- (void)reloadData {
    [self resetTracks];

    self.success = NO;

    self.numberOfColumns = [self.dataSource numberOfColumnsInTapContentView:self] ?: 1;
    self.numberOfRows    = [self.dataSource numberOfRowsInTapContentView:self]    ?: 1;
    self.targetColumn    = [self.dataSource targetColumnInTapContentView:self]    ?: 0;
    self.targetRow       = [self.dataSource targetRowInTapContentView:self]       ?: 0;

    NSAssert(self.targetColumn >= 0 && self.targetColumn < self.numberOfColumns, @"Target column out of bounds.");
    NSAssert(self.targetRow >= 0 && self.targetRow < self.numberOfRows, @"target row out of bounds.");

    if ([self.dataSource respondsToSelector:@selector(targetSizeInTapContentView:)]) {
        self.targetSize = [self.dataSource targetSizeInTapContentView:self];
    } else {
        self.targetSize = CGSizeMake(76, 76);
    }

    [self setNeedsUpdateConstraints];
    [self updateConstraintsIfNeeded];
}

#pragma mark - Gesture Recognizer Handler

- (void)handleTapGestureRecognizer:(UITapGestureRecognizer *)sender {
    if (CGRectContainsPoint(self.targetView.bounds, [sender locationInView:self.targetView])) {
        self.success = YES;
    } else {
        self.success = NO;
    }
}

@end


text:
#include <vector>
#include <boost/foreach.hpp>
#include <boost/assign/list_of.hpp>

#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"

#include "bfd/rest_api/bfd_json_config.h"

namespace BFD {
namespace REST {

static bool IsIPAddressValid(const char* addr) {
    boost::system::error_code ec;
    boost::asio::ip::address::from_string(addr, ec);
    return !ec;
}

bool JsonData::ParseFromJsonString(const std::string& json) {
    contrail_rapidjson::Document document;
    document.Parse<0>(json.c_str());
    return ParseFromJsonDocument(document);
}

void JsonData::EncodeJsonString(std::string* json) {
    contrail_rapidjson::Document document;
    EncodeJsonDocument(&document, &document.GetAllocator());
    contrail_rapidjson::StringBuffer strbuf;
    contrail_rapidjson::Writer<contrail_rapidjson::StringBuffer> writer(strbuf);
    document.Accept(writer);
    *json = strbuf.GetString();
}

bool JsonData::AreConstraintsMet(const std::vector<Constraint>& constraints,
                                const contrail_rapidjson::Value& document) {
    if (!document.IsObject())
        return false;

    BOOST_FOREACH(const struct Constraint& constraint, constraints) {
        if (!document.HasMember(constraint.member_name) ||
            !(document[constraint.member_name].*(constraint.typecheck_func))())
            return false;
    }
    return true;
}

JsonConfig::JsonConfig()
{}

JsonConfig::JsonConfig(boost::asio::ip::address address,
                       TimeInterval desired_min_tx_interval,
                       TimeInterval required_min_rx_interval,
                       int detection_time_multiplier)
                       : address(address),
                         desired_min_tx_interval(desired_min_tx_interval),
                         required_min_rx_interval(required_min_rx_interval),
                         detection_time_multiplier(detection_time_multiplier)
                       {}

bool JsonConfig::ValidateJsonDocument(const contrail_rapidjson::Value& document) {
    static const std::vector<Constraint> constraints = boost::assign::list_of
        (Constraint("Address", &contrail_rapidjson::Value::IsString) )
        (Constraint("DesiredMinTxInterval", &contrail_rapidjson::Value::IsInt))
        (Constraint("RequiredMinRxInterval", &contrail_rapidjson::Value::IsInt))
        (Constraint("DetectionMultiplier", &contrail_rapidjson::Value::IsInt));
    return AreConstraintsMet(constraints, document) &&
            IsIPAddressValid(document["Address"].GetString());
}

bool JsonConfig::ParseFromJsonDocument(const contrail_rapidjson::Value& document) {
    if (ValidateJsonDocument(document)) {
        using boost::posix_time::microseconds;

        address =
            boost::asio::ip::
                address::from_string(document["Address"].GetString());
        desired_min_tx_interval =
            microseconds(document["DesiredMinTxInterval"].GetInt());
        required_min_rx_interval =
            microseconds(document["RequiredMinRxInterval"].GetInt());
        detection_time_multiplier =
            document["DetectionMultiplier"].GetInt();
        return true;
    }
    return false;
}

void JsonConfig::EncodeJsonDocument(contrail_rapidjson::Value* document,
                                contrail_rapidjson::Value::AllocatorType *allocator) {
    document->SetObject();
    std::string address_str = address.to_string();
    contrail_rapidjson::Value address_val(address_str.c_str(), *allocator);
    document->AddMember("Address", address_val, *allocator);

    document->AddMember("DesiredMinTxInterval",
        desired_min_tx_interval.total_microseconds(), *allocator);
    document->AddMember("RequiredMinRxInterval",
        required_min_rx_interval.total_microseconds(), *allocator);
    document->AddMember("DetectionMultiplier",
        detection_time_multiplier, *allocator);
}

bool JsonState::ValidateJsonDocument(const contrail_rapidjson::Value& document) {
    const std::vector<Constraint> constraints = boost::assign::list_of
        (Constraint("LocalSessionState", &contrail_rapidjson::Value::IsString))
        (Constraint("RemoteSessionState", &contrail_rapidjson::Value::IsString))
        (Constraint("RemoteMinRxInterval", &contrail_rapidjson::Value::IsInt))
        (Constraint("LocalDiscriminator", &contrail_rapidjson::Value::IsInt))
        (Constraint("RemoteDiscriminator", &contrail_rapidjson::Value::IsInt));
    return AreConstraintsMet(constraints, document) &&
        // Check whether these strings are convertible to BFD states.
        BFDStateFromString(document["LocalSessionState"].GetString()) &&
        BFDStateFromString(document["RemoteSessionState"].GetString());
}

bool JsonState::ParseFromJsonDocument(const contrail_rapidjson::Value& document) {
    if (!session_config.ParseFromJsonDocument(document))
        return false;

    if (ValidateJsonDocument(document)) {
        using boost::posix_time::microseconds;

        remote_min_rx_interval =
            microseconds(document["RemoteMinRxInterval"].GetInt());
        local_discriminator =
            document["LocalDiscriminator"].GetInt();
        remote_discriminator =
            document["RemoteDiscriminator"].GetInt();
        bfd_local_state =
            *BFDStateFromString(document["LocalSessionState"].GetString());
        bfd_remote_state =
            *BFDStateFromString(document["RemoteSessionState"].GetString());
        return true;
    }
    return false;
}

void JsonState::EncodeJsonDocument(contrail_rapidjson::Value* document,
    contrail_rapidjson::Value::AllocatorType *allocator) {
    document->SetObject();
    session_config.EncodeJsonDocument(document, allocator);

    std::string local_session_state_str
        = boost::lexical_cast<std::string>(bfd_local_state);
    contrail_rapidjson::Value local_session_state_val(local_session_state_str.c_str(),
                                                *allocator);
    document->AddMember("LocalSessionState", local_session_state_val,
                        *allocator);

    std::string remote_session_state_str =
        boost::lexical_cast<std::string>(bfd_remote_state);
    contrail_rapidjson::Value remote_session_state_val(remote_session_state_str.c_str(),
                                                *allocator);
    document->AddMember("RemoteSessionState", remote_session_state_val,
                        *allocator);
    document->AddMember("LocalDiscriminator", local_discriminator,
                        *allocator);
    document->AddMember("RemoteDiscriminator", remote_discriminator,
                        *allocator);
    document->AddMember("RemoteMinRxInterval",
                        remote_min_rx_interval.total_microseconds(),
                        *allocator);
}

bool JsonStateNotification::ValidateJsonDocument(
                                    const contrail_rapidjson::Value& document) {
    const std::vector<Constraint> constraints = boost::assign::list_of
        (Constraint("Address", &contrail_rapidjson::Value::IsString))
        (Constraint("SessionState", &contrail_rapidjson::Value::IsString));
    return AreConstraintsMet(constraints, document) &&
            IsIPAddressValid(document["Address"].GetString()) &&
            BFDStateFromString(document["SessionState"].GetString());
}

bool JsonStateNotification::ParseFromJsonDocument(const contrail_rapidjson::Value
                                                        &document) {
    if (ValidateJsonDocument(document)) {

        address =
            boost::asio::ip::
                address::from_string(document["Address"].GetString());
        state =
            *BFDStateFromString(document["SessionState"].GetString());
        return true;
    }
    return false;
}

void JsonStateNotification::EncodeJsonDocument(contrail_rapidjson::Value* document,
        contrail_rapidjson::Value::AllocatorType *allocator) {
    document->SetObject();
    std::string address_str = address.to_string();
    contrail_rapidjson::Value address_val(address_str.c_str(), *allocator);
    document->AddMember("Address", address_val, *allocator);

    std::string session_state_str = boost::lexical_cast<std::string>(state);
    contrail_rapidjson::Value session_state_val(session_state_str.c_str(), *allocator);
    document->AddMember("SessionState", session_state_val, *allocator);
}

void JsonStateNotificationList::EncodeJsonDocument(contrail_rapidjson::Value* document,
        contrail_rapidjson::Value::AllocatorType *allocator) {
    document->SetArray();
    for (std::vector<JsonStateNotification>::iterator it =
            notifications.begin(); it != notifications.end(); ++it) {
        contrail_rapidjson::Value notification;
        it->EncodeJsonDocument(&notification, allocator);
        document->PushBack(notification, *allocator);
    }
}

bool JsonStateNotificationList::ValidateJsonDocument(
                    const contrail_rapidjson::Value& document) {
    return true;
}

bool JsonStateNotificationList::ParseFromJsonDocument(
                    const contrail_rapidjson::Value& document) {
    return false;
}

void JsonStateMap::EncodeJsonDocument(contrail_rapidjson::Value* document,
    contrail_rapidjson::Value::AllocatorType* allocator) {
    document->SetObject();

    for (StateMap::iterator it = states.begin(); it != states.end(); ++it) {
        std::string address_str = it->first.to_string();
        contrail_rapidjson::Value address_val(address_str.c_str(), *allocator);

        std::string session_state_str =
            boost::lexical_cast<std::string>(it->second);
        contrail_rapidjson::Value session_state_val(session_state_str.c_str(),
                                            *allocator);

        document->AddMember(address_val, session_state_val, *allocator);
    }
}

bool JsonStateMap::ValidateJsonDocument(const contrail_rapidjson::Value& document) {
    if (!document.IsObject())
        return false;

    for (contrail_rapidjson::Value::ConstMemberIterator it = document.MemberBegin();
            it != document.MemberEnd(); ++it) {
        using boost::system::error_code;

        if (!it->name.IsString() || !it->value.IsString())
            return false;

        error_code ec;
        if (ec != boost::system::errc::success)
            return false;
        if (!BFDStateFromString(it->value.GetString()))
            return false;
    }
    return true;
}

bool JsonStateMap::ParseFromJsonDocument(
        const contrail_rapidjson::Value& document) {
    if (!ValidateJsonDocument(document))
        return false;

    states.clear();

    for (contrail_rapidjson::Value::ConstMemberIterator
            it = document.MemberBegin(); it != document.MemberEnd(); ++it) {
        boost::asio::ip::address address =
            boost::asio::ip::address::from_string(it->name.GetString());
        BFDState state = *BFDStateFromString(it->value.GetString());
        states[address] = state;
    }
    return true;
}

}  // namespace REST
}  // namespace BFD


text: Even a Different Header


text:
package test.datetime;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class TimeZoneTest {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String timeZoneId = "GMT+8:00";
		getFormatedDateByTimezone(timeZoneId);
		printlnAllTimezone();
	}

	private static void printlnAllTimezone() {
		String[] IDs = TimeZone.getAvailableIDs();
		for (String ID : IDs) {
			String str = getFormatedDateByTimezone(ID);
			System.out.println(str);
		}
	}

	private static String getFormatedDateByTimezone(String timeZoneId) {
		TimeZone timeZone = TimeZone.getTimeZone(timeZoneId);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		sdf.setTimeZone(timeZone);
		String str = sdf.format(new Date());
		return String.format("%-40s%-60s%-30s%30d", timeZoneId, timeZone.getDisplayName(), str, timeZone.getRawOffset() / 3600 / 1000);
	}

}


text:
#ifndef _COMMAND_FACTORY_HPP_
#define _COMMAND_FACTORY_HPP_

#include "command.hpp"
#define COMMAND_BEGIN void CommandFactory::addCommand() {
#define COMMAND_END }
#define COMMAND_ADD(cmdName,cmdClass) {                         \
   ICommand* pObj = new cmdClass();                             \
   std::string str = cmdName;                                   \
   _cmdMap.insert(COMMAND_MAP::value_type(str,pObj));           \
   }                                                            \

class CommandFactory {
   typedef std::map<std::string, ICommand*> COMMAND_MAP;
   public:
      CommandFactory();
      ~CommandFactory(){}
      void addCommand();
      ICommand * getCommandProcesser(const char * pcmd);
   private:
      COMMAND_MAP _cmdMap;
};

#endif


text:
const holon_markdownbox = require('..')

const config    = require('_config')();

const { el, api } = holon_markdownbox({}, config)

document.body.append(el)


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Crop Box</title>
    <link rel="stylesheet" href="style.css" type="text/css" />

Loading...

        <input type="file" id="file" style="float:left; width: 250px">
        <input type="button" id="btnCrop" value="Crop" style="float: right">
        <input type="button" id="btnZoomIn" value="+" style="float: right">
        <input type="button" id="btnZoomOut" value="-" style="float: right">


text:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layouts/layout">
    <head>
        <title>Java Melody</title>
        <!-- Page Stylesheet -->
        <link rel="stylesheet" th:href="@{|${theme}/stylesheets/pages/system/javamelody.css|}" href="../../../../resources/stylesheets/pages/system/javamelody.css"/>
    </head>
    <body>

        <th:block layout:fragment="content">
            <iframe th:src="@{/javamelody}" frameborder="0" height="100%" width="100%" seamless="seamless" style="display: none;"></iframe>
        </th:block>

        <th:block layout:fragment="javascripts">
            <!-- Page JavaScript -->
            <script th:src="@{|${theme}/javascripts/pages/system/javamelody.js|}" src="../../../resources/javascripts/pages/system/javamelody.js"></script>
        </th:block>
    </body>
</html>


text:
package com.gs.collections.impl.utility.internal;

import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;

import com.gs.collections.api.RichIterable;
import com.gs.collections.api.block.HashingStrategy;
import com.gs.collections.api.block.function.Function;
import com.gs.collections.api.block.function.Function0;
import com.gs.collections.api.block.function.Function2;
import com.gs.collections.api.block.function.Function3;
import com.gs.collections.api.block.function.primitive.BooleanFunction;
import com.gs.collections.api.block.function.primitive.ByteFunction;
import com.gs.collections.api.block.function.primitive.CharFunction;
import com.gs.collections.api.block.function.primitive.DoubleFunction;
import com.gs.collections.api.block.function.primitive.DoubleObjectToDoubleFunction;
import com.gs.collections.api.block.function.primitive.FloatFunction;
import com.gs.collections.api.block.function.primitive.FloatObjectToFloatFunction;
import com.gs.collections.api.block.function.primitive.IntFunction;
import com.gs.collections.api.block.function.primitive.IntObjectToIntFunction;
import com.gs.collections.api.block.function.primitive.LongFunction;
import com.gs.collections.api.block.function.primitive.LongObjectToLongFunction;
import com.gs.collections.api.block.function.primitive.ShortFunction;
import com.gs.collections.api.block.predicate.Predicate;
import com.gs.collections.api.block.predicate.Predicate2;
import com.gs.collections.api.block.procedure.Procedure;
import com.gs.collections.api.block.procedure.Procedure2;
import com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure;
import com.gs.collections.api.collection.MutableCollection;
import com.gs.collections.api.collection.primitive.MutableBooleanCollection;
import com.gs.collections.api.collection.primitive.MutableByteCollection;
import com.gs.collections.api.collection.primitive.MutableCharCollection;
import com.gs.collections.api.collection.primitive.MutableDoubleCollection;
import com.gs.collections.api.collection.primitive.MutableFloatCollection;
import com.gs.collections.api.collection.primitive.MutableIntCollection;
import com.gs.collections.api.collection.primitive.MutableLongCollection;
import com.gs.collections.api.collection.primitive.MutableShortCollection;
import com.gs.collections.api.list.MutableList;
import com.gs.collections.api.map.MutableMap;
import com.gs.collections.api.map.primitive.ObjectDoubleMap;
import com.gs.collections.api.map.primitive.ObjectLongMap;
import com.gs.collections.api.multimap.MutableMultimap;
import com.gs.collections.api.partition.PartitionMutableCollection;
import com.gs.collections.api.partition.list.PartitionMutableList;
import com.gs.collections.api.tuple.Pair;
import com.gs.collections.api.tuple.Twin;
import com.gs.collections.impl.block.factory.Comparators;
import com.gs.collections.impl.block.factory.PrimitiveFunctions;
import com.gs.collections.impl.list.mutable.FastList;
import com.gs.collections.impl.map.mutable.UnifiedMap;
import com.gs.collections.impl.map.mutable.primitive.ObjectDoubleHashMap;
import com.gs.collections.impl.map.mutable.primitive.ObjectLongHashMap;
import com.gs.collections.impl.multimap.list.FastListMultimap;
import com.gs.collections.impl.utility.Iterate;

/**
 * The IterableIterate class provides a few of the methods from the Smalltalk Collection Protocol for use with general
 * Collection classes. This includes do:, select:, reject:, collect:, inject:into:, detect:, detect:ifNone:, anySatisfy:
 * and allSatisfy:
 */
public final class IterableIterate
{
    private IterableIterate()
    {
        throw new AssertionError("Suppress default constructor for noninstantiability");
    }

    /**
     * @see Iterate#select(Iterable, Predicate)
     */
    public static <T> MutableList<T> select(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IterableIterate.select(iterable, predicate, FastList.<T>newList());
    }

    /**
     * @see Iterate#selectAndRejectWith(Iterable, Predicate2, Object)
     */
    public static <T, IV> Twin<MutableList<T>> selectAndRejectWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super IV> predicate,
            IV injectedValue)
    {
        return IteratorIterate.selectAndRejectWith(iterable.iterator(), predicate, injectedValue);
    }

    /**
     * @see Iterate#partition(Iterable, Predicate)
     */
    public static <T> PartitionMutableList<T> partition(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IteratorIterate.partition(iterable.iterator(), predicate);
    }

    /**
     * @see Iterate#partitionWith(Iterable, Predicate2, Object)
     * @since 5.0
     */
    public static <T, P> PartitionMutableList<T> partitionWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
    {
        return IteratorIterate.partitionWith(iterable.iterator(), predicate, parameter);
    }

    public static <T, R extends PartitionMutableCollection<T>> R partitionWhile(Iterable<T> iterable, Predicate<? super T> predicate, R target)
    {
        return IteratorIterate.partitionWhile(iterable.iterator(), predicate, target);
    }

    public static <T, R extends MutableCollection<T>> R takeWhile(Iterable<T> iterable, Predicate<? super T> predicate, R target)
    {
        return IteratorIterate.takeWhile(iterable.iterator(), predicate, target);
    }

    public static <T, R extends MutableCollection<T>> R dropWhile(Iterable<T> iterable, Predicate<? super T> predicate, R target)
    {
        return IteratorIterate.dropWhile(iterable.iterator(), predicate, target);
    }

    /**
     * @see Iterate#count(Iterable, Predicate)
     */
    public static <T> int count(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IteratorIterate.count(iterable.iterator(), predicate);
    }

    /**
     * @see Iterate#countWith(Iterable, Predicate2, Object)
     */
    public static <T, IV> int countWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super IV> predicate,
            IV injectedValue)
    {
        return IteratorIterate.countWith(iterable.iterator(), predicate, injectedValue);
    }

    /**
     * @see Iterate#collectIf(Iterable, Predicate, Function)
     */
    public static <T, V> MutableList<V> collectIf(
            Iterable<T> iterable,
            Predicate<? super T> predicate,
            Function<? super T, ? extends V> function)
    {
        return IterableIterate.collectIf(iterable, predicate, function, FastList.<V>newList());
    }

    public static boolean isEmpty(Iterable<?> iterable)
    {
        return !iterable.iterator().hasNext();
    }

    public static boolean notEmpty(Iterable<?> iterable)
    {
        return !IterableIterate.isEmpty(iterable);
    }

    public static <T> T getFirst(Iterable<T> iterable)
    {
        Iterator<T> iterator = iterable.iterator();
        if (iterator.hasNext())
        {
            return iterator.next();
        }
        return null;
    }

    public static <T> T getLast(Iterable<T> iterable)
    {
        T last = null;
        Iterator<T> iterator = iterable.iterator();
        while (iterator.hasNext())
        {
            last = iterator.next();
        }
        return last;
    }

    /**
     * @see Iterate#select(Iterable, Predicate, Collection)
     */
    public static <T, R extends Collection<T>> R select(
            Iterable<T> iterable,
            Predicate<? super T> predicate,
            R targetCollection)
    {
        return IteratorIterate.select(iterable.iterator(), predicate, targetCollection);
    }

    /**
     * @see Iterate#selectWith(Iterable, Predicate2, Object, Collection)
     */
    public static <T, P, R extends Collection<T>> R selectWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super P> predicate,
            P injectedValue,
            R targetCollection)
    {
        return IteratorIterate.selectWith(iterable.iterator(), predicate, injectedValue, targetCollection);
    }

    /**
     * @see Iterate#selectInstancesOf(Iterable, Class)
     */
    public static <T> MutableList<T> selectInstancesOf(
            Iterable<?> iterable,
            Class<T> clazz)
    {
        FastList<T> result = FastList.newList();
        IterableIterate.selectInstancesOf(iterable, clazz, result);
        result.trimToSize();
        return result;
    }

    /**
     * @see Iterate#selectInstancesOf(Iterable, Class)
     */
    public static <T, R extends Collection<T>> R selectInstancesOf(
            Iterable<?> iterable,
            Class<T> clazz,
            R targetCollection)
    {
        return IteratorIterate.selectInstancesOf(iterable.iterator(), clazz, targetCollection);
    }

    /**
     * @see Iterate#collectIf(Iterable, Predicate, Function, Collection)
     */
    public static <T, V, R extends Collection<V>> R collectIf(
            Iterable<T> iterable,
            Predicate<? super T> predicate,
            Function<? super T, ? extends V> function,
            R targetCollection)
    {
        return IteratorIterate.collectIf(iterable.iterator(), predicate, function, targetCollection);
    }

    /**
     * @see Iterate#reject(Iterable, Predicate)
     */
    public static <T> MutableList<T> reject(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IterableIterate.reject(iterable, predicate, FastList.<T>newList());
    }

    /**
     * @see Iterate#reject(Iterable, Predicate, Collection)
     */
    public static <T, R extends Collection<T>> R reject(
            Iterable<T> iterable,
            Predicate<? super T> predicate,
            R targetCollection)
    {
        return IteratorIterate.reject(iterable.iterator(), predicate, targetCollection);
    }

    /**
     * @see Iterate#rejectWith(Iterable, Predicate2, Object, Collection)
     */
    public static <T, P, R extends Collection<T>> R rejectWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super P> predicate,
            P parameter,
            R targetCollection)
    {
        return IteratorIterate.rejectWith(iterable.iterator(), predicate, parameter, targetCollection);
    }

    /**
     * @see Iterate#collect(Iterable, Function)
     */
    public static <T, V> MutableList<V> collect(
            Iterable<T> iterable,
            Function<? super T, ? extends V> function)
    {
        return IterableIterate.collect(iterable, function, FastList.<V>newList());
    }

    /**
     * @see Iterate#collect(Iterable, Function, Collection)
     */
    public static <T, V, R extends Collection<V>> R collect(
            Iterable<T> iterable,
            Function<? super T, ? extends V> function,
            R targetCollection)
    {
        return IteratorIterate.collect(iterable.iterator(), function, targetCollection);
    }

    /**
     * @see Iterate#collectBoolean(Iterable, BooleanFunction)
     */
    public static <T> MutableBooleanCollection collectBoolean(
            Iterable<T> iterable,
            BooleanFunction<? super T> booleanFunction)
    {
        return IteratorIterate.collectBoolean(iterable.iterator(), booleanFunction);
    }

    /**
     * @see Iterate#collectBoolean(Iterable, BooleanFunction, MutableBooleanCollection)
     */
    public static <T, R extends MutableBooleanCollection> R collectBoolean(Iterable<T> iterable, BooleanFunction<? super T> booleanFunction, R target)
    {
        return IteratorIterate.collectBoolean(iterable.iterator(), booleanFunction, target);
    }

    /**
     * @see Iterate#collectByte(Iterable, ByteFunction)
     */
    public static <T> MutableByteCollection collectByte(
            Iterable<T> iterable,
            ByteFunction<? super T> byteFunction)
    {
        return IteratorIterate.collectByte(iterable.iterator(), byteFunction);
    }

    /**
     * @see Iterate#collectByte(Iterable, ByteFunction,
     * MutableByteCollection)
     */
    public static <T, R extends MutableByteCollection> R collectByte(Iterable<T> iterable, ByteFunction<? super T> byteFunction, R target)
    {
        return IteratorIterate.collectByte(iterable.iterator(), byteFunction, target);
    }

    /**
     * @see Iterate#collectChar(Iterable, CharFunction)
     */
    public static <T> MutableCharCollection collectChar(
            Iterable<T> iterable,
            CharFunction<? super T> charFunction)
    {
        return IteratorIterate.collectChar(iterable.iterator(), charFunction);
    }

    /**
     * @see Iterate#collectChar(Iterable, CharFunction,
     * MutableCharCollection)
     */
    public static <T, R extends MutableCharCollection> R collectChar(Iterable<T> iterable, CharFunction<? super T> charFunction, R target)
    {
        return IteratorIterate.collectChar(iterable.iterator(), charFunction, target);
    }

    /**
     * @see Iterate#collectDouble(Iterable, DoubleFunction)
     */
    public static <T> MutableDoubleCollection collectDouble(
            Iterable<T> iterable,
            DoubleFunction<? super T> doubleFunction)
    {
        return IteratorIterate.collectDouble(iterable.iterator(), doubleFunction);
    }

    /**
     * @see Iterate#collectDouble(Iterable, DoubleFunction,
     * MutableDoubleCollection)
     */
    public static <T, R extends MutableDoubleCollection> R collectDouble(Iterable<T> iterable, DoubleFunction<? super T> doubleFunction, R target)
    {
        return IteratorIterate.collectDouble(iterable.iterator(), doubleFunction, target);
    }

    /**
     * @see Iterate#collectFloat(Iterable, FloatFunction)
     */
    public static <T> MutableFloatCollection collectFloat(
            Iterable<T> iterable,
            FloatFunction<? super T> floatFunction)
    {
        return IteratorIterate.collectFloat(iterable.iterator(), floatFunction);
    }

    /**
     * @see Iterate#collectFloat(Iterable, FloatFunction,
     * MutableFloatCollection)
     */
    public static <T, R extends MutableFloatCollection> R collectFloat(Iterable<T> iterable, FloatFunction<? super T> floatFunction, R target)
    {
        return IteratorIterate.collectFloat(iterable.iterator(), floatFunction, target);
    }

    /**
     * @see Iterate#collectInt(Iterable, IntFunction)
     */
    public static <T> MutableIntCollection collectInt(
            Iterable<T> iterable,
            IntFunction<? super T> intFunction)
    {
        return IteratorIterate.collectInt(iterable.iterator(), intFunction);
    }

    /**
     * @see Iterate#collectInt(Iterable, IntFunction,
     * MutableIntCollection)
     */
    public static <T, R extends MutableIntCollection> R collectInt(Iterable<T> iterable, IntFunction<? super T> intFunction, R target)
    {
        return IteratorIterate.collectInt(iterable.iterator(), intFunction, target);
    }

    /**
     * @see Iterate#collectLong(Iterable, LongFunction)
     */
    public static <T> MutableLongCollection collectLong(
            Iterable<T> iterable,
            LongFunction<? super T> longFunction)
    {
        return IteratorIterate.collectLong(iterable.iterator(), longFunction);
    }

    /**
     * @see Iterate#collectLong(Iterable, LongFunction,
     * MutableLongCollection)
     */
    public static <T, R extends MutableLongCollection> R collectLong(Iterable<T> iterable, LongFunction<? super T> longFunction, R target)
    {
        return IteratorIterate.collectLong(iterable.iterator(), longFunction, target);
    }

    /**
     * @see Iterate#collectShort(Iterable, ShortFunction)
     */
    public static <T> MutableShortCollection collectShort(
            Iterable<T> iterable,
            ShortFunction<? super T> shortFunction)
    {
        return IteratorIterate.collectShort(iterable.iterator(), shortFunction);
    }

    /**
     * @see Iterate#collectShort(Iterable, ShortFunction,
     * MutableShortCollection)
     */
    public static <T, R extends MutableShortCollection> R collectShort(Iterable<T> iterable, ShortFunction<? super T> shortFunction, R target)
    {
        return IteratorIterate.collectShort(iterable.iterator(), shortFunction, target);
    }

    /**
     * @see Iterate#flatCollect(Iterable, Function)
     */
    public static <T, V> MutableList<V> flatCollect(
            Iterable<T> iterable,
            Function<? super T, ? extends Iterable<V>> function)
    {
        return IterableIterate.flatCollect(iterable, function, FastList.<V>newList());
    }

    /**
     * @see Iterate#flatCollect(Iterable, Function, Collection)
     */
    public static <T, V, R extends Collection<V>> R flatCollect(
            Iterable<T> iterable,
            Function<? super T, ? extends Iterable<V>> function,
            R targetCollection)
    {
        return IteratorIterate.flatCollect(iterable.iterator(), function, targetCollection);
    }

    /**
     * @see Iterate#forEach(Iterable, Procedure)
     */
    public static <T> void forEach(Iterable<T> iterable, Procedure<? super T> procedure)
    {
        IteratorIterate.forEach(iterable.iterator(), procedure);
    }

    /**
     * @see Iterate#forEachWithIndex(Iterable, ObjectIntProcedure)
     */
    public static <T> void forEachWithIndex(Iterable<T> iterable, ObjectIntProcedure<? super T> objectIntProcedure)
    {
        IteratorIterate.forEachWithIndex(iterable.iterator(), objectIntProcedure);
    }

    /**
     * @see Iterate#injectInto(Object, Iterable, Function2)
     */
    public static <T, IV> IV injectInto(
            IV injectValue,
            Iterable<T> iterable,
            Function2<? super IV, ? super T, ? extends IV> function)
    {
        return IteratorIterate.injectInto(injectValue, iterable.iterator(), function);
    }

    /**
     * @see Iterate#injectInto(int, Iterable, IntObjectToIntFunction)
     */
    public static <T> int injectInto(
            int injectValue,
            Iterable<T> iterable,
            IntObjectToIntFunction<? super T> function)
    {
        return IteratorIterate.injectInto(injectValue, iterable.iterator(), function);
    }

    /**
     * @see Iterate#injectInto(long, Iterable, LongObjectToLongFunction)
     */
    public static <T> long injectInto(
            long injectValue,
            Iterable<T> iterable,
            LongObjectToLongFunction<? super T> function)
    {
        return IteratorIterate.injectInto(injectValue, iterable.iterator(), function);
    }

    /**
     * @see Iterate#injectInto(double, Iterable, DoubleObjectToDoubleFunction)
     */
    public static <T> double injectInto(
            double injectValue,
            Iterable<T> iterable,
            DoubleObjectToDoubleFunction<? super T> function)
    {
        return IteratorIterate.injectInto(injectValue, iterable.iterator(), function);
    }

    /**
     * @see Iterate#injectInto(float, Iterable, FloatObjectToFloatFunction)
     */
    public static <T> float injectInto(
            float injectValue,
            Iterable<T> iterable,
            FloatObjectToFloatFunction<? super T> function)
    {
        return IteratorIterate.injectInto(injectValue, iterable.iterator(), function);
    }

    /**
     * @deprecated in 7.0.
     */
    @Deprecated
    public static <T, R extends List<T>> R distinct(
            Iterable<T> iterable,
            R targetCollection)
    {
        return IteratorIterate.distinct(iterable.iterator(), targetCollection);
    }

    /**
     * @since 7.0.
     */
    public static <T> MutableList<T> distinct(Iterable<T> iterable)
    {
        return IteratorIterate.distinct(iterable.iterator());
    }

    /**
     * @since 7.0.
     */
    public static <T> MutableList<T> distinct(Iterable<T> iterable, HashingStrategy<? super T> hashingStrategy)
    {
        return IteratorIterate.distinct(iterable.iterator(), hashingStrategy);
    }

    /**
     * @see Iterate#sumOfInt(Iterable, IntFunction)
     */
    public static <T> long sumOfInt(Iterable<T> iterable, IntFunction<? super T> function)
    {
        return IteratorIterate.sumOfInt(iterable.iterator(), function);
    }

    /**
     * @see Iterate#sumOfLong(Iterable, LongFunction)
     */
    public static <T> long sumOfLong(Iterable<T> iterable, LongFunction<? super T> function)
    {
        return IteratorIterate.sumOfLong(iterable.iterator(), function);
    }

    /**
     * @see Iterate#sumOfFloat(Iterable, FloatFunction)
     */
    public static <T> double sumOfFloat(Iterable<T> iterable, FloatFunction<? super T> function)
    {
        return IteratorIterate.sumOfFloat(iterable.iterator(), function);
    }

    /**
     * @see Iterate#sumOfDouble(Iterable, DoubleFunction)
     */
    public static <T> double sumOfDouble(Iterable<T> iterable, DoubleFunction<? super T> function)
    {
        return IteratorIterate.sumOfDouble(iterable.iterator(), function);
    }

    public static <T> BigDecimal sumOfBigDecimal(Iterable<T> iterable, Function<? super T, BigDecimal> function)
    {
        return IteratorIterate.sumOfBigDecimal(iterable.iterator(), function);
    }

    public static <T> BigInteger sumOfBigInteger(Iterable<T> iterable, Function<? super T, BigInteger> function)
    {
        return IteratorIterate.sumOfBigInteger(iterable.iterator(), function);
    }

    public static <V, T> MutableMap<V, BigDecimal> sumByBigDecimal(Iterable<T> iterable, Function<T, V> groupBy, Function<? super T, BigDecimal> function)
    {
        return IteratorIterate.sumByBigDecimal(iterable.iterator(), groupBy, function);
    }

    public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(Iterable<T> iterable, Function<T, V> groupBy, Function<? super T, BigInteger> function)
    {
        return IteratorIterate.sumByBigInteger(iterable.iterator(), groupBy, function);
    }

    public static <V, T> ObjectLongMap<V> sumByInt(Iterable<T> iterable, Function<T, V> groupBy, IntFunction<? super T> function)
    {
        ObjectLongHashMap<V> result = ObjectLongHashMap.newMap();
        return IterableIterate.injectInto(result, iterable, PrimitiveFunctions.sumByIntFunction(groupBy, function));
    }

    public static <V, T> ObjectLongMap<V> sumByLong(Iterable<T> iterable, Function<T, V> groupBy, LongFunction<? super T> function)
    {
        ObjectLongHashMap<V> result = ObjectLongHashMap.newMap();
        return IterableIterate.injectInto(result, iterable, PrimitiveFunctions.sumByLongFunction(groupBy, function));
    }

    public static <V, T> ObjectDoubleMap<V> sumByFloat(Iterable<T> iterable, Function<T, V> groupBy, FloatFunction<? super T> function)
    {
        ObjectDoubleHashMap<V> result = ObjectDoubleHashMap.newMap();
        return IterableIterate.injectInto(result, iterable, PrimitiveFunctions.sumByFloatFunction(groupBy, function));
    }

    public static <V, T> ObjectDoubleMap<V> sumByDouble(Iterable<T> iterable, Function<T, V> groupBy, DoubleFunction<? super T> function)
    {
        ObjectDoubleHashMap<V> result = ObjectDoubleHashMap.newMap();
        return IterableIterate.injectInto(result, iterable, PrimitiveFunctions.sumByDoubleFunction(groupBy, function));
    }

    /**
     * @see Iterate#injectIntoWith(Object, Iterable, Function3, Object)
     */
    public static <T, IV, P> IV injectIntoWith(
            IV injectValue,
            Iterable<T> iterable,
            Function3<? super IV, ? super T, ? super P, ? extends IV> function,
            P parameter)
    {
        return IteratorIterate.injectIntoWith(injectValue, iterable.iterator(), function, parameter);
    }

    public static <T> boolean anySatisfy(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IteratorIterate.anySatisfy(iterable.iterator(), predicate);
    }

    public static <T, P> boolean anySatisfyWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
    {
        return IteratorIterate.anySatisfyWith(iterable.iterator(), predicate, parameter);
    }

    public static <T> boolean allSatisfy(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IteratorIterate.allSatisfy(iterable.iterator(), predicate);
    }

    public static <T, P> boolean allSatisfyWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
    {
        return IteratorIterate.allSatisfyWith(iterable.iterator(), predicate, parameter);
    }

    public static <T> boolean noneSatisfy(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IteratorIterate.noneSatisfy(iterable.iterator(), predicate);
    }

    public static <T, P> boolean noneSatisfyWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
    {
        return IteratorIterate.noneSatisfyWith(iterable.iterator(), predicate, parameter);
    }

    public static <T> T detect(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IteratorIterate.detect(iterable.iterator(), predicate);
    }

    public static <T, P> T detectWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
    {
        return IteratorIterate.detectWith(iterable.iterator(), predicate, parameter);
    }

    /**
     * @see Iterate#removeIf(Iterable, Predicate)
     */
    public static <T> boolean removeIf(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IteratorIterate.removeIf(iterable.iterator(), predicate);
    }

    /**
     * @see Iterate#removeIfWith(Iterable, Predicate2, Object)
     */
    public static <T, P> boolean removeIfWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super P> predicate,
            P parameter)
    {
        return IteratorIterate.removeIfWith(iterable.iterator(), predicate, parameter);
    }

    public static <T> boolean removeIf(
            Iterable<T> iterable,
            Predicate<? super T> predicate,
            Procedure<? super T> procedure)
    {
        return IteratorIterate.removeIf(iterable.iterator(), predicate, procedure);
    }

    public static <T, P> boolean removeIfWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super P> predicate,
            P parameter,
            Procedure<? super T> procedure)
    {
        return IteratorIterate.removeIfWith(iterable.iterator(), predicate, parameter, procedure);
    }

    /**
     * @see Iterate#detectIndex(Iterable, Predicate)
     */
    public static <T> int detectIndex(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return IteratorIterate.detectIndex(iterable.iterator(), predicate);
    }

    /**
     * @see Iterate#detectIndexWith(Iterable, Predicate2, Object)
     */
    public static <T, IV> int detectIndexWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super IV> predicate,
            IV injectedValue)
    {
        return IteratorIterate.detectIndexWith(iterable.iterator(), predicate, injectedValue);
    }

    /**
     * @see Iterate#forEachWith(Iterable, Procedure2, Object)
     */
    public static <T, P> void forEachWith(
            Iterable<T> iterable,
            Procedure2<? super T, ? super P> procedure,
            P parameter)
    {
        IteratorIterate.forEachWith(iterable.iterator(), procedure, parameter);
    }

    /**
     * @see Iterate#collectWith(Iterable, Function2, Object)
     */
    public static <T, P, V> MutableList<V> collectWith(
            Iterable<T> iterable,
            Function2<? super T, ? super P, ? extends V> function,
            P parameter)
    {
        return IterableIterate.collectWith(iterable, function, parameter, FastList.<V>newList());
    }

    /**
     * @see Iterate#collectWith(Iterable, Function2, Object, Collection)
     */
    public static <T, P, A, R extends Collection<A>> R collectWith(
            Iterable<T> iterable,
            Function2<? super T, ? super P, ? extends A> function,
            P parameter,
            R targetCollection)
    {
        return IteratorIterate.collectWith(iterable.iterator(), function, parameter, targetCollection);
    }

    /**
     * @see Iterate#take(Iterable, int)
     */
    public static <T> Collection<T> take(Iterable<T> iterable, int count)
    {
        if (count < 0)
        {
            throw new IllegalArgumentException("Count must be greater than zero, but was: " + count);
        }
        return IterableIterate.take(iterable, count, FastList.<T>newList());
    }

    /**
     * @see Iterate#take(Iterable, int)
     */
    public static <T, R extends Collection<T>> R take(Iterable<T> iterable, int count, R targetCollection)
    {
        if (count < 0)
        {
            throw new IllegalArgumentException("Count must be greater than zero, but was: " + count);
        }

        int countCopy = count;
        Iterator<T> iterator = iterable.iterator();
        while (iterator.hasNext() && countCopy-- > 0)
        {
            targetCollection.add(iterator.next());
        }
        return targetCollection;
    }

    /**
     * @see Iterate#drop(Iterable, int)
     */
    public static <T> Collection<T> drop(Iterable<T> list, int count)
    {
        if (count < 0)
        {
            throw new IllegalArgumentException("Count must be greater than zero, but was: " + count);
        }
        return IterableIterate.drop(list, count, FastList.<T>newList());
    }

    /**
     * @see Iterate#drop(Iterable, int)
     */
    public static <T, R extends Collection<T>> R drop(Iterable<T> iterable, int count, R targetCollection)
    {
        if (count < 0)
        {
            throw new IllegalArgumentException("Count must be greater than zero, but was: " + count);
        }
        Iterator<T> iterator = iterable.iterator();
        for (int i = 0; iterator.hasNext(); i++)
        {
            T element = iterator.next();
            if (i >= count)
            {
                targetCollection.add(element);
            }
        }
        return targetCollection;
    }

    /**
     * @see RichIterable#appendString(Appendable, String, String, String)
     */
    public static <T> void appendString(
            Iterable<T> iterable,
            Appendable appendable,
            String start,
            String separator,
            String end)
    {
        try
        {
            appendable.append(start);

            Iterator<T> iterator = iterable.iterator();
            if (iterator.hasNext())
            {
                appendable.append(IterableIterate.stringValueOfItem(iterable, iterator.next()));
                while (iterator.hasNext())
                {
                    appendable.append(separator);
                    appendable.append(IterableIterate.stringValueOfItem(iterable, iterator.next()));
                }
            }

            appendable.append(end);
        }
        catch (IOException e)
        {
            throw new RuntimeException(e);
        }
    }

    /**
     * @see Iterate#groupBy(Iterable, Function)
     */
    public static <T, V> FastListMultimap<V, T> groupBy(
            Iterable<T> iterable,
            Function<? super T, ? extends V> function)
    {
        return IterableIterate.groupBy(iterable, function, new FastListMultimap<V, T>());
    }

    /**
     * @see Iterate#groupBy(Iterable, Function, MutableMultimap)
     */
    public static <T, V, R extends MutableMultimap<V, T>> R groupBy(
            Iterable<T> iterable,
            Function<? super T, ? extends V> function,
            R target)
    {
        return IteratorIterate.groupBy(iterable.iterator(), function, target);
    }

    /**
     * @see Iterate#groupByEach(Iterable, Function)
     */
    public static <T, V> FastListMultimap<V, T> groupByEach(
            Iterable<T> iterable,
            Function<? super T, ? extends Iterable<V>> function)
    {
        return IterableIterate.groupByEach(iterable, function, new FastListMultimap<V, T>());
    }

    /**
     * @see Iterate#groupByEach(Iterable, Function, MutableMultimap)
     */
    public static <T, V, R extends MutableMultimap<V, T>> R groupByEach(
            Iterable<T> iterable,
            Function<? super T, ? extends Iterable<V>> function,
            R target)
    {
        return IteratorIterate.groupByEach(iterable.iterator(), function, target);
    }

    /**
     * @see Iterate#groupByUniqueKey(Iterable, Function)
     */
    public static <K, T> MutableMap<K, T> groupByUniqueKey(
            Iterable<T> iterable,
            Function<? super T, ? extends K> function)
    {
        return IterableIterate.groupByUniqueKey(iterable, function, UnifiedMap.<K, T>newMap());
    }

    /**
     * @see Iterate#groupByUniqueKey(Iterable, Function, MutableMap)
     */
    public static <K, T, R extends MutableMap<K, T>> R groupByUniqueKey(
            Iterable<T> iterable,
            Function<? super T, ? extends K> function,
            R target)
    {
        return IteratorIterate.groupByUniqueKey(iterable.iterator(), function, target);
    }

    public static <T> T getOnly(Iterable<T> iterable)
    {
        Iterator<? extends T> iterator = iterable.iterator();
        if (!iterator.hasNext())
        {
            throw new IllegalArgumentException("Iterable is empty.");
        }

        T result = iterator.next();
        if (iterator.hasNext())
        {
            throw new IllegalArgumentException("Iterable has multiple values");
        }

        return result;
    }

    /**
     * @see Iterate#zip(Iterable, Iterable)
     */
    public static <X, Y> MutableList<Pair<X, Y>> zip(
            Iterable<X> xs,
            Iterable<Y> ys)
    {
        return IterableIterate.zip(xs, ys, FastList.<Pair<X, Y>>newList());
    }

    /**
     * @see Iterate#zip(Iterable, Iterable, Collection)
     */
    public static <X, Y, R extends Collection<Pair<X, Y>>> R zip(
            Iterable<X> xs,
            Iterable<Y> ys,
            R target)
    {
        return IteratorIterate.zip(xs.iterator(), ys.iterator(), target);
    }

    /**
     * @see Iterate#zipWithIndex(Iterable)
     */
    public static <T> MutableList<Pair<T, Integer>> zipWithIndex(Iterable<T> iterable)
    {
        return IterableIterate.zipWithIndex(iterable, FastList.<Pair<T, Integer>>newList());
    }

    /**
     * @see Iterate#zipWithIndex(Iterable, Collection)
     */
    public static <T, R extends Collection<Pair<T, Integer>>> R zipWithIndex(Iterable<T> iterable, R target)
    {
        return IteratorIterate.zipWithIndex(iterable.iterator(), target);
    }

    /**
     * @see Iterate#chunk(Iterable, int)
     */
    public static <T> RichIterable<RichIterable<T>> chunk(Iterable<T> iterable, int size)
    {
        return IteratorIterate.chunk(iterable.iterator(), size);
    }

    public static <T, V extends Comparable<? super V>> T maxBy(Iterable<T> iterable, Function<? super T, ? extends V> function)
    {
        return IteratorIterate.maxBy(iterable.iterator(), function);
    }

    public static <T, V extends Comparable<? super V>> T minBy(Iterable<T> iterable, Function<? super T, ? extends V> function)
    {
        return IteratorIterate.minBy(iterable.iterator(), function);
    }

    /**
     * @see Iterate#min(Iterable, Comparator)
     */
    public static <T> T min(Iterable<T> iterable, Comparator<? super T> comparator)
    {
        return IteratorIterate.min(iterable.iterator(), comparator);
    }

    /**
     * @see Iterate#max(Iterable, Comparator)
     */
    public static <T> T max(Iterable<T> iterable, Comparator<? super T> comparator)
    {
        return IteratorIterate.max(iterable.iterator(), comparator);
    }

    /**
     * @see Iterate#min(Iterable)
     */
    public static <T> T min(Iterable<T> iterable)
    {
        return IteratorIterate.min(iterable.iterator(), Comparators.naturalOrder());
    }

    /**
     * @see Iterate#max(Iterable)
     */
    public static <T> T max(Iterable<T> iterable)
    {
        return IteratorIterate.max(iterable.iterator(), Comparators.naturalOrder());
    }

    public static <T> void forEach(Iterable<T> iterable, int from, int to, Procedure<? super T> procedure)
    {
        if (from < 0 || to < 0)
        {
            throw new IllegalArgumentException("Neither from nor to may be negative.");
        }

        Iterator<T> iterator = IteratorIterate.advanceIteratorTo(iterable.iterator(), from);
        int i = from;
        while (iterator.hasNext() && i <= to)
        {
            procedure.value(iterator.next());
            i++;
        }
    }

    public static <T> void forEachWithIndex(List<T> iterable, int from, int to, ObjectIntProcedure<? super T> objectIntProcedure)
    {
        if (from < 0 || to < 0)
        {
            throw new IllegalArgumentException("Neither from nor to may be negative.");
        }

        Iterator<T> iterator = IteratorIterate.advanceIteratorTo(iterable.iterator(), from);
        int i = from;
        while (iterator.hasNext() && i <= to)
        {
            objectIntProcedure.value(iterator.next(), i++);
        }
    }

    public static <T> String stringValueOfItem(Iterable<T> iterable, T item)
    {
        return item == iterable
                ? "(this " + iterable.getClass().getSimpleName() + ')'
                : String.valueOf(item);
    }

    public static <T, K, V> MutableMap<K, V> aggregateInPlaceBy(
            Iterable<T> iterable,
            Function<? super T, ? extends K> groupBy,
            Function0<? extends V> zeroValueFactory,
            Procedure2<? super V, ? super T> mutatingAggregator)
    {
        return IteratorIterate.aggregateBy(iterable.iterator(), groupBy, zeroValueFactory, mutatingAggregator);
    }

    public static <T, K, V> MutableMap<K, V> aggregateBy(
            Iterable<T> iterable,
            Function<? super T, ? extends K> groupBy,
            Function0<? extends V> zeroValueFactory,
            Function2<? super V, ? super T, ? extends V> nonMutatingAggregator)
    {
        return IteratorIterate.aggregateBy(iterable.iterator(), groupBy, zeroValueFactory, nonMutatingAggregator);
    }
}


text:
def add_native_methods(clazz):
    def setNotificationEnabled__boolean__(a0, a1):
        raise NotImplementedError()

    def getDiagnosticCommands____(a0):
        raise NotImplementedError()

    def getDiagnosticCommandInfo__java_lang_String____(a0, a1):
        raise NotImplementedError()

    def executeDiagnosticCommand__java_lang_String__(a0, a1):
        raise NotImplementedError()

    clazz.setNotificationEnabled__boolean__ = setNotificationEnabled__boolean__
    clazz.getDiagnosticCommands____ = getDiagnosticCommands____
    clazz.getDiagnosticCommandInfo__java_lang_String____ = getDiagnosticCommandInfo__java_lang_String____
    clazz.executeDiagnosticCommand__java_lang_String__ = executeDiagnosticCommand__java_lang_String__


text:
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $EvaluatorArgs = {
    properties: {
        build_version_args: {
            type: 'BuildVersionEvaluatorArgs',
            isRequired: true,
        },
        consensus_proposals_args: {
            type: 'ConsensusProposalsEvaluatorArgs',
            isRequired: true,
        },
        consensus_round_args: {
            type: 'ConsensusRoundEvaluatorArgs',
            isRequired: true,
        },
        consensus_timeouts_args: {
            type: 'ConsensusTimeoutsEvaluatorArgs',
            isRequired: true,
        },
        handshake_args: {
            type: 'HandshakeEvaluatorArgs',
            isRequired: true,
        },
        hardware_args: {
            type: 'HardwareEvaluatorArgs',
            isRequired: true,
        },
        latency_args: {
            type: 'LatencyEvaluatorArgs',
            isRequired: true,
        },
        network_minimum_peers_args: {
            type: 'NetworkMinimumPeersEvaluatorArgs',
            isRequired: true,
        },
        network_peers_tolerance_args: {
            type: 'NetworkPeersWithinToleranceEvaluatorArgs',
            isRequired: true,
        },
        node_identity_args: {
            type: 'NodeIdentityEvaluatorArgs',
            isRequired: true,
        },
        state_sync_version_args: {
            type: 'StateSyncVersionEvaluatorArgs',
            isRequired: true,
        },
        transaction_availability_args: {
            type: 'TransactionAvailabilityEvaluatorArgs',
            isRequired: true,
        },
    },
} as const;