Tuesday, April 28, 2009

IE 6 weir duplicate character

If you ever seem IE 6 generate duplicate characters, you should double check if you have comment inside another comment tag.
More detail: http://www.positioniseverything.net/explorer/dup-characters.html

Thursday, April 09, 2009

Install SVN server

cd ~
mkdir src
cd ~/src
wget http://www.gtlib.gatech.edu/pub/apache/apr/apr-util-1.3.4.tar.gz
wget http://www.gtlib.gatech.edu/pub/apache/apr/apr-1.3.3.tar.gz
wget http://subversion.tigris.org/downloads/subversion-1.6.0.tar.gz
wget http://www.webdav.org/neon/neon-0.28.4.tar.gz
wget http://www.sqlite.org/sqlite-amalgamation-3.6.11.tar.gz

tar -xzf apr-util-1.3.4.tar.gz
tar -xzf apr-1.3.3.tar.gz
tar -xzf subversion-1.6.0.tar.gz
tar -xzf neon-0.28.4.tar.gz
tar -xzf sqlite-amalgamation-3.6.11.tar.gz

cd ~/src/apr-1.3.3
./configure --prefix=$HOME LDFLAGS="-L/lib64"
make
make install
cd ~/src/apr-util-1.3.4
./configure --prefix=$HOME --with-apr=$HOME LDFLAGS="-L/lib64"
make
make install
cd ~/src/neon-0.28.4
./configure --enable-shared --prefix=$HOME LDFLAGS="-L/lib64"
make
make install

cd ~/src/sqlite-amalgamation-3.6.11
make
make install

cd ~/src/subversion-1.6.0
cp ../sqlite-3.6.11/sqlite3.c sqlite-amalgamation/sqlite3.c
./configure --prefix=$HOME --without-berkeley-db --with-zlib --with-ssl LDFLAGS="-L/lib64"
make
make install

(You may get some warming message, but it is ok)

More info:
Follow instruction on: http://www.bluehostforum.com/showthread.php?t=12099 (more detail on the 2nd page to make svn checkable to local)

Tuesday, April 07, 2009

Mysql reset indexes

Use this sql can reset the index of an auto increment column.
ALTER TABLE tablename AUTO_INCREMENT = 1

Find more info on: Reset auto incrementation

Thursday, April 02, 2009

IE debugging tools

Most of web developers know debugging in IE is a painful job especially IE6. Unlike, firefox that has an add-on "Firebug" makes all of us happy in the debugging and inspection. How I wish IE has the same kind of tool~~. But today, after spending sometime on forum, it seems like ppl are already taking some action on IE. Here's a list of tool that may make developers' life easier on IE:

X-RAY: A free cross browser tool that lets you see the box model in action for any element, letting you see beneath the skin of any web page.

DebugBar: An Internet Explorer plug-in, feature in: DOM inspector, HTTP inspector, Javascript inspector, js console, HTML validator etc.

CompanionJS: Detailled javascript error reporting (call stack and real file name where the error occured).

These tool may requires to install IE script editor, which can be download from microsoft official site at: Microsoft Script Debugger

Wednesday, April 01, 2009

UNIX_TIMESTAMP() AND FROM_UNIXTIME()

If you use UNIX_TIMESTAMP() and FROM_UNIXTIME() to convert
between TIMESTAMP values and Unix timestamp values, the conversion
is lossy because the mapping is not one-to-one in both directions.
Because of daylight saving time, it is possible for two UNIX_TIMESTAMP()
to map two TIMESTAMP values to the same Unix timestamp value.
FROM_UNIXTIME() will map that value back to only one of the original
TIMESTAMP values. Here is an example, using TIMESTAMP values in
the CET time zone:

mysql> SELECT UNIX_TIMESTAMP('2005-03-27 03:00:00');
+---------------------------------------+
| UNIX_TIMESTAMP('2005-03-27 03:00:00') |
+---------------------------------------+
| 1111885200 |
+---------------------------------------+

mysql> SELECT UNIX_TIMESTAMP('2005-03-27 02:00:00');
+---------------------------------------+
| UNIX_TIMESTAMP('2005-03-27 02:00:00') |
+---------------------------------------+
| 1111885200 |
+---------------------------------------+

mysql> SELECT FROM_UNIXTIME(1111885200);
+---------------------------+
| FROM_UNIXTIME(1111885200) |
+---------------------------+
| 2005-03-27 03:00:00 |
+---------------------------+