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
11
votes
4 answers

Select text between double quotes over multiple lines in VIM

Let's say I have the following text: "test 1 test 2 test 3" I want to select everything between the quotes. I have used vi", but it does not work, it works only when the text is on a single line. On the other hand when when I have something like…
Mihai Vinaga
  • 1,059
  • 2
  • 10
  • 27
11
votes
3 answers

How to have line breaks in XML attributes?

I have a attribute called: description and I want to have the following in it with new lines: This is the content description section. Download instruction: This is the contents on how to download contents. Hotline support: This is the…
sling
  • 699
  • 3
  • 8
  • 10
10
votes
3 answers

How to select lines that are drawn on a HTML5 Canvas?

I am using using HTML5 Canvas to plot lines. A single line is formed by calling drawLine() on multiple intermediate points. For example: (0,0) -> (10, 10) -> (10, 5) -> (20, 12) would show up as one line on the plot. All the (x,y) co-ordinates of a…
kkonweb
  • 125
  • 1
  • 7
10
votes
3 answers

Calculating angle between two points - java

I need to calculate the angle in degrees between two points, with a fixed point that is connected with the given two points by a line. Here is an image that illustrates what I need: Here is what I have tried so far: public static float…
David Lasry
  • 1,407
  • 4
  • 26
  • 43
10
votes
5 answers

Remove lines which are between given patterns from a file (using Unix tools)

I have a text file (more correctly, a “German style“ CSV file, i.e. semicolon-separated, decimal comma) which has a date and the value of a measurement on each line. There are stretches of faulty values which I want to remove before further work. …
Florian Jenn
  • 5,211
  • 4
  • 23
  • 18
10
votes
3 answers

How do I Join the line above after current line?

I know these commands in Vim: J : Join line below after current line -J : Join current line after line above but how do I join the line above after current line?
Reman
  • 7,931
  • 11
  • 55
  • 97
10
votes
3 answers

matplotlib - control capstyle of line collection/large number of lines

Similarly to a previous question of mine, I'd like to control the capstyle of lines being drawn using matplotlib. However, I have an extremely large number of lines, and drawing with anything other than a line collection takes way too long. Are…
Carson Farmer
  • 506
  • 3
  • 19
9
votes
3 answers

Count lines in a posted string

I've tried this: count new lines in textarea to resize container in PHP? But it doesn't seems to be working: $content = nl2br($_POST['text']); preg_match_all("/(
)/", $content, $matches); echo count($matches[0]) + 1; It'll always output 1. Is…
Cyclone
  • 14,839
  • 23
  • 82
  • 114
9
votes
2 answers

OpenGL: Draw lines with VBO

How to draw several separate lines using a single VBO?
itun
  • 3,439
  • 12
  • 51
  • 75
9
votes
4 answers

Fastest way to skip lines while parsing files in Ruby?

I tried searching for this, but couldn't find much. It seems like something that's probably been asked before (many times?), so I apologize if that's the case. I was wondering what the fastest way to parse certain parts of a file in Ruby would be.…
DRobinson
  • 4,441
  • 22
  • 31
9
votes
2 answers

Why do I have lines going across my libgdx game using Tiled?

I'm using LibGdx and Tiled and when moving around the screen, there are both horizontal and vertical lines appearing on the game. I can post any code you need, if necessary. How do I get these lines to stop? Here's a gfycat gif of the…
Dylan
  • 188
  • 3
  • 12
8
votes
7 answers

PHPMailer - how can I add break lines in altbody?

How can I add break lines? I'm using this: $mailbody=$username."\r\n"; $mailbody.=$email."\r\n"; $altbody=$username."\r\n"; $altbody.=$email."\r\n"; But break lines are not there. I'm using $altbody because for some reason the software I use to…
Thomas Hardy
  • 81
  • 1
  • 1
  • 3
8
votes
6 answers

sorting lines of an enormous file.txt in java

I'm working with a very big text file (755Mb). I need to sort the lines (about 1890000) and then write them back in another file. I already noticed that discussion that has a starting file really similar to mine: Sorting Lines Based on words in them…
Lucia Belardinelli
  • 727
  • 1
  • 11
  • 20
8
votes
2 answers

Draw line between two given points (OpenCV, Python)

I am struggling with this problem for an hour by now... I have an image with a rectangle inside: This is the code I wrote to find the points for the corners: import cv2 import numpy as np img = cv2.imread('rect.png') gray = cv2.cvtColor(img,…
BlueTrack
  • 442
  • 3
  • 7
  • 19
8
votes
6 answers

Good C-coding style for multiple lines if conditions

I am programming a project in C and have a problem: I've got a lot of if conditions and it might get really hard for other people to read. I haven't yet found a similar question on the internet. Do you have an idea or example how to make my code…
En Kt
  • 113
  • 1
  • 1
  • 5