location

Customize iOS Simulator preset locations to fake as current location

。_饼干妹妹 提交于 2019-12-06 10:26:13
问题 In the iOS simulator, one can select from some Apple pre-defined locations, or enter a custom latitude/longitude for your own location. I want to customize that list of available locations. I see from this answer that one can provide a gpx file. However, I don't see where to do this in Xcode5 (the screenshots shown in the linked to answer are for Xcode 4). Suggestions? 回答1: EDIT: Another way to achieve this to edit your run scheme and select options. and provide GPX file in default location

How to get user's country and forward to URL?

故事扮演 提交于 2019-12-06 10:11:29
问题 How can I get the user's country and forward them to a URL based on it? I am looking specifically at Australia, New Zealand, USA, UK and Other. Preferably with PHP, but can use Javascript if necessary. 回答1: This may help you to get country then you can redirect accordingly. <?PHP function visitor_country() { $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR']; $result = "Unknown"; if(filter_var($client, FILTER_VALIDATE_IP)) {

nginx笔记

有些话、适合烂在心里 提交于 2019-12-06 10:10:46
nginx中文文档 官方中文文档 bookstack的中文文档 一、nginx基本概念 1. nginx是什么, 做什么事情 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,在BSD-like 协议下发行。其特点是占有内存少,并发能力强,事实上nginx的并发能力在同类型的网页服务器中表现较好,中国大陆使用nginx网站用户有:百度、京东、新浪、网易、腾讯、淘宝等。 以上内容摘自 百度百科 2. 反向代理 正向代理: 例如, 我们访问谷歌访问不到, 但是有一个服务器可以访问到, 那么, 我们就可以通过那个服务器访问谷歌. 对于谷歌来说, 他不知道我们是谁, 他只知道是代理服务器访问了它. 如图所示: 反向代理: 客户端对代理是无感知的, 因为客户端不需要任何配置就可以访问 注意: 正向代理需要客户端配置代理服务器, 较为常用的场景是 VPN翻墙 , 对服务器来说, 它只能感知到代理服务器的存在, 它是感知不到客户端的, 从图中就可以看出 反向代理不需要客户端配置服务器, 较为常用的场景是 负载均衡 、 防止web攻击 . 对于客户端来说, 它感知不到真实的服务器, 而是感知到了代理服务器, 可以参考图片理解 更加详细的信息可以参考大佬的博客: 博客园 Rabbit_Dale 、 知乎 3. 负载均衡 即: 当并发很高的时候,

How to specify location targeting of FB post via Graph API

◇◆丶佛笑我妖孽 提交于 2019-12-06 09:53:54
Some time ago there was a field called targeting in the Post API Reference but now it's gone and I don't know how to add a specific location and language targeting to the post via API. I've search a lot: some results refer to the targeting parameter. I've tried it, but it seems don't working. I've tried 2 ways to achieve this, but without any success: $post_details = array('message' => $msg, 'privary' => array('value' => 'CUSTOM', 'description' => array('country' => 'Germany'))); $fb->api('/PAGE_ID/feed', 'POST', $post_details); and $post_details = array('message' => $msg, 'targeting' => array

Android - Getting Network GPS location within a short time frame (10 seconds max)

耗尽温柔 提交于 2019-12-06 09:50:00
I'm trying to set up a quick and dirty GPS lookup via LocationManager which fetches a network location (within 500 meters) every half second for ten seconds. In other words, I'm just trying to find the correct coarse Criteria settings and the correct logic to stop checking after 10 seconds of no better locations within my Handler thread. I'm thinking my main loop should look something like this: /** * Iteration step time. */ private static final int ITERATION_TIMEOUT_STEP = 500; //half-sec intervals public void run(){ boolean stop = false; counts++; if(DEBUG){ Log.d(TAG, "counts=" + counts); }

Proximity range for Beacons changes back and forth even when the App is in the same place

折月煮酒 提交于 2019-12-06 09:32:32
问题 Beacon Proximity range changes the proximity response as Near - Immediate - Far, even while the ios Device remains in the same place. As I open a view when the proximity response is Near. I get the proximity response back and forth, Near - immediate then Near. It shows up the view again and again How can we solve this issue. Is there any event handler. Thanks. 回答1: The proximity and accuracy values appear to be quite 'noisy'. It can also depend on your environment. Water (and therefore people

iOS: Application missing from Location Services list

谁说我不能喝 提交于 2019-12-06 09:29:48
My application uses iPhone's GPS functionality, and it was working fine previously, as in it prompts user to allow the use of location services and it shows up under Settings > Location Services list. I uninstalled and re-downloaded the app from the app store, but it no longer does either of them. The app was of the same version, and hasn't been updated for a while, but the problem had started recently. The problem has been found in multiple devices (iPhone 3GS, iPhone 4, iPhone 4S) running different OS (iOS 4-5). Did Apple change how Location Services work recently? This same happend to me

How to compare 2 location positions

孤街醉人 提交于 2019-12-06 08:40:05
I have an App with a TextView that finds your location and when you move, the value in TextView changes. I want to know what can I do in order to register the first location and then look for the location 5 min after. For example: min 0 LAT 000000 LONG 000000 ( SAVE IT ) min 5 LAT 1111111 LONG 111111 if min0 == min 5 ... To sum up, I want to compare 2 strings (lat & long at the beginning) and lat & long after 5 minutes. Any suggestion will be appreciated. This Link should serve your purpose; Go through distanceTo or distanceBetween . You can create a Location object from a latitude and

Can be located which floor we are via smart phone GPS?

最后都变了- 提交于 2019-12-06 07:55:17
问题 Is there a way that can decide which floor we are via smart phone? For example, i m in a building. floor 5; the native app in my smart phone can know i m on floor 5 and give me some advice about floor 5(navigation to floor 1) 回答1: With some newer Android phones (e.g., Samsung Galaxy S3), embedded barometric pressure sensors can be used to derive an accurate indoor altitude estimate, which could be transformed into floors (assuming you know which elevation the floor is located at). See this

Google Maps - Location keeps jumping between my real location and 0.6 miles away (Random place)

孤街醉人 提交于 2019-12-06 07:41:07
问题 I've got Google Maps v2 running on my app, using a service to get the users location. Problem is the location keeps changing. It shows my real location for a bit, then jumps to a random location that I've never been to before. I'm check GPS/Network lat/lng via the service and calling them in my maps class, where I then animate the camera to move to my location. I don't really know what's wrong, or where to start with this one. Does anyone know what sort of problem this is? It's baffling to me