Questions tagged [lines]

This tag can refer to rows of characters in text output or input, or to the shortest distance between two points.

This tag can refer to:

  • rows of characters in text output or input;
  • the shortest distance between two points (see also: ).
1223 questions
6
votes
1 answer

Smoothing an inclined line

I can't find a proper way to draw a smooth inclined line without having it over-pixelated in Qt with the QPainterPath object. Note that I know it doesn't make sense to draw the path in the paintEvent function, I put it there for sake of simplicity.…
Getter
  • 765
  • 2
  • 6
  • 15
6
votes
5 answers

How do I remove lines from a big file in Python, within limited environment

Say I have a 10GB HDD Ubuntu VPS in the USA (and I live in some where else), and I have a 9GB text file on the hard drive. I have 512MB of RAM, and about the same amount of swap. Given the fact that I cannot add more HDD space and cannot move the…
James Lin
  • 25,028
  • 36
  • 133
  • 233
6
votes
4 answers

Sorting algorithm: Big text file with variable-length lines (comma-separated values)

What's a good algorithm for sorting text files that are larger than available memory (many 10s of gigabytes) and contain variable-length records? All the algorithms I've seen assume 1) data fits in memory, or 2) records are fixed-length. But imagine…
Sophie
  • 63
  • 3
6
votes
3 answers

Objective C label line spacing?

Is there a way to set the distance of two lines within a UILabel? I tried to do it within Interface Builder but without success.
Secondwave
  • 225
  • 1
  • 4
  • 17
6
votes
6 answers

How do I only print every 5th line

I have a text file ("name_data.txt") that has the following contents: name: Kelo family name: Lam location: Asia members: Kelo, Kiko, Jil name: Miko family name: Naiton location: Japan members: Miko,Kayati The text file keeps going with the same…
Robbie
  • 61
  • 5
6
votes
2 answers

Using grep to find words that have a certain prefix and suffix

I'm trying to figure out how to find certain words in a file that start with the letters air and end with the letters ne. I'd like to print the words that it matches with into a new file called "excluded". I'm very new to this environment of…
Vno
  • 71
  • 2
  • 2
  • 8
6
votes
4 answers

LaTeX: Lstlisting automatically recognizing code passage

I am writing a program (in C, but I suppose that's not so relevant) in connection with a little documentary material in LaTeX. I want the documentary material to contain code snippets from my original code. In order to include source code and keep…
phimuemue
  • 34,669
  • 9
  • 84
  • 115
6
votes
3 answers

Ruby equivalent to "grep -C 5" to get context of lines around the match?

I've searched for this a bit but I must be using the wrong terms - does ruby have a way to grep for a string/regex and also return the surrounding 5 lines (above and below)? I know I could just call "grep -C 5 ..."or even write my own method, but it…
wonderfulthunk
  • 555
  • 4
  • 16
6
votes
1 answer

r - ggplot2: connecting points in polar coordinates with a straight line

I have a plot in polar coordinates. I used geom_path to connect the points, but I'd like the paths to be straight lines. Here's what I have so far: example <- data.frame(c(5,4,3),c(0.9,1.1,0.6)) colnames(example) <- c("r", "theta") myplot <-…
Maria Reyes
  • 369
  • 3
  • 18
6
votes
3 answers

How to join all lines till next condition?

I can't find out how to join all lines till a next condition happens (a line with only 1 or more numbers) p.e. input: 1 text text text text (with numbers) text text text text (with numbers) 2 this text text text text text (with…
Reman
  • 7,931
  • 11
  • 55
  • 97
6
votes
1 answer

Why is 'curve' so different from 'lines' and 'points' in R?

I would like to fit the frequency data with discrete generalized beta distribution (DGBD). The data look like this: freq = c(1116, 2067, 137 , 124, 643, 2042, 55 ,47186, 7504, 1488, 211, 1608, 3517 , 7 , 896 , 378, 17 ,3098,…
Frank Wang
  • 1,462
  • 3
  • 17
  • 39
6
votes
1 answer

plot individual geom_hline for each geomp_boxplot

I have a boxplot and would like to add simple horizontal lines with geom_hline for each boxplot individually. I've tried on a boxplot example from R. The problems are that: The lines span the whole plot instead of just the boxplot. They are behind…
dmeu
  • 3,842
  • 5
  • 27
  • 43
6
votes
1 answer

OpenGL: GL_LINE_SMOOTH not supported on all cards; wont even draw the lines, unless

First of all, whats the purpose of this code? glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); I could put there GL_DONT_CARE but it doesnt make my lines drawn, unless i use glDisable(GL_LINE_SMOOTH) So im asking if theres some built in mechanism to make…
Newbie
6
votes
2 answers

glPolygonOffset() bugs with lines

I have the following code: glEnable(GL_POLYGON_OFFSET_LINE); glPolygonOffset(1,1); // or 40,40 etc... doesnt help at all But the lines are still z-fighting, is this common bug or something...? My lines are 1.0f thick and i draw the lines last in…
Newbie
6
votes
1 answer

Powershell - how to obtain previous lines from text file?

I have a text file containing hundreds of lines of text containing database info. I'm trying to extract the DatabaseIds for any database which is 35GB. I would like to interrogate the file using Powershell and produce a text file containing all the…
user2390040
  • 63
  • 1
  • 3