Saturday, October 23, 2010

Why to use MVVM patterns with Silverlight and WPF development

To begin with, there are numerous and varied ways in implementing methodologies like MVVM, most of which are used based on personal preference. To a novice trying to educate themselves, this leads to disparity in information. Complicating this factor is that many of the articles or videos that attempt to describe the MVVM pattern also include components of other architectural patterns. This adds unnecessary complexity to understanding the MVVM pattern because of the inconsistencies in the pattern being described.

A great artical by Kim Schmidt. Here is the link

Friday, October 22, 2010

Calendar & Date Picker Scripts for ASP.NET and more

Calendars can be seen frequently in most web pages today especially in blogs and personal websites. As for corporate sites or e-commerce sites, it is utilize to layout announcements, up-coming events, contest and much more. What makes a calendar almost essential? It allows users to know what is new, what to be expect on specified date and track back older information all at one glance.

Here is the full post

Thursday, October 21, 2010

Create games for Windows Phone 7 - Getting Started Platforms Full Download


Phase 1 - Platform

Get introduced to Windows Phone 7, and phone game development with XNA Game Studio. This set of educational content is for all skill levels and phases of development, with a focus on introducing basic game techniques – such as input, graphics, and sound – to developers interested in making games on Windows Phone 7 using XNA Game Studio 4.0.

Phase 2 - Performance

Learn how to get the most out of Windows Phone 7 and XNA Game Studio with optimization tips and tricks.

Wednesday, October 20, 2010

Sony Ericsson S006 phone with 16.2-megapixel CMOS sensor

Sony Ericsson S006 phone gets 16.2-megapixel CMOS sensor

Sony Ericsson has certainly outdone itself with the S006 smartphone from KDDI, where it will boast a massive 16.2-megapixel CMOS sensor, catering to those who think that "more is better". Digital photography doesn't work that way though, but at least it gives you some bragging rights among your less informed mates. Other specifications of the S006 include the proprietary Exmor R image engine, the ability to achieve ISO 12800, a 1GHz Snapdragon processor, Wi-Fi connectivity, an integrated FM tuner, GPS navigation, Bluetooth connectivity and a 3.3-inch display with VGA resolution. No idea on pricing, but don't expect to see this hit the US anytime soon.

Tuesday, October 19, 2010

IIS/Exchange logs and WebDAV functions

You can collect information about client requests by enabling logging for sites and services. IIS logs are stored in %SystemRoot%\system32\Logfiles\. If you examine the IIS/Exchange log file you will see the request for the sample application being handled by IIS - you can notice couple of jargons like GET, PUT, POST, MKCOL, LOCK, UNLOCK, PROPFIND, SEARCH, PROPATCH, SUSBCRIBE, UNSUBSCRIBE, POLL etc. 

clip_image002

The three main HTTP functions used are GET, PUT and POST:

  • GET: Retrieves a document 

  • PUT: Puts an item in a folder 

  • POST: Submits an item to a folder

In addition to above, there are few more WebDAV functions that are used:
  • MKCOL: Makes a collection that is in essence the same as a Web Storage System folder. MKCOL allows you to make folders and set their properties. 

  • LOCK: Locks documents to prevent writes. 

  • UNLOCK: Allows writes and creates updates. 

  • PROPFIND: Searches for properties individually or for a whole set of folders. 

  • SEARCH: Provides filter, subquery and sort capabilities to a search. 

  • PROPPATCH: Sets arbitrary properties on an item. 

  • SUBSCRIBE: Adds a user to a list. 

  • UNSUBSCRIBE: Removes a user from a list. 

  • POLL: Checks to see if the notification is fired.

Sunday, October 17, 2010

System Stored Procedure sys.sp_tables in SQL Server

to know the list of the tables from the database:
SELECT *
FROM sys.tables
GO
The script above provides various information from create date to file stream, and many other important information. If you need all those information, that script is the one for you. However, if you do not need all those information, I suggest that you run the following script:
EXEC sys.sp_tables
GO
The script above will give all the tables in the table with schema name and qualifiers. Additionally, this will return all the system catalog views together with other views. This Stored Procedure returns all the tables first in the result set, followed by views.
Even though Stored Procedure returns more numbers of rows, it still performs better than the sys.table query.
Let us verify it with two different methods for database AdventureWorks:
1) SET STATISTICS IO ON
USE AdventureWorks
GO
SET STATISTICS IO ON
SELECT
*
FROM sys.tables
GO
EXEC sys.sp_tables
GO
(81 row(s) affected) (This is for sys.tables)
Table ‘syspalvalues’. Scan count 0, logical reads 162, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table ‘syssingleobjrefs’. Scan count 0, logical reads 324, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table ‘sysidxstats’. Scan count 81, logical reads 168, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table ‘syspalnames’. Scan count 0, logical reads 162, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table ‘sysschobjs’. Scan count 1, logical reads 16, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
(1 row(s) affected)
(456 row(s) affected) (This is for sys.sp_tables)
Table ‘sysobjrdb’. Scan count 1, logical reads 29, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table ‘sysschobjs’. Scan count 1, logical reads 16, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
(1 row(s) affected)
2) Execution Plan
You can see that the execution plan for sys.table has much higher cost of query batch.
Well, if you only need to know the name of the tables, I suggest that you start using SP_TABLES; at least it takes less typing to do.

Source: sqlserverauthority

Wednesday, October 13, 2010

Free E-Books/Guides essential for .NET Programmers and Architects

Foundations Of Programming
The Foundation Of Programming Series Free e-book By Karl Seguin is one of my favorites. It is simple, short and sweet. Especially for ‘casual’ programmers, this will give a better thought process – that’ll definitely enable them to code better and think better. This book covers the ALT.NET Philosophy, Domain Driven Development concepts, DI, TDD etc in a nice way. This book is close to my heart.
Microsoft Application Architecture Guide, 2nd Edition
Published by Microsoft, this is an essential read for any Microsoft.NET developer or Architect to understand the underlying architecture and design principles and patterns for developing successful solutions on the Microsoft platform and the .NET Framework. This guide neatly covers popular architecture patterns, best practices and common challenges you need to understand for developing .NET applications. Get a good grip on developing enterprise applications in .NET.
Rob Miles C# Yellow Book 2010
A nice action packed book that takes you through C# and .NET concepts. This book explains C# language and .NET library in general – with a clear focus on implementation thought process and best practices.
Threading in C#
A short, neatly written book from Joe Albahari about Threading in C#. This is a must read for any .NET programmer to understand more about threading in general, thread pooling, synchronization, Non blocking synchronization, etc. In this book, Joe even covers the Parallel Framework Extensions and Parallel programming in .NET
Improving .NET Application Performance and Scalability
This guide is again from Microsoft, and focuses on designing your applications with Performance and scalability in mind. It has sections relevant to architects, developers, testers, and administrators. Following the checklists and guidance in this book will ensure that there won’t be any unpleasant surprises in the end. Read this guide if you develop Enterprise applications in .NET
Applying Design Patterns
This is a quick introduction towards the thought process of applying design patterns. The objective of the book is to introduce design patterns in a simple way, so that developers can understand some common patterns and how to apply them. I wrote that some time back ;)
RefCardz from DZone
DZone has a number of awesome Ref Cardz (Quick reference sheets) on multiple technologies. You can go to DZone –> RefCardz to browse and download them (after getting a free DZone Id). Here are some of my recent favorites

Tuesday, October 12, 2010

Creating High Performing Applications for Windows Phone

Performance is an important consideration when creating applications for a Windows Phone 7 device. A Windows Phone 7 device has a limited central processing unit (CPU) and graphics processing unit (GPU) compared to a desktop or laptop PC. To optimize performance of Silverlight applications on Windows Phone 7, several changes were made to the way that Silverlight processes graphics and other objects. Even though Silverlight has been optimized for Windows Phone 7, there are several things that you can do in your Silverlight applications to best leverage the CPU and GPU. This topic describes ways that you can improve the performance of your Silverlight applications and includes multiple code samples.

in reference to:

"Creating High Performing Applications for Windows Phone"
- Creating High Performing Applications for Windows Phone (view on Google Sidewiki)

Monday, October 11, 2010

Simple Tooltip with jQuery & CSS

There are a lot of tooltip plugins out there, but not many of them explain what exactly goes on in the logic of a tooltip. But Soh Tanaka has created a nice tooltip and explained the logic also.


jQuery Tooltip Tutorial

Click for Demo

Click here for full post

Sunday, October 10, 2010

Nokia N8 + HDMI + Bluetooth Keyboard/Mouse = WIN

 nokia n8 tv
nokia n8

In this video, Noah from phonedog goes hands-on with the Nokia N8 connected to a TV (via HDMI) and Apples bluetooth keyboard / mouse. Check out the video after the break!


Saturday, October 9, 2010

Keyboard Bindings / Shortcuts in Visual Studio 2010

All the Visual Studio 2010 Keyboard bindings are available here for you to download. These are very helpful resources for a person who spends most of his days in Visual Studio.

http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=92ced922-d505-457a-8c9c-84036160639f

I personally like Ctrl+. which allows me to add the using statement without going to the top of the file. I use it quite frequently.

Friday, October 8, 2010

MVVM with WCF RIA Services

MVVM without RIA:
·         MVVM relies on the concept that View (XAML) will not contact your Model directly.
·         View will contact Model via ViewModel classes.
·         ViewModel talks with View using Data Binding and Commanding in XAML based applications.
·         ViewModel talks with Model via web service communication in case of Silverlight when we don’t use RIA Service.




MVVM with RIA:

·         RIA Service abstracts the web service layer from developer’s perspective and presents on client an identical set of classes that we have in model on server.
·         This simply means that under normal MVVM scenario we just change the communication between ViewModel and Model to go via the auto generated model classes on client side instead of explicitly calling web services (though internally it is still WCF communication).
·         In my opinion, this should not pose any problems to the MVVM pattern given that we keep the communication link same as above.



Cautions/DON’Ts:

·         We should never attach the auto generated client model classes of RIA with View directly. This link of View to Model should happen via ViewModel only. In a nutshell, these auto-generated model classes should never be considered as ViewModel.

·         We also have the availability of some RIA controls like DomainDataSource (in XAML). In case of MVVM we should NEVER use any such RIA controls in XAML since they break the very pillar of MVVM by contacting auto generated client side model of RIA directly (which is same as above point).

Thursday, October 7, 2010

SharePoint 2010 Development Platform Stack - Diagram

This diagram shows the platforms on which SharePoint Server and SharePoint Foundation are built.
  • The boxes with a blue fill represent independent platforms and each depends on the platforms below it.
  • The empty boxes inside the larger boxes are selected important subparts or features of the platform.
  • The thin downward arrows indicate selected dependency relations. Not every sub-platform or dependency relation is shown.
  • The thicker, green, sideways arrows indicate that one entity accesses the entity to which the arrow points. Again, only some selected access relationships are shown.
For more information, see Conceptual Overview of SharePoint Foundation and its child nodes.​

Wednesday, October 6, 2010

Communication between Iframes

In cases when we host different applications within Iframe on a web page, we often need them to communicate with each other or just be able to communicate with its host parent.

The basic to have this communication happen is by ensuring that the
 
document.domain

property of both communicating parties are same.

Consider this, say parent page is http://parent.example.com/mypage.aspx . This page host another application in an Iframe. To have parent and hosted application able to communicate with each other we need to have IFrame application be in either a subdomain of parent.example.com (like http://sub.parent.example.com/myapp.aspx) or in parallel to parent.example.com (like http://sub.example.com/myapp.aspx ).

Once we setup both applications as mentioned above; we can then set the document.domain property to parent.example.com (in case IFrame application is hosted in a subdomain like http://sub.parent.example.com/myapp.aspx) or we need to set the document.domain to example.com (in case the Iframe application is hosted in a parallel domain like http://sub.example.com/myapp.aspx )

We can do so by calling a script function at onload event handler of both parent page and on page which is to be hosted inside the iframe, or by simply doing something like this.
 








.. all other stuff





now, parent and iframe document can communicate without any hassle.
for example iframe document can now call any javascript method on its parent, passing any required data, like shown here

Tuesday, October 5, 2010

LinkList in Javascript


    function LinkList() {

        var count = 0;

        var head = null;

        function Node() {

            var Data = null;

            var Next = null;

        }

        this.Count = function () {

            return count;

        }

        this.Add = function (data) {

            var nd = new Node();

            nd.Data = data;

            if (head) {

                nd.Next = head;

            }

            head = nd;

            count++;

        }

        this.Traverse = function () {

            var result = "";

            var current = head;

            while (current) {

                result = result + " --> " + current.Data;

                current = current.Next;

            }

            return result;

        }

    }

var mylist = new LinkList();



function AddToList() {

    var txtCtrl = document.getElementById('datatxt');

    var resCtrl = document.getElementById('result');

    if (txtCtrl && txtCtrl.value.length > 0) {

        mylist.Add(txtCtrl.value);

        if (resCtrl) {

            resCtrl.innerHTML = "" + txtCtrl.value + " added to list.";

        }

        txtCtrl.value = '';

    }

}

function PrintList() {

    var resCtrl = document.getElementById('result');

    if (resCtrl) {

        if (mylist.Count() > 0) {

            resCtrl.innerHTML = mylist.Traverse();

        }

        else {

            resCtrl.innerHTML = "List is empty.";

        }

    }

    var txtCtrl = document.getElementById('datatxt');

    if (txtCtrl) {

        txtCtrl.value = '';

    }

}

function GetCount() {

    var resCtrl = document.getElementById('result');

    if (resCtrl) {

        resCtrl.innerHTML = "List has " + mylist.Count() + " items.";

    }

    var txtCtrl = document.getElementById('datatxt');

    if (txtCtrl) {

        txtCtrl.value = '';

    }
}

Monday, October 4, 2010

Samsung I8700

Samsung I8700 is rumored to be a Windows Phone 7 running device with 4" touch screen.


Basic specifications:
GSM 850/900/1800/1900
UMTS 900/1900/2100
WiFi, 3G
   Windows Phone 7
GPS - Yes

LG C100

The LG C100 (Nelson) is a feature phone on the GSM EDGE standard, with a 2.2" LCD display, QWERTY keyboard, 1.3MP camera, music player, FM radio, and microSD card slot.

Basic specifications:
GSM 850/900/1800/1900
Average Dimensions - 4.51 x 2.35 x 0.51 inches (114.5 x 59.6 x 13 mm)
Light Weight - 3.32 oz (94 g)
Small display - 176 x 220 pixels; 262 144 colors
1.3 megapixels Camera,  microSD slot

Sunday, October 3, 2010

Samsung I5510

Samsung I5510 is a mid-range Android 2.2 running phone with a physical slide-out QWERTY, and a 3.2" display. It packs a 3MP camera, Bluetooth 3.0, Wi-Fi and a microSD card slot.

Basic specifications:
GSM 850/900/1800/1900
UMTS 900/2100
Average Dimensions - 4.37 x 2.17 x 0.60 inches (111 x 55 x 15.2 mm)
Average display - 240 x 400 pixels; 16 777 216 colors
3 megapixels Camera,  microSD/microSDHC slot, 3G
   Android
GPS - Yes

Samsung Cetus

Samsung Cetus is a Windows Phone 7 phone and is shaping up to be one looker due to the fact that it will feature a 4” WVGA AMOLED display, front-facing VGA camera, and also a healthy sized 5-megapixel shooter in its rear.







Basic specifications:
GSM 850/900/1800/1900
UMTS 900/2100
Big display - 480 x 800 pixels
5 megapixels Camera,  WiFi, 3G
   Windows Phone 7
GPS - Yes

Saturday, October 2, 2010

HTC Mondrian

HTC Mondrian is a Windows Phone 7 phone and is expected to come to market with a 480x800 resolution display and feature the next generation of Snapdragon processor under the hood.

Basic specifications:
GSM 850/900/1800/1900
UMTS 850/1900
Big display - 480 x 800 pixels
microSD/microSDHC slot, Bluetooth, 3G
   Windows Phone 7
GPS - Yes

SQL Server 2008 SP2 is now available for download

Microsoft has announce the availability of Service Pack 2 for SQL Server 2008. Both the Service Pack as the Feature Pack are available for download from the Microsoft Download Center. Service Pack 2 for SQL Server 2008 includes new features for compatibility with SQL Server 2008 R2, product enhancements based on requests from the SQL Server community as well as solutions hotfix provided in SQL Server 2008 SP1 Cumulative 1 to 8.

Key enhancements in Microsoft SQL Server 2008 Service Pack 2 are:
  • Reporting Services in SharePoint Integrated Mode. SQL Server 2008 SP2 provides updates for integration services between SSRS and SharePoint products. The SSRS of SQL Server 2008 SP2 can be integrated with SharePoint 2010 products. SQL Server 2008 SP2 also provides additional support for grant support in the integration of SQL Servers Report Server 2008 R2 SharePoint 2007 products. This now enables SharePoint 2007 to use with the Report Servers in SQL Server 2008 R2. For additional information on the new integration of SSRS and SharePoint click on the link below What's New (Reporting Services).
SQL Server 2008 R2 and Application Compatibility Multi-Server Management with SQL Server 2008.
  • Instance Management SQL Server 2008 with SP2 applied, a database instance of SQL Server 2008 can be included in the utility control SQL Server 2008 R2 as an instance managed by SQL Server. SQL Server 2008 SP2 allows organizations to extend the utility value of the control of SQL Server instances without upgrading those servers to SQL Server 2008 R2. For additional information click on the link below Overview of SQL Server Utility.
  • Data-tier Application (DAC) Support. Instances Database SQL Server 2008 supports all operations DAC distributed SQL Server 2008 R2 after SP2 has been installed. You can distribute, update, search, extract and delete DAC's SP2 does not update the client tools to provide support for DAC's. You must use the SQL Client Tools Server 2008 R2 and SQL Server Management Studio, to perform DAC's. A CAD application is an entity that contains all the objects in a database and instantiated objects used by any application. DAC provides a single unit to approve, distribute and manage objects DAC. For additional information click on the link below Designing and Implementing Data-tier Applications.
To download SQL Server 2008 SP2 selected from the following links:
Downloads and Documents:

Friday, October 1, 2010

Wildcard script mapping and IIS 7 integrated pipeline

There is a great help available on learn.iis.net.

Author Ruslan Yakushev has a very good post on this.

The big benefit of IIS 7 integrated request processing pipeline is the fact that all the nice and useful ASP.NET features can be used for any type of content on your web site; not just for ASP.NET-specific content. For example, ASP.NET SQL-based membership can be used to protect static files and folders. Also, ASP.NET extensibility API's, such as IHttpHandler and IHttpModule can be used to add custom modules and handlers that would be executed even for non-ASP.NET content.

IIS 6 did not have this level of integration. ASP.NET was plugged into IIS 6 as an ISAPI extension and by default was configured to handle ONLY requests mapped to that extension - for example any request that ended with ".aspx" would be be processed by ASP.NET extension. This obviously was a big limitation for customers who wanted to be able to use ASP.NET features for all other contend on web site. The most common way to workaround that was to use "Wildcard script mapping". This post explains how an application that used wildcard script mapping in IIS 6 can be migrated over to IIS 7.


Read Full Post Here

Thursday, September 30, 2010

Make OneNote 2010 speak to you

Did you know OneNote can talk? Here's how:

Click File | Options to open the option dialog, then click Customize Ribbon. This is to set up the ribbon for the speak command. On the right side of the dialog, expand the Home tab, then click the New Group button at the bottom:

clip_image001

Save 50% on 200 movie Classics, like 'The Wizard of Oz' and 'Gone With the Wind'!


I named the group My New Group.

Then, on the left pane, change the drop down Choose commands from to be All Commands. Scroll down to the Speak command:

clip_image002

Then click the Add>> button to add it to the group named My New Group:

clip_image003

Click OK.

Now go to any page in OneNote and select some text. Click the Home tab and then the Speak button in the group you just created.

OneNote will read the text to you!
This is not unique to OneNote, by the way - all the Office 2010 apps have this.

Web TV gets demoed on the Nokia N8

nokia n8

Heres a demo of  Web TV on the Nokia N8. This feature will also be available on other Symbian^3 devices such as the Nokia C6, C7 and the E7. Enjoy the video!

Wednesday, September 29, 2010

HTC Mozart - Full Specification Video



HTC Mozart wil be a Windows Phone 7 running phone with a 1 GHz Qualcomm QSD 8250 processor, 576 MB of RAM, 8GB of storage, a 3.7 inch WVGA S-LCD display, a 1300 mAh battery and 8MP camera with Xenon flash.

Basic specifications:
GSM 850/900/1800/1900
UMTS 900/2100
Big display - 480 x 800 pixels
8 megapixels Camera,  Bluetooth, 3G
   Windows Phone 7
GPS - Yes