Narendra Dhami

My Site

Archive for the ‘Web’ Category

What every developer should know about character encoding

Posted by Narendra Dhami on November 17, 2009

Good Article

Posted in Web | Leave a Comment »

Web Service API Design By Example

Posted by Narendra Dhami on October 9, 2009

API design is one of the more important skills possessed by web developers today. The reason behind this fact is that web applications are increasingly unable to live in isolation while at the same time providing the scope of features and web awareness users have come to expect. Developing for the web means, to a greater or lesser degree, being a productive citizen in a kingdom of online data exchange; and whether by formal engineering or organic growth, this means building an API.


Posted in Web | Leave a Comment »

Solutions To Session Attacks

Posted by Narendra Dhami on September 2, 2009

Recently i wrote two other security article on XSS and SQL Injection. I find many interesting facts and solutions on those topic that i research about and wanted to know more about other security measure. Thus, in this article i will discuss on different type of session attacks and how we can better protect ourselves against these attacks to better secure our web portal.

Session attack is nothing more than session hijacking. The most important information in session attack is to obtain a valid valid session identifier (SID). There are three common methods used to obtain a valid session identifier.

* Session Prediction
* Session Capture
* Session Fixation

More …

Posted in PHP, Web | Leave a Comment »

Searching in Google, the good way

Posted by Narendra Dhami on September 2, 2009

There are huge set of techniques by which searching in Google can be done more accurately, and here is a list of them that I frequently use.

1. Whenever we search for more than one keyword (i.e. computer programming, here we use 2 key word. a) computer b) programming) at a time Google will handle this keyword using a method called Boolean Default. Google’s Boolean default is AND; that means if we enter query words without modifiers, Google will search for all of them. If we search for:

computer programming

Google will search for all the words. If we want to specify that either word is acceptable, we can put an OR between each item:

computer OR programming

If we want to exclude a query item from search results, use a -.(minus sign or dash:

computer -programming

Note that there is no space after the (-) sign.
2. To search for a phrase use “” surrounding the phrase. like:

“Some Interesting Google Search Technique”

3. Period (.) and Asterisk (*) can also be used as traditionally used.
4. To search anything from a specific site use site:site_name.


This will search for the term google only in the specified site. Note that there is no space after the (:) sign.
5. To restrict search to title of web pages we can use intitle:search_keyword


6. Use inurl:search_keyword to restrict search to the URLs of web pages.


7. To search in body text use intext:search_keyword


8. Searches for text in a page’s link anchors

inanchor:”google desktop”

9. To search for a specific filetype use filetype:desired_file_type

bangladesh filetype:pdf

10. To search a copy of the page that Google indexed even if that site/page is no longer available at its original URL or has since changed its content completely. This is particularly useful for site/pages that change often.

Original From

Posted in Web | 4 Comments »

Image Optimization

Posted by Narendra Dhami on November 17, 2008

Good Article …

Posted in Web | Leave a Comment »

25 Awesome tutorials for web designers

Posted by Narendra Dhami on August 12, 2008

This is a collection of the best tutorials for web designers Take a look!

1. Most used CSS Tricks
A nice compilation of the most used CSS tricks in web design (rounded corners without images, style your order list, tableless forms, double blockquote, gradient text effect, vertical centering with line-height and more…)

2. Simple, Powerful Product Highlighter with MooTools
How to create a flexible tool for highlighting your sites products or services using the MooTools javascript framework.

3. Timeframe: Prototype date range component
Stephen Celis got tired of wiring together two date pickers for the common use case of grabbing a date range, so he created timeframe, which is “Click-draggable. Range-makeable. A better calendar.”

4. Rating Boxes with Starbox
Starbox allows you to easily create all kinds of rating boxes using just one PNG image. The library is build on top of the Prototype javascript framework. For some extra effects you can add Scriptaculous as well.

5. Navigation bar with tabs using CSS and sliding doors effect
This tutorial illustrates how to design a navigation bar with tabs using CSS and status effects (active, hover, link).

6. Create beautiful tooltips with ease
Prototip allows you to easily create both simple and complex tooltips using the Prototype javascript framework.

7. Solving 5 Common CSS Headaches
CSS is a relatively simple language to learn. Mastering it, on the other, can prove a little more difficult. Compensating for various browser inconsistencies alone can produce a migraine. In this article, we’ll demystify five of the most head thumping issues that you’ll encounter when building web applications.

8. Lazily load functionality via Unobtrusive Scripts
David Kees has written about Using Prototype to Load Javascript Files, which is an implementation of the general technique of loading functionality via scripts based on the availability of DOM elements.

9. Nice calendar with date-pickers
Calendar is a Javascript class ready to use that adds accessible and unobtrusive date-pickers to your form elements.

10. Fantastic News Ticker Newsvine-like using Mootools
This tutorial explains how to implement a “News” Ticker, with vertical scrolling, using mootools. It’s very simple and quick to implement in your web projects.

11. Ajax Forms with jQuery
Travor Davis illustrates how easy it is to turn a regular form into a AJAX form.

12.Sexy Sliding JavaScript Side Bar Menu Using Mootools
A simple animated sidebar using mootools ready to use in your web projects.

13. Pure CSS Animated Progress Bar
Here’s a simple demonstration of how you can create animated progress bar using pure css. The trick is very simple. We need 3 elements, one container and 2 nested elements.

14. Drag & Drop Sortable Lists with JavaScript and CSS
In Web applications I’ve seen numerous, and personally implemented a few, ways to rearrange items in a list. All of those were indirect interactions typically involving something like up/down arrows next to each item. The most heinous require server roundtrips for each modification…boo.

15. PHP components: Autosuggest
I published this simple “PHP component”, ready to use, to implement a search form with an autosuggest feature using PHP and MySQL. For all ajax beginners this is the most simple way to implement it (just with 8Kb) and the only thing you have to do is modify some parameters. Take a look at this post for all related infos.

16. Slick Tabbed Content Area using CSS & jQuery
One of the biggest challenge to web designers is finding ways to place a lot of information on a page without losing usability. Tabbed content is a great way to handle this issue and has been widely used on blogs recently. Today we’re going to build a simple little tabbed information box in HTML, then make it function using some simple Javascript, and then finally we’ll achieve the same thing using the jQuery library.

17. Multiple File Upload Magic With Unobtrusive Javascript
This tutorial illustrates how to upload multiple file with one ore several file inputs using jQuery.

18. Add grunge effect to text using simple CSS
In this short tutorial you will see how to add grunge effect to your text using just CSS and one image

19. Creating a fading header
A simple tutorial which explains how to create a fading header graphic using some basic XHTML and CSS and some unobtrusive Javascript, using the jQuery library, for the effect itself.

20. Accessible unobtrusive content scroller
This tutorial explains how to implement an unobtrusive content scroller.

21. How to Display Your RSS Count in a Cool Tooltip
How to display the current subscriber count using a combination of an extremely simple jQuery script and a PHP snippet.

22. Ext Accordion Widget Example
This page is about the InfoPanel and Accordion javascript classes and its purpose is to allow the potential users to get the feel-and-touch of the user interface they provide. It contains also step by step instructions on how to integrate the Accordion to a web page.

23. LightboxXL -prototype plugin
Lightbox functionality that you’re used to with embed Flash movies using prototype.

24. Change form elements appearance using FancyForm
FancyForm is a powerful checkbox replacement script used to provide the ultimate flexibility in changing the appearance and function of HTML form elements. It’s accessible, easy to use and degrades gracefully on all older, non-supporting browsers.

25. FORM elements design using CSS and list (ul and dl)
This tutorial explains how to design a pure CSS FORM using lists <ul>.

If you have other interesting links to suggest, please share them adding a comment!

Related Content
Woork table of contents
Scriptaculous effects compilation ready to use
Mootools effects compilation

Posted in Web | 6 Comments »

What Google Can Teach Ajax Developers

Posted by Narendra Dhami on August 9, 2008

With Google Gadgets, Google has arguably pushed Ajax scalability and testing harder than any other single vendor. But that was only the beginning. More…

Posted in Web | Leave a Comment »

Top 10 Javascript slideshows, carousels and sliders

Posted by Narendra Dhami on August 8, 2008

Good Articles

Posted in Web | Leave a Comment »

Reducing software defects: 10 things to keep in mind

Posted by Narendra Dhami on July 29, 2008

  1. Finding and fixing a software problem after delivery is often 100 times more expensive than finding and fixing it during the requirements and design phase.
  2. About 40-50% of the effort on current software projects is spent on avoidable rework.
  3. About 80% of the avoidable rework comes from 20% of the defects.
  4. About 80% of the defects come from 20% of the modules and about half the modules are defect free.
  5. About 90% of the downtime comes from at most 10% of the defects.
  6. Peer reviews catch 60% of the defects.
  7. Perspective-based reviews catch 35% more defects than non-directed reviews.
  8. Disciplined personal practices can reduce defect introduction rates by up to 75%.
  9. All other things being equal, it costs 50% more per source instruction to develop high-dependability software products than to develop low-dependability software products. However, the investment is more than worth it if significant operations and maintenance costs are involved.
  10. About 40-50% of user programs enter use with nontrivial defects.

More on each of these points can be found in this expanded article entitled, Software Defect Reduction Top-10 List, by Barry Boehm, USC and Victor Basili, U. of Maryland.

Posted in Web | Leave a Comment »

Motoko Hunt on Search Engine Optimization in Japan

Posted by Narendra Dhami on July 29, 2008

Motoko Hunt is originally from Japan and has been doing business in the US and Japan for two decades. She founded her company in 1998 and provides Japanese search marketing services in the US, Europe and Asia. She’s also the co-chair of the upcoming Search Engine Strategies Tokyo conference and will be speaking at the SES in San Jose. Motoko loves scuba diving, heavy metal music and Guinness.


By your estimate, what are the most popular search engines in Japan?

Yahoo has been the most popular search portal in Japan for years, but Google has been catching up. Right now, while Yahoo still is the #1 property in Japan, Google and Yahoo share the search market almost 50/50.

What are some of the things that can go wrong when a website owner merely translates their English content into Japanese?

There are many issues that I know of, but the keyword placement would be the most important issue with website localization.

Translators usually have no knowledge of SEO/SEM [search engine optimization/ search engine marketing]. Good translation doesn’t mean that the translators used the keywords that have the most search demands in Japan. You should always conduct the Japanese keyword research first, and give a list of important words that you’d want the translator to use.

Another big problem is when English text is translated into Japanese, often times it doesn’t sound naturally to Japanese. Grammatically, a Japanese sentence is structured almost backward of an English sentence. The keyword may be pushed to the end of the sentence or the paragraph after it’s translated, which could have an negative impact on the ranking.

Also, Japanese don’t speak as direct as Americans do, and Japanese audiences may react differently to your messages on the website. I always review and re-write my clients PPC ads instead of just translating them from English to Japanese.

Are there any layout pitfalls when creating a website that is supposed to work in Japan too? Like when it comes to fonts, colors and so on?

Since Japanese characters are double byte characters, if you don’t adjust the font size on Japanese pages, it would appear way too big. Many site owners forget to change the character settings and font settings as well as the country code setting on Japanese site. Japanese don’t like too much of [bright] colors on web site. Many American businesses who are successful in Japan use different color scheme – more calming colors – on their Japanese websites.

Are there crucial differences in Japanese searching when compared with search behavior in other countries?

Japanese are searching just about everything online, too. The search has become the number 1 source of information, and everyone goes online to research products and services that they consider purchasing. Perhaps the biggest difference would be that many Japanese use mobile search.

How big is mobile search in Japan, and do you think websites should have a special mobile version to be popular in Japan?

Very big, and we have a long history of mobile Internet in Japan. It’s not something just came up in past a few years. If your target market is 25 and younger, I highly recommend that you go after the mobile market in Japan. If your target market is female 25 and younger, you should create a mobile site sooner than later.

Do Japanese searchers on average search a lot in English, too, or relatively little? What about other foreign languages?

Japanese search using Japanese characters in most cases. Even the brand names such as Sony and Panasonic, more Japanese type them in Japanese characters.
If they are looking for French site, they may type French keywords to find French sites. If they want white paper in English, they’d use English keywords.

What are some of the important things to understand about Japanese language in terms of search, search engine optimization, and building an accessible website?

Unlike other languages, we use 4 sets of letters and characters to write in Japanese, and we use all of them together. Some words may be written in using any of these letters and characters each with spelling variations, but one of them would have the most search demand. Finding the right keyword (letters/characters & spelling) is one of the key elements in conducting successful SEO/SEM campaigns.
Since Japanese use double byte characters, once English file is translated into Japanese, the file size could double, which may slows down the page download time.

What can you tell us about message boards like 2channel and Futaba Channel? How important are these boards in the overall Japanese online world, and are they important to make a website known in Japan?

While blogs and SNS sites are very popular in Japan, it haven’t quite replaced these popular BBS sites. People go to BBS sites to exchange information, gossip and just chit-chat with others often times [anonymously]. Many Japanese business owners keep an eye on these sites to see what people are talking about their services and products. Many word-of-mouth information started to flow from these sites.

These sites could make a huge impact on your business in Japan, don’t try to market or to communicate with people as a business there. It takes an art form of how to participate in these sites especially if you are on the corporate side. If you don’t know exactly how to dance there, you’ll definitely get hurt.

Other than message boards, could you name some highly popular websites in Japan?

mixi is the most popular SNS sites, which can be accessed from both PC and mobile, and Mobaga-Town is one of the biggest gaming-SNS portal mobile sites. Yahoo Shopping is very popular as it’s the number 1 reason why people go to Yahoo Japan site, and Rakuten is the biggest e-commerce sites in Japan. They are #3 biggest site by property in Japan.

What are some of Japan’s social news [sites] which let you upvote stories, the kind like or Reddit? How popular are they?

We have many popular social news/bookmarking sites such as Hatena, Yahoo bookmark, FC2 bookmark and Livedoor Clip. They are very popular, but haven’t seen many Japanese businesses using these services to push or to communicate with customers.

What are the first things you look for when you try to search engine optimize a site for the Japanese market?

Placing the right keywords in right places.

Is search engine optimization as big in Japan as it is in some other countries? And is Japanese search engine spam as much of a problem as it is in other countries?

Every businesses know that SEO is important regardless of the size of the business, but the average skill level of agencies and the average knowledge level of clients in Japan are not as sophisticated as in US and Europe. For example, many people are still wasting time in creating a link-farm, and many clients don’t know that their agency stuffed keywords and added links to agency’s other client sites on their website.

Are there any popular stereotypes about the Japanese online world which you’d like to debunk?

Yahoo is not dominating Japanese search market any longer!

Posted in Web | 1 Comment »