2013年工作中遇到的20个问题:61-80


61.数据库密码,md5解密。
  PHP开发权威指南中,书中的一个oa系统,部署登录时,发现不知道用户名和密码。
  阅读代码发现,使用了md5加密,因此判断数据库中的用户密码应该是md5加密过的。
 
  http://www.cmd5.com/,通过这个md5解密网站,得知密码是admin,登录成功。
  21232f297a57a5a743894a0e4a801fc3-> admin
 
62.Tomcat启动比较慢。
  2013-3-28 9:42:14 org.apache.catalina.util.SessionIdGenerator createSecureRandom
 信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [34,963] milliseconds.
 createSecureRandom这方法每次启动花费的时间不一样,有时2s,有时40s。
 
  原因不详,只是知道,重启次数多了,更可能会变慢。

63.Struts2的命名空间和jsp页面所在的文件夹名字可以不同。

<package name="test" namespace="/test" extends="default">
  <action name="aaa" >
    <result>/test2/bbb.jsp</result>
  </action>

</package>

bbb.jsp不必要在根目录下的test文件夹下。


64.跨Service调用更新失败

@Service
public class MdpOperationService {

@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    public void addMode() throws IOException {
      
        for (int reportIndex = 0; reportIndex < reportSize; reportIndex++)          
            managerReportService.updateReport2(newReport);
        }
    }
}

@Service
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
public class ManagerReportService extends BaseService<Treport> {

public boolean updateReport2(Treport rep) {
        LOG.info("in:updateReport");
        return treportDao.update(rep);
    }
}

失败原因:
//跨Service调用之后,ManagerReportService.updateReport的事务使用的是
ManagerReportService类默认的(readOnly = true, propagation = Propagation.NOT_SUPPORTED),
而不是MdpOperationService.addMode方法的。

65.Myeclipse修改jsp等文件的默认打开方式 。
Myeclipse默认打开文件的方式是 jsp designer,每次双击或者使用Ctrl+Shift+R打开 就会用这个打开 ,太慢了而且多次导致Myeclipse挂掉。
可以通过以下的方式转化成你想要的打开方式,方法如下:
Myeclipse->preferences->General->editors->Files Associations(位置根据具体eclipse版本会有所同)
File Types 选择.jsp assiciations 里选择 jsp editor,然后点右边的default。


66. POI中填充Excel单元格Double数据。

目标:后台数据Float data = 1.345;
放在Excel单元格中,显示为1.345。

2种参考方式(有待于检验):
第1种,BigDecimal bd = new BigDecimal(data.toString());
cell.setCellValue(bd.doubleValue());

第2种,
HSSFCellStyle style;
style.setDataFormat("...");

 

67.使用日志记录不正常情况。
if(正常情况){
  do something;
}else{
  LOG.error("错误:出问题啦");
  LOG.warn("警告:");
}

68.Ubuntu安装软件提示404。
apt-get install mysql-server总是报错。
通过添加源解决。

修改/etc/apt/source.list文件,添加
deb http://mirrors.163.com/ubuntu/ quantal main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ quantal main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ quantal-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise universe

然后执行 apt-get update,最后再重新执行 安装命令,就可以了。

69.Ubuntu下Apache重启出现错误。

错误信息:
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
解决方法:
sudo vim /etc/apache2/apache2.conf

在文件后面加上:
#Server Name
ServerName 127.0.0.1


70.创建软链接

ln -s /user/share/phpmyadmin
(不是In,也不是Ln)

71.安装phpmyadmin之后,总是提示没有权限访问phpmyadmin。
弄了很久,也没有搞定。
最终,把/usr/share/phpmyadmin拷贝到/var/www解决了。
cp -ri /usr/share/phpmyadmin /var/www

72.FileFilter与FilenameFilter
FileFilter accept(File file)  此过滤器是否接受给定的文件。
  //file可以是目录,也可以是文件
boolean accept(File dir,String name)测试指定文件是否应该包含在某一文件列表中。
  dir - 被找到的文件所在的目录。
  name - 文件的名称。
     
73.编码识别和转换
Windows下,默认编码是GBK,有时候开发程序的时候,忘记设置了Eclipse工作空间的编码,此时
文件是GBK编码。部署到Linux系统(默认UTF-8编码)上时,容易导致乱码。

手动去修改编码非常慢,可以通过程序来改动。

2种情况:
a.编码是统一的。比如所有文件都是GBK,需要统一转化为UTF-8。
  这种情况,已经明确知道了编码,很容易自己写程序转换。
  只要在构造文件流的时候,指定编码就可以了。
 
b.编码不是统一的。比如大部分文件是UTF-8,少部分是GBK,需要统一转化为UTF-8。
  解决方法:自己去识别文件的编码格式,然后转化为目标编码。
 
  编码的识别采用Java开源工具cpdetector。
 

74.字符串比较

原来的需求是 区分大小写
public String containsKeywords(String name,Map<String,String> keys);


String key = containsKeywords(name,keys);
keys.get(key);

现在的需求是不区分大小写
修改:containsKeywords中字符串的比较都使用toLowerCase方法转化为小写。
问题:获取key的时候,即使key不为null,也可能获取不到值。
解决方法:containsKeywords应该返回原来的key(比较的时候,都使用小写的)

75.WordPress上传插件安装时,提示没有权限。

 /var/www目录下的所有文件 用户和组名 修改为 www-data:www-data.
 chown -R www-data:www-data *.*
 
76. apache2 支持重写链接

#配置apache2 支持重写
 参考文章 http://www.imneio.com/2009/10/apache2_rewrit/

  执行命令 a2enmod rewrite
   vim /etc/apache2/site-enabled/000-default

把里面"所有"的AllowOverride None 改为 AllowOverride all


77.混用JavaScript和JQuery。
纯Jquery:$("#test").removeAttr("disabled");
混合使用:$("#test")[0].removeAttribute("disabled");

78.Ubuntu下安装禅道(ZenTaoPMS)一键安装包。

XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system.
For centos, rhel or fedora systems, please try 'sudo yum install glibc.i686 libgcc.i686 libstdc++.i686'.
For ubuntu, debian systems, please try 'sudo apt-get install 'sudo apt-get install ia32-libs'.

64位系统需要安装ia32-libs包,安装失败,大致原因是依赖的包没有找到源。

解决办法:按照官方说明,使用源码安装。

79.关闭Apache的目录浏览功能
参考http://bbs.51cto.com/thread-572324-1.html

修改之后重启apache,再次访问就显示没有权限了。
You don't have permission to access /zentaopms/ on this server.

80.IE下jquery.form.js报错,提示handleError方法不存在。
jquery1.4.2之后,handleError方法没有了。

解决办法:
修改jquery.form.js源码,找到cb函数,
修改以下2行。
  catch(e){
                ok = false;
               $.handleError(opts, xhr, 'error', e);         
            }
改为  
catch(e){
               // ok = false;
              //  $.handleError(opts, xhr, 'error', e);
             ok = true;
            }
不再调用handleError方法,ok改为true。

相关阅读

工作问题 http://blog.csdn.net/FansUnion/article/category/1334371


 

转载于:https://my.oschina.net/jiutianniao/blog/400229

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
我的电脑显卡是NVIDIA CUDA 11.6.114 driver,win10,64位的,在安装Anaconda时,有如下几个版本:Anaconda-1.4.0-Windows-x86_64.exe 241.4 MiB 2013-07-04 17:58 Anaconda-1.5.0-Linux-x86.sh 238.8 MiB 2013-07-04 18:10 Anaconda-1.5.0-Linux-x86_64.sh 306.7 MiB 2013-07-04 18:22 Anaconda-1.5.0-MacOSX-x86_64.sh 166.2 MiB 2013-07-04 18:37 Anaconda-1.5.0-Windows-x86.exe 236.0 MiB 2013-07-04 18:45 Anaconda-1.5.0-Windows-x86_64.exe 280.4 MiB 2013-07-04 18:57 Anaconda-1.5.1-MacOSX-x86_64.sh 166.2 MiB 2013-07-04 19:11 Anaconda-1.6.0-Linux-x86.sh 241.6 MiB 2013-07-04 19:19 Anaconda-1.6.0-Linux-x86_64.sh 309.5 MiB 2013-07-04 19:32 Anaconda-1.6.0-MacOSX-x86_64.sh 169.0 MiB 2013-07-04 19:47 Anaconda-1.6.0-Windows-x86.exe 244.9 MiB 2013-07-04 19:56 Anaconda-1.6.0-Windows-x86_64.exe 290.4 MiB 2013-07-04 20:09 Anaconda-1.6.1-Linux-x86.sh 247.1 MiB 2013-07-05 08:34 Anaconda-1.6.1-Linux-x86_64.sh 317.6 MiB 2013-07-05 09:20 Anaconda-1.6.1-MacOSX-x86_64.pkg 197.3 MiB 2013-07-05 10:05 Anaconda-1.6.1-MacOSX-x86_64.sh 170.0 MiB 2013-07-05 12:20 Anaconda-1.6.1-Windows-x86.exe 244.4 MiB 2013-07-05 12:29 Anaconda-1.6.1-Windows-x86_64.exe 289.9 MiB 2013-07-05 12:49 Anaconda-1.6.2-Windows-x86.exe 244.4 MiB 2013-07-10 06:19 Anaconda-1.6.2-Windows-x86_64.exe 289.9 MiB 2013-07-10 07:04 Anaconda-1.7.0-Linux-x86.sh 381.0 MiB 2013-09-20 01:04 Anaconda-1.7.0-Linux-x86_64.sh 452.6 MiB 2013-09-20 02:49 Anaconda-1.7.0-MacOSX-x86_64.pkg 256.7 MiB 2013-09-20 05:04 Anaconda-1.7.0-MacOSX-x86_64.sh 223.3 MiB 2013-09-20 11:00 Anaconda-1.7.0-Windows-x86.exe 280.6 MiB 2013-09-20 11:11 Anaconda-1.7.0-Windows-x86_64.exe,请问我应该安装哪一个?
最新发布
07-24

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值