location

MongoDB: Geospatial Index array not in correct format

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: While trying to setup to use the Geospatial Index on MongoDB, I run into the error message that the location array is not in the correct format. This is my collection "test". { "_id" : ObjectId ( "4f037ac176d6fdab5b00000a" ), "CorporateId" : "XYZ12345" , "Places" : [ { "Location" : { "Longitude" : "50.0" , "Latitude" : "50.0" }, "ValidFrom" : "2011-11-01 00:00:00" , "ValidTo" : "2021-12-31 00:00:00" , "itemCount" : "1" } ] } Once I run this code. db . test . ensureIndex ({ "Places.Location" : "2d" }); I get this error message

深度优化Nginx(一)

↘锁芯ラ 提交于 2019-12-03 08:55:33
通过博文 Nginx初步优化 就已经了解了Nginx的基础概念,已经可以对Nginx进行初步的优化了,包括:Nginx平滑升级 、更改Nginx版本信息、Nginx虚拟主机配置、nginx配置文件中location选项的作用等等。本篇博文主要针对Nginx进行进一步的优化。 博文大纲: 一、Nginx配置反向代理 二、Nginx的proxy缓存使用 三、优化Nginx服务的压缩功能 一、Nginx配置反向代理 配置Nginx作为反向代理和负载均衡,同时利用其缓存功能,将静态页面在Nginx中缓存,以达到降低后端服务器连接数的目的并检查后端web服务器的检查状态。 如图: 环境需求: 一台Nginx服务器(Centos系统)IP地址:192.168.1.1; 两台httpd服务器(Centos系统)IP地址:192.168.1.2 192.168.1.3; 下载 Nginx软件包 安装Nginx: [root@localhost ~]# yum -y install gcc gcc-c++ make libtool zlib zlib-devel pcre pcre-devel openssl openssl-devel //如果安装系统时,是最小化安装,则需要安装以上依赖包 [root@localhost ~]# yum -y install pcre-devel zlib

Sort an array by NSDates using the sort function [duplicate]

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: This question already has an answer here: How do I sort a swift array containing instances of NSManagedObject subclass by an attribute value (date) 4 answers I have a model class called Event . import Foundation import MapKit public class Event { let id : Int var title : String ? let status : String let location : String var description : String ? var latitude : CLLocationDegrees ? var longitude : CLLocationDegrees ? var startDate : NSDate ? var endDate : NSDate ? init ( id : Int , location : String , status : String ) { self . id

CGEventTap blocks application input

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to use CGCreateEventTap to monitor global mouse clicks, however when I do this it seems to block interaction with my own app. Mouse clicks in other running apps work fine, but my own app (that is the DemoAppDelegate app) does not respond completely. I can drag the main window for the app, but the red/yellow/green window buttons are greyed out. And the DemoApp's menu is unclickable as well. This seems really strange to me, and I've been unable to figure it out. Examples of using event taps are few and far between, so any

handling location permissions instantaneously in swift

懵懂的女人 提交于 2019-12-03 08:52:27
问题 I am trying to implement a basic map view and add a user's current location to the map as an annotation. I have added the requestwheninuse key to my info.plist and imported coreLocation. In my view controller's did load method, I have the following: locManager.requestWhenInUseAuthorization() var currentLocation : CLLocation if(CLLocationManager.authorizationStatus() == CLAuthorizationStatus.AuthorizedWhenInUse){ currentLocation = locManager.location println("currentLocation is \

LocationManager.requestLocationUpdates add or update?

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am looking at LocationManager to get best location for periodical reporting location. I am curious about LocationManager.requestLocationUpdates method. What would it happen if I invoke this method several times with different minTime and minDistance without calling removeUpdates? Will it add new request or just update the existing one? I am trying to test this, it is not bit easy at the moment. Your answer would be appreciated. 回答1: It will update the existing request. 回答2: You could register it multiple times. see my code below. package

React Native Android location request timed out

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In IOS there isn't a problem while looking for gps coords. It works fine. On Android side its not stable as IOS. This problem both in real device and emulator. Sometimes it can find location, but sometimes not. Looking for 3days but there wasn't find a solution. When my app cannot find my location, I tried via Google Maps app, it works like charm. Here is my code for both IOS and Android; getCurrentPosition() { navigator.geolocation.getCurrentPosition( (position) => { this.setState({ initialPosition: position }); alert(JSON.stringify

LocationManager requestLocationUpdates not working

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I Have This Creepy problem. i am trying to get the location of my emulator. it working fine when i get the location of my emulator. but when i change my location coordinates nothing happens. gps is working fine. Here is my code Main.java import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.location.Location; import android.location.LocationListener;

Enable Mock Locations in Android Marshmallow

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I cannot get mock locations to work in Android Marshmallow. I have installed app in Android 6.0 . Now, When I want to set mock location for this app by following option. Setting >> Developer Option >> Select Mock location app I can not see any Application to select. Has anyone had success enabling mock locations under Marshmallow? 回答1: If you use the Mock location permission: <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> Then you will be able to select your app by Setting >> Developer Option >> Select Mock

How to handle Location Listener updates inside a Service in Android?

China☆狼群 提交于 2019-12-03 08:37:05
I am working on an app that should get accurate user location continuously if user is inside a specific zone. The location updates should be saved on a server (Parse.com) so other users can get the current location of the user. The flow is: Application onCreate --> start Service with LocationListener --> onLocationChanged --> save new location on Parse.com --> Parse.com Cloud afterSave method send push notification to users --> other users get notifications via broadcast reciever --> update user marker on map <-- Questions: I am not sure about how to implement step 4, should I save the new