Leading by Following

Image borrowed from here

I thought it was somewhat self-serving when my manager sent out an email to the team with a link to an article at Forbes about being a great follower, but it was actually a very good read. The article, titled “The 11 Leadership Secrets You’ve Never Heard About,” makes the point that the leaders among us are simply the best followers, and it reminds us that our leaders have bosses and are followers in their own right. The list of leadership secrets is about being a great follower, and it’s an excellent list.

There were a few items that really spoke to me, and it’s true: these are the things the leaders of tomorrow are doing today.

Great Followers are Great Communicators

I loved this one. (Not surprising, as somebody who clearly values communication!) More specifically, I love the idea of proactively providing relevant information. If I see something and dig into it, totaling numbers and gathering statistics, I’m going to send an email with that information displayed several different ways. Here’s a table. Here’s a graph. Here’s a 3D graph! When somebody else on the team sends out an email with data they’ve collected in a cool graph, I’m absolutely delighted.

And, to the point of the article, I’ve never received an email of this nature from somebody that I didn’t consider a leader on the team.

Great Followers are Goal Driven

There’s a lot of material out there about being successful by setting goals for yourself and being goal-oriented. Earlier in my career, I wanted to embrace this and set goals for myself, but I felt like I was a really bad goal-setter. I simply didn’t know what kinds of goals to set for myself! I like the text in the article on this item because it doesn’t just say, “set goals for yourself.” Instead, it talks about working forward versus working backward.

Great followers reason backwards: they use future goals to prioritize today’s “activity.” Poor followers reason forward: They react to their in-box and email in the forlorn hope that just staying busy will magically produce results somewhere “down the road.”

Well put! The amount of work will always be unending. If you focus solely on fighting it down, you’ll probably be stuck in the same role doing the same thing for longer than you care for. Conversely, if you can identify ways to improve the processes of today down the road, you can steer your activities in the right direction. Once you achieve the goal, you can get on to the next thing!

Great Followers Show Don’t Tell

This is another one that’s near and dear to my heart. I get pulled into a lot of what-do-you-think, consultation-type meetings. In those meetings, I’ll throw out ideas that seem like they should work. Energized by a potentially great idea, I often start putting together a proof-of-concept as soon as I get back to my desk. It’s exciting to me to send an email with a fully-functional example of what I suggested might work an hour before. Unfortunately, based on the amount of emails like this that I receive, I don’t think many people are doing this. Additionally, showing up to a meeting where it’s clear that you’ve put effort into your preparation will impress the room. Take time to prepare a PowerPoint presentation or print handouts on the topic you’re presenting or might be consulted on. You’ll be better prepared, and it’ll be noticed by peers and leadership, alike.

Great Followers Offer Solutions

This one’s definitely a favorite. Do you have a problem? What can you do about it? What are the advantages and disadvantages of your options? This is decision-maker training. When you’re new at it, evaluate the situation and bring solutions along with your problems to your team leads and managers. You may not come up with the best option, but that’s a learning opportunity. Over time, you’ll learn how to identify the best options, making you a leader capable of finding the best options to other people’s problems: you’ll be down with OPP.

Great Followers are Loyal

I’ll comment on just one more item from the list, and that’s loyalty. The article points out that a great follower will go out of their way to make their boss look good, which really couldn’t be more true. (I was once again chuckling at the self-serving nature of this statement in the article sent from my boss…) It’s true though; a great follower will take pride in making their team great. When it’s time to look for emerging leaders, the best teams are probably a good place to start.

The rest of the list is very good, too, and these were just my favorites. Check out the article and think about how you can improve as a follower. Focus on being a great follower, and you’ll naturally evolve into a leader.

Advertisements

Windows Workflow 4 Designer WPF Application

One of the coolest things about Windows Workflow Foundation is the workflow designer. It’s visual programming.  You drag and drop your components onto the design surface and configure the properties of each module to create a functional application. Microsoft makes it easy to re-host the workflow designer in your own applications, providing you with an easy way to include customization and configuration tools for your workflows.

I found a great bare-bones tutorial at MSDNRehosting the Workflow Designer.

There’s some important functionality missing from this tutorial, though. There are no mechanisms for opening or saving workflow files, and the toolbox is only populated with two controls. So, I’ve taken the MSDN tutorial, compressed the steps, and added some additional key functionality.

  1. Create a new WPF Application. I called mine “WorkflowEditor.”
  2. Add references
    • System.Activities
    • System.Activities.Core.Presentation
    • System.Activities.Presentation
  3. Copy/paste the XAML below into MainWindow.xaml
  4. Copy/paste the code-behind below into MainWindow.xaml.cs

That’s it! Once you’re this far, you should be able to run the program. If you’re looking for a more in-depth, step-by-step explanation of the code, follow the link above to the MSDN tutorial. The only differences below are that I added some reflection code to extract the “standard” workflow activities, and I added Open and Save buttons.

<Window x:Class="adamprescott.net.WorkflowEditor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="500" Width="800">
    <Grid Name="grid1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="4*" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="36" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <ToolBar Grid.Row="0" Grid.ColumnSpan="3">
            <Button Click="OnOpenClick">Load</Button>
            <Button Click="OnSaveClick">Save</Button>
        </ToolBar>
    </Grid>
</Window>
using System;
using System.Activities;
using System.Activities.Core.Presentation;
using System.Activities.Presentation;
using System.Activities.Presentation.Toolbox;
using System.Activities.Statements;
using System.Linq;
using System.Reflection;
using System.Windows.Controls;
using Microsoft.Win32;

namespace adamprescott.net.WorkflowEditor
{
    public partial class MainWindow
    {
        private WorkflowDesigner _designer;

        public MainWindow()
        {
            InitializeComponent();
            RegisterMetadata();
            InitializeDesigner();
            AddToolBox();
        }

        private void AddDesigner()
        {
            _designer = new WorkflowDesigner();
            Grid.SetColumn(_designer.View, 1);
            Grid.SetRow(_designer.View, 1);
            grid1.Children.Add(_designer.View);
        }

        private void RegisterMetadata()
        {
            var dm = new DesignerMetadata();
            dm.Register();
        }

        private ToolboxControl GetToolboxControl()
        {
            var toolbox = new ToolboxControl();
            PopulateToolboxCategoryFromAssembly(toolbox, typeof(Assign).Assembly, "Standard");
            return toolbox;
        }

        private void PopulateToolboxCategoryFromAssembly(ToolboxControl toolbox, Assembly assembly, string categoryName)
        {
            var tools = assembly.GetTypes()
                .Where(t => t.IsSubclassOf(typeof(Activity))
                    && t.IsPublic
                    && !t.IsAbstract
                    && HasParameterlessContructor(t))
                .Select(t => new ToolboxItemWrapper(t.FullName, t.Assembly.FullName, null, t.Name))
                .OrderBy(t => t.DisplayName);

            var category = new ToolboxCategory(categoryName);
            foreach (var t in tools)
            {
                category.Add(t);
            }
            toolbox.Categories.Add(category);
        }

        private bool HasParameterlessContructor(Type t)
        {
            var ctors = t.GetConstructors();
            var parameterless = ctors.Where(c => c.GetParameters().Count() == 0)
                .FirstOrDefault();
            return parameterless != null;
        }

        private void AddToolBox()
        {
            var tc = GetToolboxControl();
            Grid.SetColumn(tc, 0);
            Grid.SetRow(tc, 1);
            grid1.Children.Add(tc);
        }

        private void AddPropertyInspector()
        {
            Grid.SetColumn(_designer.PropertyInspectorView, 2);
            Grid.SetRow(_designer.PropertyInspectorView, 1);
            grid1.Children.Add(_designer.PropertyInspectorView);
        }

        private void OnOpenClick(object sender, System.Windows.RoutedEventArgs e)
        {
            var dlg = new OpenFileDialog();
            if (dlg.ShowDialog().Value)
            {
                InitializeDesigner();
                _designer.Load(dlg.FileName);
            }
        }

        private void OnSaveClick(object sender, System.Windows.RoutedEventArgs e)
        {
            var dlg = new SaveFileDialog();
            if (dlg.ShowDialog().Value)
            {
                _designer.Save(dlg.FileName);
            }
        }

        private void InitializeDesigner()
        {
            AddDesigner();
            AddPropertyInspector();
        }
    }
}

Check the Status of a Windows Service in C#

If you have an application that has a dependency on a Windows service, your application may need to be aware of the status of the service. Luckily, the .Net Framework makes this very easy for us to do.

Here’s how you can retrieve the status of a service:

var serviceName = "IISADMIN";
var sc = new ServiceController(serviceName);

Console.WriteLine("Status: {0}", sc.Status);

If you need your application to wait for a particular status, that’s very easy, too!

Console.WriteLine("Blocking until service is running...");
sc.WaitForStatus(ServiceControllerStatus.Running);

Note that WaitForStatus only blocks when the status doesn’t match the value provided. In other words, if the service in the above example is already running, it will not block.

More information about the ServiceController class can be found here.

Filter Pending Changes By Solution in TFS

I just learned about a neat feature in Visual Studio’s Pending Changes window: filter by solution. If you’re viewing pending changes and have a solution open, you can use this toggle button to filter the list of files in your Pending Changes to only files included in that solution. This is a great way to ensure you’re only checking in changes that are related to the task or story that you’re working on when multitasking or managing several works-in-progress.

 

Spotify launches free and unlimited on Android | Radio & Television Business Report

Hooray! Pandora has always been my favorite music streaming service, but I must admit that I was jealous when Spotify radio was released for iPhone and not Android. Spotify radio let’s you save favorites for playback later–a terrific feature that’s missing from the free version of Pandora.

Spotify launches free and unlimited on Android | Radio & Television Business Report.

Microsoft Introduces Outlook.com

As I was catching up on my current events on CNN, I noticed an interesting headline on their bottom line: “Microsoft replaces Hotmail with Outlook.com.” After I missed out on the ideal Twitter name, I made a decision to always sign up for new services right away regardless of how much I think I’ll use them. So, with the announcement of Outlook.com, I wanted to get over there ASAP and stake my claim! Unfortunately, “adam@outlook.com” was already taken, but I still  took the chance to look around and explore some of the features.

Overall, the UI is quite nice. It feels very crisp and clean, much like the upcoming Office 2013. I wasn’t a Hotmail user, but my Live account was already setup for it, although I wasn’t receiving any email since I hadn’t connected any of my existing email accounts. As I said before, my goal was to get my “@outlook.com” email addresses, and it took me a minute to figure out how. You need to click “More mail settings” under the configuration menu in the upper right corner, and then click “Create a Outlook alias.” (C’mon, Microsoft–do a grammar check! Create an Outlook alias!) You’ll be taken to a screen with a [textbox]@outlook.com prompt, and you can claim your name. Note that you can create multiple aliases, so you may want to grab firstname.lastname and firstnamelastname or whatever other nicknames you might want. (I was hoping they’d make period placement in email addresses irrelevant like gmail, but it appears they didn’t.)

I’ve only spent a few minutes with it at this point, but here’s what I like so far:

  • Multiple @outlook.com aliases
  • Drag and drop messages and folders
  • Keyboard shortcuts
  • Clean UI/look and feel

If you’re a fan of the offline Outlook experience, you’ll probably really like Outlook.com. It’s definitely worth checking out!