This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Practice10HistogramView extends View { | |
Paint paint1; | |
Paint paint2; | |
private final int PADDING = 30;//间隔 | |
private final int WIDTH_ITEM = 80;//间距 | |
public Practice10HistogramView(Context context) { | |
super(context); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Practice10HistogramView extends View { | |
Paint paint1; | |
Paint paint2; | |
private final int PADDING = 30;//间隔 | |
private final int WIDTH_ITEM = 80;//间距 | |
public Practice10HistogramView(Context context) { | |
super(context); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding=utf-8 | |
import requests | |
import re | |
from bs4 import BeautifulSoup | |
import os | |
import threading | |
import Queue | |
import time | |
import urllib2 | |
import string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from lxml import etree | |
start_url_var = 'https://www.jianshu.com/users/9104ebf5e177/timeline' | |
base_url = 'https://www.jianshu.com/users/9104ebf5e177/timeline?max_id={}&page={}' | |
# 筛选第一层 | |
# ul class="note-list" | |
last_max_id = -1 | |
user_id = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Practice10HistogramView extends View { | |
Paint paint1; | |
Paint paint2; | |
private final int PADDING = 30;//间隔 | |
private final int WIDTH_ITEM = 80;//宽度 | |
public Practice10HistogramView(Context context) { | |
super(context); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def remove_all_whitespace(source_str): | |
p = re.compile('\s+') | |
new_string = re.sub(p, '', source_str) | |
return new_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
detail_data = '' | |
// 详情页网址 https://www.toutiao.com/a6539663078324175367/ | |
//我把头条详情页存到了本地 toutiao_detai.html | |
with open('toutiao_detai.html', 'r')as f: | |
detail_data = f.read() | |
data_list = re.findall("articleInfo: {(.*?)}", detail_data, re.S) | |
for data in data_list: | |
url_list = re.findall('(http.*?com)', text, re.S) | |
for url in url_list: | |
print(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def insert_mysql(list_items): | |
if len(list_items) == 0: | |
print('input data illegal') | |
return | |
config = { | |
'host': '127.0.0.1', | |
'port': 3306, | |
'user': 'root', | |
'password': '********', | |
'db': 'lagouInfo', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean equals(Object o) { | |
if (this == o) return true; | |
if (o == null || getClass() != o.getClass()) return false; | |
AreaBean labelBean = (AreaBean) o; | |
if (label != null ? !label.equals(labelBean.label) : labelBean.label != null) return false; | |
return value != null ? value.equals(labelBean.value) : labelBean.value == null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
dir=~/Desktop/screenshot/ | |
curr=`date "+%Y-%m-%d %H:%M:%S"` | |
name=${dir}"screenshot"${curr}".png" | |
echo "${name}" | |
adb exec-out screencap -p > "$name" | |
if [ -n "$1" ]; then | |
echo "$1 秒后自动删除" | |
sleep $1 | |
rm "$name" |
OlderNewer