proximity

mongodb, sorting by geoNear and date?

こ雲淡風輕ζ 提交于 2019-12-02 17:32:10
问题 how to sort by proximity and date in mongoDB? I tried this. But they just sort by date: coll.find({'date':{$gte:date},'location':{$nearSphere:[lat,lng]}}).sort({'date':1}).execFind(function (err, docs) {}) I appreciate the help. 回答1: There's no direct way to use $near or $nearSphere and sort by another field, because both of these operators already sort the results of doing a find() . When you sort again by 'date', you're re-sorting the results. What you can do, however, is grab results from

Android Removing Proximity Alert

核能气质少年 提交于 2019-12-02 13:36:35
问题 i am working on app which deals with proximity alerts. I can add proximity alert but I can not remove these proximity alerts. I have tried my code both on phone and virtual device but i couldn't manage to remove them. Here is my code: the activity where locations saved to database and proximity alerts added saveButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { String title = titleText.getText().toString(); if(title.matches("")){ Toast.makeText

php : word proximity script?

独自空忆成欢 提交于 2019-12-02 09:50:25
Okay - so, I've spent ages searching in Google, and even went through a few specific searches at hotscripts etc., several php forums and this place ... nothing (not of use anyway). i want to be able to take a block of text (page/file/doc) and pull it apart to find the "distance" between specific terms (find the proximity/raltional distance etc.). I woudl have thought there'd be at least a few such thigns around - but I'm not finding them. So - it may be harder than I thought. I understand it may be a somewhat "hungry" endevour - as it's likely to be fairly intensive on large documents - but

NullPointerException proximity alert

狂风中的少年 提交于 2019-12-02 07:49:25
问题 I am creating an application, which tracks the users location using GPS, stores the longitude and latitude in a SQLite database and adds proximity alerts. reference - http://www.javacodegeeks.com/2011/01/android-proximity-alerts-tutorial.html ERROR Message java.lang.NullPointerException LogCat: 04-19 08:14:42.617: W/IInputConnectionWrapper(585): showStatusIcon on inactive InputConnection 04-19 08:18:18.477: W/IInputConnectionWrapper(585): showStatusIcon on inactive InputConnection 04-19 08:18

ProximityAlert with a BroadcastReceiver not working

浪子不回头ぞ 提交于 2019-12-02 07:39:28
I am new to Android and have a problem with adding ProximityAlert with a BroadcastReceiver. I know that this topic has been taken up earlier as well but I am trying to add proximity alert to different locations and I am not sure if what I am trying to do is quite achievable this way or I am just doing it wrong. Problem : I have tried to implement the code for adding ProximityAlert with a BroadcastReceiver, but its not working some how. Below is the snippet from my code (posted below) requesting all to please have a look and help me out with it. I have this userLocations list. I am adding

Android Removing Proximity Alert

点点圈 提交于 2019-12-02 06:20:27
i am working on app which deals with proximity alerts. I can add proximity alert but I can not remove these proximity alerts. I have tried my code both on phone and virtual device but i couldn't manage to remove them. Here is my code: the activity where locations saved to database and proximity alerts added saveButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { String title = titleText.getText().toString(); if(title.matches("")){ Toast.makeText(CurrentLocationActivity.this,"Please provide a Title",Toast.LENGTH_SHORT).show(); } else{ saveLocation

NullPointerException proximity alert

大城市里の小女人 提交于 2019-12-02 03:18:10
I am creating an application, which tracks the users location using GPS, stores the longitude and latitude in a SQLite database and adds proximity alerts. reference - http://www.javacodegeeks.com/2011/01/android-proximity-alerts-tutorial.html ERROR Message java.lang.NullPointerException LogCat: 04-19 08:14:42.617: W/IInputConnectionWrapper(585): showStatusIcon on inactive InputConnection 04-19 08:18:18.477: W/IInputConnectionWrapper(585): showStatusIcon on inactive InputConnection 04-19 08:18:26.717: D/dalvikvm(585): GC_EXPLICIT freed 3939 objects / 240736 bytes in 1956ms 04-19 08:18:37.947: W

Lucene proximity search with boundaries?

筅森魡賤 提交于 2019-12-02 00:16:48
问题 Is there a way to perform a proximity search that is bounded, not by a fixed number of tokens, but by 2 marker tokens of some kind? For example, to implement proximity queries that are bounded inside as single sentence or paragraph? Obviously the analyzer has to support it, but has this been done before, and how? 回答1: SpanPositionCheckQuery is an abstract class that defines a span query, which checks if the matched span passes a check for position. Concrete implementations include

Lucene proximity search with boundaries?

拜拜、爱过 提交于 2019-12-01 20:30:36
Is there a way to perform a proximity search that is bounded, not by a fixed number of tokens, but by 2 marker tokens of some kind? For example, to implement proximity queries that are bounded inside as single sentence or paragraph? Obviously the analyzer has to support it, but has this been done before, and how? SpanPositionCheckQuery is an abstract class that defines a span query, which checks if the matched span passes a check for position. Concrete implementations include SpanPositionRangeQuery that checks if the match is in a defined range of positions and SpanPayloadCheckQuery that

Calculate distance from one point to all others

时光总嘲笑我的痴心妄想 提交于 2019-12-01 11:18:28
问题 I am working with a list of ID, X, and Y data for fire hydrant locations. I am trying to find the three closest fire hydrants for each fire hydrant in the list. a = [[ID, X, Y],[ID, X, Y]] I have tried implementing this using a for loop but I am having trouble because I cannot keep the original point data the same while iterating through the list of points. Is there a strait forward way to calculate the distance from one point to each of the other points and iterate this for each point in the