Thursday, 30 August 2012

List Vs ObservableCollection Vs INotifyPropertyChanged

List
Observable Collection
INotifyPropertyChanged
strongly typed list of objects that can be accessed by index
ObservableCollection is a generic dynamic data collection that provides notifications (using an interface "INotifyCollectionChanged") when items get added, removed, or when the whole collection is refreshed.
INotifyPropertyChanged is not a collection, it’s an interface used in the data object classes to providePropertyChanged notification to clients when any property value gets changed. This will allow you to raisePropertyChanged event whenever the state of the object changes (Added, Removed, and Modified) to the point where you want to notify the underlying collection or container that the state has changed.
Using this you can search, sort, and manipulate lists
Using this you can search, sort, and manipulate lists
INotifyPropertyChanged is compatible on all type of collections like List<T>, ObservableCollection<T>, etc.
To Update the list you need to bind the data source again.
It does not provide any notifications when any property in the collection is changed.
The values in the observable collection are added, removed and changed during runtime in the code behind. The operations (adding and removing an item) in the observable collection will be updated to the UI (Datagrid). But any change in the existing item will not be updated to the UI.



List



ObservableCollection


From the msdn documentation:
It represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.

public class ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged
Notice that, like any collection that derives from Collection<T>, its methods accept null parameters and do not throw an exception.
But the main feature of the ObservableCollection<T> are the events it raises when the items it contains change. 

By implementing the INotifyCollectionChanged and INotifyPropertyChanged interfaces, the collection has events for CollectionChanged and PropertyChanged. All these events are related. The first one is raised whenever something changed in the collection, be it Add, Remove, Move, etc. 

This also trigger the PropertyChanged event for the Items[] property. When you’re adding or removing items, PropertyChanged is also raised for the Count property.


INotifyPropertyChanged

 References:

WPF - Introduction


Introduction

WPF stands for Windows Presentation Framework.
It was introduced with .Net framework 3.0
It is the new-era of desktop applications that are very rich and efficient.

Advantages of WPF

WPF delivers rich, responsive UI; it is very easy to use animations with WPF.
I am not a game developer but then also creating games application using WPF is far easier. Efficient and flexible developing WPF applications are an experience in itself.

WPF Vs DirectX

Not really, although using WPF you can create nice, responsive UIs but the video performance is better in DirectX than in WPF.
WPF is good for small game programming.

 WPF Vs Windows applications

·         Windows applications basically used the Operating system controls to build its application. Whereas WPF uses the vector graphics and WPF controls are actually drawn over the screen, and hence you can customize controls totally and modify their behavior when required.
·         WPF uses the hardware capabilities of your system making it to deliver smooth graphics.
·         WPF uses device independent DPI(dots per inch) for the visual layout whereas the windows applications use pixels. Using DPI makes a WPF application to adjust with various different resolutions of your monitor.
·         It’s very easy to apply styles to a WPF application , in case of windows applications the styles are defined in css and each control is tightly coupled to a style. Whereas in case of WPF you can create a style irrespective of the control.
For example , you can give a toggle button style to your checkbox.
·         In case of windows application , the controls are resource intensive , that is when a form is created the controls are loaded and their objects are loaded in memory. In case of WPF if the templates are loaded only once during the complete lifecycle of the form, this frees a certain part of memory.
·         Also, in case of WPF we are using data binding and dependency properties instead of CLR properties which gives the application very loosely coupled architecture.

Tuesday, 28 August 2012

TIPS TO BE A SUUCCESSFUL LEADER AND MAKE THE PROJECT SUCCESSFUL


Tip 1: Set the goal  

The first task we need to take is to set the goal that we want to achieve.

Tip 2: Divide and Conquer

Divide the goal into small accomplishable tasks and set the target for each of them.
Each and every task should be a SMART task
.


Tip 3: Follow-up and Follow-through

After setting the tasks, you should never forget to follow-up daily and follow-through them till their completion.

Following doesn’t mean that you don’t trust but it essentially means” trust but verify”. It will help keep everyone out of harm’s way.


Tip 4: See the goals

A project will span at least more than 15 days. In these 15 days problems will definitely pop-up.
 Resources can become sick, requirements are missed, incompatible technology is used, and systems can go down etc…etc
These problems should not set you back, you need to see through the problems on to the goal. Take preventive and corrective measures , your final target is your GOAL.


Tip 5: Never miss details

Make sure that while you focus on the big picture , your goals you are not missing out the details.
Making sure you know all the details about a particular project , about a particular problem will definitely help you and your team to sail through the difficult times easily.

Never miss the details. Not even a single day.


Tip 6: Don’t ASS-U-ME

Never rely on assumptions.
If there are any assumptions, put them on paper , get it signed off and make it requirement.

You can’t assume that just because someone said a deliverable is complete…that it is.


Tip 7: Freedom of speech.

Speak to your managers, to your team and to your customers, whenever required, wherever required.
Ask Questions, get things clarified.

Keeping silent will take every one into a fierce fight towards the end.
So, speak-up.
Avoid ambiguity, avoid confusions and speak.
Let your members speak their concerns to you. Take at least an hour, every alternate day to make sure you know what difficulties or problems each one is facing.


Tip 8: Accept you don’t know

If you don’t know, you don’t know. There is nothing to be scared off.

But whenever you don’t know, try to research and get the knowledge.
In today’s world knowledge is free. But it requires time and commitment. So, commit yourself to your lack of knowledge/understanding. And make sure you get the knowledge, make sure you understand.

As a leader, if you have ambiguity prevailing you, your team and the project is going to suffer.

Tip 9: Catch them doing right.

Make sure you appreciate your team members, whenever they have accomplished a task.
Recognize them in public, it helps boosting their self-esteem and increasing their productivity.

More than catching a person doing something wrong, it’s more important to catch them doing something right.


Tip 10: Keep a mirror with you.

Keep a mirror not just to see your appearance but to check on your attitude, towards others, towards the project, towards the organization and also towards yourself.

Be humble, respect others and be decisive.

Facts about Brain































The Astounding Nervous System: How Does My Brain Work?


The Astounding Nervous System: How Does My Brain Work?


the book tries to explain the nervous system in detailed manner in an easy to understand way.
A good read , very informative , easy to understand , explanations will be well liked by kids.
The pictures are self guiding.
Will recommend it for all the high school grades.
The experiments given are simple, easy to do , fast to remember facts.

Nice one.A must read.

Notes on Azure -1


Windows Azure is Microsoft's Operating System for "The Cloud"
What is the Cloud ?
In simple words the cloud is nothing but an abstraction used for the Internet and the underlying infrastructure hosting it.The Windows Azure cloud primarily consists of lots & lots & lots of servers, routers, switches & storage hosted in a Microsoft Data Centers. The present day Azure cloud is hosted in Redmond, US but the plan is to spread them out in data centers across the globe.
Why does it need an OS ?
Lets take a step back and think what a traditional OS would do for your applications ? A Desktop/Server OS takes care of the nitty grities of managing of your computers hardware as well as basic housekeeping tasks like memory management, disk I/O, task scheduling etc... while your application codebase is largely focused on the the business problem you are trying to solve. Now think of a typical Internet application today ? We not only have to create a well behaved application but also need to take care of provisioning a hosting environment, scaling the application based on load, monitoring health, planning for fault tolerance, disaster recovery & managing upgrades... Now how many times do we find ourselves doing the same things again and again... One cannot help but wish if only there was an environment that would automatically manage all these basic housekeeping aspects and let the IT team focus on just building the application. Well this is precisely what a cloud OS does for you.
Windows Azure.
The Azure™ Services Platform (Azure) is an internet-scale cloud services platform hosted in Microsoft data centers, which provides an operating system and a set of developer services that can be used individually or together. Azure’s flexible and interoperable platform can be used to build new applications to run from the cloud or enhance existing applications with cloud-based capabilities. Its open architecture gives developers the choice to build web applications, applications running on connected devices, PCs, servers, or hybrid solutions offering the best of online and on-premises.
Windows Azure provides the glue that gels together the cloud. It makes the zillions of connected servers work together as a cohesive unit and provides an environment that has automated service management, immense computing potential, practically unlimited storage and rich developer experience. It also provides you with 24/7 availability and the ability to scale up and down with very little overheads. This allows developers to focus on building the app than the infrastructure.
By leveraging the automated service management capabilities of windows Azure a developer can model the rules for deployment, monitoring and execution. He/She then provides the rules along with the executables for the service to the platform which then deploys, monitors, and manages the service in an hands free mode...
Windows Azure creates a powerful service hosting environment. All of the hardware including servers & load balancers is virtualized and a service is typically deployed across multiple fault domains and update domains resulting in high availability and fault tolerance. All this is done by cloud OS transparent to the service owner.
Reliable storage is an essential element of any application platform today. Windows Azure provides highly scalable cloud storage with the ability to store data in blobs, tables & queues.
Now a rich, familiar developer experience is absolutely critical to the adoption of any platform within the developer community. Windows Azure provides you with the same familiar Visual Studio experience complete with a managed framework that developers could use out of the box. To make things even better Windows Azure team makes available a complete cloud experience on your desktop that allows developers to build and test their cloud applications on a local desktop and yes you don't need a windows server for doing this...
Azure reduces the need for up-front technology purchases, and it enables developers to quickly and easily create applications running in the cloud by using their existing skills with the Microsoft Visual Studio development environment and the Microsoft .NET Framework. In addition to managed code languages supported by .NET, Azure will support more programming languages and development environments in the near future. Azure simplifies maintaining and operating applications by providing on-demand compute and storage to host, scale, and manage web and connected applications. Infrastructure management is automated with a platform that is designed for high availability and dynamic scaling to match usage needs with the option of a pay-as-you-go pricing model. Azure provides an open, standards-based and interoperable environment with support for multiple internet protocols, including HTTP, REST, SOAP, and XML.
Features

Key components of the Azure Services Platform include the following:
  • Windows Azure for service hosting and management, low-level scalable storage, computation and networking
  • Microsoft SQL Services for a wide range of database services and reporting
  • Microsoft .NET Services which are service-based implementations of familiar .NET Framework concepts such as workflow and access control
  • Live Services for a consistent way for users to store, share and synchronize documents, photos, files and information across their PCs, phones, PC applications and Web sites
  • Microsoft SharePoint Services and Microsoft Dynamics CRM Services for business content, collaboration and rapid solution development in the cloud.
Reference : StackOverflow


Windows Azure: Getting Weird Error

When trying to delete my storage account from the new azure portal getting a weird error .

"Storage account xxxxxx  has 1 container(s) which have an active image and/or disk artifacts. Ensure those artifacts are removed from the image repository before deleting this storage account."

When did this happen?
I created a Virtual Machine.
Used it.
Deleted the VM.
Trying to delete storage and OOOPsss....

Getting error



Not sure whats wrong....

Let me check.

Vollaaaaaa....got the answer....

Need to delete disks from my server....

Now now my storage got deleted....wow...

But why dis it happen???
Reason:
I deleted VM, but the deletion kept the orpaned disk and as the preview portal has hided the details. I was going bang....bang...

Now all resolved.
But need to open a support ticket so that in next release this bug is resolved.