text:
package afterSales

import (
	"errors"
	"github.com/jsix/gof/db/orm"
	"go2o/core/domain/interface/after-sales"
	"go2o/core/domain/interface/member"
	"go2o/core/domain/interface/order"
	"go2o/core/domain/tmp"
	"math"
)

var _ afterSales.IRefundOrder = new(refundOrderImpl)

type refundOrderImpl struct {
	*afterSalesOrderImpl
	_refValue  *afterSales.RefundOrder
	_memberRep member.IMemberRep
}

func newRefundOrder(v *afterSalesOrderImpl, memberRep member.IMemberRep) *refundOrderImpl {
	if v._value.Type != afterSales.TypeRefund {
		panic(errors.New("售后单类型不是退款单"))
	}
	return &refundOrderImpl{
		afterSalesOrderImpl: v,
		_memberRep:          memberRep,
	}
}

func (r *refundOrderImpl) getValue() *afterSales.RefundOrder {
	if r._refValue == nil {
		if r.GetDomainId() <= 0 {
			panic(errors.New("退款单还未提交"))
		}
		v := &afterSales.RefundOrder{}
		if tmp.Db().GetOrm().Get(r.GetDomainId(), v) != nil {
			panic(errors.New("退款单不存在"))
		}
		r._refValue = v
	}
	return r._refValue
}

// 获取售后单数据
func (r *refundOrderImpl) Value() afterSales.AfterSalesOrder {
	v := r.afterSalesOrderImpl.Value()
	v2 := r.getValue()
	v.Data = *v2
	return v
}

// 保存
func (r *refundOrderImpl) saveRefundOrder() error {
	_, err := orm.Save(tmp.Db().GetOrm(), r._refValue, r.GetDomainId())
	return err
}

// 设置要退回货物信息
func (r *refundOrderImpl) SetItem(snapshotId int, quantity int) error {
	o := r.GetOrder()
	for _, v := range o.Items() {
		if v.SnapshotId == snapshotId {
			// 判断是否超过数量,减去已退货数量
			if v.Quantity-v.ReturnQuantity < quantity {
				return afterSales.ErrOutOfQuantity
			}
			// 设置退回商品
			r._value.SnapshotId = snapshotId
			r._value.Quantity = quantity
			return nil
		}
	}
	return afterSales.ErrNoSuchOrderItem
}

// 提交退款申请
func (r *refundOrderImpl) Submit() (int, error) {
	o := r.GetOrder()
	if o.GetValue().State >= order.StatShipped {
		return 0, afterSales.ErrRefundAfterShipped
	}
	id, err := r.afterSalesOrderImpl.Submit()
	// 提交退款单
	if err == nil {
		// 锁定退货数量
		err = o.Return(r._value.SnapshotId, r._value.Quantity)
		if err == nil {
			// 生成退款单
			err = r.submitRefundOrder()
		}
	}
	return id, err
}

// 提交退款单
func (r *refundOrderImpl) submitRefundOrder() (err error) {
	r._refValue = &afterSales.RefundOrder{
		Id:       r.afterSalesOrderImpl.GetDomainId(),
		IsRefund: 0,
	}
	// 计算退款金额
	o := r.GetOrder()
	for _, v := range o.Items() {
		if v.SnapshotId == r._value.SnapshotId {
			price := v.FinalAmount / float32(v.Quantity) // 计算单价
			r._refValue.Amount = price * float32(r._value.Quantity)
			break
		}
	}
	if r._refValue.Amount <= 0 || math.IsNaN(float64(r._refValue.Amount)) {
		return afterSales.ErrOrderAmount
	}
	_, err = orm.Save(tmp.Db().GetOrm(), r._refValue, 0)
	return err
}

// 取消申请
func (r *refundOrderImpl) Cancel() error {
	err := r.afterSalesOrderImpl.Cancel()
	if err == nil {
		// 撤销退货数量
		err = r.GetOrder().RevertReturn(r._value.SnapshotId, r._value.Quantity)
	}
	return err
}

// 退回申请
func (r *refundOrderImpl) Reject(remark string) error {
	err := r.afterSalesOrderImpl.Reject(remark)
	if err == nil {
		// 撤销退货数量
		err = r.GetOrder().RevertReturn(r._value.SnapshotId, r._value.Quantity)
	}
	return err
}

// 完成退款
func (r *refundOrderImpl) Process() error {
	err := r.afterSalesOrderImpl.Process()
	if err == nil {
		err = r.handleReturn()
	}
	return err
}

// 处理退款
func (r *refundOrderImpl) handleReturn() error {
	v := r.getValue()
	if v.IsRefund == 1 {
		return nil
	}
	v.IsRefund = 1
	err := r.saveRefundOrder()
	if err == nil {
		err = r.backAmount(v.Amount)
	}
	return err
}

// 退款
func (r *refundOrderImpl) backAmount(amount float32) error {
	o := r.GetOrder().GetValue()
	mm := r._memberRep.GetMember(r._value.BuyerId)
	if mm == nil {
		return member.ErrNoSuchMember
	}
	acc := mm.GetAccount()
	return acc.ChargeForBalance(member.ChargeByRefund, "订单退款",
		o.OrderNo, amount, member.DefaultRelateUser)
}

redpajama_set_name: RedPajamaGithub


text:
Puppet::Type.type(:ini_setting)#.providers

Puppet::Type.type(:neutron_plugin_vmware).provide(
  :ini_setting,
  :parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do

  def section
    resource[:name].split('/', 2).first
  end

  def setting
    resource[:name].split('/', 2).last
  end

  def separator
    ' = '
  end

  def file_path
    '/etc/neutron/plugins/vmware/nsx.ini'
  end

end


text:
======================
python-bitfinex-client
======================

Python package to communicate with the bitfinex.com API.

Compatible with Python 2.7+ and Python 3.3+

Overview
========

There are two classes. One for the public part of API and a second for the
trading part.

Public class doesn't need user credentials, because API commands which this
class implements are not bound to bitfinex user account.

Description of API: http://docs.bitfinex.com/


text:
from flask import jsonify
from flask import g

from common import get_region
from common import get_region_list
from common import create_or_update_region
from common import delete_region

from database import DBSession

from api_constants import HTTP_OK
from api_constants import HTTP_MULTI_STATUS_ERROR
from api_constants import RESPONSE_STATUS
from api_constants import RESPONSE_STATUS_MESSAGE
from api_constants import RESPONSE_ENVELOPE
from api_constants import APIStatus

from api_utils import validate_url_parameters
from api_utils import convert_json_request_to_list
from api_utils import validate_required_keys_in_dict
from api_utils import validate_acceptable_keys_in_dict
from api_utils import convert_value_to_list

from utils import get_acceptable_string

# Acceptable JSON keys
KEY_REGION_NAME = 'region_name'
KEY_SERVER_REPOSITORIES = 'server_repositories'

def api_create_regions(request):
    """
    POST:
    http://localhost:5000/api/v1/regions

    BODY:
    [{
      "name": "Region_1"
      "server_repository": ["Repository1", "Repository2"]

    },{
      "name": "Region_2"
    }]
    """
    rows = []
    db_session = DBSession()
    error_found = False

    json_list = convert_json_request_to_list(request)

    for data in json_list:
        row = dict()
        try:
            validate_required_keys_in_dict(data, [KEY_REGION_NAME])

            region_name = get_acceptable_string(data[KEY_REGION_NAME])
            row[KEY_REGION_NAME] = region_name

            if region_name is None or len(region_name) == 0:
                raise ValueError("'{}' is an invalid region name.".format(data[KEY_REGION_NAME]))

            validate_acceptable_keys_in_dict(data, [KEY_REGION_NAME, KEY_SERVER_REPOSITORIES])

            # If the server_repositories is not in the json, it will return None
            server_repositories = convert_value_to_list(data, KEY_SERVER_REPOSITORIES)

            region = get_region(db_session, region_name)
            if region is not None and server_repositories is None:
                server_repositories = get_region_server_name_list(region)

            create_or_update_region(db_session=db_session,
                                    region_name=region_name,
                                    server_repositories=None if server_repositories is None else ','.join(server_repositories),
                                    created_by=g.api_user.username,
                                    region=region)

            row[RESPONSE_STATUS] = APIStatus.SUCCESS

        except Exception as e:
            row[RESPONSE_STATUS] = APIStatus.FAILED
            row[RESPONSE_STATUS_MESSAGE] = e.message
            error_found = True

        rows.append(row)

    return jsonify(**{RESPONSE_ENVELOPE: {'region_list': rows}}), (HTTP_OK if not error_found else HTTP_MULTI_STATUS_ERROR)

def get_region_server_name_list(region):
    server_name_list = []
    for server in region.servers:
        server_name_list.append(server.hostname)

    return server_name_list

def api_get_regions(request):
    """
    GET:
    http://localhost:5000/api/v1/regions
    http://localhost:5000/api/v1/regions?name=Region_1
    """
    validate_url_parameters(request, [KEY_REGION_NAME])

    rows = []
    db_session = DBSession

    region_name = request.args.get(KEY_REGION_NAME)
    if region_name:
        region = get_region(db_session, region_name)
        if region is None:
            raise ValueError("Region '{}' does not exist in the database.".format(region_name))

        regions = [region]
    else:
        regions = get_region_list(db_session)

    for region in regions:
        if region is not None:
            row = dict()
            row[KEY_REGION_NAME] = region.name
            row[KEY_SERVER_REPOSITORIES] = [s.hostname for s in region.servers]
            rows.append(row)

    return jsonify(**{RESPONSE_ENVELOPE: {'region_list': rows}})

def api_delete_region(region_name):
    db_session = DBSession()

    delete_region(db_session, region_name)

    return jsonify(**{RESPONSE_ENVELOPE: {KEY_REGION_NAME: region_name, RESPONSE_STATUS: APIStatus.SUCCESS}})


text:
  font-size:14px;
}

#main span {
  -webkit-font-smoothing: subpixel-antialiased;
}

#geneBox * {
  border-bottom: 0;
}

.horizontalSegment {
  margin: 0px 20px;
  height: 90px;
}

.horizontalSegmentButton {
	margin: 15px;
	padding: 10px;
	background-color: #1f77b4;
	color: white;
	border: 1px solid #1f77b4;
	border-radius: 5px;
}

.horizontalSegmentButton:hover {
	color: #ff6b6b;
}

.selectors {
  margin: 0px 20px;
}

.densityplot--label-div--zoom {
  margin-left: 205px;
  position: absolute;
  height: 40px;
  z-index: 10;
  text-align: center;
}
.densityplot--label-x {
  position: absolute;
  font-size: .75em;
  transform: translate(-50%, 0);
  bottom: 0px;
}

.densityplot--label--axis-x {
  height: 1px;
  width: 100%;
  background-color: black;
  bottom: 0px;
  position: absolute;
}

.densityplot--label-y {
  display: inline-block;
  width: 0px;
  margin-top: 60px;
  float: left;
  -webkit-transform: rotate(-90deg);
	-moz-transform: rotate(-90deg);
	transform: rotate(-90deg);
}

.densityplot--label-vertical-tick {
  width: 1px;
  height: 4px;
  position: absolute;
  bottom: 0px;
  background-color: black;
}

.densityplot--label-div-zero {
  margin-left: 160px;
  position: absolute;
  height: 50px;
  width: 50px;
  z-index: 10;
  display: inline-block;
  text-align: center;
}

.densityplot--label-zero {
  font-size: .85em;
  line-height: 10px;
  -webkit-transform: rotate(-90deg);
	-moz-transform: rotate(-90deg);
	transform: rotate(-90deg);
}


text:
using System;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Transactions;
using System.Xml;
using System.Xml.Linq;
using EspaceClient.FrontOffice.Business.Depots;
using EspaceClient.FrontOffice.Data.Context;
using EspaceClient.FrontOffice.Data.Depots;
using EspaceClient.FrontOffice.Domaine;

namespace OGDC.Data.Depots
{
    public partial class DepotBusEspaceClient : Depot<object>, IDepotBusEspaceClient
    {

        private readonly IDepotDevis _depotDevis;

        /// <summary>
        /// Initialise une nouvelle instance du dépôt.
        /// </summary>
        /// <param name="dataContext">Contexte de la base de donnée.</param>
        public DepotBusEspaceClient(IEspaceClientDbContext dataContext, IDepotDevis depotDevis)
            : base(dataContext)
        {
            _depotDevis = depotDevis;
        }

        public string Process(string xml)
        {
            StringBuilder log = new StringBuilder();
            XDocument doc = XDocument.Parse(xml);
            //XDocument doc = XDocument.Load("busoscardevis.xml");

            var items = doc.Descendants("Item");

            if (!items.Any())
            {
                return "Aucun devis trouvé.";
            }

            foreach (var devis in items)
            {
                string nom = devis.Element("NOM") == null ? string.Empty : devis.Element("NOM").Value;
                string prenom = devis.Element("PRENOM") == null ? string.Empty : devis.Element("PRENOM").Value;
                string civilite = devis.Element("CIVILITE") == null ? string.Empty : devis.Element("CIVILITE").Value;
                string tel = devis.Element("TEL") == null ? string.Empty : devis.Element("TEL").Value;
                string mail = devis.Element("MAIL") == null ? string.Empty : devis.Element("MAIL").Value;
                string societe = devis.Element("SOCIETE") == null ? string.Empty : devis.Element("SOCIETE").Value;
                string codeclient = devis.Element("CODECLIENT") == null ? string.Empty : devis.Element("CODECLIENT").Value;
                string numdossier = devis.Element("NUMDOSSIER") == null ? string.Empty : devis.Element("NUMDOSSIER").Value;
                string numdevis = devis.Element("NUMDEVIS") == null ? string.Empty : devis.Element("NUMDEVIS").Value;
                string nomcommercial = devis.Element("NOMCOMMERCIAL") == null ? string.Empty : devis.Element("NOMCOMMERCIAL").Value;
                string prenomcommercial = devis.Element("PRENOMCOMMERCIAL") == null ? string.Empty : devis.Element("PRENOMCOMMERCIAL").Value;
                string emailcommercial = devis.Element("EMAILCOMMERCIAL") == null ? string.Empty : devis.Element("EMAILCOMMERCIAL").Value;
                string civilitecommercial = devis.Element("CIVILITECOMMERCIAL") == null ? string.Empty : devis.Element("CIVILITECOMMERCIAL").Value;
                string telcommercial = devis.Element("TELCOMMERCIAL") == null ? string.Empty : devis.Element("TELCOMMERCIAL").Value;
                string urldocument = devis.Element("URLDOCUMENT") == null ? string.Empty : devis.Element("URLDOCUMENT").Value;
                string libelle = devis.Element("LIBELLE") == null ? string.Empty : devis.Element("LIBELLE").Value;
                string libellesreferentiels = devis.Element("LIBELLESREFERENTIELS") == null ? string.Empty : devis.Element("LIBELLESREFERENTIELS").Value;
                bool misadisposition = true;
                if (devis.Element("MISADISPOSITION") != null)
                {
                    int mad;
                    if (int.TryParse(devis.Element("MISADISPOSITION").Value, out mad))
                    {
                        misadisposition = (mad != 0);
                    }
                }

                if (!string.IsNullOrWhiteSpace(numdevis) && !string.IsNullOrWhiteSpace(codeclient))
                {
                    using (TransactionScope tran = new TransactionScope())
                    {
                        var res = _depotDevis.CreateSelligentDevis(nom, prenom, civilite, tel, mail, societe, codeclient, numdossier, numdevis,
                        nomcommercial, prenomcommercial, emailcommercial, civilitecommercial, telcommercial, urldocument, libelle, libellesreferentiels, misadisposition);

                        if (res != null && res.CodeErreur > 0)
                        {
                            log.Append(string.Format("Devis {0} importé avec succès - ", numdevis));
                        }
                        else if (res != null && res.CodeErreur == 0)
                        {
                            log.Append(string.Format("Devis {0} non importé ou supprimé (visible = 0) - ", numdevis));
                        }
                        else
                        {
                            log.Append(string.Format("Erreur lors de l'importation du devis {0} - ", numdevis));
                        }
                        tran.Complete();
                    }
                }
                else
                {
                    log.Append(string.Format("Données invalides : {0}", devis));
                }

            }
            return log.ToString();

        }
    }
}


text:
package org.apache.ignite.internal.processors.cache;

import java.util.concurrent.Callable;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.TransactionConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.TransactionsMXBeanImpl;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
import org.apache.ignite.internal.util.lang.GridAbsPredicate;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.mxbean.TransactionsMXBean;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionRollbackException;
import org.apache.ignite.transactions.TransactionTimeoutException;
import org.junit.Test;

import static org.apache.ignite.internal.util.typedef.X.hasCause;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;

/**
 *
 */
public class SetTxTimeoutOnPartitionMapExchangeTest extends GridCommonAbstractTest {
    /** Wait condition timeout. */
    private static final long WAIT_CONDITION_TIMEOUT = 10_000L;

    /** {@inheritDoc} */
    @Override protected void afterTest() throws Exception {
        super.afterTest();

        stopAllGrids();
    }

    /**
     *
     */
    @Test
    public void testDefaultTxTimeoutOnPartitionMapExchange() throws Exception {
        IgniteEx ig1 = startGrid(1);
        IgniteEx ig2 = startGrid(2);

        TransactionConfiguration txCfg1 = ig1.configuration().getTransactionConfiguration();
        TransactionConfiguration txCfg2 = ig2.configuration().getTransactionConfiguration();

        final long expDfltTimeout = TransactionConfiguration.TX_TIMEOUT_ON_PARTITION_MAP_EXCHANGE;

        assertEquals(expDfltTimeout, txCfg1.getTxTimeoutOnPartitionMapExchange());
        assertEquals(expDfltTimeout, txCfg2.getTxTimeoutOnPartitionMapExchange());
    }

    /**
     *
     */
    @Test
    public void testJmxSetTxTimeoutOnPartitionMapExchange() throws Exception {
        startGrid(1);
        startGrid(2);

        TransactionsMXBean mxBean1 = txMXBean(1);
        TransactionsMXBean mxBean2 = txMXBean(2);

        final long expTimeout1 = 20_000L;
        final long expTimeout2 = 30_000L;

        mxBean1.setTxTimeoutOnPartitionMapExchange(expTimeout1);
        assertTxTimeoutOnPartitionMapExchange(expTimeout1);
        assertEquals(expTimeout1, mxBean1.getTxTimeoutOnPartitionMapExchange());

        mxBean2.setTxTimeoutOnPartitionMapExchange(expTimeout2);
        assertTxTimeoutOnPartitionMapExchange(expTimeout2);
        assertEquals(expTimeout2, mxBean2.getTxTimeoutOnPartitionMapExchange());
    }

    /**
     *
     */
    @Test
    public void testClusterSetTxTimeoutOnPartitionMapExchange() throws Exception {
        Ignite ig1 = startGrid(1);
        Ignite ig2 = startGrid(2);

        final long expTimeout1 = 20_000L;
        final long expTimeout2 = 30_000L;

        ig1.cluster().setTxTimeoutOnPartitionMapExchange(expTimeout1);
        assertTxTimeoutOnPartitionMapExchange(expTimeout1);

        ig2.cluster().setTxTimeoutOnPartitionMapExchange(expTimeout2);
        assertTxTimeoutOnPartitionMapExchange(expTimeout2);
    }

    /**
     * Tests applying new txTimeoutOnPartitionMapExchange while an exchange future runs.
     *
     * @throws Exception If fails.
     */
    @Test
    public void testSetTxTimeoutDuringPartitionMapExchange() throws Exception {
        IgniteEx ig = (IgniteEx) startGrids(2);

        checkSetTxTimeoutDuringPartitionMapExchange(ig);
    }

    /**
     * Tests applying new txTimeoutOnPartitionMapExchange while an exchange future runs on client node.
     *
     * @throws Exception If fails.
     */
    @Test
    public void testSetTxTimeoutOnClientDuringPartitionMapExchange() throws Exception {
        IgniteEx ig = startGrids(2);
        IgniteEx client = startClientGrid(getConfiguration("client"));

        checkSetTxTimeoutDuringPartitionMapExchange(client);
    }

    /**
     * @param ig Ignite instance where deadlock tx will start.
     * @throws Exception If fails.
     */
    private void checkSetTxTimeoutDuringPartitionMapExchange(IgniteEx ig) throws Exception {
        final long longTimeout = 600_000L;
        final long shortTimeout = 5_000L;

        TransactionsMXBean mxBean = txMXBean(0);

        // Case 1: set very long txTimeoutOnPME, transaction should be rolled back.
        mxBean.setTxTimeoutOnPartitionMapExchange(longTimeout);
        assertTxTimeoutOnPartitionMapExchange(longTimeout);

        AtomicReference<Exception> txEx = new AtomicReference<>();

        IgniteInternalFuture<Long> fut = startDeadlock(ig, txEx, 0);

        startGridAsync(2);

        waitForExchangeStarted(ig);

        mxBean.setTxTimeoutOnPartitionMapExchange(shortTimeout);

        awaitPartitionMapExchange();

        fut.get();

        assertTrue("Transaction should be rolled back", hasCause(txEx.get(), TransactionRollbackException.class));

        // Case 2: txTimeoutOnPME will be set to 0 after starting of PME, transaction should be cancelled on timeout.
        mxBean.setTxTimeoutOnPartitionMapExchange(longTimeout);
        assertTxTimeoutOnPartitionMapExchange(longTimeout);

        fut = startDeadlock(ig, txEx, 10000L);

        startGridAsync(3);

        waitForExchangeStarted(ig);

        mxBean.setTxTimeoutOnPartitionMapExchange(0);

        fut.get();

        assertTrue("Transaction should be canceled on timeout", hasCause(txEx.get(), TransactionTimeoutException.class));
    }

    /**
     * Start test deadlock
     *
     * @param ig Ig.
     * @param txEx Atomic reference to transaction exception.
     * @param timeout Transaction timeout.
     */
    private IgniteInternalFuture<Long> startDeadlock(Ignite ig, AtomicReference<Exception> txEx, long timeout)
        throws InterruptedException {
        // Without the awaiting txs can map on different topology versions causing unexpected behavior.
        awaitPartitionMapExchange();

        IgniteCache<Object, Object> cache = ig.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME)
                .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));

        AtomicInteger thCnt = new AtomicInteger();

        CyclicBarrier barrier = new CyclicBarrier(2);

        return GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
            @Override public Void call() {
                int thNum = thCnt.incrementAndGet();

                try (Transaction tx = ig.transactions().txStart(PESSIMISTIC, REPEATABLE_READ, timeout, 0)) {
                    cache.put(thNum, 1);

                    barrier.await();

                    cache.put(thNum % 2 + 1, 1);

                    tx.commit();
                }
                catch (Exception e) {
                    txEx.set(e);
                }

                return null;
            }
        }, 2, "tx-thread");
    }

    /**
     * Starts grid asynchronously and returns just before grid starting.
     * Avoids blocking on PME.
     *
     * @param idx Test grid index.
     * @throws Exception If fails.
     */
    private void startGridAsync(int idx) throws Exception {
        GridTestUtils.runAsync(new Runnable() {
            @Override public void run() {
                try {
                    startGrid(idx);
                }
                catch (Exception ignore) {
                    // no-op.
                }
            }
        });
    }

    /**
     * Waits for srarting PME on grid.
     *
     * @param ig Ignite grid.
     * @throws IgniteCheckedException If fails.
     */
    private void waitForExchangeStarted(IgniteEx ig) throws IgniteCheckedException {
        GridTestUtils.waitForCondition(new GridAbsPredicate() {
            @Override public boolean apply() {
                for (GridDhtPartitionsExchangeFuture fut: ig.context().cache().context().exchange().exchangeFutures()) {
                    if (!fut.isDone())
                        return true;
                }

                return false;
            }
        }, WAIT_CONDITION_TIMEOUT);

        // Additional waiting to ensure that code really start waiting for partition release.
        U.sleep(5_000L);
    }

    /** */
    private TransactionsMXBean txMXBean(int igniteInt) throws Exception {
        return getMxBean(getTestIgniteInstanceName(igniteInt), "Transactions",
            TransactionsMXBeanImpl.class, TransactionsMXBean.class);
    }

    /**
     * Checking the transaction timeout on all grids.
     *
     * @param expTimeout Expected timeout.
     * @throws IgniteInterruptedCheckedException If failed.
     */
    private void assertTxTimeoutOnPartitionMapExchange(final long expTimeout)
        throws IgniteInterruptedCheckedException {

        assertTrue(GridTestUtils.waitForCondition(new GridAbsPredicate() {
            @Override public boolean apply() {
                for (Ignite ignite : G.allGrids()) {
                    long actualTimeout = ignite.configuration()
                        .getTransactionConfiguration().getTxTimeoutOnPartitionMapExchange();

                    if (actualTimeout != expTimeout) {
                        log.warning(String.format(
                            "Wrong transaction timeout on partition map exchange [grid=%s, timeout=%d, expected=%d]",
                            ignite.name(), actualTimeout, expTimeout));

                        return false;
                    }
                }

                return true;

            }
        }, WAIT_CONDITION_TIMEOUT));
    }
}


text:
module.exports = {
  'env': {
    'node': true
  },
  'rules': {
    // enforce return after a callback
    'callback-return': 1,
    // enforces error handling in callbacks (node environment)
    'handle-callback-err': 1,
    // disallow mixing regular variable and require declarations
    'no-mixed-requires': [0, false],
    // disallow use of new operator with the require function
    'no-new-require': 1,
    // disallow string concatenation with __dirname and __filename
    'no-path-concat': 1,
    // disallow process.exit()
    'no-process-exit': 1,
    // restrict usage of specified node modules
    'no-restricted-modules': 0,
    // disallow use of synchronous methods (off by default)
    'no-sync': 1
  }
};


text:
namespace ash {
namespace internal {

EventClientImpl::EventClientImpl() {
}

EventClientImpl::~EventClientImpl() {
}

bool EventClientImpl::CanProcessEventsWithinSubtree(
    const aura::Window* window) const {
  const aura::RootWindow* root_window =
      window ? window->GetRootWindow() : NULL;
  if (Shell::GetInstance()->session_state_delegate()->IsScreenLocked() &&
      root_window) {
    const aura::Window* lock_screen_containers = Shell::GetContainer(
        root_window,
        kShellWindowId_LockScreenContainersContainer);
    const aura::Window* lock_background_containers = Shell::GetContainer(
        root_window,
        kShellWindowId_LockScreenBackgroundContainer);
    const aura::Window* lock_screen_related_containers = Shell::GetContainer(
        root_window,
        kShellWindowId_LockScreenRelatedContainersContainer);
    return (window->Contains(lock_screen_containers) &&
        window->Contains(lock_background_containers) &&
        window->Contains(lock_screen_related_containers)) ||
        lock_screen_containers->Contains(window) ||
        lock_background_containers->Contains(window) ||
        lock_screen_related_containers->Contains(window);
  }
  return true;
}

ui::EventTarget* EventClientImpl::GetToplevelEventTarget() {
  return Shell::GetInstance();
}

}  // namespace internal
}  // namespace ash


text:
/* MD part of the CoCoMANS miniapp
Virginie Dupont
December 2011*/

inline void* xmalloc(size_t size, const char *what) {
  void* out;
  out = malloc(size);
  if(size && !out) {
    fprintf(stderr,"null pointer in malloc for %s\n",what);
    abort();
  }
  return out;
}

inline void* xrealloc(void *ptr, size_t size, const char *what) {
  void* out;
  out = realloc(ptr, size);
  if(size && !out) {
    fprintf(stderr,"null pointer in realloc for %s\n",what);
    abort();
  }
  return out;
}

/*index function for pointers used instead of arrays
array[lmax][kmax][jmax][imax]
is declared as *array of size imax*jmax*kmax*lmax
accessing array[l][k][j][i] is equivalent to using
array[index(i,imax,j,jmax,k,kmax,l)] or *(array+index(i,imax,j,jmax,k,kmax,l))*/
inline int index(int i,int imax,int j,int jmax = 0,int k = 0,int kmax = 0, int l = 0) {
  return i + imax*(j + jmax*(k + kmax*l));
}

/* Initialized variables*/
const int mp_md = 2504;     // Should be a multiple of 8 but *not* of 4096 (32KB cache/8 ways per cache set)

template <size_t NUM_ELTS>
class XYZvector {
 public:
  double xyz[3][NUM_ELTS];
};

/*Simluation variabes*/
double time_md,dt_md,tfin;
double xyzL[3];

int np_md,none,it,nstep;

int freq;

int nsecout;
double vx_Mean;
double penergy,kenergy;

/*Atom related arrays*/
XYZvector<mp_md> pos;
XYZvector<mp_md> previous;

XYZvector<mp_md> velocity;
XYZvector<mp_md> velocity_h;   // Velocity at half timesteps

double rmass;

XYZvector<mp_md> force;

double gamxx0,epsilon,sigma;

/*Arrays needed for stress calculations*/
double vgrad[3][3];
double tchange,trelax;
double stress[3][3];

// We promise not to use fewer than this many <whatever>s.
#define MIN_NP_MD 1024


text:
class StageBot
{
public:
	StageBot();

private:
	void joyCallback(const sensor_msgs::Joy::ConstPtr& joy);

	ros::NodeHandle nh_;

	int linear_, angular_;
	double l_scale_, a_scale_;
	ros::Publisher vel_pub_;
	ros::Subscriber joy_sub_;

};

StageBot::StageBot():
	linear_(1),
	angular_(2)
{
	nh_.param("axis_linear", linear_, linear_);
	nh_.param("axis_angular", angular_, angular_);
	nh_.param("scale_angular", a_scale_, a_scale_);
	nh_.param("scale_linear", l_scale_, l_scale_);

	vel_pub_ = nh_.advertise<geometry_msgs::Twist>("cmd_vel", 1);

	joy_sub_ = nh_.subscribe<sensor_msgs::Joy>("joy", 100, &StageBot::joyCallback, this);
}

void StageBot::joyCallback(const sensor_msgs::Joy::ConstPtr& joy)
{
	geometry_msgs::Twist vel;
	if ( joy->buttons[4] == 1 && joy->buttons[5] == 1)
		{
		vel.angular.z = linear_*joy->axes[3];
		vel.linear.x = angular_*joy->axes[1];
		}
	vel_pub_.publish(vel);
}

int main(int argc, char** argv)
{
	ros::init(argc, argv, "joystick");
	StageBot stage_bot;

	ros::spin();
}


text:
package org.neo4j.graphalgo.centrality;

import static org.junit.Assert.assertTrue;

import java.util.Set;

import org.junit.Test;
import org.neo4j.graphalgo.CostEvaluator;
import org.neo4j.graphalgo.impl.centrality.StressCentrality;
import org.neo4j.graphalgo.impl.shortestpath.SingleSourceShortestPath;
import org.neo4j.graphalgo.impl.shortestpath.SingleSourceShortestPathDijkstra;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;

import common.Neo4jAlgoTestCase;

public class StressCentralityTest extends Neo4jAlgoTestCase
{
    protected SingleSourceShortestPath<Double> getSingleSourceShortestPath()
    {
        return new SingleSourceShortestPathDijkstra<Double>( 0.0, null,
            new CostEvaluator<Double>()
            {
                public Double getCost( Relationship relationship,
                            Direction direction )
                {
                    return 1.0;
                }
            }, new org.neo4j.graphalgo.impl.util.DoubleAdder(),
            new org.neo4j.graphalgo.impl.util.DoubleComparator(),
            Direction.BOTH, MyRelTypes.R1 );
    }

    protected void assertCentrality( StressCentrality<Double> stressCentrality,
        String nodeId, Double value )
    {
        assertTrue( stressCentrality.getCentrality( graph.getNode( nodeId ) )
            .equals( value ) );
    }

    @Test
    public void testBox()
    {
        graph.makeEdgeChain( "a,b,c,d,a" );
        StressCentrality<Double> stressCentrality = new StressCentrality<Double>(
            getSingleSourceShortestPath(), graph.getAllNodes() );
        stressCentrality.calculate();
        assertCentrality( stressCentrality, "a", 1.0 );
        assertCentrality( stressCentrality, "b", 1.0 );
        assertCentrality( stressCentrality, "c", 1.0 );
        assertCentrality( stressCentrality, "d", 1.0 );
    }

    @Test
    public void testPlusShape()
    {
        graph.makeEdgeChain( "a,b,c" );
        graph.makeEdgeChain( "d,b,e" );
        StressCentrality<Double> stressCentrality = new StressCentrality<Double>(
            getSingleSourceShortestPath(), graph.getAllNodes() );
        stressCentrality.calculate();
        assertCentrality( stressCentrality, "a", 0.0 );
        assertCentrality( stressCentrality, "b", 6.0 );
        assertCentrality( stressCentrality, "c", 0.0 );
        assertCentrality( stressCentrality, "d", 0.0 );
        assertCentrality( stressCentrality, "e", 0.0 );
    }

    @Test
    public void testChain()
    {
        graph.makeEdgeChain( "a,b,c,d,e" );
        StressCentrality<Double> stressCentrality = new StressCentrality<Double>(
            getSingleSourceShortestPath(), graph.getAllNodes() );
        stressCentrality.calculate();
        assertCentrality( stressCentrality, "a", 0.0 );
        assertCentrality( stressCentrality, "b", 3.0 );
        assertCentrality( stressCentrality, "c", 4.0 );
        assertCentrality( stressCentrality, "d", 3.0 );
        assertCentrality( stressCentrality, "e", 0.0 );
    }

    @Test
    public void testStressUpdating()
    {
        graph.makeEdgeChain( "a,b,c,d,e,f" );
        new StressTest( getSingleSourceShortestPath(), graph.getAllNodes() )
            .test();
    }

    class StressTest extends StressCentrality<Double>
    {
        public StressTest(
            SingleSourceShortestPath<Double> singleSourceShortestPath,
            Set<Node> nodeSet )
        {
            super( singleSourceShortestPath, nodeSet );
        }

        public void test()
        {
            // avoid starting the real calculation by mistake
            this.doneCalculation = true;
            // set things up
            Node startNode = graph.getNode( "c" );
            singleSourceShortestPath.reset();
            singleSourceShortestPath.setStartNode( startNode );
            processShortestPaths( startNode, singleSourceShortestPath );
            Double adjustment = 0.5; // since direction is BOTH
            assertCentrality( this, "a", 0.0 * adjustment );
            assertCentrality( this, "b", 1.0 * adjustment );
            assertCentrality( this, "c", 0.0 * adjustment );
            assertCentrality( this, "d", 2.0 * adjustment );
            assertCentrality( this, "e", 1.0 * adjustment );
            assertCentrality( this, "f", 0.0 * adjustment );
        }
    }
}


text:
using namespace seqan;

// TODO(aiche): write tests for basic functions in ArgumentParser
SEQAN_DEFINE_TEST(test_argument_parser)
{
    ArgumentParser parser;
    addOption(parser, ArgParseOption("i", "integer", "help of an integer option", ArgParseArgument::INTEGER, "", true));
    _assignArgumentValue(getOption(parser, "i"), "10");
    _assignArgumentValue(getOption(parser, "i"), "12");
}

#endif // SEQAN_CORE_TESTS_ARG_PARSE_TEST_ARGUMENT_PARSER_H_


text: module.exports = require('./lib/rpc')


text:
<com.example.touch.TouchImageView xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/image"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:background="#FFFFFFFF"/>


text:
import time
import getopt
import sys
from Modules.data import DataFetch, DataAdd, DataEdit, DataExport, DataImport
running = True

class Main():

    def start(self):
        print(
            "\n\n\nWelcome to this easy to use address-book",
            "written to be used in the\n" +
            "CLI. This will hopefully give you the ability",
            "to store and search\n" +
            "All of your contact using their name.\n\n\n")
        df = DataFetch()
        df.database_conn()
        while running:
            print("What do you want to do?\n",
                  "1. add a person\n",
                  "2. view address-book\n",
                  "3. search\n",
                  "4. edit\n",
                  "5. Import or export data\n",
                  "6. quit")
            choice = input("Enter the number of the action " +
                           "you want to do:\n\n")

            if choice == '1':
                self.update_data()
            elif choice == '2':
                df = DataFetch()
                print(df.print_content_all())
            elif choice == '3':
                print("Search for a person in the database using their full",
                      " name(if you can't remember parts of the name will",
                      "also work):\n")
                name = input()
                df = DataFetch()
                df.search_data(name)
            elif choice == '4':
                self.edit_data()
            elif choice == '5':
                print("What do you want to do?\n",
                      "1. Export data?\n",
                      "2. Import data?\n")
                answ = input()
                if answ == "1":
                    self.export_data()
                elif answ == "2":
                    self.import_data()
            elif choice == '6':
                sys.exit()
            else:
                print("You need to pick a valid option")

    def update_data(self):
        print("Enter a name:\n")
        name = input()
        print("Enter a phone number:\n")
        phoneNumber = input()
        print("Enter a address:\n")
        address = input()
        print("Enter a email:\n")
        email = input()
        da = DataAdd()
        da.save_data(name, phoneNumber, address, email)

    def export_data(self):
        de = DataExport()
        print("Welcome to the section used to export data!\n",
              "What format would you like to export your table into?\n",
              "Valid formats are: CSV, txt, xlxs")
        answ = input()
        if answ in {"CSV", "csv"}:
            startTime = time.time()
            de.export_csv()
            print("The export was succseful and it took:",
                  (time.time() - startTime), "s")
        elif answ in {"TXT", "txt"}:
            de.export_txt()
            print("Success!")
        else:
            print("Not a valid format")

    def import_data(self):
        di = DataImport()
        file_name = input("What is the filename?\n\t")
        di.import_csv(file_name)
        print("Success!")

    def edit_data(self):
        print("What do you want to edit(Enter the number of the",
              "part you want to change)?\n")
        print(" 1. All\n",
              "2. Name\n",
              "3. Phone number\n",
              "4. Address\n",
              "5. Email\n")
        choice = input()
        if choice == '1':
            print("Enter the name of the contact you want to modify:\n\n")
            cname = input()
            print("Thanks.\nEnter the new name:\n")
            name = input()
            print("Enter the new Phone number:\n")
            phoneNumber = input()
            print("Enter the new Address:\n")
            address = input()
            print("Enter the new email:\n")
            email = input()
            da = DataEdit()
            da.update_database(cname, name, phoneNumber, address, email)
        elif choice == '2':
            print("Enter the name of the contact you want to modify:\n\n")
            cname = input()
            print("Thanks!\nEnter the new name:\n")
            name = input()
            da = DataEdit()
            da.update_database_name(cname, name)
        elif choice == '3':
            print("Enter the name of the contact you want to modify:\n\n")
            cname = input()
            print("Thanks!\nEnter the new phone number:\n")
            phoneNumber = input()
            da = DataEdit()
            da.update_database_number(cname, phoneNumber)
        elif choice == '4':
            print("Enter the name of the contact you want to modify:\n\n")
            cname = input()
            print("Thanks!\nEnter the new address:\n")
            address = input()
            da = DataEdit()
            da.update_database_address(cname, address)
        elif choice == '5':
            print("Enter the name of the contact you want to modify:\n\n")
            cname = input()
            print("Thanks!\nEnter the new email-address:")
            email = input()
            da = DataEdit()
            da.update_database_email(cname, email)
        else:
            print("You need to enter an actual value")

    # Help text to be printed if arguments are mismatching
    def help_text(self):
        return """  -h -help for help
                    -add to add, need be followed by
                        -n and a name
                        -p and a phone number
                        -e and an email
                        -a and an address
                    -pa to print all
                    -s and an search phrase (name atm)"""

    # Main function. It loops through the arguments and see if they match
    # If they match - the data is saved, and some action is taken.
    def main(self, argv):
        df = DataFetch()
        df.database_conn()
        willAdd = False
        phone = ""
        name = ""
        address = ""
        email = ""
        will_print = False
        will_search = False
        search_phrase = ""

        try:
            opts, args = getopt.getopt(
                argv, "h:n:p:a:e:dd:g:s:", [
                    "help=", "phone=", "name=",
                    "address=", "email=", "printall=", "search="])
        except getopt.GetoptError:
            print(self.help_text())
            sys.exit(2)

        # looping through the arguments to find a matching one
        for opt, arg in opts:
            if opt == '-h':
                print(self.help_text())
                sys.exit()

            elif opt in ("-dd"):
                willAdd = True

            elif opt in ("-p", "--phone"):
                phone = arg

            elif opt in ("-a", "--address"):
                address = arg
                print("test")

            elif opt in ("-n", "--name"):
                name = arg

            elif opt in ("-e", "--email"):
                email = arg

            elif opt in ("-g", "--printall"):
                will_print = True

            elif opt in ("-s", "--search"):
                will_search = True
                search_phrase = arg
        # if arguments are supplied, but without print or add, print help text
        if not willAdd and not will_print and not will_search and len(
                opts) > 1:
            print(self.help_text())
        # is true if the -dd arguemnt was added
        if willAdd:
            # if both the -dd and -pa was supplied -
            # add and print, not allowed
            if will_print:
                print(self.help_text())
                sys.exit()
            # if the -dd was used, you need at least to supply a name.
            if name != "":
                # all of this data was fetched from the arguments
                self.save_data(name, phone, address, email)
                sys.exit()
        elif will_print:  # true if -pa was added.
            df = DataFetch()
            print(df.print_content_all())
            sys.exit()

        elif will_search:
            df = DataFetch()
            df.search_data(search_phrase)
            sys.exit()

        else:  # no arguments - run the menu.
            m.start()

m = Main()
while running:
    m.main(sys.argv[1:])


text:
package com.example.nabu.perylol.perylol_movil.Modelos;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;

/**
 * Created by Luiis Plata on 10/06/2015.
 */
public class Conexion {

    private static AsyncHttpClient client = new AsyncHttpClient();

    public static void get(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
        client.get(url, params, responseHandler);
    }

    public static void post(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
        client.post(url, params, responseHandler);
    }

}


text: A Objective-C NSObject category for make a http request using AFNetworking framework.


text:
ToDo Mobile App is a Task Manager application that is integrated into the [Google Tasks API](https://developers.google.com/google-apps/tasks/) and adds additional features on top of the Google Task view, like the ability to set task due time and priority. It is linked to your Google+ account and requires you to first log in with your Google+ account before you are allowed to use the application. The application has the following features:
- Google+ login
- Add items to your task list; (press menu icon on top)
- Set a task name, priority, due date, due time;
- Edit an existing task; (long press)
- Mark a task a completed;
- Delete a task; (swipe)
- Sort tasks by due or priority;
- Reminder you the task past due;
- Synchronize the tasks with mobile version, web version, and Google Tasks.
- Show current location in Google Map
- Send task by SMS Message
- Send task by email
- Send push notification from server
- Receive text shared from other apps, such as browser

## Example App

A working version of the app can be found [here](https://play.google.com/store/apps/details?id=com.rockyniu.todolist).

## Build your own project

  1) put support\v13 package into /lib folder

  the package is here, ANDRIOD_SDK_BUNDEL\Eclipse\sdk\extras\android\support\v13, if you use SDK manager download it.

  2) import google_play_services library, you can find the instruction [here](http://developer.android.com/google/play-services/setup.html)

3) update android_sdk_bundle to latest version, import google_tasks_api


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.01.28 at 11:39:24 PM COT
//

package com.bpm4sb.bpmn;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for tGlobalUserTask complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="tGlobalUserTask">
 *   <complexContent>
 *     <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGlobalTask">
 *       <sequence>
 *         <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}rendering" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="implementation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplementation" default="##unspecified" />
 *       <anyAttribute processContents='lax' namespace='##other'/>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "tGlobalUserTask", propOrder = {
    "rendering"
})
public class TGlobalUserTask
    extends TGlobalTask
{

    protected List<TRendering> rendering;
    @XmlAttribute(name = "implementation")
    protected String implementation;

    /**
     * Gets the value of the rendering property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the rendering property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getRendering().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link TRendering }
     *
     *
     */
    public List<TRendering> getRendering() {
        if (rendering == null) {
            rendering = new ArrayList<TRendering>();
        }
        return this.rendering;
    }

    /**
     * Gets the value of the implementation property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getImplementation() {
        if (implementation == null) {
            return "##unspecified";
        } else {
            return implementation;
        }
    }

    /**
     * Sets the value of the implementation property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setImplementation(String value) {
        this.implementation = value;
    }

}


text:
#include "stdhdr.h"
#include "entity.h"
#include "classtbl.h"
#include "falcsess.h"
#include "F4Vu.h"
#include "Flight.h"
#include "CampList.h"
#include "FalcMesg.h"
#include "SimBase.h"
#include "SimMover.h"
#include "SimDrive.h"
#include "OTWDrive.h"
#include "MsgInc/PlayerStatusMsg.h"
#include "GameMgr.h"
#include "PlayerOp.h"
#include "TimerThread.h"
#include "aircrft.h"
#include "MsgInc/RadioChatterMsg.h"
#include "fsound.h"
#include "FalcSnd/LHSP.h"
#include "FalcSnd/FalcVoice.h"
#include "FalcSnd/VoiceManager.h"
#include "digi.h"
#include "atcbrain.h"
#include "dogfight.h"

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

extern void RebuildFLOTList (void);
extern void SetLabel (SimBaseClass* theObject);

extern int gRebuildBubbleNow;

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

ulong gBumpTime = 0;
int	gBumpFlag = FALSE;
GameManagerClass	GameManager;

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Returns 1 if all players in the game are ready to fly.

int GameManagerClass::AllPlayersReady (VuGameEntity *game)
{
	VuSessionsIterator		sessionWalker(game);
	FalconSessionEntity		*session;
	FalconEntity			*sessent;

	int
		ok = TRUE;

	session = (FalconSessionEntity*)sessionWalker.GetFirst();
	while (session)
	{
		sessent = (FalconEntity*)session->GetPlayerEntity();

		MonoPrint ("APR %s %d\n", session->GetPlayerCallsign (), session->GetFlyState ());

		if ((session->GetFlyState() != FLYSTATE_WAITING) && (session->GetFlyState() != FLYSTATE_FLYING))
		{
			ok = FALSE;
		}

		session = (FalconSessionEntity*)sessionWalker.GetNext();
	}

	return ok;
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

// Returns 1 if all players in the game are in the UI (or heading there)
int GameManagerClass::NoMorePlayers (VuGameEntity *game)
{
	VuSessionsIterator		sessionWalker(game);
	FalconSessionEntity		*session;

	int
		ok = TRUE;

	session = (FalconSessionEntity*)sessionWalker.GetFirst();
	while (session)
	{
//		MonoPrint ("NMP %s %d\n", session->GetPlayerCallsign (), session->GetFlyState ());

		if (session->GetFlyState() != FLYSTATE_IN_UI)
		{
			ok = FALSE;
		}

		session = (FalconSessionEntity*)sessionWalker.GetNext();
	}

	return ok;
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

// Checks and sets player status of this entity
// (i.e: is there one or more players attached to this?)
int GameManagerClass::CheckPlayerStatus (FalconEntity *entity)
{
	VuSessionsIterator		sessionWalker(FalconLocalGame);
	FalconSessionEntity		*session;
	int						player=0;

	if (!entity){
		return 0;
	}

	session = (FalconSessionEntity*)sessionWalker.GetFirst();
	while (session && !player){
		if (entity->IsSim() && entity == session->GetPlayerEntity()){
			player = 1;
		}
		else if (
			(entity->IsCampaign()) &&
			(
				(entity == session->GetPlayerFlight()) ||
				(entity == session->GetPlayerSquadron())
			)
		){
			player = 1;
		}
		session = (FalconSessionEntity*)sessionWalker.GetNext();
	}

	if (player){
		entity->SetFalcFlag(FEC_HASPLAYERS);
	}
	else {
		entity->UnSetFalcFlag(FEC_HASPLAYERS);
	}

	return player;
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

void GameManagerClass::AnnounceEntry()
{
	// Announce our entry to the other players
	FalconPlayerStatusMessage	*msg = new FalconPlayerStatusMessage(FalconLocalSessionId, FalconLocalGame);
	SimBaseClass				*playerEntity = (SimBaseClass*) FalconLocalSession->GetPlayerEntity();

	_tcscpy(msg->dataBlock.callsign, FalconLocalSession->GetPlayerCallsign());
	msg->dataBlock.playerID         = playerEntity->Id();
	msg->dataBlock.campID           = ((CampBaseClass*)(playerEntity->GetCampaignObject()))->GetCampID();
	msg->dataBlock.side             = ((CampBaseClass*)(playerEntity->GetCampaignObject()))->GetOwner();
	msg->dataBlock.pilotID          = FalconLocalSession->GetPilotSlot();
	msg->dataBlock.vehicleID		= FalconLocalSession->GetAircraftNum();
	msg->dataBlock.state            = PSM_STATE_ENTERED_SIM;
	FalconSendMessage(msg, TRUE);
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

void GameManagerClass::AnnounceExit()
{
	// Announce our exit to the other players
	FalconPlayerStatusMessage	*msg = new FalconPlayerStatusMessage(FalconLocalSessionId, FalconLocalGame);
	SimBaseClass				*playerEntity = (SimBaseClass*) FalconLocalSession->GetPlayerEntity();

	if (FalconLocalSession->GetPlayerFlight())
	{
		msg->dataBlock.campID		= FalconLocalSession->GetPlayerFlight()->GetCampID();
	}
	else
	{
		msg->dataBlock.campID		= 0;
	}

	if (playerEntity)
	{
		msg->dataBlock.playerID         = playerEntity->Id();
	}

	_tcscpy(msg->dataBlock.callsign,FalconLocalSession->GetPlayerCallsign());

	msg->dataBlock.side             = FalconLocalSession->GetCountry();
	msg->dataBlock.pilotID          = FalconLocalSession->GetPilotSlot();
	msg->dataBlock.vehicleID		= FalconLocalSession->GetAircraftNum();
	msg->dataBlock.state            = PSM_STATE_LEFT_SIM;

	if (FalconLocalGame->GetGameType() == game_Dogfight)
	{
		if (SimDogfight.GetGameType () == dog_TeamMatchplay)
		{
			SimDogfight.localGameStatus = dog_Waiting;
		}
	}

	FalconSendMessage(msg, TRUE);
	FalconLocalSession->SetFlyState(FLYSTATE_IN_UI);
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

void GameManagerClass::AnnounceTransfer (SimBaseClass *oldObj, SimBaseClass *newObj)
{
	// Announce our transfer of entities to the other players
	FalconPlayerStatusMessage	*msg = new FalconPlayerStatusMessage(FalconLocalSessionId, FalconLocalGame);

	_tcscpy(msg->dataBlock.callsign, FalconLocalSession->GetPlayerCallsign());
	msg->dataBlock.playerID         = newObj->Id();
	msg->dataBlock.oldID			= oldObj->Id();

	if (oldObj->GetCampaignObject())
	{
		msg->dataBlock.campID		= ((CampBaseClass*)(oldObj->GetCampaignObject()))->GetCampID();
	}
	else
	{
		msg->dataBlock.campID		= 0;
	}

	msg->dataBlock.pilotID          = FalconLocalSession->GetPilotSlot();
	msg->dataBlock.vehicleID		= FalconLocalSession->GetAircraftNum();
	msg->dataBlock.state            = PSM_STATE_TRANSFERED;
	FalconSendMessage(msg, TRUE);
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

// ===============================================================
// Here are our attachment functions (How the player gets a plane)
// ===============================================================

// Find a specific vehicle inside campEntity
SimMoverClass* GameManagerClass::FindPlayerVehicle (UnitClass *campEntity, int vehSlot) {
	SimMoverClass* simEntity = NULL;

	if ((!campEntity) || (!campEntity->GetComponents())){
		return NULL;
	}

	VuListIterator	flit(campEntity->GetComponents());
	if ((simEntity = static_cast<SimMoverClass*>( flit.GetFirst() )) == NULL){
		return NULL;
	}
	while (simEntity->vehicleInUnit != vehSlot) {
		simEntity = (SimMoverClass*) flit.GetNext();
	}
	return simEntity;

/*	int		count;

	SimMoverClass* simEntity = NULL;

	if (!campEntity)
		return NULL;

	if (campEntity->GetComponents())
	{
		VuListIterator	flit(campEntity->GetComponents());

		// Hack Hack Hack Hack HACK - This is a HACK - RH
		count = 0;

		while ((!simEntity) && (count < 100))
		{
			simEntity = (SimMoverClass*) flit.GetFirst();

			while (simEntity && simEntity->vehicleInUnit != vehSlot)
			{
				simEntity = (SimMoverClass*) flit.GetNext();
			}

			count ++;
			Sleep (100);
		}

		ShiAssert(simEntity);
	}
	else
	{
		MonoPrint ("No Components\n");
	}

	return simEntity;

*/
}

// Attach passed player to this sim entity
SimMoverClass* GameManagerClass::AttachPlayerToVehicle (FalconSessionEntity *player, SimMoverClass *simEntity, int playerSlot)
{
	Unit		campEntity;

	//simEntity->ChangeOwner(player->Id());
	player->SetPlayerEntity(simEntity);
	if (player == FalconLocalSession){
		simEntity->MakePlayerVehicle();
#define NEW_ATTACH_ORDER 1
#if NEW_ATTACH_ORDER
		// sfr: set it here, since start loop calls this too
		OTWDriver.SetGraphicsOwnship(simEntity);
#endif
		// sfr: this will need changing if one day players are not aircraft anymore
		SimDriver.SetPlayerEntity(static_cast<AircraftClass*>(simEntity));
#if !NEW_ATTACH_ORDER
		// sfr: set it here, since start loop calls this too
		OTWDriver.SetGraphicsOwnship(simEntity);
#endif
		RebuildFLOTList();
		simEntity->ConfigurePlayerAvionics();
	}
	else {
		simEntity->MakePlayerVehicle();
	}

	simEntity->pilotSlot = playerSlot;

	LockPlayer(player);

	CheckPlayerStatus(simEntity);
	campEntity = (UnitClass*)simEntity->GetCampaignObject();
	CheckPlayerStatus(campEntity);

	SetLabel(simEntity);

	gRebuildBubbleNow = TRUE;

	return simEntity;
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

int GameManagerClass::DetachPlayerFromVehicle(FalconSessionEntity *player, SimMoverClass* simEntity){
	Unit campEntity;

	if (simEntity){
		// JB 010617 (Fixes MP bug where ejected planes can't be destroyed)
		simEntity->UnSetFalcFlag(FEC_INVULNERABLE);
		simEntity->MakeNonPlayerVehicle();
		simEntity->pilotSlot = simEntity->vehicleInUnit;

		if (player){
			player->SetPlayerEntity(NULL);
		}

		// Check it's the local player
		if (player == FalconLocalSession){
			SimDriver.SetPlayerEntity(NULL);
			OTWDriver.SetGraphicsOwnship(NULL);
		}

		// Update player status of entity and it's campaign parent
		CheckPlayerStatus(simEntity);
		campEntity = (UnitClass*)simEntity->GetCampaignObject();
		CheckPlayerStatus(campEntity);

		SetLabel(simEntity);

		gRebuildBubbleNow = TRUE;
	}
	return 1;
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

void GameManagerClass::ReassignPlayerVehicle (FalconSessionEntity *player, SimMoverClass *oldEntity, SimMoverClass *newEntity)
{
	DetachPlayerFromVehicle(player, oldEntity);
	AttachPlayerToVehicle(player, newEntity, player->GetPilotSlot());
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

void GameManagerClass::LockPlayer (FalconSessionEntity *player)
{
	SimMoverClass* simEntity = (SimMoverClass*) player->GetPlayerEntity();

	if (simEntity){
		MonoPrint ("Locking up the hounds %08x - setting invulnerable\n", simEntity);

		// Set our entry flags
		simEntity->SetFalcFlag(FEC_INVULNERABLE);
		simEntity->SetFalcFlag(FEC_PLAYER_ENTERING);
		simEntity->SetFalcFlag(FEC_HOLDSHORT);

		gRebuildBubbleNow = TRUE;
	}
	else {
		MonoPrint("Not locking hounds - no sim entity\n");
	}
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

// The player is ready to go.. We're going to set our invulnerability countdown and release the aircraft from motion pause
void GameManagerClass::ReleasePlayer(FalconSessionEntity *player)
{
	SimMoverClass* simEntity = (SimMoverClass*) player->GetPlayerEntity();

	ShiAssert ( player != FalconLocalSession || simEntity );

	if (simEntity){
		simEntity->UnSetFalcFlag(FEC_PLAYER_ENTERING);
		simEntity->UnSetFalcFlag(FEC_HOLDSHORT);
		MonoPrint ("Releasing the player\n");
		if (!PlayerOptions.InvulnerableOn()){
			MonoPrint ("Releasing the hounds %08x - not invulnerable\n", simEntity);
			simEntity->UnSetFalcFlag(FEC_INVULNERABLE);
		}
		else {
			MonoPrint ("Releasing the hounds %08x\n", simEntity);
		}

		simEntity->MakeFlagsDirty();

		simEntity->ChangeOwner(player->Id());
		OTWDriver.SetGraphicsOwnship(NULL);
		simEntity->MakePlayerVehicle();
		simEntity->ConfigurePlayerAvionics();
		OTWDriver.SetGraphicsOwnship(simEntity);

		player->SetFlyState(FLYSTATE_FLYING);

		// sfr: why OnGround its not disabled ???
		// this is causing players to begin with AP on.
		// commentted out
		if (simEntity->IsAirplane()/* && !simEntity->OnGround()*/){
			((AircraftClass *)simEntity)->SetAutopilot(AircraftClass::APOff);
		}

		SetTimeCompression(1);
		TheCampaign.Resume();
		OTWDriver.SetOTWDisplayMode(OTWDriverClass::Mode2DCockpit);

		if(simEntity->OnGround() && simEntity->IsAirplane()){
			gBumpFlag = TRUE;
			gBumpTime = SimLibElapsedTime + FalconLocalGame->GetRules()->BumpTimer;
			if(((AircraftClass *)simEntity)->DBrain()->CreateTime() + 2*CampaignSeconds < SimLibElapsedTime){
				FalconRadioChatterMessage	*radioMessage = NULL;
				ObjectiveClass *atc = (ObjectiveClass*)vuDatabase->Find(
					((AircraftClass*)simEntity)->DBrain()->Airbase()
				);

				if(((AircraftClass*)simEntity)->DBrain()->IsSetATC(DigitalBrain::PermitTakeoff)){
					radioMessage = CreateCallFromATC(
						atc, (AircraftClass*)simEntity, rcCLEAREDONRUNWAY, FalconLocalSession
					);
					radioMessage->dataBlock.edata[3] = atc->brain->GetRunwayName(
						((AircraftClass*)simEntity)->DBrain()->Runway()
					);
				}
				else if( ((AircraftClass*)simEntity)->DBrain()->IsSetATC(DigitalBrain::PermitRunway) ){
					radioMessage = CreateCallFromATC(
						atc, (AircraftClass*)simEntity, rcPOSITIONANDHOLD, FalconLocalSession
					);
					radioMessage->dataBlock.edata[3] = atc->brain->GetRunwayName(
						((AircraftClass*)simEntity)->DBrain()->Runway()
					);
				}
				else {
					radioMessage = CreateCallFromATC(
						atc, (AircraftClass*)simEntity, rcCLEARTOTAXI, FalconLocalSession
					);
					radioMessage->dataBlock.edata[2] = atc->brain->GetRunwayName(
						((AircraftClass*)simEntity)->DBrain()->Runway()
					);
				}
				radioMessage->dataBlock.time_to_play = 2 * CampaignSeconds;
				FalconSendMessage(radioMessage, FALSE);
			}
		}

		gRebuildBubbleNow = TRUE;
	}
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////


text:
function handleMe(response) {
    player.id = response.me.id;
    handleLobbyUpdate(response.lobby);
}

// Change UI [lobby, game, leaderboard]
function handleLobbyUpdate(response) {
    // Only worry about response once we get our id
    if (!player.id) {
        return;
    }

    // Update state
    state = response.state;

    UIHideAll();
    if (state === STATE_LOBBY) {
        $("#lobby").show();
        UIUpdateLobbyPlayers(response.players);
    } else if (state === STATE_GAME) {
        $("#game").show();
    } else if (state === STATE_GAME_OVER) {
        $("#leaderboard").show();
    }
}

// Role is a enum (see roles.js)
function handlePlayerRole(role) {
    console.log("My role is: " + role);
    player.role = role;

    game.state.start("play");
    if (role === ROLE_APE) {
        updateLevelStart();
    } else {
        console.log("I AM A JAILER");
    }
}

// A new level started
function handleLevelStart(response) {
    console.log("The level is: " + response);
}

var lastUpdate = new Date();
//Ape position updated by server
function handleGameState(state){
    // Latency checking
    var currentUpdate = new Date();
    //console.log("Last update "+(currentUpdate - lastUpdate) + "ms ago");
    lastUpdate = currentUpdate;

    if (window.player.role === ROLE_JAILER){
        for(var player in state.players){
            switch(state.players[player].role){
                case ROLE_APE:
                    var xPos = state.players[player].state.x;
                    var yPos = state.players[player].state.y;
                    var scale = state.players[player].state.scale;

                    remoteApe.x = xPos;
                    remoteApe.y = yPos;
                    remoteApe.scale = scale;
                    remoteApe.frame = state.players[player].state.frame;
                    remoteApe.name = state.players[player].name;

                    if(apeName){
                        apeName.text = state.players[player].name;
                        var nameXPos = Math.floor(xPos + ape.width / 2) - ((scale.x === 1) ? ape.width : 0);
                        apeName.x = nameXPos;
                        apeName.y = yPos - 65;
                    }

                    //TWEEN DAT
                    if(ape.currentTween){
                        game.tweens.remove(ape.currentTween);
                    }

                    ape.currentTween = game.add.tween(ape).to({
                        x: [xPos],
                        y: [yPos]
                    },30).interpolation(Phaser.Math.bezierInterpolation).start();

                    ape.scale = scale;
                    ape.frame = state.players[player].state.frame;
                    break;
                case ROLE_JAILER:
                    break;
            }
        }
    }
}

// Find out who I am
socket.on("me", handleMe);

// Lobby update
socket.on("lobby_state", handleLobbyUpdate);

// Find out what role I am
socket.on("player_role", handlePlayerRole);

// Find out a new level has started
socket.on("level_start", handleLevelStart);

// Find out the game's state
socket.on("game_state", handleGameState);


text:
title:  Tolesniam tyrinėjimui
date:   03/07/2020
---

E. Vait, Apaštalų darbai, 9–14 p.; Su meile iš Dangaus, 2011, 761–768 p.

Naujojo Testamento Bažnyčiai grėsė pavojus nesuprasti savo buvimo tikslo. E. Vait nusakė šį pavojų:

>

> "Jeruzalės Bažnyčią užgriuvęs persekiojimas labai paskatino Evangelijos darbą. Žodžio tarnystę toje vietovėje lydėjo sėkmė, ir iškilo pavojus, jog mokiniai pernelyg ilgai ten užsibus, nepaisydami Gelbėtojo įpareigojimo eiti į visą pasaulį. Užmiršę, kad jėgų priešintis blogiui lengviausia įgyti uoliai tarnaujant, jie pradėjo manyti, jog pats svarbiausias darbas – saugoti Jeruzalės Bažnyčią nuo priešo išpuolių. Užuot mokę naujai atsivertusiuosius nešti Evangeliją tiems, kurie dar jos negirdėjo, jie pasuko pavojingu keliu – ėmė tenkintis tuo, kas jau pasiekta." (Apaštalų darbai, 79 p.)

**Klausimai aptarimui:**

`1. Atidžiai perskaitykite ištrauką iš E. Vait knygos Apaštalų darbai, ypač paskutinę eilutę. Kodėl net šiandien turime būti atsargūs dėl to paties galimo pavojaus? Kodėl, atsižvelgiant į mums tenkančius misionierių iššūkius, toks nusistatymas gali būti itin, net tragiškai, nederamas?`

`2. Jūsų manymu, kodėl kiekviena evangelija baigiasi panašiu paliepimu? Perskaitykite Mt 28, 18–20; Mk 16, 15–16; Lk 24, 46–49; Jn 20, 21. Ką tai reiškė šiems pirmojo amžiaus tikintiesiems, ir ką tai turėtų reikšti mums šiandien?`

`3. Ar liudijimas ir tarnystė gali apskritai pakeisti tikrą dvasingumą? Jei taip, kaip, ir kaip mes galime apsisaugoti nuo šių spąstų?`

`4. Klasėje aptarkite atsakymą į III dalies pabaigoje pateiktą klausimą, kaip liudijimas ir tarnavimas daro įtaką jūsų dvasiniam augimui. Ko išmokote, kas galėtų padėti kitiems? Kokių klaidų padarėte, kurių galėtumėte padėti išvengti kitiems?`

`5. Apmąstykite tai, kad Dievas myli kiekvieną iš mūsų asmeniškai. Kaip suprasti, ką tai reiškia? Kaip ši galbūt pati svarbiausia tiesa visatoje turėtų paveikti jūsų gyvenimą?`


text:
class Admin::Merchandise::Multi::VariantsController < Admin::BaseController
  def edit
    @product        = Product.includes(:properties,:product_properties, {:prototype => :properties}).find(params[:product_id])
    form_info
    render :layout => 'admin_markup'
  end

  def update
    @product = Product.find(params[:product_id])

    if @product.update_attributes(params[:product])
      flash[:notice] = "Successfully updated variants"
      redirect_to admin_merchandise_product_url(@product)
    else
      form_info
      render :action => :edit, :layout => 'admin_markup'
    end
  end
  private

  def form_info
    @brands = Brand.all.collect{|b| [b.name, b.id] }
  end
end


text:
package com.example.lichaoliang.myapplication.gson;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by lichaoliang on 2017/3/23.
 */

public class Weather {
    public String status;
    public Basic basic;
    public AQI aqi;
    public Now now;
    public Suggestion suggestion;

    @SerializedName("daily_forecast")
    public List<Forecast> forecastList;
}


text:
package com.amazonaws.services.dynamodbv2.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * Represents the input of a ListStreams operation.
 *

 */
public class ListStreamsRequest extends AmazonWebServiceRequest implements
        Serializable, Cloneable {

    /**
     *

     * If this parameter is provided, then only the streams associated with this
     * table name are returned.
     *

     */
    private String tableName;
    /**
     *

     * The maximum number of streams to return. The upper limit is 100.
     *

     */
    private Integer limit;
    /**
     *

     * The ARN (Amazon Resource Name) of the first item that this operation will
     * evaluate. Use the value that was returned for
     * LastEvaluatedStreamArn in the previous operation.
     *

     */
    private String exclusiveStartStreamArn;

    /**
     *

     * If this parameter is provided, then only the streams associated with this
     * table name are returned.
     *

     *
     * @param tableName
     *        If this parameter is provided, then only the streams associated
     *        with this table name are returned.
     */

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    /**
     *

     * If this parameter is provided, then only the streams associated with this
     * table name are returned.
     *

     *
     * @return If this parameter is provided, then only the streams associated
     *         with this table name are returned.
     */

    public String getTableName() {
        return this.tableName;
    }

    /**
     *

     * If this parameter is provided, then only the streams associated with this
     * table name are returned.
     *

     *
     * @param tableName
     *        If this parameter is provided, then only the streams associated
     *        with this table name are returned.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ListStreamsRequest withTableName(String tableName) {
        setTableName(tableName);
        return this;
    }

    /**
     *

     * The maximum number of streams to return. The upper limit is 100.
     *

     *
     * @param limit
     *        The maximum number of streams to return. The upper limit is 100.
     */

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    /**
     *

     * The maximum number of streams to return. The upper limit is 100.
     *

     *
     * @return The maximum number of streams to return. The upper limit is 100.
     */

    public Integer getLimit() {
        return this.limit;
    }

    /**
     *

     * The maximum number of streams to return. The upper limit is 100.
     *

     *
     * @param limit
     *        The maximum number of streams to return. The upper limit is 100.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ListStreamsRequest withLimit(Integer limit) {
        setLimit(limit);
        return this;
    }

    /**
     *

     * The ARN (Amazon Resource Name) of the first item that this operation will
     * evaluate. Use the value that was returned for
     * LastEvaluatedStreamArn in the previous operation.
     *

     *
     * @param exclusiveStartStreamArn
     *        The ARN (Amazon Resource Name) of the first item that this
     *        operation will evaluate. Use the value that was returned for
     *        LastEvaluatedStreamArn in the previous operation.
     */

    public void setExclusiveStartStreamArn(String exclusiveStartStreamArn) {
        this.exclusiveStartStreamArn = exclusiveStartStreamArn;
    }

    /**
     *

     * The ARN (Amazon Resource Name) of the first item that this operation will
     * evaluate. Use the value that was returned for
     * LastEvaluatedStreamArn in the previous operation.
     *

     *
     * @return The ARN (Amazon Resource Name) of the first item that this
     *         operation will evaluate. Use the value that was returned for
     *         LastEvaluatedStreamArn in the previous operation.
     */

    public String getExclusiveStartStreamArn() {
        return this.exclusiveStartStreamArn;
    }

    /**
     *

     * The ARN (Amazon Resource Name) of the first item that this operation will
     * evaluate. Use the value that was returned for
     * LastEvaluatedStreamArn in the previous operation.
     *

     *
     * @param exclusiveStartStreamArn
     *        The ARN (Amazon Resource Name) of the first item that this
     *        operation will evaluate. Use the value that was returned for
     *        LastEvaluatedStreamArn in the previous operation.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ListStreamsRequest withExclusiveStartStreamArn(
            String exclusiveStartStreamArn) {
        setExclusiveStartStreamArn(exclusiveStartStreamArn);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getTableName() != null)
            sb.append("TableName: " + getTableName() + ",");
        if (getLimit() != null)
            sb.append("Limit: " + getLimit() + ",");
        if (getExclusiveStartStreamArn() != null)
            sb.append("ExclusiveStartStreamArn: "
                    + getExclusiveStartStreamArn());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListStreamsRequest == false)
            return false;
        ListStreamsRequest other = (ListStreamsRequest) obj;
        if (other.getTableName() == null ^ this.getTableName() == null)
            return false;
        if (other.getTableName() != null
                && other.getTableName().equals(this.getTableName()) == false)
            return false;
        if (other.getLimit() == null ^ this.getLimit() == null)
            return false;
        if (other.getLimit() != null
                && other.getLimit().equals(this.getLimit()) == false)
            return false;
        if (other.getExclusiveStartStreamArn() == null
                ^ this.getExclusiveStartStreamArn() == null)
            return false;
        if (other.getExclusiveStartStreamArn() != null
                && other.getExclusiveStartStreamArn().equals(
                        this.getExclusiveStartStreamArn()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode
                + ((getTableName() == null) ? 0 : getTableName().hashCode());
        hashCode = prime * hashCode
                + ((getLimit() == null) ? 0 : getLimit().hashCode());
        hashCode = prime
                * hashCode
                + ((getExclusiveStartStreamArn() == null) ? 0
                        : getExclusiveStartStreamArn().hashCode());
        return hashCode;
    }

    @Override
    public ListStreamsRequest clone() {
        return (ListStreamsRequest) super.clone();
    }
}


text:
package cmd

import (
	"fmt"
	"os"

	"github.com/driusan/dgit/git"
)

func Fsck(c *git.Client, args []string) error {
	flags := newFlagSet("fsck")
	opts := git.FsckOptions{}

	flags.BoolVar(&opts.Unreachable, "unreachable", false, "Print unreachable objects")
	nodangling := flags.Bool("no-dangling", false, "Do not print dangling objects")
	dangling := flags.Bool("dangling", false, "Print dangling objects (default)")
	flags.BoolVar(&opts.Root, "root", false, "Report root nodes")
	flags.BoolVar(&opts.Tags, "tags", false, "Report tags")
	flags.BoolVar(&opts.Cache, "cache", false, "Consider objects in the index as a head node for unreachability traces")
	flags.BoolVar(&opts.NoReflogs, "no-reflogs", false, "Do not consider commits only reachable from reflogs reachable")
	full := flags.Bool("full", false, "Do not just check GIT_OBJECT_DIRECTORY, but also alternates")
	nofull := flags.Bool("no-full", false, "Disable --full")
	flags.BoolVar(&opts.ConnectivityOnly, "connectivity-only", false, "Only check the connectivity of commits, not the integrity of blobs")
	flags.BoolVar(&opts.Strict, "strict", false, "Check for files with mode g+w bit set")
	flags.BoolVar(&opts.Verbose, "verbose", false, "Be chatty")
	flags.BoolVar(&opts.LostFound, "lost-found", false, "Write dangling objects into .git/lost-found")
	flags.BoolVar(&opts.NameObjects, "name-objects", false, "When displaing names of reachable objects,  also display a name describing how they are reachable compatible with rev-parse")

	noprogress := flags.Bool("no-proress", false, "Do not print progress information")
	progress := flags.Bool("progress", false, "Print progress information (default)")

	flags.Parse(args)

	if *nodangling && *dangling {
		return fmt.Errorf("Can not specify both --dangling and --no-dangling")
	} else if *nodangling {
		opts.NoDangling = true
	} else if *dangling {
		opts.NoDangling = false
	}

	if *noprogress && *progress {
		return fmt.Errorf("Can not specify both --progress and --no-progress")
	} else if *noprogress {
		opts.NoProgress = true
	} else if *progress {
		opts.NoProgress = false
	}

	if *nofull && *full {
		return fmt.Errorf("Can not specify both --full and --no-full")
	} else if *nofull {
		opts.NoFull = true
	} else if *full {
		opts.NoFull = false
	}

	objects := flags.Args()

	// We disregard errs because they've already been printed,
	// they were just returned in case someone wants to use git.Fsck
	// as an API.
	// However, this (cmd.Fsck) still returns an error in case of
	// bad argument parsing.
	errs := git.Fsck(c, os.Stderr, opts, objects)
	if len(errs) > 0 {
		os.Exit(1)
	}
	return nil
}


text:
@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic);

body, html{
    background-color: black;
    color: white;
    width: 100%;
    height: 100%;
    font-family: 'Lato', sans-serif;
}

#business-profile-overlay-container{
    width: 100%;
    height: 0;
    position: absolute;
    top: 0;
    /*z-index: 999;*/
    color: white;
    background-color: black;
}

#business-profile-header-name, #business-name-label{
    margin: 2% auto;
    font-size: 150%;
    text-transform: uppercase;
  /*  display: none;*/
    text-align: center;
}

#business-profile-header-label{
    margin: 2% auto;
    /*font-size: 150%;*/
    text-transform: uppercase;
    /*display: none;*/
    text-align: center;
}

#statistics-label{
    font-size: 150%;
    margin: 5% auto 0 5%;
    /*display: none;*/
}

#business-profile-pic{
    width: 350px;
    height: 350px;
    margin: 0 auto;
    background-color: gray;
    border-radius: 50%;
    /*display: none;*/
}

#statistics-container{
    /*display: none;*/
    margin-left: 5%;
}

#close-profile-overlay{
    font-size: 150%;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    color: white;
    background-color: red;
    border: 2px solid white;
    font-weight: bold;
    z-index: 999;
    /*display: none;*/
}

#open-floor-plan{
    font-size: 150%;
    position: absolute;
    right: 10px;
    top: 75px;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    color: white;
    background-color: blue;
    border: 2px solid white;
    font-weight: bold;
    z-index: 999;
    /*display: none;*/
}

#floor-plan-container{
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    display: none;
    z-index: 990;
}

#floor-plan{
    height: 100%;
    width: 83%;
    /*min-width: 300px;*/
    display: inline-block;
    vertical-align: top;
    margin: 0;
    background-image: url('../img/icons/floor-plan.png');
    background-size: 100% 100%;
}

#floor-plan-action-panel{
    height: 100%;
    width: 15%;
    /*min-width: 75px;*/
    display: inline-block;
    vertical-align: top;
    margin: 0;
    background-color: gray;
}

.floor-plan-action-button{
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 5% auto 5% auto;
}

.floor-panel-option{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
    margin: 10% auto;
}

#add-item{
    margin-top: 150px;
    background-color: orange;
}

#add-script{
    background-color: aquamarine;
}

#add-voiceover{
    background-color: fuchsia;
}