星期二, 七月 08, 2008
学VIM的好处
文本模式播放电影
fullscreen
!sudo mplayer -ao alsa:device=dmix -vo sdl cantgoback2.wmv
!sudo mplayer -ao alsa:device=dmix -vo svga cantgoback2.wmv
center screen
!sudo mplayer -ao alsa:device=dmix -vo ggi cantgoback2.wmv
with console (partial sceen)
!sudo mplayer -ao alsa:device=dmix -vo fbdev cantgoback2.wmv
!sudo mplayer -ao alsa:device=dmix -vo fbdev2 cantgoback2.wmv
ascii
!sudo mplayer -ao alsa:device=dmix -vo caca cantgoback2.wmv
星期一, 七月 07, 2008
remove columns from datatable
for (int i = 0; i < dt.Columns.Count; ++i)
{
if (dt.Columns[i].ColumnName == "IMS")
dt.Columns.RemoveAt(i--);
}
Read excel using c#
using System.Data.Odbc;
//add code after InitializeComponent();
OdbcConnection con = new OdbcConnection(@"Driver={Microsoft Excel Driver (*.xls)};DBQ=filename.xls");
OdbcCommand cmd = new OdbcCommand(@"SELECT * FROM [Sheet1$]");
cmd.Connection = con;
OdbcDataAdapter da = new OdbcDataAdapter(cmd);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
星期日, 七月 06, 2008
星期六, 七月 05, 2008
补一下XFCE的安装方法,就是这么简单
sudo apt-get install xubuntu-desktop
下载50兆左右吧. 安装后100兆.也不大.小意思.
三四分钟就搞定了.我在想是不是可以TTY1进XFACE,TTY2进GNOME...真变态...觉得是可行的,怕机子受不了,还没试...
刚安装了XFACE,这是进入的方法
startxfce4
then I can start xfce4
also by.adding
代码:
/usr/bin/startxfce4
into ~/.xinitrc .then type startx ,I can start xfce
网上抄来的, 呵,XFACE虽说是轻量,我打开时怎么觉得它还更漂亮....比GNOME
星期五, 七月 04, 2008
ubuntu text mode 终于成功上水木了
首先就是ZHCON要设好,之前因为 defaultencode 用默认的 gb2312, 所以上水木虽然有中文,但是花屏.上水木要把GBK转UNICODE,命令如下
luit -encoding GBK telnet newsmth.net
这是从网上看来的,想到GBK,所以我就把 defaultencode 改成 gbk, 没想到就搞定了. 也许不改的话用 luit -encoding gb2312 telnet newsmth.net 也是可以的,就不想去试了.再把LYNX或W3M等上网的乱码搞定,就爽了.
星期四, 七月 03, 2008
zhcon 黑屏和分辨率解决了
2, /etc/modprobe.d/blacklist-framebuffer ->注释掉vesafb 那行
3, update-initramfs -u
我不知道这三步是不是有效,因为我看了其它一些资料,只做了第四步,所以我把第一二步改回来了.
原来使用的是 zhcon --uft8 --drv=vga , 这次改成 zhcon --drv=fb , 就解决了,分辨率变成800*600了,试着退出也不会黑屏.酷.对了,顺便说一下,之前黑屏的时候,只要盲打zhcon --utf8 --drv=vga , 就可以再次进入zhcon, 又可以看见东西了. 不需要通过终端重启.
ubuntu 改变分辨率后退出ZHCON黑屏
修改ubuntu 7.10 文本模式分辨率(摘)
2, /etc/modprobe.d/blacklist-framebuffer ->注释掉vesafb 那行
3, update-initramfs -u
4,/boot/grub/menu.lst 在kernel那一行最后加上 vga=794(794代表1280x1024,791代表1204x768)
5,重启
color depth 640x480 800x600 1024x768 1280x1024 1400x1050 1600x1200
256(8bit) 769 771 773 775
32000(15bit) 784 787 790 793
65000(16bit) 785 788 791 794 834 884
16.7 Mill.(24bit) 786 789 792 795
我在8.04下,我改成了771,的确有用.而且不影响X11的分辨率,就是UBUNTU的启动画面变成巨大,屏幕装不下了.
星期三, 七月 02, 2008
PUTTY的可爱之处
ubuntu 声卡独占(摘)
默认情况下mplayer会独占声卡设备,导致其他程序无法同时输出声音。这可 以通过使用alsa的mixer来解决。
命令行的形式为:
mplayer -ao alsa:device=dmix <input-file>
mplayer -ao alsa *.mp3
也可以在其配置文件中加入下面内容来指定:
ao=alsa:device=dmix
windows 下的播放列表在UBUNTU下不能听了
星期二, 七月 01, 2008
UBUNTU 装个声卡 好辛苦
开始是毫无头绪,后来知道要用ALSA,然后就去ALSA的网站下载 ALSA 驱动包, 开始我只下了 DRIVER那个包,后来才知道还要 LIB 和UTIL那两个包. 都下好了, 又装不了, 好像后来是装了 build essential 才让编译. 后来编译某个东西又不让了,说缺少某个文件. 以为自己下错了呢...又去下过,又从新试还是不行. 后来搜到解决方法,就是把缺的文件补上去, 创建空文件就行了. 最后就是那个 alsamixer 了, 不管怎么弄都是 alsamixer: function snd_ctl_open failed for default: No such file or directory. 后来在这个贴子上用它的方法查声卡.
http://ubuntuforums.org/showthread.php?t=205449
我的电脑上是显示没有声卡呀, 用 LSPCI也列不出声卡. 后来用了 ALSACONF 居然就找到声卡了. 识别出是CS4236B (我之前以为是 CS4232), 不过我把所以驱动都装了, 所以没所谓. 从新运行 sudo modprobe snd-cs4236. 再运行 ALSAMIXER就没问题了.只不过那个小喇叭上还是有个禁用的符号,我一度认为没有成功. 后来把音箱和音量都开到最大才发现是有声音的.反正装个声卡装得命都没了.搞了快两天了. 为了查资料方便, 我又把笔记本硬盘换成 WIN2003 那个. 苹果那个系统到现在还有很多问题. 都快不想搞了.
alsa util compile error
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether NLS is requested... yes
checking for msgfmt... no
checking for gmsgfmt... :
checking for xgettext... no
checking for msgmerge... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for cross-compiler... gcc
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ALSA CFLAGS...
checking for ALSA LDFLAGS... -lasound -lm -ldl -lpthread
checking for libasound headers version >= 1.0.15... found.
checking for snd_ctl_open in -lasound... yes
checking for snd_tlv_get_dB_range... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for initscr in -lncurses... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGE_FILES value needed for large files... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating alsactl/Makefile
config.status: creating alsamixer/Makefile
config.status: creating amidi/Makefile
config.status: creating amixer/Makefile
config.status: creating m4/Makefile
config.status: creating po/Makefile.in
config.status: creating alsaconf/alsaconf
config.status: creating alsaconf/Makefile
config.status: creating alsaconf/po/Makefile
config.status: WARNING: alsaconf/po/Makefile.in seems to ignore the --datarootdir setting
config.status: creating aplay/Makefile
config.status: creating include/Makefile
config.status: creating iecset/Makefile
config.status: creating utils/Makefile
config.status: creating utils/alsa-utils.spec
config.status: creating seq/Makefile
config.status: creating seq/aconnect/Makefile
config.status: creating seq/aplaymidi/Makefile
config.status: creating seq/aseqdump/Makefile
config.status: creating seq/aseqnet/Makefile
config.status: creating speaker-test/Makefile
config.status: creating speaker-test/samples/Makefile
config.status: creating include/aconfig.h
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing depfiles commands
feng@feng-desktop:~/桌面/alsa-utils-1.0.16$ make
Making all in include
make[1]: Entering directory `/home/feng/桌面/alsa-utils-1.0.16/include'
make all-am
make[2]: Entering directory `/home/feng/桌面/alsa-utils-1.0.16/include'
make[2]: Leaving directory `/home/feng/桌面/alsa-utils-1.0.16/include'
make[1]: Leaving directory `/home/feng/桌面/alsa-utils-1.0.16/include'
Making all in alsactl
make[1]: Entering directory `/home/feng/桌面/alsa-utils-1.0.16/alsactl'
if gcc -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -MT alsactl.o -MD -MP -MF ".deps/alsactl.Tpo" -c -o alsactl.o alsactl.c; \
then mv -f ".deps/alsactl.Tpo" ".deps/alsactl.Po"; else rm -f ".deps/alsactl.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -MT state.o -MD -MP -MF ".deps/state.Tpo" -c -o state.o state.c; \
then mv -f ".deps/state.Tpo" ".deps/state.Po"; else rm -f ".deps/state.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -MT names.o -MD -MP -MF ".deps/names.Tpo" -c -o names.o names.c; \
then mv -f ".deps/names.Tpo" ".deps/names.Po"; else rm -f ".deps/names.Tpo"; exit 1; fi
gcc -g -O2 -o alsactl alsactl.o state.o names.o -lasound -lm -ldl -lpthread
make[1]: Leaving directory `/home/feng/桌面/alsa-utils-1.0.16/alsactl'
Making all in alsaconf
make[1]: Entering directory `/home/feng/桌面/alsa-utils-1.0.16/alsaconf'
Making all in po
make[2]: Entering directory `/home/feng/桌面/alsa-utils-1.0.16/alsaconf/po'
mv: 无法对 "t-ja.gmo" 执行 stat 调用: 没有该文件或目录
make[2]: *** [ja.gmo] 错误 1
make[2]: Leaving directory `/home/feng/桌面/alsa-utils-1.0.16/alsaconf/po'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/feng/桌面/alsa-utils-1.0.16/alsaconf'
make: *** [all-recursive] 错误 1
feng@feng-desktop:~/桌面/alsa-utils-1.0.16$
Ubuntu 编译 问题
configure: error: C compiler cannot create executables
碰到这个问题 只要安装基础包即可
sudo apt-get install build-essential