in

Community Blogs

Blogs of different SQL/Developers Community Members

This Blog

Syndication

DamirDobric

rujan 2010 - Posts

  • Useful Links for BizTalk & AppFabric

    Posted ruj 30 2010, 05:58 by anonymous
    Filed under:
  • Mobility Day 2010

    If you are developer or architect focusing Microsoft technologies, don’t miss the session today at 17.00h in Zagreb.

    image

    Presentation: http://developers.de/media/p/25917.aspx

    Samples which shows all about Navigation on the phone: http://developers.de/media/p/25895.aspx

    -Navigation, UriMapping, Linking to external content, splash changing, Application Life Cycle, Orientation changing, OnLayoutUpdated Event and more.

    Sample which shows an animation on compositor thread at phone: http://developers.de/media/p/25894.aspx
    -Two samples, one Silverlight and one WP7 Silverlight. See how animation on phone can be faster than on desktop.

  • How to get physical device properties on Windows Phone 7

    One Windows Phone application should not exceed the limit defined by Application Certification Requirements. This information and many other physical idevice nformation can be queried by using of DeviceExtendedProperties helper.

    To help you get all information I post here the method which query for all of supported properties:

            private static void physicalInformation()
            {
                string ApplicationCurrentMemoryUsage = DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage").ToString();
                string DeviceName = DeviceExtendedProperties.GetValue("DeviceName").ToString();
                string DeviceManufacturer = DeviceExtendedProperties.GetValue("DeviceManufacturer").ToString();
                string DeviceFirmwareVersion = DeviceExtendedProperties.GetValue("DeviceFirmwareVersion").ToString();
                string DeviceHardwareVersion = DeviceExtendedProperties.GetValue("DeviceHardwareVersion").ToString();
                string DeviceTotalMemory = DeviceExtendedProperties.GetValue("DeviceTotalMemory").ToString();
                //byte[] DeviceUniqueId = DeviceExtendedProperties.GetValue("DeviceUniqueId") as byte[];
            }

    To give you a feeling, my emulator has 372 MB physical memory.

  • Windows Phone 7: Content vs. Resource Build Action

    When working with media files like images or video on Windows Phone Silverlight there are two significant build options: Build Action = Content and Build Action = Resource.
    File setup for build action Content as shown below will not be included in the assembly.

    image

    As you see the image Background.Jpg is not a part of assembly.

    image

    But if you dig into XAP file you you will see that the picture is there. We say embedded as “content”.

    image

    Media content contained in XAP file is usually loaded in application from file stream, means as a file.

    if you set the build action on Resource the image is embedded in the assembly.

    image

    Now take a look into XAP file and you will see that image Background.jpg is no more there:

    image

    When one image is loaded in the application as resource all data are streamed in memory.

    Build-Action Impact on Performance

    Most developers are surprised to hear that performance of one application can be increased if the footprint of application is decreased. There are many reasons for this, which are out of scope in this post. However this statement holds for Windows Phone too. Performance of an application on Windows

    Assuming that we should anyhow achieve small footprint to save the memory one reason is signature verification process.  For verification purposes, application assemblies are signed and then signature is checked every time an application starts up.  The amount of time this operation takes scales directly with the size of assemblies. The final version of Windows Phone 7 will have a cache of these signature checks and so the impact of this will be smaller. But the first time an application launches the verification will be performed. 

    Another reason to use Content-Build action is optimization of the media pipeline on the Windows Phone 7. The WP7 operating system is optimized to use files and network streams, but not in-memory streams.  This means that any media files included as resource will perform worst than medias build as content.  Files build as content content will included in  in the .XAP and NOT in assembly. 

    Note that playback of media files included as a Resource inside a DLL will be first copied to a file on the phone and then played back. 

  • Table Size Usage of AppFabric Monitoring Database

    If you want to get the listed report of all monitoring tables like shown at the picture, please use SQL code shown below:

    clip_image002

     

     

    DECLARE @TableName VARCHAR(100)    

    DECLARE tableCursor CURSOR

    FOR

    select [name]

    from dbo.sysobjects

    where  OBJECTPROPERTY(id, N'IsUserTable') = 1

    FOR READ ONLY

    CREATE TABLE #TempTable

    (

        tableName varchar(100),

        numberofRows varchar(100),

        reservedSize varchar(50),

        dataSize varchar(50),

        indexSize varchar(50),

        unusedSize varchar(50)

    )

    OPEN tableCursor

    FETCH NEXT FROM tableCursor INTO @TableName

    WHILE (@@Fetch_Status >= 0)

    BEGIN

        INSERT  #TempTable

            EXEC sp_spaceused @TableName

        FETCH NEXT FROM tableCursor INTO @TableName

    END

    CLOSE tableCursor

    DEALLOCATE tableCursor

    SELECT *

    FROM #TempTable

    DROP TABLE #TempTable

    GO

  • .NET Developer Group @ Braunschweig

    At Sept.28th 2010 I will give an overview of most important new features of WCF 4.0 and WF 4.0 and AppFabric. The talk will be powered by Developer Group Braunschweig.
    Please feel invited all of you software architects and developers who leverage .NET technologies to build none trivial enterprise application for Windows platform.
    The highly demo powered session (in German!) will take at least two hours of scheduled official part.

    Here is the agenda.

    •Simplified Configuration

    •File-Less Activation

    •Multiple Site Bindings

    •Standard Endpoints

    •Service Discovery

    •Routing Service

    •REST Improvements

    •Workflow Services and AppFabric
    Optional (depending on time)

    If anybody thinks, there would be something important I missed above, please let me know.

    Hope to see you there.

    Damir

    http://www.dotnet-braunschweig.de/

  • The best of WCF 4.0 and WF 4.0 @ Braunschweig

    At Sept.28th 2010 I will give an overview of most important new features of WCF 4.0 and WF 4.0 and AppFabric. The talk will be powered by Developer Group Braunschweig.
    Please feel invited all of you software architects and developers who leverage .NET technologies to build none trivial enterprise application for Windows platform.
    The highly demo powered session (in German!) will take at least two hours of scheduled official part.

    Here is the agenda.

    •Simplified Configuration

    •File-Less Activation

    •Multiple Site Bindings

    •Standard Endpoints

    •Service Discovery

    •Routing Service

    •REST Improvements

    •Workflow Services and AppFabric
    Optional (depending on time)

     

    If anybody thinks, there would be something important I missed above, please let me know.

    Hope to see you there.

    Damir

    http://www.dotnet-braunschweig.de/

  • Silverlight Deployment Guide

    Everybody who build Silverlight Applications for enterprises has at the end (at least) a problem to distribute Silverlight package to client machines. Because there many Admins and IT-Departments out there who for some reason do not like/want to deploy Silverlight, this document can be very helpful.
    If you are on of admins who needs to deploy Silverlight but do not want or can for some reason, please read this guide.

    This Deployment Guide documents the options and processes involved in deploying Silverlight to user's computers that are running Windows® 2000 with Service Pack 4, Microsoft® Windows XP with Service Pack 2 (SP2), Windows Server® 2003, Windows Server 2008, Windows Vista® or later Microsoft Windows operating systems in a network environment. Silverlight also installs on Apple Mac OS X (install files created by Microsoft) and on Linux (via Novell’s Moonlight product), but these deployments are outside of the scope of this document.

    Download here.

  • How to enable service discovery in IIS?

    WCF 4.0 introduces Service Discovery, which I described here. I is interesting that all samples about this feature implements a service in a console application. As you know, service channels in such kind of application are activated explicitly by calling of Host.Open() method. As you also know service channel of the service hosted in IIS is activated when the first message arrives.

    This almost unimportant fact might be in some scenarios show stopper. Examples of such scenarios are hosting of relay bindings of .NET Service Bus in IIS and activating of discovery endpoint. Why?

    Discovery Feature is used to discover the service for some consumer. This feature is activated when udpDiscoveryEndpoint is activated and that happens when the channel is activated. In IIS context that means, when first message arrives. If consumer of service does not know how to reach the service it cannot send the message. Because no message has arrived, discovery does not work and consumer cannot use discovery client :)

    Not bad!?

    To make it working enable service auto start in Windows Server AppFabric.

    image

    The same can be achieved with following configuration entry:

    <configuration>

       . . .
      
    <
    microsoft.applicationServer>
            <hosting>
                <serviceAutoStart>
                    <add relativeVirtualPath="SampleService.svc" />
                </serviceAutoStart>
            </hosting>
        </microsoft.applicationServer>
    . . .
    </configuration>

    Posted ruj 09 2010, 12:18 by anonymous
    Filed under:
  • Windows Server AppFabric Customer Advisory Site

    MSDN launched recently a new blog as part of putting some of best people in the Microsoft application middleware space under a common “virtual” roof which we proudly call Windows Server AppFabric Customer Advisory Team or AppFabric CAT for short.

    The new team blog is Microsoft’s commitment to deliver the most wanted technical guidance and share best practices with the rest of the world-wide community. This blog is  a brand-new web site that will serve the purpose of the “one-stop shop” for all the great deliverables that the team will be producing for the community going forward.

    I you follow my blog all my posts tagged with AppFabric will be aggregated there.

    http://blogs.msdn.com/b/appfabriccat/

  • Windows Phone URI-mapping

    Windows Phone provides an UriMapper object. That object defines a mapping that will be used through the entire application for all navigation process. URI mapping are used to “hide” real navigation structure and provide query string parameters to the pages.

    Following picture shows a sample mapping process. When user press “P2/123” it will be navigated to relative address “/P2/123” which is a fake address. That fake address is mapped by “/P2/{number}” to “/Page2.xaml?id={number}”.

    image

    When you are in the page use NavigationContext to get query arguments.

  • SIlverlight Animation Rendering

    Some developers know and some do not know that Silverlight has by default one Main thread. Depending on you application many other threads can be span. But there is always only one main thread which is responsible to render the UI objects on the page. This thread is called UI-thread and similar even the same thread model can be found in any UI platform.
    So, in typical scenario which includes invoking of a Web Service operation there is UI thread and a web service operation invoking thread. This ensures that UI elements like animations (storyboards) are smoothly rendered while other threads in the application are doing their job. 

    All this sound trivial, but there are some hidden details here which could be very, very useful and interesting for every developer.

    After the service operation returns, the result is dispatched on the UI-thread. Fortunately you need to evaluate this result and perform some bindings to update the UI. This moment of time is exactly the critical one. When binding process starts everything you do in converters and everything Silverlight controls are doing is done on UI-thread.
    Imagine now, you have some animation running at the moment when binding starts. If the binding implements some heavy calculations the animation will, you probably assume, not run smooth as expected.

    Here is one example:

    image

    The picture above shows application which has running a storyboard and binds some data to the list by using of one converter.

    public class MyConverter : IValueConverter
    {

            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
           {
                if (MainPage.IsSlowModeEnabled)
                {
                    double res = 12.334;
                    for (int n = 0; n < 3000000; n++)
                    {
                        res*= res;
                    }
                }

                return value;
            }
    }

    The converter does nothing if IsSlowModeEnabled set on false, what is by default. When the user press a button this variable is set on true and binding start a heavy calculation. If you compare how smooth the animation works in this two cases, you will notice that animation stops totally while converter is running.

    Today, industry applications looks in average very bad and almost nobody think bout this issue. But, soon applications will look better, for sure. One could ask question now: If such rendering is that bad on a desktop, what can we expect on platforms like Windows Phone?
    Windows Phone has by default two threads: Main (UI) thread and Renderer. Renderer thread cannot be seen in debugger and it is in play when some animation (storyboard) is running.

    That means (simplified), as long your binding is running in UI-thread in even heavy converter, all active animations will be rendered in Renderer-thread.

    image

    This Silverlight feature is on Windows Phone different than in the Silverlight desktop version. It is build on top of Direct X 10 and WDDM 1.1. Note that this feature will not work in emulator on WDDM 1.0 and lower. In this case animation will be rendered just as in desktop Silverlight on UI-thread.

Copyright of SQL/Developers Community
Powered by Community Server (Commercial Edition), by Telligent Systems