Tuesday, November 22, 2005

Highlight my Code

I think you have seen many web sites highlighting their codes like this


include 'me.php';

//my name

$name = 'ahmed';

print $name;


that's not a big problem when we can use some builte-in php functions like highlight_string .
this function highlights php codes only, but what can i do to highlight codes from other languages like C#, C++, Java ...etc.
i have found some tools can help you to work this out like GeSHi and pear::Text_Highlighter
this two classes have the ability to highlight what ever you want of codes in simple steps.

GeSHi have a big number of already supported languages so i don't have to create it by myself again. Also i can add my custom language support like its sister in pear.
IMO GeSHi is faster and better as your languages information stored in php files but with Text_Highlighter you will add this information in XML files.
think about the used memory resources to read this file (big file) and the time of execution.
may i'm wrong but i will leave you to test it your self.

Saturday, November 19, 2005

play with SQLite

i was searching for any thing not very famous to play with, now i'm setting with SQLite.
it's the new supported database engine in php5.

SQlite has many features that's can make it better than many other database engines , but you can't use it everywhere.

IMO it's good but using MySQL is better till now.
just i wanted to push you to test it.