Thursday, December 9, 2010

HTML5 client local storage

Most talked feature of html5 is storing data on client side. This could be achieved in 3 ways.
  1. Session storage.
  2. Local storage
  3. Database storage
Session storage: This is more like a upgraded version of a cookie. It persists only during browsing and once window is closed data is lost. This is easy to implement.
sessionStorage.setItem('shoppingId', '23234')
alert("Shopping Id is: " + sessionStorage.getItem('shoppingId'));
//same thing could also be achieved with sessionStorage.shoppingId

//to remove
sessionStorage.removeItem('shoppingId');




Saturday, November 13, 2010

High Performance Client side technology tweaking for a website

When a page is rendered a typical browser subsystems used and there Best Practices

1. Networkingcompress network traffic with gzip and not compress not
  • Images because they are already compressed.
  • Providing cache able content
  • Conditional Requests
  • Minifing Javascript
  • Don't scale images on the html. Crop to the required size before setting it on the html.
  • Use Image sprites.
2. HTML Parser
  • Avoid Inline Javascript
  • Avoid Linking javascript in head tag
  • Link javascript at end of the body tag, But if required use it with 'defer' tag.
3. CSS ParserAvoid Embedded styles.
  • Counter to Js files use Css linking in the head tag.
  • Avoid @import tag in CSS files but if required for cascading or hierarchical style sheet use it with link tag on the page.
4. Collections
5. Javascript
  • Minimize symbol resolution










  • Minimizing symbol resolution for functions
  • Use JSON Native methods

6. Marshalling
  • Minimize DOM interaction.. Retreive all the DOM elements in one call like
    var elems = document.body.all                                                    
    var lside = elems.lside.value;                                                      
    var rside = elems.rside.value;  
7. DOM
  • Built in methods are always effective.
  • Use selector API's for efficient access of collections (CSS Selectors)
8. Formatting
  • Only send required styles.
  • Simply selector pattern. Avoid Descendent selectors
9. Block Building 10. Layout 11. Rendering --> Layout Optimization
  • Batch Visual Changes

Saturday, August 28, 2010

Sunday, August 15, 2010

RDBMS

  • A relational database is well designed if you can reconstruct the predicates (and propositions) used to describe the business problem.
  • Normalization is a redesign process to unbundle the entities. The process involves decomposition but not decomposition that leads to a loss of information.
  • The goal of normalization is to eliminate redundancy and incompleteness.
  • The first normal form (1NF) says that a table is in fi rst normal form if all columns are atomic. No multivalued columns are allowed. Note that the 1NF defi nition simply states that a table must represent a relation.
  • Second normal form (2NF) a table must be in 1NF and every nonkey column must be functionally dependent on the entire key that means decomposition means creating new tables, not just new rows like in 1NF. To achieve 2NF, you need to decompose the table into two or more tables.
  • third normal form (3NF) a table must be in 2NF, and every nonkey column must
    be nontransitively dependent on every key. In other words, nonkey columns must be mutually independent. (Example)
  • Boyce-Codd normal form (3.5 NF): It is stronger version of 3NF. A 3NF table which doesn't have multiple overlapping candidates keys is guaranteed to be in BCNF. If A--->B and A--->C but B and C are unrelated, ie A--->(B,C) is false, then we have more than one multi-valued dependency.
  • Ref: http://support.microsoft.com/kb/283878

SQL Links