Questions tagged [line]

The shortest distance between two points. Or, a row of characters in text output.

is mostly used in below context:

  • text line or command line in text processing context;
  • line drawing or plotting in visualization or image-processing context
  • analytic geometry

For the LINE-API / LIFF use line-api or line-messenger

6255 questions
28
votes
7 answers

How to draw a directed arrow line in Java?

I want to draw a directed arrow line through Java. At present, I am using java.awt.Line2D.Double class to draw a line g2.setStroke(new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); // g2 is an instance of Graphics2D g2.draw(new…
Amit
  • 33,847
  • 91
  • 226
  • 299
27
votes
5 answers

Vim CursorLine color change in insert mode

There is good snippet for changing cursor color: if &term =~ "xterm\\|rxvt" " use an orange cursor in insert mode let &t_SI = "\]12;orange\x7" " use a red cursor otherwise let &t_EI = "\]12;red\x7" silent !echo -ne…
JackLeo
  • 4,579
  • 9
  • 40
  • 66
27
votes
8 answers

Definition list with inline pairs

I'm trying to create a definition list of term-definition pairs, each pair existing on a single, separate line. I've tried making dts and dds display:inline, but then I lose the line breaks between the pairs. How do I make sure I have a line for…
krainert
  • 375
  • 1
  • 4
  • 13
27
votes
5 answers

Is it possible to wait a few seconds before printing a new line in C?

For example could I make it type something like "Hello" "This" "Is" "A" "Test" With 1 second intervals in-between each new line? Thanks,
AppleAssassin
  • 465
  • 1
  • 5
  • 10
26
votes
9 answers

How do I render thick 2D lines as polygons?

I have a path made up of a list of 2D points. I want to turn these into a strip of triangles in order to render a textured line with a specified thickness (and other such things). So essentially the list of 2D points need to become a list of…
Patrick Hogan
  • 2,098
  • 4
  • 20
  • 28
26
votes
3 answers

glLineStipple deprecated in OpenGL 3.1

glLineStipple has been deprecated in the latest OpenGL APIs. What is it replaced with? If not replaced, how can I get a similar effect? (I don't want to use a compatibility profile of course...)
Vincent
  • 289
  • 1
  • 3
  • 9
26
votes
6 answers

Line-height without units

I saw people using line height without specifying a unit, like this: line-height: 1.5; What does the number represents? I'm guessing it's a ratio so is it like em?
ilyo
  • 35,851
  • 46
  • 106
  • 159
24
votes
9 answers

Finding number of lines in an html textarea

I'm writing a mobile web application where scrollbars are not displayed on the device's browser. Due to this, I'm trying to dynamically modify the height of the textarea to make it bigger, however I don't know of any way to actually get the line…
Kyle
  • 607
  • 2
  • 6
  • 14
24
votes
8 answers

Artisan showing inserting "32m", "34;4m" and similar

I have no idea why but my Git Bash terminal is showing 34m and random numbers in places. Here's a screenshot. Thanks for any help.
Phillip Y.
  • 517
  • 5
  • 18
24
votes
2 answers

create a multi line chart using Chart.js

I am trying to create a multiline chart using Chart.js I can do this for 1 line and i can do 2 lines using a fixed data structure but I cannot get multiple lines to display data passed to the data structure. here is the example usage abbreviated…
David Williamson
  • 255
  • 1
  • 2
  • 5
24
votes
4 answers

How do you draw a line on a canvas in WPF that is 1 pixel thick

I'm using the Line class to draw on a canvas in WPF and even though I set StrokeThickness = 1, the line shows up 2 pixels wide - it's almost as if the minimum thickness is two. How do I draw a line that is truly 1 pixel thick? Line myLine = new…
xarzu
  • 8,657
  • 40
  • 108
  • 160
24
votes
1 answer

Draw a line using an angle and a point in OpenCV

I have a point and an angle in OpenCV, how can I draw that using those parameters and not using 2 points? Thanks so much!
DualSim
  • 279
  • 2
  • 4
  • 7
23
votes
10 answers

How to delete a line from the file with php?

I have a file named $dir and a string named $line, I know that this string is a complete line of that file but I don't know its line number and I want to remove it from file, what should I do? Is it possible to use awk?
ibrahim
  • 3,254
  • 7
  • 42
  • 56
23
votes
6 answers

Line rasterisation: Cover all pixels, regardless of line gradient?

Basically, I want to use a line algo to determine which cells to check for collisions for my raycaster. Bresenham isn't great for this as it uses a unified-thickness approach, meaning that it ignores cells that aren't at least half-covering the…
Steffan Donal
  • 2,244
  • 4
  • 24
  • 47
22
votes
4 answers

Asymptotically optimal algorithm to compute if a line intersects a convex polygon

An O(n) algorithm to detect if a line intersects a convex polygon consists in checking if any edge of the polygon intersects the line, and look if the number of intersections is odd or even. Is there an asymptotically faster algorithm, e.g. an O(log…