The first SQL query most people learn is the SELECT statement with a query some thing like the following.
SELECT * FROM users WHERE id > 100
Nothing wrong with the syntax itself; but more often than not, what the user really wants is just a few columns from the table as shown in the PHP code below. Here we are only using three columns from the table. The usual practice of developers is to use the
* modifier to get all the columns from the table as it is easier then specifying individual column names. It is quicker to select all columns from a table and worry later which to actually use in the code.
Recently while working through Grunbaum and Shephards’ Tilings and Patterns, I stumbled on a wonderful piece of software for generating tilings – Taprats. Taprats is based on the age old Islamic art of constructing intricate geometric art based on radially symmetric star-like figures. The software is a Java applet that runs on your desktop and is surprisingly small in size for its features. It has a built-in library of tilings that can be used to construct many famous Islamic designs. Also, the construction of these designs is parametrized across different variables so you can modify various parameters to create different designs from the base example. Finally you can export the designs to various image formats to be used in your designs.
X-editable is a library which allows you to create editable elements on your page. It can be used with bootstrap, jquery-ui, jquery and jQuery and includes both popup and inline modes. This library is not supposed to be used in place of a standard form, but in places where in-place editing is required, such as data tables where quick editing is required.
Substring extraction of a long piece of text is a common element in web design, mostly in blogs and other CMS for displaying excerpts. The most common way to show an excerpt is to get n number of characters of the text, or
n number of words. We will explore both ways. In PHP we frequently use the
substr function. However,
substr or any of its variants does not split the text at word boundaries, keeping broken words hanging at the end. There are many ways we can prevent this, using some text adjustments. A simple one is shown here.
WordPress is one of the most deployed content management systems around. One of the main reasons is the number of plugins available and the ease with which we can use the system. It is not uncommon to find websites using tens of plugins to accomplish various tasks and functions. Wouldn’t it be nice if you could share the site content with other websites?
Read it on Smashing Magazine.
In one of my recent project requiring a CSV text file import, the data columns had to be in certain predefined positions for the program to work correctly. The import did not depend on field labels, which is obviously a wrong way to process data. It would not have been much of a concern had the CSV files been in the correct format. However, the CSV files I had had the columns in wrong positions, which required me to exchange the columns to their correct positions for the parent program to import them correctly. For a few files I’d have easily used a spreadsheet for the task, but with around 34 files it was going to be tedious. The task entailed me to write a small script which helped in the matter.
One of the main sources spammers harvest emails ids are from websites and Google. An easy way to prevent email harvesting is to not disclose email ids on your website, least not in an obvious way. If your site has a few dozen pages than you can manually scan those to see if any email id is being displayed. However, for large site with hundreds of pages it is not an easy process. One tool that can make the process easier is ‘theHarvester’.
There is nothing worse for a site owner to endure than to have his site hacked with no backup to restore from. Many people rely on the hosting providers backup feature or if unavailable make a copy themselves on a regular basis. Unfortunately, ‘Regular’ can mean weeks or months, depending on how serious the issue of security is for the site owner or webmaster. However people are not to blame; for most people data backup is a chore that needs to be get done with, much like flossing after a good meal.