Sunday, December 12, 2010

Windows Phone 7 Series multitasking: the real deal

Windows Phone 7 Series multitasking: the real deal

 

 

 We've definitely learned a ton about Windows Phone 7 Series here at MIX, but getting the full picture on multitasking has been difficult, since the OS isn't ready, no one has final hardware, and the emulator seems to behave differently than actual devices and Microsoft's descriptions. So let's set the record straight on multitasking: it's not going to happen, at least not in the traditional way. Not only have we directly confirmed this with Microsoft executives several times, but the developer sessions here are totally clear on the matter -- you don't tell 1000+ devs that they should expect their apps to be killed whenever the user switches away from them if you don't mean it. Now, that's not to say that the OS can't do multitasking: first-party apps like the Zune player and IE can run in the background, and third-party apps are actually left running in a suspended state (Microsoft calls it "dehydrated") as long as the system doesn't need any additional resources. If the user cycles back to an app, it's resumed ("rehydrated") and life continues merrily along, but if the user opens other apps and the system needs additional resources, the app is killed without any indication or remorse.

If that sounds familiar, it's because it's basically a single-tasking riff on Android and Windows Mobile 6, both of which also purport to intelligently manage multiple running applications like this, and both of which usually find themselves greatly improved with manual task managers. We'll have to see if Windows Phone 7 Series can do a better job once it ships -- we have a feeling it will -- and later down the line we'll see if Microsoft decides to extend multitasking to third-party apps. But for now, just know that you're not going to be running Pandora in the background while you do other tasks on a 7 Series device -- it is a question we have specifically asked, and the answer, unfortunately, is no.

reference: http://www.engadget.com/2010/03/17/windows-phone-7-series-multitasking-the-real-deal/

Monday, November 22, 2010

Partitioning Operators

Partitioning Operators
As mentioned the partitioning operators enable paging operations and Take(n) emulates T - SQL ’ s TOP(n) operator.
Here ’ s generic code to return a specific page of a given size:
C# 3.0
int pageSize
int pageNum
(from s in dataSource select s).Skip((pageNum -1) * pageSize)
.Take(pageSize)
VB 9.0
Dim PageSize As Integer
Dim PageNum As Integer
From s In DataSource
Select s
Skip (PageNum -1) * PageSize)
Take PageSize
The TakeWhile and SkipWhile operators have the index overload, which enables the use of the index
value in your paging or positioning logic; the Take and Skip operators aren ’ t overloaded.
Take
Take returns from the source sequence the number of contiguous elements specified by count .
C# 3.0
public static IEnumerable < TSource > Take < TSource > (
IEnumerable < TSource > source,
int count
)
VB 9.0
Public Shared Function Take(Of TSource) ( _
source As IEnumerable(Of TSource), _
count As Integer _
) As IEnumerable(Of TSource)
Skip
In LINQ for Objects, Skip bypasses in the source enumeration the number of elements specified by
count and returns the remaining source elements, if any.
C# 3.0
public static IEnumerable < TSource > Skip < TSource > (
IEnumerable < TSource > source,
int count
)
VB 9.0
Public Shared Function Skip(Of TSource) ( _
source As IEnumerable(Of TSource), _
count As Integer _
) As IEnumerable(Of TSource)
To minimize the number of rows returned from the database server, LINQ to SQL ’ s Skip implementation
behaves differently. Chapter 5 ’ s “ Paging in LINQ to SQL ” and “ Paging with the LINQDataSource
Control ” sections describe the T - SQL statements sent by Take and Skip to SQL Server 200x.

Sunday, October 31, 2010

yield keyword : Lazy and Eager Evaluation

The most important element of the Where extension method code is the yield return item
instruction that the iterator executes if item meets the Where criterion ( predicate expression). C# 2.0
introduced the yield contextual keyword but few developers used it. The compiler recognizes yield as
a keyword only if it ’ s followed by return or break . The yield return item instruction in an iterator
block enables an enumerable class to be implemented in terms of another enumerable class; that is,
chained.

Lazy and Eager Evaluation
The yield return item instruction enables lazy evaluation , which is another feature critical to LINQ.
Lazy evaluation means that a LINQ code doesn ’ t touch the query ’ s data source until the code executes
the iterator ’ s first yield return item instruction. Lazy evaluation makes execution of chained
extension methods very efficient by eliminating storage of intermediate results. Lazy evaluation is the
key to object/relational mapping (O/RM) tools ’ lazy loading of objects related to your main object by
associations. Lazy loading means that the O/RM tool doesn ’ t load related objects until the application
needs to access their property values.
Eager evaluation means that the query is self - executing. For example, chaining an aggregate function to
the end of a query causes immediate evaluation. The following snippets demonstrate eager evaluation
with the Count() expression method in query expression and method call syntax:
C# 3.0
var noStockCount1 = (from p in productList
where p.UnitsInStock == 0
select p).Count();
result = “\r\nCount of out-of-stock items = “ + noStockCount1.ToString();
var noStockCount2 = productList
.Where(p = > p.UnitsInStock == 0)
.Count();
result = “\r\nCount of out-of-stock items = “ + noStockCount2.ToString();

Sunday, October 24, 2010

The ADO . NET Entity Framework and Entity Data Model

The ADO . NET Entity Framework and
Entity Data Model
Microsoft ’ s ADO.NET team began designing the Entity Framework (EF) and Entity Data Model (EDM)
near the date in 2003 when the C# 3.0 design group decided to develop a LINQ to SQL extension as a
“ stand - in ” for the abandoned ObjectSpaces O/RM tool project. The two projects progressed in parallel,
apparently with little or no communication between the two groups. In early 2006, the ADO.NET team
gained ownership of the LINQ to SQL and LINQ to DataSet implementations and added LINQ to
Entities as an optional method for executing queries over the EDM. The ADO.NET group presented
several sessions at Tech * Ed 2006 and published a series of whitepapers about EF and EDM in June 2006.
The “ Next - Generation Data Access: Making the Conceptual Level Real ” technical article by Jos é Blakeley,
David Campbell, Jim Gray, S. Muralidhar, and Anil Nori, proposed to extend the EDM from basic CRUD
operations to reporting and analysis services (business information) and data replication.
You can read the preceding technical paper at http://msdn2.microsoft.com/en - us/
architecture/aa730866(vs.80).aspx and its companions, “ The ADO.NET Entity Framework
Overview ” at http://msdn2.microsoft.com/en - us/architecture/aa697427(VS.80)
.aspx and “ ADO.NET Tech Preview: Entity Data Model ” at http://msdn2.microsoft.com/
en - us/architecture/aa697428(VS.80).aspx .
EF is a much more than an O/RM tool. EF provides a complete set of data services including:
Query services
ClientView services
Persistence services
Object services
EF is the first concrete implementation of the EDM and enables developers to abstract the physical
storage schema of relational databases to a conceptual schema (also called a conceptual layer or conceptual
model) that conforms to the entity - relationship (E - R) data model. Dr. Peter Chen proposed the E - R data
model in a 1976 paper, “ The Entity - Relationship Model — Toward a Unified View of Data, ” which you
can read at http://bit.csc.lsu.edu/
˜
chen/pdf/erd.pdf . E - R became a mainstay of data
modeling for relational databases and the foundation for many computer - aided software engineering
(CASE) tools.
The E - R model is independent of the underlying relational database management system (RDBMs) or
data retrieval and update language, syntax or dialect, but an SQL flavor is assumed. Microsoft says that
EF “ is an execution runtime for the for the E - R model ” that ’ s RDBMS - agnostic. As you would expect,
SQL Server 200x and SQL Server Compact Edition (SSCE) have SqlClient - derived EntityClient
data providers for EF v1.0. When this book was written, IBM DB2, IS, and U2, as well as Oracle,
MySQL, and SQLite supported EF with custom EntityClient data providers for .NET. The
EntityClient object provides EntityConnection , EntityCommand , EntityParameter and
EntityDataReader objects. EntityClient has its own query language, Entity SQL (eSQL), which is
related to SQL but has entity - specific extensions. eSQL v1 has no data management language (DML)
constructs for INSERT , UPDATE or DELETE operations. Microsoft promises to implement entity -
compatible DML in a future version.
An EDM EntityType specifies an object in the application domain that is represented by data. An
EntityObject is an instance of an EntityType , has one or more Properties , and is uniquely
identified by an EntityKey . Properties can be of SimpleType , ComplexType or RowType . An
EntitySet contains multiple EntityObject instances, an EntityContainer holds multiple
EntitySet s, and corresponds to the database (such as Northwind) at the physical data store layer and
schema (such as dbo) at the conceptual level. A RelationshipType defines the relationship of two or
more EntityType s as an Association , which is a peer - to - peer relationship or Containment , that
specifies a parent - child relationship. The top - level EDM object is a Schema , which represents the entire
database.
Following are some of the most important benefits of implementing EDM in data - intensive .NET
projects:
Generates a data access layer that isolates the data domain from the application domain
Handles relational database vendor or schema changes without the need to alter C# or VB
source code and recompile the project
Enables the business logic layer to work with real - world business entities, such as customers,
orders, employees, and products, rather than rows and tables of relational databases
Supports complex properties, such as PhysicalAddress, which might include Street1, Street2,
City, State, ZipCode, Country and Coordinates, and PostalAddress, which might include only
PostOfficeBox, City, State, PostalCode and Country.
Models object - oriented concepts such as inheritance and hierarchical (nested) or polymorphic
resultsets, which don ’ t fit the relational model
Exposes relationship navigation properties to eliminate the need for complex joins between
related tables
Provides an advanced, graphical EDM Designer to simplify inheritance and hierarchy models
and enable incremental changes to mapping files
Maps the conceptual layer ’ s entity model to an object model in the Object Services layer with an
ObjectContext for identity management and change tracking
Enables simple, strongly typed queries with Object Services ’ LINQ to Entities implementation
It ’ s important to bear in mind that EF isn ’ t a traditional O/RM tool and using the Object Services layer
and LINQ to Entities is optional. Mapping to objects occurs at the conceptual layer, so the term object/
entity mapping tool might represent a more accurate description. Where performance is critical, such as
with reporting and analysis services, you can opt to write eSQL queries and return conventional,
untyped DataReaders based on the conceptual layer ’ s schema.

Thursday, October 14, 2010

Pocket PC Windows Mobile English Persian Dictionary Download

Pocket PC Windows Mobile English Persian Dictionary Download

دیکشنری انگلیسی به فارسی ویندوز موبایل پاکت پی سی دانلود

راهنمای نصب :
ابتدا  پکیج دات نت کامپکت فریم ورک سه و نیم را روی گوشی خود نصب کنید
آدرس محل دانلود
سپس فولدر برنامه دیکشنری موج سوم را روی گوشی خود کپی و فایل اجرایی دیکشنری موج سوم را اجرا نمایید

برای اطلاعات بیشتر با
m.s.rezaaei@gmail.com
مکاتبه بفرمایید

نظرات خود را با ما در مورد بهبود و دیباگ سیستم در میان بگذارید
تقدیم به همه ایرانیان


HTC HD2 Diamond Diamond 2 Samsung i Mate HP ...
DOWNLOAD
http://www.4shared.com/file/2eP5dU7A/MojeSevomDic3.html
http://www.sadatrezaei.com/MojeSevomDic2.rar

Wednesday, October 13, 2010

Extension Methods

" Software Engineers never die… They just go Offline ….  "

Extension Methods
Extension methods let you add custom methods to previously defined types, even if those types are
sealed in C# or NotInheritable in VB. For example, the string / String class is sealed and has 45
predefined instance methods, which you access by dot ( . ) syntax, as in strTest.Length() or “ This
is a test ” .Length() . The compiler treats these statements as if they were members of a function
library: Length(strTest) or Length( “ This is a test ” ) .
The Length method throws an exception if the class value is null or Nothing , so a LengthNullable()
method that returns an int? , Integer? , or Nullable(Of Integer) type eliminates the need to check
for null or Nothing before invoking the Length method. Here ’ s the C# 3.0 code for the
LengthNullable method:
C# 3.0
static class ExtensionMethods
{
public static Int32? LengthNullable(this string test)
{
if (test != null)
{
return test.Length;
}
else
{
return null;
}
}
}
Sample code for the C# 3.0 ExtensionMethods class is located in the ExtensionMethods.cs
class file.

According to VS 2008 ’ s online help ’ s “ extension methods [Visual Basic] ” topic, you can apply extension
methods to any of the following types:
Classes (reference types)
Structures (value types)
Interfaces
Delegates
ByRef and ByVal arguments
Generic method parameters
Arrays
C# 3.0 extension methods must be defined by a public static method within a public static or
internal static class. Prefixing the method ’ s first argument with the this keyword (highlighted in
the code) informs the compiler that the function is an extension method. The second argument is the
type to which the method applies, string for this example, and the third is the instance name, test .
Extension methods support full statement completion and IntelliSense features.
A downward - pointing arrow added to the IntelliSense list ’ s method icon identifies extension methods.
Following are a few C# test methods to verify that the new extension method behaves as expected:
C# 3.0
// Import the namespace if method is in another project
using CS3Extensions.ExtensionMethods;
// Extension method tests
string nada = null;
string test = “This is a test”;
int? len0 = nada.LengthNullable();
int? len1 = test.LengthNullable();
int? len2 = “This is a test”.LengthNullable();
You can create VB 9.0 extension methods in modules only, and you must add an Imports System
.Runtime.CompilerServices directive to support the < Extension() > attribute. This attribute is
necessary to instruct the compiler that the function is an extension method. VB functions declared within
modules are static, so the Shared keyword isn ’ t required. The argument ’ s type declaration specifies the
class to which the extension method applies.
VB 9.0
Imports System.Runtime.CompilerServices
Public Module ExtensionMethods
‘ VB extension methods can only be declared within modules
< Extension() > _
Public Function LengthNullable(ByVal Test As String) As Integer?
If Test Is Nothing Then
Return Nothing
Else
Return Test.Length
End If
End Function
End Module
Sample code for the VB 9.0 ExtensionMethods module is located in the ExtensionMethods.vb
module file.
As with the C# version, you must import the VB module ’ s namespace to bring the extension method
within the application ’ s scope, if the module isn ’ t in the same project. The VB test code is quite similar to that for the C# version.

Wednesday, October 6, 2010

C# and VB Extensions to Support LINQ

C# and VB Extensions to Support LINQ
LINQ is responsible for most new language extensions in VS 2008. Here ’ s a list of the LINQ - related
extensions to C# 3.0 and VB 9.0 with brief descriptions of their purpose:
Implicitly typed local variables infer the type of local variables from the expressions used to
initialize them.
Object initializers simplify the construction and initialization of objects of arbitrary types.
Array initializers extend object initializers to elements of arrays of arbitrary types. VB 9.0
doesn ’ t support array initializers.
Collection initializers (also called implicitly typed array initializers) extend the array initializer
style to infer the element type of the collection from the initializer. VB 9.0 doesn ’ t support
collection initializers.
Anonymous types enable creating tuple types with object initializers whose CLR type is
inferred by the compiler. C# anonymous types are immutable, but some VB anonymous types
are mutable.
Extension methods enable extending existing and constructed types with new methods.
Lambda expressions enable C# 2.0 ’ s anonymous methods to deliver better type inference and
allow conversions to expression trees and delegate types. VB 9.0 supports Lambda expressions
but doesn ’ t expose anonymous methods to programmers.
Standard Query Operators (SQOs. Also called Standard Sequence Operators ) filter, transform,
join, group, and aggregate collections of CLR types.
Query expressions group SQOs into a high - level query language that is similar to SQL and
related to XQuery.
Expression trees permit lambda expressions to be represented as data (expression trees) instead
of as code (delegates).
IQueryable < T > and IOrderedQueryable < T > interfaces, in conjunction with expression trees,
facilitate third - party LINQ implementations for other data domains and enable the compiling
of queries for improved performance. IQueryable < T > and IOrderedQueryable < T > types
enable composable queries by passing them as the data source of one or more additional
LINQ queries.LINQ also relies on these language features of C# 2.0 and VB 8.0:
Generic types let you specify the precise data type that a method, class, structure, or interface
acts upon. The primary benefits of generics are type safety and increased code reusability.
Anonymous methods (also called anonymous delegates) let you define a nameless method
that ’ s called by a delegate and access variables that would normally be out of scope. VB doesn ’ t
support anonymous methods directly.
Iterators , specifically the generic, type - safe IEnumerable < T > interface, in the System
.Collections.Generic namespace, which supports iterating over a generic collection in a
foreach or For Each ... Next loop.
Programs that don ’ t execute LINQ queries can take advantage of most new VS 2008 features. LINQ will
introduce the more abstract functional constructs, such as lambda expressions and expression trees, to
most .NET developers.