Book Review for Pro Silverlight 2 in C# 2008 By Matthew McDonald

I read Matthew McDonald’s book Pro WPF to bone up on WPF, XAML, and everything .NET 3.5 has to offer.  I have to say that I was impressed by Matthew’s writing style, level of detail, and general knowledge that he passed onto the reader.  This fact is also the case with Pro Silverlight 2.  While WPF has some similarities to Silverlight, the author points out some of the differences (like the lack for EventTrigger support for any event but the Loaded event in the current version).

The book covers all of the major topics, starting with an overview of the basic elements: XAML elements, properties (simple and attached), moving into the subjects of Layout containers, dependency properties, and routed events.  He then moves into an overview of the various controls.  This overview isn’t exhaustive, but gives you a firm foundation.  I thought his chapters on shapes, brushes, transforms, audio/video, and animation to be very helpful.  It can be difficult to understand how to setup these various features, and Pro Silverlight 2 clarifies it well.

The next section of the book covers the more advanced topics that you would need to know to use Silverlight, such as using web services within ASP.NET/silverlight (a useful topic since Silverlight doesn’t use ViewState or server-side technologies because it’s running on the client), databinding (which can be challenging due to various levels of nested Silverlight structures), multithreading, and more.  He really doesn’t leave very many stones unturned in his explanation of the features.

I would highly recommend this book from Apress.  Although Silverlight 3 is coming soon, this book will help you understand those fundamentals that will be in the next version.

Posted by bmains | with no comments
Filed under:

McAfee's spam report for July

Today McAfee published its spam report for the month of July with the top 15 spam subject lines by domain. For instance for the .COM domain it gives you this:

  1. Hello
  2. Hi
  3. RE: DISCOUNT 80% 0FF on Pfizer !
  4. Replica Watches
  5. Undelivered Mail Returned to Sender

For more information and other Top 15 subject lines for each major domain (.ORG, .UK, .CN, etc.), as well as the rest of McAfee’s July Spam Report, see McAfee's Avert Labs Blog.

 

Posted by jubo | with no comments
Filed under:

Windows Azure Service Platform – Worflow Services Changes

The team announced that several importance changes in the Workflow Services way of work and also that it will be taken offline for a while in order to proceed with all the changes.

Changes like the possibility of working in the Cloud Workflow Services the same way as in the .NET Framework 4.0:

“(…) An area of consistent discussion is the Microsoft .NET Workflow Service delivered via .NET Services, and how it relates to the Windows Workflow Foundation (WF) in the .NET Framework. One of the comments that we’ve consistently heard about the .NET Workflow Service is that you want the Workflow Service to be built on .NET Framework 4‘s workflow engine. This is currently not the case, since we are prior to the release date of .NET Framework 4.

As the direct result of user feedback, we will hold off further releases of the Workflow Service until after .NET Framework 4 ships. Since there will be important changes to the Workflow Service before it goes to full production, we are planning to take down the existing Workflow Service as part of service improvements in the month of July. This means any solutions that currently rely on the Workflow Service will have to be modified on or before July 1 in order to continue functioning smoothly. (…)

More information’s here.

Otimização de estação de trabalho

Uma das nossas maiores preocupações, seja no trabalho, em casa ou em um cliente, diz respeito a otimização de nossos desktops ou notebooks, ou seja, nossas estações de trabalho.

Visando isso, a Microsoft nos oferece uma série de tecnologias que estendem o valor do Windows Vista Enterprise e do Software Assurance, uma das formas de licenciamento. As empresas que estão considerando o uso do Microsoft Desktop Optimization Pack devem avaliar também o Windows Vista Enterprise e o Windows Vista Enterprise Centralized Desktop.

Há vários recursos a serem explorados. Para saber mais vejam: optimizeddesktop

No TechCenter de Windows Vista temos muitos recursos e artigos, com muita informação sobre o assunto, com vídeos e muito mais. Acessem: http://technet.microsoft.com/pt-br/windows/aa904820.aspx

Alguns dos recursos no Windows Vista Enterprise:

  • Criptografia de Unidade de Disco BitLocker™ do Windows.
  • PCs Sem Disco e Inicialização Remota.
  • Quatro Sistemas Operacionais Virtuais: Concede aos clientes do Software Assurance os direitos a quatro cópias adicionais do SO, permitindo que eles potencializem até quatro VMs no Virtual PC. Isso simplifica muitas funções, incluindo o suporte técnico, a realização de aulas de treinamento e a realização de testes em softwares.
  • Subsistema para Aplicações Baseadas no UNIX.
  • MUI (Interface de Usuário Multilíngüe.
Posted by Alexandro Prado | with no comments

Quadro Comparativo entre Windows XP SP3, Windows Vista SP1 e Windows 7

Quer comparar as versões do Windows Client? A Microsoft disponibilizou um comparativo dos recursos existentes nas três versões de Windows client existentes: Windows XP SP3, Windows Vista SP1 e Windows 7. Além de interessante, temos uma visão clara da evolução entre os sistemas
O Download do pdf com o quadro comprativo pode ser feito aqui.

windows%20client

Posted by Alexandro Prado | with no comments

LIDNUG: Tim Heuer presenting on Silverlight 3 this week

Join us for a Silverlight 3 talk with Tim Heuer at the Linked .Net Users Group on Thursday the 9th of July, 2009 at 10:30AM PDT.

Register for the event here: http://events.linkedin.com/LIDNUG-Tim-Heuer-talks-about-Silverlight/pub/78576 

We currently have 140 registered to attend and it promises to be a seriously cool presentation.

As usual, the event is presented via Live Meeting!

LIDNUG has also been looking for a new logo and voting has started for the submissions.

See the submissions here and vote: http://www.lidnug.org/community.aspx

Voting will close by the end of the month!

We’ve also reached an astonishing number of members – with now more than 27,000 registered members!

So, even though it’s summer in the northern hemisphere there’s still plenty of opportunities left to learn about all the new stuff coming out!

Since 2009 saw the kickoff for the Linked .Net Users Group, with both some hugely successful events and a massive amount of positive feedback, we’re definitely not resting on our laurels!

August will see us have both Scott Hanselman and Scott Guthrie present, on the 13th of August and 25th of August respectively!

As usual we’ll be recording all of our events and make them available from the LIDNUG web site.

Posted by Brian Madsen | with no comments

Experiments with the new SQL Data Services

The SQL Data Services that are part of the Windows Azure Service Platform just recently, and due to customer feedback, changed the way of working from a ACE (Authority, Container, Entity) model to a TDS (Tabular Data Stream) model.

Eugenio Pace in this post show how he changes the IssueTracker application from the old model to the new one, and also showing the things missing from one to the other and what needs to be done.

Very interesting reading indeed.

WPF Charting is already available in WPF Toolkit of June 2009

The long wait has finished as the WPF Charting was made available on the last WPF Toolkit release of June 2009 and now we can use all those great charts that were available for Silverlight, now also in WPF.

You can know more about this here.

Posted by NunoGodinho | with no comments
Filed under: , ,

Zodiac Signs: DateRange Class

This entry details the implementation of the DateRange class from this example in C#:

public class DateRange
{
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }

    // Constructor
    public DateRange(DateTime startdate, DateTime enddate)
    {
        this.StartDate = startdate;
        this.EndDate = enddate;
    }
}

This class uses the automatically implemented properties feature that was introduced to C# in .NET 3.5 to define the two DateTime properties.

The constructor in this example creates a DateRange with an appropriate start date and end date. Though this class was created for the Zodiac Signs example, it could be used anywhere a DateRange is needed.

Enjoy!

Posted by Deborah Kurata | with no comments
Filed under: , , ,

Zodiac Sign: ZodiacSigns Class

This entry details the implementation of the ZodiacSigns class from this example in C#:

public class ZodiacSigns : List<ZodiacSign>
{

}

Constructor

The following is the constructor defined in the ZodiacSigns class:

public ZodiacSigns()
{
    InitializeCollection();
}

This constructor ensures that the collection of zodiac signs is initialized when an instance of this class is created.

Methods

The following are the methods in the ZodiacSigns class:

public string FindSign(DateTime desiredDate)
{
    // Find the name of the Zodiak sign with the date within the ranges
    var query = from z in this
                from d in z.DateRanges
                where (desiredDate >= d.StartDate) &&
                       
(desiredDate <= d.EndDate)
                select z.Name;
    string name = query.FirstOrDefault();
    return name;
}

The FindSign method uses LINQ to find the date within the defined ranges. It returns the name of the appropriate sign.

private void InitializeCollection()
{
    // This could potentially read all of these from a file.
    // NOTE: This data may not be accurate
    this.Add(new ZodiacSign("Rat",
        new List<DateRange> {
            new DateRange(new DateTime(1996, 2,19),
                new DateTime(1997, 2,6)),
            new DateRange(new DateTime(2008, 2,7),
                new DateTime(2009, 2,25))}));
    this.Add(new ZodiacSign("Ox",
        new List<DateRange> {
            new DateRange(new DateTime(1997, 2,7),
                new DateTime(1998, 2,27)),
            new DateRange(new DateTime(2009, 2,26),
                new DateTime(2010, 2,13))}));
    this.Add(new ZodiacSign("Tiger",
        new List<DateRange> {
            new DateRange(new DateTime(1998, 2,28),
                new DateTime(1999, 2,15)),
            new DateRange(new DateTime(2010, 2,14),
                new DateTime(2011, 2,2))}));
    this.Add(new ZodiacSign("Rabbit",
        new List<DateRange> {
            new DateRange(new DateTime(1999, 2,16),
                new DateTime(2000, 2,4)),
            new DateRange(new DateTime(2011, 2,3),
                new DateTime(2012, 1,22))}));
    this.Add(new ZodiacSign("Drago",
        new List<DateRange> {
            new DateRange(new DateTime(2000, 2,5),
                new DateTime(2001, 2,23)),
            new DateRange(new DateTime(2012, 1,23),
                new DateTime(2013, 2,9))}));
    this.Add(new ZodiacSign("Snake",
        new List<DateRange> {
            new DateRange(new DateTime(2001, 1,24),
                new DateTime(2002, 2,11)),
            new DateRange(new DateTime(2013, 2,10),
                new DateTime(2014, 1,30))}));
    this.Add(new ZodiacSign("Horse",
        new List<DateRange> {
            new DateRange(new DateTime(2002, 2,12),
                new DateTime(2003, 1,31)),
            new DateRange(new DateTime(2014, 1,31),
                new DateTime(2015, 2,18))}));
    this.Add(new ZodiacSign("Sheep",
        new List<DateRange> {
            new DateRange(new DateTime(2003, 2,1),
                new DateTime(2004, 2,21)),
            new DateRange(new DateTime(2015, 2,19),
                new DateTime(2016, 2,7))}));
    this.Add(new ZodiacSign("Monkey",
        new List<DateRange> {
            new DateRange(new DateTime(2004, 1, 22),
                new DateTime(2005, 2, 8)),
            new DateRange(new DateTime(2016, 2, 8),
                new DateTime(2017, 1, 27))}));
    this.Add(new ZodiacSign("Rooster",
        new List<DateRange> {
            new DateRange(new DateTime(2005, 2, 9),
                new DateTime(2006, 1, 28)),
            new DateRange(new DateTime(2017, 1, 28),
                new DateTime(2018, 2, 15))}));
    this.Add(new ZodiacSign("Dog",
        new List<DateRange> {
            new DateRange(new DateTime(2006, 1, 29),
                new DateTime(2007, 2, 17)),
            new DateRange(new DateTime(2018, 2, 16),
                new DateTime(2019, 2, 4))}));
    this.Add(new ZodiacSign("Pig",
        new List<DateRange> {
            new DateRange(new DateTime(2007, 2, 18),
                new DateTime(2008, 2, 6)),
            new DateRange(new DateTime(2019, 2, 5),
                new DateTime(2020, 2, 21))}));
}

The InitializeCollection method does exactly what it sounds like … creating the set of date ranges associated with each zodiac sign. This code takes advantage of the list initializers now available in C#.

Enjoy!

Posted by Deborah Kurata | with no comments
Filed under: , , , ,

Interesting articles regarding .NET RIA Services

.NET RIA Services are here to make our life easier and they were introduced as part of the Silverlight 3.0 but are not only for Silverlight.

Some interesting reading about it is this:

Posted by NunoGodinho | with no comments
Filed under: ,

Zodiac Sign: ZodiacSign Class

This entry details the implementation of the ZodiacSign class from this example in C#:

public class ZodiacSign
{
    // Properties
    public string Name { get; set; }
    public List<DateRange> DateRanges { get; set; }

    // Constructor
    public ZodiacSign(string name, List<DateRange> dateranges)
    {
        this.Name = name;
        this.DateRanges = dateranges;
    }
}

This example uses the automatically implemented properties feature that was introduced to C# in .NET 3.5 to define the two properties: Name and DateRanges.

The constructor in this example creates a zodiac sign with an appropriate name and set of date ranges.

Enjoy!

Posted by Deborah Kurata | with no comments
Filed under: , , ,

Interesting reading about Entity Framework 4.0

Entity Framework has suffered great changes and in order to know more about them I recommend the following reading:

POCO (Plain Old CLR Object or Persistence ) in the Entity Framework 4.0

“Why is POCO important in Entity Framework? Is important because now we have the ability to really separate the Storage Model from the Conceptual Model, and being the Conceptual Model our normal CLR Objects, that was not possible in previous versions of Entity Framework. This is a huge breakthrough for this 4.0 version. Is not perfect, and in this technologies it never is but it’s very interesting”

I hope you enjoy the reading.

Applying OOP to Simple Situations: Chinese Zodiac Signs

Here is the story defining the simple use case for this application:

  1. The user picks a date between 2/19/1996 and 2/5/2019.
  2. The system displays the appropriate Chinese zodiac sign (Monkey, Dog, Rat, etc)

Seems simple enough. So how to implement this …

Defining the Classes

The first step in using OOP with a simple situation is the same as with any application … define the "nouns”.

These are the first nouns I came up with:

  • Zodiac sign
  • Date range

The next step is to think through each of these nouns and determine which make sense as classes for building the code to support this feature.

Zodiac Sign

This feature needs to work with a zodiac sign, so a ZodiacSign class makes sense.

In addition, this feature needs to retain the set of zodiac signs. So a ZodiacSigns (plural) class is also needed to track the list of ZodiacSign instances.

Date Range

Each zodiac sign is associated with a date range, so a DateRange class makes sense to track the dates.

Defining the Properties and Methods

The next step is to define what data that each class retains (called properties in OOP) and what functionality that the class provides (called methods in OOP).

After reviewing the nouns, three classes were defined:

ZodiacSign

This class provides the definition of a single Chinese zodiac sign. The properties for this class include:

  • Name: Name of the sign such as “dog” or “monkey”.
  • DateRanges: Set of date ranges associated with the sign.

ZodiacSigns

This class manages the list of all zodiac signs. To leverage the .NET Framework List features, this class can inherit from the built in generic List class.

This class has two methods:

  • InitializeCollection: Builds the list with the set of zodiac signs and date ranges.
  • FindSign: Given a date, finds the sign.

DateRange

This class has two simple properties:

  • Start Date: First date of the date range.
  • End Date: End date of the date range.

Using the Classes

The user interface portion of the application creates an instance of the ZodiacSigns class and calls the FindSign method as needed.

Enjoy!

Posted by Deborah Kurata | with no comments
Filed under: , , , ,

Windows Azure Service Platform: July CTP Breaking Changes Announcement

The Windows Azure Team has just release a July CTP Breaking changes announcement since the already breaking changes in the Workflow Services, now there are changes also in the .NET Service Bus.

“(…)Queues and Routers data will NOT be persisted and restored after the maintenance. Users will need to back up their data if they wish to restore them after the July 2009 CTP release. Please see below for detail.

As previously announced, the existing Workflow Service will be removed from .NET Services in the July 2009 CTP release. Any solutions that currently rely on the Workflow Services will have to be modified on or before 7/7/2009 9am PST in order to continue functioning smoothly. Existing solution Workflow Service metadata such as Workflow Type will also be deleted and cannot be retrieved after the July 2009 CTP release. (…)”

Impacts on:

“(…)NET Services and the .NET Services Portal will be unavailable during this period.(…)

Read more here.

Curiosidade: SCOM R2 ou SP2?

Antes do SCOM 2007 R2 ser lançado a Microsoft pensava em lançar o SP2 para o SCOM, isso faz um ano mais ou menos. Porém o SP2 nunca foi lançado oficial, na época isso estava sobre o NDA (contrato que um MVP tem de manter sigilo sobre as informações de alguns produtos), mas agora isso já faz parte da história e não tem mais problemas comentar por aqui J

 

Tenho este SP2 aqui comigo, na época fiz a instalação dele algumas vezes, e posso garantir que ele mesmo se tornou o R2, com muitas outras melhorias e correções é claro. Mas a curiosidade aqui fica por conta do R2 mesmo, visto que o SP2 nunca veio ao público. Quando você termina a instalação do SCOM 2007 R2, vá até a pasta:

 

C:\Program Files\System Center Operations Manager 2007\Tools\TMF

 

Na pasta Tools nós temos alguns dos arquivos utilizados pelo TraceConfig.exe (Ferramenta de diagnóstico que o Microsoft Customer Support Services (CSS) geralmente utiliza em seus chamados de problemas no SCOM, mas este não é o assunto deste texto J). E é aqui que está o “legal” da coisa, a Microsoft manteve o seguinte nome para um dos arquivos:

 

MOMv3.SP2_7221_signed.cab

 

Onde o MOMv3 é a versão do SCOM 2007 (já que o MOMv1 é o MOM 2000 e o MOMv2 é o MOM 2005), 7221 é a versão da Build do SCOM 2007 R2 e por fim o SP2 está perdido ai no meio. Claro, tem coisas que só o time do produto pode explicar J

 

Abraços,

 

Cleber Marques

Microsoft Most Valuable Professional (MVP)
Projeto MOF Brasil: Simplificando o Gerenciamento de Serviços de TI
www.mof.com.br | www.clebermarques.com | www.clebermarques.com.br

Posted by Cleber Marques | with no comments
Filed under: ,

July User group meeting

This months meeting will be virtual.  I will arrange another virtual meeting for late August. 

We should have a physical meeting in September


When: Thursday, Jul 23, 2009 7:00 PM (BST)


Where: Virtual

*~*~*~*~*~*~*~*~*~*

Subject is PowerShell output. What we see. What we get. How we can change it. methods of output

Notes


Richard Siddaway has invited you to attend an online meeting using Live Meeting.
Join the meeting.
Audio Information
Computer Audio
To use computer audio, you need speakers and microphone, or a headset.
First Time Users:
To save time before the meeting, check your system to make sure it is ready to use Microsoft Office Live Meeting.
Troubleshooting
Unable to join the meeting? Follow these steps:

  1. Copy this address and paste it into your web browser:
    https://www.livemeeting.com/cc/usergroups/join
  2. Copy and paste the required information:
    Meeting ID: 94F2K5
    Entry Code: q.bhRK7Hs
    Location: https://www.livemeeting.com/cc/usergroups

If you still cannot enter the meeting, contact support

Notice
Microsoft Office Live Meeting can be used to record meetings. By participating in this meeting, you agree that your communications may be monitored or recorded at any time during the meeting.

Posted by RichardSiddaway | with no comments

BPOS – Update, interessantes aus der Exchange-Ecke

Wie ich auf dem letzten Exchange User Group Meeting noch verkündet habe ist der Umzug auf BPOS bisher eine Einbahnstraße. Einmal dorthin gezogene Emailkonten können lediglich mit Outlook exportiert und per Handarbeit wieder zurück auf einen eigenen Server umgezogen werden. Microsoft wird nun lt. dem Technet – Blog der Schweizer Technologieberater ein Update einspielen, so das die einmal zu BPOS migrierten Konten auch wieder zurückmigriert werden können. Gerade für Migrationen wird es damit für mich zu einem sehr geeigneten Mittel. Wie genau das aussehen wird in Kürze.

Viele Grüße

 

Walter Steinsdorfer

Posted by Wstein | with no comments
Filed under:

Multithreading: using VolatileXXX instead of the volatile keyword

In the previous post we’ve seen how we can use the C# volatile keyword to guarantee that those nasty load-load reordering stay away from our code. As I’ve said before, we can also use the static Thread.VolatileRead or Thread.VolatileWrite for having more control over the way fences are applied to our code. Going back to our previous volatile example, the question is: do we really need a fence whenever we access our instance variable?

Looking at the code, I guess that we can get  away by just using an acquire fence on the initialization of the instance. Recall that an acquire fence is an optimization of the full fence and ensures that no load or store that comes after the fence can be moved before the fence (it’s just what we need to ensure proper initialization and eliminate the possible load/load reorderings allowed by the CLR).

With this in mind, lets update our sample, ok? Btw, we’ll be using another variable for controlling initialization (we’re picking an integer). This is your best option for initializing value types since you can’t control it size or check it for null (don’t forget our previous discussion on word size, alignment and .NET). Here’s the final code:

class Lazy{
  private Object _locker = new Object();
  private SomeObject _instance = null;
  private Int32 _initialized = 0;
  public SomeObject SomeObject {
    get {
      if (Thread.VolatileRead(ref _initialized) == 0) {
        lock (_locker) {
          if (_initialized == 0) {
            _instance = new SomeObject();
          }
        }
        return _instance;
      }
    }
  }
}

This code is also correct and will behave properly in all the current architectures that run Windows and the CLR. There’s no need for running another VolatileRead on the inner comparison due to a thing called control dependency (check this post by Joe Duffy for more info). Notice that in these posts our main objective is ensuring that you end up getting only one instance of a specific type. As I’ve said, if you don’t care about creating multiple instances and only need to ensure that you’ll have only one active instance, you can only use the Interlocked.CompareExchange method for that. We’ll see how in the next post. Keep tuned!

Posted by luisabreu | 2 comment(s)
Filed under: ,

MasterMind: Peg Class

This entry describes the Peg class from this example in further detail:

Public Class Peg

End Class

Properties

The properties of the class are as follows:

Private _Column As Integer
''' <summary>
''' Gets the column of this peg.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public Property Column() As Integer
    Get
        Return _Column
    End Get
    Private Set(ByVal value As Integer)
        _Column = value
    End Set
End Property

The Column property defines the column of the board that contains this peg. The setter is private because once the peg is created, its location cannot be moved.

Private _Correct As Boolean?
''' <summary>
''' Gets or sets whether the peg is in a correct position.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public Property Correct() As Boolean?
    Get
        Return _Correct
    End Get
    Friend Set(ByVal value As Boolean?)
        _Correct = value
    End Set
End Property

The Correct property defines whether this peg denotes a correct answer. A correct answer requires that the peg be of the same color and column position as the correct answer.

Private _PegColor As Color?
''' <summary>
''' Gets or sets the peg color.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public Property PegColor() As Color?
    Get
        Return _PegColor
    End Get
    Set(ByVal value As Color?)
        _PegColor = value
    End Set
End Property

The PegColor property defines the color of this peg as defined by the user.

Private _Row As Integer
''' <summary>
''' Gets the row containing the peg.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public Property Row() As Integer
    Get
        Return _Row
    End Get
    Private Set(ByVal value As Integer)
        _Row = value
    End Set
End Property

The Row property defines the row of the board that contains this peg. The setter is private because once the peg is created, its location cannot be moved.

Constructor

The following is the constructor defined in the Peg class:

''' <summary>
''' Constructs a new instance in a specific position.
''' </summary>
''' <param name="columnIndex"></param>
''' <param name="rowIndex"></param>
''' <remarks></remarks>
Public Sub New(ByVal columnIndex As Integer, ByVal rowIndex As Integer)
    Me.Column = columnIndex
    Me.Row = rowIndex
    Me.PegColor = Nothing
End Sub

Download the sample code (that is currently only in VB) from here.

Enjoy!

Posted by Deborah Kurata | with no comments
Filed under: , ,
More Posts Next page »