来自某位朋友(wangfun)博客上的代码,为了支持SSL,稍有修改。 MailSenderInfo: package com.yunos.mail; /** * 发送邮件需要使用的基本信息 *author by wangfun http://www.5a520.cn 小说520 */ import java.util.Properties; public cl
cppcheck 1.61版本:1.将zip包上载到linux2.unzip cppcheck-1.61.zip3.cd cppcheck-1.614.sudo chmod 777 cppcheck //修改下权限5.修改目标检查地址和头文件地址,并执行类似如下的命令:./cppcheck --enable=all -I~/rt0803/TGL/webkernel/foundations/incl
1、解压缩;2、cd ./qatools/pmd-bin-5.0.4/bin3、修改exec_pmd.sh,主要是修改被检查的目录 以检查无用代码为例,原始内容是:./run.sh pmd -d /home/wuhe.jyh/xxx/yyy/ -rulesets java-unusedcode > unusedcode.txt 红色字体部分
1、使用mm命令编译自己负责的模块2、解压缩;3、cd ./qatools/findbugs-2.0.2/bin4、修改exec_findbugs.sh,主要是修改被检查的目录 主要是修改第一行:./findbugs -maxHeap 2048 -high -textui /home/wuhe.jyh/xxx/out > result.txt &nbs
更少的代码解决同样的问题。String[]转String来自XXX.javaStringBuffer buffer = newStringBuffer();String projectionList = null;if(mProjection != null) {for(String p : mProjection) {buffer.append(p);buffer.append(" &
private SessionInfo getSessionInfo() { String jsonResult = null; InputStream is = null; try { is = doPost(bugfreeUrl, "mode=getsid")
private static final String loginUrl = "http://42.120.50.206/apr/login.php"; private String sessionId; public boolean login(String username, String password) {
for example: public String getBugMsg(String urlType, int id) { Map<String, String> params = new HashMap<String, String>(); params.put("url", urlType);
http://artho.com/jlint/
本期Blog原文参见:http://www.liferay.com/web/shuyang.zhou/blog/-/blogs/master-your-threadlocals ThreadLocal不是解决并发问题的"银弹", 实际上许多关于并发的最佳实践并不鼓励使用它。 但有些时候它确实是必须的
RV: Bad attempt to compute absolute value of signed 32-bit random integer (RV_ABSOLUTE_VALUE_OF_RANDOM_INT)This code generates a random signed integer and then computes the absolute value of that rand
一个表达式的结果与运算符的优先级(precedence)、结合性(associativity)、运算符的操作数计算次序(order of evaluation)相关。bool 类型可以转换为任意算术类型,false 转换为 0,true 转换为 1。不要与 true 做比较,不要写这样的代码:if (val == true) // do NOT write this 位运算符的整型操作数
from:http://www.csdn123.com/html/blogs/20130601/18352.htm预备知识对于位运算,大家都很熟悉,基本的位操作有与、或、非、异或等等。在面试中经常会出现位运算相关的题,所以我就做了简单的整理,参考了很多写的很好的博客及书籍。现在简单说一下,移位运算。左移运算:x << y。将x左移y位,将x最左边的y位丢弃,在右边补y个0。右移运算:x
from:http://just-study.blogbus.com/logs/23456568.html#include<stdio.h>#defineTOTAL_ELEMENTS (sizeof(array) /sizeof(array[0]))intarray[] = {23,34,12,17,204,99,16};intmain() {intd;for(d=-1;d
from:http://just-study.blogbus.com/logs/24154791.html1. 如果乘上一个2的倍数数值,可以改用左移运算(Left Shift) 加速 300% x = x * 2;x = x * 64;//改为:x = x << 1; // 2 = 21x = x << 6; // 64 = 262. 如果除上一个 2 的倍数数值,可以改
from:http://utildothashmap.blogspot.com/2011/08/negative-zero-vs-positive-zero.htmlIncase if you crossed your SCJP certification, you might aware of negative zero. Otherwise I don’t think we often ref
from:http://marxsoftware.blogspot.com/2008/04/negative-zero-and-java.htmlThe Wikipedia article on negative zero explains that negative zero is a computing-oriented concept rather than a mathematical c
from:http://www.cppblog.com/SmartPtr/archive/2007/07/05/27552.htmlBy SmartPtr(http://www.cppblog.com/SmartPtr/)一般情况下,如果要我们写一个求绝对值的函数,我们的实现很有可能会是这样:template<class T>T abs_Normal(T tNum){if(tNum &
from:https://dev.eclipse.org/sonar/rules/show/findbugs:BIT_IOR_OF_SIGNED_BYTE?layout=falseCorrectness - Bitwise OR of signed byte valuefindbugs : BIT_IOR_OF_SIGNED_BYTE Loads a value from a byte array
from:http://critical.eschertech.com/2010/04/07/danger-unsigned-types-used-here/By way of a change from the last two posts on formal verification, this time I’m going to talk about using unsigned types
from:http://hi.baidu.com/logeable/item/7b83c6cebcf1d15aad00ef15 1.求出该负数的原码 -7原码是100001112.求出补码
from:http://just-study.blogbus.com/logs/37238535.html6.更快的for循环一般来时,你会按照下面的方式来编写一个简单的for循环:for( i=0; i<10; i++){ ... }i循环计数变量取值依次为:0,1,2,3,4,5,6,7,8,9如果你的程序与循环计数器改变的顺序无关的话,你可以用下面的语句替代:f
from:http://just-study.blogbus.com/logs/37238127.html注:本翻译来源于链接http://www.abarnett.demon.co.uk/tutorial.html(PS,第一次翻译,有很多翻译有点可意会,不可言传的感觉:-),应该还是没有彻底理解文中的意思,见谅!)转载请注明出处! &nb
from:http://blog.regehr.org/archives/268Most C/C++ programmers have been told to avoid mixing signed and unsigned values in expressions. However — at least in part because we usually follow this advic
from:https://www.securecoding.cert.org/confluence/display/seccode/INT13-C.+Use+bitwise+operators+only+on+unsigned+operandsBitwise operators include the complement operator ~, bitwise shift operators &
undefined behavior when left operand is negative3down voteacceptedThe rules haven't changed. It's still technically undefined.Quoting from the C standard (Section 6.5.7, paragraph 4, of n1548)
from: http://www.cnblogs.com/java-zone/articles/3118592.htmlFindBugs错误修改指南 1. EC_UNRELATED_TYPESBug: Call to equals() comparing different types Pattern id: EC_UNRELATED_TYPES, type: EC, category: CORR
from:http://landerrooter.iteye.com/blog/725652最近在使用PMD进行代码缺陷扫描时,有一类问题PMD称为"call to Collection.toArray() may be optimizable"下面一行为问题代码:result = (IResearch[]) list.toArray(new IResearch[0]);PMD
这篇文章中的内容,自己没有试验from:http://www.phpboke.com/git_detail.html看到一篇git merge 和git rebase区别的文章解了我一直的困扰,特此分享起因前两天和项目组的成员分享了git相关知识,因为我发现大家再运行git pull时没有加后面的参数 –rebase。也就是说,如果你运行git pull,那么git会帮你做两件事情,首先拿到远程最
from:http://www.cnblogs.com/kym/archive/2010/08/12/1797937.htmlgit rebase,顾名思义,就是重新定义(re)起点(base)的作用,即重新定义分支的版本库状态。要搞清楚这个东西,要先看看版本库状态切换的两种情况:我们知道,在某个分支上,我们可以通过git reset,实现将当前分支切换到本分支以前的任何一个版本状态,即所谓的“回
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号