Friday, 1 April 2011

Editorial

The Cricket World Cup fever is in its final stage. Everybody is looking forward to a World Champion title. The tournament has been very interesting so far and we have enjoyed the streaming of Live Cricket at cafeteria. With many ups and downs our team has finally managed to reach this stage where the title is just a match away. I wish our team all the very best on behalf of Decos India.

Apart from cricketing world we have good news at Envision team too. This month two young, dynamic and very enthusiastic members have joined us in the form of Chitra and Mamta. This month’s issue has shaped through their significant contribution. Now onwards if you have anything to share (including your nomination to join the group) with Envision team then you can reach to them directly.

On the day of April Fool there is one more good news. The mail that you saw today morning from Ankur is not a hoax (the mail was sent yesterday night, not today). We have indeed moved to our new office which is a great piece of art. Congratulations to all who have directly or indirectly contributed to the success of creating 'meteorite building'.

Having read so many good news let’s see what’s there in this issue of Envision. In the technology section we have an article on Wordpress custom post type creation by Anand. Another article in section is about working with modem through instruction commands by Jugal. In this release we have a test for you. We want to test how careful you are while watching a mystery video.

Please welcome new members to our family and extend your birthday wishes to people through your comments on new joiners and birthday pages respectively.

Lastly, I thank all of you for supporting Envision initiative by patiently reading, suggesting and contributing in all possible forms. I am happy to receive 100% positive feedback on our new style of Envision.



Mandar Thosar
Asst. Manager (Marketing)

New Building Video

"We already know many things about our new-edge head office meteorite shaped building." May be but new joiners don't feel the same way. So we are presenting the video story of this building of this great structire.



The following video should be of interest to all.

Why?


See Paul in the role of Star Warrior. Don't believe? Watch yourself.

WordPress Custom Post Type Creation

By Anand Joshi

Before understanding the advanced part of it let me explain you in brief about WordPress. It is an FOSS CMS i.e. content management system powered by PHP and MySQL. Among many features it provides the important features are plug-in architecture and a template system which makes this CMS a robust one. It is used by over 10% of global websites.

Now moving to one of the most exciting features coming in WordPress 3.0 is custom post types, which will vastly expand WordPress’ CMS capabilities. This feature will come handy especially when using WordPress as a CMS.

WordPress Custom Post types are basically different kinds of building blocks that when put together form our website. To understand it in a better way let us create our custom post type called “place”.

Any WordPress system will have functions.php in themes folder. This is the one of our interest. To achieve the purpose you will have to add the following code at the end of the functions.php file.

function post_type_place() {
 register_post_type('place', array('labels' => array('name'=>__('Places'),'add_new_item' => __( 'Add New Place' ),'edit_item' =>__( 'Edit Place' )),
                             'public' => true,
                             'show_ui' => true,
                             'supports' => array('title','author','editor',
                                        'post-thumbnails',
                                        'excerpts',
                                        'trackbacks',
                                        'custom-fields',
                                        'comments',
                                        'revisions'),
                                        'rewrite' => false,
                                        '_builtin' => false,
             '_edit_link' => 'post.php?post=%d',
             'capability_type' => 'post',
             'hierarchical' => false,'query_var' => true
                                )
                      ); 

  // add to our plugin init function
  //for single template
  global $wp_rewrite;
  $place_structure = '/place/%category%/%place%';
  $wp_rewrite->add_rewrite_tag("%place%", '([^/]+)', "place=");
  $wp_rewrite->add_permastruct('place', $place_structure, false); 

  //for displaying tags
  register_taxonomy_for_object_type('post_tag', 'place'); 

  //for displaying categories
  register_taxonomy_for_object_type('category', 'place'); 

}
// Add filter to plugin init function

If you want you can use a single page template for displaying custom post. 

//function to redirect to place page(templating system)
// Add filter to plugin init function
add_filter('post_type_link', 'place_permalink', 10, 3);
// Adapted from get_permalink function in wp-includes/link-template.php
function place_permalink($permalink, $post_id, $leavename) {
 $post = get_post($post_id);
 $rewritecode = array(
  $leavename? '' : '%postname%',
  '%post_id%',
  '%category%',
  '%author%',
  $leavename? '' : '%pagename%',
 ); 

 if ( '' != $permalink && !in_array($post->post_status, array('draft', 'pending', 'auto-draft')) ) {
  $unixtime = strtotime($post->post_date); 

  $category = '';
  if ( strpos($permalink, '%category%') !== false ) {
   $cats = get_the_category($post->ID);
   if ( $cats ) {
    usort($cats, '_usort_terms_by_ID'); // order by ID
    $category = $cats[0]->slug;
    if($category == "featured") { 

     $category = $cats[1]->slug;} 

    if ( $parent = $cats[0]->parent )
     $category = get_category_parents($parent, false, '/', true) . $category; 

   }
   // show default category in permalinks, without
   // having to assign it explicitly
   if ( empty($category) ) { 

    $default_category = get_category( get_option( 'default_category' ) );
    $category = is_wp_error( $default_category ) ? '' : $default_category->slug;
   }
  } 

  $author = '';
  if ( strpos($permalink, '%author%') !== false ) {
   $authordata = get_userdata($post->post_author);
   $author = $authordata->user_nicename;
  }
  $rewritereplace =
  array(
   $post->post_name,
   $post->ID,
   $category,
   $author,
   $post->post_name,
  );
  $permalink = str_replace($rewritecode, $rewritereplace, $permalink);
 } else { // if they're not using the fancy permalink option
 }
 return $permalink;
}
add_action('init', 'post_type_place'); 

Update the permalinks.

The newly created post type (place) will look like this in the WordPress administrator dashboard under the links panel:

Now after creating a custom post you will want to use it. Now see the image below to understand how to add new place in WordPress.

Once you add couple of places the list view under WordPress dashboard will look something like below.

To be able to display the single-type-template using WordPress you will have to use a PHP file by the name single.php. To display newly created custom post you will have to use single-{posttype}.php. So in our case the filename would be single-place.php.

Similarly to archive the custom post use archive-{posttype}.php in WordPress. Normally, the archive-type-template use archive.php file. So in our case the archive template file name would be archive-place.php.

April New Joiners

Every new member coming in and joining Decos family strengthens the intrinsic capability of an organization to seize every possible opportunity it is exposed to.

Decos success for many years has been based on the efforts of the young talent. These young people work with lots of enthusiasm and have innovative ideas and were self-empowered to grow the organization. We are quite sure that our new team members will also continue the same tradition.

We welcome all of them to Decos family to grow it further while achieving their own career enrichment.

Below is the list of new joiners to the Decos family:

1. Shridevi Kadam on 1-Mar-11
2. Sandeep Yadav on 7-Mar-11
3. Shivangi Agrawal on 10-Mar-11
4. Swati Bhagwat on 21-Mar-11

Wish you a very bright carrer at Decos India!

AT Commands

By Jugal Panchal

What is an AT command?

AT commands allow giving instructions to both mobile devices and ordinary landline telephones. The commands are sent to the phone's modem, which can be a GSM modem or PC modem. Different phones support different sets of AT commands. This means that a specific phone might not support all AT commands listed at end of this article. Currently there is no authoritative list available of supported AT commands by all phones.

Overview

This article focuses on AT commands on Nokia's GSM and CDMA products only. Different manufacturers may have different sets of AT commands. Fortunately, many AT commands are the same. Mobile device manufacturers may also give attention to operators to allow or not to allow some commands on phones.

AT commands can be used for operations that are usually done from the keypad, for instance calling a number, sending, reading, or deleting an SMS, setting the SMSC number, looking for a GPRS access point, reading and deleting phonebook data, reading the battery status, reading the signal strength, and so on. When you want to make a PC-based application to interface a mobile phone using USB or Bluetooth, these commands are needed to communicate with mobile phones. Nokia provides an AT command set guide, where you can see the basic command syntax and the response of the command in various situations. See the Related Links section at the end of this article.

Using AT Commands with .Net

Before going for developing application we have to do some basic step with OS:

1. For AT commands to work, we have to connect our device to our PC either by Bluetooth or USB cable (just Google if you don’t know how to connect mobile with PC using either Bluetooth or USB cable).

2. After making connection you need to check its port which is very easy. Just go to control panel and open Phone and Model option and you will see something as below.


There is a Modem with its port. You have to remember that port in this case that is COM6.

3. Now comes the coding part

a. Design the form as below


Note: At the time of design drag a serial port components from toolbox in Components Tab.

b. Load all Com Port from your PC to combobox.

private void frmATCommandTest_Load(object sender, EventArgs e)
{
/*
* Name of all ports are copied to Combobox
*/
this.cmbComPorts.Items.AddRange(System.IO.Ports.SerialPort.GetPortNames());
}

c. There are various baud rates as per speed.

i. 110
ii. 300
iii. 1200
iv. 2400
v. 4800
vi. 9600
vii. 19200
viii. 38400
ix. 57600
x. 115200
xi. 230400
xii. 460800
xiii. 921600

So add as items to second combobox.

d. To connect with device

private void btnConnect_Click(object sender, EventArgs e)
{
try
{
if (!this.serialPort1.IsOpen)
{
this.serialPort1.PortName = cmbComPorts.Text;
this.serialPort1.Open();
this.serialPort1.BaudRate = cmbBaudRate.Text;
this.serialPort1.DataBits = 8;
this.serialPort1.StopBits = System.IO.Ports.StopBits.One;
this.serialPort1.Parity = System.IO.Ports.Parity.None;
this.serialPort1.Handshake = System.IO.Ports.Handshake.None;

MessageBox.Show(
"\nCONNECTED SUCESSFULLY\n", "Information");
}
else
{
MessageBox.Show(
"\nALLREADY CONNECTED\n", "Information");
}
}
catch
{
MessageBox.Show(
"\nCOMMPORT IS NOT CONNECTED", "Information");
}
}

For closing connection just call close method of Serial Port.

e. It's time to code for sending a message now

public void btnSend_Click(object sender, EventArgs e)
{
if (this.serialPort1.IsOpen)
{
serialPort1.BaseStream.Flush();
string cb = char.ConvertFromUtf32(26);
System.Threading.Thread.Sleep(
2000);

this.serialPort1.Write("AT+CMGF=1\r");
//Ufone Service Center
this.serialPort1.Write("AT+CSCA=servicecenter\r\n");
this.serialPort1.Write("AT+CMGS=\"" + txtPhoneNumber.Text + "\"\r\n");
this.serialPort1.Write(txtMessage.Text + cb);

MessageBox.Show(
"\nMessage Sent\n", "Information");
}
else
{
MessageBox.Show(
"\nSerial Port Is Not Open\n", " ERROR ");
}
}

Now it is a time to run this application. It should run successfully in your Visual Studio. If you face any error the Google it or simply ask me.

To operate the code you have to select the communication port with which your mobile has been connected (in our case it is COM6) and choose Baud Rate after click on connect button. This should show you a message for successful connection. Now type the number and message and click ‘send’ button.

There are lots of many things (such as call, miss call (you can set time for fun), end call, bulk message, send multiple copy of message, check IMEI number, battery status, manufacture name and date, date and time etc.) we can do with AT Commands but for now we will stop here. For more details I have mentioned links at end of article. I have also mentioned at set of AT Commands that might come handy for you if you would like to test it.

AT Commands set for Nokia GSM and CDMA products: (These can work on other mobile set too)

Call control:
Command - Description
ATA - Answer command
ATD - Dial command
ATH - Hang up call
ATL - Monitor speaker loudness
ATM - Monitor speaker mode
ATO - Go on-line
ATP - Set pulse dial as default
ATT - Set tone dial as default
AT+CSTA - Select type of address
AT+CRC - Cellular result codes

Data card control commands:
Command - Description
ATI - Identification
ATS - Select an S-register
ATZ - Recall stored profile
AT&F - Restore factory settings
AT&V - View active configuration
AT&W - Store parameters in given profile
AT&Y - Select Set as power up option
AT+CLCK - Facility lock command
AT+COLP - Connected line identification presentation
AT+GCAP - Request complete capabilities list
AT+GMI - Request manufacturer identification
AT+GMM - Request model identification
AT+GMR - Request revision identification
AT+GSN - Request product serial number identification (IMEI)

Phone control commands:
Command - Description
AT+CBC - Battery charge
AT+CGMI - Request manufacturer identification
AT+CGMM - Request model identification
AT+CGMR - Request revision identification
AT+CGSN - Request product serial number identification
AT+CMEE - Report mobile equipment error
AT+CPAS - Phone activity status
AT+CPBF - Find phone book entries
AT+CPBR - Read phone book entry
AT+CPBS - Select phone book memory storage
AT+CPBW - Write phone book entry
AT+CSCS - Select TE character set
AT+CSQ - Signal quality

Computer data card interface commands:
Command - Description
ATE - Command Echo
ATQ - Result code suppression
ATV - Define response format
ATX - Response range selection
AT&C - Define DCD usage
AT&D - Define DTR usage
AT&K - Select flow control
AT&Q - Define communications mode option
AT&S - Define DSR option
AT+ICF - DTE-DCE character framing
AT+IFC - DTE-DCE Local flow control
AT+IPR - Fixed DTE rate

Service:
Command - Description
AT+CLIP - Calling line identification presentation
AT+CR - Service reporting control
AT+DR - Data compression reporting
AT+ILRR - DTE-DCE local rate reporting

Network communication parameter commands:
Command - Description
ATB - Communications standard option
AT+CBST - Select bearer service type
AT+CEER - Extended error report
AT+CRLP - Radio link protocol
AT+DS - Data compression

Miscellaneous commands:
Command - Description
A/ - Re-execute command line
AT? - Command help
AT*C - Start SMS interpreter
AT*T - Enter SMS block mode protocol
AT*V - Activate V.25bis mode
AT*NOKIATEST - Test command
AT+CESP - Enter SMS block mode protocol

SMS commands

SMS text mode:
Command - Description
AT+CSMS - Select message service
AT+CPMS - Preferred message storage
AT+CMGF - Message format
AT+CSCA - Service centre address
AT+CSMP - Set text mode parameters
AT+CSDH - Show text mode parameters
AT+CSCB - Select cell broadcast message types
AT+CSAS - Save settings
AT+CRES - Restore settings
AT+CNMI - New message indications to TE
AT+CMGL - List messages
AT+CMGR - Read message
AT+CMGS - Send message
AT+CMSS - Send message from storage
AT+CMGW - Write message to memory
AT+CMGD - Delete message

SMS PDU:
Command - Description
AT+CMGL - List Messages
AT+CMGR - Read message
AT+CMGS - Send message
AT+CMGW - Write message to memory

Related links


April Birthdays

1. Pallavi Sankpal - 4th April
You are extremely methodical in your thought but you must learn to temper your opinion and accommodate other people's point of view. Because you are hard working, you may tend to exceed your physical capacity and this may result to a high degree of self criticism.

2. Abhijit Shinde – 11th April
ou are such a social human being but at times can also be hot-headed restless and impatient. You want it now! You have strong emotions that can be channelled creatively so take a bit of the fire of your spirit and pump it into those directions rather than banging your head against a wall.

You have an innate love of sharing and being rewarded for work done fairly but have the tendency to take on far too many tasks and responsibilities for your own good.

3. Sanjay Dhende – 14th April
You have a distinct if not forceful manner which you must realise will overwhelm others at times. You are quick witted and humorous streak is most able to disarm and influence those around you whenever you need assistance. Don't develop the habit of using these magical powers of influence you possess for trivial desires as you may alienate friends by doing so.

You may suffer some health or constitutional weakness in the throat at some stage. Pay attention to your breathing process.

4. Jagdish Kaur – 16th April
Though Neptune endows you with high creativity and imagination, which you strive for, it is equally important to you to make your dreams a practical reality.

You have an incredible way of bringing your dreams and imagination into the material world. This may overload your being with a mixture of passion and creative visualisation - possibly a dangerous cocktail for relationships. Your partners may feel as though they are competing with your creative dreams.

You should always only maintain one relationship at a time and never ever use your sexual power to control others.

5. Subodh Patil – 18th April
6. Shoeb Sayyed – 18th April
You are completely unafraid to disagree with anyone and to make your opinions known. Often quite loudly Try lightening your manner a touch and practising the art of quiet assertion. Your energies indicate constant bickering and squabbling are likely if you don't temper the abrasive side of your nature.

Strangely though your debating skill may in fact bring you good fortune and gains in law, legal disputes, sales or the diplomatic corps. You have great physical power and pride in your bodily strength. There are indications of injury, possibly to the knees and ankles.

7. Balbir Singh – 21st April
You are born under a lucky powerful vibration which means you are destined for comforts and success along with an intense love of material wealth and sensuality.

There is a danger of overstepping the mark therefore by making luxury your God. Know when enough is enough and don't give more thought than necessary to this part of life as inheritances and wealthy partners will more than likely come your way.

8. Swati Bhagwat – 23rd Aril
Your vibrations are definitely of a refined and artistic quality. You are endowed with the power of speech, poetry and communications. It is amazing to observe the lightning speed of your thought which results in quick decisions and they are usually correct.

You have natural business skills as Mercury usually attracts its natives to those lines. Learn to be more flexible with your opinions and ideas and change with the times. This can only enhance the opportunities which will come your way.

Are you observant?

Many things keep happening around us every time. But we don't observe most of them carefully. Well, it is both good and bad depending on what you ignore in the process.

If you ignore less important facts and details then it is good because it will save a lot of time that you would require to process that information. On the other hand, if you miss some important thing then your decision may not lead you to the desired goal.

Below is a test for you to know how observant you are. You don't have to do anything. Just watch it. You will know the answer in the middle of the video so watch every second and pixel of it carefully.