Determine the start and end columns and names of the fields.
10152
def parse_fields(self):
        """"""

        rule = self.t['toprule'].rstrip()  # keep leading space for correct columns!!
        if not (rule == self.t['midrule'].rstrip() and rule == self.t['botrule'].rstrip()):
            raise ParseError("Table rules differ from each other (check white space).")
        names = self.t['fields'].split()
        nfields = len(rule.split())
        if nfields != len(names):
            raise ParseError("number of field names (%d) does not match number of fields (%d)"
                             % (nfields, len(names)))
        fields = []     #  list of tuples (first,last) column of the field
        ifield = 0
        is_field = rule.startswith('=')  # state
        len_rule = len(rule)
        start_field = 0
        end_field = 0
        for c in xrange(len_rule):
            char = rule[c]
            if not is_field and char == '=':
                start_field = c
                is_field = True
            if is_field and (char == ' ' or c == len_rule-1):
                # finished field
                fields.append((start_field, c))
                ifield += 1
                is_field = False
        self.names = names
        self.fields = fields
1073213
public void setupSFields()
    {
        Record record = this.getMainRecord();
        this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.START_DATE_TIME));
        this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.END_DATE_TIME));
        this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.DESCRIPTION));
    }
1358216
public void process()
   {
      if (m_data != null)
      {
         int index = 0;
         int offset = 0;
         // First the length (repeated twice)
         int length = MPPUtility.getInt(m_data, offset);
         offset += 8;
         // Then the number of custom columns
         int numberOfAliases = MPPUtility.getInt(m_data, offset);
         offset += 4;

         // Then the aliases themselves
         while (index < numberOfAliases && offset < length)
         {
            // Each item consists of the Field ID (2 bytes), 40 0B marker (2 bytes), and the
            // offset to the string (4 bytes)

            // Get the Field ID
            int fieldID = MPPUtility.getInt(m_data, offset);
            offset += 4;
            // Get the alias offset (offset + 4 for some reason).
            int aliasOffset = MPPUtility.getInt(m_data, offset) + 4;
            offset += 4;
            // Read the alias itself
            if (aliasOffset < m_data.length)
            {
               String alias = MPPUtility.getUnicodeString(m_data, aliasOffset);
               m_fields.getCustomField(FieldTypeHelper.getInstance(fieldID)).setAlias(alias);
            }
            index++;
         }
      }
   }
612392
public void setupSFields()
    {
        Record record = this.getMainRecord();
        BaseField field = record.getField(DBConstants.MAIN_FIELD);
        if (field == record.getCounterField())
            this.addColumn(field);
        super.setupSFields();
    }
938333
def parse(self):
        """"""

        self.parse_fields()
        records = []
        for line in self.t['data'].split('\n'):
            if EMPTY_ROW.match(line):
                continue
            row = [self.autoconvert(line[start_field:end_field+1])
                   for start_field, end_field in self.fields]
            records.append(tuple(row))
        self.records = records
687969
static void bottomTwoColumns(NodeInfo first, NodeInfo second, List<NodeInfo> column0, List<NodeInfo> column1) {
		column0.add(first);
		column0.add(second);

		NodeInfo a = selectClosestN(first,second);
		if( a == null ) {
			return;
		}
		a.marked = true;
		column1.add(a);
		NodeInfo b = second;

		while( true ) {
			NodeInfo t = selectClosestN(a,b);
			if( t == null ) break;
			t.marked = true;
			column1.add(t);

			a = t;
			t = selectClosestN(a,b);
			if( t == null ) break;
			t.marked = true;
			column0.add(t);
			b = t;
		}
	}
416144
def getFields(cls) :
		""""""
		s = set(cls.columns.keys())
		s.remove('json')
		s.remove('raba_id')
		return s
1037656
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_UPDATE_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, START_ANNIV_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, END_ANNIV_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, UPDATE_DAYS, 10, null, new Integer(1));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIV_BACK_DAYS, 10, null, new Integer(0));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIVERSARY_DAYS, 10, null, new Integer(60));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIVERSARY_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, APPOINTMENT_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
    }
521377
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, FILE_NAME, 40, null, null);
        field = new FieldInfo(this, FILE_DESC, 40, null, null);
        field = new FieldInfo(this, FILE_MAIN_FILENAME, 40, null, null);
        field = new FieldInfo(this, TYPE, 60, null, null);
        field = new FieldInfo(this, FILE_NOTES, 9999, null, null);
        field = new FieldInfo(this, DATABASE_NAME, 20, null, null);
        field = new FieldInfo(this, FILE_REC_CALLED, 40, null, null);
    }
422253
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, CLASS_INFO_CLASS_NAME, 40, null, null);
        field = new FieldInfo(this, CLASS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CLASS_FIELD_CLASS, 60, null, null);
        field = new FieldInfo(this, CLASS_FIELD_SEQUENCE, 10, null, new Integer(0));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CLASS_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, CLASS_FIELD_DESC, 30, null, null);
        field = new FieldInfo(this, CLASS_FIELD_PROTECT, 30, null, null);
        field = new FieldInfo(this, CLASS_FIELD_INITIAL, 32000, null, null);
        field = new FieldInfo(this, CLASS_FIELD_INITIAL_VALUE, 32000, null, null);
        field = new FieldInfo(this, CLASS_FIELDS_TYPE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
340685
protected function guessColumns()
    {
        $models = $this->dataProvider->getModels();
        $model = reset($models);
        if (is_array($model) || is_object($model)) {
            foreach ($model as $name => $value) {
                $this->columns[] = $name;
            }
        }
    }
420598
def get_column_list_prefixed(self):
        
        return map(
            lambda x: ".".join([self.name, x]),
            self.columns
        )
164316
def _nice_fieldnames(all_columns, index_columns):
    ""
    non_index_columns = set(all_columns).difference(index_columns)
    return index_columns + sorted(non_index_columns)
852039
def calculate_columns(self):
        """"""

        self.cols = int(math.ceil(len(self.elements) / float(self.rows)))
1037486
function(startRow, endRow, startCol, endCol) {
            	var x = [];
            	
            	if(endRow == 0)
            	    endRow = this.rows();
            	
            	if(endCol == 0)
            	    endCol = this.cols();

            	for(i = startRow; i <= endRow; i++) {
            	    var row = [];

            	    for(j = startCol; j <= endCol; j++) {
            		row.push(this.e(i, j));
            	    }

            	    x.push(row);
            	}

            	return $M(x);
                }
870886
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, START_DATE_TIME, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, END_DATE_TIME, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, DESCRIPTION, 60, null, null);
        field = new FieldInfo(this, REPEAT_INTERVAL_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, REPEAT_COUNT, 5, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, CALENDAR_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, HIDDEN, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field = new FieldInfo(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
    }
530540
def base_fields(self):
        ''''''
        if self.extensions_start is None:
            return len(self.fields)
        return len(self.fields[:self.extensions_start])