February 2008 Archives

PHP connect DBF file update

| No Comments

I posted PHP connect DBF file with a sample. Now Pierre left the message and asked why error comes up.

I doing some tests and get the answer.

1) The database.dbf is reserved name.

2) The field name is always capital.

2008 RRSP tips for Canadian

| No Comments

1) Start early and invest regularly
Regular investing puts the power of compound growth on your side. And the earlier you start, the more you may have in the future.

2) Reduce taxes today
RRSPs are designed to help build your financial future and the contributions have the added benefit of being tax deductible. By making RRSP contributions on every pay day, you can take advantage of potential and immediate tax savings - by asking your employer to deduct less tax off your paycheque.

I recommend TaxCut by H&R Block
to prepare your 2007 tax return for USA residents.

3) Think global
As Canada makes up only about 4% of global stock market capitalization1, global investments can play an important role in reducing risk and increasing return potential. A portfolio made up of several types of investments from different countries may be stronger over the long term - and less exposed to risk - than one that's invested in a single country, asset class or type of investment. That's why a sensible approach for most investors is a globally diversified portfolio that includes Canadian and international stocks, combined with fixed income investments.

4) Consider an asset mix strategy
It is important to have the right asset mix as studies show that asset allocation is the key driver of a portfolio's performance. 2 Typically, as you get closer to retirement your mix should become more conservative to emphasize asset preservation over growth. Conversely, younger investors with more time before retirement can afford to be more aggressive in their approach.

Tax season coming

| No Comments

It is tax season again. I introduced Tax$imple last month.
It is easy and simply to use. Start from $14.95.

Now I would like to introduce another one. One of the most famous Tax Software.

Premium + State Taxcut Software by H&R Block

They offer a range of products, all of which are supported by H&R Block tax professionals:

* With our software and online tax solutions, access to a real, live tax pro is available -- so you will never get stuck. Guaranteed. Help is just an email or phone call away! * Those who e-file their federal returns receive audit representation from an IRS-Licensed Enrolled Agent should it be necessary.

The premium version is $19.95. But you still can find the online version to meet your tax filing needs.
Check their TaxCut Online Product Comparison Chart. The Basic + E-file is only $14.95.

Google Chart API

| No Comments

Google introduced it Chart API last December.
For reference, I noted here my tips.

I need a 3D Pie chart. The code should looks like below:

<img src="http://chart.apis.google.com/chart?cht=p3&chd=t:50,10,40&chs=500x200&chl=PR|HTTP Status|Whois"/>

The code can break down as shown here:
"cht=p3" is the chart type, in this case, a 3D pie chart.

"chd=t:50,10,40" are the chart values, text-encoded, and separated by a comma.
The number should be ranged from 0 to 100.

"chs=500x200" is the custom chart size, 500 by 200 pixels.

"chl=PR|HTTP Status|Whois" are the different labels for the pie chart sections, separated via the pipe character. Chinese is not supported by Chart API.

chart types include: line charts, bar charts, pie charts, Venn diagrams & scatterplots.

Dreamhost has a one-click install function. It is easy to install a new program. Now I will go through the Joomla! 1.5 installation.

In the Web Panel of Dreamhost, choose googies > One-Click Install
Choose the Joomla! 1.5 and site/directory to be installed, and also give the name of database.

Later, I receive an email tell the steps of installation. I added some screenshot on it to make it vivid.

Site: http://www.yourdomain.com/

Now visit the site to finish your installation with these settings:

1 : Language
select 'en-GB - English (United Kingdom)' and click Next
joomla15_install_1.gif

2 : Pre-installation Check
click Next
joomla15_install_2.gif

3 : License
click Next
joomla15_install_3.gif

Stop cron emails at Dreamhost

| No Comments

I have some site on the Dreamhost. To monitor the traffic and performance, I have Awstats on site and runing many cron jobs every day. I have the experience of how to install AwStats on the Ubuntu server.

The cron job is runing well on the Dreamhost server. The problem is I will receive tons of email about the job status.

Actually, I don't need these emails. If the job is completed successfully, the Awstats report should be updated. I checked the report often. So the fail of job is not my concern.

To disable cron emails, just add one line code as shown below:
First SSH server.

$ crontab -e

add this line to the top of your cron file:

MAILTO=""

That's simple. No more cron emails coming.

Repaire corrupted MyISAM tables

| No Comments

To repare the corrupted MyISAM tables, just cd to the directory that holds the MyISAM datafiles, then run this:

$ myisamchk -r -q table_name

If it doesn't work, try this command,

$ myisamchk --safe-recover table_name

The above two commands can fix most of the problems of MyISAM tables.

MySQL is very popular. Many open source or free software use MySQL as their main database engine.

To make our data safe, please remember to backup your data regularly.
There are two methodologies you can use to back up MySQL databases without spending money.

The first is to create a series of SQL statements that rebuild one or more databases. This is usually accomplished via the mysqldump script.

The second is to copy the database files themselves if you can ensure they're not being changed during the backup. This is currently possible only for MyI*SAM archive tables using the mysqlhotcopy script.

Let's go into the details of how to back up MySQL database.

Backing up MyISAM tables
The folloing command creates a SQL dump of all MySQL databases in a given instance, locks all tables as necessary, flushes the logs, and writes the name of the current binary log to the output. The second command couses MySQL to switch binary logfiles so that you can back up the logfiles that was used during the backup.

No matter which type of selector we want to use in jQuery - be it CSS, XPath, or custom - we always start with the dollar sign and parentheses: $()

$() Factory Function
Let's see some more common examples:
A tag name: $('p') gets all paragraphs in the document.
An ID: $('#some-id') gets the single element in the document that has the corresponding some-id ID.
A class: $('.some-class') gets all elements in the document that have a class of some-class.

CSS Selectors
Chile combinator
>

$('#selected-id > li')

Find each liste item (li) that is a child (>) of an element with an ID of selected-id (#selected-id).

Negation pseudo-class
not

$('#selected-id > li:not(.horizontal)')

Find each list item that do not have a class of horizontal, which is a child of #selected-id.

I have a HTTP status check online tool here. It is made by PHP with cURL extension.

The trouble is some responses are good. Someone tell me that the url should be 302 redir or 200 Ok, but the tool shows 403 Forbidden.

After doing some search and study, I find the problem of some server that don't accept the Header request only.

Anytime you set the option...

PHP Code:

curl_setopt($ch, CURLOPT_NOBODY, true);


CURLOPT_NOBODY automatically shifts the request to a HEAD, type request, so most servers don't allow HEAD type requests, results most times in 403 errors, so you use...

PHP Code:

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');


So cURL, will send the request as GET or POST, but still only really make a HEAD request because the CURLOPT_NOBODY flag was set to true, which causes cURL to read only up to the end of the response header.

basic of basic

| No Comments

1) $() function is actually a factory for jQuery object. It is the object encapsulates zero or more DOM dlements.

2) .addClass() and .removeClass()
They are fairly self-explanatory.
Its only parameter is the name of the class to add or remove.

Here are two samples.

jQuery category created

| No Comments

From today, I will start to learn jQuery framework. I compared the popular five Ajax toolkits, including jQuery. Now I choose jQuery as my Ajax toolkit.

I will build a Inout Board system by PHP, MySql and jQuery. To replace current Pentacle InOut Board based on the ASP and Access.

There is category, Ajax, in this blog. I changed it to jQuery to focus on the jQuery only.

OK, I will put some notes or tips of jQuery into David Yin's Blog - jQuery.

XP upgrade on Feb. 2008

| No Comments


This is Windows XP February 2008 upgrade.

winxp_upgrade_200802.jpg

I got the invitation from Microsoft to join their Advertisement network as a Advertiser.
It is similar to the Google's AdWords.

I left my email to Microsoft adCenter because it accepted US customers only last year. Now it is open to Canadian,

I just registered, and added one ad campaign with one ad group.
Let me see how performance and will compare it with AdWords.

What is MM_CASETEST4291

| No Comments

I am noticed that one strange folder name on my hosting.
MM_CASETEST4291
It is an empty folder.

After some search, I found it is a temporary folder which is used to test server connection and writing permission.

MM_CASETEST4291 is created by Dreamweaver. It is designed to create a folder, then delete it.

So I remove this folder by commend

rm -r MM_CASETEST4291

No hacking, no pain. Safe.

You can also doing some search by Google to see the indexed empty MM_CASETEST4291 folder. Follow the parent path, you can find some interesting thing.

Dreamhost's Newsletter mentioned that the One-Click feature is improved.
WordPress One-Click is easier.

I do not try the brand new easy install. I just use it upgrade feature.

It is very fast and easy. Just click the Upgrade to 2.3.3. The plugins are still OK.
No other operation needed.

Use Saving code G2SAVING when sign up Dreamhost, you can save $50 and get 1 extra FREE lifetime domain registration.

XBMC is the best media center on XBOX.
To upgrade the XBMC, doing the following steps.

1) FTP to XBOX by IP address. say 192.168.0.123

2) Backup the following files and delete them from the XBOX

e:\apps\xbmc
e:\udata\0face008\
e:\tdata\0face008\

3) Upload the latest XBMC you download.

The upgrade is very simple. Just uploading, then finished.


How to config it to Chinese interface?

Another security upgrade is out for WordPress. This one is fairly urgent, as it allows other members of your blog to "hijack" posts not written by them.

From WordPress Development Blog.

WordPress 2.3.3 is an urgent security release. If you have registration enabled a flaw was found in the XML-RPC implementation such that a specially crafted request would allow a user to edit posts of other users on that blog. In addition to fixing this security flaw, 2.3.3 fixes a few minor bugs. If you are interested only in the security fix, download the fixed version of xmlrpc.php and copy it over your existing xmlrpc.php. Otherwise, you can get the entire release here.

Please upgrade to the latest version as soon as possible.

Regular Expression Library

| No Comments

When I am doing some programing, I may need the Regular Expression rule to validate the data user submit.

It is used to protect the program and save the resource of server.

To write a perfect Regular Expression Rule is not easy. You need try and try, test and test.
Until I found this site , Regular Expression Library.

I choose this one to test the URL user entered.

^(http|https)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*$

It works well.

Regular Expression Library has lots of expression. You always can find one suitable for your needs.

It is a little bit early to say Happy Chinese New Year.

Feb. 7 is the Chinese New Year's Day.
Year of The Rat
070721135732641.jpg

Gong Hei Fat Choi

Big Big News - Microsohoo

| No Comments

Microsoft has officially entered a bid to buy Yahoo for $44.6 billion, just days after Yahoo cut staff by 1,000 employees. And Microsoft is clearly hoping to use Yahoo to gang up on search giant Google. On a conference call Friday, Microsoft CEO Steve Ballmer called a combination of Microsoft and Yahoo a more "credible" alternative to Google in the online advertising and services market. "By combining the assets of Microsoft and Yahoo we can offer a more competitive choice for consumers, advertisers and publishers," he said.

Yahoo's stock is up nearly 50% (28.71 per share) in morning trading.


Microsoft Offers $44.6 Billion for Yahoo
Microsoft's Bid For Yahoo

About this Archive

This page is an archive of entries from February 2008 listed from newest to oldest.

January 2008 is the previous archive.

March 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02

Subscribe

Online Tools

Code Convertor