TODO: look closer at this should it be isortingcols -1 ?
165430
def order_string
      result = []

      @params['iSortingCols'].times do |count|
        col_index = @params["iSortCol_#{count}"]
        col_dir = @params["sSortDir_#{count}"]
        col_name = column_attributes.keys[col_index]
        result << " " + (col_name + " " + col_dir)
      end

      result.join(", ")
    end
1050179
private int getColIndex(String name) {

        for (int i = 0; i < columns.length; i++) {
            if (name.equals(columns[i])) {
                return i;
            }    // end of if (name.equals(columns[i]))
        }        // end of for (int i=0; i<columns.length; i++)

        return -1;
    }
551837
private int readCorner1(int numRows, int numColumns) {
    int currentByte = 0;
    if (readModule(numRows - 1, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 1, 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 1, 2, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 2, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(1, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(2, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(3, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    return currentByte;
  }
1168577
def block_sep1(self, Y):
        
        """

        return Y[(slice(None),)*self.blkaxis + (slice(self.blkidx, None),)]
1200141
private void writeDoublecolumn(DoubleColumnVector vec, int colId, int rowNumber, ParseWriter dout) {
    double[] oneColumn = vec.vector;
    byte t = _setup.getColumnTypes()[colId];
    switch(t) {
      case Vec.T_CAT:
        if(_toStringMaps.get(colId) == null)
          _toStringMaps.put(colId,new HashMap<Number, byte[]>());
        HashMap<Number,byte[]> map = _toStringMaps.get(colId);
        BufferedString bs = new BufferedString();
        if(vec.isRepeating) {
          bs.set(StringUtils.toBytes(oneColumn[0]));
          for (int i = 0; i < rowNumber; ++i)
            dout.addStrCol(colId, bs);
        } else  if (vec.noNulls) {
          for (int i = 0; i < rowNumber; i++) {
            double d = oneColumn[i];
            if(map.get(d) == null) // TODO probably more effficient if moved to the data output
              map.put(d, StringUtils.toBytes(d));
            dout.addStrCol(colId, bs.set(map.get(d)));
          }
        } else {
          for (int i = 0; i < rowNumber; i++) {
            boolean [] isNull = vec.isNull;
            if (isNull[i])
              dout.addInvalidCol(colId);
            else {
              double d = oneColumn[i];
              if(map.get(d) == null)
                map.put(d,StringUtils.toBytes(d));
              dout.addStrCol(colId, bs.set(map.get(d)));
            }
          }
        }
        break;
      default:
        if(vec.isRepeating) {
          for (int i = 0; i < rowNumber; ++i)
            dout.addNumCol(colId, oneColumn[0]);
        } else  if (vec.noNulls) {
          for (int rowIndex = 0; rowIndex < rowNumber; rowIndex++)
            dout.addNumCol(colId, oneColumn[rowIndex]);
        } else {
          boolean [] isNull = vec.isNull;
          for (int rowIndex = 0; rowIndex < rowNumber; rowIndex++) {
            if (isNull[rowIndex]) dout.addInvalidCol(colId);
            else dout.addNumCol(colId, oneColumn[rowIndex]);
          }
        }
        break;
    }
  }
940615
function findColMergedLastIndex(tableData, rowIndex, colIndex) {
  const cellData = tableData[rowIndex][colIndex];
  let foundColIndex = colIndex;

  if (cellData.colspan > 1) {
    foundColIndex += cellData.colspan - 1;
  }

  return foundColIndex;
}
588676
function smooshColumn(addressesCol, newCol) {
  if (!defined(newCol)) {
    return;
  }
  if (newCol.values.length === addressesCol.values.length) {
    for (var i = 0; i < addressesCol.values.length; i++) {
      if (addressesCol.values[i] !== null && newCol.values[i] !== null) {
        addressesCol.values[i] =
          addressesCol.values[i] + " " + newCol.values[i];
      }
    }
  }
}
389684
private int readCorner2(int numRows, int numColumns) {
    int currentByte = 0;
    if (readModule(numRows - 3, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 2, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 1, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 4, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 3, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 2, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(1, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    return currentByte;
  }
1096058
private int keyColumnEnd()
  {
    int offset = 0;
    
    for (int i = 0; i < _columns.length; i++) {
      if (offset == _keyStart + _keyLength) {
        return i;
      }
      
      offset += _columns[i].length();
    }
    
    if (offset == _keyStart + _keyLength) {
      return _columns.length;
    }
    
    throw new IllegalStateException();
  }
744829
function() {
    this.validateColumnWidths();
    
    for(var allKeys = this._oColumnSet.keys, i=0, len=allKeys.length, col; i<len; i++) {
        col = allKeys[i];
        if(col._ddResizer) {
            col._ddResizer.resetResizerEl();
        }
    }
}
445495
function isOneOf(x) {
    var typeName = (0, _typeOf.typeOf)(x);

    for (var _len3 = arguments.length, types = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
      types[_key3 - 1] = arguments[_key3];
    }

    return toTypeRefNames(types).some(function (name) {
      return typeName === name;
    });
  }
1291274
private boolean verifyWithOfColumns(ColumnState[] columnStates, TextTableInfo tableInfo) {

    int tableWidth = tableInfo.getWidth();
    if (tableWidth != TextColumnInfo.WIDTH_AUTO_ADJUST) {
      int calculatedWidth = 0;
      for (ColumnState columnState : columnStates) {
        if (columnState.width < 0) {
          throw new AssertionError("columnWidth=" + columnState.width);
          // return false;
        }
        calculatedWidth = calculatedWidth + columnState.width + columnState.getColumnInfo().getBorderWidth();
      }
      if (calculatedWidth != tableWidth) {
        throw new AssertionError("with=" + tableWidth + ", sum-of-columns=" + calculatedWidth);
        // return false;
      }
    }
    return true;
  }
1306038
void checkColumnsMatch(int[] col, Table other, int[] othercol) {

        for (int i = 0; i < col.length; i++) {
            Type type      = colTypes[col[i]];
            Type otherType = other.colTypes[othercol[i]];

            if (type.typeComparisonGroup != otherType.typeComparisonGroup) {
                throw Error.error(ErrorCode.X_42562);
            }
        }
    }
395815
@Override
    public boolean isOrderDeterministic() {
        if ( ! hasTopLevelScans()) {
            // This currently applies to parent queries that do all their
            // scanning in subqueries and so take on the order determinism of
            // their subqueries. This might have to be rethought to allow
            // ordering in parent queries to effect determinism of unordered
            // "FROM CLAUSE" subquery results.
            return true;
        }

        if (hasAOneRowResult()) {
            return true;
        }

        if ( ! hasOrderByColumns() ) {
            return false;
        }

        // The nonOrdered expression list is used as a short-cut
        // -- if an expression has been determined to be
        // non-ordered when encountered as a GROUP BY expression,
        // it will also be non-ordered when encountered in the select list.
        ArrayList<AbstractExpression> nonOrdered = new ArrayList<>();

        if (isGrouped()) {
            // Does the ordering of a statements's GROUP BY columns
            // ensure determinism?
            // All display columns and order-by expressions
            // are functionally dependent on the GROUP BY
            // columns even if the display column's values
            // are not ordered or unique,
            // so ordering by ALL of the GROUP BY columns is enough
            // to get full determinism,
            // EVEN if ordering by other (dependent) expressions,
            // regardless of the placement of non-GROUP BY expressions
            // in the ORDER BY list.
            if (orderByColumnsDetermineAllColumns(m_groupByColumns, nonOrdered)) {
                return true;
            }

            if (orderByColumnsDetermineAllDisplayColumns(nonOrdered)) {
                return true;
            }

        }
        else {
            if (orderByColumnsDetermineAllDisplayColumns(nonOrdered)) {
                return true;
            }

            if (orderByColumnsCoverUniqueKeys()) {
                return true;
            }
        }
        return false;
    }
835619
private boolean isOrdered(FieldDescriptor[] flds, String[] pkFieldNames)
    {
        if((flds.length > 1 && pkFieldNames == null) || flds.length != pkFieldNames.length)
        {
            throw new PersistenceBrokerException("pkFieldName length does not match number of defined PK fields." +
                    " Expected number of PK fields is " + flds.length + ", given number was " +
                    (pkFieldNames != null ? pkFieldNames.length : 0));
        }
        boolean result = true;
        for(int i = 0; i < flds.length; i++)
        {
            FieldDescriptor fld = flds[i];
            result = result && fld.getPersistentField().getName().equals(pkFieldNames[i]);
        }
        return result;
    }
281823
static void doDifference(
            Map<String, String> left,
            Map<String, String> right,
            Map<String, String> onlyOnLeft,
            Map<String, String> onlyOnRight,
            Map<String, String> updated
    ) {
        onlyOnRight.clear();
        onlyOnRight.putAll(right);
        for (Map.Entry<String, String> entry : left.entrySet()) {
            String leftKey = entry.getKey();
            String leftValue = entry.getValue();
            if (right.containsKey(leftKey)) {
                String rightValue = onlyOnRight.remove(leftKey);
                if (!leftValue.equals(rightValue)) {
                    updated.put(leftKey, leftValue);
                }
            } else {
                onlyOnLeft.put(leftKey, leftValue);
            }
        }
    }
1358701
function () {
		var columns = this.columns,
			col = columns.length, 
			row,
			val,
			floatVal,
			trimVal,
			dateVal;
			
		while (col--) {
			row = columns[col].length;
			while (row--) {
				val = columns[col][row];
				floatVal = parseFloat(val);
				trimVal = this.trim(val);

				/*jslint eqeq: true*/
				if (trimVal == floatVal) { // is numeric
				/*jslint eqeq: false*/
					columns[col][row] = floatVal;
					
					// If the number is greater than milliseconds in a year, assume datetime
					if (floatVal > 365 * 24 * 3600 * 1000) {
						columns[col].isDatetime = true;
					} else {
						columns[col].isNumeric = true;
					}					
				
				} else { // string, continue to determine if it is a date string or really a string
					dateVal = this.parseDate(val);
					
					if (col === 0 && typeof dateVal === 'number' && !isNaN(dateVal)) { // is date
						columns[col][row] = dateVal;
						columns[col].isDatetime = true;
					
					} else { // string
						columns[col][row] = trimVal === '' ? null : trimVal;
					}
				}
				
			}
		}
	}