`
Jameslyy
  • 浏览: 386094 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
1. if语句嵌套重构        有很多时候需要使用if语句实现条件判断,但是过多的if嵌套导致可阅读性比较差,代码难于维护,有一些技巧可以避免过多的if嵌套。一种方式就是,可以把内层的if挪到外面来,把判断的结果保存到变量中,把嵌套的if语句修改为平行的结构,这样虽然不会减少if语句,但是却可以让代码清晰许多。进一步,把相关的if语句合起来放到独立的方法中,分解过大的代码块。        对于减少使用if...else语句,还可以使用一些设计模式,例如策略模式,把不同的问题放到不同的类进行处理;其他如责任链模式,command模式等,根据实际需要重新设计和重构代码,实现代码的可维 ...
1. git clone 项目,从git远程代码库clone一个项目     git clone ssh://gerrit-server/project.git   2. 切换分支     git checkout -b  本地分支名  远程分支名     例: git checkout -b develop origin/develop   3. 常用命令 git status      查看工作区状态,如果有已经修改获未提交代码,会列出。 git add .       添加更新代码到索引 git add -u 添加更新代码到索引 git add -i 添加新建文 ...
#格式化全文 gg=G #自动缩进当前行 == #格式化当前光标接下来的10行 10= #格式化选定的行 v(向上下选择) = #命令解释 gg #跳转到文件首行 = #应用缩进格式 G #直到文件结束  
1 文件和目录操作 cd 改变当前文件目录 pwd 显示当前目录位置 ls 显示目录文件,-a 显示所有文件,-l 显示文件详细信息 mkdir 创建目录 rm 删除文件,-r 参数:递归文件夹删除目录和文件,-f 强制删除,root用户慎用-f参数 rmdir 删除文件夹 mv 移动或重命名文件 touch 修改文件的访问时间,如果文件不存在,则会创建一个空文件。 stat 查看文件详细信息,包括文件大小、索引节点值、创建时间、修改时间、访问时间等。 ln -s 创建软链文件,如果不加-s 参数,则创建硬链接 统计文档数量:ll -lR books_dev | gr ...
    tomcat启动不了,报错:SAXParseException: Premature end of file     详查错误信息,可以发现是解析哪个xml文件时出错,检查该xml文件,应该就能发现错误所在。一般是WEB-INF/下的xml配置文件,如web.xml,处理好xml文件,问题解决!
PhysicsJS是一个基于JavaScript、模块化、可扩展、易于使用的物理引擎。 PhysicsJS:基于JavaScript的强大的物理引擎   PhysicsJS官网 http://wellcaffeinated.net/PhysicsJS/
ZeroC Ice http://www.zeroc.com/ The Internet Communications Engine (Ice) is a modern distributed computing platform with support for C++, .NET, Java, Python, Objective-C, Ruby, PHP, and ActionScript. Ice is used in mission-critical projects by companies all over the world. Ice is easy to learn, ...
int[] ip = {192, 168, 1, 100}; /* // 测试代码 System.out.println(Integer.toBinaryString(ip[0])); System.out.println(Integer.toBinaryString(ip[1])); System.out.println(Integer.toBinaryString(ip[2])); System.out.println(Integer.toBinaryString(ip[3])); System.out.println(" & 0xff: " ...
    在Eclipse中使用其他Javascript代码库时,有些没有语法错误的代码也会报错,Javascript方面的插件可能存在Bug。只有不验证这些报错的代码。可以采取以下方法取消对代码库的验证:       右键点击项目,选择properties,打开项目属性对话框,找到Javascript/Include Path,如下图:        然后点击“Edit”按钮,打开Inclusion and Exclusion Patterns 对话框:    点击如图所示Add...按钮,添加不需要验证的文件夹,然后关闭对话框,刷新项目,OK,错误报警消失了。    
  var w = screen.availWidth - 12; var h = screen.availHeight - 75; var urlStr = '#'; var subWin = window.open(urlStr,"newWin",'height='+h+',width='+w+', top=0, left=0, toolbar=no, menubar=yes, scrollbars=yes, resizable=yes, status=no'); // subWin .print(); 打印 // 预览页面, ...
在网页中嵌入Excel: <object id=Spreadsheet1 style="height:100%; width: 100%; border: 1px solid #999; " align="top" classid="clsid:0002E551-0000-0000-C000-000000000046"> <param name="DataType" value="XMLURL"/> <param na ...
Jacob 读写Excel   JacobExcelUtil import java.io.File; import java.io.FileNotFoundException; import java.util.List; import com.jacob.activeX.ActiveXComponent; import com.jacob.com.ComThread; import com.jacob.com.Dispatch; import com.jacob.com.Variant; /** * Jacob excel Util * */ pub ...
import java.util.Random; import com.jacob.activeX.ActiveXComponent; import com.jacob.com.ComThread; import com.jacob.com.Dispatch; import com.jacob.com.Variant; public class JacobUtil { public static final int WORD_HTML = 8; public static final int WORD_TXT = 7; public static final ...
  // 设置纸张大小 Document document = new Document(PageSize.A4); // 建立一个书写器(Writer)与document对象关联,通过书写器(Writer)可以将文档写入到磁盘中 RtfWriter2.getInstance(document, new FileOutputStream(file)); document.open(); document.close();
查询数据库表创建时间 DBA权限下: select object_name,created from dba_objects where object_type='TABLE' and object_name ='your_tab'; 普通用户查本用户的表: select object_name,created from user_objects where object_type='TABLE' and object_name ='your_tab';   数据转换函数 to_char 转换为字符串,to_char(date, 'yyyy-MM-dd HH24:mm:ss ...
Global site tag (gtag.js) - Google Analytics