location

微博爬虫及舆情分析-2.用户分析

匿名 (未验证) 提交于 2019-12-03 00:05:01
import pandas as pd import re #读取数据 user_frame = pd . read_csv ( 'users.csv' , index_col = None ) user_frame . head ( 2 ) # 我用的是notebook所以这里只有截图发上来 # location字段整理,保留到省份 user_frame [ 'location' ] = user_frame . location . fillna ( '其他' ) def get_provience ( loc ) : location = str ( loc ) location = re . findall ( r "^[\u4e00-\u9fff][^' ']*" , location ) if not location : return '其他' return location [ 0 ] user_frame [ 'location' ] = user_frame [ 'location' ] . apply ( get_provience ) # 认证用户比例 import matplotlib . pyplot as plt % matplotlib inline plt . rcParams [ 'font.sans-serif' ] = [ 'SimHei'

jq 刷新页面,刷新父级页面,iframe刷新父级页面

匿名 (未验证) 提交于 2019-12-02 23:56:01
window.location.reload(); //刷新当前页面. parent.location.reload(); //刷新父亲对象(用于框架) opener.location.reload(); //刷新父窗口对象(用于单开窗口) top.location.reload(); //刷新最顶端对象(用于多开窗口) 来源:51CTO 作者: qq_39161501 链接:https://blog.csdn.net/qq_39161501/article/details/100134682

自定义View(进度条)

匿名 (未验证) 提交于 2019-12-02 23:43:01
继承View重写带两个参数的构造方法,一个参数的不行不会加载视图,构造方法中初始化画笔这样不用没次刷新都要初始化浪费内存,在ondraw方法中绘图,invalidate方法会掉用ondraw方法重新绘制.在attrs中声明你将要设置的属性,名字要和自定义类名一样,在布局文件中引用属性,随便输入属性名然后alt+enter自动生成命名空间,就可以引用自定义属性了.最后在主activity中调用接口,使用传来的参数current public class MainActivity extends AppCompatActivity { protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . layout . activity_main ); final CircleProgressView myView = findViewById ( R . id . circle ); ValueAnimator animator = ValueAnimator . ofFloat ( 0 , 100 ); animator . setDuration ( 4000 ); animator .

vue刷新当前页面,不留白

匿名 (未验证) 提交于 2019-12-02 23:42:01
在项目中可能有需要刷新当前页面的需求 一般有这几种刷新当前页面的方法 1,history.go(0) 2,location.reload() 3,location=location 4,location.assign(location) 5,document.execCommand(‘Refresh’) 6,window.navigate(location) 7,location.replace(location) 8,document.URL=location.href 但是这几种都会出现白屏情况,用户体验很差 ** 推荐解决方法: ** 用provide / inject 组合 原理:允许一个祖先组件向其所有子孙后代注入一个依赖,不论组件层次有多深,并在起上下游关系成立的时间里始终生效 在App.vue,声明reload方法,控制router-view的显示或隐藏,从而控制页面的再次加载。 <template> <div id="app"> <router-view v-if="isRouterAlive"></router-view> </div> </template> <script> export default { name: 'App', provide () { return { reload: this.reload } }, data () { return

Vue路由的实现原理---完整的demo

匿名 (未验证) 提交于 2019-12-02 23:42:01
版权声明:如果您对这个文章有任何异议,那么请在文章评论处写上你的评论。 如果您觉得这个文章有意思,那么请分享并转发,或者也可以关注一下表示您对我们文章的认可与鼓励。 愿大家都能在编程这条路,越走越远。 https://blog.csdn.net/weixin_44369568/article/details/91489491 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <div class="router_box"> <a href="/home" class="router" replace="true">吃饭</a> <a href="/news" class="router">睡觉</a> <a href="/team" class="router">打豆豆</a> <a href="/about100" class="router">喝酒</a> </div> <div

Android原生方式获取经纬度

匿名 (未验证) 提交于 2019-12-02 23:40:02
两种定位方式:GPS定位、WiFi定位 优劣: GPS定位相比Wifi定位更精准且可在无网络情况下使用,但在室内基本暴毙无法使用 WiFi定位没有室内外限制也不需要开启GPS但需要联网,另外测试发现WiFi定位时onLocationChanged函数(用于监听经纬度变化)触发间隔无法小于30s public class GPSActivity extends AppCompatActivity { public static final int LOCATION_CODE = 301; private LocationManager locationManager; private String locationProvider = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getLocation(); } private void getLocation () { locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); //获取所有可用的位置提供器 List<String> providers =

Appium学习笔记||八、滑动页面

匿名 (未验证) 提交于 2019-12-02 23:40:02
一、方法   Appium的swipe方法:swipe(self, start_x, start_y, end_x, end_y, duration=xxx) 二、可以先获取元素坐标,然后根据上述方法滑动   获取元素坐标方法,可以去appium或者uiautomator中,通过鼠标查看x,y的坐标值。    from appium import webdriverimport timedesired_caps = {}desired_caps['platformName'] = 'Android'#运行平台desired_caps['platformVersion'] = '8.1.0'#安卓版本desired_caps['deviceName'] = 'test'#设备名称,不重要desired_caps['appPackage'] = 'com.tencent.qqlive'#Package名字desired_caps['appActivity'] = '.ona.activity.WelcomeActivity'#appActivity名字desired_caps['unicodeKeyboard'] = Truedesired_caps['resetKeyboard'] = Truedesired_caps['noReset'] = Truedesired_caps[

Android's most accurate Location API

别说谁变了你拦得住时间么 提交于 2019-12-02 23:24:25
In order to work, my app requires a location API. I intend use the Mapbox platform to customize its design (since Google Maps does not provide this level of customization, as far as I am concerned). Documentation says that we should use Google Play API when building location apps: The Google Play services location APIs are preferred over the Android framework location APIs (android.location) as a way of adding location awareness to your app. If you are currently using the Android framework location APIs, you are strongly encouraged to switch to the Google Play services location APIs as soon as

mSecurityInputMethodService is null in logcat

前提是你 提交于 2019-12-02 23:21:06
I wrote a little android app that should display the current location (last known location) of the smartphone. Although I copied the example code, and tried several other solutions, It seems to have the same error every time. My app consists of a button. Pressing the button should log the longitude and latitude, but only logs "mSecurityInputMethodService is null" . Here's the MainActivity.java : public class MainActivity extends Activity { int response; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button