Recently, I found Godaddy.com was advertising a new hosting package called “4GH Web hosting” and it was claimed to be the “4th generation hosting”, which is cloud-based, “revolutionary”, even better than Rackspace, GoGrid etc. I was intrigued and signed up. The result? It’s been quite disappointing. If you’ve been using other hosting services and familiar with [...]
Continue reading...Monday, December 12, 2011
1. preg_match(): if (preg_match("/php/i", "PHP is the web scripting language of choice.")) { echo "A match was found."; } Note: $matches[0]will contain the text that matched the full pattern, $matches[1] will have the text that matched the first captured parenthesized subpattern, and so on. $str = http://www.php.net/index.html; if (preg_match('@^(?:http://)?([^/]+)@i', $str, $matches) { $host = [...]
Continue reading...Monday, December 12, 2011
1. Retrieving a Path’s Filename: $path = '/home/www/data/users.txt'; $file_nm = basename($path); // "users.txt" $file_nm_1 = basename($path, ".txt"); // "users", no extension. 2. Retrieving a Path’s Directory: $path = '/home/www/data/users.txt'; $dir_nm = dirname($path) // "/home/www/data" 3. Learning More about a Path: $pathinfo = pathinfo('/home/www/htdocs/book/chapter10/index.html'); echo $pathinfo['dirname']; // "/home/www/htdocs/book/chapter10" echo $pathinfo['basename']; // "index.html" echo $pathinfo['extension']; // "html" [...]
Continue reading...Monday, December 12, 2011
1. Checking Whether a File Exists: if (file_exists("testfile.txt")) echo "File exists"; 2. Reading from Files: Method 1: Using fgets() to read one line a time: $fh = fopen("testfile.txt", 'r') or die("Cannot open file."); while (!feof($fh)) { $line = fgets($fh); $out .= $line; } fclose($fh); Method 2: Using file_get_contents() to read the entire content: [...]
Continue reading...Wednesday, December 7, 2011
Before registering a new Facebook application, you need to make sure you have verified your Facebook account. There’re two ways to verify your developer account: 1. You can confirm your phone number at the fololowing URL: http://www.facebook.com/confirmphone.php 2. You can verify your Facebook account by adding your payment (credit card information) at here: https://secure.facebook.com/cards.php Once [...]
Continue reading...Tuesday, September 27, 2011
If you have an iPod Touch (for example, iPod Touch 4), you might know that it’s more or less like an iPhone without the capability of making phone calls. You might wonder: how nice would it be if I can make phone calls from my iPod Touch? Yes, since an iPod Touch is much cheaper [...]
Continue reading...Tuesday, July 20, 2010
Below are steps to allow Kindle to display Chinese characters (汉化). It should work for the most current versions of Kindle 2 and Kindle DX. The one I used myself is Kindle DX Graphite International Version 2.5.5.
Continue reading...Wednesday, July 14, 2010
Recently I bought a new Kindle. It's pretty cool and easy to use. However, there's one question that puzzled me: Should I turn my Kindle off when not using it?
Continue reading...Saturday, April 17, 2010
最近发现了一个免费的网络工具——Dropbox。这个工具可以用来为电脑上的文件进行网络备份,还可以当作一个文件同步工具使用。 假如你同时拥有好几台电脑,你可以在每台电脑上都安装一个Dropbox软件,当你在其中任意一台上把文件存在Dropbox指定的文件夹里时,这些文件就会自动在Dropbox的服务器上备份,并且可以显示在你其它的电脑上,这样一来,你就不需要很费力气地使用U盘在不同电脑间复制、传输文件了。 Dropbox可以实现很多有用的功能,比如:同步文件夹、同步MSN和QQ聊天记录、同步文档、同步桌面、同步IE收藏家、网站自动备份等等。 Dropbox是一个免费的软件,目前为每个账户提供2G的免费空间。下载、注册Dropbox请按这里。
Continue reading...Thursday, January 28, 2010
图书封面设计是一项看似容易实则很难的工作。一个好的封面设计不但可以吸引读者的眼球,还能通过一个画面传达那本书的涵义。而且,更困难的是,封面设计师为了能让读者过目不忘,他需要让封面具有独特性和创造性。 下面是一些国外的的图书封面设计的例子,供大家学习、参考。
Continue reading...
Saturday, January 7, 2012
0 Comments