前面两篇写了有关Form与Form的验证,今天我们来写些ModelForm,因为现在的web开发都基与db驱动的,所以models.py的定义是少不掉的,但我们会发现它的定义与forms.py定义很接近,为此减少输入,我们可以使用modelForm这个模块,可减少代码输入。先定义models.py#coding:utf-8fro..
分类:
其他 时间:
2015-05-24 10:12:43
收藏:
0 评论:
0 赞:
0 阅读:
208
#LVM回滚技术
[root@domain/]#umount/home #卸载/home分区
[root@domain/]#lvreduce-L200M/dev/vg01/lvhome #不扫描文件系统,直接减掉文件系统
[root@domain/]#mount/dev/vg01/lvhome #这个时候挂载就会报错,文件系统就损坏了
[root@domain/]#cd/etc/lvm #进..
分类:
其他 时间:
2015-05-24 10:12:32
收藏:
0 评论:
0 赞:
0 阅读:
224
Tomcat是一个免费开放源代码的Web应用服务器,具有开源免费、容易安装、容易使
用、占用资源孝易于和其他软件集成等优点,是Apache软件基金会(ApacheSoftware
Foundation)的Jakarta项目中的一个核心项目,由Apache、Sun和其他一些公司及个人共
同开发而成。由于有了Sun的参与..
分类:
其他 时间:
2015-05-24 10:12:22
收藏:
0 评论:
0 赞:
0 阅读:
302
#centos安装jak和tomcat环境
[root@server1tomcat]#ls
apache-tomcat-8.0.21.tar.gzjdk-8u40-linux-x64.tar.gz
[root@server1tomcat]#tarzxvfjdk-8u40-linux-x64.tar.gz
[root@server1tomcat]#mkdir/usr/java
[root@server1tomcat]#tarzxvfjdk-8u40-linux-x64.tar.gz-C/usr/jav..
分类:
其他 时间:
2015-05-24 10:12:13
收藏:
0 评论:
0 赞:
0 阅读:
235
上一节中,我引用别人的文章,详细的讲解了Quartz 2D的基本概念。想了解的,请点击这里。这一节用几个小Demo,来说明Quartz 2D的绘图功能。
1. 我们先定义一个用来绘图的View(DrawView,它继承自UIView),并准备在下面的方法中实现绘图工作。
- (void)drawRect:(CGRect)rect;
2. 在主界面上面拖拽一个View,并且将...
分类:
其他 时间:
2015-05-24 10:11:32
收藏:
0 评论:
0 赞:
0 阅读:
234
Pair Program and Feel the FlowGudny Hauknes, Kari Røssland, and Ann Katrin GagnatiMAGiNE THAT YOU ARE TOTALLY ABSORBED by what you are doing— focused, dedicated, and involved. You may have lost track o...
分类:
其他 时间:
2015-05-24 10:11:23
收藏:
0 评论:
0 赞:
0 阅读:
232
Own (and Refactor) the BuildSteve BerczukiT iS NOT UNCOMMON for teams that are otherwise highly disciplined about coding practices to neglect build scripts, either out of a belief that they are merely...
分类:
其他 时间:
2015-05-24 10:11:02
收藏:
0 评论:
0 赞:
0 阅读:
144
Given a binary tree containing digits from 0-9 only, each root-to-leaf path
could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find the tota...
分类:
其他 时间:
2015-05-24 10:10:38
收藏:
0 评论:
0 赞:
0 阅读:
289
引入fckeditor编辑器入口文件(跟前边的例子一样)用户会话临时设置
0
表单部分<form id="Edoit_Form" method="pos...
分类:
其他 时间:
2015-05-24 10:10:02
收藏:
0 评论:
0 赞:
0 阅读:
318
//4.1矩阵运算的设计与实现
#include
#include
#define M 4
/****----------------------------------------------****/
//函数名:MatrixAdd(int m1[M][M], int m2[M][M], int &result[M][M])
//参数: (传入)int m1[M][...
分类:
其他 时间:
2015-05-24 10:09:52
收藏:
0 评论:
0 赞:
0 阅读:
284
#include
using namespace std;
class A
{
public:
A()
{
a=0;
}
A (int i)
{
a=i;
}
void print()
{
cout<<a<<" ";
}
private:
int a;
};
clas...
分类:
其他 时间:
2015-05-24 10:09:32
收藏:
0 评论:
0 赞:
0 阅读:
275
引言所谓自定义Result,就是由我们自行开发Result,而不是使用由Struts2预定义的result。
在实际的开发中使用自定义的result机会不大,因为常见的各种页面展示技术,都有struts2给我们做的比较好好的。自定义的Result观看Result的源码如下:public interface Result extends Serializable { /**
* Re...
分类:
其他 时间:
2015-05-24 10:09:12
收藏:
0 评论:
0 赞:
0 阅读:
225
题意:给你一个序列 , 给你一个mark 矩阵 , 如果mark[i][j] = 1, 则代表序列i j 可以交换,需要求出交换之后字典序最小的序列
题解:
floyd 处理一遍,然后靠前的优先选择最小的数 , 然后没了
代码:
#include
#include
#define N_node 305
int n, dis[N_node][N_node], va...
分类:
其他 时间:
2015-05-24 10:09:02
收藏:
0 评论:
0 赞:
0 阅读:
424
#include
using namespace std;
class A
{
public:
A(char *s)
{
cout<<s<<endl;
}
};
class B:public A
{
public:
B(char *s1, char *s2):A(s1)
{
cout<<s2<<endl;
}
};
...
分类:
其他 时间:
2015-05-24 10:08:52
收藏:
0 评论:
0 赞:
0 阅读:
260
int main(int argc,char **argv) {
int sockfd, n;
char buf[MAXLINE];
union {
short s;
char c[sizeof(short)];
} un;
un.s = 0x0102;
if (sizeof(short) == 2) {...
分类:
其他 时间:
2015-05-24 10:08:02
收藏:
0 评论:
0 赞:
0 阅读:
297
#include
using namespace std;
class Base
{
public:
Base(char i) { cout<<"Base constructor. --"<<i<<endl; }
};
class Derived1:virtual public Base
{
public:
Derived1(char i,char j):Base(i)
...
分类:
其他 时间:
2015-05-24 10:07:52
收藏:
0 评论:
0 赞:
0 阅读:
263
市面上大部分应用不外乎就是颠过来倒过去地做以下这些事情: --------------- --------------- --------------- --------------- | | | | ...
分类:
其他 时间:
2015-05-24 10:07:12
收藏:
0 评论:
0 赞:
0 阅读:
259
引用网友的比喻: 外部碎片,是由于大量信息由于先后写入、置换、删除而形成的空间碎片。为了便于理解,我们将信息比作货物,将存储空间比作仓库来举例子。假设,我们有编号为1、2、3、4、5、6的6间仓库库房,前天送来了一大宗货,依次装入了1、2、3、4、5号仓库,昨天又因故将4号库房的货物运走了...
分类:
其他 时间:
2015-05-24 10:06:42
收藏:
0 评论:
0 赞:
0 阅读:
281
? 此例中混合了纯虚函数、虚函数、非虚函数等,只是为了强调隐藏的是继承而来的名字,至于名字代表的是什么并不重要,即使enum、nested class、typedef也不例外。 1 #include 2 3 using namespace std; 4 5 class Base 6 { 7 p...
分类:
其他 时间:
2015-05-24 10:06:02
收藏:
0 评论:
0 赞:
0 阅读:
165
第一项任务:团队组建及项目启动日光微澜Github仓库:https://github.com/yangleiwangximin/组长:杨磊(计科高职13-3)201303014107成员:王希敏(计科高职13-3)201303014099、赵林林(计科高职13-3)、201303014112赵书(计...
分类:
其他 时间:
2015-05-24 10:05:52
收藏:
0 评论:
0 赞:
0 阅读:
242