webhost4life sucks

i hate them. at one point in time, they were a top notch company. now they’re inefficient, poorly run and they seriously lack the technical expertise to adequately host a website.

The ‘online tech support’ is predictable and useless. Here’s my latest conversation with them:

Nancy Mills: Hi Daniel. My name is Nancy Mills, how are you today?

daniel: hi nancy. last week our sites went down for 2 straight days. they were brought back up. but now..they’re back down. can you bring our sites up? if we can’t have our sites up immediately i’ve been asked to move the domains from wh4l and immediately close the account.

Nancy Mills: I apologize for any inconvenience this has caused you.

daniel: i think you guys have that line set to a macro

daniel: its always the first reply

daniel: can you bring the site/server back up or do you just ‘duplicate the issue’ and create tickets?

Nancy Mills: I have checked your websites and was able to replicate the issue. Hence, I have re-opened the ticket #6856470 and updated the information you have provided. Our specialist will work on the issue and you should hear from them soon. You can check the status of the Support ticket at http://www.webhost4life.com/member/sconsole .

Nancy Mills: One of our specialists will contact you soon with the information.

daniel: thats what i figured

daniel: why have online tech support if you cant actually fix anything?

I’m done with these guys. What a way to run a company into the ground and ruin a great reputation.

Posted on by daniel
Filed under: Uncategorized | 3 Comments »

Arggghhh!

I’ve neglected my blog for far too long!
I’ll be back with posts on Silverlight, Hockey and Photography.

Posted on by daniel
Filed under: Uncategorized | 1 Comment »

ice-t destroys a mac

So Ice-T feels the same away about Apple products that I do:

WARNING! - Bad Language and PC Destruction!

awesome.

Posted on by daniel
Filed under: Uncategorized | No Comments »

critical expression blend error

I really hate this error:

Its frustrating and deflating. My xaml compiles, runs and looks ok but opening the page in Blend crashes it every single time. Other pages load just fine. Guess I’ll break the page down with comments and find the offending code. My best guess is a style reference..but I wouldn’t know, given the craptastic error shown.
Sure hope this is fixed in Blend 3.

Posted on by daniel
Filed under: Uncategorized | No Comments »

IValueConverter and Silverlight databinding

The code here is based on Silverlight 2 technology.

One of the key features for Silverlight that I’ve made extensive use of lately is the ability to include an IValueConverter in the databinding process. Recently I had an issue with the Silverlight DataGrid and the DataGridTextColumn. I wanted to override FontWeight property of my bound text column but was getting an AG_E PARSER error. Silverlight wasn’t up for having the FontWeight property bound to anything aside from a declarative value. Let me show you the process I worked through to get the right results:

First..the basic non-bold app:



Page.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;

namespace SilverlightValueConversion
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }
    }

    public class EmailMessageList : ObservableCollection<EmailMessage>
    {
        public EmailMessageList()
            : base()
        {
           Add(new EmailMessage(”Gordie Howe”, “What happened?”, false));
           Add(new EmailMessage(”Chris Osgood”, “@$###$% @#$##!”, true));
           Add(new EmailMessage(”Gary Bettman”, “Wahoooo!”, false));

        }
    }

    public class EmailMessage
    {
        private string _fromName;
        private string _message;
        private bool _isNew;

        public EmailMessage(string from, string body, bool newmessage)
        {
            this._fromName = from;
            this._message = body;
            this._isNew = newmessage;
        }

        public string FromName
        {
            get {return _fromName;}
            set {_fromName = value;}
        }

        public string Message
        {
            get { return _message; }
            set { _message = value; }
        }

        public bool IsNew
        {
            get { return _isNew; }
            set { _isNew = value; }
        }
    }
}

Page.xaml
<UserControl xmlns:data=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data”  x:Class=”SilverlightValueConversion.Page”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
    xmlns:app=”clr-namespace:SilverlightValueConversion”
    Width=”400″ Height=”200″>
    <UserControl.Resources>
        <app:EmailMessageList x:Key=”MessageListData”/>
    </UserControl.Resources>
    <Grid x:Name=”LayoutRoot” Background=”Silver”>
        <data:DataGrid x:Name=”dgMessages”
              AutoGenerateColumns=”False”
              ItemsSource=”{Binding Source={StaticResource MessageListData}}”>
            <data:DataGrid.Columns>
                <data:DataGridTextColumn Header=”From”
                Binding=”{Binding FromName}” />
                <data:DataGridTextColumn Header=”Message”
                Binding=”{Binding Message}” />
            </data:DataGrid.Columns>
        </data:DataGrid>
    </Grid>
</UserControl>


If you look at the data source that I’ve thrown together, you’ll see that there is also a field for IsNew, indicating that the message is fresh and unread. Wouldn’t it be great if we could turn the font of the new messages to BOLD? We’re accustomed to having that functionality in our messaging clients so it would be great if we could duplicate that here. To accomplish in place conversion of bound properties, we’ll use an IValueConverter class. The simple description of the conversion process is that we send in an object, interrogate it and return a different value for binding.
This is the code for modifying the FontWeight property:

    public class FontConverter : IValueConverter
    {
        public object Convert(object value,
                              Type targetType,
                              object parameter,
                              System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                bool isNew = (bool)value;
                return isNew ? FontWeights.Bold : FontWeights.Normal;
            }
            else
            {
                return FontWeights.Normal;
            }
        }

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

We send in our bound “IsNew” boolean field and it sends out the appropriate FontWeight enumerated value for binding. Now lets turn our attention to the implementation of the FontConverter.
To expose the class to our xaml code, we add a short entry to our Resources tag:

<UserControl.Resources>

<app:EmailMessageList x:Key=”MessageListData”/>

<app:FontConverter x:Key=”fontconverter”/>

</UserControl.Resources>


And then it’s just a matter of working out the binding:

<data:DataGridTemplateColumn Header=”From”>

<data:DataGridTemplateColumn.CellTemplate>

<DataTemplate>

<TextBlock Text=”{Binding FromName}”

FontWeight=”{Binding IsNew,

Converter={StaticResource fontconverter}}” />

</DataTemplate>

</data:DataGridTemplateColumn.CellTemplate>

</data:DataGridTemplateColumn>

The converter class is called during the binding process, referencing the StaticResource fontconverter class. The IsNew property becomes a parameter for the call and the output is bound to FontWeight.

Note that we’re using a DataGridTemplateColumn to do the binding now. Couldn’t we just use the previously used DataGridTextColumn and bind to the FontWeight Property? I’m glad you asked.
Let try that:

<
data:DataGridTextColumn

Header=”From”

Binding=”{Binding FromName}”

FontWeight=”{Binding IsNew,

Converter={StaticResource fontconverter}}”>

</data:DataGridTextColumn>


If we add this and run it, we’ll get this very informative message:

So yeah…you’ll want to use the DataGridTemplateColumn instead.

So here’s the complete working code:

Page.xaml
<UserControl xmlns:data=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data”  x:Class=”SilverlightValueConversion.Page”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
    xmlns:app=”clr-namespace:SilverlightValueConversion”
    Width=”400″ Height=”200″>
    <UserControl.Resources>
        <app:EmailMessageList x:Key=”MessageListData”/>
        <app:FontConverter x:Key=”fontconverter”/>
    </UserControl.Resources>
    <Grid x:Name=”LayoutRoot” Background=”Silver”>
        <data:DataGrid x:Name=”dgMessages”
              AutoGenerateColumns=”False”
              ItemsSource=”{Binding Source={StaticResource MessageListData}}”>
            <data:DataGrid.Columns>
                <data:DataGridTemplateColumn Header=”From”>
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text=”{Binding FromName}”
                               FontWeight=”{Binding IsNew,
                                Converter={StaticResource fontconverter}}” />
                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>
                <data:DataGridTemplateColumn Header=”Message”>
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text=”{Binding Message}”
                               FontWeight=”{Binding IsNew,
                                Converter={StaticResource fontconverter}}” />
                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>
            </data:DataGrid.Columns>
        </data:DataGrid>
    </Grid>
</UserControl>

Page.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Windows.Data;

namespace SilverlightValueConversion
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }
    }

    public class EmailMessageList : ObservableCollection<EmailMessage>
    {
        public EmailMessageList()
            : base()
        {
           Add(new EmailMessage(”Gordie Howe”, “What happened?”, false));
           Add(new EmailMessage(”Chris Osgood”, “@$###$% @#$##!”, true));
           Add(new EmailMessage(”Gary Bettman”, “Wahoooo!”, false));

        }
    }

    public class EmailMessage
    {
        private string _fromName;
        private string _message;
        private bool _isNew;

        public EmailMessage(string from, string body, bool newmessage)
        {
            this._fromName = from;
            this._message = body;
            this._isNew = newmessage;
        }

        public string FromName
        {
            get {return _fromName;}
            set {_fromName = value;}
        }

        public string Message
        {
            get { return _message; }
            set { _message = value; }
        }

        public bool IsNew
        {
            get { return _isNew; }
            set { _isNew = value; }
        }
    }

    public class FontConverter : IValueConverter
    {
        public object Convert(object value,
                              Type targetType,
                              object parameter,
                              System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                bool isNew = (bool)value;
                return isNew ? FontWeights.Bold : FontWeights.Normal;
            }
            else
            {
                return FontWeights.Normal;
            }
        }

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

We run the complete code to get our working grid:

Obviously the grid could use some styling love, but this should get you started on using the IValueConverter. Keep in mind that you can use this thing for quite a few other binding tasks:

· Dynamically set coloring based on database properties

· Compile DateTime fields into custom descriptors

· Conditional testing and output

· many, many more…

You can download my sample solution file HERE.

Posted on by daniel
Filed under: Uncategorized | 1 Comment »

Quick config for Silverlight in SharePoint 2007

As promised during the Sharepoint User Group presentation on Silverlight in SharePoint:

Configuring SharePoint for Silverlight Development Checklist(’ish)

PreReq’s:

  • Windows 2008 OS installed and running with appropriate roles/features
  • SQL Server installed and runningWSS 3.0(sp’d)
  • Visual Studio 2008(sp’d)
  • VseWSS (1.2 or later):
    http://www.microsoft.com/downloads/details.aspx?FamilyID=7bf65b28-06e2-4e87-9bad-086e32185e68&displaylang=en
  • Create your Web Application and a Test Site.
  • Test that your site works.

I’d recommend backing up your VHD at this point, just in case things go awry. And they will. Especially the night before your demo the technology. Not that I’m speaking from experience or anything.

Silverlight Preparation

  • Install Silverlight Tools and the Toolkit:
    http://www.silverlight.net/GetStarted/
  • Make sure that your IIS installation has the MIME type for the .xap extension:
    Extension: .xap
    MIME type: application/x-silverlight-app
  • GAC the Silverlight .dll *:
    The .dll is most likely located at:
    C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server
  • use Gacutil or filesystem to get the dll into Windows\assembly

    *don’t forget to do this as Administrator.

Configure the Web.Config file:

Backup your sites web.config file!

Here’s a trick that worked on my new vhd and if it doesn’t work for you, hit the web and

search for ‘configuring sharepoint for silverlight’ and you’ll find the hard .config entries for the complete file. In an attempt to do a quick ramp up of the process, try this:

Open Visual Studio 2008.

Create a new Web Site, targeting the 2.0 Framework:

Open the new sites web.config file and delete the contents.

Copy the entire contents from your SharePoint web.config file to the site’s file.

Save it.

Right click on the site project file and select PropertyPages.

Click on Build and change the targeted framework to 3.5:

Add the next few options to the sections as noted:

<system.web><compilation><assemblies> :

<add assembly=”System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />

<system.web><pages><controls>:

<add tagPrefix=”asp” namespace=”System.Web.UI.SilverlightControls” assembly=”System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />

Copy the config contents over to your SharePoint web.config file, replacing the

contents. Save the file.

Reset IIS.

Your Sharepoint environment should be ready to rock and roll the Silverlight development.

My next post will cover a short Silverlight web part built and deployed to SharePoint. Stay Tuned!

Posted on by daniel
Filed under: Uncategorized | 1 Comment »

Absolutely Amazing Technology

Project Natal is an Xbox 360 add on device that uses a wii-like sensor/camera bar to interact with the real world. no controller is needed. you simply move and talk to the software. Milo, a software product coming to the Xbox is simply amazing. Watch the interaction between the actor and the game:

 

Posted on by daniel
Filed under: Uncategorized | 2 Comments »

Silverlight Presentation

I’ll be speaking at the West Michigan .Net User Group on June 9th.
Details:

Location:
GVSU Pew Campus
Kennedy Hall of Engineering
Room #330, Building #7

Time: 6:45 p.m.

Topic: Silverlight in the Enterprise

Summary:

In this session, we’ll move beyond the ‘What is Silverlight’ conversation and examine how the technology can be embraced by enterprise application developers. We’ll discuss leveraging the tools that you may already have in the workplace and how Silverlight can fit into typical n-tier architecture. A majority of the presentation will involve Silverlight coding, demonstrating a few of the various tasks that we often find ourselves repeating when building corporate applications (Grids, Data Entry, Validation, etc…)

hope to see you there!

Posted on by daniel
Filed under: Uncategorized | No Comments »

YACW7T - Number 2

Yet Another Cool Windows 7 Thing - Number 2:

I keep my eeePC 1000he netbook readily available during most of the day. If you’re like me, you occassionally like to jot down ideas and solutions as they come to you. Typically its an inconvenient time when this happens as inspiration knows no schedule. I’ve been known to keep various moleskin notebooks strewn about that I purpose for just such an event. And that’s great for ease of access but horrible for recall and actionable manipulation of the text. I’ve always wished that I could simply jot things down on my Sony laptop, but by the time the pc started, got logged in, waited for all the junk services to start; I would have grown frustrated with the wait or simply forgot what it was I felt inspired to write in the first place.

ENTER Windows 7 on a Netbook!

I was able to enter this small note in less than 15 seconds:

Now maybe that doesn’t really impress you much, as you probably just see a postit on my desktop.
(Postits come with Win7, btw).
But check this out - The netbook was laying next to the bed in sleep mode.
It took less than 15 seconds for me to open the lid, log in to the operating system, type my note and close the lid.
For brainstorming on the fly…thats amazing! The netbook becomes more than a pc…its more like..ummm…a notebook. The paper kind even.

So there you have it. Simple post about a simple thing. But for me..its monumental for where I hoped personal technology would be. 

And in other news:
I spotted some Microsoft MCTS training books on the bookshelf of Sheldon and Leonards apartment (Big Bang Theory television show):

You have to be both a programming nerd and a fan of this show to really appreciate the find.

Posted on by daniel
Filed under: Uncategorized | No Comments »

funny (old) hockey commercial

Posted on by daniel
Filed under: Uncategorized | No Comments »
continue: Next