<commit_before><%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/nlevelcombo.tld" prefix="ncombo"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page import="edu.wustl.query.util.global.CompositeQueryOperations"%>
<%@ page import="edu.wustl.query.enums.QueryType" %>
<script language="JavaScript" type="text/javascript" src="dhtml_comp/js/dhtmlwindow.js"></script>
<script language="JavaScript" type="text/javascript" src="dhtml_comp/js/modal.js"></script>
<script language="JavaScript" type="text/javascript" src="jss/advancequery/newReleaseMsg.js"></script>
<link rel="stylesheet" type="text/css" href="css/advancequery/catissue_suite.css" />
<link href="css/advancequery/inside.css" rel="stylesheet" type="text/css" />
<script  src="jss/advancequery/workflows.js"></script>
<script  src="jss/advancequery/wz_tooltip.js"></script>
<script src="jss/ajax.js"></script>	
<script type="text/JavaScript">

<%
String qType_GetCount= (QueryType.GET_COUNT).type;
String qType_GetData= (QueryType.GET_DATA).type;
%>
var previousProject="-1";

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function test(title)
{
	 var t =	escape(title);
	executeGetCountQuery(escape(t),0);
}

function showPopUp(pageOf)
{
	var url='QueryAction.do?pageOf='+pageOf+'&queryId=queryId&queryTitle=queryTitle&queryType=queryType';
	pvwindow=dhtmlmodal.open('Select queries', 'iframe', url,'Select queries', 'width=930px,height=400px,center=1,resize=1,scrolling=1');
}

function updateUI()
{
	addQuery();
}

function unionQueries()
{
	addCQToList("<%=CompositeQueryOperations.UNION.getOperation()%>");
}

function intersectQueries()
{
	addCQToList("<%=CompositeQueryOperations.INTERSECTION.getOperation()%>");
}

function minusQueries()
{
	addCQToList("<%=CompositeQueryOperations.MINUS.getOperation()%>");
}

function addCQToList(operation)
{
	var queryIdsToAdd='';
	var queryCount=0;
	queryCount=document.getElementById("table1").rows.length;
	var selectedQueryCount=0;
	for(var counter=0;counter<queryCount;counter++)
	{
		var checkboxControl=document.getElementById("checkbox_"+(counter));
		if(checkboxControl!=null && checkboxControl!=undefined && checkboxControl.checked==true)
		{
			queryIdsToAdd=queryIdsToAdd+","+counter;
			selectedQueryCount=selectedQueryCount+1;
		}
	}

	if(queryIdsToAdd!=""&& selectedQueryCount==2)
	{
		
		createCQ(queryIdsToAdd,operation,queryCount);
		uncheckselectedCheckBoxes();
		
	}		
}

function uncheckselectedCheckBoxes()
{
	var queryCount=0;
	queryCount=document.getElementById("table1").rows.length;
		for(var counter=0;counter<queryCount;counter++)
			{
				var checkboxControl=document.getElementById("checkbox_"+(counter));
				if(checkboxControl!=null && checkboxControl!=undefined && checkboxControl.checked==true)
				{
					checkboxControl.checked=false;
				}
			}
}
function createCQ(queryIdsToAdd,operation,queryCount)
{
	var queryIds=queryIdsToAdd.split(",");
	var operandsTdContent="";
	var cqTitle="";
	var cqQueryId="";
	var operandsCounter=0;
	var expression="";
	for(var counter=0;counter<queryIds.length;counter++)
	{
		if(queryIds[counter]!=null && queryIds[counter]!='')
		{
			if( cqTitle=='')
			{
				cqTitle="[ Query : "+document.getElementById("displayQueryTitle_"+queryIds[counter]).value+" ]";
			}
			else
			{
				cqTitle=cqTitle+" "+operation+" "+"[ Query : "+document.getElementById("displayQueryTitle_"+queryIds[counter]).value+" ]";
			}
			if(cqQueryId=='')
			{
				cqQueryId="("+document.getElementById("selectedqueryId_"+queryIds[counter]).value+")";
				operandsTdContent=document.getElementById("selectedqueryId_"+queryIds[counter]).value;
				expression=document.getElementById("selectedqueryId_"+queryIds[counter]).value;

			}
			else
			{
				cqQueryId="("+document.getElementById("selectedqueryId_"+queryIds[counter]).value+")";
				operandsTdContent=operandsTdContent+"_"+document.getElementById("selectedqueryId_"+queryIds[counter]).value;
	
				expression=expression+"_"+document.getElementById("expression_"+queryIds[counter]).value+"_"+shortOperator(operation);
			}
			operandsCounter=operandsCounter+1;
		}
	}
	var cqType="Count";
	var cqId="";

	var rowContents=new Array(7);
	rowContents[0]=createCheckBox("chkbox","checkbox_"+queryCount,'',queryCount,false);
	rowContents[1]=createTextElement(cqTitle);
	rowContents[2]=createTextElement(cqType);
	//rowContents[3]=createTextElement(operandsTdContent);
	//rowContents[3]=getSelectObjectControl();
	rowContents[4]=createTextElement("");
	rowContents[5]=createHiddenElement("selectedqueryId","selectedqueryId_"+queryCount,operandsTdContent);
	//rowContents[4].appendChild(createHiddenElement("identifier","identifier_"+operandsTdContent,operandsTdContent));
	rowContents[6]=cqTitle;
	rowContents[7]=cqType;
	
	var operatorsTdContent=operation;
	//uncommented for the underscore separated operation string 
	for(var counter=0;counter<operandsCounter-2;counter++)
	{
		operatorsTdContent=operatorsTdContent+"_"+operation;
	}
	//create a table containing tbody with id "table1"
	addRowToTable("table1",rowContents,operandsTdContent,operatorsTdContent,expression);	
}

function shortOperator(operation)
{
	if(operation='Union')
		return "+";
		
	if(operation='Intersection')
		return "*";
	
	if(operation='Minus')
		return "-";
	
	return "";//for NONE
}


function submitWorflow()
{
	document.forms[0].submit();
}
function cancelGetCountQuery(queryId,executionLogId,removeExecutedCount)
{	
<commit_msg>changes for post-fix expression<commit_after><%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/nlevelcombo.tld" prefix="ncombo"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page import="edu.wustl.query.util.global.CompositeQueryOperations"%>
<%@ page import="edu.wustl.query.enums.QueryType" %>
<script language="JavaScript" type="text/javascript" src="dhtml_comp/js/dhtmlwindow.js"></script>
<script language="JavaScript" type="text/javascript" src="dhtml_comp/js/modal.js"></script>
<script language="JavaScript" type="text/javascript" src="jss/advancequery/newReleaseMsg.js"></script>
<link rel="stylesheet" type="text/css" href="css/advancequery/catissue_suite.css" />
<link href="css/advancequery/inside.css" rel="stylesheet" type="text/css" />
<script  src="jss/advancequery/workflows.js"></script>
<script  src="jss/advancequery/wz_tooltip.js"></script>
<script src="jss/ajax.js"></script>	
<script type="text/JavaScript">

<%
String qType_GetCount= (QueryType.GET_COUNT).type;
String qType_GetData= (QueryType.GET_DATA).type;
%>
var previousProject="-1";

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function test(title)
{
	 var t =	escape(title);
	executeGetCountQuery(escape(t),0);
}

function showPopUp(pageOf)
{
	var url='QueryAction.do?pageOf='+pageOf+'&queryId=queryId&queryTitle=queryTitle&queryType=queryType';
	pvwindow=dhtmlmodal.open('Select queries', 'iframe', url,'Select queries', 'width=930px,height=400px,center=1,resize=1,scrolling=1');
}

function updateUI()
{
	addQuery();
}

function unionQueries()
{
	addCQToList("<%=CompositeQueryOperations.UNION.getOperation()%>");
}

function intersectQueries()
{
	addCQToList("<%=CompositeQueryOperations.INTERSECTION.getOperation()%>");
}

function minusQueries()
{
	addCQToList("<%=CompositeQueryOperations.MINUS.getOperation()%>");
}

function addCQToList(operation)
{
	var queryIdsToAdd='';
	var queryCount=0;
	queryCount=document.getElementById("table1").rows.length;
	var selectedQueryCount=0;
	for(var counter=0;counter<queryCount;counter++)
	{
		var checkboxControl=document.getElementById("checkbox_"+(counter));
		if(checkboxControl!=null && checkboxControl!=undefined && checkboxControl.checked==true)
		{
			queryIdsToAdd=queryIdsToAdd+","+counter;
			selectedQueryCount=selectedQueryCount+1;
		}
	}

	if(queryIdsToAdd!=""&& selectedQueryCount==2)
	{
		
		createCQ(queryIdsToAdd,operation,queryCount);
		uncheckselectedCheckBoxes();
		
	}		
}

function uncheckselectedCheckBoxes()
{
	var queryCount=0;
	queryCount=document.getElementById("table1").rows.length;
		for(var counter=0;counter<queryCount;counter++)
			{
				var checkboxControl=document.getElementById("checkbox_"+(counter));
				if(checkboxControl!=null && checkboxControl!=undefined && checkboxControl.checked==true)
				{
					checkboxControl.checked=false;
				}
			}
}
function createCQ(queryIdsToAdd,operation,queryCount)
{
	var queryIds=queryIdsToAdd.split(",");
	var operandsTdContent="";
	var cqTitle="";
	var cqQueryId="";
	var operandsCounter=0;
	var expression="";
	for(var counter=0;counter<queryIds.length;counter++)
	{
		if(queryIds[counter]!=null && queryIds[counter]!='')
		{
			if( cqTitle=='')
			{
				cqTitle="[ Query : "+document.getElementById("displayQueryTitle_"+queryIds[counter]).value+" ]";
			}
			else
			{
				cqTitle=cqTitle+" "+operation+" "+"[ Query : "+document.getElementById("displayQueryTitle_"+queryIds[counter]).value+" ]";
			}
			if(cqQueryId=='')
			{
				cqQueryId="("+document.getElementById("selectedqueryId_"+queryIds[counter]).value+")";
				operandsTdContent=document.getElementById("selectedqueryId_"+queryIds[counter]).value;
				expression=document.getElementById("expression_"+queryIds[counter]).value;

			}
			else
			{
				cqQueryId="("+document.getElementById("selectedqueryId_"+queryIds[counter]).value+")";
				operandsTdContent=operandsTdContent+"_"+document.getElementById("selectedqueryId_"+queryIds[counter]).value;
	
				expression=expression+"_"+document.getElementById("expression_"+queryIds[counter]).value+"_"+shortOperator(operation);
			}
			operandsCounter=operandsCounter+1;
		}
	}
	var cqType="Count";
	var cqId="";

	var rowContents=new Array(7);
	rowContents[0]=createCheckBox("chkbox","checkbox_"+queryCount,'',queryCount,false);
	rowContents[1]=createTextElement(cqTitle);
	rowContents[2]=createTextElement(cqType);
	//rowContents[3]=createTextElement(operandsTdContent);
	//rowContents[3]=getSelectObjectControl();
	rowContents[4]=createTextElement("");
	rowContents[5]=createHiddenElement("selectedqueryId","selectedqueryId_"+queryCount,operandsTdContent);
	//rowContents[4].appendChild(createHiddenElement("identifier","identifier_"+operandsTdContent,operandsTdContent));
	rowContents[6]=cqTitle;
	rowContents[7]=cqType;
	
	var operatorsTdContent=operation;
	//uncommented for the underscore separated operation string 
	for(var counter=0;counter<operandsCounter-2;counter++)
	{
		operatorsTdContent=operatorsTdContent+"_"+operation;
	}
	//create a table containing tbody with id "table1"
	addRowToTable("table1",rowContents,operandsTdContent,operatorsTdContent,expression);	
}

function shortOperator(operation)
{
	if(operation=='Union')
		return "+";
		
	if(operation=='Intersection')
		return "*";
	
	if(operation=='Minus')
		return "-";
	
	return "";//for NONE
}


function submitWorflow()
{
	document.forms[0].submit();
}
function cancelGetCountQuery(queryId,executionLogId,removeExecutedCount)
{	

{'fraction_non_alphanumeric': 0.17316533287927804, 'fraction_numerical': 0.0074919121403030815, 'mean_word_length': 7.481588447653429, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3432636', 'n_tokens_mistral': 4257, 'n_tokens_neox': 3997, 'n_words': 467}