存档

作者存档

搞定gentoo alsa

2005年8月8日 hufey 评论已被关闭

按照gentoo alsa document
关掉genkernel里的oss 和alsa,留着sound=y
然后emerge alsa-driver alsa-utils alsa-tools
rc-update del esound default
rc-update add alsasound default
运行aslaconf,找到破声卡
似乎没问题了
然而发现X起来的时候出来好几个不能调节音量的错误信息
mplayer在-ao oss模式下一切正常
但是在-ao alsa只能root出声,普通用户不出声
在google上查到要把普通用户加到audio组里
但是在user and group management里没有audio组
发现下面有一个打钩的地方显示所有用户和组
打钩
加到audio里,还是一样啊?!
没辙了
进irc问别人吧
一个叫Chris什么的人回答要logout completely才行
呵呵
果然如此
出现数个不能调节音量的错误是因为自己过去加了好几个applet但是都没有显示出来
BTW,这个Chris回答过好几个问题了,相信他肯定不记得我
也就是说他整天挂在irc channel里,啥问题都能回答。。。

分类: saving 标签:

hello qt!

2005年8月4日 hufey 评论已被关闭

$ cat helloqt.cxx
#include “qapplication.h”
#include “qlabel.h”
int main( int argc , char **argv )
{
QApplication app( argc , argv ) ;
QLabel *hello = new QLabel(
“《font color=blue》Hello 《i》QT《/i》”"《/font》”,
0 ) ;
app.setMainWidget( hello ) ;
hello->show() ;
return app.exec() ;
}
$ g++ helloqt.cxx -o helloqt -I/usr/qt/3/include -L/usr/qt/3/lib -lqt
$ ./helloqt

分类: saving 标签:

1995.7.28. 工作10年了

2005年7月29日 hufey 3 条评论

1995年7月28号,我拎着两个衣箱在上海公平渡码头下轮渡
轮渡是从青岛出发,我买的是最便宜的统舱票。
所谓统舱,就是底舱,就是舱底,一个超大的大厅,所有人都在里面找一块地方
铺上报纸衣服,坐着或睡着。
我喝了一大瓶雪碧,第一次喝这种奢侈的汽水。
一整天船舱的晃动,柴油的味道,让我从那以后再也不想喝雪碧。
在青岛呆了一周,一周都是雾沼沼的,衣服晾不干。
再之前是坐了30多小时的火车到青岛,没有座位。
在码头下船,遇到举着牌子接我的人,坐上一辆桑塔那,直奔上海郊区。
后来知道那个桑塔那是特意借来的,免得我对公司的实力有所怀疑。
跟这家公司联系是在哈尔滨打的一个长途电话,那时候还没有IP卡,电信还
没分家,话费还没降下来,电话花了我50块钱,大概是月生活费的1/3.
不过那会我在学校也有收入了,我的收入让我父母担心是不是我在外面干了什么坏事。
本来想昨天写这篇,没想到昨天一直忙到晚上9点才走。马上就要从一个我很仰慕的公司
跳到一个我很鄙视的公司了,走之前还要把手里的事做好。添了一百多个数据,检查了
两遍,传到公司的内部wiki上。再开车1个小时40公里回家。
刚刚过去的面试,人家让我自己介绍一下工作经历,我把从95年到现在10年重新描述了
一遍,简短的,只能是简短的,要不然就时间太长了,大家的时间都很宝贵,那就不要浪费了。
开车回家的路上,我听着许巍的《那一年》。
那一年.许巍
    那一年 你正年轻
    总觉得明天肯定会很美
    那理想世界就象一道光芒
    在你心里闪耀着
    怎能就让这不停燃烧的心
    就这样耗尽消失在平庸里
    你决定上路就离开这城市
    离开你深爱多年的姑娘
    这么多年你还在不停奔跑
    眼看着明天依然虚无缥缈
    在生存面前那纯洁的理想
    原来是那么脆弱不堪
    你站在这繁华的街上
    找不到你该去的方向
    你站在这繁华的街上
    感觉到从来没有的慌张 ……..
    你曾拥有一些英雄的梦想
    好象黑夜里面温暖的灯光
    怎能没有了希望的力量
    只能够挺胸勇往直前
    你走在这繁华的街上
    在寻找你该去的方向
    你走在这繁华的街上
    再寻找你曾拥有的力量

分类: chating 标签:

如何在空的cvs repository里加一个module

2005年7月28日 hufey 评论已被关闭

先cvs checkout -l -d dir .
-l 是 local的意思
-d是指定的目录
然后 cd dir
把module原来的目录copy过来
然后cvs add moduledir
然后cvs commit
然后进入moduledir
再cvs commit

分类: saving 标签:

存档:Setting up a Win32 Toolchain with SDL and wxWidgets in Gentoo

2005年7月27日 hufey 1 条评论

Setting up a Win32 Toolchain with SDL and wxWidgets in Gentoo
Everyone of us always wanted to have the ability to compile for Windows and Unix in one makefile, right?
Unfortunately, there is very few documentation on this topic and I had quite a hard time to get things working the way I wanted to. I wrote this small HOWTO to share the way I managed to build my toolchain to other people.
I like writing games and most gamers use Windows. I didn’t want to leave my Linux setup to compile the games for Windows, so I needed a MingW toolchain with SDL and wxWidgets, for those are the two cross platform APIs I use.
Compiling the toolchain
Here we can go with ebuilds, there are some nice in the portage tree:
emerge xmingw-binutils
emerge xmingw-gcc
emerge xmingw-w32api
emerge xmingw-runtime
emerge xmingw-gcc
You have to do it in this order and you have to compile gcc twice, yes. If you don’t you wont get a c++ compiler, i don’t know exactly why.
Gentoo will put the toolchain into /opt/xmingw.
Setting the environment variables
Everytime you want to compile something for Windows, you have to set some environment variables first. The best is to put them into a small script:
export PATH=”/opt/xmingw/bin:/opt/xmingw/i386-mingw32msvc/bin:$PATH”
export CC=”i386-mingw32msvc-gcc”
export CXX=”i386-mingw32msvc-g++”
unset CFLAGS
unset CPPFLAGS
unset CXXFLAGS
unset LDFLAGS
export CFLAGS=”-I/opt/xmingw/i386-mingw32msvc/include”
export CXXFLAGS=”-I/opt/xmingw/i386-mingw32msvc/include”
After you have set the environment variables you can configure a program to compile for Win32 by running ./configure –target=i386-mingw32msvc –host=i386-mingw32msvc –build=i386-linux
Compiling SDL
Download the latest cvs version of SDL from here. Untar it into a working directory and cd into SDL-1.2/. Now run your script to set the environment variables mentioned above. After that you can configure SDL:
./autogen.sh
./configure –target=i386-mingw32msvc –host=i386-mingw32msvc
–build=i386-linux –enable-cdrom –enable-threads –enable-timers
–enable-endian –enable-file –enable-cpuinfo –enable-opengl
–disable-shared –prefix=/opt/xmingw/i386-mingw32msvc
–disable-shared will even remove the dependency on SDL.dll, if you don’t want that, leave this parameter out.
Now you can call make and make install. If you have to su to run make install, don’t forget to set your environment variables again (I forgot that at first).
Now for a little tweak: cd into /opt/xmingw/i386-mingw32msvc/bin and create a symbolic link.
ln -s i386-mingw32msvc-sdl-config sdl-config
This way, if you run sdl-config in your Makefile, the right sdl-config will be executed. (wxWidgets does this automatically for wx-config)
Compiling wxWidgets
Download a wxAll package from here. I used 2.4.2, I didn’t try any newer versions. Untar it and cd into wxWindows-2.4.2/.
Don’t forget to run your environment script and then run
./autogen.sh
./configure –target=i386-mingw32msvc –host=i386-mingw32msvc –build=i386-linux –with-msw –disable-threads –disable-shared –disable-unicode –with-opengl –prefix=/opt/xmingw/i386-mingw32msvc
I recommend to disable threads because else the programs will depend on some MingW libraries. You should also disable shared, because else the programs will depend on the wxWidgets libraries (and I think I ran into some more trouble). If you don’t disable unicode, the programs will only work on WinNT/2k/XP, not on 9x.
After that you can run make and make install just like you did for SDL.
Now you should have a fully working MingW+SDL+wxWidgets toolchain. I compiled 2 games I made and they ran fine in wine after compiling. I didn’t test them on Windows, yet but I strongly believe they will run. If you run into troubles, please report them to me.

分类: saving 标签:

MV Linux Smartphone全家福

2005年7月20日 hufey 评论已被关闭

Motorola A768

E680i

E680

A760

A780

E895

NEC N901iC

N700i

N900il

Panasonic P700i,

P901i

分类: watching 标签:

iCat

2005年7月16日 hufey 评论已被关闭

分类: watching 标签:

引擎運作的動畫圖解

2005年7月13日 hufey 评论已被关闭

四衝程引擎運作的四個階段動畫圖解

二衝程引擎運作的兩個階段運作動畫圖解

四衝程V型6汽缸引擎的運作

四衝程並列四汽缸引擎的運作

四衝程水平對向四汽缸引擎的運作

四衝程並列四汽缸的凸輪軸及閥門運作

分类: watching 标签:

cvs list modules/tags

2005年7月12日 hufey 评论已被关闭

list modules:
cvs co -c
list tags:
cvs history -a -T

分类: saving 标签:

sun中国研究院的院长被微软挖走

2005年7月10日 hufey 评论已被关闭

看到一片新闻说微软要成立个啥部门在中国,头是宫力
宫力?好像听说过,一goog,原来是Sun中国研究院的头
goog到的连接有一片是他演讲如何用linux 打击m$的
呵呵

分类: chating 标签: