Questions tagged [truncation]

The process of shortening data by discarding a portion of it.

Data truncation occurs when only a portion of data or a data stream (such as a file) is stored.

Data truncation may occur automatically, such as when a long string is written to a smaller buffer, or deliberately, when only a portion of the data is wanted.

352 questions
15
votes
3 answers

Preventing truncation of long strings in pytest

I have written a test harness for system tests of our code using pytest. These tests are used in our continuous integration system so I am using the junit xml output option. The truncation of long strings by pytest is causing me problems. I know I…
gna gent
  • 151
  • 1
  • 4
14
votes
2 answers

'short name' for iOS apps possible?

I'd like to give my app one name for the App Store and one name that appears on the device, as app names that are too long are truncated with '…' on the device but not the store. Is this possible? Thanks in advance!
Jay
  • 902
  • 2
  • 12
  • 27
14
votes
7 answers

Strip all characters in a string starting from the second occurring hyphen

How can I strip everything in a string after the character - has occurred for the second time? For example: Today is - Friday and tomorrow is - Saturday I want Saturday to be removed along with the last hyphen: - Saturday I can only seem to get…
samirah
  • 199
  • 1
  • 2
  • 11
13
votes
5 answers

PyCharm: How to display all columns of dataframe in 'run' window without wrapping or truncation?

The issue I am facing has to do with how I can force the 'Run' window to show all columns of a given pandas dataframe, without fitting it to the size of the window (which happens for me either by truncation of column names, or by not showing all…
Fhyarnir
  • 453
  • 1
  • 4
  • 12
12
votes
1 answer

truncate ToolStripStatusLabel instead of hiding it

I have a StatusStrip control on a form. This control contains only one child control - it is ToolStripStatusLabel. When the text is too large, then nothing is displayed. I would prefer to display at least something instead of nothing. What should I…
Bogdan Verbenets
  • 25,686
  • 13
  • 66
  • 119
10
votes
2 answers

python: avoiding zip truncation of list

I have the following python code that uses zip() and it seems to cause unintended data truncation. inc_data = [[u'Period Ending', u'Dec 31, 2012', u'Dec 31, 2011', u'Dec 31, 2010'], [u'Total Revenue\n', u'104,507,100\n',…
vt2424253
  • 1,387
  • 4
  • 25
  • 39
10
votes
8 answers

Truncated Data when Importing from Excel to an Access Memo Field

Access is truncating the data in a couple Memo fields when I am appending an Excel file. The field in the Access table is already set as a Memo type. I believe the problem is that I do not have any entries in the first few rows of some of the memo…
RBSt
  • 143
  • 1
  • 3
  • 10
9
votes
3 answers

Inconsistent truncation of unsigned bitfield integer expressions between C++ and C in different compilers

Edit 2: I was debugging a strange test failure when a function previously residing in a C++ source file but moved into a C file verbatim, started to return incorrect results. The MVE below allows to reproduce the problem with GCC. However, when I,…
Grigory Rechistov
  • 2,104
  • 16
  • 25
9
votes
1 answer

CSS ellipsis truncation when width is narrower than ellipsis character

I'm using the following CSS to truncate text with ellipsis. .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } This works well for me, but doesn't behave as I would like when the width of the element is…
Ross Smith
  • 91
  • 1
  • 3
8
votes
2 answers

Importing CSV to SQL Server with text column > 8000 characters

I'm trying to import a csv file with two columns (sku, description) into SQL Server 2008 using the SQL Server management studio 2012 import/export wizard. Because the description column definitely has rows greater than 8000 characters, I go to the…
Michelle Williamson
  • 2,516
  • 4
  • 18
  • 19
7
votes
8 answers

HTML Truncating in Python

Is there a pure-Python tool to take some HTML and truncate it as close to a given length as possible, but make sure the resulting snippet is well-formed? For example, given this HTML:

This is a header

This is a paragraph

it would…
JasonFruit
  • 7,764
  • 5
  • 46
  • 61
7
votes
5 answers

Dividing with/without using floats in C

Below is the main function I wrote in C (for PIC18F8722 microprocessor) attempting to drive 2 multiplexing 7 segments displays at a specific frequency set by the unsigned int function get_ADC_value(). The displays also display the current…
Psi
  • 268
  • 4
  • 13
7
votes
4 answers

C++ Numerical truncation error

sorry if dumb but could not find an answer. #include using namespace std; int main() { double a(0); double b(0.001); cout << a - 0.0 << endl; for (;a<1.0;a+=b); cout << a - 1.0 << endl; for (;a<10.0;a+=b); cout << a - 10.0 << endl; cout…
Andrew
  • 2,309
  • 4
  • 27
  • 42
7
votes
2 answers

Easiest way to truncate float to 2 decimal places?

In Swift, is there a way to truncate a float to 2 decimals, such that you can perform further calculations with it? All of the threads I've seen deal with casting to a string, which I can't figure out how to then use mathematically. I tried…
NoClue
  • 211
  • 4
  • 13
7
votes
4 answers

Python not writing full string to file

I am attempting to output an aligned protein sequence to a file, however, the output string is truncated each time I attempt to write the string to file. The string I'm attempting to write is 4603 characters long, and is printed to the console with…
AHuck
  • 103
  • 1
  • 1
  • 7
1
2
3
23 24