Adjusts the real table heading rows based on the cell information

@param YNum
The number of non-duplicated Y axes in the table area
@param cc
the number of the table columns
@param tc
the object of the table candidate
547190
public void getRealHeadingBasedOnCells(int YNum, int cc, TableCandidate tc) {
		int footnoteLineIndex = tc.getFootnoteBeginRow();
		String[][] cells = tc.getCells();
    	int i=0;
		while (i<footnoteLineIndex) {
			int j=0, nonNullCellNum = 0;
			while (j<cc) {
				if (cells[i][j]=="") {
					break;
				}
				nonNullCellNum ++;
				j++;
			}
			if (nonNullCellNum==cc)	break;
			else i++;
		}
		/*
		 * if the next row contain unit symbols, this row has a very large possibility to be a table column heading row
		 */
		if ((i+1)<footnoteLineIndex ) {
			boolean hasUnitSymbols =  false;
			int j=0;
			while (j<cc) {
				if ( (cells[i+1][j].indexOf("/yg rnI--")>0) || (cells[i+1][j].indexOf("(%)")>0) || (cells[i+1][j].indexOf("w-'")>0) ||
				(cells[i+1][j].indexOf("CLg g-'")>0) || (cells[i+1][j].indexOf("pg ml-1")>=0)	) {
					i++;
					break;
				}
				j++;
			}
		}
		/*
		 * Based on observation, the column heading rows always contain missing cells. 
		 * But the first data row always does not contain missing cell
		 */
		if (i==YNum) i=0;
		if (i>0) i--;	
		tc.setHeadingLineNumber(i);
	}
468362
public function setWidth(TcTable $table) {
        if (!$this->width) {
            $widths = [];
            foreach ($table->getColumns() as $key => $column) {
                $widths[$key] = $column['width'];
            }
            unset($widths[$this->columnIndex]);
            $this->width = $this->getRemainingColumnWidth($table, $widths);
        }
        $width = $this->width;
        $table->setColumnDefinition($this->columnIndex, 'width', $width);
    }
770232
public void setCenterCoordsRelativeToParent(int x, int y) {

        Style style = getElement().getStyle();
        style.setLeft(x - 10, Unit.PX);
        style.setTop(y - 10, Unit.PX);
    }
757091
@SuppressWarnings("unused")
    // TODO 
    private static void widthTable(XWPFTable table, float[] colWidths) {
        float widthCM = 0;
        for (float w : colWidths) {
            widthCM += w;
        }
        long width = (int) (widthCM / 2.54 * 1440);
        CTTblPr tblPr = getTblPr(table);
        CTTblWidth tblW = tblPr.isSetTblW() ? tblPr.getTblW() : tblPr.addNewTblW();
        tblW.setType(0 == width ? STTblWidth.AUTO : STTblWidth.DXA);
        tblW.setW(BigInteger.valueOf(width));

        if (0 != width) {
            CTTblGrid tblGrid = table.getCTTbl().getTblGrid();
            if (null == tblGrid) {
                tblGrid = table.getCTTbl().addNewTblGrid();
            }

            for (float w : colWidths) {
                CTTblGridCol addNewGridCol = tblGrid.addNewGridCol();
                addNewGridCol.setW(BigInteger.valueOf((long) (w / 2.54 * 1440)));
            }
        }
    }
408852
public void computeDescriptor( int cx , int cy , TupleDesc_F64 desc  ) {

		desc.fill(0);

		int widthPixels = widthSubregion*widthGrid;
		int radius = widthPixels/2;

		for (int i = 0; i < widthPixels; i++) {
			int angleIndex = (cy-radius+i)*savedAngle.width + (cx-radius);

			float subY = i/(float)widthSubregion;

			for (int j = 0; j < widthPixels; j++, angleIndex++ ) {
				float subX = j/(float)widthSubregion;

				double angle = savedAngle.data[angleIndex];

				float weightGaussian = gaussianWeight[i*widthPixels+j];
				float weightGradient = savedMagnitude.data[angleIndex];

				// trilinear interpolation intro descriptor
				trilinearInterpolation(weightGaussian*weightGradient,subX,subY,angle,desc);
			}
		}

		normalizeDescriptor(desc,maxDescriptorElementValue);
	}
1335500
def set_ylim_cb(self, redraw=True):
        """"""
        try:
            ymin = float(self.w.y_lo.get_text())
        except Exception:
            set_min = True
        else:
            set_min = False

        try:
            ymax = float(self.w.y_hi.get_text())
        except Exception:
            set_max = True
        else:
            set_max = False

        if set_min or set_max:
            self.tab_plot.draw()
            self.set_ylimits_widgets(set_min=set_min, set_max=set_max)

        if not (set_min and set_max):
            self.tab_plot.ax.set_ylim(ymin, ymax)
            if redraw:
                self.tab_plot.draw()
473678
public void getRowHeadingBasedOnCells(TableCandidate tc) {
	String rowHeadingThisTable = "";
	int footnoteLineIndex = tc.getFootnoteBeginRow();
	String[][] cells = tc.getCells();
	// if (cells[0][0].length()==0 ) {
	for (int j = 0; j < footnoteLineIndex; j++) {
	    if (cells[j][0].length() > 0)
		rowHeadingThisTable = rowHeadingThisTable + cells[j][0] + "; ";
	}
	// }
	rowHeadingThisTable = tc
		.replaceAllSpecialChracters(rowHeadingThisTable);
	tc.setHeadingRows(rowHeadingThisTable);
    }
1346525
public void setC2(double c2)
    {
        if(c2 >= 1)
            throw new IllegalArgumentException("c2 must be less than 1, not " + c2);
        else if(c2 <= c1)
            throw new IllegalArgumentException("c2 must be greater than c1");
        this.c2 = c2;
    }
419811
function computeTableHeaderCellIndexes(t) {
                var matrix = [];
                var lookup = {};
                var thead = t.getElementsByTagName('THEAD')[0];
                var trs = thead.getElementsByTagName('TR');

                for (var i = 0; i < trs.length; i++) {
                    var cells = trs[i].cells;
                    for (var j = 0; j < cells.length; j++) {
                        var c = cells[j];

                        var rowIndex = c.parentNode.rowIndex;
                        var cellId = rowIndex + "-" + c.cellIndex;
                        var rowSpan = c.rowSpan || 1;
                        var colSpan = c.colSpan || 1
                        var firstAvailCol;
                        if (typeof(matrix[rowIndex]) == "undefined") {
                            matrix[rowIndex] = [];
                        }
                        // Find first available column in the first row
                        for (var k = 0; k < matrix[rowIndex].length + 1; k++) {
                            if (typeof(matrix[rowIndex][k]) == "undefined") {
                                firstAvailCol = k;
                                break;
                            }
                        }
                        lookup[cellId] = firstAvailCol;
                        for (var k = rowIndex; k < rowIndex + rowSpan; k++) {
                            if (typeof(matrix[k]) == "undefined") {
                                matrix[k] = [];
                            }
                            var matrixrow = matrix[k];
                            for (var l = firstAvailCol; l < firstAvailCol + colSpan; l++) {
                                matrixrow[l] = "x";
                            }
                        }
                    }
                }
                return lookup;
            }
1031841
public void setColumnsSpanned(final int colIndex, final int n) {
        if (n <= 1) return;

        final TableCell firstCell = this.getOrCreateCell(colIndex);
        if (firstCell.isCovered()) // already spanned
            return;

        firstCell.markColumnsSpanned(n);
        this.coverRightCells(colIndex, n);
    }
13074
private void isWideTable(TableCandidate tc) {
	float docWidth = m_docInfo.getMaxX() - m_docInfo.getMinX();
	if ((((tc.getCaptionX() > ((docWidth - 30) / (float) 4.0)
		+ m_docInfo.getMinX())) && (tc.getCaptionX() < docWidth / 2.5))
		|| (tc.getCaptonEndX() - tc.getCaptionX() > docWidth
			/ (float) 1.85)) {
	    tc.setWideTable(true);
	    // System.out.println();
	    // System.out.println("This is a wide table? " + tc.isWideTable());
	} else {
	    // System.out.println();
	    // System.out.println("This is a single-doc-column table!");
	}
    }
1094946
private void organizeCells(ArrayList<TextPiece> linesOfAPage,
	    TableCandidate tc) {
	float captionY = linesOfAPage.get(tc.getCaptionStartLine()).getY();
	float captionEndY = linesOfAPage.get(tc.getCaptionEndLine()).getEndY();
	ArrayList<TextPiece> rawCells = new ArrayList<TextPiece>();
	/*
	 * Copy & sort
	 */
	for (int i = tc.getBodyStartLine(); i <= tc.getBodyEndLine(); i++) {
	    rawCells.add(linesOfAPage.get(i));
	}

	Collections.sort(rawCells);
	assert rawCells.size() >= 4; // due to previous check
	TableRow currentRow = null; // creates first row

	for (TextPiece cell : rawCells) {
	    /*
	     * Skips lines beyond caption //TODO: remove the far Y
	     */
	    if (tc.isTopCaption() && (cell.getY() < captionY))
		continue;
	    if (!tc.isTopCaption() && (cell.getEndY() > captionEndY))
		continue;

	    /*
	     * Lines too close to each other are treated as a single line
	     */
	    if (currentRow != null
		    && cell.getY() - currentRow.getY() < m_docInfo
			    .getAverageLineGap() / 2.0)
		currentRow.addCell(cell);
	    else {
		/*
		 * Creates a new row
		 */
		currentRow = new TableRow();
		currentRow.setY(cell.getY());
		if (cell.isSuperScriptBeginning())
		    currentRow.setSuperScriptRow(true);
		currentRow.addCell(cell);
		tc.addRow(currentRow);
	    }
	}
	if (tc.getRows().size() < 2)
	    tc.setValid(false);
    }
1264775
public final void j_short(CONDITION cc, Label label, int hint)
  {
    // Adjust returned condition to jxx_short version.
    _emitJcc(INST_CODE.valueOf(conditionToJCC(cc).ordinal() + INST_J_SHORT.ordinal() - INST_J.ordinal()), label, hint);
  }
496065
public CellStyle getOrCreateRowStyle(int y) {
		final Row row = getOrCreateRow(y);
		CellStyle rowStyle = row.getRowStyle();
		if (null == rowStyle) {
			rowStyle = this.workbook.createCellStyle();
			row.setRowStyle(rowStyle);
		}
		return rowStyle;
	}
100911
public static int cusparseShyb2csc(
        cusparseHandle handle, 
        cusparseMatDescr descrA, 
        cusparseHybMat hybA, 
        Pointer cscSortedVal, 
        Pointer cscSortedRowInd, 
        Pointer cscSortedColPtr)
    {
        return checkResult(cusparseShyb2cscNative(handle, descrA, hybA, cscSortedVal, cscSortedRowInd, cscSortedColPtr));
    }
1265274
@Pure
	public int getRowFor(double y) {
		final double yy = y - this.bounds.getMinY();
		if (yy >= 0.)  {
			final int idx = (int) (yy / getCellHeight());
			assert idx >= 0;
			if (idx < getRowCount()) {
				return idx;
			}
			return getRowCount() - 1;
		}
		return 0;
	}
166265
public void setSliderPosition(int y) {

        if (y < 0) {
            y = 0;
        }
        if (y > 256) {
            y = 256;
        }
        m_slider.getElement().getStyle().setTop(y - 1047, Unit.PX);
    }