Friday, December 24, 2010

What is Tombstoning


ShareThis

In Phone Operating Systems like Windows Phone 7..

The procedure in which the operating system terminates an application’s process when the user navigates away from the application. The operating system maintains state information about the application. If the user navigates back to the application, the operating system restarts the application process and passes the state data back to the application.

os7

Wednesday, December 22, 2010

Collection of “How do I ?” MSDN Videos–(Produced by us) on Windows Phone 7, Sharepoint 2010, Silverlight4, Cloud Services, Visual Studio 2010, SQL Server RC2, Windows 7


ShareThis

Windows Phone 7

1. How Do I: Implement Tombstoning in Windows Phone 7 Applications?

2. How Do I: Migrate an Android Application to a Windows Phone 7 Application?

3. How Do I: Use Page Turn Animation in a Windows Phone 7 Application?

4. How Do I: Use MVVM in a Windows Phone 7 Application?

5. How Do I: Use Touch Manipulation in a Windows Phone 7 Application?

6. How Do I: Make Windows Phone 7 Applications Support Orientation Changes?

7. How Do I: Implement Tilt Effects in a Windows Phone 7 Application?

8. How Do I: Migrate an iPhone Application to a Windows Phone 7 Application?

9. How Do I: Use XNA for Game State Management in a Windows Phone 7 Application?

10. How Do I: Use XNA for Gestures and Collision Detection in a Windows Phone 7 Application?

11. How Do I: Save Images to the Pictures Hub and Retrieve them back from the Hub in a Windows Phone 7 Application?

12. How Do I: Use Push Notifications for Tile Customization in a Windows Phone 7 Application?

13. How Do I: Use Push Notifications in a Windows Phone 7 Application?

Windows 7

1. How Do I: Use a Progress Bar on Icon in a Windows 7 Application?

2. How Do I: Create an Overlay Icon in a Windows 7 Application?

3. How Do I: Create a Custom Thumbnail for a Windows 7 Application?

4. How Do I: Create a JumpList for Common Tasks in a Windows 7 Application?

5. How Do I: Use Multitouch in a Windows 7 Application?

6. How Do I: Create an Internet Explorer 9 Pinned Site in Windows 7?

7. How Do I: Create Custom Thumbnails and Previews for a Windows 7 Application?

8. How Do I: Use Microsoft Speech API in a Silverlight Out-of-Browser Application?

SharePoint 2010

1. How Do I: Use Client Object Model from a Silverlight Application in SharePoint?

2. How Do I: Build a SharePoint Workflow Using Visual Studio 2010?

3. How Do I: Create a Reusable Workflow Using Visual Studio 2010 and SharePoint Designer 2010?

4. How Do I: Use REST Services to Access and Update Data in a SharePoint List?

5. How Do I: Use Business Data Connectivity Model in SharePoint by Using Visual Studio 2010?

Visual Studio 2010

1. How do I: Use IntelliTrace in Visual Studio 2010?

2. How Do I: Perform Exploratory Test in Visual Studio 2010?

3. How Do I: Use Build in Visual Studio 2010?

4. How Do I: Use Query Folders for Organizing Queries in Team Foundation Server 2010?

5. How Do I: Split a Team Project Collection in Team Foundation Server 2010?

6. How Do I: Use Traceability in Visual Studio 2010?

7. How Do I: Enable Symbol and Source Server Support in Team Foundation Server Build 2010?

Cloud Services

1. How Do I: Work with Spatial Data in SQL Azure?

2. How Do I: Work with Windows Azure Marketplace DataMarket?

SQL Server 2008 R2

Wednesday, December 15, 2010

Smartphone overview and comparision


ShareThis

 

A smartphone is a phone that runs a recognizable OS on which the user can install applications.

Some facts:

  • In 2009, about 175 million smartphones were sold worldwide. The market is expected to grow by 90% this year.
  • Android is moving into the mid-range market with devices such as the Vodafone 845that have cheaper, less powerful hardware.
  • Now that Microsoft has released Windows Phone 7, Windows Mobile will disappear.
  • MeeGo was not available at the time of this writing. It is likely to hit the market in the first quarter of 2011.
Smartphone market overview
MARKET SHARE OSS CONSUMERS
High-end 20% iOS
Android
webOS
MeeGo
Windows Phone 7
BlackBerry OS6
Within the high-end group, users care about web surfing and applications above anything else, and they’re willing to pay for these features.
Business 35% BlackBerry
Symbian
Windows Mobile
Windows Phone 7
The business group includes phones that companies buy for their employees. The IT department decides which OS can access the company network so that users can retrieve e-mail and browse secure intranets.
Mid-range 45% Android
Symbian
BlackBerry
bada
Windows Mobile
Within the mid-range category, users are interested in music, a good camera, and/or easy texting (which requires a hardware keyboard)—all in an affordable device.
Global browser stats for November, 2010
SHARE BROWSER NOTES
22% Opera StatCounter lumps Opera Mini and Opera Mobile together. My personal estimate, based on discussion with Opera, is that about 90% of this number is Mini.
22% Safari StatCounter splits up iOS into iPhone, iPod Touch, and iPad. It includes iPad stats with the Safari desktop—not in the mobile statistics. Therefore, this figure excludes the iPad.
19% BlackBerry This encompasses mostly the OS5 and older models, which run a browser with a homegrown rendering engine. From OS6 on, BlackBerry uses a WebKit-based browser, and that will make our job a lot easier.
17% Nokia Nokia’s WebKit-based browser comes in various flavors, some of which are better than others. Unfortunately StatCounter does not differentiate between each flavor.
11% Android The Android market is pretty fragmented when it comes to browsers. There are some subtle differences between browsers on HTC and Sony Ericsson devices. Expect problems to arise from these inconsistencies.
4% NetFront NetFront runs mostly on older phones from Asian vendors, notably Sony Ericsson. This figure includes the Sony PlayStation Portable as well as other gaming devices.
1% UCWeb The most popular browser in China. It offers little functionality.
1% Samsung StatCounter lumps all Samsung browsers together, from old NetFront-based phones to the new WebKit-based bada.

 

The best mobile browsers

  1. Safari for iOS—the best mobile browser overall,
  2. Android WebKit,
  3. Dolfin for Samsung bada—by far the fastest mobile browser, and
  4. BlackBerry WebKit, the new default browser for OS6 and higher. (Currently only available on the BlackBerry Torch.)

How to secure your password- tips and tricks!


ShareThis

Here are few trick tips and tricks that will help you to secure your password:

passwordHOW TO SET SECURE PASSWORDS

For a password to be secure, it needs to be difficult to guess, as long as possible and consist of a combination of letters, numbers and characters. It also needs to be unique for each service that you use. The trouble is that the longer and more difficult to crack a password becomes, the harder it becomes to remember, which is why many people use the same password everywhere. The good news is, there are a few strategies that you can use to set secure and unique, yet memorable, passwords:

  1. Use a password manager. This is probably the easiest and most secure option, and so it’s the one I recommend. There are several excellent tools available, such asLastPass, 1Password and KeePass, that can generate and store extremely tough to crack unique passwords for every service you use. Because the tool manages the passwords for you, you don’t need to worry about forgetting a tricky long password.
  2. Use a password hashing tool. A password hashing tool will take your password, combine it with a parameter (perhaps based on the site’s name or domain) and combine the two using a hashing function to create a very tough to crack password. As the tool deals with the hashing for you, you only need to remember the master password. There are several free password hashers available as browser add-ons.
  3. Use a rule-based password strategy. Gina Trapani posted a great rule-based password strategy on Lifehacker back in 2006 (if only all the Lifehacker readers had actually heeded her advice!). The idea is that you take a base password and combine it with the name of the service the you’re creating the password for using a set of rules. For example, my password for WebWorkerDaily might be %shjk80aily% (an easily memorable master password of shjk80, plus the final four letters from the service name, surrounded by % characters for extra security). Applying the same rules, my password for Amazon would then be %shjk80azon%. You can also reverse or reorder the letters from the service name, or interweave  them with the letters from your master password, for even greater security.

Friday, December 10, 2010

Security mechanism in Chrome OS and Browser


ShareThis
Security mechanism in Chrome OS and Browser

Why I hate VB now even it was my native language once…


ShareThis

I started coding in VB4 language and did a lot of coding on VB 6 for many years. Those days, VB was my native language. I was fond of it. I loved it. I used to think in VB Smile

But when I learnt JAVA and then C#, I never VB again. C# is really amazing.

There are a couple of reasons I do not use VB -

  1. VB is verbose
  2. The intellisense refuses to "let go" unless I tap the Escape key
  3. Syntax highlighting sucks. In C#, all types are highlighted - in VB, only intrinsic types are highlighted.
  4. It's VB. Winking smile
  5. There are no automatic code formatting options like we get with C#

But still I know there are a couple of things that can be better done in VB.net.

Saturday, December 4, 2010

Structured Analysis vs Object Oriented Analysis


ShareThis

Structured Analysis and Object Oriented Analysis are different techniques of developing a computer system.

Structured Analysis

In Structured Analysis, the focus is only on process and procedures.
Modeling techniques used in it are DFD(Data Flow Diagram), Flowcharts etc.
This approach is old and is not preferred

Object Oriented Analysis

Whereas in Object Oriented Analysis, the focus is more on capturing the real world objects in the current scenario that are of importance to the system. [2] It stresses more on data structure and less on procedural structure. Without actually identifying objects, what are you going to interact with, and whose state will you change. In this approach, objects are identified, their relationships among each other, possible states that each object can be in, and finally how all objects collaborate with each other to achieve a broader system goal are identified.
Modeling techniques used in it are UML(Unified modeling Language), that can present both structural and behavioural/procedural aspect of the system. UML includes Class Diagram, State Diagram, Use case diagram, Sequence Diagram, etc.
Using this approach keeps your system more maintainable and reusable, and is a common choice nowadays

 

References

  1. System Analysis and Design, Fifth Edition. Author: Shelly Cashman Rosenblatt. Pg20
  2. Object Oriented Modeling and Design with UML, Second Edition. Author: Blaha Rumbaugh

360px-Data_Flow_Diagram_Example

Friday, December 3, 2010

Amazon Elastic Compute Cloud (Amazon EC2)


ShareThis

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.


Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use. AmazonEC2 provides developers the tools to build failure resilient applications and isolate themselves from common failure scenarios.


Windows API Code Pack for Microsoft .NET Framework


ShareThis
Windows API Code Pack for Microsoft .NET Framework 


This provides a source code library that can be used to access some features of Windows 7 and Windows Vista from managed code. These Windows features are not available to developers today in the .NET Framework.

The features of the library includes:

  • Windows 7 Taskbar
    • Jump Lists, Icon Overlay, Progress Bar, Tabbed Thumbnails, and Thumbnail Toolbars
  • Windows Shell
    • Windows 7 Libraries
    • Windows Shell Search API support
    • Explorer Browser Control
    • A hierarchy of Shell Namespace entities
    • Windows Shell property system
    • Drag and Drop for Shell Objects
    • Windows Vista and Windows 7 Common File Dialogs, including custom controls
    • Known Folders and non-file system containers
    • Shell Object Watcher
    • Shell Extensions API support
  • DirectX
    • Direct3D 11.0, Direct3D 10.1/10.0, DXGI 1.0/1.1, Direct2D 1.0, DirectWrite, Windows Imaging Component (WIC) APIs
  • Windows Vista and Windows 7 Task Dialogs
  • Sensor Platform APIs
  • Extended Linguistic Services APIs
  • Power Management APIs
  • Application Restart and Recovery APIs
  • Network List Manager APIs
  • Command Link control and System defined Shell icons
  • Visual Studio 2010 compliance
  • Initial xUnit test coverage
  • String localization
  • Signed assemblies

Requirements:
  • Minimum .NET Framework version required to use this library is 3.5 SP1.
    The APIs for Shell Extensions require .NET 4.
  • This library targets the Windows 7, though many of the features will work on Windows Vista as well.

Building and using the Library:
  • To build the library (except the DirectX related features) in Visual Studio 2008, execute 'Windows API Code Pack Self Extractor.exe' and extract the contents of the ‘Windows API Code Pack 1.1.zip’ file. Build the included ‘WindowsAPICodePack.sln’ file located in the 'WindowsAPICodePack' directory (within the 'source' directory).
  • To build the DirectX features, build the 'DirectX.sln' file inside the DirectX directory. Additional information on using the DirectX features of the Code Pack can be found in the 'DirectXCodePack_Requirements.htm' document available as a separate download.


Some relevant blogs:

Videos:
Two minute videos demonstrating some features are available here:

Download the API code-pack here:


Tuesday, October 5, 2010

The Truth About Value Types in C#


ShareThis

Eric Lippert of Microsoft has written en excellent blog post in which he unveil many doubted truths and let us know many of the facts of C# language and its CLR/ C LI implementation. Every developer must read it.

This post clears one of the common miss-conception of developers: Value types are always allocated on stack.

I am giving an excerpt of of that post.

You can read full post here at his blog:
http://blogs.msdn.com/b/ericlippert/archive/2010/09/30/the-truth-about-value-types.aspx

  1. It is usually stated incorrectly: the statement should be "value types can be stored on the stack", instead of the more common "value types are always stored on the stack".
  2. It is almost always irrelevant. We've worked hard to make a managed environment where the distinctions between different kinds of storage are hidden from the user. Unlike some languages, in which you must know whether a particular storage is on the stack or the heap for correctness reasons.
  3. It is incomplete. What about references? References are neither value types nor instances of reference types, but they are values. They've got to be stored somewhere. Do they go on the stack or the heap? Why does no one ever talk about them? Just because they don't have a type in the C# type system is no reason to ignore them.

The way in the past I've usually pushed back on this myth is to say that the real statement should be "in the Microsoft implementation of C# on the desktop CLR, value types are stored on the stack when the value is a local variable or temporary that is not a closed-over local variable of a lambda or anonymous method, and the method body is not an iterator block, and the jitter chooses to not enregister the value."

The sheer number of weasel words in there is astounding, but they're all necessary:

  • Versions of C# provided by other vendors may choose other allocation strategies for their temporary variables; there is no language requirement that a data structure called "the stack" be used to store locals of value type.
  • We have many versions of the CLI that run on embedded systems, in web browsers, and so on. Some may run on exotic hardware. I have no idea what the memory allocation strategies of those versions of the CLI are. The hardware might not even have the concept of "the stack" for all I know. Or there could be multiple stacks per thread. Or everything could go on the heap.
  • Lambdas and anonymous methods hoist local variables to become heap-allocated fields; those are not on the stack anymore.
  • Iterator blocks in today's implementation of C# on the desktop CLR also hoist locals to become heap-allocated fields. They do not have to! We could have chosen to implement iterator blocks as coroutines running on a fiber with a dedicated stack. In that case, the locals of value type could go on the stack of the fiber.
  • People always seem to forget that there is more to memory management than "the stack" and "the heap". Registers are neither on the stack or the heap, and it is perfectly legal for a value type to go in a register if there is one of the right size. If if is important to know when something goes on the stack, then why isn't it important to know when it goes in a register? Conversely, if the register scheduling algorithm of the jit compiler is unimportant for most users to understand, then why isn't the stack allocation strategy also unimportant?

Having made these points many times in the last few years, I've realized that the fundamental problem is inthe mistaken belief that the type system has anything whatsoever to do with the storage allocation strategy. It is simply false that the choice of whether to use the stack or the heap has anything fundamentally to do with the type of the thing being stored. The truth is: the choice of allocation mechanism has to do only with the known required lifetime of the storage.

Once you look at it that way then everything suddenly starts making much more sense. Let's break it down into some simple declarative sentences.

  • There are three kinds of values: (1) instances of value types, (2) instances of reference types, and (3) references. (Code in C# cannot manipulate instances of reference types directly; it always does so via a reference. In unsafe code, pointer types are treated like value types for the purposes of determining the storage requirements of their values.)
  • There exist "storage locations" which can store values.
  • Every value manipulated by a program is stored in some storage location.
  • Every reference (except the null reference) refers to a storage location.
  • Every storage location has a "lifetime". That is, a period of time in which the storage location's contents are valid.
  • The time between a start of execution of a particular method and the method returning normally or throwing an exception is the "activation period" of that method execution.
  • Code in a method can require the use of a storage location. If the required lifetime of the storage location is longer than the activation period of the current method execution then the storage is said to be "long lived". Otherwise it is "short lived". (Note that when method M calls method N, the use of the storage locations for the parameters passed to N and the value returned by N is required by M.)

Now we come to implementation details. In the Microsoft implementation of C# on the CLR:

  • There are three kinds of storage locations: stack locations, heap locations, and registers.
  • Long-lived storage locations are always heap locations.
  • Short-lived storage locations are always stack locations or registers.
  • There are some situations in which it is difficult for the compiler or runtime to determine whether a particular storage location is short-lived or long-lived. In those cases, the prudent decision is to treat them as long-lived. In particular, the storage locations of instances of reference types are always treated as though they are long-lived, even if they are provably short-lived. Therefore they always go on the heap.

And now things follow very naturally:

  • We see that references and instances of value types are essentially the same thing as far as their storage is concerned; they go on either the stack, in registers, or the heap depending on whether the storage of the value needs to be short-lived or long-lived.
  • It is frequently the case that array elements, fields of reference types, locals in an iterator block and closed-over locals of a lambda or anonymous method must live longer than the activation period of the method that first required the use of their storage. And even in the rare cases where their lifetimes are shorter than that of the activation of the method, it is difficult or impossible to write a compiler that knows that. Therefore we must be conservative: all of these storage locations go on the heap.
  • It is frequently the case that local variables and temporary values can be shown via compile-time analysis to be unused after the activation period ends, and therefore can be treated short-lived, and therefore can go onto the stack or put into registers.

Once you abandon entirely the crazy idea that the type of a value has anything whatsoever to do with thestorage, it becomes much easier to reason about it. Of course, my point above stands: you don't need to reason about it unless you are writing unsafe code or doing some sort of heavy interoperating with unmanaged code. Let the compiler and the runtime manage the lifetime of your storage locations; that's what its good at.

Eric Lippert is a senior software design engineer at Microsoft. He has been working full time in the developer division since 1996, where he has assisted with the design and implementation of VBScript, JScript, JScript .NET, Windows Script Host, Visual Studio Tools for Office and C#.