Dev@Free

zJun's Tech Weblog

2012年3月17日

http://ubuntu.dormforce.net/

Ubuntu 12.04 Precise Pangolin:

deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse

使用说明
打开Software Manager,点击Edit⇒Software Sources
在Download from中选择Other
选择China⇒mirrors.ustc.edu.cn
点击Choose Server
posted @ 2012-06-05 00:55 zJun's帛罗阁 阅读(1111) | 评论 (0)编辑 收藏
a wonderful Eclipse plugin:  WindowBuilder, which can be used to develope Swing/SWT UI:

WindowBuilder is built as a plug-in to Eclipse and the various Eclipse-based IDEs (RAD, RSA, MyEclipse, JBuilder, etc.). The plug-in builds an abstract syntax tree (AST) to navigate the source code and uses GEF to display and manage the visual presentation.

Develop Java graphical user interfaces in minutes for Swing, SWT, RCP and XWT with WindowBuilder Pro's WYSIWYG, drag-and-drop interface. Use wizards, editors and intelligent layout assist to automatically generate clean Java code, with the visual design and source always in sync.

The project website: http://www.eclipse.org/windowbuilder/

To install the plugin in Eclipse: http://www.eclipse.org/windowbuilder/download.php

posted @ 2012-05-31 18:44 zJun's帛罗阁 阅读(590) | 评论 (0)编辑 收藏
Example:
abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452
aer 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452

UNIX:

display the no of occurance and the record
> sort f1.txt|uniq -c
   2 abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
   1 aer 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
   2 tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452

display only the duplicate records
> sort f1.txt|uniq -d
abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452

display distinct records
> sort f1.txt|uniq
abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
aer 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452

Reference:
How to find Duplicate Records in a text file
Shell: How To Remove Duplicate Text Lines

Windows:

Notepad++ can sort by line, and remove the duplicate lines at the same time.
  1. Open the menu under: TextFX-->TextFX Tools
  2. Make sure "sort outputs only unique..." is checked
  3. select a block of text (ctrl-a to select the entire document).
  4. click "sort lines case sensitive" or "sort lines case insensitive"

posted @ 2012-04-11 12:10 zJun's帛罗阁 阅读(465) | 评论 (0)编辑 收藏

1.安装JAVA环境

sudo apt-get install sun-java5-jre

2.下载tomcat: http://tomcat.apache.org/

3.解压tomcat

$sudo tar zxvf apache-tomcat-7.0.26.tar.gz -C /opt
$sudo mv /opt/apache-tomcat-7.0.26.tar.gz /opt/tomcat

4.启动tomcat

$sudo /opt/tomcat/bin/startup.sh

如果能看到下列提示,就表明启动成功了!

>Using CATALINA_BASE: /opt/tomcat
>Using CATALINA_HOME: /opt/tomcat
>Using CATALINA_TMPDIR: /opt/tomcat/temp
>Using JRE_HOME: /usr/lib/j2sdk1.5-sun

打开Firefox,在地址栏中输入http://localhost:8080,如果出来Tomcat的缺省界面,说明测试通过!

5.停止Tomcat服务

$sudo /opt/tomcat/bin/shutdown.sh

posted @ 2012-03-28 01:18 zJun's帛罗阁 阅读(700) | 评论 (0)编辑 收藏
1.下载安装 RubyInstaller: http://rubyforge.org/frs/?group_id=167&release_id=46588

2. 检查 RubyGems 版本,须高于 1.3.6
gem -v
3.如果版本不是最新,可以通过下面的命令更新至最新版本:
gem update --system
gem uninstall rubygems-update
4.安装 Rails:
gem install rails
posted @ 2012-03-27 18:30 zJun's帛罗阁 阅读(799) | 评论 (0)编辑 收藏
1.按照github上的指南配置(http://help.github.com/win-set-up-git/)基础的git环境。

2.在github上创建一个Repository。

3.在Eclipse中通过“Eclipse Marketplaces”,在Market Places里安装egit。

4.在Eclipse中生public key, 并添加到GitHub Repository中。
Eclipse中通过:performance -> SSH2 -> Key Management -> Gernerate RSA Key 生成 SSH 的 public key。
在GitHub中通过:edit your profile -> ssh key -> Add SSH Key 添加SSH Key, 把上面生成的 public key 拷贝到这里,保存。

5.Eclipse里File菜单,Import,即可从git导入刚添加到git的项目了。

6.修改,并提交。在项目上点右键–>team–>commit。commit是commit到本机的git库,而push才是同步到github。
posted @ 2012-03-27 01:16 zJun's帛罗阁 阅读(3007) | 评论 (0)编辑 收藏
1.下载最新版 Eclipse:
官方下载:http://www.eclipse.org/downloads/

2.解压下载的压缩包:
$sudo tar xvfz eclipse-SDK-3.1.2-linux-gtk.tar.gz -C /opt

这个时候,就可以在 /opt 文件夹中看到出现了一个eclipse的文件夹,双击其中的eclipse文件就可以运行eclipse了。

3.在菜单设置Eclipse选项:
$gedit ~/.local/share/applications/eclipse-user.desktop

插入一下内容:
[Desktop Entry]
Comment=Java IDE
Name=Eclipse
Exec=/opt/eclipse/eclipse
Encoding=UTF-8
Terminal=false
Type=Application
Categories=Application;Development;
Icon=/opt/eclipse/icon.xpm

posted @ 2012-03-27 01:00 zJun's帛罗阁 阅读(631) | 评论 (0)编辑 收藏

方法1: 用SET PASSWORD命令

  mysql -u root

  mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

方法2:用mysqladmin

  mysqladmin -u root password "newpass"

  如果root已经设置过密码,采用如下方法

  mysqladmin -u root password oldpass "newpass"

方法3: 用UPDATE直接编辑user表

  mysql -u root

  mysql> use mysql;

  mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';

  mysql> FLUSH PRIVILEGES;

方法4: 在丢失root密码的时候,可以这样

  mysqld_safe --skip-grant-tables&

  mysql -u root mysql

  mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root';

  mysql> FLUSH PRIVILEGES;

---------------------------------------

经测试,方法三修改成功,其他三种方法没有测试。

posted @ 2012-03-17 22:53 zJun's帛罗阁 阅读(508) | 评论 (0)编辑 收藏

一.问题环境:
  Eclipse3.4 + Tomcat6.0.20
二.问题现象:
  在Eclipse下启动Tomcat6时,控制台会有下面警告信息
  警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:...' did not find a matching property.
三.详细解决办法:
   1.打开服务器视图:窗口 > 显示视图 > 服务器 > 服务器
   2.双击服务器列表中的Tomcat,打开“服务器概述”窗口
   3.选中"Publish module contexts to separate XML files"选项。
   小提示:如果Tomcat处于启动状态,请先停止,否则,在保存服务器设置时,提示不能保存。

posted @ 2012-03-17 22:52 zJun's帛罗阁 阅读(840) | 评论 (0)编辑 收藏

Here is a simple way to generate a analyze report by using FindBugs plugins in RSA:

  • Using FindBugs to scan the code and save the result as XML file
  • the XML report is in a bad format for reading, we can use XSL file to make it easy and clear to read:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="summary.xsl"?>
  • Use Internet Explore to open the XML report, now we get a report:
Note: FindBugs provided following xsl files for different format:

1、default.xsl;
2、fancy.xsl;
3、fancy-hist.xsl;
4、plain.xsl;
5、summary.xsl;

posted @ 2012-03-17 22:46 zJun's帛罗阁 阅读(449) | 评论 (0)编辑 收藏

导航

<2012年3月>
26272829123
45678910
11121314151617
18192021222324
25262728293031
1234567

统计

常用链接

留言簿(15)

随笔分类

随笔档案

相册

收藏夹

博客

文档

站点

论坛

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜