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
17
votes
2 answers

Loop read each line of a file to its own array

I have a text file, it can vary in number of lines, but will always have 24 tab deliberated entries on each line. 4 of these entries are dates, but they're not in the normal YYYY-MM-DD format example: "2013-03-11T20:35:33+00:00" so I use substr and…
Vereonix
  • 1,341
  • 5
  • 27
  • 54
16
votes
8 answers

Inner angle between two lines

I have two lines: Line1 and Line2. Each line is defined by two points (P1L1(x1, y1), P2L1(x2, y2) and P1L1(x1, y1), P2L3(x2, y3)). I want to know the inner angle defined by these two lines. For do it I calculate the angle of each line with the…
osanchezmon
  • 544
  • 1
  • 4
  • 18
16
votes
2 answers

How do you indent *every* line of a element?

I have the following HTML chunk: Line 1
Line 2
And the CSS declaration of instruction_text is: .instruction_text { margin-left: 70px; font-style: italic; color: #555; } The first line has a…
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
16
votes
4 answers

How to generate list of unique lines in text file using a Linux shell script?

Suppose I have a file that contain a bunch of lines, some repeating: line1 line1 line1 line2 line3 line3 line3 What linux command(s) should I use to generate a list of unique lines: line1 line2 line3 Does this change if the file is unsorted, i.e.…
I Z
  • 5,719
  • 19
  • 53
  • 100
15
votes
3 answers

FLOT: How to make different colored points in same data series, connected by a line?

I think I may have stumbled onto a limitation of Flot, but I'm not sure. I'm trying to represent a single data series over time. The items' "State" is represented on the Y-Axis (there are 5 of them), and time is on the X-Axis (items can change…
Matt
  • 23,363
  • 39
  • 111
  • 152
14
votes
5 answers

How to read entire line from bash

I have a file file.txt with contents like i love this world I hate stupid managers I love linux I have MS When I do the following: for line in `cat file.txt`; do echo $line done It gives output like I love this world I .. .. But I need the…
webminal.org
  • 44,948
  • 37
  • 94
  • 125
14
votes
7 answers

Is StreamReader.Readline() really the fastest method to count lines in a file?

While looking around for a while I found quite a few discussions on how to figure out the number of lines in a file. For example these three: c# how do I count lines in a textfile Determine the number of lines within a text file How to count lines…
sergeidave
  • 662
  • 4
  • 11
  • 23
13
votes
2 answers

How to create a Three.js 3D line series with width and thickness?

Is there a way to create a Three.js 3D line series with width and thickness? Even though the Three.js line object supports linewidth, this attribute is not yet supported in all browsers on all platforms in WebGL. Here's where you set linewidth in…
Theo
  • 376
  • 1
  • 3
  • 13
12
votes
4 answers

Delete first four lines from the top in content stored in a variable

I have a variable that needs the first four lines stripped out before being displayed: Error Report Submission From: First Last, email@example.com, 12345 Date: 2009-04-16 04:33:31 pm Eastern The content to be output starts here and can go on for…
Ian
  • 11,920
  • 27
  • 61
  • 77
12
votes
5 answers

Set UILabel's number of lines depending by the text contained - Objective C and/or Swift

I'm trying to display some random text into a UILabel and of course I have nothing but its width. Is there a way to set my UILabel's height and/or number of lines depending by the text contained in it? Thanks ;)
Sara Canducci
  • 6,231
  • 5
  • 19
  • 24
12
votes
2 answers

A O(n*log(n)) algorithm to find the segment (among n*n segments) with the lowest slope

Given P={p1,...,pn} of different points which define n2 lines, write an algorithm that finds the line which has the lowest slope (smallest absolute value) with O(n*log(n)) time complexity in the worst case.
user1387682
  • 265
  • 2
  • 9
12
votes
5 answers

Batch file to delete first 3 lines of a text file

As the title states I need a batch file to delete the FIRST 3 lines of a text file. for example: A B C D E F G in this example I need A,B and C deleted along with the line
kriegy
  • 195
  • 1
  • 3
  • 14
11
votes
7 answers

How to calculate the nearest point of a line and curve? .. or curve and curve?

Given the points of a line and a quadratic bezier curve, how do you calculate their nearest point?
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
11
votes
2 answers

JFreeChart Scatter Plot Lines

I'm trying to create a graph with JFreeChart, however it doesn't get the lines right. Instead of connecting the points in the order I put them, it connects the points from in order of their x-values. I'm using ChartFactory.createScatterPlot to…
hvitedragonfire
  • 113
  • 1
  • 1
  • 5
11
votes
1 answer

Getting the total number of lines in a Tkinter Text widget?

I have a Tkinter Text widget, and I'd like to know how many lines it contains. I know of the text.cget("height") method, however that only tells me how many lines are displayed. I'd like to know how many lines there are total. I'm using this info…
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
1 2
3
81 82