Monday, July 13, 2009

Naming Conventions C#

Variable name :

  • Variable type should have prefix. ( Example b = boolean , str = String , i = integer , o = class object.
  • First letter of the word should be capitalized
  • Variable should have //comments like below
Example :
int iCounterForArray; // counter for array
string strNameOfEmployee; // string identifies name of the employee. Scope is limited locally
bool bAlive; // boolean tells whether process is still alive. scope is global
MyDrawingClass oDrawingClass; // local object for drawing class


Function name :

  • First Letter should be small
  • First letter of the following words should be capitalized
  • Should have meaningful name
  • Do not use the short names, instead use fullwords and long names
  • Should have comments before the function signature explains what the function does and what the argumens should have.
  • Comments should describe return values too.
Example :

/*
* This function compares the process names.
* aStrProcessName : string value of process name to be compared.
* return : true if same else false
*/
bool isProcessAlive( string aStrProcessName )
{
bool bAlive = false;
/* do string comparison */
if( aStrProcessName == strProcessName)
{
bAlive = true;;
}
return bAlive;
}


Class Name :

  • First letter Should be small case
  • All the first letter of the following words should be capitalized
  • All the member variables and functions should have comments.
  • Must have destructor and constructor
Example :

/*
* Main drawing class inherited from base drawing class
* This will draw customized drawing functionalities for
* circle and rectanlges.
*/
class MyDrawingClass : public MyDrawingBaseClass
{
/* Boolean identifies the current state */
private bool bState;
/* Getter function for state */
public bool getState();
}

Thursday, December 4, 2008

Description of URI

Very good explanation of URI can be found from here : http://www.ltg.ed.ac.uk/~ht/WhatAreURIs/

Tuesday, November 4, 2008

Binary Reduction of your application

Refer the forum Nokia tutorial here : Optimization

Compression for EXE's and DLL's is enabled by default for 3rd edition
sdk's. Thats why you are seeing no diffrences in you application
sizes. There are various options that you can try:

1. You can tweak compression method used. Usually its Deflate for Code
and Huffman for data. However i doubt you will be able to reduce your
exe size much.
2. Try turning on optimizations on GCCE compiler. It will generate
smaller code at cost of speed. Have a look at
http://wiki.forum.nokia.com/index.php/Changing_the_GCC-E_optimization_level_to_speed_up_your_application.
3. Try using ARM compilers. They generate very small and relativly
faster builds. I had aboute 4 times reduction in my dll size just by
compiling my code over it.

Apart from above mentioned techniques you can tweak your code to
achieve smaller builds:
1. Dont use unnecessary headers in cpp's as they may generate static
literal strings contributing to the size of your code.
2. Minimize macro's/inline functions usage.
3. And as always MODULARIZE your code.

Thanks to VJ.

Wednesday, June 11, 2008

Peer to Peer Sharing

Whenever there is a restriction to access data ( video,audio,picture etc ) in this inter networked world there is always an alternative technology. In that way I love torrent protocol which is a weapon to kill the denial of data. I am one of those family of Michel Moore who hates Digital Rights management ( Which is created by Rich for Rich to be Rich).

Well , Traditionally or Primarily data accessed from a server or service provider ( Web Server) by a client ( Browser ). So one or more client access the server and view/download data from server. Since Server is key storage place of information, privacy policies can be imposed here like pay to use/should be 18/Only in America.

Imagine if every client turns to be server and every server is a client . Oops we form an ad-hoc network. In where there is no server or no client , there are only peers. Peers always have freedom to share whatever information they are willing to share. Torrent protocol works in this way. Torrent is a peer to peer to communication protocol to share data's.
Read more about operation and meaning of bit torrent here : http://en.wikipedia.org/wiki/BitTorrent_%28protocol%29

There are lot of bit torrent client software available but my favorite is uTorrent.
More clients can be found here : http://en.wikipedia.org/wiki/BitTorrent_client

You can find torrent files ( file in where information about other peers/seeds are stored)
in torrent search engines , of course the best one is http://www.mininova.org/

4 Steps to download your favorite music

Have fun and live in data unrestricted world.

Wednesday, May 14, 2008

How to upgrade phone software in Nokia phone ?

Before you start patience and slow and steady doing of steps are important. It is easy if you do it right and follow the steps properly.

Step 1 : Secure your data's ( Like contact,calender data , images,music etc)

    • Install PC Suite
      • PC Suite is Personal computer application which communicates to Nokia phone through USB data cable. PC Suite has device driver(or cable software) which is phone model specific and User Interface application. PC Suite is very much intrusive, means you can learn it by playing around the application.
      • You can download the PC suite application from http://europe.nokia.com/A4144902->Nokia PC Suite
      • Install application in your computer. Usually which includes cable softwares also.
      • Connect Phone and Computer through USB data cable. Your computer should automatically recognize your phone model. If not you lack device driver software ( other name cable software ) which you download and install for your phone model from http://europe.nokia.com/A4144902 -> Cable Drivers
      • Sync is widely used application to synchronize your data's. Choose Sync from PC Suite in computer which automatically synchronize your contacts & Calenders etc. Follow the guided steps shown by PC suite application.
    • More to secure your data
      • Choose backup option in PC Suite which automatically backs up your data in computer.
      • In your phone , Tools->Utilities there will be an application Memory. Select that and choose Backup Phone Memory from Options menu. Which will copy your phone data's to your memory card.
      • Now you secure your data's in 3 way. So you could be sure that no data's will be lost. Since data is single most important here.
      • Disconnect the phone and check your data's in computer , just to make sure you have all data's are copied to computer by using PC suite application.
Step 2 : Upgrade your phone software
      • Remove your memory card from phone and keep it aside.
      • Connect your phone to computer through USB cable.
      • Install phone up gradation software from http://europe.nokia.com/A4176089
      • Before you start see the demo and follow the steps. That familiarize you with the process of upgrading.
      • It is easy and reserve sometime without disturbance , that is important. taking out the cable or not following the steps properly could sabotage your phone. It might take 15 to 20 minutes. So sit and watch whats going on.
      • Following the steps guided by up gradation software is very important.
Step 3 : Copying back your data's and make your phone ready to use
      • Put your memory card back to phone.
      • In your phone , Tools->Utilities there will be an application Memory. Select that and choose Restore From Card from Options menu. Which will copy back data's to your phone memory.
      • Open PC Suite application in your computer and select Sync, which also synchronize your data's.
Now your phone should be ready to use.

Wednesday, December 12, 2007

Internet Call : Save your Money

Imagine you have to call you gal friend in US from India and want to talk about some nasty things for one hour. Are you afraid of cost ? . Oops , It costs nothing. Not a magic !

Just pay for a coffee in Star bucks who provide free WLAN and take your N95 dial an internet call . If you do not know about this powerful feature you are simply wasting your money by making CS Call .

Setup a wireless lan connection for your phone . This is important. You have to configure this access point.

And these are all the small steps you have to do :

Take your N95
1. Open Menu -> Download
2. Select Gizmo and download. ( This will take few steps to install this application )
3. Goto Gizmo website from your phone web and register in Gizmo for sip account.

Ask your friend to do the same & get his sip id . And store it in your contact.
Goto phone book and your friends contact . there should be an options called "Internet call"
Press that one .

Now it should be ringing in your friends phone .
Talk as long as and it will not cost anything for you .