Posted
on April 12, 2009, 11:09 am,
by Algirdas,
under
PHP.
I was looking for a simple class which will compare to strings and return a result with marked differences. What chars or words where removed and which were added. Just like wiki compare revisions. Actually i googled a lot and finally found a result:
The main class which do mostly all the job is Text_Diff, you can download it from http://pear.php.net/package/Text_Diff/
The other tool I used was http://software.zuavra.net/inline-diff/. It use Text_Diff and render results.
If you have two strings: “my blue pen” and “my red pen”, this is the diff and it will produce: “my <del>blue</del><ins>red</ins> pen”. Read the rest of this entry »
I really enjoy jQuery and its capabilities. It is more lightweight than Prototype and it can do the same or even more. Also this library has lots of plugins and one of them is Boxy. Boxy is a flexible, Facebook-style dialog box for jQuery with support for dragging and size tweening. It differs from other overlays I’ve seen by providing an object interface to control dialogs after they’ve been created. And for simple usage scenarios, boxy also provides a jQuery plugin for automatically hooking up links and forms, as well as an ask() helper for presenting multiple choices to the user.
Here’s an example, taken from feedback (contact us) form:
Read the rest of this entry »
Posted
on March 4, 2009, 2:03 pm,
by Algirdas,
under
Internet.
If you are here not for the first time, you can see the new page template. Because the old one was too old and did not supported new wordpress functions, I decided to use this simple and lite plainscape theme. I hope everybody enjoy it as I do.
Here you will find how to do such a trick: when somebody clicks the button, the old content fades out and then the new fades in.
To do this I used jQuery witch is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.
Read the rest of this entry »
Posted
on December 3, 2007, 4:24 pm,
by Algirdas,
under
Internet,
PHP.
I needed to move data from one database to another. The source DB was MySQL 4.0 and the destination was MySQL 5.1. And all the problems was with UTF-8 symbols. I couldn’t get it to work on MySQL 5.1. I search on the internet and figured out that MySQL 4.0 does not support UTF-8 and it is supported only from MySQL 4.1.
You can store UTF-8 date on MySQL 4.0 but it’s not encoded using UTF-8. The data is encoded using the default encoding ‘Latin1′, so the only thing what you need is to make an export file and upload using PhpMyAdmin, but don’t forget to select that the data is encoded ‘Latin1′ and not UTF-8.