Search Results

Search found 441 results on 18 pages for 'nearest neighbor'.

Page 8/18 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • MapKit Annotations and User location

    - by teddafan
    Hi all, I followed this tutorial to make my first app: http://icodeblog.com/2009/12/21/introduction-to-mapkit-in-iphone-os-3-0/ I would really like to know how to sort the annotations in the Table in order of distance to the user (the nearest annotation is the first one on the table) How is it possible to do that? I understand that I must use the CLLocation to find the user's location but then I have no idea. Could any one help me? Cheers, Thank you in advance for your much appreciated help, teddafan

    Read the article

  • How could I make geometry advanced operations on bezier paths?

    - by yizzreel
    I have a library that draws regular bezier path figures (complex paths formed of a lot of bezier points), using midpoint approximation. I can draw them without problem, but I need to add support for advanced geometry operations: Nearest point of a curve, intersection, figure contains point, and more importantly, path combinations: difference, intersection, exclusive-or, union, ... Is there any good source to get all this? Thanks

    Read the article

  • Search and annotate in MKMapView?

    - by chaitanya
    Hi, In my application I have to search five nearest locations of "medical services" using the user current location and annotate those locations on my MKMapView. Can any one tell me how to search with a particular keyword (eg. medical services, garages) by using user current locations and annotate onto the map and when the user taps on the annotations it should show the complete address of the locations which is annotated. Can anyone help me in this?

    Read the article

  • Is there a simple way to make lists behave as files (with ftplib)

    - by Brent.Longborough
    I'd like to use ftplib to upload program-generated data as lists. The nearest method I can see for doing this is ftp.storlines, but this requires a file object with a readlines() method. Obviously I could create a file, but this seems like overkill as the data isn't persistent. Is there anything that could do this?: session = ftp.new(...) upload = convertListToFileObject(mylist) session.storlines("STOR SOMETHING",upload) session.quit

    Read the article

  • Rounding of calculated measure in MDX

    - by Espo
    How can i round a calculated mdx measure up to the nearest integer without having Excel on the server? The Excel-function is CEILING(number, significance), but it is not possible to install Excel on the production ssas-server.

    Read the article

  • Get CALayers view

    - by eaigner
    Hi, is it somehow possible to get the nearest "container" NSView of a CALayer? My problem is I'm managing tracking areas in my "container" NSView, and those need to be updated if a layer is moved/added etc. and i would like to automate that somehow instead of calling my -updateTrackingAreas function manually. Regards, Erik

    Read the article

  • NOAA web service for current weather

    - by Brian
    I want to get the current weather conditions from the NOAA. I know they have a SOAP web service that can be used to get weather forecasts and XML files for current weather conditions for each of their weather stations. I could just use the XML file for the weather station nearest to where I want, but there doesn't seem to be an easy way to search for the proper xml file by zipcode. Is there a simple way to get current weather conditions by zipcode from the NOAA?

    Read the article

  • Google Maps show location based on user inputs

    - by Kiran Badi
    Hi I have an web application where in I have 4 fields in the form, like streetname,nearest street,zip,state and country.Based on this I need to show the location of this address in the google maps.I have to implement this functionality for GoogleMaps/Bing/ and Yahoo maps. Can someone point to correct api's for these.This is my first implementation of maps,so need some inputs.Appreciate if someone can point me to right direction.

    Read the article

  • Changing text depending on rounded total from database

    - by NeonBlue Bliss
    On a website I have a number of small PHP scripts to automate changes to the text of the site, depending on a figure that's calculated from a MySQL database. The site is for a fundraising group, and the text in question on the home page gives the total amount raised. The amount raised is pulled from the database and rounded to the nearest thousand. This is the PHP I use to round the figure and find the last three digits of the total: $query4 = mysql_query("SELECT SUM(amountraised) AS full_total FROM fundraisingtotal;"); $result4 = mysql_fetch_array($query4); $fulltotal = $result4["full_total"]; $num = $fulltotal + 30000; $ftotalr = round($num,-3); $roundnum = round($num); $string = $roundnum; $length = strlen($string); $characters = 3; $start = $length - $characters; $string = substr($string , $start ,$characters); $figure = $string; (£30,000 is the amount that had been raised by the previous fundraising team from when the project first started, which is why I've added 30000 to $fulltotal for the $num variable) Currently the text reads: the bookstall and other fundraising events have raised more than &pound;<? echo number_format($ftotalr); ?> I've just realised though that because the PHP is rounding to the nearest thousand, if the total's for example £39,200 and it's rounded to £40,000, to say it's more than £40,000 is incorrect, and in that case I'd need it to say 'almost £40,000' or something similar. I obviously need to replace the 'more than' with a variable. Obviously I need to test whether the last three digits of the total are nearer to 0 or 1000, so that if the total was for example £39,2000, the text would read 'just over', if it was between £39,250 and £39,400 something like 'over', between £39,400 and £39,700 something like 'well over', and between £39,700 and £39,999, 'almost.' I've managed to get the last three digits of the total as a variable, and I think I need some sort of an if/else/elseif code block (not sure if that would be the right approach, or whether to use case/break), and obviously I'm going to have to check whether the figure meets each of the criteria, but I can't figure out how to do that. Could anyone suggest what would be the best way to do this please?

    Read the article

  • Mathematical problem

    - by coolboycsaba
    I have the following function: function getLevel(points) { var level = -1 + Math.sqrt(4 + points/20); // Round down to nearest level return Math.floor(level); } The above function calculates the level of a player based on their points, my problem is that I need a function like this to calculate the points needed for a given level.

    Read the article

  • How to find the ocean using Google Maps API

    - by geejay
    I am trying to figure out where the ocean is in an arbitrary Google Maps view. I actually have the lat lon (a range of points, when joined together form the coastline) of the coastline. But how do I tell which side of this line is the coastline? One possible solution would be to find the latlon of the nearest service or town or business or something, and then the ocean is obviously on the other side (given a small enough enclosing polygon). Is there a better way?

    Read the article

  • Why is FLD1 loading NaN instead?

    - by Bernd Jendrissek
    I have a one-liner C function that is just return value * pow(1.+rate, -delay); - it discounts a future value to a present value. The interesting part of the disassembly is 0x080555b9 : neg %eax 0x080555bb : push %eax 0x080555bc : fildl (%esp) 0x080555bf : lea 0x4(%esp),%esp 0x080555c3 : fldl 0xfffffff0(%ebp) 0x080555c6 : fld1 0x080555c8 : faddp %st,%st(1) 0x080555ca : fxch %st(1) 0x080555cc : fstpl 0x8(%esp) 0x080555d0 : fstpl (%esp) 0x080555d3 : call 0x8051ce0 0x080555d8 : fmull 0xfffffff8(%ebp) While single-stepping through this function, gdb says (rate is 0.02, delay is 2; you can see them on the stack): (gdb) si 0x080555c6 30 return value * pow(1.+rate, -delay); (gdb) info float R7: Valid 0x4004a6c28f5c28f5c000 +41.68999999999999773 R6: Valid 0x4004e15c28f5c28f6000 +56.34000000000000341 R5: Valid 0x4004dceb851eb851e800 +55.22999999999999687 R4: Valid 0xc0008000000000000000 -2 =R3: Valid 0x3ff9a3d70a3d70a3d800 +0.02000000000000000042 R2: Valid 0x4004ff147ae147ae1800 +63.77000000000000313 R1: Valid 0x4004e17ae147ae147800 +56.36999999999999744 R0: Valid 0x4004efb851eb851eb800 +59.92999999999999972 Status Word: 0x1861 IE PE SF TOP: 3 Control Word: 0x037f IM DM ZM OM UM PM PC: Extended Precision (64-bits) RC: Round to nearest Tag Word: 0x0000 Instruction Pointer: 0x73:0x080555c3 Operand Pointer: 0x7b:0xbff41d78 Opcode: 0xdd45 And after the fld1: (gdb) si 0x080555c8 30 return value * pow(1.+rate, -delay); (gdb) info float R7: Valid 0x4004a6c28f5c28f5c000 +41.68999999999999773 R6: Valid 0x4004e15c28f5c28f6000 +56.34000000000000341 R5: Valid 0x4004dceb851eb851e800 +55.22999999999999687 R4: Valid 0xc0008000000000000000 -2 R3: Valid 0x3ff9a3d70a3d70a3d800 +0.02000000000000000042 =R2: Special 0xffffc000000000000000 Real Indefinite (QNaN) R1: Valid 0x4004e17ae147ae147800 +56.36999999999999744 R0: Valid 0x4004efb851eb851eb800 +59.92999999999999972 Status Word: 0x1261 IE PE SF C1 TOP: 2 Control Word: 0x037f IM DM ZM OM UM PM PC: Extended Precision (64-bits) RC: Round to nearest Tag Word: 0x0020 Instruction Pointer: 0x73:0x080555c6 Operand Pointer: 0x7b:0xbff41d78 Opcode: 0xd9e8 After this, everything goes to hell. Things get grossly over or undervalued, so even if there were no other bugs in my freeciv AI attempt, it would choose all the wrong strategies. Like sending the whole army to the arctic. (Sigh, if only I were getting that far.) I must be missing something obvious, or getting blinded by something, because I can't believe that fld1 should ever possibly fail. Even less that it should fail only after a handful of passes through this function. On earlier passes the FPU correctly loads 1 into ST(0). The bytes at 0x080555c6 definitely encode fld1 - checked with x/... on the running process. What gives?

    Read the article

  • Mustache vs other engines. Maybe I should use another template engine?

    - by marcioAlmada
    I'm passing an object to mustache and this object has a method with one parameter. Is something like this possible with Mustache and PHP? {{object.method(parameter)}} If it gets too laborious to achieve this with Mustache, what template engine would you recommend? Remember I need to pass parameters to object methods while in the view context (like we do with helpers). The nearest as possible to mustache syntax is welcome.

    Read the article

  • How to specify the image scaling algorithm used by a WPF Image?

    - by mackenir
    Is there a way to specify how an image is scaled up in an Image element with LayoutTransform set to a ScaleTransform with integer values for ScaleX and ScaleY? I want to display the scaled image crisply (ie using 'nearest neighbour' scaling), with no blurring. (Imagine how you would want a bitmap editing program to behave when zooming in). I noticed the protected property VisualBitmapScalingMode on Image, so created a subclass of Image that sets this property to BitmapScalingMode.NearestNeighbor. However, this had no effect.

    Read the article

  • C - Rounding number up

    - by Dave
    Hi all, I was curious to know how I can round a number to the nearest tenth. For instance If I had int a = 59 / 4 /* which would be 14.75 and how can i Store the number as 15 in "a"*/ Thanks, Dave

    Read the article

  • getting html tags from xml and echoing in php?

    - by Whitney Sarah Rogers
    I am trying to echo a result from xml into my html code form expedia. But I ran into a problem. There text is a little messed up: <areaInformation> Distances are calculated in a straight line from the property&apos;s location to the point of interest or attraction, and may not reflect actual travel distance. &lt;br /&gt;&lt;br /&gt; Distances are displayed to the nearest 0.1 mile and kilometre. &lt;p&gt;La Isla Shopping Mall - 0.5 km / 0.3 mi &lt;br /&gt;Yamil Lu&apos;um - 0.5 km / 0.3 mi &lt;br /&gt;Acuario Interactivo - 0.6 km / 0.3 mi &lt;br /&gt;Luxury Avenue - 1.5 km / 0.9 mi &lt;br /&gt;Cancun Golf Club at Pok Ta Pok - 2.2 km / 1.3 mi &lt;br /&gt;Nautilus Diving and Training Center - 2.6 km / 1.6 mi &lt;br /&gt;Cancun Convention Center - 2.8 km / 1.7 mi &lt;br /&gt;Plaza Caracol - 2.8 km / 1.8 mi &lt;br /&gt;Playa Tortuga - 3.1 km / 1.9 mi &lt;br /&gt;Aquaworld - 3.6 km / 2.2 mi &lt;br /&gt;Playa Langosta - 4.1 km / 2.6 mi &lt;br /&gt;Museo de Arte Popular Mexicano - 4.6 km / 2.9 mi &lt;br /&gt;Playa Linda - 5 km / 3.1 mi &lt;br /&gt;Playa Delfines - 6.1 km / 3.8 mi &lt;br /&gt;El Rey Ruins - 6.2 km / 3.8 mi &lt;br /&gt;&lt;/p&gt;&lt;p&gt;The preferred airport for ME Cancun - Complete ME All Inclusive is Cancun, Quintana Roo (CUN-Cancun Intl.) - 14.3 km / 8.9 mi. &lt;/p&gt; </areaInformation> And I echo it in php: <div id="hotelInfo"><?php echo $areaInfo ?></div> And of course I get this in the browser window: Distances are calculated in a straight line from the property's location to the point of interest or attraction, and may not reflect actual travel distance. <br /><br /> Distances are displayed to the nearest 0.1 mile and kilometre. <p>La Isla Shopping Mall - 0.5 km / 0.3 mi <br />Yamil Lu'um - 0.5 km / 0.3 mi <br />Acuario Interac etc. How can I fix this??? Any help would be greatly apreciated! Thanks!

    Read the article

  • Guidelines for LBS Mobile application development

    - by Suriyan Suresh
    i need some help!, i am planning to develop such LBS Mobile Application which find nearest things based on gps data from mobile. 1.what are the best free and (preferably) open source technologies for development?. 2.What programming language to use for development of such application?. 3.what are the points to be considered? I need the general overview of the requirements for planning, I was interested in having a general understanding of the data, tools, and frameworks required to accomplish the job.

    Read the article

  • MySQL: Digits (1.75) to Friendly Time (1 hour and 45 minutes)

    - by Nick
    In my MySQL database, I have a float field named "HoursSpent" with values like "0.25", "1.75", "2.5", etc. Is there a way that I can have my SELECT statement format those values in a friendly format like this?: 0.25 = 15 minutes 1.75 = 1 hour and 45 minutes 2.5 = 2 hours and 30 minutes The "HoursSpent" field is supposed to only have values in 0.25 increments, but if somebody were to put something random like 0.16, it would be nice if the SELECT statement handled that by rounding it up to the nearest 0.25 (so in this case 0.16 would become 0.25, or 15 minutes).

    Read the article

  • Can UML be used to model a Functional program?

    - by iestyn
    More specifically, how do you model a functional program, or one developed using the Functional Style (without classes) using a diagram, and not textual representation, is it at all possible and could someone please direct me towards the nearest application that would do this (open source, of free as in beer, if you please)

    Read the article

  • Link to Google Streetview using Lat/Long

    - by Dan Monego
    I'm trying to make an app that links to Google streetview using latitude/longitude coordinates, and shows a streetview of the nearest road. This is coming from a fairly small and well covered area, so there isn't going to be any coordinates in the middle of the ocean. Is there a published API showing the get parameters you need to link directly to streetview?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >