Questions tagged [text]

Text is a sequence of printable characters.

Text is a sequence of printable characters.

Text can be unformatted (plain) or formatted (rich).

The most common character codes used for representing text are Unicode and ASCII:

  • ASCII is a character code and an encoding.
  • Unicode is a complex standard, with multiple encodings, the most common of which is UTF-8.
31743 questions
218
votes
5 answers

Using varchar(MAX) vs TEXT on SQL Server

I just read that the VARCHAR(MAX) datatype (which can store close to 2GB of char data) is the recommended replacement for the TEXT datatype in SQL Server 2005 and Next SQL SERVER versions. If I want to search inside a column for any string, which…
user85116
  • 4,422
  • 7
  • 35
  • 33
215
votes
5 answers

Write string to text file and ensure it always overwrites the existing content.

I have a string with a C# program that I want to write to a file and always overwrite the existing content. If the file isn't there, the program should create a new file instead of throwing an exception.
leora
  • 188,729
  • 360
  • 878
  • 1,366
213
votes
6 answers

Truncating long strings with CSS: feasible yet?

Is there any good way of truncating text with plain HTML and CSS, so that dynamic content can fit in a fixed-width-and-height layout? I've been truncating server-side by logical width (i.e. a blindly-guessed number of characters), but since a 'w' is…
Sam Stokes
  • 14,617
  • 7
  • 36
  • 33
210
votes
11 answers

How to replace an entire line in a text file by line number

I have a situation where I want a bash script to replace an entire line in a file. The line number is always the same, so that can be a hard-coded variable. I'm not trying to replace some sub-string in that line, I just want to replace that line…
user788171
  • 16,753
  • 40
  • 98
  • 125
209
votes
12 answers

Can someone give an example of cosine similarity, in a very simple, graphical way?

Cosine Similarity article on Wikipedia Can you show the vectors here (in a list or something) and then do the math, and let us see how it works?
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
208
votes
5 answers

What is state-of-the-art for text rendering in OpenGL as of version 4.1?

There are already a number of questions about text rendering in OpenGL, such as: How to do OpenGL live text-rendering for a GUI? But mostly what is discussed is rendering textured quads using the fixed-function pipeline. Surely shaders must make…
Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
205
votes
8 answers

nvarchar(max) vs NText

What are the advantages and disadvantages of using the nvarchar(max) vs. NText data types in SQL Server? I don't need backward compatibility, so it is fine that nvarchar(max) isn't supported in older SQL Server releases. Edit: Apparently the…
David Pfeffer
  • 38,869
  • 30
  • 127
  • 202
203
votes
4 answers

How can I make text appear on next line instead of overflowing?

I have a fixed width div on my page that contains text. When I enter a long string of letters it overflows. I don't want to hide overflow I want to display the overflow on a new line, see below:
user342391
  • 7,569
  • 23
  • 66
  • 88
202
votes
4 answers

How can I change the text color with jQuery?

When I hover a text with animation definitely I will use jQuery. Is there a code that will change the color, or size?
Jorge
  • 5,610
  • 18
  • 47
  • 67
196
votes
13 answers

Sort a text file by line length including spaces

I have a CSV file that looks like this AS2345,ASDF1232, Mr. Plain Example, 110 Binary ave.,Atlantis,RI,12345,(999)123-5555,1.56 AS2345,ASDF1232, Mrs. Plain Example, 1121110 Ternary st. 110 Binary…
gnarbarian
  • 2,622
  • 2
  • 19
  • 25
187
votes
7 answers

Copying text to the clipboard using Java

I want to copy text from a JTable's cell to the clipboard, making it available to be pasted into other programs such as Microsoft Word. I have the text from the JTable, but I am unsure how to copy it to the clipboard.
user765134
  • 1,873
  • 2
  • 12
  • 4
187
votes
15 answers

How to extract text from a PDF?

Can anyone recommend a library/API for extracting the text and images from a PDF? We need to be able to get at text that is contained in pre-known regions of the document, so the API will need to give us positional information of each element on the…
Budda007
  • 1,903
  • 2
  • 12
  • 3
186
votes
2 answers

Editing legend (text) labels in ggplot

I have spent hours looking in the documentation and on StackOverflow, but no solution seems to solve my problem. When using ggplot I can't get the right text in the legend, even though it's in my dataframe. I have tried scale_colour_manual,…
user3633161
  • 1,963
  • 2
  • 12
  • 6
182
votes
35 answers

Label under image in UIButton

I'm trying to create a button which has some text beneath the icon (sorta like the app buttons) however it seems to be quite difficult to achieve. Any ideas how can I go about get the text to display below the image with a UIButton?
NRaf
  • 7,407
  • 13
  • 52
  • 91
182
votes
26 answers

How can you find the height of text on an HTML canvas?

The spec has a context.measureText(text) function that will tell you how much width it would require to print that text, but I can't find a way to find out how tall it is. I know it's based on the font, but I don't know to convert a font string to a…
swampsjohn
  • 6,826
  • 7
  • 37
  • 42