Skip to main content

Posts

HTML, XHTML and CSS

Cascading Definition: The cascade in CSS or cascading style sheets is the ability to have multiple styles from different sources merge together into one definitive style. The benefits of CSS Separation of content and presentation Smaller webpage file sizes Improved webpage download speed Improved rendering speed Streamlined maintenance Changing presentation for different devices Accessibility Table-less layout Customisation Search engine optimisation CSS Grouping When several selectors share the same declarations, they may be grouped into a comma-separated list. Example(s): In this example, we condense three rules with identical declarations into one. Thus, h1 { font-family: sans-serif } h2 { font-family: sans-serif } h3 { font-family: sans-serif } is equivalent to: h1, h2, h3 { font-family: sans-serif } Reverse a string in CSS? <p style="direction: rtl; unicode-bidi: bidi-override;"> 0C 88 65 36 5C 65 14 8D B5 3E 47 D9 20 11 9F ...

MySQL Questions

InnoDB Table Space Unlike MyISAM where data for individual tables is stored in their respective files, InnoDB stores data in a tablespace. By default, there is one single tablespace and data of all the databases is stored in one file. This file has data dictionary, tables, as well as indexes in it. There is a global parameter innodb_data_file_path that defines this tablespace file. It has a syntax like ibdata1:256M:autoextend, this means at the beginning a file of size 256 MB will be created and then whenever the data size exceeds this, the file will be auto-extended. The innodb_autoextend_increment variable defines in MB's that by how much each increment should be. Let's see how well can we play around: Inserts: Suppose you have too many inserts and InnoDB is extending the file too frequently. It makes sense to increase the value of innodb_autoextend_increment. Say we increase it to 16MB, then obviously the number of attempts to autoextend tablespace comes do...

CodeIgniter

CodeIgniter CodeIgniter Flow Diagram: How do you get the current controller and method name of the URL? echo $this->router->class; echo $this->router->method; Thumbnail Class: /** * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them. * */ class thumbnail_model extends Model { /** * Error message to display, if any * * @var string */ private $errmsg; /** * Whether or not there is an error * * @var boolean */ private $error; /** * Format of the image file * * @var string */ private $format; /** * File name and path of the image file * * @var string */ private $fileName; /** * Image meta data if any is available (jpeg/tiff) via the exif library * * @var array */ public $imageMeta; /** * Current dimensions of working image * * @var array */ private $currentDimensions; /** * New dimensions of working image * * @var array */ ...

OOPS General

Overloading / Overriding: Overloading is about creating multiple methods with the same name, but different signatures, in the same scope. Overriding is about changing the behavior of a certain method in the child class from the way it is behaving in the parent class. Abstraction: Abstraction means to show only the necessary details to the client of the object. Eg: 1) Do you know the inner details of the Monitor of your PC? What happen when you switch ON Monitor? Does this matter to you what is happening inside the Monitor? No Right, Important thing for you is weather Monitor is ON or NOT. 2) When you change the gear of your vehicle are you really concern about the inner details of your vehicle engine? No but what matter to you is that Gear must get changed that’s it!! This is abstraction; show only the details which matter to the user.

Performance Tuning your website

1.Top Ten Web Performance Tuning Tips Check for standards compliance by using Weblint or other HTML checking tools. Content that conforms to the HTML 4.0 standard will load faster and work in every browser because the browser then knows what to expect. Note that Microsoft-based tools create content that does not even use the standard ASCII character set, but instead uses many proprietary Microsoft characters that will display in Netscape as question marks and can slow down rendering. Minimize the use of JavaScript and style sheets. JavaScript is a major source of incompatibility, browser hangs, and pop-up advertising. Style sheets require separate downloads before the page can be displayed. There are some nice features to both JavaScript and style sheets, but at a big cost. Life is better without them. Turn off reverse DNS lookups in the Web server. If left on, reverse DNS will log a client's machine name rather than IP address, but at a large performance c...

Joomla Interview Questions

What is Joomla Joomla! is a content management system platform for publishing content on the World Wide Web and intranets as well as a Model–view–controller (MVC) Web Application Development framework. ---Joomla! came into being as the result of the fork of Mambo by the development team on August 17, 2005. ---Open Source ---Customize modules ---Built-in modules & plugins ---Develop by PHP ---MySql Support ---Admin & User Section ---User Management ---Media Manager ---Language Manager ---Banner Management & many more... What are Positions? Site templates divides the "pages" displayed on a site into a series of positions, each with a different name. You can view the location of positions in your default template from the administrator go to Site =>Preview=>Inline with Positions. You can annotate your positions through the administrator (backend). Go to Site=>Template Manage=>Module Positions. You can add or remove positions by...

MYSQL

MySQL performance Tips Avoid doing SQL queries within a loop. MySQL * MySQL is interpreted from right to left so you should put the most significant limiters as far to the right as possible. * Only select fields you need, instead of selecting * (everything). * Don't put things that changes very rarely in the database, instead put it in a global array in some include file. * Use indexes on the columns in the WHERE clause and on the columns you want to ORDER BY. * Indexes are great if you search the table alot, but it slows down insertion. * Use the EXPLAIN command to analyze your indexes. * If you only want one line as a result from the database you should always use LIMIT 1. This way mysql stops searching when it finds the first line instead of continuing through the whole database, only to find that there weren't any more lines that matched the query. * If you use $line = mysql_fetch_array($result) you'll get two ways of accessing the columns, $line...