Will implement it soon
Sửa lỗi background bị giật khi swipe qua lại trên Ipad
Hôm nay tìm ra & fix được lỗi rất chuối khi swipe trên Ipad thì background image có thuộc tính background-size: cover bị giật.
Lý do là background image không hiểu do vô tình hay cố ý bị nhét thêm thuộc tính: no-repeat vào. Theo như mô tả của W3shools thì giá trị cover của background-size là:
Scale the background image to be as large as possible so that the background area is completely covered by the background image. Some parts of the background image may not be in view within the background positioning area
Rõ ràng, nếu đã scale tới giá trị lớn nhất có thể của kích thước containner thì no-repeat không cần thiết nữa, thử bỏ nó đi và đúng là lỗi đã được fix thật
Cập nhật: sau khi test lại thì lỗi chính xác là do thuộc tính background-attachment: fixed gây ra. Hiện vẫn chưa biết giải quyết thế nào với trường hợp này, vì nếu bỏ “fixed” đi thì với page có nội dung dài thì background sẽ không scale được toàn bộ màn hình
Special problem when use simplexml_load_string function
Today, my boss ask me to fix bug cannot parse XML string: simplexml_load_string cannot parse data correctly because of XML file contain some special characters.
Here is my simple code to test:
1 2 3 4 5 6 | $xml_file = '139_1356677622_o1_13.jpg.xml'; if (file_exists($xml_file)) { $xml = file_get_contents($xml_file); $xml = simplexml_load_string($xml); print_r($xml); } |
After run it, system shows some warning/error message like bellow:
1 | Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 36: parser error : Input is not proper UTF-8, indicate encoding |
and
1 | Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 56: parser error : CData section not finished |
I thought about replacing special characters, but what is special characters? How do we know how many character cannot parse by simplexml_load_string/simplexml_load_file?
After search on internet, I found this article and luckily, I found the code of eZ Public too
1 | $xmlDoc = preg_replace('/[\x00-\x08\x0b-\x0c\x0e-\x1f]/', '', $xmlDoc); |
So my code will be:
1 2 3 4 5 6 7 8 | $xml_file = '139_1356677622_o1_13.jpg.xml'; if (file_exists($xml_file)) { $xml = file_get_contents($xml_file); $xml = utf8_encode($xml); $xml = preg_replace('/[\x00-\x08\x0b-\x0c\x0e-\x1f]/', '', $xml); $xml = simplexml_load_string($xml); print_r($xml); } |
It works! The problem is solved
Untidy Google Map
A few days ago, I had a problem with displaying Google Map. After our client apply new design to their website, the map is too untidy. It seems map is duplicated. Although I have experience in integrating Google Map for many sites before but this problem takes a lot of my time

Untidy map
My approach was:
1. Check to Map API
2. Check the Cascading Style Sheets of new design
(1) seems ok
(2) I tried to copy other map’s configuration to our site but this problem still occured (Other site displays good)
So what exactly is wrong with our CSS?
Fortunately, I found the root cause. When our client implement new design, they used reset.css with “max-with” property of <img> tag is “100%”, I just removed this line & the problem disappeared.
So my solution was:
1 2 3 4 | #wrapper #map { ... max-width: none !important; } |

Pretty map ![]()
Resolve problem: Windows 7 cannot display thumbnail image
Few days ago, when I viewed my folder which contain images, it displayed as the image bellow instead of thumbnail image:
It’s really inconvenient! I thought that my Windows had an error but after search on the internet, I found the simple way to resolve it:
In the Explorer window, go to Ogranize -> Folder and Search options -> View -> Untick the checkbox Always show icons, never thumbnails -> OK
Now, my image folder was displayed as expected