Monday, December 27, 2010

Things to remeber in linux

  • Display All Information About Files/Directories Using ls -l


Thursday, December 23, 2010

Things to remeber in html

  • text box width is set by style property only style="width:20px" not by width property <input type="text" id="text1" name="text1" style="width:20px" />
  • For putting html in the blogger you should go to this site and encode the code http://centricle.com/tools/html-entities/



Monday, December 20, 2010

Things to remeber in php

Things to remember in php so that you don't dependent on google and manual.

  • To push values in array $stack.
array_push($stack, "apple", "raspberry");
  • preg_split used in youngib api for commandline interface .
    array preg_split ( string $pattern , string $subject [, int $limit = -1 [, int $flags = 0 ]] )

Friday, December 17, 2010

Indexing in database

  • An index is a separate file that is sorted, and contains only the field/s you're interested in sorting on. If you create an index on employee_number, MySQL can find the corresponding record very quickly (Indexes work in very similar ways to an index in a book. Imagine paging through a technical book (or more often, an scrambled pile of notes!) looking for the topic "Optimizing MySQL". An index saves you an immense amount of time!
  • http://www.databasejournal.com/features/mysql/article.php/1382791/Optimizing-MySQL-Queries-and-Indexes.htm

Wednesday, November 24, 2010

Css Learning

  • white-space:no-wrap to make text in a line .
  • vertical-align:middle; display:table-cell will not work with float so advise to insert a div cover for entering float .
  • Use Float left to all the div in the container with the width specified.
  • Use Position:relative for parent div , and absolute for child div for positioning.
  • For Floating image use overflow:hidden;
  • Use CSS selectors .e.g. > * for select adjacent child divs. Check this link for more css selectors.
  • Z-index of elements should be check in the same Containers., And position should be absolute of the other element.

Tuesday, November 23, 2010

Regular Expressions

Regular Expression of Email:
string :rahul@gmail.com
exp.:([a-z])+@([a-z])+\.([a-z])+([a-z])

Passwords cannot contain sequences of 3 or more of the same character
(.)\1\1

  • # the following expression finds double characters
    (.)\1

Brackets, Ranges and Negation[],- ^

Positioning (or Anchors)^,$,.


  • The ^ (circumflex or caret) outside square brackets means look only at the beginning of the target string, for example,
  • The $ (dollar) means look only at the end of the target string, for example, fox$ will
  • The . (period) means any character(s) in this position,

Iteration MetaCharcters ?,* ,+,{n},{}
  • The ? (question mark) matches the preceding character 0 or 1 times only
  • The * (asterisk or star) matches the preceding character 0 or more times
  • The + (plus) matches the previous character 1 or more times,
  • {n} Matches the preceding character n times exactly
  • {n,m} Matches the preceding character at least n times but not more than m times,

More metacharacters()|


Submatches, Groups and Backreferences


for testing and article Please follow
http://www.zytrax.com/tech/web/regex.htm

Tuesday, November 16, 2010

Best Coding Practices

  • The more code you have the more possible to make errors and the more code you have to maintain.
  • Use Plugins are around to make life easier after all to write less code
  • Never write html code in the js files , always put html code in html file , and access html element in jquery .
    Object Oriented Programming
  • Don't put Parent Class in the Child Class , always pass the data to the child class from the Parent Class. e.g. App is parent Class then App should not be in the Child Class . Because it is the method of abstraction.
  • Put the Code related to the Class only in Class else put in Project (App) Class of the Project.
  • To Pass the Parent Class use the context .e.g. for passing config variable to the child class.
  • Each Class is separate entity and should be complete,not dependent on any class and should not give error if something changed in other class.
  • Best OOPS Principles http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
  • http://www.dofactory.com/Patterns/Patterns.aspx