Sunday, December 12, 2010

Path to six packs.

There are tons of articles & each article has something unique on six packs.
This has become buzz word in recent times where more fitness, health consciousness of how to maintain healthy body & mind.

Let us run through the easiest ways to reach six packs.

1. Burn fat. Without cardio there is nothing.
2. Stay away from sugar sweets,cakes, chocolates, sodium packaged foods.
3. Go for protein based food - Whey powder( has 22g of protein), soy beans( 20g), almonds(12g), peanuts(10g). (Numbers on a rough). Drink plenty of water.
4. Add natural carbohydrates via fruits - on daily basis(apples, oranges, grapes,bananas) plus vegetables - carrots, broccoli, spinach. Also, going for wheat whole grain 100% fiber bread will help to supply good fiber to the body.

5. Get your heart rate up to your some optimum level where you can breathe & balance via some cardio (treadmill/cycling/any one). 30- 60 mins per day will do wonders.
6. If you are meat eater (am not, so no idea), pls. check for appropriate meat (could be chicken,fish). Remember meat contain lot of fat, so choose carefully.
7. Make a habit to have fat-free milk & fat-free cottage cheese, which has good amount of protein, which can be the food for your muscles.
8. Head for resistance exercises - plan for upper body exercises(weight lifting, shoulders) one day, lower body the next day(weight pull via legs, squat exercise).
9. Go for crunches, static holdup(elbow on the ground, lie on a line, lift your body).

Never do these exercises if you don't have some carbohydrates(brown rice will be good,bananas) before 1-2 hrs, you need good energy to do workouts. More importantly, if you don't have at least 7(accepted)- 8 (good) hrs of sleep, don't attempt trying more heavy workouts, its not good for your blood pressure levels.

Happy six packing :)

Tuesday, December 7, 2010

Thanksgiving is about giving love & happiness.

Thanksgiving is not about eating turkeys, mashed potatoes, heading to black friday, buying some electronic/softwares on cyber monday.

Thanksgiving is all about love & happiness, the current trend is becoming like all the family members meet only once (on thanksgiving) or twice per year.(on Christmas). Due to the way the lifestyle is changing & in olden days people were leaving within the same city, were able to meet multiple times, but not like those, these times.

The first American thanksgiving was celebrated in 1621, to honor the memory of with a ceremony for the harvest reaped by the plymouth colony after a harsh winter.

I always used to hear from my friend that thanksgiving is more about sharing love & happiness with family & friends. Next time when you celebrate don't forget to invite one/many of your friend/family members who is living away from his/her family, that way you are adding real value to thanksgiving & sharing your love & happiness, we never want to be alone in thanksgiving day.

Sunday, July 11, 2010

Giving up is an excuse and finding an excuse is a crime.

How many times have you seen India losing a match in cricket as soon as sachin gets out? even if you have 5 wickets indian team could not hit the required 16-20 odd runs with more balls remaining, How many times have you failed in your interviews, how many times, you made wrong decisions? It happens, mistakes bound occur, but, when we need to wake up ourselves? all because of giving up things easily.

We want to achieve more, but not ready to take extra effort, when everyone watching matches, everyone sitting in cinema theaters, everyone sitting in living room watching movie with popcorn and coke in hand, there are persons who don't waste their time, each sec is important for them, remember Bill Gates if you need to speak with him, you need to get appointment before many months, can you ever image going near Lakshmi Mittal? These persons come under the II category, work hard for betterment for their life, society and for the country. Are you ready to steady your life without giving up irrespective of hurdles that come across you?

Wow, the fitness of Rahul Dravid, Sachin amuses me a lot, above 35 dravid plays cricket, hockey. Running between the wickets and fielding of sachin is marvelous. These guys never give up, have ever your noticed rahul dravid throwing his wicket, a bowler should work hard to get his wicket. Man, he fights till his last sweat.

Many strive to achieve more, but when the opportunity comes, they don't respond,instead they try to hide, its very hard to get a chance, good opportunities will come for everyone provided you hit the right path, but we should be responsible for our actions, if you don't deliver, you will be delivered out. Why is aamir khan's movie has lot of vibrance and substance than any other hindi movies these days, that is due to his involvement, interest and never giving up attitude, for you information, aamir khan came much before shahrukh, while aamir has acted less than 40 films, shahrukh has done more than 75(am not comparing both here), the fact is shahrukh is equally committed person like aamir, both have their ideas, the fact is shahrukh and aamir both have struggled a lot before they make it big. If you want to learn how to come up in life without any god father learn from shahrukh, if you want to take a leaf on never giving up attitude look onto these folks. Surviving in the hindi industry for these long period is not an easy task, they both have done remarkable work.

There was a time when young legs were needed to replace seniors. That was when Gautam Gambhir was selected in place of Ganguly. Ganguly is a legend, he is an example for inspiration, aspiration and determination, if you are replacing him, you need a person of strong mental fitness and high quality timing shots, Gautam Gambhir proved he is the next wall, his timing, matching winning knock of 75 runs in 2007 final, remember MS Dhoni is a great captain( due to players like Gambhir, Raina,Sehwag etc), Ganguly is the finest test captain(due to Dravid - 227,181, 270,etc.Laxman - 281, 100*etc), all these because of their never giving up attitudes.

If you can focus and work on your plan, you can achieve millions, inspire others, so we should stop finding an excuse and cultivate the habit of never ever giving up.

Tuesday, April 27, 2010

Ban elephants in festivals

Cruelty dealt in neat manner, will the government bring the ban rule to use elephant in festivals. Elephants are world's unique creature need to be in forest, but due to money from it - Ivory cost, circus people hunt and torture it.

Also elephants are very emotional creature, it loves his mahout (driver and care taker of elephant) so much. Many times mahout fail to feed at the musk period and elephant gets angry and kills drastically the mahout, the time duration of the madness of elephant could range from minutes to hours. After it comes to normal, it will feel for its behavior and starts crying heavily for killing his mahout. There is a special bonding between the elephant and mahout, like mother and kid, many elephants in asian countries (Thailand, India, Sri lanka etc) elephants don't have any role models, they hunted while they were kid and based on the instructions from mahout it behaves, acts and responds.

Elephant love is amazing, it remembers so much, the bad thing is its treated for begging, in circus they are abused, making to walk in the hot sun for hrs, please they need shelter and peace, they are not supposed to be in the city, let us join hands in eradicating the cruelty,nasty thing happening to the unique lovable, adorable creature.

Thursday, March 4, 2010

.NET FAQs -2

1. What is arraylist?

An ArrayList is an array that can dynamically grow and shrink.The ArrayList is one of the important classes in the System.Collection namespace. ArrayList is a dynamical array; it will increase the size of the storage location as required. It stores the value as object.

ArrayList oArrayList = new ArrayList();

2. WCF Questions

3. WPF Questions

4. Difference between Overriding and Overloading.

Overriding - same method names with same arguments and same return types associated in a class and its subclass.

Overloading - same method name with different arguments, may or may not be same return type written in the same class itself.

Example for overriding
Clas A
Virtual void hi(int a)

Class B:A
public overrid void hi(int a)


Example for Over loading

Class A
class a()


class a(int a)

5. What is Virtual in C#?

The virtual keyword is used to modify a method, property, indexer or event declaration, and allow it to be overridden in a derived class. For example, this method can be overridden by any class that inherits it:

public virtual double Area()
return x * y;

using System;
class TestClass
public class Dimensions
public const double PI = Math.PI;
protected double x, y;
public Dimensions()
public Dimensions(double x, double y)
this.x = x;
this.y = y;

public virtual double Area()
return x * y;

public class Circle : Dimensions
public Circle(double r) : base(r, 0)

public override double Area()
return PI * x * x;

class Sphere : Dimensions
public Sphere(double r) : base(r, 0)

public override double Area()
return 4 * PI * x * x;

class Cylinder : Dimensions
public Cylinder(double r, double h) : base(r, h)

public override double Area()
return 2 * PI * x * x + 2 * PI * x * y;

static void Main()
double r = 3.0, h = 5.0;
Dimensions c = new Circle(r);
Dimensions s = new Sphere(r);
Dimensions l = new Cylinder(r, h);
// Display results:
Console.WriteLine("Area of Circle = {0:F2}", c.Area());
Console.WriteLine("Area of Sphere = {0:F2}", s.Area());
Console.WriteLine("Area of Cylinder = {0:F2}", l.Area());

6. Static class in C#

A class can be declared static, indicating that it contains only static members. It is not possible to create instances of a static class using the new keyword. Static classes are loaded automatically by the .NET Framework common language runtime (CLR) when the program or namespace containing the class is loaded.

Use a static class to contain methods that are not associated with a particular object.

Suppose you have a class CompanyInfo that contains the following methods to get information about the company name and address.

class CompanyInfo
public string GetCompanyName() { return "CompanyName"; }
public string GetCompanyAddress() { return "CompanyAddress"; }

These methods do not need to be attached to a specific instance of the class. Therefore, instead of creating unnecessary instances of this class, you can declare it as a static class, like this:

static class CompanyInfo
public static string GetCompanyName() { return "CompanyName"; }
public static string GetCompanyAddress() { return "CompanyAddress"; }

7. Polymorphism in C#

When a message can be processed in different ways is called polymorphism. Polymorphism means many forms.

There are 2 types of Polymorphism namely
1.Compile time polymorphism (or) Overloading
2.Runtime polymorphism (or) Overriding

Compile Time Polymorphism :

Compile time polymorphism is method and operators overloading. It is also called early binding. Method with same name but with different arguments is called method overloading. In method overloading, method performs the different task at the different input parameters.

public class A1
public void hello()
{ Console.WriteLine(“Hello”); }

public void hello(string s)
{ Console.WriteLine(“Hello {0}”,s); }

Runtime Time Polymorphism :

Runtime time polymorphism is done using inheritance and virtual functions. Method overriding is called runtime polymorphism. It is also called late binding.Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.

When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same prototype. Method overloading has nothing to do with inheritance or virtual methods.

public Class parent
virtual void hello()
{ Console.WriteLine(“Hello from Parent”); }

public Class child : parent
override void hello()
{ Console.WriteLine(“Hello from Child”); }

public static void main()
parent objParent = new child();

8. Generics in .NET

Generics allow you to realize type safety at compile time. They allow you to create a data structure without committing to a specific data type. When the data structure is used, however, the compiler makes sure that the types used with it are consistent for type safety. Generics provide type safety, but without any loss of performance or code bloat. While they are similar to templates in C++ in this regard, they are very different in their implementation.

The System.Collections.Generics namespace contains the generics collections in .NET 2.0. Various collections/container classes have been "parameterized." To use them, simply specify the type for the parameterized type and off you go. See Example 2:

Example 2. Type-safe generic List

List aList = new List();
// aList.Add(5.0);
int total = 0;
foreach(int val in aList)
total = total + val;
Console.WriteLine("Total is {0}", total);

For more information on generics.

More FAQs later.

Monday, December 7, 2009

MOSS - Microsoft Office SharePoint Server 2007 - I

According to wikipedia "Sharepoint is a browser-based collaboration and document management platform from Microsoft."

The word sharepoint refers to both Windows Sharepoint Services 3.0 (WSS) and Microsoft Office Sharepoint Server 2007 (MOSS).

Windows SharePoint Services 3.0 (WSS)

1. Used for storage and web presentation.
2. Authorization/user management.
3. Interface to WWF (Windows Workflow Foundation).
4. APIs (Application Programming Interfaces) & web services that can be extended by developers.
5. Collaboration tools and functionality.

For more info on WSS

Microsoft Office Shareoint Server 2007 (MOSS)

MOSS comes in 2 versions - MOSS 2007 Standard and MOSS 2007 Enterprise.

MOSS 2007 Standard (provides all functionality available in WSS with the below mentioned features)

* Portal templates for building your internet/intranet site.
* User profiles, social networking and my sites.
* Web parts for aggregating information.
* Enterprise search.
* Web content Management (WCM).
* Additional built-in workflow templates.

MOSS 2007 Enterprise (provides all the functionality available in standard version, with additional features)

* BDC - Business Data Catalog
* Forms Server
* Excel Services
* Additional Web Parts

Saturday, August 1, 2009

.NET FAQs - 1

1. What is Lamda Expression?

A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types. All lambda expressions use the lambda operator =>, which is read as "goes to". The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. The lambda expression x => x * x is read "x goes to x times x." This expression can be assigned to a delegate type as follows:

delegate int del(int i);
del myDelegate = x => x * x;
int j = myDelegate(5); //j = 25

To create an expression tree type:

using System.Linq.Expressions;

Example :

The => operator has the same precedence as assignment (=) and is right-
associative. Lambdas are used in method-based LINQ queries as arguments to standard query operator methods such as Where``1(IEnumerable(UMP), Func(UMP, Boolean)).

The general rules for lambdas are as follows:

The lambda must contain the same number of parameters as the delegate type. Each input parameter in the lambda must be implicitly convertible to its corresponding delegate parameter.

The return value of the lambda (if any) must be implicitly convertible to the delegate's return type.

2. Difference between clustered and non-clustered index

The difference is that, Clustered index is unique for any given table and we can have only one clustered index on a table. The leaf level of a clustered index is the actual data and the data is resorted in case of clustered index. Whereas in case of non-clustered index the leaf level is actually a pointer to the data in rows so we can have as many non-clustered indexes as we can on the db.

3. What is Microsoft UIP?

The User Interface Process Application Block provides a simple yet extensible
framework for developing user interface processes. It is designed to abstract
the control flow and state management out of the user interface layer into a user interface process layer. This helps you write generic code for the control flow and state management for different applications types (for example, Web and Windows) and helps manage user's tasks in complex scenarios (for example, suspending and resuming tasks).

The UIP Application Block is based on the model-view-controller (MVC) pattern. Each of the MVC objects is represented in the UIP Application Block in the following ways:

Model — Implemented in the State class. This stores both user information and control information within the user interface process.
View — Implemented in the WebFormView, WindowsFormView, and
WindowsFormControlView classes.

These are used to create views in your application.

Controller — Implemented in classes that derive from the ControllerBase abstract class. These classes are responsible for the starting of, navigation within, and ending of a user interface process.

4. Difference between WCF and Webservice.

WCF is much more flexible:

can be used over HTTP (like legacy ASMX) but also: can be used over NetTCP, MSMQ, wsHttp and so on WCF services can be hosted in IIS (like legacy ASMX)
but WCF services can also be self-hosted in a console app, Windows NT Service,

WCF offers a lot more security features and security levels than ASMX (message
security etc.). WCF offers things like reliable messaging, transaction support etc. In WCF, almost anything is configurable in a config file - much more so than with ASMX

5. Why do we need 3-Tier architecture?

i. Reusability of the business logic component results in quick development.Let's say we have a module that handles adding, updating, deleting and finding customers in the system. As this component is developed and tested, we can use it in any other project that might involve maintaining customers.

ii.Transformation of the system is easy. Since the business logic is separate from the data access layer, changing the data access layer won t affect the business logic module much. Let's say if we are moving from SQL Server data storage to Oracle there shouldn t be any changes required in the business layer component and in the GUI component.

iii.Change management of the system is easy. Let's say if there is a minor change in the business logic, we don t have to install the entire system in individual user s PCs. E.g. if GST (TAX) is changed from 10% to 15% we only need to update the business logic component without affecting the users and without any downtime.

iv. Having separate functionality servers allows for parallel development of
individual tiers by application specialists. Provides more flexible resource allocation. Can reduce the network traffic by having the functionality servers strip data to the precise structure needed before sending it to the clients.

6. New features of .NET 3.5 Framework

1. .NET Compact Framework

Windows Communication Foundation (WCF) technology
Language-Integrated Query (LINQ)
Improvements made to Windows Forms controls
SoundPlayer to play multiple sounds.
Supports Compression through the System.IO.Compression namespace
Supports the CreateDelegate method
Supports the CLR Profiler
Supports the Configuration Tool (which provides runtime version information and
administrative functions)
Debugging enhancements
Improvements have been made to logging features
Information about the platform type

The runtime tools library with diagnostic tools, such as Remote Performance
Monitor, with the emulator. Strong names that are greater than 1,024 bytes are now supported The global assembly provides improved error handling and integration with
Windows Embedded CE version 6.0.

The class library documentation improved


ListView Class

ListView Class displays the values of a data source by using user-defined templates. The ListView control enables users to select, sort, delete, edit, and insert records. The ListView control is quiet flexible and contains features of the Gridview, Datagrid, Repeater and similar list controls available in ASP.NET 2.0.


Provides paging functionality for data-bound controls that implement the IPageableItemContainer interface, such as the ListView control.he best advantage is that you need not have to keep it ‘tied’ with the control on which the paging is being done. You can keep it anywhere on the page.DataPager gives you a consistent way of paging with the controls that support it.

3. Add-Ins and Extensibility
4. Common Language Runtime
5. Cryptography
6. Networking
7. Windows Communication Foundation
8. Windows Presentation Foundation
9. Windows Workflow Foundation
10. Windows Forms
11. LINQ
12. Expression Trees
13. Programming Languages

Please refer for detailed explanation.

7.LINQ to SQL Implementation

LINQ to SQL is an O/RM (object relational mapping) implementation which allows you to model a relational database using .NET classes. You can then query the database using LINQ, as well as update/insert/delete data from it.

LINQ to SQL allows .NET developers to write “queries” in their .NET language of choice to retrieve and manipulate data from a SQL Server database. In a general sense, LINQ to SQL allows us to create SQL queries in our preferred .NET language syntax and work with a strongly types collection of objects as a return result. We can make changes to these objects then save changes back to the database.

EX: (HookedOnLINQ - DB name, Contact- table name)
HookedOnLINQ db =
new HookedOnLINQ("Data Source=(local);Initial Catalog=HookedOnLINQ");

var q = from c in db.Contact
where c.DateOfBirth.AddYears(35) > DateTime.Now
orderby c.DateOfBirth descending
select c;

foreach(var c in q)
Console.WriteLine("{0} {1} b.{2}",

Mack Kamph b.17-Sep-1977
Armando Valdes b.09-Dec-1973

8.New features of .NET 2.0 Framework

Various aspects such as Support for 64 bit platform application development, Access control list support (ACL), ADO.NET, ASP.NET, Authenticated streams,COM Interop Service Enhancements, Console Class Additions, Data Protection API, Detecting changes in Network connectivity, Disjunctive Demands, Distributed Computing, EventLog Enhancements, Expanded Certificate Management, FTP Support, Generics and Generic Collection, I/O Enhancements and several other features.

For detailed description:

9. Features of SQL Server Integration Services(SSIS):

1. Enterprise-Ready Platform

SQL Server Integration Services (SSIS) provides out-of-the-box enterprise-class scalability options with its advanced data-integration pipeline architecture,
high-performance processing, and native support for 64-bit platforms.

2. Developer Productivity

SQL Server Integration Services, Analysis Services, and Reporting Services all use a common Microsoft Visual Studio–based development environment, the SQL Server Business Intelligence Development Studio, for streamlined productivity.

3. Extensible and Customizable

SSIS goes beyond simple extraction, transformation, and loading (ETL) tools by enabling nontraditional scenarios and leveraging the power of the Microsoft .NET platform and SQL Server

SQL Server Integration Services (SSIS) is a component of Microsoft SQL Server 2005 and 2008. It replaces Data Transformation Services, which has been a feature of SQL Server since Version 7.0. Unlike DTS, which was included in all versions, SSIS is only available in the "Standard" and "Enterprise" editions.

Integration Services provides a platform to build data integration and workflow applications. The primary use for SSIS is data warehousing, as the product features a fast and flexible tool for data extraction, transformation, and loading (ETL). The tool may also be used to automate maintenance of SQL Server databases, update multidimensional cube data, and perform other functions.


10. Sql Server Reporting Services

SQL Server Reporting Services (SSRS) is a server-based report generation software system from Microsoft. It can be used to prepare and deliver a variety of interactive and printed reports. It is administered via a web interface.

Reporting services features a web services interface to support the development
of custom reporting applications.

SSRS competes with Crystal Reports and other business intelligence tools, and
is included in Express, Workgroup, Standard, and Enterprise editions of Microsoft SQL Server as an install option. Reporting Services was first released in 2004 as an add-on to SQL Server 2000. The second version was released as a part of SQL Server 2005 in November 2005. The latest version was released as part of SQL Server 2008 in August 2008.

In SSRS, reports are defined in Report Definition Language (RDL), an XML markup
language. Reports can be designed using recent versions of Microsoft Visual Studio[1] with the included Business Intelligence Projects plug-in installed or with the included Report Builder, a simplified tool that does not offer all the functionality of Visual Studio. Reports defined by RDL can be generated in a variety of formats[2] including Excel, PDF, CSV, XML, TIFF (and other image formats[3]), and HTML Web Archive. SQL Server 2008 SSRS can also prepare reports in Microsoft Word (DOC) format.


11. Design Patterns

All design patterns have the following characteristics …

A name
A description of the problem being addressed
A description of the solution
An evaluation of the pattern's consequences (i.e. its trade-offs)
As software developers and architects, why should we care about design

Design patterns provide a common vocabulary, and therefore facilitate communication.

Design patterns provide templates or guidelines for solving common design problems.

Design patterns help us understand the consequences of our design decisions. If we study design patterns and understand when they should be applied, we can build better products, and in the process bring benefit to our respective companies, our projects, our teams, and ourselves as well. Rather than reinventing the wheel, we can learn from our predecessors, and that's the key to building better software!


I .GOF (Gang of Four) -The GOF book catalogued 23 design patterns into 3

groups, namely Creational, Structural and Behavioural


Abstract Factory
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

Separate the construction of a complex object from its representation so that the same construction process can create different representations.

Factory Method
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.

Ensure a class only has one instance, and provide a global point of access to it.


Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.

Decouple an abstraction from its implementation so that the two can
vary independently.

Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.

Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.

Use sharing to support large numbers of fine-grained objects efficiently.

Provide a surrogate or placeholder for another object to control access to it.


Chain Of Responsibility
Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.

Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.

Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.

Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.

Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

Allow an object to alter its behaviour when it’s internal state changes. The object will appear to change its class.

Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

Template Method
Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.

Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.

II. Environmental Design Pattern

III. Architectural Design Pattern

Architectural or Enterprise design patterns tend to focus at higher abstractions of implementation. In other words, a typical Architecture design pattern would be the 'Three-Layered Architecture'. This simply means that one tries to separate ones implementation in terms of three focused areas or layers (Presentation, Business Logic, and Data Access). At the Enterprise level, one would start looking at Integration Patterns and understanding what patterns are useful in terms of connecting disparate systems in a hybrid environment.