Glow: Opensource Javacript Library from BBC

Glow is a BBC's JavaScript library, which aims to get working with the JavaScript and the DOM easier. It succeed by hiding cross-browser issues, abstracting common tasks and providing a series of user interface widgets. Glow is available under the Apache Licence, Version 2.0. 

This allows you to use the library in almost all circumstances, and to change it. The library is extremely well-documented & it already comes with various ready-to-use widgets like: auto suggest, carousel, overlay (light box), slider, timetable & more. 

These widgets are already there in most of the famous Javscript libraries like Jquery, UI etc. and have strong knowledge hub, community support.

Read more!

Joomla :How to move Joomla to another directory?

Many web designers prefer to build their websites in test folders and when their development is over to move their Joomla applications to the root folder of their hosting accounts.

For the purpose of this article let us presume that we have a Joomla 1.5 installed in the public_html/test folder in our account and we want to move it to the public_html directory so that it will be directly accessible through www.yourdomain.com.

This change consists of the following steps:

1. Move all of the files and folders from your Joomla folder to the new directory. In our case from public_html/test to public_html

2. Reconfigure your application. You should edit your configuration.php file and make the following changes in it:

Change: var $log_path = '/home/user/public_html/test/logs';
To: var $log_path = '/home/user/public_html/logs';

Change: var $tmp_path = '/home/user/public_html/test/tmp';
To: var $tmp_path = '/home/user/public_html/tmp';

Change: var $ftp_root = '/public_html/test';
To: var $ftp_root = '/public_html';

Change: var $live_site = 'http://www.yourdomain.com/test';
To: var $live_site = 'http://www.yourdomain.com';
 
3. Remove the content of your cache folder (public_html/cache in our case)

Now when you reload your website it should be working flawlessly from its new location.
 
Read more!

Target IE6 and IE7

#myelement
{
color: #999;              /* shows in all browsers */
*color: #999;             /* notice the * before the property - shows in IE7 and below */
_color: #999;         /* notice the _ before the property - shows in IE6 and below */
}
Read more!

Recent css Tricks learned

 

 1. z-index only applies to elements that are given a "position" value

2. margin: auto" will only work when a width is declared for the element.

3. padding adds to the overall width of the element. and cannot contain negative values.

4.CSS Specificity
CSS styles follow an order of specificity and point values to determine when styles override one another or take precedence.


They are like so:

Elements – 1 points
Classes – 10 points
Identifiers – 100 points
Inline Styling – 1000 points
When in doubt, get more specific with your style declarations. You can also use the !important declaration for debugging purposes if needed

Read more!

Browser sniffing or detection : Conditional Css



<!--[if gt IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie7fix.css" media="screen" />

<![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6fix.css" media="screen" /> 

<![endif]-->




<script language="Javascript" >

    var useragent = navigator.userAgent;
    var bName = (useragent.indexOf('Firefox') > -1) ? 'Firefox' :
navigator.appName;


    if (bName == "Firefox") 
    {
        
        document.writeln('<style> #nav_bar_t6 {padding-left:33px;
padding-right:33px; } #footer {margin-left:18%}</style>');
    }

    if(navigator.userAgent.indexOf ("Netscape")!=-1)
    {
        
        document.writeln('<style> #nav_bar_t4 {WIDTH:
14.2%;padding-left:2px;} #footer {margin-left:18%}</style>');
    }
    
    if(navigator.userAgent.indexOf ("Opera")!=-1)
    {
        document.writeln('<style> #nav_bar_t6 {padding-left:38px;
padding-right:33px;} #footer {margin-left:18%}</style>');
    }
</script>





Read more!

MySQL table and want to build a XML file with it in order to make a RSS feed.

  
  <?php   $dom = new DOMDocument() ; include "connection.php"; $queryz = "SELECT * FROM ticker"; $resultz = mysql_query($queryz) or die('Error, query failed'); $row = mysql_fetch_assoc($resultz); $rss = $dom->createElement('rss'); while($row = mysql_fetch_array( $resultz )) {     $item = $dom->createElement("item");     $item->appendChild($dom->createElement("title", $row['item_title']));     $item->appendChild($dom->createElement("pubDate",$row['item_pubDate']));     $item->appendChild($dom->createElement("description",$row['item_description']));     $item->appendChild($dom->createElement("link",$row['item_link']));     $rss->appendChild($item); } $dom->appendChild($rss); $dom->save("myxml.xml");
  
  
  
  OR
  
<?php header('Content-Type: text/xml; charset=UTF-8');   $dom = new DOMDocument() ;  include "connection.php"; $queryz = "SELECT * FROM ticker"; $resultz = mysql_query($queryz) or die('Error, query failed'); $row = mysql_fetch_assoc($resultz); while($row = mysql_fetch_array( $resultz )) { $tit = $dom->createElement("title", $row['item_title']) ; $pub = $dom->createElement("pubDate",$row['item_pubDate']) ; $des = $dom->createElement("description",$row['item_description']) ; $lnk = $dom->createElement("link",$row['item_link']) ;        $dom->appendChild($tit) ;        $dom->appendChild($pub) ;       $dom->appendChild($des) ;       $dom->appendChild($lnk) ;  }  $dom->save("myxml.xml") ;  ?>


RSS Display
<?php include('rss-feed-reader.php');   $feed = 'http://www.domain.com/feed.xml'; $max_items = 5; $rss = new mod_rss(); $rss->parser($feed, $max_items, true);  ?>
Read more!

Seven tips to identify a LIAR

1. Consider the person's recall:
 Liars never forget what they have to say but they may stumble when telling a tale by making contradicting statements. They're also eager to change the subject. 

2. Observe the person's overall body language:
Liars can look ill at ease,
fiddling with their hair,
stroking their throat,
or rubbing their eyes.

With their body often turned away from you, you may notice hand or leg fidgeting. Liars also have trouble swallowing and may shake their heads after a point has been made. When the subject finally gets changed, they appear happier and more comfortable, maybe laughing nervously. 

3. Take notice of any defensiveness:
Liars will often take offence to any indication that they're under suspicion. They're likely to throw any accusations you throw at them back at you. They will also talk too much, feeling the need to over-explain themselves. 

4. Home in on facial expressions:
Liars fail to control their micro-expressions. While fibbing, you may notice nervous twitching. Their hand may be covering or touching their face. People also tend to touch the mouth when feeling guilty or anxious. They're particularly good with fake smiles. 

5. Don't overlook the Pinocchio reaction: When a human tells a lie, extra blood gets pumped through the body and the nose swells by a fraction of millimeter. Liars may subsequently touch the tip of their nose unconsciously. 

6. Concentrate on the eyes:
 A liar has a troubled brow and downcast or darting eyes. They have trouble directly engaging your gaze. They also give you eye-accessing clues. If the person is telling you the truth, he'll look up and to the left since that's the side of the brain we use for recalling information. If she's lying, she'll look up and to the right, which is the creative side of the brain, because she's mentally constructing something that hasn't happened. 

7. Note the person's voice:
The higher the stakes are, the more the liar has a fear of getting caught. With this, the liar has a harder time controlling his body language or her voice. The pitch or rate of the speech may change, with the individual giving a lot of "umms" and "ahhs." Often, a liar will appear stilted and monotone. Answers may seem rehearsed.


Read more!