为什么要提倡“Design Pattern呢?根本原因是为了代码复用,增加可维护性。那么怎么才能实现代码复用呢?面向对象有几个原则:开闭原则(Open Closed Principle,OCP)、里氏代换原则(Liskov Substitution Principle,LSP)、依赖倒转原则(Dep...
分类:
其他好文 时间:
2014-07-09 20:15:39
阅读次数:
213
1、window.open()参数window.open(pageURL,name,parameters)其中:pageURL为子窗口路径name为子窗口句柄parameters为窗口参数(各参数用逗号分隔),如常用的'height=100,width=400,top=0,left=0,toolba...
Error info:Gen already exists but is not a source folder.Workaround-1:1. Right click project, and select "Properties"2. Select "Java Build Path"3. Ope...
分类:
其他好文 时间:
2014-07-09 19:29:27
阅读次数:
182
Partial Class,部分类 或者分布类。顾名思义,就是将一个类分成多个部分。比如说:一个类中有3个方法,在VS 2005将该类中3个方法分别存放在3个不同的.cs文件中。这样做的好处:1、一个大型的项目类可以同时分成不同的区块交由不同的程序员拽写,同时进行。2、若由系统自动产生的source...
分类:
其他好文 时间:
2014-07-09 19:17:59
阅读次数:
195
00编写一个程序,接受用户的输入并保存为新的文件:def file_write(file_name): f = open(file_name, 'w') print('请输入内容【单独输入\':w\'保存退出】:') while True: write_some ...
分类:
其他好文 时间:
2014-07-08 22:10:19
阅读次数:
353
判断是否欧拉回路。
很蛋疼的一道题,加上DFS判所有点是否连通就无限WA。(并查集也可判)
直接定理就AC了。都不知道所有点是不是在一个 连通块里面。
然后他们说:Your master is a particularly absent-minded lout and continually leaves doors open throughout a particular floo...
分类:
其他好文 时间:
2014-07-08 20:05:55
阅读次数:
212
因为每个月都要升级两台gitlab server, ruby安装的源老是被墙,痛苦无比。所以需要使用国内的镜像在/home/git/gitlab/Gemfile文件中第一行修改为:# source "http://rubygems.org"
source "http://ruby.sdutlinux.org" 特此记录。...
分类:
其他好文 时间:
2014-07-08 16:39:27
阅读次数:
209
套接字是通信端点的抽象。文件描述符用open函数创建,而套接字描述符用socket函数创建。socket函数原型如下:
int socket(int domain, int type, int protocol);
// 返回值:成功返回套接字描述符,失败返回-1
domain域确定通信特性,不同的域表示地址的格式不同,表示域的常数以AF开头,表示地址族(address family)...
分类:
系统相关 时间:
2014-07-08 16:34:18
阅读次数:
333
module("PathUtil",
package.seeall)
local _map_data --
地图数据
local _open_list --
开放节点
local _open_map --
开放节点,为了提高性能而加
local _close_map --
关闭节点
local _deleget...
分类:
其他好文 时间:
2014-07-08 10:36:34
阅读次数:
271
系统及软件版本:RHEL6.4IntelClusterStudioXE2013.1步骤:1、安装IntelClusterStudioXE2013.12、安装软件组Developmenttools,命令:yumgroupinstall"Developmenttools"-y3、设置Intel环境变量,命令如下:source/opt/intel/bin/compilervars.shintel64source/opt/intel/impi/..
分类:
其他好文 时间:
2014-07-08 08:24:34
阅读次数:
743