Saturday, December 22, 2007

freebsd通过代理使用ports

因为ports使用fetch来下载源代码,所以设置fetch的环境变量即可。
setenv HTTP_PROXY 192.168.25.22:3128;
setenv FTP_PROXY 192.168.25.22:3128;
192.168.25.22:3128为代理服务器地址和端口。

Tuesday, March 20, 2007

get the last day in a month in java

from http://forum.java.sun.com/thread.jspa?threadID=700253&messageID=4063642
it says:

// create calendar instance :: now
Calendar calendar = Calendar.getInstance();
int lastDateofThisMonth = calendar.getActualMaximum(Calendar.DATE);



Just check this one and understand how to expand

// create calendar instance :: now
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR,2000);
// month 0 is january
calendar.set(Calendar.MONTH,1);
int lastDateofMonth = calendar.getActualMaximum(Calendar.DATE);
System.out.println(lastDateofMonth);

Monday, March 19, 2007

sound on gentoo

it seems i installed a generic kernel. at default, no device configed for the sound.
when i wanna use ALSA, but can't emerge alsa-driver cause couldn't download a patch for my kernel.
so i use "emerge alsa-utils", after that, run "alsaconf", after a reboot manually, everything with the sound are work well.
:)

Sunday, March 18, 2007

triangle_strip,triangle_fan,triangle_list

看了一下psp sdk里对sceGuDrawArray中prim这个参数的值的描述,始终对“3 vertices for the first primitive, 1 for every following”这句话的后半句理解不能!:worried:

void sceGuDrawArray ( int prim,
int vtype,
int count,
const void * indices,
const void * vertices
)

Draw array of vertices forming primitives.

Available primitive-types are:

* GU_POINTS - Single pixel points (1 vertex per primitive)
* GU_LINES - Single pixel lines (2 vertices per primitive)
* GU_LINE_STRIP - Single pixel line-strip (2 vertices for the first primitive, 1 for every following)
* GU_TRIANGLES - Filled triangles (3 vertices per primitive)
* GU_TRIANGLE_STRIP - Filled triangles-strip (3 vertices for the first primitive, 1 for every following)
* GU_TRIANGLE_FAN - Filled triangle-fan (3 vertices for the first primitive, 1 for every following)
* GU_SPRITES - Filled blocks (2 vertices per primitive)


在看了
http://hankfiles.pcvsconsole.com/answer.php?file=87
后才恍然大悟原来是这个意思,似乎的确是sdk文档上没说清楚。

triangle_strip:就是前3个点组成一个简单图形(这里不就是3角形嘛),第4个点和其之前2个点组成又一个简单图形,以此类推。
triangle_fan:就是前3个点组成一个简单图形,第4个点和其之前一个点以及第一个点组成又一个简单图形,以此类推。
triangle_list:哈哈,见图。。。。。

同步opera blog(http://my.opera.com/jojomclntosh)

install realplayer on gentoo

Friday, 16. March 2007, 02:51:16

realplayer, gentoo, Linux
1st step:
#emerge ca-certificates

2nd step:
#emerge realplayer

Monday, March 12, 2007

今天是植树节

回家路上才想起来今天是植树节,本来想用ps来植树的,可惜我太懒,没装ps,只能传统手工植了。:D