RotateZoom.cpp 20180622
20180622代码加入随意变换图像大小
批处理框架先不看:-B src3.bmp 10 1 30 2 0.1 3 tar.bmp
src2.bmp 37.5 2.1 tar
// RotateZoom.cpp : Defines the entry point for the console application.
// #include "stdafx.h"
#include "RotateZoom.h" #ifdef _DEBUG
#define new DEBUG_NEW
#endif
#include <atlimage.h>
#include <locale.h> // The one and only application object CWinApp theApp; using namespace std;
//双三次插值系数
double fs(double w)
{
double a=-0.5;
double fs;
if (abs(w)<=)
fs=(a+)*pow(abs(w),)-(a+)*pow(abs(w),)+;
else if (abs(w)>&&abs(w)<=)
fs=a*pow(abs(w),)-*a*pow(abs(w),)+*a*abs(w)-*a;
else
fs=;
return fs;
} HRESULT RotateZoom(PBYTE pbSrc,int iWidth,int iHeight,double dbRotate,double dbZoom,PBYTE pbTag);
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = ; setlocale(LC_ALL,"chs");
HMODULE hModule = ::GetModuleHandle(NULL);
if (hModule != NULL)
{
// initialize MFC and print and error on failure
CImage cImage;
HRESULT hResult;
int iWidth,iHeight,iBytePerPixel,iPitch;
int x,y;
PBYTE pbSrc=NULL,pbTag=NULL;
PBYTE pbImage=NULL;
PDWORD pdwImage=NULL;
double dbRotate=,dbZoom=;
do{
if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), ))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = ;
break;
}
// TODO: code your application's behavior here.
if(argc<)
{
_tprintf(_T("使用方法:RotateZoom 源图像文件 旋转角度 缩放倍数 输出文件\n"));
nRetCode= -;
break;
} _stscanf(argv[],_T("%lf"),&dbRotate);
_stscanf(argv[],_T("%lf"),&dbZoom);
if(!((dbRotate>= && dbRotate<) && (dbZoom>=0.25 && dbZoom<=)))
{
_tprintf(_T("“旋转角度” 或 “缩放倍数”参数错误!\n"));
nRetCode= -;
break;
} hResult=cImage.Load(argv[]);
if(hResult!=ERROR_SUCCESS)
{
_tprintf(_T("源图像文件名错误!\n"));
nRetCode= -;
break;
} iWidth=cImage.GetWidth();
iHeight=cImage.GetHeight();
pbSrc = (PBYTE)malloc(iWidth*iHeight);//存原图数据大小没问题
if(dbZoom>) pbTag = (PBYTE)malloc(ceil(iWidth*dbZoom)*ceil(iHeight*dbZoom));
else pbTag = (PBYTE)malloc(iWidth*iHeight);
if(pbSrc==NULL || pbTag==NULL )
{
_tprintf(_T("内存申请错误!\n"));
nRetCode= -;
break;
}
iPitch=cImage.GetPitch();
iBytePerPixel=(cImage.GetBPP()+)/;
if(iBytePerPixel==)
{
for(y=;y<iHeight;y++)
{
pbImage=(PBYTE)(PBYTE(cImage.GetBits())+iPitch*y);//得到的是图像初始像素地址
for(x=;x<iWidth;x++)
{
//pbSrc[y*iWidth+x]=pbImage[3*x]; //B
//pbSrc[y*iWidth+x]=pbImage[3*x+1]; //G
//pbSrc[y*iWidth+x]=pbImage[3*x+2]; //R //pbSrc[y*iWidth+x]=pbImage[3*x];
//pbSrc[y*iWidth+x+1]=pbImage[3*x+1];
//pbSrc[y*iWidth+x+2]=pbImage[3*x+2]; pbSrc[y*iWidth+x]=(pbImage[*x]*0.15+pbImage[*x+]*0.55+pbImage[*x+]*0.3);//转换成灰度就是单个像素了,分配大小还是原来的?。
}
}
}
cImage.Destroy();
hResult=RotateZoom(pbSrc,iWidth,iHeight,dbRotate,dbZoom,pbTag);
if(hResult!=ERROR_SUCCESS)
{
_tprintf(_T("图像处理错误!\n"));
nRetCode= -;
break;
}
iWidth=ceil(iWidth*dbZoom);
iHeight=ceil(iHeight*dbZoom);
cImage.Create(iWidth,-iHeight,);
iPitch=cImage.GetPitch();
for(y=;y<iHeight;y++)
{
pdwImage=(PDWORD)(PBYTE(cImage.GetBits())+iPitch*y);
for(x=;x<iWidth;x++)
{
pdwImage[x]=pbTag[y*iWidth+x]*0x10101;
}
}
CString csTagName=argv[];
csTagName.Trim();
csTagName.MakeUpper();
if(csTagName.Right()!=_T(".BMP") ) csTagName.Append(_T(".BMP"));
hResult=cImage.Save(csTagName);
if(hResult!=ERROR_SUCCESS)
{
_tprintf(_T("图像结果保存错误!\n"));
nRetCode= -;
break;
}
_tprintf(_T("图像处理成功!\n"));
nRetCode= ERROR_SUCCESS;
break;
}while();
if(pbSrc) free(pbSrc);
if(pbTag) free(pbTag);
}
else
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: GetModuleHandle failed\n"));
nRetCode = ;
}
getchar();
return nRetCode;
}
HRESULT RotateZoom(PBYTE pbSrc,int iWidth,int iHeight,double dbRotate,double dbZoom,PBYTE pbTag)
{
int size;
if(dbZoom>)
{
size=iWidth*iHeight;
}
else
{
size=ceil(iWidth*dbZoom)*ceil(iHeight*dbZoom);
}
int newWidth=ceil(dbZoom*iWidth);
//旋转中心为图像中心
double rx0=ceil(dbZoom*iWidth)*0.5;
double ry0=ceil(dbZoom*iHeight)*0.5;
double srcx,srcy,u,v;
int xOr,yOr;
dbRotate=dbRotate*3.1415926/180.0;
for (int y=;y<ceil(dbZoom*iHeight);y++)
{
for (int x=;x<ceil(dbZoom*iWidth);x++)
{
srcx=(double)((x-rx0)*cos(dbRotate) - (y-ry0)*sin(dbRotate) + rx0) ;
srcy=(double)((x-rx0)*sin(dbRotate) + (y-ry0)*cos(dbRotate) + ry0) ;
srcx=srcx*/dbZoom;
srcy=srcy*/dbZoom;
xOr = floor(srcx);
yOr = floor(srcy);
u=srcx-xOr;
v=srcy-yOr;
/*if(u>0.5&&v>0.5)
{
xOr=xOr+1;
yOr=yOr+1;
}
else if(u>0.5&&v<0.5)
{
xOr=xOr+1;
yOr=yOr;
}
else if(u<0.5&&v>0.5)
{
xOr=xOr;
yOr=yOr+1;
}*/
// if( !(xOr-1>=0 && xOr+2<=iWidth && yOr-1>=0 && yOr+2<=iHeight))
int newWidth=ceil(dbZoom*iWidth);
if( !(srcx>= && srcx<=iWidth && srcy>= && srcy<=iHeight))
{
pbTag[y*newWidth+x]=;//
}
else
{
double middle=
pbSrc[(yOr-)*iWidth+(xOr-)]*fs(+u)*fs(+v)+
pbSrc[(yOr)*iWidth+(xOr-)]*fs(+u)*fs(v)+
pbSrc[(yOr+)*iWidth+(xOr-)]*fs(+u)*fs(-v)+
pbSrc[(yOr+)*iWidth+(xOr-)]*fs(+u)*fs(-v)+ pbSrc[(yOr-)*iWidth+(xOr)]*fs(u)*fs(+v)+
pbSrc[(yOr)*iWidth+(xOr)]*fs(u)*fs(v)+
pbSrc[(yOr+)*iWidth+(xOr)]*fs(u)*fs(-v)+
pbSrc[(yOr+)*iWidth+(xOr)]*fs(u)*fs(-v)+ pbSrc[(yOr-)*iWidth+(xOr+)]*fs(-u)*fs(+v)+
pbSrc[(yOr)*iWidth+(xOr+)]*fs(-u)*fs(v)+
pbSrc[(yOr+)*iWidth+(xOr+)]*fs(-u)*fs(-v)+
pbSrc[(yOr+)*iWidth+(xOr+)]*fs(-u)*fs(-v)+ pbSrc[(yOr-)*iWidth+(xOr+)]*fs(-u)*fs(+v)+
pbSrc[(yOr)*iWidth+(xOr+)]*fs(-u)*fs(v)+
pbSrc[(yOr+)*iWidth+(xOr+)]*fs(-u)*fs(-v)+
pbSrc[(yOr+)*iWidth+(xOr+)]*fs(-u)*fs(-v); if(middle<=&&middle>=)
pbTag[y*newWidth+x]=middle;
else if(middle>)
pbTag[y*newWidth+x]=;
else
pbTag[y*newWidth+x]=;
}
}
}
//memcpy(pbTag,pbSrc,size);
return ERROR_SUCCESS;
}
在批处理框架中:
// RotateZoom.cpp : Defines the entry point for the console application.
// #include "stdafx.h"
#include "RotateZoom.h" #ifdef _DEBUG
#define new DEBUG_NEW
#endif
#include <atlimage.h>
#include <locale.h> // The one and only application object CWinApp theApp; using namespace std;
//双三次插值系数
double fs(double w)
{
double a=-0.5;
double fs;
if (abs(w)<=)
fs=(a+)*pow(abs(w),)-(a+)*pow(abs(w),)+;
else if (abs(w)>&&abs(w)<=)
fs=a*pow(abs(w),)-*a*pow(abs(w),)+*a*abs(w)-*a;
else
fs=;
return fs;
} HRESULT RotateZoom(PBYTE pbSrc,int iWidth,int iHeight,double dbRotate,double dbZoom,PBYTE pbTag);
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = ; setlocale(LC_ALL,"chs");
HMODULE hModule = ::GetModuleHandle(NULL);
if (hModule != NULL)
{
// initialize MFC and print and error on failure
CImage cImage;
HRESULT hResult;
int iWidth,iHeight,iBytePerPixel,iPitch;
int i,j,x,y,w,h;
PBYTE pbSrc=NULL,pbTag=NULL;
PBYTE pbImage=NULL;
PDWORD pdwImage=NULL;
double dbRotate=,dbZoom=;
double dbRotateStart=,dbRotateEnd=,dbRotateStep;
double dbZoomStart=,dbZoomEnd=,dbZoomStep;
BOOL bBenchWork=FALSE;
CString csSrcName,csTagName,csNameRoot;
TCHAR *ptChar;
do{
if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), ))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = ;
break;
}
// TODO: code your application's behavior here.
if(argc!= && argc!= )
{
_tprintf(_T("使用方法:\n RotateZoom -S 源图像文件 旋转角度 缩放倍数 输出文件\n或:\n RotateZoom -B 源图像文件 旋转起始角度 步长 旋转终止角度 缩放起始倍数 步长 缩放终止倍数 输出文件\n"));
nRetCode= -;
break;
}
if(_tcsnicmp(argv[],_T("-B"),)==)
{
bBenchWork=TRUE;
}
else if(_tcsnicmp(argv[],_T("-S"),)==)
{
bBenchWork=FALSE;
}
else
{
_tprintf(_T("使用方法:\n RotateZoom -S 源图像文件 旋转角度 缩放倍数 输出文件\n或:\nRotateZoom -B 源图像文件 旋转起始角度 步长 旋转终止角度 缩放起始倍数 步长 缩放终止倍数 输出文件\n"));
nRetCode= -;
break;
}
if(bBenchWork)
{
csSrcName=argv[];
_stscanf(argv[],_T("%lf"),&dbRotateStart);
_stscanf(argv[],_T("%lf"),&dbRotateStep);
_stscanf(argv[],_T("%lf"),&dbRotateEnd); _stscanf(argv[],_T("%lf"),&dbZoomStart);
_stscanf(argv[],_T("%lf"),&dbZoomStep);
_stscanf(argv[],_T("%lf"),&dbZoomEnd);
dbZoom=dbZoomStart>dbZoomEnd?dbZoomStart:dbZoomEnd;
csTagName=argv[];
if(!((dbRotateStart>= && dbRotateStart<) &&
(dbRotateEnd>= && dbRotateEnd<) &&
(dbZoomStart>=0.26 && dbZoomStart<=) &&
(dbZoomStart>=0.25 && dbZoomStart<=) &&
(dbRotateStep>=0.01) && (dbZoomEnd>=0.01)))
{
_tprintf(_T("旋转角度范围(0~360),缩放倍数范围(0.25~16),步长范围(>=0.01)。输入参数超出范围!\n"));
nRetCode= -;
break;
}
}
else
{
csSrcName=argv[];
_stscanf(argv[],_T("%lf"),&dbRotate);
_stscanf(argv[],_T("%lf"),&dbZoom);
csTagName=argv[];
if(!((dbRotate>= && dbRotate<) && (dbZoom>=0.25 && dbZoom<=)))
{
_tprintf(_T("旋转角度范围(0~360),缩放倍数范围(0.25~16)。输入参数超出范围!\n"));
nRetCode= -;
break;
}
} hResult=cImage.Load(csSrcName);
if(hResult!=ERROR_SUCCESS)
{
_tprintf(_T("源图像文件名错误!\n"));
nRetCode= -;
break;
} iWidth=cImage.GetWidth();
iHeight=cImage.GetHeight();
pbSrc = (PBYTE)malloc(iWidth*iHeight);//存原图数据大小没问题
if(dbZoom>) pbTag = (PBYTE)malloc(ceil(iWidth*dbZoom)*ceil(iHeight*dbZoom));
else pbTag = (PBYTE)malloc(iWidth*iHeight);
if(pbSrc==NULL || pbTag==NULL )
{
_tprintf(_T("内存申请错误!\n"));
nRetCode= -;
break;
}
iPitch=cImage.GetPitch();
iBytePerPixel=(cImage.GetBPP()+)/;
if(iBytePerPixel==)
{
for(y=;y<iHeight;y++)
{
pbImage=(PBYTE)(PBYTE(cImage.GetBits())+iPitch*y);//得到的是图像初始像素地址
for(x=;x<iWidth;x++)
{
pbSrc[y*iWidth+x]=(pbImage[*x]*0.15+pbImage[*x+]*0.55+pbImage[*x+]*0.3);//转换成灰度就是单个像素了,分配大小还是原来的?。
}
}
}
cImage.Destroy(); csTagName.Trim();
csTagName.MakeUpper();
if(bBenchWork)
{ if(csTagName.Right()!=_T(".BMP") ) csNameRoot=csTagName;
else csNameRoot=csTagName.Left (csTagName.GetLength()-);
j=;
for(dbZoom=dbZoomStart;dbZoom<=dbZoomEnd;dbZoom+=dbZoomStep)
{
w=ceil(iWidth*dbZoom);
h=ceil(iHeight*dbZoom);
cImage.Create(w,-h,);
iPitch=cImage.GetPitch();
for(dbRotate=dbRotateStart;dbRotate<=dbRotateEnd;dbRotate+=dbRotateStep)
{
hResult=RotateZoom(pbSrc,iWidth,iHeight,dbRotate,dbZoom,pbTag);
if(hResult!=ERROR_SUCCESS)
{
_tprintf(_T("图像处理错误!\n"));
nRetCode= -;
break;
} for(y=;y<h;y++)
{
pdwImage=(PDWORD)(PBYTE(cImage.GetBits())+iPitch*y);
for(x=;x<w;x++)
{
pdwImage[x]=pbTag[y*w+x]*0x10101;
}
}
csTagName=csNameRoot;
csTagName.AppendFormat(_T("_Z%05.2f_R%06.2f.BMP"),dbZoom,dbRotate);
hResult=cImage.Save(csTagName,Gdiplus::ImageFormatBMP);
if(hResult!=ERROR_SUCCESS)
{
_tprintf(_T("图像结果保存错误!\n"));
nRetCode= -;
break;
}
i=csTagName.GetLength();
ptChar=csTagName.GetBuffer(i+);
ptChar[i]=_T('\0');
_tprintf(_T("图像处理成功!%s\n"),ptChar);
csTagName.ReleaseBuffer();
nRetCode= ERROR_SUCCESS;
j++;
}
cImage.Destroy();
if(nRetCode!=ERROR_SUCCESS) break;
}
if(nRetCode==ERROR_SUCCESS) _tprintf(_T("批处理完成!共处理%d\n"),j);
else _tprintf(_T("批处理出错!已处理%d\n"),j);
}
else
{
hResult=RotateZoom(pbSrc,iWidth,iHeight,dbRotate,dbZoom,pbTag);
if(hResult!=ERROR_SUCCESS)
{
_tprintf(_T("图像处理错误!\n"));
nRetCode= -;
break;
}
iWidth=ceil(iWidth*dbZoom);
iHeight=ceil(iHeight*dbZoom);
cImage.Create(iWidth,-iHeight,);
iPitch=cImage.GetPitch();
for(y=;y<iHeight;y++)
{
pdwImage=(PDWORD)(PBYTE(cImage.GetBits())+iPitch*y);
for(x=;x<iWidth;x++)
{
pdwImage[x]=pbTag[y*iWidth+x]*0x10101;
}
}
if(csTagName.Right()!=_T(".BMP") ) csTagName.Append(_T(".BMP"));
hResult=cImage.Save(csTagName,Gdiplus::ImageFormatBMP);
if(hResult!=ERROR_SUCCESS)
{
_tprintf(_T("图像结果保存错误!\n"));
nRetCode= -;
break;
}
i=csTagName.GetLength();
ptChar=csTagName.GetBuffer(i+);
ptChar[i]=_T('\0');
_tprintf(_T("图像处理成功!%s\n"),ptChar);
csTagName.ReleaseBuffer();
nRetCode= ERROR_SUCCESS;
}
break;
}while();
if(pbSrc) free(pbSrc);
if(pbTag) free(pbTag);
}
else
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: GetModuleHandle failed\n"));
nRetCode = ;
}
_tprintf(_T("按任意键退出!"));
getchar();
return nRetCode;
}
HRESULT RotateZoom(PBYTE pbSrc,int iWidth,int iHeight,double dbRotate,double dbZoom,PBYTE pbTag)
{ int size;
if(dbZoom>)
{
size=iWidth*iHeight;
}
else
{
size=ceil(iWidth*dbZoom)*ceil(iHeight*dbZoom);
}
int newWidth=ceil(dbZoom*iWidth);
//旋转中心为图像中心
double rx0=ceil(dbZoom*iWidth)*0.5;
double ry0=ceil(dbZoom*iHeight)*0.5;
double srcx,srcy,u,v;
int xOr,yOr;
dbRotate=dbRotate*3.1415926/180.0;
for (int y=;y<ceil(dbZoom*iHeight);y++)
{
for (int x=;x<ceil(dbZoom*iWidth);x++)
{
srcx=(double)((x-rx0)*cos(dbRotate) - (y-ry0)*sin(dbRotate) + rx0) ;
srcy=(double)((x-rx0)*sin(dbRotate) + (y-ry0)*cos(dbRotate) + ry0) ;
srcx=srcx*/dbZoom;
srcy=srcy*/dbZoom;
xOr = floor(srcx);
yOr = floor(srcy);
u=srcx-xOr;
v=srcy-yOr;
int newWidth=ceil(dbZoom*iWidth);
if( !(xOr->= && xOr+<=iWidth && yOr->= && yOr+<=iHeight))
{
pbTag[y*newWidth+x]=;//
}
else
{
double middle=
pbSrc[(yOr-)*iWidth+(xOr-)]*fs(+u)*fs(+v)+
pbSrc[(yOr)*iWidth+(xOr-)]*fs(+u)*fs(v)+
pbSrc[(yOr+)*iWidth+(xOr-)]*fs(+u)*fs(-v)+
pbSrc[(yOr+)*iWidth+(xOr-)]*fs(+u)*fs(-v)+ pbSrc[(yOr-)*iWidth+(xOr)]*fs(u)*fs(+v)+
pbSrc[(yOr)*iWidth+(xOr)]*fs(u)*fs(v)+
pbSrc[(yOr+)*iWidth+(xOr)]*fs(u)*fs(-v)+
pbSrc[(yOr+)*iWidth+(xOr)]*fs(u)*fs(-v)+ pbSrc[(yOr-)*iWidth+(xOr+)]*fs(-u)*fs(+v)+
pbSrc[(yOr)*iWidth+(xOr+)]*fs(-u)*fs(v)+
pbSrc[(yOr+)*iWidth+(xOr+)]*fs(-u)*fs(-v)+
pbSrc[(yOr+)*iWidth+(xOr+)]*fs(-u)*fs(-v)+ pbSrc[(yOr-)*iWidth+(xOr+)]*fs(-u)*fs(+v)+
pbSrc[(yOr)*iWidth+(xOr+)]*fs(-u)*fs(v)+
pbSrc[(yOr+)*iWidth+(xOr+)]*fs(-u)*fs(-v)+
pbSrc[(yOr+)*iWidth+(xOr+)]*fs(-u)*fs(-v); if(middle<=&&middle>=)
pbTag[y*newWidth+x]=middle;
else if(middle>)
pbTag[y*newWidth+x]=;
else
pbTag[y*newWidth+x]=;
}
}
}
//memcpy(pbTag,pbSrc,size);
return ERROR_SUCCESS;
}
RotateZoom.cpp 20180622的更多相关文章
- RotateZoom.cpp——Inter
// RotateZoom.cpp : Defines the entry point for the console application. // #include "stdafx.h& ...
- 使用“Cocos引擎”创建的cpp工程如何在VS中调试Cocos2d-x源码
前段时间Cocos2d-x更新了一个Cocos引擎,这是一个集合源码,IDE,Studio这一家老小的整合包,我们可以使用这个Cocos引擎来创建我们的项目. 在Cocos2d-x被整合到Cocos引 ...
- Json CPP 中文支持与入门示例
在每一个Json Cpp自带*.cpp文件头加上: #include "stdafx.h" 将Json Cpp对自带的头文件的引用修改为单引号方式,例如json_reader.cp ...
- cpp 调用python
在用cpp调用python时, 出现致命错误: no module named site , 原因解释器在搜索路径下没有找到python库.可以在调用Py_Initialize前,调用 Py_Se ...
- nginx+fastcgi+c/cpp
参考:http://github.tiankonguse.com/blog/2015/01/19/cgi-nginx-three/ 跟着做了一遍,然后根据记忆写的,不清楚有没错漏步骤,希望多多评论多多 ...
- APM程序分析-ArduCopter.cpp
该文件是APM的主文件. #define SCHED_TASK(func, rate_hz, max_time_micros) SCHED_TASK_CLASS(Copter, &copter ...
- APM程序分析-AC_WPNav.cpp
APM程序分析 主程序在ArduCopter.cpp的loop()函数. /// advance_wp_target_along_track - move target location along ...
- Dev Cpp 输出中文字符问题
最近 c++ 上机作业,vc++6.0 挂了没法用,只好用 Dev Cpp 先顶替一下,然而在遇到输出中文字符的时候出现了乱码的情况,但这种情况又非常诡异.于是简单了解了一下写成此博客. [写在前面] ...
- 【安卓】aidl.exe E 10744 10584 io_delegate.cpp:102] Error while creating directories: Invalid argument
这几天在使用.aidl文件的时候eclipse的控制台总是爆出如下提示: aidl.exe E 10744 10584 io_delegate.cpp:102] Error while creatin ...
随机推荐
- 2019-11-29-dotnet-使用-System.CommandLine-写命令行程序
title author date CreateTime categories dotnet 使用 System.CommandLine 写命令行程序 lindexi 2019-11-29 08:33 ...
- nodejs 常用插件
.circular-json npm install circular-json JSON.parse高级版 .cookie-parser .md5-node .multer 上传插件 .npm i ...
- 常用插件html
1.上传模板,插件 https://github.com/kartik-v/bootstrap-fileinput 2.
- k8s第一个脚本:hello world
1.hello-world-pod.yaml 脚本: # cat hello-world-pod.yaml apiVersion: v1 kind: Pod metadata: name: hello ...
- Scrapy-redis分布式+Scrapy-redis实战
[学习目标] Scrapy-redis分布式的运行流程 Scheduler与Scrapy自带的Scheduler有什么区别 Duplication Filter作用 源码自带三种spider的使用 6 ...
- parted分区的步骤
使用parted分区的步骤1. fdisk -l ##查看一下当前的存储设备,这里可以看到新加入的磁盘,比如/dev/sdb2. parted /dev/sdb ...
- jmeter使用正则表达式提取数据
1.通过正则表达式提取到接口返回的中的某些数据.例如:success":true,"data":{"typeID":"(\w+)" ...
- Python之面向对象之初识面向对象
初始面向对象 一.面向过程:面向过程的程序设计的核心是过程(流水线式思维),过程即解决问题的步骤,面向过程的设计就好比精心设计好一条流水线,考虑周全什么时候处理什么东西. 优点:极大地降低了写成学的复 ...
- JavaScript精进篇
JavaScript是所有前端框架中最基础的框架,在工作了两年以后又重新回到了这里.过去两年里用的最多的前端框架是jquery,因为它简单易上手,而jquery就是封装了JavaScript.重新系统 ...
- HDU-3605-Escape(最大流, 状态压缩)
链接: https://vjudge.net/problem/HDU-3605 题意: 2012 If this is the end of the world how to do? I do not ...