上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 68 下一页
摘要: def str_to_hex(s): return ' '.join([hex(ord(c)).replace('0x', '') for c in s]) def hex_to_str(s): return ''.join([chr(i) for i in [int(b, 16) for b in s.split(' ')]]) def str_to_bin(s): ... 阅读全文
posted @ 2019-07-18 22:07 anobscureretreat 阅读(13888) 评论(0) 推荐(1)
摘要: 这个错误很明显 ,是因为你关闭了套接字对象后,又再次去调用了套接字对象,此时套接字链接已经被关闭,你不能再去调用,所以才会出现这种错误,复查一下自己的代码,很快就可以解决。 参考: https://blog.csdn.net/weixin_40612082/article/details/80032 阅读全文
posted @ 2019-07-18 22:05 anobscureretreat 阅读(6725) 评论(0) 推荐(0)
摘要: topic:bp_nav_statetype:std_msgs/UInt16 值:0x101-导航开始;0x103-导航结束;0x104-导航成功;0x105-导航失败;0x106-导航取消;0x201-充电第二阶段开始;0x203-充电第二阶段结束;0x204-充电第二阶段成功;0x205-充电第 阅读全文
posted @ 2019-07-18 22:03 anobscureretreat 阅读(214) 评论(0) 推荐(0)
摘要: 经过检查发现,是由于客户端请求的链接,在一次循环之后,产生的套接字关闭,没有新的客户端套接字进行请求连接,所以产生broken pipe错误 阅读全文
posted @ 2019-07-18 22:03 anobscureretreat 阅读(2267) 评论(0) 推荐(0)
摘要: 常用的地址家族AF_UNIX:基于文件,实现同一主机不同进程之间的通信AF_INET:基于网络,适用于IPv4AF_INET6:基于网络,使用于IPv6 常见的连接类型SOCK_STREAM:即TCP/IP。面向连接的套接字,通信之前必须建立可靠的连接。面向连接的套接字提供序列化的、可靠的和不重复的 阅读全文
posted @ 2019-07-18 22:00 anobscureretreat 阅读(348) 评论(0) 推荐(0)
摘要: import sys, select, tty, termios old_attr = termios.tcgetattr(sys.stdin) tty.setcbreak(sys.stdin.fileno()) print('Please input keys, press Ctrl + C to quit') while(1): if select.select([s... 阅读全文
posted @ 2019-07-18 21:58 anobscureretreat 阅读(5588) 评论(0) 推荐(0)
摘要: Python2.x中的input()函数input()函数让我们明确我们输入的是数字格式还是字符格式,就是我们自己要知道我们想要的是什么,数字格式直接输入,字符格式必须加上单引号或者双引号,以确定我们输入的是字符串。 Python2.x中的raw_input()函数:>>> a = raw_inpu 阅读全文
posted @ 2019-07-18 21:58 anobscureretreat 阅读(855) 评论(0) 推荐(0)
摘要: http://docs.ros.org/api/std_msgs/html/msg/String.html 阅读全文
posted @ 2019-07-18 01:04 anobscureretreat 阅读(2062) 评论(0) 推荐(0)
摘要: json->string str = json.dumps(jsonobj) bytes->string str = str(bytes,‘utf-8’) string->json json = json.loads(str) 参考: https://www.cnblogs.com/xiandeda 阅读全文
posted @ 2019-07-18 01:02 anobscureretreat 阅读(1164) 评论(0) 推荐(0)
摘要: 参考: https://www.cnblogs.com/niuu/p/10106897.html https://www.cnblogs.com/Lin-Yi/p/7640147.html 阅读全文
posted @ 2019-07-18 01:00 anobscureretreat 阅读(9509) 评论(0) 推荐(1)
摘要: PX为单位 在Web页面初期制作中,我们都是使用“px”来设置我们的文本,因为他比较精确和固定。 只要页面某元素设置了px字体大小,其子元素/子孙元素未设置字体大小或设置的字体大小css优先级没父元素高的话,该子元素/子孙元素会继承其父元素的px字体大小设置 。 这种方法存在一个问题:当用户在浏览器 阅读全文
posted @ 2019-07-18 00:44 anobscureretreat 阅读(3538) 评论(0) 推荐(0)
摘要: 永远以最新的IE版本模式来显示网页 <meta http-equiv="X-UA-Compatible" content="IE=7">#以上代码告诉IE浏览器,无论是否用DTD声明文档标准,IE8/9都会以IE7引擎来渲染页面。<meta http-equiv="X-UA-Compatible" 阅读全文
posted @ 2019-07-18 00:31 anobscureretreat 阅读(9632) 评论(0) 推荐(0)
摘要: demo1 输出 demo2 使用send传递一个值到yield的那行,于是res=7 输出 demo3 使用生成器的场景,你有一个10000个元素的列表要处理,如果用List的话,会占用更大的空间,比如说取0,1,2,3,4,5,6............10000 这个时候range(10000 阅读全文
posted @ 2019-07-18 00:28 anobscureretreat 阅读(232) 评论(0) 推荐(0)
摘要: 我们需要牢记两点: ①__proto__和constructor属性是对象所独有的; ② prototype属性是函数所独有的,因为函数也是一种对象,所以函数也拥有__proto__和constructor属性。__proto__属性的作用就是当访问一个对象的属性时,如果该对象内部不存在这个属性,那 阅读全文
posted @ 2019-07-18 00:18 anobscureretreat 阅读(185) 评论(0) 推荐(0)
摘要: postgres=# create database mydb; CREATE DATABASE postgres=# alter database mydb; ALTER DATABASE postgres=# create table mydbtable(name varchar(80),year int); CREATE TABLE postgres=# create ta... 阅读全文
posted @ 2019-07-16 21:54 anobscureretreat 阅读(1074) 评论(0) 推荐(0)
摘要: 如图,修改如下浏览器的位置,由于我安装了虚拟机,导致每次点击谷歌浏览器后,都是打开的虚拟机里面的谷歌浏览器,需要重新设置浏览器的位置 打开设置 打开浏览器设置界面 双击可以选择浏览器的路径,然后就可以指定浏览器。 阅读全文
posted @ 2019-07-16 21:42 anobscureretreat 阅读(821) 评论(0) 推荐(0)
摘要: Available help: ABORT CREATE USER ALTER AGGREGATE CREATE USER MAPPING ALTER COLLATION CREATE VIEW ALTER CONVERSION ... 阅读全文
posted @ 2019-07-16 21:37 anobscureretreat 阅读(248) 评论(0) 推荐(0)
摘要: PostgreSQL Database Download 下载最新版 安装 双击上面的图标,进行安装 最后点击finish 打开安装的应用 输入设置的密码 打开pgadmin4 首先设置启动密码,然后输入数据库管理员密码 最后,可以看到控制面板如下 参考: https://www.runoob.co 阅读全文
posted @ 2019-07-16 21:25 anobscureretreat 阅读(2070) 评论(0) 推荐(0)
摘要: 创建 cookie 取回 Cookie 的值 isset() 函数来确认是否已设置了 cookie "; else echo "Welcome guest!"; ?> 删除 cookie 阅读全文
posted @ 2019-07-16 21:11 anobscureretreat 阅读(213) 评论(0) 推荐(0)
摘要: try{ //解析config.ini文件 $config = parse_ini_file(realpath(dirname(__FILE__) . '/config/config.ini')); //对mysqli类进行实例化 $mysqli = new mysqli($config['host 阅读全文
posted @ 2019-07-16 21:11 anobscureretreat 阅读(149) 评论(0) 推荐(0)
摘要: touch ~/.profile加入export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 参考:https://www.zhihu.com/question/286758933https://www.jianshu.com/p/7600de 阅读全文
posted @ 2019-07-16 21:09 anobscureretreat 阅读(3908) 评论(0) 推荐(0)
摘要: 面向对象编程(Object Oriented Programming,OOP,面向对象程序设计)是一种计算机编程架构。OOP 的一条基本原则是计算机程序是由单个能够起到子程序作用的单元或对象组合而成。 阅读全文
posted @ 2019-07-16 20:01 anobscureretreat 阅读(753) 评论(0) 推荐(0)
摘要: a.php b.php 阅读全文
posted @ 2019-07-16 14:36 anobscureretreat 阅读(289) 评论(0) 推荐(0)
摘要: <?php$arr = array('Hello','World!','I','love','Shanghai!');echo implode(" ",$arr);?> Hello World! I love Shanghai! 阅读全文
posted @ 2019-07-16 13:59 anobscureretreat 阅读(455) 评论(0) 推荐(0)
摘要: connect_error) { die("连接失败: " . $conn->connect_error); } echo "连接成功"; ?> getMessage(); } ?> 阅读全文
posted @ 2019-07-16 12:40 anobscureretreat 阅读(532) 评论(0) 推荐(0)
摘要: 下载https://www.mamp.info/en/downloads/ MAMP PRO will create copies of the MySQL databases located in /Applications/MAMP/db/mysql57 and store them in /L 阅读全文
posted @ 2019-07-16 12:38 anobscureretreat 阅读(563) 评论(0) 推荐(0)
摘要: ini_set("display_errors","On");error_reporting(E_ALL); https://blog.csdn.net/itxiaolong3/article/details/81748321 阅读全文
posted @ 2019-07-16 12:35 anobscureretreat 阅读(1589) 评论(0) 推荐(0)
摘要: l1 = ['b','c','d','c','a','a'] l2 = list(set(l1)) print(l2) 阅读全文
posted @ 2019-07-16 01:12 anobscureretreat 阅读(332) 评论(0) 推荐(0)
摘要: list1 = [1,2,3] list2 = [3,4,5] set1 = set(list1) set2 = set(list2) print(set1 & set2) print(set1 ^ set2) 阅读全文
posted @ 2019-07-16 01:11 anobscureretreat 阅读(537) 评论(0) 推荐(0)
摘要: print([x*11 for x in range(10)]) 阅读全文
posted @ 2019-07-16 01:10 anobscureretreat 阅读(662) 评论(0) 推荐(0)
摘要: 放慢抓取熟速度,减小对目标网站造成的压力,但是这样会减少单位时间内的数据抓取量 使用代理IP(免费的可能不稳定,收费的可能不划算) 阅读全文
posted @ 2019-07-16 01:08 anobscureretreat 阅读(338) 评论(0) 推荐(0)
摘要: 因为redis支持主从同步,而且数据都是缓存在内存中,所以基于redis的分布式爬虫,对请求和数据的高频读取效率非常高 阅读全文
posted @ 2019-07-16 01:05 anobscureretreat 阅读(369) 评论(0) 推荐(0)
摘要: 无头浏览器即headless browser,是一种没有界面的浏览器。既然是浏览器那么浏览器该有的东西它都应该有,只是看不到界面而已。 Python中selenium模块中的PhantomJS即为无界面浏览器(无头浏览器):是基于QtWebkit的无头浏览器。 Python中selenium模块中的 阅读全文
posted @ 2019-07-16 01:04 anobscureretreat 阅读(1170) 评论(0) 推荐(0)
摘要: 通过headers反爬虫:自定义headers,添加网页中的headers数据。 基于用户行为的反爬虫(封IP):可以使用多个代理IP爬取或者将爬取的频率降低。 动态网页反爬虫(JS或者Ajax请求数据):动态网页可以使用 selenium + phantomjs 抓取。 对部分数据加密处理(数据乱 阅读全文
posted @ 2019-07-16 01:01 anobscureretreat 阅读(744) 评论(0) 推荐(0)
摘要: GET:请求指定的页面信息,返回实体主体; HEAD:类似于get请求,只不过返回的响应中没有具体的内容,用于捕获报头; POST:向指定资源提交数据进行处理请求(比如表单提交或者上传文件),。数据被包含在请求体中。 PUT:从客户端向服务端传送数据取代指定的文档的内容; DELETE:请求删除指定 阅读全文
posted @ 2019-07-16 00:55 anobscureretreat 阅读(596) 评论(0) 推荐(0)
摘要: headers方向判断User-Agent、判断Referer、判断Cookie。将浏览器的headers信息全部添加进去注意:Accept-Encoding;gzip,deflate需要注释掉 阅读全文
posted @ 2019-07-16 00:53 anobscureretreat 阅读(424) 评论(0) 推荐(0)
摘要: 网络数据包 urllib、urllib2、requests 解析包 re、xpath、beautiful soup、lxml 阅读全文
posted @ 2019-07-16 00:51 anobscureretreat 阅读(943) 评论(0) 推荐(0)
摘要: 保存当前运行状态,然后暂停执行,即将函数挂起。yield关键字后面表达式的值作为返回值返回。当使用next(),send()函数从断点处继续执行。 阅读全文
posted @ 2019-07-16 00:48 anobscureretreat 阅读(497) 评论(0) 推荐(0)
摘要: 输出 阅读全文
posted @ 2019-07-16 00:29 anobscureretreat 阅读(206) 评论(0) 推荐(0)
摘要: Python之禅import this 阅读全文
posted @ 2019-07-16 00:26 anobscureretreat 阅读(207) 评论(0) 推荐(0)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 68 下一页