摘要: public boolean isScreenChange(){ Configuration mConfiguration = this.getResources().getConfiguration(); //获取设置的配置信息 int ori = mConfiguration.orientati 阅读全文
posted @ 2020-08-03 20:33 胡辣汤王子 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 1.配置文件中style中 2.直接隐藏 阅读全文
posted @ 2020-08-01 12:54 胡辣汤王子 阅读(225) 评论(0) 推荐(0) 编辑
摘要: style name="CalendarTheme.WithActionBar" parent="android:Theme.Material.Light"> <item name="android:windowNoTitle">false</item> <item name="android:ac 阅读全文
posted @ 2020-07-31 09:03 胡辣汤王子 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Handler使用例1这个例子是最简单的介绍handler使用的,是将handler绑定到它所建立的线程中.本次实验完成的功能是:单击Start按钮,程序会开始启动线程,并且线程程序完成后延时1s会继续启动该线程,每次线程的run函数中完成对界面输出nUpdateThread...文字,不停的运行下 阅读全文
posted @ 2020-07-27 18:17 胡辣汤王子 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1 阅读全文
posted @ 2020-07-27 18:02 胡辣汤王子 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 什么是服务呢? 用俗话话应该是长期于后台运行的程序,如果是官方一点,首先它是一个组件,用于执行长期运行的任务,并且与用户没有交互。 每一个服务都需要在配置文件AndroidManifest.xml文件里进行生命,怎么生命呢? 使用标签,其实跟前面的activity,广播接收者receiver一样生命 阅读全文
posted @ 2020-07-26 17:18 胡辣汤王子 阅读(393) 评论(0) 推荐(0) 编辑
摘要: 什么是广播接收者? 我们小时候都知道,听广播,收听广播!什么是收听广播呢?打开收音机,调频就可以收到对应的广播节目了。其实我们在Android开发中也有类似的概念,所以就称之为广播了。 广播包括发广播和广播接收者,这就类似于我们的广播发射塔和收音机。 因些,在Android开发中,我们主要研究的就是 阅读全文
posted @ 2020-07-26 13:31 胡辣汤王子 阅读(286) 评论(0) 推荐(1) 编辑
摘要: 什么是启动模式呢? 我们的Activity是由系统创建的,我们编写xxxActivity直接或者间接继承自Activity,然后我们是没有自己创建的,只是配置了一下即可。 Activity由系统创建启动的时候,有几种模式,我们把这几种模式叫做Activity的启动模式。 Activity启动模式有那 阅读全文
posted @ 2020-07-26 13:06 胡辣汤王子 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 什么是生命周期呢? 我们平时在开发软件的时候,就有软件的生命周期。同样的很多事物都有自己的生命周期。一般来说,生命周期不由自己控制。自杀是一个例外,对吧! 先举个例子吧: – 一辆车的生命周期有:被创建—>被购买—->被使用—–>被报废 – 一个人的生命周期:被成为受精卵—->被出生—–>被长大—— 阅读全文
posted @ 2020-07-26 12:34 胡辣汤王子 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 接下来,我们补充一下Activity的横竖屏生命周期的变化。 先上代码吧: package com.sunofbeaches.activitylifecircledemo; import android.app.Activity; import android.os.Bundle; import a 阅读全文
posted @ 2020-07-26 12:32 胡辣汤王子 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 之后会在目录生成shared_prefs文件 代码实现: 阅读全文
posted @ 2020-07-26 10:57 胡辣汤王子 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 接收端返回结果 发送代码:,模拟话费充值,从MainActivity充值到PayActivity private static final int PAY_REQUEST_CODE=1; //按mInoput充值按钮 private void initListener() { mInput.setO 阅读全文
posted @ 2020-07-26 10:24 胡辣汤王子 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 1.这部分是显示跳转到另一个Activity,这个被跳转的Activ叫做SecondActivity 写法一: Intent intent = new Intent(this,SecondActivity.class); intent.putExtra("account",accountText); 阅读全文
posted @ 2020-07-26 08:49 胡辣汤王子 阅读(527) 评论(0) 推荐(0) 编辑
摘要: 可能是环境变量出了问题: 1.在登录界面按住alt+F1或者lt+F2进入命令行(此命令行下所有命令都应该找到其根目录执行,比如:ls命令应该bin/ls执行) 2./bin/vi /etc/profie 修改环境变量(仔细看环境变量哪里错误) 3.:w !usr/bin/sudo tee % 退出 阅读全文
posted @ 2020-07-24 09:53 胡辣汤王子 阅读(2832) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-07-23 18:39 胡辣汤王子 阅读(175) 评论(0) 推荐(0) 编辑
摘要: doc.591ota.comgitlib.591ota.com git使用流程: ssh-keygencat ~/.ssh/id_rsa.pub复制ssh-用户设置-SSH密钥 git pull 获取新代码 编辑代码、创建代码、删除文件等一系列操作后 git add file git commit 阅读全文
posted @ 2020-07-23 18:37 胡辣汤王子 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Linux下AndroidStudio的sync project with gradle file下载慢解决办法: 这种情况往往是服务器网络太慢 1.自己下载gradle压缩包 2.解压到android-studio/.gradle/wrapper/dicts下(没有文件自己创建) 3.在此目录下在 阅读全文
posted @ 2020-07-23 18:31 胡辣汤王子 阅读(464) 评论(0) 推荐(0) 编辑
摘要: DataFrame和Serious类型可以直接赋值: df = pd.DataFrame(np.arange(12).reshape(3, 4), index=list("abc"), columns=list("WXYZ")) df.loc[["a", "b"], ["W", "Z"]]=np.n 阅读全文
posted @ 2020-03-20 00:43 胡辣汤王子 阅读(669) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd import numpy as np df = pd.DataFrame(np.arange(10).reshape(5,2),index=list("cvbnm"),columns=list('AB')) print(df) print(" ") print 阅读全文
posted @ 2020-03-16 21:15 胡辣汤王子 阅读(376) 评论(0) 推荐(0) 编辑
摘要: ①进入要创建项目的路径 ②scrapy startproject qsbk(项目名),创建爬虫scrapy genspider -t crawl wxapp_spider(爬虫名) "http://www.wxapp-union.com/" (域名) ③pycahrm打开项目 阅读全文
posted @ 2020-03-16 11:29 胡辣汤王子 阅读(166) 评论(0) 推荐(0) 编辑
摘要: # 2-快速入门 ## 安装和文档: 1. 安装:通过`pip install scrapy`即可安装。 2. Scrapy官方文档:http://doc.scrapy.org/en/latest 3. Scrapy中文文档:http://scrapy-chs.readthedocs.io/zh_C 阅读全文
posted @ 2020-03-15 23:44 胡辣汤王子 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 1.安装scrapy框架:pip install scrapy 2.使用cmd窗口命令创建项目: ①进入要创建项目的路径 ②scrapy startproject qsbk(项目名),创建爬虫scrapy genspider qsbk_sqider ③pycharm下打开刚才创建的项目 ④修改set 阅读全文
posted @ 2020-03-15 21:18 胡辣汤王子 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1.tesseract import pytesseract from PIL import Image pytesseract.pytesseract.tesseract_cmd=r"H:\Python\Tesseract_dev20170510\Tesseract-OCR\tesseract.e 阅读全文
posted @ 2020-03-15 21:09 胡辣汤王子 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1.正常使用cookie爬取拉勾网ajax数据 import requests from lxml import etree import time import re headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) A 阅读全文
posted @ 2020-03-15 21:08 胡辣汤王子 阅读(578) 评论(0) 推荐(0) 编辑
摘要: 1.获取cookie信息 from selenium import webdriver driver=webdriver.Firefox() driver.get("https://www.baidu.com") for cookie in driver.get_cookies(): print(c 阅读全文
posted @ 2020-03-15 21:07 胡辣汤王子 阅读(186) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriver from selenium.webdriver.common.by import By #下载后的驱动放到火狐浏览器的根目录 #设置环境变量后就可以引用 driver=webdriver.Firefox() driver.get("htt 阅读全文
posted @ 2020-03-15 21:05 胡辣汤王子 阅读(329) 评论(0) 推荐(0) 编辑
摘要: import threading import random import time gMoney = 1000 gLock = threading.Lock() gTotalTimes = 10 gTimes = 0 class Producer(threading.Thread): def ru 阅读全文
posted @ 2020-03-15 21:03 胡辣汤王子 阅读(142) 评论(0) 推荐(0) 编辑
摘要: import requests from lxml import etree from urllib import request import os from queue import Queue import threading class Procuder(threading.Thread): 阅读全文
posted @ 2020-03-15 21:02 胡辣汤王子 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1.dump import json persons=[ { 'username':"wangchenyang", 'age':14, 'country':"china" }, { 'username':"王晨阳", 'age':14, 'country':"china" } ] # json_st 阅读全文
posted @ 2020-03-14 00:43 胡辣汤王子 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1.读取 import csv def read_csv_demo1(): with open('stock.csv','r') as fp: # reader是一个迭代器 reader=csv.reader(fp) next(reader) for x in reader: name=x[3] v 阅读全文
posted @ 2020-03-14 00:41 胡辣汤王子 阅读(236) 评论(0) 推荐(0) 编辑
摘要: import requests import re from lxml import etree headers={ "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) C 阅读全文
posted @ 2020-03-14 00:40 胡辣汤王子 阅读(280) 评论(0) 推荐(0) 编辑
摘要: #encoding: utf-8 import re # 分组 text = "apple's price $99,orange's price is $10" ret = re.search('.*(\$\d+).*(\$\d+)',text) print(ret.group(0)) # ret. 阅读全文
posted @ 2020-03-13 11:34 胡辣汤王子 阅读(206) 评论(0) 推荐(0) 编辑
摘要: #encoding: utf-8 import re text = "apple price is $299" ret = re.search("\$\d+",text) print(ret.group()) # r = raw = 原生的 # text = '\n' # print(text) t 阅读全文
posted @ 2020-03-13 11:32 胡辣汤王子 阅读(388) 评论(0) 推荐(0) 编辑
摘要: import re # 1. 匹配某个字符串: text = "hello" ret = re.match('he',text) print(ret.group()) # 2. 点:匹配任意的字符 text = "\n" ret = re.match('.',text) print(ret.grou 阅读全文
posted @ 2020-03-13 11:31 胡辣汤王子 阅读(282) 评论(0) 推荐(0) 编辑
摘要: from bs4 import BeautifulSoup import requests from pyecharts import Bar headers={ "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.3 阅读全文
posted @ 2020-03-13 11:28 胡辣汤王子 阅读(266) 评论(0) 推荐(0) 编辑
摘要: from bs4 import BeautifulSoup html=""" <html> <head> <title>表格标签学习</title> <meta charset="UTF-8"/> <pre> 表格标签学习: table :声明一个表格 tr:声明一行,设置行高及改行所有单元格的高度 阅读全文
posted @ 2020-03-13 11:27 胡辣汤王子 阅读(231) 评论(0) 推荐(0) 编辑
摘要: from bs4 import BeautifulSoup html=""" <html> <head> <title>表格标签学习</title> <meta charset="UTF-8"/> <pre> 表格标签学习: table :声明一个表格 tr:声明一行,设置行高及改行所有单元格的高度 阅读全文
posted @ 2020-03-13 11:25 胡辣汤王子 阅读(142) 评论(0) 推荐(0) 编辑
摘要: import requests from lxml import etree url_domain="https://www.dytt8.net" headers={ "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537 阅读全文
posted @ 2020-03-12 12:10 胡辣汤王子 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 错误代码: zoomE=html.xpath("//div[@id='Zoom']") cover=zoomE.xpath("//img/@src") print(cover) zoomE是一个列表 正确代码: zoomE=html.xpath("//div[@id='Zoom']")[0] cov 阅读全文
posted @ 2020-03-12 11:14 胡辣汤王子 阅读(5260) 评论(0) 推荐(0) 编辑
摘要: 原代码: text =response.content.decode('gbk') 错误提示: text =response.content.decode('gbk')UnicodeDecodeError: 'gbk' codec can't decode byte 0xd0 in position 阅读全文
posted @ 2020-03-12 01:05 胡辣汤王子 阅读(478) 评论(0) 推荐(0) 编辑