PHP and Web Technologies Freak
I just found a way to using wilcard with unlink in PHP.
Here is the scenario;
files might be:
120a-some_file1.jpg
210w-some_file1.jpg
some_file123.jpg
480h-some_file1.jpg
somefile.doc
if you want to delete;
120a-some_file1.jpg
200w-some_file1.jpg
480h-some_file1.jpg
you can use this code;
<?php foreach( glob('*-some_file1.jpg') as $file ){ unlink($file); } ?>
Sometimes, especially when moving data from one server to another, you might find that you have your MySQL database incorrectly encoded. Problem with this first show itself if you have the database and encoded in one charset set to display your website in another. If this is the case then you will find strange characters appearing in your text, especially when using punctuation marks. If you are Unwilling or unable to change the character encoding on the site then you need to change how the data is encoded in the database.
The most common sort of thing you might want to do is change from iso-8859-1 (or windows-1252) to UTF-8. This can be done in one of two ways.
The first way is to simply alter the table so that the column contains a different charset.
ALTER TABLE table MODIFY col1 VARCHAR(50) CHARACTER SET 'utf8';
However, if your database has already been set up and your data has already been inserted in the wrong format then you can also update the data in the column using the CONVERT command. The following snippet turns our latin1 data into uncoded binary data and then into utf8.
UPDATE table SET col1=CONVERT(CONVERT(CONVERT(col1 USING 'latin1') USING BINARY) USING 'utf8');
You should also make sure that the connection to the database is done through a specific character set. This is done by using the
Read the rest of this entry »
It may be useful sometimes to provide your visitors with the option to change the appearance of your website. Perhaps you may want to provide theme support for your site. Or you may simply want to provide a bigger font size version of your site for older users who may not be able to read the small-sized text you use by default. This article describes how you can use JavaScript to dynamically change the cascading style sheets, or CSS, of your website.
Here we go;
Read the rest of this entry »
ClickHeat is a visual heatmap of clicks on a HTML page, showing hot and cold click zones.

Requirements
- on the browser’s client: Javascript (tested on Firefox 2.0, Internet Explorer 6 and 7, Konqueror…)
- on the server: either Linux or Windows (since ClickHeat 1.3 release), Apache or Lighttpd (other may work fine), PHP, the graphic library GD2 (PNG support needed).
- Low logging activity: a very few function calls to log a click, no server load rise should be noticed (have a look at Performance & optimization)
- A keyword is used to define the page upon Javascript code load, allowing you to group same pages.
- Screen sizes and browsers are logged, making possible the tracking of liquid CSS layouts (100% used width).
Demo (user:demo pwd:demo)
Quicksort is one of the fastest and simplest sorting algorithms [Hoa 62]. It works recursively by a divide-and-conquer strategy.
The quicksort is considered to be very efficient, with its “divide and conquer” algorithm. This sort starts by dividing the original array into two sections (partitions) based upon the value of the first item in the array. Since our example sorts into descending order, the first section will contain all the elements with values greater than the first item. Read the rest of this entry »
Navigation menus have to be intuitive, precise and easy-to-use. One simple, basic principle, which is common for all kinds of nav bars you would ever want to use for your projects.
You’ll find 50 user-friendly CSS based menu and navigation solutions.
Titles are everywhere. Some people are defined by titles, some people loathe titles, and others like giving titles. Why do we do this? With so much information getting processed by our minds everyday, we need a way to categorize these groups of associated content in a quick referencing way.
This is the same methodology a search engine applies when it crawls a page. When you title a page, you are telling a search engine or user what the page is supposed to be about. We’ve all seen the one sentence summaries of television shows on the T.V. Guide. It allows for quick referencing and decision making by telling us what the show is going to be about.
Read the rest of this entry »
To find duplicate values you need to use the MySQL COUNT() function and then pick out all of the counts that are greater than one.
SELECT value,COUNT(value) AS Count FROM test GROUP BY value HAVING (COUNT(value) > 1) ORDER BY Count DESC;
Conversely you can also select the rows that only have a single entry. Read the rest of this entry »
Sometimes, especially when moving data from one server to another, you might find that you have encoded your MySQL database incorrectly. This problem with first show itself if you have the database encoded in one charset and your website set to display in another. If this is the case then you will find strange characters appearing in your text, especially when using punctuation marks. If you are unable or unwilling to change the character encoding on the site then you need to change how the data is encoded in the database.
The most common sort of thing you might want to do is change from iso-8859-1 (or windows-1252) to UTF-8. This can be done in one of two ways.
Read the rest of this entry »

Dijkstra’s algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1959, is a graph search algorithm that solves the single-source shortest path problem for a graph with nonnegative edge path costs, producing a shortest path tree. This algorithm is often used in routing.
Let’s call the node we are starting with an initial node. Let a distance of a node X be the distance from the initial node to it. Dijkstra’s algorithm will assign some initial distance values and will try to improve them step-by-step. Read the rest of this entry »