<commit_before><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<tiles:importAttribute/>

<%-- The following should probably be turned into a tag at some stage --%>
<table border="1px" width="90%">
  <%-- The headers --%>
  <tr>
    <c:forEach var="column" items="${resultsTable.columns}">
      <th align="center" class="resultsHeader">
        <c:out value="${column.value.alias}"/>
        <c:choose>
          <c:when test="${column.value.visible}">
            <html:link action="/changeResults?method=hideColumn&columnAlias=${column.value.alias}">
              [<bean:message key="results.hideColumn"/>]
            </html:link>
          </c:when>
          <c:otherwise>
            <html:link action="/changeResults?method=showColumn&columnAlias=${column.value.alias}">
              [<bean:message key="results.showColumn"/>]
            </html:link>
          </c:otherwise>
        </c:choose>
      </th>
    </c:forEach>
  </tr>

  <%-- The data --%>

  <%-- Row --%>
  <c:forEach var="row" items="${resultsTable.results}" varStatus="status" begin="${resultsTable.start}" end="${resultsTable.end}">

    <c:set var="rowClass">
      <c:choose>
        <c:when test="${status.count % 2 == 1}">resultsOddRow</c:when>
        <c:otherwise>resultsEvenRow</c:otherwise>
      </c:choose>
    </c:set>

    <tr class="<c:out value="${rowClass}"/>">

      <c:forEach var="column" items="${resultsTable.columns}">
        <td>
          <c:if test="${column.value.visible}">
            <c:out value="${row[column.value.index]}"/>
          </c:if>
        </td>
      </c:forEach>
    </tr>
  </c:forEach>

</table>

<%-- "Displaying xxx to xxx of xxx rows" messages --%>
<c:choose>
  <c:when test="${resultsTable.sizeEstimate}">
    <bean:message key="results.pageinfo.estimate"
                  arg0="${resultsTable.start+1}"
                  arg1="${resultsTable.end+1}"
                  arg2="${resultsTable.size}"/>
  </c:when>
  <c:otherwise>
    <bean:message key="results.pageinfo.exact"
                  arg0="${resultsTable.start+1}"
                  arg1="${resultsTable.end+1}"
                  arg2="${resultsTable.size}"/>
  </c:otherwise>

</c:choose>

<%-- Paging controls --%>
<html:link action="/changeResults?method=first">
  <bean:message key="results.first"/>
</html:link>
<c:if test="${resultsTable.previousButton}">
  <html:link action="/changeResults?method=previous">
    <bean:message key="results.previous"/>
  </html:link>
</c:if>
<c:if test="${resultsTable.nextButton}">
  <html:link action="/changeResults?method=next">
    <bean:message key="results.next"/>
  </html:link>
</c:if>
<html:link action="/changeResults?method=last">
  <bean:message key="results.last"/>
</html:link>
<commit_msg>Added column moving up/down controls resultsTable.columns is now a List<commit_after><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<tiles:importAttribute/>

<%-- The following should probably be turned into a tag at some stage --%>
<table border="1px" width="90%">
  <%-- The headers --%>
  <tr>
    <c:forEach var="column" items="${resultsTable.columns}" varStatus="status">
      <th align="center" class="resultsHeader">
        <c:out value="${column.alias}"/>

        <%-- show/hide --%>
        <c:choose>
          <c:when test="${column.visible}">
            <html:link action="/changeResults?method=hideColumn&columnAlias=${column.alias}">
              [<bean:message key="results.hideColumn"/>]
            </html:link>
          </c:when>
          <c:otherwise>
            <html:link action="/changeResults?method=showColumn&columnAlias=${column.alias}">
              [<bean:message key="results.showColumn"/>]
            </html:link>
          </c:otherwise>
        </c:choose>

        <%-- right/left --%>
        <c:if test="${not status.first}">
          <html:link action="/changeResults?method=moveUp&columnAlias=${column.alias}">
            [<bean:message key="results.moveUp"/>]
          </html:link>
        </c:if>
        <c:if test="${not status.last}">
          <html:link action="/changeResults?method=moveDown&columnAlias=${column.alias}">
            [<bean:message key="results.moveDown"/>]
          </html:link>
        </c:if>
      </th>
    </c:forEach>
  </tr>

  <%-- The data --%>

  <%-- Row --%>
  <c:forEach var="row" items="${resultsTable.results}" varStatus="status" begin="${resultsTable.start}" end="${resultsTable.end}">

    <c:set var="rowClass">
      <c:choose>
        <c:when test="${status.count % 2 == 1}">resultsOddRow</c:when>
        <c:otherwise>resultsEvenRow</c:otherwise>
      </c:choose>
    </c:set>

    <tr class="<c:out value="${rowClass}"/>">

      <c:forEach var="column" items="${resultsTable.columns}">
        <td>
          <c:if test="${column.visible}">
            <c:out value="${row[column.index]}"/>
          </c:if>
        </td>
      </c:forEach>
    </tr>
  </c:forEach>

</table>

<%-- "Displaying xxx to xxx of xxx rows" messages --%>
<c:choose>
  <c:when test="${resultsTable.sizeEstimate}">
    <bean:message key="results.pageinfo.estimate"
                  arg0="${resultsTable.start+1}"
                  arg1="${resultsTable.end+1}"
                  arg2="${resultsTable.size}"/>
  </c:when>
  <c:otherwise>
    <bean:message key="results.pageinfo.exact"
                  arg0="${resultsTable.start+1}"
                  arg1="${resultsTable.end+1}"
                  arg2="${resultsTable.size}"/>
  </c:otherwise>

</c:choose>

<%-- Paging controls --%>
<html:link action="/changeResults?method=first">
  <bean:message key="results.first"/>
</html:link>
<c:if test="${resultsTable.previousButton}">
  <html:link action="/changeResults?method=previous">
    <bean:message key="results.previous"/>
  </html:link>
</c:if>
<c:if test="${resultsTable.nextButton}">
  <html:link action="/changeResults?method=next">
    <bean:message key="results.next"/>
  </html:link>
</c:if>
<html:link action="/changeResults?method=last">
  <bean:message key="results.last"/>
</html:link>

{'fraction_non_alphanumeric': 0.20947288006111536, 'fraction_numerical': 0.004889228418640183, 'mean_word_length': 2.9744990892531877, 'pattern_counts': {'":': 0, '<': 169, '<?xml version=': 0, '>': 169, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3195238', 'n_tokens_mistral': 2237, 'n_tokens_neox': 2134, 'n_words': 334}