Wednesday, July 15, 2009

Read SMS Using AT Command

Before I start explaining, you must be sure that your handset supports SMS read functionality using an AT command.

How can I test whether my handset supports or not?

Answer is pretty simple, try executing AT+CMGR=? AT Command. If it returns ”\r\nOK\r\n” then congratulation your handset modem supports Read SMS functionality.

Reading an SMS from memory location is always a big headache J. I waste lot of time just to read an SMS using AT command.

If you know SMS memory location then task will be simpler.

  1. First of all set memory type. Use AT+CPMS=”ME” command to set memory from which you are going to read SMS.

  2. After that execute AT+CMGR=”messageID” to read message.


Tip : Whenever you execute AT command never forget quotation mark (“), Carriage Return etc.

You will get message text directly if you are working under TEXT mode. In case of PDU mode you need to convert PDU into Original Message Text by writing some algorithms.

If you want indication for incoming SMS in your application then you need to enable this functionality.

Try “AT+CNMI=?” Command to test whether new message indication functionality is available in your handset or not.

If result does not contain any error and will return some parameters then congratulation again J

Now, use "AT+CNMI=2,1,0,1" AT command to enable new message indication to TE (terminal equipment).

Last but not the least, don’t forget to use "AT+CSMS=0" AT command set ISO 8859-1 character set.

Saturday, July 4, 2009

Send SMS using AT Commands

If you are writing an application which sends SMS using AT commands then, you must read this post. Few days ago I started to develop an application which is completely AT command based. Here I am going to explain the things that I learnt from experience.

First and the foremost thing before you start developing an application based on AT command , know which mode (text/pdu) your mobile handset supports.

If handset supports TEXT mode then work is simple.

  1. First you need to set text mode by using AT+CMFG=1 Command.

  2. And then use AT+CMGS=”+CellPhoneNumber” <enter>.

  3. If command execute successfully then It will return “>” as a response.

  4. After getting success response simply write your message ex. “this is test SMS”. This will submit SMS to network and will return the Message ID.

  5. If you want to send long message i.e. greater than 160 character length message then, this is really very useful.


I will cover how to send long message in my succeeding posts.

If handset supports PDU mode then work will be little lengthy and need some more efforts.

  1. For PDU mode, you need to set pdu mode by using AT+CMFG=0 Command.

  2. And then write AT+CMGS=<length><CR> command for modem to response. Here you can’t send the length of actual message. You need to convert the text into 7-bit or 8-bit encoding scheme. I included some useful links and sample application at the bottom of the page to accomplish this task.

  3. If command execute successfully then It will return “>” as a response.

  4. After getting success response, send <PDU><ctr-z/esc > sequence. This will submit SMS to network and will return the Message ID.

  5. If you want to send long message i.e. greater than 160 character length message then, this is really very useful.


Reference :

  1. PDU message format : http://www.dreamfabric.com/sms/

  2. Complete information about all AT Commands : http://www.developershome.com/sms/operatingMode.asp

  3. Text to PDU converter : http://nerdlabs.org/tools/pdu.php


Sample Application :

  1. PDU Decoder : http://www.codeproject.com/KB/IP/PDUDecoder.aspx

  2. Sample Applications : http://www.scampers.org/steve/sms/samples.htm


Do share new things with me.

Friday, July 3, 2009

Google Search Engine Optimization Guidelines and Best Practices

If you want better rank in Google Search Engine then, why not to follow guidelines given by Google itself. Read the article below to know what Google officials have to say for Search engine optimization.

I have taken much of the information from the Google SEO guideline document.

1. Title Tag


Do

  • Title should be unique and accurately described the page content.

  • Write unique page title for each page of your website. So that Google know how each page is different from other.

  • Title can be short or long. If your title is large then Google will show only portion of it.


Avoid

  • Writing Title which has no relation to the page content.

  • Using Blank or unnamed title like “New Page 1” or “Untitled”

  • Using Single title for all the pages or group of pages.

  • Using unneeded keywords in title.


2. Description Meta Tag

Do

  • Write description that would be both informative and interesting.

  • Unique description for each page.


Avoid

  • Writing Title which has no relation to the page content.

  • Writing Generic description like “page about...” or “this is the page that...” or something like that.

  • Filling it with only keywords.

  • Writing single description for each page.




3. Improve URLs Structure

Do

  • Use words in the URL link that are relevant to your website content.

  • Proper directory structure should be there.

  • Unique URL to reach any document.


Avoid

  • Using page name like “WebPage1.html”

  • Using long URLs or session ids or querystring variables.

  • Using directory names like “Dir1” or “Folder1” etc.

  • Using directory name that does not relate to page content.

  • Mixing www. And without www. URLS



  1. 4. Website Navigation Should be Simple


Do

  • Good linking structure from top to bottom with proper manner.

  • Use text links to navigate from one page to other. So that crawler can easily understand your website.

  • Use “breadcrumb” navigation (ex. Yoursitename >> items >> productname). Using breadcrumb navigation not only gives idea about where you are in the website, but also allow user to go to previous section very easily.

  • Use HTML site map page with XML site map file. This is huge benefit for SEO purpose.

  • Have meaningful and useful 404 page. Visit Google’s widget for 404 Page.


Avoid

  • Creating complex navigation links web.

  • Using image, javascript, dropdowns or flash object for website navigation.

  • Linking broken or dead links in Site map.

  • Using unorganized sitemap page.

  • Using vague message like “page not found”.


5. Quality of Content

Do

  • Write easy and meaningful content.

  • Organize the different topics in the content.

  • Include keywords that user always search. See the search volume of keywords that you have included in your content.

  • Write Fresh and Unique content.

  • Offer exclusive content or services.

  • Create content for users not for search engine. J John chow is also telling the same thing please read more about John chow


Avoid

  • Spelling and Grammatical mistakes.

  • Coping existing content.

  • Avoid unnecessary keywords.


6. Anchor tag text

Do

Avoid

  • Writing the generic content like “Click Here”.

  • Unrelated anchor text.

  • Lengthy anchor text like sentences or paragraph.

  • Using CSS that makes text and link identical in look.

  • Using excessive keywords.


7. Heading Tag

Do

  • Distinguish the main points and sub points and use heading tag appropriately.

  • Not use too many heading tags on the page. This will confuse user about the end of the content.

  • Create proper page structure using heading tag.


Avoid

  • Writing unrelated content in heading tag.

  • Avoid using heading tag where <em> or <strong> tag is appropriate.

  • Putting whole page content into heading tag.

  • Using tag if you only want to give style.




8. Image Tag

Do

  • Give reasonably good file and brief description about what the images is all about.

  • Write very good description when you use image as a link. (Must).

  • Store all the website images under one common directory.

  • Use JPEG,GIF, PNG and BMP images because this are the common file types that all browser can easily understand.


Avoid

  • Giving random file name like image1.jpeg or pic1.gif etc.

  • Extremely lengthy file name

  • Writing keywords and long sentences in alt tag.




9. Use robots.txt Effectively

Basic Idea : robots.txt is the file which tells google.com about the pages that user do not wish to crawl. This file stay under the root directory. Google web master tool help you to create this file.

Do

  • Use secure method for some sensible content.

  • .htaccess, encryption, password protection are the better alternatives.


Avoid

  • Allowing search result kind of pages to be crawled.


10. rel=”nofollow” attribute of Link (anchor tag)

Do

  • Use nofollow set to the link for which you don’t want to pass your reputation to other.


Ex. If you want to inform others about the spam link then you can use nofollow for such link to avoid passing your reputation on to it.

Use nofollow set to the link for which you don’t want to pass your reputation to

  • Write <meta name=”robots” content=”nofollow”> if you're interested in nofollowing all of the links on a page.


This are the guidelines and best practices given by the Google Web Master team. Hope you enjoy reading this article.

Wednesday, June 24, 2009

How to Improve slow running query performance using an Index ?

I recently come across the situation where my query was running very slow. I written a perfect query with good inner join and with proper condition. Have a look at query and its executing plan.

Query Execution Plan Before indexing

As you can see in the image query takes 1.28 minute to execute successfully. And as you can see in the figure , cause for the problem is Clustered Index Scan on LotDetails Table.

See the image below to get the clear idea about Clustered Index Scan Cost in this query.

Query Execution plan Analysis

What I did was Created Non-clustered index on “SlipID” and added “Active” column into Included Columns.

Create Index On Table

Include columns in index


After doing this when I run my query it took 0 second to execute successfully. And Clustered index scan is now turned into Index seek which is 3% of the total execution cost.

Query Execution Plan After indexing

So use index as and when required to boost the performance of your T-SQL Query.

Please correct me if I am wrong anywhere. :)

Saturday, June 6, 2009

Six Useful tips To Earn Money With Google Adsense

I recently went through different articles written under AdSense Help Section. All articles are worth reading if you are interested in earning good income with Google AdSense. I found some interesting tips in this section

  1. Ad Type : 336x280 Large Rectangle, 300x250 Medium Rectangle and the 160x600 Wide Skyscraper this are the good performer.

  2. Text + Image : Always prefer or give a try to Text and image ad combination.

  3. Positioning Ads : Ad just above the website content or just below the end of the content tends to perform well. Also, ads placed in between the content are also a good performer. If are you running a blog then the case may be different. In case of blog the add unit on the right hand side and add unit just below each post is very good money making machine.
    Reference : https://www.google.com/adsense/support/bin/answer.py?answer=43869 https://www.google.com/adsense/support/bin/answer.py?answer=17954

  4. Wider ad formats tend to be more reader-friendly.

  5. Try putting as many ads you can in page. Right now you can place only 3 ads per page.

  6. Colour : Change link colour, ad content colour and title colour depending upon your webpage colour scheme. The impact of using this technique is user would have difficult to understand that whether it’s google ad your website link.


Reference : https://www.google.com/adsense/support/bin/answer.py?answer=17957

Click on the link below to find out all the useful tips given by the google for adsense.

https://www.google.com/adsense/support/bin/static.py?page=tips.html

Note : I have just try to summarise whatever is written in Google Adsense help section. All credit for this goes to Google Adsense Team.

Friday, June 5, 2009

Right Keyword Selection for SEO

In this post I am going to tell you how good keyword selection can affect your site in general.

You open a search engine website , typed some search word(s) and press search button and in return search engine will give you number of results that matches your criteria. So here is my point ? How search engine will return those thousands or millions or billions results? Well, the answer is simple by looking at each page and search for the term you entered.



So when you are selecting keyword for search engine optimization you should think from the client perspective.

Let me explain by example , suppose you have written “Software Consultant India” , What will search engine do when you hit search button,

It will return

  • all the pages containing the exact phrase “Software Consultant India”

  • all the pages containing the words “Software”, “Consultant” and “India” with nearby relation.

  • all the pages containing the word “Software”, “Consultant” and “India” without looking closeness in mind

  • all the pages that have links that contain this “Software Consultant India” phrase

  • all the pages that has the word “Software”

  • all the pages that has the word “Consultant”

  • all the pages that has the word “India”


So choose the right keyword you will surely get better rank in search engine.

One more thing to remember is that don’t ever include irrelative keywords in your page. What will happen in that case, even if people found your web site it will be useless for them because your site contain different information than they are looking for.



Bottom line is that Use right keywords and relative to your domain or business.

At any point if you feel that I am wrong then don't hasitate to post a comment with correction.

Database Publishing Wizard - SQL server 2005

The topic is self explanatory :).

What would you do if you want to generate script that contains data and schema too. To generate script with schema is pretty simple but what about data. Microsoft Database Publishing Wizard is the tool that work with SQL server 2005 to generate that kind of script. Below are the steps to get started.



Step 1
database publishing wizard


Step 2
database publishing wizard


Step 3
database publishing wizard


Step 4
database publishing wizard


Step 5
database publishing wizard


Step 6
database publishing wizard


Step 7
database publishing wizard


Step 8
database publishing wizard

this is the example of database publishing wizard 1.1. I have not used the versions after 1.1 because this version served all my purpose.


Download Microsoft SQL Server Database Publishing Wizard 1.1


if you are sql server 2008 user then you can not use this :) because good news is that sql server 2008 has this wizard by default.


Please follow http://www.kodyaz.com/articles/sql-server-script-data-with-generate-script-wizard.aspx link for sql server 2008 database publishing.


Share your thought with me !! :))