Thursday, April 30, 2009

Tips & insights for programmers

Here is the list of tips & insights compiled from StackOverFlow.

1. Never be afraid to say I don't know.Manage expectations, learn to say "no".But always give it a try before you say that.
2. Never stop learning.Accept your mistakes and take that just as a new learning opportunity
3. Ask for help sooner rather than later,know that you can't do everything by yourself.Don't take all the responsibility for a problem. Sometimes you can be furiously trying to solve a problem alone and carrying the problem on your back. Get other people involved, escalate, get other folks involved.
4. Learn to take backup
5. Assumption is the mother of all screw-ups. So never assume something which you are not sure of.
6. Estimates are always off by at least 50% either way.
7. First make it work, then make it better.
8. Always negotiate deadlines/deliverables.
9. Don't hesitate to do overtime IF the situation requires it
10.Underpromise and over deliver
11.Find the balance between being realistic and being positive.
12.Be confident in your skills
13.Listern patiently to others opinion. Especially when you talk to a client.
14.Share your skills - Help others and the community with the knowledge you've got.
15.Make sure you get proper recognition and appraisal for your good work.
16.Manage your time effectively
17.Don't give people what they ask for, give them what they need.
18.No matter where you are on the pecking order of a team or project, you CAN make a difference.
19.It's more important to manage people's perception of the problem than it is to fix it.
20.Never trust the data. Validate your inputs.
21."It works on my machine" doesn't cut it. It HAS to work for them, too.
22.Show your code to other people - and listen to their comments.& Look at other peoples code and talk to them about it.
23.If you can't figure out a problem then take a break and come back to it in 10 or 20 minutes - makes finding a solution so much easier.
24.Realize that specifications are going to change.
25.Never implement new features unless you have a written request ( mail is just fine )
26.Be prepared to reinvent yourself every five years.
27.Before you roll anything out TEST TEST TEST
28.Use Source Control
29.Communicate, communicate, communicate
30.You can never have enough clarification and detail with project requirements


Web Transition Chart



Read about it at ReadWriteWeb

Microsoft’s Vine = Facebook + Twitter

Today I came across a post  by Brier Dudley, about latest social networking site called Vine  by Microsoft. Still its under beta & if you want to be part of it, then sign up.

As per the post, Microsoft planning to provide Vine to Emergency Management Officials, which helps them to broadcast & receive information during a disaster or other major event.

See some of the screen shots of the site below.


Tuesday, April 28, 2009

Validating HTML Text Area for HTML tags using Javascript RegEx

The below code might help you with validation of certain HTML tags entered in a TextArea. (Click image to enlarge).



Tuesday, April 21, 2009

Many-Core Shift & the Next Era of Computing


I have been observing the developments in Processor Technologies, and now I am really excited with the Future of Computing with the shift from single core to many core processor technologies.


As you all know, Moore’s Law tells us that, the number of transistors on an integrated circuits (IC) doubles every two years. Now the so-called “many core shift” is happening. It’s not a thing of the future, it is here already and it will change our developers’ life as we know it today.

What’s the many core shift?

This evolution of doubling the number of transistors on an IC has reached its physical limits (clock speed, power consumption, etc.). Instead of building faster and more complex CPUs, the manufacturers started placing more CPUs, read cores, on a chip.

It all started 2006 with Intel’s dual cores, today you won’t find a single core desktop machine anymore.

High end consumer machines come with quad cores, and servers with 16 cores (packed as 4 quad cores). Starting 2006 with 2 cores, five to six years from now we will have between 32 and 128 cores machines.

What does it mean?

Well, it probably means that today’s software runs a bit faster. Not much, certainly not the 32 times faster a 64 core machine is supposed to be compared to dual core. Have a look at the following task manager of a 16 core machine:

Now look at your own desktop and count the open applications. Outlook, Word, PowerPoint, Internet Explorer, Acrobat Reader, Firefox, Visual Studio etc. All the applications utilize 1 to two cores and Most of today’s applications simply are not capable of utilizing these cores appropriately. Consequence: In order to utilize these cores we have to change the way we write our software!

You may ask, do we actually need that kind of processing power? And if so, how do we use it?

For the first question the answer is yes, it is needed for Games, Video Conversion, File Compression, Graphics etc.

And for second question we need to know that there is a concept called Multithreading.

And “Most developers have avoided multithreading altogether. And those who did do work on multithreading probably did it just for optimizations.” So, now is the time we need to have multithreading in the mainstream of application development.

And with that in mind Microsoft is developing Visual Studio 2010. And I believe it will open up new possibilities.

I am really excited to work on Visual Studio 2010 and want to utilize the multi-core.

Let me know what you think about all this.

Reference:

  1. http://www.intel.com/products/processor/index.htm
  2. http://www.digital-daily.com/cpu/new_core_conroe/index1.htm
  3. http://www.intel.com/products/desktop/processors/index.htm?iid=processors_body+dt_core

Monday, April 13, 2009

Want to know how to pronounce certain words?

I came across this wonderful site called Forvo where you can find the pronunciation of certain words and also you can add a word (your native language) and pronounce it.

Thursday, April 09, 2009

Using Winnovative HTML to PDF Converter in C# to generate PDF File

Steps:
1. Add wnvhtmlconvert.dll to Project Reference under Visual Studio

2. Import it into your code behind file "using Winnovative.WnvHtmlConvert;"

3. Add your PdfConverterKey into Web.Config

<add key="PdfConverterKey" value="your key here"/>

4. Write Below Code (Click to Expand)


And you are done.
Let me know if you have any questions

Sunday, April 05, 2009

India Advises the World at G20

Actually I dont have access to the TV (Idiot Box) so, lately i came across this Video on You Tube.
I thought to post it here and write something about it.

During G20 Summit Indian Prime Minister Dr. Manmohan Singh, advised the G20 Nations with 4 ways to tackle the Economic downturn. 

1. IMF & Asian Development Banks resources needs to be enhanced immediatly.
2. Industrialized Countries need to take toxic assets out of Financial System.
    [Toxic Assets an Example (from Yahoo Answers) : Let's say that Raj had a loan with ICICI Bank. The Loan is for Rs 200,000 for a house and Raj pays 6% interest. The house is collateral, meaning ICICI gets the house if Raj defaults. But this house was valued at Rs 275,000, so what is the worry?

So now ICICI Bank has "mortgage paper", which is an asset. They can sell the mortgage to anyone they wish. Raj will then be required to pay the purchaser, who will get the benefit of the 6% interest. It's an investment which may (or may not) make more money in the future. A good idea if ICICI needs money immediately.

But old Raj doesn't have the money to pay this mortgage. At the same time, the house value has greatly reduced to Rs 150,000. Raj still owes Rs 199,000.

If Raj defaults on this, ICICI Bank will only be able to recover a portion of their money back. The mortgage paper has now become illiquid (the house can't pay the mortgage). ICICI Bank is now unable to sell it. Why would somebody pay for an asset that guarantees you will lose money?

That mortgage has become a "toxic asset".]

3. Access of Funds needs to be restored to emerging economies like India.
4. Need to commit ourselves to keep protectionism away.



Pakistan diverts attention from Mumbai Attack Investigations

I doubt on whatever things are happening in Pakistan.People may be getting this question,recent Activities in Pakistan a way to divert attention from Mumbai Attack Investigations? 

It looks to me that, they are just diverting the attention of the world from Mumbai Attacks. First they delayed it saying they want proof and once proof submitted they told they are not considerable for further investigations & they sent 30 questions to India & when India answered, then they played the political games in pakistan, and later settled the matter without Pak military taking over the Govt. Then attack on Sri Lankan Cricketers to show that Pakistan is also a target of Terrorism. And if you look at the recent developments, suddenly the attacks in pakistan have increased. All this things make me conclude that they just want people to forget the Mumbai Attacks.

And here in India, we have Parlimentaty Elections and till the next govt forms there will not be any actions from India. And almost, most of the people have forgotten the Mumbai Attack.

Only God can save the our Country.

Saturday, March 28, 2009

Strenght & Weakness

Recently i was thinking about my strengths and weaknesses, what i realized was, my weaknesses are mirrored reflections of my strengths.

Now i am trying to find out whether it is same with every body else or not.

Let me know about yours.

Wednesday, March 25, 2009

How to: Check login name availability in ASP.NET MVC using jQuery Validation plug-in



I need to write comments for the below code, bcoz of lack of time i am posting only abstract things,if you want to know something, write comment, i will reply.


HTML login control

< input type="text" name="txtUserName" id="txtUserName" class="textBoxes" />


jQuery Rule: Add the below rule into script tag in header & add reference to jquery-1.2.6.js,jquery.validate.js in Head Element

 
$(document).ready(function() {

         $("#frmSelfRegister").validate({
             rules: {
   txtUserName:
                     {
                         required: true,
                         remote: { type: "post", 
                                   url: "Register/IsLoginAvailable" }
                    },
    messages:{

txtUserName: { required: "User Name is Required.",
                                remote: jQuery.format("{0} is not available.")}
     }
   });
     });


The above validation code executed when the focus changes from txtUserName to some other, it will call IsLoginAvailable method available in the RegisterController, as specified in the url.




Controller Code :

Below code is the one which checks for availability of a username & returns the status to above jQuery Method. The following methods return type is JsonResult because remote method of jQuery accepts the JsonResult object only.

        
[AcceptVerbs(HttpVerbs.Post)]
        public JsonResult IsLoginAvailable(FormCollection collection)
            {
                JsonResult result = new JsonResult();

                try
                {
                       ilogIn.Text = this.GetLoginByUsername(collection.Get("txtUserName").ToString().Trim());
                       
                }
                catch (Exception ex)
                {
                    Helper.ErrLogger(ex.Message);
                }

                if (ilogIn.Text == collection.Get("txtUserName").ToString())
                {
                    result.Data = false;
                }
                else
                {
                    result.Data = true;
                    
                }
                return result;
            }

Interface Inheritance Naming Conflicts



Suppose you have two interfaces, lets say Interface-IA, Interface-IB & in both you have declared Name as a property as follows.

public interface IA
{

string Name { get; set; }
String Adress { get; set; }

}

public interface IB
{

string Name { get; set; }

}

Now, you write an interface -IC which derives from above 2 Interfaces as below,


public interface IC : IA, IB
{

int Id { get; set; }

}


When you are try to do the following, you will get an error saying 'Ambiguity between IA.Name and IB.Name'. 

class Test
{

    public void GetSomething()
     {
       IC objIc = new IC();
       Textbox1.Text =  objIc.Name();
     }

}

It can be solved by upcasting as below.

class Test
{

  public void GetSomething()
  {
      IC objIc = new IC();
      Textbox1.Text =  ((IA)objIc).Name();
  }

}

Monday, March 23, 2009

23 March 1931

Today would mark 78 years of the sacrifice three young men gave for the nation. Bhagat Singh- Raj Guru- Sukh Dev.

So today no one in news would talk about Bhagat Singh, Sukh Dev and Raj Guru the three young men who were hanged on this day near Ferozpur near the present India-Pakistan border. These men never cared about religion and fought for the freedom of the nation.

bhagat-singh-sukh-dev-raj-guru-20050323-091841

Indians seem to have forgotten the sacrifice and keep remembering Gandhi. It is definitely an unfortunate thing that people who were not in congress and worked for India's freedom never got the credit they deserve.Bhagat Singh, Sukhdev and Rajguru shall remain in my heart till I die. These are the people whom the young generation should have as idols. Their sacrifice, their patriotism & their principles, we should never forget them.


Fix Google Chrome (Crash) Error, The application failed to initialize properly (0xc00005)

I have Windows Machine with Symantec Anti Virus software,whenever I used to open Google Chrome,I used to get, "The application failed to initialize properly (0xc00005)" error.

After some exploration i found the way to bypass this error.

Here are the steps to follow to get rid of the error.

1. Close Chrome
2. Right click on the Chrome Shortcut and add "--no-sandbox" or "--in-process-plugins" switch as shown in the image below.

"--no-sandbox" switch instructs Chrome not to use Sanbox Security, Sanbox security mode prevents malware from getting installed into computer.

"--in-process-plugins" switch instructs Chrome to run the plug-ins inside the browser process itself. By default Chrome runs plug-ins in seperate process to avoid browser crashing when a plug-in crashes.

Hope it helps.

Saturday, March 21, 2009

Hunt for Indian Secret Societies

I am involved in finding the Indian Secret Societies. Recently I had a chat with one of my friend who is also invovled.Here is the chat transcript.

7:17 PM Rahul: Hello one questen
7:18 PM me: hi
  yeah tell me
7:19 PM Rahul: Like Priory of Sion is more famous for its members like Issac Newton have u ever heard ne prominent person of India of this team?/
7:21 PM me: u mean in the group of priory of sion?
 Rahul: yes
7:22 PM me: no
  i don't think any body has associated with it
7:23 PM Rahul: but it must be.....I mean more brillaint people are very obvius to be attracted to their philosophy
7:24 PM me: yeah, but religion was the main criteria, so people didn't associated with it
7:25 PM if u see the history of Priory, it started around 11th century
7:26 PM Rahul: it is more ancient than that isnt it??
 me: and that time, foreign invasion was happening in India
7:27 PM it might be ancient but existed in some other name
  so during crusades they might have changed the name
7:28 PM Rahul: may be the Manuscripts of their details have gone to the distant far off land like that of Illumiati and will resurface in some time
 me: u can recall that, Knights templar also came on the scene at that time
  
7:29 PM Rahul: that righ for their lives they went underground??
 me: yeah
  they operated under different names just to avoid the church
7:30 PM Rahul: u think National Library might help??
 me: u can say, they were diverting the attention
  our National Library?
  Raja Ram Mohan Roy library?
7:31 PM Rahul: In Kol
  here I've herd they contain manuscripts
  but one problem
 me: yeah
 Rahul: i dnt know where to look into
7:32 PM I mean there must be a key
  where the search should be starting from
7:33 PM me: hmm, one minute
7:34 PM sorry i was on call
  i believe old temples of India and their manuscripts might help
7:35 PM but we can't directly check those things bcoz of religious restrictions
 Rahul: how the hell Dan Brown gets all his info then??
 me: and also, there may be some traps, we dont know how to avoid those things
7:36 PM that info was available from other writers
  he just put it in a nice novel
 Rahul: but here s no clue
  they r just tremendous brillaint
  bt some thing tells me the path is alive
7:37 PM me: here the chances of finding clues is almost impossible, if u recall that, there was no book on veda & all things, all those things passed from Teacher to student verbally
7:38 PM so you can't expect the clues, as in Davinci Code
  or National Treasure
 Rahul: yeah thats why decrepency crreped in on regarding the description of Krishna ...........or Mahabharata
 me: s
7:39 PM but, the clues are there but they are distributed
7:40 PM Rahul: ok I think I need to think but something tells me I am not far from the key...................I will take some days now if I get hand on nething I ll make a contact ok?
 me: yeah
  sure i will be glad
 Rahul: Bye 4 now tk kr dude
 me: to get invlved
  sure, take care