text:
package edu.wustl.bulkoperator.action;

import java.io.InputStream;
import java.io.StringReader;
import java.util.List;

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

import org.apache.struts.Globals;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.xml.sax.InputSource;

import edu.wustl.bulkoperator.actionForm.BulkOperationForm;
import edu.wustl.bulkoperator.bizlogic.BulkOperationBizLogic;
import edu.wustl.bulkoperator.util.BulkOperationConstants;
import edu.wustl.bulkoperator.util.BulkOperationException;
import edu.wustl.common.action.SecureAction;
import edu.wustl.common.exception.ErrorKey;
import edu.wustl.common.util.global.ApplicationProperties;
import edu.wustl.common.util.logger.Logger;

/**
 * This class uploads the CSV file of bulk operations and returns a new CSV file
 * with the results in it.
 * @author sagar_baldwa
 *
 */
public class FileUploadAction extends SecureAction
{

	/**
	 * logger.
	 */
	private transient final Logger logger = Logger.getCommonLogger(FileUploadAction.class);

	/**
	 * Execute Secure Action.
	 * @return ActionForward ActionForward.
	 * @param mapping ActionMapping.
	 * @param form ActionForm.
	 * @param request HttpServletRequest.
	 * @param response HttpServletResponse.
	 * @throws Exception Exception.
	 */
	protected ActionForward executeSecureAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception
	{
		BulkOperationForm bulkOperationForm = (BulkOperationForm) form;
		String dropDownName = bulkOperationForm.getDropdownName();
		String operationName = bulkOperationForm.getOperationName();
		logger.info("Operation Name: " + operationName);
		logger.info("DropDown Name: " + dropDownName);
		String retrievedOperationName = null;
		String forward = BulkOperationConstants.SUCCESS;
		try
		{
			if(request.getParameter(BulkOperationConstants.PAGE_OF) != null &&
					!"".equals(request.getParameter(BulkOperationConstants.PAGE_OF)))
			{
				forward = request.getParameter(BulkOperationConstants.PAGE_OF);
			}
			BulkOperationBizLogic bulkOperationBizLogic = new BulkOperationBizLogic();
			if(bulkOperationForm.getCsvFile() == null)
			{
				ErrorKey errorKey = ErrorKey.getErrorKey("bulk.operation.request.param.error");
				throw new BulkOperationException(errorKey, null, "Error in loading the CSV file on server");
			}
			InputStream csvFileInputStream = bulkOperationForm.getCsvFile().getInputStream();
			InputStream csvFileInputStreamForValidation = bulkOperationForm.getCsvFile().getInputStream();
			InputSource xmlTemplateInputSource = null;
			logger.info("bulkOperationForm.getXmlTemplateFile() : " + bulkOperationForm.getXmlTemplateFile());
			if(bulkOperationForm.getXmlTemplateFile()==null ||
					bulkOperationForm.getXmlTemplateFile().toString().equalsIgnoreCase("noname"))
			{
				try
				{
					List<String> list = bulkOperationBizLogic.getOperationNameAndXml
								(dropDownName, operationName);
					if (list.isEmpty())
					{
						ErrorKey errorkey = ErrorKey.getErrorKey("bulk.error.incorrect.operation.name");
						throw new BulkOperationException(errorkey, null, "");
					}
					retrievedOperationName = list.get(0);
					xmlTemplateInputSource = new InputSource(new StringReader(list.get(1)));
					logger.info("xmlTemplateInputSource : "+xmlTemplateInputSource);
				}
				catch (BulkOperationException exp)
				{
					logger.error(exp.getMessage(), exp);
					throw new BulkOperationException(exp.getErrorKey(), exp, exp.getMsgValues());
				}
			}
			else
			{
				retrievedOperationName = bulkOperationForm.getOperationName();
				String xmlTemplateString = new String(bulkOperationForm.getXmlTemplateFile().getFileData());
				xmlTemplateInputSource= new InputSource(new StringReader(xmlTemplateString));
			}
			Long jobId = bulkOperationBizLogic.initBulkOperation(csvFileInputStream,
					csvFileInputStreamForValidation, xmlTemplateInputSource,
					retrievedOperationName, this.getSessionData(request));
			final ActionMessages msg = new ActionMessages();
			final ActionMessage msgs = new ActionMessage("job.submitted");
			msg.add(ActionErrors.GLOBAL_MESSAGE, msgs);
			if (!msg.isEmpty())
			{
				saveMessages(request, msg);
			}
			request.setAttribute("jobId", jobId.toString());
		}
		catch (BulkOperationException exp)
		{
			ActionErrors errors = (ActionErrors) request.getAttribute(Globals.ERROR_KEY);
			if (errors == null)
			{
				errors = new ActionErrors();
				if(dropDownName == null || "".equals(dropDownName))
				{
					errors.add(ActionErrors.GLOBAL_ERROR,
					 new ActionError("errors.item",exp.getMessage()));

				}
				else
				{
					if(exp.getErrorKeyName().equals("bulk.operation.issues")
						||exp.getErrorKeyName().equals(
								"bulk.error.csv.column.name.change.validation"))
					{
						errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.item",
								ApplicationProperties.getValue("bulk.error.csv.column.name.change")));
					}
					else
					{
						errors.add(ActionErrors.GLOBAL_ERROR,
								new ActionError("errors.item",exp.getMessage()));
					}
				}
			}
			this.saveErrors(request, errors);
			logger.error(exp.getMessage(), exp);
		}
		return mapping.findForward(forward);
	}
}


text:
zabbix-api
==========

perl zabbix bindings

## Api usage

First create a ZabbixApi Object:

```perl
use ZabbixApi;

my $api = ZabbixApi->new(
    user => 'winston',
    pw   => 'gayhaim69',
    url  => 'http://my.domain.com/api_jsonrpc.php',
);
```

Now you can use the zabbix api described in the documentation like this.
Let us first get the hostgroup id of `Linux servers`.

```perl
# set api method
$zabbix->set_method('hostgroup.get');

# wrapper around output: set to 'extend'
$zabbix->payload->set_output(3);

# perform api call
$zabbix->process;

# find the Object describing Linux servers group
my $o = $zabbix->find_by( 'name', 'Linux servers' );

# we got a hash
my $id = $$o{'groupid'};

# clear the api buffer before the next action

$zabbix->clear;

```

Now we can create a host that is in this hostgroup

```perl
# set api method
$zabbix->set_method('host.create');

# add the new hostgroup
$zabbix->add_params( { groups => [ { 'groupid' => $id } ] } );

# add the interfaces
$zabbix->add_params(
    {
        interfaces =>
        [
            {
                 'useip' => 1,
                 'ip'    => '188.187.123.123',
                 'port'  => '10050',
                 'dns'   => 'test.com',
                 'type'  => 1,
                 'main'  => 1,
            }
        ]
    }
);

# add the new hostname
$zabbix->add_params( { 'host' => 'testhost' } );

# perform the api call which creates the hostgroup
$zabbix->process;
```
Of course you can add all the params in one `add_params` call. It takes every hash ref as an argument.

redpajama_set_name: RedPajamaGithub


text:
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka - October 5, 2016

* [Video Recording](https://www.youtube.com/watch?v=dsuvnoEezxs)
* [Slides](http://www.slideshare.net/AkaraSucharitakul/backpressure-in-action-handling-highburst-workloads-with-akka-streams-kafka)

## Scala Up North

Service Stampede: Surviving a Thousand Services - August 5, 2016

* [Video Recording](https://www.youtube.com/watch?v=8hJMcI8O5J0&list=PL-ziwLLJ3XaLspsk9o7gQJB5oZtqS43Qu&index=5)
* [Slides](http://www.slideshare.net/AnilGursel/service-stampede-surviving-a-thousand-services)

## Scala Bay Meetup

Asynchronous Orchestration DSL on squbs - June 13, 2016

* [Video Recording](https://www.youtube.com/watch?v=qeBlZF-MB78)
* [Slides](https://www.slideshare.net/AnilGursel/asynchronous-orchestration-dsl-on-squbs)


text:
import { Routes } from '@angular/router';

import { ChartListComponent } from './chart-list/chart-list.component';

export const CHART_ROUTES: Routes = [
  { path: '', component: ChartListComponent }
];


text:
MetadataAPIService
============

A  Scala/Spray API application which demonstrates how Spray can be used to create and consume RESTful APIs.
This application exposed two sample API's to start with GetModel, GetMessage

Getting Started
---------------

cd $HOME/ligadata/trunk
sbt
sbt > project MetadataAPIService
sbt > run

Now the webservice is up and running on the localhost:8080

Use the project MetadataAPIServiceClient for the samples of API Client


text:
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding field 'Temperature.created_on'
        db.add_column(u'webapp_temperature', 'created_on',
                      self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2014, 7, 26, 0, 0), blank=True),
                      keep_default=False)

    def backwards(self, orm):
        # Deleting field 'Temperature.created_on'
        db.delete_column(u'webapp_temperature', 'created_on')

    models = {
        u'webapp.temperature': {
            'Meta': {'object_name': 'Temperature'},
            'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'temp': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2'}),
            'thermistor': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['webapp.Thermistor']"})
        },
        u'webapp.thermistor': {
            'Meta': {'object_name': 'Thermistor'},
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'index': ('django.db.models.fields.IntegerField', [], {}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'type': ('django.db.models.fields.CharField', [], {'max_length': '10'})
        }
    }

    complete_apps = ['webapp']


text:
@interface TabBarController ()

@end

@implementation TabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.tabBar.barTintColor = [UIColor whiteColor];
//    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
//    dict[NSForegroundColorAttributeName] = [UIColor redColor];
//
//    [self.tabBarItem setTitleTextAttributes:dict forState:UIControlStateHighlighted];
//    self.tabBar.backgroundColor = [UIColor redColor];
    HomeController *home = [[HomeController alloc]init];

    [self addChildVCWithController:home title:@"首页" image:@"wanghome" imageHigh:@"wanghome_selected"];

    InterestsController *interest = [[InterestsController alloc]init];
    [self addChildVCWithController:interest title:@"兴趣" image:@"wanginterest" imageHigh:@"wangintrerst_selected"];

    ForumController *forum = [[ForumController alloc]init];
    [self addChildVCWithController:forum title:@"社交" image:@"wangluntan" imageHigh:@"wangluntan_selected"];

    ViewController *frofile = [[ViewController alloc]init];
    [self addChildVCWithController:frofile title:@"我" image:@"wangfrofile" imageHigh:@"wangfrofile_selected"];

}
- (void)addChildVCWithController:(UIViewController *)VC title:(NSString *)titile image:(NSString *)image imageHigh:(NSString *)imageHigh
{

    VC.title = titile;
    VC.view.backgroundColor = [UIColor WangColor];
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    dict[NSForegroundColorAttributeName] = [UIColor colorWithRed:145/255.0 green:0 blue:4/255.0 alpha:1.0];
    [VC.tabBarItem setTitleTextAttributes:dict forState:UIControlStateHighlighted];
    [VC.tabBarItem setImage:[UIImage imageNamed:image]];
    [VC.tabBarItem setSelectedImage:[[UIImage imageNamed:imageHigh]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

    NavigationController *naVC = [[NavigationController alloc]initWithRootViewController:VC];

    NSMutableDictionary *titleDict = [NSMutableDictionary dictionary];
    titleDict[NSForegroundColorAttributeName] = [UIColor whiteColor];
    titleDict[NSFontAttributeName] = [UIFont boldSystemFontOfSize:19.0];
    [naVC.navigationBar setTitleTextAttributes:titleDict];
    [self addChildViewController:naVC];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
<!--
  Copyright (c) 2013-2014, ARM Limited

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  THE SOFTWARE.

-->

<project name="antlr" default="dist" basedir=".">
    <property name="src" location="src"/>
    <property name="res" location="res"/>
    <property name="gen"  location="gen"/>
    <property name="bin"  location="bin/${name}"/>
    <property name="lib-name"  location="pencil"/>
    <property name="lib-bin"  location="bin/${lib-name}"/>
    <property name="grammar"  value="${name}"/>
    <property name="antlr-grammar" location="grammar/${grammar}.g"/>

    <property name="parser-loc"  location="${gen}/java/com/arm/carp/${grammar}/parser"/>

    <property name="versioninfo-scala-loc" location="${gen}/scala/com/arm/carp/apps"/>

    <target name="generate-versioninfo">
      <mkdir dir="${versioninfo-scala-loc}"/>
      <exec executable="sh">
        <arg value="${res}/version/genversion.sh"/>
        <arg value="${res}/version/Version.scala"/>
        <arg value="${versioninfo-scala-loc}/Version.scala"/>
      </exec>
    </target>

    <property environment="env"/>
    <property name="scala.home" value="${env.SCALA_HOME}"/>
    <property name="antlr.home" value="${env.ANTLR_HOME}"/>

    <target name="init" depends="generate-versioninfo">
      <taskdef resource="scala/tools/ant/antlib.xml">
        <classpath>
          <pathelement location="${scala.home}/lib/scala-compiler.jar"   />
          <pathelement location="${scala.home}/lib/scala-library.jar"   />
          <pathelement location="${scala.home}/lib/scala-reflect.jar"   />
        </classpath>
      </taskdef>
      <mkdir dir="${parser-loc}"/>
      <mkdir dir="${bin}"/>
      <mkdir dir="${lib-bin}"/>
    </target>

    <target name="clean">
      <delete dir="${bin}"/>
      <delete dir="${gen}"/>
    </target>

    <target name="run-antlr" depends="init">
      <antlr:ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr"
        target="${antlr-grammar}"
        outputdirectory="${parser-loc}"/>
    </target>

    <target name="compile" depends="init,run-antlr,dist-lib">
      <javac debug="true" debuglevel="lines,vars,source"
        destdir="${bin}">
        <compilerarg value="-Xlint:unchecked"/>
        <src path="${parser-loc}"/>
      </javac>

      <scalac
        deprecation="yes"
        addparams="-feature"
        destdir="${bin}">
        <classpath>
          <pathelement location="${bin}"/>
          <pathelement location="${scala.home}/lib/scala-library.jar"   />
          <pathelement location="${antlr.home}/antlr3.jar"   />
          <pathelement location="${lib-name}.jar"   />
        </classpath>
        <src>
          <pathelement path="${src}/scala/com/arm/carp/apps/${name}/"/>
          <pathelement path="${src}/scala/com/arm/carp/frontends/${grammar}/"/>
          <pathelement path="${versioninfo-scala-loc}"/>
        </src>
      </scalac>
    </target>

    <target name="compile-lib" depends="init">
      <scalac
        deprecation="yes"
        addparams="-feature"
        destdir="${lib-bin}">
        <classpath>
          <pathelement location="${scala.home}/lib/scala-library.jar"   />
        </classpath>
        <src>
          <pathelement path="${src}/scala/com/arm/carp/pencil/"/>
        </src>
      </scalac>
    </target>

    <target name="dist-lib" depends="compile-lib">
      <jar
        destfile="${lib-name}.jar"
        basedir="${lib-bin}">
      </jar>
    </target>

    <target name="dist" depends="compile">
      <jar
        destfile="${name}.jar"
        basedir="${bin}">
        <manifest>
          <attribute
            name="Main-Class"
            value="com.arm.carp.apps.${name}.Main"/>
        </manifest>
      </jar>
    </target>
</project>


text:
iAutoNationz
============

iAutoNationz~ Atomated BottSystems. PrePackaged Resources. Venus.Disney. PassionScience . NuSysReaseach and PlayVelopMentz.


text:
/**
 * @file MaterialProvider
 */

export default from './MaterialProvider';


text:
import {Component} from '@angular/core';
import {ITableSectionContent} from './model/section-content';

@Component({
  selector: 'my-table-section-content',
  template: '

{{content.title}}	{{content.content}}

',
  inputs: ['contents']
})
export class TableSectionContentComponent {
  public contents: ITableSectionContent[];
}


text:
namespace gpopt
{
	// fwd declaration
	class CColRefSet;

	//---------------------------------------------------------------------------
	//	@class:
	//		CLogicalGbAgg
	//
	//	@doc:
	//		aggregate operator
	//
	//---------------------------------------------------------------------------
	class CLogicalGbAgg : public CLogicalUnary
	{
		private:

			// private copy ctor
			CLogicalGbAgg(const CLogicalGbAgg &);

			// array of grouping columns
			DrgPcr *m_pdrgpcr;

			// minimal grouping columns based on FD's
			DrgPcr *m_pdrgpcrMinimal;

			// local / intermediate / global aggregate
			COperator::EGbAggType m_egbaggtype;

		protected:

			// does local / intermediate / global aggregate generate duplicate values for the same group
			BOOL m_fGeneratesDuplicates;

			// array of columns used in distinct qualified aggregates (DQA)
			// used only in the case of intermediate aggregates
			DrgPcr *m_pdrgpcrArgDQA;

			// compute required stats columns for a GbAgg
			CColRefSet *PcrsStatGbAgg
				(
				IMemoryPool *pmp,
				CExpressionHandle &exprhdl,
				CColRefSet *pcrsInput,
				ULONG ulChildIndex,
				DrgPcr *pdrgpcrGrp
				)
				const;

		public:

			// ctor
			explicit
			CLogicalGbAgg(IMemoryPool *pmp);

			// ctor
			CLogicalGbAgg
				(
				IMemoryPool *pmp,
				DrgPcr *pdrgpcr,
				COperator::EGbAggType egbaggtype
				);

			// ctor
			CLogicalGbAgg
				(
				IMemoryPool *pmp,
				DrgPcr *pdrgpcr,
				COperator::EGbAggType egbaggtype,
				BOOL fGeneratesDuplicates,
				DrgPcr *pdrgpcrArgDQA
				);

			// ctor
			CLogicalGbAgg
				(
				IMemoryPool *pmp,
				DrgPcr *pdrgpcr,
				DrgPcr *pdrgpcrMinimal,
				COperator::EGbAggType egbaggtype
				);

			// ctor
			CLogicalGbAgg
				(
				IMemoryPool *pmp,
				DrgPcr *pdrgpcr,
				DrgPcr *pdrgpcrMinimal,
				COperator::EGbAggType egbaggtype,
				BOOL fGeneratesDuplicates,
				DrgPcr *pdrgpcrArgDQA
				);

			// dtor
			virtual
			~CLogicalGbAgg();

			// ident accessors
			virtual
			EOperatorId Eopid() const
			{
				return EopLogicalGbAgg;
			}

			// return a string for operator name
			virtual
			const CHAR *SzId() const
			{
				return "CLogicalGbAgg";
			}

			// does this aggregate generate duplicate values for the same group
			virtual
			BOOL FGeneratesDuplicates() const
			{
				return m_fGeneratesDuplicates;
			}

			// match function
			virtual
			BOOL FMatch(COperator *pop) const;

			// hash function
			virtual
			ULONG UlHash() const;

			// grouping columns accessor
			DrgPcr *Pdrgpcr() const
			{
				return m_pdrgpcr;
			}

			// array of columns used in distinct qualified aggregates (DQA)
			DrgPcr *PdrgpcrArgDQA() const
			{
				return m_pdrgpcrArgDQA;
			}

			// aggregate type
			COperator::EGbAggType Egbaggtype() const
			{
				return m_egbaggtype;
			}

			// is a global aggregate?
			BOOL FGlobal() const
			{
				return (COperator::EgbaggtypeGlobal == m_egbaggtype);
			}

			// minimal grouping columns accessor
			DrgPcr *PdrgpcrMinimal() const
			{
				return m_pdrgpcrMinimal;
			}

			// return a copy of the operator with remapped columns
			virtual
			COperator *PopCopyWithRemappedColumns(IMemoryPool *pmp, HMUlCr *phmulcr, BOOL fMustExist);

			//-------------------------------------------------------------------------------------
			// Derived Relational Properties
			//-------------------------------------------------------------------------------------

			// derive output columns
			virtual
			CColRefSet *PcrsDeriveOutput(IMemoryPool *,CExpressionHandle &);

			// derive outer references
			virtual
			CColRefSet *PcrsDeriveOuter(IMemoryPool *pmp, CExpressionHandle &exprhdl);

			// derive not null columns
			virtual
			CColRefSet *PcrsDeriveNotNull(IMemoryPool *pmp, CExpressionHandle &exprhdl) const;

			// derive key collections
			virtual
			CKeyCollection *PkcDeriveKeys(IMemoryPool *pmp, CExpressionHandle &exprhdl) const;

			// derive max card
			virtual
			CMaxCard Maxcard(IMemoryPool *pmp, CExpressionHandle &exprhdl) const;

			// derive constraint property
			virtual
			CPropConstraint *PpcDeriveConstraint(IMemoryPool *pmp, CExpressionHandle &exprhdl) const;

			// compute required stats columns of the n-th child
			//-------------------------------------------------------------------------------------
			// Required Relational Properties
			//-------------------------------------------------------------------------------------

			// compute required stat columns of the n-th child
			virtual
			CColRefSet *PcrsStat
				(
				IMemoryPool *pmp,
				CExpressionHandle &exprhdl,
				CColRefSet *pcrsInput,
				ULONG ulChildIndex
				)
				const;

			//-------------------------------------------------------------------------------------
			// Transformations
			//-------------------------------------------------------------------------------------

			// candidate set of xforms
			CXformSet *PxfsCandidates(IMemoryPool *pmp) const;

			// derive statistics
			virtual
			IStatistics *PstatsDerive
						(
						IMemoryPool *pmp,
						CExpressionHandle &exprhdl,
						DrgPstat *pdrgpstatCtxt
						)
						const;

			// stat promise
			virtual
			EStatPromise Esp(CExpressionHandle &) const
			{
				return CLogical::EspHigh;
			}

			//-------------------------------------------------------------------------------------
			//-------------------------------------------------------------------------------------
			//-------------------------------------------------------------------------------------

			// conversion function
			static
			CLogicalGbAgg *PopConvert
				(
				COperator *pop
				)
			{
				GPOS_ASSERT(NULL != pop);
				GPOS_ASSERT(EopLogicalGbAgg == pop->Eopid() ||
							EopLogicalGbAggDeduplicate == pop->Eopid());

				return dynamic_cast<CLogicalGbAgg*>(pop);
			}

			// debug print
			virtual
			IOstream &OsPrint(IOstream &os) const;

			// derive statistics
			static
			IStatistics *PstatsDerive
				(
				IMemoryPool *pmp,
				IStatistics *pstatsChild,
				DrgPcr *pdrgpcrGroupingCols,
				DrgPul *pdrgpulComputedCols,
				CBitSet *pbsKeys
				);

			// print group by aggregate type
			static
			IOstream &OsPrintGbAggType(IOstream &os, COperator::EGbAggType egbaggtype);

	}; // class CLogicalGbAgg

}

#endif // !GPOS_CLogicalGbAgg_H

// EOF


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('surveys', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='survey',
            name='link',
            field=models.URLField(default=''),
            preserve_default=False,
        ),
    ]


text:
<?php
namespace Phpse\Meetups\Persistence;

use Phpse\Meetups\Domain\Meetup;
use Phpse\Meetups\Domain\Uuid;

class MeetupReader
{
    /**
     * @var \PDO
     */
    private $pdo;

    /**
     * @param \PDO $pdo
     */
    public function __construct(\PDO $pdo)
    {
        $this->pdo = $pdo;
    }

    /**
     * @param Uuid $identifier
     *
     * @return Meetup
     */
    public function getMeetup(Uuid $identifier)
    {
        $statement = $this->pdo->prepare(
            'SELECT m.*, count(r.member_identifier) as taken
             FROM meetups m
             LEFT JOIN rsvps r ON (r.meetup_identifier = m.identifier AND r.rsvp = "yes")
             WHERE m.identifier = :identifier
             GROUP BY m.identifier'
        );
        $statement->bindValue('identifier', $identifier->getValue());
        $statement->execute();
        if ($statement->rowCount() === 0) {
            throw new \PDOException('Meetup not found');
        }
        return $this->rowToMeetup($statement->fetchObject());
    }

    /**
     * @return Meetup[]
     */
    public function getMeetups()
    {
        $statement = $this->pdo->query(
            'SELECT m.*, count(r.member_identifier) as taken
             FROM meetups m
             LEFT JOIN rsvps r ON (r.meetup_identifier = m.identifier AND r.rsvp = "yes")
             GROUP BY m.identifier
             ORDER BY m.date ASC'
        );
        if (false === $statement) {
            throw new \PDOException(join("\n", $this->pdo->errorInfo()), $this->pdo->errorCode());
        }
        $meetups = [];
        while ($row = $statement->fetch(\PDO::FETCH_OBJ)) {
            $meetups[] = $this->rowToMeetup($row);
        }
        return $meetups;
    }

    /**
     * @param \StdClass $row
     *
     * @return Meetup
     */
    private function rowToMeetup(\StdClass $row)
    {
        return new Meetup(
            new Uuid($row->identifier),
            $row->title,
            new \DateTime($row->date),
            (int)$row->capacity,
            (int)$row->capacity - $row->taken
        );
    }

}


text:
@interface VBMathParserTokenFunctionCos : VBMathParserTokenFunction

@end


text:
// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit)
// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus
// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues
// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE
// More projects: http://www.zzzprojects.com/
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved.

using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Z.EntityFramework.Plus;

namespace Z.Test.EntityFramework.Plus
{
    public partial class QueryCache_AutoResetCache
    {
        [TestMethod]
        public void BulkSaveChanges_ParentAndChild_ChildModified()
        {
            TestContext.DeleteAll(x => x.Association_OneToMany_Rights);
            TestContext.DeleteAll(x => x.Association_OneToMany_Lefts);

            using (var ctx = new TestContext())
            {
                var left = ctx.Association_OneToMany_Lefts.Add(new Association_OneToMany_Left() { ColumnInt = 1 });
                var right = ctx.Association_OneToMany_Rights.Add(new Association_OneToMany_Right() { ColumnInt = 1 });

                left.Rights = new List<Association_OneToMany_Right>();
                left.Rights.Add(right);

                ctx.SaveChanges();
            }

            using (var ctx = new TestContext())
            {
                QueryCacheManager.IsAutoExpireCacheEnabled = true;

                // BEFORE
                var before = ctx.Association_OneToMany_Lefts.Include("Rights").FromCache().ToList();

                ctx.Association_OneToMany_Rights.ToList().ForEach(x => x.ColumnInt++);
                ctx.BulkSaveChanges();

                var after = ctx.Association_OneToMany_Lefts.Include("Rights").FromCache().ToList();

                QueryCacheManager.ExpireAll();
                QueryCacheManager.IsAutoExpireCacheEnabled = false;

                // TEST: The item count are equal
                Assert.AreEqual(1, before.First().ColumnInt);
                Assert.AreEqual(1, before.First().Rights.First().ColumnInt);

                // TEST: The cache count are equal
                Assert.AreEqual(1, after.First().ColumnInt);
                Assert.AreEqual(2, after.First().Rights.First().ColumnInt);
            }
        }
    }
}


text:
<?php

namespace Phile\Plugin\Siezi\PhileAdmin\Lib;

use Silex\Application;
use Silex\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\Request;

abstract class AdminController implements ControllerProviderInterface
{

    use ControllerTrait;
    use TranslationTrait;

    protected $app;

    protected $plugin;

    final public function connect(Application $app)
    {
        $this->app = $app;

        $controllers = $this->app['controllers_factory'];
        $controllers->match('/', [$this, 'index']);
        $this->getRoutes($controllers);

        return $controllers;
    }

    /**
     * callback for implementations to add routes
     *
     * @param $controllers
     * @return mixed
     */
    protected function getRoutes($controllers)
    {
        return $controllers;
    }

    /**
     * @param array $params
     */
    final public function initialize(array $params)
    {
        $this->plugin = $params['plugin'];
    }

    /**
     * render a template
     *
     * @param $template
     * @param array $vars
     * @return mixed
     */
    protected function render($template, array $vars = [])
    {
        $pluginTemplateFolder = $this->plugin->getTemplateFolder();
        if (!empty($pluginTemplateFolder)) {
            $loader = new \Twig_Loader_Filesystem($pluginTemplateFolder);
            $this->app['twig']->getLoader()->addLoader($loader);
        }

        $defaults = [
            'layout' => [
                'title' => preg_replace('/\\.[^.\\s]{3,4}$/', '', $template)
            ]
        ];
        $vars = array_replace_recursive($defaults, $vars);

        return $this->app['twig']->render($template, $vars);
    }

}


text:
A simple web application example. This is the minimal option for the developer
that doesn't want to be confused by too much going on.


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

	<bean id="WorkFlowManagerImpl" name="WorkFlowManagerImpl"
		class="org.socraticgrid.hl7.services.uc.functional.WorkflowManager">
	</bean>
</beans>


text:
"""Command line utility for querying the Logitech Harmony."""

import argparse
import logging
import json
import sys

from harmony import auth
from harmony import client as harmony_client

LOGGER = logging.getLogger(__name__)

def login_to_logitech(args):
    """Logs in to the Logitech service.

    Args:
      args: argparse arguments needed to login.

    Returns:
      Session token that can be used to log in to the Harmony device.
    """
    token = auth.login(args.email, args.password)
    if not token:
        sys.exit('Could not get token from Logitech server.')

    session_token = auth.swap_auth_token(
        args.harmony_ip, args.harmony_port, token)
    if not session_token:
        sys.exit('Could not swap login token for session token.')

    return session_token

def login_to_logitech_site(email, password, harmony_ip, harmony_port):
    token = auth.login(email, password)
    if not token:
        sys.exit('Could not get token from  Logitech server.')

    session_token = auth.swap_auth_token(
        harmony_ip, harmony_port, token)
    if not session_token:
        sys.exit('Could not swap login token for session token.')

    return session_token

def pprint(obj):
    """Pretty JSON dump of an object."""
    print(json.dumps(obj, sort_keys=True, indent=4, separators=(',', ': ')))

def get_client(args):
    """Connect to the Harmony and return a Client instance."""
    token = login_to_logitech(args)
    client = harmony_client.create_and_connect_client(
        args.harmony_ip, args.harmony_port, token)
    return client

def get_client_obj(email, password, harmony_ip, harmony_port):
    token = login_to_logitech_site(email, password)
    client = harmony_client.create_and_connect_client(harmony_ip, harmony_port, token)
    return client

def show_config(args):
    """Connects to the Harmony and prints its configuration."""
    client = get_client(args)
    pprint(client.get_config())
    client.disconnect(send_close=True)
    return 0

def show_configuration(email, password, harmony_ip, harmony_port=5222):
    client = get_client_obj(email, password, harmony_ip, harmony_port)
    pprint(client.get_config())
    client.disconnect(send_close=True)
    return False

def show_current_activity(args):
    """Connects to the Harmony and prints the current activity block
    from the config."""
    client = get_client(args)
    config = client.get_config()
    current_activity_id = client.get_current_activity()

    activity = [x for x in config['activity'] if int(x['id']) == current_activity_id][0]

    pprint(activity)

    client.disconnect(send_close=True)
    return 0

def sync(args):
    """Connects to the Harmony and syncs it.
    """
    client = get_client(args)

    client.sync()

    client.disconnect(send_close=True)
    return 0

def turn_off(args):
    """Sends a 'turn off' command to the harmony, which is the activity
    '-1'."""
    args.activity = '-1'
    start_activity(args)

def start_activity(args):
    """Connects to the Harmony and switches to a different activity,
    specified as an id or label."""
    client = get_client(args)

    config = client.get_config()

    activity_off     = False
    activity_numeric = False
    activity_id      = None
    activity_label   = None
    try:
        activity_off     = float(args.activity) == -1
        activity_id      = int(float(args.activity))
        activity_numeric = True
    except ValueError:
        activity_off   = args.activity.lower() == 'turn off'
        activity_label = str(args.activity)

    if activity_off:
        activity = [ {'id': -1, 'label': 'Turn Off'} ]
    else:
        activity = [x for x in config['activity']
            if (activity_numeric and int(x['id']) == activity_id)
                or x['label'].lower() == activity_label.lower()
        ]

    if not activity:
        LOGGER.error('could not find activity: ' + args.activity)
        client.disconnect(send_close=True)
        return 1

    activity = activity[0]

    client.start_activity(int(activity['id']))

    LOGGER.info("started activity: '%s' of id: '%s'" % (activity['label'], activity['id']))

    client.disconnect(send_close=True)
    return 0

def send_command(args):
    """Connects to the Harmony and send a simple command."""
    client = get_client(args)

    config = client.get_config()

    device = args.device if args.device_id is None else args.device_id

    device_numeric = None
    try:
        device_numeric = int(float(device))
    except ValueError:
        pass

    device_config = [x for x in config['device'] if device.lower() == x['label'].lower() or
                  ((device_numeric is not None) and device_numeric == int(x['id']))]

    if not device_config:
        LOGGER.error('could not find device: ' + device)
        client.disconnect(send_close=True)
        return 1

    device_id = int(device_config[0]['id'])

    client.send_command(device_id, args.command)

    client.disconnect(send_close=True)
    return 0

def main():
    """Main method for the script."""
    parser = argparse.ArgumentParser(
        description='pyharmony utility script',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    # Required flags go here.
    required_flags = parser.add_argument_group('required arguments')
    required_flags.add_argument('--email', required=True, help=(
        'Logitech username in the form of an email address.'))
    required_flags.add_argument(
        '--password', required=True, help='Logitech password.')
    required_flags.add_argument(
        '--harmony_ip', required=True, help='IP Address of the Harmony device.')

    # Flags with defaults go here.
    parser.add_argument('--harmony_port', default=5222, type=int, help=(
        'Network port that the Harmony is listening on.'))
    loglevels = dict((logging.getLevelName(level), level)
                     for level in [10, 20, 30, 40, 50])
    parser.add_argument('--loglevel', default='INFO', choices=loglevels.keys(),
        help='Logging level to print to the console.')

    subparsers = parser.add_subparsers()

    show_config_parser = subparsers.add_parser(
        'show_config', help='Print the Harmony device configuration.')

    show_config_parser.set_defaults(func=show_config)

    show_activity_parser = subparsers.add_parser(
        'show_current_activity', help='Print the current activity config.')
    show_activity_parser.set_defaults(func=show_current_activity)

    start_activity_parser = subparsers.add_parser(
        'start_activity', help='Switch to a different activity.')

    start_activity_parser.add_argument(
        'activity', help='Activity to switch to, id or label.')

    start_activity_parser.set_defaults(func=start_activity)

    sync_parser = subparsers.add_parser(
        'sync', help='Sync the harmony.')

    sync_parser.set_defaults(func=sync)

    turn_off_parser = subparsers.add_parser(
        'turn_off', help='Send a turn off command to the harmony.')

    turn_off_parser.set_defaults(func=turn_off)

    command_parser = subparsers.add_parser(
        'send_command', help='Send a simple command.')

    command_parser.add_argument('--command',
        help='IR Command to send to the device.', required=True)

    device_arg_group = command_parser.add_mutually_exclusive_group(required=True)

    device_arg_group.add_argument('--device_id',
        help='Specify the device id to which we will send the command.')

    device_arg_group.add_argument('--device',
        help='Specify the device id or label to which we will send the command.')

    command_parser.set_defaults(func=send_command)

    args = parser.parse_args()

    logging.basicConfig(
        level=loglevels[args.loglevel],
        format='%(levelname)s:\t%(name)s\t%(message)s')

    sys.exit(args.func(args))

if __name__ == '__main__':
    main()


text:
#pragma once

#include "../Graphics/Drawable.h"

namespace Urho3D
{

class Geometry;
class Terrain;
class VertexBuffer;

/// Individually rendered part of a heightmap terrain.
class URHO3D_API TerrainPatch : public Drawable
{
    URHO3D_OBJECT(TerrainPatch, Drawable);

public:
    /// Construct.
    TerrainPatch(Context* context);
    /// Destruct.
    virtual ~TerrainPatch() override;
    /// Register object factory.
    static void RegisterObject(Context* context);

    /// Process octree raycast. May be called from a worker thread.
    virtual void ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results) override;
    /// Calculate distance and prepare batches for rendering. May be called from worker thread(s), possibly re-entrantly.
    virtual void UpdateBatches(const FrameInfo& frame) override;
    /// Prepare geometry for rendering. Called from a worker thread if possible (no GPU update.)
    virtual void UpdateGeometry(const FrameInfo& frame) override;
    /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
    virtual UpdateGeometryType GetUpdateGeometryType() override;
    /// Return the geometry for a specific LOD level.
    virtual Geometry* GetLodGeometry(unsigned batchIndex, unsigned level) override;
    /// Return number of occlusion geometry triangles.
    virtual unsigned GetNumOccluderTriangles() override;
    /// Draw to occlusion buffer. Return true if did not run out of triangles.
    virtual bool DrawOcclusion(OcclusionBuffer* buffer) override;
    /// Visualize the component as debug geometry.
    virtual void DrawDebugGeometry(DebugRenderer* debug, bool depthTest) override;

    /// Set owner terrain.
    void SetOwner(Terrain* terrain);
    /// Set neighbor patches.
    void SetNeighbors(TerrainPatch* north, TerrainPatch* south, TerrainPatch* west, TerrainPatch* east);
    /// Set material.
    void SetMaterial(Material* material);
    /// Set local-space bounding box.
    void SetBoundingBox(const BoundingBox& box);
    /// Set patch coordinates.
    void SetCoordinates(const IntVector2& coordinates);
    /// Reset to LOD level 0.
    void ResetLod();

    /// Return visible geometry.
    Geometry* GetGeometry() const;
    /// Return max LOD geometry. Used for decals.
    Geometry* GetMaxLodGeometry() const;
    /// Return geometry used for occlusion.
    Geometry* GetOcclusionGeometry() const;
    /// Return vertex buffer.
    VertexBuffer* GetVertexBuffer() const;
    /// Return owner terrain.
    Terrain* GetOwner() const;

    /// Return north neighbor patch.
    TerrainPatch* GetNorthPatch() const { return north_; }

    /// Return south neighbor patch.
    TerrainPatch* GetSouthPatch() const { return south_; }

    /// Return west neighbor patch.
    TerrainPatch* GetWestPatch() const { return west_; }

    /// Return east neighbor patch.
    TerrainPatch* GetEastPatch() const { return east_; }

    /// Return geometrical error array.
    PODVector<float>& GetLodErrors() { return lodErrors_; }

    /// Return patch coordinates.
    const IntVector2& GetCoordinates() const { return coordinates_; }

    /// Return current LOD level.
    unsigned GetLodLevel() const { return lodLevel_; }

protected:
    /// Recalculate the world-space bounding box.
    virtual void OnWorldBoundingBoxUpdate() override;

private:
    /// Return a corrected LOD level to ensure stitching can work correctly.
    unsigned GetCorrectedLodLevel(unsigned lodLevel);

    /// Geometry.
    SharedPtr<Geometry> geometry_;
    /// Geometry that is locked to the max LOD level. Used for decals.
    SharedPtr<Geometry> maxLodGeometry_;
    /// Geometry that is used for occlusion.
    SharedPtr<Geometry> occlusionGeometry_;
    /// Vertex buffer.
    SharedPtr<VertexBuffer> vertexBuffer_;
    /// Parent terrain.
    WeakPtr<Terrain> owner_;
    /// North neighbor patch.
    WeakPtr<TerrainPatch> north_;
    /// South neighbor patch.
    WeakPtr<TerrainPatch> south_;
    /// West neighbor patch.
    WeakPtr<TerrainPatch> west_;
    /// East neighbor patch.
    WeakPtr<TerrainPatch> east_;
    /// Geometrical error per LOD level.
    PODVector<float> lodErrors_;
    /// Patch coordinates in the terrain. (0,0) is the northwest corner.
    IntVector2 coordinates_;
    /// Current LOD level.
    unsigned lodLevel_;
};

}


text:
package io.joynr.runtime;

import java.util.Properties;

import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.util.Modules;

import io.joynr.common.JoynrPropertiesModule;

public class JoynrBaseModule implements Module {
    private Module module = null;

    @Override
    public void configure(Binder binder) {
        assert module != null;
        module.configure(binder);
    }

    public JoynrBaseModule(Properties customJoynProperties, Module... modules) {
        module = Modules.override(new JoynrPropertiesModule(customJoynProperties)).with(modules);
    }
}


text:
namespace Gridsum.NHBaseThrift.Exceptions
{
    /// <summary>
    ///     已经存在指定资源异常
    /// </summary>
    public class AlreadyExistsException : System.Exception
    {
        #region Constructor

        /// <summary>
        ///     已经存在指定资源异常
        /// </summary>
        /// <param name="message">错误消息</param>
        public AlreadyExistsException(string message)
            : base(message)
        {

        }

        #endregion
    }
}


text:
package com.bearsoft.org.netbeans.modules.form.layoutsupport.delegates;

import com.bearsoft.org.netbeans.modules.form.FormProperty;
import com.bearsoft.org.netbeans.modules.form.layoutsupport.*;
import java.awt.*;
import java.beans.*;
import javax.swing.JSplitPane;

/**
 * Dedicated layout support class for JSplitPane.
 *
 * @author Tomas Pavek
 */
public class SplitPaneSupport extends AbstractLayoutSupport {

    /**
     * Gets the supported layout manager class - JSplitPane.
     *
     * @return the class supported by this delegate
     */
    @Override
    public Class<?> getSupportedClass() {
        return JSplitPane.class;
    }

    /**
     * This method calculates layout constraints for a component dragged over a
     * container (or just for mouse cursor being moved over container, without
     * any component).
     *
     * @param container instance of a real container over/in which the component
     * is dragged
     * @param containerDelegate effective container delegate of the container
     * @param component the real component being dragged, not needed here
     * @param index position (index) of the component in its container; not
     * needed here
     * @param posInCont position of mouse in the container
     * @param posInComp position of mouse in the dragged component; not needed
     * @return new LayoutConstraints object corresponding to the position of the
     * component in the container
     */
    @Override
    public LayoutConstraints<?> getNewConstraints(Container container,
            Container containerDelegate,
            Component component,
            int index,
            Point posInCont,
            Point posInComp) {
        if (!(container instanceof JSplitPane)) {
            return null;
        }

        assistantParams = findFreePosition();
        return new SplitLayoutConstraints(assistantParams);
    }
    private String assistantParams;

    @Override
    public String getAssistantContext() {
        return "splitPaneLayout"; // NOI18N
    }

    @Override
    public Object[] getAssistantParams() {
        return new Object[]{assistantParams};
    }

    /**
     * This method paints a dragging feedback for a component dragged over a
     * container (or just for mouse cursor being moved over container, without
     * any component).
     *
     * @param container instance of a real container over/in which the component
     * is dragged
     * @param containerDelegate effective container delegate of the container
     * @param component the real component being dragged; not needed here
     * @param newConstraints component layout constraints to be presented
     * @param newIndex component's index position to be presented; not needed
     * @param g Graphics object for painting (with color and line style set)
     * @return whether any feedback was painted (true in this case)
     */
    @Override
    public boolean paintDragFeedback(Container container,
            Container containerDelegate,
            Component component,
            LayoutConstraints<?> newConstraints,
            int newIndex,
            Graphics g) {
        if (!(container instanceof JSplitPane)) {
            return false;
        }

        String position = (String) newConstraints.getConstraintsObject();
        if (position == null) {
            return false;
        }

        JSplitPane splitPane = (JSplitPane) container;
        int orientation = splitPane.getOrientation();

        Dimension sz = splitPane.getSize();
        Insets insets = container.getInsets();
        sz.width -= insets.left + insets.right;
        sz.height -= insets.top + insets.bottom;

        Rectangle rect = new Rectangle(insets.left, insets.top, sz.width, sz.height);

        if (orientation == JSplitPane.HORIZONTAL_SPLIT) {
            Component left = splitPane.getLeftComponent();
            Component right = splitPane.getRightComponent();

            if (JSplitPane.LEFT.equals(position)) {
                if ((right == null) || (right == component)) {
                    rect.width = sz.width / 2;
                } else {
                    rect.width = right.getBounds().x - rect.x;
                }
            } else {
                if ((left == null) || (left == component)) {
                    rect.x = insets.left + sz.width / 2;
                    rect.width = sz.width - rect.x;
                } else {
                    rect.x = left.getBounds().x + left.getBounds().width;
                    rect.width = sz.width - rect.x;
                }
            }
        } else {
            Component top = splitPane.getTopComponent();
            Component bottom = splitPane.getBottomComponent();

            if (JSplitPane.TOP.equals(position)) {
                if ((bottom == null) || (bottom == component)) {
                    rect.height /= 2;
                } else {
                    rect.height = bottom.getBounds().y - rect.y;
                }
            } else {
                if ((top == null) || (top == component)) {
                    rect.y = insets.top + sz.height / 2;
                    rect.height = sz.height - rect.y;
                } else {
                    rect.y = top.getBounds().y + top.getBounds().height;
                    rect.height = sz.height - rect.y;
                }
            }
        }
        g.drawRect(rect.x, rect.y, rect.width, rect.height);
        return true;
    }

    /**
     * Adds real components to given container (according to layout constraints
     * stored for the components).
     *
     * @param container instance of a real container to be added to
     * @param containerDelegate effective container delegate of the container
     * @param components components to be added
     * @param index position at which to add the components to container
     */
    @Override
    public void addComponentsToContainer(Container container,
            Container containerDelegate,
            Component[] components,
            int index) {
        if (container instanceof JSplitPane) {
            for (int i = 0; i < components.length; i++) {
                JSplitPane splitPane = (JSplitPane) container;

                int descPos = convertPosition(getConstraints(i + index));
                if (descPos == 0) {
                    splitPane.setLeftComponent(components[i]);
                } else if (descPos == 1) {
                    splitPane.setRightComponent(components[i]);
                }
            }
        }
    }

    /**
     * Removes a real component from a real container.
     *
     * @param container instance of a real container
     * @param containerDelegate effective container delegate of the container
     * @param component component to be removed
     * @return whether it was possible to remove the component (some containers
     * may not support removing individual components reasonably)
     */
    @Override
    public boolean removeComponentFromContainer(Container container,
            Container containerDelegate,
            Component component) {
        if (!(containerDelegate instanceof JSplitPane)) {
            return false; // should not happen
        }
        return super.removeComponentFromContainer(container, containerDelegate, component);
    }

    @Override
    protected LayoutConstraints<?> createDefaultConstraints() {
        return new SplitLayoutConstraints(findFreePosition());
    }

    // ------------
    private int convertPosition(LayoutConstraints<?> desc) {
        if (desc != null) {
            Object position = desc.getConstraintsObject();
            if (JSplitPane.LEFT.equals(position) || JSplitPane.TOP.equals(position)) {
                return 0;
            }
            if (JSplitPane.RIGHT.equals(position) || JSplitPane.BOTTOM.equals(position)) {
                return 1;
            }
        }
        return -1;
    }

    private String findFreePosition() {
        int leftTop = 0, rightBottom = 0;
        int orientation = JSplitPane.HORIZONTAL_SPLIT;

        for (int i = 0, n = getComponentCount(); i < n; i++) {
            LayoutConstraints<?> constraints = getConstraints(i);
            if (!(constraints instanceof SplitLayoutConstraints)) {
                continue;
            }

            int constrPos = convertPosition(constraints);
            if (constrPos == 0) {
                leftTop++;
            } else if (constrPos == 1) {
                rightBottom++;
            }
        }

        if (leftTop == 0 || leftTop < rightBottom) {
            return orientation == JSplitPane.HORIZONTAL_SPLIT
                    ? JSplitPane.LEFT : JSplitPane.TOP;
        } else {
            return orientation == JSplitPane.HORIZONTAL_SPLIT
                    ? JSplitPane.RIGHT : JSplitPane.BOTTOM;
        }
    }

    // -----------
    /**
     * LayoutConstraints implementation holding component position in
     * JSplitPane.
     */
    public static class SplitLayoutConstraints implements LayoutConstraints<String> {

        private String position;
        private FormProperty<?>[] properties;

        public SplitLayoutConstraints(String aPosition) {
            position = aPosition;
        }

        @Override
        public FormProperty<?>[] getProperties() {
            if (properties == null) {
                properties = new FormProperty<?>[]{
                    new FormProperty<String>(
                    "splitPosition", // NOI18N
                    String.class,
                    getBundle().getString("PROP_splitPos"), // NOI18N
                    getBundle().getString("HINT_splitPos")) // NOI18N
                    {
                        protected SplitPositionEditor editor;

                        @Override
                        public PropertyEditor getPropertyEditor() {
                            if (editor == null) {
                                editor = new SplitPositionEditor();
                            }
                            return editor;
                        }

                        @Override
                        public String getValue() {
                            return position;
                        }

                        @Override
                        public void setValue(String value) {
                            String oldValue = getValue();
                            position = value;
                            propertyValueChanged(oldValue, value);
                        }
                    }
                };
                properties[0].setValue("NOI18N", Boolean.TRUE); // NOI18N
            }

            return properties;
        }

        @Override
        public String getConstraintsObject() {
            return position;
        }

        @Override
        public SplitLayoutConstraints cloneConstraints() {
            return new SplitLayoutConstraints(position);
        }
    }

    static class SplitPositionEditor extends PropertyEditorSupport {

        private final String[] values = {
            JSplitPane.LEFT,
            JSplitPane.RIGHT,
            JSplitPane.TOP,
            JSplitPane.BOTTOM
        };

        @Override
        public String[] getTags() {
            return values;
        }

        @Override
        public String getAsText() {
            return (String) getValue();
        }

        @Override
        public void setAsText(String str) {
            for (int i = 0; i < values.length; i++) {
                if (str.equals(values[i])) {
                    setValue(str);
                    break;
                }
            }
        }
    }
}


text:
* Cleaned a bit of CommandList, thanks to @AlexHGaming;
* Added botnames and removed unrealistic ones, thanks to @AlexHGaming;
* Fixed reload command;
* Added an issue template with rules, thanks to @proxiemind;
* Beautify leaderboard code and fixed board command, thanks to @Agarian;
* Added support for protocol 13, thanks to @Tyler3D;
* Added ability to separate chat for teams, thanks to @F0RIS;
* Fix minions not always collecting pellets in pellet mode;
* Added average score section to status command;
* Fixed some bugs regarding physics and collision;
* Fixed cells switching order on doublesplit, thanks to @Luka967;
* Added reading arguments on startup, thanks to @F0RIS
* Fixed skins on Cigar client, thanks to @Tyler3D;
* Improved console UI, thanks to @FantasyIsBae and @Tyler3D;
* Tweaked the readme, thanks to @FantasyIsBae and @MastaCoder;
* Fixed mothercell spawning issue;
* Edited the Wiki, thanks to @AlexHGaming, @Steve7914, @Tyler3D, @ItzLevvie, and @MastaCoder;
* Created the MultiOgar-Edited Wiki, thanks to @AlexHGaming;
* Match randomskins.txt to Agar.io's skins, thanks to @ItzLevvie;

-------------
#### 1.6.0:
* Refactored collision and move engine;
* Formatted & simplified some code;
* Refactored splitting cells;
* Tweaked splitting again;
* Fixed bug with mothercells eating viruses;
* Fixed "kickbot" command kicking minions too;
* Fixed playerbots not being able to have minions;
* Reduced rate of cells switching order when doublesplitting;
* ^^ This also fixed pushback with mobile splitting;
* Completely fixed ejected mass dissapearing;
* Fixed connection issues;
* Fixed long distance popsplits;
* Got rid of vegetable bot names;
* Refactored BinaryWriter;
* Refactored BinaryReader;
* Made changes to things regarding packets, thanks to @ItzLevvie;
* Fixed food registering as playercell, thanks to @NuclearC and @ItzLevvie;
* Refactored QuadNode;
* Refactored safe spawning;
* Fixed bug with linux script;
* Fixed error with ws module;
* Made some edits to commands, thanks to @Agarian;
* Implemented vector;
* Added popsplit macro, thanks to @Tyler3D;
* Refactored some of the scripts;
* Fixed leaderboard positioning in FFA;
* Added "calc" command;
* Tweaked eject size and virus explosion multipliers;
* Fixed server not working with uws module, thanks to @Luka967

-------------
#### 1.4.8:
* Added multiple client bindings, thanks to @MastaCoder;
* Cleaned up setNickname function in PacketHandler, thanks to @MastaCoder;
* Improved popsplit/virus explosion physics yet again;
* Disabled html tags in names for console-plus, thanks to @Gimmo;
* Added mobile agar.io physics with config;
* Re-factored autosplits;
* Fixed some bugs with gamemodes;
* Simplified boosted mode calculations for cells;
* Fixed ejected mass bugs;
* Added newest agario skins to randomskins.txt;
* Created new botnames based off of names in spectate on Agar.io party;
* Added movement during linesplits, thanks to @Tyler3D;
* Fixed small bug with botplayers

-------------
#### 1.4.7:
* Added web console! All thanks to @Gimmo :)
* Cleaned more of CommandList, also thanks to @Gimmo;
* Fixed teleport command, thanks to @Agarian;
* Improved splitting physics;
* Moved changelog and license back to their original places;
* Added guide for web terminal;
* Added explode command;
* Added two new configs: clientBind and ejectVirus

-------------
#### 1.4.5:
* Added playerDecayCap config;
* Fixed some bugs;
* Refactored collision + move engine;
* Fixed cell jittering;
* Cleaned CommandList, thanks to @Gimmo;
* Improved splitting and virus explosion physics;
* Improved performance

--------------
#### 1.4.4:
* Removed verification for most player commands;
* Created the file that you are reading right now;
* Improved installation guide, cleaned up and renamed some files. Thanks to @MastaCoder;
* Greatly improved performance;
* Improved splitting and virus-explosion physics;
* Added two new commands: pop and play;
* Smartened bots, cleaned code;
* Reduced Mothercell spawn amount by 10, thanks to @Fantasy-Agario;
* Fixed some bugs

--------------
#### 1.4.2:
* Added "replace" command;
* Add srcFiles variable, thanks to @MastaCoder;
* Added ejectSpawnPercent config;
* Refactored some of the collision engine;
* Fixed annoying ejected mass bug;
* Greatly improved performance, now 2x better than original MultiOgar

--------------
#### 1.4.1:
* Fixed a few bugs;
* Added back old commands;
* Added two new commands, cleaned up "help" command;
* Slightly improved performance;
* Improved splitting and collision

--------------
#### 1.4.0:
* Added pellet mode for minions! thanks to @ZfsrGhS953;
* Cleaned/refactored the rest of GameServer;
* Improved performance;
* Added controls for pellet mode;
* Refactored minion controls;
* Created "run" folder to hold the server run files/logs;
* Added two new commands: reset and split;
* Made help command look alot better, thanks to @Agarian ;
* Skipped version 1.3.8-1.3.9 for some reason

--------------
#### 1.3.7:
* Fixed some bugs;
* Cleaned/refactored most of GameServer;
* Greatly improved performance;
* Removed/moved some files to different locations;
* Created scripts folder;
* Removed unnecessary commands aswell as functions for said commands

--------------
#### 1.3.5:
* Added new gamemode: Last Man Standing! Thanks to @Tyler3D;
* Added new minion features;
* Got rid of some more unnecessary gamemodes/commands;
* Improved performance

--------------
#### 1.3.4:
* Fixed minion bugs;
* Improved performance;
* Added random skins feature, and more

--------------
#### 1.3.3:
* Moved files;
* Fixed some bugs;
* Improved popsplits;
* Added some new features for minions

--------------
#### 1.3.0:
* Added minions! With a few new features too :)

--------------
#### 1.2.9:
* Matched virus explosions to vanilla;
* Added anti-bot grow measure from vanilla

--------------
#### 1.2.8:
* Removed unnecessary/broken commands & gamemodes;
* Added some custom commands: rec, speed, freeze

--------------
#### 1.2.7:
* Fixed many bugs that the original MultiOgar had

--------------
#### 1.2.47:
* Improved stability and performance;
* Added mute/unmute command

--------------
#### What's new from Ogar:
* Added support for secure websocket connections (TLS);
* Fixed mass decay;
* Added ejectSizeLoss;
* Added sub-net ban feature (use `ban xx.xx.xx.*` or `ban xx.xx.*.*` to ban entire sub-network);
* Added performance optimizations, now up to 700 bots with no lags at all;
* Fixed bug when some cell split/eject were shown with delay for some clients;
* Added a lot of protocol optimizations, now server works with no lags at all even with 64 connected players;
* Added server version, now you can check if your MultiOgar code is fresh;
* Significant performance improvement and more smooth physics;
* Added protocol optimizations to reduce lags on cell multi split;
* Fixed pop-split behavior;
* Fixed cell-split order, now split-run works ok;
* A little performance improvement for split/eject;
* Fixed min mass to split/eject;
* Fixed mass-limit behavior;
* Added chat player commands /skin and /kill (to change skin, just type /skin %shark in the chat);
* Added scramble level 3 (anti-bot/anti-minimap protection), unsupported on some clients (unfortunately include vanilla, ogar.mivabe.nl works ok);
* Massive perfromance improvement & reduce network traffic;
* Split behavior - fixed;
* Protocol code - optimized;
* Massive performance improvement with quad-tree lookup;
* Split/Eject - physics code rewritten;
* Player speed - physics code rewritten;
* Cell remerge - physics code rewritten;
* Cell collision - physics code rewritten;
* View area - code rewritten;
* Spectate - code rewritten;
* Mouse control and cell movements - physics code rewritten;
* Border calculations - rewritten;
* Border bouncy physics - fixed and improved;
* mainLoop - cleaned;
* Added support for different protocols (4, early 5, late 5, 6, 7, 8);
* Added automatic mouse message type recognition;
* Added chat support;
* Added anti-spam protection;
* Added skin support (use name "< shark > Fish", remove space);
* Color generator replaced with hsv model;
* Memory leaks - fixed;
* Performance improved and optimized;
* Added support for server tracker ogar.mivabe.nl/master


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/protobuf/worker.proto

package org.tensorflow.distruntime;

/**
 * Protobuf type {@code tensorflow.RegisterGraphRequest}
 */
public  final class RegisterGraphRequest extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.RegisterGraphRequest)
    RegisterGraphRequestOrBuilder {
  // Use RegisterGraphRequest.newBuilder() to construct.
  private RegisterGraphRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private RegisterGraphRequest() {
    sessionHandle_ = "";
    hasControlFlow_ = false;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
  }
  private RegisterGraphRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    int mutable_bitField0_ = 0;
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!input.skipField(tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            sessionHandle_ = s;
            break;
          }
          case 18: {
            org.tensorflow.framework.GraphDef.Builder subBuilder = null;
            if (graphDef_ != null) {
              subBuilder = graphDef_.toBuilder();
            }
            graphDef_ = input.readMessage(org.tensorflow.framework.GraphDef.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(graphDef_);
              graphDef_ = subBuilder.buildPartial();
            }

            break;
          }
          case 24: {

            hasControlFlow_ = input.readBool();
            break;
          }
          case 34: {
            org.tensorflow.framework.GraphOptions.Builder subBuilder = null;
            if (graphOptions_ != null) {
              subBuilder = graphOptions_.toBuilder();
            }
            graphOptions_ = input.readMessage(org.tensorflow.framework.GraphOptions.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(graphOptions_);
              graphOptions_ = subBuilder.buildPartial();
            }

            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.distruntime.WorkerProtos.internal_static_tensorflow_RegisterGraphRequest_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.distruntime.WorkerProtos.internal_static_tensorflow_RegisterGraphRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.distruntime.RegisterGraphRequest.class, org.tensorflow.distruntime.RegisterGraphRequest.Builder.class);
  }

  public static final int SESSION_HANDLE_FIELD_NUMBER = 1;
  private volatile java.lang.Object sessionHandle_;
  /**
   *

   * Subgraphs are scoped within one session.
   *

   *
   * string session_handle = 1;
   */
  public java.lang.String getSessionHandle() {
    java.lang.Object ref = sessionHandle_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      sessionHandle_ = s;
      return s;
    }
  }
  /**
   *

   * Subgraphs are scoped within one session.
   *

   *
   * string session_handle = 1;
   */
  public com.google.protobuf.ByteString
      getSessionHandleBytes() {
    java.lang.Object ref = sessionHandle_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      sessionHandle_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int GRAPH_DEF_FIELD_NUMBER = 2;
  private org.tensorflow.framework.GraphDef graphDef_;
  /**
   *

   * "graph_def" has the subgraph of nodes for this worker, with each node
   * having its device_name filled in.
   *

   *
   * .tensorflow.GraphDef graph_def = 2;
   */
  public boolean hasGraphDef() {
    return graphDef_ != null;
  }
  /**
   *

   * "graph_def" has the subgraph of nodes for this worker, with each node
   * having its device_name filled in.
   *

   *
   * .tensorflow.GraphDef graph_def = 2;
   */
  public org.tensorflow.framework.GraphDef getGraphDef() {
    return graphDef_ == null ? org.tensorflow.framework.GraphDef.getDefaultInstance() : graphDef_;
  }
  /**
   *

   * "graph_def" has the subgraph of nodes for this worker, with each node
   * having its device_name filled in.
   *

   *
   * .tensorflow.GraphDef graph_def = 2;
   */
  public org.tensorflow.framework.GraphDefOrBuilder getGraphDefOrBuilder() {
    return getGraphDef();
  }

  public static final int HAS_CONTROL_FLOW_FIELD_NUMBER = 3;
  private boolean hasControlFlow_;
  /**
   *

   * True iff the graph (before partitioning) contains control flow nodes.
   * As of 01/11/2015, this is no longer set by clients.
   *

   *
   * bool has_control_flow = 3 [deprecated = true];
   */
  @java.lang.Deprecated public boolean getHasControlFlow() {
    return hasControlFlow_;
  }

  public static final int GRAPH_OPTIONS_FIELD_NUMBER = 4;
  private org.tensorflow.framework.GraphOptions graphOptions_;
  /**
   *

   * Configuration options for the session in which this graph was created.
   *

   *
   * .tensorflow.GraphOptions graph_options = 4;
   */
  public boolean hasGraphOptions() {
    return graphOptions_ != null;
  }
  /**
   *

   * Configuration options for the session in which this graph was created.
   *

   *
   * .tensorflow.GraphOptions graph_options = 4;
   */
  public org.tensorflow.framework.GraphOptions getGraphOptions() {
    return graphOptions_ == null ? org.tensorflow.framework.GraphOptions.getDefaultInstance() : graphOptions_;
  }
  /**
   *

   * Configuration options for the session in which this graph was created.
   *

   *
   * .tensorflow.GraphOptions graph_options = 4;
   */
  public org.tensorflow.framework.GraphOptionsOrBuilder getGraphOptionsOrBuilder() {
    return getGraphOptions();
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getSessionHandleBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sessionHandle_);
    }
    if (graphDef_ != null) {
      output.writeMessage(2, getGraphDef());
    }
    if (hasControlFlow_ != false) {
      output.writeBool(3, hasControlFlow_);
    }
    if (graphOptions_ != null) {
      output.writeMessage(4, getGraphOptions());
    }
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getSessionHandleBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sessionHandle_);
    }
    if (graphDef_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, getGraphDef());
    }
    if (hasControlFlow_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(3, hasControlFlow_);
    }
    if (graphOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getGraphOptions());
    }
    memoizedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.tensorflow.distruntime.RegisterGraphRequest)) {
      return super.equals(obj);
    }
    org.tensorflow.distruntime.RegisterGraphRequest other = (org.tensorflow.distruntime.RegisterGraphRequest) obj;

    boolean result = true;
    result = result && getSessionHandle()
        .equals(other.getSessionHandle());
    result = result && (hasGraphDef() == other.hasGraphDef());
    if (hasGraphDef()) {
      result = result && getGraphDef()
          .equals(other.getGraphDef());
    }
    result = result && (getHasControlFlow()
        == other.getHasControlFlow());
    result = result && (hasGraphOptions() == other.hasGraphOptions());
    if (hasGraphOptions()) {
      result = result && getGraphOptions()
          .equals(other.getGraphOptions());
    }
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + SESSION_HANDLE_FIELD_NUMBER;
    hash = (53 * hash) + getSessionHandle().hashCode();
    if (hasGraphDef()) {
      hash = (37 * hash) + GRAPH_DEF_FIELD_NUMBER;
      hash = (53 * hash) + getGraphDef().hashCode();
    }
    hash = (37 * hash) + HAS_CONTROL_FLOW_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getHasControlFlow());
    if (hasGraphOptions()) {
      hash = (37 * hash) + GRAPH_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getGraphOptions().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.distruntime.RegisterGraphRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.distruntime.RegisterGraphRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tensorflow.distruntime.RegisterGraphRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code tensorflow.RegisterGraphRequest}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.RegisterGraphRequest)
      org.tensorflow.distruntime.RegisterGraphRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.distruntime.WorkerProtos.internal_static_tensorflow_RegisterGraphRequest_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.distruntime.WorkerProtos.internal_static_tensorflow_RegisterGraphRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.distruntime.RegisterGraphRequest.class, org.tensorflow.distruntime.RegisterGraphRequest.Builder.class);
    }

    // Construct using org.tensorflow.distruntime.RegisterGraphRequest.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      sessionHandle_ = "";

      if (graphDefBuilder_ == null) {
        graphDef_ = null;
      } else {
        graphDef_ = null;
        graphDefBuilder_ = null;
      }
      hasControlFlow_ = false;

      if (graphOptionsBuilder_ == null) {
        graphOptions_ = null;
      } else {
        graphOptions_ = null;
        graphOptionsBuilder_ = null;
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.distruntime.WorkerProtos.internal_static_tensorflow_RegisterGraphRequest_descriptor;
    }

    public org.tensorflow.distruntime.RegisterGraphRequest getDefaultInstanceForType() {
      return org.tensorflow.distruntime.RegisterGraphRequest.getDefaultInstance();
    }

    public org.tensorflow.distruntime.RegisterGraphRequest build() {
      org.tensorflow.distruntime.RegisterGraphRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public org.tensorflow.distruntime.RegisterGraphRequest buildPartial() {
      org.tensorflow.distruntime.RegisterGraphRequest result = new org.tensorflow.distruntime.RegisterGraphRequest(this);
      result.sessionHandle_ = sessionHandle_;
      if (graphDefBuilder_ == null) {
        result.graphDef_ = graphDef_;
      } else {
        result.graphDef_ = graphDefBuilder_.build();
      }
      result.hasControlFlow_ = hasControlFlow_;
      if (graphOptionsBuilder_ == null) {
        result.graphOptions_ = graphOptions_;
      } else {
        result.graphOptions_ = graphOptionsBuilder_.build();
      }
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tensorflow.distruntime.RegisterGraphRequest) {
        return mergeFrom((org.tensorflow.distruntime.RegisterGraphRequest)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.distruntime.RegisterGraphRequest other) {
      if (other == org.tensorflow.distruntime.RegisterGraphRequest.getDefaultInstance()) return this;
      if (!other.getSessionHandle().isEmpty()) {
        sessionHandle_ = other.sessionHandle_;
        onChanged();
      }
      if (other.hasGraphDef()) {
        mergeGraphDef(other.getGraphDef());
      }
      if (other.getHasControlFlow() != false) {
        setHasControlFlow(other.getHasControlFlow());
      }
      if (other.hasGraphOptions()) {
        mergeGraphOptions(other.getGraphOptions());
      }
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.tensorflow.distruntime.RegisterGraphRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.distruntime.RegisterGraphRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object sessionHandle_ = "";
    /**
     *

     * Subgraphs are scoped within one session.
     *

     *
     * string session_handle = 1;
     */
    public java.lang.String getSessionHandle() {
      java.lang.Object ref = sessionHandle_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        sessionHandle_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * Subgraphs are scoped within one session.
     *

     *
     * string session_handle = 1;
     */
    public com.google.protobuf.ByteString
        getSessionHandleBytes() {
      java.lang.Object ref = sessionHandle_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        sessionHandle_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * Subgraphs are scoped within one session.
     *

     *
     * string session_handle = 1;
     */
    public Builder setSessionHandle(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      sessionHandle_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Subgraphs are scoped within one session.
     *

     *
     * string session_handle = 1;
     */
    public Builder clearSessionHandle() {

      sessionHandle_ = getDefaultInstance().getSessionHandle();
      onChanged();
      return this;
    }
    /**
     *

     * Subgraphs are scoped within one session.
     *

     *
     * string session_handle = 1;
     */
    public Builder setSessionHandleBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      sessionHandle_ = value;
      onChanged();
      return this;
    }

    private org.tensorflow.framework.GraphDef graphDef_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder> graphDefBuilder_;
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    public boolean hasGraphDef() {
      return graphDefBuilder_ != null || graphDef_ != null;
    }
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    public org.tensorflow.framework.GraphDef getGraphDef() {
      if (graphDefBuilder_ == null) {
        return graphDef_ == null ? org.tensorflow.framework.GraphDef.getDefaultInstance() : graphDef_;
      } else {
        return graphDefBuilder_.getMessage();
      }
    }
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    public Builder setGraphDef(org.tensorflow.framework.GraphDef value) {
      if (graphDefBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        graphDef_ = value;
        onChanged();
      } else {
        graphDefBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    public Builder setGraphDef(
        org.tensorflow.framework.GraphDef.Builder builderForValue) {
      if (graphDefBuilder_ == null) {
        graphDef_ = builderForValue.build();
        onChanged();
      } else {
        graphDefBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    public Builder mergeGraphDef(org.tensorflow.framework.GraphDef value) {
      if (graphDefBuilder_ == null) {
        if (graphDef_ != null) {
          graphDef_ =
            org.tensorflow.framework.GraphDef.newBuilder(graphDef_).mergeFrom(value).buildPartial();
        } else {
          graphDef_ = value;
        }
        onChanged();
      } else {
        graphDefBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    public Builder clearGraphDef() {
      if (graphDefBuilder_ == null) {
        graphDef_ = null;
        onChanged();
      } else {
        graphDef_ = null;
        graphDefBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    public org.tensorflow.framework.GraphDef.Builder getGraphDefBuilder() {

      onChanged();
      return getGraphDefFieldBuilder().getBuilder();
    }
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    public org.tensorflow.framework.GraphDefOrBuilder getGraphDefOrBuilder() {
      if (graphDefBuilder_ != null) {
        return graphDefBuilder_.getMessageOrBuilder();
      } else {
        return graphDef_ == null ?
            org.tensorflow.framework.GraphDef.getDefaultInstance() : graphDef_;
      }
    }
    /**
     *

     * "graph_def" has the subgraph of nodes for this worker, with each node
     * having its device_name filled in.
     *

     *
     * .tensorflow.GraphDef graph_def = 2;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder>
        getGraphDefFieldBuilder() {
      if (graphDefBuilder_ == null) {
        graphDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder>(
                getGraphDef(),
                getParentForChildren(),
                isClean());
        graphDef_ = null;
      }
      return graphDefBuilder_;
    }

    private boolean hasControlFlow_ ;
    /**
     *

     * True iff the graph (before partitioning) contains control flow nodes.
     * As of 01/11/2015, this is no longer set by clients.
     *

     *
     * bool has_control_flow = 3 [deprecated = true];
     */
    @java.lang.Deprecated public boolean getHasControlFlow() {
      return hasControlFlow_;
    }
    /**
     *

     * True iff the graph (before partitioning) contains control flow nodes.
     * As of 01/11/2015, this is no longer set by clients.
     *

     *
     * bool has_control_flow = 3 [deprecated = true];
     */
    @java.lang.Deprecated public Builder setHasControlFlow(boolean value) {

      hasControlFlow_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * True iff the graph (before partitioning) contains control flow nodes.
     * As of 01/11/2015, this is no longer set by clients.
     *

     *
     * bool has_control_flow = 3 [deprecated = true];
     */
    @java.lang.Deprecated public Builder clearHasControlFlow() {

      hasControlFlow_ = false;
      onChanged();
      return this;
    }

    private org.tensorflow.framework.GraphOptions graphOptions_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.framework.GraphOptions, org.tensorflow.framework.GraphOptions.Builder, org.tensorflow.framework.GraphOptionsOrBuilder> graphOptionsBuilder_;
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    public boolean hasGraphOptions() {
      return graphOptionsBuilder_ != null || graphOptions_ != null;
    }
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    public org.tensorflow.framework.GraphOptions getGraphOptions() {
      if (graphOptionsBuilder_ == null) {
        return graphOptions_ == null ? org.tensorflow.framework.GraphOptions.getDefaultInstance() : graphOptions_;
      } else {
        return graphOptionsBuilder_.getMessage();
      }
    }
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    public Builder setGraphOptions(org.tensorflow.framework.GraphOptions value) {
      if (graphOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        graphOptions_ = value;
        onChanged();
      } else {
        graphOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    public Builder setGraphOptions(
        org.tensorflow.framework.GraphOptions.Builder builderForValue) {
      if (graphOptionsBuilder_ == null) {
        graphOptions_ = builderForValue.build();
        onChanged();
      } else {
        graphOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    public Builder mergeGraphOptions(org.tensorflow.framework.GraphOptions value) {
      if (graphOptionsBuilder_ == null) {
        if (graphOptions_ != null) {
          graphOptions_ =
            org.tensorflow.framework.GraphOptions.newBuilder(graphOptions_).mergeFrom(value).buildPartial();
        } else {
          graphOptions_ = value;
        }
        onChanged();
      } else {
        graphOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    public Builder clearGraphOptions() {
      if (graphOptionsBuilder_ == null) {
        graphOptions_ = null;
        onChanged();
      } else {
        graphOptions_ = null;
        graphOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    public org.tensorflow.framework.GraphOptions.Builder getGraphOptionsBuilder() {

      onChanged();
      return getGraphOptionsFieldBuilder().getBuilder();
    }
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    public org.tensorflow.framework.GraphOptionsOrBuilder getGraphOptionsOrBuilder() {
      if (graphOptionsBuilder_ != null) {
        return graphOptionsBuilder_.getMessageOrBuilder();
      } else {
        return graphOptions_ == null ?
            org.tensorflow.framework.GraphOptions.getDefaultInstance() : graphOptions_;
      }
    }
    /**
     *

     * Configuration options for the session in which this graph was created.
     *

     *
     * .tensorflow.GraphOptions graph_options = 4;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.framework.GraphOptions, org.tensorflow.framework.GraphOptions.Builder, org.tensorflow.framework.GraphOptionsOrBuilder>
        getGraphOptionsFieldBuilder() {
      if (graphOptionsBuilder_ == null) {
        graphOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.framework.GraphOptions, org.tensorflow.framework.GraphOptions.Builder, org.tensorflow.framework.GraphOptionsOrBuilder>(
                getGraphOptions(),
                getParentForChildren(),
                isClean());
        graphOptions_ = null;
      }
      return graphOptionsBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

    // @@protoc_insertion_point(builder_scope:tensorflow.RegisterGraphRequest)
  }

  // @@protoc_insertion_point(class_scope:tensorflow.RegisterGraphRequest)
  private static final org.tensorflow.distruntime.RegisterGraphRequest DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tensorflow.distruntime.RegisterGraphRequest();
  }

  public static org.tensorflow.distruntime.RegisterGraphRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<RegisterGraphRequest>
      PARSER = new com.google.protobuf.AbstractParser<RegisterGraphRequest>() {
    public RegisterGraphRequest parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
        return new RegisterGraphRequest(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<RegisterGraphRequest> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<RegisterGraphRequest> getParserForType() {
    return PARSER;
  }

  public org.tensorflow.distruntime.RegisterGraphRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}