text:
package com.swfarm.biz.cs.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.swfarm.biz.chain.srv.ChainService;
import com.swfarm.biz.chain.web.ChainFrontHelper;
import com.swfarm.biz.cs.bo.SearchMailTemplatesCriteria;
import com.swfarm.biz.cs.srv.CustomerServiceService;
import com.swfarm.pub.framework.PaginationSupport;

public class ShowMailTemplatesController extends AbstractController {

	private ChainService chainService;

	private CustomerServiceService customerServiceService;

	public void setChainService(ChainService chainService) {
		this.chainService = chainService;
	}

	public void setCustomerServiceService(
			CustomerServiceService customerServiceService) {
		this.customerServiceService = customerServiceService;
	}

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		SearchMailTemplatesCriteria criteria = (SearchMailTemplatesCriteria) req
				.getAttribute("criteria");
		Map dataMap = new HashMap();
		String startIndexStr = req.getParameter("startIndex");
		String pageSizeStr = req.getParameter("pageSize");
		int startIndex = 0;
		int pageSize = 50;
		if (StringUtils.isNotEmpty(startIndexStr)) {
			startIndex = new Integer(startIndexStr).intValue();
		} else {
			String pageStr = req.getParameter("page");
			if (StringUtils.isNotEmpty(pageStr)) {
				startIndex = PaginationSupport.getPageStartIndex(new Integer(
						pageStr), pageSize);
			}
		}
		if (StringUtils.isNotEmpty(pageSizeStr)) {
			pageSize = new Integer(pageSizeStr);
		}
		if (criteria == null) {
			criteria = new SearchMailTemplatesCriteria();
		}
		PaginationSupport pagination = this.customerServiceService
				.searchMailTemplates(criteria, startIndex, pageSize);
		int page = pagination.getPage(startIndex);
		int[] pageRange = pagination.getPageRange(page);
		dataMap.put("pagination", pagination);
		dataMap.put("currentPage", page);
		dataMap.put("pageRange", pageRange);
		List customerServices = ChainFrontHelper.getCustomerServices();
		dataMap.put("customerServices", customerServices);
		List saleChannels = this.chainService.findSaleChannels();
		dataMap.put("saleChannels", saleChannels);
		return new ModelAndView("cs/mailtemplates", dataMap);
	}
}


text:
[![CI Status](http://img.shields.io/travis/DmitrySmolyakov/DocumentReader.svg?style=flat)](https://travis-ci.org/DmitrySmolyakov/DocumentReader)
[![Version](https://img.shields.io/cocoapods/v/DocumentReader.svg?style=flat)](http://cocoapods.org/pods/DocumentReader)
[![License](https://img.shields.io/cocoapods/l/DocumentReader.svg?style=flat)](http://cocoapods.org/pods/DocumentReader)
[![Platform](https://img.shields.io/cocoapods/p/DocumentReader.svg?style=flat)](http://cocoapods.org/pods/DocumentReader)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

DocumentReader is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "DocumentReader"
```

## Author

DmitrySmolyakov, dm.smolyakov@gmail.com

## License

DocumentReader is available under the MIT license. See the LICENSE file for more info.

redpajama_set_name: RedPajamaGithub


text:
/*pagging******************************************************************************/

.custompagination ul li {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: inline;
}

.custompagination ul li .mat-raised-button,
.custompagination ul li .mat-button {
    min-width: 0 !important;
}

/**************************************************************************************/


text:
var server = require('./server')
  , assert = require('assert')
  , request = require('../main.js')
  ;

var s = server.createServer();

s.listen(s.port, function () {
  var counter = 0;
  s.on('/get', function (req, resp) {
    assert.equal(req.headers.foo, 'bar');
    assert.equal(req.method, 'GET')
    resp.writeHead(200, {'Content-Type': 'text/plain'});
    resp.end('TESTING!');
  });

  // test get(string, function)
  request.defaults({headers:{foo:"bar"}})(s.url + '/get', function (e, r, b){
    if (e) throw e;
    assert.deepEqual("TESTING!", b);
    counter += 1;
  });

  s.on('/post', function (req, resp) {
    assert.equal(req.headers.foo, 'bar');
    assert.equal(req.headers['content-type'], 'application/json');
    assert.equal(req.method, 'POST')
    resp.writeHead(200, {'Content-Type': 'application/json'});
    resp.end(JSON.stringify({foo:'bar'}));
  });

  // test post(string, object, function)
  request.defaults({headers:{foo:"bar"}}).post(s.url + '/post', {json: true}, function (e, r, b){
    if (e) throw e;
    assert.deepEqual('bar', b.foo);
    counter += 1;
  });

  s.on('/del', function (req, resp) {
    assert.equal(req.headers.foo, 'bar');
    assert.equal(req.method, 'DELETE')
    resp.writeHead(200, {'Content-Type': 'application/json'});
    resp.end(JSON.stringify({foo:'bar'}));
  });

  // test .del(string, function)
  request.defaults({headers:{foo:"bar"}, json:true}).del(s.url + '/del', function (e, r, b){
    if (e) throw e;
    assert.deepEqual('bar', b.foo);
    counter += 1;
  });

  s.on('/head', function (req, resp) {
    assert.equal(req.headers.foo, 'bar');
    assert.equal(req.method, 'HEAD')
    resp.writeHead(200, {'Content-Type': 'text/plain'});
    resp.end();
  });

  // test head.(object, function)
  request.defaults({headers:{foo:"bar"}}).head({uri: s.url + '/head'}, function (e, r, b){
    if (e) throw e;
    counter += 1;
  });

  s.on('/get_custom', function(req, resp) {
    assert.equal(req.headers.foo, 'bar');
    assert.equal(req.headers.x, 'y');
    resp.writeHead(200, {'Content-Type': 'text/plain'});
    resp.end();
  });

  // test custom request handler function
  var defaultRequest = request.defaults({
    headers:{foo:"bar"}
    , body: 'TESTING!'
  }, function(uri, options, callback) {
    var params = request.initParams(uri, options, callback);
    options = params.options;
    options.headers.x = 'y';

    return request(params.uri, params.options, params.callback);
  });

  var msg = 'defaults test failed. head request should throw earlier';
  assert.throws(function() {
    defaultRequest.head(s.url + '/get_custom', function(e, r, b) {
      throw new Error(msg);
    });
    counter+=1;
  }, msg);

  defaultRequest.get(s.url + '/get_custom', function(e, r, b) {
    if(e) throw e;
    counter += 1;
    console.log(counter.toString() + " tests passed.");
    s.close();
  });
})


text:
angular.module('GulpAngularUiApp').controller('restaurantSearchController',['$scope','restaurantService',
		function($scope , restaurantService) {

            'use strict';

			$scope.searchForm = {'searchKey' : ''};

			$scope.formKeyUp = function(event) {

				if(event.keyCode === 13){
					queryApi();
				}
			};

			var queryApi = function() {
				var searchKey = $scope.searchForm.searchKey;

				restaurantService.getAll(searchKey).then(function(data) {
					$scope.restaurantList = data;
				});
			};

		}]);


text:
'use strict';

const assert = require('assert');
let battle;

describe('Lightning Rod', function () {
	afterEach(function () {
		battle.destroy();
	});

	it('should grant immunity to Electric-type moves and boost Special Attack by 1 stage', function () {
		battle = BattleEngine.Battle.construct();
		battle.join('p1', 'Guest 1', 1, [{species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']}]);
		battle.join('p2', 'Guest 2', 1, [{species: 'Jolteon', ability: 'static', moves: ['thunderbolt']}]);
		battle.commitDecisions();
		assert.strictEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp);
		assert.strictEqual(battle.p1.active[0].boosts['spa'], 1);
	});

	it('should not boost Special Attack if the user is already immune to Electric-type moves', function () {
		battle = BattleEngine.Battle.construct();
		battle.join('p1', 'Guest 1', 1, [{species: 'Rhydon', ability: 'lightningrod', moves: ['sleeptalk']}]);
		battle.join('p2', 'Guest 2', 1, [{species: 'Jolteon', ability: 'static', moves: ['thunderbolt']}]);
		battle.commitDecisions();
		assert.strictEqual(battle.p1.active[0].boosts['spa'], 0);
	});

	it('should redirect single-target Electric-type attacks to the user if it is a valid target', function () {
		this.timeout(3000);
		battle = BattleEngine.Battle.construct('battle-triples-lightningrod', 'triplescustomgame');
		battle.join('p1', 'Guest 1', 1, [
			{species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']},
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
		]);
		battle.join('p2', 'Guest 2', 1, [
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
		]);
		battle.commitDecisions(); // Team Preview
		battle.choose('p1', 'move 1, move 1 1, move 1 1');
		battle.choose('p2', 'move 1 3, move 1 3, move 1 2');
		assert.strictEqual(battle.p1.active[0].boosts['spa'], 3);
		assert.notStrictEqual(battle.p1.active[2].hp, battle.p1.active[2].maxhp);
		assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp);
	});

	it('should redirect to the fastest Pokemon with the ability', function () {
		battle = BattleEngine.Battle.construct('battle-lightningrod-speed', 'doublescustomgame');
		battle.join('p1', 'Guest 1', 1, [
			{species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']},
			{species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']},
		]);
		battle.join('p2', 'Guest 2', 1, [
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
		]);
		battle.commitDecisions(); // Team Preview
		battle.p1.active[0].boostBy({spe: 6});
		battle.choose('p1', 'move 1, move 1');
		battle.choose('p2', 'move 1 1, move 1 2');
		assert.strictEqual(battle.p1.active[0].boosts['spa'], 2);
		assert.strictEqual(battle.p1.active[1].boosts['spa'], 0);
	});

	it('should redirect to the Pokemon having the ability longest', function () {
		battle = BattleEngine.Battle.construct('battle-lightningrod-speed', 'doublescustomgame');
		battle.join('p1', 'Guest 1', 1, [
			{species: 'Meloetta', ability: 'serenegrace', moves: ['roleplay']},
			{species: 'Pikachu', ability: 'lightningrod', moves: ['sleeptalk']},
		]);
		battle.join('p2', 'Guest 2', 1, [
			{species: 'Pichu', ability: 'static', moves: ['thunderbolt']},
			{species: 'Pichu', ability: 'static', moves: ['thunderbolt']},
		]);
		battle.commitDecisions(); // Team Preview
		battle.choose('p1', 'move 1 -2, move 1');
		battle.choose('p2', 'move 1 1, move 1 2');
		assert.strictEqual(battle.p1.active[0].boosts['spa'], 0);
		assert.strictEqual(battle.p1.active[1].boosts['spa'], 2);
	});

	it('should not redirect if another Pokemon has used Follow Me', function () {
		battle = BattleEngine.Battle.construct('battle-lightningrod-followme', 'doublescustomgame');
		battle.join('p1', 'Guest 1', 1, [
			{species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']},
			{species: 'Manectric', ability: 'static', moves: ['followme']},
		]);
		battle.join('p2', 'Guest 2', 1, [
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
			{species: 'Electrode', ability: 'static', moves: ['thunderbolt']},
		]);
		battle.commitDecisions(); // Team Preview
		battle.p1.active[0].boostBy({spe: 6});
		battle.choose('p1', 'move 1, move 1');
		battle.choose('p2', 'move 1 2, move 1 1');
		assert.strictEqual(battle.p1.active[0].boosts['spa'], 0);
		assert.notStrictEqual(battle.p1.active[1].hp, battle.p1.active[1].maxhp);
	});

	it('should have its Electric-type immunity and its ability to redirect moves suppressed by Mold Breaker', function () {
		battle = BattleEngine.Battle.construct('battle-moldbreaker-lightningrod', 'doublescustomgame');
		battle.join('p1', 'Guest 1', 1, [
			{species: 'Manectric', ability: 'lightningrod', moves: ['endure']},
			{species: 'Manaphy', ability: 'hydration', moves: ['tailglow']},
		]);
		battle.join('p2', 'Guest 2', 1, [
			{species: 'Haxorus', ability: 'moldbreaker', moves: ['thunderpunch']},
			{species: 'Zekrom', ability: 'teravolt', moves: ['shockwave']},
		]);
		battle.commitDecisions(); // Team Preview
		battle.choose('p2', 'move 1 1, move 1 2');
		battle.commitDecisions();
		assert.notStrictEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp);
		assert.notStrictEqual(battle.p1.active[1].hp, battle.p1.active[1].maxhp);
	});
});


text:
import { bind } from '@ember/runloop';
import { action } from '@ember/object';
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';

export default class DrilldownController extends Controller {
  @tracked dtitle;

  baseData = [
    ['Blue Flowers', 30],
    ['Red Flowers', 120],
    ['Yellow Flowers', 300]
  ];

  blueFlowers = [
    ['Wolfsbane', 5],
    ['Cornflower', 17],
    ['Hydrangea', 24],
    ['Triteleia', 51],
    ['Vanda', 3]
  ];

  redFlowers = [
    ['Chrysanthemum', 15],
    ['Poppy', 2],
    ['Peony', 34],
    ['Azalea', 37],
    ['Gloxinia', 5]
  ];

  yellowFlowers = [
    ['Marigold', 25],
    ['Yarrow', 10],
    ['Begonia', 21],
    ['Daisy', 39],
    ['Snapdragon', 5]
  ];

  whiteFlowers = [['White Flowers', 60]];

  // chart title
  title = { text: 'Flowers by Color' };
  padding = { top: 20 };

  unloadWhite = this.whiteFlowers.map(item => item[0]);
  unloadBlue = this.blueFlowers.map(item => item[0]);
  unloadRed = this.redFlowers.map(item => item[0]);
  unloadYellow = this.yellowFlowers.map(item => item[0]);

  // get chart object from component
  @action
  getChart(chart) {
    this.chart = chart;
  }

  // iris data from R
  get data() {
    return {
      columns: [
        ['Blue Flowers', 30],
        ['Red Flowers', 120],
        ['Yellow Flowers', 300]
      ],
      type: 'pie',
      onclick: bind(this, this.myClick)
    };
  }

  myClick(data) {
    switch (data.name) {
      case 'Blue Flowers':
        this.drilldownBlue();
        break;

      case 'Red Flowers':
        this.drilldownRed();
        break;

      case 'Yellow Flowers':
        this.drilldownYellow();
        break;
    }
  }

  @action
  addWhite() {
    this.dtitle = { text: 'Four Colors', refresh: false };
    this.chart.load({ columns: this.whiteFlowers });
  }

  @action
  titleOnly() {
    this.dtitle = { text: 'Flowers are Colorful!!!', refresh: false };
  }

  @action
  resetData() {
    let c = this.chart;
    this.dtitle = { text: 'Flowers by Color', refresh: false };
    c.load({ columns: this.baseData });
    c.unload(
      this.unloadBlue
        .concat(this.unloadRed)
        .concat(this.unloadYellow)
        .concat(this.unloadWhite)
    );
  }

  drilldownBlue() {
    let c = this.chart;
    this.dtitle = { text: 'Four Colors', refresh: false };
    c.load({ columns: this.blueFlowers });
    c.unload([
      'Blue Flowers',
      'Red Flowers',
      'Yellow Flowers',
      'White Flowers'
    ]);
  }

  drilldownRed() {
    let c = this.chart;
    this.dtitle = { text: 'Red Flowers', refresh: false };
    c.load({ columns: this.redFlowers });
    c.unload([
      'Blue Flowers',
      'Red Flowers',
      'Yellow Flowers',
      'White Flowers'
    ]);
  }

  drilldownYellow() {
    let c = this.chart;
    this.dtitle = { text: 'Yellow Flowers', refrehs: false };
    c.load({ columns: this.yellowFlowers });
    c.unload([
      'Blue Flowers',
      'Red Flowers',
      'Yellow Flowers',
      'White Flowers'
    ]);
  }
}


text:
class Peptide:
	def __init__(self, seq, pro_id, modif, mass, is_nterm):
		self.seq = seq
		self.length = len(self.seq)
		self.pro_id = [pro_id]
		self.modif = modif
		self.mass_array = self.get_mass_array(mass)
		self.total_res_mass = self.get_total_res_mass()
		self.prec_mass = self.get_prec_mass(mass)
		self.is_nterm = is_nterm

	def get_mass_array(self, mass):
		mass_array = []
		seq = self.seq
		pos = self.modif['position']
		delta_mass = self.modif['delta_mass']

		for i in range(self.length):
			mass_array.append(mass[seq[i].upper()])

		for i in range(len(pos)):
			mass_array[pos[i]] += delta_mass[i]

		return mass_array

	def get_total_res_mass(self):
		total_res_mass = sum(self.mass_array)

		return total_res_mass

	def get_prec_mass(self, mass):
		prec_mass = self.total_res_mass
		prec_mass = prec_mass + mass['Hatom'] * 2 + mass['Oatom']

		return prec_mass

	def get_mass_list(self, mass, param):
		mass_list = []
		fwd_mass = 0
		mass_array = self.mass_array
		total_res_mass = self.total_res_mass
		use_a_ion = param['use_a_ion']

		for i in range(self.length - 1):
			frag = dict()
			fwd_mass += mass_array[i]
			rev_mass = total_res_mass - fwd_mass
			frag['b'] = fwd_mass + mass['b_ion_res']
			frag['y'] = rev_mass + mass['y_ion_res']
			if use_a_ion:
				frag['a'] = fwd_mass + mass['a_ion_res']
			mass_list.append(frag)

		return mass_list


text:
package com.mrmq.poker.client.impl;

import java.util.Iterator;

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

import com.mrmq.poker.client.AbstractClientHandler;
import com.mrmq.poker.client.manager.PokerClientManager;
import com.mrmq.poker.common.proto.AdminServiceProto.LoginResponse;
import com.mrmq.poker.common.proto.AdminServiceProto.UpdateUserResponse;
import com.mrmq.poker.common.proto.PokerModelProto.ActionType;
import com.mrmq.poker.common.proto.PokerModelProto.Table;
import com.mrmq.poker.common.proto.PokerServiceProto.EndGameEvent;
import com.mrmq.poker.common.proto.PokerServiceProto.JoinTableResponse;
import com.mrmq.poker.common.proto.PokerServiceProto.NewRoundEvent;
import com.mrmq.poker.common.proto.PokerServiceProto.PlayerActionEvent;
import com.mrmq.poker.common.proto.PokerServiceProto.StartGameEvent;
import com.mrmq.poker.common.proto.PokerServiceProto.TableResponse;
import com.mrmq.poker.common.proto.Rpc.RpcMessage;
import com.mrmq.poker.common.proto.Rpc.RpcMessage.Result;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker;

public class PokerClientHandler extends AbstractClientHandler {
	private static Logger log = LoggerFactory.getLogger(PokerClientHandler.class);

	private int position;
	private long lastBet = 0;
    private Table table;

	public PokerClientHandler(WebSocketClientHandshaker handshaker) {
		super(handshaker);
	}

	protected void handleRpcMessage(ChannelHandlerContext ctx, RpcMessage msg) throws Exception {
		log.info("Received RpcMessage, id: {}, payload: {}", msg.getId(), msg.getPayloadClass());

		Thread.sleep(1000);

		if(LoginResponse.getDescriptor().getName().equals(msg.getPayloadClass())) {
			//Login
			if(msg.getResult() == Result.SUCCESS) {
				RpcMessage tableRequest = PokerClientManager.createTableRequest();
				request(ctx, tableRequest);
			}
		}

		if(TableResponse.getDescriptor().getName().equals(msg.getPayloadClass())) {
			TableResponse response = TableResponse.parseFrom(msg.getPayloadData());
			log.info("TableResponse: " + response);

			if(response.getTablesCount() > 0) {
				Iterator<Table> iter = response.getTablesList().iterator();
				Table tempTable = null;

				if(table == null) {
					table = iter.next();
				} else
				while(iter.hasNext()) {
					tempTable = iter.next();
					if(tempTable.getTableId().equals(table.getTableId())) {
						table = tempTable;
						break;
					}
				}

				if(tempTable == null || table == tempTable) {
					log.info("Join to table: {}", table);

					RpcMessage joinTableRequest = PokerClientManager.createJoinTableRequest(table, position);
					request(ctx, joinTableRequest);
				} else
					log.warn("Not found table to join, Table: {}", table);
			}
		}

		if(JoinTableResponse.getDescriptor().getName().equals(msg.getPayloadClass())) {
			JoinTableResponse response = JoinTableResponse.parseFrom(msg.getPayloadData());
			log.info("JoinTableResponse: {}", response);
		}

		if(StartGameEvent.getDescriptor().getName().equals(msg.getPayloadClass())) {
			StartGameEvent gameEvent = StartGameEvent.parseFrom(msg.getPayloadData());
			log.info("StartGameEvent: {}", gameEvent);
			lastBet = table.getTableRule().getBigBlind();
		}

		if(NewRoundEvent.getDescriptor().getName().equals(msg.getPayloadClass())) {
			NewRoundEvent gameEvent = NewRoundEvent.parseFrom(msg.getPayloadData());
			log.info("NewRoundEvent: {}", gameEvent);

			if(gameEvent.getFirstPlayerId().equals(loginId)) {
				Thread.sleep(5000);

				RpcMessage actionRequest = PokerClientManager.createActionRequest(table, loginId, ActionType.RAISE, lastBet);
				request(ctx, actionRequest);
			}
		}

		if(EndGameEvent.getDescriptor().getName().equals(msg.getPayloadClass())) {
			EndGameEvent gameEvent = EndGameEvent.parseFrom(msg.getPayloadData());
			log.info("EndGameEvent: {}", gameEvent);
		}

		if(PlayerActionEvent.getDescriptor().getName().equals(msg.getPayloadClass())) {
			PlayerActionEvent gameEvent = PlayerActionEvent.parseFrom(msg.getPayloadData());
			log.info("PlayerActionEvent: {}", gameEvent);
			lastBet = gameEvent.getRaiseAmount();

			if(gameEvent.getNextPlayerId().equals(loginId)) {
				Thread.sleep(5000);

				RpcMessage actionRequest = PokerClientManager.createActionRequest(table, loginId, ActionType.CALL, lastBet);
				request(ctx, actionRequest);
			}
		}

		if(UpdateUserResponse.getDescriptor().getName().equals(msg.getPayloadClass())) {
			UpdateUserResponse response = UpdateUserResponse.parseFrom(msg.getPayloadData());
			log.info("UpdateUserResponse: {}", response);
		}
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}

	public Table getTable() {
		return table;
	}

	public void setTable(Table table) {
		this.table = table;
	}
}


text:
#ifndef _DUDE_DUMBSTER_PARSER_H
#define _DUDE_DUMBSTER_PARSER_H

#include <list>

# include "dude/dumbster/fragments.hpp"
# include "dude/lexer/lexer.hpp"
# include "dude/filesystem/file.hpp"

namespace dude {
namespace dumbster {

  using dude::ex::yet_undefined_exception;
  using dude::fs::File;

  using dude::lexer::Lexer;
  using dude::lexer::Token;

  namespace xfs = boost::filesystem;

  /**
   */
  class Parser {
    protected:
      File _file;
      Lexer _alex;
      std::list<Token> _tokens;
      std::list<Token>::iterator current_token_it_;
      std::list<Token> _stack;
      Fragment *fragments_;
    public:
      explicit Parser(xfs::path fileName);

      /// Fetch one more token from the lexer.
      Token& next_token();

      /// Rewind back one token.
      Token& rewind_token();

      /// Returns the current token from the `_tokens` list (of lexed tokens).
      Token& token();

      /// TRUE if current token is a single-byte character matching `ch`.
      bool matchSymbol(char ch);

      /// Push onto the parsing `_stack` a (possibly multi-byte character `mch`
      /// that is expected by some [non-]terminal.
      void pushExpectedSymbol(const char *mch);

      template<typename... TokenCtorArgs>
        void pushExpectedToken(TokenCtorArgs&&... args)
        {
          _stack.emplace_front(std::forward<TokenCtorArgs>(args)...);
        }

      /// Pop one token off the top of the "expected tokens stack".
      /// `tok` argument is compared against the token about to be poped off,
      /// (and an exception is thrown in case both do not match).
      Token popExpectedToken(const Token& tok);

      /// Tells whether `tok` matches a token that is expected by some
      /// non-terminal.
      bool isExpected(const Token& tok);

      void parse();
      void dev_parse();

      Fragment * nt_whatever(Fragment *previous, int depth);
      Fragment * nt_curly_block(Fragment *preceding, int depth);
      void debug_print_ast(std::ostream& os);
  };

} // dumbster ns.
} // dude ns.

#endif // _DUDE_DUMBSTER_PARSER_H


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace Rendition {
    public partial class Commerce {
        /// <summary>
        /// This class creates a single review made of an item
        /// An instance of rendtion._site must exist to use this class
        /// </summary>
        public class Review {
            #region Static Properties
            /// <summary>
            /// Gets all Replies.
            /// </summary>
            public static List<Review> All {
                get {
                    return Main.Site.Reviews.List;
                }
            }
            #endregion
            #region Instance Properties
            /// <summary>
            /// Id of the view
            /// </summary>
            public Guid Id { get; internal set; }
            /// <summary>
            /// userId of ther user who made the review.
            /// </summary>
            public int UserId { get; internal set; }
            /// <summary>
            /// Rating the user gave this object.
            /// </summary>
            public double Rating { get; internal set; }
            /// <summary>
            /// The message attached to the review.
            /// </summary>
            public string Value { get; internal set; }
            /// <summary>
            /// If this review has been placed in the archive (no longer visible).
            /// </summary>
            public bool Archive { get; internal set; }
            /// <summary>
            /// The date this review as made on.
            /// </summary>
            public DateTime Date { get; internal set; }
            /// <summary>
            /// The reference for this review (e.g.: the item number being reviewed).
            /// </summary>
            public string RefId { get; internal set; }
            /// <summary>
            /// What type of object is being reviewed (e.g.: "itemNumber")
            /// </summary>
            public string RefType { get; internal set; }
            /// <summary>
            /// The user who created the review.
            /// </summary>
            public User User { get; internal set; }
            #endregion
            #region Constructors
            /// <summary>
            /// Initializes a new instance of the <see cref="Review"/> class.
            /// </summary>
            /// <param name="f_id">The f_id.</param>
            /// <param name="f_userId">The f_user id.</param>
            /// <param name="f_rating">The f_rating.</param>
            /// <param name="f_value">The f_value.</param>
            /// <param name="f_archive">if set to <c>true</c> [f_archive].</param>
            /// <param name="f_date">The f_date.</param>
            /// <param name="f_refId">The f_ref id.</param>
            /// <param name="f_refType">Type of the f_ref.</param>
            /// <param name="site">The site.</param>
            public Review(Guid f_id, int f_userId, double f_rating, string f_value, bool f_archive,
            DateTime f_date, string f_refId, string f_refType, Site site) {
                Id = f_id;
                UserId = f_userId;
                Rating = f_rating;
                Value = f_value;
                Archive = f_archive;
                Date = f_date;
                RefId = f_refId;
                RefType = f_refType;
                User = site.Users.List.Find(delegate(User u) {
                    return u.UserId == f_userId;
                });
            }
            #endregion
            #region Static Methods
            /// <summary>
            /// creates a review for a hash match object accessable later thru _site._reviews
            /// </summary>
            /// <param name="args">JSON Object containging
            ///review_rating,
            ///review_message,
            ///review_objId,
            ///review_objType</param>
            /// <returns>{reviewId:Guid,userId:Int,rating:Int,value:string,archive:bool
            /// addDate:date,refType:string,refId:string,error:int,errorDesc:string}.</returns>
            public static Dictionary<string, object> AddReview(Dictionary<string, object> args) {
                ("FUNCTION /w SP addReview").Debug(10);
                Dictionary<string, object> j = new Dictionary<string, object>();
                Session session = null;
                if(args.ContainsKey("sessionId")) {
                    session = new Session(Main.Site, new Guid((string)args["sessionId"]));
                } else {
                    session = Main.GetCurrentSession();
                }
                Guid reviewId = Guid.NewGuid();
                SqlCommand cmd = new SqlCommand("dbo.insertReview @reviewId,@userId,@rating,@message,@refId,@archive,@addDate,@refType", Site.SqlConnection);
                cmd.Parameters.Add("@reviewId", SqlDbType.UniqueIdentifier).Value = new Guid(reviewId.ToString());
                cmd.Parameters.Add("@userId", SqlDbType.Int).Value = session.UserId;
                cmd.Parameters.Add("@rating", SqlDbType.Int).Value = Convert.ToInt32(args["rating"]);
                cmd.Parameters.Add("@message", SqlDbType.VarChar).Value = Convert.ToString(args["message"]);
                cmd.Parameters.Add("@refId", SqlDbType.VarChar, 50).Value = Convert.ToString(args["objId"]);
                cmd.Parameters.Add("@archive", SqlDbType.Bit).Value = false;
                cmd.Parameters.Add("@addDate", SqlDbType.DateTime).Value = DateTime.Now;
                cmd.Parameters.Add("@refType", SqlDbType.VarChar, 50).Value = Convert.ToString(args["objType"]);
                cmd.ExecuteNonQuery();
                cmd.Dispose();
                /* add to review list in memory */
                Commerce.Review rev = new Commerce.Review(reviewId, Main.GetCurrentSession().UserId, (float)Convert.ToInt32(args["rating"]),
                Convert.ToString(args["message"]), false, DateTime.Now, Convert.ToString(args["objId"]), Convert.ToString(args["objType"]), Main.Site);
                Main.Site.Reviews.List.Add(rev);
                if(Convert.ToString(args["objType"]).l() == "itemnumber") {
                    Commerce.Item i = Main.Site.Items.List.Find(delegate(Commerce.Item itm) {
                        return itm.ItemNumber.l() == Convert.ToString(args["objId"]).l();
                    });
                    /* refresh item item in-memory as well*/
                    if(i != null) {
                        i.RefreshReviews();
                    }
                }
                j.Add("reviewId", rev.Id.ToString());
                j.Add("userId", rev.UserId);
                j.Add("rating", rev.Rating);
                j.Add("message", rev.Value);
                j.Add("archive", rev.Archive);
                j.Add("addDate", rev.Date);
                j.Add("refType", rev.RefType);
                j.Add("refId", rev.RefId);
                j.Add("error", 0);
                j.Add("errorDesc", "");
                return j;
            }
            #endregion
        }
        /// <summary>
        /// This is a list of all reviews on the site.
        /// </summary>
        public class Reviews {
            #region Instance Fields
            /// <summary>
            /// This is a list of all reviews on the site.
            /// </summary>
            public List<Review> List = new List<Review>();
            #endregion
            #region Instance Methods
            private void Add(Review newProperty) {
                List.Add(newProperty);
            }
            #endregion
            #region Constructors
            /// <summary>
            /// Initializes a new instance of the <see cref="Reviews"/> class.
            /// </summary>
            /// <param name="site">The site.</param>
            public Reviews(Site site) {
                using(SqlConnection cn = Site.CreateConnection(true, true)) {
                    cn.Open();
                    using(SqlCommand cmd = new SqlCommand("dbo.getReviews", cn)) {
                        using(SqlDataReader review_list = cmd.ExecuteReader()) {
                            while(review_list.Read()) {
                                List.Add(new Review(
                                    review_list.GetGuid(0),
                                    review_list.GetInt32(1),
                                    review_list.GetDouble(2),
                                    review_list.GetString(3),
                                    review_list.GetBoolean(4),
                                    review_list.GetDateTime(5),
                                    review_list.GetString(6),
                                    review_list.GetString(7),
                                    site
                                ));
                            }
                        }
                    }
                }
                return;
            }
            #endregion
        }
    }
}


text:
import { Node } from "../../display/Node";
import { Loader } from "../../net/Loader";
import { Animator } from "../component/Animator";
import { Vector3 } from "../math/Vector3";
import { Vector4 } from "../math/Vector4";
import { Mesh } from "../resource/models/Mesh";
import { Shader3D } from "../shader/Shader3D";
import { Utils3D } from "../utils/Utils3D";
import { Avatar } from "./Avatar";
import { Bounds } from "./Bounds";
import { MeshFilter } from "./MeshFilter";
import { MeshSprite3D } from "./MeshSprite3D";
import { RenderableSprite3D } from "./RenderableSprite3D";
import { SkinnedMeshRenderer } from "./SkinnedMeshRenderer";
import { Sprite3D } from "./Sprite3D";
import { Material } from "./material/Material";
import { SkinnedMeshSprite3DShaderDeclaration } from "./SkinnedMeshSprite3DShaderDeclaration";

/**
 * SkinnedMeshSprite3D 类用于绑点骨骼节点精灵。
 */
export class SkinnedMeshSprite3D extends RenderableSprite3D {
	/**@internal */
	static _tempArray0: any[] = [];

	/**着色器变量名,蒙皮动画。*/
	static BONES: number = Shader3D.propertyNameToID("u_Bones");
	/**简单动画变量名,贴图蒙皮动画*/
	static SIMPLE_SIMPLEANIMATORTEXTURE:number = Shader3D.propertyNameToID("u_SimpleAnimatorTexture");
	static SIMPLE_SIMPLEANIMATORPARAMS:number = Shader3D.propertyNameToID("u_SimpleAnimatorParams");
	static SIMPLE_SIMPLEANIMATORTEXTURESIZE:number = Shader3D.propertyNameToID("u_SimpleAnimatorTextureSize");
	/**
	 * @internal
	 */
	static __init__(): void {
		SkinnedMeshSprite3DShaderDeclaration.SHADERDEFINE_BONE = Shader3D.getDefineByName("BONE");
		SkinnedMeshSprite3DShaderDeclaration.SHADERDEFINE_SIMPLEBONE = Shader3D.getDefineByName("SIMPLEBONE");
	}

	/** @internal */
	private _meshFilter: MeshFilter;

	/**
	 * 网格过滤器。
	 */
	get meshFilter(): MeshFilter {
		return this._meshFilter;
	}

	/**
	 * 网格渲染器。
	 */
	get skinnedMeshRenderer(): SkinnedMeshRenderer {
		return (<SkinnedMeshRenderer>this._render);
	}

	/**
	 * 创建一个 MeshSprite3D 实例。
	 * @param mesh 网格,同时会加载网格所用默认材质。
	 * @param name 名字。
	 */
	constructor(mesh: Mesh = null, name: string = null) {
		super(name);
		this._meshFilter = new MeshFilter(this);
		this._render = new SkinnedMeshRenderer(this);
		(mesh) && (this._meshFilter.sharedMesh = mesh);
	}

	/**
	 * @inheritDoc
	 * @override
	 * @internal
	 */
	_parse(data: any, spriteMap: any): void {
		super._parse(data, spriteMap);
		var render: SkinnedMeshRenderer = this.skinnedMeshRenderer;
		var lightmapIndex: any = data.lightmapIndex;
		(lightmapIndex != null) && (render.lightmapIndex = lightmapIndex);
		var lightmapScaleOffsetArray: any[] = data.lightmapScaleOffset;
		(lightmapScaleOffsetArray) && (render.lightmapScaleOffset = new Vector4(lightmapScaleOffsetArray[0], lightmapScaleOffsetArray[1], lightmapScaleOffsetArray[2], lightmapScaleOffsetArray[3]));
		(data.enableRender != undefined) && (render.enable = data.enableRender);
		(data.receiveShadows != undefined) && (render.receiveShadow = data.receiveShadows);
		(data.castShadow != undefined) && (render.castShadow = data.castShadow);
		var meshPath: string;
		meshPath = data.meshPath;
		if (meshPath) {
			var mesh: Mesh = Loader.getRes(meshPath);//加载失败mesh为空
			(mesh) && (this.meshFilter.sharedMesh = mesh);
		}

		var materials: any[] = data.materials;
		if (materials) {
			var sharedMaterials: Material[] = render.sharedMaterials;
			var materialCount: number = materials.length;
			sharedMaterials.length = materialCount;
			for (var i: number = 0; i < materialCount; i++) {
				sharedMaterials[i] = Loader.getRes(materials[i].path);
			}
			render.sharedMaterials = sharedMaterials;
		}

		var boundBox: any = data.boundBox;
		var min: any[] = boundBox.min;
		var max: any[] = boundBox.max;
		render.localBounds.setMin(new Vector3(min[0], min[1], min[2]));
		render.localBounds.setMax(new Vector3(max[0], max[1], max[2]));

		if (spriteMap) {
			var rootBoneData: number = data.rootBone;
			render.rootBone = spriteMap[rootBoneData];
			var bonesData: any[] = data.bones;
			var n: number;
			for (i = 0, n = bonesData.length; i < n; i++)
				render.bones.push(spriteMap[bonesData[i]]);
		} else {//[兼容代码]
			(data.rootBone) && (render._setRootBone(data.rootBone));//[兼容性]
		}
	}

	/**
	 * @inheritDoc
	 * @override
	 * @internal
	 */
	protected _changeHierarchyAnimator(animator: Animator): void {
		super._changeHierarchyAnimator(animator);
		this.skinnedMeshRenderer._setCacheAnimator(animator);
	}

	/**
	 * @inheritDoc
	 * @override
	 * @internal
	 */
	protected _changeAnimatorAvatar(avatar: Avatar): void {
		this.skinnedMeshRenderer._setCacheAvatar(avatar);
	}

	/**
	 * @inheritDoc
	 * @override
	 * @internal
	 */
	_cloneTo(destObject: any, srcRoot: Node, dstRoot: Node): void {
		var meshSprite3D: MeshSprite3D = (<MeshSprite3D>destObject);
		meshSprite3D.meshFilter.sharedMesh = this.meshFilter.sharedMesh;
		var meshRender: SkinnedMeshRenderer = (<SkinnedMeshRenderer>this._render);
		var destMeshRender: SkinnedMeshRenderer = (<SkinnedMeshRenderer>meshSprite3D._render);
		destMeshRender.enable = meshRender.enable;
		destMeshRender.sharedMaterials = meshRender.sharedMaterials;
		destMeshRender.castShadow = meshRender.castShadow;
		var lightmapScaleOffset: Vector4 = meshRender.lightmapScaleOffset;
		lightmapScaleOffset && (destMeshRender.lightmapScaleOffset = lightmapScaleOffset.clone());
		destMeshRender.receiveShadow = meshRender.receiveShadow;
		destMeshRender.sortingFudge = meshRender.sortingFudge;
		destMeshRender._rootBone = meshRender._rootBone;

		var bones: Sprite3D[] = meshRender.bones;
		var destBones: Sprite3D[] = destMeshRender.bones;
		var bonesCount: number = bones.length;
		destBones.length = bonesCount;

		var rootBone: Sprite3D = meshRender.rootBone;
		if (rootBone) {
			var pathes: any[] = Utils3D._getHierarchyPath(srcRoot, rootBone, SkinnedMeshSprite3D._tempArray0);
			if (pathes)
				destMeshRender.rootBone = (<Sprite3D>Utils3D._getNodeByHierarchyPath(dstRoot, pathes));
			else
				destMeshRender.rootBone = rootBone;
		}

		for (var i: number = 0; i < bones.length; i++) {
			pathes = Utils3D._getHierarchyPath(srcRoot, bones[i], SkinnedMeshSprite3D._tempArray0);
			if (pathes)
				destBones[i] = (<Sprite3D>Utils3D._getNodeByHierarchyPath(dstRoot, pathes));
			else
				destBones[i] = bones[i];
		}

		var lbb: Bounds = meshRender.localBounds;
		(lbb) && (lbb.cloneTo(destMeshRender.localBounds));
		super._cloneTo(destObject, srcRoot, dstRoot);//父类函数在最后,组件应该最后赋值,否则获取材质默认值等相关函数会有问题
	}

	/**
	 * @inheritDoc
	 * @override
	 */
	destroy(destroyChild: boolean = true): void {
		if (this.destroyed)
			return;
		super.destroy(destroyChild);
		this._meshFilter.destroy();
	}

	/**
	 * @internal
	 */
	protected _create(): Node {
		return new SkinnedMeshSprite3D();
	}

}


text:
#include "Armature.h"

NAME_SPACE_DRAGON_BONES_BEGIN

IEventDispatcher *Armature::soundEventDispatcher = nullptr;

bool Armature::sortBone(const std::pair<int, Bone*> &a, const std::pair<int, Bone*> &b)
{
    return a.first > b.first;
}

bool Armature::sortSlot(const Slot *a, const Slot *b)
{
    return a->getZOrder() < b->getZOrder();
}

const std::vector<Bone*>& Armature::getBones() const
{
    return _boneList;
}

const std::vector<Slot*>& Armature::getSlots() const
{
    return _slotList;
}

const ArmatureData* Armature::getArmatureData() const
{
    return _armatureData;
}

Animation* Armature::getAnimation() const
{
    return _animation;
}

void* Armature::getDisplay() const
{
    return _display;
}

IEventDispatcher* Armature::getEventDispatcher() const
{
    return _eventDispatcher;
}

Armature::Armature(ArmatureData *armatureData, Animation *animation, IEventDispatcher *eventDispatcher, void *display)
{
    _armatureData = armatureData;
    _animation = animation;
    _eventDispatcher = eventDispatcher;
    _display = display;
    _animation->_armature = this;
    _needUpdate = false;
    _slotsZOrderChanged = false;
    _delayDispose = false;
    _lockDispose = false;
    userData = nullptr;
}
Armature::~Armature()
{
    dispose();
}
void Armature::dispose()
{
    _delayDispose = true;
    if(!_animation || _lockDispose)
    {
        return;
    }

    if (_animation)
    {
        _animation->dispose();
        delete _animation;
        _animation = nullptr;
    }

    //
    for (size_t i = 0, l = _boneList.size(); i < l; ++i)
    {
        if (_boneList[i])
        {
            _boneList[i]->dispose();
            delete _boneList[i];
            _boneList[i] = nullptr;
        }
    }

    //
    for (size_t i = 0, l = _slotList.size(); i < l; ++i)
    {
        if (_slotList[i])
        {
            _slotList[i]->dispose();
            delete _slotList[i];
            _slotList[i] = nullptr;
        }
    }

    //
    for (size_t i = 0, l = _eventDataList.size(); i < l; ++i)
    {
        if (_eventDataList[i])
        {
            EventData::returnObject(_eventDataList[i]);
        }
    }

    //
    _boneList.clear();
    _slotList.clear();
    _eventDataList.clear();

    if (_eventDispatcher)
    {
        _eventDispatcher->dispose();
        delete _eventDispatcher;
        _eventDispatcher = nullptr;
    }

    if (_display)
    {
        _display = nullptr;
    }

    if (userData)
    {
        delete userData;
        userData = nullptr;
    }
}

Bone* Armature::getBone(const std::string &boneName) const
{
    if (boneName.empty())
    {
        // throw
    }

    for (size_t i = 0, l = _boneList.size(); i < l; ++i)
    {
        if (_boneList[i]->name == boneName)
        {
            return _boneList[i];
        }
    }

    return nullptr;
}

Bone* Armature::getBoneByDisplay(const void *display) const
{
    if (!display)
    {
        // throw
    }

    Slot *slot = getSlotByDisplay(display);
    return slot ? slot->_parent : nullptr;
}

void Armature::addBone(Bone *bone)
{
    if (!bone)
    {
        // throw
    }

    if (bone->_parent)
    {
        bone->_parent->removeChild(bone);
    }

    bone->setArmature(this);
}

void Armature::addBone(Bone *bone, const std::string &parentBoneName)
{
    if (parentBoneName.empty())
    {
        // throw
    }

    Bone *boneParent = getBone(parentBoneName);

    if (!boneParent)
    {
        // throw
    }

    boneParent->addChild(bone);
}

void Armature::removeBone(Bone *bone)
{
    if (!bone || bone->_armature != this)
    {
        // throw
    }

    if (bone->_parent)
    {
        bone->_parent->removeChild(bone);
    }
    else
    {
        bone->setArmature(nullptr);
    }
}

Bone *Armature::removeBone(const std::string &boneName)
{
    if (boneName.empty())
    {
        // throw
    }

    Bone *bone = getBone(boneName);

    if (bone)
    {
        removeBone(bone);
    }

    return bone;
}

Slot* Armature::getSlot(const std::string &slotName) const
{
    if (slotName.empty())
    {
        // throw
    }

    for (size_t i = 0, l = _slotList.size(); i < l; ++i)
    {
        if (_slotList[i]->name == slotName)
        {
            return _slotList[i];
        }
    }

    return nullptr;
}

Slot* Armature::getSlotByDisplay(const void *display) const
{
    if (!display)
    {
        // throw
    }

    for (size_t i = 0, l = _slotList.size(); i < l; ++i)
    {
        if (_slotList[i]->_display == display)
        {
            return _slotList[i];
        }
    }

    return nullptr;
}

void Armature::addSlot(Slot *slot, const std::string &parentBoneName)
{
    Bone *bone = getBone(parentBoneName);

    if (!bone)
    {
        // throw
    }

    bone->addChild(slot);
}

void Armature::removeSlot(Slot *slot)
{
    if (!slot || slot->_armature != this)
    {
        // throw
    }

    slot->_parent->removeChild(slot);
}

Slot* Armature::removeSlot(const std::string &slotName)
{
    Slot *slot = getSlot(slotName);

    if (slot)
    {
        removeSlot(slot);
    }

    return slot;
}

void Armature::replaceSlot(const std::string &boneName, const std::string &oldSlotName, Slot* newSlot)
{
    auto bone = getBone(boneName);
    if (!bone) return;

    auto slots = bone->getSlots();
    auto it = std::find_if(slots.begin(), slots.end(),
        [&oldSlotName](Slot* tmp){return oldSlotName == tmp->name;});
    if (it != slots.end())
    {
        auto oldSlog = *it;
        newSlot->_tweenZOrder = oldSlog->_tweenZOrder;
        newSlot->_originZOrder = oldSlog->_originZOrder;
        newSlot->_offsetZOrder = oldSlog->_offsetZOrder;
        newSlot->_blendMode = oldSlog->_blendMode;
        removeSlot(oldSlog);
    }

    newSlot->name = oldSlotName;
    bone->addChild(newSlot);
}

void Armature::sortSlotsByZOrder()
{
    /*
    for (size_t i = 0, l = _slotList.size(); i < l; ++i)
    {
        Slot *slot = _slotList[i];

        if (slot->_isShowDisplay)
        {
            slot->addDisplayToContainer(_display, i);
        }
    }
    */

    std::sort(_slotList.begin() , _slotList.end() , sortSlot);

    for (size_t i = 0, l = _slotList.size(); i < l; ++i)
    {
        Slot *slot = _slotList[i];

        if (slot->_isShowDisplay)
        {
            slot->removeDisplayFromContainer();
        }
    }

    for (size_t i = 0, l = _slotList.size(); i < l; ++i)
    {
        Slot *slot = _slotList[i];

        if (slot->_isShowDisplay)
        {
            slot->addDisplayToContainer(_display, -1);
        }
    }

    _slotsZOrderChanged = false;
}

void Armature::invalidUpdate()
{
    for (size_t i = 0, l = _boneList.size(); i < l; ++i)
    {
        _boneList[i]->invalidUpdate();
    }
}

void Armature::invalidUpdate(const std::string &boneName)
{
    if (boneName.empty())
    {
        // throw
    }

    Bone *bone = getBone(boneName);

    if (bone)
    {
        bone->invalidUpdate();
    }
}

void Armature::advanceTime(float passedTime)
{
    _lockDispose = true;
    _animation->advanceTime(passedTime);
    passedTime *= _animation->_timeScale;
    const bool isFading = _animation->_isFading;

    for (size_t i = _boneList.size(); i--;)
    {
        _boneList[i]->update(isFading);
    }

    for (size_t i = _slotList.size(); i--;)
    {
        Slot *slot = _slotList[i];
        slot->update();

        if (slot->_isShowDisplay && slot->_childArmature)
        {
            slot->_childArmature->advanceTime(passedTime);
        }
    }

    if (_slotsZOrderChanged)
    {
        sortSlotsByZOrder();

#ifdef NEED_Z_ORDER_UPDATED_EVENT
        if (_eventDispatcher->hasEvent(EventData::EventType::Z_ORDER_UPDATED))
        {
            EventData *eventData = new EventData(EventData::EventType::Z_ORDER_UPDATED, this);
            _eventDataList.push_back(eventData);
        }
#endif
    }

    if (!_eventDataList.empty())
    {
        for (size_t i = 0, l = _eventDataList.size(); i < l; ++i)
        {
            _eventDispatcher->dispatchEvent(_eventDataList[i]);
            EventData::returnObject(_eventDataList[i]);
        }

        _eventDataList.clear();
    }

    _lockDispose = false;

    if (_delayDispose)
    {
        dispose();
    }
}

void Armature::addObject(Object *object)
{
    Bone *bone = dynamic_cast<Bone*>(object);
    Slot *slot = dynamic_cast<Slot*>(object);

    if (bone)
    {
        auto iterator = std::find(_boneList.cbegin(), _boneList.cend(), bone);

        if (iterator == _boneList.cend())
        {
            _boneList.push_back(bone);
            sortBones();
            _animation->updateAnimationStates();
        }
    }
    else if (slot)
    {
        auto iterator = std::find(_slotList.cbegin(), _slotList.cend(), slot);

        if (iterator == _slotList.cend())
        {
            _slotList.push_back(slot);
        }
    }
}

void Armature::removeObject(Object *object)
{
    Bone *bone = dynamic_cast<Bone*>(object);
    Slot *slot = dynamic_cast<Slot*>(object);

    if (bone)
    {
        auto iterator = std::find(_boneList.begin(), _boneList.end(), bone);

        if (iterator != _boneList.end())
        {
            _boneList.erase(iterator);
            _animation->updateAnimationStates();
        }
    }
    else if (slot)
    {
        auto iterator = std::find(_slotList.begin(), _slotList.end(), slot);

        if (iterator != _slotList.end())
        {
            _slotList.erase(iterator);
        }
    }
}

void Armature::sortBones()
{
    if (_boneList.empty())
    {
        return;
    }

    std::vector<std::pair<int , Bone*>> sortedList;

    for (size_t i = 0, l = _boneList.size(); i < l; ++i)
    {
        Bone *bone = _boneList[i];
        Bone *parentBone = bone;
        int level = 0;

        while (parentBone)
        {
            parentBone = parentBone->_parent;
            ++level;
        }

        sortedList.push_back(std::make_pair(level , bone));
    }

    std::sort(sortedList.begin() , sortedList.end() , sortBone);

    for (size_t i = 0, l = sortedList.size(); i < l; ++i)
    {
        _boneList[i] = sortedList[i].second;
    }
}

void Armature::arriveAtFrame(Frame *frame, AnimationState *animationState, bool isCross)
{
    if (!frame->event.empty() && _eventDispatcher->hasEvent(EventData::EventType::ANIMATION_FRAME_EVENT))
    {
        EventData *eventData = EventData::borrowObject(EventData::EventType::ANIMATION_FRAME_EVENT);
        eventData->armature = this;
        eventData->animationState = animationState;
        eventData->frameLabel = frame->event;
        eventData->frame = frame;
        _eventDataList.push_back(eventData);
    }

    if (!frame->sound.empty() && soundEventDispatcher && soundEventDispatcher->hasEvent(EventData::EventType::SOUND))
    {
        EventData *eventData = EventData::borrowObject(EventData::EventType::SOUND);
        eventData->armature = this;
        eventData->animationState = animationState;
        eventData->sound = frame->sound;
        soundEventDispatcher->dispatchEvent(eventData);
    }

    if (!frame->action.empty())
    {
        if (animationState->displayControl)
        {
            _animation->gotoAndPlay(frame->action);
        }
    }
}
NAME_SPACE_DRAGON_BONES_END


text:
package kitsu

// Mapping ...
type Mapping struct {
	ID string `json:"id"`
	// Type string `json:"type"`
	// Links struct {
	// 	Self string `json:"self"`
	// } `json:"links"`
	Attributes struct {
		// CreatedAt    interface{} `json:"createdAt"`
		// UpdatedAt    interface{} `json:"updatedAt"`
		ExternalSite string `json:"externalSite"`
		ExternalID   string `json:"externalId"`
	} `json:"attributes"`
	Relationships struct {
		Item struct {
			// Links struct {
			// 	Self    string `json:"self"`
			// 	Related string `json:"related"`
			// } `json:"links"`
			Data struct {
				Type string `json:"type"`
				ID   string `json:"id"`
			} `json:"data"`
		} `json:"item"`
	} `json:"relationships"`
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Trollius uncinatus Sipliv.

### Remarks
null


text:
module Chartkick
  class Engine < ::Rails::Engine
    initializer "precompile", group: :all do |app|
      if defined?(Sprockets) && Gem::Version.new(Sprockets::VERSION) >= Gem::Version.new("4.0.0.beta1")
        app.config.assets.precompile << "chartkick.js"
      else
        # use a proc instead of a string
        app.config.assets.precompile << proc { |path| path == "chartkick.js" }
      end
    end

    initializer "helper" do
      ActiveSupport.on_load(:action_view) do
        include Helper
      end
    end
  end
end


text:
import React from 'react';

import { storiesOf } from '@storybook/react-native';

import BinaryUICarousel0 from './carousel-0';
import BinaryUICarousel4 from './carousel-4';
import BinaryUICarousel4Loop from './carousel-4-loop';
import BinaryUICarousel4LoopWithScrollView from './carousel-4-loop-with-scroll-view';

storiesOf('binary-ui-carousel', module)
  .add('0 options', () => (
    <BinaryUICarousel0 />
  ))
  .add('4 options', () => (
    <BinaryUICarousel4 />
  ))
  .add('4 options loop', () => (
    <BinaryUICarousel4Loop />
  ))
  .add('4 options loop with scroll', () => (
    <BinaryUICarousel4LoopWithScrollView />
  ));


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
    <comment>SignInPage</comment>
    <entry key="userDetailsPanelHeader">User Details</entry>
</properties>


text:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class BrowseDisplay
    Inherits System.Windows.Forms.UserControl

    'UserControl overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.gpBoxControls = New System.Windows.Forms.GroupBox()
        Me.lblCurrentDoc = New System.Windows.Forms.Label()
        Me.pnlControls = New System.Windows.Forms.Panel()
        Me.btnZoomOut = New System.Windows.Forms.Button()
        Me.btnZoomIn = New System.Windows.Forms.Button()
        Me.btnRefresh = New System.Windows.Forms.Button()
        Me.btnForward = New System.Windows.Forms.Button()
        Me.btnBack = New System.Windows.Forms.Button()
        Me.Panel1 = New System.Windows.Forms.Panel()
        Me.Panel2 = New System.Windows.Forms.Panel()
        Me.Panel3 = New System.Windows.Forms.Panel()
        Me.Panel4 = New System.Windows.Forms.Panel()
        Me.webDisplay = New ZoomBrowser.MyBrowser()
        Me.gpBoxControls.SuspendLayout()
        Me.pnlControls.SuspendLayout()
        Me.SuspendLayout()
        '
        'gpBoxControls
        '
        Me.gpBoxControls.Controls.Add(Me.lblCurrentDoc)
        Me.gpBoxControls.Controls.Add(Me.pnlControls)
        Me.gpBoxControls.Dock = System.Windows.Forms.DockStyle.Top
        Me.gpBoxControls.Location = New System.Drawing.Point(0, 0)
        Me.gpBoxControls.Name = "gpBoxControls"
        Me.gpBoxControls.Size = New System.Drawing.Size(522, 68)
        Me.gpBoxControls.TabIndex = 0
        Me.gpBoxControls.TabStop = False
        '
        'lblCurrentDoc
        '
        Me.lblCurrentDoc.BackColor = System.Drawing.SystemColors.Control
        Me.lblCurrentDoc.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblCurrentDoc.Dock = System.Windows.Forms.DockStyle.Fill
        Me.lblCurrentDoc.Font = New System.Drawing.Font("Verdana", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblCurrentDoc.ForeColor = System.Drawing.Color.Crimson
        Me.lblCurrentDoc.Location = New System.Drawing.Point(3, 16)
        Me.lblCurrentDoc.Name = "lblCurrentDoc"
        Me.lblCurrentDoc.Size = New System.Drawing.Size(227, 49)
        Me.lblCurrentDoc.TabIndex = 3
        Me.lblCurrentDoc.Text = ""
        '
        'pnlControls
        '
        Me.pnlControls.Controls.Add(Me.btnZoomOut)
        Me.pnlControls.Controls.Add(Me.btnZoomIn)
        Me.pnlControls.Controls.Add(Me.btnRefresh)
        Me.pnlControls.Controls.Add(Me.btnForward)
        Me.pnlControls.Controls.Add(Me.btnBack)
        Me.pnlControls.Dock = System.Windows.Forms.DockStyle.Right
        Me.pnlControls.Location = New System.Drawing.Point(230, 16)
        Me.pnlControls.Name = "pnlControls"
        Me.pnlControls.Size = New System.Drawing.Size(289, 49)
        Me.pnlControls.TabIndex = 4
        '
        'btnZoomOut
        '
        Me.btnZoomOut.FlatAppearance.BorderSize = 0
        Me.btnZoomOut.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnZoomOut.Image = Global.MobileControls.My.Resources.Resources.ZoomOut
        Me.btnZoomOut.Location = New System.Drawing.Point(64, -1)
        Me.btnZoomOut.Name = "btnZoomOut"
        Me.btnZoomOut.Size = New System.Drawing.Size(50, 50)
        Me.btnZoomOut.TabIndex = 8
        Me.btnZoomOut.UseVisualStyleBackColor = True
        '
        'btnZoomIn
        '
        Me.btnZoomIn.FlatAppearance.BorderSize = 0
        Me.btnZoomIn.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnZoomIn.Image = Global.MobileControls.My.Resources.Resources.ZoomIn
        Me.btnZoomIn.Location = New System.Drawing.Point(176, 0)
        Me.btnZoomIn.Name = "btnZoomIn"
        Me.btnZoomIn.Size = New System.Drawing.Size(50, 50)
        Me.btnZoomIn.TabIndex = 7
        Me.btnZoomIn.UseVisualStyleBackColor = True
        '
        'btnRefresh
        '
        Me.btnRefresh.FlatAppearance.BorderSize = 0
        Me.btnRefresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnRefresh.Image = Global.MobileControls.My.Resources.Resources.refresh
        Me.btnRefresh.Location = New System.Drawing.Point(120, 0)
        Me.btnRefresh.Name = "btnRefresh"
        Me.btnRefresh.Size = New System.Drawing.Size(50, 50)
        Me.btnRefresh.TabIndex = 5
        Me.btnRefresh.UseVisualStyleBackColor = True
        '
        'btnForward
        '
        Me.btnForward.FlatAppearance.BorderSize = 0
        Me.btnForward.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnForward.Image = Global.MobileControls.My.Resources.Resources.rightArrow
        Me.btnForward.Location = New System.Drawing.Point(232, -1)
        Me.btnForward.Name = "btnForward"
        Me.btnForward.Size = New System.Drawing.Size(50, 50)
        Me.btnForward.TabIndex = 4
        Me.btnForward.UseVisualStyleBackColor = True
        '
        'btnBack
        '
        Me.btnBack.FlatAppearance.BorderSize = 0
        Me.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnBack.Image = Global.MobileControls.My.Resources.Resources.LeftArrow
        Me.btnBack.Location = New System.Drawing.Point(8, -1)
        Me.btnBack.Name = "btnBack"
        Me.btnBack.Size = New System.Drawing.Size(50, 50)
        Me.btnBack.TabIndex = 3
        Me.btnBack.UseVisualStyleBackColor = True
        '
        'Panel1
        '
        Me.Panel1.BackColor = System.Drawing.SystemColors.Highlight
        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Left
        Me.Panel1.Location = New System.Drawing.Point(0, 68)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(10, 418)
        Me.Panel1.TabIndex = 1
        '
        'Panel2
        '
        Me.Panel2.BackColor = System.Drawing.SystemColors.Highlight
        Me.Panel2.Dock = System.Windows.Forms.DockStyle.Bottom
        Me.Panel2.Location = New System.Drawing.Point(10, 476)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(512, 10)
        Me.Panel2.TabIndex = 2
        '
        'Panel3
        '
        Me.Panel3.BackColor = System.Drawing.SystemColors.Highlight
        Me.Panel3.Dock = System.Windows.Forms.DockStyle.Right
        Me.Panel3.Location = New System.Drawing.Point(512, 68)
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(10, 408)
        Me.Panel3.TabIndex = 3
        '
        'Panel4
        '
        Me.Panel4.BackColor = System.Drawing.SystemColors.Highlight
        Me.Panel4.Dock = System.Windows.Forms.DockStyle.Top
        Me.Panel4.Location = New System.Drawing.Point(10, 68)
        Me.Panel4.Name = "Panel4"
        Me.Panel4.Size = New System.Drawing.Size(502, 10)
        Me.Panel4.TabIndex = 5
        '
        'webDisplay
        '
        Me.webDisplay.Dock = System.Windows.Forms.DockStyle.Fill
        Me.webDisplay.Location = New System.Drawing.Point(10, 78)
        Me.webDisplay.MinimumSize = New System.Drawing.Size(20, 20)
        Me.webDisplay.Name = "webDisplay"
        Me.webDisplay.ScriptErrorsSuppressed = True
        Me.webDisplay.Size = New System.Drawing.Size(502, 398)
        Me.webDisplay.TabIndex = 6
        '
        'BrowseDisplay
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.Controls.Add(Me.webDisplay)
        Me.Controls.Add(Me.Panel4)
        Me.Controls.Add(Me.Panel3)
        Me.Controls.Add(Me.Panel2)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.gpBoxControls)
        Me.Name = "BrowseDisplay"
        Me.Size = New System.Drawing.Size(522, 486)
        Me.gpBoxControls.ResumeLayout(False)
        Me.pnlControls.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub
    Friend WithEvents gpBoxControls As System.Windows.Forms.GroupBox
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents Panel3 As System.Windows.Forms.Panel
    Friend WithEvents Panel4 As System.Windows.Forms.Panel
    Friend WithEvents webDisplay As ZoomBrowser.MyBrowser
    Friend WithEvents lblCurrentDoc As System.Windows.Forms.Label
    Friend WithEvents pnlControls As System.Windows.Forms.Panel
    Friend WithEvents btnRefresh As System.Windows.Forms.Button
    Friend WithEvents btnForward As System.Windows.Forms.Button
    Friend WithEvents btnBack As System.Windows.Forms.Button
    Friend WithEvents btnZoomOut As System.Windows.Forms.Button
    Friend WithEvents btnZoomIn As System.Windows.Forms.Button

End Class


text:
/*! \file thrust/iterator/discard_iterator.h
 *  \brief An iterator which "discards" (ignores) values assigned to it upon dereference
 */

#pragma once

#include <thrust/detail/config.h>
#include <thrust/iterator/detail/discard_iterator_base.h>
#include <thrust/iterator/iterator_facade.h>

__THRUST_DISABLE_MSVC_POSSIBLE_LOSS_OF_DATA_WARNING_BEGIN

namespace thrust
{

/*! \addtogroup iterators
 *  \{
 */

/*! \addtogroup fancyiterator Fancy Iterators
 *  \ingroup iterators
 *  \{
 */

/*! \p discard_iterator is an iterator which represents a special kind of pointer that
 *  ignores values written to it upon dereference. This iterator is useful for ignoring
 *  the output of certain algorithms without wasting memory capacity or bandwidth.
 *  \p discard_iterator may also be used to count the size of an algorithm's output which
 *  may not be known a priori.
 *
 *  The following code snippet demonstrates how to use \p discard_iterator to ignore
 *  ignore one of the output ranges of reduce_by_key
 *
 *  \code
 *  #include <thrust/iterator/discard_iterator.h>
 *  #include <thrust/reduce.h>
 *  #include <thrust/device_vector.h>
 *
 *  int main(void)
 *  {
 *    thrust::device_vector<int> keys(7), values(7);
 *
 *    keys[0] = 1;
 *    keys[1] = 3;
 *    keys[2] = 3;
 *    keys[3] = 3;
 *    keys[4] = 2;
 *    keys[5] = 2;
 *    keys[6] = 1;
 *
 *    values[0] = 9;
 *    values[1] = 8;
 *    values[2] = 7;
 *    values[3] = 6;
 *    values[4] = 5;
 *    values[5] = 4;
 *    values[6] = 3;
 *
 *    thrust::device_vector<int> result(4);
 *
 *    // we are only interested in the reduced values
 *    // use discard_iterator to ignore the output keys
 *    thrust::reduce_by_key(keys.begin(), keys.end(),
 *                          values.begin(),
 *                          thrust::make_discard_iterator(),
 *                          result.begin());
 *
 *    // result is now [9, 21, 9, 3]
 *
 *    return 0;
 *  }
 *  \endcode
 *
 *  \see make_discard_iterator
 */
template<typename System = use_default>
  class discard_iterator
    : public detail::discard_iterator_base<System>::type
{
    /*! \cond
     */
    friend class thrust::iterator_core_access;
    typedef typename detail::discard_iterator_base<System>::type          super_t;
    typedef typename detail::discard_iterator_base<System>::incrementable incrementable;
    typedef typename detail::discard_iterator_base<System>::base_iterator base_iterator;

  public:
    typedef typename super_t::reference  reference;
    typedef typename super_t::value_type value_type;

    /*! \endcond
     */

    /*! Copy constructor copies from a source discard_iterator.
     *
     *  \p rhs The discard_iterator to copy.
     */
    __host__ __device__
    discard_iterator(discard_iterator const &rhs)
      : super_t(rhs.base()) {}

    /*! This constructor receives an optional index specifying the position of this
     *  \p discard_iterator in a range.
     *
     *  \p i The index of this \p discard_iterator in a range. Defaults to the
     *       value returned by \c Incrementable's null constructor. For example,
     *       when <tt>Incrementable == int</tt>, \c 0.
     */
    __host__ __device__
    discard_iterator(incrementable const &i = incrementable())
      : super_t(base_iterator(i)) {}

    /*! \cond
     */

  private: // Core iterator interface
    __host__ __device__
    reference dereference(void) const
    {
      return m_element;
    }

    mutable value_type m_element;

    /*! \endcond
     */
}; // end constant_iterator

/*! \p make_discard_iterator creates a \p discard_iterator from an optional index parameter.
 *
 *  \param i The index of the returned \p discard_iterator within a range.
 *           In the default case, the value of this parameter is \c 0.
 *
 *  \return A new \p discard_iterator with index as given by \p i.
 *
 *  \see constant_iterator
 */
inline __host__ __device__
discard_iterator<> make_discard_iterator(discard_iterator<>::difference_type i = discard_iterator<>::difference_type(0))
{
  return discard_iterator<>(i);
} // end make_discard_iterator()

/*! \} // end fancyiterators
 */

/*! \} // end iterators
 */

} // end namespace thrust

__THRUST_DISABLE_MSVC_POSSIBLE_LOSS_OF_DATA_WARNING_END


text:
package net.oschina.concurrency.syncnew;
/**
 *
 * @author 张大川
 *
 */
public class Bank implements Runnable {

	private Account account;

	public Bank(Account account) {
		this.account = account;
	}

	public void run() {
		for (int i = 0; i < 100; i++) {
			account.subtractAmount(1000);
		}
	}

}


text:
package com.hazelcast.scheduledexecutor.impl;

import com.hazelcast.cluster.MembershipEvent;
import com.hazelcast.cluster.impl.MemberImpl;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.HazelcastInstanceAware;
import com.hazelcast.instance.impl.HazelcastInstanceImpl;
import com.hazelcast.partition.PartitionLostEvent;
import com.hazelcast.scheduledexecutor.IScheduledFuture;
import com.hazelcast.scheduledexecutor.ScheduledTaskHandler;
import com.hazelcast.scheduledexecutor.ScheduledTaskStatistics;
import com.hazelcast.scheduledexecutor.StaleTaskException;
import com.hazelcast.scheduledexecutor.impl.operations.CancelTaskOperation;
import com.hazelcast.scheduledexecutor.impl.operations.DisposeTaskOperation;
import com.hazelcast.scheduledexecutor.impl.operations.GetDelayOperation;
import com.hazelcast.scheduledexecutor.impl.operations.GetResultOperation;
import com.hazelcast.scheduledexecutor.impl.operations.GetStatisticsOperation;
import com.hazelcast.scheduledexecutor.impl.operations.IsCanceledOperation;
import com.hazelcast.scheduledexecutor.impl.operations.IsDoneOperation;
import com.hazelcast.spi.impl.NodeEngineImpl;
import com.hazelcast.spi.impl.operationservice.Operation;
import com.hazelcast.spi.impl.operationservice.OperationService;
import com.hazelcast.spi.impl.operationservice.impl.InvocationFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.util.UUID;
import java.util.concurrent.Delayed;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;

import static com.hazelcast.internal.util.ExceptionUtil.sneakyThrow;
import static com.hazelcast.internal.util.Preconditions.checkNotNull;

@SuppressFBWarnings("EQ_COMPARETO_USE_OBJECT_EQUALS")
@SuppressWarnings({"checkstyle:methodcount"})
public final class ScheduledFutureProxy<V>
        implements IScheduledFuture<V>, HazelcastInstanceAware {

    private transient HazelcastInstance instance;

    private final transient AtomicBoolean partitionLost = new AtomicBoolean(false);

    private final transient AtomicBoolean memberLost = new AtomicBoolean(false);

    // Single writer, many readers (see partition & member listener)
    private volatile ScheduledTaskHandler handler;

    ScheduledFutureProxy(ScheduledTaskHandler handler, ScheduledExecutorServiceProxy executor) {
        checkNotNull(handler);
        this.handler = handler;
        executor.getService().addLossListener(this);
    }

    @Override
    public void setHazelcastInstance(HazelcastInstance hazelcastInstance) {
        this.instance = hazelcastInstance;
    }

    @Override
    public ScheduledTaskHandler getHandler() {
        return handler;
    }

    @Override
    public ScheduledTaskStatistics getStats() {
        checkAccessibleHandler();
        checkAccessibleOwner();

        Operation op = new GetStatisticsOperation(handler);

        return this.<ScheduledTaskStatistics>invoke(op).joinInternal();
    }

    @Override
    public long getDelay(TimeUnit unit) {
        checkNotNull(unit, "Unit is null");
        checkAccessibleHandler();
        checkAccessibleOwner();

        Operation op = new GetDelayOperation(handler, unit);
        return this.<Long>invoke(op).joinInternal();
    }

    @Override
    public int compareTo(Delayed o) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean cancel(boolean mayInterruptIfRunning) {
        if (mayInterruptIfRunning) {
            // DelegateAndSkipOnConcurrentExecutionDecorator doesn't expose the Executor's future
            // therefore we don't have access to the runner thread to interrupt. We could access through Thread.currentThread()
            // inside the TaskRunner but it adds extra complexity.
            throw new UnsupportedOperationException("mayInterruptIfRunning flag is not supported.");
        }

        checkAccessibleHandler();
        checkAccessibleOwner();

        Operation op = new CancelTaskOperation(handler, mayInterruptIfRunning);
        return this.<Boolean>invoke(op).joinInternal();
    }

    @Override
    public boolean isCancelled() {
        checkAccessibleHandler();
        checkAccessibleOwner();

        Operation op = new IsCanceledOperation(handler);
        return this.<Boolean>invoke(op).joinInternal();
    }

    @Override
    public boolean isDone() {
        checkAccessibleHandler();
        checkAccessibleOwner();

        Operation op = new IsDoneOperation(handler);
        return this.<Boolean>invoke(op).joinInternal();
    }

    private InvocationFuture<V> get0() {
        checkAccessibleHandler();
        checkAccessibleOwner();
        Operation op = new GetResultOperation<V>(handler);
        return this.invoke(op);
    }

    @Override
    public V get()
            throws InterruptedException, ExecutionException {
        try {
            return this.get0().get();
        } catch (ScheduledTaskResult.ExecutionExceptionDecorator ex) {
            throw sneakyThrow(ex.getCause());
        }
    }

    @Override
    public V get(long timeout, TimeUnit unit)
            throws InterruptedException, ExecutionException, TimeoutException {
        checkNotNull(unit, "Unit is null");
        try {
            return this.get0().get(timeout, unit);
        } catch (ScheduledTaskResult.ExecutionExceptionDecorator ex) {
            throw sneakyThrow(ex.getCause());
        }
    }

    @Override
    public void dispose() {
        checkAccessibleHandler();
        checkAccessibleOwner();

        Operation op = new DisposeTaskOperation(handler);
        InvocationFuture future = invoke(op);
        handler = null;
        future.joinInternal();
    }

    void notifyMemberLost(MembershipEvent event) {
        ScheduledTaskHandler handler = this.handler;
        if (handler == null) {
            // Already disposed future
            return;
        }

        if (handler.isAssignedToMember()
                && handler.getUuid().equals(event.getMember().getUuid())) {
            this.memberLost.set(true);
        }
    }

    void notifyPartitionLost(PartitionLostEvent event) {
        ScheduledTaskHandler handler = this.handler;
        if (handler == null) {
            // Already disposed future
            return;
        }

        int durability = instance.getConfig().getScheduledExecutorConfig(handler.getSchedulerName()).getDurability();

        if (handler.isAssignedToPartition()
                && handler.getPartitionId() == event.getPartitionId()
                && event.getLostBackupCount() >= durability) {
            this.partitionLost.set(true);
        }
    }

    private void checkAccessibleOwner() {
        if (handler.isAssignedToPartition()) {
            if (partitionLost.get()) {
                throw new IllegalStateException("Partition " + handler.getPartitionId() + ", holding this scheduled task"
                        + " was lost along with all backups.");
            }
        } else {
            if (memberLost.get()) {
                throw new IllegalStateException("Member with address: " + handler.getUuid() + ",  holding this scheduled task"
                        + " is not part of this cluster.");
            }
        }
    }

    private void checkAccessibleHandler() {
        if (handler == null) {
            throw new StaleTaskException("Scheduled task was previously disposed.");
        }
    }

    private <T> InvocationFuture<T> invoke(Operation op) {
        if (handler.isAssignedToPartition()) {
            op.setPartitionId(handler.getPartitionId());
            return invokeOnPartition(op);
        } else {
            return invokeOnAddress(op, handler.getUuid());
        }
    }

    private <T> InvocationFuture<T> invokeOnPartition(Operation op) {
        OperationService opService = ((HazelcastInstanceImpl) instance).node.getNodeEngine().getOperationService();

        return opService.invokeOnPartition(op);
    }

    private <T> InvocationFuture<T> invokeOnAddress(Operation op, UUID uuid) {
        NodeEngineImpl nodeEngine = ((HazelcastInstanceImpl) instance).node.getNodeEngine();
        MemberImpl member = nodeEngine.getClusterService().getMember(uuid);
        OperationService opService = nodeEngine.getOperationService();
        return opService.invokeOnTarget(op.getServiceName(), op, member.getAddress());
    }

}


text:
#pragma once
#include <aws/elasticloadbalancing/ElasticLoadBalancing_EXPORTS.h>
#include <aws/elasticloadbalancing/ElasticLoadBalancingRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/elasticloadbalancing/model/Listener.h>
#include <aws/elasticloadbalancing/model/Tag.h>
#include <utility>

namespace Aws
{
namespace ElasticLoadBalancing
{
namespace Model
{

  /**
   *
Contains the parameters for CreateLoadBalancer.

See Also:
   AWS
   * API Reference

   */
  class AWS_ELASTICLOADBALANCING_API CreateLoadBalancerRequest : public ElasticLoadBalancingRequest
  {
  public:
    CreateLoadBalancerRequest();
    Aws::String SerializePayload() const override;

  protected:
    void DumpBodyToUrl(Aws::Http::URI& uri ) const override;

  public:
    /**
     *
The name of the load balancer.

This name must be unique within your
     * set of load balancers for the region, must have a maximum of 32 characters, must
     * contain only alphanumeric characters or hyphens, and cannot begin or end with a
     * hyphen.

     */
    inline const Aws::String& GetLoadBalancerName() const{ return m_loadBalancerName; }

    /**
     *
The name of the load balancer.

This name must be unique within your
     * set of load balancers for the region, must have a maximum of 32 characters, must
     * contain only alphanumeric characters or hyphens, and cannot begin or end with a
     * hyphen.

     */
    inline void SetLoadBalancerName(const Aws::String& value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName = value; }

    /**
     *
The name of the load balancer.

This name must be unique within your
     * set of load balancers for the region, must have a maximum of 32 characters, must
     * contain only alphanumeric characters or hyphens, and cannot begin or end with a
     * hyphen.

     */
    inline void SetLoadBalancerName(Aws::String&& value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName = std::move(value); }

    /**
     *
The name of the load balancer.

This name must be unique within your
     * set of load balancers for the region, must have a maximum of 32 characters, must
     * contain only alphanumeric characters or hyphens, and cannot begin or end with a
     * hyphen.

     */
    inline void SetLoadBalancerName(const char* value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName.assign(value); }

    /**
     *
The name of the load balancer.

This name must be unique within your
     * set of load balancers for the region, must have a maximum of 32 characters, must
     * contain only alphanumeric characters or hyphens, and cannot begin or end with a
     * hyphen.

     */
    inline CreateLoadBalancerRequest& WithLoadBalancerName(const Aws::String& value) { SetLoadBalancerName(value); return *this;}

    /**
     *
The name of the load balancer.

This name must be unique within your
     * set of load balancers for the region, must have a maximum of 32 characters, must
     * contain only alphanumeric characters or hyphens, and cannot begin or end with a
     * hyphen.

     */
    inline CreateLoadBalancerRequest& WithLoadBalancerName(Aws::String&& value) { SetLoadBalancerName(std::move(value)); return *this;}

    /**
     *
The name of the load balancer.

This name must be unique within your
     * set of load balancers for the region, must have a maximum of 32 characters, must
     * contain only alphanumeric characters or hyphens, and cannot begin or end with a
     * hyphen.

     */
    inline CreateLoadBalancerRequest& WithLoadBalancerName(const char* value) { SetLoadBalancerName(value); return *this;}

    /**
     *
The listeners.

For more information, see Listeners
     * for Your Classic Load Balancer in the Classic Load Balancer
     * Guide.

     */
    inline const Aws::Vector<Listener>& GetListeners() const{ return m_listeners; }

    /**
     *
The listeners.

For more information, see Listeners
     * for Your Classic Load Balancer in the Classic Load Balancer
     * Guide.

     */
    inline void SetListeners(const Aws::Vector<Listener>& value) { m_listenersHasBeenSet = true; m_listeners = value; }

    /**
     *
The listeners.

For more information, see Listeners
     * for Your Classic Load Balancer in the Classic Load Balancer
     * Guide.

     */
    inline void SetListeners(Aws::Vector<Listener>&& value) { m_listenersHasBeenSet = true; m_listeners = std::move(value); }

    /**
     *
The listeners.

For more information, see Listeners
     * for Your Classic Load Balancer in the Classic Load Balancer
     * Guide.

     */
    inline CreateLoadBalancerRequest& WithListeners(const Aws::Vector<Listener>& value) { SetListeners(value); return *this;}

    /**
     *
The listeners.

For more information, see Listeners
     * for Your Classic Load Balancer in the Classic Load Balancer
     * Guide.

     */
    inline CreateLoadBalancerRequest& WithListeners(Aws::Vector<Listener>&& value) { SetListeners(std::move(value)); return *this;}

    /**
     *
The listeners.

For more information, see Listeners
     * for Your Classic Load Balancer in the Classic Load Balancer
     * Guide.

     */
    inline CreateLoadBalancerRequest& AddListeners(const Listener& value) { m_listenersHasBeenSet = true; m_listeners.push_back(value); return *this; }

    /**
     *
The listeners.

For more information, see Listeners
     * for Your Classic Load Balancer in the Classic Load Balancer
     * Guide.

     */
    inline CreateLoadBalancerRequest& AddListeners(Listener&& value) { m_listenersHasBeenSet = true; m_listeners.push_back(std::move(value)); return *this; }

    /**
     *
One or more Availability Zones from the same region as the load balancer.

     *
You must specify at least one Availability Zone.

You can add more
     * Availability Zones after you create the load balancer using
     * EnableAvailabilityZonesForLoadBalancer.

     */
    inline const Aws::Vector<Aws::String>& GetAvailabilityZones() const{ return m_availabilityZones; }

    /**
     *
One or more Availability Zones from the same region as the load balancer.

     *
You must specify at least one Availability Zone.

You can add more
     * Availability Zones after you create the load balancer using
     * EnableAvailabilityZonesForLoadBalancer.

     */
    inline void SetAvailabilityZones(const Aws::Vector<Aws::String>& value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones = value; }

    /**
     *
One or more Availability Zones from the same region as the load balancer.

     *
You must specify at least one Availability Zone.

You can add more
     * Availability Zones after you create the load balancer using
     * EnableAvailabilityZonesForLoadBalancer.

     */
    inline void SetAvailabilityZones(Aws::Vector<Aws::String>&& value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones = std::move(value); }

    /**
     *
One or more Availability Zones from the same region as the load balancer.

     *
You must specify at least one Availability Zone.

You can add more
     * Availability Zones after you create the load balancer using
     * EnableAvailabilityZonesForLoadBalancer.

     */
    inline CreateLoadBalancerRequest& WithAvailabilityZones(const Aws::Vector<Aws::String>& value) { SetAvailabilityZones(value); return *this;}

    /**
     *
One or more Availability Zones from the same region as the load balancer.

     *
You must specify at least one Availability Zone.

You can add more
     * Availability Zones after you create the load balancer using
     * EnableAvailabilityZonesForLoadBalancer.

     */
    inline CreateLoadBalancerRequest& WithAvailabilityZones(Aws::Vector<Aws::String>&& value) { SetAvailabilityZones(std::move(value)); return *this;}

    /**
     *
One or more Availability Zones from the same region as the load balancer.

     *
You must specify at least one Availability Zone.

You can add more
     * Availability Zones after you create the load balancer using
     * EnableAvailabilityZonesForLoadBalancer.

     */
    inline CreateLoadBalancerRequest& AddAvailabilityZones(const Aws::String& value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones.push_back(value); return *this; }

    /**
     *
One or more Availability Zones from the same region as the load balancer.

     *
You must specify at least one Availability Zone.

You can add more
     * Availability Zones after you create the load balancer using
     * EnableAvailabilityZonesForLoadBalancer.

     */
    inline CreateLoadBalancerRequest& AddAvailabilityZones(Aws::String&& value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones.push_back(std::move(value)); return *this; }

    /**
     *
One or more Availability Zones from the same region as the load balancer.

     *
You must specify at least one Availability Zone.

You can add more
     * Availability Zones after you create the load balancer using
     * EnableAvailabilityZonesForLoadBalancer.

     */
    inline CreateLoadBalancerRequest& AddAvailabilityZones(const char* value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones.push_back(value); return *this; }

    /**
     *
The IDs of the subnets in your VPC to attach to the load balancer. Specify
     * one subnet per Availability Zone specified in
     * AvailabilityZones.

     */
    inline const Aws::Vector<Aws::String>& GetSubnets() const{ return m_subnets; }

    /**
     *
The IDs of the subnets in your VPC to attach to the load balancer. Specify
     * one subnet per Availability Zone specified in
     * AvailabilityZones.

     */
    inline void SetSubnets(const Aws::Vector<Aws::String>& value) { m_subnetsHasBeenSet = true; m_subnets = value; }

    /**
     *
The IDs of the subnets in your VPC to attach to the load balancer. Specify
     * one subnet per Availability Zone specified in
     * AvailabilityZones.

     */
    inline void SetSubnets(Aws::Vector<Aws::String>&& value) { m_subnetsHasBeenSet = true; m_subnets = std::move(value); }

    /**
     *
The IDs of the subnets in your VPC to attach to the load balancer. Specify
     * one subnet per Availability Zone specified in
     * AvailabilityZones.

     */
    inline CreateLoadBalancerRequest& WithSubnets(const Aws::Vector<Aws::String>& value) { SetSubnets(value); return *this;}

    /**
     *
The IDs of the subnets in your VPC to attach to the load balancer. Specify
     * one subnet per Availability Zone specified in
     * AvailabilityZones.

     */
    inline CreateLoadBalancerRequest& WithSubnets(Aws::Vector<Aws::String>&& value) { SetSubnets(std::move(value)); return *this;}

    /**
     *
The IDs of the subnets in your VPC to attach to the load balancer. Specify
     * one subnet per Availability Zone specified in
     * AvailabilityZones.

     */
    inline CreateLoadBalancerRequest& AddSubnets(const Aws::String& value) { m_subnetsHasBeenSet = true; m_subnets.push_back(value); return *this; }

    /**
     *
The IDs of the subnets in your VPC to attach to the load balancer. Specify
     * one subnet per Availability Zone specified in
     * AvailabilityZones.

     */
    inline CreateLoadBalancerRequest& AddSubnets(Aws::String&& value) { m_subnetsHasBeenSet = true; m_subnets.push_back(std::move(value)); return *this; }

    /**
     *
The IDs of the subnets in your VPC to attach to the load balancer. Specify
     * one subnet per Availability Zone specified in
     * AvailabilityZones.

     */
    inline CreateLoadBalancerRequest& AddSubnets(const char* value) { m_subnetsHasBeenSet = true; m_subnets.push_back(value); return *this; }

    /**
     *
The IDs of the security groups to assign to the load balancer.

     */
    inline const Aws::Vector<Aws::String>& GetSecurityGroups() const{ return m_securityGroups; }

    /**
     *
The IDs of the security groups to assign to the load balancer.

     */
    inline void SetSecurityGroups(const Aws::Vector<Aws::String>& value) { m_securityGroupsHasBeenSet = true; m_securityGroups = value; }

    /**
     *
The IDs of the security groups to assign to the load balancer.

     */
    inline void SetSecurityGroups(Aws::Vector<Aws::String>&& value) { m_securityGroupsHasBeenSet = true; m_securityGroups = std::move(value); }

    /**
     *
The IDs of the security groups to assign to the load balancer.

     */
    inline CreateLoadBalancerRequest& WithSecurityGroups(const Aws::Vector<Aws::String>& value) { SetSecurityGroups(value); return *this;}

    /**
     *
The IDs of the security groups to assign to the load balancer.

     */
    inline CreateLoadBalancerRequest& WithSecurityGroups(Aws::Vector<Aws::String>&& value) { SetSecurityGroups(std::move(value)); return *this;}

    /**
     *
The IDs of the security groups to assign to the load balancer.

     */
    inline CreateLoadBalancerRequest& AddSecurityGroups(const Aws::String& value) { m_securityGroupsHasBeenSet = true; m_securityGroups.push_back(value); return *this; }

    /**
     *
The IDs of the security groups to assign to the load balancer.

     */
    inline CreateLoadBalancerRequest& AddSecurityGroups(Aws::String&& value) { m_securityGroupsHasBeenSet = true; m_securityGroups.push_back(std::move(value)); return *this; }

    /**
     *
The IDs of the security groups to assign to the load balancer.

     */
    inline CreateLoadBalancerRequest& AddSecurityGroups(const char* value) { m_securityGroupsHasBeenSet = true; m_securityGroups.push_back(value); return *this; }

    /**
     *
The type of a load balancer. Valid only for load balancers in a VPC.

     *
By default, Elastic Load Balancing creates an Internet-facing load balancer
     * with a DNS name that resolves to public IP addresses. For more information about
     * Internet-facing and Internal load balancers, see Load
     * Balancer Scheme in the Elastic Load Balancing User Guide.

     *
Specify internal to create a load balancer with a DNS name that
     * resolves to private IP addresses.

     */
    inline const Aws::String& GetScheme() const{ return m_scheme; }

    /**
     *
The type of a load balancer. Valid only for load balancers in a VPC.

     *
By default, Elastic Load Balancing creates an Internet-facing load balancer
     * with a DNS name that resolves to public IP addresses. For more information about
     * Internet-facing and Internal load balancers, see Load
     * Balancer Scheme in the Elastic Load Balancing User Guide.

     *
Specify internal to create a load balancer with a DNS name that
     * resolves to private IP addresses.

     */
    inline void SetScheme(const Aws::String& value) { m_schemeHasBeenSet = true; m_scheme = value; }

    /**
     *
The type of a load balancer. Valid only for load balancers in a VPC.

     *
By default, Elastic Load Balancing creates an Internet-facing load balancer
     * with a DNS name that resolves to public IP addresses. For more information about
     * Internet-facing and Internal load balancers, see Load
     * Balancer Scheme in the Elastic Load Balancing User Guide.

     *
Specify internal to create a load balancer with a DNS name that
     * resolves to private IP addresses.

     */
    inline void SetScheme(Aws::String&& value) { m_schemeHasBeenSet = true; m_scheme = std::move(value); }

    /**
     *
The type of a load balancer. Valid only for load balancers in a VPC.

     *
By default, Elastic Load Balancing creates an Internet-facing load balancer
     * with a DNS name that resolves to public IP addresses. For more information about
     * Internet-facing and Internal load balancers, see Load
     * Balancer Scheme in the Elastic Load Balancing User Guide.

     *
Specify internal to create a load balancer with a DNS name that
     * resolves to private IP addresses.

     */
    inline void SetScheme(const char* value) { m_schemeHasBeenSet = true; m_scheme.assign(value); }

    /**
     *
The type of a load balancer. Valid only for load balancers in a VPC.

     *
By default, Elastic Load Balancing creates an Internet-facing load balancer
     * with a DNS name that resolves to public IP addresses. For more information about
     * Internet-facing and Internal load balancers, see Load
     * Balancer Scheme in the Elastic Load Balancing User Guide.

     *
Specify internal to create a load balancer with a DNS name that
     * resolves to private IP addresses.

     */
    inline CreateLoadBalancerRequest& WithScheme(const Aws::String& value) { SetScheme(value); return *this;}

    /**
     *
The type of a load balancer. Valid only for load balancers in a VPC.

     *
By default, Elastic Load Balancing creates an Internet-facing load balancer
     * with a DNS name that resolves to public IP addresses. For more information about
     * Internet-facing and Internal load balancers, see Load
     * Balancer Scheme in the Elastic Load Balancing User Guide.

     *
Specify internal to create a load balancer with a DNS name that
     * resolves to private IP addresses.

     */
    inline CreateLoadBalancerRequest& WithScheme(Aws::String&& value) { SetScheme(std::move(value)); return *this;}

    /**
     *
The type of a load balancer. Valid only for load balancers in a VPC.

     *
By default, Elastic Load Balancing creates an Internet-facing load balancer
     * with a DNS name that resolves to public IP addresses. For more information about
     * Internet-facing and Internal load balancers, see Load
     * Balancer Scheme in the Elastic Load Balancing User Guide.

     *
Specify internal to create a load balancer with a DNS name that
     * resolves to private IP addresses.

     */
    inline CreateLoadBalancerRequest& WithScheme(const char* value) { SetScheme(value); return *this;}

    /**
     *
A list of tags to assign to the load balancer.

For more information
     * about tagging your load balancer, see Tag
     * Your Classic Load Balancer in the Classic Load Balancer Guide.

     */
    inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }

    /**
     *
A list of tags to assign to the load balancer.

For more information
     * about tagging your load balancer, see Tag
     * Your Classic Load Balancer in the Classic Load Balancer Guide.

     */
    inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }

    /**
     *
A list of tags to assign to the load balancer.

For more information
     * about tagging your load balancer, see Tag
     * Your Classic Load Balancer in the Classic Load Balancer Guide.

     */
    inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }

    /**
     *
A list of tags to assign to the load balancer.

For more information
     * about tagging your load balancer, see Tag
     * Your Classic Load Balancer in the Classic Load Balancer Guide.

     */
    inline CreateLoadBalancerRequest& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}

    /**
     *
A list of tags to assign to the load balancer.

For more information
     * about tagging your load balancer, see Tag
     * Your Classic Load Balancer in the Classic Load Balancer Guide.

     */
    inline CreateLoadBalancerRequest& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
A list of tags to assign to the load balancer.

For more information
     * about tagging your load balancer, see Tag
     * Your Classic Load Balancer in the Classic Load Balancer Guide.

     */
    inline CreateLoadBalancerRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }

    /**
     *
A list of tags to assign to the load balancer.

For more information
     * about tagging your load balancer, see Tag
     * Your Classic Load Balancer in the Classic Load Balancer Guide.

     */
    inline CreateLoadBalancerRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }

  private:
    Aws::String m_loadBalancerName;
    bool m_loadBalancerNameHasBeenSet;
    Aws::Vector<Listener> m_listeners;
    bool m_listenersHasBeenSet;
    Aws::Vector<Aws::String> m_availabilityZones;
    bool m_availabilityZonesHasBeenSet;
    Aws::Vector<Aws::String> m_subnets;
    bool m_subnetsHasBeenSet;
    Aws::Vector<Aws::String> m_securityGroups;
    bool m_securityGroupsHasBeenSet;
    Aws::String m_scheme;
    bool m_schemeHasBeenSet;
    Aws::Vector<Tag> m_tags;
    bool m_tagsHasBeenSet;
  };

} // namespace Model
} // namespace ElasticLoadBalancing
} // namespace Aws


text:
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;

public final class FooRoute {

    private FooRoute() { }

    public static void main(String[] args) {
        Main main = new Main();
        main.addRouteBuilder(new MyRouteBuilder());
        main.run(args);
    }

    public static class MyRouteBuilder extends RouteBuilder {
        @Override
        public void configure() throws Exception {
            from("direct:start")
                .transform().simple("Hello ${foo}")
                .to("mock:result");
        }
    }

}


text:
class TextBlockMigration {

  void concatenationWithThreeQuotes() {
    String quotes = "this concatenation contains<caret>\n" +
                    " three quotes\n" +
                    "one after another\n" +
                    "\"" +
                    '"' +
                    "\"";
  }

}


text:
package org.voovan.test.tools.serialize;

import junit.framework.TestCase;
import org.voovan.test.tools.json.TestObject;
import org.voovan.tools.TObject;
import org.voovan.tools.json.JSON;
import org.voovan.tools.reflect.TReflect;
import org.voovan.tools.serialize.ProtoStuffSerialize;
import org.voovan.tools.serialize.TSerialize;

import java.text.ParseException;
import java.util.*;

/**
 * 类文字命名
 *
 * @author helyho
 * DBase Framework.
 * WebSite: https://github.com/helyho/DBase
 * Licence: Apache v2 License
 */
public class TSerializationUnit extends TestCase {

    public static void testJSON() throws ParseException, ReflectiveOperationException {
        TestObject m = new TestObject();
        m.setBint(111);
        m.setString("str");
        Vector<Object> v = new Vector<Object>();
        v.add("v1111");
        v.add("v2222");
        m.setList(v);
        HashMap<String, Object> k = new HashMap<>();
        k.put("m1", "v1");
        k.put("m2", "v2");
        m.setMap(k);

        Map<String, TestObject> vvv = new HashMap<>();
        vvv.putIfAbsent("mm", m);

        byte[] bytes = TSerialize.serialize(vvv);
        Object object = TSerialize.unserialize(bytes);
        System.out.println(object);

        Object o = TReflect.getObjectFromMap(TestObject.class, TObject.asMap(), false);
        System.out.println(object);
    }

    public void testProtoStuffMapCollection() {
        TSerialize.SERIALIZE = new ProtoStuffSerialize();
        byte[] mm;
        Object mk;

        HashMap m = new HashMap();
//        m.putAll(TObject.asMap("a", "123123", "1", 123));
        mm =TSerialize.serialize(m);
        mk = TSerialize.unserialize(mm);
        System.out.println(mk);

        List m1 = new ArrayList();
        m1.add("123123");
        m1.add(123123);
        mm =TSerialize.serialize(m1);
        mk = TSerialize.unserialize(mm);
        System.out.println(mk);

        HashSet hashSet = new HashSet();
        hashSet.add("345345");
        mm =TSerialize.serialize(hashSet);
        mk = TSerialize.unserialize(mm);
        System.out.println(mk);

        TestObject testObject = new TestObject();
        testObject.setString("helyho");
        mm =TSerialize.serialize(testObject);
        mk = TSerialize.unserialize(mm);
        System.out.println(JSON.toJSON(mk));

    }
}