Thursday, December 29, 2011

How to read a local XML file in Silverlight and to read a XML file in Silverlight and bind its data?

In this article, we are going to learn working with data in SilverLight.

Working with Data in Silverlight

Data is the back bone of any Line of Business application and in this section we are going to learn about working with data in Silverlight.

How to read a local XML file in Silverlight?

To read XML file in Silverlight, we can either user XmlReader or LINQ to XML, in this example we are going to learn LINQ to XML.

Read More....

Monday, December 26, 2011

Silverlight debugging - Beginner's Guide

Sometimes people have difficulties to debug Silverlight applications. Let me give you a hint to make it easy. The key thing is to understand that there are two applications (processes) you might want to debug – server and client. If you typically hit F5 sometimes only server gets debugged. That's why I do it another way:

Sunday, December 25, 2011

Using XCode 4 Snippets

Recently, I came across this post and fell in love with the idea of using XCode 4 snippets. Up until I read the post, I had heard they existed, but never really tried them. After reading the post, I began using his snippets as well as started creating my own. Now, I would say that my work-flow is faster than ever.

Here is a quick demonstration of the power of snippets

Read More....

Monday, December 19, 2011

Mastering Debugging in Visual Studio 2010 - A Beginner's Guide

In the software development life cycle, testing and defect fixing take more time than actually code writing. In general, debugging is a process of finding out defects in the program and fixing them. Defect fixing comes after the debugging, or you can say they are co-related. When you have some defects in your code, first of all you need to identify the root cause of the defect, which is called the debugging. When you have the root cause, you can fix the defect to make the program behavior as expected.

Now how to debug the code? Visual Studio IDE gives us a lot of tools to debug our application. Sometimes debugging activity takes a very long time to identify the root cause. But VS IDE provides a lot of handy tools which help to debug code in a better way. Debugger features include error listing, adding breakpoints, visualize the program flow, control the flow of execution, data tips, watch variables and many more. Many of them are very common for many developers and many are not. In this article, I have discussed all the important features of VS IDE for debugging like Breakpoint, labeling and saving breakpoints, putting conditions and filter on breakpoints, DataTips, Watch windows, Multithreaded debugging, Thread window, overview of parallel debugging and overview of IntelliTrace Debugging. I hope this will be very helpful for beginners to start up with and for becoming an expert on debugging. Please note, targeted Visual Studio version is Visual Studio 2010. Many things are common in older versions, but many features such as Labeling breakpoint, Pinned DataTip, Multithreaded Debugging, Parallel debugging and IntelliTrace are added in VS 2010. Please provide your valuable suggestions and feedback to improve my article.

Mastering Debugging in Visual Studio 2010 - A Beginner's Guide

In the software development life cycle, testing and defect fixing take more time than actually code writing. In general, debugging is a process of finding out defects in the program and fixing them. Defect fixing comes after the debugging, or you can say they are co-related. When you have some defects in your code, first of all you need to identify the root cause of the defect, which is called the debugging. When you have the root cause, you can fix the defect to make the program behavior as expected.

Now how to debug the code? Visual Studio IDE gives us a lot of tools to debug our application. Sometimes debugging activity takes a very long time to identify the root cause. But VS IDE provides a lot of handy tools which help to debug code in a better way. Debugger features include error listing, adding breakpoints, visualize the program flow, control the flow of execution, data tips, watch variables and many more. Many of them are very common for many developers and many are not. In this article, I have discussed all the important features of VS IDE for debugging like Breakpoint, labeling and saving breakpoints, putting conditions and filter on breakpoints, DataTips, Watch windows, Multithreaded debugging, Thread window, overview of parallel debugging and overview of IntelliTrace Debugging. I hope this will be very helpful for beginners to start up with and for becoming an expert on debugging. Please note, targeted Visual Studio version is Visual Studio 2010. Many things are common in older versions, but many features such as Labeling breakpoint, Pinned DataTip, Multithreaded Debugging, Parallel debugging and IntelliTrace are added in VS 2010. Please provide your valuable suggestions and feedback to improve my article.

Monday, December 12, 2011

How to create Stored Procedures in MySQL?

In this Article, we are going to understand how to work with Stored Procedures in MySQL and also learn Pagination through MySQL stored Procedure

Stored Procedures are precompiled queries these stored procedures improves security and execution performance of database client server applications.

Here, as seen below we have database 'dotnetfunda_3rd' having a table 3rdpartyarticles .The columns of table can also be seen below. I am using SQLyog –MySQL GUI.

Read More....

Saturday, December 10, 2011

Best Of Wallpapers Free


Description

Beautiful collection of Wallpapers Of different Categories 


-Nature Wallpapers
-Cars Wallpapers
-3D Wallpapers
-Travel Wallpapers
-Food Wallpapers
-Military Wallpapers
-Animal Wallpapers
-Holiday Wallpapers

Best Collection for your iPhone with hundreds of Wallpapers.
Included many new categories of wallpapers.
It contains
3D Wallpapers
Abstract Wallpapers
Aircraft Wallpapers
Animal Wallpapers
Architecture Wallpapers
Travel Wallpapers
Birds Wallpapers
Car Wallpapers
Event Wallpapers
Flower Wallpapers
Food Wallpapers
Heart Wallpapers
Love Wallpapers
Horse Wallpapers
Military Wallpapers
Mountain Wallpapers
River Wallpapers
Natural Wallpapers
Police Car Wallpapers
Space Wallpapers
Sports Wallpapers
Texture Wallpapers
Waterfall Wallpapers
Cricket Wallpapers

Also included sharing and email functionality, so you can now send wallpapers to your lovers and also can share it on Facebook etc.

Tuesday, December 6, 2011

Workflow services


Workflow services
In this short screencast DevelopMentor instructor, freelance developer and MVP Maurice de Beijer demonstrates how to create a workflow service using the Receive and the SendReply activities. He also shows how to use this workflow service form both a regular .NET client application as another workflow using the Send and ReceiveReply activities.

Activity designers


Activity designers
In this short screencast DevelopMentor instructor, freelance developer and MVP Maurice de Beijer demonstrates how to create custom activity designers and how to accosiate these with their control. He demostrates how to use the ExpressionTextBox to edit activity expressions on the design surface and how to add child activities using the WorkflowItemPresenter.

Developing custom activities

In this short screencast DevelopMentor instructor, freelance developer and MVP Maurice de Beijer demonstrates how to create custom activities. He explains the difference between composite XAML activities, the CodeActivity and the NativeActivity and when to use which one.

Working with data in workflows


Executing workflows

Getting started with Windows Workflow Foundation 4 and the different workflow authoring models

Calling Silverlight Method from Javascript and Javascript Function from Silverlight

Introduction

When working with silverlight, we are working with manage code (C#,VB). sometimes we will need to callback to html page from manage code.

In this article we walkthrough how to calling manage code from javascript and calling javascript function from manage code. 

Background

To call javascript function from silverlight, HtmlPage class of System.Windows.Browser namespace is used to allow user to access and manipulate browser DOM (Document Object Model).

ScriptableMemberAtrribute class indicates that method or property is accessible for javascript caller.

To permit user to access method of silverlight from javascript you have to set [ScriptableMember] attribute to that method.

Using the code

Let's start with step by step including source to demonstrate how to communication between javascript and silverlight.

Taming Silverlight Async Calls

Users of Silverlight often fall foul of the Asynchronous calling pattern which is enforced by the framework. Among the pitfalls are:
  • Callback methods being called multiple times instead of once
  • Attempts to use information before it has been retrieved
  • Inability to link a specific call to a specific callback
A number of articles have been written on CodeProject and elsewhere about this issue. Indeed, there are even forthcoming changes to the language to make it easier to handle some common cases. However, all of the approaches I've seen to date either require you to redesign your approach, or enforce a 'pseudo synchronous' approach in which the benefits of having multiple async calls in flight simultaneously are lost.

The AsyncCalls library addresses these problems and more. It offers
  • An easy to read way of writing simple 'pseudo sync' method calls
  • The ability to have several calls to the same method in progress at the same time, even llowing a different callback method to be run for each call, and guaranteeing that the user code will run exactly once for each async invocation
  • The ability to configure multiple calls to multiple async methods in such a way that as many of them as possible can be in progress at the same time, while guaranteeing that all needed results are available

And the whole library is only a page long - smaller than the demo Silverlight app included in the download!

Silverlight user control validation

Introduction

This article discusses user control validation techniques in Silverlight. It will help you display validation errors in user controls as they get displayed in textbox, combobox controls.

Problem Definition : 

Very often in programming we require to create our own user controls, which encapsulate system controls as TextBox, ComboBox etc. Silverlight with use of INotifyDataErrorInfo, allows binding source property to throw validation errors which become trickier to display in user controls. 

Attempt for solution :

 One of the simplest solution to overcome this problem is to bind internal system controls of user control to view model properties. But it makes user control tightly coupled to a particular view model, adding unnecessary restriction in control usage. Though, nothing innocuous in doing this (User control aware of view model and its properties), we definitely prefer to have control independent of view model. 

How to create Splash Screen with Progress Bar in Windows Phone 7

To create SplashScreen with ProgressBar idea is to put a popup visible till start page is ready.

Read More....


Monday, December 5, 2011

Essential Foundation Classes

Now that we have a better handle on how object oriented programming works on iOS we should go over some of the key Foundation classes that you will use in your own apps. Like the name suggests, Foundation supports the key frameworks used in iOS development. Most of what you will be doing when building iOS apps comes from Foundation and will use Foundation classes.

Foundation Inheritance Hierarchy

Remember that classes can have an inheritance relationship with other classes. Although we did not mention it specifically we have already seen classes in Foundation that are in an inheritance relationship. The two classes that I am talking about are NSObject and NSString. NSString inherits from NSObject. You might also say that NSString is a kind of NSObject. Because of this relationship, NSString has all the properties and methods it needs to be and do what an object is.

Extending Classes with Categories

Much of the day to day work in object-oriented programming involves using classes that are already written. Sometimes we want our classes to do just a little bit more. That means they need more properties and methods and adding these entities changes the nature of the class. This is called sub-classing and we already covered how to do that.

There are times, however, when we want to extend the abilities of class but we don't want to define a completely new class. You will encounter these situations more and more as you plunge into Objective-C programming. Perhaps more importantly, you will find examples of category use throughout the Mac and iOS programming examples written by Apple and other developers.

So, to extend a class without sub-classing you have the option of using categories. Let's talk about how to do this.

What is an NSDictionary and NSMutableDictionary

This is how I define Dictionary data strcuture.

It's a table with following conditions.

  1. It has exactly 2 columns and n rows.
  2. Its first column title is "key" and second column title is "value"
  3. Column 1 (key) values are always "unique"

Objective-C Foundation framework provide us 2 kind of dictionaries. One which is mutable (virtually unlimited size) and editable values called NSMutableDictionary and the one which has a fixed size (set when initializing it) with non-editable values calledNSDictionary.

NSDictionary is normally used to hold dictionaries which we know for sure that we will only use them in our calculations but not adding new rows into it or editing its values e.g; we use it to hold dictionaries returned by some function.

NSMutableDictionary is used where we are not sure about the the total number of rows in our dataset e.g; when we are processing our json response and not sure in advance how many results will be there.

How to Use NSMutableDictionary

   // Creating an instance of NSMutableDictionary NSMutableDictionary *mutDictionary = [[NSMutableDictionary alloc] init];  // Adding Values in it. [mutDictionary setValue:@"1st" forKey:@"FirstKey"]; [mutDictionary setValue:@"2nd" forKey:@"SecondKey"];  // Getting values in dictionary NSLog(@"First Value %@",[mutDictionary valueForKey:@"FirstKey"]); NSLog(@"Second Value %@",[mutDictionary valueForKey:@"SecondKey"]);
How to Use NSDictionary
  // Creating an instance of NSDictionary NSDictionary *dictionary = [[NSDictionary alloc] init];  // Since NSDictionary size is fixed, we will not be able to add new rows in it [dictionary setValue:@"Value" forKey:@"Key"];   // will produce run time error  // So if you wanted to initialize NSDictionary with some data, you can do it with some // proper initializer like this NSDictionary *dictionary = [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects:@"ist",@"2nd",nil] forKeys:[NSArray arrayWithObjects:@"FirstKey", @"SecondKey", nil]];  // Getting values in dictionary NSLog(@"First Value %@",[dictionary valueForKey:@"FirstKey"]); NSLog(@"Second Value %@",[dictionary valueForKey:@"SecondKey"]);

What is Key-Value Coding (KVC) and Why We Need It?

Before I discuss what is Key-Value Coding (KVC), it's very important that you understand the concept of KeyKey-Value and Key-Path.

What is Key?

Lets say we have a class named "Person" and it has 2 ivars called "name" and "age". We will call these ivars as "keys" but they will be strings => our ivar called "name" will have the key called @"name" and "age" ivar will have the key called @"age".

What is Key-Value?

Since ivar is suppose to store some value/data => our keys will have a value/data and we will call it key-value.

And What is Key-Path?

Lets say we have 2 classes as follows.

  @interface Passport {  	NSString *passportId; } @end
  @interface Person {  	NSString  *name; 	NSInteger *age;  	Passport  *passport; }  @end

Now what will be key for Passport class ivar called "passportId"? Answer is, it will depend on the perpective. If we will look it from the Person class, its key will be @"passport.passportId" and if we look it from the Passport class itself, it will be@"passportId".

So this "Path tracing" of key is called "Key-Path"

What is Key-Value Coding (KVC)?

In object oriented (OO) programming, you will also make getters and setters to set and access the values of your ivars, which is very good thing from the perspective of Encapsulation. But KVC is the concept of setting and getting the values of ivars with keys instead of getter and setters like this.

  Person *person = [[Person alloc] init];  // To set value of ivar with keys [person setValue:@"Adil" forKey:@"name"];  // To get the value of name ivar with keys [person valueForKey:@"name"];

Why We Need This?

The obvious question which arise from this, if we can do the same thing with getters and setters, why go through this hassle? The simple answer is, it reduce the amount of code we write but how? Just compare the following 2 codes for the following senario.

  /* Lets say we need the value associated with our ivars at run time but we don't know in advance  which ivar need to be returned. */  // Code 1 - without KVC  - (id*) returnIvarValueFor:(NSString*) key {  	if ([key isEqualToString:@"name"]) { 		return [self name]; 	} else if ([key isEqualToString:@"age"]) { 		return [self age]; 	} }  // code 2 - with KVC  - (id*) returnIvarValueFor:(NSString*) key {  	return [self valueForKey:key]; }

Code 2 is obviously simpler and easy to understand.

How to Create a Windows 8 Metro Style Application using Visual Studio 2011?

People often asked me to start a Video Tutorial series on Windows 8 Metro Style Application development using Visual Studio 2011 and here is first part of the series. The series will include the video tutorial as well as some text to give you easy access to the code.   In this first part (10 mint Video Tutorial), we will learn how to get started with the Project and also we will learn the project structure. Later we will have a small demo to show you how to develop your first "Hello Metro Style Application" using Visual Studio 2011 IDE. Continue to the tutorial to learn more.   Prerequisite Before starting with the development process, you need to setup your dev environment first. Download and install the Windows 8 Developer Preview with Developer Tools in a virtual environment, if you not yet done that step. A complete installation procedure is already documented in this article: "Step-by-Step Tutorial to Setup Windows8 in VMWare".   Download Windows 8...

Saturday, December 3, 2011

iPhone Interview Question And Answers

iPhone - What is iPhone? 

What is iPhone? 

  • IPhone is a combination of internet and multimedia enabled smart phone developed by Apple Inc.
  • iPhone functions as a camera phone, including text messaging, and visual voice mail
  • iPhone is a portable media player that resembles a video iPod
  • It has user interface that is built around the multi-touch screen including virtual keyboard.
  • App Store , which launched in the mid 2008 has over 1,00,000 applications with functionalities including games, references, GPS navigation, advertising, television shows, films, reference, celebrities. 

Creating Static Libraries For iOS

In computer science, a static library or statically-linked library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable. This executable and the process of compiling it are both known as a static build of the program. Historically, libraries could only be static.

On the iPhone, static libraries have a .a extention and can only contain code. This means that any resources (xibs, images, etc…) must be packed either in a bundle or shipped separately than the library. We won't go into this part today.

Read More...

Dynamically Controlling Your Application From The Web

Often times you find yourself in a situation where you might want to control your application remotely. You may want to enable/disable features at a certain time, push messages to all of your users, or do some cross promotion whenever you launch a new application. All of this can easily be done with a little JSON and some simple web interface coding.

How to import contacts into the iPhone Simulator

If you're working with AddressBook.framework chances are you'll want to import your own data to test against when you're in the simulator. Without being able to sync with iTunes or iCloud you may think you're stuck entering in addresses manually; not only is that a huge pain, but there are probably lots of edge cases already in your address book you wouldn't necessarily think of.

Read More...

Friday, December 2, 2011

Detect whether Silverlight is installed and its version through JavaScript

Internet Explorer considers Silverlight as a kind of ActiveX control. So to find if Silverlight is installed, we can attempt to create this ActiveX control using
Javascript. If it fails to create the ActiveX control, we can assume that Silverlight is not installed.

For other browsers like Google Chrome, Netscape, FireFox, Safari etc, this can be determined by looking in to the Plugin array of the navigator object.
The Silverlight plugin is installed with the name 'Silverlight Plug-In'.

Read More....

Thursday, December 1, 2011

Jump start Windows Workflow Foundation

Jump Start Windows Workflow Foundation

Once a veteran programmer was asked to define his professional developer's career in as few words as possible. His answer was "passion", "excitement" and "learning". And that's absolutely true as new, bleeding edge, exciting technologies/frameworks/languages keep flooding the technology limelight; we programmers fuel our passion of we-can-do-anything by mastering them.

One of the newest buzz phrases in the industry is "Windows Workflow Foundation" (WF). This article is aimed at getting a jump start into it to fuel excitement and pump up passion. Basic knowledge of .NET Framework is the only prerequisite for marching on with this jump-start tutorial. Examples are in C#, but VB.NET lovers are also invited to the show as this is all about framework, and if they can understand the pseudo code, programming it in VB.NET must be trivial.