Search Results

Search found 1099 results on 44 pages for 'arg geo'.

Page 3/44 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Finding whether two geo-coordinates lie on the same road

    - by Amarsh
    Hi there, Given two geo-coordinates in (latitude,longitude) format, is it possible to find out if they lie on the same road? I want to do this programatically not visually. I can perhaps extract addresses and compare the street name, but since streets can change names over a long distance, this solution doesnt sem to work :( Cheers Amarsh

    Read the article

  • IPhone geo tagging data (SQLite or CoreData)

    - by user267980
    Hi. I'm about to build an app that has a database of places that has a location (lon/lat) and i'm about to build the dataModel. Actualy the app is very simple and all i want is to be able to fetch all places around the user (say in a radius of 30miles). Is it better to user SQLite (is there any geo-spatial extension out there)? I'll have around 5000 places in the database and i'm wondering where i can ask a database without affecting performances.

    Read the article

  • geo-indexing: efficiently calculating proximity based on latitude/longitude

    - by AnC
    My simple web app (WSGI, Python) supports text queries to find items in the database. Now I'd like to extend this to allow for queries like "find all items within 1 mile of {lat,long}". Of course that's a complex job if efficiency is a concern, so I'm thinking of a dedicated external module that does indexing for geo-coordinates - sort of like Lucene would for text. I assume a generic component like this already exists, but haven't been able to find anything so far. Any help would be greatly appreciated.

    Read the article

  • Using Geo APIs to pick a random town from anywhere in the world

    - by Dan Forys
    Hi all, I'm trying to use Yahoo's excellent GeoPlanet API: http://developer.yahoo.com/geo/geoplanet/guide/api-reference.html I would like to pick a random town from anywhere in the world but can't see an easy way to do it. I have tried querying by country and asking for children of type 'town', but can't seem to do that directly. Can anyone think of a way to pluck out a random town WOEID without having to query the country, then the admin regions, then the admin 2, then the admin 3 etc. I have also experimented using YQL, but don't have enough of an understanding about the available APIs.

    Read the article

  • Iphone geo location permission check

    - by Johnny Mast
    Dear Developers, Hi i have a quick question about the iphone (iOS) geolocation api's. Currenly i have a map in my application and the operating system will ask the user if it wants to allow the use of geolocations. Now thats all nice but the thing is i want to change my app when geolocations is allowed to a so called "Geo location" mode where new options are available or "standard" mode with less ui elements when permissions are not granted. What can i use to check if permission is granted?. So basicaly is that an api that tells me permission granted yes or no.

    Read the article

  • GPS on emulator doesn't get the geo fix - Android

    - by MaurizioPz
    Hi I'm developing an application for the android OS, I'm just starting, but I can't get the GPS on the emulator to work. I've read on the internet that you need to send a geo fix to the emulator in order to enable the gps locationProvider. I'm both using the DDMS and telnet to try to send it, but logcat never tells me the it recived a new fix, and my apolication still sees the gps as disabled here's my code package eu.mauriziopz.gps; import java.util.Iterator; import java.util.List; import android.app.Activity; import android.content.Context; import android.location.LocationManager; import android.os.Bundle; import android.util.Log; public class ggps extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); LocationManager l =(LocationManager) getSystemService(Context.LOCATION_SERVICE); List<String> li = l.getAllProviders(); for (Iterator<String> iterator = li.iterator(); iterator.hasNext();) { String string = iterator.next(); Log.d("gps", string); } if (l.getLastKnownLocation("gps")==null) Log.d("gps", "null"); } } I've read that the DDMS may not work properly on a non english OS, but telnet should work! update: the gps is enabled in the settings

    Read the article

  • issue to solve the geo tagging in android

    - by sundar
    I am a new guy in Android. How to implement the Geo-tag for images? I have tried by myself but not getting expected result. My code is like: @Override protected Dialog onCreateDialog(int id) { jpgDialog = null;; switch(id){ case ID_JPGDIALOG: Context mContext = this; jpgDialog = new Dialog(mContext); jpgDialog.setContentView(R.layout.jpgdialog); exifText = (TextView) jpgDialog.findViewById(R.id.text); geoText = (TextView)jpgDialog.findViewById(R.id.geotext); bmImage = (ImageView)jpgDialog.findViewById(R.id.image); bmOptions = new BitmapFactory.Options(); bmOptions.inSampleSize = 2; Button okDialogButton = (Button)jpgDialog.findViewById(R.id.okdialogbutton); okDialogButton.setOnClickListener(okDialogButtonOnClickListener); mapviewButton = (Button)jpgDialog.findViewById(R.id.mapviewbutton); mapviewButton.setOnClickListener(mapviewButtonOnClickListener); break; default: break; } return jpgDialog; } Please help me how to proceed?

    Read the article

  • Could not convert JavaScript argument arg 0" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS

    - by Drahcir
    I am trying to make this captcha jquery plugin to work. The a certain line of code is executed, the error pops up. This is the line of code that causes the error : $(".ajax-fc-" + rand).draggable({ containment: '#ajax-fc-content' }); What I am assuming is that there is some kind of conflict with the javascript reference, but can't determain what. These are the referenes that I am using <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> <script src="js/ui.core.js"></script> <script src="js/ui.draggable.js"></script> <script src="js/ui.droppable.js"></script> <script src="js/effects.core.js"></script> <script src="js/effects.slide.js"></script>

    Read the article

  • Java Collections Sort not accepting comparator constructor with arg

    - by harmzl
    I'm getting a compiler error for this line: Collections.sort(terms, new QuerySorter_TFmaxIDF(myInteger)); My customized Comparator is pretty basic; here's the signature and constructor: public class QuerySorter_TFmaxIDF implements Comparator<Term>{ private int numberOfDocs; QuerySorter_TFmaxIDF(int n){ super(); numberOfDocs = n; } } Is there an error because I'm passing an argument into the Comparator? I need to pass an argument...

    Read the article

  • c++ var-arg macro, NOT template

    - by anon
    I need this to be a macro. Do not answer about templates. [This is part of a larger system that can not be represented as a template.] Is it possible to define a macro "foo" so that foo(a) --> foo1(a); foo(a, b) --> foo2(a, b); foo(a, b, c) --> foo3(a, b, c); Basically, I want this macro to expand to a different macro depending on the number of args it has. Pretty much, I want number_of_(__VA_ARGS) as a symbol. Thanks!

    Read the article

  • Spring MVC 3.0: Avoiding explicit JAXBElement<> wrapper in method arg

    - by Keith Myers
    I have the following method and want to avoid having to explicitly show the JAXBElement< syntax. Is there some sort of annotation that would allow the method to appear to accept raw MessageResponse objects but in actuality work the same as shown below? I'm not sure how clear that was so I'll say this: I'm looking for some syntactic sugar :) @ServiceActivator public void handleMessageResponse(JAXBElement<MessageResponse> jaxbResponse) { MessageResponse response = jaxbResponse.getValue(); MessageStatus status = messageStatusDao.getByStoreIdAndMessageId(response.getStoreId(), response.getMessageId()); status.setStatusTimestamp(response.getDate()); status.setStatus("Complete"); }

    Read the article

  • How to resolve "Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]" erro

    - by Holicreature
    i have a json object returned from ajax and when i alert it, it is displayed correctly and i try to add those into a unordered list and add that to a place holder div, but throws the above error.. function handleResponse() { if(httpa.readyState == 4){ var response = httpa.responseText; //alert(response); if(response!='empty') { //alert(response); eval("prod="+response); var len = prod.length; var st = "<ul>"; for(var cnt=0;cnt<len;cnt++) { st = st + "<li onclick='set("+prod[cnt].id+")'>"+prod[cnt].name+"</li>"; } st = st + "</ul>"; } var tt = document.getElementById('holder1'); tt.appendChild(st); // i even tried **tt.appendChild(eval(st));** tt.style.display = 'block'; } }

    Read the article

  • Jython java call throws exception asking for 2 args when only one arg is coded

    - by clutch
    I have an Java method I want to call within my Jython servlet running on tomcat5. It looks like this: @SuppressWarnings("unchecked") public School loadByName(String name) { List<School> school; school = getHibernateTemplate().find("from " + getPersistentClass().getName() + " where name = ?", name); return uniqueResult(school); } I call it in Jython using: foobar = SchoolDAOHibernate.loadByName('Univeristy') It throws an error that says loadByName() expects 2 args; got 1. What other argument could it be looking for?

    Read the article

  • Why first arg to execve() must be path to executable

    - by EBM
    I understand that execve() and family require the first argument of its argument array to be the same as the executable that is also pointed to by its first argument. That is, in this: execve(prog, args, env); args[0] will usually be the same as prog. But I can't seem to find information as to why this is. I also understand that executables (er, at least shell scripts) always have their calling path as the first argument when running, but I would think that the shell would do the work to put it there, and execve() would just call the executable using the path given in its first argument ("prog" from above), then passing the argument array ("args" from above) as one would on the command line.... i.e., I don't call scripts on the command line with a duplicate executable path in the args list.... /bin/ls /bin/ls /home/john Can someone explain?

    Read the article

  • How to receive a arg from command line in C

    - by 115599yy
    Hi everyone: I want to write a program to receive a argument from command line. It's like a kind of atof(). There my program goes: 9 char s[] = "3.1415e-4"; 10 if (argc == 1) { 11 printf("%e\n",atof(s)); 12 } 13 else if (argc == 2) { 14 //strcpy(s, argv[1]); 15 printf("%e\n",atof(argv[1])); 16 } 1.should I just use argv[1] for the string to pass to my atof(), or, put it into s[]? 2.If I'd better put it in s[], is there some build-in function to do this "put" work? maybe some function like strcpy()?? thanks.

    Read the article

  • Declaring an array of character pointers (arg passing)

    - by Isaac Copper
    This is something that should be easy to answer, but is more difficult for me to find a particular right answer on Google or in K&R. I could totally be overlooking this, too, and if so please set me straight! The pertinent code is below: int main(){ char tokens[100][100]; char str = "This is my string"; tokenize(str, tokens); for(int i = 0; i < 100; i++){ printf("%s is a token\n", token[i]); } } void tokenize(char *str, char tokens[][]){ //do stuff with string and tokens, putting //chars into the token array like so: tokens[i][j] = <A CHAR> } So I realize that I can't have char tokens[][] in my tokenize function, but if I put in char **tokens instead, I get a compiler warning. Also, when I try to put a char into my char array with tokens[i][j] = <A CHAR>, I segfault. Where am I going wrong? (And in how many ways... and how can I fix it?) Thanks so much!

    Read the article

  • command line arg?

    - by kaushik
    This is a module named XYZ. def func(x) ..... ..... if __name__=="__main__": print func(sys.argv[1]) Now I have imported this module in another code and want to use the func. How can i use it? import XYZ After this, where to give the argument, and syntax on how to call it, please?

    Read the article

  • Vim plugin only works when file is provided as arg to launch command

    - by nsfyn55
    I am using the plugin java_getset.vim. The issue is that the plugin's commands are only available when I launch vim with the file as an argument. user@machine~: vim myfile.java If launch vim and use command-t or NerdTree to open the file in a buffer the plugin's commands are not accessible. All the filetype detection stuff is configured and working(I have syntax highlighting and indentation). The plugin source appears to be written to the letter according the the vim docs for a filetype plugin. Can anyone help me understand what changes a can make so that I can use this plugin in conjunction with Command-t?

    Read the article

  • Help with malloc and free: Glibc detected: free(): invalid pointer

    - by nunos
    I need help with debugging this piece of code. I know the problem is in malloc and free but can't find exactly where, why and how to fix it. Please don't answer: "Use gdb" and that's it. I would use gdb to debug it, but I still don't know much about it and am still learning it, and would like to have, in the meanwhile, another solution. Thanks. #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <unistd.h> #include <string.h> #include <sys/wait.h> #include <sys/types.h> #define MAX_COMMAND_LENGTH 256 #define MAX_ARGS_NUMBER 128 #define MAX_HISTORY_NUMBER 100 #define PROMPT ">>> " int num_elems; typedef enum {false, true} bool; typedef struct { char **arg; char *infile; char *outfile; int background; } Command_Info; int parse_cmd(char *cmd_line, Command_Info *cmd_info) { char *arg; char *args[MAX_ARGS_NUMBER]; int i = 0; arg = strtok(cmd_line, " "); while (arg != NULL) { args[i] = arg; arg = strtok(NULL, " "); i++; } num_elems = i;precisa em free_mem if (num_elems == 0) return 0; cmd_info->arg = (char **) ( malloc(num_elems * sizeof(char *)) ); cmd_info->infile = NULL; cmd_info->outfile = NULL; cmd_info->background = 0; bool b_infile = false; bool b_outfile = false; int iarg = 0; for (i = 0; i < num_elems; i++) { if ( !strcmp(args[i], "<") ) { if ( b_infile || i == num_elems-1 || !strcmp(args[i+1], "<") || !strcmp(args[i+1], ">") || !strcmp(args[i+1], "&") ) return -1; i++; cmd_info->infile = malloc(strlen(args[i]) * sizeof(char)); strcpy(cmd_info->infile, args[i]); b_infile = true; } else if (!strcmp(args[i], ">")) { if ( b_outfile || i == num_elems-1 || !strcmp(args[i+1], ">") || !strcmp(args[i+1], "<") || !strcmp(args[i+1], "&") ) return -1; i++; cmd_info->outfile = malloc(strlen(args[i]) * sizeof(char)); strcpy(cmd_info->outfile, args[i]); b_outfile = true; } else if (!strcmp(args[i], "&")) { if ( i == 0 || i != num_elems-1 || cmd_info->background ) return -1; cmd_info->background = true; } else { cmd_info->arg[iarg] = malloc(strlen(args[i]) * sizeof(char)); strcpy(cmd_info->arg[iarg], args[i]); iarg++; } } cmd_info->arg[iarg] = NULL; return 0; } void print_cmd(Command_Info *cmd_info) { int i; for (i = 0; cmd_info->arg[i] != NULL; i++) printf("arg[%d]=\"%s\"\n", i, cmd_info->arg[i]); printf("arg[%d]=\"%s\"\n", i, cmd_info->arg[i]); printf("infile=\"%s\"\n", cmd_info->infile); printf("outfile=\"%s\"\n", cmd_info->outfile); printf("background=\"%d\"\n", cmd_info->background); } void get_cmd(char* str) { fgets(str, MAX_COMMAND_LENGTH, stdin); str[strlen(str)-1] = '\0'; } pid_t exec_simple(Command_Info *cmd_info) { pid_t pid = fork(); if (pid < 0) { perror("Fork Error"); return -1; } if (pid == 0) { if ( (execvp(cmd_info->arg[0], cmd_info->arg)) == -1) { perror(cmd_info->arg[0]); exit(1); } } return pid; } void type_prompt(void) { printf("%s", PROMPT); } void syntax_error(void) { printf("msh syntax error\n"); } void free_mem(Command_Info *cmd_info) { int i; for (i = 0; cmd_info->arg[i] != NULL; i++) free(cmd_info->arg[i]); free(cmd_info->arg); free(cmd_info->infile); free(cmd_info->outfile); } int main(int argc, char* argv[]) { char cmd_line[MAX_COMMAND_LENGTH]; Command_Info cmd_info; //char* history[MAX_HISTORY_NUMBER]; while (true) { type_prompt(); get_cmd(cmd_line); if ( parse_cmd(cmd_line, &cmd_info) == -1) { syntax_error(); continue; } if (!strcmp(cmd_line, "")) continue; if (!strcmp(cmd_info.arg[0], "exit")) exit(0); pid_t pid = exec_simple(&cmd_info); waitpid(pid, NULL, 0); free_mem(&cmd_info); } return 0; }

    Read the article

  • Oracle spatial search within distance

    - by KA_lin
    I have the following table Cities: ID(int),City(char),latitude(float),longitude(float). Now based on a user`s longitude(ex:44.8) and latitude(ex:46.3) I want to search for all the cities near him within 100 miles/KM. I have found some examples but don`t know how to adapt them to my case select * from GEO.Cities a where SDO_WITHIN_DISTANCE([I don`t know], MDSYS.SDO_GEOMETRY(2001, 8307, MDSYS.SDO_POINT_TYPE(44.8,46.3, NULL) ,NULL, NULL), 'distance = 1000') = 'TRUE'; Any help would be appreciated. P.S: If it is possible to have the distance and to be sorted P.P.S: I want to do it in this way due to performance issues, I have done this in this way http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL but it takes too long...

    Read the article

  • Liskov principle: violation by type-hinting

    - by Elias Van Ootegem
    According to the Liskov principle, a construction like the one below is invalid, as it strengthens a pre-condition. I know the example is pointless/nonsense, but when I last asked a question like this, and used a more elaborate code sample, it seemed to distract people too much from the actual question. //Data models abstract class Argument { protected $value = null; public function getValue() { return $this->value; } abstract public function setValue($val); } class Numeric extends Argument { public function setValue($val) { $this->value = $val + 0;//coerce to number return $this; } } //used here: abstract class Output { public function printValue(Argument $arg) { echo $this->format($arg); return $this; } abstract public function format(Argument $arg); } class OutputNumeric extends Output { public function format(Numeric $arg)//<-- VIOLATION! { $format = is_float($arg->getValue()) ? '%.3f' : '%d'; return sprintf($format, $arg->getValue()); } } My question is this: Why would this kind of "violation" be considered harmful? So much so that some languages, like the one I used in this example (PHP), don't even allow this? I'm not allowed to strengthen the type-hint of an abstract method but, by overriding the printValue method, I am allowed to write: class OutputNumeric extends Output { final public function printValue(Numeric $arg) { echo $this->format($arg); } public function format(Argument $arg) { $format = is_float($arg->getValue()) ? '%.3f' : '%d'; return sprintf($format, $arg->getValue()); } } But this would imply repeating myself for each and every child of Output, and makes my objects harder to reuse. I understand why the Liskov principle exists, don't get me wrong, but I find it somewhat difficult to fathom why the signature of an abstract method in an abstract class has to be adhered to so much stricter than a non-abstract method. Could someone explain to me why I'm not allowed to hind at a child class, in a child class? The way I see it, the child class OutputNumeric is a specific use-case of Output, and thus might need a specific instance of Argument, namely Numeric. Is it really so wrong of me to write code like this?

    Read the article

  • Finding the Geo-location on a Blackberry?

    - by Frederico
    I'm running into an issue when trying to geolocate users whom are using blackberry devices. Currently there are a few checks that I go through to geolocate the individual the first, using the navigator paramater inside browsers. if(navigator.geolocation) if this fails then I have a backup using a free service (for testing) from maxmind: See Here Yet this doesn't return back the city at all either. I've then tried using the JSPI that google maps proviedes, and echoing out the google.loader.ClientLocation: if (google.loader.ClientLocation != null) { document.write("Your Location Is: " + google.loader.ClientLocation.address.city + ", " + google.loader.ClientLocation.address.region + " lat: " + google.loader.ClientLocation.latitude + " Long: " + google.loader.ClientLocation.longitude); } else { document.write("Your Location Was Not Detected By Google Loader"); } When this didn't work I tried following the google maps 3.0 detect location seen here: Detecting Location I've done all this after seeing this work correctly in google latitude.. so I know there has to be a way to get the location... any thoughts, ideas on what I could possibly try? Thank you kindly

    Read the article

  • Get the distance between two geo points

    - by Chmouel Boudjnah
    Hi, I want to make a apps that check what's the nearest place from where the user is. I can easily get the location of the user and I have a list of places with latitude and longitude. What would be the best way to know the nearest place of the list against the current position. I could not find anything in the google APIs. I am worried I need to resort to my calculate and have to do math to calculate it. What do you guys think ? Cheers and thanks for reading or replying.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >