Youtube founder acquired Delicious too!

Delicious IconQ: What is Delicious? It’s ok that it’s a adjective/noun but what is its role in internet world?
Ans:
  Delicious (formerly del.icio.us, pronounced "delicious") is a social bookmarking web service for storing, sharing, and discovering web bookmarks. The site was founded by Joshua Schachter in 2003 and acquired by Yahoo! in 2005, then sold to Chad Hurley and Steve Chen on April 27, 2011. By the end of 2008, the service claimed more than 5.3 million users and 180 million unique bookmarked URLs.It is headquartered in Sunnyvale, California.   
 Source: Wikipedia

Q:  Why delicious? Any use for us?

Ans:  Well, this website is very famous for bookmarking your links related to anything over internet. Its main advantage is that you can access it anytime using internet. Usually, we bookmark our favorite links into the browser only. But what if that browser gets crashed or we upgrade that browser or we installed fresh piece of O.S and browser?  Everything will be gone.
So, It’s a nice idea to bookmark our links online and can share it to the whole world. You can save your online bookmarked links private or public. You can access other’s public book marked links too.

Q: Earlier it was owned by Yahoo but now by Youtube owner. Will it affect anything to our account or bookmarked links?
Ans:
 Yahoo! has announced that Delicious has been acquired by the founders of YouTube, Chad Hurley and Steve Chen. As creators of the largest online video platform, Hurley and Chen have firsthand expertise enabling millions of consumers to share their experiences with the world. Delicious will become the part of their new Internet Company, AVOS.

To continue using Delicious, you must agree to let Yahoo! transfer your bookmarks to AVOS. After a transition period and after your bookmarks are transferred, you will be subject to the AVOS terms of service and privacy policy.

Q: What is this AVOS?
Ans:
AVOS is a new Internet company founded by Chad Hurley and Steve Chen who, in 2005, founded YouTube, the world's largest online video platform. Before YouTube, Hurley and Chen were early employees at PayPal, a leading online payment service that is now part of eBay. Delicious will become a part of AVOS, based in San Mateo, California.

Q: What we need to do to use our old bookmarked links and to continue using it?
Ans:
 1. Delicious in its current form will be available until approximately July 2011.

 2. After that, you will no longer be able to use your existing Delicious account and will not have

access to your existing bookmarks or account information.

3. To continue using Delicious, you must agree to let Yahoo! transfer your bookmarks to AVOS.

Q: What are the reason that Yahoo is transferring the existing bookmarks to AVOS?

Ans:Reasons are:

•        Continue uninterrupted use of Delicious.

•        Keep your Delicious account and all your bookmarks.

•        Enjoy the same look and feel of Delicious today plus future product innovations.

Source: Yahoo Inc

Q: Is it good to have account there after its acquisition to AVOS?
Ans:
Well AVOS is the company whose owner founded Youtube the world’s most popular online video platform. So, it has great future in those hands. I would suggest one should agree to AVOS’s Terms and policies and continue to use bookmarks as we were doing earlier.

 

 

 

Minimal things to keep in mind while choosing domain name

aliencoders domain nameChoosing A Good Domain Name

Choosing a domain name for your site is one of the most important steps towards creating the perfect internet presence. If you run an on-line business, picking a name that will be marketable and achieve success in search engine placement is paramount. Many factors must be considered when choosing a good domain name. This article summarizes all the different things to consider before making that final registration step!

It should be Short and Sweet
Domain names can be really long or really short (1 – 67 characters). In general, it is far better to choose a domain name that is short in length. The shorter your domain name, the easier it will be for people remember. Remembering a domain name is very important from a marketability perspective. As visitors reach your site and enjoy using it, they will likely tell people about it. And those people may tell others, etc. As with any business, word of mouth is the most powerful marketing tool to drive traffic to your site (and it's free too!). If your site is long and difficult to pronounce, people will not remember the name of the site and unless they bookmark the link, they may never return.

 

Consider Alternatives
Unless a visitor reaches your site through a bookmark or a link from another site, they have typed in your domain name. Most people on the internet are terrible typists and misspell words constantly. If your domain name is easy to misspell, you should think about alternate domain names to purchase. For example, if your site will be called "MikesTools.com", you should also consider buying "MikeTools.com" and "MikeTool.com". You should also secure the different top level domain names besides the one you will use for marketing purposes ("MikesTools.net", "MikesTools.org", etc.) You should also check to see if there are existing sites based on the misspelled version of the domain name you are considering. "MikesTools.com" may be available, but "MikesTool.com" may be home to a graphic pornography site. You would hate for a visitor to walk away thinking you were hosting something they did not expect.

 

Also consider domain names that may not include the name of your company, but rather what your company provides. For example, if the name of your company is Mike's Tools, you may want to consider domain names that target what you sell. For example: "buyhammers.com" or "hammer-and-nail.com". Even though these example alternative domain names do not include the name of your company, it provides an avenue for visitors from your target markets. Remember that you can own multiple domain names, all of which can point to a single domain. For example, you could register "buyhammers.com", "hammer-and-nail.com", and "mikestools.com" and have "buyhammers.com" and "hammer-and-nail.com" point to "mikestools.com".

 

Hyphens: Your Friend and Enemy
Domain name availability has become more and more scant over the years. Many single word domain names have been scooped up which it makes it more and more difficult to find a domain name that you like and is available. When selecting a domain name, you have the option of including hyphens as part of the name. Hyphens help because it allows you to clearly separate multiple words in a domain name, making it less likely that a person will accidentally misspell the name. For example, people are more likely to misspell "domainnamecenter.com" than they are "domain-name-center.com". Having words crunched together makes it hard on the eyes, increasing the likelihood of a misspelling.

On the other hand, hyphens make your domain name longer. The longer the domain name, the easier it is for people to forget it altogether. Also, if someone recommends a site to someone else, they may forget to mention that each word in the domain name is separated by a hyphen. If do you choose to leverage hyphens, limit the number of words between the hyphens to three. Another advantage to using hyphens is that search engines are able to pick up each unique word in the domain name as key words, thus helping to make your site more visible in search engine results.

 

Dot What?
There are many top level domain names available today including .com, .net, .org, and .biz. In most cases, the more unusual the top level domain, the more available domain names are available. However, the .com top level domain is far and away the most commonly used domain on the internet, driven by the fact that it was the first domain extension put to use commercially and has received incredible media attention. If you cannot lay your hands on a .com domain name, look for a .net domain name, which is the second most commercially popular domain name extension.

 

Long Arm of the Law
Be very careful not to register domain names that include trademarked names. Although internet domain name law disputes are tricky and have few cases in existence, the risk of a legal battle is not a risk worth taking. Even if you believe your domain name is untouchable by a business that has trademarked a name, do not take the chance: the cost of litigation is extremely high and unless you have deep pockets you will not likely have the resources to defend yourself in a court of law. Even stay away from domain names in which part of the name is trademarked: the risks are the same.

Search Engines and Directories
All search engines and directories are different. Each has a unique process for being part of the results or directory listing and each has a different way of sorting and listing domain names. Search engines and directories are the most important on-line marketing channel, so consider how your domain name choice affects site placement before you register the domain. Most directories simply list links to home pages in alphabetical order. If possible, choose a domain name with a letter of the alphabet near the beginning ("a" or "b"). For example, "aardvark-pest-control.com" will come way above "joes-pest-control.com".

However, check the directories before you choose a domain name. You may find that the directories you would like be in are already cluttered with domain names beginning with the letter "a". Search engines scan websites and sort results based on key words. Key words are words that a person visiting a search engine actually search on. Having key words as part of your domain name can help you get better results.

Note: Check the grade of your website at  http://www.domometer.com/

For aliencoders.org, its showing A+ which manes it is very good domain name.

Source: http://faq.programmerworld.net/

Minimal Basics to know about bandwidth

BandwidthIntroduction

If you are an internet user and If you are the owner of any blog or website then you might have heard the common word “Bandwidth”. Either you go for internet connection or for web hosting plan they will sure deal in this term.

So what exactly this bandwidth is? 
In simple words, it is the amount of traffic that is allowed to you (web space allowed to you from the web hosting server) between your web site and the rest of the internet. The amount of bandwidth a hosting company can provide is determined by their network connections, plans etc. (Free, premium, golden etc kind of plans are there. I saw these in godaddy.com). Hosting on Windows or Linux platform may also depend while providing bandwidth.

Network Connectivity

The internet, in the most simplest terms, is a group of millions of computers connected by networks. These connections within the internet can be large or small depending upon the cabling and equipment that is used at a particular internet location. It is the size of each network connection that determines how much bandwidth is available. For example, if you use a DSL connection to connect to the internet, you have 1.54 Mega bits (Mb) of bandwidth. Bandwidth therefore is measured in bits (a single 0 or 1). Bits are grouped in bytes which form words, text, and other information that is transferred between your computer and the internet.

If you have a DSL connection to the internet, you have dedicated bandwidth between your computer and your internet provider. But your internet provider may have thousands of DSL connections to their location. All of these connection aggregate at your internet provider who then has their own dedicated connection to the internet (or multiple connections) which is much larger than your single connection. They must have enough bandwidth to serve your computing needs as well as all of their other customers. So while you have a 1.54Mb connection to your internet provider, your internet provider may have a 255Mb connection to the internet so it can accommodate your needs and up to 166 other users (255/1.54).

 

Traffic
A very simple analogy to use to understand bandwidth and traffic is to think of highways and cars. Bandwidth is the number of lanes on the highway and traffic is the number of cars on the highway. If you are the only car on a highway, you can travel very quickly. If you are stuck in the middle of rush hour, you may travel very slowly since all of the lanes are being used up.

Traffic is simply the number of bits that are transferred on network connections. It is easiest to understand traffic using examples. One Gigabyte is 2 to the 30th power (1,073,741,824) bytes. One gigabyte is equal to 1,024 megabytes. To put this in perspective, it takes one byte to store one character. Imagine 100 file cabinets in a building, each of these cabinets holds 1000 folders. Each folder has 100 papers. Each paper contains 100 characters – A GB is all the characters in the building. An MP3 song is about 4MB, the same song in wav format is about 40MB, a full length movie can be 800MB to 1000MB (1000MB = 1GB).

If you were to transfer this MP3 song from a web site to your computer, you would create 4MB of traffic between the web site you are downloading from and your computer. Depending upon the network connection between the web site and the internet, the transfer may occur very quickly, or it could take time if other people are also downloading files at the same time.

Ex: the web site you download from has a 10MB connection to the internet, and you are the only person accessing that web site to download your MP3, your 4MB file will be the only traffic on that web site. However, if three people are all downloading that same MP at the same time, 12MB (3 x 4MB) of traffic has been created. Because in this example, the host only has 10MB of bandwidth, someone will have to wait.

 The network equipment at the hosting company will cycle through each person downloading the file and transfer a small portion at a time so each person's file transfer can take place, but the transfer for everyone downloading the file will be slower. If 100 people all came to the site and downloaded the MP3 at the same time, the transfers would be extremely slow. If the host wanted to decrease the time it took to download files simultaneously, it could increase the bandwidth of their internet connection (at a cost due to upgrading equipment).

 

Hosting Bandwidth
In the example above, we discussed traffic in terms of downloading an MP3 file. However, each time you visit a web site, you are creating traffic, because in order to view that web page on your computer, the web page is first downloaded to your computer (between the web site and you) which is then displayed using your browser software (Internet Explorer, Netscape, etc.) . The page itself is simply a file that creates traffic just like the MP3 file in the example above (however, a web page is usually much smaller than a music file).

A web page may be very small or large depending upon the amount of text and the number and quality of images integrated within the web page. For example, the home page for CNN.com is about 200KB (200 Kilobytes = 200,000 bytes = 1,600,000 bits). This is typically large for a web page. In comparison, Yahoo's home page is about 70KB.

How Much Bandwidth Is Enough?
It depends (don't you hate that answer). But in truth, it does. Since bandwidth is a significant determinant of hosting plan prices, you should take time to determine just how much is right for you. Almost all hosting plans have bandwidth requirements measured in months, so you need to estimate the amount of bandwidth that will be required by your site on a monthly basis

If you do not intend to provide file download capability from your site, the formula for calculating bandwidth is fairly straightforward:
Average Daily Visitors x Average Page Views x Average Page Size x 31 x Fudge Factor

If you intend to allow people to download files from your site, your bandwidth calculation should be: [(Average Daily Visitors x Average Page Views x Average Page Size) + (Average Daily File Downloads x Average File Size)] x 31 x Fudge Factor

Let us examine each item in the formula:

Average Daily Visitors – The number of people you expect to visit your site, on average, each day. Depending upon how you market your site, this number could be from 1 to 1,000,000.

Average Page Views – On average, the number of web pages you expect a person to view. If you have 50 web pages in your web site, an average person may only view 5 of those pages each time they visit.

Average Page Size – The average size of your web pages, in Kilobytes (KB). If you have already designed your site, you can calculate this directly.

Average Daily File Downloads – The number of downloads you expect to occur on your site. This is a function of the numbers of visitors and how many times a visitor downloads a file, on average, each day.

Average File Size – Average file size of files that are downloadable from your site. Similar to your web pages, if you already know which files can be downloaded, you can calculate this directly.

Fudge Factor – A number greater than 1. Using 1.5 would be safe, which assumes that your estimate is off by 50%. However, if you were very unsure, you could use 2 or 3 to ensure that your bandwidth requirements are more than met.

Usually, hosting plans offer bandwidth in terms of Gigabytes (GB) per month. This is why our formula takes daily averages and multiplies them by 31 (total days in a month . Maximum is better always).

Summary
Most personal or small business sites will not need more than 1GB of bandwidth per month. If you have a web site that is composed of static web pages and you expect little traffic to your site on a daily basis, go with a low bandwidth plan. If you go over the amount of bandwidth allocated in your plan, your hosting company could charge you over usage fees, so if you think the traffic to your site will be significant, you may want to go through the calculations above to estimate the amount of bandwidth required in a hosting plan.

Source: http://www.findmyhosting.com/

Uncategorized

Minimal solution for image alignment in HTML

HTML Logo by AlienCodersWhile working on area and map tag for some image manipulation tricks. I found that center attribute doesn't work at all for img tag .   We are having problems centering images – particularly when they're mixing the ALIGN attribute with style sheet properties. There are two main causes:HTML rules and browser compatibility issues.

Some Elements Center, Others Don't!

First, remember that the ALIGN attribute is a deprecated HTML attribute, meaning it's marked for deletion in future versions. Of course, deprecated doesn't mean that it will stop in near future. But it means  that you should be alert to use or  display issues in current and future browser versions.

Since ALIGN may not behave as you expect, how should you center an image?          

Your first thought is probably to include the align="center" property/value pair to your image tag. After all, it works for paragraphs, tables, and other elements:
[html]
     <p align="center">paragraph content here</p>
     <table align="center">table content here</table>
     <div align="center">div content here</div>
      <h2 align="center">header content here</h2>
[/html]

The content inside those tags centers reliably across browsers because they're block-level tags. But the IMG tag is an inline element, so it displays relative to the content around it. That's why the only supported ALIGN values are those that indicate how text and other page elements should display in relation to the image.

You can move an image to the left or right on the Web page or control its vertical placement with the ALIGN property, but you can't center it using the ALIGN attribute. align="center" isn't valid HTML. All browsers ignore align="center" when it's part of an IMG tag.

Deprecated Alignment Strategies

The simplest way to center an image is to place it inside opening and closing CENTER tags:

<center><img src="imgName.gif" alt="image description" height="100" width="100"></center>

Unfortunately, the CENTER tag is also deprecated and becoming somewhat unreliable in the most recent browser versions.

Another simple solution is to enclose the image inside a page element that CAN be aligned to the center – such as a paragraph or a DIV tag:

<p align="center"><img src="imgName.gif" alt="image description" height="100" width="100"></p>

<div align="center"><img src="imgName.gif" alt="image description" height="100" width="100"></div>

That solution works in all browsers, but you'll have to contend with the extra spaces that browsers automatically place above and below block-level tags. You'll have less control over page layout and display with this method. And remember that both rely on a deprecated HTML tag or attribute.

But a more pressing problem is that once an element or attribute is deprecated there are no firm rules governing how browsers should display it. Most browsers continue to recognize the tag or attribute, but you'll probably encounter display differences between browsers and browser versions.

Cascading Style Sheets (CSS) offer more alternatives, but also have their own set of browser display problems.

Aligning Images With CSS

The most obvious CSS solution is to use the text-align property to center the image. Unfortunately, that has the same effect as adding align="center" to the image tag: browsers ignore it entirely!

Instead, you'll have to apply the text-align property to the container element (the paragraph, DIV, or other block-level element that contains the image).

Create a style class and add it to the HEAD section of your page. Even better, add it to your external style sheet and use it on every page!

<style type="text/css">
.centeredImage
    {
 
    text-align:center;
      margin-top:0px;
      margin-bottom:0px;
      padding:0px;
    }
</style>

Nothing to display

Then, apply the class to the container element:

<p class="centeredImage"><img src="imgName.gif" alt="image description" height="100" width="100"></p>

That's slightly more trouble than just applying align="center" to the paragraph tag, but it has the added benefit of giving you more control over the spacing around the image. Note that in our example, we set the margin and padding values to zero pixels to avoid extra spacing that may push important content farther down the page.

Browser Display Issues And ALIGN

Of course, if you're moderately familiar with CSS, you may have already asked yourself this question:

"Why not just control the inline element problem by converting the problem image from an inline to a block-level tag?"

Yes, it seems simple. Just add this class:

<style type="text/css">
  .centeredImage
    {
     text-align:center;
     display:block;
    }
</style>

and apply it to the IMG you want to center:

<img src="imgName.gif" class="centeredImage" alt="image description" height="100" width="100">

That eliminates the extra code needed for the container tag.

That is (or seems to be) the easiest and most elegant solution. And it is – for Explorer browsers. Other browsers follow W3C standards more strictly than Explorer (even Explorer 6.x) and don't allow you to convert images from inline to block. Just to make it even more confusing though, some of those browsers do allow you to convert other inline elements to block-level!

Carefully check for display problems if you apply styles to any page element that also uses the ALIGN attribute. Some browsers may ignore the deprecated ALIGN attribute value. This is a particular problem in tables.

 Source: http://www.netmechanic.com/news/vol7/html_no10.htm

Uncategorized

Minimal reasons to know about system crashes

If you are using Microsoft Windows O.S then you might have seen “Blue Screen of Death” ( BSOD). I have experienced it 3 times in my own system and have seen many times in my friends system too. If you have not seen this yet, it means you are lucky that your system is working fine :P.  But it’s good to know that what are the causes that leads us towards BSOD? It may happen for various causes, few are listed here:

1.  The number one reason why Windows crashes is hardware conflict. Each hardware device communicates to other devices through an interrupt request channel (IRQ). These are supposed to be unique for each device.

For example, a printer usually connects internally on IRQ 7. The keyboard usually uses IRQ 1 and the floppy disk drive IRQ 6. Each device will try to hog a single IRQ for itself. If there are a lot of devices, or if they are not installed properly, two of them may end up sharing the same IRQ number. When the user tries to use both devices at the same time, a crash can happen.

2. Bad Ram Ram (random-access memory) problems might bring on the blue screen of death with a message saying Fatal Exception Error. A fatal error indicates a serious hardware problem. Sometimes it may mean a part is damaged and will need replacing.

3. BIOS settings Every motherboard is supplied with a range of chipset settings that are decided in the factory. A common way to access these settings is to press the F2 or delete button during the first few seconds of a boot-up. Once inside the BIOS, great care should be taken. It is a good idea to write down on a piece of paper all the settings that appear on the screen.
That way, if you change something and the computer becomes more unstable, you will know what settings to revert to. MS  Windows is better at allocating IRQ numbers than any BIOS. If possible set the IRQ numbers to Auto in the BIOS. This will allow Windows to allocate the IRQ numbers (make sure the BIOS setting for Plug and Play OS is switched to ‘yes’ to allow Windows to do this.).

4. Hard disk drives After a few weeks, the information on a hard disk drive starts to become piecemeal or fragmented. It is a good idea to defragment the hard disk every week or so, to prevent the disk from causing a screen freeze. There are many tools to defragment it a.       Disk Defragmenter b.      ScanDisk

5. Viruses Often the first sign of a virus infection is instability. Some viruses erase the boot sector of a hard drive, making it impossible to start. This is why it is a good idea to create a Windows start-up disk. Use any good anti-virus for it. I use Eset NOD 32 . McAfee, Norton are also very good in that.

6. Software A common cause of computer crash is faulty or badly-installed software. Often the problem can be cured by uninstalling the software and then reinstalling it. The System Registry can be corrupted by old references to obsolete software that you thought was uninstalled. Ccleaner  to clean up the System Registry and remove obsolete entries. It works on Windows 95, Windows 98, Windows 98 SE (Second Edition), Windows Millennium Edition (ME), NT4 and Windows 2000.

7. Overheating Central processing units (CPUs) are usually equipped with fans to keep them cool. If the fan fails or if the CPU gets old it may start to overheat and generate a particular kind of error called a kernel error. This is a common problem in chips that have been over clocked to operate at higher speeds than they are supposed to. One remedy is to get a bigger better fan and install it on top of the CPU. Specialist cooling fans/heatsinks are available from http://www.computernerd.com or www.coolit.com CPU problems can often be fixed by disabling the CPU internal cache in the BIOS. This will make the machine run more slowly, but it should also be more stable.

8. Power supply problems With all the new construction going on around the country the steady supply of electricity has become disrupted. A power surge or spike can crash a computer as easily as a power cut. If this has become a nuisance for you then consider buying a uninterrupted power supply (UPS). This will give you a clean power supply when there is electricity, and it will give you a few minutes to perform a controlled shutdown in case of a power cut. It is a good investment if your data are critical, because a power cut will cause any unsaved data to be lost.

Source : http://faq.programmerworld.net/pc/10-reasons-why-pcs-crash.html

Uncategorized

5 Important rules to start with JavaScript

At first sight, JavaScript looks very simple language. But if you don't follow unobtrusive and OO pattern then you will treat it as one of the weird browser languages. But in today's world you can't make good websites without the help of JavaScript. Either you use Dojo, JQuery, ext js , moo tools or any JavaScript based plug-ins , you would require fair knowledge of JavaScript. Apart from keeping in mind while using  namespace, global and local variables. We should follow  these 5 simple rules (in no order and there can be many rules as per the programmer), we can improve JavaScript coding:

1. Do not make any assumptions about JavaScript features

Probably the most important feature of unobtrusive JavaScript is that you stop making assumptions:

  • You don't expect JavaScript to be available but make it a nice-to-have rather than a dependency
  • You don't expect browsers to support certain methods and have the correct properties but  test  them before you access them
  • You don't expect the correct HTML to be at your disposal, but check for it and do nothing when it is not available
  • You expect other scripts to try to interfere with your functionality and keep the scope of your scripts as secure as possible. use local variable and namespace properly

The first thing to consider before you even start planning your script is to look at the HTML code that you are going to enhance with scripting and see what you can use for your own purposes.

 2. Find your hooks and relationships (HTML, the base to build on)

Before you start your script look at the base that you build upon. If the HTML is unstructured , there is hardly any way to create a clever scripting solution

There are several things to consider in your HTML – hooks and relationships

 HTML Hooks

HTML hooks are first and foremost IDs, as these can be accessed with the fastest DOM method – getElementById. These are safe as IDs are unique in a valid HTML document (IE has a bug with name and ID, but good libraries work around that) and easy to test for.

Other hooks are HTML elements which can be read out with getElementsByTagName and CSS classes, which can not be read out with a native DOM method in most browsers (Mozilla will soon have one and Opera 9.5 already does though). However, there are a lot of helper methods that allow for a getElementsByClassName.

 HTML relationships

The other interesting thing about HTML is the relationships of your markup. Questions to ask yourself are:

  • How can I reach this element the easiest and with the least steps traversing the DOM?
  • What element do I need to alter to reach as many child elements that I need to change?
  • What attributes or information does a certain element have that I can use to link to another?

Traversing the DOM is expensive and can be slow, that is why it is a good idea to leave it to a technology that is already in use in browsers.

 3. Leave traversing to the experts (CSS, the faster DOM traveller)

It is pretty interesting that DOM scripting and traversing the DOM with its methods and properties (getElementsByTagName, nextSibling, previousSibling, parentNode and so on) appears as a confusing matter to a lot of people. It is interesting as we already do it with a different technology: CSS.

CSS is a technology that takes a CSS selector and traverses the DOM to access the desired elements and change their visual attributes. A rather complex JavaScript using DOM can be replaced with a single CSS selector:

var n = document.getElementById('nav');
if(n){
var as = n.getElementsByTagName('a');
if(as.length &amp;gt; 0){
for(var i=0;as[i];i++){
as[i].style.color = '#369'; as[i].style.textDecoration = 'none'; }
}
}

/* is the same as */

#nav a{ color:#369; text-decoration:none; }

 4. Understand Events (Event handling to initiate change)

Event handling is the next step to truly unobtrusive JavaScript. The point is not to make everything draggable and clickable or add inline handling. The point is to understand that Event Handling is true separation. We separate HTML, CSS and JavaScript but with Event Handling we go much further.

Elements in the document are there to wait for handlers to listen to a change happening to them. If that happens, the handlers retrieve a magical object (normally as a parameter called e) that tells them what happened to what and what can be done with it.

The really cool thing about most event handling is though that it does not only happen to the element you want to reach but also to all the elements above it in the DOM hierarchy (this does not apply to all events though – focus and blur don't do that). This allows you to assign one single event handler to for example a navigation list and use event handling's methods to reach what element was really involved. This technique is called event delegation and it has several benefits:

  • You only need to test if a single element exists, not each of them
  • You can dynamically add or remove new child elements without having to remove or add new handlers
  • You can react to the same event on different elements

The other thing to remember is that you can stop events from being reported to parent elements and you can override the default action HTML elements like links have. However, sometimes this is not a good idea, as browsers apply them for a reason. An example would be links pointing to in-page targets. Allowing for them to be followed makes sure that users can bookmark the state of your script.

 5. Work for the next developer (Making maintenance easier)

The last step to make your script truly unobtrusive is to give it another go-over when you finished and think about the next developer who has to take over from you once this went into production. Consider the following:

  • Are all the variable and function names logical and easy to understand?
  • Is the code logically structured? Can you "read" it from top to bottom?
  • Are the dependencies obvious?
  • Have you commented areas that might be confusing?

The most important bit is to understand that the HTML and CSS of a document is much more likely to change than the JavaScript (as these make up visual output). Therefore it is a great idea not to have any class and ID names or strings that will be shown to the end user buried somewhere in the code but separate it out into a configuration object instead.

myscript = function(){
   var config = {navigationID:'nav', visibleClass:'show'};
   var nav = document.getElementById(config.navigationID);
   function init(){
      show();
      if(nav.className === config.visibleClass){ reset(); } // do stuff
   }
   function show(){
     var c = nav.className; // do stuff
   }
   function reset(){
   // do stuff
   };
}();

That way maintainers know exactly where to change these without having to alter the rest of your code.

Source: http://icant.co.uk

Uncategorized

IT Security Threats for 2011 by McAfee

2011 will be much like 2010 when it comes to IT security threats, only more so.

“We are seeing an escalating threat landscape in 2011,” says Dmitri Alperovitch, threat research vice president at McAfee Labs, which Tuesday issued its annual threat predictions for the coming year.

In an interview with Information Security Media Group, Alperovitch explains the challenges these threat present and how individuals and organizations can address them. The threats McAfee Labs identifies for 2011 are:

Uncategorized

Top 10 Programming language of year 2010

It is always important for the IT people to know that:

1.       Which language is rising exponentially?

2.       Which language is in high demand?

3.        By having knowledge of which language we can grab more job opportunity?

4.       Which one is the highest paying language in your country?

And many more Just like ever year Tiobe has done complete survey and displayed the result for top 10 programming languages of 2010 and have compared from previous year.  Just have a look over it.