// NewDoubleTsCell creates a TsCell from an floating point number
424455
func NewDoubleTsCell(v float64) TsCell {
	tsc := riak_ts.TsCell{DoubleValue: &v}
	tsct := riak_ts.TsColumnType_DOUBLE
	return TsCell{columnType: tsct, cell: &tsc}
}
367304
func convertFromPbTsRows(tsRows []*riak_ts.TsRow, tsCols []*riak_ts.TsColumnDescription) [][]TsCell {
	var rows [][]TsCell
	var row []TsCell
	var cell TsCell

	for _, tsRow := range tsRows {
		row = make([]TsCell, 0)

		for i, tsCell := range tsRow.Cells {
			tsColumnType := riak_ts.TsColumnType_VARCHAR
			if tsCols != nil {
				tsColumnType = tsCols[i].GetType()
			}
			cell.setCell(tsCell, tsColumnType)
			row = append(row, cell)
		}

		if len(rows) < 1 {
			rows = make([][]TsCell, 0)
		}

		rows = append(rows, row)
	}

	return rows
}
208347
func NewDFT(sr int, x []float64) *DFT {
	return &DFT{
		SampleRate: sr,
		Coefs:      fft.FFTReal(x),
	}
}
609930
func NewNumericFacet(field string, size int) *NumericFacet {
	mq := &NumericFacet{}
	mq.data.Field = field
	mq.data.Size = size
	return mq
}
900261
func NewStringTsCell(v string) TsCell {
	tsc := riak_ts.TsCell{VarcharValue: []byte(v)}
	tsct := riak_ts.TsColumnType_VARCHAR
	return TsCell{columnType: tsct, cell: &tsc}
}
585972
func (c *SQLiteContext) ResultDouble(d float64) {
	C.sqlite3_result_double((*C.sqlite3_context)(c), C.double(d))
}
259929
func NewIncSingle(ctx context.Context, table, key []byte, family, qualifier string,
	amount int64, options ...func(Call) error) (*Mutate, error) {
	buf := make([]byte, 8)
	binary.BigEndian.PutUint64(buf, uint64(amount))
	value := map[string]map[string][]byte{family: map[string][]byte{qualifier: buf}}
	return NewInc(ctx, table, key, value, options...)
}
718558
func shiftCell(cellID string, dx, dy int) string {
	fx, fy, _ := GetCoordsFromCellIDString(cellID)

	// Is fixed column?
	fixedCol := strings.Index(cellID, fixedCellRefChar) == 0

	// Is fixed row?
	fixedRow := strings.LastIndex(cellID, fixedCellRefChar) > 0

	if !fixedCol {
		// Shift column
		fx += dx
	}

	if !fixedRow {
		// Shift row
		fy += dy
	}

	// New shifted cell
	shiftedCellID := GetCellIDStringFromCoords(fx, fy)

	if !fixedCol && !fixedRow {
		return shiftedCellID
	}

	// There are absolute references, need to put the $ back into the formula.
	letterPart := strings.Map(letterOnlyMapF, shiftedCellID)
	numberPart := strings.Map(intOnlyMapF, shiftedCellID)

	result := ""

	if fixedCol {
		result += "$"
	}

	result += letterPart

	if fixedRow {
		result += "$"
	}

	result += numberPart

	return result
}
907583
func NewBlobTsCell(v []byte) TsCell {
	tsc := riak_ts.TsCell{VarcharValue: v}
	tsct := riak_ts.TsColumnType_BLOB
	return TsCell{columnType: tsct, cell: &tsc}
}
804364
func (ts *Server) CreateCellsAlias(ctx context.Context, alias string, cellsAlias *topodatapb.CellsAlias) error {
	currentAliases, err := ts.GetCellsAliases(ctx, true)
	if err != nil {
		return err
	}

	if overlappingAliases(currentAliases, cellsAlias) {
		return fmt.Errorf("unsupported: you can't over overlapping aliases. Cells alias: %v, has an overlap with existent aliases", cellsAlias)

	}

	ts.clearCellAliasesCache()

	// Pack the content.
	contents, err := proto.Marshal(cellsAlias)
	if err != nil {
		return err
	}

	// Save it.
	filePath := pathForCellsAlias(alias)
	_, err = ts.globalCell.Create(ctx, filePath, contents)
	return err
}
1334163
func ColIndexToLetters(colRef int) string {
	parts := intToBase26(colRef)
	return formatColumnName(smooshBase26Slice(parts))
}
618754
func (s *Service) AddDashboardCell(ctx context.Context, id platform.ID, cell *platform.Cell, opts platform.AddDashboardCellOptions) error {
	op := OpPrefix + platform.OpAddDashboardCell
	d, err := s.FindDashboardByID(ctx, id)
	if err != nil {
		return &platform.Error{
			Err: err,
			Op:  op,
		}
	}
	cell.ID = s.IDGenerator.ID()
	if err := s.createCellView(ctx, cell); err != nil {
		return &platform.Error{
			Err: err,
			Op:  op,
		}
	}

	d.Cells = append(d.Cells, cell)
	if err = s.PutDashboardWithMeta(ctx, d); err != nil {
		return &platform.Error{
			Err: err,
			Op:  op,
		}
	}
	return nil
}
1000155
func NewNumberTypeDef(init ...*NumberTypeDef) *NumberTypeDef {
	var o *NumberTypeDef
	if len(init) == 1 {
		o = init[0]
	} else {
		o = new(NumberTypeDef)
	}
	return o
}
439212
func (f *Fpdf) Cell(w, h float64, txtStr string) {
	f.CellFormat(w, h, txtStr, "", 0, "L", false, 0, "")
}
1004716
func NewAsymmetricSpritesheetFromTexture(tr *TextureResource, spriteRegions []SpriteRegion) *Spritesheet {
	return &Spritesheet{
		texture: tr.Texture,
		width:   tr.Width,
		height:  tr.Height,
		cells:   spriteRegions,
		cache:   make(map[int]Texture),
	}
}
1283389
func NewDoubleArray(seqs [][]string) *DoubleArray {
	da := &DoubleArray{Encoding: make(map[string]int)}
	if len(seqs) == 0 {
		return da
	}

	encoded := registerTokens(da, seqs)
	sort.Sort(byLex(encoded))

	root := node{row: -1, col: -1, left: 0, right: len(encoded)}
	addSeqs(da, encoded, 0, root)

	for i := len(da.Base); i > 0; i-- {
		if da.Check[i-1] != 0 {
			da.Base = da.Base[:i]
			da.Check = da.Check[:i]
			break
		}
	}
	return da
}
278602
func fillCellData(rawcell xlsxC, reftable *RefTable, sharedFormulas map[int]sharedFormula, cell *Cell) {
	var data string = rawcell.V
	if len(data) > 0 {
		vval := strings.Trim(data, " \t\n\r")
		switch rawcell.T {
		case "s": // Shared String
			ref, error := strconv.Atoi(vval)
			if error != nil {
				panic(error)
			}
			cell.Value = reftable.ResolveSharedString(ref)
			cell.cellType = CellTypeString
		case "b": // Boolean
			cell.Value = vval
			cell.cellType = CellTypeBool
		case "e": // Error
			cell.Value = vval
			cell.formula = formulaForCell(rawcell, sharedFormulas)
			cell.cellType = CellTypeError
		default:
			if rawcell.F == nil {
				// Numeric
				cell.Value = vval
				cell.cellType = CellTypeNumeric
			} else {
				// Formula
				cell.Value = vval
				cell.formula = formulaForCell(rawcell, sharedFormulas)
				cell.cellType = CellTypeFormula
			}
		}
	}
}