location

nginx 常见正则匹配符号表示

浪尽此生 提交于 2019-12-24 17:52:58
nginx 常见正则匹配符号表示 1 2 3 4 5 6 7 8 9 10 11 1、^: 匹配字符串的开始位置; 2、 $:匹配字符串的结束位置; 3、.*: .匹配任意字符,*匹配数量0到正无穷; 4、\. 斜杠用来转义,\.匹配 . 特殊使用方法,记住记性了; 5、(值1|值2|值3|值4):或匹配模式,例:(jpg|gif|png|bmp)匹配jpg或gif或png或bmp 6、i不区分大小写   一.正则表达式匹配,其中: * ~ 为区分大小写匹配 * ~* 为不区分大小写匹配 * !~和!~*分别为区分大小写不匹配及不区分大小写不匹配 二.文件及目录匹配,其中: * -f和!-f用来判断是否存在文件 * -d和!-d用来判断是否存在目录 * -e和!-e用来判断是否存在文件或目录 * -x和!-x用来判断文件是否可执行 三.rewrite指令的最后一项参数为flag标记,flag标记有: 1.last 相当于apache里面的[L]标记,表示rewrite。 2.break本条规则匹配完成后,终止匹配,不再匹配后面的规则。 3.redirect 返回302临时重定向,浏览器地址会显示跳转后的URL地址。 4.permanent 返回301永久重定向,浏览器地址会显示跳转后的URL地址。 使用last和break实现URI重写,浏览器地址栏不变。而且两者有细微差别

Detecting location in air

假装没事ソ 提交于 2019-12-24 17:20:21
问题 In my app location should be detected by my mobile when i am in air. Is it possible to detect location using google or Apple map? If anyone of you faced this scenario please give me some solution. 回答1: You can try reading Google Maps Elevation API documentation. The example JSON returns this: { "results" : [ { "elevation" : 1608.637939453125, "location" : { "lat" : 39.73915360, "lng" : -104.98470340 }, "resolution" : 4.771975994110107 } ], "status" : "OK" } So, you have to look for the

Rewrite跳转

旧街凉风 提交于 2019-12-24 16:47:57
Nginx服务中Rewrite的应用 Rewrite跳转场景 URL看起来更规范、合理 企业会将动态URL地址伪装成静态地址提供服务 网址换新域名后,让旧的访问跳转到新的域名上 服务端某些业务调整 Rewrite跳转实现 Rewrite实用场景 Nginx跳转需求的实现方式 使用 rewrite 进行匹配跳转 使用 if 匹配全局变量后跳转 使用 location 匹配再跳转 rewrite放在server{},if{},location{} 段中 对域名或参数字符串 使用 if 全局变量匹配 使用 proxy_ pass 反向代理 Nginx正则表达式 常用的正则表达式元字符 字符 说明 ^ 匹配输入字符串的起始位置 $ 匹配输入字符串的结束位置 * 匹配前面的字符零次或多次 + 匹配前面的字符一次或多次 ? 匹配前面的字符零次或一次 . 匹配除“\n”之外的任何单个字符。使用诸如"[.\n]"之 类的模式,可匹配包括“n”在内的任意字符 \ 将后面接着的字符标记为一个特殊字符或一个原义字符或一个向后引用 \d 匹配纯数字 {n} 重复n次 {n,} 重复n次或更多次 [c] 匹配单个字符c [a-z] 匹配a-z小写字母的任意一个 [a-zA-Z] 匹配a-z小写字母或A-Z大写字母的任意一 个 Rewrite命令 语法 rewrite <regex> <replacement

Get gps coordinates with asyncTask

孤人 提交于 2019-12-24 15:12:43
问题 i need to get my current coordinates. i try next, but it is does not get result. public class FragmentNear extends SherlockFragment implements android.location.LocationListener { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { locationManager = (LocationManager) getActivity().getSystemService( Context.LOCATION_SERVICE); locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, this); v = inflater.inflate(R.layout

PHP Radius Search

為{幸葍}努か 提交于 2019-12-24 14:54:14
问题 I'm going to build an app where the users can see points of interest in a predefined radius around their location. My first idea was to store the latitude and longitude of all POI's in a database and comparing the users location with the POI's location via SQL. The problem is the performance I think. If there are thousands of POI's and thousands of user requests with their location, it wouldn't be very economically or is this no problem for todays servers? My next approach was to divide the

Find location 1 Km away in 180 degree (South) from my location

青春壹個敷衍的年華 提交于 2019-12-24 14:30:41
问题 I have one Location (lat and long) and I want to find the next location(lat and long), which is 1 km away in 180 degree (in south) from my location(lat and long). Can you give me and algorithm or function? 回答1: Start with the Rosetta code implementation in Java: public static double haversine(double lat1, double lon1, double lat2, double lon2) { double dLat = Math.toRadians(lat2 - lat1); double dLon = Math.toRadians(lon2 - lon1); lat1 = Math.toRadians(lat1); lat2 = Math.toRadians(lat2);

Get page URL in IE context menu extension

孤者浪人 提交于 2019-12-24 13:33:35
问题 I am using IE as my browser, what I want to do is : 1. to do right click in IE page, then click a custom menu which call an external script in my local. 2. this external script is used to get the current page url where I do this right click action. Supposed I open https://docs.microsoft.com/en-us/sql/t-sql/statements/drop-external-resource-pool-transact-sql in my IE browser, then I do right click to execute my external script from my local. So what I want to get is the exact URL (https://docs

How do I disable click on a map marker in android?

烂漫一生 提交于 2019-12-24 13:16:29
问题 I've written my custom location listener which checks the user's location in every 10 minutes and updates a marker on the map which denotes the user's location. The problem is that the marker is clickable i.e. it shows a button to get directions to the marker. I want to disable that, how can I do that? Here's the function which creates/updates the marker public void updateUserMarker() { Double temp_latitude = ((MainActivity)mContext).mLatitude; Double temp_longitude = ((MainActivity)mContext)

Insert google map showing my current location

时光总嘲笑我的痴心妄想 提交于 2019-12-24 11:44:29
问题 I am traveling globally and need to insert a Google map on my web page that shows my current position (not the position of the reader) so that others can see where I am. Does anyone have a straightforward solution to do this. I know how to use My Places to create maps and insert in my pages, but have avoided having to get involved in using the Maps API so far. I have some knowledge of HTML and Javascript, but it is minimal so would rather avoid this if I can. Does anyone have a solution to

Watchkit Maps: show current location

不想你离开。 提交于 2019-12-24 11:22:41
问题 I have made application where we can calculate current location in extention app and I would like to show it at watch. How to do this? There is a methods only to show pin with different color. 回答1: If you have the coordinates for the location you can use - (void)addAnnotation (CLLocationCoordinate2D)location withImage:(UIImage *)image centerOffset:(CGPoint)offset on WKInterfaceMap. Pass in the location for the first parameter and pass in a UIImage for the pin that you want to show for the