.NET Framework 4.0 Architecture

by Prashant 24. September 2009 00:51

Download PDF: Microsoft .NET Framework 4.0 Architecture.pdf (259.20 kb)

Share or Bookmark this post…
  • Live
  • Facebook
  • TwitThis
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • StumbleUpon
  • Google
  • E-Mail

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , ,

.NET Framework | Microsoft

GOOGLE Office - New York City

by Prashant 23. September 2009 10:29

 

Share or Bookmark this post…
  • Live
  • Facebook
  • TwitThis
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • StumbleUpon
  • Google
  • E-Mail

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags:

Fundoo

Using Hashtables

by Prashant 21. September 2009 06:40

Here I illustrate how to create and use hash table. Each element of hash table is a combination of Key/Value pair stored in a DictionaryEntry object. A value in a hash table can be null or contains no value but a key cannot be of null reference. Key in hash table work as an identifier for the value where you can search a hash table for a value with a specified key.

First you will need to import the namespace System.Collection. We use System.Collection namespace because it contains various interface and classes the defines various collection of objects like list, dictionary, queues, hash tables and bit arrays.

1. Adding Key/Values to Hash Table

using System;
using System.Collections;
class HashtableClass
{
 public static void Main()
 {
   Hashtable htbl = new Hashtable();
   htbl.Add("AL", "Alabama");
   htbl.Add("CA", "California");
   htbl.Add("FL", "Florida");
   htbl.Add("NY", "New York");
   htbl.Add("WY", "Wyoming");
   // Get a collection of the keys.
   ICollection coll = htbl.Keys;
   foreach (string str in coll)
   {
     Console.WriteLine(str + ": " + htbl[str]);
   }
 }
}

2. Clear all Key/Value pairs in a hash table

To clear all the key/value pairs in a hash table use Clear() method of a hash table class:

htbl.Clear();

3. Remove Key/Value pairs from hash table

Just if you want to remove a particular value from a hash table use the Remove() method of hash table class and specify the Key to remove the key/value:

htbl.Remove("NY");

4. Adding Key/value pair to hash table by using indexer

We can use Add() method of the hash table class to add key/value pair to the hash table, but instead we can use indexer to add key/pair:

htbl["NY"] = "New York";

5. Use the ContainsKey() method to check if hash table contains a key

Just a simple method to use with an IF condition:

if(htbl.ContainsKey("NY"))
{
       Console.WriteLine("Hashtable contains key NY");
}

6. Use the ContainsValue() method to check if hash table contains a key

Just a simple method to use with an IF condition:

if(htbl.ContainsValue("New York"))
{
Console.WriteLine("Hashtable contains value New York");
}

7. Copy the keys from hash table into an array using the CopyTo() method

string[] keys=new string[5];
htbl.Keys.CopyTo(keys,0);
Share or Bookmark this post…
  • Live
  • Facebook
  • TwitThis
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • StumbleUpon
  • Google
  • E-Mail

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

C#

Laws of Computer Programming

by Prashant 13. September 2009 11:42

1.    Any given program, once deployed, is already obsolete.

2.    It is easier to change the specification to fit the program than vice versa.

3.    If a program is useful, it will have to be changed.

4.    If a program is useless, it will have to be documented.

5.    Only ten percent of the code in any given program will ever execute.

6.    Software expands to consume all available resources.

7.    Any non-trivial program contains at least one error.

8.    The probability of a flawless demo is inversely proportional to the number of people watching, raised to the power of the amount of money involved.

9.    Not until a program has been in production for at least six months will its most harmful error be discovered.

10. Undetectable errors are infinite in variety, in contrast to detectable errors, which by definition are limited.

11. The effort required to correct an error increases exponentially with time.

12. Program complexity grows until it exceeds the capabilities of the programmer who must maintain it.

13. Any code of your own that you haven’t looked at in months might as well have been written by someone else.

14. Inside every small program is a large program struggling to get out.

15. The sooner you start coding a program, the longer it will take.

16. A carelessly planned project takes three times longer to complete than expected; a carefully planned project takes only twice as long.

17. Adding programmers to a late project makes it later.

18. A program is never less than 90% complete, and never more than 95% complete.

19. If you automate a mess, you get an automated mess.

20. Build a program that even a fool can use, and only a fool will want to use it.

21. Users truly don’t know what they want in a program until they use it.

Share or Bookmark this post…
  • Live
  • Facebook
  • TwitThis
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • StumbleUpon
  • Google
  • E-Mail

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

Fundoo

Powered by BlogEngine.NET 1.5.0.7
Visit blogadda.com to discover Indian blogs

About

Name of authorPrashant Khandelwal

Programmer and Tech Enthusiast



       

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2010

Creative Commons License