No public Twitter messages.

Solving PHP has encountered an Access Violation

August 31st, 2009 by Tkjune

In short: it's caused by compatibility of different version of MySQL.
I have installed php + MySQL on two similar servers. The first one was running without any problem while the second one gave me "PHP has encountered an Access Violation". Here is the version of each component:

  • PHP: 5.2.8
  • MySQL: 5.1.34
  • Zend Optimizer: 3.3.3 (The key point)

On the 2nd server, I installed MySQL before PHP. When deploying the web application, "Access Violation" appeared. I reinstalled MySQL, problem solved. I remembered the difference in phpinfo() between 1st server and 2nd server: MySQL Client API version - 5.0.51a vs 5.1.34. Strange that I installed 5.1.34 on both servers, why the 1st one got older version of API? I did not pay more attention on this question for the problem was solved at that time. But after no more than 24 hrs, same problem happened again. This time, I remembered that I forgot to install Zend Optimizer on 2nd server. Then I install it and found that the API version changed to 5.0.51a... Now I know why the 1st server is running well: Zend Optimizer replaced the MySQL API for php.
My experience is proven here, exact same problem.
It teaches me the lesson again, which, though, I already knew but often forgot to apply:
The latest version may not be the best

Welcome, Dell U2410!

August 25th, 2009 by Tkjune

Dell U2410

6 years later, I finally got my new large screen LCD. Costs less, but much lager (17" vs 24").

Dell U2410, what I like most, is the OSD design.  5 buttons with touch sensor and blue LED, when moving fingers over it, the LED turns on automatically. Touch it slightly, the other 4 button LED turn on and the menu appears just next to them. With so detailed settings, U2410 meets all my needs.

I've been thinking of buying a new LCD from last Oct. When doing the coding and designing work, the old pal Maya 17" was not large enough to show so many windows I opened. And it was too dark to watch movies. After all, it's been worked for me for 6 years. 2408WFP was my target at that time. Just one thing: it exceeded my budget. Then I waited and waited. So many times, I would like to step back and get the 22" model, with was so hot and popular too, 2209WA. What a coincidence, 2 days before I making the decision, Hei told me a new model released. This is it. Another dream comes true story.

Take a photo and make a magazine

August 13th, 2009 by Tkjune

Cover creation from Peter Belanger on Vimeo.

God, I still have to take care 48% IE6

July 29th, 2009 by Tkjune

The browser war has so many players in it: IE, Firefox, Chrome, Safari, Opera... and some other mobile browsers. After turning to Mac, I have a delusion that most people are using Firefox, or Safari, or Chrome. When I check the website visitor report, the truth kicks me off from the cloud -- There are still 48% IE6 users visiting the website.
I'm not a super fan of Firefox in Windows, but in Mac, all the fonts looks so nice in any browser (definitely not including IE) and I just don't want to look back to the IE in Windows. Isn't it a nightmare? With the Web Developer and Firebug add-on, Firefox is so powerful a web app development tool. In the meanwhile, the IE develop toolbar looks like a kid. Even in IE8, the improved built-in develop tool bar, has so many limitations. It's killing me.
After complaining so much, I have to face the fact: 48% IE6! The good side is, Firefox and other browsers are stronger than last year. Take Firefox for example, it grows from 7% to 8%.

Guardian in the room

July 15th, 2009 by Tkjune

One day, a visitor came. In green tuxedo, it stood still for over one day. I was very glad with its visiting. More food it had got, happier I would be. You must know it too.
guardian-in-the-room

Mac OS X: Repair "Open With" list in right-click menu

July 9th, 2009 by Tkjune

In Terminal, paste command below and press enter:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

Done,

Google Wave

June 21st, 2009 by Tkjune

Restaurant and review site, interact on mobile

June 15th, 2009 by Tkjune

3G is just lunched in China for not so long. No doubt it's a huge market for the fast network is finally moving on hand. Let the information fill the gaps of life. Finding a restaurant on mobile network is not new. Maybe restaurant and review site can do more inter-activities.

Before, it happens like this: The food hunters like hanging around with their camera. When they find out something delicious, take a photo, enjoy the meal, when they get home, they use computer to post a review on websites, mostly on review sites.

See what we have now: Faster internet connection on hand and high resolution camera build-in mobile phone. That means everybody and do the live review work. Think about the "Customer Comment Book" in some restaurants. Has it been made fully use of? Usually, the boss of the restaurant may see it. Then what? How about encourage customers to comment directly on the web and let more customers see?

This requires the review sites provide a mobile portal which is easy to use, an application for iphone, blackberry and other mobile phones could provide seamless searching and commenting services. The restaurants provide coupon or discount to encourage customers to post a comment directly when they are waiting for the bill.

It meant to be cool

June 15th, 2009 by Tkjune

Use Automator to quick edit "hosts" in Mac OS X

May 24th, 2009 by Tkjune

A web developer often edit hosts file for developing use. In windows, you can create a shortcut to use notepad to open and edit the hosts file. In Mac OS X, I like using Spotlight to quick open the stuffs I want. But the hosts files is hidden by default and can not be found in Spotlight. So I use Automator to triger TextMate to open hosts file for editing.

Here's what I did in Mac OS X 10.5.6:

  1. Open Automator
  2. In Library of Automator, choose "Get Specified Finder Items" in "Files & Folders" category. Drag it to the right panel.
  3. Open Finder, select "Go -> Go to Folder..." from menu (or use shortcut key "CMD+SHIFT+G"), input "/private/etc/". You can find "hosts" file here. Drag it to Automator, the file list area in "Get Specified Finder Items".
  4. In Library of Automator, choose "Open Finder Items" in "Files & Folders" category. Drag it to the right panel. Choose the application you like to open the hosts file. As to me, I chose TextMate.
  5. Click "Run" button on the top right to test it.
  6. Save it as application in "Application" folder.

This works alright in 10.5.6. But I just upgrade to 10.5.7 a few days ago and I found that it does not work. When test run, the automator can find out the file but cannot open it, even after I repairing the disk permissions. Then I changed another way for step 4 here:

4. In Library of Automator, choose "Run AppleScript" in "Utilities" category. Input following lines:

on run {input, parameters}
tell application "TextMate"
open input
end tell
return input
end run

Test run and bingo!