text:
package org.apache.activemq.artemis.cli.commands.tools;

/**
 * The constants shared by org.apache.activemq.tools.XmlDataImporter and
 * org.apache.activemq.tools.XmlDataExporter.
 */
public final class XmlDataConstants {

   private XmlDataConstants() {
      // Utility
   }

   static final String XML_VERSION = "1.0";
   static final String DOCUMENT_PARENT = "activemq-journal";
   static final String BINDINGS_PARENT = "bindings";
   static final String BINDINGS_CHILD = "binding";
   static final String BINDING_ADDRESS = "address";
   static final String BINDING_FILTER_STRING = "filter-string";
   static final String BINDING_QUEUE_NAME = "queue-name";
   static final String BINDING_ID = "id";
   static final String JMS_CONNECTION_FACTORY = "jms-connection-factory";
   static final String JMS_CONNECTION_FACTORIES = "jms-connection-factories";
   static final String MESSAGES_PARENT = "messages";
   static final String MESSAGES_CHILD = "message";
   static final String MESSAGE_ID = "id";
   static final String MESSAGE_PRIORITY = "priority";
   static final String MESSAGE_EXPIRATION = "expiration";
   static final String MESSAGE_TIMESTAMP = "timestamp";
   static final String DEFAULT_TYPE_PRETTY = "default";
   static final String BYTES_TYPE_PRETTY = "bytes";
   static final String MAP_TYPE_PRETTY = "map";
   static final String OBJECT_TYPE_PRETTY = "object";
   static final String STREAM_TYPE_PRETTY = "stream";
   static final String TEXT_TYPE_PRETTY = "text";
   static final String MESSAGE_TYPE = "type";
   static final String MESSAGE_IS_LARGE = "isLarge";
   static final String MESSAGE_USER_ID = "user-id";
   static final String MESSAGE_BODY = "body";
   static final String PROPERTIES_PARENT = "properties";
   static final String PROPERTIES_CHILD = "property";
   static final String PROPERTY_NAME = "name";
   static final String PROPERTY_VALUE = "value";
   static final String PROPERTY_TYPE = "type";
   static final String QUEUES_PARENT = "queues";
   static final String QUEUES_CHILD = "queue";
   static final String QUEUE_NAME = "name";
   static final String PROPERTY_TYPE_BOOLEAN = "boolean";
   static final String PROPERTY_TYPE_BYTE = "byte";
   static final String PROPERTY_TYPE_BYTES = "bytes";
   static final String PROPERTY_TYPE_SHORT = "short";
   static final String PROPERTY_TYPE_INTEGER = "integer";
   static final String PROPERTY_TYPE_LONG = "long";
   static final String PROPERTY_TYPE_FLOAT = "float";
   static final String PROPERTY_TYPE_DOUBLE = "double";
   static final String PROPERTY_TYPE_STRING = "string";
   static final String PROPERTY_TYPE_SIMPLE_STRING = "simple-string";

   static final String JMS_CONNECTION_FACTORY_NAME = "name";
   static final String JMS_CONNECTION_FACTORY_CLIENT_ID = "client-id";
   static final String JMS_CONNECTION_FACTORY_CALL_FAILOVER_TIMEOUT = "call-failover-timeout";
   static final String JMS_CONNECTION_FACTORY_CALL_TIMEOUT = "call-timeout";
   static final String JMS_CONNECTION_FACTORY_CLIENT_FAILURE_CHECK_PERIOD = "client-failure-check-period";
   static final String JMS_CONNECTION_FACTORY_CONFIRMATION_WINDOW_SIZE = "confirmation-window-size";
   static final String JMS_CONNECTION_FACTORY_CONNECTION_TTL = "connection-ttl";
   static final String JMS_CONNECTION_FACTORY_CONSUMER_MAX_RATE = "consumer-max-rate";
   static final String JMS_CONNECTION_FACTORY_CONSUMER_WINDOW_SIZE = "consumer-window-size";
   static final String JMS_CONNECTION_FACTORY_DISCOVERY_GROUP_NAME = "discovery-group-name";
   static final String JMS_CONNECTION_FACTORY_DUPS_OK_BATCH_SIZE = "dups-ok-batch-size";
   static final String JMS_CONNECTION_FACTORY_TYPE = "type";
   static final String JMS_CONNECTION_FACTORY_GROUP_ID = "group-id";
   static final String JMS_CONNECTION_FACTORY_LOAD_BALANCING_POLICY_CLASS_NAME = "load-balancing-policy-class-name";
   static final String JMS_CONNECTION_FACTORY_MAX_RETRY_INTERVAL = "max-retry-interval";
   static final String JMS_CONNECTION_FACTORY_MIN_LARGE_MESSAGE_SIZE = "min-large-message-size";
   static final String JMS_CONNECTION_FACTORY_PRODUCER_MAX_RATE = "producer-max-rate";
   static final String JMS_CONNECTION_FACTORY_PRODUCER_WINDOW_SIZE = "producer-window-size";
   static final String JMS_CONNECTION_FACTORY_RECONNECT_ATTEMPTS = "reconnect-attempts";
   static final String JMS_CONNECTION_FACTORY_RETRY_INTERVAL = "retry-interval";
   static final String JMS_CONNECTION_FACTORY_RETRY_INTERVAL_MULTIPLIER = "retry-interval-multiplier";
   static final String JMS_CONNECTION_FACTORY_SCHEDULED_THREAD_POOL_MAX_SIZE = "scheduled-thread-pool-max-size";
   static final String JMS_CONNECTION_FACTORY_THREAD_POOL_MAX_SIZE = "thread-pool-max-size";
   static final String JMS_CONNECTION_FACTORY_TRANSACTION_BATCH_SIZE = "transaction-batch-size";
   static final String JMS_CONNECTION_FACTORY_CONNECTORS = "connectors";
   static final String JMS_CONNECTION_FACTORY_CONNECTOR = "connector";
   static final String JMS_CONNECTION_FACTORY_AUTO_GROUP = "auto-group";
   static final String JMS_CONNECTION_FACTORY_BLOCK_ON_ACKNOWLEDGE = "block-on-acknowledge";
   static final String JMS_CONNECTION_FACTORY_BLOCK_ON_DURABLE_SEND = "block-on-durable-send";
   static final String JMS_CONNECTION_FACTORY_BLOCK_ON_NON_DURABLE_SEND = "block-on-non-durable-send";
   static final String JMS_CONNECTION_FACTORY_CACHE_LARGE_MESSAGES_CLIENT = "cache-large-messages-client";
   static final String JMS_CONNECTION_FACTORY_COMPRESS_LARGE_MESSAGES = "compress-large-messages";
   static final String JMS_CONNECTION_FACTORY_FAILOVER_ON_INITIAL_CONNECTION = "failover-on-initial-connection";
   static final String JMS_CONNECTION_FACTORY_HA = "ha";
   static final String JMS_CONNECTION_FACTORY_PREACKNOWLEDGE = "preacknowledge";
   static final String JMS_CONNECTION_FACTORY_USE_GLOBAL_POOLS = "use-global-pools";

   static final String JMS_DESTINATIONS = "jms-destinations";
   static final String JMS_DESTINATION = "jms-destination";
   static final String JMS_DESTINATION_NAME = "name";
   static final String JMS_DESTINATION_SELECTOR = "selector";
   static final String JMS_DESTINATION_TYPE = "type";

   static final String JMS_JNDI_ENTRIES = "entries";
   static final String JMS_JNDI_ENTRY = "entry";

   public static final String JNDI_COMPATIBILITY_PREFIX = "java:jboss/exported/";

   static final String NULL = "_AMQ_NULL";
}


text:
#include <af/dim4.hpp>
#include <af/features.h>
#include <Array.hpp>
#include <err_opencl.hpp>
#include <math.hpp>
#include <kernel/orb.hpp>

using af::dim4;
using af::features;

namespace opencl
{

template<typename T, typename convAccT>
unsigned orb(Array<float> &x_out, Array<float> &y_out,
             Array<float> &score_out, Array<float> &ori_out,
             Array<float> &size_out, Array<uint> &desc_out,
             const Array<T>& image,
             const float fast_thr, const unsigned max_feat,
             const float scl_fctr, const unsigned levels,
             const bool blur_img)
{
    unsigned nfeat;

    Param x;
    Param y;
    Param score;
    Param ori;
    Param size;
    Param desc;

    kernel::orb<T,convAccT>(&nfeat, x, y, score, ori, size, desc,
                            image, fast_thr, max_feat, scl_fctr,
                            levels, blur_img);

    if (nfeat > 0) {
        const dim4 out_dims(nfeat);
        const dim4 desc_dims(8, nfeat);

        x_out     = createParamArray<float>(x, true);
        y_out     = createParamArray<float>(y, true);
        score_out = createParamArray<float>(score, true);
        ori_out   = createParamArray<float>(ori, true);
        size_out  = createParamArray<float>(size, true);
        desc_out  = createParamArray<unsigned>(desc, true);
    }

    return nfeat;
}

#define INSTANTIATE(T, convAccT)                                                        \
    template unsigned orb<T, convAccT>(Array<float> &x, Array<float> &y,                \
                                       Array<float> &score, Array<float> &ori,          \
                                       Array<float> &size, Array<uint> &desc,           \
                                       const Array<T>& image,                           \
                                       const float fast_thr, const unsigned max_feat,   \
                                       const float scl_fctr, const unsigned levels,     \
                                       const bool blur_img);

INSTANTIATE(float , float )
INSTANTIATE(double, double)

}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Reflection;
using System.Diagnostics;
using GiTp;

namespace GiTp
{
    class Program {
        private static Commands Z;

        private static Assembly assembly = Assembly.GetExecutingAssembly();
        private static FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
        private static String Version = fileVersionInfo.ProductVersion;
        private static String SolutionName = Assembly.GetCallingAssembly().GetName().Name;

        static void Main(string[] args) {
            Welcome();
            Z = new Commands( args.Length > 0 ? new Command( String.Join(" ", args) ) : null );
            Z.Run();
        }

        static void Welcome()
        {
            Console.WriteLine(SolutionName + " ~ [Versão " + Version + "]");
            Console.WriteLine();

        }

    }
}


text:
package org.sagebionetworks.repo.model.dbo.dao.table;

import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_ID_SEQUENCE;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_ID_SEQUENCE_TABLE_ID;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_TABLE_ROW_KEY_NEW;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_TABLE_ROW_TABLE_ETAG;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_TABLE_ROW_TABLE_ID;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_TABLE_ROW_TRX_ID;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_TABLE_ROW_TYPE;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_TABLE_ROW_VERSION;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_TABLE_TRX_TO_VER_TRX_ID;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.COL_TABLE_TRX_TO_VER_VER_NUM;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.TABLE_ROW_CHANGE;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.TABLE_TABLE_ID_SEQUENCE;
import static org.sagebionetworks.repo.model.query.jdo.SqlConstants.TABLE_TABLE_TRX_TO_VERSION;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Optional;
import java.util.UUID;

import org.sagebionetworks.aws.SynapseS3Client;
import org.sagebionetworks.repo.model.dao.table.TableRowTruthDAO;
import org.sagebionetworks.repo.model.dbo.DBOBasicDao;
import org.sagebionetworks.repo.model.dbo.persistence.table.ColumnModelUtils;
import org.sagebionetworks.repo.model.dbo.persistence.table.DBOTableIdSequence;
import org.sagebionetworks.repo.model.dbo.persistence.table.DBOTableRowChange;
import org.sagebionetworks.repo.model.entity.IdAndVersion;
import org.sagebionetworks.repo.model.jdo.KeyFactory;
import org.sagebionetworks.repo.model.table.ColumnChange;
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.repo.model.table.IdRange;
import org.sagebionetworks.repo.model.table.SparseChangeSetDto;
import org.sagebionetworks.repo.model.table.TableChangeType;
import org.sagebionetworks.repo.model.table.TableRowChange;
import org.sagebionetworks.repo.transactions.WriteTransaction;
import org.sagebionetworks.repo.web.NotFoundException;
import org.sagebionetworks.table.cluster.utils.TableModelUtils;
import org.sagebionetworks.util.FileProvider;
import org.sagebionetworks.util.ValidateArgument;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

import com.amazonaws.services.s3.model.S3Object;

/**
 * Basic S3 & RDS implementation of the TableRowTruthDAO.
 *
 * @author John
 *
 */
public class TableRowTruthDAOImpl implements TableRowTruthDAO {

	private static final String SELECT_FIRST_ROW_VERSION_FOR_TABLE = "SELECT " + COL_TABLE_ROW_VERSION + " FROM "
			+ TABLE_ROW_CHANGE + " WHERE " + COL_TABLE_ROW_TYPE + " = ? AND TABLE_ID = ? LIMIT 1";

	private static final String SELECT_LAST_TRANSACTION_ID = "SELECT " + COL_TABLE_ROW_TRX_ID + " FROM "
			+ TABLE_ROW_CHANGE + " WHERE " + COL_TABLE_ROW_TABLE_ID + " = ? ORDER BY " + COL_TABLE_ROW_VERSION
			+ " DESC LIMIT 1";

	private static final String SQL_LAST_CHANGE_NUMBER = "SELECT MAX(" + COL_TABLE_ROW_VERSION + ") FROM "
			+ TABLE_ROW_CHANGE + " WHERE " + COL_TABLE_ROW_TABLE_ID + " = ?";

	private static final String SQL_LAST_CHANGE_NUMBER_FOR_VERSION = "SELECT MAX(" + COL_TABLE_ROW_VERSION + ") FROM "
			+ TABLE_ROW_CHANGE + " C JOIN " + TABLE_TABLE_TRX_TO_VERSION + " V ON (C." + COL_TABLE_ROW_TRX_ID + " = V."
			+ COL_TABLE_TRX_TO_VER_TRX_ID + ") WHERE C." + COL_TABLE_ROW_TABLE_ID + " = ? AND V."
			+ COL_TABLE_TRX_TO_VER_VER_NUM + " = ?";

	public static final String SCAN_ROWS_TYPE_ERROR = "Can only scan over table changes of type: "
			+ TableChangeType.ROW;

	private static final String SQL_SELECT_VERSION_FOR_ETAG = "SELECT " + COL_TABLE_ROW_VERSION + " FROM "
			+ TABLE_ROW_CHANGE + " WHERE " + COL_TABLE_ROW_TABLE_ID + " = ? AND " + COL_TABLE_ROW_TABLE_ETAG + " = ? ";
	private static final String SQL_SELECT_MAX_ROWID = "SELECT " + COL_ID_SEQUENCE + " FROM " + TABLE_TABLE_ID_SEQUENCE
			+ " WHERE " + COL_ID_SEQUENCE_TABLE_ID + " = ?";

	private static final String SQL_SELECT_LAST_ROW_CHANGE_FOR_TABLE = "SELECT * FROM " + TABLE_ROW_CHANGE + " WHERE "
			+ COL_TABLE_ROW_TABLE_ID + " = ? ORDER BY " + COL_TABLE_ROW_VERSION + " DESC LIMIT 1";

	private static final String SQL_SELECT_LAST_ROW_CHANGE_FOR_TABLE_WITH_TYPE = "SELECT * FROM " + TABLE_ROW_CHANGE
			+ " WHERE " + COL_TABLE_ROW_TABLE_ID + " = ? AND " + COL_TABLE_ROW_TYPE + " = ? ORDER BY "
			+ COL_TABLE_ROW_VERSION + " DESC LIMIT 1";

	private static final String SQL_SELECT_ROW_CHANGE_FOR_TABLE_AND_VERSION = "SELECT * FROM " + TABLE_ROW_CHANGE
			+ " WHERE " + COL_TABLE_ROW_TABLE_ID + " = ? AND " + COL_TABLE_ROW_VERSION + " = ?";

	private static final String SQL_LIST_ALL_KEYS = "SELECT " + COL_TABLE_ROW_KEY_NEW + " FROM " + TABLE_ROW_CHANGE
			+ " WHERE " + COL_TABLE_ROW_KEY_NEW + " IS NOT NULL" + " UNION SELECT " + COL_TABLE_ROW_KEY_NEW + " FROM "
			+ TABLE_ROW_CHANGE + " WHERE " + COL_TABLE_ROW_KEY_NEW + " IS NOT NULL";

	private static final String SQL_LIST_ALL_KEYS_FOR_TABLE = "SELECT " + COL_TABLE_ROW_KEY_NEW + " FROM "
			+ TABLE_ROW_CHANGE + " WHERE " + COL_TABLE_ROW_KEY_NEW + " IS NOT NULL AND " + COL_TABLE_ROW_TABLE_ID
			+ " = ?";

	private static final String SQL_SELECT_ALL_ROW_CHANGES_FOR_TABLE = "SELECT * FROM " + TABLE_ROW_CHANGE + " WHERE "
			+ COL_TABLE_ROW_TABLE_ID + " = ? ORDER BY " + COL_TABLE_ROW_VERSION + " ASC LIMIT ? OFFSET ?";

	private static final String SQL_ALL_ROW_CHANGES_FOR_TABLE_GREATER_VERSION_BASE = "FROM " + TABLE_ROW_CHANGE
			+ " WHERE " + COL_TABLE_ROW_TABLE_ID + " = ? AND " + COL_TABLE_ROW_VERSION + " > ? AND "
			+ COL_TABLE_ROW_TYPE + " = '" + TableChangeType.ROW + "' ORDER BY " + COL_TABLE_ROW_VERSION + " ASC";

	private static final String SQL_SELECT_ALL_ROW_CHANGES_FOR_TABLE_GREATER_VERSION = "SELECT * "
			+ SQL_ALL_ROW_CHANGES_FOR_TABLE_GREATER_VERSION_BASE;

	private static final String SQL_DELETE_ROW_DATA_FOR_TABLE = "DELETE FROM " + TABLE_TABLE_ID_SEQUENCE + " WHERE "
			+ COL_ID_SEQUENCE_TABLE_ID + " = ?";
	private static final String KEY_TEMPLATE = "%1$s.csv.gz";
	private static final String SQL_TRUNCATE_SEQUENCE_TABLE = "DELETE FROM " + TABLE_TABLE_ID_SEQUENCE + " WHERE "
			+ COL_ID_SEQUENCE_TABLE_ID + " > 0";
	private static final String SQL_SELECT_SEQUENCE_FOR_UPDATE = "SELECT * FROM " + TABLE_TABLE_ID_SEQUENCE + " WHERE "
			+ COL_ID_SEQUENCE_TABLE_ID + " = ? FOR UPDATE";
	@Autowired
	private DBOBasicDao basicDao;
	@Autowired
	private JdbcTemplate jdbcTemplate;
	@Autowired
	private SynapseS3Client s3Client;
	@Autowired
	private FileProvider fileProvider;

	private String s3Bucket;

	RowMapper<DBOTableIdSequence> sequenceRowMapper = new DBOTableIdSequence().getTableMapping();
	RowMapper<DBOTableRowChange> rowChangeMapper = new DBOTableRowChange().getTableMapping();

	@WriteTransaction
	@Override
	public IdRange reserveIdsInRange(String tableIdString, long countToReserver) {
		if (tableIdString == null)
			throw new IllegalArgumentException("TableId cannot be null");
		long tableId = KeyFactory.stringToKey(tableIdString);

		// Setup the dbo
		DBOTableIdSequence dbo = null;
		boolean exists = false;
		// If this table already exists, lock the row and get the current value.
		Long currentSequence;
		Long currentVersion;
		try {
			// First lock row for this table
			dbo = jdbcTemplate.queryForObject(SQL_SELECT_SEQUENCE_FOR_UPDATE, sequenceRowMapper, tableId);
			currentSequence = dbo.getSequence();
			currentVersion = dbo.getVersionNumber();
			exists = true;
		} catch (EmptyResultDataAccessException e) {
			// This table does not exist yet
			currentSequence = -1l;
			currentVersion = -1l;
			exists = false;
		}
		// Create the new values
		dbo = new DBOTableIdSequence();
		dbo.setSequence(currentSequence + countToReserver);
		dbo.setTableId(tableId);
		dbo.setEtag(UUID.randomUUID().toString());
		dbo.setVersionNumber(currentVersion + 1);
		// create or update
		if (exists) {
			// update
			basicDao.update(dbo);
		} else {
			// create
			basicDao.createNew(dbo);
		}
		// Prepare the results
		IdRange range = new IdRange();
		if (countToReserver > 0) {
			range.setMaximumId(dbo.getSequence());
			range.setMinimumId(dbo.getSequence() - countToReserver + 1);
		}
		range.setMaximumUpdateId(currentSequence);
		range.setVersionNumber(dbo.getVersionNumber());
		range.setEtag(dbo.getEtag());
		return range;
	}

	@WriteTransaction
	@Override
	public String appendRowSetToTable(String userId, String tableId, String etag, long versionNumber,
			List<ColumnModel> columns, final SparseChangeSetDto delta, long transactionId) {
		// Write the delta to S3
		String key = saveToS3((OutputStream out) -> TableModelUtils.writeSparesChangeSetToGz(delta, out));
		// record the change
		DBOTableRowChange changeDBO = new DBOTableRowChange();
		changeDBO.setTableId(KeyFactory.stringToKey(tableId));
		changeDBO.setRowVersion(versionNumber);
		changeDBO.setEtag(etag);
		changeDBO.setCreatedBy(Long.parseLong(userId));
		changeDBO.setCreatedOn(System.currentTimeMillis());
		changeDBO.setKeyNew(key);
		changeDBO.setBucket(s3Bucket);
		changeDBO.setRowCount(new Long(delta.getRows().size()));
		changeDBO.setChangeType(TableChangeType.ROW.name());
		changeDBO.setTransactionId(transactionId);
		basicDao.createNew(changeDBO);
		return key;
	}

	@Override
	public long appendSchemaChangeToTable(String userId, String tableId, List<String> current,
			final List<ColumnChange> changes, long transactionId) {

		long coutToReserver = 1;
		IdRange range = reserveIdsInRange(tableId, coutToReserver);
		// We are ready to convert the file to a CSV and save it to S3.
		String key = saveToS3((OutputStream out) -> ColumnModelUtils.writeSchemaChangeToGz(changes, out));
		// record the change
		DBOTableRowChange changeDBO = new DBOTableRowChange();
		changeDBO.setTableId(KeyFactory.stringToKey(tableId));
		changeDBO.setRowVersion(range.getVersionNumber());
		changeDBO.setEtag(range.getEtag());
		changeDBO.setColumnIds(TableModelUtils.createDelimitedColumnModelIdString(current));
		changeDBO.setCreatedBy(Long.parseLong(userId));
		changeDBO.setCreatedOn(System.currentTimeMillis());
		changeDBO.setKeyNew(key);
		changeDBO.setBucket(s3Bucket);
		changeDBO.setRowCount(0L);
		changeDBO.setChangeType(TableChangeType.COLUMN.name());
		changeDBO.setTransactionId(transactionId);
		basicDao.createNew(changeDBO);
		return range.getVersionNumber();
	}

	/**
	 * Write the data from the given callback to S3.
	 *
	 * @param callback
	 * @return
	 * @throws IOException
	 */
	String saveToS3(WriterCallback callback) {
		// First write to a temp file.
		try {
			File temp = fileProvider.createTempFile("tempToS3", ".gz");
			try (OutputStream out = fileProvider.createFileOutputStream(temp);) {
				// write to the temp file.
				callback.write(out);
				out.flush();
				out.close();
				// upload it to S3.
				String key = String.format(KEY_TEMPLATE, UUID.randomUUID().toString());
				s3Client.putObject(s3Bucket, key, temp);
				return key;
			} finally {
				if (temp != null) {
					temp.delete();
				}
			}
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public List<ColumnChange> getSchemaChangeForVersion(String tableId, long versionNumber) throws IOException {
		TableRowChange dto = getTableRowChange(tableId, versionNumber);
		// Download the file from S3
		S3Object object = s3Client.getObject(dto.getBucket(), dto.getKeyNew());
		try {
			return ColumnModelUtils.readSchemaChangeFromGz(object.getObjectContent());
		} finally {
			// Need to close the stream unconditionally.
			object.getObjectContent().close();
		}
	}

	@Override
	public long getVersionForEtag(String tableIdString, String etag) {
		if (tableIdString == null)
			throw new IllegalArgumentException("TableId cannot be null");
		long tableId = KeyFactory.stringToKey(tableIdString);
		try {
			return jdbcTemplate.queryForObject(SQL_SELECT_VERSION_FOR_ETAG, new RowMapper<Long>() {
				@Override
				public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
					return rs.getLong(COL_TABLE_ROW_VERSION);
				}
			}, tableId, etag);
		} catch (EmptyResultDataAccessException e) {
			throw new IllegalArgumentException("Invalid etag: " + etag);
		}
	}

	@Override
	public long getMaxRowId(String tableIdString) {
		if (tableIdString == null)
			throw new IllegalArgumentException("TableId cannot be null");
		long tableId = KeyFactory.stringToKey(tableIdString);
		try {
			return jdbcTemplate.queryForObject(SQL_SELECT_MAX_ROWID, Long.class, tableId);
		} catch (EmptyResultDataAccessException e) {
			// presumably, no rows have been added yet
			return -1L;
		}
	}

	@Override
	public TableRowChange getLastTableRowChange(String tableIdString) {
		if (tableIdString == null)
			throw new IllegalArgumentException("TableId cannot be null");
		long tableId = KeyFactory.stringToKey(tableIdString);
		try {
			DBOTableRowChange dbo = jdbcTemplate.queryForObject(SQL_SELECT_LAST_ROW_CHANGE_FOR_TABLE, rowChangeMapper,
					tableId);
			return TableRowChangeUtils.ceateDTOFromDBO(dbo);
		} catch (EmptyResultDataAccessException e) {
			// presumably, no rows have been added yet
			return null;
		}
	}

	@Override
	public TableRowChange getLastTableRowChange(String tableIdString, TableChangeType changeType) {
		ValidateArgument.required(tableIdString, "tableId");
		ValidateArgument.required(changeType, "TableChangeType");
		long tableId = KeyFactory.stringToKey(tableIdString);
		try {
			DBOTableRowChange dbo = jdbcTemplate.queryForObject(SQL_SELECT_LAST_ROW_CHANGE_FOR_TABLE_WITH_TYPE,
					rowChangeMapper, tableId, changeType.name());
			return TableRowChangeUtils.ceateDTOFromDBO(dbo);
		} catch (EmptyResultDataAccessException e) {
			// presumably, no rows have been added yet
			return null;
		}
	}

	/**
	 * List all changes for this table.
	 */
	@Deprecated
	@Override
	public List<TableRowChange> listRowSetsKeysForTable(String tableIdString) {
		long limit = Long.MAX_VALUE;
		long offset = 0L;
		return getTableChangePage(tableIdString, limit, offset);
	}

	@Override
	public List<TableRowChange> listRowSetsKeysForTableGreaterThanVersion(String tableIdString, long versionNumber) {
		if (tableIdString == null)
			throw new IllegalArgumentException("TableId cannot be null");
		long tableId = KeyFactory.stringToKey(tableIdString);
		List<DBOTableRowChange> dboList = jdbcTemplate.query(SQL_SELECT_ALL_ROW_CHANGES_FOR_TABLE_GREATER_VERSION,
				rowChangeMapper, tableId, versionNumber);
		return TableRowChangeUtils.ceateDTOFromDBO(dboList);
	}

	@Override
	public TableRowChange getTableRowChange(String tableIdString, long rowVersion) throws NotFoundException {
		if (tableIdString == null)
			throw new IllegalArgumentException("TableID cannot be null");
		long tableId = KeyFactory.stringToKey(tableIdString);
		try {
			DBOTableRowChange dbo = jdbcTemplate.queryForObject(SQL_SELECT_ROW_CHANGE_FOR_TABLE_AND_VERSION,
					rowChangeMapper, tableId, rowVersion);
			return TableRowChangeUtils.ceateDTOFromDBO(dbo);
		} catch (EmptyResultDataAccessException e) {
			throw new NotFoundException(
					"TableRowChange does not exist for tableId: " + tableId + " and row version: " + rowVersion);
		}
	}

	@Override
	public SparseChangeSetDto getRowSet(String tableId, long rowVersion) throws IOException {
		TableRowChange dto = getTableRowChange(tableId, rowVersion);
		return getRowSet(dto);
	}

	@Override
	public SparseChangeSetDto getRowSet(TableRowChange dto) throws IOException {
		// Download the file from S3
		S3Object object = s3Client.getObject(dto.getBucket(), dto.getKeyNew());
		try {
			return TableModelUtils.readSparseChangeSetDtoFromGzStream(object.getObjectContent());
		} finally {
			// Need to close the stream unconditionally.
			object.getObjectContent().close();
		}
	}

	@Override
	public void deleteAllRowDataForTable(String tableId) {
		// List key so we can delete them
		List<String> keysToDelete = listAllKeysForTable(tableId);
		// Delete each object from S3
		for (String key : keysToDelete) {
			s3Client.deleteObject(s3Bucket, key);
		}
		// let cascade delete take care of deleting the row changes
		jdbcTemplate.update(SQL_DELETE_ROW_DATA_FOR_TABLE, KeyFactory.stringToKey(tableId));
	}

	@Override
	public void truncateAllRowData() {
		// List key so we can delete them
		List<String> keysToDelete = listAllKeys();
		// Delete each object from S3
		for (String key : keysToDelete) {
			s3Client.deleteObject(s3Bucket, key);
		}
		jdbcTemplate.update(SQL_TRUNCATE_SEQUENCE_TABLE);
	}

	/**
	 * List all of the S3 Keys
	 *
	 * @return
	 */
	private List<String> listAllKeys() {
		return jdbcTemplate.query(SQL_LIST_ALL_KEYS, new RowMapper<String>() {
			@Override
			public String mapRow(ResultSet rs, int rowNum) throws SQLException {
				return rs.getString(COL_TABLE_ROW_KEY_NEW);
			}
		});
	}

	/**
	 * List all of the S3 Keys for a table
	 *
	 * @return
	 */
	private List<String> listAllKeysForTable(String tableId) {
		long tableIdLong = KeyFactory.stringToKey(tableId);
		return jdbcTemplate.query(SQL_LIST_ALL_KEYS_FOR_TABLE, new RowMapper<String>() {
			@Override
			public String mapRow(ResultSet rs, int rowNum) throws SQLException {
				return rs.getString(COL_TABLE_ROW_KEY_NEW);
			}
		}, tableIdLong);
	}

	public String getS3Bucket() {
		return s3Bucket;
	}

	/**
	 * IoC
	 *
	 * @param s3Bucket
	 */
	public void setS3Bucket(String s3Bucket) {
		this.s3Bucket = s3Bucket;
	}

	@Override
	public List<TableRowChange> getTableChangePage(String tableIdString, long limit, long offset) {
		ValidateArgument.required(tableIdString, "tableId");
		long tableId = KeyFactory.stringToKey(tableIdString);
		List<DBOTableRowChange> dboList = jdbcTemplate.query(SQL_SELECT_ALL_ROW_CHANGES_FOR_TABLE, rowChangeMapper,
				tableId, limit, offset);
		return TableRowChangeUtils.ceateDTOFromDBO(dboList);
	}

	@Override
	public Optional<Long> getLastTableChangeNumber(long tableId) {
		Long changeNumber = this.jdbcTemplate.queryForObject(SQL_LAST_CHANGE_NUMBER, Long.class, tableId);
		return Optional.ofNullable(changeNumber);
	}

	@Override
	public Optional<Long> getLastTableChangeNumber(long tableId, long tableVersion) {
		Long changeNumber = this.jdbcTemplate.queryForObject(SQL_LAST_CHANGE_NUMBER_FOR_VERSION, Long.class, tableId,
				tableVersion);
		return Optional.ofNullable(changeNumber);
	}

	@Override
	public boolean hasAtLeastOneChangeOfType(String tableIdString, TableChangeType type) {
		ValidateArgument.required(tableIdString, "tableId");
		ValidateArgument.required(type, "TableChangeType");
		try {
			long tableId = KeyFactory.stringToKey(tableIdString);
			Long firstRowVersion = jdbcTemplate.queryForObject(SELECT_FIRST_ROW_VERSION_FOR_TABLE, Long.class,
					type.name(), tableId);
			return firstRowVersion != null;
		} catch (EmptyResultDataAccessException e) {
			return false;
		}
	}

	@Override
	public Optional<Long> getLastTransactionId(String tableIdString) {
		ValidateArgument.required(tableIdString, "tableId");
		try {
			long tableId = KeyFactory.stringToKey(tableIdString);
			Long transactionId = jdbcTemplate.queryForObject(SELECT_LAST_TRANSACTION_ID, Long.class, tableId);
			return Optional.of(transactionId);
		} catch (EmptyResultDataAccessException e) {
			return Optional.empty();
		}
	}

	@WriteTransaction
	@Override
	public void deleteChangeNumber(String tableIdString, long changeNumber) {
		ValidateArgument.required(tableIdString, "tableId");
		long tableId = KeyFactory.stringToKey(tableIdString);
		jdbcTemplate.update("DELETE FROM " + TABLE_ROW_CHANGE + " WHERE " + COL_TABLE_ROW_TABLE_ID + " = ? AND "
				+ COL_TABLE_ROW_VERSION + " = ?", tableId, changeNumber);
	}

	@Override
	public boolean isEtagInTablesChangeHistory(String tableIdString, String etag) {
		ValidateArgument.required(tableIdString, "tableId");
		ValidateArgument.required(etag, "etag");
		long tableId = KeyFactory.stringToKey(tableIdString);
		try {
			jdbcTemplate.queryForObject(
					"SELECT " + COL_TABLE_ROW_TABLE_ETAG + " FROM " + TABLE_ROW_CHANGE + " WHERE "
							+ COL_TABLE_ROW_TABLE_ID + " = ? AND " + COL_TABLE_ROW_TABLE_ETAG + " = ?",
					String.class, tableId, etag);
			return true;
		} catch (EmptyResultDataAccessException e) {
			return false;
		}
	}

}


text:
#pragma once

#include "fence.h"
#include "omg/core/tools/tools.h"

namespace omg {
namespace sync {

template<typename T>
class msg{
	T data;
	double sent;
	double received;
	double handled;
	fence receivedFlag;
	fence handledFlag;
public:
	msg(T news):data(news), sent(tools::getmsd()), received(0), handled(0){}

	// recipient tools
	T get(){
		received = tools::getmsd()-sent;
		receivedFlag.pass();
		return data;
	}
	void markAsHandled(){
		handled = tools::getmsd()-sent;
		handledFlag.pass();
	}

	// sender tools
	double assertReceived() {
		receivedFlag.wait();
		return received;
	}
	double assertHandled() {
		handledFlag.wait();
		return handled;
	}
};

}  // namespace sync
}  // namespace omg


text:
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using FluentAssertions;
using JsonApiDotNetCore.Serialization.Objects;
using Microsoft.EntityFrameworkCore;
using TestBuildingBlocks;
using Xunit;

namespace JsonApiDotNetCoreTests.IntegrationTests.IdObfuscation
{
    public sealed class IdObfuscationTests : IClassFixture<IntegrationTestContext<TestableStartup<ObfuscationDbContext>, ObfuscationDbContext>>
    {
        private readonly IntegrationTestContext<TestableStartup<ObfuscationDbContext>, ObfuscationDbContext> _testContext;
        private readonly ObfuscationFakers _fakers = new();

        public IdObfuscationTests(IntegrationTestContext<TestableStartup<ObfuscationDbContext>, ObfuscationDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController<BankAccountsController>();
            testContext.UseController<DebitCardsController>();
        }

        [Fact]
        public async Task Can_filter_equality_in_primary_resources()
        {
            // Arrange
            List<BankAccount> accounts = _fakers.BankAccount.Generate(2);

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                await dbContext.ClearTableAsync<BankAccount>();
                dbContext.BankAccounts.AddRange(accounts);
                await dbContext.SaveChangesAsync();
            });

            string route = $"/bankAccounts?filter=equals(id,'{accounts[1].StringId}')";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync<Document>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.OK);

            responseDocument.Data.ManyValue.Should().HaveCount(1);
            responseDocument.Data.ManyValue[0].Id.Should().Be(accounts[1].StringId);
        }

        [Fact]
        public async Task Can_filter_any_in_primary_resources()
        {
            // Arrange
            List<BankAccount> accounts = _fakers.BankAccount.Generate(2);

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                await dbContext.ClearTableAsync<BankAccount>();
                dbContext.BankAccounts.AddRange(accounts);
                await dbContext.SaveChangesAsync();
            });

            var codec = new HexadecimalCodec();
            string route = $"/bankAccounts?filter=any(id,'{accounts[1].StringId}','{codec.Encode(Unknown.TypedId.Int32)}')";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync<Document>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.OK);

            responseDocument.Data.ManyValue.Should().HaveCount(1);
            responseDocument.Data.ManyValue[0].Id.Should().Be(accounts[1].StringId);
        }

        [Fact]
        public async Task Cannot_get_primary_resource_for_invalid_ID()
        {
            // Arrange
            const string route = "/bankAccounts/not-a-hex-value";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync<Document>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.BadRequest);

            responseDocument.Errors.Should().HaveCount(1);

            ErrorObject error = responseDocument.Errors[0];
            error.StatusCode.Should().Be(HttpStatusCode.BadRequest);
            error.Title.Should().Be("Invalid ID value.");
            error.Detail.Should().Be("The value 'not-a-hex-value' is not a valid hexadecimal value.");
        }

        [Fact]
        public async Task Can_get_primary_resource_by_ID()
        {
            // Arrange
            DebitCard card = _fakers.DebitCard.Generate();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.DebitCards.Add(card);
                await dbContext.SaveChangesAsync();
            });

            string route = $"/debitCards/{card.StringId}";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync<Document>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.OK);

            responseDocument.Data.SingleValue.Should().NotBeNull();
            responseDocument.Data.SingleValue.Id.Should().Be(card.StringId);
        }

        [Fact]
        public async Task Can_get_secondary_resources()
        {
            // Arrange
            BankAccount account = _fakers.BankAccount.Generate();
            account.Cards = _fakers.DebitCard.Generate(2);

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.BankAccounts.Add(account);
                await dbContext.SaveChangesAsync();
            });

            string route = $"/bankAccounts/{account.StringId}/cards";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync<Document>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.OK);

            responseDocument.Data.ManyValue.Should().HaveCount(2);
            responseDocument.Data.ManyValue[0].Id.Should().Be(account.Cards[0].StringId);
            responseDocument.Data.ManyValue[1].Id.Should().Be(account.Cards[1].StringId);
        }

        [Fact]
        public async Task Can_include_resource_with_sparse_fieldset()
        {
            // Arrange
            BankAccount account = _fakers.BankAccount.Generate();
            account.Cards = _fakers.DebitCard.Generate(1);

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.BankAccounts.Add(account);
                await dbContext.SaveChangesAsync();
            });

            string route = $"/bankAccounts/{account.StringId}?include=cards&fields[debitCards]=ownerName";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync<Document>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.OK);

            responseDocument.Data.SingleValue.Should().NotBeNull();
            responseDocument.Data.SingleValue.Id.Should().Be(account.StringId);

            responseDocument.Included.Should().HaveCount(1);
            responseDocument.Included[0].Id.Should().Be(account.Cards[0].StringId);
            responseDocument.Included[0].Attributes.Should().HaveCount(1);
            responseDocument.Included[0].Relationships.Should().BeNull();
        }

        [Fact]
        public async Task Can_get_relationship()
        {
            // Arrange
            BankAccount account = _fakers.BankAccount.Generate();
            account.Cards = _fakers.DebitCard.Generate(1);

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.BankAccounts.Add(account);
                await dbContext.SaveChangesAsync();
            });

            string route = $"/bankAccounts/{account.StringId}/relationships/cards";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync<Document>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.OK);

            responseDocument.Data.ManyValue.Should().HaveCount(1);
            responseDocument.Data.ManyValue[0].Id.Should().Be(account.Cards[0].StringId);
        }

        [Fact]
        public async Task Can_create_resource_with_relationship()
        {
            // Arrange
            BankAccount existingAccount = _fakers.BankAccount.Generate();
            DebitCard newCard = _fakers.DebitCard.Generate();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.BankAccounts.Add(existingAccount);
                await dbContext.SaveChangesAsync();
            });

            var requestBody = new
            {
                data = new
                {
                    type = "debitCards",
                    attributes = new
                    {
                        ownerName = newCard.OwnerName,
                        pinCode = newCard.PinCode
                    },
                    relationships = new
                    {
                        account = new
                        {
                            data = new
                            {
                                type = "bankAccounts",
                                id = existingAccount.StringId
                            }
                        }
                    }
                }
            };

            const string route = "/debitCards";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecutePostAsync<Document>(route, requestBody);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.Created);

            responseDocument.Data.SingleValue.Attributes["ownerName"].Should().Be(newCard.OwnerName);
            responseDocument.Data.SingleValue.Attributes["pinCode"].Should().Be(newCard.PinCode);

            var codec = new HexadecimalCodec();
            int newCardId = codec.Decode(responseDocument.Data.SingleValue.Id);

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                DebitCard cardInDatabase = await dbContext.DebitCards.Include(card => card.Account).FirstWithIdAsync(newCardId);

                cardInDatabase.OwnerName.Should().Be(newCard.OwnerName);
                cardInDatabase.PinCode.Should().Be(newCard.PinCode);

                cardInDatabase.Account.Should().NotBeNull();
                cardInDatabase.Account.Id.Should().Be(existingAccount.Id);
                cardInDatabase.Account.StringId.Should().Be(existingAccount.StringId);
            });
        }

        [Fact]
        public async Task Can_update_resource_with_relationship()
        {
            // Arrange
            BankAccount existingAccount = _fakers.BankAccount.Generate();
            existingAccount.Cards = _fakers.DebitCard.Generate(1);

            DebitCard existingCard = _fakers.DebitCard.Generate();

            string newIban = _fakers.BankAccount.Generate().Iban;

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.AddInRange(existingAccount, existingCard);
                await dbContext.SaveChangesAsync();
            });

            var requestBody = new
            {
                data = new
                {
                    type = "bankAccounts",
                    id = existingAccount.StringId,
                    attributes = new
                    {
                        iban = newIban
                    },
                    relationships = new
                    {
                        cards = new
                        {
                            data = new[]
                            {
                                new
                                {
                                    type = "debitCards",
                                    id = existingCard.StringId
                                }
                            }
                        }
                    }
                }
            };

            string route = $"/bankAccounts/{existingAccount.StringId}";

            // Act
            (HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecutePatchAsync<string>(route, requestBody);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);

            responseDocument.Should().BeEmpty();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                BankAccount accountInDatabase = await dbContext.BankAccounts.Include(account => account.Cards).FirstWithIdAsync(existingAccount.Id);

                accountInDatabase.Iban.Should().Be(newIban);

                accountInDatabase.Cards.Should().HaveCount(1);
                accountInDatabase.Cards[0].Id.Should().Be(existingCard.Id);
                accountInDatabase.Cards[0].StringId.Should().Be(existingCard.StringId);
            });
        }

        [Fact]
        public async Task Can_add_to_ToMany_relationship()
        {
            // Arrange
            BankAccount existingAccount = _fakers.BankAccount.Generate();
            existingAccount.Cards = _fakers.DebitCard.Generate(1);

            DebitCard existingDebitCard = _fakers.DebitCard.Generate();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.AddInRange(existingAccount, existingDebitCard);
                await dbContext.SaveChangesAsync();
            });

            var requestBody = new
            {
                data = new[]
                {
                    new
                    {
                        type = "debitCards",
                        id = existingDebitCard.StringId
                    }
                }
            };

            string route = $"/bankAccounts/{existingAccount.StringId}/relationships/cards";

            // Act
            (HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecutePostAsync<string>(route, requestBody);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);

            responseDocument.Should().BeEmpty();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                BankAccount accountInDatabase = await dbContext.BankAccounts.Include(account => account.Cards).FirstWithIdAsync(existingAccount.Id);

                accountInDatabase.Cards.Should().HaveCount(2);
            });
        }

        [Fact]
        public async Task Can_remove_from_ToMany_relationship()
        {
            // Arrange
            BankAccount existingAccount = _fakers.BankAccount.Generate();
            existingAccount.Cards = _fakers.DebitCard.Generate(2);

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.BankAccounts.Add(existingAccount);
                await dbContext.SaveChangesAsync();
            });

            var requestBody = new
            {
                data = new[]
                {
                    new
                    {
                        type = "debitCards",
                        id = existingAccount.Cards[0].StringId
                    }
                }
            };

            string route = $"/bankAccounts/{existingAccount.StringId}/relationships/cards";

            // Act
            (HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecuteDeleteAsync<string>(route, requestBody);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);

            responseDocument.Should().BeEmpty();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                BankAccount accountInDatabase = await dbContext.BankAccounts.Include(account => account.Cards).FirstWithIdAsync(existingAccount.Id);

                accountInDatabase.Cards.Should().HaveCount(1);
            });
        }

        [Fact]
        public async Task Can_delete_resource()
        {
            // Arrange
            BankAccount existingAccount = _fakers.BankAccount.Generate();
            existingAccount.Cards = _fakers.DebitCard.Generate(1);

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.BankAccounts.Add(existingAccount);
                await dbContext.SaveChangesAsync();
            });

            string route = $"/bankAccounts/{existingAccount.StringId}";

            // Act
            (HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecuteDeleteAsync<string>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);

            responseDocument.Should().BeEmpty();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                BankAccount accountInDatabase = await dbContext.BankAccounts.Include(account => account.Cards).FirstWithIdOrDefaultAsync(existingAccount.Id);

                accountInDatabase.Should().BeNull();
            });
        }

        [Fact]
        public async Task Cannot_delete_unknown_resource()
        {
            // Arrange
            var codec = new HexadecimalCodec();
            string stringId = codec.Encode(Unknown.TypedId.Int32);

            string route = $"/bankAccounts/{stringId}";

            // Act
            (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteDeleteAsync<Document>(route);

            // Assert
            httpResponse.Should().HaveStatusCode(HttpStatusCode.NotFound);

            responseDocument.Errors.Should().HaveCount(1);

            ErrorObject error = responseDocument.Errors[0];
            error.StatusCode.Should().Be(HttpStatusCode.NotFound);
            error.Title.Should().Be("The requested resource does not exist.");
            error.Detail.Should().Be($"Resource of type 'bankAccounts' with ID '{stringId}' does not exist.");
        }
    }
}


text:
package ar.com.javacuriosities.servlets.filters;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class AuthenticationFilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

        System.out.println("Authentication Filter - Inicio");

        // Obtenemos nombre de usuario
        String userName = request.getParameter("txtName");

        System.out.println("El usuario es:" + userName);
        if ("CosmeFulanito".equals(userName)) {
            ((HttpServletResponse) response).sendError(HttpServletResponse.SC_FORBIDDEN, "Usted no tiene permisos");
        }
        chain.doFilter(request, response);

        System.out.println("Authentication Filter - Fin");
    }

    /**
     * Este método es ejecutado cuando el Filtro se destruye
     */
    @Override
    public void destroy() {
    }

    /**
     * Este método es ejecutado cuando el Filtro se construye
     */
    @Override
    public void init(FilterConfig filterConfig) {
    }
}


text:
from hvad.test_utils.data import DATES_REVERSED, D3
from hvad.test_utils.fixtures import DatesMixin
from hvad.test_utils.testcase import NaniTestCase
from testproject.app.models import Date
import datetime

class LatestTests(NaniTestCase, DatesMixin):
    def test_shared_latest(self):
        latest = Date.objects.language('en').latest('shared_date')
        self.assertEqual(latest.pk, DATES_REVERSED[D3]['shared_date'])

    def test_translated_latest(self):
        latest = Date.objects.language('en').latest('translated_date')
        self.assertEqual(latest.pk, DATES_REVERSED[D3]['translated_date_en'])
        latest = Date.objects.language('ja').latest('translated_date')
        self.assertEqual(latest.pk, DATES_REVERSED[D3]['translated_date_ja'])

class DatesTests(NaniTestCase, DatesMixin):
    def test_objects_dates(self):
        d2011 = datetime.date(year=2011, month=1, day=1)
        self.assertEqual(len(Date.objects.language('en').dates("shared_date", "year")), 2)
        self.assertEqual(len(Date.objects.language('en').dates("shared_date", "month")), 3)
        self.assertEqual(len(Date.objects.language('en').dates("shared_date", "day")), 3)
        self.assertEqual(len(Date.objects.language('en').dates("shared_date", "day").filter(shared_date__gt=d2011)), 2)


text:
using Microsoft.AspNet.SignalR;

namespace Angrlar.Deployit.Web.Hubs
{
    public class BroadcastHub : Hub
    {
    }
}


text:
import Queue
import signal
quit = False
jobs = Queue.Queue()
def handler(signum, frame):
    global quit
    quit = True
    jobs.put({"command":"quit", "error": "SIGINT received", "id": -1})
    raise EOFError

signal.signal(signal.SIGINT, handler)

import json
import curation
import threading, os, sys
os.chdir(os.path.dirname(sys.executable))

# log for debugging
# log = open("log.txt", "a+", buffering=1)

def handle_job():
    global log
    global quit
    while not quit:
        job = jobs.get()
        if job["command"] == "quit":
            if "error" in job:
                result = {
                            "result": "ok",
                            "error": job["error"],
                            "id": job["id"]
                        }
            else:
                result = {
                            "result": "ok",
                            "error": None,
                            "id": job["id"]
                        }
            print json.dumps(result, separators=(',', ': ')) + "\n"
            sys.stdout.flush()
            break
        try:
            function = getattr(curation, job["command"])
            job_result = function(job["arguments"])
            result = {
                        "result": job_result["result"],
                        "error": job_result["error"],
                        "id": job["id"]
                     }
        except Exception as e:
            result = {
                        "result": None,
                        "error": e.message,
                        "id": job["id"]
                     }
        print json.dumps(result, separators=(',', ': ')) + "\n"
        sys.stdout.flush()

threading.Thread(target=handle_job).start()
def loop():
    while not quit:
        jobs.put(json.loads(raw_input()))

try:
    loop()
except Exception as e:
    jobs.put({"command":"quit", "error": "end of file received", "id": -1})


text:
from pyramid.response import Response
from pyramid.security import Everyone

from cornice.cors import ensure_origin

def forbidden_view(request):
    if not request.credentials_id or request.credentials_id == Everyone:
        resp = Response(
            '{"error": "401 Unauthorized",'
            ' "msg": "You must be logged-in to access this page."}',
            status='401 Unauthorized', content_type='application/json')
    else:
        resp = Response(
            '{"error": "403 Forbidden",'
            ' "credentials_id": "%s", "msg": "Access to this resource is '
            'Forbidden."}' % request.credentials_id, status='403 Forbidden',
            content_type='application/json')

    # We need to re-apply the CORS checks done by Cornice, since we're
    # recreating the response from scratch.
    services = request.registry.cornice_services
    pattern = request.matched_route.pattern
    service = services.get(pattern, None)

    request.info['cors_checked'] = False
    resp = ensure_origin(service, request, resp)
    return resp


text:
'use strict';

var uuid = require('node-uuid');
var _ = require('lodash/core');
var url = require('url');

module.exports.generateIds = function (content) {
  if (content.length === 0) {
    return content;
  }
  content.elements.forEach(function (element) {
    element._id = uuid.v4();
  });
  return content;
};

module.exports.calculateResults = function (badge, answers) {
  var results = {};
  badge.content.elements.forEach(function (element) {
    var id = element._id;
    if (typeof element.answer !== 'undefined') {
      var result = false;
      var userAnswer = answers[id];
      if (userAnswer) {
        switch(element.elementType){
          case "quiz-single":
          case "quiz-multiple":
          case "quiz-ordered-list":
            result = isAnswerCorrect(userAnswer, element.answer);
            break;
          case "quiz-short-input":
            result = isShortAnswerCorrect(userAnswer, element.answerKeywords);
            break;
          case "quiz-long-input":
            result = isLongAnswerCorrect(userAnswer, element.wordLimit);
            break;
          case "quiz-list-groups":
            result = isGroupedAnswerCorrect(userAnswer, element.answer);
            break;
          default:
            console.error("Unknown answer type", element.elementType);
            break;
        }
      }
      results[id] = result;
    }
  });
  return results;
};

function isAnswerCorrect(userAnswer, answer) {
  return (userAnswer + '' === answer + '');
}

function isShortAnswerCorrect(userAnswer, answer) {
  var ans = userAnswer.toLowerCase();
  var score = 0;
  var keywordsArray = answer.toLowerCase().replace(" ", "").split(',');
  keywordsArray.forEach(function(word){
    if (ans.indexOf(word) > -1) {
      score++;
    }
  });
  if (score == keywordsArray.length) {
    return true;
  }
  return false;
}

function isLongAnswerCorrect(userAnswer, minNumberOfAnswers) {
  var ans = userAnswer.toLowerCase();
  var words = countWords(ans);
  if (words >= minNumberOfAnswers) {
    return true;
  }
  return false;
}

function isGroupedAnswerCorrect(userAnswers, answers){
  //console.log('\nuserAnswers:\n', userAnswers, '\nanswers:\n', answers);
  var result = true;
  answers.forEach(function(answer){
    var group = answer.group;
    var userAnswer = _.find(userAnswers, function(o) { return o.group === group; });
    var isCorrect = _.isEqual(_.sortBy(answer.items), _.sortBy(userAnswer.items));
    if ( !isCorrect ) {
      result = false;
    }
  });
  return result;
}

function countWords(s){
    if(!s){
      return 0;
    }
    s = s.replace(/(^\s*)|(\s*$)/gi,"");//exclude  start and end white-space
    s = s.replace(/[ ]{2,}/gi," ");//2 or more space to 1
    s = s.replace(/\n /,"\n"); // exclude newline with a start spacing
    return s.split(' ').length;
}

module.exports.replacePathEnding = function (path, ending) {
  var pathname = url.parse(path).pathname;
  var split = pathname.split('/');
  split.pop();
  if (ending) {
    split.push(ending);
  }
  return split.length > 1 ? split.join('/') : '/';
};


text:
$('.delete-button').on('click', function(e){
    var idArticle = $(this).parent().parent().find('th').html();
    var nameArticle = $(this).parent().find('a').html();
    $('#deleteArticle .modal-body p').html(nameArticle);
    $('#deleteArticle .modal-footer .btn-primary').attr('onclick', 'deleteArticle(' + idArticle + ')');
    $('#deleteArticle').modal('show');
});

function deleteArticle(id) {
    $.ajax({
        type: "POST",
        url: "controller/ajax.php",
        data: {
            id: id
        },
        timeout: 10000,
        success: function(data) {
            $('.table #' + id).remove();
            $('#deleteArticle').modal('hide');
            $('#deleteArticleSuccess').modal('show');

        },
        error: function () {
            console.log('error ajax');
            $('#deleteArticle').modal('hide');
        }
    });
}


text:
package model.persisted.fsb

import org.mongodb.scala.bson.BsonValue
import play.api.libs.json.Json
import uk.gov.hmrc.mongo.play.json.Codecs

case class ScoresAndFeedback(overallScore: Double, feedback: String)

object ScoresAndFeedback {
  implicit val scoresAndFeedbackFormat = Json.format[ScoresAndFeedback]

  implicit class BsonOps(val scoresAndFeedback: ScoresAndFeedback) extends AnyVal {
    def toBson: BsonValue = Codecs.toBson(scoresAndFeedback)
  }
}


text:
from ._compat import FileNotFoundError

class SnakePitException(Exception):
    """Base exception class"""

class ConfigDoesNotExist(SnakePitException, FileNotFoundError):
    """Raised when config file not found."""

class InvalidConfiguration(SnakePitException):
    """Raised when does not open config file."""

class RequirementsKeyError(SnakePitException, KeyError):
    """Raised when key not found in config file."""

class DistributionNotFound(SnakePitException):
    """Raised when distribution not found."""


text:
<?php
namespace Chamilo\Core\Admin\Announcement\Integration\Chamilo\Core\Home\Package;

class Activator extends \Chamilo\Configuration\Package\Action\Activator
{
}


text:
package gc

import (
	"fmt"
	"strings"
)

// Rewrite tree to use separate statements to enforce
// order of evaluation.  Makes walk easier, because it
// can (after this runs) reorder at will within an expression.
//
// Rewrite x op= y into x = x op y.
//
// Introduce temporaries as needed by runtime routines.
// For example, the map runtime routines take the map key
// by reference, so make sure all map keys are addressable
// by copying them to temporaries as needed.
// The same is true for channel operations.
//
// Arrange that map index expressions only appear in direct
// assignments x = m[k] or m[k] = x, never in larger expressions.
//
// Arrange that receive expressions only appear in direct assignments
// x = <-c or as standalone statements <-c, never in larger expressions.

// TODO(rsc): The temporary introduction during multiple assignments
// should be moved into this file, so that the temporaries can be cleaned
// and so that conversions implicit in the OAS2FUNC and OAS2RECV
// nodes can be made explicit and then have their temporaries cleaned.

// TODO(rsc): Goto and multilevel break/continue can jump over
// inserted VARKILL annotations. Work out a way to handle these.
// The current implementation is safe, in that it will execute correctly.
// But it won't reuse temporaries as aggressively as it might, and
// it can result in unnecessary zeroing of those variables in the function
// prologue.

// Order holds state during the ordering process.
type Order struct {
	out  *NodeList // list of generated statements
	temp *NodeList // head of stack of temporary variables
	free *NodeList // free list of NodeList* structs (for use in temp)
}

// Order rewrites fn->nbody to apply the ordering constraints
// described in the comment at the top of the file.
func order(fn *Node) {
	if Debug['W'] > 1 {
		s := fmt.Sprintf("\nbefore order %v", Sconv(fn.Nname.Sym, 0))
		dumplist(s, fn.Nbody)
	}

	orderblock(&fn.Nbody)
}

// Ordertemp allocates a new temporary with the given type,
// pushes it onto the temp stack, and returns it.
// If clear is true, ordertemp emits code to zero the temporary.
func ordertemp(t *Type, order *Order, clear bool) *Node {
	var_ := temp(t)
	if clear {
		a := Nod(OAS, var_, nil)
		typecheck(&a, Etop)
		order.out = list(order.out, a)
	}

	l := order.free
	if l == nil {
		l = new(NodeList)
	}
	order.free = l.Next
	l.Next = order.temp
	l.N = var_
	order.temp = l
	return var_
}

// Ordercopyexpr behaves like ordertemp but also emits
// code to initialize the temporary to the value n.
//
// The clear argument is provided for use when the evaluation
// of tmp = n turns into a function call that is passed a pointer
// to the temporary as the output space. If the call blocks before
// tmp has been written, the garbage collector will still treat the
// temporary as live, so we must zero it before entering that call.
// Today, this only happens for channel receive operations.
// (The other candidate would be map access, but map access
// returns a pointer to the result data instead of taking a pointer
// to be filled in.)
func ordercopyexpr(n *Node, t *Type, order *Order, clear int) *Node {
	var_ := ordertemp(t, order, clear != 0)
	a := Nod(OAS, var_, n)
	typecheck(&a, Etop)
	order.out = list(order.out, a)
	return var_
}

// Ordercheapexpr returns a cheap version of n.
// The definition of cheap is that n is a variable or constant.
// If not, ordercheapexpr allocates a new tmp, emits tmp = n,
// and then returns tmp.
func ordercheapexpr(n *Node, order *Order) *Node {
	switch n.Op {
	case ONAME,
		OLITERAL:
		return n
	}

	return ordercopyexpr(n, n.Type, order, 0)
}

// Ordersafeexpr returns a safe version of n.
// The definition of safe is that n can appear multiple times
// without violating the semantics of the original program,
// and that assigning to the safe version has the same effect
// as assigning to the original n.
//
// The intended use is to apply to x when rewriting x += y into x = x + y.
func ordersafeexpr(n *Node, order *Order) *Node {
	switch n.Op {
	case ONAME,
		OLITERAL:
		return n

	case ODOT:
		l := ordersafeexpr(n.Left, order)
		if l == n.Left {
			return n
		}
		a := Nod(OXXX, nil, nil)
		*a = *n
		a.Orig = a
		a.Left = l
		typecheck(&a, Erv)
		return a

	case ODOTPTR,
		OIND:
		l := ordercheapexpr(n.Left, order)
		if l == n.Left {
			return n
		}
		a := Nod(OXXX, nil, nil)
		*a = *n
		a.Orig = a
		a.Left = l
		typecheck(&a, Erv)
		return a

	case OINDEX,
		OINDEXMAP:
		var l *Node
		if Isfixedarray(n.Left.Type) {
			l = ordersafeexpr(n.Left, order)
		} else {
			l = ordercheapexpr(n.Left, order)
		}
		r := ordercheapexpr(n.Right, order)
		if l == n.Left && r == n.Right {
			return n
		}
		a := Nod(OXXX, nil, nil)
		*a = *n
		a.Orig = a
		a.Left = l
		a.Right = r
		typecheck(&a, Erv)
		return a
	}

	Fatal("ordersafeexpr %v", Oconv(int(n.Op), 0))
	return nil // not reached
}

// Istemp reports whether n is a temporary variable.
func istemp(n *Node) bool {
	if n.Op != ONAME {
		return false
	}
	return strings.HasPrefix(n.Sym.Name, "autotmp_")
}

// Isaddrokay reports whether it is okay to pass n's address to runtime routines.
// Taking the address of a variable makes the liveness and optimization analyses
// lose track of where the variable's lifetime ends. To avoid hurting the analyses
// of ordinary stack variables, those are not 'isaddrokay'. Temporaries are okay,
// because we emit explicit VARKILL instructions marking the end of those
// temporaries' lifetimes.
func isaddrokay(n *Node) bool {
	return islvalue(n) && (n.Op != ONAME || n.Class == PEXTERN || istemp(n))
}

// Orderaddrtemp ensures that *np is okay to pass by address to runtime routines.
// If the original argument *np is not okay, orderaddrtemp creates a tmp, emits
// tmp = *np, and then sets *np to the tmp variable.
func orderaddrtemp(np **Node, order *Order) {
	n := *np
	if isaddrokay(n) {
		return
	}
	*np = ordercopyexpr(n, n.Type, order, 0)
}

// Marktemp returns the top of the temporary variable stack.
func marktemp(order *Order) *NodeList {
	return order.temp
}

// Poptemp pops temporaries off the stack until reaching the mark,
// which must have been returned by marktemp.
func poptemp(mark *NodeList, order *Order) {
	var l *NodeList

	for {
		l = order.temp
		if l == mark {
			break
		}
		order.temp = l.Next
		l.Next = order.free
		order.free = l
	}
}

// Cleantempnopop emits to *out VARKILL instructions for each temporary
// above the mark on the temporary stack, but it does not pop them
// from the stack.
func cleantempnopop(mark *NodeList, order *Order, out **NodeList) {
	var kill *Node

	for l := order.temp; l != mark; l = l.Next {
		kill = Nod(OVARKILL, l.N, nil)
		typecheck(&kill, Etop)
		*out = list(*out, kill)
	}
}

// Cleantemp emits VARKILL instructions for each temporary above the
// mark on the temporary stack and removes them from the stack.
func cleantemp(top *NodeList, order *Order) {
	cleantempnopop(top, order, &order.out)
	poptemp(top, order)
}

// Orderstmtlist orders each of the statements in the list.
func orderstmtlist(l *NodeList, order *Order) {
	for ; l != nil; l = l.Next {
		orderstmt(l.N, order)
	}
}

// Orderblock orders the block of statements *l onto a new list,
// and then replaces *l with that list.
func orderblock(l **NodeList) {
	var order Order
	mark := marktemp(&order)
	orderstmtlist(*l, &order)
	cleantemp(mark, &order)
	*l = order.out
}

// Orderexprinplace orders the side effects in *np and
// leaves them as the init list of the final *np.
func orderexprinplace(np **Node, outer *Order) {
	n := *np
	var order Order
	orderexpr(&n, &order)
	addinit(&n, order.out)

	// insert new temporaries from order
	// at head of outer list.
	lp := &order.temp

	for *lp != nil {
		lp = &(*lp).Next
	}
	*lp = outer.temp
	outer.temp = order.temp

	*np = n
}

// Orderstmtinplace orders the side effects of the single statement *np
// and replaces it with the resulting statement list.
func orderstmtinplace(np **Node) {
	n := *np
	var order Order
	mark := marktemp(&order)
	orderstmt(n, &order)
	cleantemp(mark, &order)
	*np = liststmt(order.out)
}

// Orderinit moves n's init list to order->out.
func orderinit(n *Node, order *Order) {
	orderstmtlist(n.Ninit, order)
	n.Ninit = nil
}

// Ismulticall reports whether the list l is f() for a multi-value function.
// Such an f() could appear as the lone argument to a multi-arg function.
func ismulticall(l *NodeList) bool {
	// one arg only
	if l == nil || l.Next != nil {
		return false
	}
	n := l.N

	// must be call
	switch n.Op {
	default:
		return false

	case OCALLFUNC,
		OCALLMETH,
		OCALLINTER:
		break
	}

	// call must return multiple values
	return n.Left.Type.Outtuple > 1
}

// Copyret emits t1, t2, ... = n, where n is a function call,
// and then returns the list t1, t2, ....
func copyret(n *Node, order *Order) *NodeList {
	if n.Type.Etype != TSTRUCT || n.Type.Funarg == 0 {
		Fatal("copyret %v %d", Tconv(n.Type, 0), n.Left.Type.Outtuple)
	}

	var l1 *NodeList
	var l2 *NodeList
	var tl Iter
	var tmp *Node
	for t := Structfirst(&tl, &n.Type); t != nil; t = structnext(&tl) {
		tmp = temp(t.Type)
		l1 = list(l1, tmp)
		l2 = list(l2, tmp)
	}

	as := Nod(OAS2, nil, nil)
	as.List = l1
	as.Rlist = list1(n)
	typecheck(&as, Etop)
	orderstmt(as, order)

	return l2
}

// Ordercallargs orders the list of call arguments *l.
func ordercallargs(l **NodeList, order *Order) {
	if ismulticall(*l) {
		// return f() where f() is multiple values.
		*l = copyret((*l).N, order)
	} else {
		orderexprlist(*l, order)
	}
}

// Ordercall orders the call expression n.
// n->op is OCALLMETH/OCALLFUNC/OCALLINTER or a builtin like OCOPY.
func ordercall(n *Node, order *Order) {
	orderexpr(&n.Left, order)
	orderexpr(&n.Right, order) // ODDDARG temp
	ordercallargs(&n.List, order)
}

// Ordermapassign appends n to order->out, introducing temporaries
// to make sure that all map assignments have the form m[k] = x,
// where x is adressable.
// (Orderexpr has already been called on n, so we know k is addressable.)
//
// If n is m[k] = x where x is not addressable, the rewrite is:
//	tmp = x
//	m[k] = tmp
//
// If n is the multiple assignment form ..., m[k], ... = ..., the rewrite is
//	t1 = m
//	t2 = k
//	...., t3, ... = x
//	t1[t2] = t3
//
// The temporaries t1, t2 are needed in case the ... being assigned
// contain m or k. They are usually unnecessary, but in the unnecessary
// cases they are also typically registerizable, so not much harm done.
// And this only applies to the multiple-assignment form.
// We could do a more precise analysis if needed, like in walk.c.
//
// Ordermapassign also inserts these temporaries if needed for
// calling writebarrierfat with a pointer to n->right.
func ordermapassign(n *Node, order *Order) {
	switch n.Op {
	default:
		Fatal("ordermapassign %v", Oconv(int(n.Op), 0))

	case OAS:
		order.out = list(order.out, n)

		// We call writebarrierfat only for values > 4 pointers long. See walk.c.
		if (n.Left.Op == OINDEXMAP || (needwritebarrier(n.Left, n.Right) && n.Left.Type.Width > int64(4*Widthptr))) && !isaddrokay(n.Right) {
			m := n.Left
			n.Left = ordertemp(m.Type, order, false)
			a := Nod(OAS, m, n.Left)
			typecheck(&a, Etop)
			order.out = list(order.out, a)
		}

	case OAS2,
		OAS2DOTTYPE,
		OAS2MAPR,
		OAS2FUNC:
		var post *NodeList
		var m *Node
		var a *Node
		for l := n.List; l != nil; l = l.Next {
			if l.N.Op == OINDEXMAP {
				m = l.N
				if !istemp(m.Left) {
					m.Left = ordercopyexpr(m.Left, m.Left.Type, order, 0)
				}
				if !istemp(m.Right) {
					m.Right = ordercopyexpr(m.Right, m.Right.Type, order, 0)
				}
				l.N = ordertemp(m.Type, order, false)
				a = Nod(OAS, m, l.N)
				typecheck(&a, Etop)
				post = list(post, a)
			}
		}

		order.out = list(order.out, n)
		order.out = concat(order.out, post)
	}
}

// Orderstmt orders the statement n, appending to order->out.
// Temporaries created during the statement are cleaned
// up using VARKILL instructions as possible.
func orderstmt(n *Node, order *Order) {
	if n == nil {
		return
	}

	lno := int(setlineno(n))

	orderinit(n, order)

	switch n.Op {
	default:
		Fatal("orderstmt %v", Oconv(int(n.Op), 0))

	case OVARKILL:
		order.out = list(order.out, n)

	case OAS,
		OAS2,
		OCLOSE,
		OCOPY,
		OPRINT,
		OPRINTN,
		ORECOVER,
		ORECV:
		t := marktemp(order)
		orderexpr(&n.Left, order)
		orderexpr(&n.Right, order)
		orderexprlist(n.List, order)
		orderexprlist(n.Rlist, order)
		switch n.Op {
		case OAS,
			OAS2,
			OAS2DOTTYPE:
			ordermapassign(n, order)

		default:
			order.out = list(order.out, n)
		}

		cleantemp(t, order)

		// Special: rewrite l op= r into l = l op r.
	// This simplies quite a few operations;
	// most important is that it lets us separate
	// out map read from map write when l is
	// a map index expression.
	case OASOP:
		t := marktemp(order)

		orderexpr(&n.Left, order)
		n.Left = ordersafeexpr(n.Left, order)
		tmp1 := treecopy(n.Left)
		if tmp1.Op == OINDEXMAP {
			tmp1.Etype = 0 // now an rvalue not an lvalue
		}
		tmp1 = ordercopyexpr(tmp1, n.Left.Type, order, 0)
		n.Right = Nod(int(n.Etype), tmp1, n.Right)
		typecheck(&n.Right, Erv)
		orderexpr(&n.Right, order)
		n.Etype = 0
		n.Op = OAS
		ordermapassign(n, order)
		cleantemp(t, order)

		// Special: make sure key is addressable,
	// and make sure OINDEXMAP is not copied out.
	case OAS2MAPR:
		t := marktemp(order)

		orderexprlist(n.List, order)
		r := n.Rlist.N
		orderexpr(&r.Left, order)
		orderexpr(&r.Right, order)

		// See case OINDEXMAP below.
		if r.Right.Op == OARRAYBYTESTR {
			r.Right.Op = OARRAYBYTESTRTMP
		}
		orderaddrtemp(&r.Right, order)
		ordermapassign(n, order)
		cleantemp(t, order)

		// Special: avoid copy of func call n->rlist->n.
	case OAS2FUNC:
		t := marktemp(order)

		orderexprlist(n.List, order)
		ordercall(n.Rlist.N, order)
		ordermapassign(n, order)
		cleantemp(t, order)

		// Special: use temporary variables to hold result,
	// so that assertI2Tetc can take address of temporary.
	// No temporary for blank assignment.
	case OAS2DOTTYPE:
		t := marktemp(order)

		orderexprlist(n.List, order)
		orderexpr(&n.Rlist.N.Left, order) // i in i.(T)
		if isblank(n.List.N) {
			order.out = list(order.out, n)
		} else {
			typ := n.Rlist.N.Type
			tmp1 := ordertemp(typ, order, haspointers(typ))
			order.out = list(order.out, n)
			r := Nod(OAS, n.List.N, tmp1)
			typecheck(&r, Etop)
			ordermapassign(r, order)
			n.List = list(list1(tmp1), n.List.Next.N)
		}

		cleantemp(t, order)

		// Special: use temporary variables to hold result,
	// so that chanrecv can take address of temporary.
	case OAS2RECV:
		t := marktemp(order)

		orderexprlist(n.List, order)
		orderexpr(&n.Rlist.N.Left, order) // arg to recv
		ch := n.Rlist.N.Left.Type
		tmp1 := ordertemp(ch.Type, order, haspointers(ch.Type))
		var tmp2 *Node
		if !isblank(n.List.Next.N) {
			tmp2 = ordertemp(n.List.Next.N.Type, order, false)
		} else {
			tmp2 = ordertemp(Types[TBOOL], order, false)
		}
		order.out = list(order.out, n)
		r := Nod(OAS, n.List.N, tmp1)
		typecheck(&r, Etop)
		ordermapassign(r, order)
		r = Nod(OAS, n.List.Next.N, tmp2)
		typecheck(&r, Etop)
		ordermapassign(r, order)
		n.List = list(list1(tmp1), tmp2)
		cleantemp(t, order)

		// Special: does not save n onto out.
	case OBLOCK,
		OEMPTY:
		orderstmtlist(n.List, order)

		// Special: n->left is not an expression; save as is.
	case OBREAK,
		OCONTINUE,
		ODCL,
		ODCLCONST,
		ODCLTYPE,
		OFALL,
		OXFALL,
		OGOTO,
		OLABEL,
		ORETJMP:
		order.out = list(order.out, n)

		// Special: handle call arguments.
	case OCALLFUNC,
		OCALLINTER,
		OCALLMETH:
		t := marktemp(order)

		ordercall(n, order)
		order.out = list(order.out, n)
		cleantemp(t, order)

		// Special: order arguments to inner call but not call itself.
	case ODEFER,
		OPROC:
		t := marktemp(order)

		switch n.Left.Op {
		// Delete will take the address of the key.
		// Copy key into new temp and do not clean it
		// (it persists beyond the statement).
		case ODELETE:
			orderexprlist(n.Left.List, order)

			t1 := marktemp(order)
			np := &n.Left.List.Next.N // map key
			*np = ordercopyexpr(*np, (*np).Type, order, 0)
			poptemp(t1, order)

		default:
			ordercall(n.Left, order)
		}

		order.out = list(order.out, n)
		cleantemp(t, order)

	case ODELETE:
		t := marktemp(order)
		orderexpr(&n.List.N, order)
		orderexpr(&n.List.Next.N, order)
		orderaddrtemp(&n.List.Next.N, order) // map key
		order.out = list(order.out, n)
		cleantemp(t, order)

		// Clean temporaries from condition evaluation at
	// beginning of loop body and after for statement.
	case OFOR:
		t := marktemp(order)

		orderexprinplace(&n.Ntest, order)
		var l *NodeList
		cleantempnopop(t, order, &l)
		n.Nbody = concat(l, n.Nbody)
		orderblock(&n.Nbody)
		orderstmtinplace(&n.Nincr)
		order.out = list(order.out, n)
		cleantemp(t, order)

		// Clean temporaries from condition at
	// beginning of both branches.
	case OIF:
		t := marktemp(order)

		orderexprinplace(&n.Ntest, order)
		var l *NodeList
		cleantempnopop(t, order, &l)
		n.Nbody = concat(l, n.Nbody)
		l = nil
		cleantempnopop(t, order, &l)
		n.Nelse = concat(l, n.Nelse)
		poptemp(t, order)
		orderblock(&n.Nbody)
		orderblock(&n.Nelse)
		order.out = list(order.out, n)

		// Special: argument will be converted to interface using convT2E
	// so make sure it is an addressable temporary.
	case OPANIC:
		t := marktemp(order)

		orderexpr(&n.Left, order)
		if !Isinter(n.Left.Type) {
			orderaddrtemp(&n.Left, order)
		}
		order.out = list(order.out, n)
		cleantemp(t, order)

		// n->right is the expression being ranged over.
	// order it, and then make a copy if we need one.
	// We almost always do, to ensure that we don't
	// see any value changes made during the loop.
	// Usually the copy is cheap (e.g., array pointer, chan, slice, string are all tiny).
	// The exception is ranging over an array value (not a slice, not a pointer to array),
	// which must make a copy to avoid seeing updates made during
	// the range body. Ranging over an array value is uncommon though.
	case ORANGE:
		t := marktemp(order)

		orderexpr(&n.Right, order)
		switch n.Type.Etype {
		default:
			Fatal("orderstmt range %v", Tconv(n.Type, 0))

			// Mark []byte(str) range expression to reuse string backing storage.
		// It is safe because the storage cannot be mutated.
		case TARRAY:
			if n.Right.Op == OSTRARRAYBYTE {
				n.Right.Op = OSTRARRAYBYTETMP
			}
			if count(n.List) < 2 || isblank(n.List.Next.N) {
				// for i := range x will only use x once, to compute len(x).
				// No need to copy it.
				break
			}
			fallthrough

			// chan, string, slice, array ranges use value multiple times.
		// make copy.
		// fall through
		case TCHAN,
			TSTRING:
			r := n.Right

			if r.Type.Etype == TSTRING && r.Type != Types[TSTRING] {
				r = Nod(OCONV, r, nil)
				r.Type = Types[TSTRING]
				typecheck(&r, Erv)
			}

			n.Right = ordercopyexpr(r, r.Type, order, 0)

			// copy the map value in case it is a map literal.
		// TODO(rsc): Make tmp = literal expressions reuse tmp.
		// For maps tmp is just one word so it hardly matters.
		case TMAP:
			r := n.Right

			n.Right = ordercopyexpr(r, r.Type, order, 0)

			// n->alloc is the temp for the iterator.
			n.Alloc = ordertemp(Types[TUINT8], order, true)
		}

		for l := n.List; l != nil; l = l.Next {
			orderexprinplace(&l.N, order)
		}
		orderblock(&n.Nbody)
		order.out = list(order.out, n)
		cleantemp(t, order)

	case ORETURN:
		ordercallargs(&n.List, order)
		order.out = list(order.out, n)

		// Special: clean case temporaries in each block entry.
	// Select must enter one of its blocks, so there is no
	// need for a cleaning at the end.
	// Doubly special: evaluation order for select is stricter
	// than ordinary expressions. Even something like p.c
	// has to be hoisted into a temporary, so that it cannot be
	// reordered after the channel evaluation for a different
	// case (if p were nil, then the timing of the fault would
	// give this away).
	case OSELECT:
		t := marktemp(order)

		var tmp1 *Node
		var tmp2 *Node
		var r *Node
		for l := n.List; l != nil; l = l.Next {
			if l.N.Op != OXCASE {
				Fatal("order select case %v", Oconv(int(l.N.Op), 0))
			}
			r = l.N.Left
			setlineno(l.N)

			// Append any new body prologue to ninit.
			// The next loop will insert ninit into nbody.
			if l.N.Ninit != nil {
				Fatal("order select ninit")
			}
			if r != nil {
				switch r.Op {
				default:
					Yyerror("unknown op in select %v", Oconv(int(r.Op), 0))
					Dump("select case", r)

					// If this is case x := <-ch or case x, y := <-ch, the case has
				// the ODCL nodes to declare x and y. We want to delay that
				// declaration (and possible allocation) until inside the case body.
				// Delete the ODCL nodes here and recreate them inside the body below.
				case OSELRECV,
					OSELRECV2:
					if r.Colas != 0 {
						t = r.Ninit
						if t != nil && t.N.Op == ODCL && t.N.Left == r.Left {
							t = t.Next
						}
						if t != nil && t.N.Op == ODCL && t.N.Left == r.Ntest {
							t = t.Next
						}
						if t == nil {
							r.Ninit = nil
						}
					}

					if r.Ninit != nil {
						Yyerror("ninit on select recv")
						dumplist("ninit", r.Ninit)
					}

					// case x = <-c
					// case x, ok = <-c
					// r->left is x, r->ntest is ok, r->right is ORECV, r->right->left is c.
					// r->left == N means 'case <-c'.
					// c is always evaluated; x and ok are only evaluated when assigned.
					orderexpr(&r.Right.Left, order)

					if r.Right.Left.Op != ONAME {
						r.Right.Left = ordercopyexpr(r.Right.Left, r.Right.Left.Type, order, 0)
					}

					// Introduce temporary for receive and move actual copy into case body.
					// avoids problems with target being addressed, as usual.
					// NOTE: If we wanted to be clever, we could arrange for just one
					// temporary per distinct type, sharing the temp among all receives
					// with that temp. Similarly one ok bool could be shared among all
					// the x,ok receives. Not worth doing until there's a clear need.
					if r.Left != nil && isblank(r.Left) {
						r.Left = nil
					}
					if r.Left != nil {
						// use channel element type for temporary to avoid conversions,
						// such as in case interfacevalue = <-intchan.
						// the conversion happens in the OAS instead.
						tmp1 = r.Left

						if r.Colas != 0 {
							tmp2 = Nod(ODCL, tmp1, nil)
							typecheck(&tmp2, Etop)
							l.N.Ninit = list(l.N.Ninit, tmp2)
						}

						r.Left = ordertemp(r.Right.Left.Type.Type, order, haspointers(r.Right.Left.Type.Type))
						tmp2 = Nod(OAS, tmp1, r.Left)
						typecheck(&tmp2, Etop)
						l.N.Ninit = list(l.N.Ninit, tmp2)
					}

					if r.Ntest != nil && isblank(r.Ntest) {
						r.Ntest = nil
					}
					if r.Ntest != nil {
						tmp1 = r.Ntest
						if r.Colas != 0 {
							tmp2 = Nod(ODCL, tmp1, nil)
							typecheck(&tmp2, Etop)
							l.N.Ninit = list(l.N.Ninit, tmp2)
						}

						r.Ntest = ordertemp(tmp1.Type, order, false)
						tmp2 = Nod(OAS, tmp1, r.Ntest)
						typecheck(&tmp2, Etop)
						l.N.Ninit = list(l.N.Ninit, tmp2)
					}

					orderblock(&l.N.Ninit)

				case OSEND:
					if r.Ninit != nil {
						Yyerror("ninit on select send")
						dumplist("ninit", r.Ninit)
					}

					// case c <- x
					// r->left is c, r->right is x, both are always evaluated.
					orderexpr(&r.Left, order)

					if !istemp(r.Left) {
						r.Left = ordercopyexpr(r.Left, r.Left.Type, order, 0)
					}
					orderexpr(&r.Right, order)
					if !istemp(r.Right) {
						r.Right = ordercopyexpr(r.Right, r.Right.Type, order, 0)
					}
				}
			}

			orderblock(&l.N.Nbody)
		}

		// Now that we have accumulated all the temporaries, clean them.
		// Also insert any ninit queued during the previous loop.
		// (The temporary cleaning must follow that ninit work.)
		for l := n.List; l != nil; l = l.Next {
			cleantempnopop(t, order, &l.N.Ninit)
			l.N.Nbody = concat(l.N.Ninit, l.N.Nbody)
			l.N.Ninit = nil
		}

		order.out = list(order.out, n)
		poptemp(t, order)

		// Special: value being sent is passed as a pointer; make it addressable.
	case OSEND:
		t := marktemp(order)

		orderexpr(&n.Left, order)
		orderexpr(&n.Right, order)
		orderaddrtemp(&n.Right, order)
		order.out = list(order.out, n)
		cleantemp(t, order)

		// TODO(rsc): Clean temporaries more aggressively.
	// Note that because walkswitch will rewrite some of the
	// switch into a binary search, this is not as easy as it looks.
	// (If we ran that code here we could invoke orderstmt on
	// the if-else chain instead.)
	// For now just clean all the temporaries at the end.
	// In practice that's fine.
	case OSWITCH:
		t := marktemp(order)

		orderexpr(&n.Ntest, order)
		for l := n.List; l != nil; l = l.Next {
			if l.N.Op != OXCASE {
				Fatal("order switch case %v", Oconv(int(l.N.Op), 0))
			}
			orderexprlistinplace(l.N.List, order)
			orderblock(&l.N.Nbody)
		}

		order.out = list(order.out, n)
		cleantemp(t, order)
	}

	lineno = int32(lno)
}

// Orderexprlist orders the expression list l into order.
func orderexprlist(l *NodeList, order *Order) {
	for ; l != nil; l = l.Next {
		orderexpr(&l.N, order)
	}
}

// Orderexprlist orders the expression list l but saves
// the side effects on the individual expression ninit lists.
func orderexprlistinplace(l *NodeList, order *Order) {
	for ; l != nil; l = l.Next {
		orderexprinplace(&l.N, order)
	}
}

// Orderexpr orders a single expression, appending side
// effects to order->out as needed.
func orderexpr(np **Node, order *Order) {
	n := *np
	if n == nil {
		return
	}

	lno := int(setlineno(n))
	orderinit(n, order)

	switch n.Op {
	default:
		orderexpr(&n.Left, order)
		orderexpr(&n.Right, order)
		orderexprlist(n.List, order)
		orderexprlist(n.Rlist, order)

		// Addition of strings turns into a function call.
	// Allocate a temporary to hold the strings.
	// Fewer than 5 strings use direct runtime helpers.
	case OADDSTR:
		orderexprlist(n.List, order)

		if count(n.List) > 5 {
			t := typ(TARRAY)
			t.Bound = int64(count(n.List))
			t.Type = Types[TSTRING]
			n.Alloc = ordertemp(t, order, false)
		}

		// Mark string(byteSlice) arguments to reuse byteSlice backing
		// buffer during conversion. String concatenation does not
		// memorize the strings for later use, so it is safe.
		// However, we can do it only if there is at least one non-empty string literal.
		// Otherwise if all other arguments are empty strings,
		// concatstrings will return the reference to the temp string
		// to the caller.
		hasbyte := false

		haslit := false
		for l := n.List; l != nil; l = l.Next {
			hasbyte = hasbyte || l.N.Op == OARRAYBYTESTR
			haslit = haslit || l.N.Op == OLITERAL && len(l.N.Val.U.Sval) != 0
		}

		if haslit && hasbyte {
			for l := n.List; l != nil; l = l.Next {
				if l.N.Op == OARRAYBYTESTR {
					l.N.Op = OARRAYBYTESTRTMP
				}
			}
		}

	case OCMPSTR:
		orderexpr(&n.Left, order)
		orderexpr(&n.Right, order)

		// Mark string(byteSlice) arguments to reuse byteSlice backing
		// buffer during conversion. String comparison does not
		// memorize the strings for later use, so it is safe.
		if n.Left.Op == OARRAYBYTESTR {
			n.Left.Op = OARRAYBYTESTRTMP
		}
		if n.Right.Op == OARRAYBYTESTR {
			n.Right.Op = OARRAYBYTESTRTMP
		}

		// key must be addressable
	case OINDEXMAP:
		orderexpr(&n.Left, order)

		orderexpr(&n.Right, order)

		// For x = m[string(k)] where k is []byte, the allocation of
		// backing bytes for the string can be avoided by reusing
		// the []byte backing array. This is a special case that it
		// would be nice to handle more generally, but because
		// there are no []byte-keyed maps, this specific case comes
		// up in important cases in practice. See issue 3512.
		// Nothing can change the []byte we are not copying before
		// the map index, because the map access is going to
		// be forced to happen immediately following this
		// conversion (by the ordercopyexpr a few lines below).
		if n.Etype == 0 && n.Right.Op == OARRAYBYTESTR {
			n.Right.Op = OARRAYBYTESTRTMP
		}

		orderaddrtemp(&n.Right, order)
		if n.Etype == 0 {
			// use of value (not being assigned);
			// make copy in temporary.
			n = ordercopyexpr(n, n.Type, order, 0)
		}

		// concrete type (not interface) argument must be addressable
	// temporary to pass to runtime.
	case OCONVIFACE:
		orderexpr(&n.Left, order)

		if !Isinter(n.Left.Type) {
			orderaddrtemp(&n.Left, order)
		}

	case OANDAND,
		OOROR:
		mark := marktemp(order)
		orderexpr(&n.Left, order)

		// Clean temporaries from first branch at beginning of second.
		// Leave them on the stack so that they can be killed in the outer
		// context in case the short circuit is taken.
		var l *NodeList

		cleantempnopop(mark, order, &l)
		n.Right.Ninit = concat(l, n.Right.Ninit)
		orderexprinplace(&n.Right, order)

	case OAPPEND,
		OCALLFUNC,
		OCALLINTER,
		OCALLMETH,
		OCAP,
		OCOMPLEX,
		OCOPY,
		OIMAG,
		OLEN,
		OMAKECHAN,
		OMAKEMAP,
		OMAKESLICE,
		ONEW,
		OREAL,
		ORECOVER:
		ordercall(n, order)
		n = ordercopyexpr(n, n.Type, order, 0)

	case OCLOSURE:
		if n.Noescape && n.Cvars != nil {
			n.Alloc = ordertemp(Types[TUINT8], order, false) // walk will fill in correct type
		}

	case OARRAYLIT,
		OCALLPART:
		orderexpr(&n.Left, order)
		orderexpr(&n.Right, order)
		orderexprlist(n.List, order)
		orderexprlist(n.Rlist, order)
		if n.Noescape {
			n.Alloc = ordertemp(Types[TUINT8], order, false) // walk will fill in correct type
		}

	case ODDDARG:
		if n.Noescape {
			// The ddd argument does not live beyond the call it is created for.
			// Allocate a temporary that will be cleaned up when this statement
			// completes. We could be more aggressive and try to arrange for it
			// to be cleaned up when the call completes.
			n.Alloc = ordertemp(n.Type.Type, order, false)
		}

	case ODOTTYPE, ODOTTYPE2:
		orderexpr(&n.Left, order)
		// TODO(rsc): The Isfat is for consistency with componentgen and walkexpr.
		// It needs to be removed in all three places.
		// That would allow inlining x.(struct{*int}) the same as x.(*int).
		if !isdirectiface(n.Type) || Isfat(n.Type) || flag_race != 0 {
			n = ordercopyexpr(n, n.Type, order, 1)
		}

	case ORECV:
		orderexpr(&n.Left, order)
		n = ordercopyexpr(n, n.Type, order, 1)

	case OEQ,
		ONE:
		orderexpr(&n.Left, order)
		orderexpr(&n.Right, order)
		t := n.Left.Type
		if t.Etype == TSTRUCT || Isfixedarray(t) {
			// for complex comparisons, we need both args to be
			// addressable so we can pass them to the runtime.
			orderaddrtemp(&n.Left, order)

			orderaddrtemp(&n.Right, order)
		}
	}

	lineno = int32(lno)

	*np = n
}


text:
{% extends "base_login.html" %}
{% load i18n static %}

{% block extra_style %}
<link rel="stylesheet" type="text/css" href="{% static 'shibboleth_eds/idpselect.css' %}"/>
{% endblock %}

{% block main_content %}

{% if LANGUAGE_CODE == 'de' %}

Die HU-Box verwendet die zentrale Einmal-Anmeldung (Single Sign-On per Shibboleth). Wählen Sie bitte Ihre Heimatinstitution aus und melden sich dort an. Shibboleth überträgt die angezeigten und notwendigen Daten an die HU-Box.

{% else %}

The HU-Box uses the central single sign-on via Shibboleth. Please select your home organization and login there. Shibboleth transfers the displayed and necessary data to the HU-Box.

{% endif %}

    Your Browser does not support javascript. Please use
    this link.

{% endblock %}

{% block extra_script %}

{% endblock %}


text:
    <fusioncharts
            style="margin-right: 1em;"
            width="600"
            height="400"
            type="pie3d"
            datasource="{{myDataSource}}"
            ></fusioncharts>

        <fusioncharts
                width="500"
                height="300"
                type="line"
                datasource="{{lineChart}}"
                ></fusioncharts>

        <fusioncharts
                style="margin-right: 1em;"
                width="600"
                height="400"
                type="area2d"
                datasource="{{areaChart}}"
                ></fusioncharts>


text:
<?php

$number = trim(fgets(STDIN));
$stringOperations = trim(fgets(STDIN));
$arrayOperations = explode(', ', $stringOperations);

function chopChop($number) {
    return $number / 2;
}

function dice($number) {
    return ($number > 0) ? sqrt($number) : ($number);
}

function spice($number) {
    return $number + 1;
}

function bake($number) {
    return $number * 3;
}

function fillet($number) {
    return $number - (($number * 2) / 10);
}

function performOperation($number, $operation) {
    static $keepNumber;
    if (!isset($keepNumber)) {
        $keepNumber = $number;
    }
    if ($operation == 'chop') {
        $operation = 'chopChop';
    }
    $keepNumber = call_user_func($operation, $keepNumber);
    return $keepNumber;
}

foreach ($arrayOperations as $Operation) {
    echo performOperation($number, $Operation) . PHP_EOL;
}


text:
package com.iot.nero.facade;

import com.iot.nero.parent_data.entity.MQMessage;

import java.util.List;

/**
 * Author neroyang
 * Email  nerosoft@outlook.com
 * Date   2017/7/11
 * Time   下午1:19
 */
public interface IDataFacade {
    /**
     * 储存消息
     * @param id
     * @param from
     * @param to
     * @param qos
     * @param message
     * @return
     */
    Integer saveMessage(Integer id, String from, String to, String qos, String message);

    /**
     * 获取信息列表
     * @param aid
     * @param page
     * @param num
     * @return
     */
    List<MQMessage> getMessageByPage(Integer aid, Integer page, Integer num);

    /**
     * 获取客户端发送消息
     * @param aid
     * @param clientId
     * @param page
     * @param num
     * @return
     */
    List<MQMessage> getClientSendMessageByPage(Integer aid, String clientId, Integer page, Integer num);

    /**
     * 获取客户端接收消息
     * @param aid
     * @param clientId
     * @param page
     * @param num
     * @return
     */
    List<MQMessage> getClientReceivedMessageByPage(Integer aid, String clientId, Integer page, Integer num);

    /**
     * 获取设备发送数据条数
     * @param aid
     * @param clientId
     * @return
     */
    Integer getClientSendMessageCount(Integer aid, String clientId);

    /**
     * 获取当前应用总发送消息数
     * @param uid
     * @param id
     * @return
     */
    Integer getSendMessageCount(Integer uid, Integer id);
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由Codesmith工具生成。
// 此文件的更改可能会导致不正确的行为,如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using ZyGames.Framework.Common;
using ZyGames.Framework.Collection;
using ZyGames.Framework.Model;
using ProtoBuf;
using System.Runtime.Serialization;

namespace ZyGames.Tianjiexing.Model
{
    /// <summary>
    /// 法宝洗练消耗物品配置表
    /// </summary>
    [Serializable, ProtoContract]
    [EntityTable(AccessLevel.ReadOnly, DbConfig.Config, "WashConsumeInfo")]

    public class WashConsumeInfo : ShareEntity
    {
        public const string Index_TrumpID = "Index_TrumpID";

        public WashConsumeInfo()
            : base(AccessLevel.ReadOnly)
        {
        }

        public WashConsumeInfo(Int32 TrumpID, Int16 MatureType)
            : this()
        {
            this.TrumpID = TrumpID;
            this.MatureType = MatureType;
        }

        #region 自动生成属性

        private Int32 _TrumpID;
        /// <summary>
        ///
        /// </summary>
        [ProtoMember(1)]
        [EntityField("TrumpID", IsKey = true)]
        public Int32 TrumpID
        {
            get
            {
                return _TrumpID;
            }
            private set
            {
                SetChange("TrumpID", value);
            }
        }

        private Int16 _MatureType;
        /// <summary>
        ///
        /// </summary>
        [ProtoMember(2)]
        [EntityField("MatureType", IsKey = true)]
        public Int16 MatureType
        {
            get
            {
                return _MatureType;
            }
            private set
            {
                SetChange("MatureType", value);
            }
        }

        private Int32 _ItemID;
        /// <summary>
        ///
        /// </summary>
        [ProtoMember(3)]
        [EntityField("ItemID")]
        public Int32 ItemID
        {
            get
            {
                return _ItemID;
            }
            private set
            {
                SetChange("ItemID", value);
            }
        }

        private Int32 _ItemNum;
        /// <summary>
        ///
        /// </summary>
        [ProtoMember(4)]
        [EntityField("ItemNum")]
        public Int32 ItemNum
        {
            get
            {
                return _ItemNum;
            }
            private set
            {
                SetChange("ItemNum", value);
            }
        }

        private Decimal _SuccessNum;
        /// <summary>
        ///
        /// </summary>
        [ProtoMember(5)]
        [EntityField("SuccessNum")]
        public Decimal SuccessNum
        {
            get
            {
                return _SuccessNum;
            }
            private set
            {
                SetChange("SuccessNum", value);
            }
        }

        private Int32 _MatureNum;
        /// <summary>
        ///
        /// </summary>
        [ProtoMember(6)]
        [EntityField("MatureNum")]
        public Int32 MatureNum
        {
            get
            {
                return _MatureNum;
            }
            private set
            {
                SetChange("MatureNum", value);
            }
        }

        protected override object this[string index]
		{
			get
			{
                #region
				switch (index)
				{
                    case "TrumpID": return TrumpID;
                    case "MatureType": return MatureType;
                    case "ItemID": return ItemID;
                    case "ItemNum": return ItemNum;
                    case "SuccessNum": return SuccessNum;
                    case "MatureNum": return MatureNum;
					default: throw new ArgumentException(string.Format("WashConsumeInfo index[{0}] isn't exist.", index));
				}
                #endregion
			}
			set
			{
                #region
				switch (index)
				{
                    case "TrumpID":
                        _TrumpID = value.ToInt();
                        break;
                    case "MatureType":
                        _MatureType = value.ToShort();
                        break;
                    case "ItemID":
                        _ItemID = value.ToInt();
                        break;
                    case "ItemNum":
                        _ItemNum = value.ToInt();
                        break;
                    case "SuccessNum":
                        _SuccessNum = value.ToDecimal();
                        break;
                    case "MatureNum":
                        _MatureNum = value.ToInt();
                        break;
					default: throw new ArgumentException(string.Format("WashConsumeInfo index[{0}] isn't exist.", index));
				}
                #endregion
			}
		}

        #endregion

        protected override int GetIdentityId()
        {
            //allow modify return value
            return DefIdentityId;
        }
	}
}


text:
using UnityEngine;
using UnityEngine.SceneManagement;

[AddComponentMenu("NGUI/Examples/Load Level On Click")]
public class LoadLevelOnClick : MonoBehaviour
{
	public string levelName;

	void OnClick()
	{
		if (!string.IsNullOrEmpty(levelName))
		{
			SceneManager.LoadScene(levelName);
		}
	}
}