location

Decoding the CLLocationAccuracy const's

北城以北 提交于 2019-11-28 15:24:18
问题 the following are listed in CLLocation.h but from my experience they are deceiving names- possibly originally thought up to serve two purposes, 1. to test the accuracy of the location returned, but also 2. to set how hard the location manager works, specifically what is enabled (gps (how many sat channels), how hard the wifi works, triangulation etc. extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation; // (raw value: -2) extern const CLLocationAccuracy kCLLocationAccuracyBest

php ip转换省市县

送分小仙女□ 提交于 2019-11-28 15:23:29
http://www.cz88.net/ip/ http://www.ttlsa.com/php/php_cunzhen-ipdata/ #  wget h http://6.scdx3.crsky.com/201307/qqwry0715.zip #  unzip qqwry0715.zip #  mv ip/qqwry.dat /data/site/test.ttlsa.com/qqwry.dat p class cls_ipAddress{ private $fp; private $firstip; private $lastip; private $totalip; public function __construct($filename="qqwry.dat"){ $this->fp=0; if(($this->fp=@fopen($filename,"rb"))!==false){ $this->firstip=$this->getlong(); $this->lastip=$this->getlong(); $this->totalip=($this->lastip-$this->firstip)/7; register_shutdown_function(array(&$this,"__destruct")); } } public function _

使用宝塔面板 配置nginx 访问ftp服务器下面的图片

时间秒杀一切 提交于 2019-11-28 15:04:45
如果 你在服务器上 运行war项目 可以在tomcat 配置访问的: tomcat 也贴出来吧! 一.tomca配置访问,需要更改配置文件server.xml ,如果找不到,自己好好找一下 一般在 tomcat/conf 这个目录下面 1. 截图: 2. 3.找到 <Host></Host> 这个标签 然后在<Host></Host>里添加<Context></>来实现映射功能 添加这一段: 直接放出来,你们可以复制 <Context path="/img" docBase="/img" reloadable="true"></Context> 然后就可以访问一下啦,图片访问成功 二 .配置nginx 访问ftp图片 1:进入配置文件的目录: 2;nginx的默认配置文件nginx.config #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet

JPanel setLocation

纵饮孤独 提交于 2019-11-28 14:30:28
Where it says: usePanel.setLocation(800,usePanel.getY()); it doesn't set the location it just starts in the middle, but inside the for loop where it gradually changes the position for a cool animation, it works fine. Any idea why the first set location to get it started isn't working? This is under FlowLayout btw so I assume that may have something to do with it but am not sure. usePanel.setLocation(800,usePanel.getY()); for(int x=0;x<3500;x+=6){ usePanel.setLocation(usePanel.getX()-5,usePanel.getY()); Thread.sleep(500); } Updated with current code private Timer nextloc; private JPanel

更新adt-bundle-windows-20131030

与世无争的帅哥 提交于 2019-11-28 13:43:05
对Android开发新手而言bundle集成的环境无疑是个很好的选择,对于使用前产生的问题应对如下。 一、将adt改为汉化的环境 先抛开出现失误不谈,我们先应付英文不好不认字的问题,首先在eclipse目录找到dropins文件夹打开后发现空空如也(如果你的时英文的),那么好,在这里下载eclipse插件 zh_CN 将该文件夹复制到与eclipse同文件夹的dropins目录下,再打开eclipse就是中文的了。神奇吧! 二、应对问题 sdk location 错误 当你打开集成环境时却看到提示没有sdk,如下 Could not find folder 'tools' inside SDK 那么好吧,请检查你的sdk里是否有tools文件夹,如果没有恭喜你,丢了文件,请重新下载一个,放到sdk目录下,这是同时将platform-tools文件目录写入path路径。如果没有SDK Manager.exe,请去网上搜一下,重新下一个吧。 三、在此你的adt不提示你sdk有问题了,但是让你更新adt啊!默认连接太慢啊!怎么办! 1.点击 窗口--->Android SDK Manager ; 2.打开主界面,Tools-->Options...,弹出Android SDK Manager - Settings窗口; 3.在Android SDK Manager -

Swift - Weekday by current location by currentCalendar()

做~自己de王妃 提交于 2019-11-28 13:30:34
Today is Wednesday and I have this code let calendar:NSCalendar = NSCalendar.currentCalendar() let dateComps:NSDateComponents = calendar.components(.CalendarUnitWeekday , fromDate: NSDate()) let dayOfWeek:Int = dateComps.weekday dayOfWeek is 4, but today is 3rd day of the week in Bulgaria. Is in USA today is 4th day of the week? And how to determine when the week starts in different countries and regions ? On my iPhone locale and calendar are set to Bulgarian calendar and locale and it knows that the week starts on Monday on my iMac also, but when I execute code it writes me 4... For the

用mpvue写个玩意儿玩玩

我的未来我决定 提交于 2019-11-28 13:22:07
下周公司要搞黑客马拉松了,组里可能会做个小程序。然后看到了mpvue感觉还不错,于是就打算试试水。用vue写小程序听上去美滋滋。 那么先开始吧! 全局安装 vue-cli $ npm install --global vue-cli 创建一个基于 mpvue-quickstart 模板的新项目 $ vue init mpvue/mpvue-quickstart my-project 安装依赖 $ cd my-project $ npm install 启动构建 $ npm run dev 这样子就Okay了。跑起来之后,在微信开发工具里新建项目,选择my-project下的dist目录 然后确定,你就能看到你的小程序已经可以运行了。项目请用别的编辑去编辑,vscode和atom都可以。微信开发工具仅用于调试。 我在pages下面新建了一个todolist和weather页面。每个目录下都有一个.vue文件和一个main.js文件。main.js下面可以配置一个微信小程序的参数,vue文件就是我们要编辑的页面了。 在打开src/main.js文件,在pages字段上加上我们刚刚创建的两个页面的路径。 接下来在src/components下创建一个组件我叫他todo-list.vue 代码如下,自己瞎几把写写的,各种div和css请不要在意,名字也取得不好。 src

Finding the location of maximum peaks in a plot with MATLAB

假装没事ソ 提交于 2019-11-28 12:57:19
问题 Suppose I have the F matrix like this: F = 0, 0, 106, 10, 14, 20, 20, 23, 27, 26, 28, 28, 28, 23 | | | peak peak peak I'm using the command plot(F) . I want to get the indexes of the peaks in the data. This is the code I have so far, it does not work: [max_x,index_x]=max(x); e=index_x; for i=1:11 index_x(i)=e; e=e+16; end Is there a builtin function in matlab that will do this for me? 回答1: Use the findpeaks function (Signal Processing Toolbox). [peakVal,peakLoc]= findpeaks(x); 回答2: Well here

How to set Allow Mock Location on Android Device before executing AndroidTest with uiautomator and espresso?

巧了我就是萌 提交于 2019-11-28 12:39:12
Basically every time I have to execute an AndroidTest that makes use of mock location provider I need to manually check the box on device emulator: Settings--> mock locations. How to automate this task directly from the android test? Is there any way using espresso/uiautomator/something else? I managed to do that in the way I wanted. Thanks to the links posted on comments. I added in my gradle file the following snippet: task enableMockLocationForTestsOnDevice(type: Exec) { Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream(

Nginx+Lua+Redis连接池

只谈情不闲聊 提交于 2019-11-28 12:33:56
上篇介绍了如果使用Lua访问Redis,但是每次都是重新创建一个连接到Redis,其实更好的方法是使用Redis连接池。 如果创建Redis连接池呢?原理是用Nginx的Upstream来实现,在Nginx启动时就可以创建多条socket连接到RedisServer,然后我们只要把请求发送到该Upstream即可,具体来配置文件。 upstream redis_pool { server 127.0.0.1:6379; keepalive 1024; } 这样就创建了redis连接池, 接着在配置文件里面添加一个location。 location /get_redis{ set_unescape_uri $query $arg_query; redis2_raw_query $query; redis2_pass redis_pool; } 接下来就是如果使用redis连接池了。我写了一个lua模块。 RedisManager = {} RedisManager.runCommand = {} local metatable = { __call = function(table , ...) command = nil args = '' for key, value in ipairs({...}) do if not command then command = value