line

OpenGL ES iPhone - drawing anti aliased lines

Normally, you'd use something like: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); glLineWidth(2.0f); glVertexPointer(2, GL_FLOAT, 0, points); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(GL_LINE_STRIP, 0, num_points); glDisableClientState(GL_VERTEX_ARRAY); It looks good in t...

Get the slope from one point and an angle in degrees.

In javascript, I am trying to draw a line that is at an angle that is user defined. Basically, I have a point (x,y) and an angle to create the next point at. The length of the line need to be 10px. Let's say that the point to start with is (180, 200)... if I give it angle "A" and the (I guess)hypotenuse is 10, what would my equation(s...

Exception line-number in Jscript-ASP

Hello all, I'm developing a website with server-side JScript engine over ASP server. I have several try-catch clauses in my code looking roughly like this: try { // do something } catch (err) { // pass it to the frontend code die("Exception caught: " + err.description); } I would very much like to display the line number in ...

Regex: finding several linebreaks

hi i'm having this html markup <body> <table border="0" width="50%" align="center"> <tr> <td> <center> and i'm trying to find a "wildcard" for the linebreaks to reach the <center> tag - how would this work? thx ...

VBScript: Function parameter list too long?

in VBScript, I've got a function like: Function InsertPerson(FirstName, LastName, Street1, Street2, City, State, Zip, x, y, z, a, b, c, d, e) When I try to compile this function, I get an "Identifier Expected" error. However, if I shorten the list of parameters, it works fine. Is there such a thing as TOO long a list of parameters? ...

Line-Spacing in JTextArea

Hi Geeks, It seems my current JTextArea instance is having line-spcing about 1 or 1.5. Can anybody tell me how to change the line-spacing in JTextArea instance? ...

Collision Handling Between Circle and Line Segments

Hello, I'm implementing a small game and am having trouble getting the physics working properly. In this game, there is one ball (a circle which moves from frame to frame, and may change radius) and several walls (line segments which also change and move from frame to frame). I can detect collisions properly, and making the ball bounce ...

Reading a file line by line in C

Hello, I am trying to write some code that will open a file, read its content line by line and store each of these lines into an array. First I open the file and count the number of lines, each of the lines is of a fixed length so I simply do this : char buf2[LINE_LENGTH]; int in2 = open("toSend2", O_RDONLY); int number_o...

How to paint a gridline as a background on JPanel

Hi everyone, I have a problem. I used Gridbaglayout in my JFrame. One of the component is JPanel. I wanted to draw a gridline as a background for my JPanel. e.g in the program below, it supposed to produce 3 vertical and 3 horizontal lines, however it only shows 2 vertical and 2 horizontal line. the last line was not shown. Another pro...

Delete final line in file via python

How can one delete the very last line of a file via python? Example File: hello world foo bar Resulatant File: hello world foo I've created the following code to find the number of lines in the file - but I do not know how to delete the specific line number. I'm new to python - so if there is an easier way - please tell me. try:...

How can I make the 'return character' for a text with several lines in an xml tag, which I parse then put in a UItableView?

I want to display in a UItableViewCell, text like line1 line2 I get it from an xml tag like line1 line2 I've tried a lot of things, like: <br/> (also &lt;br&gt;), \n which only displays "line1 \n line2", <![CDATA[<br >]]> which only displays "line1 <br> line2". Thanks for the help ...

Source code for Xiaolin Wu's line algorithm in C?

Hi, I'm looking for a nice and efficient implementation of Xiaolin Wu's anti-aliased line drawing algorithm in C, does anyone have this code they could share with me? Thanks ...

Python: list problems

I've read in a text file and converted each line into a list. using this script: l = [s.strip().split() for s in open("cluster2.wcnf").readlines()] How would i go about : the file it opens is dynamic rather than static? i.e. the user chooses the file to open. Select specific lines to read after it has been converted to a list. assi...

Highlight line in Zend Studio 7

Hi, In ZS 5 you can highlight a line by clicking on the line number in red. This persists when you move the cursor to another line. I use this as a bookmark. Is it possible to highlight a line in this manner in ZS 7? Thanks. ...

How do I create an image matrix with a line drawn in it in MATLAB?

I want to plot a line from one well-defined point to another and then turn it into an image matrix to use a Gaussian filter on it for smoothing. For this I use the functions line and getframe to plot a line and capture the figure window in an image, but getframe is very slow and not very reliable. I noticed that it does not capture anyth...

Is there any way to "undo" the effect of #line in C?

I am generating C code based on information provided by another file (an XML file). Certain chunks of C are included in this XML file and should be included verbatim in my generated C file. I wish to use the #line directive, so that if these chunks contain an error, the user will see the line number in the XML file that the chunk came fr...

Fast way to convert array of points into triangle strip?

I have an array of CGPoints (basic struct with two floats: x and y). I want to use OpenGL ES to draw a textured curve using these points. I can do this fine with just two points, but it gets harder when I need to make a line from several points. Currently I draw a line horizontally, calculate its angle from the points given, and then ro...

HTML CSS How to stop a table to put the content after it on a new line?

I have a table followed by an anchor tag. I want the anchor tag not to move to next line after the table. What are the options? ...

Javascript Error Line Numbers

I have a jsp with lots of javascript code. Whenever there is a javascript error on the page, shown in the status bar of the IE browser, the line number reported to contain the error, does not match with the line number that actually contains the error. I am doing a right click>view source to find the line number reported. But that line d...

Perfect line rendering in as3

I'm making an arcade game in as3 and I want to draw pixely(unsmoothed by flash) lines. I'm drawing the pixels 'by hand'(not with flash's lineTo or anything) onto a bitmapdata object. The lines don't appear quite right though, when zoomed out the line is rendered 2 pixels thick at some parts. However by zooming it its apparent that t...