Set the characters used to draw lines between rows and columns

        - the array should contain 4 fields:

            [horizontal, vertical, corner, header]

        - default is set to:

            ['-', '|', '+', '=']
175297
def set_chars(self, array):
        

        if len(array) != 4:
            raise ArraySizeError("array should contain 4 characters")
        array = [ x[:1] for x in [ str(s) for s in array ] ]
        (self._char_horiz, self._char_vert,
            self._char_corner, self._char_header) = array
        return self
917582
function(data) {
            if (data.row.index === 5) {
                data.cell.styles.fillColor = [40, 170, 100];
            }

            if ((data.row.section === 'head' || data.row.section === 'foot') && data.column.dataKey === "expenses") {
                data.cell.text = '' // Use an icon in didDrawCell instead
            }

            if (data.row.index === 0 && data.row.section === 'body' && data.column.dataKey === 'city') {
                data.cell.text = 'とうきょう'
            }
        }
1331948
def _format_line(self, line):
        '''
        
        '''
        delim = '\n'
        offset = 0
        self.string_parts = []

        # Split the line into an array of columns, e.g., ['0', '0x00000000',
        # 'Some description here']
        line_columns = line.split(None, self.num_columns - 1)
        if line_columns:
            # Find where the start of the last column (description) starts in the line of text.
            # All line wraps need to be aligned to this offset.
            offset = line.rfind(line_columns[-1])
            # The delimiter will be a newline followed by spaces padding out
            # the line wrap to the alignment offset.
            delim += ' ' * offset

        if line_columns and self.fit_to_screen and len(line) > self.SCREEN_WIDTH:
            # Calculate the maximum length that each wrapped line can be
            max_line_wrap_length = self.SCREEN_WIDTH - offset
            # Append all but the last column to formatted_line
            formatted_line = line[:offset]

            # Loop to split up line into multiple max_line_wrap_length pieces
            while len(line[offset:]) > max_line_wrap_length:
                # Find the nearest space to wrap the line at (so we don't split
                # a word across two lines)
                split_offset = line[
                    offset:offset + max_line_wrap_length].rfind(' ')
                # If there were no good places to split the line, just truncate
                # it at max_line_wrap_length
                if split_offset < 1:
                    split_offset = max_line_wrap_length

                self._append_to_data_parts(line, offset, offset + split_offset)
                offset += split_offset

            # Add any remaining data (guarunteed to be max_line_wrap_length
            # long or shorter) to self.string_parts
            self._append_to_data_parts(line, offset, offset + len(line[offset:]))

            # Append self.string_parts to formatted_line; each part seperated
            # by delim
            formatted_line += delim.join(self.string_parts)
        else:
            formatted_line = line

        return formatted_line
1342449
def set_window_params(self, cols=None, rows=None):
        
        self._set_aliased('cols', cols)
        self._set_aliased('rows', rows)

        return self
429672
@Override
    public void characters(char[] ch, int start, int length)
        throws SAXException {
        if (vIsOpen) {
            value.append(ch, start, length);
        }
        if (fIsOpen) {
            formula.append(ch, start, length);
        }
        if (hfIsOpen) {
            headerFooter.append(ch, start, length);
        }
    }
820454
private void addColumn(final List<String> columns, String line, int charIndex) {
		
		if(currentColumn.length() > 0){
			columns.add(currentColumn.toString());
		}
		else{
			int previousCharIndex = charIndex - 1;
			boolean availableCharacters = previousCharIndex >= 0 ;
			boolean previousCharIsQuote = availableCharacters && line.charAt(previousCharIndex) == quoteChar;
			String noValue = ( (previousCharIsQuote) && emptyColumnParsing.equals(EmptyColumnParsing.ParseEmptyColumnsAsEmptyString)) ? "" : null;
			columns.add(noValue);
		}
	}
241556
function header(columns, opt, repeat, nodisplay){
  var headers = Object.keys(columns);
  var widths = headers.map(head => columns[head]);
  var topl = opt.title ? p[1][0] : p[0][0];
  var topr = opt.title ? p[1][2] : p[0][2];
  var topc = repeat ? p[1][1] : p[0][1];
  log(topl + widths.map(col => p.h + strN(col, p.h) + p.h).join(topc) + topr);
  if (!nodisplay) {
    log(p.v + ' ' + headers.map((txt, i) => fixed(txt, widths[i])).join(' ' + p.v + ' ') + ' ' + p.v);
    log(p[1][0] + widths.map(col => p.h + strN(col, p.h) + p.h).join(p[1][1]) + p[1][2]);
  }
}
1337316
function Fixed2DArray(rows, cols, defaultValue) {
  if(rows <= 0 || cols <= 0){
    throw new Error('fixed-2d-array: Must have more then 0 rows and 0 columns.');
  }

  this._width = cols;
  this._height = rows;
  this._grid = [];

  for (var i = 0; i < rows; i++) {
    this._grid[i] = [];
    for (var j = 0; j < cols; j++) {
      this._grid[i][j] = defaultValue;
    }
  }
}
794548
def render
      buffer = []
      _guess_col_widths
      rows = @list.size.to_s.length
      @rows = rows
      _prepare_format
      
      str = ""
      if @numbering
        str = " "*(rows+1)+@y
      end
      str <<  @fmstr % @columns
      buffer << str
      #puts "-" * str.length
      buffer << separator
      if @list
        if @numbering
          @fmstr = "%#{rows}d "+ @y + @fmstr
        end
        #@list.each { |e| puts e.join(@y) }
        count = 0
        @list.each_with_index { |r,i|  
          value = convert_value_to_text r, count
          buffer << value
          count += 1
        }
      end
      buffer
    end
1229277
def columns=(array)
      $log.debug "tabular got columns #{array.count} #{array.inspect} " if $log
      @columns = array
      @columns.each_with_index { |c,i| 
        @chash[i] = ColumnInfo.new(c, c.to_s.length) 
        @cw[i] ||= c.to_s.length
        #@calign[i] ||= :left # 2011-09-27 prevent setting later on
      }
    end
654667
public void setRow(int row, double[] columns) {
        checkIndices(row, columns.length - 1);

        if (cols <= columns.length)
            cols = columns.length;
        
        SparseDoubleVector rowVec = updateRow(row);

        for (int col = 0; col < cols; ++col) {
            double val = columns[col];
            rowVec.set(col, val);
        }
    }
822365
void charsToLines(LinkedList<Change> diffs,
                                     List<String> lineArray) {
        StringBuilder text;
        for (Change diff : diffs) {
            text = new StringBuilder();
            for (int y = 0; y < diff.text.length(); y++) {
                text.append(lineArray.get(diff.text.charAt(y)));
            }
            diff.text = text.toString();
        }
    }
483586
private void setLineLinePredicates_() {
        m_predicates_half_edge = Predicates.LineLinePredicates;
        m_predicates_cluster = Predicates.LinePointPredicates;

        m_max_dim[MatrixPredicate.InteriorInterior] = 1;
        m_max_dim[MatrixPredicate.InteriorBoundary] = 0;
        m_max_dim[MatrixPredicate.InteriorExterior] = 1;
        m_max_dim[MatrixPredicate.BoundaryInterior] = 0;
        m_max_dim[MatrixPredicate.BoundaryBoundary] = 0;
        m_max_dim[MatrixPredicate.BoundaryExterior] = 0;
        m_max_dim[MatrixPredicate.ExteriorInterior] = 1;
        m_max_dim[MatrixPredicate.ExteriorBoundary] = 0;
        m_max_dim[MatrixPredicate.ExteriorExterior] = 2;

        // set predicates that are always true/false
        if (m_perform_predicates[MatrixPredicate.ExteriorExterior])
        {
            m_matrix[MatrixPredicate.ExteriorExterior] = 2; // Always true
            m_perform_predicates[MatrixPredicate.ExteriorExterior] = false;
            m_predicate_count--;
        }
	}
1336270
def set_form_col col1=@curpos #:nodoc:
      @cols_panned ||= 0
      @pad_offset ||= 0 # added 2010-02-11 21:54 since padded widgets get an offset.
      @curpos = col1
      maxlen = @maxlen || @width-@internal_width
      #@curpos = maxlen if @curpos > maxlen
      if @curpos > maxlen
        @pcol = @curpos - maxlen
        @curpos = maxlen - 1
        @repaint_required = true # this is required so C-e can pan screen
      else
        @pcol = 0
      end
      # the rest only determines cursor placement
      win_col = 0 # 2010-02-07 23:19 new cursor stuff
      col2 = win_col + @col + @col_offset + @curpos + @cols_panned + @pad_offset
      #$log.debug "TV SFC #{@name} setting c to #{col2} #{win_col} #{@col} #{@col_offset} #{@curpos} "
      #@form.setrowcol @form.row, col
      setrowcol nil, col2
      @repaint_footer_required = true
    end
356296
private void setW() {
        if( saveW ) {
            W.col0 = Y.col0;
            W.col1 = Y.col1;
            W.row0 = Y.row0;
            W.row1 = Y.row1;
        } else {
            W.col1 = Y.col1 - Y.col0;
            W.row0 = Y.row0;
        }
    }
1295356
def lines
      ret = [Attributes::HEADER]
      # Sort by name, but id goes first
      @attrs.sort_by{|x| x[:name] == 'id' ? '_' : x[:name]}.each do |row|
        line = "# * #{row[:name]} [#{row[:type]}]#{row[:desc].to_s.empty? ? "" : " - #{row[:desc]}"}"
        # split into lines that don't exceed 80 chars
        lt = wrap_text(line, MAX_CHARS_PER_LINE-3).split("\n")
        line = ([lt[0]] + lt[1..-1].map{|x| "#   #{x}"}).join("\n")
        ret << line
      end
      ret
    end
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