• 有没有在打开目录的时候,出现类似下面的错误?

    无法打开位置“file:///home/dong" 没有注册为处理此文件的应用程

    如图所示:


     

    解决办法:

    第一种,麻烦一些,编辑~/.local/share/applications/mimeapps.list

    在文件尾增加一行配置即可

    inode/directory=nautilus-folder-handler.desktop;nautilus-browser.desktop;

    第二种,很方便,

    随便找到一个目录,选中后点击右键,应该有一项就叫“使用其它程序打开...”菜单项,点击它后选择“文件浏览器”,确定即可。

     

  • GParted

    日期:2009-10-13 | 分类:自写 | Tags:Linux

    GParted是一个很帅的分区工具,因为最近看着我那3G多的swap分区总觉得很不舒服,想缩小一些,分1G给它用足够了,另外2G可以做一个小的文件分区,就研究了两个晚上。

    为了调整swap分区的大小,需要做一个Live usb(cd也可以),但是下载了当前最新版本0.4.7-1.iso,使用UBUNTU自带的"usb启动盘创建器"做了一个live usb,重启电脑后无法引导,折腾了好几回都不行.

    于是又下了它的zip文件,准备参照它的文档手工创建一下live usb,步骤如下:

    1. mkfs.vfat -F 32 /dev/sdb1

    2.  unzip gparted-live-0.4.5-2.zip -d /media/usb/

    3. cd /media/usb/utils/linux

    4. makeboot.sh /dev/sdb1

    完成后,重启系统,选择使用USB引导,这回能够正常进入了.

    这么点儿小东西折腾了我两个晚上,失败啊.

     




  • Ubuntu下最好用的浏览器(2)-Chrome

    日期:2009-10-11 | 分类:自写 | Tags:Linux

    2007年的时候,写过一个blog,Ubuntu下最好用的浏览器 Konqueror

    今年已经是2009年了,Google Chrome Linux版发布也有些日子了,这个"最好"应该换人了.

    自从在Ubuntu下装了Chrome,基本上很少再用其他的浏览器了,用了这些日子体会如下:

    1.速度很好,可以说是很快

    2.操作很方便,界面和Windows版相差不大

    3.内存占用较小

    4.已经可以播放Flash了

    鉴于以上几点,满足日常的上网功能已经很不错了,强烈推荐.

     

     


  • 千万要小心在更新时关闭Ubuntu

    日期:2009-10-11 | 分类:自写 | Tags:Linux

    在更新的过程中关闭ubuntu,我已经不是第一次了。

    以前就有过两回,结果是系统启动不了,修复失败,最后重装了系统。

    今天手特别贱,在更新时把窗口管理器给换了,用了几天Gnome Shell感觉别扭,还是换回到熟悉的metacity,换的过程很正常,在终端中执行metacity --replace就可以了,就在这时,我又敲了个ctrl+c,这下可好,整个桌面全死了,什么也操作不了.而这时update-manager应该正在安装新程序,因为硬盘灯闲得厉害,我就在键盘上瞎按,不知道按到哪,系统重启了.

    在引导的过程中就不大正常了,屏幕狂闪,连基本的登录都不能进行了.

    还好有一个备份的kernal,重启后进入它的修复模式,检查了一下,怀疑安装程序没有完成,把原来的显卡驱动给删除了,新的却没有完成安装,执行这个命令:

    sudo dpkg --configure -a

    以下是这个操作的说明:

    --configure package...|-a|--pending

                  Reconfigure  an  unpacked  package.  If -a or --pending is given

                  instead of package, all unpacked but unconfigured  packages  are

                  configured.

     

                  Configuring consists of the following steps:

     

                  1.  Unpack  the  conffiles, and at the same time back up the old

                  conffiles, so that they can be restored if something goes wrong.

     

                  2. Run postinst script, if provided by the package.


    果然发现好些新下载的更新包还没有安装完成.

    修复完成后,重启,恢复正常,在此留念,以后决不在更新的时候重启系统.

     

     

  • 编程卓越之道(第二卷)

    日期:2009-10-03 | 分类:自写 | Tags:

    国庆前三天,抽时间把编程卓越之道(第二卷)剩下的部分读完了,读完之后,越发觉得像我这样一直以来几乎只使用Java编程的程序员应该仔细读读,以后有时间应该再重读一遍,呵呵。

     

     

  • 升级到Ubuntu 9.10

    日期:2009-09-28 | 分类:自写 | Tags:Linux

    最近很忙,昨天休息,晚上就把电脑升级到了Ubuntu 9.10,今天试了一下,发现输入法改成了IBUS,感觉比sci要好用一些,不过无线又用不了,安装了最新的驱动也不管用,将就着先用有线上网了。

    明天再继续体验新系统,第一感觉挺好,呵呵。

     

  • Top 5 Static Analysis Plugins for Eclipse

    日期:2009-07-04 | 分类:转载 | Tags:

    原文:http://codedependents.com/2009/07/01/top-5-static-analysis-plugins-for-eclipse/ 好像是被拦了,内容如下:

    Static Analysis

    How is it that static analysis is still a best kept secret while so much lips service is paid to code reviews?  We have long since understood that boring repetitive jobs should be left for the machines, but when it comes to code inspection there seems to be a mental block.  Humans hold the advantage when reviewing architecture, use of design patterns and code organization, but a machine will find when a known null value is dereferenced 100% of the time and that can hardly be said for even the OCD coders I know.  Therefore, I present the top five static analysis tools for Eclipse.  While you might not have the delight of working on a project running continuous integration with a full unit test suite, code coverage, and static analysis, you can at least run your own private versions and rest comfortably knowing you’ve done your best.

    Code Coverage

    I assume at the very least that you’ve written some unit tests in Junit or maybe TestNG, the next step is to see if you are actually testing enough of your code.  Code coverage has saved me a number of times when I’ve been a little lax in my TDD discipline.  Having written some code, followed by some tests, its very easy to forget that one code branch and fail to exercise it; EclEmma to the rescue.  EclEmma installs a Coverage mode right next to the run and debug modes that are standard to Eclipse.  Simply run your unit test with the Coverage mode and bang, your code shows up bright green, yellow or red, letting you quickly know where you forgot a test or two.

    Bytecode Analysis

    The next level of analysis comes from the well respected FindBugs tool.  After installing the plugin, FindBugs inspects the actual .class files of your compiled code for well know bugs and other suspicious behavior.  I’m constantly surprised at the lack of false positives and overall quality of the bugs it finds, from comparing strings with ==, to failing to close resources, and more, its spot on.

    Code Complexity Analysis

    Next in my list of favorites is complexity analysis.  These metrics, from simple lines of code in a method to the lesser know but more powerful Cyclomatic Complexity and Efferent Coupling, are the closest thing to a “stinky code” test that software engineering has come up with.  If you strive for loose coupling and DRY code, then EclipseMetrics is right up your alley.  Once it is installed you will see warnings where your methods are overly long or complex, or your classes are poorly organized.  Let the OCD run wild.

    Dependancy Analysis

    Dependancies are one of those things that can go unnoticed until they bite you in the rear.  Once circular dependancies creep in it can become incredibly hard to break apart and modularize your code.  This might not seem important in a small to medium sized project but once a project scales up, the need to break it apart becomes critical and keeping your ducks in a line from the get go makes life that much easier.  For this task we employ JDepend4Eclipse.

    Source Code Analysis

    Finally we come to PMD. This is the twin brother of FindBugs.  Where FindBugs checks the .class file, PMD checks the .java file.  There is a lot of overlap here but you can find some interesting things like unused code that javac might have optimized away in the .class file.

    以上工具我目前在用得只有FindBugs,下面我想在工作中应用一下EclipseMetricsJDepend4Eclipse.应该有帮助,呵呵。

  • Chromium真不是一般的快

    日期:2009-06-22 | 分类:自写 | Tags:

    chromium(chrome at linux)真不是一般的快,在Linux下终于有一个用得顺手的浏览器了.

  • 10 Essential SQL Tips for Developers

    日期:2009-06-06 | 分类:转载 | Tags:

    10 Essential SQL Tips for Developers


  • G1 Garbage Collector的声明修改了

    日期:2009-06-03 | 分类:转载 | Tags:java技术

    G1可能是很多Java开发者期待的一个垃圾收集器了,我也一直在关注它的进展。

    不过在之前jdk6u14的Update Release Notes中有下面的一段话:

    Although G1 is available for use in this release, note that production use of G1 is only permitted where a Java support contract has been purchased. G1 is supported thru Sun's Java Platform Standard Edition for Business program.

    看样子是要付费才能在生产环境下使用G1?

    Infoq上有一个文章专门讲到这个事情,

    Is Sun offering the new G1 Garbage Collector Only with a Paid Support Contract?

    刚才又仔细看了一下jdk6u14的release notes,上面的话变成下面的内容了:

    G1 is available as early access in this release, please try it and give us feedback. Usage in production settings without a Java SE for Business support contract is not recommended.

    看样子InfoQ的文章中有一段分析得很接近,在jdk6u14中,如果没有购买支持协议,G1不建议在生产环境中使用。

    老外太聪慧了。