Posted by: uttamkumar | September 12, 2008

web usability

Usability has it’s own importance in a website.Some dos and don’t s to achieve a good usability are as follows.

  • Do:
    • Use ALT tags for all graphics, especially navigation graphics.
    • Use black text on white background whenever possible for optimal legibility.
    • Use either plain-color backgrounds or extremely subtle background patterns.
    • Make sure text is in a printable color (not white).
    • Place navigation in a consistent location on each page of your website.
    • Use a familiar location for navigation bars.
    • Keep the design from scrolling horizontally.
    • Use one axis of symmetry for centered text on a page.
    • Encourage scrolling by splitting an image at the fold.
  • Don’t:
    • Allow ALT tags to get clipped (especially an issue for small, fixed width images).
    • Display static text in blue or underlined.
    • Use boldface or ALL CAPS for long pieces of text. These slow down reading.
    • Leave too much white space–reduces scannability.
    • Make the user scroll to find critical information, especially transaction buttons and navigation links.
    • Use horizontal rules to separate chunks of content.
    • Alternate too frequently between centered text and left-aligned text. Most text should be left-aligned.
    • Fix pages at larger than 800 x 600 pixels. Larger pages may force users to scroll horizontally.
Posted by: uttamkumar | July 30, 2008

Technical Documentation

Writing convention

  1. Are you referring to the reader and author correctly in your document?

    In technical writing, there are only two valid subjects:

    • “You” (the reader)
    • The subject (the software, hardware, function etc.)

    For example:

    When the CD is inserted, a Windows dialog will be shown.
    When you insert a CD, Windows shows a dialog.

    The first example is bad because it is not addressing the reader or writing from the point of the subject (the software in this case), ie. using the passive voice.It is occasionally acceptable to use the first person, “we”, “I”, “us”, “our” etc. An example of an acceptable use of first person is, “We recommend that you backup your database first.” However, you must never use the first person to refer to the reader:

    We will now open a web browser and go to the home page.
    You can now open a web browser and go to the home page.

    The first example is bad because it is unclear to the reader as to who “we” is.


  2. Do you use the correct symbols when documenting instructions?

    An important area which Microsoft does not apply strict standards to, is documenting instructions. This is often a confusing dilemma for many people, as the way in which instructions are worded and arranged is very important in helping the user understand the instructions. Therefore, the instructions should be minimalistic, clear and concise.

    In Ken Getzs words you MUST ALWAYS list the items in the order the user selects them. I often see Microsoft documentation say: Select All Programs from the Start menu. That’s inexecusable.?

    Click Start, then All Programs, then Accessories, then Calculator.
    Figure: Bad Example – No visual cue is given for separate steps.
    Start – All Programs – Accessories – Calculator
    Figure: Bad Example – Dashes are easy to glance over
    Start –> All Programs –> Accessories –> Calculator
    Figure: Bad Example – This is better but looks unprofessional
    Start | All Programs | Accessories | Calculator
    Figure: Good Example
  3. Do you use the right order of instructions?

    When writing the instructions for a series of operations, be sure of the right order of them. With the clear order of operations, users won’t be confused anymore.

    Select Options from the Tools Menu.
    Figure: Bad Example – See how it is in a reversed menu order than the one the user will do it in.
    Select Tools | Options
    Figure: Good Example

  4. Do you highlight items correctly in your document?

    When highlighting items (file names, user commands etc.) be sure to:

    1. Distinguish the items from the rest of the surrounding text; and
    2. Be consistent.

    Use the following rules to highlight items in your document.

    Style Use this style on Example
    Bold text Menus, commands, dialog box options, file names and paths To access the application, click Start | Programs | Accessories | System Tools | Disk Defragmenter
    UPPERCASE Code keywords and database elements Use the INNER JOIN clause in SQL Server to join one table to another.
    Initial Capitals + Bold File paths and file names Now open C:\My Documents\Invoice.doc.
    Monospace (Courier New font) Code samples, error messages You will see the following error: error opening database: database is currently in use.

  5. Do you include version numbers in your file names?

    It is a good practice to include a version number in the name of the file. Every time you make a significant change to the file you should increment the version number. This helps us to navigate through the old and the new versions. It makes it easy if we decide to roll back any changes and use an older version.

    For example:

    extreme_email_file
    extreme_email_new_file
    extreme_email_latest
    Bad file naming conventions :
    Extreme_Emails_v1
    Extreme_Emails_v2
    CodeAuditor_Ver1
    CodeAuditor_Ver2
    Good file naming conventions :

  6. Are you referring to the reader and author consistently throughout your document?

    When writing technical documentation, one of your primary objectives is to ensure the document is written consistently to ensure a flowing reading experience. Ensure the reader and author are correctly referenced throughout your document, for example:

    When one wants to scan for viruses, you can open the antivirus software.
    When you want to scan for viruses, you can open the antivirus software.

    The first example is bad because it confuses the reader as to whom the author is referring.


  7. Do you add a useful figure caption in bold below all images?

    When you add an image to a website or application, follow the Microsoft Word standard and use “Figure: Description” to describe your images. Read more about this rule on our Rules to Better Websites – Layout.


  8. Do you avoid using unnecessary words?

    When writing any documentation it is vital that you avoid using unnecessary words to keep the reader interested and focussed on the content. This is especially true in technical documentation, as most of the content is factual.

    Click on the “Select” button
    Bad Example
    Click “Select”
    Good Example

    It is less wordy, and still gets the message across. Look through your document now – where else can you get rid of words that don’t add any value to the sentence?


  9. Do you use “will”, not “should”?

    When explaining steps in a process, e.g. Printing a file, make sure to say something “will” happen or is happening. This is especially important when describing your own software, because saying something “should” happen implies that it may or may not happen, i.e. there could be bugs!

    To print your document:

    1. Select File | Print. The Print dialog should now show.
    2. Select the number of copies and click Print . The file should now print.
    Bad example: Using “should” implies uncertainty
    To print your document:

    1. Select File | Print. The Print dialog is shown.
    2. Select the number of copies and click Print. The file will now print.
    Good example: Using present or future tense implies confidence

  10. Do you use “setup” and “set up” correctly?

    Often when writing technical documents, you will instruct the reader to “set up” his PC or run a “setup” file. Remember that “set up” is a verb, and “setup” is a noun.

    Correct use of “setup”: Verify that your network setup is correct before attempting to connect to the Internet.

    Correct use of “set up”: Click Go to set up your database

    “Set up” is a verb with many meanings, most commonly “to establish something.” “He is going to set up shop.” The single word “setup” is a noun, basically meaning an “arrangement.” “The setup was all wrong.” How can you remember this? Mentally replace “setup” or “set up” with “setting up.” If the sentence still basically makes sense, use two words. If it doesn’t, use the single word. For example, the sentence “he is setting up shop” makes sense. “The settingup was all wrong” does not.


  11. Do you know email should be email without the hyphen?

    Yes Microsoft Word spell checker is wrong.
    Good – “email”
    Bad – “e-mail”

    I do prefer to see email as email as the hyphen is really an extra thing that serves no purpose anymore.
    What if you wanted to say “Re-email this report please”… surely you would not say “Re-e-mail this report”… sounds like you have a stutter.

    Do you know commas and full stops always need to have “one” space after it ?

    When writing any documentation it is important to put only “one” space after commas or other punctuation. This makes the document easy to read and looks more professional.

    For example:

    Looking for your sent emails through a searching tool is simple.By using Windows Desktop search,you can search your relevant emails by recipient and/or by subject.
    Bad Example- No space after comma and full stop
    Looking for your sent emails through a searching tool is simple. By using Windows Desktop search, you can search your relevant emails by recipient and/or by subject.
    Bad Example- Two spaces after comma and full stop
    Looking for your sent emails through a searching tool is simple. By using Windows Desktop search, you can search your relevant emails by recipient and/or by subject.
    Good Example- One space after full stop and comma

    Original Source

    rules to better technical documentation

Documentation chapters

Index

Breif Description

Timeline

Flow Diagram

Tables and Database used

External Libraries & Modules used

Posted by: uttamkumar | July 25, 2008

coding standered & convention

or a team to work effectively and to share ownership of all the code, all the programmers within the team need to write the code in the same way or same programming style.These programming style refers to a set of guidelines,rules that one should follow in the team.programming style used in a particular program may be derived from the coding standards or code convention of a company/organization.

Good coding standards are important in any development project, particularly when multiple developers are working on the same project. Having coding standards helps to ensure that the code is of high quality, has fewer bugs, and is easily maintained.here are coding standered and convention that one should follow while developing a PHP program.

Comments convention
  • each php file should have Header comment block.This block should contains short description of file,category,package,auther,coyright etc.
  • each function block should have Function comment block.This bloc contains brief description about task perform by function,parameter passed and data type n identifier which function returns.
  • Inline comment can be helpful in case of complex logical block of code.
Naming convention
  • Identifier names should be explanatory, and should be in word-case. Also the first letter of the variable or parameter or IDs must tell the nature thereof.
    • For Example
      Class: ClassName
      Object: oObjectName
      Function Name: functionName()
      Private Method: _MethodName()
      Constants: CONSTANTNAME
      String Variable: sVariableName
      Array Variable: aVariableName
      Integer Variable:$ iVariableName
      Float Variable: fVariableName
      Boolean Variable: bVariableName
  • Global variable should contain package name in uppercase followed by 1 underscore and identifier name.

    For Example

    PEAR_destructor

Coding convention
  • Use an indent of 4 spaces, with no tabs.This helps to avoid problems with diffs, patches, SVN history.
  • lines at approximately 75-85 characters long for better code readability.
Posted by: uttamkumar | July 9, 2008

PHP Optimization tips.

Art to tune a system to perform more  efficiently.
Improving Speed
Using less resources
Less memory uses     [In computing]
Disk Space             [In computing]
Bandwidth             [In computing]

When to Optimize code
After UI, since in the process of optimization UI can be screwed up.

Here is a good example to explain code optimization.Suppose I need to calculate sum of the numbers from 1-25.A normal code can be as follows.

int i, sum=0,N=25;
for (i = 1; i <= N; i++)‏
sum += i;
printf (“sum: %d\n”, sum);

But if you think wisely you can optimized this code.Here is the optimized code.

int sum = (N * (N+1)) / 2;
printf (“sum: %d\n”, sum);

So overall idea to present this exercise is let you know that several time code can be optimized by applying formula  and logic.I prefer  to plan  and build logic before actually  you start the code.Try for  2-3  different-2 logic  and  implement  the best one.Here is some tips to optimize your PHP code.

Set the max value for your for-loops before and not in the loop.

str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4

Error messages are expensive . Error suppressing is slow

Pre increment is faster than post increment.

Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one

$row[’id’] is 7 times faster than $row[id]
Use foreach in case of iterating array in the loop.

Use single quotes instead of double quotes.

Incrementing a global variable is 2 times slow than a local var. Incrementing an object property (eg. $this->prop++) is 3 times slower

Don't go on creating class,object,methods randomly.often it is too much overhead, each method and object call consumes a lot of memory

Don't split methods too much, think, which code you will really re-use.

Try to use cache for your application.

Try comparing constant on the left side of the operand.eg. if(5==$five).will handle logical error

use isset for checking length of string which is faster than strlen() as it's language construct.
 eg. if (!isset($foo{5})) { echo "Foo is too short"; }
Avoid using regular expression.
eg.
preg_match("![0-9]+!", $foo);
vs
ctype_digit($foo);
ctype_digit is faster.

There are lot more to add will be followed in the next release.

Posted by: uttamkumar | May 28, 2008

Setting CronJob from web-browser.

In order to set a cronjob from a site/webpage using follow the following steps.

1. Write a script which will create/append a file with a cron task

2. call cron command of shell prompt using exce/system function from php and specify the filename from where task to be read.The file name will be the same file name where cron task has been written using script.Command will be as follows.

exec(“crontab UserName path/of/the/file”);

make sure that cron.allow file in the directory /etc has username specified for which cron has been set up.

you can check username for webbrowser using phpinfo() function of php.

Posted by: uttamkumar | April 10, 2008

OpenSocial – A API for social website

OpenSocial is a common API that can be used for developing social application which can interact with the people. OpenSocial has a common API for social applications across multiple websites.Using JavaScript and HTML one can develop which can access social network website.

here is the link http://code.google.com/apis/opensocial/

Posted by: uttamkumar | March 25, 2008

Using .htaccess

Enabling SSI with .htaccess

Another common use of .htaccess files is to enable Server Side Includes for a particular directory. This may be done with the following configuration directives, placed in a .htaccess file in the desired directory:

Options +Includes
AddType text/html shtml
AddHandler server-parsed shtml

Note that AllowOverride Options and AllowOverride FileInfo must both be in effect for these directives to have any effect.

Executing CGI script using .htaccess file

.htaccess file to permit the execution of CGI programs in a particular directory. following lines needed.

Options +ExecCGI
AddHandler cgi-script cgi pl

Alternately,  all files in the given directory be considered to be CGI programs, this may be done with the following configuration:

Options +ExecCGI
SetHandler cgi-script

Note that AllowOverride Options and AllowOverride FileInfo must both be in effect for these directives to have any effect.

Posted by: uttamkumar | March 25, 2008

About .htaccess

.htaccess files provide a way to make configuration changes on a per-directory basis.It’s a file which contains one or more configuration directives, placed in a perticular directory.The directives written in .htaccess is applies to the directory it is placed and to the subdirectory.

General use of .htaccess file

Authentication

mod re-write

SSI and executing CGI scripts.

Caution:- in order to use .htaccess file check AllowOverride directive is not set to none in the main configuration file.

Drawback of using .htaccess file.

Performance :- enabling .htaccess files makes server request slow since it check for each and every directory for the .htacces file.

Security :- it allow users to change configuration which has no control.Specify exactly what should be allowed in AllowOverride directive.

Posted by: uttamkumar | December 27, 2007

Authentication using .htaccess

The folder or the page on the sever can be prevented from the unauthenticated user using .htacess and .htpasswd files.

The .htaccess will look like this.

AuthName “Restricted Area”
AuthType Basic
AuthUserFile /path/of/your/folder/to/be/protected/.htpasswd
AuthGroupFile /dev/null
require valid-user

you should keep .htpasswd and .htaccess file under the directory/parent folder of the file  which you want to protect from the unauthorized users.

.htpasswd file will contain username and password in the following format.

userName:password

Posted by: uttamkumar | August 24, 2007

SQL Designer

SQL Designer is the tool available to generate schema for any database for mysql,postgresql, oracle and many more..It shows you pictorial presentation of how tables are related to each others in the database so that you can easily design a database with team discussion on the fly.Having design your database you can generate DDL statements.Demo of the tool can be found by following the link http://ondras.zarovi.cz/sql/demo/.

Older Posts »

Categories