这段时间看了一些大型的matlabproject文件(如:faster r-cnn),对于project中常常要用到的一些函数进行一个总结。

1、路径问题。

这主要涵括文件路径的包括和组合。

curdir = fileparts(mfilename('fullpath'));
addpath(genpath(fullfile(curdir, 'utils')));
mkdir_if_missing(fullfile(curdir, 'utils'));
caffe_path = fullfile(curdir, 'external', 'caffe', 'matlab');
if exist(caffe_path, 'dir') == 0
error('matcaffe is missing from external/caffe/matlab; See README.md');
end

我们常常须要引用不同目录下的文件或是函数。

mfilename 表示正在执行的函数的路径

fileparts 则返回文件上层的目录路径

fullfile 则返回组合文件的全路径

genpath 递归的产生该目录下的全部文件的路径

addpath 路径增加到函数或文件搜索的范围内

exist 查看路径是否存在

mkdir_if_missing 如果不存在就创建相应的目录

dirpath = '/home/Deeplearning';
filepath = [dirpath, '/%s.txt'];
for i=1:10
filepath_real = sprintf(filepath, num2str(i));
end

这时路径组合中常常出现的情况

用[]拼接通用路径,详细情况时再增加须要修改的部分。需修改的部分在拼接通用路径时预留

2、查找和排序

[B,I] = sort(A,mode,dim)

A为输入矩阵或向量,mode为排序的模式,升序还是降序,dim表示按第几维进行排序;B为排序后的矩阵或向量,I为排序后的各元素的序号。

X = [3 2 0; -5 0 7; 0 0 1]
[row,col,v] = find(X>1)

X>1为条件,即矩阵X中元素大小比1大的元素。row,col, v分别为返回的元素的位置横、纵坐标、元素本身。

3、随机过程与函数

randi ,random等

4、维度转换

A = [1 2; 3 4]; permute(A,[2 1])
ans =
1 3
2 4

squeeze移除掉多余的某一纬度

Create a 2-by-1-by-3 array and remove the singleton column dimension to form a 2-by-3 matrix.
y = rand(2,1,3)
z = squeeze(y)
y(:,:,1) =
0.8147
0.9058
y(:,:,2) =
0.1270
0.9134
y(:,:,3) = 0.6324
0.0975
z = 0.8147 0.1270 0.6324
0.9058 0.9134 0.0975

5、绘图

plot , subplot, figure, meshgrid等

对于如何在一幅图片中的指定位置增加文字和标注可參考我的上一篇博文http://blog.csdn.net/sunnyxiaohu/article/details/51150430

中 function showboxes(im, boxes, legends, color_conf)的解析。

6、数据的转换

round:

Round to nearest decimal or intege

这个在处理数据时非常实用

cell2mat:

num2str, str2num

cat(1,some_cell);

unique();

这些函数在进行各种格式之间的数据转换用的非常多,能够自行查阅文档。

matlab中常常强调向量化编程,这样能加快执行的速度。那么对于array或者cell。我们如何尽量的少使用for循环而用向量化编程呢?

A = randi(10,4,2)%如果你有4组数据,每一组数据有2维。你须要对每组数据进行某个处理

     7     7
8 2
8 8
4 1
A_cell = num2cell(A,2)%先将其按行转化为cell [1x2 double]
[1x2 double]
[1x2 double]
[1x2 double]
y_hat = cellfun(@(x) (x.*10) ,A_cell, 'UniformOutput', false)%这样就可用cellfun进行向量化处理了
[1x2 double]
[1x2 double]
[1x2 double]
[1x2 double]
%处理完毕之后,又变换回原来的格式
y = cat(1,y_hat{:})
70 70
80 20
80 80
40 10

7、文档的读写

这里主要讲三种

[gtids,t]=textread(sprintf(VOCopts.imgsetpath,VOCopts.testset),'%s %d');

[A,B,C,...] = textread(filename,format)
[A,B,C,...] = textread(filename,format,N)
[...] = textread(...,param,value,...)

对于txt文件的读取。用textread基本就已经够用了,这里面有非常多个參数可选,自己琢磨一下。

对于图片的读取,用imread()就可以,更详细的在图片上进行操作可參考我的上一篇博文中的showbox()

图片的保存主要解说这两种:

1、print(gcf,'-djpeg',filename,);
2、saveas(gcf,filename,filetype);

对于xml文件的读取:

xmlwrite();
xmlread();
这里有一个文档可供參考。讲得非常详细。

%% Tutorial for xml_io_tools Package

% By Jarek Tuszynski

%

% Package xml_io_tools can read XML files into MATLAB struct and writes

% MATLAB data types to XML files with help of simple interface to

% MATLAB’s xmlwrite and xmlread functions.

%

% Two function to simplify reading and writing XML files from MATLAB:

%

% * Function xml_read first calls MATLAB’s xmlread function and than

% converts its output (‘Document Object Model’ tree of Java objects)

% to tree of MATLAB struct’s. The output is in the format of nested

% structs and cells. In the output data structure field names are based on

% XML tags.

%

% * Function xml_write first convert input tree of MATLAB structs and cells

% and other types to tree of ‘Document Object Model’ nodes, and then writes

% resulting object to XML file using MATLAB’s xmlwrite function. .

%

%% This package can:

% * Read most XML files, created inside and outside of MATLAB environment,

% and convert them to MATLAB data structures.

% * Write any MATLAB’s struct tree to XML file

% * Handle XML attributes and special XML nodes like comments, processing

% instructions and CDATA sections

% * Supports base64 encoding and decoding to allow handling embeded binary

% data

% * Be studied, modified, customized, rewritten and used in other packages

% without any limitations. All code is included and documented. Software

% is distributed under BSD Licence (included).

%

%% This package does not:

% * Guarantee to recover the same Matlab objects that were saved. If you

% need to be able to recover carbon copy of the structure that was saved

% than you will have to use one of the packages that uses special set of

% tags saved as xml attributes that help to guide the parsing of XML code.

% This package does not use those tags.

% * Guarantee to work with older versions of MATLAB. Functions do not work

% with versions of MATLAB prior to 7.1 (26-Jul-2005).

%

%% Change History

% * 2006-11-06 - original version

% * 2006-11-26 - corrected xml_write to handle writing Matlab’s column

% arrays to xml files. Bug discovered and diagnosed by Kalyan Dutta.

% * 2006-11-28 - made changes to handle special node types like:

% COMMENTS and CDATA sections

% * 2007-03-12 - Writing CDATA sections still did not worked. The problem

% was diagnosed and fixed by Alberto Amaro. The fix involved rewriting

% xmlwrite to use Apache Xerces java files directly instead of MATLAB’s

% XMLUtils java class.

% * 2007-06-21 - Fixed problem reported by Anna Kelbert in Reviews about

% not writing attributes of ROOT node. Also: added support for Processing

% Instructions, added support for global text nodes: Processing

% Instructions and comments, allowed writing tag names with special

% characters

% * 2007-07-20 - Added tutorial script file. Extended support for global

% text nodes. Added more Preference fields.

% * 2008-01-23 - Fixed problem reported by Anna Krewet of converting dates

% in format ‘2007-01-01’ to numbers. Improved and added warning messages.

% Added detection of old Matlab versions incompatible with the library.

% Expanded documentation.

% * 2008-06-23 - Fixed problem with writing 1D array reported by Mark Neil.

% Extended xml_read’s Pref.Num2Str to 3 settings (never, smart and always)

% for better control. Added parameter Pref.KeepNS for keeping or ignoring

% namespace data when reading. Fixed a bug related to writing 2D cell

% arrays brought up by Andrej’s Mosat review.

% * 2008-09-11 - Resubmitting last upload - zip file is still old

% * 2009-02-26 - Small changes. More error handling. More robust in case of

% large binary objects. Added support for Base64 encoding/decoding of

% binary objects (using functions by Peter J. Acklam).

% * 2009-06-26 - changes to xml_read: added CellItem parameter to allow

% better control of reading files with ‘item’ notation (see comment by

% Shlomi); changed try-catch statements so xml_read would work for mablab

% versions prior to 7.5 (see Thomas Pilutti comment)

% * 2009-12-03 - added PreserveSpace parameter for contolling empty string

% handling as suggested by Sebastiaan. Fix suggested by Michael Murphy.

% Fixed number recognition code as suggested by Yuan Ren.

% * 2010-05-04 - implemented fixes suggested by Dylan Reynolds from Airbus.

% * 2010-07-28 - implemented support for 2D arrays of cells and structs

% suggested by Rodney Behn from MIT Lincoln Laboratory. Also attempted

% large scale cleanup of xml_write function

% * 2010-08-18 - minor extension to allow better handling of logical

% scalars and arrays and function handles suggested by Andreas Richter

% and others

% * 2010-09-20 - allow reading and writing of sparse matrices. Improve

% reading of 1D boolean arrays.

% * 2010-11-05 - Fix problem with empty cells reported by Richard Cotton;

% fixed issues with reading boolean arrays reported by Zohar Bar-Yehuda;

% Improved speed of base64 coding and decoding by switching to java based

% code.

%% Licence

% The package is distributed under BSD License

format compact; % viewing preference

clear variables;

type(‘license.txt’)

%% Write XML file based on a Struct using “xml_write”

% Any MATLAB data struct can be saved to XML file.

MyTree=[];

MyTree.MyNumber = 13;

MyTree.MyString = ‘Hello World’;

xml_write(‘test.xml’, MyTree);

type(‘test.xml’)

%% Read XML file producing a Struct using “xml_read”

[tree treeName] = xml_read (‘test.xml’);

disp([treeName{1} ’ =’])

gen_object_display(tree)

%% “Pref.XmlEngine” flag in “xml_write”

% Occasionaly some operations are performed better by Apache Xerces XML

% engine than default xmlread function. That is why xml_write provide an

% option for choosing the underlaying xml engine. Code below performs the

% same operation as the previous section but using Apache Xerces XML engine.

% Notice that in this case name of root element

% was passed as variable and not extracted from the variable name.

% Pref=[]; Pref.XmlEngine = ‘Xerces’; % use Xerces xml generator directly

% xml_write(‘test.xml’, MyTree, ‘TreeOfMine’, Pref);

% type(‘test.xml’)

%

% %% Writing Struct with different type MATLAB arrays

% MyTree=[];

% MyTree.Empty = []; % Empty variable

% MyTree.Num_1x1 = 13; % simple scalar

% MyTree.Vec_1x3 = [1 2 3]; % horizontal vector

% MyTree.Vec_4x1 = [1; 2; 3; 4]; % vertical vector

% MyTree.Mat_2x2 = [1, 2; 3, 4]; % 2D matrix

% MyTree.Cube_3D = reshape(1:8,[2 2 2]); % 3D array

% MyTree.String1 = ‘[2003 10 30]’; % number string with [] brackets

% MyTree.String2 = ’ 2003 10 30 ‘; % number string without [] brackets

% MyTree.Logical_1x1 = false; % single logical

% MyTree.Logical_2x2 = [false, true; true, false]; % 2D matrix of logicals

% MyTree.Logical_Str = ‘False False True True’;

% MyTree.Int_2x2 = uint8([1 2;3 4]); % 2D matrix of uint8 integers

% MyTree.Complex_1x1 = complex(1, 7); % complex scalar

% MyTree.Complex_2x2 = complex([1 2;3 4],[2 2;7 7]); % 2D matrix of complex numbers

% MyTree.Sparse_9x9 = sparse(1:9,1:9,1); % sparse 9x9 matrix

% MyTree.Function = @sum; % function handle

% xml_write(‘test.xml’, MyTree);

% type(‘test.xml’)

%

% %% Read Struct with MATLAB arrays

% % Notice that ‘Cube_3D’ did not preserve original dimentions

% [tree treeName] = xml_read (‘test.xml’);

% disp([treeName{1} ’ =’])

% gen_object_display(tree)

%

% %% “Pref.StructItem” flag in “xml_write” (controls 1D arrays of structs)

% % Create a simple structure with 1D array of struct’s

MyTree = [];

MyTree.a(1).b = ‘jack’;

MyTree.a(2).b = ‘john’;

gen_object_display(MyTree)

%%

% *Write XML with “StructItem = true” (default). Notice single ‘a’

% section and multiple ‘item’ sub-sections. Those subsections are used

% to store array elements*

wPref.StructItem = true;

xml_write(‘test.xml’, MyTree, ‘MyTree’,wPref);

type(‘test.xml’)

fprintf(‘\nxml_read output:\n’)

gen_object_display(xml_read (‘test.xml’))

%%

% Write XML with “StructItem = false”. Notice multiple ‘a’ sections

wPref.StructItem = false;

xml_write(‘test.xml’, MyTree, ‘MyTree’,wPref);

type(‘test.xml’)

fprintf(‘\nxml_read output:\n’)

gen_object_display(xml_read (‘test.xml’))

%%

% Notice that xml_read function produced the same struct when reading both files

%%

% Potential problems with “StructItem = true”:

wPref.StructItem = true;

MyTree1 = []; MyTree1.a.b = ‘jack’;

MyTree2 = []; MyTree2.a(1).b = ‘jack’;

MyTree3 = []; MyTree3.a(2).b = ‘jack’;

xml_write(‘test.xml’, MyTree1, [], wPref); type(‘test.xml’);

xml_write(‘test.xml’, MyTree2, [], wPref); type(‘test.xml’);

xml_write(‘test.xml’, MyTree3, [], wPref); type(‘test.xml’);

%%

% *Notice that MyTree1 and MyTree2 produce identical files with no ‘items’,

% while MyTree2 and MyTree3 produce very different file structures. It was

% pointed out to me that files produced from MyTree2 and MyTree3 can not

% belong to the same schema, which can be a problem. The solution is to use

% cells.*

wPref.CellItem = true;

wPref.NoCells = true;

MyTree2 = []; MyTree2.a{1}.b = ‘jack’;

MyTree3 = []; MyTree3.a{2}.b = ‘jack’;

xml_write(‘test.xml’, MyTree2, [], wPref); type(‘test.xml’);

xml_write(‘test.xml’, MyTree3, [], wPref); type(‘test.xml’);

%% “Pref.CellItem” flag in “xml_write” (controls 1D arrays of cells)

% Create a simple structure with cell arrays

MyTree = [];

MyTree.a = {‘jack’, ‘john’};

disp(MyTree)

%%

% *Write XML with “CellItem = true” (default). Notice single ‘a’

% section and multiple ‘item’ sections*

Pref=[]; Pref.CellItem = true;

xml_write(‘test.xml’, MyTree, ‘MyTree’,Pref);

type(‘test.xml’)

fprintf(‘\nxml_read output:\n’);

disp(xml_read (‘test.xml’))

%%

% Write XML with “CellItem = false”. Notice multiple ‘a’ sections

Pref=[]; Pref.CellItem = false;

xml_write(‘test.xml’, MyTree, ‘MyTree’,Pref);

type(‘test.xml’)

fprintf(‘\nxml_read output:\n’);

disp(xml_read (‘test.xml’))

%%

% Notice that xml_read function produced the same struct when reading both files

%% “Pref.NoCells” flag in “xml_read”

% Create a cell/struct mixture object

MyTree = [];

MyTree.a{1}.b = ‘jack’;

MyTree.a{2}.b = [];

MyTree.a{2}.c = ‘john’;

gen_object_display(MyTree);

%%

% Save it to xml file

Pref=[]; Pref.CellItem = false;

xml_write(‘test.xml’, MyTree, ‘MyTree’,Pref);

type(‘test.xml’)

%%

% Read above file with “Pref.NoCells=true” (default) - output is quite different then input

% By default program is trying to convert everything to struct’s and arrays

% of structs. In case arrays of structs all the structs in array need to have the

% same fields, and if they are not than MATLAB creates empty fields.

Pref=[]; Pref.NoCells=true;

gen_object_display(xml_read(‘test.xml’, Pref))

%%

% Read above file with “Pref.NoCells=false” - now input and output are the same

% Cell arrays of structs allow structs in array to have different fields.

Pref=[]; Pref.NoCells=false;

gen_object_display(xml_read(‘test.xml’, Pref))

%% “Pref.ItemName” flag in “xml_write” (customize 1D arrays of structs and cells)

% Create a cell/struct mixture object

MyTree = [];

MyTree.a{1}.b = ‘jack’;

MyTree.a{2}.c = ‘john’;

gen_object_display(MyTree);

%%

% Save it to xml file, using ‘item’ notation but with different name

Pref=[];

Pref.CellItem = true;

Pref.ItemName = ‘MyItem’;

xml_write(‘test.xml’, MyTree, ‘MyTree’,Pref);

type(‘test.xml’)

%% “Pref.ItemName” flag in “xml_read”

% Read above file with default settings (“Pref.ItemName = ‘item’”)

% The results do not match the original structure

Pref=[]; Pref.NoCells = false;

gen_object_display(xml_read(‘test.xml’, Pref))

%%

% *Read above file with “Pref.ItemName = ‘MyItem’” - now saved and read

% MATLAB structures are the same*

Pref=[];

Pref.ItemName = ‘MyItem’;

Pref.NoCells = false;

gen_object_display(xml_read(‘test.xml’, Pref))

%% “Pref.CellItem” flag in “xml_read”

% “Pref.ItemName” is used to create xml files with clearly marked arrays

% “Pref.CellItem” flag in “xml_read” ensures that they are always read as

% arrays by forcing output to stay in cell format. In cell format s{1} is

% different than s, while s(1) is indistinguishable from s.

%%

% Create a test file

MyTree = [];

MyTree.a1{1}.b = ‘jack’; % a1 - single struct

MyTree.a2{1}.b = ‘jack’; % a2 - cell array of structs with the same fields

MyTree.a2{2}.b = ‘john’;

MyTree.a3{1}.b = ‘jack’; % a3 - cell array of structs with the different fields

MyTree.a3{2}.c = ‘john’;

Pref=[];

Pref.CellItem = true;

Pref.Debug = true;

xml_write(‘test.xml’, MyTree, ‘MyTree’,Pref);

type(‘test.xml’)

%%

% Read above file with “Pref.CellItem = true” (default)

% All outputs are in cell format

Pref=[];

Pref.NoCells = false; % allow cell output

Pref.CellItem = true; % keep ‘item’ arrays as cells

gen_object_display(xml_read(‘test.xml’, Pref))

%%

% Read above file with “Pref.CellItem = false”

% Outputs format is determined by content

Pref=[];

Pref.NoCells = false; % allow cell output

Pref.CellItem = false; % allow ‘item’ arrays to beheave like other fields

gen_object_display(xml_read(‘test.xml’, Pref))

%%

% Read above file with “Pref.CellItem = false” and “Pref.NoCells = true”

% All outputs are in struct format

Pref=[];

Pref.NoCells = true; % don’t allow cell output

Pref.CellItem = false; % allow ‘item’ arrays to beheave like other fields

gen_object_display(xml_read(‘test.xml’, Pref))

%% “Pref.CellTable” flag in “xml_write” (controls 2D arrays of cells)

% Create a structure with 2D arrays of cells

MyTree = [];

MyTree.M = {[1,2;3,4], ‘M12’; struct(‘a’,’jack’), {11, ‘N12’; 21, ‘N22’}};

gen_object_display(MyTree)

%%

% *Write XML with “CellTable = ‘Html” (default). This option mimics use of

% HTML “tr” and “td” tags to encode 2D tables. Tag names can

% be changed using TableName parameter (see below)*

wPref = [];

wPref.CellTable = ‘Html’;

xml_write(‘test.xml’, MyTree, ‘MyTree’,wPref);

type(‘test.xml’)

fprintf(‘\nxml_read output:\n’)

rPref=[]; rPref.NoCells=false;

gen_object_display(xml_read(‘test.xml’, rPref))

%%

% Write XML with “CellTable = ‘Vector’”.

% Converts 2D arrays to 1D array and item or regular notation. This option

% is mostly provided for backward compatibility since this was the

% behavior in prior verions of the code

wPref = [];

wPref.CellTable = ‘Vector’;

xml_write(‘test.xml’, MyTree, ‘MyTree’,wPref);

type(‘test.xml’)

fprintf(‘\nxml_read output:\n’)

rPref=[]; rPref.NoCells=false;

gen_object_display(xml_read(‘test.xml’, rPref))

%%

% Create a simpler structure without struct’s

MyTree = [];

MyTree.M = {[1,2;3,4], ‘M12’; ‘M21’, {11, ‘N12’; 21, ‘N22’}};

gen_object_display(MyTree)

%%

% *Write XML with “CellTable = ‘Matlab”. This option encodes tables

% consisting of numbers, strings and other cell arrays as MATLAB command

% string. Unlike ‘Html’ option it does not work if one of the cells is

% a struct*

wPref = [];

wPref.CellTable = ‘Matlab’;

xml_write(‘test.xml’, MyTree, ‘MyTree’,wPref);

type(‘test.xml’)

fprintf(‘\nxml_read output:\n’)

rPref=[]; rPref.NoCells=false;

gen_object_display(xml_read(‘test.xml’, rPref))

%% Write 2D cell array in HTML format

MyTree = [];

MyTree.table.ATTRIBUTE.border=1;

MyTree.table.CONTENT = {‘Apples’, ‘44%’; ‘Bannanas’, ‘23%’; ‘Oranges’, ‘13%’; ‘Other’, ‘10%’};

xml_write(‘html/test.html’, MyTree);

type(‘html/test.html’)

%%

% Click on

matlab实战中一些重要的函数总结的更多相关文章

  1. 使用axes函数在matlab绘图中实现图中图的绘制

    使用axes函数在matlab绘图中实现图中图的绘制 有时为了对细节进行详细说明,需要在一个较大坐标轴上绘制一个小图来对局部进行放大以阐述结果. 这可以通过调用axes函数实现. 下面通过绘制 y=1 ...

  2. Matlab GUI设计中的一些常用函数

    Matlab GUI常用函数总结 % — 文件的打开.读取和关闭% — 文件的保存% — 创建一个进度条% — 在名为display的axes显示图像,然后关闭% — 把数字转化为时间格式% — ch ...

  3. MATLAB中trapz和cumtrapz函数

    这两个函数都是MATLAB中的内置函数,是基于梯形法则的数值积分公式 例如我们有函数y=x^3-2x-3,为了计算在[0,1]上的积分,可以这么做: 其中x和y分别是自变量和对应的值,trapz其实就 ...

  4. MATLAB中“repmat”与“cat”函数的用法

    MATLAB中“repmat”与“cat”函数的用法 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 1. repmat函数 >> z=re ...

  5. matlab中的输出显示函数

    matlab中的输出显示函数 在matlab中使用的显示函数有disp.sprintf.fprintf比较常用.下面来介绍一下他们的用法. 1.disp()函数: disp(x)主要是用来输出变量x的 ...

  6. JavaScript基础&实战(4)js中的对象、函数、全局作用域和局部作用域

    文章目录 1.对象的简介 2.对象的基本操作 2.1 代码 2.2 测试结果 3.属性和属性值 3.1 代码 3.2 测试结果 4.对象的方法 4.1 代码 4.2 测试结果 5.对象字面量 5.1 ...

  7. numpy函数库中一些经常使用函数的记录

    ##numpy函数库中一些经常使用函数的记录 近期才開始接触python,python中为我们提供了大量的库,不太熟悉.因此在<机器学习实战>的学习中,对遇到的一些函数的使用方法进行记录. ...

  8. 《量化投资:以MATLAB为工具》连载(2)基础篇-N分钟学会MATLAB(中)

    http://www.matlabsky.com/thread-43937-1-1.html   <量化投资:以MATLAB为工具>连载(3)基础篇-N分钟学会MATLAB(下)     ...

  9. [转]matlab语言中的assert断言函数

    MATLAB语言没有系统的断言函数,但有错误报告函数 error 和 warning.由于要求对参数的保护,需要对输入参数或处理过程中的一些状态进行判断,判断程序能否/是否需要继续执行.在matlab ...

随机推荐

  1. 都是 htmlspecialchars的错,解决 织梦cms dedecms 标题不能为空 不支持php5.3 php5.4 php5.5版本

    article_add.php  101行 $title = htmlspecialchars(cn_substrR($title,$cfg_title_maxlen)); 改成 $title = h ...

  2. 【J2SE高速进阶】——多线程之synchronized

    我和老婆去银行取钱 有一天,和老婆打了个赌.如今我的银行账号里共同拥有5000块钱.我们去银行同一时候取钱,看我俩能不能同一时候取出5000来....(PS:打赌的代价是:假设都能取出5000,那这1 ...

  3. 【GLSL教程】(四)shder的简单示例 【转】

    http://blog.csdn.net/racehorse/article/details/6638455 GLSL的Hello World 这一节中包含一个最基本的shader,它提供如下功能:顶 ...

  4. CentOS下配置iptables防火墙 linux NAT(iptables)配置

    CentOS下配置防火墙 配置nat转发服务CentOS下配置iptables防火墙 linux NAT(iptables)配置 CentOS下配置iptables 1,vim /etc/syscon ...

  5. 一波三折ST-Link

    前言 原创文章,转载引用务必注明链接,水平有限,如有疏漏,欢迎指正. 本文使用Markdown写成,为获得更好的阅读体验和正常的链接.图片显示,请访问我的博客原文: http://www.cnblog ...

  6. Nginx配置文档具体解释

    Nginx的配置文档具体解释.在这儿做个总结,以便以后使用的时间查看. 下面大部分自己整理.部分来自參考 #设置用户 #user  nobody; #启动进程数(一般和server的CPU同样) #能 ...

  7. 以其他字段作为某一字段的值. 字段长度char_length(?)

    UPDATE t_dealer a INNER JOIN t_dealer b ON a.id=b.id SET a.zihao=b.shortName where a.zihao is null o ...

  8. Node.js 把抓取到的电影节目列表单发或者群发到QQ邮箱

    代码地址如下:http://www.demodashi.com/demo/12381.html 一.前言 上一节我们演示了如何用Node的各种包去抓取电影天堂最新电影列表,接下来我们会讲解如何发送我们 ...

  9. Nook 2 Root

        最后我还是忍不住root了它,用了差一点够一个月 1.备份2.root 3.装软件=====================================================1. ...

  10. Leetcode Array 4 Median of Two Sorted Arrays

    做leetcode题目的第二天,我是按照分类来做的,做的第一类是Array类,碰见的第二道题目,也就是今天做的这个,题目难度为hard.题目不难理解,但是要求到了时间复杂度,就需要好好考虑使用一下算法 ...