point

Deserialization not working in WCF

I have a simple class, let's say "Team" and I expose a WCF service (basicHttpBinding, hosted in IIS) with a GetTeams operation which returns an array of Team. The Team class looks like [DataContract] public class Team { [DataMember] public int Id { get; set; } [DataMember] public Point Position { get; set; } [DataMe...

Algorithm for spread-out 2D point distribution

In a 2D pixel array, I need an efficient algorithm that will select p% of pixels that are the most spread out. This can be done adaptively by selecting points, then repeatedly adjusting the positions of points that are too close together. But this isn't efficient since it would require many iterations and distance calculations. It doe...

Compare the value of a variable at intervals

Hey I have a problem comparing the value of a CGPoint (struct with two ints: x and y) with another at certain time intervals. One is called location and has the value of where the cursor is. Every half a second or so, I want to see if it changed. How do I do this? The language is Objective-C (so C++/C stuff should work) ...

How do I import a java Point class in android?

Hi, I am writing an android game. I need a Point class that stores x and y coordinates. I have found a class called java.awt.Point. Which looks like what I need. I have created an interface for java.awt.Point and put import java.awt.Point in my code. But when I do Point pos = new Point. I get an error: cannot instantiate Point. A...

Find Coordinates for point on screen?

The thing is I have some graphics shown in a form, rectangle for example, and I want to capture when the point gets over thees fields. So I Thoght I try to find the corrrdinates for thees rectangles, but as thay are the coords in the form it dose not match the ones with the mouse location. So I wonder is there a way to find what coord o...

Snap point to a line - Java

Hi, I have two gps coordinates which link together to make a line. I also have a gps point which is near to, but never exactly on, the line. My question is how do I find the nearest point along the line to the given point? Many thanks ...

Finding Remote Points in 2D

I have a set of points on the infinite (well, double precision) 2D plane. Given the convex hull for this set, how can find some points on the inside of the convex hull that are relatively far away from all the points in the input set? In the image below, the black points are part of the original set and the hatched area represents the ...

double type digits in C++

The IEE754 (64 bits) floating point is supposed to correctly represent 15 significant digit although the internal representation has 17 ditigs. Is there a way to force the 16th and 17th digits to zero ?? Ref: http://msdn.microsoft.com/en-us/library/system.double%28VS.80%29.aspx : . . Remember that a floating-point number can only appr...

Reading floating numbers from sqlite database in iphone

I need to read floating point decimals from sqlite db I have created Variable type in database as INTEGER i am reading with sqlite3_column_int to NSInteger variables which parts should changed so i can read floating point integers from database thanks for answers sorry im a newbie in this topics ...

Add a decimal point 2 chars from the right under PHP

I have a big array containing lots of elements containing numerical data. Example: 3200 34300 1499 12899 I want to convert these into: 32.00 343.00 14.99 128.99 How can I achieve this elegantly under PHP using no regex? Thanks in advance. ...

Insert a point into a finite 2D region with maximum distance to existing points.

I have a set of 2D points inside a finite 2D region of space (let's say a world-aligned rectangle to keep things simple for now). What would be an exceedingly efficient way to insert a new point into the set that has a relatively large distance to its new closest neighbour? I could slowly build a Delaunay triangulation and limit my sear...

Creating an entry point in a C# DLL to call from WIX

Good Afternoon, I am trying to find a way to create an entry point for my C# dll. I am aware of how to call other dlls in c# but cannot find create one. I need this in order to call it in my WiX installer as a customer action. Any help that can be provided will be appreciated. ...

Some questions about Function point

Hi, I try to learn how to use Function Point analysis, however, there are questions that i can't answer. Hopefully, stackoverflow and you guys out there can help me answer those questions. According to the IFPUG manual, the menu is not counted. However, if we can perform some functions, which do not invoke a dialog, via the menu, then...

Display 3 lists in one data view (sharepoint)

Hi all, I would like to display tree different lists in one view in sharepoint. 1) Project_list: here I have all projects 2) Project_list_Costs: here I have all costs for each project (project name is the reference) 3) Project_list_Revenues: here I have all revenues for each project (project name is the reference) One project eleme...

7 Point computational stencil cache access problem in C (or..map a 3D array into a 1D array)

Hi all, I have a problem I am trying to tackle that involves a 7 point computational stencil. For those who may not know, this would be a 3D grid, and the 7 points are the n'th point, and the neighbors one point away in the x, y and z directions, both positive and negative (or neighbors to the east/west/north/south and up/down). So thes...

Getting mount point when a USB device is inserted Mac OS X and linux

Hi All, I am trying to develop a program in Mac OS and Linux which lists the files and folders in USB drive. I need to get the some events when USB device is connected and removed. I know that in Mac OS X I can use IOKit. But I do n't know how to get the mount point where the device is mounted. Can I get it using IOkit? Is there any cro...

Bézier curve compute point from one axis

I have a Cubic Bézier curve. But I have a problem when I need only one point. I have only value from the X-axis and want to find a value that coresponds to Y-axis to that point. Or find the t step, from it I can easely calculate the Y-axis. Any clue how to do it? Or is there any formula to do this? ...

Test if point is in some rectangle

I have a large collection of rectangles, all of the same size. I am generating random points that should not fall in these rectangles, so what I wish to do is test if the generated point lies in one of the rectangles, and if it does, generate a new point. Using R-trees seem to work, but they are really meant for rectangles and not point...

Get polygons close to a lat,long in MySQL

Hi, does anyone know of a way to fetch all polgons in a MySQL db within a given distance from a point. The actual distance is not that important since it's calculated for each found polygon later, but it would be a hube optimization to just do that calculation for the polygons that are "close". I've looked at the MBR and contains func...

Floating point exception on a int Array - C

int check_row; for (n=0; n<9; n++) { used_numbers[n] = n+1; } for (row=0; row<3; row++) { for (check_row=0; check_row<3; check_row++) { used_numbers[(sudoku[row][check_row]-1)] = 0; } ... int sudoku[9][9] declared as global variable and used_numbers[9] as int. In sudoku matrix for row from 0 to 2 and col from 0 to ...