Dec 28, 2009
当然了,这里的目的是用css来针对浏览器的不同控制排版。
<?php
if(extension_loaded('zlib')){ob_start('ob_gzhandler');}
header("Content-type: text/css");
$UA=$_SERVER['HTTP_USER_AGENT'];
if (eregi("mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|m50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |sonyericsson|samsung|240x|x320vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile|ipod|iphone|android|opera mini|blackberry|palm os|palm|hiptop|avantgo|fennec|plucker|xiino|blazer|elaine|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile",$UA) == 1 )
{
include($_SERVER['DOCUMENT_ROOT']."/wp-content/themes/default/mobile.css");//可以替换成其他针对手机浏览器的语句
}
else
{include($_SERVER['DOCUMENT_ROOT']."/wp-content/themes/default/style.css");}
if(extension_loaded('zlib')){ob_end_flush();}
?>
Nov 14, 2009
和APE格式类似,FLAC格式用来听古典是相当不错的,压缩比高,没有任何的音质损失。
网上也有不少Flac的资源,但其缺点也和APE格式类似,就是无法支持随身听这类的音频播放器。
其实要把Flac格式转换成MP3很简单,只要用Winamp和Monkey’s Audio就可以了。
- 安装且打开Winamp,然后按Ctrl+P呼出Prefenences窗口,在Plug-ins的output界面中选择Nullsoft Disk Writer。
- 呼出该窗口后有一些设置,建议保存目录设置成和源文件同一个目录。
- 关闭Winamp,再重新打开后,按 L 键选择你所要转换的Flac文件,Winamp就会自动得将Flac格式转换成Wav格式。
- 接下来,用我之前介绍过的方法,用Monkey’s Audio再将Wav格式转换成MP3格式就可以了。
- 另外,对于那种一张碟一个Flac文件的,我们可以用Medieval CUE Splitter这款软件来先分割一下。
- 全部完成后,还要记得将刚才改动过的Winamp->Prefences->Plun-ins->Output中改回Nullsoft DirectSound Output选项。
Oct 13, 2009
Geohot released BlackRa1n for iPhone 3.1.2. But many ppls report that it did NOT work.
The following is my solution, actually, I tried it for more than 30 times. So, please be patient
My condition:
Running winxp sp3 with iPhone 3G 8g black w/ 3.1.2
I tried more than 30 times and finally see Geohot’s face.
1. reboot computer
2. open the following services:Telnet, Messenger and Terminal Service
3. kill any iTune related programs:iTunes Helper. mdnsresponder, iPodService
4. turn off/hard reset your iPhone and connect to your pc via USB cable
5. run blackRa1n, click "make it rain"
6. hold power and home button of your iPhone, release power until you see Apple logo. Continue holding "Home" and you will see Geohot’s face.
I repeat steps 4-6 for more than 30 times and finally get it done.
Sep 1, 2009
一直很鄙视Excel,觉得这软件做的不咋地。
但最近看了本书后发现原来是自己太土鳖,这玩意儿的功能强大着呢。
举个简单的例子就是级数求和。
之前要算100项的级数求和的时候,我都是用它的自动填充的方法,一拖拖出100行来。这个对收敛快的还成,如果是要进行Monte Carlo Simulation就麻烦了。
但现在发现用它的矩阵功能,许多要拖几百行的计算,一个cell里就搞定了……
比方说要计算π值,这里我们选这个比较彪悍的级数:

在Excel里就可以表示成:
{=2*SUM(FACT(ROW(INDIRECT("1:50")))/FACTDOUBLE(2*ROW(INDIRECT("1:50"))+1))+2}
一个cell就能搞定。
有兴趣的可以下载这个excel文件回去研究一下。
更多的功能还在开发中……
Aug 8, 2009
Acid Test 是一系列由 Web 标准组织编写的针对网页浏览器的测试页面(不是软件)。
浏览器开发者用这些测试页面来验证自己的产品是否能够精准的还原页面编写者的设计。他们看起来都很简单,但是背后的代码都异常复杂。
http://acid3.acidtests.org/ (支持CSS3,用分数来显示浏览器的排版情况)
http://acid2.acidtests.org/ (支持CSS2,用一个笑脸来显示,正常情况上方显示Hello World,当鼠标指向笑脸鼻子的时候鼻子会变成蓝色。)
http://acid1.acidtests.org/ (支持CSS1,最土鳖的检测方式,不好玩)
检测的结果,Google Chrome最彪悍,全都满分。Firefox其次,有些小瑕疵。IE7则惨不忍睹,我真服了微软的研发部门了,因为IE8虽然做这个测试还行,在其他方面兼容性太差……。
所以,浏览器还是选Chrome或者是Firefox吧。
Jul 18, 2009
Google has released Google Chrome for quite a long time. I love Google’s products however, I didn’t think about to move to Google Chrome from my firefox because it lacks of the powerful plugins database.
Now it’s the time to change it because I found the new version (2.0) of Google Chrome works quite well---with a little customization:
1) the fastest browser: GC is faster than IE8, Safari 3, FF 3.5. Not only the loading speed, but the running time. Now you can find many articles about this issue and the winner is always--GC
2) incognito mode: No traces will leave.
3) you don’t need to install many plugins to optimize your browers, just some useful customization.
- Mouse Gesture:
Mouse Gesture Redox is a famous firefox addon which provide easy function with your mouse.
I use Strokeit to achieve this function in GC.
- Gmail Signature:
Gmail Signature is another good firefox addon I used. Now I use a web email signature generator as the substitute.
- User JavaScript and others:
Please use
"C:\Program Files\Google\Chrome\Application\chrome.exe" --enable-user-scripts --user-data-dir="E:\Temp\Chrome Cache"
To enable your own JavaScript. Copy the script to folder
E:\Temp\Chrome Cache\Default\User ScriptsPlease note [--user-data-dir="E:\Temp\Chrome Cache"] will start GC by putting all GC data into E:\Temp\Chrome Cache. And it can be any folder you prefer.