location

nginx学习之静态内容篇(五)

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-21 09:13:08
1.根目录和索引文件 server { root /www/data; location / { } location /images/ { } location ~ \.(mp3|mp4) { root /www/media; } } root指令能放置的位置是:http,server,location。 上面的意思是:我所有的location定义都是基于根目录/www/data的,也就是说 "/" 指的就是/www/data/,而 "/images/" 指的就是/www/data/images/。 我们可以为每个目录都定义一个索引文件,默认是index.html。 index指令的值:可以是index.html或者index.htm,或者index.php。 如果我们的URI是/images/some/path,那么nginx返回的文件就是/www/data/images/some/path/index.html。当然,前提是这个index.html得存在,否则返回404错误。 假如我访问/images/some/path这个URI时,我希望在网页上展示的是列表,需要使用指令autoindex:会展示 /www/data/images/some/path/ 目录下的所有文件夹和文件。 location /images/ { autoindex on; }

How to get location from service

瘦欲@ 提交于 2020-03-21 05:36:39
问题 Somewhat new to android, need some help with services. I have a service which polls for current location at interval X. I want to bind to that service and pass getLastKnownLocation from the service to my Activity A. I am not sure exactly how the information is passed from the bound service to the activity, if its through the binder or what. Anyways, here is my code where I am at thus far. Service: public class LocationService extends Service implements LocationListener { LocationManager

How to get location from service

故事扮演 提交于 2020-03-21 05:36:33
问题 Somewhat new to android, need some help with services. I have a service which polls for current location at interval X. I want to bind to that service and pass getLastKnownLocation from the service to my Activity A. I am not sure exactly how the information is passed from the bound service to the activity, if its through the binder or what. Anyways, here is my code where I am at thus far. Service: public class LocationService extends Service implements LocationListener { LocationManager

How to get location from service

会有一股神秘感。 提交于 2020-03-21 05:36:26
问题 Somewhat new to android, need some help with services. I have a service which polls for current location at interval X. I want to bind to that service and pass getLastKnownLocation from the service to my Activity A. I am not sure exactly how the information is passed from the bound service to the activity, if its through the binder or what. Anyways, here is my code where I am at thus far. Service: public class LocationService extends Service implements LocationListener { LocationManager

字典的学习3——嵌套——Python编程从入门到实践

余生颓废 提交于 2020-03-20 21:16:36
嵌套 ? 一系列字典存储在列表or列表作为值存储在字典or字典中套字典 1. 字典列表 alien_0 = {'color': 'green', 'points': 5} alien_1 = {'color': 'yellow', 'points': 10} alien_2 = {'color': 'red', 'points': 15} aliens = [alien_0, alien_1, alien_2] for alien in aliens: print(alien) 这样手动一个一个输入太费劲,让其自动生成多个: aliens = [] # 生成30个 for alien_number in range(30): new_alien = {'color': 'green', 'points': 5, 'speed': 'slow'} aliens.append(new_alien) # 显示前5个 for alien in aliens[:5]: print(alien) 但此时生成的数量是很多了,可都具有一样的特征,怎么办呢? for alien in aliens[0:3]: if alien['color'] == 'green': alien['color'] = 'yellow' alien['speed'] = 'medium' alien['point']

location 对象

喜夏-厌秋 提交于 2020-03-20 03:09:23
何为location对象? location是最常用的BOM对象之一,它 提供了与当前窗口中加载的文档有关的信息,还提供一些导航功能 。它很特别,因为window.location和document.location引用的是同一个对象,它是window对象和document对象的的属性。 location对象用处 location对象可以保存当前文档的信息,还能将URL解析为独立的片段,我们可以通过不同的属性访问这些片段。 location对象的属性 1. location.hash 设置或返回从井号 (#) 开始的 URL(锚),如果URL不包含散列,则返回空字符串; 2.location.host 设置或返回主机名和当前 URL 的端口号。 3.location.hostname 设置或返回当前 URL 的主机名。 4.location.href 设置或返回完整的 URL。 5.location.pathname 设置或返回当前URL的路径部分 6.location.port 设置或返回当前URL的端口号 7.location.protocol 设置或返回当前URL的协议,如:http:或https: 8.location.search 设置或返回URL的查询字符串,以问号开头的 location对象的方法 1.location.reload() 重新加载当前页面,默认不传参

Java14的新特性

放肆的年华 提交于 2020-03-19 00:17:27
3 月,跳不动了?>>> Java语言特性系列 Java5的新特性 Java6的新特性 Java7的新特性 Java8的新特性 Java9的新特性 Java10的新特性 Java11的新特性 Java12的新特性 Java13的新特性 Java14的新特性 Java15的新特性 序 本文主要讲述一下Java14的新特性 版本号 java -version openjdk version "14" 2020-03-17 OpenJDK Runtime Environment (build 14+36-1461) OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing) 从version信息可以看出是build 14+36 特性列表 305:Pattern Matching for instanceof (Preview) JDK14引入了preview版本的针对instanceof的模式匹配,其用法示例如下 public boolean isBadRequestError(Exception ex) { return (ex instanceof HttpClientErrorException rce) && HttpStatus.BAD_REQUEST == rce.getStatusCode(); }

LocationClient getLastLocation() returning null

亡梦爱人 提交于 2020-03-18 12:13:13
问题 I'm new to Android programming and wanted to start by creating a very basic app that displays the latitude and longitude of the current location on screen. I'm developing for my Samsung Galaxy S3 and read that you need to kickstart the phone to return the GPS. I've tried doing this in the onConnected() method with the requestLocationUpdates() method call on the LocationManager. However I find that the LocationClient is still returning a null location. Can anyone tell me what I'm doing wrong?

LocationClient getLastLocation() returning null

馋奶兔 提交于 2020-03-18 12:12:15
问题 I'm new to Android programming and wanted to start by creating a very basic app that displays the latitude and longitude of the current location on screen. I'm developing for my Samsung Galaxy S3 and read that you need to kickstart the phone to return the GPS. I've tried doing this in the onConnected() method with the requestLocationUpdates() method call on the LocationManager. However I find that the LocationClient is still returning a null location. Can anyone tell me what I'm doing wrong?