line

Drawing top border on a shape on Android

I'm creating a custom progress bar (positioned under a WebView) and what I would like to draw is a 1dp-wide line between the WebView and the ProgressBar. I'm modifying existing drawable, namely progress_horizontal.xml, and tried something like this: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android...

how can i draw a line between two points on a grid in WPF

I have a grid with 100 columns and 100 rows. I want to draw a line between the centre of one of those grid squares and another, say 45,25 to 75,38. I am happy with being able to draw a line, but how can i find the x and y pos of the centre of the two grid squares? Or is there a better approach i have missed ...

Very general question about the implementation of vectors, vertices, edges, rays, lines & line segments.

This is just a LARGE generalized question regarding rays (and/or line segments or edges etc) and their place in a software rendered 3d engine that is/not performing raytracing operations. I'm learning the basics and I'm the first to admit that I don't know much about this stuff so please be kind. :) OK, I wondered why a parametrized lin...

JavaFX: Appending line to path as animation

Hi, I am trying to create an animated chart which grows to the right as new data is added. I'm using a path for plotting the variables (JavaFX LineChart seems too slow), attempting to plot a new variable every 500ms by appending a new LineTo to the set of path elements. I have reduced the problem down to the following sample code. Could...

Is there a C++ iterator that can iterate over a file line by line?

I would like to get an istream_iterator-style iterator that returns each line of the file as a string rather than each word. Is this possible? ...

JEDI Code Library line number for exception

I have a codegear C++ builder project and added the JCL library to get a stackdump when an exception occurs. I get the stackdump, but the most important thing is missing, the line number where the exception actually happened. I get the function name, but if the function is 30 lines long it's not easy to guess where the problem is. Am I ...

php image arrow line need to be smooth

im making a line in php and so far its showing fine, but what problem im getting now is the line is not being smooth, it shows as breaking edges. following is the code for making radius line: function draw_radius($img, $x1, $y1, $radius, $angle, $arrow_color, $arrow_length = 10, $arrow_width = 3) { $x2 = $x1 + $radius * cos(deg2rad(...

using xslt stylesheet to convert xhtml blank lines to an XSL-FO blank line

Hello, I'm using an XSLT stylesheet (by Antennahouse) to convert XHTML to an XSL-FO file. I defined a blank line in my XHTML file as 2 consecutive HTML BR tags. Now there is no native support for a blank line in the XSL-FO format. I want to work around this limitation by adding a height to the fo:block that the stylesheet inserts for a ...

Jquery remove drawn line added via jquery svg library

Hi, In my application I have a line drawn from one table cell to another cell through jQuery SVG plugin. Following the steps of the blog post http://www.openstudio.fr/Library-for-simple-drawing-with.html I managed to add it. But at the same time I need to remove that line and draw it on another place when mouse hovers. Is there a metho...

WPF: How to put an object/shape at the end of a line path/stroke?

Hi, everyone! I just wanna ask if there's a way where I could put an object (circle) at the end of a particular line path. Similar to this: --------------------------------------------O Start End Right now, I have the following code for tracing the line: <Grid x:Name="LayoutRoot" > <Path Stro...

How to delete and replace last line in the terminal using bash ?

I want to implement a progress bar showing elapsed seconds in bash. For this, i need to erase the last line shown on the screen ( command "clear" erases all the screen, i need to erase only the line of the progress bar and replace it with the new informations ). Final result should look like : "Elapsed time 5 seconds" ...

php - efficent way to get and remove first line in file

Hello, I have a script that each time is called gets the 1st line of a file. Each line is known to be exactly of the same length (32 alphanumerci chars) and terminates with a "\r\n". After getting the 1st line, the script removes it. Now I do in this way: $contents = file_get_contents($file)); $first_line = substr($contents, 0, 32); f...

Line height for Fire fox

I have one problem I dont know either its my mistake or Firefox bug I have a text box in which the value is dynamically generated through python. The value in the text box should come in middle its work properly in IE and Chrome and but in Firefox its not working. Here is my code for CSS: #query { margin:0px; padding:0px; width:...

In pure XAML, is it possible to get a Line to align to part of a Grid?

Is it possible to create a Line in XAML (without any C# code behind) to align a line inside of a layout container such as a Grid? I'd like to effectively have: <Grid> <Line StrokeThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Stroke="Red"/> </Grid> I need to use StrokeDashA...

WPF, convert Path.DataProperty to Segment objects

I was wondering if there was a tool to convert a path data like "M 0 0 l 10 10" to it's equivalent line/curve segment code. Currently I'm using: string pathXaml = "<Path xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" Data=\"M 0 0 l 10 10\"/>"; Path path = (Pa...

matlab plot and line

What's the difference between function plot and line in matlab? Are they doing the same thing? Thanks! ...

3D line plane intersection, with simple plane

hello, i have two points in 3D space which have X-coordinates with different signum. so one of them lies definitely on one side of the X-plane and one on the other. now i want to find the intersection of this plane and the line made up by the two points in the most simple and optimized way. i know how to do general line plane intersect...

How can I highlight the line of text that is closest to the mouse?

I have a long text and I'd like to offer the user a reading help: The current line should be highlighted. To make it easier, I'll just use the Y coordinate of the mouse (this way, the mouse pointer isn't going to get in the way). I have a big DIV with the id content which fills the whole width and a small DIV with the class content for t...

MATLAB: Drawing a line over a black and white image

What is the best way to draw a line over a black and white (binary) image in MATLAB, provided the start and end coordinates are known? Please note, I am not trying to add an annotation line, I would like the line to become part of the image. ...

Crontab: cut line to many lines?

Hard-to-read-line @daily export sunshine="~/logs/Sunshine-`date '+\%F'`" && export sunshineUrl="http://www.sunshine.net/main/search_results.asp?currency_id=1&amp;min_price=&amp;max_price=50000&amp;country_id=241&amp;region_id=&amp;Submit=Search" && mkdir -p $sunshine && cd $sunshine && wget --mirror -l 1 $sunshineUrl Which mark do I n...