point

AS3 - bug in Rectangle.inflatePoint() - doesn't deal with negative coordinates well

this seems a bit nutty: var r:Rectangle = new Rectangle(); trace("initial rect: " + r); // (x=0, y=0, w=0, h=0) var p:Point = new Point(-5, -3); // (x=-5, y=-3) trace("point: " + p); r.inflatePoint(p); trace("inflated rect: " + r); // (x=5, y=3, w=-10, h=-6) i would expect the result to be (x=-5, y=-3, width=5, heigh...

Java: getting a value from an array from a defined location

I have an array of numbers and would like to retrieve one of the values from location "index". I've looked at the Java documentation http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Array.html but my code still isn't compiling. here is my method: public class ConvexPolygon implements Shape { java.awt.Point[] vertices; ...

ELF binary entry point

why is the entry point in each ELF binary something starting with 0x80xxxxx? Why doesn't the program start at (virtual) address 0x0? When executed, program will start running from virtual address 0x80482c0 (see entry point address). The "0x" prefix here means it is a hexadecimal number. This address doesn't point to our main() procedure...

Create grid out of number of elements

Ok here's what I'm trying to accomplish. Say I have 100 items. I want to create a "grid"(each Item consisting of an x, y point). I want the grid to be as close to a square as possible. Is there any kind of math to determine the grid width, and grid height i'd need by just a single number?(By grid width and height I mean the number of x i...

C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL

For the life of me I can't make sense why this code produces the following output... I think there is a bug or something when using List and lambda if the type exposes a Rectangle property and you use the Contains method of the rectangle object...and explicit iteration proves true while the List Find method fails.... Oneway Code publ...

Recursion paths from coordinate to coordinate

I'm working on a java assignment for a class and I'm unsure how to solve this problem. I don't want it completed for me, but get me started in the right direction. I'm mostly unsure of the recursive part of the program. I'm not very good at programming. problem: NorthEast paths are obtained from a two-dimensional grid ...

Find the distance between two points in MYSQL. (using the Point Datatype)

Suppose I have a 2 column table like this: | user_id | int(11) | NO | UNI | NULL | | | utm | point | NO | MUL | NULL | | As you can see, it's very simple. utm is a Point data-type. I insert it like this: INSERT INTO mytable(user_id, utm) VALUES(1, PointFromWKB(point(50, 50))); ...

Point on Polygon (Longitude/Latitude) in .NET

Hi I need some help for my problem ;): I've got a polygon definied with 3 or more longitude/latitude points. Now I've got another longitude/latitude point and I need to check if this point is in the polygon area or not. I need this function in .NET. Can anyone help me? Thank you very much for your help. ...

Delphi array initialization

I currently have this, and it sucks: type TpointArray = array [0..3] of Tpoint; class function rotationTable.offsets(pType, rotState, dir: integer): TpointArray; begin Result[0] := point(1, 1); Result[1] := point(1, 2); Result[2] := point(1, 1); Result[3] := point(1, 1); end; but instead, i want to do something like this: c...

How to get mouse position in float or double with exact resolution?

I need to take the mouse click position in float or double, how can I do that?In mouse listener, I take the point like this, e.getPoint(); but Point object's x and y values are integer, I need position in float or double. Any help will be appreciated. Edit *I need exact resolution.* ...

Removing extra pixels after shrinking to a point and selecting the correct pixel as the cross point with Matlab

link text Based on the link above, I managed to get the cross point but sometimes I get 2 or more results. I have 10 similar images with the cross slightly moved in every frame. Is there a way that I can remove the extra pixels remaining that are very off from the other 9 images by comparing it to the cross point of the 1st image? As th...

How to prevent external translation of a movieclip object on stage in AS3?

I have a MovieClip object, which is exported for actionscript (AS3) in an .swc file. When I place an instance of the clip on the stage without any modifications, it appears in the upper left corner, about half off stage (i.e. only the lower right quadrant of the object is visible). I understand that this is because the clip has a regist...

Matlab - Propagate points orthogonally on to the edge of shape boundaries

Hi I have a set of points which I want to propagate on to the edge of shape boundary defined by a binary image. The shape boundary is defined by a 1px wide white edge. I have the coordinates of these points stored in a 2 row by n column matrix. The shape forms a concave boundary with no holes within itself made of around 2500 points. ...

Convert pre-IEEE-754 C++ floating-point numbers to/from C#

Before .Net, before math coprocessors, before IEEE-574, Microsoft defined a bit pattern for floating-point numbers. Old versions of the C++ compiler happily used that definition. I am writing a C# app that needs to read/write such floating-point numbers in a file. How can I do the conversions between the 2 bit formats? I need conversion...

how to write floating value accurately to a bin file.

Hi I am trying to dump the floating point values from my program to a bin file. Since I can't use any stdlib function, I am thinking of writting it char by char to a big char array which I am dumping in my test application to a file. It's like float a=3132.000001; I will be dumping this to a char array in 4 bytes. Code example woul...

Dropping the '.00' when printing floats that hold whole numbers

I'm currently displaying a quantity in Javascript. I want it to display (for example) the whole number as 89 instead of 89.00; however, if the number is fractional like 89.50 then it should display 89.50 ...

Problem with share point login!

Hi all. I'm new bie in share point. To day, I used Share Point Designer to create new master page for my project, after that, I add my own user control. The problem is that whenever the page is postback, share point asks me to log in so many time?? I do not know what is reaseon? Does anyone have solution for this problem? Thanks PS: My E...

IronPython: Creating & Adding An Array Of Points To A GraphicsPath

Greetings; I'm having a bit of trouble correctly instantiating an Array of System.Drawing.Point instances, and then adding the Array of Points to a GDI+ GraphicsPath instance using IronPython in a WinForms application. The following code compiles or builds correctly under SharpDevelop 3.2 with IronPython 2.6: import System.Drawing imp...

Flex chart display with no datapoint

I need to display price of item for every date in the month. The chart can be Bar chart or plot chart. Question: Suppose there is no data available for 01/15/2010 then, Is there a way to display (01/15/2010) on x axis but no (bar or plot point) corresponding y axis point ? i.e. there will be a empty space between 2 bars or plot points...

What's the Unicode code point for [ \u8D27 ] ?

I want to find out if a Chinese character can be displayed, the unidode for it is "\u8D27", how to use the Java Font method canDisplay ? It takes an int, but "8D27" is not an integer, how does it work, do I need another method to translate "8D27" to an int then use canDisplay ? If so how to translate it ? Edit : To be more precise, how ...