自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(27)
  • 问答 (3)
  • 收藏
  • 关注

原创 Linux C语言编程(3)——文件系统实验

Linux 系统文件调用的使用设计一个二级目录的树形文件系统程序利用 C 语言实现一个简单的文件系统,能完成目录和文件的创建,删除,空间分配,能实现两级目录。linux文件系统c语言实现源代码课内实验要求用c语言实现linux的文件系统,此代码实现的文件系统较为简单,功能包括打开、关闭、创建、删除文件和目录等。zy691357966/SimpleOSFileSystem

2017-07-30 16:25:46 3716

原创 linux 下C语言编程(2)——进程的创建,挂起,解挂,进程间通信

在 linux 下利用C语言实现进程的创建,挂起和解挂操作#include #include #include #include #include #include #include /*********************************************************** 功能说明:在 linux 下利用C语言实现进程的创建,挂起和解

2017-07-30 16:25:14 4529

原创 Python爬虫知识(3)—— xpath 选择器

<!DOCTYPE html> <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--><!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--><!--[if IE 8 ]> <html lang="en" class="no-js ie8">

2017-07-29 22:55:05 12090

原创 Python爬虫知识(2)——正则表达式复习

"""特殊字符1、 ^ $ * ? + {2} {2,} {2,5} |2、 [] [^] [a-z] .3、 \s \S \w \W4、 [\u4E00-\u9FA5] () \d"""import re# line = 'bobby123'# . 代表任意字符, * 代表前边的字符出现任意多次# b 开头,后边任意字符出现任意多次# re_pattern = '^b.*'# if

2017-07-28 18:00:07 630

原创 unittest 中用于跳过 test method, test class,的相关装饰器

可以使用unitest.skip装饰器族跳过test method或者test class,这些装饰器包括: ① @unittest.skip(reason):无条件跳过测试,reason描述为什么跳过测试 ② @unittest.skipif(conditition,reason):condititon为true时跳过测试 ③ @unittest.skipunless(condition,

2017-07-21 23:59:22 988

原创 unittest 基础之 —— TestResult

testresult就是存储测试结果的,不过通过何种方式调用run函数,最终到Testcase中的run方法时必须传一个result(如果为None则自己实例化一个TestResult对象)。这个result就是TestResult对象或者是其子类的对象,我们每次执行的结果都会调用其addFailure,addSuccess,addSkip….等方法将执行结果保存到TestResult

2017-07-21 23:59:05 3924 1

原创 matplotlib基础——matplotlib.pyplot.scatter

matplotlib.pyplot.scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, verts=None, edgecolors=None, hold=None, data=None, **kwargs)Make a

2017-07-21 22:47:06 3623

原创 Python基础 —— 使用 pickle 模块存储数据报错的解决办法

# 写入错误TypeError: write() argument must be str, not bytes# 读取错误UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 0: illegal multibyte sequence解决方案:def storeTree(inputTree, fielname):

2017-07-21 17:18:05 3637

原创 matplotlib基础——令画图时显示中文的方法

当前代码# -*- coding:utf-8 -*-import matplotlib.pyplot as pltdecisionNode = dict(boxstyle="sawtooth", fc="0.8")leafNode = dict(boxstyle="round4", fc="0.8")arrow_args = dict(arrowstyle="<-")def plotNode(n

2017-07-21 14:38:35 888

原创 Python基础——list.append() 与 list.extend() 的区别

>>> li = ['a', 'b', 'c'] >>> li.extend(['d', 'e', 'f']) >>> li ['a', 'b', 'c', 'd', 'e', 'f'] >>> len(li) 6 >>> li[-1] 'f' >>> li = ['a', 'b', 'c'] >>> li.append(

2017-07-21 00:43:03 1131

原创 使用pip install 命令时,提示 Using cached解决方案

PS C:\Users\rHotD\Documents\GitHub> pip install -r .\requirements.txtCollecting asn1crypto==0.22.0 (from -r .\requirements.txt (line 1)) Using cached asn1crypto-0.22.0-py2.py3-none-any.whlCollectin

2017-07-21 00:41:33 25721 2

原创 matplotlib基础——add_subplot()

add_subplot(*args, **kwargs)Add a subplot. Examples:fig.add_subplot(111)# equivalent but more generalfig.add_subplot(1,1,1)# add subplot with red backgroundfig.add_subplot(212, facecolor='r')# add a

2017-07-20 13:39:27 6071

原创 matplotlib基础——pyplot.figure()

matplotlib.pyplot.figure(num=None, figsize=None, dpi=None, facecolor=None, edgecolor=None, frameon=True, FigureClass=<class 'matplotlib.figure.Figure'>, **kwargs)Creates a new figure.生成一个新的图像Parameters

2017-07-20 13:36:05 5771

原创 numpy基础——关于 ndarray 的一些尝试

In [1]: import numpy as npIn [3]: a_Mat = np.array([1,1],[1,1],[1,1])---------------------------------------------------------------------------ValueError Traceback (mo

2017-07-20 13:07:58 497

原创 Python基础——read(),readline(),readlines()的区别

"""关于read()方法:1、读取整个文件,将文件内容放到一个字符串变量中2、如果文件大于可用内存,不可能使用这种处理"""file_object = open("test.py",'r') #创建一个文件对象,也是一个可迭代对象try: all_the_text = file_object.read() #结果为str类型 print type(all_the_te

2017-07-20 12:15:43 621

原创 numpy基础——numpy.sum

numpy.sumnumpy.sum(a, axis=None, dtype=None, out=None, keepdims=Parameters:a : array_like Elements to sum.axis : None or int or tuple of ints, optional Axis or axes along which a sum is performed. Th

2017-07-20 01:35:51 1577

原创 numpy基础——numpy.tile

numpy.tilenumpy.tile(A, reps)Construct an array by repeating A the number of times given by reps.构造一个数组,通过重复数组 A,重复的次数由 reps 给出。If reps has length d, the result will have dimension of max(d, A.ndim).If

2017-07-20 01:20:24 497

原创 numpy基础——numpy.argsort

numpy.argsortnumpy.argsort(a, axis=-1, kind=’quicksort’, order=None)Returns the indices that would sort an array. 返回排序数组的索引。Perform an indirect sort along the given axis using the algorithm specified

2017-07-20 01:13:59 569

原创 Python基础—— dict.get() 与 dict['key'] 的区别

In [1]: a = {'name': 'wang'}In [2]: a.get('age')In [3]: a['age']---------------------------------------------------------------------------KeyError Traceback (most re

2017-07-20 01:04:01 924

原创 numpy基础——ndarray.shape

numpy.ndarray.shapendarray.shapeTuple of array dimensions.获得数组维度的 tupleNotesMay be used to “reshape” the array, as long as this would not require a change in the total number of elementsExamples>>> x =

2017-07-20 01:02:08 7751

原创 Python基础——使字典按照 items 的大小进行排序

In [12]: my_dict={'B': 2, 'A': 1}In [13]: my_dict.keys()Out[13]: dict_keys(['B', 'A'])In [14]: my_dict.items()Out[14]: dict_items([('B', 2), ('A', 1)])In [15]: sorted(my_dict.items())Out[15]: [('A',

2017-07-20 00:57:34 1254

原创 集体智慧编程学习笔记(1)——机器学习定义

机器学习是人工智能领域中与算法相关的一个子领域,它允许计算机不断地进行学习。大多数情况下,这相当于将一组数据传递给算法,并由算法推断出与这些数据的属性相关的信息——借助这些信息,算法就能够预测出未来有可能会出现的其他数据。因为几乎所有的非随机数据中,都会包含这样或者那样的模式(patterns),这些模式的存在使机器得意据此进行归纳。为了实现归纳,机器会利用它所认定的出现于数据中的重要特征对数据进行

2017-07-15 22:38:18 441

原创 Python正则表达式学习(6)—— 匹配中文字符

[\u4E00-\u9FA5]unicode 写法此区间的字符均为汉字

2017-07-15 21:59:27 899

原创 Python爬虫知识(1)——scrapy vs requests+BeautifulSoup

scrapy vs requests+BeautifulSoup1、requests 和 beautifulsoup 都是库,而 scrapy 是框架2、scrapy 框架中可以加入 requests 和 beautifulsoup3、scrapy 基于 twisted,性能是最大优势4、scrapy 方便扩展,提供了很多内置的功能5、scrapy 内置的 css 和 xpath selector

2017-07-15 21:43:23 1445

原创 MIT线性代数学习(1)——求解线性方程组

笔记和习题

2017-07-11 11:09:06 505

原创 linux 下的 C语言编程学习(1)

编写完上面的代码后,你需要做的就是两个步骤: 1、输入 gcc hello.c -o hello; 2、输入./hello。如果一切正常的话,此时你应该会在屏幕上看到一行hello的打印。 如果你看到了,那么恭喜你,你已经可以开始linux的c语言编程之旅了。 linux下的C语言开发

2017-07-06 13:25:47 741

原创 vim 命令基础学习(1)——清空文件内容,显示行号,跳转到指定行

1 清空一个文件中的内容,不仅仅是修改 切换到命令行模式 :1,$d2 vim 下显示行号 按 Esc 切换到命令行模式,输入 : :set nu3 跳转到指定行 输入: :行号然后回车即可

2017-07-06 13:22:47 464

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除