FAQ Database Discussion Community


Maths Concept: Draw line to follow mouse, with a radius limit

math,line,limit,conceptual,radius
This is not a question specific to one programming language, more of a mathematically conceptual, though just in case, I'm using C++ on Visual Studio. Basically, my current code draws a line, that starts at the centre (of the window), and ends at my mouse position at any time, every...

Draw lines between divs using css border

jquery,css,border,line,connections
This below is a "jQuery plugin that adds stylable connecting lines using CSS border among block elements of your page, which is good for web based mind map or project flow." I was trying to use it but when I do, it connects every box to every box. Can't I...

Gnuplot no lines drawn

printing,line,gnuplot
My problem is that gnuplot does not draw any lines. That applies to linespoints and lines. Here is my script: set terminal postscript set output "bla.eps" set datafile separator "\t" set autoscale set grid set yrange [0:12] unset log unset label set xtic auto set xtics font "Times-Roman, 10" set...

Tcl How to write data to a specific line number in the middle of operating

numbers,tcl,output,line,puts
Is there any way or command in Tcl for writing in the middle of {data.txt} and also specific line number ... ? for example after writing data in text file, when I'm writing in line number 1000, is there any way for turning back to line number 20 and adding...

Drawing a Line - Maximum Point

java,2d,line,coordinates
I drew a line that is at an angle based on a slider. I am trying to make the line's end Y coordinate a certain number (let's say 300), even if it is at an angle. Any ideas on how to do this? Here is the work on my line...

Vertical line align property in css

css,line
I am going to draw a line which starts from left of the page: I used <hr> tag, here is its style: hr { background: #D8D8D8; width: 500px; height: 1px; } But the is no align property for <hr> as describes here! With this style, line draws in the middle...

Draw line with high StrokeThickness in silverlight

c#,xaml,silverlight,line,stroke
I have an application where you can draw on a Canvas (like Paint). The C# code looks basically like this: private void startDrawing(object sender, System.Windows.Input.MouseButtonEventArgs e) { _drawingStart = e.GetPosition((UIElement)sender); _isDrawing = true; } private void stopDrawing(object sender, System.Windows.Input.MouseButtonEventArgs e) { _isDrawing = false; } private void doDrawing(object sender, System.Windows.Input.MouseEventArgs...

C# Draw multiple Lines

c#,line,draw
Hi i'm drawing multiple lines with this code but i feel there is a better way doing this like a multidimensional array? or a list? private void drawLines() { int[] x1 = { 0, 0, 112, 222, 0, 333, 0, 1}; int[] x2 = { 334, 334, 112, 222, 334,...

Getting a line that has the coordinates defined by the mouse location

c#,graphics,drawing,line,mouse
I'm trying to make a little graphics program that has a circle of diameter 100 on the screen and from the center of it, a line is coming out of it that is always attached to the mouse pointer until such time that the user does a click, and then...

JavaFX Line segment width

java,javafx,2d,line
I have some code which responds to key presses, and draws points and line segments correspondingly. However, the width of the line segments seems to alternate, even though I don't touch the line stroke width in the code. I'm wondering why this is happening. Here is the code: import javafx.application.Application;...

JTable returning null for Graphics?

java,swing,table,line,paint
I'm trying to draw lines over my JTable using a Painter object that I've made, but for some reason table.getGraphics() returns null. Painter class: import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JTable; public class Painter extends JTable { public Painter(){ } public void paintSudokuLines(Graphics g){ paintComponent(g); } public void paintComponent(Graphics...

How to parse text in python with IPWhois

python,parsing,text,line
My code is: from ipwhois import IPWhois import pprint obj = IPWhois('74.125.227.206') results = obj.lookup_rws() pprint.pprint(results) It returns: {'asn': '15169', 'asn_cidr': '74.125.227.0/24', 'asn_country_code': 'US', 'asn_date': '2007-03-13', 'asn_registry': 'arin', 'nets': [{'abuse_emails': '[email protected]', 'address': '1600 Amphitheatre Parkway', 'cidr': '74.125.0.0/16', 'city': 'Mountain View', 'country': 'US', 'created': '2007-03-13T12:09:54-04:00', 'description': 'Google Inc.', 'handle': u'NET-74-125-0-0-1', 'misc_emails':...

c# escaping chars trying to run command

c#,command,escaping,character,line
I'm trying to run this command with several quotation marks: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --proxy-server="10.10.10.10:9999" -user-data-dir=C:\filterbypass www.example.com" I've tried adding backslashes to the before C and after com, no luck Tried assigning it to a string string \"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --proxy-server="10.10.10.10:9999" -user-data-dir=C:\filterbypass www.example.com\" with hopes to run the command like that,...

Java Graphics.drawLine() inexact: drawn lines are too long

java,graphics,line
I have a polygon with the vertices (0,0), (100,0), (100,100), and (0,100). I debugged the program and those are the exact lines that java is drawing. Instead of drawing an exact square, some of the lines are a pixel too long: http://gyazo.com/7418546c51c9a10fc690b18afcc96360.png (The green circle is just me testing the...

Using D3 to draw background gridline paths in a matrix for scatterplots?

javascript,d3.js,path,line,scatter-plot
I've been able to draw most of the visual components of a scatterplot. I now want to draw some background gridlines using a lighter color. In other words, every X coordinate will have a corresponding vertical background gridline that goes the full height of the Y axis and every Y...

Count number of different lines

awk,count,line
I have a file that has a lot of its lines repeated, it looks like this: a a . . . a b b c . . c d . . d e . . . e I need to count each line value only once so for example if...

Matlab - plot bar and line graph on the same y axis

matlab,plot,line
I'm trying to plot a line graph and a bar graph on the same y-axis: figure; plotyy(Pert, Rfootvel(:,i+1), Pert, 0,'bar','plot'); hold(ax(1), 'on'); legend('Pert 1-8', 'Base'); ylim(ax(2), [0 1]); title(['The avg pert velocity of the first step vs the avg base velocity, PP' num2str(j)]); Unfortunately, setting the second y-axis limit like...

PHPStorm Code view split

php,split,line
I am a new user of PHP Storm editor. I am not sure why there is a vertical line on my code view as seen on this image http://screenshots.x10.mx/aHOWxR.jpg I have reviewed their HELP section but can't find anything related to this vertical line. Anyone know how to remove it...

CSS address code doesnt appear

css,line
Hi whats wrong with adress code? Doesnt show dotted line. Everything was ok, but the address code is bad? Maybe something wrong, iam just a newbie so please understand me :) body { padding-left: 11em; font-family: Georgia, "Times New Roman", Times, serif; color: purple; background-color: #d8da3d } ul.navbar { list-style-type:...

Make patch of line different color in D3

d3.js,line,visualization,data-visualization,graph-visualization
My visualization uses lines between nodes to indicate their relationship. The wider the line, the more connected the two nodes are. In this context I would like to set a small section of the lines to a darker hue to attach more information to the visualization. Whichever node is closest...

token in line doesn't work fail c++

c++,loops,line,token
The following function works on text file called "_filePath" and tries to cut it to little tokens separate by ";" and "," like this: [Mickey M;12034;911416313;M;01a;9001;NULL;0;13;12;0;CPP,C;MSC,3D;FEND,BEND,SEC;] When trying to separate CPP,C into little token, it doesn't reach the next token which is MSC,3D and so on. I notice that the...

How do you create a d3 line function that will draw 2 lines for x, y1, y2 data?

javascript,d3.js,line,data-visualization
I have an array of data in this format: var data = [{x:0,y1:1, y2:2}, {x:1, y1:2, y2:2},...] I'd like to use d3 to plot this with the help of the line function. So, I created 2 paths on my svg container... var path1 = svg.append("path"); var path2 = svg.append("path"); Now,...

No line number shown for run-time error from Python module

python,numbers,runtime-error,line,traceback
Most Python errors produce traceback showing the line number of the offending statement. But for some reason some run-time errors do not. For instance, running "python -m mymodule.py" on a module containing just the two lines: args = {} if len(args > 2): print("this is a run-time error. Should be:...

Plotting lines with multiple variables in ggplot

r,ggplot2,line
I am trying to plot 2 lines based on 2 variables using ggplot2 in R. Here is a piece from the complete Framingham data set that I am using: df2 = read.table(text = " number smoker BMI sex 98 No 27.73 Men 99 No 24.35 Men 100 No 25.60 Men...

Is it possible to change ONE line in a txt file WITHOUT reading and writing the whole file (Java)?

java,file,text,replace,line
Say I have a text file: I love bananas. <age> 23 </age> years old. I like beaches. All I want to do is open said file and change the age to 24 or 25. Any way to do that in Java WITHOUT reading a writing the whole file? I know...

Searching for a line in a jpg file Python

python,image,line,ocr
I'm interested in using Python to detect a vertical line dividing a scanned page in two. I have a series of these scanned pages, and I need to split them in half along a black line. I know how to split them using ImageMagick, I just need to be able...

Draw a line every N words using iTextSharp

position,itextsharp,line,word,draw
Using iTextSharp, I create a pdf writing some text into it. What I need is to draw a line to delimiter the text every 25 words, like the following image: Basically, I need to do that: draw a line every 25 words, just like the image. I'm aware there's a...

Assembly Language New Line

assembly,line,masm
I'm brand new to assembly language programming, and I would like my output to have separate lines so that it is easier to read, however, I wrote my code and had it working, but was then informed that I could not in fact use the Irvine procedure to make a...

Python - I need a specific way of making multi-line input [duplicate]

python,text,input,line,break
This question already has an answer here: Multiline user input python 1 answer I need a to make multi-line input in Python. This is part of my program: input_ = input("Enter text:\n") #This can handle only single line of text Like this: Enter text: This is frst line, #Variable...

Shortest distance from CGPoint to segment

swift,line,cgpoint
I've been trying to implement Douglas-Peucker algorithm into my code and I'm able to translate pseudocode into Swift, except for the shortestDistanceToSegment function. Only Swift version I could find was answered here but I don't understand what that actually does. I need a function that gets three points as arguments...

Remove unwanted paragraphs from string using php

php,parameters,line,paragraphs
How to remove unwanted tags using pregmatch in below cases. i wrote pregmatch but its not working for some cases. here is my string <?php $str='<div class="borderdummydiv" style="padding: 10px;"> <div class="showcolsec" style="line-height: normal;"> <p style="font-size: 14px;" data-mce-style="font-size: 14px;"><strong>Email Template for Testing - 01:</strong></p><p style="font-size: 14px;" data-mce-style="font-size: 14px;"><br data-mce-bogus="1"></p><p style="font-size: 14px;"...

drawLine() method not drawing anything

java,swing,line
So I have this class inside a class which is an implementation of JPanel. private static class Line extends JComponent { private static final long serialVersionUID = 1L; @Override public void paintComponent(Graphics g) { System.out.println("Pozvan paintComponent()"); g.setColor(Color.YELLOW); g.drawLine(20, 20, 100, 20); super.paintComponent(g); } } This is a snippet of code...

How to rotate a line in a circle (radar like) in Processing while also plotting points?

rotation,line,processing
I am trying to rotate a line around in a circle that represents the direction a sensor is facing, while also plotting distance measurements. So I can't use background() in the draw function to clear the screen, because it erases the plotting of the distance readings. I've tried pggraphics and...

OpenCV: Lines passing through centroid of contour at given angles

python,opencv,image-processing,line,contour
I have a contour named cnt obtained from the image bellow: for which I am able to find the centroid like this: M = cv2.moments(cnt) centroid_x = int(M['m10']/M['m00']) centroid_y = int(M['m01']/M['m00']) I now want to draw N number of lines, each 360/N degrees apart, starting from the centroid and cutting...

Show Results' line numbers using grep

linux,bash,grep,formatting,line
how i can show the result of my grep command with incremental numbers before them , i'm not talking about using -n or -nr to show where is my string located in that files. i'm talking about something like this : grep foo *.* result should be like this :...

Java file line processing (basics)

java,file,io,line
I'm having a hard time learning file line processing. I understand how to read through lines of a file with a while loop and .hasNextLine, and I'm even able to print the entire line if it contains the value I'm searching for. I just don't understand how to get individual...

Drawing angled lines in CSS

css,css3,line,css-shapes
What I'm trying to do LOOKS simple, but I can't seem to figure out how to do it. As you can see in my image there are a couple of red lines that go across the bottom, then bend upwards close to the right side. Is there a way in...

html canvas linewidth not working properly

jquery,canvas,line
I was drawing a few lines in canvas using javascript and I was changing the value of linewidth for 3 different lines (the two axes, bottom 10 lines and top 10 lines). When I change the lineWidth property for the first 2 lines (lineWidth = 2.5 and lineWidth = 1.0),...

Is it possible to have multi line assignment in Python?

python,line,variable-assignment
Example of nasty assignment using __ setitem __: self.outer_scopes[self.children.item(i).getNodeName()][self.children.item(i).item(j).getNodeName()] = self.children.item(i).item(j).getTextContent() Is it possible to do something like this? self.outer_scopes[self.children.item(i).getNodeName()][self.children.item(i).item(j).getNodeName()] = self.children.item(i).item(j).getTextContent() I mean, to split the assignment, not the strings after it with \ or whatever....

Splitting lines by delimiter in large file

linux,file,split,line,delimiter
I have a file in this format: a(tab)b(tab)c some lines do not have a c column What I need to do is take the b column out of every line? What would be the best way to accomplish this?...

Vaadin layout break line without panel

layout,label,line,vaadin,break
I know it is possible for labels to automatically break lines when in a panel. Is there a way to have labels break lines when the text would be over a layouts width? UPDATE OK i tried it with "800px" width now instead of "100%" and now the labels are...

Draw line to connect centroids

matlab,image-processing,line,centroid
I have an image . After I process to find centroid, it has four centroids. My goal is I want to connect them using line and measure the angle between this area. To be clear about the centroid and my goal, you can open . Here it is my code...

Java: How to check for next ints without going to the next line (Scanner)

java,line,next
Quick Java question: So I have a set of integers on two different lines, however, I want to regard them in different scenarios. So I have a for loop that I want to continue through a list of integers and add them to, say an ArrayList, but I want it...

Run JavaScript in a Windows Command Line

javascript,command,line,cscript
This is something I only found out about today is that JavaScript can be run through a windows command line. So I found out that to run a javascript file in windows cmd.exe you use cscript. My hworld.js file only has one line print('hello world'); I try to run this...

How to retrieve the coordinates of a Line2D in Java

java,line,coordinates,shape,rectangles
So am trying to retrieve the coordinates of a line 2D that i will draw on my JPanel. The getBounds() method seemed to work for a rectangle2D but is not appripriate for a line2D.. How can i get the the coordinates of a line2D and put them in a variable...

Adding line breaks every x characters (using jquery / angular)

jquery,angularjs,line,break
I'd like to automatically add a new line break every 10 characters with this code : HTML : <div ng-app=""> <textarea id="chat" ng-model="msg"></textarea> <span class="msg" ng-bind="msg"></span> </div> Naturally when I type something in the textarea, it appears below in the span. But I want it to work like there is...

Add number / text inside d3 path [duplicate]

javascript,d3.js,path,label,line
This question already has an answer here: draw text in d3 arc javascript 1 answer How would I add a text or numeric label inside an arc, using d3? I have the paths drawn the way I want but am struggling to get the text inside it? I would...

Reading Text file in C, skip first line

c,file,line,fopen,skip
I have a big problem with my program. I would like to skip reading from 1st line and then start reading from others. I wasted so much time on searching it in the Internet. This is my txt file. LP bfdhfgd ffhf fhfhf hgf hgf hgf ffryt f uu 1...

Regex with max line length and maximum total characters

regex,line,maxlength
I'd love to have a regex with that will allow the following: A text for which every line has a maximal length, lets say 10, and the total text had a maximum number of total characters (lets say 30). For example this would be some valid inputs: 1) 1234567890 2)...

setLineWidth works differently on different test machines

opengl-es,width,line,andengine,bezier-curve
I make a game in which I draw bezier curve like this: final VertexBufferObjectManager vbom = engine.getVertexBufferObjectManager(); final HighPerformanceMeshVertexBufferObject pMeshVBOM = new HighPerformanceMeshVertexBufferObject(vbom, pBufferData, pBufferData.length, DrawType.DYNAMIC, true, Mesh.VERTEXBUFFEROBJECTATTRIBUTES_DEFAULT); final HighPerformanceLineChainVertexBufferObject pLeftCurbLineChainVBOM = new HighPerformanceLineChainVertexBufferObject(vbom, triangleCount * 3, DrawType.DYNAMIC, true,...

JTextArea show last X lines

java,line,limit,jtextarea
I want to use jTextArea as log of events for my application. I know I can redirect system.out and system.in but I want to use multiple jTextArea logs for different parts of my code. For example I want to do TCPServer log and display log for it in jTextArea. For...

max number of text lines + ellipsis

css3,text,overflow,line,whitespace
I have multiple titles with different lenghts and i would like them to always take 1 line and leave suspension points/ellipsis (...) if they can't fit. I can't just change the text inside the divs because the h2s inside them will automatically change everyday. Heres my code: http://jsfiddle.net/FranLegon/k9LsLuuk/ You can...

JTextPane last line with smaller font size

java,size,line,font-size,jtextpane
I have issue with JTextPane. If I write something to JTextPane on last line, the last line has another size than other previous lines. After pressing ENTER row moves a little up. I figured out, that this behavior is just in case when font size is smaller then 12. Last...

java text file new line

java,string,parsing,line
I am trying to capture information and then parse it to a txt file. I have tried using \n to create a new line, but the program seems to append the string on the same line. try { FileWriter mother = new FileWriter(file, true); mother.write(newsHeadline.attr("title") + '\n'); mother.close(); } catch(IOException...

Reading a .txt, Display it in Form, Edit in Form, and Save

c#,file,line,edit
I'm relatively new to programming and I've set up a "fairly" simple task for me to work on. What I am trying to accomplish is clicking on a "Settings" button on Form1 that will open and post the results of "config.txt" to labels on Form2. Config.txt looks like this: [VERSION]...

Swift - UIGraphics dash line close

swift,graphics,line,dash
This is my code: UIGraphicsBeginImageContextWithOptions(CGSizeMake(self.view.frame.width,graphSize), false, 0) let context = UIGraphicsGetCurrentContext() CGContextSetStrokeColorWithColor(context, UIColor.whiteColor().CGColor) CGContextSetLineWidth(context, 0.3) CGContextBeginPath(context) CGContextMoveToPoint(context, width1, height1) CGContextAddLineToPoint(context, width11, height11) CGContextMoveToPoint(context, width2, height2) CGContextAddLineToPoint(context, width22, height22) //dash line CGContextStrokePath(context)...

Inserting text to end of line python

python,line,editing
I want to append some text to the end of a specific line in a text file, inside a loop. So far, I have the following: batch = ['1', '2', '3', '4', '5'] list = ['A', 'B', 'C'] for i in list: for j in batch: os.chdir("/" + i +...

In SQL, how do you add a line break to text AND display text in the Results window?

sql-server,output,line,break
I am trying to display harcoded text on two different lines and then display three tables after them. The problem I am having is getting the text and the tables to show in the same window. (is this even possible?) I took the code from (How to insert a line...

Matplotlib: plotting curves with histogram data

matplotlib,line,histogram,curve
Currently have 3 sets of data in a single histogram, but I need to plot a single curve for each set of data. Currently plotting histograms through a function: def plot_histogram(xmin,xmax,title,xlabel,data,data1,data2): plt.xlim(xmin, xmax) plt.title(title) plt.xlabel(xlabel) plt.ylabel('Relative Frequency') bins=np.histogram(np.hstack((data,data1,data2)), bins=11)[1] plt.hist([data, data1, data2], bins, normed=1, alpha=0.5, color=['b', 'g', 'r'], label=['t', 'g-',...

How can I draw a line over all pages in fpdf

line,fpdf
Just as I ask in the title, how can I draw a line over all pages using fpdf? I tried giving the line a height of 9000, but this only gave a line to the full first page, but not on any other pages. Anyone knows how I can solve...

Skip the first line of the file which has words separated by commas in C

c,csv,line
I have a .txt file that contains words and numbers like this ID;Name;Surname;Phone;State; And what i am trying is to skip this line, located at the begining, i have looked for it but i have no seen any case in which the words are separated by commas. I am using...

Pygame draw anti-aliased thick line

python,pygame,line,antialiasing
I used to draw lines (given some start and end points) at pygame like this: pygame.draw.line(window, color_L1, X0, X1, 2), where 2 was defining the thickness of the line. As, anti-aliasing is not supported by .draw, so I moved to .gfxdraw and pygame.gfxdraw.line(window, X0[0], X0[1], X1[0], X1[1], color_L1). However, this...

Angle between two lines beginning at one side of the line

math,geometry,line,pseudocode,angle
I have two lines specified by two points with x and y coordinate each. The first point (where the lines begin) is equal meaning that I have 3 points A, B and C where one line is from A to B and the other one from A to C. I...

Add separation lines to fieldset

html,line,fieldset
Is there a way to add separation lines in a fieldset? Something like but I want the lines to go full across the fieldset and also be able to change the color. Here's an axample to help visualise what I want to do... the red line being the added line....

Python - Read specific lines in a text file based on a condition

python,file,line,readfile
Problem Statement: I have a file as below. name | date | count John | 201406 | 1 John | 201410 | 2 Mary | 201409 | 180 Mary | 201410 | 154 Mary | 201411 | 157 Mary | 201412 | 153 Mary | 201501 | 223 Mary |...

Python: “Print” and “Input” in one line

python,input,printing,line
If I'd like to put some input in between a text in python, how can I do it without, after the user has input something and pressed enter, switching to a new line? E.g.: print "I have" h = input() print "apples and" h1 = input() print "pears." Should be...

How to dynamically load multiple line segments using D3.js

javascript,animation,d3.js,line
I want to draw many line segments using D3.js. I would like to create animations like this: draw one line segment first, and then draw the second line after the fist line is done. But the codes I wrote just draw all the lines at the same time. The below...

How to change font size and color in second line of text on a Winforms button?

c#,winforms,button,colors,line
this.Controls.Add(button); button.Font = new Font("Arial", 8); button.Name = "btn" + idDanych; button.Width = 100; button.Height = 100; button.Location = new Point(0, 0); button.Text = "…" + Environment.NewLine + Environment.NewLine + "…"; button.ForeColor = Color.Black; How can I change the font size and color in the button's second line of...

Fastest way read single line in giant file

file,sed,line
So I have a website and I need to access a single line (line number is known) in a giant text file (~2GB). I came to the conclusion that system_exec("sed -n 3p << /file/whatever.txt"); in PHP is the most efficient way. But I don't feel very comfortable using it, it...

Dotted line xml in android

android,line,dotted-line
I am working on android application in which i want to use dotted line xml as a divider in my layout. For this i have used different drawables for this but instead to make a dashed dotted line, it is making a line. My drawable is given below, please help...

Visio 2013 - How to make custom line pattern with an existing stencil

line,visio
I'm making a custom line, but I want to use a stencil that I've already created. I have already read how to create a new line pattern with the Drawing Explorer and I understand that process just fine; however, I can't figure out how to make a new line pattern...

Hide part of line from an arc c#

c#,line,circle
I am trying to draw an arc over a line and have it hide part of a line to look like the line is continuous as follows: http://i188.photobucket.com/albums/z265/fac7orx/hide%20portion%20of%20line1_zpsegcc6vhy.png So far I am drawing a graph, then a line, then the arc. onPaintGraphics.DrawLine(greenPen, (float)point1.X, 320f, point2.X, 0f); //portion of code drawing...

Click on line in canvas

javascript,canvas,line
Is it possible get info, if is click on line in canvas? var canvas; var x = 200; var y = 200; var dx=4; var dy=4; var d = 5; var width, height; function init() { canvasE = document.getElementById('game'); canvas= canvasE.getContext('2d'); width = canvasE.width; height = canvasE.height; canvasE.addEventListener("click", onClick, false);...

How to draw a line on image in Matlab?

image,matlab,line
I want to draw a line on picture, but it only draws line at 45 angle. Line seems to be reacting only at x coordinate change. function demoOnImageClick clc;clear;close all; imObj = rand(500) figure; hAxes = axes(); imageHandle = imshow(imObj); set(imageHandle,'ButtonDownFcn',@ImageClickCallback); function ImageClickCallback ( objectHandle , eventData ) axesHandle =...

How to force `geom_line()` to NOT use the shortest distance to connect points?

r,graph,plot,ggplot2,line
ggplot(mtcars, aes(wt, mpg)) + geom_line() + geom_point() geom_line() connects the dot with a single straight line, that is the shortest path between the two dots. I would like the line to go straight on the horizontal (or vertical) direction first and then goes up or down (or right) to connect...

How do I create a line break before the image of a PayPal button?

button,paypal,line,break,paragraph
So, I've already tried p and br tags, but for some reason nothing changed. How do I create a paragraph after the options? So the image jumps to the next line... I'm very lay at coding, anyone could help me? Here's the code I'm using: <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input...

Python - Optional Command Line Argument

python,list,command,arguments,line
I would like to have an option -n, that will allow users to specify a size of a list. The default will be 30. So: ./findNumberOfPlayers.py -n10 I haven't done any command line arguments with python before but am confused with how to include -n10 within the program. I understand...

How to Draw on Zoomable Image in C# windows Forms

c#,winforms,graphics,zoom,line
so am implementing a project that can read image pan it, zoom it and do other stuff.. everything was going well until i tried implementing a draw with right mouse button. the problem is when i draw a line, the line that appears on the image does not correspond to...

Making for loop in xtend template, to print in same line

templates,for-loop,line,xtend
So if I have «FOR number: numbers» «number» «ENDFOR» It will print every number in new line, how do I make it print numbers in the same line?...

How to insert string before last line?

php,insert,line
I saw using fseek to insert string before last line this question, but this isn't solving my problem. I not use "?>" tag. Php version PHP 5.4 example line1 example line2 //i need insert here lastline $eg}; My code is working but this is adding empty lines after all lines...

Not recognized command everytime in the first line of a code

batch-file,command,line
I have a problem with my BATCH file... Whatever is written on the first line, it says: [command] is not a command. Like so: @ECHO OFF I get this output: [C:\folder (path)]>´╗┐@ECHO OFF ´╗┐@ECHO is not a command It does the same even in a clear batch file(nothing except @ECHO...

Line follower algorithm OpenCV

algorithm,opencv,line
I am trying to make a line follower using a cam stream using OpenCV. What can be the problems? there isn't a fixed line colour the line isn't straight (so I think I cannot use hough transform) and could look like a zig zag the path could have crosses My...

Need every name in the list to query active directory

string,powershell,foreach,split,line
Why does this only display the last object and not all of them for each loop? $str = @" First1 Last1 First2 Last2 First3 Last3 First4 Last4 "@ foreach ($line in $str.Split("`n")) { $userOBJ = Get-ADUser -Filter {Name -like $line} $userOBJ } Output Only has one record. DistinguishedName : CN=First...

Return index of selected series

excel,vba,indexing,charts,line
is there a simple way to get the index of a selected line in a Excel chart using VBA? I have a chart, where the user selects a series. Then a macro should do some thing. I'm looking for something like idx = Selection.getIndex. I need this idx to call...

How to print select lines of a text file in python?

python-3.x,printing,text-files,line
I have a text file with multiple lines of text. Each line of text is split into two columns, separated by a comma. How do I write a program to print only the lines of the text file that have a specific value for the first column? So for example...

Java BufferedReader - empty line issue

java,file,javafx,line,bufferedreader
Problem description: For example we have a text file file.txt with following content: Hello(LS) what(LS) are(LS) <empty_line>(LS) you(LS) doing(LS) <empty_line>(LS) <empty_line>(LS) now(LS) <empty_line>(LS) <empty_line>(LS) <empty_line>(EOF) (LS - line separator, EOF - end of file) If I understood the idea of text file, the file is looking something like that. Now,...

Draw line in ComboBox in Silverlight

c#,silverlight,graphics,line
How can I create line in comboBoxItem programmatically in Silverlight? I would like to get something like this: Thanks. I tried to do like: var lineTypeComboBox = new ComboBox { Width = 40, Background = Background, Margin = new Thickness(0), Padding = new Thickness(0) }; lineTypeComboBox.Items.Add(new Line {X1 = 1,...

Rotate line in Tkinter Canvas

python,canvas,tkinter,line
I have a line in a canvas that I would like to rotate en x number of degrees,while maintaining the start point at the middle of the canvs, I was wondering what the formula to figure out the end point coordinates is?, something like degrees=xnumberofdegrees lineEndPoint=degrees*someformulaforxandy canvas = Canvas(root, width=500,...

drawing line segments connecting sets of points

r,ggplot2,line,facet,segment
I am trying to connect sets of (two) points at each level of x, in each facet. Here is a reproducible example: datum <- structure(list(frequency = c(8L, 7L, 6L, 18L, 5L, 11L, 16L, 15L, 9L, 8L, 8L, 10L, 2L, 20L, 14L, 3L, 6L, 2L, 2L, 11L, 10L, 6L, 15L, 19L,...

awk to manipulate multiple files

awk,output,line,filenames
I have the following files file1 and file2 (as example) $cat file1.txt SERVICE: 1 TASK: 1 RESULT: 1 ADDITIONAL: 1 SERVICE: 2 TASK: 2 RESULT: 2 ADDITIONAL: 2 SERVICE: 3 TASK: 3 RESULT: 3 ADDITIONAL: 3 $cat file2.txt SERVICE: 1 TASK: 1 RESULT: 1 ADDITIONAL: 1 SERVICE: 2 TASK: 2...

How not to go to the next line of file in c

c,file,line
I am pretty new to C Programming and I'm having problems with my code. My program opens a .txt file and stores the data inside it in a string. After that, the data stored in a string is copied into another .txt file. FILE * fp = fopen("New.txt", "a"); FILE...

plot several lines with color based on a value in matlab

matlab,line,colormap,value
i have a matrix consist of 5 columns the first and second columns are for x_start & y_start of the line the third and fourth are for x_end & y_end the fifth is -concentration of contaminant in this line- for the value which i want to change color based on...

HTML POST insert line break in parameters

java,html,post,line,newline
currently I am trying to use hilite.me/api to format Java code. It all works ok but the only problem is that \n line breaks seem to be ignored and the output is just one long line. Anyone know how I can properly pass in linebreaks into the POST request. Thanks....

Deleting a line in file containing exact string (Python)

python,file,delete,line
import re print "List of names:" f=open('names.txt','r') #look below lines = f.readlines() for line in lines: info = line.split('|') names = info[0] print names name = raw_input("Enter the name of the person you want to delete: ") f.close() f = open('names.txt','w') for line in lines: if not re.match(name,line): f.write(line) break...

Python Reading Commands from File

python,file,input,line
I am new to python and am trying to open a file, look at its contents, and do something based on those contents. For example, if a file contains: Buy 100 20.00 Buy 400 10.00 Sell 200 28.00 How would i read the file one line at a time, assign...

Compare every line in file

file,loops,vbscript,line
I need to compare a "field" e.g. mid(stringX, 10, 20) of each line with every other line in a file. If a match is found, I want to sum some numbers, but that's not really part of the problem. My problem is, that I don't know, how to do a...