text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='../../../../../../../../../test.xsl'?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!--
-->

<!DOCTYPE Test SYSTEM '../../../../../../../../../test.dtd'>

<Test ID="Btest4513_case3"
    date-of-creation="2005-10-12"
    timeout="2" >

    <Description>
        (JUnit testcase may stop(???) code execution)
    </Description>

    <Keyword name="regression"/>
    <Keyword name="opt"/>

    <Source name="Btest4513_case3.java"/>

    <Runner ID="ExecuteRegression">
        <!-- Testcase from the "Additional Comment #6 From Mikhail Fursov
             2005-09-26 18:34 " -->
        <Param name="toRun" value="hang">
            <Option name="~opt"/>
            <Option name="~crashString=PASSED!"/>
            <Option name="org.apache.harmony.test.func.reg.jit.btest4513.Btest4513_case3"/>
        </Param>

    </Runner>

</Test>


text:
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using LinqInfer.Data.Pipes;
using LinqInfer.Learning.Features;
using LinqInfer.Maths;
using LinqInfer.Utility;
using NUnit.Framework;

namespace LinqInfer.UnitTests.Learning.Features
{
    [TestFixture]
    public class AsyncFeatureProcessingPipelineTests
    {
        [Test]
        public async Task ExtractBatches_WhenGivenADataLoadingFunction_ReturnsExpectedObjectsAndExtractedVectors()
        {
            var fe = new ExpressionFeatureExtractor<string>(x => Vector.FromCsv(x, ','), 2);

            var pipeline = new AsyncFeatureProcessingPipeline<string>(Loader().AsAsyncEnumerator(), fe);

            var n = 0;
            var m = 0;

            foreach (var item in await pipeline
                .ExtractBatches()
                .ToMemoryAsync(CancellationToken.None))
            {
                Assert.That(item.Vector[0], Is.EqualTo(m));
                Assert.That(item.Vector[1], Is.EqualTo(n));

                n++;

                if (n != 5) continue;

                m++;
                n = 0;
            }
        }

        static IEnumerable<Task<IList<string>>> Loader()
        {
            return Enumerable.Range(0, 10)
                .Select(n => Task<IList<string>>.Factory.StartNew(() =>
                    Enumerable.Range(0, 5).Select(m => $"{n},{m}").ToList()
                ));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

// Imposto l'esecuzione massima in 10 minuti
ini_set('max_execution_time',600);

include("./inc/conn.php");
include("./inc/layouts.php");

proteggi(1);

/**
 * Permette di modificare il nome di un file eliminando i caratteri accentati latin1 e
 * sostituendo ciò che non sono lettere, numeri o trattini con il carattere underscore
 *
 * @param string $nomefile
 * @return string Nome del file senza caratteri accenti o spazi
 */
function rinomina_file($nomefile){

	$nomefile=str_replace(array('à','è','é','ò','ì','ù'),
						  array('a','e','e','o','i','u'),
						  $nomefile);

	$nomefile=preg_replace("'[^\w-.]+'","_",trim($nomefile));

	return $nomefile;

}

/**
 * Controlla la tipologia dei file mediante la lettura delle estensioni
 * ed il confronto con le estensioni permesse nella variabile "formati_attach"
 *
 * @param string $nomefile
 * @param string $header_file
 * @todo Impostare un controllo mediante la lettura del MIME del file
 * @return bool
 */
function verifica_tipo_file($nomefile,$header_file){

	$estensioni_accettate=explode(",",$_SESSION['VF_VARS']['formati_attach']);

	foreach($estensioni_accettate as $k=>$v) $estensioni_accettate[$k]=trim($v);

	$infofile=pathinfo($nomefile);

//	var_dump($estensioni_accettate);

	return (in_array($infofile['extension'],$estensioni_accettate)) ?  true:false;

}

/**
 * Funzione per la determinazione del tipo di file immagine mediante il nome e l'estensione
 * Restituisce una icona con il tipo (se presente nei casi descritti)
 *
 * @param string $nomefile
 * @return string
 */
function img_filetype($nomefile){

	switch (substr($nomefile,-4,4)){

		case '.pdf': $mime='pdf.gif'; $alt='pdf'; break;
		case '.doc': $mime='doc.gif'; $alt='documento Word'; break;
		case '.xls': $mime='xls.gif'; $alt='foglio di calcolo Excel'; break;
		case '.zip': $mime='zip.gif'; $alt='file compresso zip'; break;
		default   : $mime='generic.gif'; $alt='file'; break;

	}

	return "";

}

######################################################################
#
#	CASO ELIMINA ALLEGATO
#

if(isset($_GET['del'])){

	$id_da_eliminare=str_replace(_BASE64_PASSFRASE,'',base64_decode($_GET['del']));

	$id_da_eliminare=intval($id_da_eliminare);

	// elimino dal DB
	$q_del=$vmreg->query("DELETE FROM "._TABELLA_ALLEGATO." WHERE codiceallegato=$id_da_eliminare");

	$test_del_db= ($vmreg->affected_rows($q_del)==1) ? true:false;

	// elimino dal filesystem
	$test_del_fs=@unlink(_PATH_ATTACHMENT."/$id_da_eliminare.dat");

	if($test_del_db && $test_del_fs){
		header("Location: ".$_SERVER['PHP_SELF']."?t=".$_GET['t']."&id=".$_GET['id']."&az=del&feed=ok");

	}
	else{
		header("Location: ".$_SERVER['PHP_SELF']."?t=".$_GET['t']."&id=".$_GET['id']."&az=del&feed=ko");
	}

	exit;
}

#
#
######################################################################

#######################################################################
#
#	CASO UPLOAD ESEGUITO
#

if(count($_FILES)>0){

	// variabile per il test finale
	$success=0;
	$tipo_errori_up= array();

	// CICLO SUI FILES
	for($i=0;$i<count($_FILES['gfile']['tmp_name']);$i++){

		// test sulla correttezza dell'upload
		if(is_file($_FILES['gfile']['tmp_name'][$i]) && $_FILES['gfile']['error'][$i]==0){

			$nome_pulito = rinomina_file($_FILES['gfile']['name'][$i]);
		}
		else{
			$tipo_errori_up[$i]='generico di upload';
			continue;
		}

		// Test sul tipo di file
		if(!verifica_tipo_file($nome_pulito,$_FILES['gfile']['type'][$i])){
			$tipo_errori_up[$i]=_('file type not allowed (the available extensions are: ').str_replace(",",", ",$_SESSION['VF_VARS']['formati_attach']).')';
			continue;
		}

		// INSERISCE IN DATABASE

		$sql_ins=sprintf("INSERT INTO "._TABELLA_ALLEGATO."
				 (tipoentita,codiceentita,nomefileall,descroggall,autoreall,lastdata)
				 VALUES ('%s','%s','%s','%s','%s','%s')",
				 $vmreg->escape($_POST['t']),
				 $vmreg->escape($_POST['id']),
				 $vmreg->escape($nome_pulito),
				 '',
				 $vmreg->escape(ucfirst($_SESSION['user']['nome'])." ".ucfirst($_SESSION['user']['cognome'])),
				 date('Y-m-d H:i:s')
				 );

		$q_ins=$vmreg->query($sql_ins);

		$id_ultimo=$vmreg->insert_id(_TABELLA_ALLEGATO,'codiceallegato');

		$test_move=move_uploaded_file($_FILES['gfile']['tmp_name'][$i],_PATH_ATTACHMENT."/$id_ultimo.dat");

		if($test_move){

			$success++;
		}
		else{
			$tipo_errori_up[$i]=_('it is not possible to upload the file in the folder');
			continue;
		}

	}

	if($success==count($_FILES['gfile']['tmp_name'])){

		header("Location: ".$_SERVER['PHP_SELF']."?t=".$_POST['t']."&id=".$_POST['id']."&feed=ok");
	}
	else{
		header("Location: ".$_SERVER['PHP_SELF']."?t=".$_POST['t']."&id=".$_POST['id']."&feed=ko&msg=".implode("|",$tipo_errori_up));
	}

	exit;
}
########################################################################

########################################################################
#
#	VISTA PAGINA - QUERY DI RICERCA ALLEGATI
#

# CASO SPECIALE NEW:
// L'utente ha cliccato su allegato quando ancora il record non era salvato..
if($_GET['id']=='new'){

	$msg=_("To attach a file, save the new record first, and then upload the attached files.");
	openErrorGenerico(_('You cannot attach a file until you have first saved the new record'),false,$msg,'popup');
	exit;
}

if($_GET['id']=='ric'){

	$msg=_("You are in the middle of a search. Complete or cancel the search before trying to insert attachments.");
	openErrorGenerico(_('You cannot attach files while performing a search'),false,$msg,'popup');
	exit;
}

$tabella = preg_replace("'[\W]+'","",trim($_GET['t']));
$id = preg_replace("'[\W]+'","",trim($_GET['id']));

// PRENDI IMPOSTAZIONI ALLEGATI PER TABELLA/REGISTO
$info_tab=RegTools::prendi_info_tabella($tabella, "permetti_allegati_ins, permetti_allegati_del");

$allegati_ins=$info_tab['permetti_allegati_ins'];
$allegati_del=$info_tab['permetti_allegati_del'];

if(!RegTools::is_tabella($tabella) || $id==''){

	openErrorGenerico(_('Request error'),false);
	exit;
}

// CERCA ALLEGATI PER QUESTA TABELLA
$qa=$vmreg->query("SELECT * FROM "._TABELLA_ALLEGATO."
				WHERE tipoentita='$tabella'
				AND codiceentita='$id'
				ORDER BY nomefileall, lastdata");

$num_allegati=$vmreg->num_rows($qa);

$matrice_info_allegati=$vmreg->fetch_assoc_all($qa);

$files = array('sty/linguette.css','js/uploadprogress/BytesUploaded.js','js/uploadprogress/LoadVars.js','js/clona_attach.js','sty/attach.css');

$INIZIO_LAYOUT= openLayout1("Allegati",$files,'popup');

echo str_replace("","",$INIZIO_LAYOUT);

echo "\n";

echo "
"._('Attachments for record')." ".$_GET['id']." "._('of table')." ".$_GET['t']."
";

echo "
";

$JS_aggiorna= (isset($_GET['feed']) && $_GET['feed']=='ok') ?  'window.opener.richiediAL();' : "";

	echo "

	";

	if(isset($_GET['feed']) && $_GET['feed']=='ko'){

		$messaggi=str_replace("|","
",$_GET['msg']);

		echo "
"._('Warning!')."
\n$messaggi
\n";
	}

	echo "

"._('Attachments')."

			", ($allegati_ins) ? "
"._('Add attachment')."
" : "","

";

	// opzione scarica tutti
	if($num_allegati>=2){

		$link_scarica_tutti=" - Scarica tutti gli allegati";
	}
	else{
		$link_scarica_tutti='';
	}

	// LINGUETTA NUOVO FLUSSO
	echo "

"._('Attachments for this record').": $num_allegati $link_scarica_tutti

		";

		// MOSTRA GLI ALLEGATI
		for($i=0;$i<count($matrice_info_allegati);$i++){

			$dimensione = RegTools::allegato_filesize($matrice_info_allegati[$i]['codiceallegato']);

			$scarica=(preg_match('|Dimensione|i',$dimensione)) ? "": " - Scarica";
			$elimina=($allegati_del) ? " - "._('Delete')."" : "";

			$estensione=substr($matrice_info_allegati[$i]['nomefileall'],-3,3);

			if($estensione=='gif' || $estensione=='jpg' || $estensione=='png' ||
			$estensione=='GIF' || $estensione=='JPG' || $estensione=='PNG'){

				$immagine='

';
			}
			else{

				$immagine = img_filetype($matrice_info_allegati[$i]['nomefileall']);
			}

			echo "

".$immagine."

					".$matrice_info_allegati[$i]['nomefileall']."

					$dimensione $scarica $elimina

\n";
		}

	echo "

	";

	// LINGUETTA AMMINISTRAZIONE FLUSSI
	if($allegati_ins){
	echo "

		";
	?>
	<form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" onsubmit="bUploaded.start('fileprogress');">

<input type="file" name="gfile[]" size="60" /> rimuovi

				<?php echo _('Add another file');?>

				<input type="hidden" name="t" value="<?php echo $tabella;?>" />
				<input type="hidden" name="id" value="<?php echo $id;?>" />

				<input type="submit" name="aggiungi" value="  <?php echo _('Send');?>  " onclick="submit();this.value='<?php echo _('Please wait...');?>';this.disabled=true;" />

		</form>

<?php

	echo "
\n";
	} // -- fine clausola nuovi inserimenti

echo "
\n\n";

echo closeLayout1();
?>


text:
/**
 *
Title: HibernateDAO Class>
 *
Description:	HibernateDAO is default implemention of DAO through Hibernate ORM tool.
 * Copyright:    Copyright (c) year
 * Company: Washington University, School of Medicine, St. Louis.
 * @author Gautam Shetty
 * @version 1.00
 * Created on Mar 16, 2005
 */

package edu.wustl.dao;

import java.util.Collection;
import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;

import edu.wustl.common.audit.AuditManager;
import edu.wustl.common.audit.Auditable;
import edu.wustl.common.beans.SessionDataBean;
import edu.wustl.common.domain.AuditEventLog;
import edu.wustl.common.exception.AuditException;
import edu.wustl.common.exception.ErrorKey;
import edu.wustl.common.util.logger.Logger;
import edu.wustl.dao.condition.EqualClause;
import edu.wustl.dao.exception.DAOException;
import edu.wustl.dao.util.DAOConstants;
import edu.wustl.dao.util.DAOUtility;

/**
 * Default implementation of DAO through Hibernate ORM tool.
 * @author kapil_kaveeshwar
 */
public class HibernateDAOImpl extends AbstractDAOImpl implements HibernateDAO
{

    /**
     * logger Logger - Generic logger.
     */
      private static org.apache.log4j.Logger logger =
           Logger.getLogger(HibernateDAOImpl.class);

	/**
	 * specify Session instance.
	 */
     private Session session = null;

     /**
 	 * Audit Manager.
 	 */
 	private AuditManager auditManager;

	/**
	 * This method will be used to establish the session with the database.
	 * Declared in  class.
	 * @param sessionDataBean session Data.
	 * @throws DAOException generic DAOException.
	 */
	public void openSession(SessionDataBean sessionDataBean) throws DAOException
	{
		logger.debug("Open the session");
	    auditManager = getAuditManager(sessionDataBean);
		session = connectionManager.currentSession();
	}

	/**
	 * This method will be used to close the session with the database.
	 * Declared in  class.
	 * @throws DAOException generic DAOException.
	 */
	public void closeSession() throws DAOException
	{
		logger.debug("Close the session");
		auditManager = null;
		connectionManager.closeSession();
	}

	/**
	 * Commit the database level changes.
	 * Declared in  class.
	 * @throws DAOException generic DAOException.
	 */
	public void commit() throws DAOException
	{
		logger.debug("Session commit");
		auditManager.insert(this);
		connectionManager.commit();
	}

	/**
	 * RollBack all the changes after last commit.
	 * Declared in  class.
	 * @throws DAOException generic DAOException.
	 */
	public void rollback() throws DAOException
	{
		logger.debug("Session rollback");
		connectionManager.rollback();
	}

	/**
	 * Saves the persistent object in the database.
	 * @param obj The object to be saved.
	 * @param isAuditable is Auditable.
	 * @throws DAOException generic DAOException.
	 */
	public void insert(Object obj,boolean isAuditable) throws DAOException
	{
		logger.debug("Insert Object");
		try
		{
			session.save(obj);
			if (obj instanceof Auditable && isAuditable)
			{
				auditManager.audit((Auditable)obj, null, "INSERT");
			}
		}
		catch (HibernateException hibExp)
		{
			ErrorKey errorKey = ErrorKey.getErrorKey("db.operation.error");
			throw new DAOException(errorKey,hibExp,"HibernateDAOImpl.java :"+
					DAOConstants.INSERT_OBJ_ERROR);
		}
		catch (AuditException exp)
		{
			ErrorKey errorKey = ErrorKey.getErrorKey("db.audit.error");
			throw new DAOException(errorKey,exp,"HibernateDAOImpl.java :");
		}

	}

	/**
	 * updates the object into the database.
	 * @param obj Object to be updated in database
	 * @throws DAOException : generic DAOException
	 */
	public void update(Object obj) throws DAOException
	{
		logger.debug("Update Object");
		try
		{
			session.update(obj);
		}
		catch (HibernateException hibExp)
		{
			ErrorKey errorKey = ErrorKey.getErrorKey("db.operation.error");
			throw new DAOException(errorKey,hibExp,"HibernateDAOImpl.java :"+
					DAOConstants.UPDATE_OBJ_ERROR);
		}
	}

	/**
	 * update and audit the object to the database.
	 * @param obj Object to be updated in database
	 * @param oldObj old object.
	 * @throws DAOException : generic DAOException
	 */
	public void update(Object obj, Object oldObj) throws DAOException
	{
		try
		{
			update(obj);
			auditManager.audit((Auditable)obj, (Auditable) oldObj, "UPDATE");
		}
		catch (AuditException exp)
		{
			ErrorKey errorKey = ErrorKey.getErrorKey("db.audit.error");
			throw new DAOException(errorKey,exp,"HibernateDAOImpl.java :");
		}
	}

	/**
	 * Deletes the persistent object from the database.
	 * @param obj The object to be deleted.
	 * @throws DAOException generic DAOException.
	 */
	public void delete(Object obj) throws DAOException
	{
		logger.debug("Delete Object");
		try
		{
			session.delete(obj);
		}
		catch (HibernateException hibExp)
		{
			logger.error(hibExp.getMessage() , hibExp);
			ErrorKey errorKey = ErrorKey.getErrorKey("db.operation.error");
			throw new DAOException(errorKey,hibExp,"HibernateDAOImpl.java :"+
					DAOConstants.DELETE_OBJ_ERROR);
		}
	}

	/**
	 * Retrieves the records for class name in sourceObjectName according
	 * to field values passed in the passed session.
	 * @param sourceObjectName source Object Name.
	 * @param selectColumnName select Column Name.
	 * @param queryWhereClause where column conditions
	 * @param onlyDistinctRows true if only distinct rows should be selected.
	 * @return List.
	 * @throws DAOException generic DAOException.
	 */
	public List retrieve(String sourceObjectName,String[] selectColumnName,
			QueryWhereClause queryWhereClause,boolean onlyDistinctRows) throws DAOException
	{
		logger.debug("Inside retrieve method");
		List<Object> list;
		try
		{
			StringBuffer queryStrBuff = new StringBuffer();
			String className = DAOUtility.getInstance().parseClassName(sourceObjectName);
			Query query;

			generateSelectPartOfQuery(selectColumnName, queryStrBuff, className);
			generateFromPartOfQuery(sourceObjectName, queryStrBuff, className);

			if(queryWhereClause != null)
			{
				queryStrBuff.append(queryWhereClause.toWhereClause());
			}
			query = session.createQuery(queryStrBuff.toString());

			list = query.list();

		}
		catch (Exception exp)
		{
			logger.error(exp.getMessage(), exp);
			ErrorKey errorKey = ErrorKey.getErrorKey("db.operation.error");
			throw new DAOException(errorKey, exp,"HibernateDAOImpl.java :"
					+DAOConstants.RETRIEVE_ERROR);
		}
		return list;
	}

	/**
	 * Generate Select Block.
	 * @param selectColumnName select Column Name.
	 * @param sqlBuff sqlBuff
	 * @param className class Name.
	 */
	private void generateSelectPartOfQuery(String[] selectColumnName, StringBuffer sqlBuff, String className)
	 {
		logger.debug("Prepare select part of query.");
		if (selectColumnName != null && selectColumnName.length > 0)
		 {
		    sqlBuff.append("Select ");
		    for (int i = 0; i < selectColumnName.length; i++)
		     {
		        sqlBuff.append(DAOUtility.getInstance().
		        		createAttributeNameForHQL(className, selectColumnName[i]));
		        if (i != selectColumnName.length - 1)
		        {
		            sqlBuff.append(", ");
		        }
		    }
		    sqlBuff.append("   ");
		}
	}

	/**
	 * @param sourceObjectName source Object Name.
	 * @param sqlBuff query buffer
	 * @param className gives the class name
	 */
	private void generateFromPartOfQuery(String sourceObjectName,
			StringBuffer sqlBuff, String className)
	{
		logger.debug("Prepare from part of query");
		sqlBuff.append("from " + sourceObjectName
		        + " " + className);
	}

	/**
	 * Retrieve Object.
	 * @param sourceObjectName source Object Name.
	 * @param identifier identifier.
	 * @return object.
	 * @throws DAOException generic DAOException.
	 */
	public Object retrieveById(String sourceObjectName, Long identifier)
	 throws DAOException
	 {
		logger.debug("Inside retrieve method");
		try
		{
			Object object = session.get(Class.forName(sourceObjectName), identifier);
			//HibernateProxy hibernatProxy = (HibernateProxy) object;
			//return (Object)hibernatProxy.getHibernateLazyInitializer().getImplementation();
			//return HibernateMetaData.getProxyObjectImpl(object);
			//session.evict(object);
			return object;
		}
		catch (Exception exp)
		{
			logger.error(exp.getMessage(), exp);
			ErrorKey errorKey = ErrorKey.getErrorKey("db.operation.error");
			throw new DAOException(errorKey, exp,"HibernateDAOImpl.java :"+
					DAOConstants.RETRIEVE_ERROR);
		}

	}

	/**
	 * Executes the HQL query.
	 * @param query HQL query to execute.
	 * @return List.
	 * @throws DAOException generic DAOException.
	 */
	public List executeQuery(String query) throws DAOException
	{
		logger.debug("Execute query");
		try
		{
	    	Query hibernateQuery = session.createQuery(query);
		    List <Object> returner = hibernateQuery.list();
		    return returner;
		}
		catch(HibernateException hiberExp)
		{
			logger.error(hiberExp.getMessage(), hiberExp);
			ErrorKey errorKey = ErrorKey.getErrorKey("db.operation.error");
			throw new DAOException(errorKey, hiberExp,"HibernateDAOImpl.java :"+
					DAOConstants.EXECUTE_QUERY_ERROR);
		}
	}

	/**
	 * This method executes the named query and returns the results.
	 * @param queryName : handle for named query.
	 * @return result as list of Object
	 */
	public List executeNamedQuery(String queryName)
	{
		Query query=session.getNamedQuery(queryName);
		return query.list();
	}

	/**
	 * This method returns named query.
	 * @param queryName : handle for named query.
	 * @return Query named query
	 */
	public Query getNamedQuery(String queryName)
	{
		return session.getNamedQuery(queryName);
	}

	/**
	 * add Audit Event Logs.
	 * @param auditEventDetailsCollection audit Event Details Collection.
	 */
	public void addAuditEventLogs(Collection<AuditEventLog> auditEventDetailsCollection)
	{
		logger.debug("Add audit event logs");
		auditManager.addAuditEventLogs(auditEventDetailsCollection);
	}

	/**
	 * This will be called to initialized the Audit Manager.
	 * @param sessionDataBean : This will holds the session data.
	 * @return AuditManager : instance of AuditManager
	 */
	private static AuditManager getAuditManager(SessionDataBean sessionDataBean)
	{
		logger.debug("Initialize audit manager");
		AuditManager auditManager = new AuditManager();
		if (sessionDataBean == null)
		{
			auditManager.setUserId(null);
		}
		else
		{
			auditManager.setUserId(sessionDataBean.getUserId());
			auditManager.setIpAddress(sessionDataBean.getIpAddress());
		}
		return auditManager;
	}

	/**
	 * Retrieves the records for class name in sourceObjectName according
	 * to field values passed in the passed session.
	 * @param sourceObjectName source Object Name.
	 * @param selectColumnName select Column Name.
	 * @param queryWhereClause where column conditions
	 * @return List.
	 * @throws DAOException generic DAOException.
	 */
	public List retrieve(String sourceObjectName,
			String[] selectColumnName, QueryWhereClause queryWhereClause)
			throws DAOException
	{
		return retrieve(sourceObjectName, selectColumnName,queryWhereClause,false);
	}

	/**
	 * Retrieves all the records for class name in sourceObjectName.
	 * @param sourceObjectName Contains the class Name whose records are to be retrieved.
	 * @return List.
	 * @throws DAOException generic DAOException.
	 */
	public List retrieve(String sourceObjectName) throws DAOException
	{
		logger.debug("Inside retrieve method");
		String[] selectColumnName = null;
		return retrieve(sourceObjectName, selectColumnName, null,false);
	}

	/**
	 * Retrieves all the records for class name in sourceObjectName.
	 * @param sourceObjectName Contains the class Name whose records are to be retrieved.
	 * @param whereColumnName Column name to be included in where clause.
	 * @param whereColumnValue Value of the Column name that included in where clause.
	 * @return List.
	 * @throws DAOException generic DAOException.
	 */
	public List retrieve(String sourceObjectName, String whereColumnName, Object whereColumnValue)
			throws DAOException
	{
		logger.debug("Inside retrieve method");
		String[] selectColumnName = null;

		QueryWhereClause queryWhereClause = new QueryWhereClause(sourceObjectName);
		queryWhereClause.addCondition(new EqualClause(whereColumnName,whereColumnValue));

		return retrieve(sourceObjectName, selectColumnName,queryWhereClause,false);
	}

	/**
	 * @param sourceObjectName Contains the class Name whose records are to be retrieved.
	 * @param selectColumnName select Column Name.
	 * @return List.
	 * @throws DAOException generic DAOException.
	 */
	public List retrieve(String sourceObjectName, String[] selectColumnName)
	throws DAOException
	{
		logger.debug("Inside retrieve method");
		return retrieve(sourceObjectName, selectColumnName,null,false);
	}

	/**
	 * Retrieve Attribute.
	 * @param objClass object.
	 * @param identifier identifier.
	 * @param attributeName attribute Name.
	 * @param columnName Name of the column.
	 * @return Object.
	 * @throws DAOException generic DAOException.
	 */
	public List retrieveAttribute(Class objClass, Long identifier,
			String attributeName,String columnName) throws DAOException
	 {
		logger.debug("Retrieve attributes");
		try
		{
			String[] selectColumnName = {attributeName};
			QueryWhereClause queryWhereClause = new QueryWhereClause(objClass.getName());
			queryWhereClause.addCondition(new EqualClause(columnName,identifier));
			return retrieve(objClass.getName(), selectColumnName, queryWhereClause, false);
		}
		catch (HibernateException exception)
		{
			ErrorKey errorKey = ErrorKey.getErrorKey("db.operation.error");
			throw new DAOException(errorKey, exception,"HibernateDAOImpl.java :"+
					DAOConstants.RETRIEVE_ERROR);
		}
	}

	/**
	 * @param excp : Exception Object.
	 * @return : It will return the formated messages.
	 * @throws DAOException :
	 *//*
	public String formatMessage(Exception excp) throws DAOException
	{
		logger.debug("Format error message");
		String formatMessage = DAOConstants.TAILING_SPACES;
		String appName = CommonServiceLocator.getInstance().getAppHome();
		IDAOFactory daoFactory = DAOConfigFactory.getInstance().getDAOFactory(appName);
		JDBCDAO jdbcDAO = daoFactory.getJDBCDAO();
		//HibernateMetaData.initHibernateMetaData(jdbcDAO.getConnectionManager().getConfiguration());
		formatMessage = jdbcDAO.formatMessage(excp,getCleanConnection());
		getConnectionManager().closeConnection();
		return formatMessage;
	}*/

	/**
	 * This method will be called to obtain clean session.
	 * @return session object.
	 *@throws DAOException :Generic DAOException.
	 *//*
	public Session getCleanSession() throws DAOException
	{
		logger.debug("Get clean session");
		return connectionManager.getCleanSession();
	}

	*//**
	 *This method will be called to close current connection.
	 *@throws DAOException :Generic DAOException.
	 *//*
	public void closeCleanSession() throws DAOException
	{
		logger.debug("Close clean session");
		connectionManager.closeCleanSession();
	}
*/
}


text:
// THIS VERSION IS USED FOR SPECIFIC ROBOT LOGGING OF ALL JOINT VALUES
#include "vision_test.hpp"

vision_test::vision_test(ros::NodeHandle n)
{
  nh = n;
  subscribe_robot_status = nh.subscribe("/rovi2/robot_node/Robot_state",0,&vision_test::robot_status_callback,this);
  subscribe_triangulated = nh.subscribe("/ball_locator_3d/pos_triangulated",0,&vision_test::triangulated_callback,this);
  subscribe_estimated = nh.subscribe("/ball_locator_3d/kalman_estimate",0,&vision_test::estimated_callback,this);
  subscribe_predicted = nh.subscribe("/ball_locator_3d/kalman_prediction",0,&vision_test::predicted_callback,this);
  subscribe_xy_left = nh.subscribe("/ball_locator_3d/pos_left",0,&vision_test::xy_left_callback,this);
  subscribe_xy_right = nh.subscribe("/ball_locator_3d/pos_right",0,&vision_test::xy_right_callback,this);

  //_workcell = rw::loaders::WorkCellLoader::Factory::load("/home/nikolaj/catkin_ws_A/src/rovi2/WorkStation_3/WC3_Scene.wc.xml");
  _workcell = rw::loaders::WorkCellLoader::Factory::load("/home/mathias/catkin_ws/src/rovi2/WorkStation_3/WC3_Scene.wc.xml");
  _device = _workcell->findDevice("UR1");
  _state =  _workcell->getDefaultState();

  // Get frames
  robot_base = _workcell->findFrame("UR1.Base");
  TCP_marker = _workcell->findFrame("WSG50.BallError");
  if(robot_base == NULL)
  {
    std::cout << "robot_base not found" << std::endl;
  }
  if(TCP_marker == NULL)
  {
    std::cout << "TCP_marker not found" << std::endl;
  }
  std::cout << "Setup complete" << std::endl;

}

vision_test::~vision_test()
{}

void vision_test::robot_status_callback(const rovi2::State &msg)
{
  robot_state = msg;

 rw::math::Q q = toRw(robot_state.q);
  _device->setQ(q,_state);
  rw::math::Vector3D<double> robot_p = robot_base->fTf(TCP_marker,_state).P();

  // Transformation matrices
  rw::math::Vector3D<double> transP(-0.116075, -1.67057, 1.33754);
  rw::math::Rotation3D<double> transR(rw::math::RPY<double>(-0.0375525, -0.0132076, -2.0942).toRotation3D());
  rw::math::Transform3D<double> trans(transP, transR);
//Transform camera points to robot points
  //rw::math::Vector3D<double> triangulated_pos_robot(triangulated_pos.x, triangulated_pos.y, triangulated_pos.z);
  //triangulated_pos_robot = trans*triangulated_pos_robot;
  //rw::math::Vector3D<double> estimated_pos_robot(estimated_pos.x, estimated_pos.y, estimated_pos.z);
  //estimated_pos_robot = trans*estimated_pos_robot;
  rw::math::Vector3D<double> predicted_pos_robot(predicted_pos.x,predicted_pos.y,predicted_pos.z);
  predicted_pos_robot = trans*predicted_pos_robot;

  std::ofstream file;
  file.open("vision_test.log",std::ios::app);
  file << predicted_pos_robot(0) << "\t";
  file << predicted_pos_robot(1) << "\t";
  file << predicted_pos_robot(2) << "\t";
  file << robot_p(0) << "\t";
  file << robot_p(1) << "\t";
  file << robot_p(2) << "\t";
  file << q(0) << "\t";
  file << q(1) << "\t";
  file << q(2) << "\t";
  file << q(3) << "\t";
  file << q(4) << "\t";
  file << q(5) << "\t";
  file << std::endl;
  file.close();
  //ROS_INFO("Got a state");
}

void vision_test::triangulated_callback(const rovi2::position3D &msg)
{
  triangulated_pos = msg;
  //ROS_INFO("Triangulated: %f\t%f\t%f", msg.x, msg.y msg.z);
}

void vision_test::estimated_callback(const rovi2::position3D &msg)
{
  estimated_pos = msg;
  //ROS_INFO("Got an estimate");
}

void vision_test::xy_left_callback(const rovi2::position2D &msg)
{
  xy_left_position = msg;
}

void vision_test::xy_right_callback(const rovi2::position2D &msg)
{
  xy_right_position = msg;
}

void vision_test::predicted_callback(const rovi2::position3D &msg)
{

	predicted_pos = msg;
  /*// Convert ros q to rw q, set state and conver to cartesian space (forward kinematics)
  rw::math::Q q = toRw(robot_state.q);
  _device->setQ(q,_state);
  rw::math::Vector3D<double> robot_p = robot_base->fTf(TCP_marker,_state).P();

  // Transformation matrices
  rw::math::Vector3D<double> transP(-0.116075, -1.67057, 1.33754);
  rw::math::Rotation3D<double> transR(rw::math::RPY<double>(-0.0375525, -0.0132076, -2.0942).toRotation3D());
  rw::math::Transform3D<double> trans(transP, transR);

  //Transform camera points to robot points
  rw::math::Vector3D<double> triangulated_pos_robot(triangulated_pos.x, triangulated_pos.y, triangulated_pos.z);
  triangulated_pos_robot = trans*triangulated_pos_robot;
  rw::math::Vector3D<double> estimated_pos_robot(estimated_pos.x, estimated_pos.y, estimated_pos.z);
  estimated_pos_robot = trans*estimated_pos_robot;
  rw::math::Vector3D<double> predicted_pos_robot(msg.x,msg.y,msg.z);
  predicted_pos_robot = trans*predicted_pos_robot;

  std::ofstream file;
  file.open("vision_test.log",std::ios::app);
  file << triangulated_pos_robot(0) << "\t";
  file << triangulated_pos_robot(1) << "\t";
  file << triangulated_pos_robot(2) << "\t";
  file << estimated_pos_robot(0) << "\t";
  file << estimated_pos_robot(1) << "\t";
  file << estimated_pos_robot(2) << "\t";
  file << predicted_pos_robot(0) << "\t";
  file << predicted_pos_robot(1) << "\t";
  file << predicted_pos_robot(2) << "\t";
  file << robot_p(0) << "\t";
  file << robot_p(1) << "\t";
  file << robot_p(2) << "\t";
  file << xy_left_position.x << "\t";
  file << xy_left_position.y << "\t";
  file << xy_right_position.x << "\t";
  file << xy_right_position.y << "\t";
  file << std::endl;
  file.close();
	*/
  //ROS_INFO("Got a prediction");
}

rw::math::Q vision_test::toRw(const rovi2::Q& q)
{ // From RobWork
  rw::math::Q res(q.data.size());
  for (std::size_t i = 0; i < q.data.size(); ++i)
  {
    res(i) = q.data[i];
  }
  return res;
}


text:
package io.cattle.platform.configitem.server.model;

import io.cattle.platform.configitem.model.Client;
import io.cattle.platform.configitem.model.ItemVersion;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;

public interface Request {

    public static final int OK = 200;
    public static final int NOT_FOUND = 404;

    ItemVersion getAppliedVersion();

    ItemVersion getCurrentVersion();

    String getItemName();

    Client getClient();

    void setResponseCode(int code);

    void setContentType(String contentType);

    OutputStream getOutputStream() throws IOException;

    Map<String, Object> getParams();

}


text:
require 'rubygems'
require 'watir-webdriver'
# 本程序用于向Testin网站提交app进行标准兼容测试

@base_url = 'http://www.testin.cn/portal.action?op=Portal.index' #登录Testin网站
@login_url = "http://sso.testin.cn/user.action?op=Login.check&domain=real.testin.cn&ru=http%3A%2F%2Frealauto.testin.cn%2Fnativeapp.action%3Fop%3DApp.list"
#网站用户名
email = "laiyuncong8404@163.com"
#网站密码
pwd = "19840415" #请将*更换为实际密码
#App登录用户名
loginName = '13540774227'
#App登录密码
loginPass = "123456"

dr = Watir::Browser.new :chrome
Watir.default_timeout = 300 #设置等待时间300s
dr.window.maximize()
# dr.goto @base_url
# sleep 5
# dr.link(:text, "用户登录").click
dr.goto @login_url
sleep 5
dr.text_field(:name, 'email').set email
dr.text_field(:name, 'pwd').set pwd
dr.button(:tag_name, 'button').click #登录按钮

dr.link(:text, '创建测试').click
# dr.element(:css, '#app_compatible_test').click #标准兼容测试
js="var q=document.documentElement.scrollTop=10000"  #移动滚动条到底部
dr.execute_script(js)
sleep 5
dr.link(:id, 'next_step').click
sleep 5
dr.link(:id, 'button_continue').click
sleep 5
dr.select_list(:id, 'sel_detail_type').select('其他应用')
sleep 2
dr.element(:css, '#commit_package').click #上传App按钮
sleep 5

system (File.join(File.dirname(__FILE__), 'uploadApp.exe')) #不支持直接设置,需要调用autoit
dr.element(:css, "#app_progress_success").wait_until_present #等待app上传完成
dr.element(:css,'#monkeyselect').checkbox(:name, 'monkeyflag').set
sleep 5
dr.element(:css,'#select_txt_file_name_checkbox').click
dr.element(:css,'#upload_app_tr_opt > td > dl:nth-child(1) > dt > label > input[type="radio"]').click
sleep 5
dr.text_field(:name, 'loginName').set loginName
dr.text_field(:name, 'loginPass').set loginPass
dr.element(:css,'#upload_commit.green_button').click
sleep 5

android_os = dr.element(:css, '#selected_area > table:nth-child(1) > tbody').checkboxes(:css, 'input[type=checkbox]')
puts "#{android_os.size}" #安卓系统类型总数
for os in android_os
	os.set
end

dr.checkbox(:value, 'zhenhai.lai@changhong.com').set
dr.element(:css,'#finish.green_button').click #提交测试按钮
dr.quit


text: DROP TABLE IF EXISTS card_prices;