Prints a horizontal divider of the provided colspan.
547936
@Override
	public void printContentHorizontalDivider(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int[] colspansAndDirections, boolean endsInternal) {
		out.print("  <tr>\n");
		for(int c=0;c<colspansAndDirections.length;c+=2) {
			int direction=c==0?-1:colspansAndDirections[c-1];
			if(direction!=-1) {
				switch(direction) {
					case UP:
						out.print("    <td>&#160;</td>\n");
						break;
					case DOWN:
						out.print("    <td>&#160;</td>\n");
						break;
					case UP_AND_DOWN:
						out.print("    <td>&#160;</td>\n");
						break;
					default: throw new IllegalArgumentException("Unknown direction: "+direction);
				}
			}

			int colspan=colspansAndDirections[c];
			out.print("    <td");
			if(colspan!=1) out.print(" colspan='").print(colspan).print('\'');
			out.print("><hr /></td>\n");
		}
		out.print("  </tr>\n");
	}
384887
def click_table_printer(headers, _filter, data):
    """"""
    _filter = [h.lower() for h in _filter] + [h.upper() for h in _filter]
    headers = [h for h in headers if not _filter or h in _filter]
    # Maximum header width
    header_widths = [len(h) for h in headers]

    for row in data:
        for idx in range(len(headers)):
            # If a row contains an element which is wider update maximum width
            if header_widths[idx] < len(str(row[idx])):
                header_widths[idx] = len(str(row[idx]))
    # Prepare the format string with the maximum widths
    formatted_output_parts = ['{{:<{0}}}'.format(hw)
                              for hw in header_widths]
    formatted_output = '   '.join(formatted_output_parts)
    # Print the table with the headers capitalized
    click.echo(formatted_output.format(*[h.upper() for h in headers]))
    for row in data:
        click.echo(formatted_output.format(*row))
1191323
function (columns) {
        var i, j, k,
            totalCol = 0,
            flag = [];

        for (i = 0; i < columns[0].length; i++) {
            totalCol += columns[0][i].colspan || 1;
        }

        for (i = 0; i < columns.length; i++) {
            flag[i] = [];
            for (j = 0; j < totalCol; j++) {
                flag[i][j] = false;
            }
        }

        for (i = 0; i < columns.length; i++) {
            for (j = 0; j < columns[i].length; j++) {
                var r = columns[i][j],
                    rowspan = r.rowspan || 1,
                    colspan = r.colspan || 1,
                    index = $.inArray(false, flag[i]);

                if (colspan === 1) {
                    r.fieldIndex = index;
                    // when field is undefined, use index instead
                    if (typeof r.field === 'undefined') {
                        r.field = index;
                    }
                }

                for (k = 0; k < rowspan; k++) {
                    flag[i + k][index] = true;
                }
                for (k = 0; k < colspan; k++) {
                    flag[i][index + k] = true;
                }
            }
        }
    }
1061720
def horizontal_layout(self, draw, slide):
        
        padding = self.padding
        heading = slide['heading']

        top = padding
        left = padding

        top += heading['height'] + padding

        rows = slide['rows']

        for row in rows:

            images = row.get('images', 0)

            items = row['items']
            
            used_width = sum(x.get('width', 0) for x in items)

            available_width = WIDTH - (
                used_width + ((1 + len(items)) * padding))

            if images:
                image_width = available_width // images

            # OK, now set left for all items and image_width for images
            left = padding
            for item in row['items']:

                if item.get('image'):
                    item['width'] = image_width

                item['left'] = left    

                left += item['width'] + padding

        return
348559
def print_top_right(htext)
      hlen = htext.length
      len = @window.getmaxx # width was not changing when resize happens
      len = Ncurses.COLS-0 if len == 0 || len > Ncurses.COLS
      #$log.debug " def print_top_right(#{htext}) #{len} #{Ncurses.COLS} "
      @form.window.printstring 0, len-hlen, htext, @color_pair, @attr
    end
15759
protected void filterSeparators()
    {
        /*int hthreshold = (int) (root.getArea().getDeclaredFontSize() * HSEP_MIN_HEIGHT);
        int vthreshold = (int) (root.getArea().getDeclaredFontSize() * VSEP_MIN_WIDTH);*/
        int hthreshold = getMinHSepHeight();
        int vthreshold = getMinVSepWidth();
        
        for (Iterator<Separator> it = hsep.iterator(); it.hasNext();)
        {
            Separator sep = it.next();
            //Adaptive height threshold: use the font size of the box above the separator for determining the em size for the threshold  
            AreaImpl above = root.findContentAbove(sep);
            if (above != null)
                hthreshold = (int) (above.getFontSize() * HSEP_MIN_HEIGHT);
            else
                hthreshold = (int) (root.getFontSize() * HSEP_MIN_HEIGHT);
            //System.out.println("For: " + sep + " limit " + hthreshold + " area " + above);
            
            if (sep.getWeight() < hthreshold)
                it.remove();
                //System.out.println("removed");
            else if (sep.getWidth() / (double) sep.getHeight() < SEP_MIN_RATIO)
                it.remove();
        }
        for (Iterator<Separator> it = vsep.iterator(); it.hasNext();)
        {
            Separator sep = it.next();
            if (sep.getWeight() < vthreshold)
                it.remove();
            else if (sep.getHeight() / (double) sep.getWidth() < SEP_MIN_RATIO)
                it.remove();
        }
    }
1034136
@Override
	protected void horizontal() {
		float[] dataX = derivX.data;
		float[] dataY = derivY.data;

		float[] hXX = horizXX.data;
		float[] hXY = horizXY.data;
		float[] hYY = horizYY.data;

		final int imgHeight = derivX.getHeight();
		final int imgWidth = derivX.getWidth();

		int windowWidth = radius * 2 + 1;

		int radp1 = radius + 1;

		BoofConcurrency.loopFor(0,imgHeight,row->{

			int pix = row * imgWidth;
			int end = pix + windowWidth;

			float totalXX = 0;
			float totalXY = 0;
			float totalYY = 0;

			int indexX = derivX.startIndex + row * derivX.stride;
			int indexY = derivY.startIndex + row * derivY.stride;

			for (; pix < end; pix++) {
				float dx = dataX[indexX++];
				float dy = dataY[indexY++];

				totalXX += dx * dx;
				totalXY += dx * dy;
				totalYY += dy * dy;
			}

			hXX[pix - radp1] = totalXX;
			hXY[pix - radp1] = totalXY;
			hYY[pix - radp1] = totalYY;

			end = row * imgWidth + imgWidth;
			for (; pix < end; pix++, indexX++, indexY++) {

				float dx = dataX[indexX - windowWidth];
				float dy = dataY[indexY - windowWidth];

				// saving these multiplications in an array to avoid recalculating them made
				// the algorithm about 50% slower
				totalXX -= dx * dx;
				totalXY -= dx * dy;
				totalYY -= dy * dy;

				dx = dataX[indexX];
				dy = dataY[indexY];

				totalXX += dx * dx;
				totalXY += dx * dy;
				totalYY += dy * dy;

				hXX[pix - radius] = totalXX;
				hXY[pix - radius] = totalXY;
				hYY[pix - radius] = totalYY;
			}
		});
	}
591448
private void showSeparators()
    {
        ListModel<Separator> ml = sepList.getModel();
        for (int i = 0; i < ml.getSize(); i++)
            drawSeparator(ml.getElementAt(i));
        browser.updateDisplay();
    }
    
    //========================================================================================
    
    private JPanel getSepListPanel()
    {
        if (sepListPanel == null)
        {
            GridLayout gridLayout3 = new GridLayout();
            gridLayout3.setRows(1);
            gridLayout3.setColumns(1);
            sepListPanel = new JPanel();
            sepListPanel.setLayout(gridLayout3);
            sepListPanel.add(getSepScroll(), null);
        }
        return sepListPanel;
    }

    private JScrollPane getSepScroll()
    {
        if (sepScroll == null)
        {
            sepScroll = new JScrollPane();
            sepScroll.setViewportView(getSepList());
        }
        return sepScroll;
    }

    private JList<Separator> getSepList()
    {
        if (sepList == null)
        {
            sepList = new JList<Separator>();
            sepList.addListSelectionListener(new javax.swing.event.ListSelectionListener()
            {
                public void valueChanged(javax.swing.event.ListSelectionEvent e)
                {
                    Separator sep = (Separator) sepList.getSelectedValue();
                    if (sep != null)
                    {
                        drawSeparator(sep);
                        browser.updateDisplay();
                    }
                }
            });
        }
        return sepList;
    }

    private JToolBar getShowToolBar()
    {
        if (showToolBar == null)
        {
            showToolBar = new JToolBar("Segmentation");
            showToolBar.add(getShowSepButton());
            showToolBar.add(getGridButton());
        }
        return showToolBar;
    }
    
    private JButton getShowSepButton()
    {
        if (showSepButton == null)
        {
            showSepButton = new JButton();
            showSepButton.setText("Separators");
            showSepButton.addActionListener(new java.awt.event.ActionListener()
            {
                public void actionPerformed(java.awt.event.ActionEvent e)
                {
                    showSeparators();
                }
            });
        }
        return showSepButton;
    }

    /**
     * This method initializes gridButton   
     *  
     * @return javax.swing.JButton  
     */
    private JButton getGridButton()
    {
        if (gridButton == null)
        {
            gridButton = new JButton();
            gridButton.setText("Show grid");
            gridButton.addActionListener(new java.awt.event.ActionListener()
            {
                public void actionPerformed(java.awt.event.ActionEvent e)
                {
                    Area node = browser.getSelectedArea();
                    if (node != null)
                    {
                        node.getTopology().drawLayout(browser.getOutputDisplay());
                        browser.updateDisplay();
                    }
                }
            });
        }
        return gridButton;
    }


    
}
157544
def print_table(columns, formatter)
      columns.transpose.each { |row| puts sprintf(formatter, *row) }
    end
911651
function printColumns(heading, data) {
  const columns = columnify(data, {});
  const spacer = EOL + EOL;

  process.stdout.write(heading);
  process.stdout.write(spacer);

  if (columns) {
    process.stdout.write(columns);
    process.stdout.write(spacer);
  }
}
1357213
def print_splits(cliques, next_cliques):
    """"""
    splits = 0
    for i, clique in enumerate(cliques):
        parent, _ = clique

        # If this fork continues
        if parent in next_cliques:
            # If there is a new fork, print a split
            if len(next_cliques[parent]) > 1:
                print_split(i + splits, len(cliques) + splits)
                splits += 1
1118607
def _print_table(rows, header=True):
    
    border = "="
    # vertical delimiter
    vdelim = " | "
    # padding nr. of spaces are left around the longest element in the
    # column
    padding = 1
    # may be left,center,right
    justify = 'right'
    justify = {'left'   : str.ljust,
               'center' : str.center,
               'right'  : str.rjust}[justify.lower()]
    # calculate column widths (longest item in each col
    # plus "padding" nr of spaces on both sides)
    cols = zip(*rows)
    colWidths = [max([len(str(item))+2*padding for item in col]) for col in cols]
    borderline = vdelim.join([w*border for w in colWidths])
    for row in rows:
        print(vdelim.join([justify(str(item),width) for (item,width) in zip(row,colWidths)]))
        if header:
            print(borderline)
            header=False
877752
def vertically(value, num_blocks, val_min, color, args):
    """"""
    global maxi, value_list

    value_list.append(str(value))

    # In case the number of blocks at the end of the normalization is less
    # than the default number, use the maxi variable to escape.
    if maxi < num_blocks:
        maxi = num_blocks

    if num_blocks > 0:
        vertical_list.append((TICK * num_blocks))
    else:
        vertical_list.append(SM_TICK)

    # Zip_longest method in order to turn them vertically.
    for row in zip_longest(*vertical_list, fillvalue='  '):
        zipped_list.append(row)

    counter, result_list = 0, []

    # Combined with the maxi variable, escapes the appending method at
    # the correct point or the default one (width).
    for i in reversed(zipped_list):
        result_list.append(i)
        counter += 1

        if maxi == args['width']:
            if counter == (args['width']):
                break
        else:
            if counter == maxi:
                break

    # Return a list of rows which will be used to print the result vertically.
    return result_list
956243
function printTurnHeader(turnNumber) {
  printRow(chalk.gray.dim(` ${String(turnNumber).padStart(3, '0')} `), {
    position: 'middle',
    padding: chalk.gray.dim('~'),
  });
}
331050
def separated(self, separator='-'):
        """"""
        return separator.join((part for part in self.elements() if part))
40750
def print_split(column_to_split, total_columns):
    """"""
    out = ""
    for _ in range(column_to_split):
        out += "| "
    out += "|\\"
    for _ in range(column_to_split + 1, total_columns):
        out += " \\"
    print(out)
305991
public void divide(PairDblInt[] cols, double val) {
	for (int i = 0; i < numLabels; i++) {
	    cols[i].first /= val;
	}
    }