Returns an array containing a column length, precision and scale, basing on the column type.
764165
public static function lengthToPrecisionAndScale($type, $length)
    {
        $length = trim($length);

        if (!strlen($length)) {
            return [];
        }

        $result = [
            'length' => null,
            'precision' => null,
            'scale' => null
        ];

        if (in_array($type, self::getDecimalTypes())) {
            $matches = [];

            if (!preg_match(self::REGEX_LENGTH_DOUBLE, $length, $matches)) {
                throw new ApplicationException(Lang::get('rainlab.builder::lang.database.error_table_length', [
                    'type' => $type
                ]));
            }

            $result['precision'] = $matches[1];
            $result['scale'] = $matches[2];

            return $result;
        }

        if (in_array($type, self::getIntegerTypes())) {
            if (!preg_match(self::REGEX_LENGTH_SINGLE, $length)) {
                throw new ApplicationException(Lang::get('rainlab.builder::lang.database.error_table_length', [
                    'type' => $type
                ]));
            }

            $result['precision'] = $length;
            $result['scale'] = 0;

            return $result;
        }

        $result['length'] = $length;
        return $result;
    }
1287121
function() {
      var array = [],
          i, j, ilen, jlen;
      for(i = 0, ilen = this.elements.length; i < ilen; i++) {
        var row = [];
        for(j = 0, jlen = this.column_names.length; j < jlen ; j++) {
          row.push( this.elements[i][ this.column_names[j] ] );
        }
        array.push(row);
      }
      return array;
    }
191351
def columns=(array)
      @_header_adjustment = 1
      @columns = array
      @columns.each_with_index { |c,i| 
        @cw[i] ||= c.to_s.length
        @calign[i] ||= :left
      }
      # maintains index in current pointer and gives next or prev
      @column_pointer = Circular.new @columns.size()-1
    end
1305453
def col_widths(self):
        # type: () -> defaultdict
        
        _widths = defaultdict(int)

        all_rows = [self.headers]
        all_rows.extend(self._rows)

        for row in all_rows:
            for idx, col in enumerate(row):
                _col_l = len(col)
                if _col_l > _widths[idx]:
                    _widths[idx] = _col_l

        return _widths
903409
def _get_cols_width(self):
        """"""

        tab = self.grid.current_table
        no_cols = self.grid.code_array.shape[1]
        default_col_width = self.grid.code_array.cell_attributes.\
            default_cell_attributes["column-width"]

        non_standard_col_widths = []
        __col_widths = self.grid.code_array.col_widths
        for __col, __tab in __col_widths:
            if __tab == tab:
                non_standard_col_widths.append(__col_widths[(__col, __tab)])

        cols_width = sum(non_standard_col_widths)
        cols_width += \
            (no_cols - len(non_standard_col_widths)) * default_col_width

        return cols_width
1126416
def columns(self):
        """"""
        res = [col['name'] for col in self.column_definitions]
        res.extend([col['name'] for col in self.foreign_key_definitions])
        return res
189216
public function getLength()
    {
        return in_array($this->schema, $this->lengthSchemas, true) ? ($this->precision . ($this->scale ? ', ' . $this->scale : null)) : null;
    }
1351480
def description(self):
        """"""
        return (
            self.name,
            self.type_code,
            None,  # TODO: display_length; should this be self.length?
            self.get_column_length(),  # 'internal_size'
            self.get_column_length(),  # 'precision'  # TODO: why!?!?
            self.scale,
            self.flags % 2 == 0)
911842
def values(self):
        
        dtypes = [col.dtype for col in self.columns]
        if len(set(dtypes)) > 1:
            dtype = object
        else:
            dtype = None
        return np.array(self.columns, dtype=dtype).T
50607
function scaleColumns(colsByGroup, maxWidth, totalFlexGrow) {
    // calculate total width and flexgrow points for coulumns that can be resized
    for (var attr in colsByGroup) {
        for (var _i = 0, _a = colsByGroup[attr]; _i < _a.length; _i++) {
            var column = _a[_i];
            if (!column.canAutoResize) {
                maxWidth -= column.width;
                totalFlexGrow -= column.flexGrow ? column.flexGrow : 0;
            }
            else {
                column.width = 0;
            }
        }
    }
    var hasMinWidth = {};
    var remainingWidth = maxWidth;
    // resize columns until no width is left to be distributed
    do {
        var widthPerFlexPoint = remainingWidth / totalFlexGrow;
        remainingWidth = 0;
        for (var attr in colsByGroup) {
            for (var _b = 0, _c = colsByGroup[attr]; _b < _c.length; _b++) {
                var column = _c[_b];
                // if the column can be resize and it hasn't reached its minimum width yet
                if (column.canAutoResize && !hasMinWidth[column.prop]) {
                    var newWidth = column.width + column.flexGrow * widthPerFlexPoint;
                    if (column.minWidth !== undefined && newWidth < column.minWidth) {
                        remainingWidth += newWidth - column.minWidth;
                        column.width = column.minWidth;
                        hasMinWidth[column.prop] = true;
                    }
                    else {
                        column.width = newWidth;
                    }
                }
            }
        }
    } while (remainingWidth !== 0);
}
972188
public String getColumnNames() {
		StringBuffer sb = new StringBuffer();
		int lvSize = columnNames.size();
		for (int i=0;i<lvSize; i++) {
			sb.append(columnNames.get(i));
			if (i < (lvSize-1)) {
				sb.append(getDelimiter());
			}			
		}
		return sb.toString();
	}
1197122
def size(self):
        
        return len(self._query_compiler.index) * len(self._query_compiler.columns)
154445
def convert_column(data, schemae):
    """"""
    ctype = schemae.converted_type
    if ctype == parquet_thrift.ConvertedType.DECIMAL:
        scale_factor = Decimal("10e-{}".format(schemae.scale))
        if schemae.type == parquet_thrift.Type.INT32 or schemae.type == parquet_thrift.Type.INT64:
            return [Decimal(unscaled) * scale_factor for unscaled in data]
        return [Decimal(intbig(unscaled)) * scale_factor for unscaled in data]
    elif ctype == parquet_thrift.ConvertedType.DATE:
        return [datetime.date.fromordinal(d) for d in data]
    elif ctype == parquet_thrift.ConvertedType.TIME_MILLIS:
        return [datetime.timedelta(milliseconds=d) for d in data]
    elif ctype == parquet_thrift.ConvertedType.TIMESTAMP_MILLIS:
        return [datetime.datetime.utcfromtimestamp(d / 1000.0) for d in data]
    elif ctype == parquet_thrift.ConvertedType.UTF8:
        return [codecs.decode(item, "utf-8") for item in data]
    elif ctype == parquet_thrift.ConvertedType.UINT_8:
        return _convert_unsigned(data, 'b')
    elif ctype == parquet_thrift.ConvertedType.UINT_16:
        return _convert_unsigned(data, 'h')
    elif ctype == parquet_thrift.ConvertedType.UINT_32:
        return _convert_unsigned(data, 'i')
    elif ctype == parquet_thrift.ConvertedType.UINT_64:
        return _convert_unsigned(data, 'q')
    elif ctype == parquet_thrift.ConvertedType.JSON:
        return [json.loads(s) for s in codecs.iterdecode(data, "utf-8")]
    elif ctype == parquet_thrift.ConvertedType.BSON and bson:
        return [bson.BSON(s).decode() for s in data]
    else:
        logger.info("Converted type '%s'' not handled",
                    parquet_thrift.ConvertedType._VALUES_TO_NAMES[ctype])  # pylint:disable=protected-access
    return data
109251
def types(self):
        """"""
        res = []
        for column in self.column_definitions:
            tmp = column.get('type', None)
            res.append(ModelCompiler.get_column_type(tmp)) if tmp else False
        res = list(set(res))
        return res
395984
public double[] getColumn(int col) {
    double[] column = new double[numRows];
    int offset = translate(0, col, numRows);
    for (int i = 0; i < column.length; i++) {
      column[i] = matrix[offset + i];
    }
    return column;
  }
934590
public ColumnSpec[] getColumnSpecs() {
        Set<ColumnSpec> results = new HashSet<>();
        addTo(results, this.baseSpec);
        addTo(results, this.codeSpec);
        addTo(results, this.constraintSpecs);
        addTo(results, this.finishTimeSpec);
        addTo(results, this.startTimeOrTimestampSpec);
        addTo(results, this.uniqueIdSpecs);
        addTo(results, this.valueSpec);
        addTo(results, this.createDateSpec);
        addTo(results, this.updateDateSpec);
        addTo(results, this.deleteDateSpec);
        for (PropertySpec propertySpec : this.propertySpecs) {
            addTo(results, propertySpec.getCodeSpec());
        }
        return results.toArray(new ColumnSpec[results.size()]);
    }
838549
protected function _column($real) {
		if (is_array($real)) {
			return $real['type'] . (isset($real['length']) ? "({$real['length']})" : '');
		}

		if (!preg_match('/(?P<type>\w+)(?:\((?P<length>[\d,]+)\))?/', $real, $column)) {
			return $real;
		}
		$column = array_intersect_key($column, ['type' => null, 'length' => null]);

		if (isset($column['length']) && $column['length']) {
			$length = explode(',', $column['length']) + [null, null];
			$column['length'] = $length[0] ? (integer) $length[0] : null;
			$length[1] ? $column['precision'] = (integer) $length[1] : null;
		}

		switch (true) {
			case in_array($column['type'], ['date', 'time', 'datetime', 'timestamp']):
				return $column;
			case ($column['type'] === 'tinyint' && $column['length'] == '1'):
			case ($column['type'] === 'boolean'):
				return ['type' => 'boolean'];
			break;
			case (strpos($column['type'], 'int') !== false):
				$column['type'] = 'integer';
			break;
			case (strpos($column['type'], 'char') !== false || $column['type'] === 'tinytext'):
				$column['type'] = 'string';
			break;
			case (strpos($column['type'], 'text') !== false):
				$column['type'] = 'text';
			break;
			case (strpos($column['type'], 'blob') !== false || $column['type'] === 'binary'):
				$column['type'] = 'binary';
			break;
			case preg_match('/float|double|decimal/', $column['type']):
				$column['type'] = 'float';
			break;
			default:
				$column['type'] = 'text';
			break;
		}
		return $column;
	}