I've always felt sorry for people that don't drink -- remember,
when they wake up, that's as good as they're gonna feel all day!

2008-11-13

Struts 2 Process Flow

Filed under: java, framework — LiQiang @ 21:37:19

2008-11-12

Struts 1 Process Flow

Filed under: java, framework — LiQiang @ 22:56:45

2008-10-28

软件开发中经验的来源与作用

Filed under: develop — LiQiang @ 22:53:45

        在开发软件时,开发经验如何获得,一个没有实战开发过软件,或者两个经验差异较大的开发人员的差异是什么,不同的开发人员的技术能力体现在哪些方面,这些是对软件开发人员经常遇到的问题。

首先我们谈一下经验来自哪里, 经验可以来自两个方面:

1.前人总结的实践理论、经验

2.自己工作中不断实践、不断总结而积累的经验

前者通过学习、实践就可以快速掌握,占据每个人经验的很大一部分。这方面的积累主要靠自己勤奋、努力多学习,在勤奋的同时也需要很好的领悟力、记忆力,能够深入理解前人的经验,并在实践中合适的环境下加以使用。

后者需要经过大量的实践、总结,在实践过程中需要应用所学,因此也离不开学习前人经验。自己的经验通常是对已有经验(自己、前人)的总结、优化、组合、升华。而自己积累经验特别的一点是和自己的成长、工作、项目环境有关,就是说这些经验在这样一个特定的环境下,可能前人并没有遇到过,因此这个经验是独有的。这种环境的特殊性形成的经验非常可贵、并且稀缺。

有了经验的两个来源,我们再来分析一下获取经验的能力。第一个来源可以学习得到,因此这个经验是可以后期补上的,这时我们需要比较的是在可接受的时间内能够学习、应用这些经验的能力。通常这种能力我们能通过了解过去类似经历来分析了解,在一些环境下也通过智力测验得到结果。第二个来源需要工作中的思考、总结,也需要不断为自己寻找有挑战性的问题,在有挑战的问题解决中磨练锻炼自己。

经验的作用体现在做事的过程中,在公司流程就是经验的一种总结固化,而对于个人经验体现在做事情能够一次做对、一次做好。通过失败、错误来积累经验成本是很高的。

对于软件开发来讲,经验体现在开发的各个方面:
过程:软件的需求、设计、开发、测试、部署实施各阶段做的怎样。
团队:和项目相关的人员如何有效沟通、合作,推动项目进展。
技术:开发出来的软件在各种指标上体现怎样,和竞争对手产品比较如何。

经验的识别同样是一种能力,古人说“世有伯乐,然后有千里马。千里马常有,而伯乐不常有。故虽有名马,辱于奴隶之手,骈死于槽枥之间,不以千里称也”,如果千里马没有被伯乐发现,也只能平平庸庸。

2008-08-25

Symfony 1.1 framework — Control flow

Filed under: framework, php — LiQiang @ 21:46:45

Symfony is a php web framework following MVC pattern.

Follow image is a general analysis how symfony process  url request .  If you directly following code to analysis how it process a request , it will be very difficult , because symfony using many config generated code ,and it use many specific feature/mechanism : event dispatch , class mixin ,autoload .  These features and mechanisms make the framework very powerful ,and by the while makes itself difficult to catch up.

symfony 1.1 architecture- control flow

2008-07-20

*nix distribution on Ibook

Filed under: mac — LiQiang @ 23:08:43

Netbsd:

  1. booting
    using open firmware boot : hd:4,\ofwboot.xcf  hd:10,/netbsd
    hd:4 is a Mac partition ,  ofwboot.xcf is a netbsd provide file ,need copy to the mac partition.
    hd:10 is the netbsd installed patition .
  2. feature
    The default terminal is not acceptable , the default font is big , and the whole screen background color is gray. X11 is not installed by default , and pkg_src not installed by default.

Freebsd:
0.install
Need partition before installtion (use ubuntu mac-fdik) ,the installer can’t create new partition.
1.booting
Using Open Firmware boot : hd:4,\loader hd:10,/boot/kernel
2.feature
The default terminal compared to netbsd is really good . Ports can be installed manually.X11 I had’t try yet.
My Iboot cpu is 1.3G , but install ports is really slow (port package configure and compile) , it’s just like a 300MHz cpu machine.
The inner keyboard can’t be recogonized , can only be used with a external keyboard. Wireless network card can’t be recogonized by default.

Ubuntu:
1.booting
Using yaboot , the utility is really good , similar to lilo or grub . If you already installed ubuntu 6 on ibook ,then you can config yaboot to boot from hard disk ubuntu 8 installation.
2.feature
Hardware support is very well, wireless network and screen brightness and volume control is all function well .Gnome is default installed , KDE and xfce4 I have tryed no problem.

Fedore Core 7:
Read my previous article :
wireless Fedora core linux 7 on ibook

2008-07-12

IPod touch firmware 2.0 update

Filed under: iphone — LiQiang @ 21:33:02

Today Apple released firmware 2.0 for ipod touch , the update needs $9.95 to download the firmware via itunes. To take advantage of firmware 2.0 , it needs itunes to update to version 7.7 . Then just plug in ipod touch usb table, and itunes shows the firmware update avaiable (after purchase).

It takes about an hour(ADSL 150Kbps) to download  the firmware , the version number is 5A347.And file size is 222.6MB , much bigger than 5A225C version. After finish download firmware then press upgrade ipod touch button in itunes ,  the update process is straightforward, just wait ipod touch update finish ,and reboot ,it takes about 10 minutes.

First impressions:

AppStore rocks : Both ITunes and Ipod touch can download application from AppStore. And there’s many free application avaiable. The AppStore is much better then Installer.app , every application has it’s infomation,screenshot, web site . It’s full featured web shopping item.

Remote.app is awesome , just open Remote.app on ipod touch , add itunes library ,and put the 4-digit passcode on itunes ,  then ipod touch can fully control itunes on Mac/Windows. And the interface is the same as music control on ipod touch.

2008-06-22

using awk to process stock quote data

Filed under: linux — LiQiang @ 18:45:24

在论坛上看到一则awk的题目,有股票数据文件:
quote.dat:
20080525|0600|758836152.12
20080525|0602|609000.00
20080525|0603|2666746080.44
20080525|0604|1400500000.00
20080525|0605|380000000.00
20080525|0606|356894829.48
20080526|0603|2666746080.42
20080526|0602|609000.05
20080526|0604|1400500000.07
20080526|0605|380000000.09
20080526|0606|356894829.41
要求按照格式输出股票报价,使用awk实现。
输出格式:
quote 0600 0602 0603 0604 0605 0606
20080525 758836152.12 609000.00 2666746080.44 1400500000.00 380000000.00 356894829.48
20080526 NAN 609000.05 2666746080.42 1400500000.07 380000000.09 356894829.41

最近正好常用awk,自己实现了一下,代码如下:

function echo_result(date,NUM,QUOTE){
	printf "n%-15s",date;
	for(i=0 ; i<length(NUM) ;i+=1 ){
		qu=QUOTE[NUM[i]];
		if(qu>0)
			printf "%-15.2f ",qu;
		else
			printf "%-16s","NAN";
	}
}

begin{
	c=0;
}	

{
	if($1==date || NR==1)
	{
		if(c==0){
			NUM[NR-1]=$2;
		}
	}else{
		c++;
		if(c==1){
			printf "%-15s","quote";
			for(i=0 ; i<length(NUM) ;i+=1 ){
				printf "%-15s ",NUM[i];
			}
		}
		echo_result(date,NUM,QUOTE);
		delete QUOTE;

	}
	QUOTE[$2]=$3;
	date=$1;
}	

END{
		echo_result(date,NUM,QUOTE);
}

执行:
awk -F’\’ -f quote.awk quote.dat

2008-06-02

阿拉蕾回忆

Filed under: 生活 — LiQiang @ 13:18:38

2008-05-27

try solaris 10

Filed under: linux — LiQiang @ 22:39:29

Today I installed Solaris 10 on Mac Parallels. The version is solaris 10 express developer editon , the install screen is much beter then Freebsd ,it takes 8G hard disk space,and the install process is very slow.
After install the network card is not installed automatically. I google it , and found two answer:
1. In Parallels installation disk it contains a little tools to setup the network .
2 .Install realtek 8029 manually at page http://homepage2.nifty.com/mrym3/taiyodo/eng/ .
I used method 2 setup the network properly.  Just first trying.

2008-05-10

Beginning freebsd-1

Filed under: linux — LiQiang @ 19:46:21

freebsdToday I installed freebsd 6.2.It’s has 2 cd-rom disk and 1 document disk. The install process is very straitforward , there’s no fantasic GUI like FedoraCore installation , only simple text and ncurses simple ui controls . First it will format disk , and install the kernel system .Then the many option softwares and configuration is opened automaticly , and these can be reopened at any time by command sysinstall.

I first install a version in Parallels on leopard , then another version in VMware on windows xp . It’s all installed ok and network is configed automaticly. The vmware version I forget to install port collection, and absense the source code , so there’s a chance to run sysinstall and install port in the running os . The sysinstall process is simple ,but it erase some my config ,include my network config ,inet service config and /usr/bin/vi symbol link. This maybe because when installing port software collection, it made a ‘make install clean’ and clear my previous config.

Freebsd has the proc filesystem ,and /proc directory is the mount point , but it’s not mount automaticly , need to run ‘ mount_procfs procfs /proc’ as root.

A running freebsd system for a programer need setup a programming enviroment. First the shell , the default shell is /bin/sh , we need change to bash , use the command chsh to change current user shell config , or just type bash to enter bash. Then setup bash config file: .bashrc and .bash_profile , a demo config as follow:
export CLICOLOR=xterm
export ll=’ls -l’
export SVN_EDITOR=vim

Then setup vi editor , a demo config file .vimrc as follow:freebsd logo
syntax on
filetype on
set fdm=syntax
set sw=4
set tabstop=4
set autoindent
set laststatus=2
set stl=%F\ %l,%v
set numer

That’s it , then we can beginning programming on the little Freebsd daemon.

Next Page »

EMail:liqiang@xuecs.com