Sunday, August 31, 2008

Css样式兼容IE6,IE7,FIREFOX的写法

根据FF和IE对一些符号识别的差异,我们可以单独对FF以及IE定义样式,例子:

区别IE6与FF:
background:orange;*background:blue;
区别IE6与IE7:
background:green !important;background:blue;

区别IE7与FF:
background:orange; *background:green;
区别FF,IE7,IE6:
background:orange;*background:green !important;*background:blue;
注:IE都能识别*;标准浏览器(如FF)不能识别*;

  • IE6能识别*,但不能识别 !important,

  • IE7能识别*,也能识别!important;

  • FF不能识别*,但能识别!important;



所以标准的写法FF,IE7,IE6:
color:#fff; *color:#000 !important; *color:#ff6600;
firefox:白色,IE7:黑色,IE6:橙色

另外再补充一个,下划线”_”,
IE6支持下划线,IE7和firefox均不支持下划线。

于是大家还可以这样来区分IE6,IE7,firefox:
background:orange;*background:green;_background:blue;
注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面。

Friday, August 29, 2008

Google Get Error

[caption id="attachment_887" align="alignnone" width="300" caption="Google Get Error Page"]Google Get Error Page[/caption]

Thursday, August 28, 2008

Another Xorg.conf

在笔记本上使用usb的鼠标真的是不好受,可能是由于我的这个usb鼠标的原因。再发一次配置。


#
# zhuzhu@cpan.org
#
Section "Module"
Load "dbe" # Double buffer extension
SubSection "extmod"
Option "omit xfree86-dga" # don't initialise the DGA extension
EndSubSection
Load "type1"
Load "freetype"
Load "speedo"
Load "glx"
#Load "synaptics"
EndSection

Section "Files"
RgbPath "/usr/share/X11/rgb"
FontPath "/usr/share/fonts/local/"
FontPath "/usr/share/fonts/misc/"
FontPath "/usr/share/fonts/OTF/"
FontPath "/usr/share/fonts/TTF/"
FontPath "/usr/share/fonts/Type1/"
FontPath "/usr/share/fonts/CID/"
FontPath "/usr/share/fonts/Speedo/"
FontPath "/usr/share/fonts/75dpi/:unscaled"
FontPath "/usr/share/fonts/100dpi/:unscaled"
FontPath "/usr/share/fonts/75dpi/"
FontPath "/usr/share/fonts/100dpi/"
FontPath "/usr/share/fonts/cyrillic/"
FontPath "/usr/share/fonts/vista/"
EndSection

Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse2"
Driver "mouse"
Option "Protocol" "IMPS/2"
# Option "SendCoreEvents" "true"
# Option "CorePointer"
Option "Name" "Logitech USB optical mouse"
Option "Device" "/dev/input/mice"
# Option "Device" "/dev/mouse"
# Option "Device" "/dev/psaux"
# Option "BaudRate" "9600"
# Option "SampleRate" "150"
# Option "AlwaysCore" "true"
Option "ZAxisMapping" "4 5"
# Option "Buttons" "5"
option "Emulate3Buttons" "true"
# Option "Resolution" "800"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "Emulate3Buttons" "true"
EndSection

Section "Monitor"
Identifier "My Monitor"
HorizSync 31.5 - 50.0
VertRefresh 40-90
EndSection

Section "Device"
Identifier "VESA Framebuffer"
Driver "vesa"
#VideoRam 4096
EndSection

Section "Screen"
Identifier "Screen 1"
Device "VESA Framebuffer"
Monitor "My Monitor"
DefaultDepth 24
Subsection "Display"
Depth 8
Modes "1024x768" "800x600" "640x480"
EndSubsection
Subsection "Display"
Depth 16
Modes "1280x800" "1024x768" "800x600" "640x480"
EndSubsection
Subsection "Display"
Depth 24
Modes "1280x800" "1024x768" "800x600" "640x480"
EndSubsection
Subsection "Display"
Depth 32
Modes "1280x800" "1024x768" "800x600" "640x480"
EndSubsection

EndSection

#Section "InputDevice"
# Identifier "Synaptics"
# Driver "synaptics"
# Option "SendCoreEvents" "true"
# Option "Device" "/dev/psaux"
# Option "Protocol" "auto-dev"
# Option "SHMConfig" "true"
# #带#的为可选项,用来设置边界大小及速度及滚动等。具体见程序synclient.
# Option "LeftEdge" "1700"
# Option "RightEdge" "5300"
# Option "TopEdge" "1700"
# Option "BottomEdge" "4200"
# Option "FingerLow" "25"
# Option "Fingertop" "30"
# Option "MaxTapTime" "180"
# Option "MAxTapMove" "220"
# Option "VertScrollDelta" "100"
# Option "MinSpeed" "0.06"
# Option "MaxSpeed" "0.12"
# Option "AceelFactor" "0.0010"
# Option "SHMConfig" "on"
# Option "RTCornerButton" "2"
#EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Screen 1"
# Each InputDevice line specifies an InputDevice section name and
# optionally some options to specify the way the device is to be
# used. Those options include "CorePointer", "CoreKeyboard" and
# "SendCoreEvents".
# InputDevice "Synaptics" "AlwaysCore"
# InputDevice "Synaptics"
# InputDevice "Mouse1" "CorePointer"
# InputDevice "Mouse2" "AlwaysPointer"
# InputDevice "Configured Mouse" "CorePointer"
# InputDevice "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection

#Section "ServerLayout"
# Identifier "Default Layout"
# Screen "Default Screen"
#在类似的地方再加入下面这一行:
# InputDevice "Synaptics" "CorePointer"
# InputDevice "Keyboard1" "CoreKeyboard"
# InputDevice "Mouse" "SendCoreEvents"
#EndSection

Wednesday, August 27, 2008

Testing On Work Laptop is a Bad Idea

为了测试 kde4.1 (slackware-current)里面的包,我安装了,不过testing的版本的确非常不好,还是换回来了,看到又要折腾一个下午了…… 再也不在工作用的电脑上安装testing的包了,特别是这样大型的桌面环境。

Thursday, August 21, 2008

Python 八荣八耻

以动手实践为荣 , 以只看不练为耻;
以打印日志为荣 , 以单步跟踪为耻;
以空格缩进为荣 , 以制表缩进为耻;
以单元测试为荣 , 以人工测试为耻;

以模块复用为荣 , 以复制粘贴为耻;
以多态应用为荣 , 以分支判断为耻;
以Pythonic为荣 , 以冗余拖沓为耻;
以总结分享为荣 , 以跪求其解为耻;


每日至少抽一刻钟,解答邮件列表中初学者的问题,
每周至少抽两小时,整理新学知识将体验发表/分享出去,
通过Blog/Wiki/MaiList/个人网站……
每旬至少抽四个小时, 来翻译自个儿喜爱的自由软件的文档,
每月至少抽八小时, 快乐的编程,推进自个儿的项目,
每年至少参加一次, 自由软件的活动,传播自由软件思想,
发展一名“自由人”……

只要我们每个人都坚持下去……
10年!就足以改变中国软件的整体风貌!

Tuesday, August 19, 2008

Frontpage hanging CPU on Hostmonster with Cpanel

Frontpage hanging CPU on Hostmonster with Cpanel, It's truth, author.exe cross most cpu time, about 99%, on Hostmonster with Cpanel. Google will find much like this. Such as this. or such as hostmonster server host266.

I think the team of Hostmonster need remove some frontpage  extensions.








From Pic


From Pic


From Pic

Monday, August 18, 2008

使用自由软件测试HTTP服务

一个测试HTTP服务器极限的好方法就是模拟高负载下的HTTP服务器, 有5款自由软件是您的最好选择: curl-loader, httperf, Siege, Tsung, and Apache JMeter.

  • httperf
    测试5000次连接,每次50个请求
    httperf --server=localhost --uri=/ --num-conns=5000 --num-calls=50
    高级应用
    httperf --client=0/1 --server=localhost --port=80 --uri=/ \
    --send-buffer=4096 --recv-buffer=16384 \
    --num-conns=5000 --num-calls=50

    你也可以尝试一下一个更简单的类httperf软件http_load.

  • Siege
    和httperf类似, 上手非常简单
    siege localhost
    利用sproxy连接代理服务器
    sproxy -v -o urls.txt
    使用代理服务器
    siege -v --internet --file=urls.txt



参考文章: http://www.linux.com/feature/143896

Friday, August 15, 2008

Google App Engine 被GFW搞掉了

真的感到非常气愤和无助, GFW, 我们得罪你的吗, 我不期待民主, 不期待法制了, 只期待早日离开这个地方. 越块越好.

Tuesday, August 5, 2008

windows不能登录samba问题

如果遇到Windows在不能登录samba, 就是说不能输入用户名时, 使用 control keymgr.dll 加入对应的主机和用户名即可.

Saturday, August 2, 2008

5 个充满想象力的 Web 调色板

Web 设计离不开调色板,现成的调色板多不胜数,不管是 Windows 标准色板,还是 Web 标准色板,还是 Pantone 色板,它们虽然准确,完整,但缺乏想象力,下面要介绍的 5 个调色板(或者说调色板生成工具)可以激发你的设计想象力。

Kuler
Kuler 是 Adobe 实验室出品的调色板生成工具,完全基于 Flash。你可以创建自己的配色方案,也可以浏览,搜索别人的方案,这些配色方案可以下载为 Adobe ASE 格式并被 Adobe Creative Suite 中的程序调用。

Color Hunter
Color Hunter 是一款基于 flickr 图库的调色板工具,它最有趣的地方是,可以根据 flickr 中的图片,自动生成该图片的色板,你可以通过 Tag 搜索图片,也可以上载本机中的图片。

Color Palette Generator
和 Color Hunter 一样,Color Palette Generator 也是根据图片生成调色板,但比 Color Hunter 简单,但简单的东西可能更好用,你只需要提供任何一幅图片的 URL 地址,该工具会立刻为你生成一个色板。

[caption id="" align="aligncenter" width="407" caption="Color Palette Generator"][/caption]

ColorJack
ColorJack 会显示一个色表,将鼠标指针放在某个颜色上,会显示基于该颜色的配色主题,你可以将生成的配色方案输出到  Illustrator, Photoshop, 或 ColorJack Studio。ColorJack 的其它工具包括 Color SphereColor Galaxy,这两种工具使用不同的用户界面生成配色方案。

[caption id="" align="aligncenter" width="417" caption="ColorJack"][/caption]

Daily Color Scheme
Daily Color Scheme 你可以看到来其它网站的各种各样的配色方案,如 9Rules Logo 配色方案。你可以将这些方案以各种格式下载到 Photoshop, Illustrator 一类的程序。