June 2008 - Posts

Printouts of the slides, presented on Silverlight 2.0 open house today

Thank you all, who participated today in Silverlight 2.0 for building Rich Internet Applications event. I uploaded printouts of the slides, presented during the session here. So, you can download it for reference.

I’m really interesting within your feedback (leave comments) in order for me to be able to enhance it for future events.

Also, I want to remind you, that due to lack of space we were unable to handle all those who want to attend, thus we decided to make another session within two weeks, so can register here. Remember, only registered attendees, who with confirmation received will allow to enter. So, hurry up.

If you want to learn more about Silverlight, you can register to attend Expert Days “Mastering Microsoft Silverlight 2.0 – 020 full day course, 13-August, were we’ll have Silverlight 2.0 deep dive training day. You can also review another two courses, I’ll have there:

Download slides from today session >>

Register to attend next event at 23 July >>

image

Thank you and leave a comment…

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Silverlight 2.0 for building Rich Internet Applications (Local Event) – Take 2

As promised earlier, the next session of Silverlight 2.0 for building Rich Internet Applications will take place at 23 July, 8:30 AM-12:30 PM in ILDC. This is exactly the same session for those, who unable to attend tomorrow due to lack of place.

Please, this time, try to register as soon as possible to assure seat assignment.

Register to attend Silverlight 2.0 for building RIA >>

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Please do not ask me. We cannot handle more…

Monday next week, I’ll making half day session about building rich internet applications with Silverlight 2.0 in ILDC. The registration is over a while ago, but during this week, I got very large amount of email, IMs and phones calls with appeal to attend.

Sorry, we’re fully booked (currently about twice of available seats) and cannot handle any more. Only those who registered and got confirmations will allow to enter. It is for your own convenience!

I promise, that within next two weeks I’ll make the same session again for all those, who want to come, but unable to register and attend (after a small arrangement, I’ll publish here next date).

Thank you again for understanding and see you soon.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
How to consume WCF or Webservice from Vista Sidebar gadget by using Silverlight?

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/how-to-consume-wcf-or-webservice-from-vista-sidebar-gadget-by-using-silverlight/]


The challenge today is really simple. All we have to do is to write Silverlight Vista Sidebar Gadget, that consumes either WCF, ASMX or REST based service. Really simple, isn’t it? Let’s start

image

Build server side services

We should start from services. This is very straight forward mission. Here the logic I want to implement

public string Echo(string input)
    {
        return string.Format("ACK from {0}", input);
    }

Well, WCF? We should mark service and operation contracts. That’s all

[ServiceContract(Namespace = "")]
public class EchoService
{
    [OperationContract]
    public string Echo(string input)
    {
        return string.Format("ACK from WCF with {0}", input);
    }

}

This does not works. Why? Silverlight knows only consumes ASP.NET compatible (simplified) web services, thus we should add following attribute to the our class attributes collection

[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class EchoService
{

Now, the service is discoverable and accessible by Silverlight. Great news. Now let’s put it into our shared host. Hmm, we got strange error: “Deploying WCF Services: This collection already contains an address with scheme http.” What the hell is it?

This is shared hosting problem. Your host provider uses virtual IP and host addresses and has number of different web services, sitting on the same shared host. How to solve it?

Simple, all you have to do is to specify your own service host factory. Here the example of classes to put into code behind

class SLHostFactory : ServiceHostFactory
{
    protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
    {
        SLHost customServiceHost =
          new SLHost(serviceType, new Uri("[Your URL goes here]",UriKind.Absolute));
        return customServiceHost;
    }
}

class SLHost : ServiceHost
{
    public SLHost(Type serviceType, params Uri[] baseAddresses)
        : base(serviceType, baseAddresses)
    { }
    protected override void ApplyConfiguration()
    {
        base.ApplyConfiguration();
    }
}

And one attribute into your service tag

Factory="SLHostFactory"

Now it works. So what’s next? Build ASMX web service. This is even simpler

[WebMethod]
public string Echo(string input)
{
    return string.Format("ACK from web service with {0}", input);
}

We done, now either WCF and Web services are accessible from your Silverlight application. So, add Service reference and consume it

Building client side

Inside code behind of your Silverlight project, you should define two proxies – one for Web Service and another for WCF service. Bother services implements the same interface, so it should not be a problem

ServerEcho.EchoServiceClient proxy;
WebServiceEcho.EchoWebServiceSoapClient wsProxy;
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
    proxy = new ServerEcho.EchoServiceClient();
    proxy.EchoCompleted += new EventHandler<ServerEcho.EchoCompletedEventArgs>(proxy_EchoCompleted);

    wsProxy = new SLGadget.WebServiceEcho.EchoWebServiceSoapClient();
    wsProxy.EchoCompleted += new EventHandler<SLGadget.WebServiceEcho.EchoCompletedEventArgs>(wsProxy_EchoCompleted);
}

Silverlight work only asynchronously, thus you should begin to understand, that synchronous programming is for pussies :). Consume it

private void WCF_Click(object sender, RoutedEventArgs e)
        {
            proxy.EchoAsync(txt.Text);
        }

        private void WS_Click(object sender, RoutedEventArgs e)
        {
            wsProxy.EchoAsync(txt.Text);
        }

And Update output

void wsProxy_EchoCompleted(object sender, SLGadget.WebServiceEcho.EchoCompletedEventArgs e)
        {
            txt.Text = e.Error == null ? e.Result : (e.Error.InnerException != null ? e.Error.InnerException.ToString() : e.Error.Message);
        }

        void proxy_EchoCompleted(object sender, ServerEcho.EchoCompletedEventArgs e)
        {
            txt.Text = e.Error == null ? e.Result : (e.Error.InnerException != null ? e.Error.InnerException.ToString() : e.Error.Message);
        }

Now let’s run it. What? Another error? Security? Access denied? Of cause you have no crossdomain.xml.

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
   <allow-access-from domain="*" />
</cross-domain-policy>

What? You have it and still getting the same error? Look into sniffer. You application is looking for other file, named clientaccesspolicy.xml. Why? According the documentation, you can use either… Hm, another bug with WCF consuming. Never mind, let’s put it too

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

Very well, now we are ready to run our application. It works! So, the only thing we should do is to pack it into MyGadget.gadget directory and put inside %userprofile%\appdata\local\microsoft\windows sidebar\gadgets together with gadget.xml manifest.

But… It stopped working… What’s the problem?

Very client side networking in Silverlight

The problem is, that SideBar executes it’s gadgets with local path, not with network path. Silverlight cannot use any network provider, when running locally. Why? Actually I do not know (maybe to prevent local applications development). so what to do?

Simple! Microsoft SideBar knows to run cross domain AJAX without any warnings and problems. So why not to use external XmlHttp from JavaScript for network access. Let’s do it

First we should initialize XMLHttpRequest object in JavaSctipt

var xObj;
        function getEchoWCF(text) {
            if(xObj == null) {   
                xObj = new XMLHttpRequest();
                }
            else if(xObj) {
                xObj.abort();
            }

Then create SOAP request to WCF or WebService

var sURL = "[Path yo your service]";
            //Build SOAP
            var sReq = "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><Echo><input>"+text+"</input></Echo></s:Body></s:Envelope>";
            xObj.open("POST", sURL, true);
            xObj.setRequestHeader( "Content-Type", "text/xml; charset=utf-8" );
            xObj.setRequestHeader( "Cache-Control", "no-cache" );

xObj.send(sReq);

After the request created and send we should handle result. So we need an access from HTML page, hosting Silverlight object to Silverlight. Simple. “ScriptableMember - ScriptableType”, remember?

[ScriptableType]
    public partial class Page : UserControl
    {

[ScriptableMember]
        public void UpdateResponse(string result)
        {

Now return the result

xObj.onreadystatechange = function() {
            if (xObj.readyState === 4) {
                if (xObj.status && xObj.status === 200) {   
                    var control = document.getElementById("silverlightControl");
                    control.Content.Page.UpdateResponse(xObj.responseText);
                }
            }

But this is not enough. We also should know to call Javascript from Silverlight… This is really simple

private void JS_Click(object sender, RoutedEventArgs e)
        {
            HtmlPage.Window.Invoke("getEchoWCF", txt.Text);
        }

We done. Now you can pack your Silverlight control, together with hosting HTML and Javascript into windows sidebar gadget and use it even with external network support.

Have a good day and be nice people.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Mastering Images in WPF

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/mastering-images-in-wpf/]


If you are “in” WPF imaging, you, definitely, should read this post of Dwayne Need (who is SDM of WPF in Microsoft) about customizing BitmapSource. A ton of information about how to make Bitmap Source for your needs, what WIC is and how to use it. Also he has a lot of samples in CodePlex. Great work, Dwayne.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Quick Silverlight tip: How to set format and validate value in TextBox?

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/quick-silverlight-tip-how-to-set-format-and-validate-value-in-textbox/]


Today morning I got an email from one of Microsofties, asking following question:

Is there any way to set format and validation on TextBox in Silverlight 2. TextBox format: Date Format, Currency Format etc, TextBox validation: Regular date expression, should allow only numeric etc. If it’s possible out-of-box how do I do it?

The answer is, that there is no data validation or formatting in Silverlight, however it’s very simple to build converter to format binded value. Here the code of the converter:

public class TextFormatConverter:IValueConverter
   {

       #region IValueConverter Members

       public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
       {
           return Format(value, parameter);
       }
       public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
       {
           return Format(value, parameter);
       }

       object Format(object value, object param)
       {
           if (value == null)
               return value;
           int ri;
           double rd;
           if (int.TryParse(value.ToString(), out ri))
           {
               return string.Format(param.ToString(), ri);
           }
           else if (double.TryParse(value.ToString(), out rd))
           {
               return string.Format(param.ToString(), rd);
           }
           else
           {
               return string.Format(param.ToString(), value);
           }
       }

       #endregion
   }

Here the usage:

<TextBox Text="{Binding String, Source={StaticResource data}, Mode=TwoWay, Converter={StaticResource formatConverter}, ConverterParameter='{0:0.00}'}" />

Regarding validators – There is no ValidationRule or IDataErrorInfo in Silverlight right now. If you want to have it, you’ll need to write your own custom TextBox with validation. But, I’ll speak next time about it. ValidatingTextBox with format support will be a part of Silverlight controls library when I’ll have a time for it.

Have a nice day and be good people.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Posted 19 June 2008 03:07 PM by tamirk
Filed under: , , ,
The truth about HTC has been revealed!

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/the-truth-about-htc-has-been-revealed/]


HTC is underground factory, that manufacturing cat eater cyborgs (Cats? Why Cats? Don’t you know, what PDA is? It’s Pussy Defended Asset. Other words male mouser). Especially, those cyborgs eat cats is disguise of Mobile Phones.

Cat-eater

Where HTC located?

HTC located on the moon. Not in China. The facility is in one of moon craters inside the old spacecraft, abandoned by HAL from a space odyssey. Once a year, this moonbus rides to the Earth with new cyborgs production on board.

HTC production

At glance, the production of HTC looks like a regular mobile phones, however it has no phone capabilities. Therefore, once it leaves moonbus it eats fist mobile phone found. Momentarily after, cyborg’s internal infrastructure adopts the consumed cat and starts to operate as long as life endures, producing the illusion, that the cyborg is regular mobile phone.

However, the main mission of HTC production is to eat cats. It do the offense nightly, when the owner sleeps. It comes out and every time, seeing a cat, exclaims: “Hey, That’s Cat!”, then swallows the victim. Once the cyborg loaded up, it return to the owner.

The other ability of HTC production is zombying of its owners. It washes their brains and commands them to think, that cyborgs are the best mobile phone ever. All other phones are missing of features and very user unfriendly. Because of it, most of mobile phone owners forgot how to use regular mobile phones.

Cyborg detection

In spite of good camouflage, it’s possible to detect cyborgs:

  • Occasional pressing of phone screen does nothing for regular mobile phones, however cyborgs very sensitive to this action
  • Upper cover of the cyborg consists of strange rectangle thing. It’s the antenna, used by the cyborg for zombying owners.
  • One of following words might appear in cyborg’s front or back panel: i-mate,t-mobile,eten,asus,htc,orange,AT&T
  • Sustained use of cyborgs causes headache or migraine.

The cyborgs are extremely dangerous for cat population of the Earth, thus every time, you detect the cyborg, please, report to WWF, Heath Officer or FBI.

Thank you for cooperation.

[illustration by DaKraken, inspired by absurdopedia]

x-posted from http://blogs.microsoft.co.il/blogs/tamir
HLSL (Pixel shader) effects tutorial

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/hlsl-pixel-shader-effects-tutorial/]


Recently, I already wrote about PixelShader effects, introduced in .NET framework 3.5 SP1 (WPF). However it looks like for most people this syntax is still hard to understand. Today we’ll try to lean it more. In order to do this, I wrote small program, that helps you to write and debug pixel shader effects quickly. This how it looks like

image

Hit Open to load image, Write your code and hit Execute to compile and apply bitmap dx effect to the image. Let’s start from very beginning. Effect, that does nothing:

sampler2D input : register(s0);
float4 main(float2 uv : TEXCOORD) : COLOR
{
    float4 Color;
    Color = tex2D( input , uv.xy);
    return Color;
}

This is the results:

image

What was done? We got pixel. Read it color and return it as it to the shader. Let’s do something more interesting.

Actually we can get float2 as coordinate, this means, that it can be spitted to uv.x and uv.y. Also color is float4 (argb), thus we can change color. Let’s multiply color by 3

Color = tex2D( input , uv.xy)*3;

And the result is bright image

image

We also can make operations with variables.

Color = tex2D( input , uv.xy)*uv.x;

Result

image

We not have to change whole color. We can also change only its part. Blue for example

Color = tex2D( input , uv.xy);
Color.b = Color.b*2;

Result

image

Or execute math operations

Color = tex2D( input , uv.xy);
Color.r = Color.r*sin(uv.x*100)*2;
Color.g = Color.g*cos(uv.x*150)*2;
Color.b = Color.b*sin(uv.x*50)*2;

Result

image

Color is not only thing we can operate. Actually we’re sampling coordinates, so operations done with coordinates should work. Let’s try to stretch image

uv.x = uv.x * 0.5;
Color = tex2D( input , uv.xy);

Result

image

Why 0.5? Should not it make it smaller? Actually not, you’re multiplying coordinates, so to make the image smaller, you should divide

uv.x = uv.x / 0.5;
Color = tex2D( input , uv.xy);

Result

image

Some math could be fun here also

uv.y = uv.y  + (sin(uv.y*100)*0.03);
Color = tex2D( input , uv.xy);

Result

image

There are a ton of interesting effects you can do by using pixel shaders. Here for example color shift

   Color = tex2D( input , uv);
Color.r -= tex2D( input , uv +(somevar/100)).r;
Color.g += tex2D( input , uv+ (somevar/200)).g;
Color.b -= tex2D( input , uv+ (somevar/300)).b;

Result:

image

Or, even cooler efects

Color -= tex2D(input , uv.xy-0.003)*2.7f;
Color += tex2D( input , uv.xy+0.003)*2.7f;
Color.rgb = (Color.r+Color.g+Color.b)/3.0f;

Result

image

You can also use cases and ifs for even cooler effects

Color.rgb = (Color.r+Color.g+Color.b)/3.0f;
if (Color.r<0.2 || Color.r>0.9) Color.r = 0; else Color.r = 1.0f;
if (Color.g<0.2 || Color.g>0.9) Color.g = 0; else Color.g = 1.0f;
if (Color.b<0.2 || Color.b>0.9) Color.b = 0; else Color.b = 1.0f;

Result

image

Other words, the sky is the limit.

Please note, that Pixel Shaders done in GPU only, thus it is the most efficient method to manipulate your images. Actually, you can apply effect to any UIElement, thus the sky is really the limit.

Have a nice day and be good people. Download code for this article. Notice, that you’ll need DirectX SDK to compile pixel shader files and use this program

x-posted from http://blogs.microsoft.co.il/blogs/tamir
UserControl binding to own property bug in Sliverlight 2.0 beta 2

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/usercontrol-binding-to-own-property-bug-in-sliverlight-20-beta-2/]


Today morning, I come to my office. Alex, sitting there, was very tired. His eyes were red. I asked him: “What’s going on?” and he responsed: “I think, I’m sick. Something is broken in Silverlight”. “What’s the problem?” – I asked. And he explained me, that he want to create UserControl with some properties. Let’s say something like this:

<UserControl x:Class="SilverlightControl1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="400" Height="300">
    <Grid x:Name="LayoutRoot" Background="White">
        <TextBlock Text="Hello, World" Name="tb" FontSize="{Binding MySize}"/>
    </Grid>
</UserControl>

Where MySize is internal dependency property of the SilverlightControl1. Now you’re going to your application and consuming your new control.

<l:SilverlightControl1 x:Name="kuku" MySize="40"/>

This does not work. Maybe the problem is DataContext? Let’s set DataContext of UserControl to itself

public SilverlightControl1()
        {
            InitializeComponent();
            this.DataContext = this;
        }

Ups… “An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.dll”. Well, why binding does not happens?

Maybe the problem is binding? Let’s try to explicitely bind to it property.

Binding b = new Binding("MySize");
b.Source = this;
tb.SetBinding(TextBlock.FontSizeProperty, b);

Nothing happens. Where to dig? Maybe notification changes not happen? Let’s add INotifyPropertyChanged notification

public double MySize
        {
            get { return (double)GetValue(MySizeProperty); }
            set { SetValue(MySizeProperty, value); PropertyChanged(this,new PropertyChangedEventArgs("MySize"));}
        }

Now it works, but what will happen if we’ll remove explicit binding? Nothing this does not work. What’s the problem?

The problem is bug in Silverlight 2.0 beta 2. To workaround it, you can either use explicit binding inside the usercontrol, or (like me) create external data class and bind to this class.

public class MyData : INotifyPropertyChanged
{
    public double MySize
    {
        get { return m_MySize; }
        set
        {
            m_MySize = value;
            OnPropertyChanged("MySize");
        }
    }

    double m_MySize = default(double);

    #region INotifyPropertyChanged Members

    public event PropertyChangedEventHandler PropertyChanged;

    public void OnPropertyChanged(string name)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, new PropertyChangedEventArgs(name));
    }

    #endregion
}

Create DataContext

MyData d;
       public SilverlightControl1()
       {
           d = new MyData();
           InitializeComponent();
           this.DataContext = d;

And then, extern the property to the control

public double MySize
        {
            get { return d.MySize; }
            set { d.MySize = value; }
        }

We done. Hope this nasty bug will be fixed in RTM version of Silverlight. Have a good day and be nice people.

Have a nice day to Alex to. Do not try to understand what’s problem with your code, when working with beta version of any framework. First check alternatives.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Silverlight controls library has been upgraded to Beta 2

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/silverlight-controls-library-has-been-upgraded-to-beta-2/]


Finally this weekend I got  a time to upgrade one of my OpenUp submissions, Silverlight controls library to work with Silverlight 2.0 beta 2. It was very interesting to track changes between developer’s (beta 1) and production (beta 2) go-live licenses. Let’s try to understand what has need changed.

  1. Syntax of DependencyProperty registration. Now instead of DependencyProperty.Register(name, propertyType,ownerType,propertyChangedCallback) you should use DependencyProperty.Register(name, propertyType,ownerType,typeMetadata), which, actually receives only one parameter in constructor – propertyChangedCallback. This make Silverlight to be closer to WPF syntax and open it for future enhancements. You can download updated Visual Studio 2008 snippet for creation of Silverlight Dependency Properties.
  2. OnApplyTemplate method of UserControl become public instead of protected
  3. Thumb DragDelta event argument is not DragEventArg anymore. Now it’s DragDeltaEventArgs. So there is no HorizontalOffset and VerticalOffset attributes. They replaced by HorizontalChange and VerticalChange
  4. DefaultStyleKey is not null anymore
  5. Most of controls migrated from System.Windows.Controls into System.Windows namespace
  6. Some changed to ToolTip service
  7. Now Silverlight checks whether TargetType property of Style is really compatible with the control, you’re applying style to (this not happened in beta 1). Also DependencyObject.SetValue() method checks it’s type.
  8. There is no InitializeFromXaml anymore. Now Silverlight works more “WPF style” with application services – Application.LoadComponent()
  9. You cannot use x:Name and Name property together (someone did it?)

There are a ton of other changed, that was not related to Silverlight Control Library. For example, changed within Storyboard class, networking, cross-domain policy, other controls (e.g. DataGrid), Templates of some controls (e.g. Button, TextBox, etc) and API.

Also I want to invite you to take part into development of Silverlight controls library not because of complimentary ticket to PDC ‘08 or Mobile Memory Mouse 8000, but because Open Source is not “one-men-show”. To get access to SVN, submit your work and begin development of next generation of Silverlight controls, contact me via CodePlex and I’ll add you to the project as new contributor.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Presenting at TechEd Developers South Africa 2008, Durban

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/presenting-at-teched-developers-south-africa-2008-durban/]


Save the date. TechEd Developers South Africa is around the corner (August 3rd through 6th). This year it will take place in Durban, the third most populous city in South Africa.

image

This TechEd, there are four sessions assigned to me:

Creating Rich Applications with Windows Presentation Foundation (300)

Completely new session about how to enrich user experience, by decreasing development efforts with WPF. In order to do this, we’ll try to take some application and completely recreate it, by using XAML only without any single code line.

Target audience: Developers and decide makers, who what to understand what can be done with WPF and how easy you can do it.

Understanding Reflection (400)

This is also new session for lazy developers. It’s not only about what reflection is or what’s new about reflection in latest frameworks (including .NET 3.5 and Silverlight), but also how to use it to make developer’s life easier. We’ll enter a bit into IL to understand what’s going on under the hoods, but most of session is about appliance of this technology for everyday developers’ tasks and challenges.

Target audience: Developers, have an experience with .NET programming

WPF Performance (400)

Session very similar to one, I had in Dev Academy 2. However this time it will focus on performance enhancements in .NET framework 3.5 SP1. I’ll speak about virtualization, parallel processing, DX surface direct access and more…

Target audience: Developers, have an experience with WPF development.

Game Development Using Microsoft’s Latest Technologies (300)

Fun session, I had in TechEd Israel with very complicated setup. Here the sneak preview of how it looks like. It listed as a 300 level, because the fact, that except this session’s fun, you can learn a lot of new there.

Target audience: Everyone, who love technology and want to have fun hour in the morning before advanced sessions will begin.

If you’re reading my blog, and you’re going TechEd Africa. Come and say me hello, ‘cos it would be really nice to see the faces of the people I’m writing to in this blog :)

More information about other sessions in this TechEd can be found in Ahmed Salijee blog, who is developer evangelist in Microsoft Africa and arranges this event.

See you there.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Phone history or why I throw my Tytn II

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/phone-history-or-why-i-throw-my-tytn-ii/]


I decided to throw out my HTC TYTN II (Actually AT&T Tilt) and get old Nokia E61 back. Why I’m doing it? Tytn is much better, then old Nokia? It’s 3.75G/HSUPA mobile phone, running latest Windows Mobile 6.1 OS. It also has full QUERTY keyboard, 2.8” LCD monitor, 3MP camera and even very good integrated GPS. Nokia has neither. It’s processor is x4 faster and memory x3 bigger. Why I cannot use it? Why I want my old “keyboard brick” back?

e61

First of all, I need phone. Not “freaky damn good uber extensible device”. I want to push one button to receive/make call, push another button to read/answer email. That’s all I need. I need business phone. I do not want to be worry about battery/alarms/meeting/time offset/current time/something wrong/too much processes/no memory/fault/occasionally shutdown/my ears near end call or mute button and all other “goodies” come with TYTN 2 device. I want to be able to dial number without looking on device. I want to be able to do it either when its sunny day outside. I want to push one button to refuse receive call, send “I’m sorry” SMS and turn ring off simultaneously. And I do not want to reinstall ROMS to figure one with small amounts of bugs and then reinstall 300 programs that allows me to do it. I want business phone, that knows what I need.

Just see the regular flow phone usage – make call:

  1. Click power/unlock button
  2. Enter password (there is exchange policy). To do this you have to look on screen. If you wont you’ll absolutely unable to know where each button on screen. Windows mobile using different keyboard for lock and phone utility.
  3. You should press left hardware button. It is not very easy task, ‘cos if your phone doing something now, you’ll wait for response between 1-2 seconds. If you’ll press it twice – you’ll arrive into calendar utility (only for this layout everyone in UX team of Windows Mobile should be fired.
  4. Press Phone button opens dialer utility. If you want any of your last incoming/outgoing/missed calls, you should press another soft button on screen (up jog button not always responses as required)
  5. Choose phone to call (another non-responsive hardware up/down buttons) and then
  6. Press middle big button…
  7. Nothing happes… “OK” button?
  8. You arrived to the contact information (I want to call)!!! Just side note, Windows Mobile is very smart system and if you have more, then one number per contact (work/mobile/office/text) it will call this number by default forever.
  9. Finally I choose a number I want to call (if you choose Text field of contact it brings your SMS interface instead of dialer) and calling the contact
  10. Busy… Redial? Automatic redial? Nothing. Now you should keep sitting and trying to process all above steps each time you want to redial…

Very useful, very easy tool. Isn’t it? Now let’s call the contact with E61

  1. Click unlock button
  2. Enter password (your keyboard is always the same and you should not look into it to dial 5 button is marked)
  3. Move jog up
  4. Move jog down
  5. Move your finger left and up (each button has its unique profile and you can feel it)
  6. Dial
  7. Busy? E61 will redial for you until it’ll catch the contact or you’ll cancel operation. You even do not need to hold phone near ear. Once it success, you’ll hear gentle sound from external speaker.

Should not it work this way? It should, because it is phone, not PDA device.

What about exchange synchronization? Works perfectly. I do not want E61I (successor of E61) it much slower and bugger, then E61. I’m waiting for E71 (smaller) to see if it good for me. but meanwhile, I’m paying $300 to get my E61 back. Someone want to buy my Tilt? Bid in comments.

All above is the reason I do not want IPhone. It’s toy. Very cool and beautiful toy. It is not tool I need everyday.

P.S. I think Microsoft should think a lot about Windows CE 5.x, used as WM. It is not OS for phones, it’s OS for devices with some tools to be able to make calls. Microsoft never be the favorite of mobile market (like Steve Ballmer want it to be), unless they understand, that CE is not operation system for phones. Just in case, currently Nokia holds 33% of the market, next is Motorola (20%), and Samsung (13%). Pay attention all three companies have phone operation system. It’s not about coolness of the device. It’s all about usability of tools.

P.P.S Yes, it’s much easier to find or develop additional tools for Windows Mobile, rather then for Symbian. But I’m ready to pay this bill if I’ll be able to use my phone as phone.

AT&T Tilt

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Microsoft future healthcare vision – boom, biga boom UX troubles…

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/microsoft-future-healthcare-vision-%e2%80%93-boom-biga-boom-ux-troubles%e2%80%a6/]


About a week ago, Microsoft healthcare division put a lot of money into their future vision. The results are: cool SF promo, real big UX troubles. Let’s try to understand why

Fellow young pre-diabetic girl runs somewhere in wide, while big physiologist brother is watching her on 15” e-paper monitor with big box for something over it. He also typing on rubber keyboard in his table. Good idea, especially if he has coffee, that can split to it.

image image

He has only 5 qualified patients to follow and their are not sorted anyhow. But who cares, maybe in the future we’ll have 20% of physiologists in the world.

In the future we’ll not have standard keyboards. All of them will be flat and chunky with huge circle in upper right corner instead of Enter (have you ever tried to blind type with absolutely flat keyboard? I’m suffering from this every day with my Windows Mobile.

image

But who cares about flat keyboards, when we’ll charge business cards and have only IPhones at home. We do not really have to use it as music player for jogging. Ah, and other thing, all our power supplies will be wireless, but we still need plates to put all devices into.

image

Wee! We’ll have Vista start button in upper left corner. Under it we’ll have some kind of mail client and them Internet Explorer. Well call button will be the smallest one in bottom left. Also, the default screen of our mobile phones will show cool graphs.

image

But phone is still small device, we’ll have to turn it in order to switch TV on. Also we’ll have huge tumbler button (flat) to do something useful with TV.

image

When we’ll want to see good film, one of our physiologists will appear from inside email message to show us two really useful graphs of  “Qualifying range” of something. Also we are not really using email (we have only 5 messages for 3 month). Another problem is computer clock it seemed to be very broken (weather outside is very very good for 12 February). Please take a look onto user interface – emails without words, but very useful search block (we have no keyboards, remember) and Windows with IE hot buttons.

image

Hospital

Endocrinologist Christian Kemp is very new there, thus he need map to find the way out. Well', let’s take into account, that he has a lot of work and computer builds routing path for him. But why to go through the walls?

image

A moment after we’re understand why. This is the hospital for aliens from Men in Black II – green small aliens. So we should watch not to step over them. Also, the map on device shows absolutely different place. Treasure island?

image

Even worth is to be patient. You should see front view of driving cars and all Medication Reminders. When the reminder appears, it has fast forward, fast backward and pause buttons (you have click it very quick – the car will stop, but reminder remains, so you have no way out). Maybe if we’ll not have medication on time those cars become real and ride over us.

image image

The bad news is, that all drugs looks absolutely the same. The only difference is the color of ellipse under it. If you’re suffering of daltonism, you’ll dead!

image

But this is not all. You have to move tube for perception to appear. Then all you have to do it to click it, wait, that take it again and take drug. Extremely user friendly technology.

image

 Then, when endocrinologist finally found us he should look for something very strange. However X-rays of his device always how the exact place of his stuff. Wait a minute! It was 3:12 PM when we begun the hide and seek with Christian. It was 3:14 PM when the patient took his drug. Now Christian’s devices shows 3:12 PM again. Well another broken clock. Also his device has small horizontal and vertical offset. Also it makes another things to appear. Look into right upper corner of the imag

image

How Christian had to go out for smoking with the device. It’s 3:24 PM, when he begun to check Alex Roland’s eye. Also instead of looking into monitor near Alex’s bed (where car was), Christian trying to look into the hole in opposite side of the tube device he found. What he smoked?

image image

Finally the doctor found anomaly and adjust something with stylus to show Alex. Now he (Alex), probably know his chances to be cured.

image

Now in his room, all Chris has to do is to shrink something to turn 67.8% of effectiveness into 84.2%. Very cool, especially when all other numbers (at right) had not been changed.

image image

Now they should told the girl from the first scene about her chances. Well, all of them already know about her. More, then this they used Alex’s eye test results to make the right decision (everything happens momentarily, it’s 8:24 PM in device’s clock).

image

Now all we have to do is to turn off everyone and put doctor’s device to changing on cabinet door. The battery is really low (about 80%) and no one cares about patients privacy. A moment after the battery is full again, but device turned into door sign.

 image image

Now the girl come to visit the doctor (he told, her, that she has about 80% of chances not to see cars near hospital bed). But in order to be identified and get right directions, she should not wash her hands for a while. This way thumbprint scanning will work.

image

Then she should choose what card to use. Really strange is not the card the same?

image

Now just swipe a card to get directions (we already identified twice)?

image

Not really, now we have to type something. We’ll we have not. It types itself.

image

Now first “OK” will confirm our details (don’t we really know it?) Then we should choose why we come here.  This “mini-hospital” provides only four types of services: Flu diagnosis (very important in sunny February), hemoglobin A1C (that’s why she here), Mononucleosis (abnormal increase of while blood cells in blood) and pregnancy testing. All this for $25 only. Cool hospital.

image image

But actually she does not need tests. She already has prescription for 80mg oral hypoglycemic for $20 only. Thus she can pay immediately. Wait don’t she need to change cards in wallet? The machine become smarter.

image

Now all she has to do is to find way out (do you remember labyrinths in this hospital?)

image

Very cool CF film, but it’s very unreal and prognoses us bad User Experience in the future…

Have a nice day and be good people.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Backup and restore your wireless networks settings by using WirelessMigrator

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/backup-and-restore-your-wireless-networks-settings-by-using-wirelessmigrator/]


I had to reinstall my working notebook, so I begun to backup all it’s settings. I almost finished, when recognize, that Windows Vista has no tool for backup and restore wireless networks settings (tnx to Daniel Petri). You can manually add or remove it. You can even change the priorities, but you cannot backup or restore it.

 image

What to do? How to save all my passwords for networks and all certificates. Digging a bit deeper I found a way to do it, by using command line prompt.

“netsh wlan show profiles” will show you all wireless network profiles in your system
”netsh wlan export profile name=”name” folder=”folder”” will export each profile to xml file (you can also run netsh wlan export profile” to export them all as bunch
”netsh wlan add profile filename=”name”” will restore each one of profiles and returns them into the system

For some reason, I cannot see my mother doing it… More then this, I cannot see myself remember all those command and doing it manually for each one of saved profiles (and I have a lot of them)

What’s the solution? Build handy tool! I’m developer after all and know to solve my and other’s problems by code.

Let me introduce you WirelessMigrator

What is WirelessMigrator? Wireless Migrator is a handy small program, that knows to backup and restore all wireless networks setting from your computer by one click. For some reason, there is no way to do it by using regular Windows Vista tools.
This feature is extremely useful, when you have to reinstall your computer or use the same settings of wireless networks for different machines. In order to use the program, all you have to do is to run it once. The program generate small file, can be handled and transferred in diskette. Later if you'll run this generated file, all settings of wireless networks will be restored on target machine.

Run “BackupWireless.exe” to backup

image

And “RestoreWireless.wnb” to restore

image

That’s all, folks. Now you can save and restore your settings for wireless networks for migration easily.

Download Wireless Migrator >>

At first run, the program will request elevation on Windows Vista, to assign backup archive extension with the program and be able to restore with one click. To completely remove all registry nodes, wrote by program, from the registry, use BackupWireless.exe /remove option. To reinstall the program, just run it for the first time. That’s what I’m calling SmartClient. This is not “real” installation it also not very “web” application.

WirelessMigrator has very advanced and smart user interface

Now a little bit about the user interface of this program. I though a lot about it and decided not to make any user interface for it. Theoretically, it was possible to make kind of “Funky-Vista-Glow” list of all available networks and three buttons “Backup”, “Restore” and “Cancel”. I even done it with half an hour in WPF. But wait a moment. Is it really necessary to have user interface for such program? It wont be more functional by having it. All it have to do, done automatically and you have nothing to do if something going wrong.

So, I build text-only progress bar and key switches to show progress (with will not take more, then 3 seconds), but that’s all. ‘m really interested to know what do you think about it?

Download Wireless Migrator >>

Your feedback is really important for me. Please take a moment and tell me what’s good and what’s bad with this program in order me to be able to continue it’s development. Full source of the program is available under MS-PL from CodePlex.

My other open source projects, you may be interested with

Have a nice day and be good people.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Quick note: New TechEd downloads

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/quick-note-new-teched-downloads/]


There is TechEd in Orlando, and this means, that there are a lot of new announcements. Let’s fill up our download managers with expensive fuel and start.

Silverlight 2.0 beta 2 + Microsoft Expression Blend 2.5 June preview will be available for download very soon. Keep watching. Meanwhile, you can start learn about new TabControl, VisualStateManager, new templating system and cross-domain policy from Tim Heuer’s blog. Also there are some news about event bubbling in beta 2 in Jesse’s blog.

x-posted from http://blogs.microsoft.co.il/blogs/tamir
Next page »
Page view counter