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
6
votes
6 answers

How to change truncate characters in UILabel?

When the text of a UILabel gets truncated there are 3 dots inserted by default. Is it possible to change these characters or disable them?
Felix
  • 35,354
  • 13
  • 96
  • 143
6
votes
2 answers

if/else statement for defining a distribution in JAGS

In JAGS I'd like to define a Poisson distribution for parameter w[i] which is also truncated (greater than or equal to 2) if another parameter, e[i], is greater than 0. Essentially I want it to represent: w[i] ~ ifelse( e[i] > 0, dpois(mu) T(2,) ,…
james_980
  • 75
  • 1
  • 4
6
votes
1 answer

How to truncate text in HTML

I have an HTML email (with the following HTML in it) to be sent to our user base, the email sends correctly. I have some lines that are very long, and the text needs to fit in a fixed layout and text longer than 3 lines needs to be truncated. Is…
Daniela
  • 861
  • 5
  • 11
  • 28
6
votes
1 answer

What is the maximum url length that can be safely used in an email?

My website sends out an email with a link in it. Lately we've been getting a lot of errors that indicate that the URL in the email that we send out is being somehow garbled. Unfortunately we dont' have any logs that indicate what the url they…
aamiri
  • 2,420
  • 4
  • 38
  • 58
5
votes
4 answers

Difference between narrowing and truncation in C++?

I've been going through a book (C++ Programming Language Stroustrup 4th ed). An example given in a section related to Initialization as below: void f(double d, int i) { int a{ d }; // error : possible truncation char b{ i }; // error…
pasha
  • 2,035
  • 20
  • 34
5
votes
3 answers

Truncating multiline html text using truncate.js

I found a wonderful html truncation library, truncate.js, which handles about 99% of my needs. But I have one nagging issue I am facing. I have a requirement that requires 'Show more' be placed on the end of a specific number of lines for a series…
abidmix
  • 1,748
  • 1
  • 16
  • 26
5
votes
2 answers

UITextView: Find location of ellipsis in truncated text

I have a UITextView with some attributed text, where the textContainer.maximumNumberOfLine is set (3 in this case). I'd like to find the index of the ellipsis character within the character range of the attributed string. E.g: Original String:…
Tim Malseed
  • 6,003
  • 6
  • 48
  • 66
5
votes
2 answers

truncating a text file does not change the file

When a novice (like me) asks for reading/processing a text file in python he often gets answers like: with open("input.txt", 'r') as f: for line in f: #do your stuff Now I would like to truncate everything in the file I'm reading after…
ead
  • 32,758
  • 6
  • 90
  • 153
5
votes
1 answer

Troubleshoot MYSQL truncation with C api

I am using prepared statements with the MYSQL C API and I am having trouble with truncation. mysql_stmt_fetch() always returns MYSQL_DATA_TRUNCATED and I don't understand why. Can someone give me reasons why the data would be truncated to help me…
BenP1192
  • 221
  • 1
  • 6
5
votes
2 answers

How do I determine if truncation is being applied in my style through JS?

I am applying truncation using CSS styles: .yui-skin-sam td:not(.yui-dt-editable) .yui-dt-liner{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -ms-text-overflow: ellipsis; -o-text-overflow: ellipsis; …
Son of the Wai-Pan
  • 12,371
  • 16
  • 46
  • 55
4
votes
2 answers

Spring endpoint receives truncated body for larger http requests

I have a component, deployed in an EC2-instance on AWS, which will fail 'randomly' (~70% of the request) when sending a larger payload (40k). Sending the request is done using Postman. Sending the same request over and over again (with same delay in…
Bas E
  • 51
  • 1
  • 4
4
votes
1 answer

The truncation problem of SwiftUI Text View

I am making a swiftUI calendar and met a weird truncation problem of SwiftUI Text View. struct test : View { var body: some View { GeometryReader { geometry in HStack(alignment: .center, spacing: 0) { ForEach(0..<7) { _ in …
echo
  • 1,244
  • 1
  • 16
  • 40
4
votes
4 answers

PHP is truncating MSSQL Blob data (4096b), even after setting INI values. Am I missing one?

I am writing a PHP script that goes through a table and extracts the varbinary(max) blob data from each record into an external file. The code is working perfectly (I used virtually the same code to go through some images) except when a file is over…
Dutchie432
  • 28,798
  • 20
  • 92
  • 109
4
votes
1 answer

java integer rounding (division related)

I have run into a surprise with integer division not rounding down as expected. Simple code: public class HelloMath { public static void main(String[] args) { for (int s=1; s< 20; s++) { int div = 1<
Keybounce
  • 59
  • 1
  • 2
  • 4
4
votes
2 answers

NSLineBreakByTruncatingTail on UITextView removing new line breaks

I have a UITextView with attributedText that has multiple new line breaks included in its attributed string. NSMutableAttributedString *info = [[NSMutableAttributedString alloc] initWithString:@""]; NSAttributedString *title = [[NSAttributedString…
vpetro
  • 83
  • 6
1 2
3
23 24