摘要:
def getdirsize(dirpath): size = 0 for root, dirs, files in os.walk(dirpath): size += sum([getsize(join(root, name)) for name in files]) return size
阅读全文
posted @ 2019-01-02 16:04
anobscureretreat
阅读(716)
推荐(0)
posted @ 2019-01-02 11:08
anobscureretreat
阅读(643)
推荐(0)
摘要:
boost安装:https://www.cnblogs.com/sea-stream/p/10205425.html 在vs中添加
阅读全文
posted @ 2019-01-01 19:14
anobscureretreat
阅读(478)
推荐(0)
摘要:
在编译VS时候,出现fatal error C1010: unexpected end of file while looking for precompiled head。 问题详细解释:致命错误C1010,在寻找预编译指示头文件时,文件未预期结束。就是没有找到预编译指示信息的问文件。 顾名思义就
阅读全文
posted @ 2019-01-01 18:53
anobscureretreat
阅读(1137)
推荐(0)
摘要:
在编写头文件时,遇到这么一个warning:PCH Warning: header stop cannot be in a macro or #if block. An intellisense PCH file was not generated. 查询后大概原因是这样: 如果一个头文件在你的工程
阅读全文
posted @ 2019-01-01 18:45
anobscureretreat
阅读(901)
推荐(0)
摘要:
1.下载包 目录结构: 切换到上面的目录,然后运行 执行完毕后会生成两个exe文件 继续执行 结束后,目录如下 2.设置路径 测试 #include "stdafx.h"#include <boost\version.hpp>#include <boost\config.hpp>#include <
阅读全文
posted @ 2019-01-01 18:11
anobscureretreat
阅读(510)
推荐(0)
摘要:
1.下载去“boost”下载最新版 boost 库 https://sourceforge.net/projects/boost/ 2.安装解压之后,进入cmd控制台,运行 booststrap.bat 文件,运行完毕后会出现 bjam.exe 和 b2.exe 两个文件,继续运行 bjam.exe
阅读全文
posted @ 2019-01-01 14:56
anobscureretreat
阅读(309)
推荐(0)
摘要:
如果命令执行成功并且返回,status为0,否则status不为0 output为命令执行的结果, 如上如果执行ls, output为文件或者文件夹名称的列表
阅读全文
posted @ 2018-12-31 18:17
anobscureretreat
阅读(1102)
推荐(0)
摘要:
def make_targz(output_filename, source_dir): with tarfile.open(output_filename, "w:gz") as tar: tar.add(source_dir, arcname=os.path.basename(source_dir)) def make_targz_one_by_one(outpu...
阅读全文
posted @ 2018-12-31 17:19
anobscureretreat
阅读(2029)
推荐(0)
posted @ 2018-12-31 17:13
anobscureretreat
阅读(2486)
推荐(0)
摘要:
Python中,浮点数运算,经常会碰到如下情况: 出现上面的情况,主要还是因浮点数在计算机中实际是以二进制保存的,有些数不精确。比如说: 0.1是十进制,转化为二进制后它是个无限循环的数:0.000110011001100110011001100110011001100110011001100110
阅读全文
posted @ 2018-12-31 03:53
anobscureretreat
阅读(6098)
推荐(0)
摘要:
先说几个解决的方法,具体的有时间再细说 字典是这个,然后要对字典按照value进行排序 方法一: 方法二: 方法三: zip 之后,zip函数默认会对第一个元素进行排序的,如何取消排序?
阅读全文
posted @ 2018-12-31 03:49
anobscureretreat
阅读(165)
推荐(0)
posted @ 2018-12-31 03:39
anobscureretreat
阅读(207)
推荐(0)
摘要:
小数位数较多,可以使用round 如:
阅读全文
posted @ 2018-12-31 02:20
anobscureretreat
阅读(2035)
推荐(0)
摘要:
#-*- encoding=utf8 -*- import time import datetime import os '''把时间戳转化为时间: 1479264792 to 2016-11-16 10:53:12''' def TimeStampToTime(timestamp): timeStruct = time.localtime(timestamp) retur...
阅读全文
posted @ 2018-12-31 01:18
anobscureretreat
阅读(1400)
推荐(0)
摘要:
# 用到的知识# os.path.getatime(file) 输出文件访问时间# os.path.getctime(file) 输出文件的创建时间# os.path.getmtime(file) 输出文件最近修改时间 #-*- encoding=utf8 -*-import time import
阅读全文
posted @ 2018-12-31 00:18
anobscureretreat
阅读(18381)
推荐(0)
摘要:
先将整型转换成float型,在计算,结果就有小数了
阅读全文
posted @ 2018-12-29 13:29
anobscureretreat
阅读(1739)
推荐(0)
摘要:
服务启动: avtar服务启动 am startservice com.xxx.xxxwebserver/com.xxx.xxxwebserver.AvatarService am startservice com.xxx.xxxwebserver/com.xxx.xxxwebserver.WebRTCService report服务启动 am startservice com.xxx.d...
阅读全文
posted @ 2018-12-29 02:00
anobscureretreat
阅读(155)
推荐(0)
摘要:
##Using Queue with multiprocessing – Chapter 3: Process Based Parallelism import multiprocessing import random import time class producer(multiprocessing.Process): def __init__(self, queue): ...
阅读全文
posted @ 2018-12-29 01:23
anobscureretreat
阅读(173)
推荐(0)
posted @ 2018-12-29 01:02
anobscureretreat
阅读(184)
推荐(0)
摘要:
#!/usr/bin/python3 def KelvinToFahrenheit(Temperature): assert (Temperature >= 0),"Colder than absolute zero!" return ((Temperature-273)*1.8)+32 print (KelvinToFahrenheit(273)) print (int(Ke...
阅读全文
posted @ 2018-12-28 18:14
anobscureretreat
阅读(200)
推荐(0)
摘要:
下载地址: macos https://www.wireshark.org/download/osx/ win64https://www.wireshark.org/download/win64/ win32https://www.wireshark.org/download/win32/ 数据包的
阅读全文
posted @ 2018-12-28 15:46
anobscureretreat
阅读(283)
推荐(0)
posted @ 2018-12-28 01:16
anobscureretreat
阅读(1608)
推荐(0)
posted @ 2018-12-28 01:13
anobscureretreat
阅读(259)
推荐(0)
posted @ 2018-12-28 01:09
anobscureretreat
阅读(847)
推荐(0)
摘要:
例1 输出 例2 输出 例3 输出 例4 输出 例5
阅读全文
posted @ 2018-12-28 01:04
anobscureretreat
阅读(1807)
推荐(0)
posted @ 2018-12-28 00:49
anobscureretreat
阅读(583)
推荐(0)
摘要:
def interpolation_search(data,val): low=0 high=len(data)-1 print('查找过程中......') while low data[mid]: print('%d 介于中间值位置 %d[%3d] 和 %d[%3d] 之间,找右半边' \ %(v...
阅读全文
posted @ 2018-12-27 23:52
anobscureretreat
阅读(637)
推荐(0)
摘要:
def bin_search(data,val): low=0 high=len(data)-1 while low data[mid]: print('%d 介于中间值位置 %d[%3d] 和 %d[%3d] 之间,找右半边' \ %(val,mid+1,data[mid],high+1,data[high...
阅读全文
posted @ 2018-12-27 23:35
anobscureretreat
阅读(231)
推荐(0)
摘要:
import random val=0 data=[5,6,7,8,9] while val!=-1: find=0 val=int(input('请输入查找键值(1-9),输入-1离开:')) for i in data: if i==val: print('在第 %3d个位置找到键值 [%3d]' %(i+1,i)) ...
阅读全文
posted @ 2018-12-27 22:55
anobscureretreat
阅读(461)
推荐(0)
摘要:
[root@bogon ~]# stat -c%s install.log 26593
阅读全文
posted @ 2018-12-27 12:24
anobscureretreat
阅读(264)
推荐(0)
posted @ 2018-12-26 21:27
anobscureretreat
阅读(212)
推荐(0)
摘要:
match函数 输出 search函数 输出 匹配与搜索 输出 搜索和替换 输出
阅读全文
posted @ 2018-12-26 20:31
anobscureretreat
阅读(196)
推荐(0)
摘要:
一个简单的服务器 一个简单的客户端
阅读全文
posted @ 2018-12-26 19:06
anobscureretreat
阅读(245)
推荐(0)
摘要:
thread模块 输出 threading模块 输出 同步线程 输出 多线程优先级队列 输出
阅读全文
posted @ 2018-12-26 14:59
anobscureretreat
阅读(205)
推荐(0)
摘要:
movies.xml 使用SAX API解析XML 输出 使用DOM API解析XML 输出
阅读全文
posted @ 2018-12-26 14:33
anobscureretreat
阅读(217)
推荐(0)
摘要:
例子一 例子二 的实现为 例子三 for i in PowTwo(5): print(i) 输出 执行 例子四 返回所有奇数 执行
阅读全文
posted @ 2018-12-26 13:51
anobscureretreat
阅读(138)
推荐(0)
摘要:
例子一 执行 例子二 输出 例子三 输出 上面的 相当于
阅读全文
posted @ 2018-12-26 13:16
anobscureretreat
阅读(159)
推荐(0)
摘要:
一 二 例子1 输出 例子2 输出 例子3 反转字符串的生成器 输出
阅读全文
posted @ 2018-12-26 11:45
anobscureretreat
阅读(192)
推荐(0)
摘要:
def make_multiplier_of(n): def multiplier(x): return x * n return multiplier # Multiplier of 3 times3 = make_multiplier_of(3) # Multiplier of 5 times5 = make_multiplier_of(5) # O...
阅读全文
posted @ 2018-12-26 11:27
anobscureretreat
阅读(177)
推荐(0)