text:
package com.baomidou.mybatisplus.test;

import java.io.IOException;
import java.io.InputStream;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

import com.baomidou.mybatisplus.MybatisSessionFactoryBuilder;
import com.baomidou.mybatisplus.entity.GlobalConfiguration;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.baomidou.mybatisplus.spring.MybatisMapperRefresh;
import com.baomidou.mybatisplus.test.mysql.MySqlInjector;
import com.baomidou.mybatisplus.test.mysql.UserMapperTest;
import com.baomidou.mybatisplus.test.mysql.mapper.UserMapper;
import com.baomidou.mybatisplus.toolkit.SystemClock;

/**
 *

 * 切莫用于生产环境(后果自负)

 * Mybatis 映射文件热加载(发生变动后自动重新加载).

 * 方便开发时使用,不用每次修改xml文件后都要去重启应用.

 *

 *
 * @author nieqiurong
 * @Date 2016-08-25
 */
public class MybatisMapperRefreshTest {

    /**
     * 测试 Mybatis XML 修改自动刷新
     */
    public static void main(String[] args) throws IOException, InterruptedException {
        InputStream in = UserMapperTest.class.getClassLoader().getResourceAsStream("mysql-config.xml");
        MybatisSessionFactoryBuilder mf = new MybatisSessionFactoryBuilder();
        mf.setGlobalConfig(new GlobalConfiguration(new MySqlInjector()));
        Resource[] resource = new ClassPathResource[]{new ClassPathResource("mysql/UserMapper.xml")};
        SqlSessionFactory sessionFactory = mf.build(in);
        new MybatisMapperRefresh(resource, sessionFactory, 0, 5, true);
        boolean isReturn = false;
        SqlSession session = null;
        while (!isReturn) {
            try {
                session = sessionFactory.openSession();
                UserMapper userMapper = session.getMapper(UserMapper.class);
                userMapper.selectListRow(new Pagination(1, 10));
                resource[0].getFile().setLastModified(SystemClock.now());
                session.commit();
                session.close();
                Thread.sleep(5000);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                if (session != null) {
                    session.close();
                }
                Thread.sleep(5000);
            }
        }
        System.exit(0);
    }
}

redpajama_set_name: RedPajamaGithub


text:
title: Export to JSON
page_title: Export to JSON - RadDiagram
description: Check our Web Forms article about Export to JSON.
slug: diagram/import-and-export/export-to-json
tags: export,to,json
published: True
position: 2
---

# Export to JSON

You can export **RadDiagram** to a JSON object literal on the client. This is done in two simple steps (**Example 1**):

1. Get a reference to the client-side object of the underlying Kendo UI diagram as described in the [Overview]({%slug diagram/client-side-programming/overview%}) help article.

1. Call the [save](https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/diagram#methods-save) method of the client-side object of the diagram.

>caption **Example 1**: Export a diagram to a JSON object literal.

````ASP.NET
<telerik:RadDiagram ID="RadDiagra1" runat="server">
	<LayoutSettings Type="Tree" Subtype="Down" Enabled="true">
	</LayoutSettings>
	<ClientEvents OnLoad="onLoad" />
	<ShapesCollection>
		<telerik:DiagramShape Id="DiagramShape1"></telerik:DiagramShape>
		<telerik:DiagramShape Id="DiagramShape2"></telerik:DiagramShape>
	</ShapesCollection>
	<ConnectionsCollection>
		<telerik:DiagramConnection>
			<FromSettings Connector="Top" ShapeId="DiagramShape1" />
			<ToSettings Connector="Bottom" ShapeId="DiagramShape2" />
			<StrokeSettings />
		</telerik:DiagramConnection>
	</ConnectionsCollection>
</telerik:RadDiagram>
<script type="text/javascript">
	function onLoad(diagram) {
		var diagramWidget = diagram.get_kendoWidget();
		var json = diagramWidget.save();
		console.log(json);
	}
</script>
````

You can find a live example of the export to JSON functionality in the [JSON Import and Export demo](https://demos.telerik.com/aspnet-ajax/diagram/examples/saveload/defaultcs.aspx).

# See Also

 * [RadDiagram Client-Side Basics]({%slug diagram/client-side-programming/overview%})

 * [save method of Kendo UI Diagram](https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/diagram#methods-save)

 * [RadDiagram JSON Import and Export Demo](https://demos.telerik.com/aspnet-ajax/diagram/examples/saveload/defaultcs.aspx)


text:
<BroadcastMonitor>
  <updated>2015-08-07T20:18:42</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime>2015-08-07T20:18:26</startTime>
    <itemId>1000079349:1244620</itemId>
    <titleId>216136355</titleId>
    <itemCode>10265</itemCode>
    <itemReference></itemReference>
    <titleName>Cold Tears</titleName>
    <artistName>AM & Shawn Lee</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>186</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-07T20:21:24</startTime>
    <itemId>1000079349:1244621</itemId>
    <titleId>216123413</titleId>
    <itemCode>09265</itemCode>
    <itemReference></itemReference>
    <titleName>Secrets</titleName>
    <artistName>Bobby Womack</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>234</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
/**
 * This class is generated by jOOQ
 */
package io.cattle.platform.core.model.tables.records;

/**
 * This class is generated by jOOQ.
 */
@javax.annotation.Generated(value    = { "http://www.jooq.org", "3.3.0" },
                            comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
@javax.persistence.Entity
@javax.persistence.Table(name = "host_vnet_map", schema = "cattle")
public class HostVnetMapRecord extends org.jooq.impl.UpdatableRecordImpl<io.cattle.platform.core.model.tables.records.HostVnetMapRecord> implements io.cattle.platform.db.jooq.utils.TableRecordJaxb, org.jooq.Record12<java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Date, java.util.Date, java.util.Date, java.util.Map<String,Object>, java.lang.Long, java.lang.Long>, io.cattle.platform.core.model.HostVnetMap {

	private static final long serialVersionUID = -1160570753;

	/**
	 * Setter for cattle.host_vnet_map.id.
	 */
	@Override
	public void setId(java.lang.Long value) {
		setValue(0, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.id.
	 */
	@javax.persistence.Id
	@javax.persistence.Column(name = "id", unique = true, nullable = false, precision = 19)
	@Override
	public java.lang.Long getId() {
		return (java.lang.Long) getValue(0);
	}

	/**
	 * Setter for cattle.host_vnet_map.name.
	 */
	@Override
	public void setName(java.lang.String value) {
		setValue(1, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.name.
	 */
	@javax.persistence.Column(name = "name", length = 255)
	@Override
	public java.lang.String getName() {
		return (java.lang.String) getValue(1);
	}

	/**
	 * Setter for cattle.host_vnet_map.kind.
	 */
	@Override
	public void setKind(java.lang.String value) {
		setValue(2, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.kind.
	 */
	@javax.persistence.Column(name = "kind", nullable = false, length = 255)
	@Override
	public java.lang.String getKind() {
		return (java.lang.String) getValue(2);
	}

	/**
	 * Setter for cattle.host_vnet_map.uuid.
	 */
	@Override
	public void setUuid(java.lang.String value) {
		setValue(3, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.uuid.
	 */
	@javax.persistence.Column(name = "uuid", unique = true, nullable = false, length = 128)
	@Override
	public java.lang.String getUuid() {
		return (java.lang.String) getValue(3);
	}

	/**
	 * Setter for cattle.host_vnet_map.description.
	 */
	@Override
	public void setDescription(java.lang.String value) {
		setValue(4, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.description.
	 */
	@javax.persistence.Column(name = "description", length = 1024)
	@Override
	public java.lang.String getDescription() {
		return (java.lang.String) getValue(4);
	}

	/**
	 * Setter for cattle.host_vnet_map.state.
	 */
	@Override
	public void setState(java.lang.String value) {
		setValue(5, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.state.
	 */
	@javax.persistence.Column(name = "state", nullable = false, length = 128)
	@Override
	public java.lang.String getState() {
		return (java.lang.String) getValue(5);
	}

	/**
	 * Setter for cattle.host_vnet_map.created.
	 */
	@Override
	public void setCreated(java.util.Date value) {
		setValue(6, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.created.
	 */
	@javax.persistence.Column(name = "created")
	@Override
	public java.util.Date getCreated() {
		return (java.util.Date) getValue(6);
	}

	/**
	 * Setter for cattle.host_vnet_map.removed.
	 */
	@Override
	public void setRemoved(java.util.Date value) {
		setValue(7, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.removed.
	 */
	@javax.persistence.Column(name = "removed")
	@Override
	public java.util.Date getRemoved() {
		return (java.util.Date) getValue(7);
	}

	/**
	 * Setter for cattle.host_vnet_map.remove_time.
	 */
	@Override
	public void setRemoveTime(java.util.Date value) {
		setValue(8, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.remove_time.
	 */
	@javax.persistence.Column(name = "remove_time")
	@Override
	public java.util.Date getRemoveTime() {
		return (java.util.Date) getValue(8);
	}

	/**
	 * Setter for cattle.host_vnet_map.data.
	 */
	@Override
	public void setData(java.util.Map<String,Object> value) {
		setValue(9, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.data.
	 */
	@javax.persistence.Column(name = "data", length = 16777215)
	@Override
	public java.util.Map<String,Object> getData() {
		return (java.util.Map<String,Object>) getValue(9);
	}

	/**
	 * Setter for cattle.host_vnet_map.host_id.
	 */
	@Override
	public void setHostId(java.lang.Long value) {
		setValue(10, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.host_id.
	 */
	@javax.persistence.Column(name = "host_id", precision = 19)
	@Override
	public java.lang.Long getHostId() {
		return (java.lang.Long) getValue(10);
	}

	/**
	 * Setter for cattle.host_vnet_map.vnet_id.
	 */
	@Override
	public void setVnetId(java.lang.Long value) {
		setValue(11, value);
	}

	/**
	 * Getter for cattle.host_vnet_map.vnet_id.
	 */
	@javax.persistence.Column(name = "vnet_id", precision = 19)
	@Override
	public java.lang.Long getVnetId() {
		return (java.lang.Long) getValue(11);
	}

	// -------------------------------------------------------------------------
	// Primary key information
	// -------------------------------------------------------------------------

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Record1<java.lang.Long> key() {
		return (org.jooq.Record1) super.key();
	}

	// -------------------------------------------------------------------------
	// Record12 type implementation
	// -------------------------------------------------------------------------

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Row12<java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Date, java.util.Date, java.util.Date, java.util.Map<String,Object>, java.lang.Long, java.lang.Long> fieldsRow() {
		return (org.jooq.Row12) super.fieldsRow();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Row12<java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Date, java.util.Date, java.util.Date, java.util.Map<String,Object>, java.lang.Long, java.lang.Long> valuesRow() {
		return (org.jooq.Row12) super.valuesRow();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.Long> field1() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.ID;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.String> field2() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.NAME;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.String> field3() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.KIND;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.String> field4() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.UUID;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.String> field5() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.DESCRIPTION;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.String> field6() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.STATE;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.util.Date> field7() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.CREATED;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.util.Date> field8() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.REMOVED;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.util.Date> field9() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.REMOVE_TIME;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.util.Map<String,Object>> field10() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.DATA;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.Long> field11() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.HOST_ID;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.Long> field12() {
		return io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP.VNET_ID;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.Long value1() {
		return getId();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.String value2() {
		return getName();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.String value3() {
		return getKind();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.String value4() {
		return getUuid();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.String value5() {
		return getDescription();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.String value6() {
		return getState();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.util.Date value7() {
		return getCreated();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.util.Date value8() {
		return getRemoved();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.util.Date value9() {
		return getRemoveTime();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.util.Map<String,Object> value10() {
		return getData();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.Long value11() {
		return getHostId();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.Long value12() {
		return getVnetId();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value1(java.lang.Long value) {
		setId(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value2(java.lang.String value) {
		setName(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value3(java.lang.String value) {
		setKind(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value4(java.lang.String value) {
		setUuid(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value5(java.lang.String value) {
		setDescription(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value6(java.lang.String value) {
		setState(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value7(java.util.Date value) {
		setCreated(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value8(java.util.Date value) {
		setRemoved(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value9(java.util.Date value) {
		setRemoveTime(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value10(java.util.Map<String,Object> value) {
		setData(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value11(java.lang.Long value) {
		setHostId(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord value12(java.lang.Long value) {
		setVnetId(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public HostVnetMapRecord values(java.lang.Long value1, java.lang.String value2, java.lang.String value3, java.lang.String value4, java.lang.String value5, java.lang.String value6, java.util.Date value7, java.util.Date value8, java.util.Date value9, java.util.Map<String,Object> value10, java.lang.Long value11, java.lang.Long value12) {
		return this;
	}

	// -------------------------------------------------------------------------
	// FROM and INTO
	// -------------------------------------------------------------------------

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void from(io.cattle.platform.core.model.HostVnetMap from) {
		setId(from.getId());
		setName(from.getName());
		setKind(from.getKind());
		setUuid(from.getUuid());
		setDescription(from.getDescription());
		setState(from.getState());
		setCreated(from.getCreated());
		setRemoved(from.getRemoved());
		setRemoveTime(from.getRemoveTime());
		setData(from.getData());
		setHostId(from.getHostId());
		setVnetId(from.getVnetId());
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public <E extends io.cattle.platform.core.model.HostVnetMap> E into(E into) {
		into.from(this);
		return into;
	}

	// -------------------------------------------------------------------------
	// Constructors
	// -------------------------------------------------------------------------

	/**
	 * Create a detached HostVnetMapRecord
	 */
	public HostVnetMapRecord() {
		super(io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP);
	}

	/**
	 * Create a detached, initialised HostVnetMapRecord
	 */
	public HostVnetMapRecord(java.lang.Long id, java.lang.String name, java.lang.String kind, java.lang.String uuid, java.lang.String description, java.lang.String state, java.util.Date created, java.util.Date removed, java.util.Date removeTime, java.util.Map<String,Object> data, java.lang.Long hostId, java.lang.Long vnetId) {
		super(io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP);

		setValue(0, id);
		setValue(1, name);
		setValue(2, kind);
		setValue(3, uuid);
		setValue(4, description);
		setValue(5, state);
		setValue(6, created);
		setValue(7, removed);
		setValue(8, removeTime);
		setValue(9, data);
		setValue(10, hostId);
		setValue(11, vnetId);
	}
}


text:
var util = require("util");
var choreography = require("temboo/core/choreography");

/*
    CreateInvoiceItem
    Adds a charge or credit to the customer's next invoice.
*/

var CreateInvoiceItem = function(session) {
    /*
        Create a new instance of the CreateInvoiceItem Choreo. A TembooSession object, containing a valid
        set of Temboo credentials, must be supplied.
	*/
    var location = "/Library/Stripe/InvoiceItems/CreateInvoiceItem"
    CreateInvoiceItem.super_.call(this, session, location);

    /*
    Define a callback that will be used to appropriately format the results of this Choreo.
    */
    var newResultSet = function(resultStream) {
        return new CreateInvoiceItemResultSet(resultStream);
    }

	/*
	Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
	*/
    this.newInputSet = function() {
        return new CreateInvoiceItemInputSet();
    }

	/*
	Execute this Choreo with the specified inputs, calling the specified callback upon success,
	and the specified errorCallback upon error.
	*/
    this.execute = function(inputs, callback, errorCallback) {
        this._execute(inputs, newResultSet, callback, errorCallback);
    }
}

/*
An InputSet with methods appropriate for specifying the inputs to the CreateInvoiceItem
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/

var CreateInvoiceItemInputSet = function() {
    CreateInvoiceItemInputSet.super_.call(this);
        /*
        Set the value of the APIKey input for this Choreo. ((required, string) The API Key providied by Stripe)
        */
        this.set_APIKey = function(value) {
            this.setInput("APIKey", value);
        }

        /*
        Set the value of the Amount input for this Choreo. ((required, integer) The amount in cents of the charge to be included in the customer's next invoice)
        */
        this.set_Amount = function(value) {
            this.setInput("Amount", value);
        }

        /*
        Set the value of the Currency input for this Choreo. ((optional, string) 3-letter ISO code for currency. Defaults to 'usd' which is currently the only supported currency.)
        */
        this.set_Currency = function(value) {
            this.setInput("Currency", value);
        }

        /*
        Set the value of the CustomerID input for this Choreo. ((required, string) The unique identifier of the customer you want to create an invoice item for)
        */
        this.set_CustomerID = function(value) {
            this.setInput("CustomerID", value);
        }

        /*
        Set the value of the Description input for this Choreo. ((optional, string) An arbitrary string of text that will be included with the invoice item)
        */
        this.set_Description = function(value) {
            this.setInput("Description", value);
        }

}

/*
A ResultSet with methods tailored to the values returned by the CreateInvoiceItem Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/

var CreateInvoiceItemResultSet = function(resultStream) {
    CreateInvoiceItemResultSet.super_.call(this, resultStream);
        /*
        Retrieve the value for the "Response" output from this Choreo execution. ((json) The response from Stripe)
        */
        this.get_Response = function() {
            return this.getResult("Response");
        }
}

util.inherits(CreateInvoiceItem, choreography.Choreography);
util.inherits(CreateInvoiceItemInputSet, choreography.InputSet);
util.inherits(CreateInvoiceItemResultSet, choreography.ResultSet);
exports.CreateInvoiceItem = CreateInvoiceItem;

/*
    DeleteInvoiceItem
    Deletes a specified invoice item.
*/

var DeleteInvoiceItem = function(session) {
    /*
        Create a new instance of the DeleteInvoiceItem Choreo. A TembooSession object, containing a valid
        set of Temboo credentials, must be supplied.
	*/
    var location = "/Library/Stripe/InvoiceItems/DeleteInvoiceItem"
    DeleteInvoiceItem.super_.call(this, session, location);

    /*
    Define a callback that will be used to appropriately format the results of this Choreo.
    */
    var newResultSet = function(resultStream) {
        return new DeleteInvoiceItemResultSet(resultStream);
    }

	/*
	Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
	*/
    this.newInputSet = function() {
        return new DeleteInvoiceItemInputSet();
    }

	/*
	Execute this Choreo with the specified inputs, calling the specified callback upon success,
	and the specified errorCallback upon error.
	*/
    this.execute = function(inputs, callback, errorCallback) {
        this._execute(inputs, newResultSet, callback, errorCallback);
    }
}

/*
An InputSet with methods appropriate for specifying the inputs to the DeleteInvoiceItem
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/

var DeleteInvoiceItemInputSet = function() {
    DeleteInvoiceItemInputSet.super_.call(this);
        /*
        Set the value of the APIKey input for this Choreo. ((required, string) The API Key provided by Stripe)
        */
        this.set_APIKey = function(value) {
            this.setInput("APIKey", value);
        }

        /*
        Set the value of the InvoiceItemID input for this Choreo. ((required, string) The unique identifier of the invoice item you want to delete)
        */
        this.set_InvoiceItemID = function(value) {
            this.setInput("InvoiceItemID", value);
        }

}

/*
A ResultSet with methods tailored to the values returned by the DeleteInvoiceItem Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/

var DeleteInvoiceItemResultSet = function(resultStream) {
    DeleteInvoiceItemResultSet.super_.call(this, resultStream);
        /*
        Retrieve the value for the "Response" output from this Choreo execution. ((json) The response from Stripe)
        */
        this.get_Response = function() {
            return this.getResult("Response");
        }
}

util.inherits(DeleteInvoiceItem, choreography.Choreography);
util.inherits(DeleteInvoiceItemInputSet, choreography.InputSet);
util.inherits(DeleteInvoiceItemResultSet, choreography.ResultSet);
exports.DeleteInvoiceItem = DeleteInvoiceItem;

/*
    ListAllInvoiceItems
    Returns a list of all invoice items or a list of invoice items for a specified customer.
*/

var ListAllInvoiceItems = function(session) {
    /*
        Create a new instance of the ListAllInvoiceItems Choreo. A TembooSession object, containing a valid
        set of Temboo credentials, must be supplied.
	*/
    var location = "/Library/Stripe/InvoiceItems/ListAllInvoiceItems"
    ListAllInvoiceItems.super_.call(this, session, location);

    /*
    Define a callback that will be used to appropriately format the results of this Choreo.
    */
    var newResultSet = function(resultStream) {
        return new ListAllInvoiceItemsResultSet(resultStream);
    }

	/*
	Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
	*/
    this.newInputSet = function() {
        return new ListAllInvoiceItemsInputSet();
    }

	/*
	Execute this Choreo with the specified inputs, calling the specified callback upon success,
	and the specified errorCallback upon error.
	*/
    this.execute = function(inputs, callback, errorCallback) {
        this._execute(inputs, newResultSet, callback, errorCallback);
    }
}

/*
An InputSet with methods appropriate for specifying the inputs to the ListAllInvoiceItems
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/

var ListAllInvoiceItemsInputSet = function() {
    ListAllInvoiceItemsInputSet.super_.call(this);
        /*
        Set the value of the APIKey input for this Choreo. ((required, string) The API Key provided by Stripe)
        */
        this.set_APIKey = function(value) {
            this.setInput("APIKey", value);
        }

        /*
        Set the value of the Count input for this Choreo. ((optional, integer) The limit of invoice items to be returned. Can range from 1 to 100. Defaults to 10.)
        */
        this.set_Count = function(value) {
            this.setInput("Count", value);
        }

        /*
        Set the value of the CustomerID input for this Choreo. ((optional, string) The unique identifier of the customer whose invoice items to return. If not specified, all invoice items will be returned.)
        */
        this.set_CustomerID = function(value) {
            this.setInput("CustomerID", value);
        }

        /*
        Set the value of the Offset input for this Choreo. ((optional, integer) Stripe will return a list of invoice items starting at the specified offset. Defaults to 0.)
        */
        this.set_Offset = function(value) {
            this.setInput("Offset", value);
        }

}

/*
A ResultSet with methods tailored to the values returned by the ListAllInvoiceItems Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/

var ListAllInvoiceItemsResultSet = function(resultStream) {
    ListAllInvoiceItemsResultSet.super_.call(this, resultStream);
        /*
        Retrieve the value for the "Response" output from this Choreo execution. ((json) The response from Stripe)
        */
        this.get_Response = function() {
            return this.getResult("Response");
        }
}

util.inherits(ListAllInvoiceItems, choreography.Choreography);
util.inherits(ListAllInvoiceItemsInputSet, choreography.InputSet);
util.inherits(ListAllInvoiceItemsResultSet, choreography.ResultSet);
exports.ListAllInvoiceItems = ListAllInvoiceItems;

/*
    RetrieveInvoiceItem
    Retrieves invoice items with a specified id.
*/

var RetrieveInvoiceItem = function(session) {
    /*
        Create a new instance of the RetrieveInvoiceItem Choreo. A TembooSession object, containing a valid
        set of Temboo credentials, must be supplied.
	*/
    var location = "/Library/Stripe/InvoiceItems/RetrieveInvoiceItem"
    RetrieveInvoiceItem.super_.call(this, session, location);

    /*
    Define a callback that will be used to appropriately format the results of this Choreo.
    */
    var newResultSet = function(resultStream) {
        return new RetrieveInvoiceItemResultSet(resultStream);
    }

	/*
	Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
	*/
    this.newInputSet = function() {
        return new RetrieveInvoiceItemInputSet();
    }

	/*
	Execute this Choreo with the specified inputs, calling the specified callback upon success,
	and the specified errorCallback upon error.
	*/
    this.execute = function(inputs, callback, errorCallback) {
        this._execute(inputs, newResultSet, callback, errorCallback);
    }
}

/*
An InputSet with methods appropriate for specifying the inputs to the RetrieveInvoiceItem
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/

var RetrieveInvoiceItemInputSet = function() {
    RetrieveInvoiceItemInputSet.super_.call(this);
        /*
        Set the value of the APIKey input for this Choreo. ((required, string) The secret API Key provided by Stripe)
        */
        this.set_APIKey = function(value) {
            this.setInput("APIKey", value);
        }

        /*
        Set the value of the InvoiceItemID input for this Choreo. ((required, string) The unique identifier of the invoice item you want to retrieve)
        */
        this.set_InvoiceItemID = function(value) {
            this.setInput("InvoiceItemID", value);
        }

}

/*
A ResultSet with methods tailored to the values returned by the RetrieveInvoiceItem Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/

var RetrieveInvoiceItemResultSet = function(resultStream) {
    RetrieveInvoiceItemResultSet.super_.call(this, resultStream);
        /*
        Retrieve the value for the "Response" output from this Choreo execution. ((json) The response from Stripe)
        */
        this.get_Response = function() {
            return this.getResult("Response");
        }
}

util.inherits(RetrieveInvoiceItem, choreography.Choreography);
util.inherits(RetrieveInvoiceItemInputSet, choreography.InputSet);
util.inherits(RetrieveInvoiceItemResultSet, choreography.ResultSet);
exports.RetrieveInvoiceItem = RetrieveInvoiceItem;

/*
    UpdateInvoiceItem
    Updates the amount or description of an existing invoice item.
*/

var UpdateInvoiceItem = function(session) {
    /*
        Create a new instance of the UpdateInvoiceItem Choreo. A TembooSession object, containing a valid
        set of Temboo credentials, must be supplied.
	*/
    var location = "/Library/Stripe/InvoiceItems/UpdateInvoiceItem"
    UpdateInvoiceItem.super_.call(this, session, location);

    /*
    Define a callback that will be used to appropriately format the results of this Choreo.
    */
    var newResultSet = function(resultStream) {
        return new UpdateInvoiceItemResultSet(resultStream);
    }

	/*
	Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
	*/
    this.newInputSet = function() {
        return new UpdateInvoiceItemInputSet();
    }

	/*
	Execute this Choreo with the specified inputs, calling the specified callback upon success,
	and the specified errorCallback upon error.
	*/
    this.execute = function(inputs, callback, errorCallback) {
        this._execute(inputs, newResultSet, callback, errorCallback);
    }
}

/*
An InputSet with methods appropriate for specifying the inputs to the UpdateInvoiceItem
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/

var UpdateInvoiceItemInputSet = function() {
    UpdateInvoiceItemInputSet.super_.call(this);
        /*
        Set the value of the APIKey input for this Choreo. ((required, string) The API Key provided by Stripe)
        */
        this.set_APIKey = function(value) {
            this.setInput("APIKey", value);
        }

        /*
        Set the value of the Amount input for this Choreo. ((required, integer) The amount in cents of the charge to be included in the customer's next invoice)
        */
        this.set_Amount = function(value) {
            this.setInput("Amount", value);
        }

        /*
        Set the value of the Currency input for this Choreo. ((optional, string) 3-letter ISO code for currency. Defaults to 'usd' which is currently the only supported currency.)
        */
        this.set_Currency = function(value) {
            this.setInput("Currency", value);
        }

        /*
        Set the value of the Description input for this Choreo. ((optional, string) An arbitrary string of text that will be included with the invoice item)
        */
        this.set_Description = function(value) {
            this.setInput("Description", value);
        }

        /*
        Set the value of the InvoiceItemID input for this Choreo. ((required, string) The unique identifier of the invoice item you want to update)
        */
        this.set_InvoiceItemID = function(value) {
            this.setInput("InvoiceItemID", value);
        }

}

/*
A ResultSet with methods tailored to the values returned by the UpdateInvoiceItem Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/

var UpdateInvoiceItemResultSet = function(resultStream) {
    UpdateInvoiceItemResultSet.super_.call(this, resultStream);
        /*
        Retrieve the value for the "Response" output from this Choreo execution. ((json) The response from Stripe)
        */
        this.get_Response = function() {
            return this.getResult("Response");
        }
}

util.inherits(UpdateInvoiceItem, choreography.Choreography);
util.inherits(UpdateInvoiceItemInputSet, choreography.InputSet);
util.inherits(UpdateInvoiceItemResultSet, choreography.ResultSet);
exports.UpdateInvoiceItem = UpdateInvoiceItem;


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.trino.operator.scalar;

import io.trino.spi.type.VarcharType;
import org.testng.annotations.Test;

public class TestTypeOfFunction
        extends AbstractTestFunctions
{
    @Test
    public void testSimpleType()
    {
        assertFunction("typeof(CAST(1 AS BIGINT))", VarcharType.VARCHAR, "bigint");
        assertFunction("typeof(CAST(1 AS INTEGER))", VarcharType.VARCHAR, "integer");
        assertFunction("typeof(CAST(1 AS VARCHAR))", VarcharType.VARCHAR, "varchar");
        assertFunction("typeof(CAST(1 AS DOUBLE))", VarcharType.VARCHAR, "double");
        assertFunction("typeof(123)", VarcharType.VARCHAR, "integer");
        assertFunction("typeof('cat')", VarcharType.VARCHAR, "varchar(3)");
        assertFunction("typeof(NULL)", VarcharType.VARCHAR, "unknown");
    }

    @Test
    public void testParametricType()
    {
        assertFunction("typeof(CAST(NULL AS VARCHAR(10)))", VarcharType.VARCHAR, "varchar(10)");
        assertFunction("typeof(CAST(NULL AS DECIMAL(5,1)))", VarcharType.VARCHAR, "decimal(5,1)");
        assertFunction("typeof(CAST(NULL AS DECIMAL(1)))", VarcharType.VARCHAR, "decimal(1,0)");
        assertFunction("typeof(CAST(NULL AS DECIMAL))", VarcharType.VARCHAR, "decimal(38,0)");
        assertFunction("typeof(CAST(NULL AS ARRAY(INTEGER)))", VarcharType.VARCHAR, "array(integer)");
        assertFunction("typeof(CAST(NULL AS ARRAY(DECIMAL(5,1))))", VarcharType.VARCHAR, "array(decimal(5,1))");
    }

    @Test
    public void testNestedType()
    {
        assertFunction("typeof(CAST(NULL AS ARRAY(ARRAY(ARRAY(INTEGER)))))", VarcharType.VARCHAR, "array(array(array(integer)))");
        assertFunction("typeof(CAST(NULL AS ARRAY(ARRAY(ARRAY(DECIMAL(5,1))))))", VarcharType.VARCHAR, "array(array(array(decimal(5,1))))");
    }

    @Test
    public void testComplex()
    {
        assertFunction("typeof(CONCAT('ala','ma','kota'))", VarcharType.VARCHAR, "varchar");
        assertFunction("typeof(CONCAT(CONCAT('ala','ma','kota'), 'baz'))", VarcharType.VARCHAR, "varchar");
        assertFunction("typeof(ARRAY [CAST(1 AS INTEGER),CAST(2 AS INTEGER),CAST(3 AS INTEGER)])", VarcharType.VARCHAR, "array(integer)");
        assertFunction("typeof(sin(2))", VarcharType.VARCHAR, "double");
        assertFunction("typeof(2+sin(2)+2.3)", VarcharType.VARCHAR, "double");
    }
}


text:
/* $Id: wak_codegen.h,v 1.1.1.1 2004/09/13 21:07:48 mstrout Exp $ */
#ifndef Already_Included_Wak_CodeGen
#define Already_Included_Wak_CodeGen

namespace omega {

extern String WakGenerateCode(String init);

extern Relation wak_project_onto_levels(Relation R, int last_level, bool wildcards);

extern String outputEasyBound(const GEQ_Handle &g, Variable_ID v,
			      int lower_bound);

extern int is_loop_dist[max_stmts][maxLevels];

}

#endif


text:
using System;
using System.Diagnostics;
using System.Drawing;

namespace PeriodicAppCore
{
    public abstract class Cube
    {
        public const int Width = 32;
        public const int Height = 32;
        protected const int paletteSize = 16;
        protected Color[] palette = new Color[paletteSize];
        protected Cube[] neighbors = new Cube[(int)Side.NumSides];
        protected Cube[] lastNeighbors = new Cube[(int)Side.NumSides];

        protected virtual void OnNeighborsChanged()
        {
        }

        public Cube GetNeighborSinceLastPaint(Side side)
        {
            if (!side.IsValid())
            { throw new ArgumentOutOfRangeException("side", "Side must be a valid side!"); }

            return lastNeighbors[(int)side];
        }

        public Cube GetNeighbor(Side side)
        {
            if (!side.IsValid())
            { throw new ArgumentOutOfRangeException("side", "Side must be a valid side!"); }

            return neighbors[(int)side];
        }

        public void SetNeighbor(Side side, Cube other)
        {
            lock (Periodic.NeighborhoodMutex)
            {
                if (!side.IsValid())
                { throw new ArgumentOutOfRangeException("side", "Side must be a valid side!"); }

                int sideNum = (int)side;
                Side oppositeSide = side.GetOpposite();
                int oppositeSideNum = (int)oppositeSide;

                Cube oldNeighbor = GetNeighbor(side);

                if (oldNeighbor == other)
                { return; }

                // Remove ourselves from our old neighbor
                if (oldNeighbor != null)
                {
                    Debug.Assert(oldNeighbor.neighbors[oppositeSideNum] == this);
                    oldNeighbor.neighbors[oppositeSideNum] = null;
                }

                // Set our new neighbor:
                neighbors[sideNum] = other;

                // Set us on our new neighbor, and remove the old neighbor if the new neighbor had one:
                if (other != null)
                {
                    // Remove the new neighbor from the old neighbor
                    if (other.neighbors[oppositeSideNum] != null)
                    { other.neighbors[oppositeSideNum].neighbors[sideNum] = null; }

                    // Set us as a neighbor of the new neighbor
                    other.neighbors[oppositeSideNum] = this;
                }
            }
        }

        public void OnTouch()
        {
            Periodic.OnTouch(this);
        }

        protected internal void SetPaletteColor(int colorIndex, Color color)
        {
            if (colorIndex < 0 || colorIndex >= palette.Length)
            { throw new ArgumentOutOfRangeException("colorIndex", "colorIndex is out of the range of allowed palette indices."); }

            palette[colorIndex] = color;
        }

        protected internal void SetPaletteColor(int colorIndex, int r, int g, int b)
        {
            SetPaletteColor(colorIndex, Color.FromArgb(r, g, b));
        }

        bool neighborhoodIsStale = false;

        public virtual void Paint()
        {
            // Back up the neighbors array so that the cubes get the state that is accurate to the events they've received rather than
            // the live version. We also use this to call OnNeighborsChanged and inform Periodic that the neighborhoods have changed.
            neighborhoodIsStale = false;
            for (int i = 0; i < neighbors.Length; i++)
            {
                if (lastNeighbors[i] != neighbors[i])
                {
                    lastNeighbors[i] = neighbors[i];
                    neighborhoodIsStale = true;
                }
            }

            if (neighborhoodIsStale)
            {
                Periodic.MarkNeighborhoodsAsStale();
            }
        }

        //HACK: This is kinda weird to get around issues with deadlocking with Invoke in OnNeighborsChanged.
        public void HandleNeighborhoodChanging()
        {
            if (neighborhoodIsStale)
            {
                neighborhoodIsStale = false;
                OnNeighborsChanged();
            }
        }

        public abstract void ClearScreen(int colorIndex);
        public abstract void DrawPoint(int x, int y, int colorIndex);
    }
}


text:
package org.apache.drill.exec.resourcemgr.config;

import org.apache.drill.exec.resourcemgr.config.selectionpolicy.QueueSelectionPolicy.SelectionPolicy;

/**
 * Defines all the default values used for the optional configurations for ResourceManagement
 */
public final class RMCommonDefaults {

  public static final int MAX_ADMISSIBLE_QUERY_COUNT = 10;

  public static final int MAX_WAITING_QUERY_COUNT = 10;

  public static final int MAX_WAIT_TIMEOUT_IN_MS = 30_000;

  public static final boolean WAIT_FOR_PREFERRED_NODES = true;

  public static final double ROOT_POOL_DEFAULT_MEMORY_PERCENT = 0.9;

  public static final SelectionPolicy ROOT_POOL_DEFAULT_QUEUE_SELECTION_POLICY = SelectionPolicy.BESTFIT;

}


text:
package org.apache.geode.management.internal.cli.commands.lifecycle;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import javax.management.remote.JMXServiceURL;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.ArgumentCaptor;

import org.apache.geode.management.internal.cli.shell.Gfsh;
import org.apache.geode.test.junit.rules.GfshParserRule;

public class StartJConsoleCommandTest {

  @Rule
  public GfshParserRule gfshParser = new GfshParserRule();

  private StartJConsoleCommand command;
  private Gfsh gfsh;
  ArgumentCaptor<String[]> argumentCaptor;

  @Before
  public void setUp() throws Exception {
    command = spy(StartJConsoleCommand.class);
    gfsh = mock(Gfsh.class);
    doReturn(gfsh).when(command).getGfsh();
    doReturn(null).when(command).getJmxServiceUrl();

    Process process = mock(Process.class);
    doReturn(process).when(command).getProcess(any(String[].class));
    doReturn("some output").when(command).getProcessOutput(process);

    argumentCaptor = ArgumentCaptor.forClass(String[].class);
  }

  @Test
  public void succcessOutput() throws Exception {
    gfshParser.executeAndAssertThat(command, "start jconsole")
        .containsOutput("some output");

    verify(command, times(1)).getProcess(argumentCaptor.capture());

    String[] commandString = argumentCaptor.getValue();
    assertThat(commandString).hasSize(2);
    assertThat(commandString[0]).contains("jconsole");
    assertThat(commandString[1]).isEqualTo("-interval=4");
  }

  @Test
  public void succcessOutputWithVersion() throws Exception {
    StringBuilder builder = new StringBuilder();
    builder.append("some error message");
    doReturn(builder).when(command).getErrorStringBuilder(any());

    gfshParser.executeAndAssertThat(command, "start jconsole --version")
        .containsOutput("some error message");

    verify(command, times(1)).getProcess(argumentCaptor.capture());

    String[] commandString = argumentCaptor.getValue();
    assertThat(commandString).hasSize(2);
    assertThat(commandString[0]).contains("jconsole");
    assertThat(commandString[1]).isEqualTo("-version");
  }

  @Test
  public void successWithServiceUrl() throws Exception {
    doReturn(new JMXServiceURL("service:jmx:rmi://localhost")).when(command).getJmxServiceUrl();
    doReturn(true).when(command).isConnectedAndReady();
    gfshParser.executeAndAssertThat(command, "start jconsole")
        .containsOutput("some output");

    verify(command, times(1)).getProcess(argumentCaptor.capture());
    String[] commandString = argumentCaptor.getValue();
    assertThat(commandString).hasSize(3);
    assertThat(commandString[0]).contains("jconsole");
    assertThat(commandString[1]).isEqualTo("-interval=4");
    assertThat(commandString[2]).isEqualTo("service:jmx:rmi://localhost");
  }
}


text:
$canvas = $('.canvas');
// align-content: "flex-start"
$('#opt-start').click(function(event) {
  console.log('align-content: "flex-start"');
  $canvas.css('align-content', 'flex-start');
});
// align-content: "flex-end"
$('#opt-end').click(function(event) {
  console.log('align-content: "flex-end"');
  $canvas.css('align-content', 'flex-end');
});
// align-content: "center"
$('#opt-center').click(function(event) {
  console.log('align-content: "center"');
  $canvas.css('align-content', 'center');
});
// align-content: "stretch"
$('#opt-stretch').click(function(event) {
  console.log('align-content: "stretch"');
  $canvas.css('align-content', 'stretch');
});
// align-content: "space-around"
$('#opt-space-a').click(function(event) {
  console.log('align-content: "space-around"');
  $canvas.css('align-content', 'space-around');
});
// align-content: "space-between"
$('#opt-space-b').click(function(event) {
  console.log('align-content: "space-between"');
  $canvas.css('align-content', 'space-between');
});


text:
#define _POSIX_C_SOURCE 200112L
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-client-protocol.h>
#include "wlr-virtual-pointer-unstable-v1-client-protocol.h"

static struct wl_seat *seat = NULL;
static struct zwlr_virtual_pointer_manager_v1 *pointer_manager = NULL;

static void handle_global(void *data, struct wl_registry *registry,
		uint32_t name, const char *interface, uint32_t version) {
	if (strcmp(interface, wl_seat_interface.name) == 0) {
		seat = wl_registry_bind(registry, name,
			&wl_seat_interface, version);
	} else if (strcmp(interface,
			zwlr_virtual_pointer_manager_v1_interface.name) == 0) {
		pointer_manager = wl_registry_bind(registry, name,
			&zwlr_virtual_pointer_manager_v1_interface, 1);
	}
}

static void handle_global_remove(void *data, struct wl_registry *registry,
		uint32_t name) {
	// Who cares?
}

static const struct wl_registry_listener registry_listener = {
	.global = handle_global,
	.global_remove = handle_global_remove,
};

int main(int argc, char *argv[]) {
	if (argc < 2) {
		fprintf(stderr, "Usage: ./virtual-pointer <subcommand>\n");
		return EXIT_FAILURE;
	}
	struct wl_display * display = wl_display_connect(NULL);
	if (display == NULL) {
		perror("failed to create display");
		return EXIT_FAILURE;
	}

	struct wl_registry *registry = wl_display_get_registry(display);
	wl_registry_add_listener(registry, &registry_listener, NULL);
	wl_display_roundtrip(display);

	if (pointer_manager == NULL) {
		fprintf(stderr, "compositor does not support wlr-virtual-pointer-unstable-v1\n");
		return EXIT_FAILURE;
	}

	struct zwlr_virtual_pointer_v1 *pointer =
		zwlr_virtual_pointer_manager_v1_create_virtual_pointer(
			pointer_manager, seat);

	const char *cmd = argv[1];
	if (strcmp(cmd, "motion") == 0) {
		if (argc < 4) {
			fprintf(stderr, "Usage: ./virtual-pointer motion <dx> <dy>\n");
			return EXIT_FAILURE;
		}
		wl_fixed_t dx = wl_fixed_from_double(atof(argv[2]));
		wl_fixed_t dy = wl_fixed_from_double(atof(argv[3]));
		zwlr_virtual_pointer_v1_motion(pointer, 0, dx, dy);
	} else if (strcmp(cmd, "absolute") == 0) {
		if (argc < 6) {
			fprintf(stderr, "Usage: ./virtual-pointer absolute <x> <y> <x_extent> <y_extent>\n");
			return EXIT_FAILURE;
		}
		uint32_t x = atoi(argv[2]);
		uint32_t y = atoi(argv[3]);
		uint32_t x_extent = atoi(argv[4]);
		uint32_t y_extent = atoi(argv[5]);
		zwlr_virtual_pointer_v1_motion_absolute(pointer, 0, x, y, x_extent, y_extent);
	} else if (strcmp(cmd, "button") == 0) {
		if (argc < 4) {
			fprintf(stderr, "Usage: ./virtual-pointer button <button> press|release\n");
			return EXIT_FAILURE;
		}
		uint32_t button = atoi(argv[2]);
		bool press = !!strcmp(argv[3], "release");
		zwlr_virtual_pointer_v1_button(pointer, 0, button, press);
	} else if (strcmp(cmd, "axis") == 0) {
		if (argc < 4) {
			fprintf(stderr, "Usage: ./virtual-pointer axis <axis> <value>\n");
			return EXIT_FAILURE;
		}
		uint32_t axis = atoi(argv[2]);
		wl_fixed_t value = wl_fixed_from_double(atof(argv[3]));
		zwlr_virtual_pointer_v1_axis(pointer, 0, axis, value);
		zwlr_virtual_pointer_v1_axis_stop(pointer, 0, axis);
	} else if (strcmp(cmd, "axis_discrete") == 0) {
		if (argc < 5) {
			fprintf(stderr, "Usage: ./virtual-pointer axis <axis> <value> <value_discrete>\n");
			return EXIT_FAILURE;
		}
		uint32_t axis = atoi(argv[2]);
		wl_fixed_t value = wl_fixed_from_double(atof(argv[3]));
		uint32_t discrete = atoi(argv[4]);
		zwlr_virtual_pointer_v1_axis_discrete(pointer, 0, axis, value, discrete);
		zwlr_virtual_pointer_v1_axis_stop(pointer, 0, axis);
	} else {
		fprintf(stderr, "Invalid subcommand\n");
		return EXIT_FAILURE;
	}

	zwlr_virtual_pointer_v1_frame(pointer);
	zwlr_virtual_pointer_v1_destroy(pointer);

	wl_display_flush(display);

	return EXIT_SUCCESS;
}


text:
/************************************************************************
*
* Flood Project © (2008-201x)
* Licensed under the simplified BSD license. All rights reserved.
*
************************************************************************/

#pragma once

#include "API.h"
#include "Core/Event.h"
#include "Graphics/RenderContext.h"

#include <wx/glcanvas.h>

NAMESPACE_EDITOR_BEGIN

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

class RenderTarget;
class WxWindow;
class WxInputManager;

class WxRenderContext : public RenderContext
{
public:

	WxRenderContext(wxGLCanvas* canvas);
	virtual ~WxRenderContext();

	void makeCurrent(RenderTarget* target) OVERRIDE;

	// OpenGL context.
	wxGLContext* contextGL;
};

class WxGLCanvas : public wxGLCanvas
{
public:

	WxGLCanvas(wxWindow* parent, wxWindowID id = wxID_ANY,
					const int* attribList = nullptr,
					const wxPoint& pos = wxDefaultPosition,
					const wxSize& size = wxDefaultSize,
					long style = wxFULL_REPAINT_ON_RESIZE | wxBORDER_NONE,
					const wxString& name = wxGLCanvasName);

	~WxGLCanvas();

	// Flag this control to be redrawn.
	void flagRedraw();

	// Starts firing the update and render frame timers.
	void startFrameLoop();

	// Starts firing the update and render frame timers.
	void stopFrameLoop();

	// Holds an instance of the input manager.
	WxInputManager* input;

protected:

	// Handles the update and redraw logic.
	void doUpdate(wxTimerEvent&);
	void doRender(wxTimerEvent&);

	// Window events.
	void OnIdle(wxIdleEvent& event);
	void OnPaint(wxPaintEvent& event);
	void OnSize(wxSizeEvent& event);
	void OnFocusSet(wxFocusEvent& event);
	void OnFocusKill(wxFocusEvent& event);

	// Input events.
	void OnKeyDown(wxKeyEvent& event);
	void OnKeyUp(wxKeyEvent& event);
	void OnChar(wxKeyEvent& event);
	void OnMouseEvent(wxMouseEvent& event);
	void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);

	// Timer responsible for update ticks.
	wxTimer frameUpdateTimer;

	// Timer responsible for rendering ticks.
	wxTimer frameRenderTimer;

	// Window associated with this control.
	WxWindow* window;

	// Tracks if the control needs to be redrawn.
	bool needsRedraw;

	DECLARE_EVENT_TABLE()
};

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

NAMESPACE_EDITOR_END


text:
namespace views {
class TextButton;
class Textfield;
}  // namespace views

class AboutNetworkDialog : public views::DialogDelegate,
                           public views::ButtonListener,
                           public views::View {
 public:
  // This dialog is a singleton. If the dialog is already opened, it won't do
  // anything, so you can just blindly call this function all you want.
  static void RunDialog();

  virtual ~AboutNetworkDialog();

  // Appends the given string to the dialog box. This is called by the job
  // tracker (see the .cc file) when "stuff happens."
  void AppendText(const std::wstring& text);

  // Returns true if we're currently tracking network operations.
  bool tracking() const { return tracking_; }

 private:
  friend struct DefaultSingletonTraits<AboutNetworkDialog>;

  AboutNetworkDialog();

  // Sets up all UI controls for the dialog.
  void SetupControls();

  virtual gfx::Size GetPreferredSize();
  virtual views::View* GetContentsView();
  virtual int GetDialogButtons() const;
  virtual std::wstring GetWindowTitle() const;

  // views::WindowDelegate (via view::DialogDelegate).
  virtual bool CanResize() const;

  // views::ButtonListener.
  virtual void ButtonPressed(views::Button* button, const views::Event& event);

  views::TextButton* track_toggle_;
  views::TextButton* show_button_;
  views::TextButton* clear_button_;
  views::Textfield* text_field_;

  // Set to true when we're tracking network status.
  bool tracking_;

  DISALLOW_COPY_AND_ASSIGN(AboutNetworkDialog);
};

#endif  // CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_


text:
using namespace Oryol;

TEST(QueueTest) {

    // test empty queue
    Queue<StringAtom> queue0;
    CHECK(queue0.GetMinGrow() == ORYOL_CONTAINER_DEFAULT_MIN_GROW);
    CHECK(queue0.GetMaxGrow() == ORYOL_CONTAINER_DEFAULT_MAX_GROW);
    CHECK(queue0.Size() == 0);
    CHECK(queue0.Capacity() == 0);
    CHECK(queue0.Empty());
    CHECK(queue0.SpareEnqueue() == 0);
    CHECK(queue0.SpareDequeue() == 0);

    // copy-construct from empty queue
    Queue<StringAtom> queue1(queue0);
    CHECK(queue1.GetMinGrow() == ORYOL_CONTAINER_DEFAULT_MIN_GROW);
    CHECK(queue1.GetMaxGrow() == ORYOL_CONTAINER_DEFAULT_MAX_GROW);
    CHECK(queue1.Size() == 0);
    CHECK(queue1.Capacity() == 0);
    CHECK(queue1.Empty());
    CHECK(queue1.SpareEnqueue() == 0);
    CHECK(queue1.SpareDequeue() == 0);

    // copy-assign empty queue
    Queue<StringAtom> queue2;
    queue2 = queue0;
    CHECK(queue2.GetMinGrow() == ORYOL_CONTAINER_DEFAULT_MIN_GROW);
    CHECK(queue2.GetMaxGrow() == ORYOL_CONTAINER_DEFAULT_MAX_GROW);
    CHECK(queue2.Size() == 0);
    CHECK(queue2.Capacity() == 0);
    CHECK(queue2.Empty());
    CHECK(queue2.SpareEnqueue() == 0);
    CHECK(queue2.SpareDequeue() == 0);

    // enqueue some elements
    const StringAtom w0("Element0");
    const StringAtom w1("Element1");
    const StringAtom w2("Element2");
    const StringAtom w3("Element3");
    queue0.Enqueue(w0);
    queue0.Enqueue(w1);
    queue0.Enqueue(w2);
    queue0.Enqueue(w3);
    CHECK(queue0.Size() == 4);
    CHECK(queue0.SpareDequeue() == 0);

    // dequeue elements
    StringAtom r0(queue0.Dequeue());
    CHECK(r0 == w0);
    CHECK(r0 == "Element0");
    CHECK(queue0.Size() == 3);
    CHECK(queue0.SpareDequeue() == 1);
    CHECK(queue0.Dequeue() == "Element1");
    CHECK(queue0.Size() == 2);
    CHECK(queue0.SpareDequeue() == 2);
    StringAtom r2;
    queue0.Dequeue(r2);
    CHECK(r2 == w2);
    CHECK(r2 == "Element2");
    CHECK(queue0.Size() == 1);
    CHECK(queue0.SpareDequeue() == 3);
    StringAtom r3 = queue0.Dequeue();
    CHECK(r3 == w3);
    CHECK(r3 == "Element3");
    CHECK(queue0.Empty());

    queue0.Enqueue("Bla");
    CHECK(queue0.SpareDequeue() == 0);
    CHECK(queue0.Size() == 1);
    CHECK(queue0.Dequeue() == "Bla");

    // SetFixedCapacity
    // fixed capacity
    Queue<int> queue3;
    queue3.SetFixedCapacity(128);
    CHECK(queue3.Size() == 0);
    CHECK(queue3.Capacity() == 128);
    CHECK(queue3.GetMinGrow() == 0);
    CHECK(queue3.GetMaxGrow() == 0);
}


text:
namespace doris {

BitFieldReader::BitFieldReader(ReadOnlyFileStream* input) :
        _input(input),
        _byte_reader(NULL),
        _current('\0'),
        _bits_left(0) {}

BitFieldReader::~BitFieldReader() {
    SAFE_DELETE(_byte_reader);
}

OLAPStatus BitFieldReader::init() {
    if (NULL == _byte_reader) {
        _byte_reader = new(std::nothrow) RunLengthByteReader(_input);

        if (NULL == _byte_reader) {
            OLAP_LOG_WARNING("fail to create RunLengthByteReader");
            return OLAP_ERR_MALLOC_ERROR;
        }
    }

    return OLAP_SUCCESS;
}

OLAPStatus BitFieldReader::_read_byte() {
    OLAPStatus res = OLAP_SUCCESS;

    if (_byte_reader->has_next()) {
        if (OLAP_SUCCESS != (res = _byte_reader->next(&_current))) {
            return res;
        }

        _bits_left = 8;
    } else {
        return OLAP_ERR_DATA_EOF;
    }

    return OLAP_SUCCESS;
}

OLAPStatus BitFieldReader::next(char* value) {
    OLAPStatus res = OLAP_SUCCESS;

    if (0 == _bits_left) {
        if (OLAP_SUCCESS != (res = _read_byte())) {
            return res;
        }
    }

    --_bits_left;

    *value = (_current >> _bits_left) & 0x01;

    return OLAP_SUCCESS;
}

OLAPStatus BitFieldReader::seek(PositionProvider* position) {
    OLAPStatus res = OLAP_SUCCESS;

    if (OLAP_SUCCESS != (res = _byte_reader->seek(position))) {
        return res;
    }

    int64_t consumed = position->get_next();

    if (consumed > 8) {
        OLAP_LOG_WARNING("read past end of bit field");
        return OLAP_ERR_DATA_EOF;
    } else if (consumed != 0) {
        if (OLAP_SUCCESS != (res = _read_byte())) {
            return res;
        }

        _bits_left = 8 - consumed;
    } else {
        _bits_left = 0;
    }

    return OLAP_SUCCESS;
}

OLAPStatus BitFieldReader::skip(uint64_t num_values) {
    OLAPStatus res = OLAP_SUCCESS;

    uint64_t total_bits = num_values;

    if (_bits_left >= total_bits) {
        _bits_left -= total_bits;
    } else {
        total_bits -= _bits_left;

        if (OLAP_SUCCESS != (res = _byte_reader->skip(total_bits / 8))) {
            return res;
        }

        if (OLAP_SUCCESS != (res = _byte_reader->next(&_current))) {
            return res;
        }

        _bits_left = 8 - (total_bits % 8);
    }

    return OLAP_SUCCESS;
}

}  // namespace doris


text:
using System;
using System.Collections.Generic;
using System.Linq;
using hw.Debug;

namespace hw.Helper
{
    public static class RelationExtender
    {
        public static IEnumerable<TType> Sort<TType>(this IEnumerable<TType> x, Func<TType, IEnumerable<TType>> immediateParents)
        {
            var xx = x.ToArray();
            Tracer.Assert(xx.IsCircuidFree(immediateParents));
            return null;
        }

        public static IEnumerable<TType> Closure<TType>(this IEnumerable<TType> x, Func<TType, IEnumerable<TType>> immediateParents)
        {
            var types = x.ToArray();
            var targets = types;
            while(true)
            {
                targets = targets.SelectMany(immediateParents).Except(types).ToArray();
                if(!targets.Any())
                    return types;
                types = types.Union(targets).ToArray();
            }
        }

        public static bool IsCircuidFree<TType>(this TType x, Func<TType, IEnumerable<TType>> immediateParents) { return immediateParents(x).Closure(immediateParents).All(xx => !xx.Equals(x)); }
        public static bool IsCircuidFree<TType>(this IEnumerable<TType> x, Func<TType, IEnumerable<TType>> immediateParents) { return x.All(xx => xx.IsCircuidFree(immediateParents)); }

        public static IEnumerable<TType> Circuids<TType>(this IEnumerable<TType> x, Func<TType, IEnumerable<TType>> immediateParents) { return x.Where(xx => !xx.IsCircuidFree(immediateParents)); }
    }
}


text:
package com.dibujaron.BetterPassives;

import org.bukkit.Location;

import com.massivecraft.factions.Factions;
import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.massivecore.ps.PS;

public class FactionUtils {
	public static boolean isInClaimedLand(Location l) {
		Faction f = BoardColl.get().getFactionAt(PS.valueOf(l));
		if (f == null)
			return false;
		String id = f.getId();
		if (id.equals(Factions.ID_NONE) || id.equals(Factions.ID_SAFEZONE) || id.equals(Factions.ID_WARZONE)) {
			return false;
		}
		return true;
	}
}


text:
import rospy
from std_msgs.msg import Int8
from hlpr_record_demonstration.srv import ChangeKF, ChangeKFResponse

""" kf_tracker.py
simple tracker that tracks the current KF for recording purposes
"""
class KFTracker():

    TOPIC_PARAM = "kf_track_topic"
    SERVICE_NAME = "kf_change_service"
    DEFAULT_RATE = 100
    DEFAULT_TOPIC = "kf_tracker/state"
    IDLE_KF = -1

    def __init__(self):

        # Everything is ready, now init the node
        rospy.init_node("kf_tracker")

        # Get the frequency of publishing
        self.publish_rate = rospy.get_param("~kf_rate", self.DEFAULT_RATE)
        self.rate = rospy.Rate(self.publish_rate)

        # Get the topic to publish to
        self.publish_topic = rospy.get_param("~kf_topic", self.DEFAULT_TOPIC)

        # Store the topic name
        rospy.set_param(self.TOPIC_PARAM, self.publish_topic)

        # Setup the publisher
        self.pub = rospy.Publisher(self.publish_topic, Int8, queue_size=10)

        # Setup service to change the current KF number
        self.kf_service = rospy.Service(self.SERVICE_NAME, ChangeKF, self._update_kf)

        # Initialize the state
        self.kf_num = self.IDLE_KF

        rospy.loginfo("Done setting up keyframe tracker")

    def _update_kf(self, req):

        # Check what to do with KF req
        if req.increment:
            self.kf_num+=1
        elif req.decrement:
            self.kf_num-+1
        else:
            self.kf_num = req.kf_num

        rospy.loginfo("Change KF to: %d" % self.kf_num)
        resp = ChangeKFResponse()
        resp.response = True
        return resp

    def _start_publish(self):

        # Continuously publish
        while not rospy.is_shutdown():

            self.pub.publish(self.kf_num)
            self.rate.sleep()

if __name__ == '__main__':
    tracker = KFTracker()
    tracker._start_publish()


text:
import NormalisationRuleStore from '../../lib/normalisation-rule-store';
import * as assert from 'assert';
import WorkspaceAdaptor from '../../lib/adaptors/workspace';
import {mock, when} from '../helpers';

suite('NormalisationRuleStore', () => {
    let workspace: WorkspaceAdaptor;
    let ruleStore: NormalisationRuleStore;

    setup(() => {
        workspace = mock(WorkspaceAdaptor);
        when(workspace.get('preComparisonTextNormalizationRules')).thenReturn([
            {name: 'RULE1', enableOnStart: true},
            {name: 'RULE2', enableOnStart: true},
            {name: 'RULE3', enableOnStart: false},
            {name: 'RULE4'}
        ]);
        ruleStore = new NormalisationRuleStore(workspace);
    });

    test('it gives pre-comparison text normalization rules from config', () => {
        assert.deepEqual(ruleStore.getAllRules(), [
            {name: 'RULE1', active: true},
            {name: 'RULE2', active: true},
            {name: 'RULE3', active: false},
            {name: 'RULE4', active: true}
        ]);
    });

    test('it marks unspecified rules as disabled', () => {
        const activeRuleIndices = [1];
        ruleStore.specifyActiveRules(activeRuleIndices);
        const [firstRule] = ruleStore.getAllRules();
        assert.deepEqual(firstRule, {name: 'RULE1', active: false});
    });

    test('it resets all rule states in the editor config', () => {
        const activeRuleIndices = [1];
        ruleStore.specifyActiveRules(activeRuleIndices);
        workspace.get<any[]>('preComparisonTextNormalizationRules').push({name: 'RULE_TMP'} as any);
        assert.deepEqual(ruleStore.getAllRules(), [
            {name: 'RULE1', active: true},
            {name: 'RULE2', active: true},
            {name: 'RULE3', active: false},
            {name: 'RULE4', active: true},
            {name: 'RULE_TMP', active: true}
        ]);
    });

    test('it returns all the active rules', () => {
        const activeRuleIndices = [1];
        ruleStore.specifyActiveRules(activeRuleIndices);
        assert.deepEqual(ruleStore.activeRules, [{name: 'RULE2', active: true}]);
    });

    test('it tells if there are any active rules', () => {
        const activeRuleIndices = [1];
        ruleStore.specifyActiveRules(activeRuleIndices);
        assert.equal(ruleStore.hasActiveRules, true);
    });

    test('it tells if there are no active rules', () => {
        ruleStore.specifyActiveRules([]);
        assert.equal(ruleStore.hasActiveRules, false);
    });
});


text:
define(["require", "exports", "tslib", "./TileProcessor"], function (require, exports, tslib_1, TileProcessor_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    TileProcessor_1 = tslib_1.__importDefault(TileProcessor_1);
    exports.tileProcessor = new TileProcessor_1.default();
});
//# sourceMappingURL=FeaturePipeline.js.map


text:
/*
 *  @author  Anthony Chan
 */

package logformat.clog2;

import java.util.List;
import java.util.ArrayList;
import java.io.*;

// Class corresponds to CLOG_Rec_EventDef
public class RecDefEvent
{
    public  static final int RECTYPE  = Const.RecType.EVENTDEF;
    private static final int BYTESIZE = 2 * 4
                                      + StrColor.BYTESIZE
                                      + StrDesc.BYTESIZE
                                      + StrFormat.BYTESIZE;
    public         Integer     etype;            // event
    // private static int         pad;              // pad
    public         String      color;            // string for color
    public         String      name;             // string describing event
    public         String      format;           // format string for the event

    public int readFromDataStream( MixedDataInputStream in )
    {
        try {
            etype        = new Integer( in.readInt() );
            // pad          = in.readInt();
            in.skipBytes( 4 );
            color        = in.readString( StrColor.BYTESIZE );
            name         = in.readString( StrDesc.BYTESIZE );
            format       = in.readString( StrFormat.BYTESIZE );
        } catch ( IOException ioerr ) {
            ioerr.printStackTrace();
            return 0;
        }

        return BYTESIZE;
    }

    public int skipBytesFromDataStream( DataInputStream in )
    {
        try {
            in.skipBytes( BYTESIZE );
        } catch ( IOException ioerr ) {
            ioerr.printStackTrace();
            return 0;
        }

        return BYTESIZE;
    }

    public static List getUndefinedInitedEventDefs( int eventID_start,
                                                    int eventID_count )
    {
        RecDefEvent def;

        // evtID is equivalent to the variable "stateid" MPI_Init()
        // in <MPE>/src/wrappers/src/log_mpi_core.c
        int evtID = eventID_start;
        List defs = new ArrayList( eventID_count );
        for ( int idx = 0; idx < eventID_count; idx++ ) {
            def              = new RecDefEvent();
            def.etype        = new Integer( evtID++ );
            def.color        = "pink";
            def.name         = null;
            def.format       = null;
            defs.add( def );
        }
        return defs;
    }

    public String toString()
    {
        return ( "RecDefEvent"
               + "[ etype=" + etype
               // + ", pad=" + pad
               + ", color=" + color
               + ", name=" + name
               + ", format=" + format
               // + ", BYTESIZE=" + BYTESIZE
               + " ]");
    }
}


text:
owner=`who -m | awk '{print $1;}'`
## echo "The owner is $owner"
grep "^$owner:" /etc/passwd | grep "1000:1000" > /dev/null 2>&1
ret_val=$?
if [ "$ret_val" -eq 0 ]; then
    echo "Found the owner $owner with right UID and GID"
else
    echo "Did not find the owner $owner with right UID and GID"
    exit 1
fi

id | grep root > /dev/null 2>&1
ret_val=$?
if [ "$ret_val" -ne 0 ]; then
    echo "You are not running as sudo !!!"
    exit 1
else
    echo "Running as root. Continuing !!!"
fi

PRE_REQUISITE_APPS="docker supervisord supervisorctl"

check_availability() {
    command -v $1 > /dev/null 2>&1
    ret_val=$?
    ## echo "The ret_val is :: $ret_val"
    return $ret_val
}

for req_app in $PRE_REQUISITE_APPS
do
    ## echo $req_app
    check_availability $req_app
    ret_val=$?
    if [ $ret_val -eq 0 ]
    then
        echo "$req_app is installed, good to go !"
    else
        echo "$req_app is not installed. Please install $req_app first !"
        echo "Installation terminated as dependencies are not met."
        exit 1
    fi
done

add_host_to_etc_hosts() {
    hostname=`hostname`
    ## echo "The host name is ::: $hostname"
    ip_address=`ping -c 1 $hostname | grep "bytes of data" | awk '{print $3}' | cut -c 2- | rev | cut -c 2- | rev`
    ## echo "The ip address is $ip_address"
    string_to_add="$ip_address $hostname  api.$hostname"
    already_exists=`grep "^$string_to_add" /etc/hosts | wc -l`

    ## Check if already exists
    if [ $already_exists -ge 1 ]; then
         return 999
    fi
    echo "String to add is :: $string_to_add"
    echo "$string_to_add" >>  /etc/hosts
    return $?
}

## echo "Calling add_host_to_etc_hosts()"
add_host_to_etc_hosts
ret_val=$?
if [ $ret_val -eq 0 ]; then
    echo "added to /etc/hosts !"
elif [ $ret_val -eq 999 ]; then
    echo "already configured in /etc/hosts !"
else
    echo "could not add to /etc/hosts !"
    echo "Installation terminated as dependencies are not met."
    exit 1
fi

## Untar up all the required images and components in the home folder
tar xvf JuliaDeploymentBundle.tar

cd JuliaDeploymentImages

## Load all the docker images

for dock_img in `ls -1 *_image.tar`
do
	echo ""
    echo "======================================================"
    echo "Loading docker image ${dock_img} ..."
    echo "======================================================"
	docker load < $dock_img
	ret_val=$?
    echo "======================================================"
    echo "Loaded docker image ${dock_img} ..."
    echo "Status ${ret_val} ..."  ## Should exit if not successful !
    echo "======================================================"
done

## Go back to where it all started
cd ../

echo "======================================================"
echo "Unpack jboxengine ..."
echo "======================================================"
\cp -rf jboxengine /
ret_val=$?
## TODO check if it is required to change ownership. It may not be required?
## chown -R $USER:$USER /jboxengine
chown -R $owner:$owner /jboxengine
echo "======================================================"
echo "Unpacked jboxengine ..."
echo "Status ${ret_val} ..."  ## Should exit if not successful !
echo "======================================================"

echo "======================================================"
echo "Starting components ..."
echo "======================================================"

cd JuliaDeployment
./scripts/run/start.sh
ret_val=$?

echo "======================================================"
echo "Started components. Check webserver/logs and engine/logs ..."
echo "Status ${ret_val} ..."  ## Should exit if not successful !
echo "======================================================"

echo "======================================================"
echo "Validating components ..."
echo "======================================================"

echo "Waiting for components to start !"
sleep 5
num_containers=`docker ps -a | wc -l`
echo "# of containers = $num_containers"
echo "======================================================"
if [ $num_containers -ge 4 ]; then
	echo "Validation Successful !!!"
else
	echo "Validation Failed !!! Please check the log files for more information"
fi
echo "======================================================"

echo "======================================================"
echo "Validating API container ..."
echo "======================================================"

hostname=`hostname`
ret_val=`curl -v --data ";jsonString=\"Hello\""  http://api.$hostname/test/echo/ | cat - | grep "Hello" | wc -l`
## ret_val=`curl -v --data ";jsonString=\"Hello\""  http://api.ip-10-93-140-37/test/echo/ | cat - | grep "Hello" | wc -l`

echo "The ret_val is :: $ret_val"

echo "======================================================"
if [ $ret_val -ne 0 ]; then
	echo "API Deployment Successful !!!"
else
	echo "API Deployment Failed !!! Please check the log files for more information"
fi
echo "======================================================"

echo
echo "Installation and Validation DONE !!!"


text:
package com.ea.orbit.actors.test.actors;

import com.ea.orbit.actors.Actor;
import com.ea.orbit.concurrent.Task;

public interface SomeChatRoom extends Actor
{
    Task<Void> join(SomeChatObserver chatObserver);

    Task<Void> sendMessage(SomeChatObserver chatObserver, String message);

    Task<?> startCountdown(int count, String message);

}


text:
package eu.hgross.blaubot.mock;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.SocketTimeoutException;
import java.util.UUID;
import java.util.concurrent.LinkedBlockingQueue;

import eu.hgross.blaubot.core.AbstractBlaubotConnection;
import eu.hgross.blaubot.core.IBlaubotConnection;
import eu.hgross.blaubot.core.IBlaubotDevice;

/**
 *
 * Mock object utilizing an input and an output queue to emulate connection operations. To
 * emulate data sent from a client (this connection is the client connection) use the
 * {@link #writeMockDataToInputStream(byte[])} method. This data can then be retrieved via
 * the read*() methods like {@link #readFully(byte[])}.
 *
 * If you want to read the data written to this connection via its write*() methods like
 * {@link #write(byte[])}, use the {@link #getInputStreamForWrittenConnectionData()}
 * {@link InputStream} to do so.
 *
 * If you need a pair of connections where one connection writes to the other connections
 * input stream, use {@link BlaubotConnectionQueueMock#getOtherEndpointConnection(eu.hgross.blaubot.core.IBlaubotDevice)}.
 *
 * @author Henning Gross {@literal (mail.to@henning-gross.de)}
 *
 */
public class BlaubotConnectionQueueMock extends AbstractBlaubotConnection {

	protected LinkedBlockingQueue<Byte> inputQueue;
	protected LinkedBlockingQueue<Byte> outputQueue;
	private DataInputStream dataInputStream;
	private DataOutputStream dataOutputStream;
	protected volatile boolean connected = true;
	private IBlaubotDevice device;
    private UUID uuid = UUID.randomUUID();

	/**
	 * @param remoteDevice
	 *            the remote device
	 */
	public BlaubotConnectionQueueMock(IBlaubotDevice remoteDevice) {
		this.device = remoteDevice;
		this.inputQueue = new LinkedBlockingQueue<Byte>();
		this.outputQueue = new LinkedBlockingQueue<Byte>();
		setupDataStreams();
	}

	private void setupDataStreams() {
		this.dataInputStream = new DataInputStream(inputStream);
		this.dataOutputStream = new DataOutputStream(outputStream);
	}

	/**
	 * Retrieve a {@link BlaubotConnectionQueueMock} object which reads from THIS object
	 * for its read() methods and writes to THIS object.
	 *
	 * @param otherSidesDevice the other endpoint's {@link IBlaubotDevice}
	 * @return the remote device's connection (their perspective)
	 */
	public BlaubotConnectionQueueMock getOtherEndpointConnection(IBlaubotDevice otherSidesDevice) {
		BlaubotConnectionQueueMock otherSide = new BlaubotConnectionQueueMock(otherSidesDevice);
		otherSide.outputQueue = inputQueue;
		otherSide.inputQueue = outputQueue;
		otherSide.setupDataStreams();
		return otherSide;

	}

	/**
	 * Write data to the stream that can be retrieved via the {@link IBlaubotConnection}s
	 * read*() methods.
	 *
	 * @param data
	 *            the data to write to the input stream as byte array
	 */
	public synchronized void writeMockDataToInputStream(byte[] data) {
		for (byte b : data) {
			this.inputQueue.add(b);
		}
	}

	/**
	 * Retrieve an {@link InputStream} to get the data written to this
	 * {@link IBlaubotConnection} via it's write*() methods.
	 *
	 * @return the input stream
	 */
	public InputStream getInputStreamForWrittenConnectionData() {
		return new InputStream() {
			@Override
			public int read() throws IOException {
				Byte b;
				try {
					b = outputQueue.take();
					if (!connected) {
						throw new IOException("Connection was closed");
					}
				} catch (InterruptedException e) {
                    // EOF
					return -1;
				}
				return b != null ? unsignedToBytes(b) : -1;
			}
		};
	}

	/**
	 * Converts the byte to an unsigned integer.
	 *
	 * @param b
	 * @return
	 */
	private static int unsignedToBytes(byte b) {
		return b & 0xFF;
	}

	private InputStream inputStream = new InputStream() {
		@Override
		public int read() throws IOException {
			Byte b;
			try {
				b = inputQueue.take();
				if (!connected) {
					throw new IOException("Connection was closed");
				}
			} catch (InterruptedException e) {
                // EOF
				return -1;
			}
			return b != null ? unsignedToBytes(b) : -1;
		}
	};

	private OutputStream outputStream = new OutputStream() {
		@Override
		public void write(int b) throws IOException {
			byte toWrite = (byte) (b & 0xFF);
			try {
				if (!connected) {
					throw new IOException("Connection was closed");
				}
				outputQueue.put(toWrite);
			} catch (InterruptedException e) {
				e.printStackTrace();
				throw new IOException(e);
			}
		}
	};

	protected Object disconnnectMonitor = new Object();
	@Override
	public  void disconnect() {
		synchronized (disconnnectMonitor) {
			if (!connected) {
				return;
			}
			connected = false;
		}
		// put a byte to the inputQueue to ensure the readFully operations will die with
		// ioexceptions
		try {
			inputQueue.put((byte) 0);
		} catch (InterruptedException e) {
			e.printStackTrace();
            throw new RuntimeException(e);
		}
		this.notifyDisconnected();
	}

	@Override
	public boolean isConnected() {
		return connected;
	}

	@Override
	public IBlaubotDevice getRemoteDevice() {
		return device;
	}

	@Override
	public void write(int b) throws SocketTimeoutException, IOException {
		if (!connected) {
			throw new IOException("not connected");
		}
		dataOutputStream.write(b);
	}

	@Override
	public void write(byte[] bytes) throws SocketTimeoutException, IOException {
		if (!connected) {
			throw new IOException("not connected");
		}
		dataOutputStream.write(bytes);
	}

	@Override
	public void write(byte[] bytes, int byteOffset, int byteCount) throws SocketTimeoutException, IOException {
		if (!connected) {
			throw new IOException("not connected");
		}
		dataOutputStream.write(bytes, byteOffset, byteCount);
	}

	@Override
	public int read() throws SocketTimeoutException, IOException {
		if (!connected) {
			throw new IOException("not connected");
		}
		return dataInputStream.read();
	}

	@Override
	public int read(byte[] buffer) throws SocketTimeoutException, IOException {
		if (!connected) {
			throw new IOException("not connected");
		}
		return dataInputStream.read(buffer);
	}

	@Override
	public int read(byte[] buffer, int byteOffset, int byteCount) throws SocketTimeoutException, IOException {
		if (!connected) {
			throw new IOException("not connected");
		}
		return dataInputStream.read(buffer, byteOffset, byteCount);
	}

	@Override
	public void readFully(byte[] buffer) throws SocketTimeoutException, IOException {
		if (!connected) {
			throw new IOException("not connected");
		}
		dataInputStream.readFully(buffer);
	}

	@Override
	public void readFully(byte[] buffer, int offset, int byteCount) throws SocketTimeoutException, IOException {
		if (!connected) {
			throw new IOException("not connected");
		}
		dataInputStream.readFully(buffer, offset, byteCount);
	}

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        BlaubotConnectionQueueMock that = (BlaubotConnectionQueueMock) o;

        if (uuid != null ? !uuid.equals(that.uuid) : that.uuid != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (uuid != null ? uuid.hashCode() : 0);
        return result;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Metrodiana, Sonderheft 4: 16 (1990)

#### Original name
Psathyrella tristezae Raithelh.

### Remarks
null


text:
// Copyright 2018 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.skylarkbuildapi.android;

import com.google.devtools.build.lib.skylarkinterface.StarlarkBuiltin;
import com.google.devtools.build.lib.syntax.StarlarkValue;

/** Android configuration for properly handling native dependencies */
@StarlarkBuiltin(
    name = "android_split_transition",
    doc =
        "Do not use this module. It is intended for migration purposes only. If you depend on it, "
            + "you will be broken when it is removed.",
    documented = false)
public interface AndroidSplitTransititionApi extends StarlarkValue {}


text: export { default as OneWayInput } from 'ember-one-way-controls/components/one-way-input';


text:
pkg_name=gdb
pkg_origin=core
pkg_version=8.1
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
pkg_license=('GPL-3.0')
pkg_description="GDB, the GNU Project debugger, allows you to see what is going on 'inside' another program while it executes -- or what another program was doing at the moment it crashed."
pkg_upstream_url="https://www.gnu.org/software/gdb/"
pkg_source="http://ftp.gnu.org/gnu/${pkg_name}/${pkg_name}-${pkg_version}.tar.xz"
pkg_shasum=af61a0263858e69c5dce51eab26662ff3d2ad9aa68da9583e8143b5426be4b34
pkg_deps=(
  core/glibc
  lilian/readline
  lilian/zlib
  lilian/xz
  lilian/ncurses
  lilian/expat
  lilian/guile
  lilian/bdwgc
  lilian/python
)
pkg_build_deps=(
  lilian/coreutils
  lilian/pkg-config
  lilian/diffutils
  lilian/expect
  lilian/dejagnu
  lilian/patch
  lilian/make
  lilian/gcc
  lilian/texinfo
)
pkg_bin_dirs=(bin)
pkg_lib_dirs=(lib)

pkg_disabled_features=(pic)
source ../defaults.sh

do_build() {
  ./configure \
    --build=x86_64-linux-gnu \
    --host=x86_64-linux-gnu \
    --prefix="${pkg_prefix}" \
    --sysconfdir="${pkg_svc_config_path}" \
    --localstatedir="${pkg_svc_var_path}" \
    --libexecdir="${pkg_prefix}/lib/gdb" \
    --enable-tui \
    --disable-maintainer-mode \
    --disable-dependency-tracking \
    --disable-silent-rules \
    --disable-gdbtk \
    --disable-shared \
    --with-pkgversion="The Habitat Maintainers ${pkg_version}/${pkg_release}" \
    --with-system-readline \
    --with-system-zlib \
    --with-lzma \
    --with-expat \
    --with-guile \
    --without-babeltrace \
    --with-system-gdbinit="${pkg_svc_config_path}/gdb/gdbinit" \
    --with-python=python3

  make -j "$(nproc)"
}

do_check() {
  make -j "$(nproc)" check
}

do_install() {
  do_default_install

  # Clean up files that ship with binutils and may conflict
  rm -fv "${pkg_prefix}/lib/{libbfd,libopcodes}.a"
  rm -fv "${pkg_prefix}/include/{ansidecl,bfd,bfdlink,dis-asm,plugin-api,symcat}.h"
  rm -fv "${pkg_prefix}/share/info/bfd.info"
}


text:
Custom Toolbar Buttons
=======================

This is an extension of [Bootstrap table](http://bootstrap-table.wenzhixin.net.cn/) to add custom buttons to toolbar, close to default buttons like "refresh", "column selector", etc.

Features
-----
- Add a custom button with specified icon that on click event call a custom function

Demo
-----
See it in action: [demo here](https://jsfiddle.net/michaelsogos/w112m1o3/)

Installation
-----
#### Bower

```
bower install bootstrap-table-toolbar-buttons
```

Usage
-----
Include this extension after [Bootstrap-table](https://github.com/wenzhixin/bootstrap-table).
In case you use an AMD loader (like require.js) specify manually dependecies to jQuery, bootstrap and bootstrap-table (like shims in require.js).

```html
<script src="bootstrap-table-toolbar-buttons.js"></script>
```

Simple example:
```html
<body>
    <div class="container">
      <div class="row">
        <table id='grid'>
            <thead>
              <tr>
                <th data-field='itemid'>Item ID</th>
                <th data-field='name'>Name</th>
                <th data-field='price'>Price</th>
              </tr>
            </thead>
            <tbody>
              <tr><td>1</td><td>ABC</td><td>$1.00</td></tr>
              <tr><td>2</td><td>DEF</td><td>$2.00</td></tr>
              <tr><td>3</td><td>GHI</td><td>$3.00</td></tr>
              <tr><td>4</td><td>XYZ</td><td>$4.00</td></tr>
            </tbody>
        </table>
      </div>
    </div>

    <!-- context menu -->
    <ul id="context-menu" class="dropdown-menu">
        <li data-item="edit"><a>Edit</a></li>
        <li data-item="delete"><a>Delete</a></li>
        <li data-item="action1"><a>Action Here</a></li>
        <li data-item="action2"><a>And Action Here</a></li>
    </ul>

    <div id="filters-dialog" class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title ">Table Filters</h4>
                </div>
                <div class="modal-body">
                    <span>Add here filter fields!</span>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-danger pull-left">Reset Filters</button>
                    <button type="button" class="btn btn-info" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>

    <script>
    $(function() {
        $('#grid').bootstrapTable({
            showRefresh: true,
            customToolbarButtons: [
                {
                    name: "grid-filters",
                    title: "Filters",
                    icon: "glyphicon-filter",
                    callback: onShowFiltersDialog
                }
            ]
        });
    });

    var onShowFiltersDialog = function(){
        $('#filters-dialog').modal('show');
    }
    </script>
</body>
```

Options
-----

|Name                    |Type                 |Default   |Description|
|------------------------|---------------------|----------|-----------|
|customToolbarButtons    |Array                |[]        |An array of button object (see below).|

Button object
----

|Name                    |Type                 |Default   |Description|
|------------------------|---------------------|----------|-----------|
|name                    |String               |undefined |The attribute NAME of the button. It must be unique else just one button will be rendered.|
|title                   |String               |undefined |The attribute TITLE and ARIA-LABEL of the button.|
|icon                    |String               |undefined |The css class name of the button (usually a glyphicon), it depend on the option *iconsPrefix*.|
|callback                |Function             |undefined |The function will be called when user raise CLICK event to the button.|


text:
/**
 * Provides classes for reading and writing the standard ZIP and GZIP file
 * formats. Also includes classes for compressing and decompressing data using
 * the DEFLATE compression algorithm, which is used by the ZIP and GZIP file
 * formats. Additionally, there are utility classes for computing the CRC-32,
 * CRC-32C and Adler-32 checksums of arbitrary input streams.
 *
 *
Package Specification

 *
 *

 *

 *         Info-ZIP Application Note 970311 - a detailed description of
 *         the Info-ZIP format upon which the {@code java.util.zip} classes
 *         are based.
 *
An implementation may optionally support the
 *         ZIP64(tm) format extensions defined by the
 *
 *         PKWARE ZIP File Format Specification. The ZIP64(tm) format
 *         extensions are used to overcome the size limitations of the
 *         original ZIP format.
 *
APPENDIX D of
 *
 *         PKWARE ZIP File Format Specification - Language Encoding Flag
 *         to encode ZIP entry filename and comment fields using UTF-8.
 *

 *         ZLIB Compressed Data Format Specification version 3.3
 *
 *         (pdf)
 *         (RFC 1950)
 *

 *         DEFLATE Compressed Data Format Specification version 1.3
 *
 *         (pdf)
 *         (RFC 1951)
 *

 *         GZIP file format specification version 4.3
 *
 *         (pdf)
 *         (RFC 1952)
 *
CRC-32 checksum is described in RFC 1952 (above)
 *
CRC-32C checksum is described in
 *         Internet Small
 *         Computer Systems Interface (iSCSI)
 *
 *         (pdf)
 *         (RFC 3720)
 *
Adler-32 checksum is described in RFC 1950 (above)
 *

 *
 * @since 1.1
 */
package java.util.zip;